can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[livejournal] r21791: LJSUP-11904: Disable image wizards in RT...

Committer: dpetrov
LJSUP-11904: Disable image wizards in RTE and HTML tabs at update.bml
U   trunk/cgi-bin/LJ/Widget/EntryForm.pm
U   trunk/htdocs/js/ck/plugins/image/dialogs/image.js
U   trunk/htdocs/js/entry.js
Modified: trunk/cgi-bin/LJ/Widget/EntryForm.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/EntryForm.pm	2012-04-24 13:09:39 UTC (rev 21790)
+++ trunk/cgi-bin/LJ/Widget/EntryForm.pm	2012-04-24 14:02:40 UTC (rev 21791)
@@ -806,7 +806,7 @@
         </li>
     } : "";
 
-    $insert_image .= ($remote && ($remote->prop ('fotki_migration_status') == LJ::Pics::Migration::MIGRATION_STATUS_DONE()) && $remote->can_use_ljphoto) ? qq{
+    $insert_image .= ($remote && ($remote->prop ('fotki_migration_status') != LJ::Pics::Migration::MIGRATION_STATUS_NONE()) && $remote->can_use_ljphoto) ? qq{
     <li class='image'>
         <a
             href='javascript:void(0);'

Modified: trunk/htdocs/js/ck/plugins/image/dialogs/image.js
===================================================================
--- trunk/htdocs/js/ck/plugins/image/dialogs/image.js	2012-04-24 13:09:39 UTC (rev 21790)
+++ trunk/htdocs/js/ck/plugins/image/dialogs/image.js	2012-04-24 14:02:40 UTC (rev 21791)
@@ -261,6 +261,9 @@
 			previewLinkId = numbering('previewLink'),
 			previewImageId = numbering('previewImage');
 
+		//show all four tabs only if old photohosting is enabled
+		var showFullDialog = window.ljphotoUploadEnabled && window.ljphotoMigrationStatus === LJ.getConst('LJPHOTO_MIGRATION_NONE');
+
 		return {
 			title : editor.lang.image[ dialogType == 'image' ? 'title' : 'titleButton' ],
 			minWidth : 480,
@@ -1063,7 +1066,7 @@
 							}
 						]
 				},
-				{
+				((showFullDialog) ? {
 					id : 'Upload',
 					hidden : false,
 					filebrowser : 'uploadButton',
@@ -1075,8 +1078,8 @@
 							html: '<iframe name="rteUpload" id="rteUpload" src="' + Site.siteroot + '/imguploadrte.bml?only_upload=1" bgcolor="transparent" frameborder="0" scrolling="no" style="width: 99%; height: 340px;"></iframe>'
 						}
 					]
-				},
-				{
+				} : null),
+				((showFullDialog) ? {
 					id : 'Photobucket',
 					hidden : false,
 					label : 'Photobucket',
@@ -1087,7 +1090,7 @@
 							html: '<iframe name="jwidget" id="jwidget" src="http://photobucket.com/svc/jwidget.php?width=360&height=400&largeThumb=true&pbaffsite=' + pb_affsite_id + '&bg=%23FFFFFF&border=false&bordercolor=%23000000' + cb_url + '&linkType=url&textcolor=%23000000&linkcolor=%230000FF&media=image&btntxt=Paste&dimensions=false&promo=false" bgcolor="transparent" frameborder="0" scrolling="no" style="width: 99%; height: 440px;"></iframe>'
 						}
 					]
-				}
+				} : null)
 			]
 		};
 	};

Modified: trunk/htdocs/js/entry.js
===================================================================
--- trunk/htdocs/js/entry.js	2012-04-24 13:09:39 UTC (rev 21790)
+++ trunk/htdocs/js/entry.js	2012-04-24 14:02:40 UTC (rev 21791)
@@ -944,7 +944,7 @@
 
 	return function (type, data) {
 		//we should show old dialog only when migration did not start and new photohosting is disabled
-		if (window.ljphotoUploadEnabled || window.ljphotoMigrationStatus !== LJ.getConst('LJPHOTO_MIGRATION_NONE') || type === 'add') {
+		if (!window.ljphotoEnabled || window.ljphotoMigrationStatus !== LJ.getConst('LJPHOTO_MIGRATION_NONE') || type === 'add') {
 			var jPhotoUploader = jQuery('#updateForm');
 
 			if (type == 'add' && data) {

Tags: can3p, dpetrov, js, livejournal, pm
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