Index: trunk/tools/wp-photocommons/js/search.js |
— | — | @@ -2,6 +2,7 @@ |
3 | 3 | window.log = function( a, b ) { |
4 | 4 | //console.log( a, b ); |
5 | 5 | }; |
| 6 | + |
6 | 7 | if ( !window.Photocommons ) { |
7 | 8 | window.Photocommons = {}; |
8 | 9 | } |
Index: trunk/tools/wp-photocommons/js/admin.js |
— | — | @@ -25,9 +25,19 @@ |
26 | 26 | |
27 | 27 | $("#wp-photocommons-images img").live('click', function() { |
28 | 28 | 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 |
29 | 35 | cnt = $("#content").val(); |
| 36 | + $("#content").val( + cnt); |
| 37 | + } else { |
| 38 | + // Wysiwyg |
| 39 | + tinyMCE.execCommand('mceInsertContent', false, shortcode); |
| 40 | + } |
30 | 41 | |
31 | | - $("#content").val('[photocommons file="' + file + '" size="300"]' + "\n" + cnt); |
32 | 42 | $self.dialog('close'); |
33 | 43 | }); |
34 | 44 | }); |
Index: trunk/tools/wp-photocommons/index.php |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | Plugin URI: http://www.mediawiki.org/wiki/Photocommons |
6 | 6 | Description: Search and add free images from Wikimedia Commons directly in your blog |
7 | 7 | Author: Hay Kranen, Timo Tijhof |
8 | | -Version: 1.0 |
| 8 | +Version: 0.1-alpha |
9 | 9 | Author URI: http://www.mediawiki.org/wiki/Photocommons |
10 | 10 | */ |
11 | 11 | |