diff --git a/bundle/Resources/public/admin/js/field/jqmodal.js b/bundle/Resources/public/admin/js/field/jqmodal.js index 2cc730aa..2a9d1e12 100644 --- a/bundle/Resources/public/admin/js/field/jqmodal.js +++ b/bundle/Resources/public/admin/js/field/jqmodal.js @@ -5,42 +5,42 @@ * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html - * + * * $Version: 1.2.0 (2015.04.01 +r23) * Requires: jQuery 1.2.3+ */ (function($) { - + /** * Initialize a set of elements as "modals". Modals typically are popup dialogs, - * notices, modal windows, &c. - * + * notices, modal windows, &c. + * * @name jqm * @param options user defined options, augments defaults. * @type jQuery * @cat Plugins/jqModal */ - + $.fn.jqm=function(options){ return this.each(function(){ var e = $(this), jqm = e.data('jqm') || $.extend({ID: I++}, $.jqm.params), o = $.extend(jqm,options); - + // add/extend options to modal and mark as initialized e.data('jqm',o).addClass('jqm-init')[0]._jqmID = o.ID; - + // ... Attach events to trigger showing of this modal o.trigger && e.jqmAddTrigger(o.trigger); }); }; - - + + /** * Matching modals will have their jqmShow() method fired by attaching a * onClick event to elements matching `trigger`. - * + * * @name jqmAddTrigger * @param trigger a selector String, jQuery collection of elements, or a DOM element. */ @@ -50,12 +50,12 @@ err("jqmAddTrigger must be called on initialized modals") }); }; - - + + /** * Matching modals will have their jqmHide() method fired by attaching an * onClick event to elements matching `trigger`. - * + * * @name jqmAddClose * @param trigger a selector String, jQuery collection of elements, or a DOM element. */ @@ -65,62 +65,62 @@ err("jqmAddClose must be called on initialized modals") }); }; - - + + /** * Open matching modals (if not shown) */ $.fn.jqmShow=function(trigger){ - return this.each(function(){ - !this._jqmShown&&show($(this), trigger); + return this.each(function(){ + !this._jqmShown&&show($(this), trigger); }); }; - + /** * Close matching modals */ $.fn.jqmHide=function(trigger){ return this.each(function(){ this._jqmShown&&hide($(this), trigger); }); }; - - + + // utility functions - + var err = function(msg){ if(window.console && window.console.error) window.console.error(msg); - - + + }, show = function(e, t){ - + /** * e = modal element (as jQuery object) * t = triggering element - * + * * o = options * z = z-index of modal * v = overlay element (as jQuery object) * h = hash (for jqModal <= r15 compatibility) */ - + var o = e.data('jqm'), t = t || window.event, z = (parseInt(e.css('z-index'))), z = (z > 0) ? z : 3000, v = $('
').addClass(o.overlayClass).css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z-1,opacity:o.overlay/100}), - + // maintain legacy "hash" construct - h = {w: e, c: o, o: v, t: t}; - + h = {w: e, c: o, o: v, t: t}; + e.css('z-index',z); if(o.ajax){ var target = o.target || e, url = o.ajax; - + target = (typeof target == 'string') ? $(target,e) : $(target); if(url.substr(0,1) == '@') url = $(t).attr(url.substring(1)); - + // Load the Ajax Content (and once loaded); // Fire the onLoad callback (if exists), // Attach closing events to elements inside the modal that match the closingClass, @@ -128,125 +128,125 @@ target.html(o.ajaxText).load(url,function(){ o.onLoad && o.onLoad.call(this,h); open(h); - }); + }); } else { open(h); } - + }, hide = function(e, t){ /** * e = modal element (as jQuery object) * t = triggering element - * + * * o = options * h = hash (for jqModal <= r15 compatibility) */ - + var o = e.data('jqm'), t = t || window.event, - + // maintain legacy "hash" construct h = {w: e, c: o, o: e.data('jqmv'), t: t}; - + close(h); - + }, onShow = function(hash){ // onShow callback. Responsible for showing a modal and overlay. - // return false to stop opening modal. - + // return false to stop opening modal. + // hash object; // w: (jQuery object) The modal element - // c: (object) The modal's options object + // c: (object) The modal's options object // o: (jQuery object) The overlay element // t: (DOM object) The triggering element - + // display the overlay (prepend to body) if not disabled if(hash.c.overlay > 0) hash.o.prependTo('body'); - + // make modal visible hash.w.show(); - + // call focusFunc (attempts to focus on first input in modal) $.jqm.focusFunc(hash.w,true); - + return true; - - + + }, onHide = function(hash){ // onHide callback. Responsible for hiding a modal and overlay. - // return false to stop closing modal. - + // return false to stop closing modal. + // hash object; // w: (jQuery object) The modal element - // c: (object) The modal's options object + // c: (object) The modal's options object // o: (jQuery object) The overlay element // t: (DOM object) The triggering element - + // hide modal and if overlay, remove overlay. hash.w.hide() && hash.o && hash.o.remove(); - + return true; - - + + }, addTrigger = function(e, key, trigger){ // addTrigger: Adds a jqmShow/jqmHide (key) event click on modal (e) // to all elements that match trigger string (trigger) - + var jqm = e.data('jqm'); - + // return false if e is not an initialized modal element if(!e.data('jqm')) return false; - + return $(trigger).each(function(){ this[key] = this[key] || []; - + // register this modal with this trigger only once if($.inArray(jqm.ID,this[key]) < 0) { this[key].push(jqm.ID); - + // register trigger click event for this modal $(this).click(function(){ var trigger = this; - + e[key](this); - + // stop trigger click event from bubbling return false; }); } - + }); - + }, open = function(h){ // open: executes the onOpen callback + performs common tasks if successful - // transform legacy hash into new var shortcuts + // transform legacy hash into new var shortcuts var e = h.w, v = h.o, o = h.c; - + // execute onShow callback if(o.onShow(h) !== false){ // mark modal as shown e[0]._jqmShown = true; - - // if modal dialog + + // if modal dialog // // Bind the Keep Focus Function [F] if no other Modals are open (!ActiveModals[0]) + - // + // // else, close dialog when overlay is clicked if(o.modal){ !ActiveModals[0]&&F('bind'); ActiveModals.push(e[0]); } else e.jqmAddClose(v); - + // Attach closing events to elements inside the modal matching closingClass o.closeClass&&e.jqmAddClose($('.' + o.closeClass,e)); - + // IF toTop is true and overlay exists; // Add placeholder element before modal to // remember it's position in the DOM and move it to a child of the body tag (after overlay) o.toTop&&v&&e.before('').insertAfter(v); - + // remember overlay (for closing function) e.data('jqmv',v); @@ -256,12 +256,12 @@ e.attr("tabindex", 0).bind("keydown",$.jqm.closeOnEscFunc).focus(); } } - - + + }, close = function(h){ // close: executes the onHide callback + performs common tasks if successful - // transform legacy hash into new var shortcuts + // transform legacy hash into new var shortcuts var e = h.w, v = h.o, o = h.c; @@ -270,50 +270,50 @@ if(o.onHide(h) !== false){ // mark modal as !shown e[0]._jqmShown = false; - + // If modal, remove from modal stack. // If no modals in modal stack, unbind the Keep Focus Function if(o.modal){ActiveModals.pop();!ActiveModals[0]&&F('unbind');} - + // IF toTop was passed and an overlay exists; // Move modal back to its "remembered" position. o.toTop&&v&&$('#jqmP'+o.ID).after(e).remove(); } - - + + }, F = function(t){ // F: The Keep Focus Function (for modal: true dialos) // Binds or Unbinds (t) the Focus Examination Function (X) to keypresses and clicks - + $(document)[t]("keypress keydown mousedown",X); - - + + }, X = function(e){ // X: The Focus Examination Function (for modal: true dialogs) - var targetModal = $(e.target).data('jqm') || $(e.target).parents('.jqm-init:first').data('jqm'); + var targetModal = $(e.target).data('jqm') || $(e.target).parents('.jqm-init').first().data('jqm'); var activeModal = ActiveModals[ActiveModals.length-1]; - + // allow bubbling if event target is within active modal dialog - return (targetModal && targetModal.ID == activeModal._jqmID) ? + return (targetModal && targetModal.ID == activeModal._jqmID) ? true : $.jqm.focusFunc(activeModal,e); - }, - - I = 0, // modal ID increment (for nested modals) + }, + + I = 0, // modal ID increment (for nested modals) ActiveModals = []; // array of active modals (used to lock interactivity to appropriate modal) - - + + // $.jqm, overridable defaults $.jqm = { /** * default options - * - * (Integer) overlay - [0-100] Translucency percentage (opacity) of the body covering overlay. Set to 0 for NO overlay, and up to 100 for a 100% opaque overlay. + * + * (Integer) overlay - [0-100] Translucency percentage (opacity) of the body covering overlay. Set to 0 for NO overlay, and up to 100 for a 100% opaque overlay. * (String) overlayClass - Applied to the body covering overlay. Useful for controlling overlay look (tint, background-image, &c) with CSS. * (String) closeClass - Children of the modal element matching `closeClass` will fire the onHide event (to close the modal). * (Mixed) trigger - Matching elements will fire the onShow event (to display the modal). Trigger can be a selector String, a jQuery collection of elements, a DOM element, or a False boolean. - * (String) ajax - URL to load content from via an AJAX request. False to disable ajax. If ajax begins with a "@", the URL is extracted from the attribute of the triggering element (e.g. use '@data-url' for; ...) - * (Mixed) target - Children of the modal element to load the ajax response into. If false, modal content will be overwritten by ajax response. Useful for retaining modal design. + * (String) ajax - URL to load content from via an AJAX request. False to disable ajax. If ajax begins with a "@", the URL is extracted from the attribute of the triggering element (e.g. use '@data-url' for; ...) + * (Mixed) target - Children of the modal element to load the ajax response into. If false, modal content will be overwritten by ajax response. Useful for retaining modal design. * Target may be a selector string, jQuery collection of elements, or a DOM element -- and MUST exist as a child of the modal element. * (String) ajaxText - Text shown while waiting for ajax return. Replaces HTML content of `target` element. * (Boolean) modal - If true, user interactivity will be locked to the modal window until closed. @@ -337,22 +337,22 @@ onHide: onHide, onLoad: false }, - + // focusFunc is fired: - // a) when a modal:true dialog is shown, + // a) when a modal:true dialog is shown, // b) when an event occurs outside an active modal:true dialog - // It is passed the active modal:true dialog as well as event - focusFunc: function(activeModal, event) { - + // It is passed the active modal:true dialog as well as event + focusFunc: function(activeModal, event) { + // if the event occurs outside the activeModal, focus on first element - if(event) { - $(':input:visible:first',activeModal).focus(); - } - + if(event) { + $(':input:visible',activeModal).first().focus(); + } + // lock interactions to the activeModal - return false; + return false; }, - + // closeOnEscFunc is attached to modals where closeOnEsc param true. closeOnEscFunc: function(event){ if (event.keyCode == 27) { @@ -361,5 +361,5 @@ } } }; - -})( jQuery ); \ No newline at end of file + +})( jQuery ); diff --git a/bundle/Resources/public/admin/js/field/jquery.netgen_tags.js b/bundle/Resources/public/admin/js/field/jquery.netgen_tags.js index de8fc0ec..093d4a98 100644 --- a/bundle/Resources/public/admin/js/field/jquery.netgen_tags.js +++ b/bundle/Resources/public/admin/js/field/jquery.netgen_tags.js @@ -64,7 +64,7 @@ is_key: function(e, keys){ var self = this; - !$.isArray(keys) && (keys = [keys]); + !Array.isArray(keys) && (keys = [keys]); keys = $.map(keys, function(name){ return self.key[name]; }); return $.inArray(e.which, keys) > -1; } @@ -280,11 +280,11 @@ ' -->', ' ', '', '', @@ -1004,7 +1004,7 @@ * @return {array} Values from hidden input or empty array if there was none. */ Base.prototype.parse_hidden_input = function(name) { - var val = $.trim(this.$hidden_inputs[name].val()); + var val = this.$hidden_inputs[name].val().trim(); return val ? val.split('|#') : []; }; @@ -1023,7 +1023,7 @@ Base.prototype.get_tag_name_from_input = function() { - return $.trim(this.$input.val()); + return this.$input.val().trim(); }; Base.prototype.clear_input = function() { diff --git a/bundle/Resources/public/vendor/jquery/jquery.min.js b/bundle/Resources/public/vendor/jquery/jquery.min.js index a1c07fd8..7f37b5d9 100644 --- a/bundle/Resources/public/vendor/jquery/jquery.min.js +++ b/bundle/Resources/public/vendor/jquery/jquery.min.js @@ -1,2 +1,2 @@ -/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0