Просмотр исходного кода

Add the markItUp editor to the Bookmarklet and some style fixes

pecesama 16 лет назад
Родитель
Сommit
6d9bde1a85
3 измененных файлов с 30 добавлено и 8 удалено
  1. 14 6
      admin/bm.php
  2. 11 0
      admin/css/style.css
  3. 5 2
      admin/index.php

+ 14 - 6
admin/bm.php Просмотреть файл

@@ -55,12 +55,10 @@ if ($user->isAdmin()) {
55 55
 		if (!get_magic_quotes_gpc()) {
56 56
 			$_POST["title"] = addslashes($_POST["title"]);
57 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 63
 		if ($tumble->addPost($_POST)) {
66 64
 			$input = array("{type}");
@@ -109,7 +107,17 @@ if ($user->isAdmin()) {
109 107
 		<meta name="generator" content="gelato cms <?php echo version();?>" />
110 108
 		<title>gelato :: <?php echo __("bookmarklet")?></title>
111 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 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 121
 		<style type="text/css" media="screen">
114 122
 			@import "<?php echo $conf->urlGelato;?>/admin/css/style.css";
115 123
 		</style>

+ 11 - 0
admin/css/style.css Просмотреть файл

@@ -110,6 +110,17 @@ fieldset.install input.txt{width:468px;}
110 110
 a.linkFrm, a.linkFrm:link, a.linkFrm:visited, a.linkFrm:active{ color:#297aab; text-decoration:none; outline:none;}
111 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 124
 /* Feeds */
114 125
 
115 126
 #feedlist{}

+ 5 - 2
admin/index.php Просмотреть файл

@@ -319,8 +319,11 @@ if ($user->isAuthenticated()) {
319 319
 										&nbsp;&nbsp;&nbsp;&nbsp;&lt;blockquote&gt;
320 320
                                         &lt;code&gt; &lt;pre&gt; &lt;img&gt;
321 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 327
 								<p>
325 328
 									<input class="btn" type="submit" name="btnAdd" value="<?php echo ($isEdition) ? "Modify" : "Create"; ?> post" />
326 329
 								</p>