diff --git a/wire/modules/Inputfield/InputfieldPageTable/InputfieldPageTable.js b/wire/modules/Inputfield/InputfieldPageTable/InputfieldPageTable.js index b7a868f9..bea562ad 100644 --- a/wire/modules/Inputfield/InputfieldPageTable/InputfieldPageTable.js +++ b/wire/modules/Inputfield/InputfieldPageTable/InputfieldPageTable.js @@ -21,11 +21,12 @@ function InputfieldPageTableDialog() { $table.find('tbody').css('overflow', 'visible'); InputfieldPageTableSortable($table); - // restore appearnace of any items marked for deletion + // restore appearance of any items marked for deletion var deleteIDs = $container.siblings("input.InputfieldPageTableDelete").eq(0).val().split('|'); if(deleteIDs.length) { for(var n = 0; n < deleteIDs.length; n++) { var deleteID = deleteIDs[n]; + if(!deleteID.length) continue; $table.find("tr[data-id=" + deleteID + "]") .addClass('InputfieldPageTableDelete ui-state-error-text ui-state-disabled'); } diff --git a/wire/modules/Inputfield/InputfieldPageTable/InputfieldPageTable.min.js b/wire/modules/Inputfield/InputfieldPageTable/InputfieldPageTable.min.js index e07f2fa2..cf74c0a2 100644 --- a/wire/modules/Inputfield/InputfieldPageTable/InputfieldPageTable.min.js +++ b/wire/modules/Inputfield/InputfieldPageTable/InputfieldPageTable.min.js @@ -1 +1 @@ -function InputfieldPageTableDialog(){var $a=$(this);var url=$a.attr("data-url");var title=$a.attr("data-title");var closeOnSave=true;var $container=$(this).parents(".InputfieldPageTableContainer");var dialogPageID=0;var noclose=parseInt($container.attr("data-noclose"));var modalSettings={close:function(event,ui){if(dialogPageID>0){var ajaxURL=$container.attr("data-url")+"&InputfieldPageTableAdd="+dialogPageID;var sort=$container.siblings(".InputfieldPageTableSort").val();if(typeof sort!="undefined"&&sort.length)ajaxURL+="&InputfieldPageTableSort="+sort.replace(/\|/g,",");$.get(ajaxURL,function(data){$container.html(data);$container.find(".Inputfield").trigger("reloaded",["InputfieldPageTable"]);$container.effect("highlight",500,function(){var $table=$container.find("table");$table.find("tbody").css("overflow","visible");InputfieldPageTableSortable($table);var deleteIDs=$container.siblings("input.InputfieldPageTableDelete").eq(0).val().split("|");if(deleteIDs.length){for(var n=0;n0)setTimeout(function(){for(var i=0;i0)value+="|";value+=pageID});var $container=$table.parents(".InputfieldPageTableContainer");var $input=$container.siblings(".InputfieldPageTableSort");$input.val(value)}function InputfieldPageTableSortable($tables){$tables.each(function(){var $table=$(this);if($table.closest(".InputfieldRenderValueMode").length)return;$table.find("tbody").sortable({axis:"y",start:function(event,ui){var widths=[];var n=0;$table.find("thead").find("th").each(function(){widths[n]=$(this).width();n++});n=0;ui.helper.find("td").each(function(){$(this).attr("width",widths[n]);n++})},stop:function(event,ui){InputfieldPageTableUpdate($(this))},update:function(e,ui){$table.closest(".Inputfield").trigger("sorted",[ui.item])}})})}function InputfieldPageTableDelete(){var $row=$(this).closest("tr");$row.toggleClass("InputfieldPageTableDelete ui-state-error-text ui-state-disabled");var ids="";$row.parents("tbody").children("tr").each(function(){var $tr=$(this);var id=$tr.attr("data-id");if($tr.is(".InputfieldPageTableDelete"))ids+=(ids.length>0?"|":"")+id});var $input=$(this).parents(".InputfieldPageTableContainer").siblings("input.InputfieldPageTableDelete");$input.val(ids);return false}$(document).ready(function(){$(document).on("click",".InputfieldPageTableAdd, .InputfieldPageTableEdit",InputfieldPageTableDialog);$(document).on("click","a.InputfieldPageTableDelete",InputfieldPageTableDelete);$(document).on("dblclick",".InputfieldPageTable .AdminDataTable td",function(){$(this).closest("tr").find(".InputfieldPageTableEdit").click()});InputfieldPageTableSortable($(".InputfieldPageTable table"));$(document).on("reloaded",".InputfieldPageTable",function(){InputfieldPageTableSortable($(this).find(".InputfieldPageTableContainer > table"))});$(document).on("click",".InputfieldPageTableOrphansAll",function(){var $checkboxes=$(this).closest(".InputfieldPageTableOrphans").find("input");$checkboxes.prop("checked",$checkboxes.eq(0).is(":checked")?false:true);return false})}); \ No newline at end of file +function InputfieldPageTableDialog(){var $a=$(this);var url=$a.attr("data-url");var title=$a.attr("data-title");var closeOnSave=true;var $container=$(this).parents(".InputfieldPageTableContainer");var dialogPageID=0;var noclose=parseInt($container.attr("data-noclose"));var modalSettings={close:function(event,ui){if(dialogPageID>0){var ajaxURL=$container.attr("data-url")+"&InputfieldPageTableAdd="+dialogPageID;var sort=$container.siblings(".InputfieldPageTableSort").val();if(typeof sort!="undefined"&&sort.length)ajaxURL+="&InputfieldPageTableSort="+sort.replace(/\|/g,",");$.get(ajaxURL,function(data){$container.html(data);$container.find(".Inputfield").trigger("reloaded",["InputfieldPageTable"]);$container.effect("highlight",500,function(){var $table=$container.find("table");$table.find("tbody").css("overflow","visible");InputfieldPageTableSortable($table);var deleteIDs=$container.siblings("input.InputfieldPageTableDelete").eq(0).val().split("|");if(deleteIDs.length){for(var n=0;n0)setTimeout(function(){for(var i=0;i0)value+="|";value+=pageID});var $container=$table.parents(".InputfieldPageTableContainer");var $input=$container.siblings(".InputfieldPageTableSort");$input.val(value)}function InputfieldPageTableSortable($tables){$tables.each(function(){var $table=$(this);if($table.closest(".InputfieldRenderValueMode").length)return;$table.find("tbody").sortable({axis:"y",start:function(event,ui){var widths=[];var n=0;$table.find("thead").find("th").each(function(){widths[n]=$(this).width();n++});n=0;ui.helper.find("td").each(function(){$(this).attr("width",widths[n]);n++})},stop:function(event,ui){InputfieldPageTableUpdate($(this))},update:function(e,ui){$table.closest(".Inputfield").trigger("sorted",[ui.item])}})})}function InputfieldPageTableDelete(){var $row=$(this).closest("tr");$row.toggleClass("InputfieldPageTableDelete ui-state-error-text ui-state-disabled");var ids="";$row.parents("tbody").children("tr").each(function(){var $tr=$(this);var id=$tr.attr("data-id");if($tr.is(".InputfieldPageTableDelete"))ids+=(ids.length>0?"|":"")+id});var $input=$(this).parents(".InputfieldPageTableContainer").siblings("input.InputfieldPageTableDelete");$input.val(ids);return false}$(document).ready(function(){$(document).on("click",".InputfieldPageTableAdd, .InputfieldPageTableEdit",InputfieldPageTableDialog);$(document).on("click","a.InputfieldPageTableDelete",InputfieldPageTableDelete);$(document).on("dblclick",".InputfieldPageTable .AdminDataTable td",function(){$(this).closest("tr").find(".InputfieldPageTableEdit").click()});InputfieldPageTableSortable($(".InputfieldPageTable table"));$(document).on("reloaded",".InputfieldPageTable",function(){InputfieldPageTableSortable($(this).find(".InputfieldPageTableContainer > table"))});$(document).on("click",".InputfieldPageTableOrphansAll",function(){var $checkboxes=$(this).closest(".InputfieldPageTableOrphans").find("input");$checkboxes.prop("checked",$checkboxes.eq(0).is(":checked")?false:true);return false})}); \ No newline at end of file diff --git a/wire/modules/Jquery/JqueryCore/jquery.longclick.js b/wire/modules/Jquery/JqueryCore/jquery.longclick.js index a8b79524..733090e0 100644 --- a/wire/modules/Jquery/JqueryCore/jquery.longclick.js +++ b/wire/modules/Jquery/JqueryCore/jquery.longclick.js @@ -1,148 +1,140 @@ -/** - * jQuery Longclick Event - * ====================== - * Press & hold mouse button "long click" special event for jQuery 1.4.x - * - * @license Longclick Event - * Copyright (c) 2010 Petr Vostrel (http://petr.vostrel.cz/) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * Version: 0.3.2 - * Updated: 2010-06-22 - * - */ -(function($){ - - /* - `.click( duration, handler )` - - * Simply supply `duration` to the well-known `.click` method and you have a *long click*. - * This method is a shortcut for `.bind("longclick", handler)`. - * Returns *jQuery*. - */ - var - $_fn_click= $.fn.click - - $.fn.click= function click(duration, handler){ - /* Shortcircuit ordinary click calls */ - if (!handler) return $_fn_click.apply(this, arguments) - /* Bind long click */ - return $(this).data(_duration_, duration || null).bind(type, handler) - } - - /* - `.longclick( [ duration ], [ handler ] )` - - * If supplied, optional custom `duration` is used for target element(s). - * This method is a shortcut for `.click(duration, handler)` when at least `handler` is supplied - and for `.trigger("longclick")` if called without arguments. - * Returns *jQuery*. - */ - $.fn.longclick= function longclick(){ - var - args= [].splice.call(arguments, 0), - handler= args.pop(), - duration= args.pop(), - $this= $(this).data(_duration_, duration || null) - return handler ? $this.click(duration, handler) : $this.trigger(type) - } - - /* - Configuration - */ - $.longclick= { - /* - * For how long (in milliseconds) mouse button must be pressed down (or touched) stationery - to qualify as a *long click*. - * False value results in using the configured default. - * Default `duration` is **500** and is stored in `jQuery.longclick.duration` variable. - */ - duration: 600 - } - - /* - Bindings - */ - $.event.special.longclick= { - setup: function(data, namespaces){ - if (!(/iphone|ipad|ipod/i).test(navigator.userAgent)){ - /* normal technique for standard mouse-based interaction */ - $(this) - .bind(_mousedown_, schedule) - .bind([_mousemove_, _mouseup_, _mouseout_, _contextmenu_].join(' '), annul) - .bind(_click_, click) - }else{ - /* and special handling for touch-based interaction on iPhone-compatibile devices */ - touch_enabled(this) - .bind(_touchstart_, schedule) - .bind([_touchend_, _touchmove_, _touchcancel_].join(' '), annul) - .bind(_click_, click) - .css({ WebkitUserSelect: 'none' }) - } - }, - teardown: function(namespaces){ - $(this).unbind(namespace) - } - } - - /* - Commit subset of touch events to trigger jQuery events of same names - */ - function touch_enabled(element){ - $.each('touchstart touchmove touchend touchcancel'.split(/ /), function bind(ix, it){ - element.addEventListener(it, function trigger_jquery_event(event){ $(element).trigger(it) }, false); - }); - return $(element); - } - - /* - Handlers - */ - function schedule(event){ - /* Check the timer isn't already running and drop if so */ - if ($(this).data(_timer_)) return; - /* Catch in closure the `this` reference and `arguments` for later */ - var - element= this, - args= arguments - /* Flag as "not fired" and schedule the trigger */ - $(this) - .data(_fired_, false) - .data(_timer_, setTimeout(scheduled, $(this).data(_duration_) || $.longclick.duration)) - - function scheduled(){ - /* Flag as "fired" and rejoin the default event flow */ - $(element).data(_fired_, true) - event.type= type - jQuery.event.handle.apply(element, args) - //jQuery.event.dispatch.apply(element,args); - } - } - function annul(event){ - /* Annul the scheduled trigger */ - $(this).data(_timer_, clearTimeout($(this).data(_timer_)) || null) - } - function click(event){ - /* Prevent `click` event to be fired after button release once `longclick` was fired */ - if ($(this).data(_fired_)) return event.stopImmediatePropagation() || false - } - - /* - Frequent primitives and shortcuts - */ - var - type= 'longclick', - namespace= '.' + type, - - /* Event strings */ - _mousedown_= 'mousedown'+namespace, _click_= 'click'+namespace, - _mousemove_= 'mousemove'+namespace, _mouseup_= 'mouseup'+namespace, - _mouseout_= 'mouseout'+namespace, _contextmenu_= 'contextmenu'+namespace, - _touchstart_= 'touchstart'+namespace, _touchend_= 'touchend'+namespace, - _touchmove_= 'touchmove'+namespace, _touchcancel_= 'touchcancel'+namespace, - - /* Storage keys */ - _duration_= 'duration'+namespace, _timer_= 'timer'+namespace, _fired_= 'fired'+namespace - -})(jQuery); \ No newline at end of file +/** + * jQuery Longclick Event + * ====================== + * Press & hold mouse button "long click" special event for jQuery 1.4.x + * + * @license Longclick Event + * Copyright (c) 2014 Pascal GANAYE + * Largely based from from a work Petr Vostrel (http://petr.vostrel.cz/) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * Version: 0.4.0 + * Updated: 2014-10-13 + */ + + (function ($) { + /** `.longclick([ handler ], [ duration ])` + * If supplied, optional custom `duration` is used for target element(s). + * This method is a shortcut for `.trigger("longclick")` if called without arguments. + * Returns *jQuery*. + */ + $.fn.longclick = function longclick() { + var handler = arguments[0], + duration = arguments[1], + $this = $(this).data(_duration_, duration || null); + /* Bind long click */ + return handler ? $this.bind(type, handler) : $this.trigger(type); + }; + + /** + * Configuration + */ + $.longclick = { + /** + * For how long (in milliseconds) mouse button must be pressed down (or touched) stationery + * to qualify as a *long click*. + * False value results in using the configured default. + * Default `duration` is **600** and is stored in `jQuery.longclick.duration` variable. + */ + duration: 600 + }; + + /** + * Bindings + */ + $.event.special.longclick = { + setup: function (data, namespaces) { + if (!(/iphone|ipad|ipod/i).test(navigator.userAgent)) { + /* normal technique for standard mouse-based interaction */ + $(this) + .bind(_mousedown_, schedule) + .bind([_mouseup_, _mouseout_, _contextmenu_].join(' '), cancel) + .bind(_click_, click); + } else { + /* and special handling for touch-based interaction on iPhone-compatibile devices */ + touch_enabled(this) + .bind(_touchstart_, schedule) + .bind([_touchend_, _touchcancel_].join(' '), cancel) + .bind(_click_, click) + .css({WebkitUserSelect: 'none'}); + } + }, + teardown: function (namespaces) { + $(this).unbind(namespace); + } + }; + + /** + * Commit subset of touch events to trigger jQuery events of same names + */ + function touch_enabled(element) { + $.each('touchstart touchend touchcancel'.split(/ /), function bind(ix, it) { + element.addEventListener(it, function trigger_jquery_event(event) { + $(element).trigger(it); + }, false); + }); + return $(element); + } + + /** + * Handlers + */ + function schedule(event) { + /* Check the timer isn't already running and drop if so */ + if ($(this).data(_timer_)) return; + /* Catch in closure the `this` reference and `arguments` for later */ + var element = this; + var args = arguments; + + function scheduled() { + /* Flag as "fired" and rejoin the default event flow */ + $(element).data(_fired_, true) + .data(_timer_, null); + event.type = type; + var f = (jQuery.event.dispatch || jQuery.event.handle); + f.apply(element, args); + } + + /* Flag as "not fired" and schedule the trigger */ + $(this) + .data(_fired_, false) + .data(_timer_, setTimeout(scheduled, $(this).data(_duration_) || $.longclick.duration)); + + } + + function cancel(event) { + var timer = $(this).data(_timer_); + if (timer) { + /* cancel the scheduled trigger */ + $(this).data(_timer_, clearTimeout(timer) || null); + } + } + + function click(event) { + /* Prevent `click` event to be fired after button release once `longclick` was fired */ + if ($(this).data(_fired_)) return event.stopImmediatePropagation() || false; + } + + /* + * Frequent primitives and shortcuts + */ + var type = 'longclick', + namespace = '.' + type, + + /* Event strings */ + _mousedown_ = 'mousedown' + namespace, + _click_ = 'click' + namespace, + _mouseup_ = 'mouseup' + namespace, + _mouseout_ = 'mouseout' + namespace, + _contextmenu_ = 'contextmenu' + namespace, + _touchstart_ = 'touchstart' + namespace, + _touchend_ = 'touchend' + namespace, + _touchcancel_ = 'touchcancel' + namespace, + + /* Storage keys */ + _duration_ = 'duration' + namespace, + _timer_ = 'timer' + namespace, + _fired_ = 'fired' + namespace; + +})(jQuery); diff --git a/wire/modules/Jquery/JqueryCore/jquery.longclick.min.js b/wire/modules/Jquery/JqueryCore/jquery.longclick.min.js index 341ab9d7..21bf1a40 100644 --- a/wire/modules/Jquery/JqueryCore/jquery.longclick.min.js +++ b/wire/modules/Jquery/JqueryCore/jquery.longclick.min.js @@ -1 +1,15 @@ -(function(f){var l=f.fn.click;f.fn.click=function q(x,w){if(!w){return l.apply(this,arguments)}return f(this).data(t,x||null).bind(b,w)};f.fn.longclick=function n(){var w=[].splice.call(arguments,0),x=w.pop(),z=w.pop(),y=f(this).data(t,z||null);return x?y.click(z,x):y.trigger(b)};f.longclick={duration:600};f.event.special.longclick={setup:function(x,w){if(!(/iphone|ipad|ipod/i).test(navigator.userAgent)){f(this).bind(d,s).bind([a,c,h,i].join(" "),o).bind(v,q)}else{j(this).bind(r,s).bind([e,u,p].join(" "),o).bind(v,q).css({WebkitUserSelect:"none"})}},teardown:function(w){f(this).unbind(m)}};function j(w){f.each("touchstart touchmove touchend touchcancel".split(/ /),function x(y,z){w.addEventListener(z,function A(B){f(w).trigger(z)},false)});return f(w)}function s(y){if(f(this).data(g)){return}var x=this,w=arguments;f(this).data(k,false).data(g,setTimeout(z,f(this).data(t)||f.longclick.duration));function z(){f(x).data(k,true);y.type=b;jQuery.event.handle.apply(x,w)}}function o(w){f(this).data(g,clearTimeout(f(this).data(g))||null)}function q(w){if(f(this).data(k)){return w.stopImmediatePropagation()||false}}var b="longclick",m="."+b,d="mousedown"+m,v="click"+m,a="mousemove"+m,c="mouseup"+m,h="mouseout"+m,i="contextmenu"+m,r="touchstart"+m,e="touchend"+m,u="touchmove"+m,p="touchcancel"+m,t="duration"+m,g="timer"+m,k="fired"+m})(jQuery); \ No newline at end of file +/** + * jQuery Longclick Event + * ====================== + * Press & hold mouse button "long click" special event for jQuery 1.4.x + * + * @license Longclick Event + * Copyright (c) 2014 Pascal GANAYE + * Largely based from from a work Petr Vostrel (http://petr.vostrel.cz/) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * Version: 0.4.0 + * Updated: 2014-10-13 + */ +!function(t){function n(n){return t.each("touchstart touchend touchcancel".split(/ /),function(i,e){n.addEventListener(e,function(i){t(n).trigger(e)},!1)}),t(n)}function i(n){if(!t(this).data(b)){var i=this,e=arguments;t(this).data(m,!1).data(b,setTimeout(function(){t(i).data(m,!0).data(b,null),n.type=o,(jQuery.event.dispatch||jQuery.event.handle).apply(i,e)},t(this).data(g)||t.longclick.duration))}}function e(n){var i=t(this).data(b);i&&t(this).data(b,clearTimeout(i)||null)}function a(n){if(t(this).data(m))return n.stopImmediatePropagation()||!1}t.fn.longclick=function(){var n=arguments[0],i=arguments[1],e=t(this).data(g,i||null);return n?e.bind(o,n):e.trigger(o)},t.longclick={duration:600},t.event.special.longclick={setup:function(o,c){/iphone|ipad|ipod/i.test(navigator.userAgent)?n(this).bind(h,i).bind([f,p].join(" "),e).bind(d,a).css({WebkitUserSelect:"none"}):t(this).bind(u,i).bind([r,s,l].join(" "),e).bind(d,a)},teardown:function(n){t(this).unbind(c)}};var o="longclick",c="."+o,u="mousedown"+c,d="click"+c,r="mouseup"+c,s="mouseout"+c,l="contextmenu"+c,h="touchstart"+c,f="touchend"+c,p="touchcancel"+c,g="duration"+c,b="timer"+c,m="fired"+c}(jQuery); \ No newline at end of file diff --git a/wire/modules/Jquery/JqueryUI/modal.js b/wire/modules/Jquery/JqueryUI/modal.js index 8c1e8bd7..56ed7a9c 100644 --- a/wire/modules/Jquery/JqueryUI/modal.js +++ b/wire/modules/Jquery/JqueryUI/modal.js @@ -224,7 +224,7 @@ function pwModalWindow(href, options, size) { $iframe.dialog(settings); $iframe.data('settings', settings); - $iframe.load(function() { + $iframe.on('load', function() { if(typeof settings.title == "undefined" || !settings.title) { var title = jQuery('