r80632 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80631‎ | r80632 | r80633 >
Date:17:09, 20 January 2011
Author:husky
Status:ok
Tags:
Comment:
made insertions possible in visual mode
Modified paths:
  • /trunk/tools/wp-photocommons/index.php (modified) (history)
  • /trunk/tools/wp-photocommons/js/admin.js (modified) (history)
  • /trunk/tools/wp-photocommons/js/search.js (modified) (history)

Diff [purge]

Index: trunk/tools/wp-photocommons/js/search.js
@@ -2,6 +2,7 @@
33 window.log = function( a, b ) {
44 //console.log( a, b );
55 };
 6+
67 if ( !window.Photocommons ) {
78 window.Photocommons = {};
89 }
Index: trunk/tools/wp-photocommons/js/admin.js
@@ -25,9 +25,19 @@
2626
2727 $("#wp-photocommons-images img").live('click', function() {
2828 var file = $(this).attr('data-filename'),
 29+ shortcode = '[photocommons file="' + file + '" size="300"]' + "\n";
 30+
 31+ // Depending on whether we are in Wysiwyg or HTML mode we
 32+ // do a different insert
 33+ if ($("#edButtonHTML").hasClass('active')) {
 34+ // HTML editor
2935 cnt = $("#content").val();
 36+ $("#content").val( + cnt);
 37+ } else {
 38+ // Wysiwyg
 39+ tinyMCE.execCommand('mceInsertContent', false, shortcode);
 40+ }
3041
31 - $("#content").val('[photocommons file="' + file + '" size="300"]' + "\n" + cnt);
3242 $self.dialog('close');
3343 });
3444 });
Index: trunk/tools/wp-photocommons/index.php
@@ -4,7 +4,7 @@
55 Plugin URI: http://www.mediawiki.org/wiki/Photocommons
66 Description: Search and add free images from Wikimedia Commons directly in your blog
77 Author: Hay Kranen, Timo Tijhof
8 -Version: 1.0
 8+Version: 0.1-alpha
99 Author URI: http://www.mediawiki.org/wiki/Photocommons
1010 */
1111

Status & tagging log