Aralot (aralot) wrote in changelog,
Aralot
aralot
changelog

[livejournal] r19587: LJSUP-9380: User can view new PhotoHosti...

Committer: szhirkov
LJSUP-9380: User can view new PhotoHosting
U   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'
 			});
 

Tags: aralot, js, livejournal
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments