PluginProbe
Photonic Gallery & Lightbox for Flickr, SmugMug & Others / 2.44
Photonic Gallery & Lightbox for Flickr, SmugMug & Others v2.44
3.36 3.35 3.34 3.33 2.19 2.20 2.21 2.22 2.23 2.24 2.25 2.26 2.27 2.28 2.29 2.30 2.31 2.32 2.33 2.34 2.40 2.41 2.42 2.43 2.44 All 141 releases
photonic / include / scripts / admin / widget.js

widget.js in Photonic Gallery & Lightbox for Flickr, SmugMug & Others 2.44, at include/scripts/admin/widget.js

41 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * widget.js - Contains all Widget functionality required by Photonic
3 */
4 var photonicWidgetData;
5 jQuery(document).ready(function($) {
6 (function(win) {
7 "use strict";
8
9 $(document).on('click', '.photonic-wizard', function(e) {
10 e.preventDefault();
11
12 var clicked = $(this);
13 photonicWidgetData = $(clicked.closest('.photonic-widget').find('.photonic-shortcode')[0]);
14 tb_show('Click to create gallery', clicked.attr('href'));
15 });
16
17 $(document).on('change', '.photonic-shortcode', function() {
18 var $sc_field = $(this);
19 var $icon = $($(this).closest('.photonic-widget').find('.photonic-wizard')[0]);
20 if (top.wp !== undefined && top.wp.shortcode !== undefined) {
21 var shortcode = top.wp.shortcode.next(Photonic_Widget_JS.shortcode, $sc_field.attr('value'));
22 var attrs = shortcode.shortcode.attrs.named;
23 if ($icon.hasClass('photonic')) {
24 var $para = $icon.siblings('p');
25 $para.html(Photonic_Widget_JS.edit_message);
26 }
27 if (attrs.type !== undefined) {
28 $icon.attr('class', 'photonic-wizard ' + attrs.type);
29 }
30 else {
31 $icon.attr('class', 'photonic-wizard wp');
32 }
33 }
34
35 var $sc_display = $($(this).closest('.photonic-widget').find('.photonic-shortcode-display')[0]);
36 $sc_display.html("<h4>" + Photonic_Widget_JS.current_shortcode + "</h4>\n" +
37 "<code>" + $sc_field.attr('value') + "</code>\n");
38 });
39 }) (window);
40 });
41