Revision: 1386
Author: magike.net
Date: Mon Mar 15 23:02:15 2010
Log: 给插入附件的js函数末尾增加一个cid参数
http://code.google.com/p/typecho/source/detail?r=1386

Modified:
  /trunk/admin/editor-js.php
  /trunk/admin/file-upload.php

=======================================
--- /trunk/admin/editor-js.php  Sun Oct 18 00:33:52 2009
+++ /trunk/admin/editor-js.php  Mon Mar 15 23:02:15 2010
@@ -10,12 +10,12 @@
      });

      /** 这两个函数在插件中必须实现 */
-    var insertImageToEditor = function (title, url, link) {
+    var insertImageToEditor = function (title, url, link, cid) {
          textEditor.setContent('<a href="' + link + '" title="' + title  
+ '"><img src="' + url + '" alt="' + title + '" /></a>', '');
          new  
Fx.Scroll(window).toElement($(document).getElement('textarea#text'));
      };

-    var insertLinkToEditor = function (title, url, link) {
+    var insertLinkToEditor = function (title, url, link, cid) {
          textEditor.setContent('<a href="' + url + '" title="' + title  
+ '">' + title + '</a>', '');
          new  
Fx.Scroll(window).toElement($(document).getElement('textarea#text'));
      };
=======================================
--- /trunk/admin/file-upload.php        Tue Jan 19 23:31:14 2010
+++ /trunk/admin/file-upload.php        Mon Mar 15 23:02:15 2010
@@ -85,9 +85,9 @@
          </strong>
          <small>
              <span class="insert" onclick="<?php if  
($attachment->attachment->isImage){
-                         
echo "insertImageToEditor('{$attachment->title}', 
'{$attachment->attachment->url}', '{$attachment->permalink}');";
+                         
echo "insertImageToEditor('{$attachment->title}', 
'{$attachment->attachment->url}', '{$attachment->permalink}',  
{$attachment->cid});";
                      } else {
-                         
echo "insertLinkToEditor('{$attachment->title}', 
'{$attachment->attachment->url}', '{$attachment->permalink}');";
+                         
echo "insertLinkToEditor('{$attachment->title}', 
'{$attachment->attachment->url}', '{$attachment->permalink}',  
{$attachment->cid});";
                      } ?>"><?php _e('插入'); ?></span>
              ,
              <span class="delete" onclick="deleteAttachment(<?php  
$attachment->cid(); ?>, this);"><?php _e('删除'); ?></span>
_______________________________________________
announce mailing list
[email protected]
http://lists.typecho.org/mailman/listinfo/announce

回复