Y-SLD/assets/playkit/js/usermain-36392347b7.js

1 line
8.6 KiB
JavaScript

function showMsg(e,t){"add"==e?swal("Added!",t,"success"):"update"==e?swal("Updated!",t,"success"):"deleted"==e?swal("Deleted!",t,"success"):"success"==e?swal({title:"Success!",text:t,html:!0,type:"success"}):swal({title:"Error!",text:t,html:!0,type:"error"})}function ajaxRequest(e,t,r,o,i){jQuery.ajax({url:baseURL+e,type:t,dataType:r,data:o}).done(function(e){i(e)}).fail(function(e){var e=JSON.parse(e.responseText),t="<ul>";$.each(e,function(e,r){t+="<li>"+r+"</li>"}),t+="</ul>",showMsg("error",t)}).always(function(){})}function getDetailsByAttr(e,t,r){var o=[];for(var i in e)e.hasOwnProperty(i)&&("object"==typeof e[i]?o=o.concat(getDetailsByAttr(e[i],t,r)):i==t&&e[t]==r&&o.push(e));return o}function validateForm(e){e.validate({errorElement:"span",errorClass:"help-inline",focusInvalid:!1,rules:{},messages:{}})}function uniqId(e){return e+Math.round((new Date).getTime()+1e13*Math.random())}function sort_value_layer(e,t){return e.order<t.order?-1:e.order>t.order?1:0}function isGoogle(){return"undefined"!=typeof map&&92==map.id||1==googleMapsDefault}!function(e){e.fn.extend({slimScroll:function(r){var o=e.extend({width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:.4,alwaysVisible:!1,disableFadeOut:!1,railVisible:!1,railColor:"#333",railOpacity:.2,railDraggable:!0,railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:!1,wheelStep:20,touchScrollStep:200,borderRadius:"7px",railBorderRadius:"7px"},r);return this.each(function(){function i(t){if(u){t=t||window.event;var r=0;t.wheelDelta&&(r=-t.wheelDelta/120),t.detail&&(r=t.detail/3),e(t.target||t.srcTarget||t.srcElement).closest("."+o.wrapperClass).is(y.parent())&&n(r,!0),t.preventDefault&&!b&&t.preventDefault(),b||(t.returnValue=!1)}}function n(e,t,r){b=!1;var i=y.outerHeight()-m.outerHeight();t&&(t=parseInt(m.css("top"))+e*parseInt(o.wheelStep)/100*m.outerHeight(),t=Math.min(Math.max(t,0),i),t=0<e?Math.ceil(t):Math.floor(t),m.css({top:t+"px"})),g=parseInt(m.css("top"))/(y.outerHeight()-m.outerHeight()),t=g*(y[0].scrollHeight-y.outerHeight()),r&&(t=e,e=t/y[0].scrollHeight*y.outerHeight(),e=Math.min(Math.max(e,0),i),m.css({top:e+"px"})),y.scrollTop(t),y.trigger("slimscrolling",~~t),s(),l()}function a(){d=Math.max(y.outerHeight()/y[0].scrollHeight*y.outerHeight(),30),m.css({height:d+"px"});var e=d==y.outerHeight()?"none":"block";m.css({display:e})}function s(){a(),clearTimeout(f),g==~~g?(b=o.allowPageScroll,v!=g&&y.trigger("slimscroll",0==~~g?"top":"bottom")):b=!1,v=g,d>=y.outerHeight()?b=!0:(m.stop(!0,!0).fadeIn("fast"),o.railVisible&&x.stop(!0,!0).fadeIn("fast"))}function l(){o.alwaysVisible||(f=setTimeout(function(){o.disableFadeOut&&u||c||p||(m.fadeOut("slow"),x.fadeOut("slow"))},1e3))}var u,c,p,f,h,d,g,v,b=!1,y=e(this);if(y.parent().hasClass(o.wrapperClass)){var w=y.scrollTop(),m=y.siblings("."+o.barClass),x=y.siblings("."+o.railClass);if(a(),e.isPlainObject(r)){if("height"in r&&"auto"==r.height){y.parent().css("height","auto"),y.css("height","auto");var S=y.parent().parent().height();y.parent().css("height",S),y.css("height",S)}else"height"in r&&(S=r.height,y.parent().css("height",S),y.css("height",S));if("scrollTo"in r)w=parseInt(o.scrollTo);else if("scrollBy"in r)w+=parseInt(o.scrollBy);else if("destroy"in r)return m.remove(),x.remove(),void y.unwrap();n(w,!1,!0)}}else if(!(e.isPlainObject(r)&&"destroy"in r)){o.height="auto"==o.height?y.parent().height():o.height,w=e("<div></div>").addClass(o.wrapperClass).css({position:"relative",overflow:"hidden",width:o.width,height:o.height}),y.css({overflow:"hidden",width:o.width,height:o.height});var x=e("<div></div>").addClass(o.railClass).css({width:o.size,height:"100%",position:"absolute",top:0,display:o.alwaysVisible&&o.railVisible?"block":"none","border-radius":o.railBorderRadius,background:o.railColor,opacity:o.railOpacity,zIndex:90}),m=e("<div></div>").addClass(o.barClass).css({background:o.color,width:o.size,position:"absolute",top:0,opacity:o.opacity,display:o.alwaysVisible?"block":"none","border-radius":o.borderRadius,BorderRadius:o.borderRadius,MozBorderRadius:o.borderRadius,WebkitBorderRadius:o.borderRadius,zIndex:99}),S="right"==o.position?{right:o.distance}:{left:o.distance};x.css(S),m.css(S),y.wrap(w),y.parent().append(m),y.parent().append(x),o.railDraggable&&m.bind("mousedown",function(r){var o=e(document);return p=!0,t=parseFloat(m.css("top")),pageY=r.pageY,o.bind("mousemove.slimscroll",function(e){currTop=t+e.pageY-pageY,m.css("top",currTop),n(0,m.position().top,!1)}),o.bind("mouseup.slimscroll",function(e){p=!1,l(),o.unbind(".slimscroll")}),!1}).bind("selectstart.slimscroll",function(e){return e.stopPropagation(),e.preventDefault(),!1}),x.hover(function(){s()},function(){l()}),m.hover(function(){c=!0},function(){c=!1}),y.hover(function(){u=!0,s(),l()},function(){u=!1,l()}),y.bind("touchstart",function(e,t){e.originalEvent.touches.length&&(h=e.originalEvent.touches[0].pageY)}),y.bind("touchmove",function(e){b||e.originalEvent.preventDefault(),e.originalEvent.touches.length&&(n((h-e.originalEvent.touches[0].pageY)/o.touchScrollStep,!0),h=e.originalEvent.touches[0].pageY)}),a(),"bottom"===o.start?(m.css({top:y.outerHeight()-m.outerHeight()}),n(0,!0)):"top"!==o.start&&(n(e(o.start).position().top,null,!0),o.alwaysVisible||m.hide()),window.addEventListener?(this.addEventListener("DOMMouseScroll",i,!1),this.addEventListener("mousewheel",i,!1)):document.attachEvent("onmousewheel",i)}}),this}}),e.fn.extend({slimscroll:e.fn.slimScroll})}(jQuery),"object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(e){return e<10?"0"+e:e}function this_value(){return this.valueOf()}function quote(e){return rx_escapable.lastIndex=0,rx_escapable.test(e)?'"'+e.replace(rx_escapable,function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var r,o,i,n,a,s=gap,l=t[e];switch(l&&"object"==typeof l&&"function"==typeof l.toJSON&&(l=l.toJSON(e)),"function"==typeof rep&&(l=rep.call(t,e,l)),typeof l){case"string":return quote(l);case"number":return isFinite(l)?String(l):"null";case"boolean":case"null":return String(l);case"object":if(!l)return"null";if(gap+=indent,a=[],"[object Array]"===Object.prototype.toString.apply(l)){for(n=l.length,r=0;r<n;r+=1)a[r]=str(r,l)||"null";return i=0===a.length?"[]":gap?"[\n"+gap+a.join(",\n"+gap)+"\n"+s+"]":"["+a.join(",")+"]",gap=s,i}if(rep&&"object"==typeof rep)for(n=rep.length,r=0;r<n;r+=1)"string"==typeof rep[r]&&(o=rep[r],i=str(o,l),i&&a.push(quote(o)+(gap?": ":":")+i));else for(o in l)Object.prototype.hasOwnProperty.call(l,o)&&(i=str(o,l),i&&a.push(quote(o)+(gap?": ":":")+i));return i=0===a.length?"{}":gap?"{\n"+gap+a.join(",\n"+gap)+"\n"+s+"}":"{"+a.join(",")+"}",gap=s,i}}var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;"function"!=typeof JSON.stringify&&(meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(e,t,r){var o;if(gap="",indent="","number"==typeof r)for(o=0;o<r;o+=1)indent+=" ";else"string"==typeof r&&(indent=r);if(rep=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw new Error("JSON.stringify");return str("",{"":e})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(e,t){var r,o,i=e[t];if(i&&"object"==typeof i)for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(o=walk(i,r),void 0!==o?i[r]=o:delete i[r]);return reviver.call(e,t,i)}var j;if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(),jQuery(document).ready(function(){jQuery("#global_geoserver_id").change(function(){window.location=baseURL+"/developer/geoserver/current/update/"+jQuery(this).val()})});