- EA8F81F08CB7F4D05F0AC7E3EDE78493621EA774E52954EF001B501E22F11D9F8A1DAFEAA5F2291C7B175D5514750C68772C703CCC51261848F85A06C1C740E6+ 238AA7E252E5C106B396B8EAA65D155D70C48C09E84BA23AB408364962B7FA67F345CBC7C303D6DC47B6D4E64EDD71B2522B34793BD9954EE1BA72F64F140DD8mp-wp/wp-admin/js/gallery.js(30 . 22)(30 . 11)
8088 var w = wpgallery.getWin();
8089
8090 $('#save-all, #gallery-settings').show();
8091 if ( typeof w.tinyMCE != 'undefined' && w.tinyMCE.activeEditor && ! w.tinyMCE.activeEditor.isHidden() ) {
8092 wpgallery.mcemode = true;
8093 wpgallery.init();
8094 } else {
8095 $('#insert-gallery').show();
8096 }
8097 $('#insert-gallery').show();
8098 }
8099 });
8100
8101 jQuery(window).unload( function () { tinymce = tinyMCE = wpgallery = null; } ); // Cleanup
8102
8103 /* gallery settings */
8104 var tinymce = null, tinyMCE;
8105
8106 var wpgallery = {
8107 mcemode : false,
8108 editor : {},
8109 dom : {},
8110 is_update : false,
(55 . 98)(44 . 10)
8112 return document.getElementById(e);
8113 },
8114
8115 init: function() {
8116 var t = this, li, q, i, it, w = t.getWin();
8117
8118 if ( ! t.mcemode ) return;
8119
8120 li = ('' + document.location.search).replace(/^\?/, '').split('&');
8121 q = {};
8122 for (i=0; i<li.length; i++) {
8123 it = li[i].split('=');
8124 q[unescape(it[0])] = unescape(it[1]);
8125 }
8126
8127 if (q.mce_rdomain)
8128 document.domain = q.mce_rdomain;
8129
8130 // Find window & API
8131 tinymce = w.tinymce;
8132 tinyMCE = w.tinyMCE;
8133 t.editor = tinymce.EditorManager.activeEditor;
8134
8135 t.setup();
8136 },
8137
8138 getWin : function() {
8139 return window.dialogArguments || opener || parent || top;
8140 },
8141
8142 restoreSelection : function() {
8143 var t = this;
8144
8145 if (tinymce.isIE)
8146 t.editor.selection.moveToBookmark(t.editor.windowManager.bookmark);
8147 },
8148
8149 setup : function() {
8150 var t = this, a, f = document.forms[0], ed = t.editor, el, g;
8151 if ( ! t.mcemode ) return;
8152
8153 t.restoreSelection();
8154 t.el = ed.selection.getNode();
8155
8156 if ( t.el.nodeName != 'IMG' || ! ed.dom.hasClass(t.el, 'wpGallery') ) {
8157 if ( (g = ed.dom.select('img.wpGallery')) && g[0] ) {
8158 t.el = g[0];
8159 } else {
8160 if ( getUserSetting('galfile') == '1' ) t.I('linkto-file').checked = "checked";
8161 if ( getUserSetting('galdesc') == '1' ) t.I('order-desc').checked = "checked";
8162 if ( getUserSetting('galcols') ) t.I('columns').value = getUserSetting('galcols');
8163 if ( getUserSetting('galord') ) t.I('orderby').value = getUserSetting('galord');
8164 jQuery('#insert-gallery').show();
8165 return;
8166 }
8167 }
8168
8169 a = ed.dom.getAttrib(t.el, 'title');
8170 a = ed.dom.decode(a);
8171
8172 if ( a ) {
8173 jQuery('#update-gallery').show();
8174 t.is_update = true;
8175
8176 var columns = a.match(/columns=['"]([0-9]+)['"]/), link = a.match(/link=['"]([^'"]+)['"]/i);
8177 var order = a.match(/order=['"]([^'"]+)['"]/i), orderby = a.match(/orderby=['"]([^'"]+)['"]/i), all = '';
8178
8179 if ( link && link[1] ) t.I('linkto-file').checked = "checked";
8180 if ( order && order[1] ) t.I('order-desc').checked = "checked";
8181 if ( columns && columns[1] ) t.I('columns').value = ''+columns[1];
8182 if ( orderby && orderby[1] ) t.I('orderby').value = orderby[1];
8183 } else {
8184 jQuery('#insert-gallery').show();
8185 }
8186 },
8187
8188 update : function() {
8189 var t = this, ed = t.editor, el, all = '';
8190
8191 if ( ! t.mcemode || ! t.is_update ) {
8192 var s = '[gallery'+t.getSettings()+']';
8193 t.getWin().send_to_editor(s);
8194 return;
8195 }
8196
8197 if (t.el.nodeName != 'IMG') return;
8198
8199 all = ed.dom.decode(ed.dom.getAttrib(t.el, 'title'));
8200 all = all.replace(/\s*(order|link|columns|orderby)=['"]([^'"]+)['"]/gi, '');
8201 all += t.getSettings();
8202
8203 ed.dom.setAttrib(t.el, 'title', all);
8204 t.getWin().tb_remove();
8205 },
8206
8207 getSettings : function() {
8208 var I = this.I, s = '';
8209