All Downloads are FREE. Search and download functionalities are using the official Maven repository.

template.js.struts2.jquery.ui.struts2.min.js Maven / Gradle / Ivy

There is a newer version: 5.0.5
Show newest version
/*

 jquery.ui.struts2.js

 Integration of jquery and jquery ui with struts 2
 for ajax, widget and interactions support in struts 2

 Requires use of jQuery and jQuery UI.
 Tested with jQuery 2.1 and jQuery UI 1.11

 Copyright (c) 2010 - 2015 Johannes Geppert http://www.jgeppert.com

 Dual licensed under the MIT and GPL licenses:
   http://www.opensource.org/licenses/mit-license.php
   http://www.gnu.org/licenses/gpl.html

*/
'use strict';(function(e){e.struts2_jquery_ui={handler:{open_dialog:"_s2j_open_dialog",close_dialog:"_s2j_close_dialog",destroy_dialog:"_s2j_destroy_dialog"},opendialog:function(c,a){var b=this,d,k="_s2j_dialog_open_"+a.id;b.log("open dialog : "+a.opendialog);a.opendialog&&(d=e(b.escId(a.opendialog)),c.bind("click",function(c){if(e(this).prop("disabled"))return!1;b.subscribeTopics(d,k,b.handler.open_dialog,a);d.publish(k,a);return!1}))},draggable:function(c,a){var b=a.draggableoptions,d=window[b];
this.log("init draggable with id: "+a.id);this.loadAtOnce||this.require(["js/base/data"+this.minSuffix+".js","js/base/plugin"+this.minSuffix+".js","js/base/safe-active-element"+this.minSuffix+".js","js/base/safe-blur"+this.minSuffix+".js","js/base/scroll-parent"+this.minSuffix+".js","js/base/widget"+this.minSuffix+".js","js/base/mouse"+this.minSuffix+".js","js/base/draggable"+this.minSuffix+".js"]);d=d?{}:eval("( "+b+" )");d.start=this.pubTops(c,a.onalw,a.draggableonstarttopics);d.stop=this.pubTops(c,
a.onalw,a.draggableonstoptopics);d.drap=this.pubTops(c,a.onalw,a.draggableondragtopics);c.draggable(d)},droppable:function(c,a){var b=a.droppableoptions,d=window[b];this.log("droppable : "+a.id);this.loadAtOnce||this.require(["js/base/data"+this.minSuffix+".js","js/base/plugin"+this.minSuffix+".js","js/base/safe-active-element"+this.minSuffix+".js","js/base/safe-blur"+this.minSuffix+".js","js/base/scroll-parent"+this.minSuffix+".js","js/base/widget"+this.minSuffix+".js","js/base/mouse"+this.minSuffix+
".js","js/base/draggable"+this.minSuffix+".js","js/base/droppable"+this.minSuffix+".js"]);d=d?{}:eval("( "+b+" )");d.activate=this.pubTops(c,a.onalw,a.droppableonactivatetopics);d.deactivate=this.pubTops(c,a.onalw,a.droppableondeactivatetopics);d.start=this.pubTops(c,a.onalw,a.droppableonstarttopics);d.stop=this.pubTops(c,a.onalw,a.droppableonstoptopics);d.drop=this.pubTops(c,a.onalw,a.droppableondroptopics);d.over=this.pubTops(c,a.onalw,a.droppableonovertopics);d.out=this.pubTops(c,a.onalw,a.droppableonouttopics);
c.droppable(d)},selectable:function(c,a){var b=a.selectableoptions,d=window[b];this.log("selectable : "+a.id);this.loadAtOnce||this.require(["js/base/widget"+this.minSuffix+".js","js/base/mouse"+this.minSuffix+".js","js/base/selectable"+this.minSuffix+".js"]);d=d?{}:eval("( "+b+" )");d.selected=this.pubTops(c,a.onalw,a.selectableonselectedtopics);d.selecting=this.pubTops(c,a.onalw,a.selectableonselectingtopics);d.start=this.pubTops(c,a.onalw,a.selectableonstarttopics);d.stop=this.pubTops(c,a.onalw,
a.selectableonstoptopics);d.unselected=this.pubTops(c,a.onalw,a.selectableonunselectedtopics);d.unselecting=this.pubTops(c,a.onalw,a.selectableonunselectingtopics);c.selectable(d)},sortable:function(c,a){var b=a.sortableoptions,d=window[b];this.log("sortable : "+a.id);this.loadAtOnce||this.require(["js/base/widget"+this.minSuffix+".js","js/base/mouse"+this.minSuffix+".js","js/base/data"+this.minSuffix+".js","js/base/ie"+this.minSuffix+".js","js/base/scroll-parent"+this.minSuffix+".js","js/base/sortable"+
this.minSuffix+".js"]);d=d?{}:eval("( "+b+" )");d.beforeStop=this.pubTops(c,a.onalw,a.sortableonbeforestoptopics);d.stop=this.pubTops(c,a.onalw,a.sortableonstoptopics);d.start=this.pubTops(c,a.onalw,a.sortableonstarttopics);d.sort=this.pubTops(c,a.onalw,a.sortableonsorttopics);d.activate=this.pubTops(c,a.onalw,a.sortableonactivatetopics);d.deactivate=this.pubTops(c,a.onalw,a.sortableondeactivatetopics);d.over=this.pubTops(c,a.onalw,a.sortableonovertopics);d.out=this.pubTops(c,a.onalw,a.sortableonouttopics);
d.remove=this.pubTops(c,a.onalw,a.sortableonremovetopics);d.receive=this.pubTops(c,a.onalw,a.sortableonreceivetopics);d.change=this.pubTops(c,a.onalw,a.sortableonchangetopics);d.update=this.pubTops(c,a.onalw,a.sortableonupdatetopics);c.sortable(d)},resizable:function(c,a){var b=a.resizableoptions,d=window[b];this.loadAtOnce||this.require(["js/base/widget"+this.minSuffix+".js","js/base/mouse"+this.minSuffix+".js","js/base/disable-selection"+this.minSuffix+".js","js/base/plugin"+this.minSuffix+".js",
"js/base/resizable"+this.minSuffix+".js"]);d=d?{}:eval("( "+b+" )");d.start=this.pubTops(c,a.onalw,a.resizableonstarttopics);d.stop=this.pubTops(c,a.onalw,a.resizableonstoptopics);d.resize=this.pubTops(c,a.onalw,a.resizableonresizetopics);c.resizable(d)},dialog:function(c,a){var b=this;b.log("init dialog with id: "+a.id);var d=["js/base/widget"+b.minSuffix+".js","js/base/mouse"+b.minSuffix+".js","js/base/position"+b.minSuffix+".js","js/base/data"+b.minSuffix+".js","js/base/disable-selection"+b.minSuffix+
".js","js/base/plugin"+b.minSuffix+".js","js/base/resizable"+b.minSuffix+".js","js/base/focusable"+b.minSuffix+".js","js/base/keycode"+b.minSuffix+".js","js/base/scroll-parent"+b.minSuffix+".js","js/base/safe-active-element"+b.minSuffix+".js","js/base/safe-blur"+b.minSuffix+".js","js/base/tabbable"+b.minSuffix+".js","js/base/unique-id"+b.minSuffix+".js","js/base/draggable"+b.minSuffix+".js","js/base/button"+b.minSuffix+".js","js/base/dialog"+b.minSuffix+".js"];(a.hide||a.show)&&d.push("js/base/effect"+
b.minSuffix+".js");a.hide&&d.push("js/base/effect-"+a.hide+b.minSuffix+".js");a.show&&d.push("js/base/effect-"+a.show+b.minSuffix+".js");a.resizable&&d.push("js/base/resizable"+b.minSuffix+".js");a.draggable&&d.push("js/base/draggable"+b.minSuffix+".js");b.loadAtOnce||b.require(d);a.opentopics&&b.subscribeTopics(c,a.opentopics,b.handler.open_dialog,a);a.closetopics&&b.subscribeTopics(c,a.closetopics,b.handler.close_dialog,a);a.destroytopics&&b.subscribeTopics(c,a.destroytopics,b.handler.destroy_dialog,
a);a.open=function(d,e){var h={},g="_s2j_topic_load_"+a.id;h.event=d;h.ui=e;a.href&&"#"!==a.href&&(b.subscribeTopics(c,g,b.handler.load,a),c.publish(g));b.publishTopic(c,a.onalw,h);b.publishTopic(c,a.onbef,h);b.publishTopic(c,a.onopentopics,h)};a.close=b.pubTops(c,a.onalw,a.onclosetopics);a.focus=b.pubTops(c,a.onalw,a.onfocustopics);a.beforeClose=function(){var d={close:!0};b.publishTopic(c,a.onalw,d);b.publishTopic(c,a.onbeforeclosetopics,d);return d.close};a.drag=b.pubTops(c,a.onalw,a.oncha);c.data("s2j_options",
a);c.dialog(a)},tabbedpanel:function(c,a){var b=this,d={},k=a.disabledtabs,f=window[k],h=c.data("taboptions"),g="",m=!1;b.log("tabbedpanel : "+a.id);b.loadAtOnce||b.require(["js/base/escape-selector"+b.minSuffix+".js","js/base/keycode"+b.minSuffix+".js","js/base/safe-active-element"+b.minSuffix+".js","js/base/unique-id"+b.minSuffix+".js","js/base/widget"+b.minSuffix+".js","js/base/tabs"+b.minSuffix+".js"]);a.disabledtabs&&"false"!==a.disabledtabs&&!f&&(a.disabled=eval("( "+k+" )"));a.openonmouseover&&
(a.event="mouseover");a.cookie&&b.require("js/base/jquery.cookie"+b.minSuffix+".js");a.selectedtab?a.active=a.selectedtab:a.cookie&&(a.active=e.cookie(c.prop("id")));a.show&&(b.require("js/base/effect"+b.minSuffix+".js"),"string"===e.type(a.show)&&b.require("js/base/effect-"+a.show+b.minSuffix+".js"));a.hide&&(b.require("js/base/effect"+b.minSuffix+".js"),"string"===e.type(a.hide)&&b.require("js/base/effect-"+a.hide+b.minSuffix+".js"));a.ajaxOptions={dataType:"html"};a.beforeLoad=function(d,e){var g=
{},f=""+e.tab.data("form");g.event=d;g.ui=e;f&&(e.ajaxSettings.url=b.addForms(f,e.ajaxSettings.url));a.onbef&&(b.publishTopic(c,a.onbef,g),b.publishTopic(c,a.onalw,g));a.cache&&(e.tab.data("loaded")?d.preventDefault():e.jqXHR.success(function(){e.tab.data("loaded",!0)}))};a.activate=function(d,g){var f={};f.event=d;f.ui=g;a.cookie&&e.cookie(c.prop("id"),g.newTab.index(),{name:"tab"+a.id,expires:365});a.oncha&&(b.publishTopic(c,a.oncha,f),b.publishTopic(c,a.onalw,f))};a.oncom&&(a.load=b.pubTops(c,
a.onalw,a.oncom));a.onactivatetopics&&(a.load=b.pubTops(c,a.onalw,a.onactivatetopics));a.onbefacttopics&&(a.load=b.pubTops(c,a.onalw,a.onbefacttopics));if(h){for(k=0;ke;)f=c[e],e++;else if(a)return a[d]};d.abortReq(a.id);d.showIndicator(a.indicatorid);d.currentXhr[a.id]=e.ajax({url:d.addForms(a.formids,k),dataType:"json",data:{term:b.term},complete:function(b,c){d.hideIndicator(a.indicatorid)},
success:function(k){d.currentXhr[a.id]=null;var n=0,p=!1,l=[];null!==k[a.list]&&(e.isArray(k[a.list])||(p=!0),e.each(k[a.list],function(c,d){if(p)l.push({label:d.replace(new RegExp("(?![^\x26;]+;)(?!\x3c[^\x3c\x3e]*)("+e.ui.autocomplete.escapeRegex(b.term)+")(?![^\x3c\x3e]*\x3e)(?![^\x26;]+;)","gi"),"\x3cstrong\x3e$1\x3c/strong\x3e"),value:d,key:c});else if(void 0!==a.listkey&&void 0!==a.listvalue){var g;g=a.listlabel?d[a.listlabel]:d[a.listvalue].replace(new RegExp("(?![^\x26;]+;)(?!\x3c[^\x3c\x3e]*)("+
e.ui.autocomplete.escapeRegex(b.term)+")(?![^\x3c\x3e]*\x3e)(?![^\x26;]+;)","gi"),"\x3cstrong\x3e$1\x3c/strong\x3e");l.push({label:g,value:d[a.listvalue],key:m(d,a.listkey)})}else l.push({label:k[a.list][n].replace(new RegExp("(?![^\x26;]+;)(?!\x3c[^\x3c\x3e]*)("+e.ui.autocomplete.escapeRegex(b.term)+")(?![^\x3c\x3e]*\x3e)(?![^\x26;]+;)","gi"),"\x3cstrong\x3e$1\x3c/strong\x3e"),value:k[a.list][n],key:k[a.list][n]});n++}),c(l))}})}:b.addForms(a.formids,k):a.list&&!1===a.selectBox&&(d.source=a.list);
a.delay&&(d.delay=a.delay);a.minimum&&(d.minLength=a.minimum);!1===a.forceValidOption&&c.keyup(function(d){e(b.escId(a.hiddenid)).val(c.val())});a.onsuc&&(d.open=b.pubTops(c,a.onalw,a.onsuc));a.oncha&&(d.change=b.pubTops(c,a.onalw,a.oncha));a.oncom&&(d.close=b.pubTops(c,a.onalw,a.oncom));a.onsearchtopics&&(d.search=b.pubTops(c,a.onalw,a.onsearchtopics));a.onfocustopics&&(d.focus=b.pubTops(c,a.onalw,a.onfocustopics));d.select=function(f,h){if(a.onselecttopics){d.select=b.pubTops(c,a.onalw,a.onselecttopics);
var g={};g.event=f;g.ui=h;b.publishTopic(c,a.onalw,g);b.publishTopic(c,a.onselecttopics,g)}h.item&&(h.item.option?e(b.escId(a.hiddenid)).val(h.item.option.value):h.item.key?e(b.escId(a.hiddenid)).val(h.item.key):e(b.escId(a.hiddenid)).val(h.item.value))};!1===a.selectBox?c.autocomplete(d):(b.loadAtOnce||b.require(["js/base/button"+b.minSuffix+".js","js/base/tooltip"+b.minSuffix+".js"]),b.requireCss("themes/s2j-combobox.css"),b.require(["js/plugins/jquery.combobox"+b.minSuffix+".js"]),d.icon=a.selectBoxIcon?
!0:!1,c.combobox(d))},jquerybutton:function(c,a){var b={};this.log("init button with id: "+a.id);this.loadAtOnce||this.require(["js/base/escape-selector"+this.minSuffix+".js","js/base/form"+this.minSuffix+".js","js/base/form-reset-mixin"+this.minSuffix+".js","js/base/labels"+this.minSuffix+".js","js/base/keycode"+this.minSuffix+".js","js/base/widget"+this.minSuffix+".js","js/base/controlgroup"+this.minSuffix+".js","js/base/checkboxradio"+this.minSuffix+".js","js/base/button"+this.minSuffix+".js"]);
a.button&&(b.icons={},a.bicon&&(b.icons.primary=a.bicon),a.bicon2&&(b.icons.secondary=a.bicon2),void 0!==a.btext&&(b.text=a.btext),c.button(b))},buttonset:function(c,a){var b="_s2j_topic_load_"+a.id,d="s2j_buttonset_"+a.id;this.log("init buttonset with id: "+a.id);this.loadAtOnce||this.require(["js/base/escape-selector"+this.minSuffix+".js","js/base/form"+this.minSuffix+".js","js/base/form-reset-mixin"+this.minSuffix+".js","js/base/labels"+this.minSuffix+".js","js/base/keycode"+this.minSuffix+".js",
"js/base/widget"+this.minSuffix+".js","js/base/controlgroup"+this.minSuffix+".js","js/base/checkboxradio"+this.minSuffix+".js","js/base/button"+this.minSuffix+".js"]);a.href&&"#"!==a.href?(c.isSubscribed(d)&&c.destroyTopic(d),c.subscribe(d,function(b,d){var h=c.find("input[type\x3dradio], input[type\x3dcheckbox]");a.oncha&&(0==e.support.leadingWhitespace&&"radio"===a.type?h.click(function(){this.blur();this.focus();e.each(a.oncha.split(","),function(a,b){c.publish(b)})}):h.change(function(){e.each(a.oncha.split(","),
function(a,b){c.publish(b)})}));a.buttonset&&(h.checkboxradio(a),c.controlgroup(a))}),a.onsuc=d,this.subscribeTopics(c,a.reloadtopics,this.handler.load,a),this.subscribeTopics(c,a.listentopics,this.handler.load,a),c.subscribe(b,this.handler.load),c.publish(b,a)):(b=c.find("input[type\x3dradio], input[type\x3dcheckbox]"),a.oncha&&b.change(function(){e.each(a.oncha.split(","),function(a,b){c.publish(b)})}),a.buttonset&&(b.checkboxradio(a),c.controlgroup(a)))}};e.subscribeHandler(e.struts2_jquery_ui.handler.open_dialog,
function(c,a){var b=e.struts2_jquery_ui,d=e(this).data("s2j_options");a&&(a.href&&"#"!==a.href&&(d.href=a.href),a.hrefparameter&&(d.hrefparameter=a.hrefparameter),a.formids&&(d.formids=a.formids),a.opendialogtitle&&(d.opendialogtitle=a.opendialogtitle));e(this).dialog("option","open",function(a,c){var h={},g="_s2j_topic_load_"+d.id;h.event=a;h.ui=c;d.href&&"#"!==d.href&&(b.subscribeTopics(e(this),g,b.handler.load,d),e(this).publish(g));b.publishTopic(e(this),d.onalw,h);b.publishTopic(e(this),d.onbef,
h);b.publishTopic(e(this),d.onopentopics,h)});d.opendialogtitle&&e(this).dialog("option","title",d.opendialogtitle);e(this).dialog("open")});e.subscribeHandler(e.struts2_jquery_ui.handler.close_dialog,function(c,a){e(this).dialog("close")});e.subscribeHandler(e.struts2_jquery_ui.handler.destroy_dialog,function(c,a){e(this).dialog("destroy")});e.extend(!0,e.struts2_jquery_ui,e.struts2_jquery);e.struts2_jquery_ui.debugPrefix="[struts2_jquery_ui] "})(jQuery);




© 2015 - 2024 Weber Informatics LLC | Privacy Policy