Browse Source

Add the markItUp editor to the Bookmarklet and some style fixes

pecesama 16 years ago
parent
commit
6d9bde1a85
3 changed files with 30 additions and 8 deletions
  1. 14 6
      admin/bm.php
  2. 11 0
      admin/css/style.css
  3. 5 2
      admin/index.php

+ 14 - 6
admin/bm.php View File

55
 		if (!get_magic_quotes_gpc()) {
55
 		if (!get_magic_quotes_gpc()) {
56
 			$_POST["title"] = addslashes($_POST["title"]);
56
 			$_POST["title"] = addslashes($_POST["title"]);
57
 			$_POST["description"] = addslashes($_POST["description"]);
57
 			$_POST["description"] = addslashes($_POST["description"]);
58
-		}
59
-
60
-		$textile = new Textile();
61
-
62
-		$_POST["title"] = $textile->TextileThis(removeBadTags($_POST["title"]));
63
-		$_POST["description"] = $textile->TextileThis(removeBadTags($_POST["description"]));
58
+		}		
59
+		
60
+		$_POST["title"] = removeBadTags($_POST["title"],true);
61
+		$_POST["description"] = removeBadTags($_POST["description"]);
64
 
62
 
65
 		if ($tumble->addPost($_POST)) {
63
 		if ($tumble->addPost($_POST)) {
66
 			$input = array("{type}");
64
 			$input = array("{type}");
109
 		<meta name="generator" content="gelato cms <?php echo version();?>" />
107
 		<meta name="generator" content="gelato cms <?php echo version();?>" />
110
 		<title>gelato :: <?php echo __("bookmarklet")?></title>
108
 		<title>gelato :: <?php echo __("bookmarklet")?></title>
111
 		<link rel="shortcut icon" href="<?php echo $conf->urlGelato;?>/images/favicon.ico" />
109
 		<link rel="shortcut icon" href="<?php echo $conf->urlGelato;?>/images/favicon.ico" />
110
+        <script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/jquery.js"></script>
112
 		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/tools.js"></script>
111
 		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/tools.js"></script>
112
+        <script type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/markitup/jquery.markitup.pack.js"></script>
113
+		<script type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/markitup/sets/html/set.js"></script>			
114
+        <link rel="stylesheet" type="text/css" href="<?php echo $conf->urlGelato;?>/admin/scripts/markitup/skins/simple/style.css" />
115
+        <link rel="stylesheet" type="text/css" href="<?php echo $conf->urlGelato;?>/admin/scripts/markitup/sets/html/style.css" />			
116
+        <script type="text/javascript" >
117
+           $(document).ready(function() {
118
+              $("#description").markItUp(my_html);
119
+           });
120
+        </script>
113
 		<style type="text/css" media="screen">
121
 		<style type="text/css" media="screen">
114
 			@import "<?php echo $conf->urlGelato;?>/admin/css/style.css";
122
 			@import "<?php echo $conf->urlGelato;?>/admin/css/style.css";
115
 		</style>
123
 		</style>

+ 11 - 0
admin/css/style.css View File

110
 a.linkFrm, a.linkFrm:link, a.linkFrm:visited, a.linkFrm:active{ color:#297aab; text-decoration:none; outline:none;}
110
 a.linkFrm, a.linkFrm:link, a.linkFrm:visited, a.linkFrm:active{ color:#297aab; text-decoration:none; outline:none;}
111
 a.linkFrm:hover{ text-decoration:underline; color:#297aab;  outline:none;}
111
 a.linkFrm:hover{ text-decoration:underline; color:#297aab;  outline:none;}
112
 
112
 
113
+.bookmarklet {
114
+ 	font-weight:bold; padding: 1px 2px;
115
+ 	border: 2px solid #888;
116
+	background-color: #eee; text-decoration:none;
117
+}
118
+
119
+.bookmarklet:hover {
120
+	background-color: #6FA6EA; text-decoration:none;
121
+}
122
+
123
+
113
 /* Feeds */
124
 /* Feeds */
114
 
125
 
115
 #feedlist{}
126
 #feedlist{}

+ 5 - 2
admin/index.php View File

319
 										&nbsp;&nbsp;&nbsp;&nbsp;&lt;blockquote&gt;
319
 										&nbsp;&nbsp;&nbsp;&nbsp;&lt;blockquote&gt;
320
                                         &lt;code&gt; &lt;pre&gt; &lt;img&gt;
320
                                         &lt;code&gt; &lt;pre&gt; &lt;img&gt;
321
 										<code>
321
 										<code>
322
-										<br />
323
-                                        Bookmarklet - <a href="javascript:var w; setTimeout('w.focus()',100);w=window.open('<?php echo $conf->urlGelato; ?>/admin/bm.php?url='+encodeURIComponent(location.href)+'&sel='+encodeURIComponent(window.getSelection()),'bookmarklet','toolbar=0,resizable=0,status=1,width=650,height=460,dependent=yes' ); w.focus();"><?php echo __("add to gelato")?></a>                                    </span>								</p>
322
+										<br /><br />
323
+                                        Bookmarklet - <a class="bookmarklet" title="<?php echo __("Drag to the Bookmarks Toolbar")?>" href="javascript:var w; setTimeout('w.focus()',100);w=window.open('<?php echo $conf->urlGelato; ?>/admin/bm.php?url='+encodeURIComponent(location.href)+'&sel='+encodeURIComponent(window.getSelection()),'bookmarklet','toolbar=0,resizable=0,status=1,width=650,height=540,dependent=yes' ); w.focus();"><?php echo __("add to gelato")?></a>
324
+                                        <br /><br />
325
+                                	</span>
326
+                                </p>
324
 								<p>
327
 								<p>
325
 									<input class="btn" type="submit" name="btnAdd" value="<?php echo ($isEdition) ? "Modify" : "Create"; ?> post" />
328
 									<input class="btn" type="submit" name="btnAdd" value="<?php echo ($isEdition) ? "Modify" : "Create"; ?> post" />
326
 								</p>
329
 								</p>