PHP 8.1.33
Preview: gallery.js Size: 5.41 KB
/home/jambtst2015/public_html/www.securiskbrokers.com/wp-admin/js/gallery.js

/**
 * @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;
	}
};

Directory Contents

Dirs: 1 × Files: 97

Name Size Perms Modified Actions
widgets DIR
- drwxr-xr-x 2024-12-09 13:54:39
Edit Download
2.86 KB lrw-r--r-- 2024-10-13 23:09:12
Edit Download
758 B lrw-r--r-- 2024-10-13 23:09:12
Edit Download
6.24 KB lrw-r--r-- 2023-09-18 02:51:24
Edit Download
2.95 KB lrw-r--r-- 2023-09-18 02:51:24
Edit Download
5.66 KB lrw-r--r-- 2021-02-24 00:45:04
Edit Download
2.04 KB lrw-r--r-- 2022-04-09 00:07:18
Edit Download
11.32 KB lrw-r--r-- 2020-07-28 03:35:02
Edit Download
3.01 KB lrw-r--r-- 2024-06-27 16:55:22
Edit Download
9.54 KB lrw-r--r-- 2021-03-18 23:01:04
Edit Download
3.40 KB lrw-r--r-- 2022-04-09 00:07:18
Edit Download
2.85 KB lrw-r--r-- 2024-02-12 00:14:20
Edit Download
1.28 KB lrw-r--r-- 2022-04-09 00:07:18
Edit Download
61.00 KB lrw-r--r-- 2025-02-04 08:26:20
Edit Download
23.03 KB lrw-r--r-- 2025-02-04 08:26:20
Edit Download
3.35 KB lrw-r--r-- 2021-03-18 23:01:04
Edit Download
1.18 KB lrw-r--r-- 2021-03-18 23:01:04
Edit Download
1.98 KB lrw-r--r-- 2021-02-24 00:45:04
Edit Download
287.36 KB lrw-r--r-- 2025-02-04 08:03:16
Edit Download
109.16 KB lrw-r--r-- 2025-02-04 08:03:16
Edit Download
109.90 KB lrw-r--r-- 2025-09-30 21:02:50
Edit Download
46.24 KB lrw-r--r-- 2025-09-30 21:02:50
Edit Download
70.05 KB lrw-r--r-- 2024-06-21 22:17:14
Edit Download
27.41 KB lrw-r--r-- 2024-06-21 22:17:14
Edit Download
26.92 KB lrw-r--r-- 2024-04-12 21:47:14
Edit Download
8.59 KB lrw-r--r-- 2024-06-27 16:55:22
Edit Download
36.67 KB lrw-r--r-- 2024-08-26 02:37:20
Edit Download
15.01 KB lrw-r--r-- 2024-08-26 02:37:20
Edit Download
41.61 KB lrw-r--r-- 2024-04-12 21:47:14
Edit Download
13.14 KB lrw-r--r-- 2024-06-27 16:55:22
Edit Download
43.98 KB lrw-r--r-- 2024-10-07 20:57:16
Edit Download
12.76 KB lrw-r--r-- 2024-10-07 20:57:16
Edit Download
7.67 KB lrw-r--r-- 2023-07-18 02:03:26
Edit Download
5.41 KB lrw-r--r-- 2023-10-10 01:31:28
Edit Download
3.65 KB lrw-r--r-- 2023-10-10 01:31:28
Edit Download
39.98 KB lrw-r--r-- 2024-08-28 20:45:12
Edit Download
15.15 KB lrw-r--r-- 2024-08-28 20:45:12
Edit Download
20.17 KB lrw-r--r-- 2024-09-30 22:24:14
Edit Download
9.41 KB lrw-r--r-- 2024-09-30 22:24:14
Edit Download
7.61 KB lrw-r--r-- 2021-03-18 23:01:04
Edit Download
2.93 KB lrw-r--r-- 2021-03-18 23:01:04
Edit Download
23.09 KB lrw-r--r-- 2021-11-03 23:40:00
Edit Download
890 B lrw-r--r-- 2021-02-24 00:45:04
Edit Download
423 B lrw-r--r-- 2021-02-24 00:45:04
Edit Download
3.89 KB lrw-r--r-- 2021-03-18 23:01:04
Edit Download
1.70 KB lrw-r--r-- 2021-03-18 23:01:04
Edit Download
1.27 KB lrw-r--r-- 2021-02-24 00:45:04
Edit Download
611 B lrw-r--r-- 2022-04-09 00:07:18
Edit Download
3.38 KB lrw-r--r-- 2021-01-22 17:32:04
Edit Download
1.13 KB lrw-r--r-- 2023-02-02 21:36:32
Edit Download
6.61 KB lrw-r--r-- 2024-10-07 06:49:18
Edit Download
2.38 KB lrw-r--r-- 2024-10-07 06:49:18
Edit Download
59.07 KB lrw-r--r-- 2025-09-30 21:02:50
Edit Download
29.29 KB lrw-r--r-- 2025-09-30 21:02:50
Edit Download
4.14 KB lrw-r--r-- 2021-01-22 17:32:04
Edit Download
1.10 KB lrw-r--r-- 2021-01-22 17:32:04
Edit Download
1.31 KB lrw-r--r-- 2023-06-24 03:09:30
Edit Download
847 B lrw-r--r-- 2023-06-24 03:09:30
Edit Download
6.92 KB lrw-r--r-- 2021-03-18 23:01:04
Edit Download
2.35 KB lrw-r--r-- 2023-02-02 21:36:32
Edit Download
38.68 KB lrw-r--r-- 2024-11-28 02:23:16
Edit Download
18.40 KB lrw-r--r-- 2024-11-28 02:23:16
Edit Download
18.40 KB lrw-r--r-- 2023-01-10 14:30:14
Edit Download
6.55 KB lrw-r--r-- 2022-09-23 23:55:30
Edit Download
10.67 KB lrw-r--r-- 2024-06-21 22:17:14
Edit Download
5.03 KB lrw-r--r-- 2024-06-21 22:17:14
Edit Download
33.92 KB lrw-r--r-- 2024-10-14 00:49:14
Edit Download
17.97 KB lrw-r--r-- 2024-10-14 00:49:14
Edit Download
876 B lrw-r--r-- 2020-07-07 22:55:04
Edit Download
620 B lrw-r--r-- 2020-07-07 22:55:04
Edit Download
13.15 KB lrw-r--r-- 2023-12-28 20:27:16
Edit Download
6.13 KB lrw-r--r-- 2023-12-28 20:27:16
Edit Download
6.10 KB lrw-r--r-- 2024-08-24 02:47:16
Edit Download
2.20 KB lrw-r--r-- 2024-08-24 02:47:16
Edit Download
3.20 KB lrw-r--r-- 2024-09-08 02:44:18
Edit Download
1.53 KB lrw-r--r-- 2024-09-08 02:44:18
Edit Download
10.88 KB lrw-r--r-- 2021-03-18 23:01:04
Edit Download
3.00 KB lrw-r--r-- 2023-02-02 21:36:32
Edit Download
5.64 KB lrw-r--r-- 2024-02-19 03:16:14
Edit Download
2.22 KB lrw-r--r-- 2024-02-19 03:16:14
Edit Download
4.77 KB lrw-r--r-- 2022-04-12 23:37:14
Edit Download
1.96 KB lrw-r--r-- 2022-04-12 23:37:14
Edit Download
24.79 KB lrw-r--r-- 2024-04-12 21:47:14
Edit Download
11.46 KB lrw-r--r-- 2024-06-27 16:55:22
Edit Download
54.65 KB lrw-r--r-- 2024-08-19 23:19:18
Edit Download
26.40 KB lrw-r--r-- 2024-08-19 23:19:18
Edit Download
109.29 KB lrw-r--r-- 2024-09-30 22:24:14
Edit Download
47.23 KB lrw-r--r-- 2024-09-30 22:24:14
Edit Download
15.00 KB lrw-r--r-- 2024-09-18 04:14:14
Edit Download
6.70 KB lrw-r--r-- 2024-09-18 04:14:14
Edit Download
2.25 KB lrw-r--r-- 2021-03-18 23:01:04
Edit Download
676 B lrw-r--r-- 2021-03-18 23:01:04
Edit Download
22.56 KB lrw-r--r-- 2021-03-18 23:01:04
Edit Download
12.31 KB lrw-r--r-- 2023-02-02 21:36:32
Edit Download
7.52 KB lrw-r--r-- 2020-07-28 03:35:02
Edit Download
1.49 KB lrw-r--r-- 2023-02-02 21:36:32
Edit Download
740 B lrw-r--r-- 2021-03-18 23:01:04
Edit Download
458 B lrw-r--r-- 2021-03-18 23:01:04
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).