X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/11be8dc178e77d0b46189bbd8e33a216a9b90942..refs/tags/wordpress-2.8:/wp-admin/js/gallery.js diff --git a/wp-admin/js/gallery.js b/wp-admin/js/gallery.js index c0be92f8..17fa4386 100644 --- a/wp-admin/js/gallery.js +++ b/wp-admin/js/gallery.js @@ -1,175 +1 @@ -jQuery(function($) { - var gallerySortable; - var gallerySortableInit = function() { - gallerySortable = $('#media-items').sortable( { - items: '.media-item', - placeholder: 'sorthelper', - axis: 'y', - distance: 2, - update: galleryReorder - } ); - } - - // When an update has occurred, adjust the order for each item - var galleryReorder = function(e, sort) { - jQuery.each(sort['element'].sortable('toArray'), function(i, id) { - jQuery('#' + id + ' .menu_order input')[0].value = (1+i); - }); - } - - // initialize sortable - gallerySortableInit(); -}); - -jQuery(document).ready(function($){ - $('.menu_order_input').each(function(){ - if ( this.value == '0' ) this.value = ''; - }); - - if ( $('#media-items>*').length > 1 ) { - var w = wpgallery.getWin(); - - $('#save-all, #gallery-settings').show(); - if ( typeof w.tinyMCE != 'undefined' && w.tinyMCE.activeEditor && ! w.tinyMCE.activeEditor.isHidden() ) { - wpgallery.mcemode = true; - wpgallery.init(); - } else { - $('#insert-gallery').show(); - } - } -}); - -jQuery(window).unload( function () { tinymce = tinyMCE = wpgallery = null; } ); // Cleanup - -/* gallery settings */ -var tinymce = null, tinyMCE; - -var wpgallery = { - mcemode : false, - editor : {}, - dom : {}, - is_update : false, - el : {}, - - I : function(e) { - return document.getElementById(e); - }, - - init: function() { - var t = this, li, q, i, it, w = t.getWin(); - - if ( ! t.mcemode ) return; - - li = ('' + document.location.search).replace(/^\?/, '').split('&'); - q = {}; - for (i=0; i*").length>1){a=wpgallery.getWin();c("#save-all, #gallery-settings").show();if(typeof a.tinyMCE!="undefined"&&a.tinyMCE.activeEditor&&!a.tinyMCE.activeEditor.isHidden()){wpgallery.mcemode=true;wpgallery.init()}else{c("#insert-gallery").show()}}});jQuery(window).unload(function(){tinymce=tinyMCE=wpgallery=null});var tinymce=null,tinyMCE,wpgallery;wpgallery={mcemode:false,editor:{},dom:{},is_update:false,el:{},I:function(a){return document.getElementById(a)},init:function(){var d=this,a,f,c,e,b=d.getWin();if(!d.mcemode){return}a=(""+document.location.search).replace(/^\?/,"").split("&");f={};for(c=0;c