Committer: szhirkov
LJSUP-9380: User can view new PhotoHostingU branches/fotki/htdocs/js/ck/plugins/livejournal/plugin.js
Modified: branches/fotki/htdocs/js/ck/plugins/livejournal/plugin.js =================================================================== --- branches/fotki/htdocs/js/ck/plugins/livejournal/plugin.js 2011-08-04 04:01:01 UTC (rev 19586) +++ branches/fotki/htdocs/js/ck/plugins/livejournal/plugin.js 2011-08-04 04:07:58 UTC (rev 19587) @@ -230,19 +230,27 @@ ////////// LJ Image Button ////////////// editor.addCommand('LJImage', { exec : function(editor){ - jQuery('#updateForm') - .photouploader({ - type: 'upload' - }) - .photouploader('show') - .bind('htmlready', function (event, html) { - editor.insertHtml(html); - }); + if (window.ljphotoEnabled){ + jQuery('#updateForm') + .photouploader({ + type: 'upload' + }) + .photouploader('show') + .bind('htmlready', function (event, html) { + editor.insertHtml(html); + }); + } else { + if (ljNoteData.LJImage.node){ + editor.getSelection().selectElement(ljNoteData.LJImage.node); + } + + editor.getCommand('image').exec(); + } } }); editor.ui.addButton('LJImage', { - label: 'Add Image', + label: editor.lang.common.imageButton, command: 'LJImage' });