wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[livejournal] r20509: LJSUP-10284: Fotki: ability to set image...

Committer: wisest-owl
LJSUP-10284: Fotki: ability to set images sequence with adding to an entry

U   trunk/cgi-bin/LJ/Widget/EntryForm.pm
Modified: trunk/cgi-bin/LJ/Widget/EntryForm.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/EntryForm.pm	2011-11-09 07:00:58 UTC (rev 20508)
+++ trunk/cgi-bin/LJ/Widget/EntryForm.pm	2011-11-09 07:15:09 UTC (rev 20509)
@@ -1651,26 +1651,40 @@
         my $insert_photos_json = LJ::JSON->to_json ( $insert_photos );
         $out .= <<JS;
 <script type="text/javascript">
-    jQuery('#updateForm')
-        .photouploader({
-            insertPhotosData: $insert_photos_json,
-            type: 'add'
-        })
-        .bind('htmlready', function (event) {
-            var html = event.htmlStrings,
-                editor;
+		var jSortable,
+			jPhotoUploader = jQuery('#updateForm');
 
-            if (window.switchedRteOn) {
-                editor = CKEDITOR.instances.draft;
+		jPhotoUploader.photouploader({
+					insertPhotosData: $insert_photos_json,
+					type: 'add'
+			})
+			.bind('htmlready', function (event) {
+					var html = event.htmlStrings,
+							editor;
 
-                for (var i = 0, l = html.length; i < l; i++) {
-                    editor.insertElement(new CKEDITOR.dom.element.createFromHtml(html[i], editor.document));
-                }
-            } else {
-                jQuery('#draft').val(jQuery('#draft').val() + html.join(' '));
-            }
-        })
-        .photouploader('show');
+					if (window.switchedRteOn) {
+							editor = CKEDITOR.instances.draft;
+
+							for (var i = 0, l = html.length; i < l; i++) {
+									editor.insertElement(new CKEDITOR.dom.element.createFromHtml(html[i], editor.document));
+							}
+					} else {
+							jQuery('#draft').val(jQuery('#draft').val() + html.join(' '));
+					}
+			})
+			.bind('removeitem', function () {
+				jSortable.sortable('refresh');
+			})
+			.photouploader('show');
+
+		jSortable = jQuery('.b-popup-pics-gallery-list');
+		jSortable.sortable({
+			stop: function() {
+				jPhotoUploader.photouploader('update');
+			}
+		});
+
+		jSortable.disableSelection();
 </script>
 JS
     }

Tags: livejournal, pm, wisest-owl
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