/**
* @output wp-admin/js/gallery.js
*/
/* global unescape, getUserSetting, setUserSetting, wpgallery, tinymce */
jQuery( function($) {
var gallerySortable, gallerySortableInit, sortIt, clearAll, w, desc = false;
gallerySortableInit = function() {
gallerySortable = $('#media-items').sortable( {
items: 'div.media-item',
placeholder: 'sorthelper',
axis: 'y',
distance: 2,
handle: 'div.filename',
stop: function() {
// When an update has occurred, adjust the order for each item.
var all = $('#media-items').sortable('toArray'), len = all.length;
$.each(all, function(i, id) {
var order = desc ? (len - i) : (1 + i);
$('#' + id + ' .menu_order input').val(order);
});
}
} );
};
sortIt = function() {
var all = $('.menu_order_input'), len = all.length;
all.each(function(i){
var order = desc ? (len - i) : (1 + i);
$(this).val(order);
});
};
clearAll = function(c) {
c = c || 0;
$('.menu_order_input').each( function() {
if ( this.value === '0' || c ) {
this.value = '';
}
});
};
$('#asc').on( 'click', function( e ) {
e.preventDefault();
desc = false;
sortIt();
});
$('#desc').on( 'click', function( e ) {
e.preventDefault();
desc = true;
sortIt();
});
$('#clear').on( 'click', function( e ) {
e.preventDefault();
clearAll(1);
});
$('#showall').on( 'click', function( e ) {
e.preventDefault();
$('#sort-buttons span a').toggle();
$('a.describe-toggle-on').hide();
$('a.describe-toggle-off, table.slidetoggle').show();
$('img.pinkynail').toggle(false);
});
$('#hideall').on( 'click', function( e ) {
e.preventDefault();
$('#sort-buttons span a').toggle();
$('a.describe-toggle-on').show();
$('a.describe-toggle-off, table.slidetoggle').hide();
$('img.pinkynail').toggle(true);
});
// Initialize sortable.
gallerySortableInit();
clearAll();
if ( $('#media-items>*').length > 1 ) {
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();
}
}
});
/* gallery settings */
window.tinymce = null;
window.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<li.length; i++) {
it = li[i].split('=');
q[unescape(it[0])] = unescape(it[1]);
}
if ( q.mce_rdomain ) {
document.domain = q.mce_rdomain;
}
// Find window & API.
window.tinymce = w.tinymce;
window.tinyMCE = w.tinyMCE;
t.editor = tinymce.EditorManager.activeEditor;
t.setup();
},
getWin : function() {
return window.dialogArguments || opener || parent || top;
},
setup : function() {
var t = this, a, ed = t.editor, g, columns, link, order, orderby;
if ( ! t.mcemode ) {
return;
}
t.el = ed.selection.getNode();
if ( t.el.nodeName !== 'IMG' || ! ed.dom.hasClass(t.el, 'wpGallery') ) {
if ( ( g = ed.dom.select('img.wpGallery') ) && g[0] ) {
t.el = g[0];
} else {
if ( getUserSetting('galfile') === '1' ) {
t.I('linkto-file').checked = 'checked';
}
if ( getUserSetting('galdesc') === '1' ) {
t.I('order-desc').checked = 'checked';
}
if ( getUserSetting('galcols') ) {
t.I('columns').value = getUserSetting('galcols');
}
if ( getUserSetting('galord') ) {
t.I('orderby').value = getUserSetting('galord');
}
jQuery('#insert-gallery').show();
return;
}
}
a = ed.dom.getAttrib(t.el, 'title');
a = ed.dom.decode(a);
if ( a ) {
jQuery('#update-gallery').show();
t.is_update = true;
columns = a.match(/columns=['"]([0-9]+)['"]/);
link = a.match(/link=['"]([^'"]+)['"]/i);
order = a.match(/order=['"]([^'"]+)['"]/i);
orderby = a.match(/orderby=['"]([^'"]+)['"]/i);
if ( link && link[1] ) {
t.I('linkto-file').checked = 'checked';
}
if ( order && order[1] ) {
t.I('order-desc').checked = 'checked';
}
if ( columns && columns[1] ) {
t.I('columns').value = '' + columns[1];
}
if ( orderby && orderby[1] ) {
t.I('orderby').value = orderby[1];
}
} else {
jQuery('#insert-gallery').show();
}
},
update : function() {
var t = this, ed = t.editor, all = '', s;
if ( ! t.mcemode || ! t.is_update ) {
s = '[gallery' + t.getSettings() + ']';
t.getWin().send_to_editor(s);
return;
}
if ( t.el.nodeName !== 'IMG' ) {
return;
}
all = ed.dom.decode( ed.dom.getAttrib( t.el, 'title' ) );
all = all.replace(/\s*(order|link|columns|orderby)=['"]([^'"]+)['"]/gi, '');
all += t.getSettings();
ed.dom.setAttrib(t.el, 'title', all);
t.getWin().tb_remove();
},
getSettings : function() {
var I = this.I, s = '';
if ( I('linkto-file').checked ) {
s += ' link="file"';
setUserSetting('galfile', '1');
}
if ( I('order-desc').checked ) {
s += ' order="DESC"';
setUserSetting('galdesc', '1');
}
if ( I('columns').value !== 3 ) {
s += ' columns="' + I('columns').value + '"';
setUserSetting('galcols', I('columns').value);
}
if ( I('orderby').value !== 'menu_order' ) {
s += ' orderby="' + I('orderby').value + '"';
setUserSetting('galord', I('orderby').value);
}
return s;
}
};
| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| widgets/ | 2026-02-23 19:41 | 136.16 KB | 76129f60960:kunden | dxwrx-rx-r | |
| accordion.js | 2026-02-23 19:41 | 2.86 KB | 76129f60960:kunden | -xw-x----- | |
| accordion.min.js | 2026-02-23 19:41 | 758 B | 76129f60960:kunden | -xw-x----- | |
| application-passwords.js | 2026-02-23 19:41 | 6.24 KB | 76129f60960:kunden | -xw-x----- | |
| application-passwords.min.js | 2026-02-23 19:41 | 2.95 KB | 76129f60960:kunden | -xw-x----- | |
| auth-app.js | 2026-02-23 19:41 | 5.66 KB | 76129f60960:kunden | -xw-x----- | |
| auth-app.min.js | 2026-02-23 19:41 | 2.04 KB | 76129f60960:kunden | -xw-x----- | |
| code-editor.js | 2026-02-23 19:41 | 11.32 KB | 76129f60960:kunden | -xw-x----- | |
| code-editor.min.js | 2026-02-23 19:41 | 3.01 KB | 76129f60960:kunden | -xw-x----- | |
| color-picker.js | 2026-02-23 19:41 | 9.54 KB | 76129f60960:kunden | -xw-x----- | |
| color-picker.min.js | 2026-02-23 19:41 | 3.4 KB | 76129f60960:kunden | -xw-x----- | |
| comment.js | 2026-02-23 19:41 | 2.85 KB | 76129f60960:kunden | -xw-x----- | |
| comment.min.js | 2026-02-23 19:41 | 1.28 KB | 76129f60960:kunden | -xw-x----- | |
| common.js | 2026-02-23 19:41 | 61.15 KB | 76129f60960:kunden | -xw-x----- | |
| common.min.js | 2026-02-23 19:41 | 23.12 KB | 76129f60960:kunden | -xw-x----- | |
| custom-background.js | 2026-02-23 19:41 | 3.35 KB | 76129f60960:kunden | -xw-x----- | |
| custom-background.min.js | 2026-02-23 19:41 | 1.18 KB | 76129f60960:kunden | -xw-x----- | |
| custom-header.js | 2026-02-23 19:41 | 1.98 KB | 76129f60960:kunden | -xw-x----- | |
| customize-controls.js | 2026-02-23 19:41 | 288.41 KB | 76129f60960:kunden | -xw-x----- | |
| customize-controls.min.js | 2026-02-23 19:41 | 109.69 KB | 76129f60960:kunden | -xw-x----- | |
| customize-nav-menus.js | 2026-02-23 19:41 | 111.46 KB | 76129f60960:kunden | -xw-x----- | |
| customize-nav-menus.min.js | 2026-02-23 19:41 | 47.14 KB | 76129f60960:kunden | -xw-x----- | |
| customize-widgets.js | 2026-02-23 19:41 | 70.05 KB | 76129f60960:kunden | -xw-x----- | |
| customize-widgets.min.js | 2026-02-23 19:41 | 27.41 KB | 76129f60960:kunden | -xw-x----- | |
| dashboard.js | 2026-02-23 19:41 | 27.02 KB | 76129f60960:kunden | -xw-x----- | |
| dashboard.min.js | 2026-02-23 19:41 | 8.65 KB | 76129f60960:kunden | -xw-x----- | |
| edit-comments.js | 2026-02-23 19:41 | 37.12 KB | 76129f60960:kunden | -xw-x----- | |
| edit-comments.min.js | 2026-02-23 19:41 | 15.13 KB | 76129f60960:kunden | -xw-x----- | |
| editor-expand.js | 2026-02-23 19:41 | 41.61 KB | 76129f60960:kunden | -xw-x----- | |
| editor-expand.min.js | 2026-02-23 19:41 | 13.14 KB | 76129f60960:kunden | -xw-x----- | |
| editor.js | 2026-02-23 19:41 | 44 KB | 76129f60960:kunden | -xw-x----- | |
| editor.min.js | 2026-02-23 19:41 | 12.78 KB | 76129f60960:kunden | -xw-x----- | |
| farbtastic.js | 2026-02-23 19:41 | 7.67 KB | 76129f60960:kunden | -xw-x----- | |
| gallery.js | 2026-02-23 19:41 | 5.41 KB | 76129f60960:kunden | -xw-x----- | |
| gallery.min.js | 2026-02-23 19:41 | 3.65 KB | 76129f60960:kunden | -xw-x----- | |
| image-edit.js | 2026-02-23 19:41 | 39.98 KB | 76129f60960:kunden | -xw-x----- | |
| image-edit.min.js | 2026-02-23 19:41 | 15.15 KB | 76129f60960:kunden | -xw-x----- | |
| inline-edit-post.js | 2026-02-23 19:41 | 20.17 KB | 76129f60960:kunden | -xw-x----- | |
| inline-edit-post.min.js | 2026-02-23 19:41 | 9.41 KB | 76129f60960:kunden | -xw-x----- | |
| inline-edit-tax.js | 2026-02-23 19:41 | 7.61 KB | 76129f60960:kunden | -xw-x----- | |
| inline-edit-tax.min.js | 2026-02-23 19:41 | 2.93 KB | 76129f60960:kunden | -xw-x----- | |
| iris.min.js | 2026-02-23 19:41 | 23.09 KB | 76129f60960:kunden | -xw-x----- | |
| language-chooser.js | 2026-02-23 19:41 | 890 B | 76129f60960:kunden | -xw-x----- | |
| language-chooser.min.js | 2026-02-23 19:41 | 423 B | 76129f60960:kunden | -xw-x----- | |
| link.js | 2026-02-23 19:41 | 3.89 KB | 76129f60960:kunden | -xw-x----- | |
| link.min.js | 2026-02-23 19:41 | 1.7 KB | 76129f60960:kunden | -xw-x----- | |
| media-gallery.js | 2026-02-23 19:41 | 1.27 KB | 76129f60960:kunden | -xw-x----- | |
| media-gallery.min.js | 2026-02-23 19:41 | 611 B | 76129f60960:kunden | -xw-x----- | |
| media-upload.js | 2026-02-23 19:41 | 3.38 KB | 76129f60960:kunden | -xw-x----- | |
| media-upload.min.js | 2026-02-23 19:41 | 1.13 KB | 76129f60960:kunden | -xw-x----- | |
| media.js | 2026-02-23 19:41 | 6.61 KB | 76129f60960:kunden | -xw-x----- | |
| media.min.js | 2026-02-23 19:41 | 2.38 KB | 76129f60960:kunden | -xw-x----- | |
| nav-menu.js | 2026-02-23 19:41 | 61.15 KB | 76129f60960:kunden | -xw-x----- | |
| nav-menu.min.js | 2026-02-23 19:41 | 30.06 KB | 76129f60960:kunden | -xw-x----- | |
| password-strength-meter.js | 2026-02-23 19:41 | 4.14 KB | 76129f60960:kunden | -xw-x----- | |
| password-strength-meter.min.js | 2026-02-23 19:41 | 1.1 KB | 76129f60960:kunden | -xw-x----- | |
| password-toggle.js | 2026-02-23 19:41 | 1.31 KB | 76129f60960:kunden | -xw-x----- | |
| password-toggle.min.js | 2026-02-23 19:41 | 847 B | 76129f60960:kunden | -xw-x----- | |
| plugin-install.js | 2026-02-23 19:41 | 6.92 KB | 76129f60960:kunden | -xw-x----- | |
| plugin-install.min.js | 2026-02-23 19:41 | 2.35 KB | 76129f60960:kunden | -xw-x----- | |
| post.js | 2026-02-23 19:41 | 38.68 KB | 76129f60960:kunden | -xw-x----- | |
| post.min.js | 2026-02-23 19:41 | 18.4 KB | 76129f60960:kunden | -xw-x----- | |
| postbox.js | 2026-02-23 19:41 | 18.49 KB | 76129f60960:kunden | -xw-x----- | |
| postbox.min.js | 2026-02-23 19:41 | 6.6 KB | 76129f60960:kunden | -xw-x----- | |
| privacy-tools.js | 2026-02-23 19:41 | 10.67 KB | 76129f60960:kunden | -xw-x----- | |
| privacy-tools.min.js | 2026-02-23 19:41 | 5.03 KB | 76129f60960:kunden | -xw-x----- | |
| revisions.js | 2026-02-23 19:41 | 33.92 KB | 76129f60960:kunden | -xw-x----- | |
| revisions.min.js | 2026-02-23 19:41 | 17.97 KB | 76129f60960:kunden | -xw-x----- | |
| set-post-thumbnail.js | 2026-02-23 19:41 | 876 B | 76129f60960:kunden | -xw-x----- | |
| set-post-thumbnail.min.js | 2026-02-23 19:41 | 620 B | 76129f60960:kunden | -xw-x----- | |
| site-health.js | 2026-02-23 19:41 | 13.15 KB | 76129f60960:kunden | -xw-x----- | |
| site-health.min.js | 2026-02-23 19:41 | 6.13 KB | 76129f60960:kunden | -xw-x----- | |
| site-icon.js | 2026-02-23 19:41 | 6.1 KB | 76129f60960:kunden | -xw-x----- | |
| site-icon.min.js | 2026-02-23 19:41 | 2.2 KB | 76129f60960:kunden | -xw-x----- | |
| svg-painter.js | 2026-02-23 19:41 | 3.2 KB | 76129f60960:kunden | -xw-x----- | |
| svg-painter.min.js | 2026-02-23 19:41 | 1.53 KB | 76129f60960:kunden | -xw-x----- | |
| tags-box.js | 2026-02-23 19:41 | 10.88 KB | 76129f60960:kunden | -xw-x----- | |
| tags-box.min.js | 2026-02-23 19:41 | 3 KB | 76129f60960:kunden | -xw-x----- | |
| tags-suggest.js | 2026-02-23 19:41 | 5.64 KB | 76129f60960:kunden | -xw-x----- | |
| tags-suggest.min.js | 2026-02-23 19:41 | 2.22 KB | 76129f60960:kunden | -xw-x----- | |
| tags.js | 2026-02-23 19:41 | 5.96 KB | 76129f60960:kunden | -xw-x----- | |
| tags.min.js | 2026-02-23 19:41 | 2.41 KB | 76129f60960:kunden | -xw-x----- | |
| theme-plugin-editor.js | 2026-02-23 19:41 | 24.77 KB | 76129f60960:kunden | -xw-x----- | |
| theme-plugin-editor.min.js | 2026-02-23 19:41 | 11.43 KB | 76129f60960:kunden | -xw-x----- | |
| theme.js | 2026-02-23 19:41 | 54.94 KB | 76129f60960:kunden | -xw-x----- | |
| theme.min.js | 2026-02-23 19:41 | 26.51 KB | 76129f60960:kunden | -xw-x----- | |
| updates.js | 2026-02-23 19:41 | 109.37 KB | 76129f60960:kunden | -xw-x----- | |
| updates.min.js | 2026-02-23 19:41 | 47.31 KB | 76129f60960:kunden | -xw-x----- | |
| user-profile.js | 2026-02-23 19:41 | 17.91 KB | 76129f60960:kunden | -xw-x----- | |
| user-profile.min.js | 2026-02-23 19:41 | 7.81 KB | 76129f60960:kunden | -xw-x----- | |
| user-suggest.js | 2026-02-23 19:41 | 2.25 KB | 76129f60960:kunden | -xw-x----- | |
| user-suggest.min.js | 2026-02-23 19:41 | 676 B | 76129f60960:kunden | -xw-x----- | |
| widgets.js | 2026-02-23 19:41 | 22.56 KB | 76129f60960:kunden | -xw-x----- | |
| widgets.min.js | 2026-02-23 19:41 | 12.31 KB | 76129f60960:kunden | -xw-x----- | |
| word-count.js | 2026-02-23 19:41 | 7.52 KB | 76129f60960:kunden | -xw-x----- | |
| word-count.min.js | 2026-02-23 19:41 | 1.49 KB | 76129f60960:kunden | -xw-x----- | |
| xfn.js | 2026-02-23 19:41 | 740 B | 76129f60960:kunden | -xw-x----- | |
| xfn.min.js | 2026-02-23 19:41 | 458 B | 76129f60960:kunden | -xw-x----- | |