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

root.libs.composum.nodes.commons.components.js.core.min.js Maven / Gradle / Ivy

(function(){window.composum=window.CPM=window.CPM||{};CPM.namespace=function(a,b){b=void 0===b?window.CPM:b;a.split(".").forEach(function(a){_.isObject(b[a])||(b[a]={});b=b[a]})};window.core=CPM.core={const:{url:{sling:/^((https?):\/\/([^:/]+)(:([^/]+))?)?(\/[^.?]*)(\.(([^/?]+)\.)?([^./?]+))?(\/[^?]*)?(\?(.*))?$/},alert:{type:{error:"danger",warn:"warning"}}},log:log.getLogger("core"),getHtml:function(a,b,d,c){core.ajaxGet(a,{dataType:"html"},b,d,c)},getJson:function(a,b,d,c){core.ajaxGet(a,{dataType:"json"},
b,d,c)},ajaxHead:function(a,b,d,c,e){a=_.extend({type:"HEAD",url:core.getContextUrl(a)},b);core.ajaxCall(a,d,c,e)},ajaxGet:function(a,b,d,c,e){a=_.extend({type:"GET",url:core.getContextUrl(a)},b);core.ajaxCall(a,d,c,e)},ajaxPost:function(a,b,d,c,e,f){a=_.extend({type:"POST",url:core.getContextUrl(a),data:b},d);core.ajaxCall(a,c,e,f)},ajaxPut:function(a,b,d,c,e,f){a=_.extend({type:"PUT",contentType:!1,url:core.getContextUrl(a),data:b},d);core.ajaxCall(a,c,e,f)},ajaxDelete:function(a,b,d,c,e){a=_.extend({type:"DELETE",
contentType:!1,url:core.getContextUrl(a)},b);core.ajaxCall(a,d,c,e)},ajaxCall:function(a,b,d,c){var e=_.extend({async:!0,cache:!1,success:function(a,c,d){_.isFunction(b)&&b(a,c,d)},error:function(f){core.isNotAuthorized(f)&&_.isFunction(core.unauthorizedDelegate)?core.unauthorizedDelegate(function(){core.ajaxCall(a,b,d,c)}):200>f.status||299f.indexOf("/j_security_check")&&core.isNotAuthorized(e)&&_.isFunction(core.unauthorizedDelegate)?core.unauthorizedDelegate(function(){core.submitForm(a,
b,d,c)}):200>e.status||299f.status||299(.+)<\/title>/im.exec(a.responseText),c=/
.*Exception: ?(.+)<\/div>/im.exec(a.responseText);return(b?b:"")+(d?(b?" - ":"")+d[1]+(c?" ("+c[1]+")":""):(b?" - ":"")+(a.responseText?a.responseText:a.status+": "+a.statusText))},getContextUrl:function(a){if(a&&!a.match(/^https?:\/\//i)){var b=$("html").data("context-path");b&&0!==a.indexOf(b)&&(a=b+a)}return a},getView:function(a,b,d,c){return core.getWidget(document,a,b,d,c)},getWidget:function(a,b,d,c,e){a=$(a);if((b= "string"===typeof b?a.is(b)?a:a.find(b):$(b))&&0




© 2015 - 2024 Weber Informatics LLC | Privacy Policy