pbca26
8 years ago
141 changed files with 0 additions and 33768 deletions
Binary file not shown.
@ -1,23 +0,0 @@ |
|||
<installerInformation> |
|||
<versionId>1</versionId> |
|||
<version>0.1.5e-beta</version> |
|||
<platformFileList> |
|||
<platformFile> |
|||
<filename>IguanaApp-0.1.5.5e-beta-win32-x64.zip</filename> |
|||
<platform>windows</platform> |
|||
</platformFile> |
|||
<platformFile> |
|||
<filename>IguanaApp-0.1.5.5e-beta-linux-x64.tar.gz</filename> |
|||
<platform>linux</platform> |
|||
</platformFile> |
|||
<platformFile> |
|||
<filename>IguanaApp-0.1.5.5e-beta-osx.app.zip</filename> |
|||
<platform>osx</platform> |
|||
</platformFile> |
|||
</platformFileList> |
|||
<downloadLocationList> |
|||
<downloadLocation> |
|||
<url>https://github.com/SuperNETorg/iguana/releases/tag/v0.1.5.5e-beta/</url> |
|||
</downloadLocation> |
|||
</downloadLocationList> |
|||
</installerInformation> |
@ -1,93 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
$.components.register("alertify", { |
|||
mode: "api", |
|||
defaults: { |
|||
type: "alert", |
|||
delay: 5000, |
|||
theme: 'bootstrap' |
|||
}, |
|||
api: function() { |
|||
if (typeof alertify === "undefined") return; |
|||
|
|||
var defaults = $.components.getDefaults("alertify"); |
|||
|
|||
$(document).on('click.site.alertify', '[data-plugin="alertify"]', function() { |
|||
var $this = $(this), |
|||
options = $.extend(true, {}, defaults, $this.data()); |
|||
|
|||
if (options.labelOk) { |
|||
options.okBtn = options.labelOk; |
|||
} |
|||
|
|||
if (options.labelCancel) { |
|||
options.cancelBtn = options.labelCancel; |
|||
} |
|||
|
|||
if (typeof options.delay !== 'undefined') { |
|||
alertify.delay(options.delay); |
|||
} |
|||
|
|||
if (typeof options.theme !== 'undefined') { |
|||
alertify.theme(options.theme); |
|||
} |
|||
|
|||
if (typeof options.cancelBtn !== 'undefined') { |
|||
alertify.cancelBtn(options.cancelBtn); |
|||
} |
|||
|
|||
if (typeof options.okBtn !== 'undefined') { |
|||
alertify.okBtn(options.okBtn); |
|||
} |
|||
|
|||
if (typeof options.placeholder !== 'undefined') { |
|||
alertify.delay(options.placeholder); |
|||
} |
|||
|
|||
if (typeof options.defaultValue !== 'undefined') { |
|||
alertify.delay(options.defaultValue); |
|||
} |
|||
|
|||
if (typeof options.maxLogItems !== 'undefined') { |
|||
alertify.delay(options.maxLogItems); |
|||
} |
|||
|
|||
if (typeof options.closeLogOnClick !== 'undefined') { |
|||
alertify.delay(options.closeLogOnClick); |
|||
} |
|||
|
|||
switch (options.type) { |
|||
case "alert": |
|||
alertify.alert(options.alertMessage); |
|||
break; |
|||
case "confirm": |
|||
alertify.confirm(options.confirmTitle, function() { |
|||
alertify.success(options.successMessage); |
|||
}, function() { |
|||
alertify.error(options.errorMessage); |
|||
}); |
|||
break; |
|||
case "prompt": |
|||
alertify.prompt(options.promptTitle, function(str, ev) { |
|||
var message = options.successMessage.replace('%s', str); |
|||
alertify.success(message); |
|||
}, function(ev) { |
|||
alertify.error(options.errorMessage); |
|||
}); |
|||
break; |
|||
case "log": |
|||
alertify.log(options.logMessage); |
|||
break; |
|||
case "success": |
|||
alertify.success(options.successMessage); |
|||
break; |
|||
case "error": |
|||
alertify.error(options.errorMessage); |
|||
break; |
|||
} |
|||
}); |
|||
} |
|||
}); |
@ -1,81 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
$.components.register("animsition", { |
|||
mode: "manual", |
|||
defaults: { |
|||
inClass: 'fade-in', |
|||
outClass: 'fade-out', |
|||
inDuration: 800, |
|||
outDuration: 500, |
|||
linkElement: '.animsition-link', |
|||
loading: true, |
|||
loadingParentElement: "body", |
|||
loadingClass: "loader", |
|||
loadingType: "default", |
|||
timeout: false, |
|||
timeoutCountdown: 5000, |
|||
onLoadEvent: true, |
|||
browser: ['animation-duration', '-webkit-animation-duration'], |
|||
overlay: false, |
|||
// random: true,
|
|||
overlayClass: 'animsition-overlay-slide', |
|||
overlayParentElement: "body", |
|||
|
|||
inDefaults: [ |
|||
'fade-in', |
|||
'fade-in-up-sm', 'fade-in-up', 'fade-in-up-lg', |
|||
'fade-in-down-sm', 'fade-in-down', 'fade-in-down-lg', |
|||
'fade-in-left-sm', 'fade-in-left', 'fade-in-left-lg', |
|||
'fade-in-right-sm', 'fade-in-right', 'fade-in-right-lg', |
|||
// 'overlay-slide-in-top', 'overlay-slide-in-bottom', 'overlay-slide-in-left', 'overlay-slide-in-right',
|
|||
'zoom-in-sm', 'zoom-in', 'zoom-in-lg' |
|||
], |
|||
outDefaults: [ |
|||
'fade-out', |
|||
'fade-out-up-sm', 'fade-out-up', 'fade-out-up-lg', |
|||
'fade-out-down-sm', 'fade-out-down', 'fade-out-down-lg', |
|||
'fade-out-left-sm', 'fade-out-left', 'fade-out-left-lg', |
|||
'fade-out-right-sm', 'fade-out-right', 'fade-out-right-lg', |
|||
// 'overlay-slide-out-top', 'overlay-slide-out-bottom', 'overlay-slide-out-left', 'overlay-slide-out-right'
|
|||
'zoom-out-sm', 'zoom-out', 'zoom-out-lg' |
|||
] |
|||
}, |
|||
init: function(context, callback) { |
|||
var options = $.components.getDefaults("animsition"); |
|||
|
|||
if (options.random) { |
|||
var li = options.inDefaults.length, |
|||
lo = options.outDefaults.length; |
|||
|
|||
var ni = parseInt(li * Math.random(), 0), |
|||
no = parseInt(lo * Math.random(), 0); |
|||
|
|||
options.inClass = options.inDefaults[ni]; |
|||
options.outClass = options.outDefaults[no]; |
|||
} |
|||
|
|||
var $this = $(".animsition", context); |
|||
|
|||
$this.animsition(options); |
|||
|
|||
$("." + options.loadingClass).addClass('loader-' + options.loadingType); |
|||
|
|||
if ($this.animsition('supportCheck', options)) { |
|||
if ($.isFunction(callback)) { |
|||
$this.one('animsition.end', function() { |
|||
callback.call(); |
|||
}); |
|||
} |
|||
|
|||
return true; |
|||
} else { |
|||
if ($.isFunction(callback)) { |
|||
callback.call(); |
|||
} |
|||
return false; |
|||
} |
|||
} |
|||
}); |
@ -1,6 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
$.components.register("animsition",{mode:"manual",defaults:{inClass:"fade-in",outClass:"fade-out",inDuration:800,outDuration:500,linkElement:".animsition-link",loading:!0,loadingParentElement:"body",loadingClass:"loader",loadingType:"default",timeout:!1,timeoutCountdown:5e3,onLoadEvent:!0,browser:["animation-duration","-webkit-animation-duration"],overlay:!1,overlayClass:"animsition-overlay-slide",overlayParentElement:"body",inDefaults:["fade-in","fade-in-up-sm","fade-in-up","fade-in-up-lg","fade-in-down-sm","fade-in-down","fade-in-down-lg","fade-in-left-sm","fade-in-left","fade-in-left-lg","fade-in-right-sm","fade-in-right","fade-in-right-lg","zoom-in-sm","zoom-in","zoom-in-lg"],outDefaults:["fade-out","fade-out-up-sm","fade-out-up","fade-out-up-lg","fade-out-down-sm","fade-out-down","fade-out-down-lg","fade-out-left-sm","fade-out-left","fade-out-left-lg","fade-out-right-sm","fade-out-right","fade-out-right-lg","zoom-out-sm","zoom-out","zoom-out-lg"]},init:function(context,callback){var options=$.components.getDefaults("animsition");if(options.random){var li=options.inDefaults.length,lo=options.outDefaults.length,ni=parseInt(li*Math.random(),0),no=parseInt(lo*Math.random(),0);options.inClass=options.inDefaults[ni],options.outClass=options.outDefaults[no]}var $this=$(".animsition",context);return $this.animsition(options),$("."+options.loadingClass).addClass("loader-"+options.loadingType),$this.animsition("supportCheck",options)?($.isFunction(callback)&&$this.one("animsition.end",function(){callback.call()}),!0):($.isFunction(callback)&&callback.call(),!1)}}); |
@ -1,6 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
$.components.register("progress",{mode:"init",defaults:{bootstrap:!0,onUpdate:function(n){var per=(n-this.min)/(this.max-this.min);.5>per?this.$target.addClass("progress-bar-success").removeClass("progress-bar-warning progress-bar-danger"):per>=.5&&.8>per?this.$target.addClass("progress-bar-warning").removeClass("progress-bar-success progress-bar-danger"):this.$target.addClass("progress-bar-danger").removeClass("progress-bar-success progress-bar-warning")},labelCallback:function(n){var label,labelType=this.$element.data("labeltype");if("percentage"===labelType){var percentage=this.getPercentage(n);label=percentage+"%"}else if("steps"===labelType){var total=this.$element.data("totalsteps");total||(total=10);var step=Math.round(total*(n-this.min)/(this.max-this.min));label=step+" / "+total}else label=n;return this.$element.parent().hasClass("contextual-progress")&&this.$element.parent().find(".progress-label").html(label),label}},init:function(context){if($.fn.asProgress){var defaults=$.components.getDefaults("progress");$('[data-plugin="progress"]',context).each(function(){var $this=$(this),options=$this.data();options=$.extend({},defaults,options),$this.asProgress(options)})}}}); |
@ -1,23 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
$.components.register("scrollable", { |
|||
mode: "init", |
|||
defaults: { |
|||
namespace: "scrollable", |
|||
contentSelector: "> [data-role='content']", |
|||
containerSelector: "> [data-role='container']" |
|||
}, |
|||
init: function(context) { |
|||
if (!$.fn.asScrollable) return; |
|||
var defaults = $.components.getDefaults("scrollable"); |
|||
|
|||
$('[data-plugin="scrollable"]', context).each(function() { |
|||
var options = $.extend({}, defaults, $(this).data()); |
|||
|
|||
$(this).asScrollable(options); |
|||
}); |
|||
} |
|||
}); |
@ -1,6 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
$.components.register("scrollable",{mode:"init",defaults:{namespace:"scrollable",contentSelector:"> [data-role='content']",containerSelector:"> [data-role='container']"},init:function(context){if($.fn.asScrollable){var defaults=$.components.getDefaults("scrollable");$('[data-plugin="scrollable"]',context).each(function(){var options=$.extend({},defaults,$(this).data());$(this).asScrollable(options)})}}}); |
@ -1,47 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
$.components.register("bootbox", { |
|||
mode: "api", |
|||
defaults: { |
|||
message: "" |
|||
}, |
|||
api: function() { |
|||
if (typeof bootbox === "undefined") return; |
|||
var defaults = $.components.getDefaults("bootbox"); |
|||
|
|||
$(document).on('click.site.bootbox', '[data-plugin="bootbox"]', function() { |
|||
var $btn = $(this); |
|||
var options = $btn.data(); |
|||
|
|||
options = $.extend(true, {}, defaults, options); |
|||
if (options.classname) { |
|||
options.className = options.classname; |
|||
} |
|||
|
|||
if (typeof options.callback === "string" && $.isFunction(window[options.callback])) { |
|||
options.callback = window[options.callback]; |
|||
} |
|||
|
|||
if (options.type) { |
|||
switch (options.type) { |
|||
case "alert": |
|||
bootbox.alert(options); |
|||
break; |
|||
case "confirm": |
|||
bootbox.confirm(options); |
|||
break; |
|||
case "prompt": |
|||
bootbox.prompt(options); |
|||
break; |
|||
default: |
|||
bootbox.dialog(options); |
|||
} |
|||
} else { |
|||
bootbox.dialog(options); |
|||
} |
|||
}); |
|||
} |
|||
}); |
@ -1,32 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
$.components.register("buttons", { |
|||
mode: "api", |
|||
defaults: {}, |
|||
api: function() { |
|||
$(document).on('click.site.loading', '[data-loading-text]', function() { |
|||
var $btn = $(this), |
|||
text = $btn.text(), |
|||
i = 20, |
|||
loadingText = $btn.data('loadingText'); |
|||
|
|||
$btn.text(loadingText + '(' + i + ')').css('opacity', '.6'); |
|||
|
|||
var timeout = setInterval(function() { |
|||
$btn.text(loadingText + '(' + (--i) + ')'); |
|||
if (i === 0) { |
|||
clearInterval(timeout); |
|||
$btn.text(text).css('opacity', '1'); |
|||
} |
|||
}, 1000); |
|||
}); |
|||
|
|||
$(document).on('click.site.morebutton', '[data-more]', function() { |
|||
var $target = $($(this).data('more')); |
|||
$target.toggleClass('show'); |
|||
}); |
|||
} |
|||
}); |
@ -1,6 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
$.components.register("labelauty",{mode:"default",defaults:{same_width:!0}}); |
@ -1,6 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
$.components.register("placeholder",{mode:"init",init:function(context){$.fn.placeholder&&$("input, textarea",context).placeholder()}}); |
@ -1,42 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
$.components.register("ladda", { |
|||
mode: "init", |
|||
defaults: { |
|||
timeout: 2000 |
|||
}, |
|||
init: function() { |
|||
if (typeof Ladda === "undefined") return; |
|||
|
|||
var defaults = $.components.getDefaults("ladda"); |
|||
Ladda.bind('[data-plugin="ladda"]', defaults); |
|||
} |
|||
}); |
|||
|
|||
$.components.register("laddaProgress", { |
|||
mode: "init", |
|||
defaults: { |
|||
init: function(instance) { |
|||
var progress = 0; |
|||
var interval = setInterval(function() { |
|||
progress = Math.min(progress + Math.random() * 0.1, 1); |
|||
instance.setProgress(progress); |
|||
|
|||
if (progress === 1) { |
|||
instance.stop(); |
|||
clearInterval(interval); |
|||
} |
|||
}, 200); |
|||
} |
|||
}, |
|||
init: function() { |
|||
if (typeof Ladda === 'undefined') return; |
|||
|
|||
var defaults = $.components.getDefaults("laddaProgress"); |
|||
// Bind progress buttons and simulate loading progress
|
|||
Ladda.bind('[data-plugin="laddaProgress"]', defaults); |
|||
} |
|||
}); |
@ -1,6 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
$.components.register("nprogress",{mode:"init",defaults:{minimum:.15,trickleRate:.07,trickleSpeed:360,showSpinner:!1,template:'<div class="bar" role="bar"></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'},init:function(){if("undefined"!=typeof NProgress){var defaults=$.components.getDefaults("nprogress");NProgress.configure(defaults)}}}); |
@ -1,6 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
$.components.register("panel",{api:function(){$(document).on("click.site.panel",'[data-toggle="panel-fullscreen"]',function(e){e.preventDefault();var $this=$(this),$panel=$this.closest(".panel"),api=$panel.data("panel-api");api.toggleFullscreen()}),$(document).on("click.site.panel",'[data-toggle="panel-collapse"]',function(e){e.preventDefault();var $this=$(this),$panel=$this.closest(".panel"),api=$panel.data("panel-api");api.toggleContent()}),$(document).on("click.site.panel",'[data-toggle="panel-close"]',function(e){e.preventDefault();var $this=$(this),$panel=$this.closest(".panel"),api=$panel.data("panel-api");api.close()}),$(document).on("click.site.panel",'[data-toggle="panel-refresh"]',function(e){e.preventDefault();var $this=$(this),$panel=$this.closest(".panel"),api=$panel.data("panel-api"),callback=$this.data("loadCallback");$.isFunction(window[callback])?api.load(window[callback]):api.load()})},init:function(context){$(".panel",context).each(function(){var $loading,$this=$(this),isFullscreen=!1,isClose=!1,isCollapse=!1,isLoading=!1,$fullscreen=$this.find('[data-toggle="panel-fullscreen"]'),$collapse=$this.find('[data-toggle="panel-collapse"]'),self=this;$this.hasClass("is-collapse")&&(isCollapse=!0);var api={load:function(callback){var type=$this.data("load-type");type||(type="blue-only"),$loading=$('<div class="panel-loading"><div class="loader-wrapper active"><div class="loader-layer loader-'+type+'"><div class="loader-circle-left"><div class="circle"></div></div><div class="loader-circle-gap"></div><div class="loader-circle-right"><div class="circle"></div></div></div></div></div>'),$loading.appendTo($this),$this.addClass("is-loading"),$this.trigger("loading.uikit.panel"),isLoading=!0,$.isFunction(callback)&&callback.call(self,this.done)},done:function(){isLoading===!0&&($loading.remove(),$this.removeClass("is-loading"),$this.trigger("loading.done.uikit.panel"))},toggleContent:function(){isCollapse?this.showContent():this.hideContent()},showContent:function(){isCollapse!==!1&&($this.removeClass("is-collapse"),$collapse.hasClass("md-plus")&&$collapse.removeClass("md-plus").addClass("md-minus"),$this.trigger("shown.uikit.panel"),isCollapse=!1)},hideContent:function(){isCollapse!==!0&&($this.addClass("is-collapse"),$collapse.hasClass("md-minus")&&$collapse.removeClass("md-minus").addClass("md-plus"),$this.trigger("hidden.uikit.panel"),isCollapse=!0)},toggleFullscreen:function(){isFullscreen?this.leaveFullscreen():this.enterFullscreen()},enterFullscreen:function(){isFullscreen!==!0&&($this.addClass("is-fullscreen"),$fullscreen.hasClass("md-fullscreen")&&$fullscreen.removeClass("md-fullscreen").addClass("md-fullscreen-exit"),$this.trigger("enter.fullscreen.uikit.panel"),isFullscreen=!0)},leaveFullscreen:function(){isFullscreen!==!1&&($this.removeClass("is-fullscreen"),$fullscreen.hasClass("md-fullscreen-exit")&&$fullscreen.removeClass("md-fullscreen-exit").addClass("md-fullscreen"),$this.trigger("leave.fullscreen.uikit.panel"),isFullscreen=!1)},toggle:function(){isClose?this.open():this.close()},open:function(){isClose!==!1&&($this.removeClass("is-close"),$this.trigger("open.uikit.panel"),isClose=!1)},close:function(){isClose!==!0&&($this.addClass("is-close"),$this.trigger("close.uikit.panel"),isClose=!0)}};$this.data("panel-api",api)})}}); |
@ -1,25 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
$.components.register("slidePanel", { |
|||
mode: "manual", |
|||
defaults: { |
|||
closeSelector: '.slidePanel-close', |
|||
mouseDragHandler: '.slidePanel-handler', |
|||
loading: { |
|||
template: function(options) { |
|||
return '<div class="' + options.classes.loading + '">' + |
|||
'<div class="loader loader-default"></div>' + |
|||
'</div>'; |
|||
}, |
|||
showCallback: function(options) { |
|||
this.$el.addClass(options.classes.loading + '-show'); |
|||
}, |
|||
hideCallback: function(options) { |
|||
this.$el.removeClass(options.classes.loading + '-show'); |
|||
} |
|||
} |
|||
} |
|||
}); |
@ -1,6 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
$.components.register("slidePanel",{mode:"manual",defaults:{closeSelector:".slidePanel-close",mouseDragHandler:".slidePanel-handler",loading:{template:function(options){return'<div class="'+options.classes.loading+'"><div class="loader loader-default"></div></div>'},showCallback:function(options){this.$el.addClass(options.classes.loading+"-show")},hideCallback:function(options){this.$el.removeClass(options.classes.loading+"-show")}}}}); |
@ -1,22 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
$.components.register("switchery", { |
|||
mode: "init", |
|||
defaults: { |
|||
color: $.colors("primary", 600) |
|||
}, |
|||
init: function(context) { |
|||
if (typeof Switchery === "undefined") return; |
|||
|
|||
var defaults = $.components.getDefaults("switchery"); |
|||
|
|||
$('[data-plugin="switchery"]', context).each(function() { |
|||
var options = $.extend({}, defaults, $(this).data()); |
|||
|
|||
new Switchery(this, options); |
|||
}); |
|||
} |
|||
}); |
@ -1,6 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
$.components.register("switchery",{mode:"init",defaults:{color:$.colors("primary",600)},init:function(context){if("undefined"!=typeof Switchery){var defaults=$.components.getDefaults("switchery");$('[data-plugin="switchery"]',context).each(function(){var options=$.extend({},defaults,$(this).data());new Switchery(this,options)})}}}); |
@ -1,94 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
$.components.register("verticalTab", { |
|||
mode: "init", |
|||
init: function(context) { |
|||
if (!$.fn.matchHeight) return; |
|||
|
|||
$('.nav-tabs-vertical', context).each(function() { |
|||
$(this).children().matchHeight(); |
|||
}); |
|||
} |
|||
}); |
|||
|
|||
$.components.register("horizontalTab", { |
|||
mode: "init", |
|||
init: function(context) { |
|||
if (!$.fn.responsiveHorizontalTabs) return; |
|||
|
|||
$('.nav-tabs-horizontal', context).responsiveHorizontalTabs(); |
|||
} |
|||
}); |
|||
|
|||
$.components.register("navTabsLine", { |
|||
mode: "init", |
|||
defaults: { |
|||
speed: '0.5s, 1s', |
|||
animate: 'cubic-bezier(0.4, 0, 0.2, 1), cubic-bezier(0.4, 0, 0.2, 1)', |
|||
tpl: function() { |
|||
return '<li class="nav-tabs-autoline"></li>'; |
|||
} |
|||
}, |
|||
init: function(context) { |
|||
var defaults = $.components.getDefaults('navTabsLine'); |
|||
|
|||
$('.nav-tabs-line', context).each(function() { |
|||
var $this = $(this); |
|||
var options = $.extend({}, defaults, $this.data()); |
|||
var $parent = $this.parent(); |
|||
var $active = $this.find('.active'); |
|||
|
|||
var $autoLineTpl = $(options.tpl()).css({ |
|||
"-webkit-transition-duration": options.speed, |
|||
"transition-duration": options.speed, |
|||
"-webkit-transition-timing-function": options.animate, |
|||
"transition-timing-function": options.animate |
|||
}); |
|||
$autoLineTpl.appendTo($this); |
|||
|
|||
var horizontalLine = function($this) { |
|||
var left = $this.position().left; |
|||
var lineWidth = $this.outerWidth(); |
|||
|
|||
$autoLineTpl.css({ |
|||
"left": left, |
|||
"width": lineWidth |
|||
}); |
|||
}; |
|||
|
|||
var verticalLine = function($this) { |
|||
var top = $this.position().top; |
|||
var lineHeight = $this.outerHeight(); |
|||
|
|||
$autoLineTpl.css({ |
|||
"top": top, |
|||
"height": lineHeight |
|||
}); |
|||
}; |
|||
|
|||
var change = function($this) { |
|||
if ($parent.hasClass('nav-tabs-vertical')) { |
|||
verticalLine($this); |
|||
} else { |
|||
horizontalLine($this); |
|||
} |
|||
}; |
|||
|
|||
$this.on('shown.bs.tab', 'a[data-toggle="tab"]', function() { |
|||
var $li = $(this).parent(), |
|||
$ul = $li.parent(); |
|||
|
|||
if ($ul.hasClass('dropdown-menu')) { |
|||
change($ul.parent()); |
|||
} else { |
|||
change($(this).parent()); |
|||
} |
|||
}); |
|||
|
|||
change($active); |
|||
}); |
|||
} |
|||
}); |
@ -1,6 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
$.components.register("verticalTab",{mode:"init",init:function(context){$.fn.matchHeight&&$(".nav-tabs-vertical",context).each(function(){$(this).children().matchHeight()})}}),$.components.register("horizontalTab",{mode:"init",init:function(context){$.fn.responsiveHorizontalTabs&&$(".nav-tabs-horizontal",context).responsiveHorizontalTabs()}}),$.components.register("navTabsLine",{mode:"init",defaults:{speed:"0.5s, 1s",animate:"cubic-bezier(0.4, 0, 0.2, 1), cubic-bezier(0.4, 0, 0.2, 1)",tpl:function(){return'<li class="nav-tabs-autoline"></li>'}},init:function(context){var defaults=$.components.getDefaults("navTabsLine");$(".nav-tabs-line",context).each(function(){var $this=$(this),options=$.extend({},defaults,$this.data()),$parent=$this.parent(),$active=$this.find(".active"),$autoLineTpl=$(options.tpl()).css({"-webkit-transition-duration":options.speed,"transition-duration":options.speed,"-webkit-transition-timing-function":options.animate,"transition-timing-function":options.animate});$autoLineTpl.appendTo($this);var horizontalLine=function($this){var left=$this.position().left,lineWidth=$this.outerWidth();$autoLineTpl.css({left:left,width:lineWidth})},verticalLine=function($this){var top=$this.position().top,lineHeight=$this.outerHeight();$autoLineTpl.css({top:top,height:lineHeight})},change=function($this){$parent.hasClass("nav-tabs-vertical")?verticalLine($this):horizontalLine($this)};$this.on("shown.bs.tab",'a[data-toggle="tab"]',function(){var $li=$(this).parent(),$ul=$li.parent();change($ul.hasClass("dropdown-menu")?$ul.parent():$(this).parent())}),change($active)})}}); |
@ -1,39 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
$.components.register("toastr", { |
|||
mode: "api", |
|||
api: function() { |
|||
if (typeof toastr === "undefined") return; |
|||
var defaults = $.components.getDefaults("toastr"); |
|||
|
|||
$(document).on('click.site.toastr', '[data-plugin="toastr"]', function(e) { |
|||
e.preventDefault(); |
|||
|
|||
var $this = $(this); |
|||
var options = $.extend(true, {}, defaults, $this.data()); |
|||
var message = options.message || ''; |
|||
var type = options.type || "info"; |
|||
var title = options.title || undefined; |
|||
|
|||
switch (type) { |
|||
case "success": |
|||
toastr.success(message, title, options); |
|||
break; |
|||
case "warning": |
|||
toastr.warning(message, title, options); |
|||
break; |
|||
case "error": |
|||
toastr.error(message, title, options); |
|||
break; |
|||
case "info": |
|||
toastr.info(message, title, options); |
|||
break; |
|||
default: |
|||
toastr.info(message, title, options); |
|||
} |
|||
}); |
|||
} |
|||
}); |
@ -1,6 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
$.components.register("toastr",{mode:"api",api:function(){if("undefined"!=typeof toastr){var defaults=$.components.getDefaults("toastr");$(document).on("click.site.toastr",'[data-plugin="toastr"]',function(e){e.preventDefault();var $this=$(this),options=$.extend(!0,{},defaults,$this.data()),message=options.message||"",type=options.type||"info",title=options.title||void 0;switch(type){case"success":toastr.success(message,title,options);break;case"warning":toastr.warning(message,title,options);break;case"error":toastr.error(message,title,options);break;case"info":toastr.info(message,title,options);break;default:toastr.info(message,title,options)}})}}}); |
@ -1,302 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
(function(window, document, $) { |
|||
"use strict"; |
|||
$.configs.colors = { |
|||
"red": { |
|||
"50": "#ffebee", |
|||
"100": "#ffcdd2", |
|||
"200": "#ef9a9a", |
|||
"300": "#e57373", |
|||
"400": "#ef5350", |
|||
"500": "#f44336", |
|||
"600": "#e53935", |
|||
"700": "#d32f2f", |
|||
"800": "#c62828", |
|||
"900": "#b71c1c", |
|||
"a100": "#ff8a80", |
|||
"a200": "#ff5252", |
|||
"a300": "#ff1744", |
|||
"a400": "#d50000" |
|||
}, |
|||
"pink": { |
|||
"50": "#fce4ec", |
|||
"100": "#f8bbd0", |
|||
"200": "#f48fb1", |
|||
"300": "#f06292", |
|||
"400": "#ec407a", |
|||
"500": "#e91e63", |
|||
"600": "#d81b60", |
|||
"700": "#c2185b", |
|||
"800": "#ad1457", |
|||
"900": "#880e4f", |
|||
"a100": "#ff80ab", |
|||
"a200": "#ff4081", |
|||
"a300": "#f50057", |
|||
"a400": "#c51162" |
|||
}, |
|||
"purple": { |
|||
"50": "#f3e5f5", |
|||
"100": "#e1bee7", |
|||
"200": "#ce93d8", |
|||
"300": "#ba68c8", |
|||
"400": "#ab47bc", |
|||
"500": "#9c27b0", |
|||
"600": "#8e24aa", |
|||
"700": "#7b1fa2", |
|||
"800": "#6a1b9a", |
|||
"900": "#4a148c", |
|||
"a100": "#ea80fc", |
|||
"a200": "#e040fb", |
|||
"a300": "#d500f9", |
|||
"a400": "#aa00ff" |
|||
}, |
|||
"deep-purple": { |
|||
"50": "#ede7f6", |
|||
"100": "#d1c4e9", |
|||
"200": "#b39ddb", |
|||
"300": "#9575cd", |
|||
"400": "#7e57c2", |
|||
"500": "#673ab7", |
|||
"600": "#5e35b1", |
|||
"700": "#512da8", |
|||
"800": "#4527a0", |
|||
"900": "#311b92", |
|||
"a100": "#b388ff", |
|||
"a200": "#7c4dff", |
|||
"a300": "#651fff", |
|||
"a400": "#6200ea" |
|||
}, |
|||
"indigo": { |
|||
"50": "#e8eaf6", |
|||
"100": "#c5cae9", |
|||
"200": "#9fa8da", |
|||
"300": "#7986cb", |
|||
"400": "#5c6bc0", |
|||
"500": "#3f51b5", |
|||
"600": "#3949ab", |
|||
"700": "#303f9f", |
|||
"800": "#283593", |
|||
"900": "#1a237e", |
|||
"a100": "#8c9eff", |
|||
"a200": "#536dfe", |
|||
"a300": "#3d5afe", |
|||
"a400": "#304ffe" |
|||
}, |
|||
"blue": { |
|||
"50": "#e3f2fd", |
|||
"100": "#bbdefb", |
|||
"200": "#90caf9", |
|||
"300": "#64b5f6", |
|||
"400": "#42a5f5", |
|||
"500": "#2196f3", |
|||
"600": "#1e88e5", |
|||
"700": "#1976d2", |
|||
"800": "#1565c0", |
|||
"900": "#0d47a1", |
|||
"a100": "#82b1ff", |
|||
"a200": "#448aff", |
|||
"a300": "#2979ff", |
|||
"a400": "#2962ff" |
|||
}, |
|||
"light-blue": { |
|||
"50": "#e1f5fe", |
|||
"100": "#b3e5fc", |
|||
"200": "#81d4fa", |
|||
"300": "#4fc3f7", |
|||
"400": "#29b6f6", |
|||
"500": "#03a9f4", |
|||
"600": "#039be5", |
|||
"700": "#0288d1", |
|||
"800": "#0277bd", |
|||
"900": "#01579b", |
|||
"a100": "#80d8ff", |
|||
"a200": "#40c4ff", |
|||
"a300": "#00b0ff", |
|||
"a400": "#0091ea" |
|||
}, |
|||
"cyan": { |
|||
"50": "#e0f7fa", |
|||
"100": "#b2ebf2", |
|||
"200": "#80deea", |
|||
"300": "#4dd0e1", |
|||
"400": "#26c6da", |
|||
"500": "#00bcd4", |
|||
"600": "#00acc1", |
|||
"700": "#0097a7", |
|||
"800": "#00838f", |
|||
"900": "#006064", |
|||
"a100": "#84ffff", |
|||
"a200": "#18ffff", |
|||
"a300": "#00e5ff", |
|||
"a400": "#00b8d4" |
|||
}, |
|||
"teal": { |
|||
"50": "#e0f2f1", |
|||
"100": "#b2dfdb", |
|||
"200": "#80cbc4", |
|||
"300": "#4db6ac", |
|||
"400": "#26a69a", |
|||
"500": "#009688", |
|||
"600": "#00897b", |
|||
"700": "#00796b", |
|||
"800": "#00695c", |
|||
"900": "#004d40", |
|||
"a100": "#a7ffeb", |
|||
"a200": "#64ffda", |
|||
"a300": "#1de9b6", |
|||
"a400": "#00bfa5" |
|||
}, |
|||
"green": { |
|||
"50": "#e8f5e9", |
|||
"100": "#c8e6c9", |
|||
"200": "#a5d6a7", |
|||
"300": "#81c784", |
|||
"400": "#66bb6a", |
|||
"500": "#4caf50", |
|||
"600": "#43a047", |
|||
"700": "#388e3c", |
|||
"800": "#2e7d32", |
|||
"900": "#1b5e20", |
|||
"a100": "#b9f6ca", |
|||
"a200": "#69f0ae", |
|||
"a300": "#00e676", |
|||
"a400": "#00c853" |
|||
}, |
|||
"light-green": { |
|||
"50": "#f1f8e9", |
|||
"100": "#dcedc8", |
|||
"200": "#c5e1a5", |
|||
"300": "#aed581", |
|||
"400": "#9ccc65", |
|||
"500": "#8bc34a", |
|||
"600": "#7cb342", |
|||
"700": "#689f38", |
|||
"800": "#558b2f", |
|||
"900": "#33691e", |
|||
"a100": "#ccff90", |
|||
"a200": "#b2ff59", |
|||
"a300": "#76ff03", |
|||
"a400": "#64dd17" |
|||
}, |
|||
"lime": { |
|||
"50": "#f9fbe7", |
|||
"100": "#f0f4c3", |
|||
"200": "#e6ee9c", |
|||
"300": "#dce775", |
|||
"400": "#d4e157", |
|||
"500": "#cddc39", |
|||
"600": "#c0ca33", |
|||
"700": "#afb42b", |
|||
"800": "#9e9d24", |
|||
"900": "#827717", |
|||
"a100": "#f4ff81", |
|||
"a200": "#eeff41", |
|||
"a300": "#c6ff00", |
|||
"a400": "#aeea00" |
|||
}, |
|||
"yellow": { |
|||
"50": "#fffde7", |
|||
"100": "#fff9c4", |
|||
"200": "#fff59d", |
|||
"300": "#fff176", |
|||
"400": "#ffee58", |
|||
"500": "#ffeb3b", |
|||
"600": "#fdd835", |
|||
"700": "#fbc02d", |
|||
"800": "#f9a825", |
|||
"900": "#f57f17", |
|||
"a100": "#ffff8d", |
|||
"a200": "#ffff00", |
|||
"a300": "#ffea00", |
|||
"a400": "#ffd600" |
|||
}, |
|||
"amber": { |
|||
"50": "#fff8e1", |
|||
"100": "#ffecb3", |
|||
"200": "#ffe082", |
|||
"300": "#ffd54f", |
|||
"400": "#ffca28", |
|||
"500": "#ffc107", |
|||
"600": "#ffb300", |
|||
"700": "#ffa000", |
|||
"800": "#ff8f00", |
|||
"900": "#ff6f00", |
|||
"a100": "#ffe57f", |
|||
"a200": "#ffd740", |
|||
"a300": "#ffc400", |
|||
"a400": "#ffab00" |
|||
}, |
|||
"orange": { |
|||
"50": "#fff3e0", |
|||
"100": "#ffe0b2", |
|||
"200": "#ffcc80", |
|||
"300": "#ffb74d", |
|||
"400": "#ffa726", |
|||
"500": "#ff9800", |
|||
"600": "#fb8c00", |
|||
"700": "#f57c00", |
|||
"800": "#ef6c00", |
|||
"900": "#e65100", |
|||
"a100": "#ffd180", |
|||
"a200": "#ffab40", |
|||
"a300": "#ff9100", |
|||
"a400": "#ff6d00" |
|||
}, |
|||
"deep-orange": { |
|||
"50": "#fbe9e7", |
|||
"100": "#ffccbc", |
|||
"200": "#ffab91", |
|||
"300": "#ff8a65", |
|||
"400": "#ff7043", |
|||
"500": "#ff5722", |
|||
"600": "#f4511e", |
|||
"700": "#e64a19", |
|||
"800": "#d84315", |
|||
"900": "#bf360c", |
|||
"a100": "#ff9e80", |
|||
"a200": "#ff6e40", |
|||
"a300": "#ff3d00", |
|||
"a400": "#dd2c00" |
|||
}, |
|||
"brown": { |
|||
"50": "#efebe9", |
|||
"100": "#d7ccc8", |
|||
"200": "#bcaaa4", |
|||
"300": "#a1887f", |
|||
"400": "#8d6e63", |
|||
"500": "#795548", |
|||
"600": "#6d4c41", |
|||
"700": "#5d4037", |
|||
"800": "#4e342e", |
|||
"900": "#3e2723" |
|||
}, |
|||
"grey": { |
|||
"50": "#fafafa", |
|||
"100": "#f5f5f5", |
|||
"200": "#eeeeee", |
|||
"300": "#e0e0e0", |
|||
"400": "#bdbdbd", |
|||
"500": "#9e9e9e", |
|||
"600": "#757575", |
|||
"700": "#616161", |
|||
"800": "#424242", |
|||
"900": "#212121" |
|||
}, |
|||
"blue-grey": { |
|||
"50": "#eceff1", |
|||
"100": "#cfd8dc", |
|||
"200": "#b0bec5", |
|||
"300": "#90a4ae", |
|||
"400": "#78909c", |
|||
"500": "#607d8b", |
|||
"600": "#546e7a", |
|||
"700": "#455a64", |
|||
"800": "#37474f", |
|||
"900": "#263238" |
|||
} |
|||
}; |
|||
})(window, document, $); |
@ -1,6 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
!function(window,document,$){"use strict";$.configs.colors={red:{50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",a100:"#ff8a80",a200:"#ff5252",a300:"#ff1744",a400:"#d50000"},pink:{50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",a100:"#ff80ab",a200:"#ff4081",a300:"#f50057",a400:"#c51162"},purple:{50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",a100:"#ea80fc",a200:"#e040fb",a300:"#d500f9",a400:"#aa00ff"},"deep-purple":{50:"#ede7f6",100:"#d1c4e9",200:"#b39ddb",300:"#9575cd",400:"#7e57c2",500:"#673ab7",600:"#5e35b1",700:"#512da8",800:"#4527a0",900:"#311b92",a100:"#b388ff",a200:"#7c4dff",a300:"#651fff",a400:"#6200ea"},indigo:{50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",a100:"#8c9eff",a200:"#536dfe",a300:"#3d5afe",a400:"#304ffe"},blue:{50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",a100:"#82b1ff",a200:"#448aff",a300:"#2979ff",a400:"#2962ff"},"light-blue":{50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",a100:"#80d8ff",a200:"#40c4ff",a300:"#00b0ff",a400:"#0091ea"},cyan:{50:"#e0f7fa",100:"#b2ebf2",200:"#80deea",300:"#4dd0e1",400:"#26c6da",500:"#00bcd4",600:"#00acc1",700:"#0097a7",800:"#00838f",900:"#006064",a100:"#84ffff",a200:"#18ffff",a300:"#00e5ff",a400:"#00b8d4"},teal:{50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",a100:"#a7ffeb",a200:"#64ffda",a300:"#1de9b6",a400:"#00bfa5"},green:{50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",a100:"#b9f6ca",a200:"#69f0ae",a300:"#00e676",a400:"#00c853"},"light-green":{50:"#f1f8e9",100:"#dcedc8",200:"#c5e1a5",300:"#aed581",400:"#9ccc65",500:"#8bc34a",600:"#7cb342",700:"#689f38",800:"#558b2f",900:"#33691e",a100:"#ccff90",a200:"#b2ff59",a300:"#76ff03",a400:"#64dd17"},lime:{50:"#f9fbe7",100:"#f0f4c3",200:"#e6ee9c",300:"#dce775",400:"#d4e157",500:"#cddc39",600:"#c0ca33",700:"#afb42b",800:"#9e9d24",900:"#827717",a100:"#f4ff81",a200:"#eeff41",a300:"#c6ff00",a400:"#aeea00"},yellow:{50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",a100:"#ffff8d",a200:"#ffff00",a300:"#ffea00",a400:"#ffd600"},amber:{50:"#fff8e1",100:"#ffecb3",200:"#ffe082",300:"#ffd54f",400:"#ffca28",500:"#ffc107",600:"#ffb300",700:"#ffa000",800:"#ff8f00",900:"#ff6f00",a100:"#ffe57f",a200:"#ffd740",a300:"#ffc400",a400:"#ffab00"},orange:{50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",a100:"#ffd180",a200:"#ffab40",a300:"#ff9100",a400:"#ff6d00"},"deep-orange":{50:"#fbe9e7",100:"#ffccbc",200:"#ffab91",300:"#ff8a65",400:"#ff7043",500:"#ff5722",600:"#f4511e",700:"#e64a19",800:"#d84315",900:"#bf360c",a100:"#ff9e80",a200:"#ff6e40",a300:"#ff3d00",a400:"#dd2c00"},brown:{50:"#efebe9",100:"#d7ccc8",200:"#bcaaa4",300:"#a1887f",400:"#8d6e63",500:"#795548",600:"#6d4c41",700:"#5d4037",800:"#4e342e",900:"#3e2723"},grey:{50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121"},"blue-grey":{50:"#eceff1",100:"#cfd8dc",200:"#b0bec5",300:"#90a4ae",400:"#78909c",500:"#607d8b",600:"#546e7a",700:"#455a64",800:"#37474f",900:"#263238"}}}(window,document,$); |
@ -1,290 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
(function(window, document, $) { |
|||
'use strict'; |
|||
|
|||
var $doc = $(document); |
|||
|
|||
// Site
|
|||
// ====
|
|||
$.site = $.site || {}; |
|||
|
|||
$.extend($.site, { |
|||
_queue: { |
|||
prepare: [], |
|||
run: [], |
|||
complete: [] |
|||
}, |
|||
|
|||
run: function() { |
|||
var self = this; |
|||
|
|||
this.dequeue('prepare', function() { |
|||
self.trigger('before.run', self); |
|||
}); |
|||
|
|||
this.dequeue('run', function() { |
|||
self.dequeue('complete', function() { |
|||
self.trigger('after.run', self); |
|||
}); |
|||
}); |
|||
}, |
|||
|
|||
dequeue: function(name, done) { |
|||
var self = this, |
|||
queue = this.getQueue(name), |
|||
fn = queue.shift(), |
|||
next = function() { |
|||
self.dequeue(name, done); |
|||
}; |
|||
|
|||
if (fn) { |
|||
fn.call(this, next); |
|||
} else if ($.isFunction(done)) { |
|||
done.call(this); |
|||
} |
|||
}, |
|||
|
|||
getQueue: function(name) { |
|||
if (!$.isArray(this._queue[name])) { |
|||
this._queue[name] = []; |
|||
} |
|||
|
|||
return this._queue[name]; |
|||
}, |
|||
|
|||
extend: function(obj) { |
|||
$.each(this._queue, function(name, queue) { |
|||
if ($.isFunction(obj[name])) { |
|||
queue.push(obj[name]); |
|||
|
|||
delete obj[name]; |
|||
} |
|||
}); |
|||
|
|||
$.extend(this, obj); |
|||
|
|||
return this; |
|||
}, |
|||
|
|||
trigger: function(name, data, $el) { |
|||
if (typeof name === 'undefined') return; |
|||
if (typeof $el === 'undefined') $el = $doc; |
|||
|
|||
$el.trigger(name + '.site', data); |
|||
}, |
|||
|
|||
throttle: function(func, wait) { |
|||
var _now = Date.now || function() { |
|||
return new Date().getTime(); |
|||
}; |
|||
var context, args, result; |
|||
var timeout = null; |
|||
var previous = 0; |
|||
|
|||
var later = function() { |
|||
previous = _now(); |
|||
timeout = null; |
|||
result = func.apply(context, args); |
|||
context = args = null; |
|||
}; |
|||
|
|||
return function() { |
|||
var now = _now(); |
|||
var remaining = wait - (now - previous); |
|||
context = this; |
|||
args = arguments; |
|||
if (remaining <= 0) { |
|||
clearTimeout(timeout); |
|||
timeout = null; |
|||
previous = now; |
|||
result = func.apply(context, args); |
|||
context = args = null; |
|||
} else if (!timeout) { |
|||
timeout = setTimeout(later, remaining); |
|||
} |
|||
return result; |
|||
}; |
|||
}, |
|||
|
|||
resize: function() { |
|||
if (document.createEvent) { |
|||
var ev = document.createEvent('Event'); |
|||
ev.initEvent('resize', true, true); |
|||
window.dispatchEvent(ev); |
|||
} else { |
|||
element = document.documentElement; |
|||
var event = document.createEventObject(); |
|||
element.fireEvent("onresize", event); |
|||
} |
|||
} |
|||
}); |
|||
|
|||
// Configs
|
|||
// =======
|
|||
$.configs = $.configs || {}; |
|||
|
|||
$.extend($.configs, { |
|||
data: {}, |
|||
get: function(name) { |
|||
var callback = function(data, name) { |
|||
return data[name]; |
|||
} |
|||
|
|||
var data = this.data; |
|||
|
|||
for (var i = 0; i < arguments.length; i++) { |
|||
name = arguments[i]; |
|||
|
|||
data = callback(data, name); |
|||
} |
|||
|
|||
return data; |
|||
}, |
|||
|
|||
set: function(name, value) { |
|||
this.data[name] = value; |
|||
}, |
|||
|
|||
extend: function(name, options) { |
|||
var value = this.get(name); |
|||
return $.extend(true, value, options); |
|||
} |
|||
}); |
|||
|
|||
// Colors
|
|||
// ======
|
|||
$.colors = function(name, level) { |
|||
if (name === 'primary') { |
|||
name = $.configs.get('site', 'primaryColor'); |
|||
if (!name) { |
|||
name = 'red'; |
|||
} |
|||
} |
|||
|
|||
if (typeof $.configs.colors === 'undefined') { |
|||
return null; |
|||
} |
|||
|
|||
if (typeof $.configs.colors[name] !== 'undefined') { |
|||
if (level && typeof $.configs.colors[name][level] !== 'undefined') { |
|||
return $.configs.colors[name][level]; |
|||
} |
|||
|
|||
if (typeof level === 'undefined') { |
|||
return $.configs.colors[name]; |
|||
} |
|||
} |
|||
|
|||
return null; |
|||
}; |
|||
|
|||
// Components
|
|||
// ==========
|
|||
$.components = $.components || {}; |
|||
|
|||
$.extend($.components, { |
|||
_components: {}, |
|||
|
|||
register: function(name, obj) { |
|||
this._components[name] = obj; |
|||
}, |
|||
|
|||
init: function(name, context, args) { |
|||
var self = this; |
|||
|
|||
if (typeof name === 'undefined') { |
|||
$.each(this._components, function(name) { |
|||
self.init(name); |
|||
}); |
|||
} else { |
|||
context = context || document; |
|||
args = args || []; |
|||
|
|||
var obj = this.get(name); |
|||
|
|||
if (obj) { |
|||
switch (obj.mode) { |
|||
case 'default': |
|||
return this._initDefault(name, context); |
|||
case 'init': |
|||
return this._initComponent(name, obj, context, args); |
|||
case 'api': |
|||
return this._initApi(name, obj, args); |
|||
default: |
|||
this._initApi(name, obj, context, args); |
|||
this._initComponent(name, obj, context, args); |
|||
return; |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
|
|||
/* init alternative, but only or init mode */ |
|||
call: function(name, context) { |
|||
var args = Array.prototype.slice.call(arguments, 2); |
|||
var obj = this.get(name); |
|||
|
|||
context = context || document; |
|||
|
|||
return this._initComponent(name, obj, context, args); |
|||
}, |
|||
|
|||
_initDefault: function(name, context) { |
|||
if (!$.fn[name]) return; |
|||
|
|||
var defaults = this.getDefaults(name); |
|||
|
|||
$('[data-plugin=' + name + ']', context).each(function() { |
|||
var $this = $(this), |
|||
options = $.extend(true, {}, defaults, $this.data()); |
|||
|
|||
$this[name](options); |
|||
}); |
|||
}, |
|||
|
|||
|
|||
_initComponent: function(name, obj, context, args) { |
|||
if ($.isFunction(obj.init)) { |
|||
obj.init.apply(obj, [context].concat(args)); |
|||
} |
|||
}, |
|||
|
|||
_initApi: function(name, obj, args) { |
|||
if (typeof obj.apiCalled === 'undefined' && $.isFunction(obj.api)) { |
|||
obj.api.apply(obj, args); |
|||
|
|||
obj.apiCalled = true; |
|||
} |
|||
}, |
|||
|
|||
|
|||
getDefaults: function(name) { |
|||
var component = this.get(name); |
|||
|
|||
if (component && typeof component.defaults !== "undefined") { |
|||
return component.defaults; |
|||
} else { |
|||
return {}; |
|||
} |
|||
}, |
|||
|
|||
get: function(name, property) { |
|||
if (typeof this._components[name] !== "undefined") { |
|||
if (typeof property !== "undefined") { |
|||
return this._components[name][property]; |
|||
} else { |
|||
return this._components[name]; |
|||
} |
|||
} else { |
|||
console.warn('component:' + component + ' script is not loaded.'); |
|||
|
|||
return undefined; |
|||
} |
|||
} |
|||
}); |
|||
|
|||
})(window, document, jQuery); |
@ -1,6 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
!function(window,document,$){"use strict";var $doc=$(document);$.site=$.site||{},$.extend($.site,{_queue:{prepare:[],run:[],complete:[]},run:function(){var self=this;this.dequeue("prepare",function(){self.trigger("before.run",self)}),this.dequeue("run",function(){self.dequeue("complete",function(){self.trigger("after.run",self)})})},dequeue:function(name,done){var self=this,queue=this.getQueue(name),fn=queue.shift(),next=function(){self.dequeue(name,done)};fn?fn.call(this,next):$.isFunction(done)&&done.call(this)},getQueue:function(name){return $.isArray(this._queue[name])||(this._queue[name]=[]),this._queue[name]},extend:function(obj){return $.each(this._queue,function(name,queue){$.isFunction(obj[name])&&(queue.push(obj[name]),delete obj[name])}),$.extend(this,obj),this},trigger:function(name,data,$el){"undefined"!=typeof name&&("undefined"==typeof $el&&($el=$doc),$el.trigger(name+".site",data))},throttle:function(func,wait){var context,args,result,_now=Date.now||function(){return(new Date).getTime()},timeout=null,previous=0,later=function(){previous=_now(),timeout=null,result=func.apply(context,args),context=args=null};return function(){var now=_now(),remaining=wait-(now-previous);return context=this,args=arguments,0>=remaining?(clearTimeout(timeout),timeout=null,previous=now,result=func.apply(context,args),context=args=null):timeout||(timeout=setTimeout(later,remaining)),result}},resize:function(){if(document.createEvent){var ev=document.createEvent("Event");ev.initEvent("resize",!0,!0),window.dispatchEvent(ev)}else{element=document.documentElement;var event=document.createEventObject();element.fireEvent("onresize",event)}}}),$.configs=$.configs||{},$.extend($.configs,{data:{},get:function(name){for(var callback=function(data,name){return data[name]},data=this.data,i=0;i<arguments.length;i++)name=arguments[i],data=callback(data,name);return data},set:function(name,value){this.data[name]=value},extend:function(name,options){var value=this.get(name);return $.extend(!0,value,options)}}),$.colors=function(name,level){if("primary"===name&&(name=$.configs.get("site","primaryColor"),name||(name="red")),"undefined"==typeof $.configs.colors)return null;if("undefined"!=typeof $.configs.colors[name]){if(level&&"undefined"!=typeof $.configs.colors[name][level])return $.configs.colors[name][level];if("undefined"==typeof level)return $.configs.colors[name]}return null},$.components=$.components||{},$.extend($.components,{_components:{},register:function(name,obj){this._components[name]=obj},init:function(name,context,args){var self=this;if("undefined"==typeof name)$.each(this._components,function(name){self.init(name)});else{context=context||document,args=args||[];var obj=this.get(name);if(obj)switch(obj.mode){case"default":return this._initDefault(name,context);case"init":return this._initComponent(name,obj,context,args);case"api":return this._initApi(name,obj,args);default:return this._initApi(name,obj,context,args),void this._initComponent(name,obj,context,args)}}},call:function(name,context){var args=Array.prototype.slice.call(arguments,2),obj=this.get(name);return context=context||document,this._initComponent(name,obj,context,args)},_initDefault:function(name,context){if($.fn[name]){var defaults=this.getDefaults(name);$("[data-plugin="+name+"]",context).each(function(){var $this=$(this),options=$.extend(!0,{},defaults,$this.data());$this[name](options)})}},_initComponent:function(name,obj,context,args){$.isFunction(obj.init)&&obj.init.apply(obj,[context].concat(args))},_initApi:function(name,obj,args){"undefined"==typeof obj.apiCalled&&$.isFunction(obj.api)&&(obj.api.apply(obj,args),obj.apiCalled=!0)},getDefaults:function(name){var component=this.get(name);return component&&"undefined"!=typeof component.defaults?component.defaults:{}},get:function(name,property){return"undefined"!=typeof this._components[name]?"undefined"!=typeof property?this._components[name][property]:this._components[name]:void 0}})}(window,document,jQuery); |
@ -1,524 +0,0 @@ |
|||
(function() { |
|||
|
|||
"use strict"; |
|||
|
|||
var TRANSITION_FALLBACK_DURATION = 500; |
|||
var hideElement = function(el) { |
|||
|
|||
if (! el) { |
|||
return; |
|||
} |
|||
|
|||
var removeThis = function() { |
|||
if (el && el.parentNode) { |
|||
el.parentNode.removeChild(el); |
|||
} |
|||
}; |
|||
|
|||
el.classList.remove("show"); |
|||
el.classList.add("hide"); |
|||
el.addEventListener("transitionend", removeThis); |
|||
|
|||
// Fallback for no transitions.
|
|||
setTimeout(removeThis, TRANSITION_FALLBACK_DURATION); |
|||
|
|||
}; |
|||
|
|||
function Alertify() { |
|||
|
|||
/** |
|||
* Alertify private object |
|||
* @type {Object} |
|||
*/ |
|||
var _alertify = { |
|||
|
|||
parent: document.body, |
|||
version: "1.0.10", |
|||
defaultOkLabel: "Ok", |
|||
okLabel: "Ok", |
|||
defaultCancelLabel: "Cancel", |
|||
cancelLabel: "Cancel", |
|||
defaultMaxLogItems: 2, |
|||
maxLogItems: 2, |
|||
promptValue: "", |
|||
promptPlaceholder: "", |
|||
closeLogOnClick: false, |
|||
closeLogOnClickDefault: false, |
|||
delay: 5000, |
|||
defaultDelay: 5000, |
|||
logContainerClass: "alertify-logs", |
|||
logContainerDefaultClass: "alertify-logs", |
|||
dialogs: { |
|||
buttons: { |
|||
holder: "<nav>{{buttons}}</nav>", |
|||
ok: "<button class='ok' tabindex='1'>{{ok}}</button>", |
|||
cancel: "<button class='cancel' tabindex='2'>{{cancel}}</button>" |
|||
}, |
|||
input: "<input type='text'>", |
|||
message: "<p class='msg'>{{message}}</p>", |
|||
log: "<div class='{{class}}'>{{message}}</div>" |
|||
}, |
|||
|
|||
defaultDialogs: { |
|||
buttons: { |
|||
holder: "<nav>{{buttons}}</nav>", |
|||
ok: "<button class='ok' tabindex='1'>{{ok}}</button>", |
|||
cancel: "<button class='cancel' tabindex='2'>{{cancel}}</button>" |
|||
}, |
|||
input: "<input type='text'>", |
|||
message: "<p class='msg'>{{message}}</p>", |
|||
log: "<div class='{{class}}'>{{message}}</div>" |
|||
}, |
|||
|
|||
/** |
|||
* Build the proper message box |
|||
* |
|||
* @param {Object} item Current object in the queue |
|||
* |
|||
* @return {String} An HTML string of the message box |
|||
*/ |
|||
build: function(item) { |
|||
|
|||
var btnTxt = this.dialogs.buttons.ok; |
|||
var html = "<div class='dialog'>" + "<div>" + this.dialogs.message.replace("{{message}}", item.message); |
|||
|
|||
if(item.type === "confirm" || item.type === "prompt") { |
|||
btnTxt = this.dialogs.buttons.cancel + this.dialogs.buttons.ok; |
|||
} |
|||
|
|||
if (item.type === "prompt") { |
|||
html += this.dialogs.input; |
|||
} |
|||
|
|||
html = (html + this.dialogs.buttons.holder + "</div>" + "</div>") |
|||
.replace("{{buttons}}", btnTxt) |
|||
.replace("{{ok}}", this.okLabel) |
|||
.replace("{{cancel}}", this.cancelLabel); |
|||
|
|||
return html; |
|||
|
|||
}, |
|||
|
|||
setCloseLogOnClick: function(bool) { |
|||
this.closeLogOnClick = !! bool; |
|||
}, |
|||
|
|||
/** |
|||
* Close the log messages |
|||
* |
|||
* @param {Object} elem HTML Element of log message to close |
|||
* @param {Number} wait [optional] Time (in ms) to wait before automatically hiding the message, if 0 never hide |
|||
* |
|||
* @return {undefined} |
|||
*/ |
|||
close: function(elem, wait) { |
|||
|
|||
if (this.closeLogOnClick) { |
|||
elem.addEventListener("click", function(ev) { |
|||
hideElement(ev.srcElement); |
|||
}); |
|||
} |
|||
|
|||
wait = wait && !isNaN(+wait) ? +wait : this.delay; |
|||
|
|||
if (wait < 0) { |
|||
hideElement(elem); |
|||
} else if(wait > 0) { |
|||
setTimeout(function() { |
|||
hideElement(elem); |
|||
}, wait); |
|||
} |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* Create a dialog box |
|||
* |
|||
* @param {String} message The message passed from the callee |
|||
* @param {String} type Type of dialog to create |
|||
* @param {Function} onOkay [Optional] Callback function when clicked okay. |
|||
* @param {Function} onCancel [Optional] Callback function when cancelled. |
|||
* |
|||
* @return {Object} |
|||
*/ |
|||
dialog: function(message, type, onOkay, onCancel) { |
|||
return this.setup({ |
|||
type: type, |
|||
message: message, |
|||
onOkay: onOkay, |
|||
onCancel: onCancel |
|||
}); |
|||
}, |
|||
|
|||
/** |
|||
* Show a new log message box |
|||
* |
|||
* @param {String} message The message passed from the callee |
|||
* @param {String} type [Optional] Optional type of log message |
|||
* @param {Number} wait [Optional] Time (in ms) to wait before auto-hiding the log |
|||
* |
|||
* @return {Object} |
|||
*/ |
|||
log: function(message, type, click) { |
|||
|
|||
var existing = document.querySelectorAll(".alertify-logs > div"); |
|||
if (existing) { |
|||
var diff = existing.length - this.maxLogItems; |
|||
if (diff >= 0) { |
|||
for (var i = 0, _i = diff + 1; i < _i; i++) { |
|||
this.close(existing[i], -1); |
|||
} |
|||
} |
|||
} |
|||
|
|||
this.notify(message, type, click); |
|||
}, |
|||
|
|||
setLogPosition: function(str) { |
|||
this.logContainerClass = "alertify-logs " + str; |
|||
}, |
|||
|
|||
setupLogContainer: function() { |
|||
|
|||
var elLog = document.querySelector(".alertify-logs"); |
|||
var className = this.logContainerClass; |
|||
if (! elLog) { |
|||
elLog = document.createElement("div"); |
|||
elLog.className = className; |
|||
this.parent.appendChild(elLog); |
|||
} |
|||
|
|||
// Make sure it's positioned properly.
|
|||
if (elLog.className !== className) { |
|||
elLog.className = className; |
|||
} |
|||
|
|||
return elLog; |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* Add new log message |
|||
* If a type is passed, a class name "{type}" will get added. |
|||
* This allows for custom look and feel for various types of notifications. |
|||
* |
|||
* @param {String} message The message passed from the callee |
|||
* @param {String} type [Optional] Type of log message |
|||
* @param {Number} wait [Optional] Time (in ms) to wait before auto-hiding |
|||
* |
|||
* @return {undefined} |
|||
*/ |
|||
notify: function(message, type, click) { |
|||
|
|||
var elLog = this.setupLogContainer(); |
|||
var log = document.createElement("div"); |
|||
|
|||
log.className = (type || "default"); |
|||
if (_alertify.logTemplateMethod) { |
|||
log.innerHTML = _alertify.logTemplateMethod(message); |
|||
} else { |
|||
log.innerHTML = message; |
|||
} |
|||
|
|||
// Add the click handler, if specified.
|
|||
if ("function" === typeof click) { |
|||
log.addEventListener("click", click); |
|||
} |
|||
|
|||
elLog.appendChild(log); |
|||
setTimeout(function() { |
|||
log.className += " show"; |
|||
}, 10); |
|||
|
|||
this.close(log, this.delay); |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* Initiate all the required pieces for the dialog box |
|||
* |
|||
* @return {undefined} |
|||
*/ |
|||
setup: function(item) { |
|||
|
|||
var el = document.createElement("div"); |
|||
el.className = "alertify hide"; |
|||
el.innerHTML = this.build(item); |
|||
|
|||
var btnOK = el.querySelector(".ok"); |
|||
var btnCancel = el.querySelector(".cancel"); |
|||
var input = el.querySelector("input"); |
|||
var label = el.querySelector("label"); |
|||
|
|||
// Set default value/placeholder of input
|
|||
if (input) { |
|||
if (typeof this.promptPlaceholder === "string") { |
|||
// Set the label, if available, for MDL, etc.
|
|||
if (label) { |
|||
label.textContent = this.promptPlaceholder; |
|||
} else { |
|||
input.placeholder = this.promptPlaceholder; |
|||
} |
|||
} |
|||
if (typeof this.promptValue === "string") { |
|||
input.value = this.promptValue; |
|||
} |
|||
} |
|||
|
|||
function setupHandlers(resolve) { |
|||
if ("function" !== typeof resolve) { |
|||
// promises are not available so resolve is a no-op
|
|||
resolve = function () {}; |
|||
} |
|||
|
|||
if (btnOK) { |
|||
btnOK.addEventListener("click", function(ev) { |
|||
if (item.onOkay && "function" === typeof item.onOkay) { |
|||
if (input) { |
|||
item.onOkay(input.value, ev); |
|||
} else { |
|||
item.onOkay(ev); |
|||
} |
|||
} |
|||
|
|||
if (input) { |
|||
resolve({ |
|||
buttonClicked: "ok", |
|||
inputValue: input.value, |
|||
event: ev |
|||
}); |
|||
} else { |
|||
resolve({ |
|||
buttonClicked: "ok", |
|||
event: ev |
|||
}); |
|||
} |
|||
|
|||
hideElement(el); |
|||
}); |
|||
} |
|||
|
|||
if (btnCancel) { |
|||
btnCancel.addEventListener("click", function(ev) { |
|||
if (item.onCancel && "function" === typeof item.onCancel) { |
|||
item.onCancel(ev); |
|||
} |
|||
|
|||
resolve({ |
|||
buttonClicked: "cancel", |
|||
event: ev |
|||
}); |
|||
|
|||
hideElement(el); |
|||
}); |
|||
} |
|||
} |
|||
|
|||
var promise; |
|||
|
|||
if (typeof Promise === "function") { |
|||
promise = new Promise(setupHandlers); |
|||
} else { |
|||
setupHandlers(); |
|||
} |
|||
|
|||
this.parent.appendChild(el); |
|||
setTimeout(function() { |
|||
el.classList.remove("hide"); |
|||
if(input && item.type && item.type === "prompt") { |
|||
input.select(); |
|||
input.focus(); |
|||
} else { |
|||
if (btnOK) { |
|||
btnOK.focus(); |
|||
} |
|||
} |
|||
}, 100); |
|||
|
|||
return promise; |
|||
}, |
|||
|
|||
okBtn: function(label) { |
|||
this.okLabel = label; |
|||
return this; |
|||
}, |
|||
|
|||
setDelay: function(time) { |
|||
time = time || 0; |
|||
this.delay = isNaN(time) ? this.defaultDelay : parseInt(time, 10); |
|||
return this; |
|||
}, |
|||
|
|||
cancelBtn: function(str) { |
|||
this.cancelLabel = str; |
|||
return this; |
|||
}, |
|||
|
|||
setMaxLogItems: function(num) { |
|||
this.maxLogItems = parseInt(num || this.defaultMaxLogItems); |
|||
}, |
|||
|
|||
theme: function(themeStr) { |
|||
switch(themeStr.toLowerCase()) { |
|||
case "bootstrap": |
|||
this.dialogs.buttons.ok = "<button class='ok btn btn-primary' tabindex='1'>{{ok}}</button>"; |
|||
this.dialogs.buttons.cancel = "<button class='cancel btn btn-default' tabindex='2'>{{cancel}}</button>"; |
|||
this.dialogs.input = "<input type='text' class='form-control'>"; |
|||
break; |
|||
case "purecss": |
|||
this.dialogs.buttons.ok = "<button class='ok pure-button' tabindex='1'>{{ok}}</button>"; |
|||
this.dialogs.buttons.cancel = "<button class='cancel pure-button' tabindex='2'>{{cancel}}</button>"; |
|||
break; |
|||
case "mdl": |
|||
case "material-design-light": |
|||
this.dialogs.buttons.ok = "<button class='ok mdl-button mdl-js-button mdl-js-ripple-effect' tabindex='1'>{{ok}}</button>"; |
|||
this.dialogs.buttons.cancel = "<button class='cancel mdl-button mdl-js-button mdl-js-ripple-effect' tabindex='2'>{{cancel}}</button>"; |
|||
this.dialogs.input = "<div class='mdl-textfield mdl-js-textfield'><input class='mdl-textfield__input'><label class='md-textfield__label'></label></div>"; |
|||
break; |
|||
case "angular-material": |
|||
this.dialogs.buttons.ok = "<button class='ok md-primary md-button' tabindex='1'>{{ok}}</button>"; |
|||
this.dialogs.buttons.cancel = "<button class='cancel md-button' tabindex='2'>{{cancel}}</button>"; |
|||
this.dialogs.input = "<div layout='column'><md-input-container md-no-float><input type='text'></md-input-container></div>"; |
|||
break; |
|||
case "default": |
|||
default: |
|||
this.dialogs.buttons.ok = this.defaultDialogs.buttons.ok; |
|||
this.dialogs.buttons.cancel = this.defaultDialogs.buttons.cancel; |
|||
this.dialogs.input = this.defaultDialogs.input; |
|||
break; |
|||
} |
|||
}, |
|||
|
|||
reset: function() { |
|||
this.parent = document.body; |
|||
this.theme("default"); |
|||
this.okBtn(this.defaultOkLabel); |
|||
this.cancelBtn(this.defaultCancelLabel); |
|||
this.setMaxLogItems(); |
|||
this.promptValue = ""; |
|||
this.promptPlaceholder = ""; |
|||
this.delay = this.defaultDelay; |
|||
this.setCloseLogOnClick(this.closeLogOnClickDefault); |
|||
this.setLogPosition("bottom left"); |
|||
this.logTemplateMethod = null; |
|||
}, |
|||
|
|||
injectCSS: function() { |
|||
if (!document.querySelector("#alertifyCSS")) { |
|||
var head = document.getElementsByTagName("head")[0]; |
|||
var css = document.createElement("style"); |
|||
css.type = "text/css"; |
|||
css.id = "alertifyCSS"; |
|||
css.innerHTML = "/* style.css */"; |
|||
head.insertBefore(css, head.firstChild); |
|||
} |
|||
}, |
|||
|
|||
removeCSS: function() { |
|||
var css = document.querySelector("#alertifyCSS"); |
|||
if (css && css.parentNode) { |
|||
css.parentNode.removeChild(css); |
|||
} |
|||
} |
|||
|
|||
}; |
|||
|
|||
_alertify.injectCSS(); |
|||
|
|||
return { |
|||
_$$alertify: _alertify, |
|||
parent: function(elem) { |
|||
_alertify.parent = elem; |
|||
}, |
|||
reset: function() { |
|||
_alertify.reset(); |
|||
return this; |
|||
}, |
|||
alert: function(message, onOkay, onCancel) { |
|||
return _alertify.dialog(message, "alert", onOkay, onCancel) || this; |
|||
}, |
|||
confirm: function(message, onOkay, onCancel) { |
|||
return _alertify.dialog(message, "confirm", onOkay, onCancel) || this; |
|||
}, |
|||
prompt: function(message, onOkay, onCancel) { |
|||
return _alertify.dialog(message, "prompt", onOkay, onCancel) || this; |
|||
}, |
|||
log: function(message, click) { |
|||
_alertify.log(message, "default", click); |
|||
return this; |
|||
}, |
|||
theme: function(themeStr) { |
|||
_alertify.theme(themeStr); |
|||
return this; |
|||
}, |
|||
success: function(message, click) { |
|||
_alertify.log(message, "success", click); |
|||
return this; |
|||
}, |
|||
error: function(message, click) { |
|||
_alertify.log(message, "error", click); |
|||
return this; |
|||
}, |
|||
cancelBtn: function(label) { |
|||
_alertify.cancelBtn(label); |
|||
return this; |
|||
}, |
|||
okBtn: function(label) { |
|||
_alertify.okBtn(label); |
|||
return this; |
|||
}, |
|||
delay: function(time) { |
|||
_alertify.setDelay(time); |
|||
return this; |
|||
}, |
|||
placeholder: function(str) { |
|||
_alertify.promptPlaceholder = str; |
|||
return this; |
|||
}, |
|||
defaultValue: function(str) { |
|||
_alertify.promptValue = str; |
|||
return this; |
|||
}, |
|||
maxLogItems: function(num) { |
|||
_alertify.setMaxLogItems(num); |
|||
return this; |
|||
}, |
|||
closeLogOnClick: function(bool) { |
|||
_alertify.setCloseLogOnClick(!! bool); |
|||
return this; |
|||
}, |
|||
logPosition: function(str) { |
|||
_alertify.setLogPosition(str || ""); |
|||
return this; |
|||
}, |
|||
setLogTemplate: function(templateMethod) { |
|||
_alertify.logTemplateMethod = templateMethod; |
|||
return this; |
|||
}, |
|||
clearLogs: function() { |
|||
_alertify.setupLogContainer().innerHTML = ""; |
|||
return this; |
|||
}, |
|||
version: _alertify.version |
|||
}; |
|||
} |
|||
|
|||
// AMD, window, and NPM support
|
|||
if ("undefined" !== typeof module && !! module && !! module.exports) { |
|||
// Preserve backwards compatibility
|
|||
module.exports = function() { |
|||
return new Alertify(); |
|||
}; |
|||
var obj = new Alertify(); |
|||
for (var key in obj) { |
|||
module.exports[key] = obj[key]; |
|||
} |
|||
} else if (typeof define === "function" && define.amd) { |
|||
define(function() { |
|||
return new Alertify(); |
|||
}); |
|||
} else { |
|||
window.alertify = new Alertify(); |
|||
} |
|||
|
|||
}()); |
File diff suppressed because one or more lines are too long
@ -1,8 +0,0 @@ |
|||
/*! |
|||
* animsition v3.6.0 |
|||
* A simple and easy jQuery plugin for CSS animated page transitions. |
|||
* http://blivesta.github.io/animsition
|
|||
* License : MIT |
|||
* Author : blivesta (http://blivesta.com/)
|
|||
*/ |
|||
!function(n){"use strict";"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof exports?module.exports=n(require("jquery")):n(jQuery)}(function(n){"use strict";var a="animsition",i={init:function(t){t=n.extend({inClass:"fade-in",outClass:"fade-out",inDuration:1500,outDuration:800,linkElement:".animsition-link",loading:!0,loadingParentElement:"body",loadingClass:"animsition-loading",unSupportCss:["animation-duration","-webkit-animation-duration","-o-animation-duration"],overlay:!1,overlayClass:"animsition-overlay-slide",overlayParentElement:"body"},t);var o=i.supportCheck.call(this,t);if(!o&&t.unSupportCss.length>0&&(!o||!this.length))return"console"in window||(window.console={},window.console.log=function(n){return n}),this.length||console.log("Animsition: Element does not exist on page."),o||console.log("Animsition: Does not support this browser."),i.destroy.call(this);var e=i.optionCheck.call(this,t);return e&&i.addOverlay.call(this,t),t.loading&&i.addLoading.call(this,t),this.each(function(){var o=this,e=n(this),s=n(window),l=e.data(a);l||(t=n.extend({},t),e.data(a,{options:t}),s.on("load."+a+" pageshow."+a,function(){i.pageIn.call(o)}),s.on("unload."+a,function(){}),n(t.linkElement).on("click."+a,function(a){a.preventDefault();var t=n(this),e=t.attr("href");2===a.which||a.metaKey||a.shiftKey||-1!==navigator.platform.toUpperCase().indexOf("WIN")&&a.ctrlKey?window.open(e,"_blank"):i.pageOut.call(o,t,e)}))})},addOverlay:function(a){n(a.overlayParentElement).prepend('<div class="'+a.overlayClass+'"></div>')},addLoading:function(a){n(a.loadingParentElement).append('<div class="'+a.loadingClass+'"></div>')},removeLoading:function(){var i=n(this),t=i.data(a).options,o=n(t.loadingParentElement).children("."+t.loadingClass);o.fadeOut().remove()},supportCheck:function(a){var i=n(this),t=a.unSupportCss,o=t.length,e=!1;0===o&&(e=!0);for(var s=0;o>s;s++)if("string"==typeof i.css(t[s])){e=!0;break}return e},optionCheck:function(a){var i,t=n(this);return i=a.overlay||t.data("animsition-overlay")?!0:!1},animationCheck:function(i,t,o){var e=n(this),s=e.data(a).options,l=typeof i,r=!t&&"number"===l,c=t&&"string"===l&&i.length>0;return r||c?i=i:t&&o?i=s.inClass:!t&&o?i=s.inDuration:t&&!o?i=s.outClass:t||o||(i=s.outDuration),i},pageIn:function(){var t=this,o=n(this),e=o.data(a).options,s=o.data("animsition-in-duration"),l=o.data("animsition-in"),r=i.animationCheck.call(t,s,!1,!0),c=i.animationCheck.call(t,l,!0,!0),d=i.optionCheck.call(t,e);e.loading&&i.removeLoading.call(t),d?i.pageInOverlay.call(t,c,r):i.pageInBasic.call(t,c,r)},pageInBasic:function(a,i){var t=n(this);t.trigger("animsition.start").css({"animation-duration":i/1e3+"s"}).addClass(a).animateCallback(function(){t.removeClass(a).css({opacity:1}).trigger("animsition.end")})},pageInOverlay:function(i,t){var o=n(this),e=o.data(a).options;o.trigger("animsition.start").css({opacity:1}),n(e.overlayParentElement).children("."+e.overlayClass).css({"animation-duration":t/1e3+"s"}).addClass(i).animateCallback(function(){o.trigger("animsition.end")})},pageOut:function(t,o){var e=this,s=n(this),l=s.data(a).options,r=t.data("animsition-out"),c=s.data("animsition-out"),d=t.data("animsition-out-duration"),u=s.data("animsition-out-duration"),m=r?r:c,h=d?d:u,p=i.animationCheck.call(e,m,!0,!1),f=i.animationCheck.call(e,h,!1,!1),g=i.optionCheck.call(e,l);g?i.pageOutOverlay.call(e,p,f,o):i.pageOutBasic.call(e,p,f,o)},pageOutBasic:function(a,i,t){var o=n(this);o.css({"animation-duration":i/1e3+"s"}).addClass(a).animateCallback(function(){location.href=t})},pageOutOverlay:function(t,o,e){var s=this,l=n(this),r=l.data(a).options,c=l.data("animsition-in"),d=i.animationCheck.call(s,c,!0,!0);n(r.overlayParentElement).children("."+r.overlayClass).css({"animation-duration":o/1e3+"s"}).removeClass(d).addClass(t).animateCallback(function(){location.href=e})},destroy:function(){return this.each(function(){var i=n(this);n(window).unbind("."+a),i.css({opacity:1}).removeData(a)})}};n.fn.animateCallback=function(a){var i="animationend webkitAnimationEnd mozAnimationEnd oAnimationEnd MSAnimationEnd";return this.each(function(){n(this).bind(i,function(){return n(this).unbind(i),a.call(this)})})},n.fn.animsition=function(t){return i[t]?i[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void n.error("Method "+t+" does not exist on jQuery."+a):i.init.apply(this,arguments)}}); |
File diff suppressed because one or more lines are too long
@ -1,4 +0,0 @@ |
|||
/*! jQuery asProgress - v0.1.1 - 2014-12-09 |
|||
* https://github.com/amazingSurge/jquery-asProgress
|
|||
* Copyright (c) 2014 amazingSurge; Licensed GPL */ |
|||
!function(a,b,c){"use strict";function d(a){return"string"==typeof a&&-1!=a.indexOf("%")}function e(){return"undefined"!=typeof c.performance&&c.performance.now?c.performance.now():Date.now()}Date.now||(Date.now=function(){return(new Date).getTime()});for(var f=["webkit","moz"],g=0;g<f.length&&!c.requestAnimationFrame;++g){var h=f[g];c.requestAnimationFrame=c[h+"RequestAnimationFrame"],c.cancelAnimationFrame=c[h+"CancelAnimationFrame"]||c[h+"CancelRequestAnimationFrame"]}if(/iP(ad|hone|od).*OS (6|7)/.test(c.navigator.userAgent)||!c.requestAnimationFrame||!c.cancelAnimationFrame){var i=0;c.requestAnimationFrame=function(a){var b=Date.now(),c=Math.max(i+16,b);return setTimeout(function(){a(i=c)},c-b)},c.cancelAnimationFrame=clearTimeout}var j="asProgress",k=a[j]=function(b,c){this.element=b,this.$element=a(b),this.options=a.extend({},k.defaults,c,this.$element.data()),this.options.bootstrap?(this.namespace="progress",this.$target=this.$element.find(".progress-bar"),this.classes={label:this.namespace+"-label",bar:this.namespace+"-bar"}):(this.namespace=this.options.namespace,this.classes={label:this.namespace+"__label",bar:this.namespace+"__bar"},this.$target=this.$element,this.$element.addClass(this.namespace)),this.easing=k.easing[this.options.easing]||k.easing.ease,this.min=this.$target.attr("aria-valuemin"),this.max=this.$target.attr("aria-valuemax"),this.min=this.min?parseInt(this.min,10):this.options.min,this.max=this.max?parseInt(this.max,10):this.options.max,this.first=this.$target.attr("aria-valuenow"),this.first=this.first?parseInt(this.first,10):this.min,this.now=this.first,this.goal=this.options.goal,this._frameId=null,this.initialized=!1,this._trigger("init"),this.init()};k.defaults={namespace:"asProgress",bootstrap:!1,min:0,max:100,goal:100,speed:20,easing:"ease",labelCallback:function(a){var b=this.getPercentage(a);return b+"%"}};var l=function(a,b,c,d){function e(a,b){return 1-3*b+3*a}function f(a,b){return 3*b-6*a}function g(a){return 3*a}function h(a,b,c){return((e(b,c)*a+f(b,c))*a+g(b))*a}function i(a,b,c){return 3*e(b,c)*a*a+2*f(b,c)*a+g(b)}function j(b){for(var d=b,e=0;4>e;++e){var f=i(d,a,c);if(0===f)return d;var g=h(d,a,c)-b;d-=g/f}return d}return a===b&&c===d?{css:"linear",fn:function(a){return a}}:{css:"cubic-bezier("+a+","+b+","+c+","+d+")",fn:function(a){return h(j(a),b,d)}}};a.extend(k.easing={},{ease:l(.25,.1,.25,1),linear:l(0,0,1,1),"ease-in":l(.42,0,1,1),"ease-out":l(0,0,.58,1),"ease-in-out":l(.42,0,.58,1)}),k.prototype={constructor:k,init:function(){this.$bar=this.$element.find("."+this.classes.bar),this.$label=this.$element.find("."+this.classes.label),this.reset(),this.initialized=!0,this._trigger("ready")},_trigger:function(a){var b=Array.prototype.slice.call(arguments,1),c=[this].concat(b);this.$element.trigger(j+"::"+a,c),a=a.replace(/\b\w+\b/g,function(a){return a.substring(0,1).toUpperCase()+a.substring(1)});var d="on"+a;"function"==typeof this.options[d]&&this.options[d].apply(this,b)},getPercentage:function(a){return Math.round(100*(a-this.min)/(this.max-this.min))},go:function(a){var b=this;this._clear(),d(a)&&(a=parseInt(a.replace("%",""),10),a=Math.round(this.min+a/100*(this.max-this.min))),"undefined"==typeof a&&(a=this.goal),a>this.max?a=this.max:a<this.min&&(a=this.min);var f=b.now,g=e(),h=function(d){var e=(d-g)/b.options.speed,i=Math.round(b.easing.fn(e/100)*(b.max-b.min));a>f?(i=f+i,i>a&&(i=a)):(i=f-i,a>i&&(i=a)),b._update(i),i===a?(c.cancelAnimationFrame(b._frameId),b._frameId=null,b.now===b.goal&&b._trigger("finish")):b._frameId=c.requestAnimationFrame(h)};b._frameId=c.requestAnimationFrame(h)},_update:function(a){this.now=a;var b=this.getPercentage(this.now);this.$bar.css("width",b+"%"),this.$target.attr("aria-valuenow",this.now),this.$label.length>0&&"function"==typeof this.options.labelCallback&&this.$label.html(this.options.labelCallback.call(this,[this.now])),this._trigger("update",a)},get:function(){return this.now},start:function(){this._clear(),this._trigger("start"),this.go(this.goal)},_clear:function(){this._frameId&&(c.cancelAnimationFrame(this._frameId),this._frameId=null)},reset:function(){this._clear(),this._update(this.first),this._trigger("reset")},stop:function(){this._clear(),this._trigger("stop")},finish:function(){this._clear(),this._update(this.goal),this._trigger("finish")},destory:function(){this.$element.data(j,null),this._trigger("destory")}},a.fn[j]=function(b){if("string"!=typeof b)return this.each(function(){a.data(this,j)||a.data(this,j,new k(this,b))});var c=b,d=Array.prototype.slice.call(arguments,1);if(/^\_/.test(c))return!1;if(!/^(get)$/.test(c))return this.each(function(){var b=a.data(this,j);b&&"function"==typeof b[c]&&b[c].apply(b,d)});var e=this.first().data(j);return e&&"function"==typeof e[c]?e[c].apply(e,d):void 0}}(jQuery,document,window); |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,990 +0,0 @@ |
|||
/** |
|||
* bootbox.js [master branch] |
|||
* |
|||
* http://bootboxjs.com/license.txt
|
|||
*/ |
|||
|
|||
// @see https://github.com/makeusabrew/bootbox/issues/180
|
|||
// @see https://github.com/makeusabrew/bootbox/issues/186
|
|||
(function (root, factory) { |
|||
|
|||
"use strict"; |
|||
if (typeof define === "function" && define.amd) { |
|||
// AMD. Register as an anonymous module.
|
|||
define(["jquery"], factory); |
|||
} else if (typeof exports === "object") { |
|||
// Node. Does not work with strict CommonJS, but
|
|||
// only CommonJS-like environments that support module.exports,
|
|||
// like Node.
|
|||
module.exports = factory(require("jquery")); |
|||
} else { |
|||
// Browser globals (root is window)
|
|||
root.bootbox = factory(root.jQuery); |
|||
} |
|||
|
|||
}(this, function init($, undefined) { |
|||
|
|||
"use strict"; |
|||
|
|||
// the base DOM structure needed to create a modal
|
|||
var templates = { |
|||
dialog: |
|||
"<div class='bootbox modal' tabindex='-1' role='dialog' aria-hidden='true'>" + |
|||
"<div class='modal-dialog'>" + |
|||
"<div class='modal-content'>" + |
|||
"<div class='modal-body'><div class='bootbox-body'></div></div>" + |
|||
"</div>" + |
|||
"</div>" + |
|||
"</div>", |
|||
header: |
|||
"<div class='modal-header'>" + |
|||
"<h4 class='modal-title'></h4>" + |
|||
"</div>", |
|||
footer: |
|||
"<div class='modal-footer'></div>", |
|||
closeButton: |
|||
"<button type='button' class='bootbox-close-button close' data-dismiss='modal' aria-hidden='true'>×</button>", |
|||
form: |
|||
"<form class='bootbox-form'></form>", |
|||
inputs: { |
|||
text: |
|||
"<input class='bootbox-input bootbox-input-text form-control' autocomplete=off type=text />", |
|||
textarea: |
|||
"<textarea class='bootbox-input bootbox-input-textarea form-control'></textarea>", |
|||
email: |
|||
"<input class='bootbox-input bootbox-input-email form-control' autocomplete='off' type='email' />", |
|||
select: |
|||
"<select class='bootbox-input bootbox-input-select form-control'></select>", |
|||
checkbox: |
|||
"<div class='checkbox'><label><input class='bootbox-input bootbox-input-checkbox' type='checkbox' /></label></div>", |
|||
date: |
|||
"<input class='bootbox-input bootbox-input-date form-control' autocomplete=off type='date' />", |
|||
time: |
|||
"<input class='bootbox-input bootbox-input-time form-control' autocomplete=off type='time' />", |
|||
number: |
|||
"<input class='bootbox-input bootbox-input-number form-control' autocomplete=off type='number' />", |
|||
password: |
|||
"<input class='bootbox-input bootbox-input-password form-control' autocomplete='off' type='password' />" |
|||
} |
|||
}; |
|||
|
|||
var defaults = { |
|||
// default language
|
|||
locale: "en", |
|||
// show backdrop or not. Default to static so user has to interact with dialog
|
|||
backdrop: "static", |
|||
// animate the modal in/out
|
|||
animate: true, |
|||
// additional class string applied to the top level dialog
|
|||
className: null, |
|||
// whether or not to include a close button
|
|||
closeButton: true, |
|||
// show the dialog immediately by default
|
|||
show: true, |
|||
// dialog container
|
|||
container: "body" |
|||
}; |
|||
|
|||
// our public object; augmented after our private API
|
|||
var exports = {}; |
|||
|
|||
/** |
|||
* @private |
|||
*/ |
|||
function _t(key) { |
|||
var locale = locales[defaults.locale]; |
|||
return locale ? locale[key] : locales.en[key]; |
|||
} |
|||
|
|||
function processCallback(e, dialog, callback) { |
|||
e.stopPropagation(); |
|||
e.preventDefault(); |
|||
|
|||
// by default we assume a callback will get rid of the dialog,
|
|||
// although it is given the opportunity to override this
|
|||
|
|||
// so, if the callback can be invoked and it *explicitly returns false*
|
|||
// then we'll set a flag to keep the dialog active...
|
|||
var preserveDialog = $.isFunction(callback) && callback.call(dialog, e) === false; |
|||
|
|||
// ... otherwise we'll bin it
|
|||
if (!preserveDialog) { |
|||
dialog.modal("hide"); |
|||
} |
|||
} |
|||
|
|||
function getKeyLength(obj) { |
|||
// @TODO defer to Object.keys(x).length if available?
|
|||
var k, t = 0; |
|||
for (k in obj) { |
|||
t ++; |
|||
} |
|||
return t; |
|||
} |
|||
|
|||
function each(collection, iterator) { |
|||
var index = 0; |
|||
$.each(collection, function(key, value) { |
|||
iterator(key, value, index++); |
|||
}); |
|||
} |
|||
|
|||
function sanitize(options) { |
|||
var buttons; |
|||
var total; |
|||
|
|||
if (typeof options !== "object") { |
|||
throw new Error("Please supply an object of options"); |
|||
} |
|||
|
|||
if (!options.message) { |
|||
throw new Error("Please specify a message"); |
|||
} |
|||
|
|||
// make sure any supplied options take precedence over defaults
|
|||
options = $.extend({}, defaults, options); |
|||
|
|||
if (!options.buttons) { |
|||
options.buttons = {}; |
|||
} |
|||
|
|||
buttons = options.buttons; |
|||
|
|||
total = getKeyLength(buttons); |
|||
|
|||
each(buttons, function(key, button, index) { |
|||
|
|||
if ($.isFunction(button)) { |
|||
// short form, assume value is our callback. Since button
|
|||
// isn't an object it isn't a reference either so re-assign it
|
|||
button = buttons[key] = { |
|||
callback: button |
|||
}; |
|||
} |
|||
|
|||
// before any further checks make sure by now button is the correct type
|
|||
if ($.type(button) !== "object") { |
|||
throw new Error("button with key " + key + " must be an object"); |
|||
} |
|||
|
|||
if (!button.label) { |
|||
// the lack of an explicit label means we'll assume the key is good enough
|
|||
button.label = key; |
|||
} |
|||
|
|||
if (!button.className) { |
|||
if (total <= 2 && index === total-1) { |
|||
// always add a primary to the main option in a two-button dialog
|
|||
button.className = "btn-primary"; |
|||
} else { |
|||
button.className = "btn-default"; |
|||
} |
|||
} |
|||
}); |
|||
|
|||
return options; |
|||
} |
|||
|
|||
/** |
|||
* map a flexible set of arguments into a single returned object |
|||
* if args.length is already one just return it, otherwise |
|||
* use the properties argument to map the unnamed args to |
|||
* object properties |
|||
* so in the latter case: |
|||
* mapArguments(["foo", $.noop], ["message", "callback"]) |
|||
* -> { message: "foo", callback: $.noop } |
|||
*/ |
|||
function mapArguments(args, properties) { |
|||
var argn = args.length; |
|||
var options = {}; |
|||
|
|||
if (argn < 1 || argn > 2) { |
|||
throw new Error("Invalid argument length"); |
|||
} |
|||
|
|||
if (argn === 2 || typeof args[0] === "string") { |
|||
options[properties[0]] = args[0]; |
|||
options[properties[1]] = args[1]; |
|||
} else { |
|||
options = args[0]; |
|||
} |
|||
|
|||
return options; |
|||
} |
|||
|
|||
/** |
|||
* merge a set of default dialog options with user supplied arguments |
|||
*/ |
|||
function mergeArguments(defaults, args, properties) { |
|||
return $.extend( |
|||
// deep merge
|
|||
true, |
|||
// ensure the target is an empty, unreferenced object
|
|||
{}, |
|||
// the base options object for this type of dialog (often just buttons)
|
|||
defaults, |
|||
// args could be an object or array; if it's an array properties will
|
|||
// map it to a proper options object
|
|||
mapArguments( |
|||
args, |
|||
properties |
|||
) |
|||
); |
|||
} |
|||
|
|||
/** |
|||
* this entry-level method makes heavy use of composition to take a simple |
|||
* range of inputs and return valid options suitable for passing to bootbox.dialog |
|||
*/ |
|||
function mergeDialogOptions(className, labels, properties, args) { |
|||
// build up a base set of dialog properties
|
|||
var baseOptions = { |
|||
className: "bootbox-" + className, |
|||
buttons: createLabels.apply(null, labels) |
|||
}; |
|||
|
|||
// ensure the buttons properties generated, *after* merging
|
|||
// with user args are still valid against the supplied labels
|
|||
return validateButtons( |
|||
// merge the generated base properties with user supplied arguments
|
|||
mergeArguments( |
|||
baseOptions, |
|||
args, |
|||
// if args.length > 1, properties specify how each arg maps to an object key
|
|||
properties |
|||
), |
|||
labels |
|||
); |
|||
} |
|||
|
|||
/** |
|||
* from a given list of arguments return a suitable object of button labels |
|||
* all this does is normalise the given labels and translate them where possible |
|||
* e.g. "ok", "confirm" -> { ok: "OK, cancel: "Annuleren" } |
|||
*/ |
|||
function createLabels() { |
|||
var buttons = {}; |
|||
|
|||
for (var i = 0, j = arguments.length; i < j; i++) { |
|||
var argument = arguments[i]; |
|||
var key = argument.toLowerCase(); |
|||
var value = argument.toUpperCase(); |
|||
|
|||
buttons[key] = { |
|||
label: _t(value) |
|||
}; |
|||
} |
|||
|
|||
return buttons; |
|||
} |
|||
|
|||
function validateButtons(options, buttons) { |
|||
var allowedButtons = {}; |
|||
each(buttons, function(key, value) { |
|||
allowedButtons[value] = true; |
|||
}); |
|||
|
|||
each(options.buttons, function(key) { |
|||
if (allowedButtons[key] === undefined) { |
|||
throw new Error("button key " + key + " is not allowed (options are " + buttons.join("\n") + ")"); |
|||
} |
|||
}); |
|||
|
|||
return options; |
|||
} |
|||
|
|||
exports.alert = function() { |
|||
var options; |
|||
|
|||
options = mergeDialogOptions("alert", ["ok"], ["message", "callback"], arguments); |
|||
|
|||
if (options.callback && !$.isFunction(options.callback)) { |
|||
throw new Error("alert requires callback property to be a function when provided"); |
|||
} |
|||
|
|||
/** |
|||
* overrides |
|||
*/ |
|||
options.buttons.ok.callback = options.onEscape = function() { |
|||
if ($.isFunction(options.callback)) { |
|||
return options.callback.call(this); |
|||
} |
|||
return true; |
|||
}; |
|||
|
|||
return exports.dialog(options); |
|||
}; |
|||
|
|||
exports.confirm = function() { |
|||
var options; |
|||
|
|||
options = mergeDialogOptions("confirm", ["cancel", "confirm"], ["message", "callback"], arguments); |
|||
|
|||
/** |
|||
* overrides; undo anything the user tried to set they shouldn't have |
|||
*/ |
|||
options.buttons.cancel.callback = options.onEscape = function() { |
|||
return options.callback.call(this, false); |
|||
}; |
|||
|
|||
options.buttons.confirm.callback = function() { |
|||
return options.callback.call(this, true); |
|||
}; |
|||
|
|||
// confirm specific validation
|
|||
if (!$.isFunction(options.callback)) { |
|||
throw new Error("confirm requires a callback"); |
|||
} |
|||
|
|||
return exports.dialog(options); |
|||
}; |
|||
|
|||
exports.prompt = function() { |
|||
var options; |
|||
var defaults; |
|||
var dialog; |
|||
var form; |
|||
var input; |
|||
var shouldShow; |
|||
var inputOptions; |
|||
|
|||
// we have to create our form first otherwise
|
|||
// its value is undefined when gearing up our options
|
|||
// @TODO this could be solved by allowing message to
|
|||
// be a function instead...
|
|||
form = $(templates.form); |
|||
|
|||
// prompt defaults are more complex than others in that
|
|||
// users can override more defaults
|
|||
// @TODO I don't like that prompt has to do a lot of heavy
|
|||
// lifting which mergeDialogOptions can *almost* support already
|
|||
// just because of 'value' and 'inputType' - can we refactor?
|
|||
defaults = { |
|||
className: "bootbox-prompt", |
|||
buttons: createLabels("cancel", "confirm"), |
|||
value: "", |
|||
inputType: "text" |
|||
}; |
|||
|
|||
options = validateButtons( |
|||
mergeArguments(defaults, arguments, ["title", "callback"]), |
|||
["cancel", "confirm"] |
|||
); |
|||
|
|||
// capture the user's show value; we always set this to false before
|
|||
// spawning the dialog to give us a chance to attach some handlers to
|
|||
// it, but we need to make sure we respect a preference not to show it
|
|||
shouldShow = (options.show === undefined) ? true : options.show; |
|||
|
|||
/** |
|||
* overrides; undo anything the user tried to set they shouldn't have |
|||
*/ |
|||
options.message = form; |
|||
|
|||
options.buttons.cancel.callback = options.onEscape = function() { |
|||
return options.callback.call(this, null); |
|||
}; |
|||
|
|||
options.buttons.confirm.callback = function() { |
|||
var value; |
|||
|
|||
switch (options.inputType) { |
|||
case "text": |
|||
case "textarea": |
|||
case "email": |
|||
case "select": |
|||
case "date": |
|||
case "time": |
|||
case "number": |
|||
case "password": |
|||
value = input.val(); |
|||
break; |
|||
|
|||
case "checkbox": |
|||
var checkedItems = input.find("input:checked"); |
|||
|
|||
// we assume that checkboxes are always multiple,
|
|||
// hence we default to an empty array
|
|||
value = []; |
|||
|
|||
each(checkedItems, function(_, item) { |
|||
value.push($(item).val()); |
|||
}); |
|||
break; |
|||
} |
|||
|
|||
return options.callback.call(this, value); |
|||
}; |
|||
|
|||
options.show = false; |
|||
|
|||
// prompt specific validation
|
|||
if (!options.title) { |
|||
throw new Error("prompt requires a title"); |
|||
} |
|||
|
|||
if (!$.isFunction(options.callback)) { |
|||
throw new Error("prompt requires a callback"); |
|||
} |
|||
|
|||
if (!templates.inputs[options.inputType]) { |
|||
throw new Error("invalid prompt type"); |
|||
} |
|||
|
|||
// create the input based on the supplied type
|
|||
input = $(templates.inputs[options.inputType]); |
|||
|
|||
switch (options.inputType) { |
|||
case "text": |
|||
case "textarea": |
|||
case "email": |
|||
case "date": |
|||
case "time": |
|||
case "number": |
|||
case "password": |
|||
input.val(options.value); |
|||
break; |
|||
|
|||
case "select": |
|||
var groups = {}; |
|||
inputOptions = options.inputOptions || []; |
|||
|
|||
if (!$.isArray(inputOptions)) { |
|||
throw new Error("Please pass an array of input options"); |
|||
} |
|||
|
|||
if (!inputOptions.length) { |
|||
throw new Error("prompt with select requires options"); |
|||
} |
|||
|
|||
each(inputOptions, function(_, option) { |
|||
|
|||
// assume the element to attach to is the input...
|
|||
var elem = input; |
|||
|
|||
if (option.value === undefined || option.text === undefined) { |
|||
throw new Error("given options in wrong format"); |
|||
} |
|||
|
|||
// ... but override that element if this option sits in a group
|
|||
|
|||
if (option.group) { |
|||
// initialise group if necessary
|
|||
if (!groups[option.group]) { |
|||
groups[option.group] = $("<optgroup/>").attr("label", option.group); |
|||
} |
|||
|
|||
elem = groups[option.group]; |
|||
} |
|||
|
|||
elem.append("<option value='" + option.value + "'>" + option.text + "</option>"); |
|||
}); |
|||
|
|||
each(groups, function(_, group) { |
|||
input.append(group); |
|||
}); |
|||
|
|||
// safe to set a select's value as per a normal input
|
|||
input.val(options.value); |
|||
break; |
|||
|
|||
case "checkbox": |
|||
var values = $.isArray(options.value) ? options.value : [options.value]; |
|||
inputOptions = options.inputOptions || []; |
|||
|
|||
if (!inputOptions.length) { |
|||
throw new Error("prompt with checkbox requires options"); |
|||
} |
|||
|
|||
if (!inputOptions[0].value || !inputOptions[0].text) { |
|||
throw new Error("given options in wrong format"); |
|||
} |
|||
|
|||
// checkboxes have to nest within a containing element, so
|
|||
// they break the rules a bit and we end up re-assigning
|
|||
// our 'input' element to this container instead
|
|||
input = $("<div/>"); |
|||
|
|||
each(inputOptions, function(_, option) { |
|||
var checkbox = $(templates.inputs[options.inputType]); |
|||
|
|||
checkbox.find("input").attr("value", option.value); |
|||
checkbox.find("label").append(option.text); |
|||
|
|||
// we've ensured values is an array so we can always iterate over it
|
|||
each(values, function(_, value) { |
|||
if (value === option.value) { |
|||
checkbox.find("input").prop("checked", true); |
|||
} |
|||
}); |
|||
|
|||
input.append(checkbox); |
|||
}); |
|||
break; |
|||
} |
|||
|
|||
// @TODO provide an attributes option instead
|
|||
// and simply map that as keys: vals
|
|||
if (options.placeholder) { |
|||
input.attr("placeholder", options.placeholder); |
|||
} |
|||
|
|||
if (options.pattern) { |
|||
input.attr("pattern", options.pattern); |
|||
} |
|||
|
|||
if (options.maxlength) { |
|||
input.attr("maxlength", options.maxlength); |
|||
} |
|||
|
|||
// now place it in our form
|
|||
form.append(input); |
|||
|
|||
form.on("submit", function(e) { |
|||
e.preventDefault(); |
|||
// Fix for SammyJS (or similar JS routing library) hijacking the form post.
|
|||
e.stopPropagation(); |
|||
// @TODO can we actually click *the* button object instead?
|
|||
// e.g. buttons.confirm.click() or similar
|
|||
dialog.find(".btn-primary").click(); |
|||
}); |
|||
|
|||
dialog = exports.dialog(options); |
|||
|
|||
// clear the existing handler focusing the submit button...
|
|||
dialog.off("shown.bs.modal"); |
|||
|
|||
// ...and replace it with one focusing our input, if possible
|
|||
dialog.on("shown.bs.modal", function() { |
|||
// need the closure here since input isn't
|
|||
// an object otherwise
|
|||
input.focus(); |
|||
}); |
|||
|
|||
if (shouldShow === true) { |
|||
dialog.modal("show"); |
|||
} |
|||
|
|||
return dialog; |
|||
}; |
|||
|
|||
exports.dialog = function(options) { |
|||
options = sanitize(options); |
|||
|
|||
var dialog = $(templates.dialog); |
|||
var innerDialog = dialog.find(".modal-dialog"); |
|||
var body = dialog.find(".modal-body"); |
|||
var buttons = options.buttons; |
|||
var buttonStr = ""; |
|||
var callbacks = { |
|||
onEscape: options.onEscape |
|||
}; |
|||
|
|||
if ($.fn.modal === undefined) { |
|||
throw new Error( |
|||
"$.fn.modal is not defined; please double check you have included " + |
|||
"the Bootstrap JavaScript library. See http://getbootstrap.com/javascript/ " + |
|||
"for more details." |
|||
); |
|||
} |
|||
|
|||
each(buttons, function(key, button) { |
|||
|
|||
// @TODO I don't like this string appending to itself; bit dirty. Needs reworking
|
|||
// can we just build up button elements instead? slower but neater. Then button
|
|||
// can just become a template too
|
|||
buttonStr += "<button data-bb-handler='" + key + "' type='button' class='btn " + button.className + "'>" + button.label + "</button>"; |
|||
callbacks[key] = button.callback; |
|||
}); |
|||
|
|||
body.find(".bootbox-body").html(options.message); |
|||
|
|||
if (options.animate === true) { |
|||
dialog.addClass("fade"); |
|||
} |
|||
|
|||
if (options.className) { |
|||
dialog.addClass(options.className); |
|||
} |
|||
|
|||
if (options.size === "large") { |
|||
innerDialog.addClass("modal-lg"); |
|||
} else if (options.size === "small") { |
|||
innerDialog.addClass("modal-sm"); |
|||
} |
|||
|
|||
if (options.title) { |
|||
body.before(templates.header); |
|||
} |
|||
|
|||
if (options.closeButton) { |
|||
var closeButton = $(templates.closeButton); |
|||
|
|||
if (options.title) { |
|||
dialog.find(".modal-header").prepend(closeButton); |
|||
} else { |
|||
closeButton.css("margin-top", "-10px").prependTo(body); |
|||
} |
|||
} |
|||
|
|||
if (options.title) { |
|||
dialog.find(".modal-title").html(options.title); |
|||
} |
|||
|
|||
if (buttonStr.length) { |
|||
body.after(templates.footer); |
|||
dialog.find(".modal-footer").html(buttonStr); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Bootstrap event listeners; used handle extra |
|||
* setup & teardown required after the underlying |
|||
* modal has performed certain actions |
|||
*/ |
|||
|
|||
dialog.on("hidden.bs.modal", function(e) { |
|||
// ensure we don't accidentally intercept hidden events triggered
|
|||
// by children of the current dialog. We shouldn't anymore now BS
|
|||
// namespaces its events; but still worth doing
|
|||
if (e.target === this) { |
|||
dialog.remove(); |
|||
} |
|||
}); |
|||
|
|||
/* |
|||
dialog.on("show.bs.modal", function() { |
|||
// sadly this doesn't work; show is called *just* before
|
|||
// the backdrop is added so we'd need a setTimeout hack or
|
|||
// otherwise... leaving in as would be nice
|
|||
if (options.backdrop) { |
|||
dialog.next(".modal-backdrop").addClass("bootbox-backdrop"); |
|||
} |
|||
}); |
|||
*/ |
|||
|
|||
dialog.on("shown.bs.modal", function() { |
|||
dialog.find(".btn-primary:first").focus(); |
|||
}); |
|||
|
|||
/** |
|||
* Bootbox event listeners; experimental and may not last |
|||
* just an attempt to decouple some behaviours from their |
|||
* respective triggers |
|||
*/ |
|||
|
|||
if (options.backdrop !== "static") { |
|||
// A boolean true/false according to the Bootstrap docs
|
|||
// should show a dialog the user can dismiss by clicking on
|
|||
// the background.
|
|||
// We always only ever pass static/false to the actual
|
|||
// $.modal function because with `true` we can't trap
|
|||
// this event (the .modal-backdrop swallows it)
|
|||
// However, we still want to sort of respect true
|
|||
// and invoke the escape mechanism instead
|
|||
dialog.on("click.dismiss.bs.modal", function(e) { |
|||
// @NOTE: the target varies in >= 3.3.x releases since the modal backdrop
|
|||
// moved *inside* the outer dialog rather than *alongside* it
|
|||
if (dialog.children(".modal-backdrop").length) { |
|||
e.currentTarget = dialog.children(".modal-backdrop").get(0); |
|||
} |
|||
|
|||
if (e.target !== e.currentTarget) { |
|||
return; |
|||
} |
|||
|
|||
dialog.trigger("escape.close.bb"); |
|||
}); |
|||
} |
|||
|
|||
dialog.on("escape.close.bb", function(e) { |
|||
if (callbacks.onEscape) { |
|||
processCallback(e, dialog, callbacks.onEscape); |
|||
} |
|||
}); |
|||
|
|||
/** |
|||
* Standard jQuery event listeners; used to handle user |
|||
* interaction with our dialog |
|||
*/ |
|||
|
|||
dialog.on("click", ".modal-footer button", function(e) { |
|||
var callbackKey = $(this).data("bb-handler"); |
|||
|
|||
processCallback(e, dialog, callbacks[callbackKey]); |
|||
}); |
|||
|
|||
dialog.on("click", ".bootbox-close-button", function(e) { |
|||
// onEscape might be falsy but that's fine; the fact is
|
|||
// if the user has managed to click the close button we
|
|||
// have to close the dialog, callback or not
|
|||
processCallback(e, dialog, callbacks.onEscape); |
|||
}); |
|||
|
|||
dialog.on("keyup", function(e) { |
|||
if (e.which === 27) { |
|||
dialog.trigger("escape.close.bb"); |
|||
} |
|||
}); |
|||
|
|||
// the remainder of this method simply deals with adding our
|
|||
// dialogent to the DOM, augmenting it with Bootstrap's modal
|
|||
// functionality and then giving the resulting object back
|
|||
// to our caller
|
|||
|
|||
$(options.container).append(dialog); |
|||
|
|||
dialog.modal({ |
|||
backdrop: options.backdrop ? "static": false, |
|||
keyboard: false, |
|||
show: false |
|||
}); |
|||
|
|||
if (options.show) { |
|||
dialog.modal("show"); |
|||
} |
|||
|
|||
// @TODO should we return the raw element here or should
|
|||
// we wrap it in an object on which we can expose some neater
|
|||
// methods, e.g. var d = bootbox.alert(); d.hide(); instead
|
|||
// of d.modal("hide");
|
|||
|
|||
/* |
|||
function BBDialog(elem) { |
|||
this.elem = elem; |
|||
} |
|||
|
|||
BBDialog.prototype = { |
|||
hide: function() { |
|||
return this.elem.modal("hide"); |
|||
}, |
|||
show: function() { |
|||
return this.elem.modal("show"); |
|||
} |
|||
}; |
|||
*/ |
|||
|
|||
return dialog; |
|||
|
|||
}; |
|||
|
|||
exports.setDefaults = function() { |
|||
var values = {}; |
|||
|
|||
if (arguments.length === 2) { |
|||
// allow passing of single key/value...
|
|||
values[arguments[0]] = arguments[1]; |
|||
} else { |
|||
// ... and as an object too
|
|||
values = arguments[0]; |
|||
} |
|||
|
|||
$.extend(defaults, values); |
|||
}; |
|||
|
|||
exports.hideAll = function() { |
|||
$(".bootbox").modal("hide"); |
|||
|
|||
return exports; |
|||
}; |
|||
|
|||
|
|||
/** |
|||
* standard locales. Please add more according to ISO 639-1 standard. Multiple language variants are |
|||
* unlikely to be required. If this gets too large it can be split out into separate JS files. |
|||
*/ |
|||
var locales = { |
|||
ar : { |
|||
OK : "موافق", |
|||
CANCEL : "الغاء", |
|||
CONFIRM : "تأكيد" |
|||
}, |
|||
bg_BG : { |
|||
OK : "Ок", |
|||
CANCEL : "Отказ", |
|||
CONFIRM : "Потвърждавам" |
|||
}, |
|||
br : { |
|||
OK : "OK", |
|||
CANCEL : "Cancelar", |
|||
CONFIRM : "Sim" |
|||
}, |
|||
cs : { |
|||
OK : "OK", |
|||
CANCEL : "Zrušit", |
|||
CONFIRM : "Potvrdit" |
|||
}, |
|||
da : { |
|||
OK : "OK", |
|||
CANCEL : "Annuller", |
|||
CONFIRM : "Accepter" |
|||
}, |
|||
de : { |
|||
OK : "OK", |
|||
CANCEL : "Abbrechen", |
|||
CONFIRM : "Akzeptieren" |
|||
}, |
|||
el : { |
|||
OK : "Εντάξει", |
|||
CANCEL : "Ακύρωση", |
|||
CONFIRM : "Επιβεβαίωση" |
|||
}, |
|||
en : { |
|||
OK : "OK", |
|||
CANCEL : "Cancel", |
|||
CONFIRM : "OK" |
|||
}, |
|||
es : { |
|||
OK : "OK", |
|||
CANCEL : "Cancelar", |
|||
CONFIRM : "Aceptar" |
|||
}, |
|||
et : { |
|||
OK : "OK", |
|||
CANCEL : "Katkesta", |
|||
CONFIRM : "OK" |
|||
}, |
|||
fa : { |
|||
OK : "قبول", |
|||
CANCEL : "لغو", |
|||
CONFIRM : "تایید" |
|||
}, |
|||
fi : { |
|||
OK : "OK", |
|||
CANCEL : "Peruuta", |
|||
CONFIRM : "OK" |
|||
}, |
|||
fr : { |
|||
OK : "OK", |
|||
CANCEL : "Annuler", |
|||
CONFIRM : "Confirmer" |
|||
}, |
|||
he : { |
|||
OK : "אישור", |
|||
CANCEL : "ביטול", |
|||
CONFIRM : "אישור" |
|||
}, |
|||
hu : { |
|||
OK : "OK", |
|||
CANCEL : "Mégsem", |
|||
CONFIRM : "Megerősít" |
|||
}, |
|||
hr : { |
|||
OK : "OK", |
|||
CANCEL : "Odustani", |
|||
CONFIRM : "Potvrdi" |
|||
}, |
|||
id : { |
|||
OK : "OK", |
|||
CANCEL : "Batal", |
|||
CONFIRM : "OK" |
|||
}, |
|||
it : { |
|||
OK : "OK", |
|||
CANCEL : "Annulla", |
|||
CONFIRM : "Conferma" |
|||
}, |
|||
ja : { |
|||
OK : "OK", |
|||
CANCEL : "キャンセル", |
|||
CONFIRM : "確認" |
|||
}, |
|||
lt : { |
|||
OK : "Gerai", |
|||
CANCEL : "Atšaukti", |
|||
CONFIRM : "Patvirtinti" |
|||
}, |
|||
lv : { |
|||
OK : "Labi", |
|||
CANCEL : "Atcelt", |
|||
CONFIRM : "Apstiprināt" |
|||
}, |
|||
nl : { |
|||
OK : "OK", |
|||
CANCEL : "Annuleren", |
|||
CONFIRM : "Accepteren" |
|||
}, |
|||
no : { |
|||
OK : "OK", |
|||
CANCEL : "Avbryt", |
|||
CONFIRM : "OK" |
|||
}, |
|||
pl : { |
|||
OK : "OK", |
|||
CANCEL : "Anuluj", |
|||
CONFIRM : "Potwierdź" |
|||
}, |
|||
pt : { |
|||
OK : "OK", |
|||
CANCEL : "Cancelar", |
|||
CONFIRM : "Confirmar" |
|||
}, |
|||
ru : { |
|||
OK : "OK", |
|||
CANCEL : "Отмена", |
|||
CONFIRM : "Применить" |
|||
}, |
|||
sq : { |
|||
OK : "OK", |
|||
CANCEL : "Anulo", |
|||
CONFIRM : "Prano" |
|||
}, |
|||
sv : { |
|||
OK : "OK", |
|||
CANCEL : "Avbryt", |
|||
CONFIRM : "OK" |
|||
}, |
|||
th : { |
|||
OK : "ตกลง", |
|||
CANCEL : "ยกเลิก", |
|||
CONFIRM : "ยืนยัน" |
|||
}, |
|||
tr : { |
|||
OK : "Tamam", |
|||
CANCEL : "İptal", |
|||
CONFIRM : "Onayla" |
|||
}, |
|||
zh_CN : { |
|||
OK : "OK", |
|||
CANCEL : "取消", |
|||
CONFIRM : "确认" |
|||
}, |
|||
zh_TW : { |
|||
OK : "OK", |
|||
CANCEL : "取消", |
|||
CONFIRM : "確認" |
|||
} |
|||
}; |
|||
|
|||
exports.addLocale = function(name, values) { |
|||
$.each(["OK", "CANCEL", "CONFIRM"], function(_, v) { |
|||
if (!values[v]) { |
|||
throw new Error("Please supply a translation for '" + v + "'"); |
|||
} |
|||
}); |
|||
|
|||
locales[name] = { |
|||
OK: values.OK, |
|||
CANCEL: values.CANCEL, |
|||
CONFIRM: values.CONFIRM |
|||
}; |
|||
|
|||
return exports; |
|||
}; |
|||
|
|||
exports.removeLocale = function(name) { |
|||
delete locales[name]; |
|||
|
|||
return exports; |
|||
}; |
|||
|
|||
exports.setLocale = function(name) { |
|||
return exports.setDefaults("locale", name); |
|||
}; |
|||
|
|||
exports.init = function(_$) { |
|||
return init(_$ || $); |
|||
}; |
|||
|
|||
return exports; |
|||
})); |
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@ |
|||
!function(a){a(["jquery"],function(a){return function(){function b(a,b,c){return o({type:u.error,iconClass:p().iconClasses.error,message:a,optionsOverride:c,title:b})}function c(b,c){return b||(b=p()),r=a("#"+b.containerId),r.length?r:(c&&(r=l(b)),r)}function d(a,b,c){return o({type:u.info,iconClass:p().iconClasses.info,message:a,optionsOverride:c,title:b})}function e(a){s=a}function f(a,b,c){return o({type:u.success,iconClass:p().iconClasses.success,message:a,optionsOverride:c,title:b})}function g(a,b,c){return o({type:u.warning,iconClass:p().iconClasses.warning,message:a,optionsOverride:c,title:b})}function h(a){var b=p();r||c(b),k(a,b)||j(b)}function i(b){var d=p();return r||c(d),b&&0===a(":focus",b).length?void q(b):void(r.children().length&&r.remove())}function j(b){for(var c=r.children(),d=c.length-1;d>=0;d--)k(a(c[d]),b)}function k(b,c){return b&&0===a(":focus",b).length?(b[c.hideMethod]({duration:c.hideDuration,easing:c.hideEasing,complete:function(){q(b)}}),!0):!1}function l(b){return r=a("<div/>").attr("id",b.containerId).addClass(b.positionClass).attr("aria-live","polite").attr("role","alert"),r.appendTo(a(b.target)),r}function m(){return{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",target:"body",closeHtml:"<button>×</button>",newestOnTop:!0}}function n(a){s&&s(a)}function o(b){function d(b){return!a(":focus",j).length||b?j[g.hideMethod]({duration:g.hideDuration,easing:g.hideEasing,complete:function(){q(j),g.onHidden&&"hidden"!==o.state&&g.onHidden(),o.state="hidden",o.endTime=new Date,n(o)}}):void 0}function e(){(g.timeOut>0||g.extendedTimeOut>0)&&(i=setTimeout(d,g.extendedTimeOut))}function f(){clearTimeout(i),j.stop(!0,!0)[g.showMethod]({duration:g.showDuration,easing:g.showEasing})}var g=p(),h=b.iconClass||g.iconClass;"undefined"!=typeof b.optionsOverride&&(g=a.extend(g,b.optionsOverride),h=b.optionsOverride.iconClass||h),t++,r=c(g,!0);var i=null,j=a("<div/>"),k=a("<div/>"),l=a("<div/>"),m=a(g.closeHtml),o={toastId:t,state:"visible",startTime:new Date,options:g,map:b};return b.iconClass&&j.addClass(g.toastClass).addClass(h),b.title&&(k.append(b.title).addClass(g.titleClass),j.append(k)),b.message&&(l.append(b.message).addClass(g.messageClass),j.append(l)),g.closeButton&&(m.addClass("toast-close-button").attr("role","button"),j.prepend(m)),j.hide(),g.newestOnTop?r.prepend(j):r.append(j),j[g.showMethod]({duration:g.showDuration,easing:g.showEasing,complete:g.onShown}),g.timeOut>0&&(i=setTimeout(d,g.timeOut)),j.hover(f,e),!g.onclick&&g.tapToDismiss&&j.click(d),g.closeButton&&m&&m.click(function(a){a.stopPropagation?a.stopPropagation():void 0!==a.cancelBubble&&a.cancelBubble!==!0&&(a.cancelBubble=!0),d(!0)}),g.onclick&&j.click(function(){g.onclick(),d()}),n(o),g.debug&&console&&console.log(o),j}function p(){return a.extend({},m(),v.options)}function q(a){r||(r=c()),a.is(":visible")||(a.remove(),a=null,0===r.children().length&&r.remove())}var r,s,t=0,u={error:"error",info:"info",success:"success",warning:"warning"},v={clear:h,remove:i,error:b,getContainer:c,info:d,options:{},subscribe:e,success:f,version:"2.0.3",warning:g};return v}()})}("function"==typeof define&&define.amd?define:function(a,b){"undefined"!=typeof module&&module.exports?module.exports=b(require("jquery")):window.toastr=b(window.jQuery)}); |
File diff suppressed because one or more lines are too long
@ -1,4 +0,0 @@ |
|||
/*! breakpoints.js - v0.4.2 - 2015-04-22 |
|||
* https://github.com/amazingSurge/breakpoints.js
|
|||
* Copyright (c) 2015 amazingSurge; Licensed GPL */ |
|||
!function(a,b,c){"use strict";function d(a,b){var c;for(var d in a)if(c=b(d,a[d]),c===!1)break}function e(a){return"function"==typeof a||!1}function f(a,b){for(var c in b)a[c]=b[c];return a}var g=b.Breakpoints=function(){g.define.apply(g,arguments)};g.defaults={xs:{min:0,max:767},sm:{min:768,max:991},md:{min:992,max:1199},lg:{min:1200,max:1/0}};var h=g.mediaBuilder={min:function(a,b){return"(min-width: "+a+b+")"},max:function(a,b){return"(max-width: "+a+b+")"},between:function(a,b,c){return"(min-width: "+a+c+") and (max-width: "+b+c+")"},get:function(a,b,c){return c||(c="px"),0===a?this.max(b,c):b===1/0?this.min(a,c):this.between(a,b,c)}},i=function(){var a=[];return{length:0,add:function(b,c,d){a.push({fn:b,data:c||{},one:d||0}),this.length++},remove:function(b){for(var c=0;c<a.length;c++)a[c].fn===b&&(a.splice(c,1),this.length--,c--)},empty:function(){a=[],this.length=0},call:function(c,d,f){d||(d=this.length-1);var g=a[d];e(f)?f.call(this,c,g,d):e(g.fn)&&g.fn.call(c||b,g.data),g.one&&(delete a[d],this.length--)},fire:function(b,c){for(var d in a)this.call(b,d,c)}}},j={current:null,callbacks:new i,trigger:function(a){var b=this.current;this.current=a,this.callbacks.fire(a,function(c,d){e(d.fn)&&d.fn.call({current:a,previous:b},d.data)})},one:function(a,b){return this.on(a,b,1)},on:function(a,b,d){return null==b&&e(a)&&(b=a,a=c),e(b)?void this.callbacks.add(b,a,d):this},off:function(a){null==a&&this.callbacks.empty()}},k=g.mediaQuery=function(a,b){this.name=a,this.media=b,this.initialize.apply(this)};k.prototype={constructor:k,initialize:function(){this.callbacks={enter:new i,leave:new i},this.mql=b.matchMedia&&b.matchMedia(this.media)||{matches:!1,media:this.media,addListener:function(){},removeListener:function(){}};var a=this;this.mqlListener=function(b){var c=b.matches&&"enter"||"leave";a.callbacks[c].fire(a)},this.mql.addListener(this.mqlListener)},on:function(a,b,d,f){var g;if("object"==typeof a){for(g in a)this.on(g,b,a[g],f);return this}return null==d&&e(b)&&(d=b,b=c),e(d)?(a in this.callbacks&&(this.callbacks[a].add(d,b,f),this.isMatched()&&"enter"===a&&this.callbacks[a].call(this)),this):this},one:function(a,b,c){return this.on(a,b,c,1)},off:function(a,b){var c;if("object"==typeof a){for(c in a)this.off(c,a[c]);return this}return null==a&&(this.callbacks.enter.empty(),this.callbacks.leave.empty()),a in this.callbacks&&(b?this.callbacks[a].remove(b):this.callbacks[a].empty()),this},isMatched:function(){return this.mql.matches},destory:function(){this.off()}};var l=function(a,b,c,d){this.name=a,this.min=b?b:0,this.max=c?c:1/0,this.media=h.get(this.min,this.max,d),this.initialize.apply(this);var e=this;this.changeListener=function(){e.isMatched()&&j.trigger(e)},this.isMatched()&&(j.current=this),this.mql.addListener(this.changeListener)};l.prototype=k.prototype,l.prototype.constructor=l,f(l.prototype,{destory:function(){this.off(),this.mql.removeListener(this.changeHander)}});var m=function(a){this.name=a,this.sizes=[];var b=this,c=[];d(a.split(" "),function(a,d){var e=g.get(d);e&&(b.sizes.push(e),c.push(e.media))}),this.media=c.join(","),this.initialize.apply(this)};m.prototype=k.prototype,m.prototype.constructor=m;var n={},o={};g=f(g,{defined:!1,define:function(a,b){this.defined&&this.destory(),a||(a=g.defaults),this.options=f(b||{},{unit:"px"});for(var c in a)this.set(c,a[c].min,a[c].max,this.options.unit);this.defined=!0},destory:function(){d(n,function(a,b){b.destory()}),n={},j.current=null},is:function(a){var b=this.get(a);return b?b.isMatched():null},all:function(){var a=[];return d(n,function(b){a.push(b)}),a},set:function(a,b,c,d){var e=this.get(a);return e&&e.destory(),n[a]=new l(a,b||null,c||null,d||null),n[a]},get:function(a){return n.hasOwnProperty(a)?n[a]:null},getUnion:function(a){return o.hasOwnProperty(a)?o[a]:(o[a]=new m(a),o[a])},getMin:function(a){var b=this.get(a);return b?b.min:null},getMax:function(a){var b=this.get(a);return b?b.max:null},current:function(){return j.current},getMedia:function(a){var b=this.get(a);return b?b.media:null},on:function(a,b,c,d,e){if("change"===a)return d=c,c=b,j.on(c,d,e);if(a.indexOf(" ")){var f=this.getUnion(a);f&&f.on(b,c,d,e)}else{var g=this.get(a);g&&g.on(b,c,d,e)}return this},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){if("change"===a)return j.off(b);if(a.indexOf(" ")){var d=this.getUnion(a);d&&d.off(b,c)}else{var e=this.get(a);e&&e.off(b,c)}return this}})}(document,window); |
File diff suppressed because one or more lines are too long
@ -1,8 +0,0 @@ |
|||
/*! |
|||
DataTables Bootstrap 3 integration |
|||
©2011-2014 SpryMedia Ltd - datatables.net/license |
|||
*/ |
|||
(function(l,q){var e=function(b,c){b.extend(!0,c.defaults,{dom:"<'row'<'col-sm-6'l><'col-sm-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-5'i><'col-sm-7'p>>",renderer:"bootstrap"});b.extend(c.ext.classes,{sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm"});c.ext.renderer.pageButton.bootstrap=function(g,e,r,s,i,m){var t=new c.Api(g),u=g.oClasses,j=g.oLanguage.oPaginate,d,f,n=0,p=function(c,e){var k,h,o,a,l=function(a){a.preventDefault(); |
|||
b(a.currentTarget).hasClass("disabled")||t.page(a.data.action).draw(!1)};k=0;for(h=e.length;k<h;k++)if(a=e[k],b.isArray(a))p(c,a);else{f=d="";switch(a){case "ellipsis":d="…";f="disabled";break;case "first":d=j.sFirst;f=a+(0<i?"":" disabled");break;case "previous":d=j.sPrevious;f=a+(0<i?"":" disabled");break;case "next":d=j.sNext;f=a+(i<m-1?"":" disabled");break;case "last":d=j.sLast;f=a+(i<m-1?"":" disabled");break;default:d=a+1,f=i===a?"active":""}d&&(o=b("<li>",{"class":u.sPageButton+" "+ |
|||
f,id:0===r&&"string"===typeof a?g.sTableId+"_"+a:null}).append(b("<a>",{href:"#","aria-controls":g.sTableId,"data-dt-idx":n,tabindex:g.iTabIndex}).html(d)).appendTo(c),g.oApi._fnBindAction(o,{action:a},l),n++)}},h;try{h=b(q.activeElement).data("dt-idx")}catch(l){}p(b(e).empty().html('<ul class="pagination"/>').children("ul"),s);h&&b(e).find("[data-dt-idx="+h+"]").focus()};c.TableTools&&(b.extend(!0,c.TableTools.classes,{container:"DTTT btn-group",buttons:{normal:"btn btn-default",disabled:"disabled"}, |
|||
collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:"disabled"}},print:{info:"DTTT_print_info"},select:{row:"active"}}),b.extend(!0,c.TableTools.DEFAULTS.oTags,{collection:{container:"ul",button:"li",liner:"a"}}))};"function"===typeof define&&define.amd?define(["jquery","datatables"],e):"object"===typeof exports?e(require("jquery"),require("datatables")):jQuery&&e(jQuery,jQuery.fn.dataTable)})(window,document); |
@ -1,650 +0,0 @@ |
|||
/*! FixedHeader 3.1.1 |
|||
* ©2009-2016 SpryMedia Ltd - datatables.net/license |
|||
*/ |
|||
|
|||
/** |
|||
* @summary FixedHeader |
|||
* @description Fix a table's header or footer, so it is always visible while |
|||
* scrolling |
|||
* @version 3.1.1 |
|||
* @file dataTables.fixedHeader.js |
|||
* @author SpryMedia Ltd (www.sprymedia.co.uk) |
|||
* @contact www.sprymedia.co.uk/contact |
|||
* @copyright Copyright 2009-2016 SpryMedia Ltd. |
|||
* |
|||
* This source file is free software, available under the following license: |
|||
* MIT license - http://datatables.net/license/mit
|
|||
* |
|||
* This source file is distributed in the hope that it will be useful, but |
|||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
|||
* or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details. |
|||
* |
|||
* For details please refer to: http://www.datatables.net
|
|||
*/ |
|||
|
|||
(function( factory ){ |
|||
if ( typeof define === 'function' && define.amd ) { |
|||
// AMD
|
|||
define( ['jquery', 'datatables.net'], function ( $ ) { |
|||
return factory( $, window, document ); |
|||
} ); |
|||
} |
|||
else if ( typeof exports === 'object' ) { |
|||
// CommonJS
|
|||
module.exports = function (root, $) { |
|||
if ( ! root ) { |
|||
root = window; |
|||
} |
|||
|
|||
if ( ! $ || ! $.fn.dataTable ) { |
|||
$ = require('datatables.net')(root, $).$; |
|||
} |
|||
|
|||
return factory( $, root, root.document ); |
|||
}; |
|||
} |
|||
else { |
|||
// Browser
|
|||
factory( jQuery, window, document ); |
|||
} |
|||
}(function( $, window, document, undefined ) { |
|||
'use strict'; |
|||
var DataTable = $.fn.dataTable; |
|||
|
|||
|
|||
var _instCounter = 0; |
|||
|
|||
var FixedHeader = function ( dt, config ) { |
|||
// Sanity check - you just know it will happen
|
|||
if ( ! (this instanceof FixedHeader) ) { |
|||
throw "FixedHeader must be initialised with the 'new' keyword."; |
|||
} |
|||
|
|||
// Allow a boolean true for defaults
|
|||
if ( config === true ) { |
|||
config = {}; |
|||
} |
|||
|
|||
dt = new DataTable.Api( dt ); |
|||
|
|||
this.c = $.extend( true, {}, FixedHeader.defaults, config ); |
|||
|
|||
this.s = { |
|||
dt: dt, |
|||
position: { |
|||
theadTop: 0, |
|||
tbodyTop: 0, |
|||
tfootTop: 0, |
|||
tfootBottom: 0, |
|||
width: 0, |
|||
left: 0, |
|||
tfootHeight: 0, |
|||
theadHeight: 0, |
|||
windowHeight: $(window).height(), |
|||
visible: true |
|||
}, |
|||
headerMode: null, |
|||
footerMode: null, |
|||
autoWidth: dt.settings()[0].oFeatures.bAutoWidth, |
|||
namespace: '.dtfc'+(_instCounter++), |
|||
scrollLeft: { |
|||
header: -1, |
|||
footer: -1 |
|||
}, |
|||
enable: true |
|||
}; |
|||
|
|||
this.dom = { |
|||
floatingHeader: null, |
|||
thead: $(dt.table().header()), |
|||
tbody: $(dt.table().body()), |
|||
tfoot: $(dt.table().footer()), |
|||
header: { |
|||
host: null, |
|||
floating: null, |
|||
placeholder: null |
|||
}, |
|||
footer: { |
|||
host: null, |
|||
floating: null, |
|||
placeholder: null |
|||
} |
|||
}; |
|||
|
|||
this.dom.header.host = this.dom.thead.parent(); |
|||
this.dom.footer.host = this.dom.tfoot.parent(); |
|||
|
|||
var dtSettings = dt.settings()[0]; |
|||
if ( dtSettings._fixedHeader ) { |
|||
throw "FixedHeader already initialised on table "+dtSettings.nTable.id; |
|||
} |
|||
|
|||
dtSettings._fixedHeader = this; |
|||
|
|||
this._constructor(); |
|||
}; |
|||
|
|||
|
|||
/* |
|||
* Variable: FixedHeader |
|||
* Purpose: Prototype for FixedHeader |
|||
* Scope: global |
|||
*/ |
|||
$.extend( FixedHeader.prototype, { |
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
|||
* API methods |
|||
*/ |
|||
|
|||
/** |
|||
* Enable / disable the fixed elements |
|||
* |
|||
* @param {boolean} enable `true` to enable, `false` to disable |
|||
*/ |
|||
enable: function ( enable ) |
|||
{ |
|||
this.s.enable = enable; |
|||
|
|||
if ( this.c.header ) { |
|||
this._modeChange( 'in-place', 'header', true ); |
|||
} |
|||
|
|||
if ( this.c.footer && this.dom.tfoot.length ) { |
|||
this._modeChange( 'in-place', 'footer', true ); |
|||
} |
|||
|
|||
this.update(); |
|||
}, |
|||
|
|||
/** |
|||
* Set header offset |
|||
* |
|||
* @param {int} new value for headerOffset |
|||
*/ |
|||
headerOffset: function ( offset ) |
|||
{ |
|||
if ( offset !== undefined ) { |
|||
this.c.headerOffset = offset; |
|||
this.update(); |
|||
} |
|||
|
|||
return this.c.headerOffset; |
|||
}, |
|||
|
|||
/** |
|||
* Set footer offset |
|||
* |
|||
* @param {int} new value for footerOffset |
|||
*/ |
|||
footerOffset: function ( offset ) |
|||
{ |
|||
if ( offset !== undefined ) { |
|||
this.c.footerOffset = offset; |
|||
this.update(); |
|||
} |
|||
|
|||
return this.c.footerOffset; |
|||
}, |
|||
|
|||
|
|||
/** |
|||
* Recalculate the position of the fixed elements and force them into place |
|||
*/ |
|||
update: function () |
|||
{ |
|||
this._positions(); |
|||
this._scroll( true ); |
|||
}, |
|||
|
|||
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
|||
* Constructor |
|||
*/ |
|||
|
|||
/** |
|||
* FixedHeader constructor - adding the required event listeners and |
|||
* simple initialisation |
|||
* |
|||
* @private |
|||
*/ |
|||
_constructor: function () |
|||
{ |
|||
var that = this; |
|||
var dt = this.s.dt; |
|||
|
|||
$(window) |
|||
.on( 'scroll'+this.s.namespace, function () { |
|||
that._scroll(); |
|||
} ) |
|||
.on( 'resize'+this.s.namespace, function () { |
|||
that.s.position.windowHeight = $(window).height(); |
|||
that.update(); |
|||
} ); |
|||
|
|||
dt.on( 'column-reorder.dt.dtfc column-visibility.dt.dtfc draw.dt.dtfc column-sizing.dt.dtfc', function () { |
|||
that.update(); |
|||
} ); |
|||
|
|||
dt.on( 'destroy.dtfc', function () { |
|||
dt.off( '.dtfc' ); |
|||
$(window).off( that.s.namespace ); |
|||
} ); |
|||
|
|||
this._positions(); |
|||
this._scroll(); |
|||
}, |
|||
|
|||
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
|||
* Private methods |
|||
*/ |
|||
|
|||
/** |
|||
* Clone a fixed item to act as a place holder for the original element |
|||
* which is moved into a clone of the table element, and moved around the |
|||
* document to give the fixed effect. |
|||
* |
|||
* @param {string} item 'header' or 'footer' |
|||
* @param {boolean} force Force the clone to happen, or allow automatic |
|||
* decision (reuse existing if available) |
|||
* @private |
|||
*/ |
|||
_clone: function ( item, force ) |
|||
{ |
|||
var dt = this.s.dt; |
|||
var itemDom = this.dom[ item ]; |
|||
var itemElement = item === 'header' ? |
|||
this.dom.thead : |
|||
this.dom.tfoot; |
|||
|
|||
if ( ! force && itemDom.floating ) { |
|||
// existing floating element - reuse it
|
|||
itemDom.floating.removeClass( 'fixedHeader-floating fixedHeader-locked' ); |
|||
} |
|||
else { |
|||
if ( itemDom.floating ) { |
|||
itemDom.placeholder.remove(); |
|||
this._unsize( item ); |
|||
itemDom.floating.children().detach(); |
|||
itemDom.floating.remove(); |
|||
} |
|||
|
|||
itemDom.floating = $( dt.table().node().cloneNode( false ) ) |
|||
.css( 'table-layout', 'fixed' ) |
|||
.removeAttr( 'id' ) |
|||
.append( itemElement ) |
|||
.appendTo( 'body' ); |
|||
|
|||
// Insert a fake thead/tfoot into the DataTable to stop it jumping around
|
|||
itemDom.placeholder = itemElement.clone( false ); |
|||
itemDom.host.prepend( itemDom.placeholder ); |
|||
|
|||
// Clone widths
|
|||
this._matchWidths( itemDom.placeholder, itemDom.floating ); |
|||
} |
|||
}, |
|||
|
|||
/** |
|||
* Copy widths from the cells in one element to another. This is required |
|||
* for the footer as the footer in the main table takes its sizes from the |
|||
* header columns. That isn't present in the footer so to have it still |
|||
* align correctly, the sizes need to be copied over. It is also required |
|||
* for the header when auto width is not enabled |
|||
* |
|||
* @param {jQuery} from Copy widths from |
|||
* @param {jQuery} to Copy widths to |
|||
* @private |
|||
*/ |
|||
_matchWidths: function ( from, to ) { |
|||
var get = function ( name ) { |
|||
return $(name, from) |
|||
.map( function () { |
|||
return $(this).width(); |
|||
} ).toArray(); |
|||
}; |
|||
|
|||
var set = function ( name, toWidths ) { |
|||
$(name, to).each( function ( i ) { |
|||
$(this).css( { |
|||
width: toWidths[i], |
|||
minWidth: toWidths[i] |
|||
} ); |
|||
} ); |
|||
}; |
|||
|
|||
var thWidths = get( 'th' ); |
|||
var tdWidths = get( 'td' ); |
|||
|
|||
set( 'th', thWidths ); |
|||
set( 'td', tdWidths ); |
|||
}, |
|||
|
|||
/** |
|||
* Remove assigned widths from the cells in an element. This is required |
|||
* when inserting the footer back into the main table so the size is defined |
|||
* by the header columns and also when auto width is disabled in the |
|||
* DataTable. |
|||
* |
|||
* @param {string} item The `header` or `footer` |
|||
* @private |
|||
*/ |
|||
_unsize: function ( item ) { |
|||
var el = this.dom[ item ].floating; |
|||
|
|||
if ( el && (item === 'footer' || (item === 'header' && ! this.s.autoWidth)) ) { |
|||
$('th, td', el).css( { |
|||
width: '', |
|||
minWidth: '' |
|||
} ); |
|||
} |
|||
else if ( el && item === 'header' ) { |
|||
$('th, td', el).css( 'min-width', '' ); |
|||
} |
|||
}, |
|||
|
|||
/** |
|||
* Reposition the floating elements to take account of horizontal page |
|||
* scroll |
|||
* |
|||
* @param {string} item The `header` or `footer` |
|||
* @param {int} scrollLeft Document scrollLeft |
|||
* @private |
|||
*/ |
|||
_horizontal: function ( item, scrollLeft ) |
|||
{ |
|||
var itemDom = this.dom[ item ]; |
|||
var position = this.s.position; |
|||
var lastScrollLeft = this.s.scrollLeft; |
|||
|
|||
if ( itemDom.floating && lastScrollLeft[ item ] !== scrollLeft ) { |
|||
itemDom.floating.css( 'left', position.left - scrollLeft ); |
|||
|
|||
lastScrollLeft[ item ] = scrollLeft; |
|||
} |
|||
}, |
|||
|
|||
/** |
|||
* Change from one display mode to another. Each fixed item can be in one |
|||
* of: |
|||
* |
|||
* * `in-place` - In the main DataTable |
|||
* * `in` - Floating over the DataTable |
|||
* * `below` - (Header only) Fixed to the bottom of the table body |
|||
* * `above` - (Footer only) Fixed to the top of the table body |
|||
* |
|||
* @param {string} mode Mode that the item should be shown in |
|||
* @param {string} item 'header' or 'footer' |
|||
* @param {boolean} forceChange Force a redraw of the mode, even if already |
|||
* in that mode. |
|||
* @private |
|||
*/ |
|||
_modeChange: function ( mode, item, forceChange ) |
|||
{ |
|||
var dt = this.s.dt; |
|||
var itemDom = this.dom[ item ]; |
|||
var position = this.s.position; |
|||
|
|||
if ( mode === 'in-place' ) { |
|||
// Insert the header back into the table's real header
|
|||
if ( itemDom.placeholder ) { |
|||
itemDom.placeholder.remove(); |
|||
itemDom.placeholder = null; |
|||
} |
|||
|
|||
this._unsize( item ); |
|||
|
|||
if ( item === 'header' ) { |
|||
itemDom.host.prepend( this.dom.thead ); |
|||
} |
|||
else { |
|||
itemDom.host.append( this.dom.tfoot ); |
|||
} |
|||
|
|||
if ( itemDom.floating ) { |
|||
itemDom.floating.remove(); |
|||
itemDom.floating = null; |
|||
} |
|||
} |
|||
else if ( mode === 'in' ) { |
|||
// Remove the header from the read header and insert into a fixed
|
|||
// positioned floating table clone
|
|||
this._clone( item, forceChange ); |
|||
|
|||
itemDom.floating |
|||
.addClass( 'fixedHeader-floating' ) |
|||
.css( item === 'header' ? 'top' : 'bottom', this.c[item+'Offset'] ) |
|||
.css( 'left', position.left+'px' ) |
|||
.css( 'width', position.width+'px' ); |
|||
|
|||
if ( item === 'footer' ) { |
|||
itemDom.floating.css( 'top', '' ); |
|||
} |
|||
} |
|||
else if ( mode === 'below' ) { // only used for the header
|
|||
// Fix the position of the floating header at base of the table body
|
|||
this._clone( item, forceChange ); |
|||
|
|||
itemDom.floating |
|||
.addClass( 'fixedHeader-locked' ) |
|||
.css( 'top', position.tfootTop - position.theadHeight ) |
|||
.css( 'left', position.left+'px' ) |
|||
.css( 'width', position.width+'px' ); |
|||
} |
|||
else if ( mode === 'above' ) { // only used for the footer
|
|||
// Fix the position of the floating footer at top of the table body
|
|||
this._clone( item, forceChange ); |
|||
|
|||
itemDom.floating |
|||
.addClass( 'fixedHeader-locked' ) |
|||
.css( 'top', position.tbodyTop ) |
|||
.css( 'left', position.left+'px' ) |
|||
.css( 'width', position.width+'px' ); |
|||
} |
|||
|
|||
this.s.scrollLeft.header = -1; |
|||
this.s.scrollLeft.footer = -1; |
|||
this.s[item+'Mode'] = mode; |
|||
}, |
|||
|
|||
/** |
|||
* Cache the positional information that is required for the mode |
|||
* calculations that FixedHeader performs. |
|||
* |
|||
* @private |
|||
*/ |
|||
_positions: function () |
|||
{ |
|||
var dt = this.s.dt; |
|||
var table = dt.table(); |
|||
var position = this.s.position; |
|||
var dom = this.dom; |
|||
var tableNode = $(table.node()); |
|||
|
|||
// Need to use the header and footer that are in the main table,
|
|||
// regardless of if they are clones, since they hold the positions we
|
|||
// want to measure from
|
|||
var thead = tableNode.children('thead'); |
|||
var tfoot = tableNode.children('tfoot'); |
|||
var tbody = dom.tbody; |
|||
|
|||
position.visible = tableNode.is(':visible'); |
|||
position.width = tableNode.outerWidth(); |
|||
position.left = tableNode.offset().left; |
|||
position.theadTop = thead.offset().top; |
|||
position.tbodyTop = tbody.offset().top; |
|||
position.theadHeight = position.tbodyTop - position.theadTop; |
|||
|
|||
if ( tfoot.length ) { |
|||
position.tfootTop = tfoot.offset().top; |
|||
position.tfootBottom = position.tfootTop + tfoot.outerHeight(); |
|||
position.tfootHeight = position.tfootBottom - position.tfootTop; |
|||
} |
|||
else { |
|||
position.tfootTop = position.tbodyTop + tbody.outerHeight(); |
|||
position.tfootBottom = position.tfootTop; |
|||
position.tfootHeight = position.tfootTop; |
|||
} |
|||
}, |
|||
|
|||
|
|||
/** |
|||
* Mode calculation - determine what mode the fixed items should be placed |
|||
* into. |
|||
* |
|||
* @param {boolean} forceChange Force a redraw of the mode, even if already |
|||
* in that mode. |
|||
* @private |
|||
*/ |
|||
_scroll: function ( forceChange ) |
|||
{ |
|||
var windowTop = $(document).scrollTop(); |
|||
var windowLeft = $(document).scrollLeft(); |
|||
var position = this.s.position; |
|||
var headerMode, footerMode; |
|||
|
|||
if ( ! this.s.enable ) { |
|||
return; |
|||
} |
|||
|
|||
if ( this.c.header ) { |
|||
if ( ! position.visible || windowTop <= position.theadTop - this.c.headerOffset ) { |
|||
headerMode = 'in-place'; |
|||
} |
|||
else if ( windowTop <= position.tfootTop - position.theadHeight - this.c.headerOffset ) { |
|||
headerMode = 'in'; |
|||
} |
|||
else { |
|||
headerMode = 'below'; |
|||
} |
|||
|
|||
if ( forceChange || headerMode !== this.s.headerMode ) { |
|||
this._modeChange( headerMode, 'header', forceChange ); |
|||
} |
|||
|
|||
this._horizontal( 'header', windowLeft ); |
|||
} |
|||
|
|||
if ( this.c.footer && this.dom.tfoot.length ) { |
|||
if ( ! position.visible || windowTop + position.windowHeight >= position.tfootBottom + this.c.footerOffset ) { |
|||
footerMode = 'in-place'; |
|||
} |
|||
else if ( position.windowHeight + windowTop > position.tbodyTop + position.tfootHeight + this.c.footerOffset ) { |
|||
footerMode = 'in'; |
|||
} |
|||
else { |
|||
footerMode = 'above'; |
|||
} |
|||
|
|||
if ( forceChange || footerMode !== this.s.footerMode ) { |
|||
this._modeChange( footerMode, 'footer', forceChange ); |
|||
} |
|||
|
|||
this._horizontal( 'footer', windowLeft ); |
|||
} |
|||
} |
|||
} ); |
|||
|
|||
|
|||
/** |
|||
* Version |
|||
* @type {String} |
|||
* @static |
|||
*/ |
|||
FixedHeader.version = "3.1.1"; |
|||
|
|||
/** |
|||
* Defaults |
|||
* @type {Object} |
|||
* @static |
|||
*/ |
|||
FixedHeader.defaults = { |
|||
header: true, |
|||
footer: false, |
|||
headerOffset: 0, |
|||
footerOffset: 0 |
|||
}; |
|||
|
|||
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
|||
* DataTables interfaces |
|||
*/ |
|||
|
|||
// Attach for constructor access
|
|||
$.fn.dataTable.FixedHeader = FixedHeader; |
|||
$.fn.DataTable.FixedHeader = FixedHeader; |
|||
|
|||
|
|||
// DataTables creation - check if the FixedHeader option has been defined on the
|
|||
// table and if so, initialise
|
|||
$(document).on( 'init.dt.dtfh', function (e, settings, json) { |
|||
if ( e.namespace !== 'dt' ) { |
|||
return; |
|||
} |
|||
|
|||
var init = settings.oInit.fixedHeader; |
|||
var defaults = DataTable.defaults.fixedHeader; |
|||
|
|||
if ( (init || defaults) && ! settings._fixedHeader ) { |
|||
var opts = $.extend( {}, defaults, init ); |
|||
|
|||
if ( init !== false ) { |
|||
new FixedHeader( settings, opts ); |
|||
} |
|||
} |
|||
} ); |
|||
|
|||
// DataTables API methods
|
|||
DataTable.Api.register( 'fixedHeader()', function () {} ); |
|||
|
|||
DataTable.Api.register( 'fixedHeader.adjust()', function () { |
|||
return this.iterator( 'table', function ( ctx ) { |
|||
var fh = ctx._fixedHeader; |
|||
|
|||
if ( fh ) { |
|||
fh.update(); |
|||
} |
|||
} ); |
|||
} ); |
|||
|
|||
DataTable.Api.register( 'fixedHeader.enable()', function ( flag ) { |
|||
return this.iterator( 'table', function ( ctx ) { |
|||
var fh = ctx._fixedHeader; |
|||
|
|||
if ( fh ) { |
|||
fh.enable( flag !== undefined ? flag : true ); |
|||
} |
|||
} ); |
|||
} ); |
|||
|
|||
DataTable.Api.register( 'fixedHeader.disable()', function ( ) { |
|||
return this.iterator( 'table', function ( ctx ) { |
|||
var fh = ctx._fixedHeader; |
|||
|
|||
if ( fh ) { |
|||
fh.enable( false ); |
|||
} |
|||
} ); |
|||
} ); |
|||
|
|||
$.each( ['header', 'footer'], function ( i, el ) { |
|||
DataTable.Api.register( 'fixedHeader.'+el+'Offset()', function ( offset ) { |
|||
var ctx = this.context; |
|||
|
|||
if ( offset === undefined ) { |
|||
return ctx.length && ctx[0]._fixedHeader ? |
|||
ctx[0]._fixedHeader[el +'Offset']() : |
|||
undefined; |
|||
} |
|||
|
|||
return this.iterator( 'table', function ( ctx ) { |
|||
var fh = ctx._fixedHeader; |
|||
|
|||
if ( fh ) { |
|||
fh[ el +'Offset' ]( offset ); |
|||
} |
|||
} ); |
|||
} ); |
|||
} ); |
|||
|
|||
|
|||
return FixedHeader; |
|||
})); |
File diff suppressed because it is too large
@ -1,78 +0,0 @@ |
|||
/*! Bootstrap integration for DataTables' Responsive |
|||
* ©2015 SpryMedia Ltd - datatables.net/license |
|||
*/ |
|||
|
|||
(function( factory ){ |
|||
if ( typeof define === 'function' && define.amd ) { |
|||
// AMD
|
|||
define( ['jquery', 'datatables.net-bs', 'datatables.net-responsive'], function ( $ ) { |
|||
return factory( $, window, document ); |
|||
} ); |
|||
} |
|||
else if ( typeof exports === 'object' ) { |
|||
// CommonJS
|
|||
module.exports = function (root, $) { |
|||
if ( ! root ) { |
|||
root = window; |
|||
} |
|||
|
|||
if ( ! $ || ! $.fn.dataTable ) { |
|||
$ = require('datatables.net-bs')(root, $).$; |
|||
} |
|||
|
|||
if ( ! $.fn.dataTable.Responsive ) { |
|||
require('datatables.net-responsive')(root, $); |
|||
} |
|||
|
|||
return factory( $, root, root.document ); |
|||
}; |
|||
} |
|||
else { |
|||
// Browser
|
|||
factory( jQuery, window, document ); |
|||
} |
|||
}(function( $, window, document, undefined ) { |
|||
'use strict'; |
|||
var DataTable = $.fn.dataTable; |
|||
|
|||
|
|||
var _display = DataTable.Responsive.display; |
|||
var _original = _display.modal; |
|||
|
|||
_display.modal = function ( options ) { |
|||
return function ( row, update, render ) { |
|||
if ( ! $.fn.modal ) { |
|||
_original( row, update, render ); |
|||
} |
|||
else { |
|||
if ( ! update ) { |
|||
var modal = $( |
|||
'<div class="modal fade" role="dialog">'+ |
|||
'<div class="modal-dialog" role="document">'+ |
|||
'<div class="modal-content">'+ |
|||
'<div class="modal-header">'+ |
|||
'<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>'+ |
|||
'</div>'+ |
|||
'<div class="modal-body"/>'+ |
|||
'</div>'+ |
|||
'</div>'+ |
|||
'</div>' |
|||
); |
|||
|
|||
if ( options && options.header ) { |
|||
modal.find('div.modal-header') |
|||
.append( '<h4 class="modal-title">'+options.header( row )+'</h4>' ); |
|||
} |
|||
|
|||
modal.find( 'div.modal-body' ).append( render() ); |
|||
modal |
|||
.appendTo( 'body' ) |
|||
.modal(); |
|||
} |
|||
} |
|||
}; |
|||
}; |
|||
|
|||
|
|||
return DataTable.Responsive; |
|||
})); |
File diff suppressed because it is too large
@ -1,166 +0,0 @@ |
|||
/*! |
|||
DataTables 1.10.12-dev |
|||
©2008-2015 SpryMedia Ltd - datatables.net/license |
|||
*/ |
|||
(function(h){"function"===typeof define&&define.amd?define(["jquery"],function(D){return h(D,window,document)}):"object"===typeof exports?module.exports=function(D,I){D||(D=window);I||(I="undefined"!==typeof window?require("jquery"):require("jquery")(D));return h(I,D,D.document)}:h(jQuery,window,document)})(function(h,D,I,k){function Y(a){var b,c,d={};h.each(a,function(e){if((b=e.match(/^([^A-Z]+?)([A-Z])/))&&-1!=="a aa ai ao as b fn i m o s ".indexOf(b[1]+" "))c=e.replace(b[0],b[2].toLowerCase()), |
|||
d[c]=e,"o"===b[1]&&Y(a[e])});a._hungarianMap=d}function K(a,b,c){a._hungarianMap||Y(a);var d;h.each(b,function(e){d=a._hungarianMap[e];if(d!==k&&(c||b[d]===k))"o"===d.charAt(0)?(b[d]||(b[d]={}),h.extend(!0,b[d],b[e]),K(a[d],b[d],c)):b[d]=b[e]})}function Fa(a){var b=m.defaults.oLanguage,c=a.sZeroRecords;!a.sEmptyTable&&(c&&"No data available in table"===b.sEmptyTable)&&E(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&(c&&"Loading..."===b.sLoadingRecords)&&E(a,a,"sZeroRecords","sLoadingRecords"); |
|||
a.sInfoThousands&&(a.sThousands=a.sInfoThousands);(a=a.sDecimal)&&db(a)}function eb(a){A(a,"ordering","bSort");A(a,"orderMulti","bSortMulti");A(a,"orderClasses","bSortClasses");A(a,"orderCellsTop","bSortCellsTop");A(a,"order","aaSorting");A(a,"orderFixed","aaSortingFixed");A(a,"paging","bPaginate");A(a,"pagingType","sPaginationType");A(a,"pageLength","iDisplayLength");A(a,"searching","bFilter");"boolean"===typeof a.sScrollX&&(a.sScrollX=a.sScrollX?"100%":"");"boolean"===typeof a.scrollX&&(a.scrollX= |
|||
a.scrollX?"100%":"");if(a=a.aoSearchCols)for(var b=0,c=a.length;b<c;b++)a[b]&&K(m.models.oSearch,a[b])}function fb(a){A(a,"orderable","bSortable");A(a,"orderData","aDataSort");A(a,"orderSequence","asSorting");A(a,"orderDataType","sortDataType");var b=a.aDataSort;b&&!h.isArray(b)&&(a.aDataSort=[b])}function gb(a){if(!m.__browser){var b={};m.__browser=b;var c=h("<div/>").css({position:"fixed",top:0,left:0,height:1,width:1,overflow:"hidden"}).append(h("<div/>").css({position:"absolute",top:1,left:1, |
|||
width:100,overflow:"scroll"}).append(h("<div/>").css({width:"100%",height:10}))).appendTo("body"),d=c.children(),e=d.children();b.barWidth=d[0].offsetWidth-d[0].clientWidth;b.bScrollOversize=100===e[0].offsetWidth&&100!==d[0].clientWidth;b.bScrollbarLeft=1!==Math.round(e.offset().left);b.bBounding=c[0].getBoundingClientRect().width?!0:!1;c.remove()}h.extend(a.oBrowser,m.__browser);a.oScroll.iBarWidth=m.__browser.barWidth}function hb(a,b,c,d,e,f){var g,j=!1;c!==k&&(g=c,j=!0);for(;d!==e;)a.hasOwnProperty(d)&& |
|||
(g=j?b(g,a[d],d,a):a[d],j=!0,d+=f);return g}function Ga(a,b){var c=m.defaults.column,d=a.aoColumns.length,c=h.extend({},m.models.oColumn,c,{nTh:b?b:I.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mData:c.mData?c.mData:d,idx:d});a.aoColumns.push(c);c=a.aoPreSearchCols;c[d]=h.extend({},m.models.oSearch,c[d]);ja(a,d,h(b).data())}function ja(a,b,c){var b=a.aoColumns[b],d=a.oClasses,e=h(b.nTh);if(!b.sWidthOrig){b.sWidthOrig=e.attr("width")||null;var f= |
|||
(e.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);f&&(b.sWidthOrig=f[1])}c!==k&&null!==c&&(fb(c),K(m.defaults.column,c),c.mDataProp!==k&&!c.mData&&(c.mData=c.mDataProp),c.sType&&(b._sManualType=c.sType),c.className&&!c.sClass&&(c.sClass=c.className),h.extend(b,c),E(b,c,"sWidth","sWidthOrig"),c.iDataSort!==k&&(b.aDataSort=[c.iDataSort]),E(b,c,"aDataSort"));var g=b.mData,j=Q(g),i=b.mRender?Q(b.mRender):null,c=function(a){return"string"===typeof a&&-1!==a.indexOf("@")};b._bAttrSrc=h.isPlainObject(g)&& |
|||
(c(g.sort)||c(g.type)||c(g.filter));b._setter=null;b.fnGetData=function(a,b,c){var d=j(a,b,k,c);return i&&b?i(d,b,a,c):d};b.fnSetData=function(a,b,c){return R(g)(a,b,c)};"number"!==typeof g&&(a._rowReadObject=!0);a.oFeatures.bSort||(b.bSortable=!1,e.addClass(d.sSortableNone));a=-1!==h.inArray("asc",b.asSorting);c=-1!==h.inArray("desc",b.asSorting);!b.bSortable||!a&&!c?(b.sSortingClass=d.sSortableNone,b.sSortingClassJUI=""):a&&!c?(b.sSortingClass=d.sSortableAsc,b.sSortingClassJUI=d.sSortJUIAscAllowed): |
|||
!a&&c?(b.sSortingClass=d.sSortableDesc,b.sSortingClassJUI=d.sSortJUIDescAllowed):(b.sSortingClass=d.sSortable,b.sSortingClassJUI=d.sSortJUI)}function U(a){if(!1!==a.oFeatures.bAutoWidth){var b=a.aoColumns;Ha(a);for(var c=0,d=b.length;c<d;c++)b[c].nTh.style.width=b[c].sWidth}b=a.oScroll;(""!==b.sY||""!==b.sX)&&ka(a);u(a,null,"column-sizing",[a])}function Z(a,b){var c=la(a,"bVisible");return"number"===typeof c[b]?c[b]:null}function $(a,b){var c=la(a,"bVisible"),c=h.inArray(b,c);return-1!==c?c:null} |
|||
function aa(a){var b=0;h.each(a.aoColumns,function(a,d){d.bVisible&&"none"!==h(d.nTh).css("display")&&b++});return b}function la(a,b){var c=[];h.map(a.aoColumns,function(a,e){a[b]&&c.push(e)});return c}function Ia(a){var b=a.aoColumns,c=a.aoData,d=m.ext.type.detect,e,f,g,j,i,h,l,q,t;e=0;for(f=b.length;e<f;e++)if(l=b[e],t=[],!l.sType&&l._sManualType)l.sType=l._sManualType;else if(!l.sType){g=0;for(j=d.length;g<j;g++){i=0;for(h=c.length;i<h;i++){t[i]===k&&(t[i]=B(a,i,e,"type"));q=d[g](t[i],a);if(!q&& |
|||
g!==d.length-1)break;if("html"===q)break}if(q){l.sType=q;break}}l.sType||(l.sType="string")}}function ib(a,b,c,d){var e,f,g,j,i,n,l=a.aoColumns;if(b)for(e=b.length-1;0<=e;e--){n=b[e];var q=n.targets!==k?n.targets:n.aTargets;h.isArray(q)||(q=[q]);f=0;for(g=q.length;f<g;f++)if("number"===typeof q[f]&&0<=q[f]){for(;l.length<=q[f];)Ga(a);d(q[f],n)}else if("number"===typeof q[f]&&0>q[f])d(l.length+q[f],n);else if("string"===typeof q[f]){j=0;for(i=l.length;j<i;j++)("_all"==q[f]||h(l[j].nTh).hasClass(q[f]))&& |
|||
d(j,n)}}if(c){e=0;for(a=c.length;e<a;e++)d(e,c[e])}}function N(a,b,c,d){var e=a.aoData.length,f=h.extend(!0,{},m.models.oRow,{src:c?"dom":"data",idx:e});f._aData=b;a.aoData.push(f);for(var g=a.aoColumns,j=0,i=g.length;j<i;j++)g[j].sType=null;a.aiDisplayMaster.push(e);b=a.rowIdFn(b);b!==k&&(a.aIds[b]=f);(c||!a.oFeatures.bDeferRender)&&Ja(a,e,c,d);return e}function ma(a,b){var c;b instanceof h||(b=h(b));return b.map(function(b,e){c=Ka(a,e);return N(a,c.data,e,c.cells)})}function B(a,b,c,d){var e=a.iDraw, |
|||
f=a.aoColumns[c],g=a.aoData[b]._aData,j=f.sDefaultContent,i=f.fnGetData(g,d,{settings:a,row:b,col:c});if(i===k)return a.iDrawError!=e&&null===j&&(L(a,0,"Requested unknown parameter "+("function"==typeof f.mData?"{function}":"'"+f.mData+"'")+" for row "+b+", column "+c,4),a.iDrawError=e),j;if((i===g||null===i)&&null!==j&&d!==k)i=j;else if("function"===typeof i)return i.call(g);return null===i&&"display"==d?"":i}function jb(a,b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,d,{settings:a,row:b,col:c})} |
|||
function La(a){return h.map(a.match(/(\\.|[^\.])+/g)||[""],function(a){return a.replace(/\\./g,".")})}function Q(a){if(h.isPlainObject(a)){var b={};h.each(a,function(a,c){c&&(b[a]=Q(c))});return function(a,c,f,g){var j=b[c]||b._;return j!==k?j(a,c,f,g):a}}if(null===a)return function(a){return a};if("function"===typeof a)return function(b,c,f,g){return a(b,c,f,g)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("[")||-1!==a.indexOf("("))){var c=function(a,b,f){var g,j;if(""!==f){j=La(f); |
|||
for(var i=0,n=j.length;i<n;i++){f=j[i].match(ba);g=j[i].match(V);if(f){j[i]=j[i].replace(ba,"");""!==j[i]&&(a=a[j[i]]);g=[];j.splice(0,i+1);j=j.join(".");if(h.isArray(a)){i=0;for(n=a.length;i<n;i++)g.push(c(a[i],b,j))}a=f[0].substring(1,f[0].length-1);a=""===a?g:g.join(a);break}else if(g){j[i]=j[i].replace(V,"");a=a[j[i]]();continue}if(null===a||a[j[i]]===k)return k;a=a[j[i]]}}return a};return function(b,e){return c(b,e,a)}}return function(b){return b[a]}}function R(a){if(h.isPlainObject(a))return R(a._); |
|||
if(null===a)return function(){};if("function"===typeof a)return function(b,d,e){a(b,"set",d,e)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("[")||-1!==a.indexOf("("))){var b=function(a,d,e){var e=La(e),f;f=e[e.length-1];for(var g,j,i=0,n=e.length-1;i<n;i++){g=e[i].match(ba);j=e[i].match(V);if(g){e[i]=e[i].replace(ba,"");a[e[i]]=[];f=e.slice();f.splice(0,i+1);g=f.join(".");if(h.isArray(d)){j=0;for(n=d.length;j<n;j++)f={},b(f,d[j],g),a[e[i]].push(f)}else a[e[i]]=d;return}j&&(e[i]=e[i].replace(V, |
|||
""),a=a[e[i]](d));if(null===a[e[i]]||a[e[i]]===k)a[e[i]]={};a=a[e[i]]}if(f.match(V))a[f.replace(V,"")](d);else a[f.replace(ba,"")]=d};return function(c,d){return b(c,d,a)}}return function(b,d){b[a]=d}}function Ma(a){return G(a.aoData,"_aData")}function na(a){a.aoData.length=0;a.aiDisplayMaster.length=0;a.aiDisplay.length=0;a.aIds={}}function oa(a,b,c){for(var d=-1,e=0,f=a.length;e<f;e++)a[e]==b?d=e:a[e]>b&&a[e]--; -1!=d&&c===k&&a.splice(d,1)}function ca(a,b,c,d){var e=a.aoData[b],f,g=function(c,d){for(;c.childNodes.length;)c.removeChild(c.firstChild); |
|||
c.innerHTML=B(a,b,d,"display")};if("dom"===c||(!c||"auto"===c)&&"dom"===e.src)e._aData=Ka(a,e,d,d===k?k:e._aData).data;else{var j=e.anCells;if(j)if(d!==k)g(j[d],d);else{c=0;for(f=j.length;c<f;c++)g(j[c],c)}}e._aSortData=null;e._aFilterData=null;g=a.aoColumns;if(d!==k)g[d].sType=null;else{c=0;for(f=g.length;c<f;c++)g[c].sType=null;Na(a,e)}}function Ka(a,b,c,d){var e=[],f=b.firstChild,g,j,i=0,n,l=a.aoColumns,q=a._rowReadObject,d=d!==k?d:q?{}:[],t=function(a,b){if("string"===typeof a){var c=a.indexOf("@"); |
|||
-1!==c&&(c=a.substring(c+1),R(a)(d,b.getAttribute(c)))}},S=function(a){if(c===k||c===i)j=l[i],n=h.trim(a.innerHTML),j&&j._bAttrSrc?(R(j.mData._)(d,n),t(j.mData.sort,a),t(j.mData.type,a),t(j.mData.filter,a)):q?(j._setter||(j._setter=R(j.mData)),j._setter(d,n)):d[i]=n;i++};if(f)for(;f;){g=f.nodeName.toUpperCase();if("TD"==g||"TH"==g)S(f),e.push(f);f=f.nextSibling}else{e=b.anCells;f=0;for(g=e.length;f<g;f++)S(e[f])}if(b=b.firstChild?b:b.nTr)(b=b.getAttribute("id"))&&R(a.rowId)(d,b);return{data:d,cells:e}} |
|||
function Ja(a,b,c,d){var e=a.aoData[b],f=e._aData,g=[],j,i,n,l,q;if(null===e.nTr){j=c||I.createElement("tr");e.nTr=j;e.anCells=g;j._DT_RowIndex=b;Na(a,e);l=0;for(q=a.aoColumns.length;l<q;l++){n=a.aoColumns[l];i=c?d[l]:I.createElement(n.sCellType);i._DT_CellIndex={row:b,column:l};g.push(i);if((!c||n.mRender||n.mData!==l)&&(!h.isPlainObject(n.mData)||n.mData._!==l+".display"))i.innerHTML=B(a,b,l,"display");n.sClass&&(i.className+=" "+n.sClass);n.bVisible&&!c?j.appendChild(i):!n.bVisible&&c&&i.parentNode.removeChild(i); |
|||
n.fnCreatedCell&&n.fnCreatedCell.call(a.oInstance,i,B(a,b,l),f,b,l)}u(a,"aoRowCreatedCallback",null,[j,f,b])}e.nTr.setAttribute("role","row")}function Na(a,b){var c=b.nTr,d=b._aData;if(c){var e=a.rowIdFn(d);e&&(c.id=e);d.DT_RowClass&&(e=d.DT_RowClass.split(" "),b.__rowc=b.__rowc?pa(b.__rowc.concat(e)):e,h(c).removeClass(b.__rowc.join(" ")).addClass(d.DT_RowClass));d.DT_RowAttr&&h(c).attr(d.DT_RowAttr);d.DT_RowData&&h(c).data(d.DT_RowData)}}function kb(a){var b,c,d,e,f,g=a.nTHead,j=a.nTFoot,i=0=== |
|||
h("th, td",g).length,n=a.oClasses,l=a.aoColumns;i&&(e=h("<tr/>").appendTo(g));b=0;for(c=l.length;b<c;b++)f=l[b],d=h(f.nTh).addClass(f.sClass),i&&d.appendTo(e),a.oFeatures.bSort&&(d.addClass(f.sSortingClass),!1!==f.bSortable&&(d.attr("tabindex",a.iTabIndex).attr("aria-controls",a.sTableId),Oa(a,f.nTh,b))),f.sTitle!=d[0].innerHTML&&d.html(f.sTitle),Pa(a,"header")(a,d,f,n);i&&da(a.aoHeader,g);h(g).find(">tr").attr("role","row");h(g).find(">tr>th, >tr>td").addClass(n.sHeaderTH);h(j).find(">tr>th, >tr>td").addClass(n.sFooterTH); |
|||
if(null!==j){a=a.aoFooter[0];b=0;for(c=a.length;b<c;b++)f=l[b],f.nTf=a[b].cell,f.sClass&&h(f.nTf).addClass(f.sClass)}}function ea(a,b,c){var d,e,f,g=[],j=[],i=a.aoColumns.length,n;if(b){c===k&&(c=!1);d=0;for(e=b.length;d<e;d++){g[d]=b[d].slice();g[d].nTr=b[d].nTr;for(f=i-1;0<=f;f--)!a.aoColumns[f].bVisible&&!c&&g[d].splice(f,1);j.push([])}d=0;for(e=g.length;d<e;d++){if(a=g[d].nTr)for(;f=a.firstChild;)a.removeChild(f);f=0;for(b=g[d].length;f<b;f++)if(n=i=1,j[d][f]===k){a.appendChild(g[d][f].cell); |
|||
for(j[d][f]=1;g[d+i]!==k&&g[d][f].cell==g[d+i][f].cell;)j[d+i][f]=1,i++;for(;g[d][f+n]!==k&&g[d][f].cell==g[d][f+n].cell;){for(c=0;c<i;c++)j[d+c][f+n]=1;n++}h(g[d][f].cell).attr("rowspan",i).attr("colspan",n)}}}}function O(a){var b=u(a,"aoPreDrawCallback","preDraw",[a]);if(-1!==h.inArray(!1,b))C(a,!1);else{var b=[],c=0,d=a.asStripeClasses,e=d.length,f=a.oLanguage,g=a.iInitDisplayStart,j="ssp"==y(a),i=a.aiDisplay;a.bDrawing=!0;g!==k&&-1!==g&&(a._iDisplayStart=j?g:g>=a.fnRecordsDisplay()?0:g,a.iInitDisplayStart= |
|||
-1);var g=a._iDisplayStart,n=a.fnDisplayEnd();if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++,C(a,!1);else if(j){if(!a.bDestroying&&!lb(a))return}else a.iDraw++;if(0!==i.length){f=j?a.aoData.length:n;for(j=j?0:g;j<f;j++){var l=i[j],q=a.aoData[l];null===q.nTr&&Ja(a,l);l=q.nTr;if(0!==e){var t=d[c%e];q._sRowStripe!=t&&(h(l).removeClass(q._sRowStripe).addClass(t),q._sRowStripe=t)}u(a,"aoRowCallback",null,[l,q._aData,c,j]);b.push(l);c++}}else c=f.sZeroRecords,1==a.iDraw&&"ajax"==y(a)?c=f.sLoadingRecords: |
|||
f.sEmptyTable&&0===a.fnRecordsTotal()&&(c=f.sEmptyTable),b[0]=h("<tr/>",{"class":e?d[0]:""}).append(h("<td />",{valign:"top",colSpan:aa(a),"class":a.oClasses.sRowEmpty}).html(c))[0];u(a,"aoHeaderCallback","header",[h(a.nTHead).children("tr")[0],Ma(a),g,n,i]);u(a,"aoFooterCallback","footer",[h(a.nTFoot).children("tr")[0],Ma(a),g,n,i]);d=h(a.nTBody);d.children().detach();d.append(h(b));u(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing=!1}}function T(a,b){var c=a.oFeatures,d=c.bFilter; |
|||
c.bSort&&mb(a);d?fa(a,a.oPreviousSearch):a.aiDisplay=a.aiDisplayMaster.slice();!0!==b&&(a._iDisplayStart=0);a._drawHold=b;O(a);a._drawHold=!1}function nb(a){var b=a.oClasses,c=h(a.nTable),c=h("<div/>").insertBefore(c),d=a.oFeatures,e=h("<div/>",{id:a.sTableId+"_wrapper","class":b.sWrapper+(a.nTFoot?"":" "+b.sNoFooter)});a.nHolding=c[0];a.nTableWrapper=e[0];a.nTableReinsertBefore=a.nTable.nextSibling;for(var f=a.sDom.split(""),g,j,i,n,l,q,t=0;t<f.length;t++){g=null;j=f[t];if("<"==j){i=h("<div/>")[0]; |
|||
n=f[t+1];if("'"==n||'"'==n){l="";for(q=2;f[t+q]!=n;)l+=f[t+q],q++;"H"==l?l=b.sJUIHeader:"F"==l&&(l=b.sJUIFooter);-1!=l.indexOf(".")?(n=l.split("."),i.id=n[0].substr(1,n[0].length-1),i.className=n[1]):"#"==l.charAt(0)?i.id=l.substr(1,l.length-1):i.className=l;t+=q}e.append(i);e=h(i)}else if(">"==j)e=e.parent();else if("l"==j&&d.bPaginate&&d.bLengthChange)g=ob(a);else if("f"==j&&d.bFilter)g=pb(a);else if("r"==j&&d.bProcessing)g=qb(a);else if("t"==j)g=rb(a);else if("i"==j&&d.bInfo)g=sb(a);else if("p"== |
|||
j&&d.bPaginate)g=tb(a);else if(0!==m.ext.feature.length){i=m.ext.feature;q=0;for(n=i.length;q<n;q++)if(j==i[q].cFeature){g=i[q].fnInit(a);break}}g&&(i=a.aanFeatures,i[j]||(i[j]=[]),i[j].push(g),e.append(g))}c.replaceWith(e);a.nHolding=null}function da(a,b){var c=h(b).children("tr"),d,e,f,g,j,i,n,l,q,t;a.splice(0,a.length);f=0;for(i=c.length;f<i;f++)a.push([]);f=0;for(i=c.length;f<i;f++){d=c[f];for(e=d.firstChild;e;){if("TD"==e.nodeName.toUpperCase()||"TH"==e.nodeName.toUpperCase()){l=1*e.getAttribute("colspan"); |
|||
q=1*e.getAttribute("rowspan");l=!l||0===l||1===l?1:l;q=!q||0===q||1===q?1:q;g=0;for(j=a[f];j[g];)g++;n=g;t=1===l?!0:!1;for(j=0;j<l;j++)for(g=0;g<q;g++)a[f+g][n+j]={cell:e,unique:t},a[f+g].nTr=d}e=e.nextSibling}}}function qa(a,b,c){var d=[];c||(c=a.aoHeader,b&&(c=[],da(c,b)));for(var b=0,e=c.length;b<e;b++)for(var f=0,g=c[b].length;f<g;f++)if(c[b][f].unique&&(!d[f]||!a.bSortCellsTop))d[f]=c[b][f].cell;return d}function ra(a,b,c){u(a,"aoServerParams","serverParams",[b]);if(b&&h.isArray(b)){var d={}, |
|||
e=/(.*?)\[\]$/;h.each(b,function(a,b){var c=b.name.match(e);c?(c=c[0],d[c]||(d[c]=[]),d[c].push(b.value)):d[b.name]=b.value});b=d}var f,g=a.ajax,j=a.oInstance,i=function(b){u(a,null,"xhr",[a,b,a.jqXHR]);c(b)};if(h.isPlainObject(g)&&g.data){f=g.data;var n=h.isFunction(f)?f(b,a):f,b=h.isFunction(f)&&n?n:h.extend(!0,b,n);delete g.data}n={data:b,success:function(b){var c=b.error||b.sError;c&&L(a,0,c);a.json=b;i(b)},dataType:"json",cache:!1,type:a.sServerMethod,error:function(b,c){var d=u(a,null,"xhr", |
|||
[a,null,a.jqXHR]);-1===h.inArray(!0,d)&&("parsererror"==c?L(a,0,"Invalid JSON response",1):4===b.readyState&&L(a,0,"Ajax error",7));C(a,!1)}};a.oAjaxData=b;u(a,null,"preXhr",[a,b]);a.fnServerData?a.fnServerData.call(j,a.sAjaxSource,h.map(b,function(a,b){return{name:b,value:a}}),i,a):a.sAjaxSource||"string"===typeof g?a.jqXHR=h.ajax(h.extend(n,{url:g||a.sAjaxSource})):h.isFunction(g)?a.jqXHR=g.call(j,b,i,a):(a.jqXHR=h.ajax(h.extend(n,g)),g.data=f)}function lb(a){return a.bAjaxDataGet?(a.iDraw++,C(a, |
|||
!0),ra(a,ub(a),function(b){vb(a,b)}),!1):!0}function ub(a){var b=a.aoColumns,c=b.length,d=a.oFeatures,e=a.oPreviousSearch,f=a.aoPreSearchCols,g,j=[],i,n,l,q=W(a);g=a._iDisplayStart;i=!1!==d.bPaginate?a._iDisplayLength:-1;var k=function(a,b){j.push({name:a,value:b})};k("sEcho",a.iDraw);k("iColumns",c);k("sColumns",G(b,"sName").join(","));k("iDisplayStart",g);k("iDisplayLength",i);var S={draw:a.iDraw,columns:[],order:[],start:g,length:i,search:{value:e.sSearch,regex:e.bRegex}};for(g=0;g<c;g++)n=b[g], |
|||
l=f[g],i="function"==typeof n.mData?"function":n.mData,S.columns.push({data:i,name:n.sName,searchable:n.bSearchable,orderable:n.bSortable,search:{value:l.sSearch,regex:l.bRegex}}),k("mDataProp_"+g,i),d.bFilter&&(k("sSearch_"+g,l.sSearch),k("bRegex_"+g,l.bRegex),k("bSearchable_"+g,n.bSearchable)),d.bSort&&k("bSortable_"+g,n.bSortable);d.bFilter&&(k("sSearch",e.sSearch),k("bRegex",e.bRegex));d.bSort&&(h.each(q,function(a,b){S.order.push({column:b.col,dir:b.dir});k("iSortCol_"+a,b.col);k("sSortDir_"+ |
|||
a,b.dir)}),k("iSortingCols",q.length));b=m.ext.legacy.ajax;return null===b?a.sAjaxSource?j:S:b?j:S}function vb(a,b){var c=sa(a,b),d=b.sEcho!==k?b.sEcho:b.draw,e=b.iTotalRecords!==k?b.iTotalRecords:b.recordsTotal,f=b.iTotalDisplayRecords!==k?b.iTotalDisplayRecords:b.recordsFiltered;if(d){if(1*d<a.iDraw)return;a.iDraw=1*d}na(a);a._iRecordsTotal=parseInt(e,10);a._iRecordsDisplay=parseInt(f,10);d=0;for(e=c.length;d<e;d++)N(a,c[d]);a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=!1;O(a);a._bInitComplete|| |
|||
ta(a,b);a.bAjaxDataGet=!0;C(a,!1)}function sa(a,b){var c=h.isPlainObject(a.ajax)&&a.ajax.dataSrc!==k?a.ajax.dataSrc:a.sAjaxDataProp;return"data"===c?b.aaData||b[c]:""!==c?Q(c)(b):b}function pb(a){var b=a.oClasses,c=a.sTableId,d=a.oLanguage,e=a.oPreviousSearch,f=a.aanFeatures,g='<input type="search" class="'+b.sFilterInput+'"/>',j=d.sSearch,j=j.match(/_INPUT_/)?j.replace("_INPUT_",g):j+g,b=h("<div/>",{id:!f.f?c+"_filter":null,"class":b.sFilter}).append(h("<label/>").append(j)),f=function(){var b=!this.value? |
|||
"":this.value;b!=e.sSearch&&(fa(a,{sSearch:b,bRegex:e.bRegex,bSmart:e.bSmart,bCaseInsensitive:e.bCaseInsensitive}),a._iDisplayStart=0,O(a))},g=null!==a.searchDelay?a.searchDelay:"ssp"===y(a)?400:0,i=h("input",b).val(e.sSearch).attr("placeholder",d.sSearchPlaceholder).bind("keyup.DT search.DT input.DT paste.DT cut.DT",g?ua(f,g):f).bind("keypress.DT",function(a){if(13==a.keyCode)return!1}).attr("aria-controls",c);h(a.nTable).on("search.dt.DT",function(b,c){if(a===c)try{i[0]!==I.activeElement&&i.val(e.sSearch)}catch(d){}}); |
|||
return b[0]}function fa(a,b,c){var d=a.oPreviousSearch,e=a.aoPreSearchCols,f=function(a){d.sSearch=a.sSearch;d.bRegex=a.bRegex;d.bSmart=a.bSmart;d.bCaseInsensitive=a.bCaseInsensitive};Ia(a);if("ssp"!=y(a)){wb(a,b.sSearch,c,b.bEscapeRegex!==k?!b.bEscapeRegex:b.bRegex,b.bSmart,b.bCaseInsensitive);f(b);for(b=0;b<e.length;b++)xb(a,e[b].sSearch,b,e[b].bEscapeRegex!==k?!e[b].bEscapeRegex:e[b].bRegex,e[b].bSmart,e[b].bCaseInsensitive);yb(a)}else f(b);a.bFiltered=!0;u(a,null,"search",[a])}function yb(a){for(var b= |
|||
m.ext.search,c=a.aiDisplay,d,e,f=0,g=b.length;f<g;f++){for(var j=[],i=0,n=c.length;i<n;i++)e=c[i],d=a.aoData[e],b[f](a,d._aFilterData,e,d._aData,i)&&j.push(e);c.length=0;h.merge(c,j)}}function xb(a,b,c,d,e,f){if(""!==b)for(var g=a.aiDisplay,d=Qa(b,d,e,f),e=g.length-1;0<=e;e--)b=a.aoData[g[e]]._aFilterData[c],d.test(b)||g.splice(e,1)}function wb(a,b,c,d,e,f){var d=Qa(b,d,e,f),e=a.oPreviousSearch.sSearch,f=a.aiDisplayMaster,g;0!==m.ext.search.length&&(c=!0);g=zb(a);if(0>=b.length)a.aiDisplay=f.slice(); |
|||
else{if(g||c||e.length>b.length||0!==b.indexOf(e)||a.bSorted)a.aiDisplay=f.slice();b=a.aiDisplay;for(c=b.length-1;0<=c;c--)d.test(a.aoData[b[c]]._sFilterRow)||b.splice(c,1)}}function Qa(a,b,c,d){a=b?a:va(a);c&&(a="^(?=.*?"+h.map(a.match(/"[^"]+"|[^ ]+/g)||[""],function(a){if('"'===a.charAt(0))var b=a.match(/^"(.*)"$/),a=b?b[1]:a;return a.replace('"',"")}).join(")(?=.*?")+").*$");return RegExp(a,d?"i":"")}function va(a){return a.replace(Zb,"\\$1")}function zb(a){var b=a.aoColumns,c,d,e,f,g,j,i,h,l= |
|||
m.ext.type.search;c=!1;d=0;for(f=a.aoData.length;d<f;d++)if(h=a.aoData[d],!h._aFilterData){j=[];e=0;for(g=b.length;e<g;e++)c=b[e],c.bSearchable?(i=B(a,d,e,"filter"),l[c.sType]&&(i=l[c.sType](i)),null===i&&(i=""),"string"!==typeof i&&i.toString&&(i=i.toString())):i="",i.indexOf&&-1!==i.indexOf("&")&&(wa.innerHTML=i,i=$b?wa.textContent:wa.innerText),i.replace&&(i=i.replace(/[\r\n]/g,"")),j.push(i);h._aFilterData=j;h._sFilterRow=j.join(" ");c=!0}return c}function Ab(a){return{search:a.sSearch,smart:a.bSmart, |
|||
regex:a.bRegex,caseInsensitive:a.bCaseInsensitive}}function Bb(a){return{sSearch:a.search,bSmart:a.smart,bRegex:a.regex,bCaseInsensitive:a.caseInsensitive}}function sb(a){var b=a.sTableId,c=a.aanFeatures.i,d=h("<div/>",{"class":a.oClasses.sInfo,id:!c?b+"_info":null});c||(a.aoDrawCallback.push({fn:Cb,sName:"information"}),d.attr("role","status").attr("aria-live","polite"),h(a.nTable).attr("aria-describedby",b+"_info"));return d[0]}function Cb(a){var b=a.aanFeatures.i;if(0!==b.length){var c=a.oLanguage, |
|||
d=a._iDisplayStart+1,e=a.fnDisplayEnd(),f=a.fnRecordsTotal(),g=a.fnRecordsDisplay(),j=g?c.sInfo:c.sInfoEmpty;g!==f&&(j+=" "+c.sInfoFiltered);j+=c.sInfoPostFix;j=Db(a,j);c=c.fnInfoCallback;null!==c&&(j=c.call(a.oInstance,a,d,e,f,g,j));h(b).html(j)}}function Db(a,b){var c=a.fnFormatNumber,d=a._iDisplayStart+1,e=a._iDisplayLength,f=a.fnRecordsDisplay(),g=-1===e;return b.replace(/_START_/g,c.call(a,d)).replace(/_END_/g,c.call(a,a.fnDisplayEnd())).replace(/_MAX_/g,c.call(a,a.fnRecordsTotal())).replace(/_TOTAL_/g, |
|||
c.call(a,f)).replace(/_PAGE_/g,c.call(a,g?1:Math.ceil(d/e))).replace(/_PAGES_/g,c.call(a,g?1:Math.ceil(f/e)))}function ga(a){var b,c,d=a.iInitDisplayStart,e=a.aoColumns,f;c=a.oFeatures;var g=a.bDeferLoading;if(a.bInitialised){nb(a);kb(a);ea(a,a.aoHeader);ea(a,a.aoFooter);C(a,!0);c.bAutoWidth&&Ha(a);b=0;for(c=e.length;b<c;b++)f=e[b],f.sWidth&&(f.nTh.style.width=x(f.sWidth));u(a,null,"preInit",[a]);T(a);e=y(a);if("ssp"!=e||g)"ajax"==e?ra(a,[],function(c){var f=sa(a,c);for(b=0;b<f.length;b++)N(a,f[b]); |
|||
a.iInitDisplayStart=d;T(a);C(a,!1);ta(a,c)},a):(C(a,!1),ta(a))}else setTimeout(function(){ga(a)},200)}function ta(a,b){a._bInitComplete=!0;(b||a.oInit.aaData)&&U(a);u(a,null,"plugin-init",[a,b]);u(a,"aoInitComplete","init",[a,b])}function Ra(a,b){var c=parseInt(b,10);a._iDisplayLength=c;Sa(a);u(a,null,"length",[a,c])}function ob(a){for(var b=a.oClasses,c=a.sTableId,d=a.aLengthMenu,e=h.isArray(d[0]),f=e?d[0]:d,d=e?d[1]:d,e=h("<select/>",{name:c+"_length","aria-controls":c,"class":b.sLengthSelect}), |
|||
g=0,j=f.length;g<j;g++)e[0][g]=new Option(d[g],f[g]);var i=h("<div><label/></div>").addClass(b.sLength);a.aanFeatures.l||(i[0].id=c+"_length");i.children().append(a.oLanguage.sLengthMenu.replace("_MENU_",e[0].outerHTML));h("select",i).val(a._iDisplayLength).bind("change.DT",function(){Ra(a,h(this).val());O(a)});h(a.nTable).bind("length.dt.DT",function(b,c,d){a===c&&h("select",i).val(d)});return i[0]}function tb(a){var b=a.sPaginationType,c=m.ext.pager[b],d="function"===typeof c,e=function(a){O(a)}, |
|||
b=h("<div/>").addClass(a.oClasses.sPaging+b)[0],f=a.aanFeatures;d||c.fnInit(a,b,e);f.p||(b.id=a.sTableId+"_paginate",a.aoDrawCallback.push({fn:function(a){if(d){var b=a._iDisplayStart,i=a._iDisplayLength,h=a.fnRecordsDisplay(),l=-1===i,b=l?0:Math.ceil(b/i),i=l?1:Math.ceil(h/i),h=c(b,i),k,l=0;for(k=f.p.length;l<k;l++)Pa(a,"pageButton")(a,f.p[l],l,h,b,i)}else c.fnUpdate(a,e)},sName:"pagination"}));return b}function Ta(a,b,c){var d=a._iDisplayStart,e=a._iDisplayLength,f=a.fnRecordsDisplay();0===f||-1=== |
|||
e?d=0:"number"===typeof b?(d=b*e,d>f&&(d=0)):"first"==b?d=0:"previous"==b?(d=0<=e?d-e:0,0>d&&(d=0)):"next"==b?d+e<f&&(d+=e):"last"==b?d=Math.floor((f-1)/e)*e:L(a,0,"Unknown paging action: "+b,5);b=a._iDisplayStart!==d;a._iDisplayStart=d;b&&(u(a,null,"page",[a]),c&&O(a));return b}function qb(a){return h("<div/>",{id:!a.aanFeatures.r?a.sTableId+"_processing":null,"class":a.oClasses.sProcessing}).html(a.oLanguage.sProcessing).insertBefore(a.nTable)[0]}function C(a,b){a.oFeatures.bProcessing&&h(a.aanFeatures.r).css("display", |
|||
b?"block":"none");u(a,null,"processing",[a,b])}function rb(a){var b=h(a.nTable);b.attr("role","grid");var c=a.oScroll;if(""===c.sX&&""===c.sY)return a.nTable;var d=c.sX,e=c.sY,f=a.oClasses,g=b.children("caption"),j=g.length?g[0]._captionSide:null,i=h(b[0].cloneNode(!1)),n=h(b[0].cloneNode(!1)),l=b.children("tfoot");l.length||(l=null);i=h("<div/>",{"class":f.sScrollWrapper}).append(h("<div/>",{"class":f.sScrollHead}).css({overflow:"hidden",position:"relative",border:0,width:d?!d?null:x(d):"100%"}).append(h("<div/>", |
|||
{"class":f.sScrollHeadInner}).css({"box-sizing":"content-box",width:c.sXInner||"100%"}).append(i.removeAttr("id").css("margin-left",0).append("top"===j?g:null).append(b.children("thead"))))).append(h("<div/>",{"class":f.sScrollBody}).css({position:"relative",overflow:"auto",width:!d?null:x(d)}).append(b));l&&i.append(h("<div/>",{"class":f.sScrollFoot}).css({overflow:"hidden",border:0,width:d?!d?null:x(d):"100%"}).append(h("<div/>",{"class":f.sScrollFootInner}).append(n.removeAttr("id").css("margin-left", |
|||
0).append("bottom"===j?g:null).append(b.children("tfoot")))));var b=i.children(),k=b[0],f=b[1],t=l?b[2]:null;if(d)h(f).on("scroll.DT",function(){var a=this.scrollLeft;k.scrollLeft=a;l&&(t.scrollLeft=a)});h(f).css(e&&c.bCollapse?"max-height":"height",e);a.nScrollHead=k;a.nScrollBody=f;a.nScrollFoot=t;a.aoDrawCallback.push({fn:ka,sName:"scrolling"});return i[0]}function ka(a){var b=a.oScroll,c=b.sX,d=b.sXInner,e=b.sY,b=b.iBarWidth,f=h(a.nScrollHead),g=f[0].style,j=f.children("div"),i=j[0].style,n=j.children("table"), |
|||
j=a.nScrollBody,l=h(j),q=j.style,t=h(a.nScrollFoot).children("div"),m=t.children("table"),o=h(a.nTHead),F=h(a.nTable),p=F[0],r=p.style,u=a.nTFoot?h(a.nTFoot):null,Eb=a.oBrowser,Ua=Eb.bScrollOversize,s=G(a.aoColumns,"nTh"),P,v,w,y,z=[],A=[],B=[],C=[],D,E=function(a){a=a.style;a.paddingTop="0";a.paddingBottom="0";a.borderTopWidth="0";a.borderBottomWidth="0";a.height=0};v=j.scrollHeight>j.clientHeight;if(a.scrollBarVis!==v&&a.scrollBarVis!==k)a.scrollBarVis=v,U(a);else{a.scrollBarVis=v;F.children("thead, tfoot").remove(); |
|||
u&&(w=u.clone().prependTo(F),P=u.find("tr"),w=w.find("tr"));y=o.clone().prependTo(F);o=o.find("tr");v=y.find("tr");y.find("th, td").removeAttr("tabindex");c||(q.width="100%",f[0].style.width="100%");h.each(qa(a,y),function(b,c){D=Z(a,b);c.style.width=a.aoColumns[D].sWidth});u&&J(function(a){a.style.width=""},w);f=F.outerWidth();if(""===c){r.width="100%";if(Ua&&(F.find("tbody").height()>j.offsetHeight||"scroll"==l.css("overflow-y")))r.width=x(F.outerWidth()-b);f=F.outerWidth()}else""!==d&&(r.width= |
|||
x(d),f=F.outerWidth());J(E,v);J(function(a){B.push(a.innerHTML);z.push(x(h(a).css("width")))},v);J(function(a,b){if(h.inArray(a,s)!==-1)a.style.width=z[b]},o);h(v).height(0);u&&(J(E,w),J(function(a){C.push(a.innerHTML);A.push(x(h(a).css("width")))},w),J(function(a,b){a.style.width=A[b]},P),h(w).height(0));J(function(a,b){a.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+B[b]+"</div>";a.style.width=z[b]},v);u&&J(function(a,b){a.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+ |
|||
C[b]+"</div>";a.style.width=A[b]},w);if(F.outerWidth()<f){P=j.scrollHeight>j.offsetHeight||"scroll"==l.css("overflow-y")?f+b:f;if(Ua&&(j.scrollHeight>j.offsetHeight||"scroll"==l.css("overflow-y")))r.width=x(P-b);(""===c||""!==d)&&L(a,1,"Possible column misalignment",6)}else P="100%";q.width=x(P);g.width=x(P);u&&(a.nScrollFoot.style.width=x(P));!e&&Ua&&(q.height=x(p.offsetHeight+b));c=F.outerWidth();n[0].style.width=x(c);i.width=x(c);d=F.height()>j.clientHeight||"scroll"==l.css("overflow-y");e="padding"+ |
|||
(Eb.bScrollbarLeft?"Left":"Right");i[e]=d?b+"px":"0px";u&&(m[0].style.width=x(c),t[0].style.width=x(c),t[0].style[e]=d?b+"px":"0px");F.children("colgroup").insertBefore(F.children("thead"));l.scroll();if((a.bSorted||a.bFiltered)&&!a._drawHold)j.scrollTop=0}}function J(a,b,c){for(var d=0,e=0,f=b.length,g,j;e<f;){g=b[e].firstChild;for(j=c?c[e].firstChild:null;g;)1===g.nodeType&&(c?a(g,j,d):a(g,d),d++),g=g.nextSibling,j=c?j.nextSibling:null;e++}}function Ha(a){var b=a.nTable,c=a.aoColumns,d=a.oScroll, |
|||
e=d.sY,f=d.sX,g=d.sXInner,j=c.length,i=la(a,"bVisible"),n=h("th",a.nTHead),l=b.getAttribute("width"),k=b.parentNode,t=!1,m,o,p=a.oBrowser,d=p.bScrollOversize;(m=b.style.width)&&-1!==m.indexOf("%")&&(l=m);for(m=0;m<i.length;m++)o=c[i[m]],null!==o.sWidth&&(o.sWidth=Fb(o.sWidthOrig,k),t=!0);if(d||!t&&!f&&!e&&j==aa(a)&&j==n.length)for(m=0;m<j;m++)i=Z(a,m),null!==i&&(c[i].sWidth=x(n.eq(m).width()));else{j=h(b).clone().css("visibility","hidden").removeAttr("id");j.find("tbody tr").remove();var r=h("<tr/>").appendTo(j.find("tbody")); |
|||
j.find("thead, tfoot").remove();j.append(h(a.nTHead).clone()).append(h(a.nTFoot).clone());j.find("tfoot th, tfoot td").css("width","");n=qa(a,j.find("thead")[0]);for(m=0;m<i.length;m++)o=c[i[m]],n[m].style.width=null!==o.sWidthOrig&&""!==o.sWidthOrig?x(o.sWidthOrig):"",o.sWidthOrig&&f&&h(n[m]).append(h("<div/>").css({width:o.sWidthOrig,margin:0,padding:0,border:0,height:1}));if(a.aoData.length)for(m=0;m<i.length;m++)t=i[m],o=c[t],h(Gb(a,t)).clone(!1).append(o.sContentPadding).appendTo(r);h("[name]", |
|||
j).removeAttr("name");o=h("<div/>").css(f||e?{position:"absolute",top:0,left:0,height:1,right:0,overflow:"hidden"}:{}).append(j).appendTo(k);f&&g?j.width(g):f?(j.css("width","auto"),j.removeAttr("width"),j.width()<k.clientWidth&&l&&j.width(k.clientWidth)):e?j.width(k.clientWidth):l&&j.width(l);for(m=e=0;m<i.length;m++)k=h(n[m]),g=k.outerWidth()-k.width(),k=p.bBounding?Math.ceil(n[m].getBoundingClientRect().width):k.outerWidth(),e+=k,c[i[m]].sWidth=x(k-g);b.style.width=x(e);o.remove()}l&&(b.style.width= |
|||
x(l));if((l||f)&&!a._reszEvt)b=function(){h(D).bind("resize.DT-"+a.sInstance,ua(function(){U(a)}))},d?setTimeout(b,1E3):b(),a._reszEvt=!0}function ua(a,b){var c=b!==k?b:200,d,e;return function(){var b=this,g=+new Date,j=arguments;d&&g<d+c?(clearTimeout(e),e=setTimeout(function(){d=k;a.apply(b,j)},c)):(d=g,a.apply(b,j))}}function Fb(a,b){if(!a)return 0;var c=h("<div/>").css("width",x(a)).appendTo(b||I.body),d=c[0].offsetWidth;c.remove();return d}function Gb(a,b){var c=Hb(a,b);if(0>c)return null;var d= |
|||
a.aoData[c];return!d.nTr?h("<td/>").html(B(a,c,b,"display"))[0]:d.anCells[b]}function Hb(a,b){for(var c,d=-1,e=-1,f=0,g=a.aoData.length;f<g;f++)c=B(a,f,b,"display")+"",c=c.replace(ac,""),c=c.replace(/ /g," "),c.length>d&&(d=c.length,e=f);return e}function x(a){return null===a?"0px":"number"==typeof a?0>a?"0px":a+"px":a.match(/\d$/)?a+"px":a}function W(a){var b,c,d=[],e=a.aoColumns,f,g,j,i;b=a.aaSortingFixed;c=h.isPlainObject(b);var n=[];f=function(a){a.length&&!h.isArray(a[0])?n.push(a):h.merge(n, |
|||
a)};h.isArray(b)&&f(b);c&&b.pre&&f(b.pre);f(a.aaSorting);c&&b.post&&f(b.post);for(a=0;a<n.length;a++){i=n[a][0];f=e[i].aDataSort;b=0;for(c=f.length;b<c;b++)g=f[b],j=e[g].sType||"string",n[a]._idx===k&&(n[a]._idx=h.inArray(n[a][1],e[g].asSorting)),d.push({src:i,col:g,dir:n[a][1],index:n[a]._idx,type:j,formatter:m.ext.type.order[j+"-pre"]})}return d}function mb(a){var b,c,d=[],e=m.ext.type.order,f=a.aoData,g=0,j,i=a.aiDisplayMaster,h;Ia(a);h=W(a);b=0;for(c=h.length;b<c;b++)j=h[b],j.formatter&&g++,Ib(a, |
|||
j.col);if("ssp"!=y(a)&&0!==h.length){b=0;for(c=i.length;b<c;b++)d[i[b]]=b;g===h.length?i.sort(function(a,b){var c,e,g,j,i=h.length,k=f[a]._aSortData,m=f[b]._aSortData;for(g=0;g<i;g++)if(j=h[g],c=k[j.col],e=m[j.col],c=c<e?-1:c>e?1:0,0!==c)return"asc"===j.dir?c:-c;c=d[a];e=d[b];return c<e?-1:c>e?1:0}):i.sort(function(a,b){var c,g,j,i,k=h.length,m=f[a]._aSortData,p=f[b]._aSortData;for(j=0;j<k;j++)if(i=h[j],c=m[i.col],g=p[i.col],i=e[i.type+"-"+i.dir]||e["string-"+i.dir],c=i(c,g),0!==c)return c;c=d[a]; |
|||
g=d[b];return c<g?-1:c>g?1:0})}a.bSorted=!0}function Jb(a){for(var b,c,d=a.aoColumns,e=W(a),a=a.oLanguage.oAria,f=0,g=d.length;f<g;f++){c=d[f];var j=c.asSorting;b=c.sTitle.replace(/<.*?>/g,"");var i=c.nTh;i.removeAttribute("aria-sort");c.bSortable&&(0<e.length&&e[0].col==f?(i.setAttribute("aria-sort","asc"==e[0].dir?"ascending":"descending"),c=j[e[0].index+1]||j[0]):c=j[0],b+="asc"===c?a.sSortAscending:a.sSortDescending);i.setAttribute("aria-label",b)}}function Va(a,b,c,d){var e=a.aaSorting,f=a.aoColumns[b].asSorting, |
|||
g=function(a,b){var c=a._idx;c===k&&(c=h.inArray(a[1],f));return c+1<f.length?c+1:b?null:0};"number"===typeof e[0]&&(e=a.aaSorting=[e]);c&&a.oFeatures.bSortMulti?(c=h.inArray(b,G(e,"0")),-1!==c?(b=g(e[c],!0),null===b&&1===e.length&&(b=0),null===b?e.splice(c,1):(e[c][1]=f[b],e[c]._idx=b)):(e.push([b,f[0],0]),e[e.length-1]._idx=0)):e.length&&e[0][0]==b?(b=g(e[0]),e.length=1,e[0][1]=f[b],e[0]._idx=b):(e.length=0,e.push([b,f[0]]),e[0]._idx=0);T(a);"function"==typeof d&&d(a)}function Oa(a,b,c,d){var e= |
|||
a.aoColumns[c];Wa(b,{},function(b){!1!==e.bSortable&&(a.oFeatures.bProcessing?(C(a,!0),setTimeout(function(){Va(a,c,b.shiftKey,d);"ssp"!==y(a)&&C(a,!1)},0)):Va(a,c,b.shiftKey,d))})}function xa(a){var b=a.aLastSort,c=a.oClasses.sSortColumn,d=W(a),e=a.oFeatures,f,g;if(e.bSort&&e.bSortClasses){e=0;for(f=b.length;e<f;e++)g=b[e].src,h(G(a.aoData,"anCells",g)).removeClass(c+(2>e?e+1:3));e=0;for(f=d.length;e<f;e++)g=d[e].src,h(G(a.aoData,"anCells",g)).addClass(c+(2>e?e+1:3))}a.aLastSort=d}function Ib(a, |
|||
b){var c=a.aoColumns[b],d=m.ext.order[c.sSortDataType],e;d&&(e=d.call(a.oInstance,a,b,$(a,b)));for(var f,g=m.ext.type.order[c.sType+"-pre"],j=0,i=a.aoData.length;j<i;j++)if(c=a.aoData[j],c._aSortData||(c._aSortData=[]),!c._aSortData[b]||d)f=d?e[j]:B(a,j,b,"sort"),c._aSortData[b]=g?g(f):f}function ya(a){if(a.oFeatures.bStateSave&&!a.bDestroying){var b={time:+new Date,start:a._iDisplayStart,length:a._iDisplayLength,order:h.extend(!0,[],a.aaSorting),search:Ab(a.oPreviousSearch),columns:h.map(a.aoColumns, |
|||
function(b,d){return{visible:b.bVisible,search:Ab(a.aoPreSearchCols[d])}})};u(a,"aoStateSaveParams","stateSaveParams",[a,b]);a.oSavedState=b;a.fnStateSaveCallback.call(a.oInstance,a,b)}}function Kb(a){var b,c,d=a.aoColumns;if(a.oFeatures.bStateSave){var e=a.fnStateLoadCallback.call(a.oInstance,a);if(e&&e.time&&(b=u(a,"aoStateLoadParams","stateLoadParams",[a,e]),-1===h.inArray(!1,b)&&(b=a.iStateDuration,!(0<b&&e.time<+new Date-1E3*b)&&d.length===e.columns.length))){a.oLoadedState=h.extend(!0,{},e); |
|||
e.start!==k&&(a._iDisplayStart=e.start,a.iInitDisplayStart=e.start);e.length!==k&&(a._iDisplayLength=e.length);e.order!==k&&(a.aaSorting=[],h.each(e.order,function(b,c){a.aaSorting.push(c[0]>=d.length?[0,c[1]]:c)}));e.search!==k&&h.extend(a.oPreviousSearch,Bb(e.search));b=0;for(c=e.columns.length;b<c;b++){var f=e.columns[b];f.visible!==k&&(d[b].bVisible=f.visible);f.search!==k&&h.extend(a.aoPreSearchCols[b],Bb(f.search))}u(a,"aoStateLoaded","stateLoaded",[a,e])}}}function za(a){var b=m.settings,a= |
|||
h.inArray(a,G(b,"nTable"));return-1!==a?b[a]:null}function L(a,b,c,d){c="DataTables warning: "+(a?"table id="+a.sTableId+" - ":"")+c;d&&(c+=". For more information about this error, please see http://datatables.net/tn/"+d);if(b)D.console&&console.log&&console.log(c);else if(b=m.ext,b=b.sErrMode||b.errMode,a&&u(a,null,"error",[a,d,c]),"alert"==b)alert(c);else{if("throw"==b)throw Error(c);"function"==typeof b&&b(a,d,c)}}function E(a,b,c,d){h.isArray(c)?h.each(c,function(c,d){h.isArray(d)?E(a,b,d[0], |
|||
d[1]):E(a,b,d)}):(d===k&&(d=c),b[c]!==k&&(a[d]=b[c]))}function Lb(a,b,c){var d,e;for(e in b)b.hasOwnProperty(e)&&(d=b[e],h.isPlainObject(d)?(h.isPlainObject(a[e])||(a[e]={}),h.extend(!0,a[e],d)):a[e]=c&&"data"!==e&&"aaData"!==e&&h.isArray(d)?d.slice():d);return a}function Wa(a,b,c){h(a).bind("click.DT",b,function(b){a.blur();c(b)}).bind("keypress.DT",b,function(a){13===a.which&&(a.preventDefault(),c(a))}).bind("selectstart.DT",function(){return!1})}function z(a,b,c,d){c&&a[b].push({fn:c,sName:d})} |
|||
function u(a,b,c,d){var e=[];b&&(e=h.map(a[b].slice().reverse(),function(b){return b.fn.apply(a.oInstance,d)}));null!==c&&(b=h.Event(c+".dt"),h(a.nTable).trigger(b,d),e.push(b.result));return e}function Sa(a){var b=a._iDisplayStart,c=a.fnDisplayEnd(),d=a._iDisplayLength;b>=c&&(b=c-d);b-=b%d;if(-1===d||0>b)b=0;a._iDisplayStart=b}function Pa(a,b){var c=a.renderer,d=m.ext.renderer[b];return h.isPlainObject(c)&&c[b]?d[c[b]]||d._:"string"===typeof c?d[c]||d._:d._}function y(a){return a.oFeatures.bServerSide? |
|||
"ssp":a.ajax||a.sAjaxSource?"ajax":"dom"}function Aa(a,b){var c=[],c=Mb.numbers_length,d=Math.floor(c/2);b<=c?c=X(0,b):a<=d?(c=X(0,c-2),c.push("ellipsis"),c.push(b-1)):(a>=b-1-d?c=X(b-(c-2),b):(c=X(a-d+2,a+d-1),c.push("ellipsis"),c.push(b-1)),c.splice(0,0,"ellipsis"),c.splice(0,0,0));c.DT_el="span";return c}function db(a){h.each({num:function(b){return Ba(b,a)},"num-fmt":function(b){return Ba(b,a,Xa)},"html-num":function(b){return Ba(b,a,Ca)},"html-num-fmt":function(b){return Ba(b,a,Ca,Xa)}},function(b, |
|||
c){v.type.order[b+a+"-pre"]=c;b.match(/^html\-/)&&(v.type.search[b+a]=v.type.search.html)})}function Nb(a){return function(){var b=[za(this[m.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return m.ext.internal[a].apply(this,b)}}var m,v,r,p,s,Ya={},Ob=/[\r\n]/g,Ca=/<.*?>/g,bc=/^[\w\+\-]/,cc=/[\w\+\-]$/,Zb=RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^|\\-)","g"),Xa=/[',$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfk]/gi,M=function(a){return!a||!0===a||"-"===a?!0:!1}, |
|||
Pb=function(a){var b=parseInt(a,10);return!isNaN(b)&&isFinite(a)?b:null},Qb=function(a,b){Ya[b]||(Ya[b]=RegExp(va(b),"g"));return"string"===typeof a&&"."!==b?a.replace(/\./g,"").replace(Ya[b],"."):a},Za=function(a,b,c){var d="string"===typeof a;if(M(a))return!0;b&&d&&(a=Qb(a,b));c&&d&&(a=a.replace(Xa,""));return!isNaN(parseFloat(a))&&isFinite(a)},Rb=function(a,b,c){return M(a)?!0:!(M(a)||"string"===typeof a)?null:Za(a.replace(Ca,""),b,c)?!0:null},G=function(a,b,c){var d=[],e=0,f=a.length;if(c!==k)for(;e< |
|||
f;e++)a[e]&&a[e][b]&&d.push(a[e][b][c]);else for(;e<f;e++)a[e]&&d.push(a[e][b]);return d},ha=function(a,b,c,d){var e=[],f=0,g=b.length;if(d!==k)for(;f<g;f++)a[b[f]][c]&&e.push(a[b[f]][c][d]);else for(;f<g;f++)e.push(a[b[f]][c]);return e},X=function(a,b){var c=[],d;b===k?(b=0,d=a):(d=b,b=a);for(var e=b;e<d;e++)c.push(e);return c},Sb=function(a){for(var b=[],c=0,d=a.length;c<d;c++)a[c]&&b.push(a[c]);return b},pa=function(a){var b=[],c,d,e=a.length,f,g=0;d=0;a:for(;d<e;d++){c=a[d];for(f=0;f<g;f++)if(b[f]=== |
|||
c)continue a;b.push(c);g++}return b},A=function(a,b,c){a[b]!==k&&(a[c]=a[b])},ba=/\[.*?\]$/,V=/\(\)$/,wa=h("<div>")[0],$b=wa.textContent!==k,ac=/<.*?>/g;m=function(a){this.$=function(a,b){return this.api(!0).$(a,b)};this._=function(a,b){return this.api(!0).rows(a,b).data()};this.api=function(a){return a?new r(za(this[v.iApiIndex])):new r(this)};this.fnAddData=function(a,b){var c=this.api(!0),d=h.isArray(a)&&(h.isArray(a[0])||h.isPlainObject(a[0]))?c.rows.add(a):c.row.add(a);(b===k||b)&&c.draw();return d.flatten().toArray()}; |
|||
this.fnAdjustColumnSizing=function(a){var b=this.api(!0).columns.adjust(),c=b.settings()[0],d=c.oScroll;a===k||a?b.draw(!1):(""!==d.sX||""!==d.sY)&&ka(c)};this.fnClearTable=function(a){var b=this.api(!0).clear();(a===k||a)&&b.draw()};this.fnClose=function(a){this.api(!0).row(a).child.hide()};this.fnDeleteRow=function(a,b,c){var d=this.api(!0),a=d.rows(a),e=a.settings()[0],h=e.aoData[a[0][0]];a.remove();b&&b.call(this,e,h);(c===k||c)&&d.draw();return h};this.fnDestroy=function(a){this.api(!0).destroy(a)}; |
|||
this.fnDraw=function(a){this.api(!0).draw(a)};this.fnFilter=function(a,b,c,d,e,h){e=this.api(!0);null===b||b===k?e.search(a,c,d,h):e.column(b).search(a,c,d,h);e.draw()};this.fnGetData=function(a,b){var c=this.api(!0);if(a!==k){var d=a.nodeName?a.nodeName.toLowerCase():"";return b!==k||"td"==d||"th"==d?c.cell(a,b).data():c.row(a).data()||null}return c.data().toArray()};this.fnGetNodes=function(a){var b=this.api(!0);return a!==k?b.row(a).node():b.rows().nodes().flatten().toArray()};this.fnGetPosition= |
|||
function(a){var b=this.api(!0),c=a.nodeName.toUpperCase();return"TR"==c?b.row(a).index():"TD"==c||"TH"==c?(a=b.cell(a).index(),[a.row,a.columnVisible,a.column]):null};this.fnIsOpen=function(a){return this.api(!0).row(a).child.isShown()};this.fnOpen=function(a,b,c){return this.api(!0).row(a).child(b,c).show().child()[0]};this.fnPageChange=function(a,b){var c=this.api(!0).page(a);(b===k||b)&&c.draw(!1)};this.fnSetColumnVis=function(a,b,c){a=this.api(!0).column(a).visible(b);(c===k||c)&&a.columns.adjust().draw()}; |
|||
this.fnSettings=function(){return za(this[v.iApiIndex])};this.fnSort=function(a){this.api(!0).order(a).draw()};this.fnSortListener=function(a,b,c){this.api(!0).order.listener(a,b,c)};this.fnUpdate=function(a,b,c,d,e){var h=this.api(!0);c===k||null===c?h.row(b).data(a):h.cell(b,c).data(a);(e===k||e)&&h.columns.adjust();(d===k||d)&&h.draw();return 0};this.fnVersionCheck=v.fnVersionCheck;var b=this,c=a===k,d=this.length;c&&(a={});this.oApi=this.internal=v.internal;for(var e in m.ext.internal)e&&(this[e]= |
|||
Nb(e));this.each(function(){var e={},e=1<d?Lb(e,a,!0):a,g=0,j,i=this.getAttribute("id"),n=!1,l=m.defaults,q=h(this);if("table"!=this.nodeName.toLowerCase())L(null,0,"Non-table node initialisation ("+this.nodeName+")",2);else{eb(l);fb(l.column);K(l,l,!0);K(l.column,l.column,!0);K(l,h.extend(e,q.data()));var t=m.settings,g=0;for(j=t.length;g<j;g++){var p=t[g];if(p.nTable==this||p.nTHead.parentNode==this||p.nTFoot&&p.nTFoot.parentNode==this){g=e.bRetrieve!==k?e.bRetrieve:l.bRetrieve;if(c||g)return p.oInstance; |
|||
if(e.bDestroy!==k?e.bDestroy:l.bDestroy){p.oInstance.fnDestroy();break}else{L(p,0,"Cannot reinitialise DataTable",3);return}}if(p.sTableId==this.id){t.splice(g,1);break}}if(null===i||""===i)this.id=i="DataTables_Table_"+m.ext._unique++;var o=h.extend(!0,{},m.models.oSettings,{sDestroyWidth:q[0].style.width,sInstance:i,sTableId:i});o.nTable=this;o.oApi=b.internal;o.oInit=e;t.push(o);o.oInstance=1===b.length?b:q.dataTable();eb(e);e.oLanguage&&Fa(e.oLanguage);e.aLengthMenu&&!e.iDisplayLength&&(e.iDisplayLength= |
|||
h.isArray(e.aLengthMenu[0])?e.aLengthMenu[0][0]:e.aLengthMenu[0]);e=Lb(h.extend(!0,{},l),e);E(o.oFeatures,e,"bPaginate bLengthChange bFilter bSort bSortMulti bInfo bProcessing bAutoWidth bSortClasses bServerSide bDeferRender".split(" "));E(o,e,["asStripeClasses","ajax","fnServerData","fnFormatNumber","sServerMethod","aaSorting","aaSortingFixed","aLengthMenu","sPaginationType","sAjaxSource","sAjaxDataProp","iStateDuration","sDom","bSortCellsTop","iTabIndex","fnStateLoadCallback","fnStateSaveCallback", |
|||
"renderer","searchDelay","rowId",["iCookieDuration","iStateDuration"],["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"],["bJQueryUI","bJUI"]]);E(o.oScroll,e,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]);E(o.oLanguage,e,"fnInfoCallback");z(o,"aoDrawCallback",e.fnDrawCallback,"user");z(o,"aoServerParams",e.fnServerParams,"user");z(o,"aoStateSaveParams",e.fnStateSaveParams,"user");z(o,"aoStateLoadParams", |
|||
e.fnStateLoadParams,"user");z(o,"aoStateLoaded",e.fnStateLoaded,"user");z(o,"aoRowCallback",e.fnRowCallback,"user");z(o,"aoRowCreatedCallback",e.fnCreatedRow,"user");z(o,"aoHeaderCallback",e.fnHeaderCallback,"user");z(o,"aoFooterCallback",e.fnFooterCallback,"user");z(o,"aoInitComplete",e.fnInitComplete,"user");z(o,"aoPreDrawCallback",e.fnPreDrawCallback,"user");o.rowIdFn=Q(e.rowId);gb(o);i=o.oClasses;e.bJQueryUI?(h.extend(i,m.ext.oJUIClasses,e.oClasses),e.sDom===l.sDom&&"lfrtip"===l.sDom&&(o.sDom= |
|||
'<"H"lfr>t<"F"ip>'),o.renderer)?h.isPlainObject(o.renderer)&&!o.renderer.header&&(o.renderer.header="jqueryui"):o.renderer="jqueryui":h.extend(i,m.ext.classes,e.oClasses);q.addClass(i.sTable);o.iInitDisplayStart===k&&(o.iInitDisplayStart=e.iDisplayStart,o._iDisplayStart=e.iDisplayStart);null!==e.iDeferLoading&&(o.bDeferLoading=!0,g=h.isArray(e.iDeferLoading),o._iRecordsDisplay=g?e.iDeferLoading[0]:e.iDeferLoading,o._iRecordsTotal=g?e.iDeferLoading[1]:e.iDeferLoading);var r=o.oLanguage;h.extend(!0, |
|||
r,e.oLanguage);""!==r.sUrl&&(h.ajax({dataType:"json",url:r.sUrl,success:function(a){Fa(a);K(l.oLanguage,a);h.extend(true,r,a);ga(o)},error:function(){ga(o)}}),n=!0);null===e.asStripeClasses&&(o.asStripeClasses=[i.sStripeOdd,i.sStripeEven]);var g=o.asStripeClasses,v=q.children("tbody").find("tr").eq(0);-1!==h.inArray(!0,h.map(g,function(a){return v.hasClass(a)}))&&(h("tbody tr",this).removeClass(g.join(" ")),o.asDestroyStripes=g.slice());t=[];g=this.getElementsByTagName("thead");0!==g.length&&(da(o.aoHeader, |
|||
g[0]),t=qa(o));if(null===e.aoColumns){p=[];g=0;for(j=t.length;g<j;g++)p.push(null)}else p=e.aoColumns;g=0;for(j=p.length;g<j;g++)Ga(o,t?t[g]:null);ib(o,e.aoColumnDefs,p,function(a,b){ja(o,a,b)});if(v.length){var s=function(a,b){return a.getAttribute("data-"+b)!==null?b:null};h(v[0]).children("th, td").each(function(a,b){var c=o.aoColumns[a];if(c.mData===a){var d=s(b,"sort")||s(b,"order"),e=s(b,"filter")||s(b,"search");if(d!==null||e!==null){c.mData={_:a+".display",sort:d!==null?a+".@data-"+d:k,type:d!== |
|||
null?a+".@data-"+d:k,filter:e!==null?a+".@data-"+e:k};ja(o,a)}}})}var w=o.oFeatures;e.bStateSave&&(w.bStateSave=!0,Kb(o,e),z(o,"aoDrawCallback",ya,"state_save"));if(e.aaSorting===k){t=o.aaSorting;g=0;for(j=t.length;g<j;g++)t[g][1]=o.aoColumns[g].asSorting[0]}xa(o);w.bSort&&z(o,"aoDrawCallback",function(){if(o.bSorted){var a=W(o),b={};h.each(a,function(a,c){b[c.src]=c.dir});u(o,null,"order",[o,a,b]);Jb(o)}});z(o,"aoDrawCallback",function(){(o.bSorted||y(o)==="ssp"||w.bDeferRender)&&xa(o)},"sc");g= |
|||
q.children("caption").each(function(){this._captionSide=q.css("caption-side")});j=q.children("thead");0===j.length&&(j=h("<thead/>").appendTo(this));o.nTHead=j[0];j=q.children("tbody");0===j.length&&(j=h("<tbody/>").appendTo(this));o.nTBody=j[0];j=q.children("tfoot");if(0===j.length&&0<g.length&&(""!==o.oScroll.sX||""!==o.oScroll.sY))j=h("<tfoot/>").appendTo(this);0===j.length||0===j.children().length?q.addClass(i.sNoFooter):0<j.length&&(o.nTFoot=j[0],da(o.aoFooter,o.nTFoot));if(e.aaData)for(g=0;g< |
|||
e.aaData.length;g++)N(o,e.aaData[g]);else(o.bDeferLoading||"dom"==y(o))&&ma(o,h(o.nTBody).children("tr"));o.aiDisplay=o.aiDisplayMaster.slice();o.bInitialised=!0;!1===n&&ga(o)}});b=null;return this};var Tb=[],w=Array.prototype,dc=function(a){var b,c,d=m.settings,e=h.map(d,function(a){return a.nTable});if(a){if(a.nTable&&a.oApi)return[a];if(a.nodeName&&"table"===a.nodeName.toLowerCase())return b=h.inArray(a,e),-1!==b?[d[b]]:null;if(a&&"function"===typeof a.settings)return a.settings().toArray();"string"=== |
|||
typeof a?c=h(a):a instanceof h&&(c=a)}else return[];if(c)return c.map(function(){b=h.inArray(this,e);return-1!==b?d[b]:null}).toArray()};r=function(a,b){if(!(this instanceof r))return new r(a,b);var c=[],d=function(a){(a=dc(a))&&(c=c.concat(a))};if(h.isArray(a))for(var e=0,f=a.length;e<f;e++)d(a[e]);else d(a);this.context=pa(c);b&&h.merge(this,b);this.selector={rows:null,cols:null,opts:null};r.extend(this,this,Tb)};m.Api=r;h.extend(r.prototype,{any:function(){return 0!==this.count()},concat:w.concat, |
|||
context:[],count:function(){return this.flatten().length},each:function(a){for(var b=0,c=this.length;b<c;b++)a.call(this,this[b],b,this);return this},eq:function(a){var b=this.context;return b.length>a?new r(b[a],this[a]):null},filter:function(a){var b=[];if(w.filter)b=w.filter.call(this,a,this);else for(var c=0,d=this.length;c<d;c++)a.call(this,this[c],c,this)&&b.push(this[c]);return new r(this.context,b)},flatten:function(){var a=[];return new r(this.context,a.concat.apply(a,this.toArray()))},join:w.join, |
|||
indexOf:w.indexOf||function(a,b){for(var c=b||0,d=this.length;c<d;c++)if(this[c]===a)return c;return-1},iterator:function(a,b,c,d){var e=[],f,g,h,i,n,l=this.context,m,t,p=this.selector;"string"===typeof a&&(d=c,c=b,b=a,a=!1);g=0;for(h=l.length;g<h;g++){var o=new r(l[g]);if("table"===b)f=c.call(o,l[g],g),f!==k&&e.push(f);else if("columns"===b||"rows"===b)f=c.call(o,l[g],this[g],g),f!==k&&e.push(f);else if("column"===b||"column-rows"===b||"row"===b||"cell"===b){t=this[g];"column-rows"===b&&(m=Da(l[g], |
|||
p.opts));i=0;for(n=t.length;i<n;i++)f=t[i],f="cell"===b?c.call(o,l[g],f.row,f.column,g,i):c.call(o,l[g],f,g,i,m),f!==k&&e.push(f)}}return e.length||d?(a=new r(l,a?e.concat.apply([],e):e),b=a.selector,b.rows=p.rows,b.cols=p.cols,b.opts=p.opts,a):this},lastIndexOf:w.lastIndexOf||function(a,b){return this.indexOf.apply(this.toArray.reverse(),arguments)},length:0,map:function(a){var b=[];if(w.map)b=w.map.call(this,a,this);else for(var c=0,d=this.length;c<d;c++)b.push(a.call(this,this[c],c));return new r(this.context, |
|||
b)},pluck:function(a){return this.map(function(b){return b[a]})},pop:w.pop,push:w.push,reduce:w.reduce||function(a,b){return hb(this,a,b,0,this.length,1)},reduceRight:w.reduceRight||function(a,b){return hb(this,a,b,this.length-1,-1,-1)},reverse:w.reverse,selector:null,shift:w.shift,sort:w.sort,splice:w.splice,toArray:function(){return w.slice.call(this)},to$:function(){return h(this)},toJQuery:function(){return h(this)},unique:function(){return new r(this.context,pa(this))},unshift:w.unshift});r.extend= |
|||
function(a,b,c){if(c.length&&b&&(b instanceof r||b.__dt_wrapper)){var d,e,f,g=function(a,b,c){return function(){var d=b.apply(a,arguments);r.extend(d,d,c.methodExt);return d}};d=0;for(e=c.length;d<e;d++)f=c[d],b[f.name]="function"===typeof f.val?g(a,f.val,f):h.isPlainObject(f.val)?{}:f.val,b[f.name].__dt_wrapper=!0,r.extend(a,b[f.name],f.propExt)}};r.register=p=function(a,b){if(h.isArray(a))for(var c=0,d=a.length;c<d;c++)r.register(a[c],b);else for(var e=a.split("."),f=Tb,g,j,c=0,d=e.length;c<d;c++){g= |
|||
(j=-1!==e[c].indexOf("()"))?e[c].replace("()",""):e[c];var i;a:{i=0;for(var n=f.length;i<n;i++)if(f[i].name===g){i=f[i];break a}i=null}i||(i={name:g,val:{},methodExt:[],propExt:[]},f.push(i));c===d-1?i.val=b:f=j?i.methodExt:i.propExt}};r.registerPlural=s=function(a,b,c){r.register(a,c);r.register(b,function(){var a=c.apply(this,arguments);return a===this?this:a instanceof r?a.length?h.isArray(a[0])?new r(a.context,a[0]):a[0]:k:a})};p("tables()",function(a){var b;if(a){b=r;var c=this.context;if("number"=== |
|||
typeof a)a=[c[a]];else var d=h.map(c,function(a){return a.nTable}),a=h(d).filter(a).map(function(){var a=h.inArray(this,d);return c[a]}).toArray();b=new b(a)}else b=this;return b});p("table()",function(a){var a=this.tables(a),b=a.context;return b.length?new r(b[0]):a});s("tables().nodes()","table().node()",function(){return this.iterator("table",function(a){return a.nTable},1)});s("tables().body()","table().body()",function(){return this.iterator("table",function(a){return a.nTBody},1)});s("tables().header()", |
|||
"table().header()",function(){return this.iterator("table",function(a){return a.nTHead},1)});s("tables().footer()","table().footer()",function(){return this.iterator("table",function(a){return a.nTFoot},1)});s("tables().containers()","table().container()",function(){return this.iterator("table",function(a){return a.nTableWrapper},1)});p("draw()",function(a){return this.iterator("table",function(b){"page"===a?O(b):("string"===typeof a&&(a="full-hold"===a?!1:!0),T(b,!1===a))})});p("page()",function(a){return a=== |
|||
k?this.page.info().page:this.iterator("table",function(b){Ta(b,a)})});p("page.info()",function(){if(0===this.context.length)return k;var a=this.context[0],b=a._iDisplayStart,c=a.oFeatures.bPaginate?a._iDisplayLength:-1,d=a.fnRecordsDisplay(),e=-1===c;return{page:e?0:Math.floor(b/c),pages:e?1:Math.ceil(d/c),start:b,end:a.fnDisplayEnd(),length:c,recordsTotal:a.fnRecordsTotal(),recordsDisplay:d,serverSide:"ssp"===y(a)}});p("page.len()",function(a){return a===k?0!==this.context.length?this.context[0]._iDisplayLength: |
|||
k:this.iterator("table",function(b){Ra(b,a)})});var Ub=function(a,b,c){if(c){var d=new r(a);d.one("draw",function(){c(d.ajax.json())})}if("ssp"==y(a))T(a,b);else{C(a,!0);var e=a.jqXHR;e&&4!==e.readyState&&e.abort();ra(a,[],function(c){na(a);for(var c=sa(a,c),d=0,e=c.length;d<e;d++)N(a,c[d]);T(a,b);C(a,!1)})}};p("ajax.json()",function(){var a=this.context;if(0<a.length)return a[0].json});p("ajax.params()",function(){var a=this.context;if(0<a.length)return a[0].oAjaxData});p("ajax.reload()",function(a, |
|||
b){return this.iterator("table",function(c){Ub(c,!1===b,a)})});p("ajax.url()",function(a){var b=this.context;if(a===k){if(0===b.length)return k;b=b[0];return b.ajax?h.isPlainObject(b.ajax)?b.ajax.url:b.ajax:b.sAjaxSource}return this.iterator("table",function(b){h.isPlainObject(b.ajax)?b.ajax.url=a:b.ajax=a})});p("ajax.url().load()",function(a,b){return this.iterator("table",function(c){Ub(c,!1===b,a)})});var $a=function(a,b,c,d,e){var f=[],g,j,i,n,l,m;i=typeof b;if(!b||"string"===i||"function"=== |
|||
i||b.length===k)b=[b];i=0;for(n=b.length;i<n;i++){j=b[i]&&b[i].split?b[i].split(","):[b[i]];l=0;for(m=j.length;l<m;l++)(g=c("string"===typeof j[l]?h.trim(j[l]):j[l]))&&g.length&&(f=f.concat(g))}a=v.selector[a];if(a.length){i=0;for(n=a.length;i<n;i++)f=a[i](d,e,f)}return pa(f)},ab=function(a){a||(a={});a.filter&&a.search===k&&(a.search=a.filter);return h.extend({search:"none",order:"current",page:"all"},a)},bb=function(a){for(var b=0,c=a.length;b<c;b++)if(0<a[b].length)return a[0]=a[b],a[0].length= |
|||
1,a.length=1,a.context=[a.context[b]],a;a.length=0;return a},Da=function(a,b){var c,d,e,f=[],g=a.aiDisplay;c=a.aiDisplayMaster;var j=b.search;d=b.order;e=b.page;if("ssp"==y(a))return"removed"===j?[]:X(0,c.length);if("current"==e){c=a._iDisplayStart;for(d=a.fnDisplayEnd();c<d;c++)f.push(g[c])}else if("current"==d||"applied"==d)f="none"==j?c.slice():"applied"==j?g.slice():h.map(c,function(a){return-1===h.inArray(a,g)?a:null});else if("index"==d||"original"==d){c=0;for(d=a.aoData.length;c<d;c++)"none"== |
|||
j?f.push(c):(e=h.inArray(c,g),(-1===e&&"removed"==j||0<=e&&"applied"==j)&&f.push(c))}return f};p("rows()",function(a,b){a===k?a="":h.isPlainObject(a)&&(b=a,a="");var b=ab(b),c=this.iterator("table",function(c){var e=b;return $a("row",a,function(a){var b=Pb(a);if(b!==null&&!e)return[b];var j=Da(c,e);if(b!==null&&h.inArray(b,j)!==-1)return[b];if(!a)return j;if(typeof a==="function")return h.map(j,function(b){var e=c.aoData[b];return a(b,e._aData,e.nTr)?b:null});b=Sb(ha(c.aoData,j,"nTr"));if(a.nodeName){if(a._DT_RowIndex!== |
|||
k)return[a._DT_RowIndex];if(a._DT_CellIndex)return[a._DT_CellIndex.row];b=h(a).closest("*[data-dt-row]");return b.length?[b.data("dt-row")]:[]}if(typeof a==="string"&&a.charAt(0)==="#"){j=c.aIds[a.replace(/^#/,"")];if(j!==k)return[j.idx]}return h(b).filter(a).map(function(){return this._DT_RowIndex}).toArray()},c,e)},1);c.selector.rows=a;c.selector.opts=b;return c});p("rows().nodes()",function(){return this.iterator("row",function(a,b){return a.aoData[b].nTr||k},1)});p("rows().data()",function(){return this.iterator(!0, |
|||
"rows",function(a,b){return ha(a.aoData,b,"_aData")},1)});s("rows().cache()","row().cache()",function(a){return this.iterator("row",function(b,c){var d=b.aoData[c];return"search"===a?d._aFilterData:d._aSortData},1)});s("rows().invalidate()","row().invalidate()",function(a){return this.iterator("row",function(b,c){ca(b,c,a)})});s("rows().indexes()","row().index()",function(){return this.iterator("row",function(a,b){return b},1)});s("rows().ids()","row().id()",function(a){for(var b=[],c=this.context, |
|||
d=0,e=c.length;d<e;d++)for(var f=0,g=this[d].length;f<g;f++){var h=c[d].rowIdFn(c[d].aoData[this[d][f]]._aData);b.push((!0===a?"#":"")+h)}return new r(c,b)});s("rows().remove()","row().remove()",function(){var a=this;this.iterator("row",function(b,c,d){var e=b.aoData,f=e[c],g,h,i,n,l;e.splice(c,1);g=0;for(h=e.length;g<h;g++)if(i=e[g],l=i.anCells,null!==i.nTr&&(i.nTr._DT_RowIndex=g),null!==l){i=0;for(n=l.length;i<n;i++)l[i]._DT_CellIndex.row=g}oa(b.aiDisplayMaster,c);oa(b.aiDisplay,c);oa(a[d],c,!1); |
|||
Sa(b);c=b.rowIdFn(f._aData);c!==k&&delete b.aIds[c]});this.iterator("table",function(a){for(var c=0,d=a.aoData.length;c<d;c++)a.aoData[c].idx=c});return this});p("rows.add()",function(a){var b=this.iterator("table",function(b){var c,f,g,h=[];f=0;for(g=a.length;f<g;f++)c=a[f],c.nodeName&&"TR"===c.nodeName.toUpperCase()?h.push(ma(b,c)[0]):h.push(N(b,c));return h},1),c=this.rows(-1);c.pop();h.merge(c,b);return c});p("row()",function(a,b){return bb(this.rows(a,b))});p("row().data()",function(a){var b= |
|||
this.context;if(a===k)return b.length&&this.length?b[0].aoData[this[0]]._aData:k;b[0].aoData[this[0]]._aData=a;ca(b[0],this[0],"data");return this});p("row().node()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]].nTr||null:null});p("row.add()",function(a){a instanceof h&&a.length&&(a=a[0]);var b=this.iterator("table",function(b){return a.nodeName&&"TR"===a.nodeName.toUpperCase()?ma(b,a)[0]:N(b,a)});return this.row(b[0])});var cb=function(a,b){var c=a.context;if(c.length&& |
|||
(c=c[0].aoData[b!==k?b:a[0]])&&c._details)c._details.remove(),c._detailsShow=k,c._details=k},Vb=function(a,b){var c=a.context;if(c.length&&a.length){var d=c[0].aoData[a[0]];if(d._details){(d._detailsShow=b)?d._details.insertAfter(d.nTr):d._details.detach();var e=c[0],f=new r(e),g=e.aoData;f.off("draw.dt.DT_details column-visibility.dt.DT_details destroy.dt.DT_details");0<G(g,"_details").length&&(f.on("draw.dt.DT_details",function(a,b){e===b&&f.rows({page:"current"}).eq(0).each(function(a){a=g[a]; |
|||
a._detailsShow&&a._details.insertAfter(a.nTr)})}),f.on("column-visibility.dt.DT_details",function(a,b){if(e===b)for(var c,d=aa(b),f=0,h=g.length;f<h;f++)c=g[f],c._details&&c._details.children("td[colspan]").attr("colspan",d)}),f.on("destroy.dt.DT_details",function(a,b){if(e===b)for(var c=0,d=g.length;c<d;c++)g[c]._details&&cb(f,c)}))}}};p("row().child()",function(a,b){var c=this.context;if(a===k)return c.length&&this.length?c[0].aoData[this[0]]._details:k;if(!0===a)this.child.show();else if(!1=== |
|||
a)cb(this);else if(c.length&&this.length){var d=c[0],c=c[0].aoData[this[0]],e=[],f=function(a,b){if(h.isArray(a)||a instanceof h)for(var c=0,k=a.length;c<k;c++)f(a[c],b);else a.nodeName&&"tr"===a.nodeName.toLowerCase()?e.push(a):(c=h("<tr><td/></tr>").addClass(b),h("td",c).addClass(b).html(a)[0].colSpan=aa(d),e.push(c[0]))};f(a,b);c._details&&c._details.remove();c._details=h(e);c._detailsShow&&c._details.insertAfter(c.nTr)}return this});p(["row().child.show()","row().child().show()"],function(){Vb(this, |
|||
!0);return this});p(["row().child.hide()","row().child().hide()"],function(){Vb(this,!1);return this});p(["row().child.remove()","row().child().remove()"],function(){cb(this);return this});p("row().child.isShown()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]]._detailsShow||!1:!1});var ec=/^(.+):(name|visIdx|visible)$/,Wb=function(a,b,c,d,e){for(var c=[],d=0,f=e.length;d<f;d++)c.push(B(a,e[d],b));return c};p("columns()",function(a,b){a===k?a="":h.isPlainObject(a)&& |
|||
(b=a,a="");var b=ab(b),c=this.iterator("table",function(c){var e=a,f=b,g=c.aoColumns,j=G(g,"sName"),i=G(g,"nTh");return $a("column",e,function(a){var b=Pb(a);if(a==="")return X(g.length);if(b!==null)return[b>=0?b:g.length+b];if(typeof a==="function"){var e=Da(c,f);return h.map(g,function(b,f){return a(f,Wb(c,f,0,0,e),i[f])?f:null})}var k=typeof a==="string"?a.match(ec):"";if(k)switch(k[2]){case "visIdx":case "visible":b=parseInt(k[1],10);if(b<0){var m=h.map(g,function(a,b){return a.bVisible?b:null}); |
|||
return[m[m.length+b]]}return[Z(c,b)];case "name":return h.map(j,function(a,b){return a===k[1]?b:null});default:return[]}if(a.nodeName&&a._DT_CellIndex)return[a._DT_CellIndex.column];b=h(i).filter(a).map(function(){return h.inArray(this,i)}).toArray();if(b.length||!a.nodeName)return b;b=h(a).closest("*[data-dt-column]");return b.length?[b.data("dt-column")]:[]},c,f)},1);c.selector.cols=a;c.selector.opts=b;return c});s("columns().header()","column().header()",function(){return this.iterator("column", |
|||
function(a,b){return a.aoColumns[b].nTh},1)});s("columns().footer()","column().footer()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].nTf},1)});s("columns().data()","column().data()",function(){return this.iterator("column-rows",Wb,1)});s("columns().dataSrc()","column().dataSrc()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].mData},1)});s("columns().cache()","column().cache()",function(a){return this.iterator("column-rows",function(b, |
|||
c,d,e,f){return ha(b.aoData,f,"search"===a?"_aFilterData":"_aSortData",c)},1)});s("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(a,b,c,d,e){return ha(a.aoData,e,"anCells",b)},1)});s("columns().visible()","column().visible()",function(a,b){return this.iterator("column",function(c,d){if(a===k)return c.aoColumns[d].bVisible;var e=c.aoColumns,f=e[d],g=c.aoData,j,i,n;if(a!==k&&f.bVisible!==a){if(a){var l=h.inArray(!0,G(e,"bVisible"),d+1);j=0;for(i=g.length;j< |
|||
i;j++)n=g[j].nTr,e=g[j].anCells,n&&n.insertBefore(e[d],e[l]||null)}else h(G(c.aoData,"anCells",d)).detach();f.bVisible=a;ea(c,c.aoHeader);ea(c,c.aoFooter);(b===k||b)&&U(c);u(c,null,"column-visibility",[c,d,a,b]);ya(c)}})});s("columns().indexes()","column().index()",function(a){return this.iterator("column",function(b,c){return"visible"===a?$(b,c):c},1)});p("columns.adjust()",function(){return this.iterator("table",function(a){U(a)},1)});p("column.index()",function(a,b){if(0!==this.context.length){var c= |
|||
this.context[0];if("fromVisible"===a||"toData"===a)return Z(c,b);if("fromData"===a||"toVisible"===a)return $(c,b)}});p("column()",function(a,b){return bb(this.columns(a,b))});p("cells()",function(a,b,c){h.isPlainObject(a)&&(a.row===k?(c=a,a=null):(c=b,b=null));h.isPlainObject(b)&&(c=b,b=null);if(null===b||b===k)return this.iterator("table",function(b){var d=a,e=ab(c),f=b.aoData,g=Da(b,e),j=Sb(ha(f,g,"anCells")),i=h([].concat.apply([],j)),l,n=b.aoColumns.length,m,p,r,u,v,s;return $a("cell",d,function(a){var c= |
|||
typeof a==="function";if(a===null||a===k||c){m=[];p=0;for(r=g.length;p<r;p++){l=g[p];for(u=0;u<n;u++){v={row:l,column:u};if(c){s=f[l];a(v,B(b,l,u),s.anCells?s.anCells[u]:null)&&m.push(v)}else m.push(v)}}return m}if(h.isPlainObject(a))return[a];c=i.filter(a).map(function(a,b){return{row:b._DT_CellIndex.row,column:b._DT_CellIndex.column}}).toArray();if(c.length||!a.nodeName)return c;s=h(a).closest("*[data-dt-row]");return s.length?[{row:s.data("dt-row"),column:s.data("dt-column")}]:[]},b,e)});var d= |
|||
this.columns(b,c),e=this.rows(a,c),f,g,j,i,n,l=this.iterator("table",function(a,b){f=[];g=0;for(j=e[b].length;g<j;g++){i=0;for(n=d[b].length;i<n;i++)f.push({row:e[b][g],column:d[b][i]})}return f},1);h.extend(l.selector,{cols:b,rows:a,opts:c});return l});s("cells().nodes()","cell().node()",function(){return this.iterator("cell",function(a,b,c){return(a=a.aoData[b])&&a.anCells?a.anCells[c]:k},1)});p("cells().data()",function(){return this.iterator("cell",function(a,b,c){return B(a,b,c)},1)});s("cells().cache()", |
|||
"cell().cache()",function(a){a="search"===a?"_aFilterData":"_aSortData";return this.iterator("cell",function(b,c,d){return b.aoData[c][a][d]},1)});s("cells().render()","cell().render()",function(a){return this.iterator("cell",function(b,c,d){return B(b,c,d,a)},1)});s("cells().indexes()","cell().index()",function(){return this.iterator("cell",function(a,b,c){return{row:b,column:c,columnVisible:$(a,c)}},1)});s("cells().invalidate()","cell().invalidate()",function(a){return this.iterator("cell",function(b, |
|||
c,d){ca(b,c,a,d)})});p("cell()",function(a,b,c){return bb(this.cells(a,b,c))});p("cell().data()",function(a){var b=this.context,c=this[0];if(a===k)return b.length&&c.length?B(b[0],c[0].row,c[0].column):k;jb(b[0],c[0].row,c[0].column,a);ca(b[0],c[0].row,"data",c[0].column);return this});p("order()",function(a,b){var c=this.context;if(a===k)return 0!==c.length?c[0].aaSorting:k;"number"===typeof a?a=[[a,b]]:h.isArray(a[0])||(a=Array.prototype.slice.call(arguments));return this.iterator("table",function(b){b.aaSorting= |
|||
a.slice()})});p("order.listener()",function(a,b,c){return this.iterator("table",function(d){Oa(d,a,b,c)})});p("order.fixed()",function(a){if(!a){var b=this.context,b=b.length?b[0].aaSortingFixed:k;return h.isArray(b)?{pre:b}:b}return this.iterator("table",function(b){b.aaSortingFixed=h.extend(!0,{},a)})});p(["columns().order()","column().order()"],function(a){var b=this;return this.iterator("table",function(c,d){var e=[];h.each(b[d],function(b,c){e.push([c,a])});c.aaSorting=e})});p("search()",function(a, |
|||
b,c,d){var e=this.context;return a===k?0!==e.length?e[0].oPreviousSearch.sSearch:k:this.iterator("table",function(e){e.oFeatures.bFilter&&fa(e,h.extend({},e.oPreviousSearch,{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===d?!0:d}),1)})});s("columns().search()","column().search()",function(a,b,c,d){return this.iterator("column",function(e,f){var g=e.aoPreSearchCols;if(a===k)return g[f].sSearch;e.oFeatures.bFilter&&(h.extend(g[f],{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null=== |
|||
c?!0:c,bCaseInsensitive:null===d?!0:d}),fa(e,e.oPreviousSearch,1))})});p("state()",function(){return this.context.length?this.context[0].oSavedState:null});p("state.clear()",function(){return this.iterator("table",function(a){a.fnStateSaveCallback.call(a.oInstance,a,{})})});p("state.loaded()",function(){return this.context.length?this.context[0].oLoadedState:null});p("state.save()",function(){return this.iterator("table",function(a){ya(a)})});m.versionCheck=m.fnVersionCheck=function(a){for(var b= |
|||
m.version.split("."),a=a.split("."),c,d,e=0,f=a.length;e<f;e++)if(c=parseInt(b[e],10)||0,d=parseInt(a[e],10)||0,c!==d)return c>d;return!0};m.isDataTable=m.fnIsDataTable=function(a){var b=h(a).get(0),c=!1;h.each(m.settings,function(a,e){var f=e.nScrollHead?h("table",e.nScrollHead)[0]:null,g=e.nScrollFoot?h("table",e.nScrollFoot)[0]:null;if(e.nTable===b||f===b||g===b)c=!0});return c};m.tables=m.fnTables=function(a){var b=!1;h.isPlainObject(a)&&(b=a.api,a=a.visible);var c=h.map(m.settings,function(b){if(!a|| |
|||
a&&h(b.nTable).is(":visible"))return b.nTable});return b?new r(c):c};m.util={throttle:ua,escapeRegex:va};m.camelToHungarian=K;p("$()",function(a,b){var c=this.rows(b).nodes(),c=h(c);return h([].concat(c.filter(a).toArray(),c.find(a).toArray()))});h.each(["on","one","off"],function(a,b){p(b+"()",function(){var a=Array.prototype.slice.call(arguments);a[0].match(/\.dt\b/)||(a[0]+=".dt");var d=h(this.tables().nodes());d[b].apply(d,a);return this})});p("clear()",function(){return this.iterator("table", |
|||
function(a){na(a)})});p("settings()",function(){return new r(this.context,this.context)});p("init()",function(){var a=this.context;return a.length?a[0].oInit:null});p("data()",function(){return this.iterator("table",function(a){return G(a.aoData,"_aData")}).flatten()});p("destroy()",function(a){a=a||!1;return this.iterator("table",function(b){var c=b.nTableWrapper.parentNode,d=b.oClasses,e=b.nTable,f=b.nTBody,g=b.nTHead,j=b.nTFoot,i=h(e),f=h(f),k=h(b.nTableWrapper),l=h.map(b.aoData,function(a){return a.nTr}), |
|||
p;b.bDestroying=!0;u(b,"aoDestroyCallback","destroy",[b]);a||(new r(b)).columns().visible(!0);k.unbind(".DT").find(":not(tbody *)").unbind(".DT");h(D).unbind(".DT-"+b.sInstance);e!=g.parentNode&&(i.children("thead").detach(),i.append(g));j&&e!=j.parentNode&&(i.children("tfoot").detach(),i.append(j));b.aaSorting=[];b.aaSortingFixed=[];xa(b);h(l).removeClass(b.asStripeClasses.join(" "));h("th, td",g).removeClass(d.sSortable+" "+d.sSortableAsc+" "+d.sSortableDesc+" "+d.sSortableNone);b.bJUI&&(h("th span."+ |
|||
d.sSortIcon+", td span."+d.sSortIcon,g).detach(),h("th, td",g).each(function(){var a=h("div."+d.sSortJUIWrapper,this);h(this).append(a.contents());a.detach()}));f.children().detach();f.append(l);g=a?"remove":"detach";i[g]();k[g]();!a&&c&&(c.insertBefore(e,b.nTableReinsertBefore),i.css("width",b.sDestroyWidth).removeClass(d.sTable),(p=b.asDestroyStripes.length)&&f.children().each(function(a){h(this).addClass(b.asDestroyStripes[a%p])}));c=h.inArray(b,m.settings);-1!==c&&m.settings.splice(c,1)})});h.each(["column", |
|||
"row","cell"],function(a,b){p(b+"s().every()",function(a){var d=this.selector.opts,e=this;return this.iterator(b,function(f,g,h,i,n){a.call(e[b](g,"cell"===b?h:d,"cell"===b?d:k),g,h,i,n)})})});p("i18n()",function(a,b,c){var d=this.context[0],a=Q(a)(d.oLanguage);a===k&&(a=b);c!==k&&h.isPlainObject(a)&&(a=a[c]!==k?a[c]:a._);return a.replace("%d",c)});m.version="1.10.12-dev";m.settings=[];m.models={};m.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0};m.models.oRow={nTr:null,anCells:null, |
|||
_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null,idx:-1};m.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};m.defaults= |
|||
{aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bJQueryUI:!1,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(a){return a.toString().replace(/\B(?=(\d{3})+(?!\d))/g, |
|||
this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(a){try{return JSON.parse((-1===a.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+a.sInstance+"_"+location.pathname))}catch(b){}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(a,b){try{(-1===a.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+a.sInstance+ |
|||
"_"+location.pathname,JSON.stringify(b))}catch(c){}},fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries", |
|||
sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:h.extend({},m.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",searchDelay:null,sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null,rowId:"DT_RowId"}; |
|||
Y(m.defaults);m.defaults.column={aDataSort:null,iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};Y(m.defaults.column);m.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null, |
|||
bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1,bBounding:!1,barWidth:0},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aIds:{},aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[], |
|||
aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:"two_button",iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,json:k,oAjaxData:k,fnServerData:null, |
|||
aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,bJUI:null,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==y(this)?1*this._iRecordsTotal:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==y(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var a= |
|||
this._iDisplayLength,b=this._iDisplayStart,c=b+a,d=this.aiDisplay.length,e=this.oFeatures,f=e.bPaginate;return e.bServerSide?!1===f||-1===a?b+d:Math.min(b+a,this._iRecordsDisplay):!f||c>d||-1===a?d:c},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{},rowIdFn:null,rowId:null};m.ext=v={buttons:{},classes:{},builder:"-source-",errMode:"alert",feature:[],search:[],selector:{cell:[],column:[],row:[]},internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{}, |
|||
header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:m.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:m.version};h.extend(v,{afnFiltering:v.search,aTypes:v.type.detect,ofnSearch:v.type.search,oSort:v.type.order,afnSortData:v.order,aoFeatures:v.feature,oApi:v.internal,oStdClasses:v.classes,oPagination:v.pager});h.extend(m.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd", |
|||
sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead", |
|||
sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sJUIHeader:"",sJUIFooter:""});var Ea="",Ea="",H=Ea+"ui-state-default",ia=Ea+"css_right ui-icon ui-icon-",Xb=Ea+"fg-toolbar ui-toolbar ui-widget-header ui-helper-clearfix";h.extend(m.ext.oJUIClasses, |
|||
m.ext.classes,{sPageButton:"fg-button ui-button "+H,sPageButtonActive:"ui-state-disabled",sPageButtonDisabled:"ui-state-disabled",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",sSortAsc:H+" sorting_asc",sSortDesc:H+" sorting_desc",sSortable:H+" sorting",sSortableAsc:H+" sorting_asc_disabled",sSortableDesc:H+" sorting_desc_disabled",sSortableNone:H+" sorting_disabled",sSortJUIAsc:ia+"triangle-1-n",sSortJUIDesc:ia+"triangle-1-s",sSortJUI:ia+"carat-2-n-s", |
|||
sSortJUIAscAllowed:ia+"carat-1-n",sSortJUIDescAllowed:ia+"carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon",sScrollHead:"dataTables_scrollHead "+H,sScrollFoot:"dataTables_scrollFoot "+H,sHeaderTH:H,sFooterTH:H,sJUIHeader:Xb+" ui-corner-tl ui-corner-tr",sJUIFooter:Xb+" ui-corner-bl ui-corner-br"});var Mb=m.ext.pager;h.extend(Mb,{simple:function(){return["previous","next"]},full:function(){return["first","previous","next","last"]},numbers:function(a,b){return[Aa(a, |
|||
b)]},simple_numbers:function(a,b){return["previous",Aa(a,b),"next"]},full_numbers:function(a,b){return["first","previous",Aa(a,b),"next","last"]},_numbers:Aa,numbers_length:7});h.extend(!0,m.ext.renderer,{pageButton:{_:function(a,b,c,d,e,f){var g=a.oClasses,j=a.oLanguage.oPaginate,i=a.oLanguage.oAria.paginate||{},k,l,m=0,p=function(b,d){var o,r,u,s,v=function(b){Ta(a,b.data.action,true)};o=0;for(r=d.length;o<r;o++){s=d[o];if(h.isArray(s)){u=h("<"+(s.DT_el||"div")+"/>").appendTo(b);p(u,s)}else{k=null; |
|||
l="";switch(s){case "ellipsis":b.append('<span class="ellipsis">…</span>');break;case "first":k=j.sFirst;l=s+(e>0?"":" "+g.sPageButtonDisabled);break;case "previous":k=j.sPrevious;l=s+(e>0?"":" "+g.sPageButtonDisabled);break;case "next":k=j.sNext;l=s+(e<f-1?"":" "+g.sPageButtonDisabled);break;case "last":k=j.sLast;l=s+(e<f-1?"":" "+g.sPageButtonDisabled);break;default:k=s+1;l=e===s?g.sPageButtonActive:""}if(k!==null){u=h("<a>",{"class":g.sPageButton+" "+l,"aria-controls":a.sTableId,"aria-label":i[s], |
|||
"data-dt-idx":m,tabindex:a.iTabIndex,id:c===0&&typeof s==="string"?a.sTableId+"_"+s:null}).html(k).appendTo(b);Wa(u,{action:s},v);m++}}}},r;try{r=h(b).find(I.activeElement).data("dt-idx")}catch(o){}p(h(b).empty(),d);r&&h(b).find("[data-dt-idx="+r+"]").focus()}}});h.extend(m.ext.type.detect,[function(a,b){var c=b.oLanguage.sDecimal;return Za(a,c)?"num"+c:null},function(a){if(a&&!(a instanceof Date)&&(!bc.test(a)||!cc.test(a)))return null;var b=Date.parse(a);return null!==b&&!isNaN(b)||M(a)?"date": |
|||
null},function(a,b){var c=b.oLanguage.sDecimal;return Za(a,c,!0)?"num-fmt"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return Rb(a,c)?"html-num"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return Rb(a,c,!0)?"html-num-fmt"+c:null},function(a){return M(a)||"string"===typeof a&&-1!==a.indexOf("<")?"html":null}]);h.extend(m.ext.type.search,{html:function(a){return M(a)?a:"string"===typeof a?a.replace(Ob," ").replace(Ca,""):""},string:function(a){return M(a)?a:"string"===typeof a?a.replace(Ob, |
|||
" "):a}});var Ba=function(a,b,c,d){if(0!==a&&(!a||"-"===a))return-Infinity;b&&(a=Qb(a,b));a.replace&&(c&&(a=a.replace(c,"")),d&&(a=a.replace(d,"")));return 1*a};h.extend(v.type.order,{"date-pre":function(a){return Date.parse(a)||0},"html-pre":function(a){return M(a)?"":a.replace?a.replace(/<.*?>/g,"").toLowerCase():a+""},"string-pre":function(a){return M(a)?"":"string"===typeof a?a.toLowerCase():!a.toString?"":a.toString()},"string-asc":function(a,b){return a<b?-1:a>b?1:0},"string-desc":function(a, |
|||
b){return a<b?1:a>b?-1:0}});db("");h.extend(!0,m.ext.renderer,{header:{_:function(a,b,c,d){h(a.nTable).on("order.dt.DT",function(e,f,g,h){if(a===f){e=c.idx;b.removeClass(c.sSortingClass+" "+d.sSortAsc+" "+d.sSortDesc).addClass(h[e]=="asc"?d.sSortAsc:h[e]=="desc"?d.sSortDesc:c.sSortingClass)}})},jqueryui:function(a,b,c,d){h("<div/>").addClass(d.sSortJUIWrapper).append(b.contents()).append(h("<span/>").addClass(d.sSortIcon+" "+c.sSortingClassJUI)).appendTo(b);h(a.nTable).on("order.dt.DT",function(e, |
|||
f,g,h){if(a===f){e=c.idx;b.removeClass(d.sSortAsc+" "+d.sSortDesc).addClass(h[e]=="asc"?d.sSortAsc:h[e]=="desc"?d.sSortDesc:c.sSortingClass);b.find("span."+d.sSortIcon).removeClass(d.sSortJUIAsc+" "+d.sSortJUIDesc+" "+d.sSortJUI+" "+d.sSortJUIAscAllowed+" "+d.sSortJUIDescAllowed).addClass(h[e]=="asc"?d.sSortJUIAsc:h[e]=="desc"?d.sSortJUIDesc:c.sSortingClassJUI)}})}}});var Yb=function(a){return"string"===typeof a?a.replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):a};m.render={number:function(a, |
|||
b,c,d,e){return{display:function(f){if("number"!==typeof f&&"string"!==typeof f)return f;var g=0>f?"-":"",h=parseFloat(f);if(isNaN(h))return Yb(f);f=Math.abs(h);h=parseInt(f,10);f=c?b+(f-h).toFixed(c).substring(2):"";return g+(d||"")+h.toString().replace(/\B(?=(\d{3})+(?!\d))/g,a)+f+(e||"")}}},text:function(){return{display:Yb}}};h.extend(m.ext.internal,{_fnExternApiFunc:Nb,_fnBuildAjax:ra,_fnAjaxUpdate:lb,_fnAjaxParameters:ub,_fnAjaxUpdateDraw:vb,_fnAjaxDataSrc:sa,_fnAddColumn:Ga,_fnColumnOptions:ja, |
|||
_fnAdjustColumnSizing:U,_fnVisibleToColumnIndex:Z,_fnColumnIndexToVisible:$,_fnVisbleColumns:aa,_fnGetColumns:la,_fnColumnTypes:Ia,_fnApplyColumnDefs:ib,_fnHungarianMap:Y,_fnCamelToHungarian:K,_fnLanguageCompat:Fa,_fnBrowserDetect:gb,_fnAddData:N,_fnAddTr:ma,_fnNodeToDataIndex:function(a,b){return b._DT_RowIndex!==k?b._DT_RowIndex:null},_fnNodeToColumnIndex:function(a,b,c){return h.inArray(c,a.aoData[b].anCells)},_fnGetCellData:B,_fnSetCellData:jb,_fnSplitObjNotation:La,_fnGetObjectDataFn:Q,_fnSetObjectDataFn:R, |
|||
_fnGetDataMaster:Ma,_fnClearTable:na,_fnDeleteIndex:oa,_fnInvalidate:ca,_fnGetRowElements:Ka,_fnCreateTr:Ja,_fnBuildHead:kb,_fnDrawHead:ea,_fnDraw:O,_fnReDraw:T,_fnAddOptionsHtml:nb,_fnDetectHeader:da,_fnGetUniqueThs:qa,_fnFeatureHtmlFilter:pb,_fnFilterComplete:fa,_fnFilterCustom:yb,_fnFilterColumn:xb,_fnFilter:wb,_fnFilterCreateSearch:Qa,_fnEscapeRegex:va,_fnFilterData:zb,_fnFeatureHtmlInfo:sb,_fnUpdateInfo:Cb,_fnInfoMacros:Db,_fnInitialise:ga,_fnInitComplete:ta,_fnLengthChange:Ra,_fnFeatureHtmlLength:ob, |
|||
_fnFeatureHtmlPaginate:tb,_fnPageChange:Ta,_fnFeatureHtmlProcessing:qb,_fnProcessingDisplay:C,_fnFeatureHtmlTable:rb,_fnScrollDraw:ka,_fnApplyToChildren:J,_fnCalculateColumnWidths:Ha,_fnThrottle:ua,_fnConvertToWidth:Fb,_fnGetWidestNode:Gb,_fnGetMaxLenString:Hb,_fnStringToCss:x,_fnSortFlatten:W,_fnSort:mb,_fnSortAria:Jb,_fnSortListener:Va,_fnSortAttachListener:Oa,_fnSortingClasses:xa,_fnSortData:Ib,_fnSaveState:ya,_fnLoadState:Kb,_fnSettingsFromNode:za,_fnLog:L,_fnMap:E,_fnBindAction:Wa,_fnCallbackReg:z, |
|||
_fnCallbackFire:u,_fnLengthOverflow:Sa,_fnRenderer:Pa,_fnDataSource:y,_fnRowAttributes:Na,_fnCalculateEnd:function(){}});h.fn.dataTable=m;m.$=h;h.fn.dataTableSettings=m.settings;h.fn.dataTableExt=m.ext;h.fn.DataTable=function(a){return h(this).dataTable(a).api()};h.each(m,function(a,b){h.fn.DataTable[a]=b});return h.fn.dataTable}); |
@ -1,43 +0,0 @@ |
|||
(function(C,p){"object"===typeof exports?p(exports):"function"===typeof define&&define.amd?define(["exports"],p):p(C)})(this,function(C){function p(a){this._targetElement=a;this._introItems=[];this._options={nextLabel:"Next →",prevLabel:"← Back",skipLabel:"Skip",doneLabel:"Done",tooltipPosition:"bottom",tooltipClass:"",highlightClass:"",exitOnEsc:!0,exitOnOverlayClick:!0,showStepNumbers:!0,keyboardNavigation:!0,showButtons:!0,showBullets:!0,showProgress:!1,scrollToElement:!0,overlayOpacity:0.8, |
|||
positionPrecedence:["bottom","top","right","left"],disableInteraction:!1,hintPosition:"top-middle",hintButtonLabel:"Got it"}}function P(a){var b=[],c=this;if(this._options.steps)for(var d=0,f=this._options.steps.length;d<f;d++){var e=y(this._options.steps[d]);e.step=b.length+1;"string"===typeof e.element&&(e.element=document.querySelector(e.element));if("undefined"===typeof e.element||null==e.element){var g=document.querySelector(".introjsFloatingElement");null==g&&(g=document.createElement("div"), |
|||
g.className="introjsFloatingElement",document.body.appendChild(g));e.element=g;e.position="floating"}null!=e.element&&b.push(e)}else{f=a.querySelectorAll("*[data-intro]");if(1>f.length)return!1;d=0;for(e=f.length;d<e;d++){var g=f[d],k=parseInt(g.getAttribute("data-step"),10);0<k&&(b[k-1]={element:g,intro:g.getAttribute("data-intro"),step:parseInt(g.getAttribute("data-step"),10),tooltipClass:g.getAttribute("data-tooltipClass"),highlightClass:g.getAttribute("data-highlightClass"),position:g.getAttribute("data-position")|| |
|||
this._options.tooltipPosition})}d=k=0;for(e=f.length;d<e;d++)if(g=f[d],null==g.getAttribute("data-step")){for(;"undefined"!=typeof b[k];)k++;b[k]={element:g,intro:g.getAttribute("data-intro"),step:k+1,tooltipClass:g.getAttribute("data-tooltipClass"),highlightClass:g.getAttribute("data-highlightClass"),position:g.getAttribute("data-position")||this._options.tooltipPosition}}}d=[];for(f=0;f<b.length;f++)b[f]&&d.push(b[f]);b=d;b.sort(function(a,c){return a.step-c.step});c._introItems=b;Q.call(c,a)&& |
|||
(z.call(c),a.querySelector(".introjs-skipbutton"),a.querySelector(".introjs-nextbutton"),c._onKeyDown=function(b){if(27===b.keyCode&&!0==c._options.exitOnEsc)void 0!=c._introExitCallback&&c._introExitCallback.call(c),A.call(c,a);else if(37===b.keyCode)D.call(c);else if(39===b.keyCode)z.call(c);else if(13===b.keyCode){var d=b.target||b.srcElement;d&&0<d.className.indexOf("introjs-prevbutton")?D.call(c):d&&0<d.className.indexOf("introjs-skipbutton")?(c._introItems.length-1==c._currentStep&&"function"=== |
|||
typeof c._introCompleteCallback&&c._introCompleteCallback.call(c),void 0!=c._introExitCallback&&c._introExitCallback.call(c),A.call(c,a)):z.call(c);b.preventDefault?b.preventDefault():b.returnValue=!1}},c._onResize=function(a){r.call(c,document.querySelector(".introjs-helperLayer"));r.call(c,document.querySelector(".introjs-tooltipReferenceLayer"))},window.addEventListener?(this._options.keyboardNavigation&&window.addEventListener("keydown",c._onKeyDown,!0),window.addEventListener("resize",c._onResize, |
|||
!0)):document.attachEvent&&(this._options.keyboardNavigation&&document.attachEvent("onkeydown",c._onKeyDown),document.attachEvent("onresize",c._onResize)));return!1}function y(a){if(null==a||"object"!=typeof a||"undefined"!=typeof a.nodeType)return a;var b={},c;for(c in a)b[c]="undefined"!=typeof jQuery&&a[c]instanceof jQuery?a[c]:y(a[c]);return b}function z(){this._direction="forward";"undefined"===typeof this._currentStep?this._currentStep=0:++this._currentStep;if(this._introItems.length<=this._currentStep)"function"=== |
|||
typeof this._introCompleteCallback&&this._introCompleteCallback.call(this),A.call(this,this._targetElement);else{var a=this._introItems[this._currentStep];"undefined"!==typeof this._introBeforeChangeCallback&&this._introBeforeChangeCallback.call(this,a.element);K.call(this,a)}}function D(){this._direction="backward";if(0===this._currentStep)return!1;var a=this._introItems[--this._currentStep];"undefined"!==typeof this._introBeforeChangeCallback&&this._introBeforeChangeCallback.call(this,a.element); |
|||
K.call(this,a)}function A(a){var b=a.querySelector(".introjs-overlay");if(null!=b){b.style.opacity=0;setTimeout(function(){b.parentNode&&b.parentNode.removeChild(b)},500);var c=a.querySelector(".introjs-helperLayer");c&&c.parentNode.removeChild(c);(c=a.querySelector(".introjs-tooltipReferenceLayer"))&&c.parentNode.removeChild(c);(a=a.querySelector(".introjs-disableInteraction"))&&a.parentNode.removeChild(a);(a=document.querySelector(".introjsFloatingElement"))&&a.parentNode.removeChild(a);if(a=document.querySelector(".introjs-showElement"))a.className= |
|||
a.className.replace(/introjs-[a-zA-Z]+/g,"").replace(/^\s+|\s+$/g,"");if((a=document.querySelectorAll(".introjs-fixParent"))&&0<a.length)for(c=a.length-1;0<=c;c--)a[c].className=a[c].className.replace(/introjs-fixParent/g,"").replace(/^\s+|\s+$/g,"");window.removeEventListener?window.removeEventListener("keydown",this._onKeyDown,!0):document.detachEvent&&document.detachEvent("onkeydown",this._onKeyDown);this._currentStep=void 0}}function F(a,b,c,d,f){var e="",g,k;f=f||!1;b.style.top=null;b.style.right= |
|||
null;b.style.bottom=null;b.style.left=null;b.style.marginLeft=null;b.style.marginTop=null;c.style.display="inherit";"undefined"!=typeof d&&null!=d&&(d.style.top=null,d.style.left=null);if(this._introItems[this._currentStep]){e=this._introItems[this._currentStep];e="string"===typeof e.tooltipClass?e.tooltipClass:this._options.tooltipClass;b.className=("introjs-tooltip "+e).replace(/^\s+|\s+$/g,"");k=this._introItems[this._currentStep].position;if(("auto"==k||"auto"==this._options.tooltipPosition)&& |
|||
"floating"!=k){e=k;g=this._options.positionPrecedence.slice();k=G();var x=t(b).height+10,q=t(b).width+20,l=t(a),m="floating";l.left+q>k.width||0>l.left+l.width/2-q?(s(g,"bottom"),s(g,"top")):(l.height+l.top+x>k.height&&s(g,"bottom"),0>l.top-x&&s(g,"top"));l.width+l.left+q>k.width&&s(g,"right");0>l.left-q&&s(g,"left");0<g.length&&(m=g[0]);e&&"auto"!=e&&-1<g.indexOf(e)&&(m=e);k=m}e=t(a);a=t(b);g=G();switch(k){case "top":c.className="introjs-arrow bottom";H(e,f?0:15,a,g,b);b.style.bottom=e.height+20+ |
|||
"px";break;case "right":b.style.left=e.width+20+"px";e.top+a.height>g.height?(c.className="introjs-arrow left-bottom",b.style.top="-"+(a.height-e.height-20)+"px"):c.className="introjs-arrow left";break;case "left":f||!0!=this._options.showStepNumbers||(b.style.top="15px");e.top+a.height>g.height?(b.style.top="-"+(a.height-e.height-20)+"px",c.className="introjs-arrow right-bottom"):c.className="introjs-arrow right";b.style.right=e.width+20+"px";break;case "floating":c.style.display="none";b.style.left= |
|||
"50%";b.style.top="50%";b.style.marginLeft="-"+a.width/2+"px";b.style.marginTop="-"+a.height/2+"px";"undefined"!=typeof d&&null!=d&&(d.style.left="-"+(a.width/2+18)+"px",d.style.top="-"+(a.height/2+18)+"px");break;case "bottom-right-aligned":c.className="introjs-arrow top-right";L(e,0,a,b);b.style.top=e.height+20+"px";break;case "bottom-middle-aligned":c.className="introjs-arrow top-middle";c=e.width/2-a.width/2;f&&(c+=5);L(e,c,a,b)&&(b.style.right=null,H(e,c,a,g,b));b.style.top=e.height+20+"px"; |
|||
break;default:c.className="introjs-arrow top",H(e,0,a,g,b),b.style.top=e.height+20+"px"}}}function H(a,b,c,d,f){if(a.left+b+c.width>d.width)return f.style.left=d.width-c.width-a.left+"px",!1;f.style.left=b+"px";return!0}function L(a,b,c,d){if(0>a.left+a.width-b-c.width)return d.style.left=-a.left+"px",!1;d.style.right=b+"px";return!0}function s(a,b){-1<a.indexOf(b)&&a.splice(a.indexOf(b),1)}function r(a){if(a&&this._introItems[this._currentStep]){var b=this._introItems[this._currentStep],c=t(b.element), |
|||
d=10;I(b.element)&&(a.className+=" introjs-fixedTooltip");"floating"==b.position&&(d=0);a.setAttribute("style","width: "+(c.width+d)+"px; height:"+(c.height+d)+"px; top:"+(c.top-5)+"px;left: "+(c.left-5)+"px;")}}function R(){var a=document.querySelector(".introjs-disableInteraction");null===a&&(a=document.createElement("div"),a.className="introjs-disableInteraction",this._targetElement.appendChild(a));r.call(this,a)}function K(a){"undefined"!==typeof this._introChangeCallback&&this._introChangeCallback.call(this, |
|||
a.element);var b=this,c=document.querySelector(".introjs-helperLayer"),d=document.querySelector(".introjs-tooltipReferenceLayer"),f="introjs-helperLayer";t(a.element);"string"===typeof a.highlightClass&&(f+=" "+a.highlightClass);"string"===typeof this._options.highlightClass&&(f+=" "+this._options.highlightClass);if(null!=c){var e=d.querySelector(".introjs-helperNumberLayer"),g=d.querySelector(".introjs-tooltiptext"),k=d.querySelector(".introjs-arrow"),x=d.querySelector(".introjs-tooltip"),q=d.querySelector(".introjs-skipbutton"), |
|||
l=d.querySelector(".introjs-prevbutton"),m=d.querySelector(".introjs-nextbutton");c.className=f;x.style.opacity=0;x.style.display="none";if(null!=e){var h=this._introItems[0<=a.step-2?a.step-2:0];if(null!=h&&"forward"==this._direction&&"floating"==h.position||"backward"==this._direction&&"floating"==a.position)e.style.opacity=0}r.call(b,c);r.call(b,d);if((h=document.querySelectorAll(".introjs-fixParent"))&&0<h.length)for(f=h.length-1;0<=f;f--)h[f].className=h[f].className.replace(/introjs-fixParent/g, |
|||
"").replace(/^\s+|\s+$/g,"");h=document.querySelector(".introjs-showElement");h.className=h.className.replace(/introjs-[a-zA-Z]+/g,"").replace(/^\s+|\s+$/g,"");b._lastShowElementTimer&&clearTimeout(b._lastShowElementTimer);b._lastShowElementTimer=setTimeout(function(){null!=e&&(e.innerHTML=a.step);g.innerHTML=a.intro;x.style.display="block";F.call(b,a.element,x,k,e);d.querySelector(".introjs-bullets li > a.active").className="";d.querySelector('.introjs-bullets li > a[data-stepnumber="'+a.step+'"]').className= |
|||
"active";d.querySelector(".introjs-progress .introjs-progressbar").setAttribute("style","width:"+M.call(b)+"%;");x.style.opacity=1;e&&(e.style.opacity=1);-1===m.tabIndex?q.focus():m.focus()},350)}else{var p=document.createElement("div"),l=document.createElement("div"),c=document.createElement("div"),n=document.createElement("div"),s=document.createElement("div"),w=document.createElement("div"),E=document.createElement("div"),u=document.createElement("div");p.className=f;l.className="introjs-tooltipReferenceLayer"; |
|||
r.call(b,p);r.call(b,l);this._targetElement.appendChild(p);this._targetElement.appendChild(l);c.className="introjs-arrow";s.className="introjs-tooltiptext";s.innerHTML=a.intro;w.className="introjs-bullets";!1===this._options.showBullets&&(w.style.display="none");for(var p=document.createElement("ul"),f=0,C=this._introItems.length;f<C;f++){var y=document.createElement("li"),B=document.createElement("a");B.onclick=function(){b.goToStep(this.getAttribute("data-stepnumber"))};f===a.step-1&&(B.className= |
|||
"active");B.href="javascript:void(0);";B.innerHTML=" ";B.setAttribute("data-stepnumber",this._introItems[f].step);y.appendChild(B);p.appendChild(y)}w.appendChild(p);E.className="introjs-progress";!1===this._options.showProgress&&(E.style.display="none");f=document.createElement("div");f.className="introjs-progressbar";f.setAttribute("style","width:"+M.call(this)+"%;");E.appendChild(f);u.className="introjs-tooltipbuttons";!1===this._options.showButtons&&(u.style.display="none");n.className="introjs-tooltip"; |
|||
n.appendChild(s);n.appendChild(w);n.appendChild(E);!0==this._options.showStepNumbers&&(h=document.createElement("span"),h.className="introjs-helperNumberLayer",h.innerHTML=a.step,l.appendChild(h));n.appendChild(c);l.appendChild(n);m=document.createElement("a");m.onclick=function(){b._introItems.length-1!=b._currentStep&&z.call(b)};m.href="javascript:void(0);";m.innerHTML=this._options.nextLabel;l=document.createElement("a");l.onclick=function(){0!=b._currentStep&&D.call(b)};l.href="javascript:void(0);"; |
|||
l.innerHTML=this._options.prevLabel;q=document.createElement("a");q.className="introjs-button introjs-skipbutton";q.href="javascript:void(0);";q.innerHTML=this._options.skipLabel;q.onclick=function(){b._introItems.length-1==b._currentStep&&"function"===typeof b._introCompleteCallback&&b._introCompleteCallback.call(b);b._introItems.length-1!=b._currentStep&&"function"===typeof b._introExitCallback&&b._introExitCallback.call(b);A.call(b,b._targetElement)};u.appendChild(q);1<this._introItems.length&& |
|||
(u.appendChild(l),u.appendChild(m));n.appendChild(u);F.call(b,a.element,n,c,h)}!0===this._options.disableInteraction&&R.call(b);l.removeAttribute("tabIndex");m.removeAttribute("tabIndex");0==this._currentStep&&1<this._introItems.length?(l.className="introjs-button introjs-prevbutton introjs-disabled",l.tabIndex="-1",m.className="introjs-button introjs-nextbutton",q.innerHTML=this._options.skipLabel):this._introItems.length-1==this._currentStep||1==this._introItems.length?(q.innerHTML=this._options.doneLabel, |
|||
l.className="introjs-button introjs-prevbutton",m.className="introjs-button introjs-nextbutton introjs-disabled",m.tabIndex="-1"):(l.className="introjs-button introjs-prevbutton",m.className="introjs-button introjs-nextbutton",q.innerHTML=this._options.skipLabel);m.focus();a.element.className+=" introjs-showElement";h=v(a.element,"position");"absolute"!==h&&"relative"!==h&&(a.element.className+=" introjs-relativePosition");for(h=a.element.parentNode;null!=h&&"body"!==h.tagName.toLowerCase();){c=v(h, |
|||
"z-index");n=parseFloat(v(h,"opacity"));u=v(h,"transform")||v(h,"-webkit-transform")||v(h,"-moz-transform")||v(h,"-ms-transform")||v(h,"-o-transform");if(/[0-9]+/.test(c)||1>n||"none"!==u&&void 0!==u)h.className+=" introjs-fixParent";h=h.parentNode}S(a.element)||!0!==this._options.scrollToElement||(n=a.element.getBoundingClientRect(),h=G().height,c=n.bottom-(n.bottom-n.top),n=n.bottom-h,0>c||a.element.clientHeight>h?window.scrollBy(0,c-30):window.scrollBy(0,n+100));"undefined"!==typeof this._introAfterChangeCallback&& |
|||
this._introAfterChangeCallback.call(this,a.element)}function v(a,b){var c="";a.currentStyle?c=a.currentStyle[b]:document.defaultView&&document.defaultView.getComputedStyle&&(c=document.defaultView.getComputedStyle(a,null).getPropertyValue(b));return c&&c.toLowerCase?c.toLowerCase():c}function I(a){var b=a.parentNode;return"HTML"===b.nodeName?!1:"fixed"==v(a,"position")?!0:I(b)}function G(){if(void 0!=window.innerWidth)return{width:window.innerWidth,height:window.innerHeight};var a=document.documentElement; |
|||
return{width:a.clientWidth,height:a.clientHeight}}function S(a){a=a.getBoundingClientRect();return 0<=a.top&&0<=a.left&&a.bottom+80<=window.innerHeight&&a.right<=window.innerWidth}function Q(a){var b=document.createElement("div"),c="",d=this;b.className="introjs-overlay";if("body"===a.tagName.toLowerCase())c+="top: 0;bottom: 0; left: 0;right: 0;position: fixed;",b.setAttribute("style",c);else{var f=t(a);f&&(c+="width: "+f.width+"px; height:"+f.height+"px; top:"+f.top+"px;left: "+f.left+"px;",b.setAttribute("style", |
|||
c))}a.appendChild(b);b.onclick=function(){!0==d._options.exitOnOverlayClick&&(void 0!=d._introExitCallback&&d._introExitCallback.call(d),A.call(d,a))};setTimeout(function(){c+="opacity: "+d._options.overlayOpacity.toString()+";";b.setAttribute("style",c)},10);return!0}function w(){var a=this._targetElement.querySelector(".introjs-hintReference");if(a){var b=a.getAttribute("data-step");a.parentNode.removeChild(a);return b}}function N(){for(var a=0,b=this._introItems.length;a<b;a++){var c=this._introItems[a]; |
|||
O.call(this,c.hintPosition,c.element,c.targetElement)}}function T(a){w.call(this);var b=this._targetElement.querySelector('.introjs-hint[data-step="'+a+'"]');b&&(b.className+=" introjs-hidehint");"undefined"!==typeof this._hintCloseCallback&&this._hintCloseCallback.call(this,a)}function U(){var a=this,b=document.querySelector(".introjs-hints");null==b&&(b=document.createElement("div"),b.className="introjs-hints");for(var c=0,d=this._introItems.length;c<d;c++){var f=this._introItems[c];if(!document.querySelector('.introjs-hint[data-step="'+ |
|||
c+'"]')){var e=document.createElement("a");e.href="javascript:void(0);";(function(b,c,d){b.onclick=function(e){e=e?e:window.event;e.stopPropagation&&e.stopPropagation();null!=e.cancelBubble&&(e.cancelBubble=!0);V.call(a,b,c,d)}})(e,f,c);e.className="introjs-hint";I(f.element)&&(e.className+=" introjs-fixedhint");var g=document.createElement("div");g.className="introjs-hint-dot";var k=document.createElement("div");k.className="introjs-hint-pulse";e.appendChild(g);e.appendChild(k);e.setAttribute("data-step", |
|||
c);f.targetElement=f.element;f.element=e;O.call(this,f.hintPosition,e,f.targetElement);b.appendChild(e)}}document.body.appendChild(b);"undefined"!==typeof this._hintsAddedCallback&&this._hintsAddedCallback.call(this)}function O(a,b,c){c=t.call(this,c);switch(a){default:case "top-left":b.style.left=c.left+"px";b.style.top=c.top+"px";break;case "top-right":b.style.left=c.left+c.width+"px";b.style.top=c.top+"px";break;case "bottom-left":b.style.left=c.left+"px";b.style.top=c.top+c.height+"px";break; |
|||
case "bottom-right":b.style.left=c.left+c.width+"px";b.style.top=c.top+c.height+"px";break;case "bottom-middle":b.style.left=c.left+c.width/2+"px";b.style.top=c.top+c.height+"px";break;case "top-middle":b.style.left=c.left+c.width/2+"px",b.style.top=c.top+"px"}}function V(a,b,c){"undefined"!==typeof this._hintClickCallback&&this._hintClickCallback.call(this,a,b,c);var d=w.call(this);if(parseInt(d,10)!=c){var d=document.createElement("div"),f=document.createElement("div"),e=document.createElement("div"), |
|||
g=document.createElement("div");d.className="introjs-tooltip";d.onclick=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0};f.className="introjs-tooltiptext";var k=document.createElement("p");k.innerHTML=b.hint;b=document.createElement("a");b.className="introjs-button";b.innerHTML=this._options.hintButtonLabel;b.onclick=T.bind(this,c);f.appendChild(k);f.appendChild(b);e.className="introjs-arrow";d.appendChild(e);d.appendChild(f);this._currentStep=a.getAttribute("data-step");g.className= |
|||
"introjs-tooltipReferenceLayer introjs-hintReference";g.setAttribute("data-step",a.getAttribute("data-step"));r.call(this,g);g.appendChild(d);document.body.appendChild(g);F.call(this,a,d,e,null,!0)}}function t(a){var b={};b.width=a.offsetWidth;b.height=a.offsetHeight;for(var c=0,d=0;a&&!isNaN(a.offsetLeft)&&!isNaN(a.offsetTop);)c+=a.offsetLeft,d+=a.offsetTop,a=a.offsetParent;b.top=d;b.left=c;return b}function M(){return 100*(parseInt(this._currentStep+1,10)/this._introItems.length)}var J=function(a){if("object"=== |
|||
typeof a)return new p(a);if("string"===typeof a){if(a=document.querySelector(a))return new p(a);throw Error("There is no element with given selector.");}return new p(document.body)};J.version="2.0";J.fn=p.prototype={clone:function(){return new p(this)},setOption:function(a,b){this._options[a]=b;return this},setOptions:function(a){var b=this._options,c={},d;for(d in b)c[d]=b[d];for(d in a)c[d]=a[d];this._options=c;return this},start:function(){P.call(this,this._targetElement);return this},goToStep:function(a){this._currentStep= |
|||
a-2;"undefined"!==typeof this._introItems&&z.call(this);return this},nextStep:function(){z.call(this);return this},previousStep:function(){D.call(this);return this},exit:function(){A.call(this,this._targetElement);return this},refresh:function(){r.call(this,document.querySelector(".introjs-helperLayer"));r.call(this,document.querySelector(".introjs-tooltipReferenceLayer"));return this},onbeforechange:function(a){if("function"===typeof a)this._introBeforeChangeCallback=a;else throw Error("Provided callback for onbeforechange was not a function"); |
|||
return this},onchange:function(a){if("function"===typeof a)this._introChangeCallback=a;else throw Error("Provided callback for onchange was not a function.");return this},onafterchange:function(a){if("function"===typeof a)this._introAfterChangeCallback=a;else throw Error("Provided callback for onafterchange was not a function");return this},oncomplete:function(a){if("function"===typeof a)this._introCompleteCallback=a;else throw Error("Provided callback for oncomplete was not a function.");return this}, |
|||
onhintsadded:function(a){if("function"===typeof a)this._hintsAddedCallback=a;else throw Error("Provided callback for onhintsadded was not a function.");return this},onhintclick:function(a){if("function"===typeof a)this._hintClickCallback=a;else throw Error("Provided callback for onhintclick was not a function.");return this},onhintclose:function(a){if("function"===typeof a)this._hintCloseCallback=a;else throw Error("Provided callback for onhintclose was not a function.");return this},onexit:function(a){if("function"=== |
|||
typeof a)this._introExitCallback=a;else throw Error("Provided callback for onexit was not a function.");return this},addHints:function(){a:{var a=this._targetElement;this._introItems=[];if(this._options.hints)for(var a=0,b=this._options.hints.length;a<b;a++){var c=y(this._options.hints[a]);"string"===typeof c.element&&(c.element=document.querySelector(c.element));c.hintPosition=c.hintPosition||"top-middle";null!=c.element&&this._introItems.push(c)}else{c=a.querySelectorAll("*[data-hint]");if(1>c.length)break a; |
|||
a=0;for(b=c.length;a<b;a++){var d=c[a];this._introItems.push({element:d,hint:d.getAttribute("data-hint"),hintPosition:d.getAttribute("data-hintPosition")||this._options.hintPosition,tooltipClass:d.getAttribute("data-tooltipClass"),position:d.getAttribute("data-position")||this._options.tooltipPosition})}}U.call(this);document.addEventListener?(document.addEventListener("click",w.bind(this),!1),window.addEventListener("resize",N.bind(this),!0)):document.attachEvent&&(document.attachEvent("onclick", |
|||
w.bind(this)),document.attachEvent("onresize",N.bind(this)))}return this}};return C.introJs=J}); |
@ -1,2 +0,0 @@ |
|||
!function(n){"use strict";function t(n,t){var r=(65535&n)+(65535&t),e=(n>>16)+(t>>16)+(r>>16);return e<<16|65535&r}function r(n,t){return n<<t|n>>>32-t}function e(n,e,o,u,c,f){return t(r(t(t(e,n),t(u,f)),c),o)}function o(n,t,r,o,u,c,f){return e(t&r|~t&o,n,t,u,c,f)}function u(n,t,r,o,u,c,f){return e(t&o|r&~o,n,t,u,c,f)}function c(n,t,r,o,u,c,f){return e(t^r^o,n,t,u,c,f)}function f(n,t,r,o,u,c,f){return e(r^(t|~o),n,t,u,c,f)}function i(n,r){n[r>>5]|=128<<r%32,n[(r+64>>>9<<4)+14]=r;var e,i,a,h,d,l=1732584193,g=-271733879,v=-1732584194,m=271733878;for(e=0;e<n.length;e+=16)i=l,a=g,h=v,d=m,l=o(l,g,v,m,n[e],7,-680876936),m=o(m,l,g,v,n[e+1],12,-389564586),v=o(v,m,l,g,n[e+2],17,606105819),g=o(g,v,m,l,n[e+3],22,-1044525330),l=o(l,g,v,m,n[e+4],7,-176418897),m=o(m,l,g,v,n[e+5],12,1200080426),v=o(v,m,l,g,n[e+6],17,-1473231341),g=o(g,v,m,l,n[e+7],22,-45705983),l=o(l,g,v,m,n[e+8],7,1770035416),m=o(m,l,g,v,n[e+9],12,-1958414417),v=o(v,m,l,g,n[e+10],17,-42063),g=o(g,v,m,l,n[e+11],22,-1990404162),l=o(l,g,v,m,n[e+12],7,1804603682),m=o(m,l,g,v,n[e+13],12,-40341101),v=o(v,m,l,g,n[e+14],17,-1502002290),g=o(g,v,m,l,n[e+15],22,1236535329),l=u(l,g,v,m,n[e+1],5,-165796510),m=u(m,l,g,v,n[e+6],9,-1069501632),v=u(v,m,l,g,n[e+11],14,643717713),g=u(g,v,m,l,n[e],20,-373897302),l=u(l,g,v,m,n[e+5],5,-701558691),m=u(m,l,g,v,n[e+10],9,38016083),v=u(v,m,l,g,n[e+15],14,-660478335),g=u(g,v,m,l,n[e+4],20,-405537848),l=u(l,g,v,m,n[e+9],5,568446438),m=u(m,l,g,v,n[e+14],9,-1019803690),v=u(v,m,l,g,n[e+3],14,-187363961),g=u(g,v,m,l,n[e+8],20,1163531501),l=u(l,g,v,m,n[e+13],5,-1444681467),m=u(m,l,g,v,n[e+2],9,-51403784),v=u(v,m,l,g,n[e+7],14,1735328473),g=u(g,v,m,l,n[e+12],20,-1926607734),l=c(l,g,v,m,n[e+5],4,-378558),m=c(m,l,g,v,n[e+8],11,-2022574463),v=c(v,m,l,g,n[e+11],16,1839030562),g=c(g,v,m,l,n[e+14],23,-35309556),l=c(l,g,v,m,n[e+1],4,-1530992060),m=c(m,l,g,v,n[e+4],11,1272893353),v=c(v,m,l,g,n[e+7],16,-155497632),g=c(g,v,m,l,n[e+10],23,-1094730640),l=c(l,g,v,m,n[e+13],4,681279174),m=c(m,l,g,v,n[e],11,-358537222),v=c(v,m,l,g,n[e+3],16,-722521979),g=c(g,v,m,l,n[e+6],23,76029189),l=c(l,g,v,m,n[e+9],4,-640364487),m=c(m,l,g,v,n[e+12],11,-421815835),v=c(v,m,l,g,n[e+15],16,530742520),g=c(g,v,m,l,n[e+2],23,-995338651),l=f(l,g,v,m,n[e],6,-198630844),m=f(m,l,g,v,n[e+7],10,1126891415),v=f(v,m,l,g,n[e+14],15,-1416354905),g=f(g,v,m,l,n[e+5],21,-57434055),l=f(l,g,v,m,n[e+12],6,1700485571),m=f(m,l,g,v,n[e+3],10,-1894986606),v=f(v,m,l,g,n[e+10],15,-1051523),g=f(g,v,m,l,n[e+1],21,-2054922799),l=f(l,g,v,m,n[e+8],6,1873313359),m=f(m,l,g,v,n[e+15],10,-30611744),v=f(v,m,l,g,n[e+6],15,-1560198380),g=f(g,v,m,l,n[e+13],21,1309151649),l=f(l,g,v,m,n[e+4],6,-145523070),m=f(m,l,g,v,n[e+11],10,-1120210379),v=f(v,m,l,g,n[e+2],15,718787259),g=f(g,v,m,l,n[e+9],21,-343485551),l=t(l,i),g=t(g,a),v=t(v,h),m=t(m,d);return[l,g,v,m]}function a(n){var t,r="",e=32*n.length;for(t=0;t<e;t+=8)r+=String.fromCharCode(n[t>>5]>>>t%32&255);return r}function h(n){var t,r=[];for(r[(n.length>>2)-1]=void 0,t=0;t<r.length;t+=1)r[t]=0;var e=8*n.length;for(t=0;t<e;t+=8)r[t>>5]|=(255&n.charCodeAt(t/8))<<t%32;return r}function d(n){return a(i(h(n),8*n.length))}function l(n,t){var r,e,o=h(n),u=[],c=[];for(u[15]=c[15]=void 0,o.length>16&&(o=i(o,8*n.length)),r=0;r<16;r+=1)u[r]=909522486^o[r],c[r]=1549556828^o[r];return e=i(u.concat(h(t)),512+8*t.length),a(i(c.concat(e),640))}function g(n){var t,r,e="0123456789abcdef",o="";for(r=0;r<n.length;r+=1)t=n.charCodeAt(r),o+=e.charAt(t>>>4&15)+e.charAt(15&t);return o}function v(n){return unescape(encodeURIComponent(n))}function m(n){return d(v(n))}function p(n){return g(m(n))}function s(n,t){return l(v(n),v(t))}function C(n,t){return g(s(n,t))}function A(n,t,r){return t?r?s(t,n):C(t,n):r?m(n):p(n)}"function"==typeof define&&define.amd?define(function(){return A}):"object"==typeof module&&module.exports?module.exports=A:n.md5=A}(this); |
|||
//# sourceMappingURL=md5.min.js.map
|
@ -1,240 +0,0 @@ |
|||
/*! |
|||
* LABELAUTY jQuery Plugin |
|||
* |
|||
* @file: jquery-labelauty.js |
|||
* @author: Francisco Neves (@fntneves) |
|||
* @site: www.francisconeves.com |
|||
* @license: MIT License |
|||
*/ |
|||
|
|||
(function( $ ){ |
|||
|
|||
$.fn.labelauty = function( options ) |
|||
{ |
|||
/* |
|||
* Our default settings |
|||
* Hope you don't need to change anything, with these settings |
|||
*/ |
|||
var settings = $.extend( |
|||
{ |
|||
// Development Mode
|
|||
// This will activate console debug messages
|
|||
development: false, |
|||
|
|||
// Trigger Class
|
|||
// This class will be used to apply styles
|
|||
class: "labelauty", |
|||
|
|||
// Use text label ?
|
|||
// If false, then only an icon represents the input
|
|||
label: true, |
|||
|
|||
// Separator between labels' messages
|
|||
// If you use this separator for anything, choose a new one
|
|||
separator: "|", |
|||
|
|||
// Default Checked Message
|
|||
// This message will be visible when input is checked
|
|||
checked_label: "Checked", |
|||
|
|||
// Default UnChecked Message
|
|||
// This message will be visible when input is unchecked
|
|||
unchecked_label: "Unchecked", |
|||
|
|||
// Force random ID's
|
|||
// Replace original ID's with random ID's,
|
|||
force_random_id: false, |
|||
|
|||
// Minimum Label Width
|
|||
// This value will be used to apply a minimum width to the text labels
|
|||
minimum_width: false, |
|||
|
|||
// Use the greatest width between two text labels ?
|
|||
// If this has a true value, then label width will be the greatest between labels
|
|||
same_width: true |
|||
}, options); |
|||
|
|||
/* |
|||
* Let's create the core function |
|||
* It will try to cover all settings and mistakes of using |
|||
*/ |
|||
return this.each(function() |
|||
{ |
|||
var $object = $( this ); |
|||
var use_labels = true; |
|||
var labels; |
|||
var labels_object; |
|||
var input_id; |
|||
|
|||
// Test if object is a check input
|
|||
// Don't mess me up, come on
|
|||
if( $object.is( ":checkbox" ) === false && $object.is( ":radio" ) === false ) |
|||
return this; |
|||
|
|||
// Add "labelauty" class to all checkboxes
|
|||
// So you can apply some custom styles
|
|||
$object.addClass( settings.class ); |
|||
|
|||
// Get the value of "data-labelauty" attribute
|
|||
// Then, we have the labels for each case (or not, as we will see)
|
|||
labels = $object.attr( "data-labelauty" ); |
|||
|
|||
use_labels = settings.label; |
|||
|
|||
// It's time to check if it's going to the right way
|
|||
// Null values, more labels than expected or no labels will be handled here
|
|||
if( use_labels === true ) |
|||
{ |
|||
if( labels == null || labels.length === 0 ) |
|||
{ |
|||
// If attribute has no label and we want to use, then use the default labels
|
|||
labels_object = new Array(); |
|||
labels_object[0] = settings.unchecked_label; |
|||
labels_object[1] = settings.checked_label; |
|||
} |
|||
else |
|||
{ |
|||
// Ok, ok, it's time to split Checked and Unchecked labels
|
|||
// We split, by the "settings.separator" option
|
|||
labels_object = labels.split( settings.separator ); |
|||
|
|||
// Now, let's check if exist _only_ two labels
|
|||
// If there's more than two, then we do not use labels :(
|
|||
// Else, do some additional tests
|
|||
if( labels_object.length > 2 ) |
|||
{ |
|||
use_labels = false; |
|||
debug( settings.development, "There's more than two labels. LABELAUTY will not use labels." ); |
|||
} |
|||
else |
|||
{ |
|||
// If there's just one label (no split by "settings.separator"), it will be used for both cases
|
|||
// Here, we have the possibility of use the same label for both cases
|
|||
if( labels_object.length === 1 ) |
|||
debug( settings.development, "There's just one label. LABELAUTY will use this one for both cases." ); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/* |
|||
* Let's begin the beauty |
|||
*/ |
|||
|
|||
// Start hiding ugly checkboxes
|
|||
// Obviously, we don't need native checkboxes :O
|
|||
$object.css({ display : "none" }); |
|||
|
|||
// We don't need more data-labelauty attributes!
|
|||
// Ok, ok, it's just for beauty improvement
|
|||
$object.removeAttr( "data-labelauty" ); |
|||
|
|||
// Now, grab checkbox ID Attribute for "label" tag use
|
|||
// If there's no ID Attribute, then generate a new one
|
|||
input_id = $object.attr( "id" ); |
|||
|
|||
if( settings.force_random_id || input_id == null || input_id.trim() === "") |
|||
{ |
|||
var input_id_number = 1 + Math.floor( Math.random() * 1024000 ); |
|||
input_id = "labelauty-" + input_id_number; |
|||
|
|||
// Is there any element with this random ID ?
|
|||
// If exists, then increment until get an unused ID
|
|||
while( $( input_id ).length !== 0 ) |
|||
{ |
|||
input_id_number++; |
|||
input_id = "labelauty-" + input_id_number; |
|||
debug( settings.development, "Holy crap, between 1024 thousand numbers, one raised a conflict. Trying again." ); |
|||
} |
|||
|
|||
$object.attr( "id", input_id ); |
|||
} |
|||
|
|||
// Now, add necessary tags to make this work
|
|||
// Here, we're going to test some control variables and act properly
|
|||
$object.after( create( input_id, labels_object, use_labels ) ); |
|||
|
|||
// Now, add "min-width" to label
|
|||
// Let's say the truth, a fixed width is more beautiful than a variable width
|
|||
if( settings.minimum_width !== false ) |
|||
$object.next( "label[for=" + input_id + "]" ).css({ "min-width": settings.minimum_width }); |
|||
|
|||
// Now, add "min-width" to label
|
|||
// Let's say the truth, a fixed width is more beautiful than a variable width
|
|||
if( settings.same_width != false && settings.label == true ) |
|||
{ |
|||
var label_object = $object.next( "label[for=" + input_id + "]" ); |
|||
var unchecked_width = getRealWidth(label_object.find( "span.labelauty-unchecked" )); |
|||
var checked_width = getRealWidth(label_object.find( "span.labelauty-checked" )); |
|||
|
|||
if( unchecked_width > checked_width ) |
|||
label_object.find( "span.labelauty-checked" ).width( unchecked_width ); |
|||
else |
|||
label_object.find( "span.labelauty-unchecked" ).width( checked_width ); |
|||
} |
|||
}); |
|||
}; |
|||
|
|||
/* |
|||
* Tricky code to work with hidden elements, like tabs. |
|||
* Note: This code is based on jquery.actual plugin. |
|||
* https://github.com/dreamerslab/jquery.actual
|
|||
*/ |
|||
function getRealWidth( element ) |
|||
{ |
|||
var width = 0; |
|||
var $target = element; |
|||
var style = 'position: absolute !important; top: -1000 !important; '; |
|||
|
|||
$target = $target.clone().attr('style', style).appendTo('body'); |
|||
width = $target.width(true); |
|||
$target.remove(); |
|||
|
|||
return width; |
|||
} |
|||
|
|||
function debug( debug, message ) |
|||
{ |
|||
if( debug && window.console && window.console.log ) |
|||
window.console.log( "jQuery-LABELAUTY: " + message ); |
|||
}; |
|||
|
|||
function create( input_id, messages_object, label ) |
|||
{ |
|||
var block; |
|||
var unchecked_message; |
|||
var checked_message; |
|||
|
|||
if( messages_object == null ) |
|||
unchecked_message = checked_message = ""; |
|||
else |
|||
{ |
|||
unchecked_message = messages_object[0]; |
|||
|
|||
// If checked message is null, then put the same text of unchecked message
|
|||
if( messages_object[1] == null ) |
|||
checked_message = unchecked_message; |
|||
else |
|||
checked_message = messages_object[1]; |
|||
} |
|||
|
|||
if( label == true ) |
|||
{ |
|||
block = '<label for="' + input_id + '">' + |
|||
'<span class="labelauty-unchecked-image"></span>' + |
|||
'<span class="labelauty-unchecked">' + unchecked_message + '</span>' + |
|||
'<span class="labelauty-checked-image"></span>' + |
|||
'<span class="labelauty-checked">' + checked_message + '</span>' + |
|||
'</label>'; |
|||
} |
|||
else |
|||
{ |
|||
block = '<label for="' + input_id + '">' + |
|||
'<span class="labelauty-unchecked-image"></span>' + |
|||
'<span class="labelauty-checked-image"></span>' + |
|||
'</label>'; |
|||
} |
|||
|
|||
return block; |
|||
}; |
|||
|
|||
}( jQuery )); |
@ -1,281 +0,0 @@ |
|||
/*! |
|||
* jQuery Placeholder Plugin v2.3.1 |
|||
* https://github.com/mathiasbynens/jquery-placeholder
|
|||
* |
|||
* Copyright 2011, 2015 Mathias Bynens |
|||
* Released under the MIT license |
|||
*/ |
|||
(function(factory) { |
|||
if (typeof define === 'function' && define.amd) { |
|||
// AMD
|
|||
define(['jquery'], factory); |
|||
} else if (typeof module === 'object' && module.exports) { |
|||
factory(require('jquery')); |
|||
} else { |
|||
// Browser globals
|
|||
factory(jQuery); |
|||
} |
|||
}(function($) { |
|||
|
|||
/**** |
|||
* Allows plugin behavior simulation in modern browsers for easier debugging. |
|||
* When setting to true, use attribute "placeholder-x" rather than the usual "placeholder" in your inputs/textareas |
|||
* i.e. <input type="text" placeholder-x="my placeholder text" /> |
|||
*/ |
|||
var debugMode = false; |
|||
|
|||
// Opera Mini v7 doesn't support placeholder although its DOM seems to indicate so
|
|||
var isOperaMini = Object.prototype.toString.call(window.operamini) === '[object OperaMini]'; |
|||
var isInputSupported = 'placeholder' in document.createElement('input') && !isOperaMini && !debugMode; |
|||
var isTextareaSupported = 'placeholder' in document.createElement('textarea') && !isOperaMini && !debugMode; |
|||
var valHooks = $.valHooks; |
|||
var propHooks = $.propHooks; |
|||
var hooks; |
|||
var placeholder; |
|||
var settings = {}; |
|||
|
|||
if (isInputSupported && isTextareaSupported) { |
|||
|
|||
placeholder = $.fn.placeholder = function() { |
|||
return this; |
|||
}; |
|||
|
|||
placeholder.input = true; |
|||
placeholder.textarea = true; |
|||
|
|||
} else { |
|||
|
|||
placeholder = $.fn.placeholder = function(options) { |
|||
|
|||
var defaults = {customClass: 'placeholder'}; |
|||
settings = $.extend({}, defaults, options); |
|||
|
|||
return this.filter((isInputSupported ? 'textarea' : ':input') + '[' + (debugMode ? 'placeholder-x' : 'placeholder') + ']') |
|||
.not('.'+settings.customClass) |
|||
.not(':radio, :checkbox, [type=hidden]') |
|||
.bind({ |
|||
'focus.placeholder': clearPlaceholder, |
|||
'blur.placeholder': setPlaceholder |
|||
}) |
|||
.data('placeholder-enabled', true) |
|||
.trigger('blur.placeholder'); |
|||
}; |
|||
|
|||
placeholder.input = isInputSupported; |
|||
placeholder.textarea = isTextareaSupported; |
|||
|
|||
hooks = { |
|||
'get': function(element) { |
|||
|
|||
var $element = $(element); |
|||
var $passwordInput = $element.data('placeholder-password'); |
|||
|
|||
if ($passwordInput) { |
|||
return $passwordInput[0].value; |
|||
} |
|||
|
|||
return $element.data('placeholder-enabled') && $element.hasClass(settings.customClass) ? '' : element.value; |
|||
}, |
|||
'set': function(element, value) { |
|||
|
|||
var $element = $(element); |
|||
var $replacement; |
|||
var $passwordInput; |
|||
|
|||
if (value !== '') { |
|||
|
|||
$replacement = $element.data('placeholder-textinput'); |
|||
$passwordInput = $element.data('placeholder-password'); |
|||
|
|||
if ($replacement) { |
|||
clearPlaceholder.call($replacement[0], true, value) || (element.value = value); |
|||
$replacement[0].value = value; |
|||
|
|||
} else if ($passwordInput) { |
|||
clearPlaceholder.call(element, true, value) || ($passwordInput[0].value = value); |
|||
element.value = value; |
|||
} |
|||
} |
|||
|
|||
if (!$element.data('placeholder-enabled')) { |
|||
element.value = value; |
|||
return $element; |
|||
} |
|||
|
|||
if (value === '') { |
|||
|
|||
element.value = value; |
|||
|
|||
// Setting the placeholder causes problems if the element continues to have focus.
|
|||
if (element != safeActiveElement()) { |
|||
// We can't use `triggerHandler` here because of dummy text/password inputs :(
|
|||
setPlaceholder.call(element); |
|||
} |
|||
|
|||
} else { |
|||
|
|||
if ($element.hasClass(settings.customClass)) { |
|||
clearPlaceholder.call(element); |
|||
} |
|||
|
|||
element.value = value; |
|||
} |
|||
// `set` can not return `undefined`; see http://jsapi.info/jquery/1.7.1/val#L2363
|
|||
return $element; |
|||
} |
|||
}; |
|||
|
|||
if (!isInputSupported) { |
|||
valHooks.input = hooks; |
|||
propHooks.value = hooks; |
|||
} |
|||
|
|||
if (!isTextareaSupported) { |
|||
valHooks.textarea = hooks; |
|||
propHooks.value = hooks; |
|||
} |
|||
|
|||
$(function() { |
|||
// Look for forms
|
|||
$(document).delegate('form', 'submit.placeholder', function() { |
|||
|
|||
// Clear the placeholder values so they don't get submitted
|
|||
var $inputs = $('.'+settings.customClass, this).each(function() { |
|||
clearPlaceholder.call(this, true, ''); |
|||
}); |
|||
|
|||
setTimeout(function() { |
|||
$inputs.each(setPlaceholder); |
|||
}, 10); |
|||
}); |
|||
}); |
|||
|
|||
// Clear placeholder values upon page reload
|
|||
$(window).bind('beforeunload.placeholder', function() { |
|||
|
|||
var clearPlaceholders = true; |
|||
|
|||
try { |
|||
// Prevent IE javascript:void(0) anchors from causing cleared values
|
|||
if (document.activeElement.toString() === 'javascript:void(0)') { |
|||
clearPlaceholders = false; |
|||
} |
|||
} catch (exception) { } |
|||
|
|||
if (clearPlaceholders) { |
|||
$('.'+settings.customClass).each(function() { |
|||
this.value = ''; |
|||
}); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
function args(elem) { |
|||
// Return an object of element attributes
|
|||
var newAttrs = {}; |
|||
var rinlinejQuery = /^jQuery\d+$/; |
|||
|
|||
$.each(elem.attributes, function(i, attr) { |
|||
if (attr.specified && !rinlinejQuery.test(attr.name)) { |
|||
newAttrs[attr.name] = attr.value; |
|||
} |
|||
}); |
|||
|
|||
return newAttrs; |
|||
} |
|||
|
|||
function clearPlaceholder(event, value) { |
|||
|
|||
var input = this; |
|||
var $input = $(this); |
|||
|
|||
if (input.value === $input.attr((debugMode ? 'placeholder-x' : 'placeholder')) && $input.hasClass(settings.customClass)) { |
|||
|
|||
input.value = ''; |
|||
$input.removeClass(settings.customClass); |
|||
|
|||
if ($input.data('placeholder-password')) { |
|||
|
|||
$input = $input.hide().nextAll('input[type="password"]:first').show().attr('id', $input.removeAttr('id').data('placeholder-id')); |
|||
|
|||
// If `clearPlaceholder` was called from `$.valHooks.input.set`
|
|||
if (event === true) { |
|||
$input[0].value = value; |
|||
|
|||
return value; |
|||
} |
|||
|
|||
$input.focus(); |
|||
|
|||
} else { |
|||
input == safeActiveElement() && input.select(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
function setPlaceholder(event) { |
|||
var $replacement; |
|||
var input = this; |
|||
var $input = $(this); |
|||
var id = input.id; |
|||
|
|||
// If the placeholder is activated, triggering blur event (`$input.trigger('blur')`) should do nothing.
|
|||
if (event && event.type === 'blur' && $input.hasClass(settings.customClass)) { |
|||
return; |
|||
} |
|||
|
|||
if (input.value === '') { |
|||
if (input.type === 'password') { |
|||
if (!$input.data('placeholder-textinput')) { |
|||
|
|||
try { |
|||
$replacement = $input.clone().prop({ 'type': 'text' }); |
|||
} catch(e) { |
|||
$replacement = $('<input>').attr($.extend(args(this), { 'type': 'text' })); |
|||
} |
|||
|
|||
$replacement |
|||
.removeAttr('name') |
|||
.data({ |
|||
'placeholder-enabled': true, |
|||
'placeholder-password': $input, |
|||
'placeholder-id': id |
|||
}) |
|||
.bind('focus.placeholder', clearPlaceholder); |
|||
|
|||
$input |
|||
.data({ |
|||
'placeholder-textinput': $replacement, |
|||
'placeholder-id': id |
|||
}) |
|||
.before($replacement); |
|||
} |
|||
|
|||
input.value = ''; |
|||
$input = $input.removeAttr('id').hide().prevAll('input[type="text"]:first').attr('id', $input.data('placeholder-id')).show(); |
|||
|
|||
} else { |
|||
|
|||
var $passwordInput = $input.data('placeholder-password'); |
|||
|
|||
if ($passwordInput) { |
|||
$passwordInput[0].value = ''; |
|||
$input.attr('id', $input.data('placeholder-id')).show().nextAll('input[type="password"]:last').hide().removeAttr('id'); |
|||
} |
|||
} |
|||
|
|||
$input.addClass(settings.customClass); |
|||
$input[0].value = $input.attr((debugMode ? 'placeholder-x' : 'placeholder')); |
|||
|
|||
} else { |
|||
$input.removeClass(settings.customClass); |
|||
} |
|||
} |
|||
|
|||
function safeActiveElement() { |
|||
// Avoid IE9 `document.activeElement` of death
|
|||
try { |
|||
return document.activeElement; |
|||
} catch (exception) {} |
|||
} |
|||
})); |
@ -1,5 +0,0 @@ |
|||
/* HTML5 Placeholder jQuery Plugin - v2.3.1 |
|||
* Copyright (c)2015 Mathias Bynens |
|||
* 2015-12-16 |
|||
*/ |
|||
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof module&&module.exports?require("jquery"):jQuery)}(function(a){function b(b){var c={},d=/^jQuery\d+$/;return a.each(b.attributes,function(a,b){b.specified&&!d.test(b.name)&&(c[b.name]=b.value)}),c}function c(b,c){var d=this,f=a(this);if(d.value===f.attr(h?"placeholder-x":"placeholder")&&f.hasClass(n.customClass))if(d.value="",f.removeClass(n.customClass),f.data("placeholder-password")){if(f=f.hide().nextAll('input[type="password"]:first').show().attr("id",f.removeAttr("id").data("placeholder-id")),b===!0)return f[0].value=c,c;f.focus()}else d==e()&&d.select()}function d(d){var e,f=this,g=a(this),i=f.id;if(!d||"blur"!==d.type||!g.hasClass(n.customClass))if(""===f.value){if("password"===f.type){if(!g.data("placeholder-textinput")){try{e=g.clone().prop({type:"text"})}catch(j){e=a("<input>").attr(a.extend(b(this),{type:"text"}))}e.removeAttr("name").data({"placeholder-enabled":!0,"placeholder-password":g,"placeholder-id":i}).bind("focus.placeholder",c),g.data({"placeholder-textinput":e,"placeholder-id":i}).before(e)}f.value="",g=g.removeAttr("id").hide().prevAll('input[type="text"]:first').attr("id",g.data("placeholder-id")).show()}else{var k=g.data("placeholder-password");k&&(k[0].value="",g.attr("id",g.data("placeholder-id")).show().nextAll('input[type="password"]:last').hide().removeAttr("id"))}g.addClass(n.customClass),g[0].value=g.attr(h?"placeholder-x":"placeholder")}else g.removeClass(n.customClass)}function e(){try{return document.activeElement}catch(a){}}var f,g,h=!1,i="[object OperaMini]"===Object.prototype.toString.call(window.operamini),j="placeholder"in document.createElement("input")&&!i&&!h,k="placeholder"in document.createElement("textarea")&&!i&&!h,l=a.valHooks,m=a.propHooks,n={};j&&k?(g=a.fn.placeholder=function(){return this},g.input=!0,g.textarea=!0):(g=a.fn.placeholder=function(b){var e={customClass:"placeholder"};return n=a.extend({},e,b),this.filter((j?"textarea":":input")+"["+(h?"placeholder-x":"placeholder")+"]").not("."+n.customClass).not(":radio, :checkbox, [type=hidden]").bind({"focus.placeholder":c,"blur.placeholder":d}).data("placeholder-enabled",!0).trigger("blur.placeholder")},g.input=j,g.textarea=k,f={get:function(b){var c=a(b),d=c.data("placeholder-password");return d?d[0].value:c.data("placeholder-enabled")&&c.hasClass(n.customClass)?"":b.value},set:function(b,f){var g,h,i=a(b);return""!==f&&(g=i.data("placeholder-textinput"),h=i.data("placeholder-password"),g?(c.call(g[0],!0,f)||(b.value=f),g[0].value=f):h&&(c.call(b,!0,f)||(h[0].value=f),b.value=f)),i.data("placeholder-enabled")?(""===f?(b.value=f,b!=e()&&d.call(b)):(i.hasClass(n.customClass)&&c.call(b),b.value=f),i):(b.value=f,i)}},j||(l.input=f,m.value=f),k||(l.textarea=f,m.value=f),a(function(){a(document).delegate("form","submit.placeholder",function(){var b=a("."+n.customClass,this).each(function(){c.call(this,!0,"")});setTimeout(function(){b.each(d)},10)})}),a(window).bind("beforeunload.placeholder",function(){var b=!0;try{"javascript:void(0)"===document.activeElement.toString()&&(b=!1)}catch(c){}b&&a("."+n.customClass).each(function(){this.value=""})}))}); |
@ -1 +0,0 @@ |
|||
{"version":3,"sources":["jquery.placeholder.js"],"names":["factory","define","amd","module","exports","require","jQuery","$","args","elem","newAttrs","rinlinejQuery","each","attributes","i","attr","specified","test","name","value","clearPlaceholder","event","input","this","$input","debugMode","hasClass","settings","customClass","removeClass","data","hide","nextAll","show","removeAttr","focus","safeActiveElement","select","setPlaceholder","$replacement","id","type","clone","prop","e","extend","placeholder-enabled","placeholder-password","placeholder-id","bind","placeholder-textinput","before","prevAll","$passwordInput","addClass","document","activeElement","exception","hooks","placeholder","isOperaMini","Object","prototype","toString","call","window","operamini","isInputSupported","createElement","isTextareaSupported","valHooks","propHooks","fn","textarea","options","defaults","filter","not","focus.placeholder","blur.placeholder","trigger","get","element","$element","set","delegate","$inputs","setTimeout","clearPlaceholders"],"mappings":";;;;CAOC,SAASA,GACgB,kBAAXC,SAAyBA,OAAOC,IAEvCD,QAAQ,UAAWD,GAEnBA,EADyB,gBAAXG,SAAuBA,OAAOC,QACpCC,QAAQ,UAGRC,SAEd,SAASC,GA2JP,QAASC,GAAKC,GAEV,GAAIC,MACAC,EAAgB,aAQpB,OANAJ,GAAEK,KAAKH,EAAKI,WAAY,SAASC,EAAGC,GAC5BA,EAAKC,YAAcL,EAAcM,KAAKF,EAAKG,QAC3CR,EAASK,EAAKG,MAAQH,EAAKI,SAI5BT,EAGX,QAASU,GAAiBC,EAAOF,GAE7B,GAAIG,GAAQC,KACRC,EAASjB,EAAEgB,KAEf,IAAID,EAAMH,QAAUK,EAAOT,KAAMU,EAAY,gBAAkB,gBAAmBD,EAAOE,SAASC,EAASC,aAKvG,GAHAN,EAAMH,MAAQ,GACdK,EAAOK,YAAYF,EAASC,aAExBJ,EAAOM,KAAK,wBAAyB,CAKrC,GAHAN,EAASA,EAAOO,OAAOC,QAAQ,gCAAgCC,OAAOlB,KAAK,KAAMS,EAAOU,WAAW,MAAMJ,KAAK,mBAG1GT,KAAU,EAGV,MAFAG,GAAO,GAAGL,MAAQA,EAEXA,CAGXK,GAAOW,YAGPb,IAASc,KAAuBd,EAAMe,SAKlD,QAASC,GAAejB,GACpB,GAAIkB,GACAjB,EAAQC,KACRC,EAASjB,EAAEgB,MACXiB,EAAKlB,EAAMkB,EAGf,KAAInB,GAAwB,SAAfA,EAAMoB,OAAmBjB,EAAOE,SAASC,EAASC,aAI/D,GAAoB,KAAhBN,EAAMH,MAAc,CACpB,GAAmB,aAAfG,EAAMmB,KAAqB,CAC3B,IAAKjB,EAAOM,KAAK,yBAA0B,CAEvC,IACIS,EAAef,EAAOkB,QAAQC,MAAOF,KAAQ,SAC/C,MAAMG,GACJL,EAAehC,EAAE,WAAWQ,KAAKR,EAAEsC,OAAOrC,EAAKe,OAASkB,KAAQ,UAGpEF,EACKL,WAAW,QACXJ,MACGgB,uBAAuB,EACvBC,uBAAwBvB,EACxBwB,iBAAkBR,IAErBS,KAAK,oBAAqB7B,GAE/BI,EACKM,MACGoB,wBAAyBX,EACzBS,iBAAkBR,IAErBW,OAAOZ,GAGhBjB,EAAMH,MAAQ,GACdK,EAASA,EAAOU,WAAW,MAAMH,OAAOqB,QAAQ,4BAA4BrC,KAAK,KAAMS,EAAOM,KAAK,mBAAmBG,WAEnH,CAEH,GAAIoB,GAAiB7B,EAAOM,KAAK,uBAE7BuB,KACAA,EAAe,GAAGlC,MAAQ,GAC1BK,EAAOT,KAAK,KAAMS,EAAOM,KAAK,mBAAmBG,OAAOD,QAAQ,+BAA+BD,OAAOG,WAAW,OAIzHV,EAAO8B,SAAS3B,EAASC,aACzBJ,EAAO,GAAGL,MAAQK,EAAOT,KAAMU,EAAY,gBAAkB,mBAG7DD,GAAOK,YAAYF,EAASC,aAIpC,QAASQ,KAEL,IACI,MAAOmB,UAASC,cAClB,MAAOC,KA9Pb,GAQIC,GACAC,EATAlC,GAAY,EAGZmC,EAAmE,uBAArDC,OAAOC,UAAUC,SAASC,KAAKC,OAAOC,WACpDC,EAAmB,eAAiBZ,UAASa,cAAc,WAAaR,IAAgBnC,EACxF4C,EAAsB,eAAiBd,UAASa,cAAc,cAAgBR,IAAgBnC,EAC9F6C,EAAW/D,EAAE+D,SACbC,EAAYhE,EAAEgE,UAGd5C,IAEAwC,IAAoBE,GAEpBV,EAAcpD,EAAEiE,GAAGb,YAAc,WAC7B,MAAOpC,OAGXoC,EAAYrC,OAAQ,EACpBqC,EAAYc,UAAW,IAIvBd,EAAcpD,EAAEiE,GAAGb,YAAc,SAASe,GAEtC,GAAIC,IAAY/C,YAAa,cAG7B,OAFAD,GAAWpB,EAAEsC,UAAW8B,EAAUD,GAE3BnD,KAAKqD,QAAQT,EAAmB,WAAa,UAAY,KAAO1C,EAAY,gBAAkB,eAAiB,KACjHoD,IAAI,IAAIlD,EAASC,aACjBiD,IAAI,oCACJ5B,MACG6B,oBAAqB1D,EACrB2D,mBAAoBzC,IAEvBR,KAAK,uBAAuB,GAC5BkD,QAAQ,qBAGjBrB,EAAYrC,MAAQ6C,EACpBR,EAAYc,SAAWJ,EAEvBX,GACIuB,IAAO,SAASC,GAEZ,GAAIC,GAAW5E,EAAE2E,GACb7B,EAAiB8B,EAASrD,KAAK,uBAEnC,OAAIuB,GACOA,EAAe,GAAGlC,MAGtBgE,EAASrD,KAAK,wBAA0BqD,EAASzD,SAASC,EAASC,aAAe,GAAKsD,EAAQ/D,OAE1GiE,IAAO,SAASF,EAAS/D,GAErB,GACIoB,GACAc,EAFA8B,EAAW5E,EAAE2E,EAmBjB,OAfc,KAAV/D,IAEAoB,EAAe4C,EAASrD,KAAK,yBAC7BuB,EAAiB8B,EAASrD,KAAK,wBAE3BS,GACAnB,EAAiB4C,KAAKzB,EAAa,IAAI,EAAMpB,KAAW+D,EAAQ/D,MAAQA,GACxEoB,EAAa,GAAGpB,MAAQA,GAEjBkC,IACPjC,EAAiB4C,KAAKkB,GAAS,EAAM/D,KAAWkC,EAAe,GAAGlC,MAAQA,GAC1E+D,EAAQ/D,MAAQA,IAInBgE,EAASrD,KAAK,wBAKL,KAAVX,GAEA+D,EAAQ/D,MAAQA,EAGZ+D,GAAW9C,KAEXE,EAAe0B,KAAKkB,KAKpBC,EAASzD,SAASC,EAASC,cAC3BR,EAAiB4C,KAAKkB,GAG1BA,EAAQ/D,MAAQA,GAGbgE,IAvBHD,EAAQ/D,MAAQA,EACTgE,KA0BdhB,IACDG,EAAShD,MAAQoC,EACjBa,EAAUpD,MAAQuC,GAGjBW,IACDC,EAASG,SAAWf,EACpBa,EAAUpD,MAAQuC,GAGtBnD,EAAE,WAEEA,EAAEgD,UAAU8B,SAAS,OAAQ,qBAAsB,WAG/C,GAAIC,GAAU/E,EAAE,IAAIoB,EAASC,YAAaL,MAAMX,KAAK,WACjDQ,EAAiB4C,KAAKzC,MAAM,EAAM,KAGtCgE,YAAW,WACPD,EAAQ1E,KAAK0B,IACd,QAKX/B,EAAE0D,QAAQhB,KAAK,2BAA4B,WAEvC,GAAIuC,IAAoB,CAExB,KAE8C,uBAAtCjC,SAASC,cAAcO,aACvByB,GAAoB,GAE1B,MAAO/B,IAEL+B,GACAjF,EAAE,IAAIoB,EAASC,aAAahB,KAAK,WAC7BW,KAAKJ,MAAQ","file":"jquery.placeholder.min.js"} |
@ -1,20 +0,0 @@ |
|||
Copyright (c) 2011 Jerome Etienne, http://jetienne.com |
|||
|
|||
Permission is hereby granted, free of charge, to any person obtaining |
|||
a copy of this software and associated documentation files (the |
|||
"Software"), to deal in the Software without restriction, including |
|||
without limitation the rights to use, copy, modify, merge, publish, |
|||
distribute, sublicense, and/or sell copies of the Software, and to |
|||
permit persons to whom the Software is furnished to do so, subject to |
|||
the following conditions: |
|||
|
|||
The above copyright notice and this permission notice shall be |
|||
included in all copies or substantial portions of the Software. |
|||
|
|||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
|||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
|||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
|||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
|||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
|||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
@ -1,28 +0,0 @@ |
|||
(function(r){r.fn.qrcode=function(h){var s;function u(a){this.mode=s;this.data=a}function o(a,c){this.typeNumber=a;this.errorCorrectLevel=c;this.modules=null;this.moduleCount=0;this.dataCache=null;this.dataList=[]}function q(a,c){if(void 0==a.length)throw Error(a.length+"/"+c);for(var d=0;d<a.length&&0==a[d];)d++;this.num=Array(a.length-d+c);for(var b=0;b<a.length-d;b++)this.num[b]=a[b+d]}function p(a,c){this.totalCount=a;this.dataCount=c}function t(){this.buffer=[];this.length=0}u.prototype={getLength:function(){return this.data.length}, |
|||
write:function(a){for(var c=0;c<this.data.length;c++)a.put(this.data.charCodeAt(c),8)}};o.prototype={addData:function(a){this.dataList.push(new u(a));this.dataCache=null},isDark:function(a,c){if(0>a||this.moduleCount<=a||0>c||this.moduleCount<=c)throw Error(a+","+c);return this.modules[a][c]},getModuleCount:function(){return this.moduleCount},make:function(){if(1>this.typeNumber){for(var a=1,a=1;40>a;a++){for(var c=p.getRSBlocks(a,this.errorCorrectLevel),d=new t,b=0,e=0;e<c.length;e++)b+=c[e].dataCount; |
|||
for(e=0;e<this.dataList.length;e++)c=this.dataList[e],d.put(c.mode,4),d.put(c.getLength(),j.getLengthInBits(c.mode,a)),c.write(d);if(d.getLengthInBits()<=8*b)break}this.typeNumber=a}this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(a,c){this.moduleCount=4*this.typeNumber+17;this.modules=Array(this.moduleCount);for(var d=0;d<this.moduleCount;d++){this.modules[d]=Array(this.moduleCount);for(var b=0;b<this.moduleCount;b++)this.modules[d][b]=null}this.setupPositionProbePattern(0,0);this.setupPositionProbePattern(this.moduleCount- |
|||
7,0);this.setupPositionProbePattern(0,this.moduleCount-7);this.setupPositionAdjustPattern();this.setupTimingPattern();this.setupTypeInfo(a,c);7<=this.typeNumber&&this.setupTypeNumber(a);null==this.dataCache&&(this.dataCache=o.createData(this.typeNumber,this.errorCorrectLevel,this.dataList));this.mapData(this.dataCache,c)},setupPositionProbePattern:function(a,c){for(var d=-1;7>=d;d++)if(!(-1>=a+d||this.moduleCount<=a+d))for(var b=-1;7>=b;b++)-1>=c+b||this.moduleCount<=c+b||(this.modules[a+d][c+b]= |
|||
0<=d&&6>=d&&(0==b||6==b)||0<=b&&6>=b&&(0==d||6==d)||2<=d&&4>=d&&2<=b&&4>=b?!0:!1)},getBestMaskPattern:function(){for(var a=0,c=0,d=0;8>d;d++){this.makeImpl(!0,d);var b=j.getLostPoint(this);if(0==d||a>b)a=b,c=d}return c},createMovieClip:function(a,c,d){a=a.createEmptyMovieClip(c,d);this.make();for(c=0;c<this.modules.length;c++)for(var d=1*c,b=0;b<this.modules[c].length;b++){var e=1*b;this.modules[c][b]&&(a.beginFill(0,100),a.moveTo(e,d),a.lineTo(e+1,d),a.lineTo(e+1,d+1),a.lineTo(e,d+1),a.endFill())}return a}, |
|||
setupTimingPattern:function(){for(var a=8;a<this.moduleCount-8;a++)null==this.modules[a][6]&&(this.modules[a][6]=0==a%2);for(a=8;a<this.moduleCount-8;a++)null==this.modules[6][a]&&(this.modules[6][a]=0==a%2)},setupPositionAdjustPattern:function(){for(var a=j.getPatternPosition(this.typeNumber),c=0;c<a.length;c++)for(var d=0;d<a.length;d++){var b=a[c],e=a[d];if(null==this.modules[b][e])for(var f=-2;2>=f;f++)for(var i=-2;2>=i;i++)this.modules[b+f][e+i]=-2==f||2==f||-2==i||2==i||0==f&&0==i?!0:!1}},setupTypeNumber:function(a){for(var c= |
|||
j.getBCHTypeNumber(this.typeNumber),d=0;18>d;d++){var b=!a&&1==(c>>d&1);this.modules[Math.floor(d/3)][d%3+this.moduleCount-8-3]=b}for(d=0;18>d;d++)b=!a&&1==(c>>d&1),this.modules[d%3+this.moduleCount-8-3][Math.floor(d/3)]=b},setupTypeInfo:function(a,c){for(var d=j.getBCHTypeInfo(this.errorCorrectLevel<<3|c),b=0;15>b;b++){var e=!a&&1==(d>>b&1);6>b?this.modules[b][8]=e:8>b?this.modules[b+1][8]=e:this.modules[this.moduleCount-15+b][8]=e}for(b=0;15>b;b++)e=!a&&1==(d>>b&1),8>b?this.modules[8][this.moduleCount- |
|||
b-1]=e:9>b?this.modules[8][15-b-1+1]=e:this.modules[8][15-b-1]=e;this.modules[this.moduleCount-8][8]=!a},mapData:function(a,c){for(var d=-1,b=this.moduleCount-1,e=7,f=0,i=this.moduleCount-1;0<i;i-=2)for(6==i&&i--;;){for(var g=0;2>g;g++)if(null==this.modules[b][i-g]){var n=!1;f<a.length&&(n=1==(a[f]>>>e&1));j.getMask(c,b,i-g)&&(n=!n);this.modules[b][i-g]=n;e--; -1==e&&(f++,e=7)}b+=d;if(0>b||this.moduleCount<=b){b-=d;d=-d;break}}}};o.PAD0=236;o.PAD1=17;o.createData=function(a,c,d){for(var c=p.getRSBlocks(a, |
|||
c),b=new t,e=0;e<d.length;e++){var f=d[e];b.put(f.mode,4);b.put(f.getLength(),j.getLengthInBits(f.mode,a));f.write(b)}for(e=a=0;e<c.length;e++)a+=c[e].dataCount;if(b.getLengthInBits()>8*a)throw Error("code length overflow. ("+b.getLengthInBits()+">"+8*a+")");for(b.getLengthInBits()+4<=8*a&&b.put(0,4);0!=b.getLengthInBits()%8;)b.putBit(!1);for(;!(b.getLengthInBits()>=8*a);){b.put(o.PAD0,8);if(b.getLengthInBits()>=8*a)break;b.put(o.PAD1,8)}return o.createBytes(b,c)};o.createBytes=function(a,c){for(var d= |
|||
0,b=0,e=0,f=Array(c.length),i=Array(c.length),g=0;g<c.length;g++){var n=c[g].dataCount,h=c[g].totalCount-n,b=Math.max(b,n),e=Math.max(e,h);f[g]=Array(n);for(var k=0;k<f[g].length;k++)f[g][k]=255&a.buffer[k+d];d+=n;k=j.getErrorCorrectPolynomial(h);n=(new q(f[g],k.getLength()-1)).mod(k);i[g]=Array(k.getLength()-1);for(k=0;k<i[g].length;k++)h=k+n.getLength()-i[g].length,i[g][k]=0<=h?n.get(h):0}for(k=g=0;k<c.length;k++)g+=c[k].totalCount;d=Array(g);for(k=n=0;k<b;k++)for(g=0;g<c.length;g++)k<f[g].length&& |
|||
(d[n++]=f[g][k]);for(k=0;k<e;k++)for(g=0;g<c.length;g++)k<i[g].length&&(d[n++]=i[g][k]);return d};s=4;for(var j={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52, |
|||
78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(a){for(var c=a<<10;0<=j.getBCHDigit(c)-j.getBCHDigit(j.G15);)c^=j.G15<<j.getBCHDigit(c)-j.getBCHDigit(j.G15);return(a<<10|c)^j.G15_MASK},getBCHTypeNumber:function(a){for(var c=a<<12;0<=j.getBCHDigit(c)- |
|||
j.getBCHDigit(j.G18);)c^=j.G18<<j.getBCHDigit(c)-j.getBCHDigit(j.G18);return a<<12|c},getBCHDigit:function(a){for(var c=0;0!=a;)c++,a>>>=1;return c},getPatternPosition:function(a){return j.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,c,d){switch(a){case 0:return 0==(c+d)%2;case 1:return 0==c%2;case 2:return 0==d%3;case 3:return 0==(c+d)%3;case 4:return 0==(Math.floor(c/2)+Math.floor(d/3))%2;case 5:return 0==c*d%2+c*d%3;case 6:return 0==(c*d%2+c*d%3)%2;case 7:return 0==(c*d%3+(c+d)%2)%2;default:throw Error("bad maskPattern:"+ |
|||
a);}},getErrorCorrectPolynomial:function(a){for(var c=new q([1],0),d=0;d<a;d++)c=c.multiply(new q([1,l.gexp(d)],0));return c},getLengthInBits:function(a,c){if(1<=c&&10>c)switch(a){case 1:return 10;case 2:return 9;case s:return 8;case 8:return 8;default:throw Error("mode:"+a);}else if(27>c)switch(a){case 1:return 12;case 2:return 11;case s:return 16;case 8:return 10;default:throw Error("mode:"+a);}else if(41>c)switch(a){case 1:return 14;case 2:return 13;case s:return 16;case 8:return 12;default:throw Error("mode:"+ |
|||
a);}else throw Error("type:"+c);},getLostPoint:function(a){for(var c=a.getModuleCount(),d=0,b=0;b<c;b++)for(var e=0;e<c;e++){for(var f=0,i=a.isDark(b,e),g=-1;1>=g;g++)if(!(0>b+g||c<=b+g))for(var h=-1;1>=h;h++)0>e+h||c<=e+h||0==g&&0==h||i==a.isDark(b+g,e+h)&&f++;5<f&&(d+=3+f-5)}for(b=0;b<c-1;b++)for(e=0;e<c-1;e++)if(f=0,a.isDark(b,e)&&f++,a.isDark(b+1,e)&&f++,a.isDark(b,e+1)&&f++,a.isDark(b+1,e+1)&&f++,0==f||4==f)d+=3;for(b=0;b<c;b++)for(e=0;e<c-6;e++)a.isDark(b,e)&&!a.isDark(b,e+1)&&a.isDark(b,e+ |
|||
2)&&a.isDark(b,e+3)&&a.isDark(b,e+4)&&!a.isDark(b,e+5)&&a.isDark(b,e+6)&&(d+=40);for(e=0;e<c;e++)for(b=0;b<c-6;b++)a.isDark(b,e)&&!a.isDark(b+1,e)&&a.isDark(b+2,e)&&a.isDark(b+3,e)&&a.isDark(b+4,e)&&!a.isDark(b+5,e)&&a.isDark(b+6,e)&&(d+=40);for(e=f=0;e<c;e++)for(b=0;b<c;b++)a.isDark(b,e)&&f++;a=Math.abs(100*f/c/c-50)/5;return d+10*a}},l={glog:function(a){if(1>a)throw Error("glog("+a+")");return l.LOG_TABLE[a]},gexp:function(a){for(;0>a;)a+=255;for(;256<=a;)a-=255;return l.EXP_TABLE[a]},EXP_TABLE:Array(256), |
|||
LOG_TABLE:Array(256)},m=0;8>m;m++)l.EXP_TABLE[m]=1<<m;for(m=8;256>m;m++)l.EXP_TABLE[m]=l.EXP_TABLE[m-4]^l.EXP_TABLE[m-5]^l.EXP_TABLE[m-6]^l.EXP_TABLE[m-8];for(m=0;255>m;m++)l.LOG_TABLE[l.EXP_TABLE[m]]=m;q.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var c=Array(this.getLength()+a.getLength()-1),d=0;d<this.getLength();d++)for(var b=0;b<a.getLength();b++)c[d+b]^=l.gexp(l.glog(this.get(d))+l.glog(a.get(b)));return new q(c,0)},mod:function(a){if(0> |
|||
this.getLength()-a.getLength())return this;for(var c=l.glog(this.get(0))-l.glog(a.get(0)),d=Array(this.getLength()),b=0;b<this.getLength();b++)d[b]=this.get(b);for(b=0;b<a.getLength();b++)d[b]^=l.gexp(l.glog(a.get(b))+c);return(new q(d,0)).mod(a)}};p.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27], |
|||
[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146, |
|||
116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15, |
|||
43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45, |
|||
3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19, |
|||
55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10, |
|||
45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];p.getRSBlocks=function(a,c){var d=p.getRsBlockTable(a,c);if(void 0==d)throw Error("bad rs block @ typeNumber:"+a+"/errorCorrectLevel:"+c);for(var b=d.length/3,e=[],f=0;f<b;f++)for(var h=d[3*f+0],g=d[3*f+1],j=d[3*f+2],l=0;l<h;l++)e.push(new p(g,j));return e};p.getRsBlockTable=function(a,c){switch(c){case 1:return p.RS_BLOCK_TABLE[4*(a-1)+0];case 0:return p.RS_BLOCK_TABLE[4*(a-1)+1];case 3:return p.RS_BLOCK_TABLE[4* |
|||
(a-1)+2];case 2:return p.RS_BLOCK_TABLE[4*(a-1)+3]}};t.prototype={get:function(a){return 1==(this.buffer[Math.floor(a/8)]>>>7-a%8&1)},put:function(a,c){for(var d=0;d<c;d++)this.putBit(1==(a>>>c-d-1&1))},getLengthInBits:function(){return this.length},putBit:function(a){var c=Math.floor(this.length/8);this.buffer.length<=c&&this.buffer.push(0);a&&(this.buffer[c]|=128>>>this.length%8);this.length++}};"string"===typeof h&&(h={text:h});h=r.extend({},{render:"canvas",width:256,height:256,typeNumber:-1, |
|||
correctLevel:2,background:"#ffffff",foreground:"#000000"},h);return this.each(function(){var a;if("canvas"==h.render){a=new o(h.typeNumber,h.correctLevel);a.addData(h.text);a.make();var c=document.createElement("canvas");c.width=h.width;c.height=h.height;for(var d=c.getContext("2d"),b=h.width/a.getModuleCount(),e=h.height/a.getModuleCount(),f=0;f<a.getModuleCount();f++)for(var i=0;i<a.getModuleCount();i++){d.fillStyle=a.isDark(f,i)?h.foreground:h.background;var g=Math.ceil((i+1)*b)-Math.floor(i*b), |
|||
j=Math.ceil((f+1)*b)-Math.floor(f*b);d.fillRect(Math.round(i*b),Math.round(f*e),g,j)}}else{a=new o(h.typeNumber,h.correctLevel);a.addData(h.text);a.make();c=r("<table></table>").css("width",h.width+"px").css("height",h.height+"px").css("border","0px").css("border-collapse","collapse").css("background-color",h.background);d=h.width/a.getModuleCount();b=h.height/a.getModuleCount();for(e=0;e<a.getModuleCount();e++){f=r("<tr></tr>").css("height",b+"px").appendTo(c);for(i=0;i<a.getModuleCount();i++)r("<td></td>").css("width", |
|||
d+"px").css("background-color",a.isDark(e,i)?h.foreground:h.background).appendTo(f)}}a=c;jQuery(a).appendTo(this)})}})(jQuery); |
@ -1,781 +0,0 @@ |
|||
/** |
|||
* jQuery CSS Customizable Scrollbar |
|||
* |
|||
* Copyright 2015, Yuriy Khabarov |
|||
* Dual licensed under the MIT or GPL Version 2 licenses. |
|||
* |
|||
* If you found bug, please contact me via email <13real008@gmail.com> |
|||
* |
|||
* @author Yuriy Khabarov aka Gromo |
|||
* @version 0.2.10 |
|||
* @url https://github.com/gromo/jquery.scrollbar/
|
|||
* |
|||
*/ |
|||
; |
|||
(function (root, factory) { |
|||
if (typeof define === 'function' && define.amd) { |
|||
define(['jquery'], factory); |
|||
} else { |
|||
factory(root.jQuery); |
|||
} |
|||
}(this, function ($) { |
|||
'use strict'; |
|||
|
|||
// init flags & variables
|
|||
var debug = false; |
|||
|
|||
var browser = { |
|||
data: { |
|||
index: 0, |
|||
name: 'scrollbar' |
|||
}, |
|||
macosx: /mac/i.test(navigator.platform), |
|||
mobile: /android|webos|iphone|ipad|ipod|blackberry/i.test(navigator.userAgent), |
|||
overlay: null, |
|||
scroll: null, |
|||
scrolls: [], |
|||
webkit: /webkit/i.test(navigator.userAgent) && !/edge\/\d+/i.test(navigator.userAgent) |
|||
}; |
|||
|
|||
browser.scrolls.add = function (instance) { |
|||
this.remove(instance).push(instance); |
|||
}; |
|||
browser.scrolls.remove = function (instance) { |
|||
while ($.inArray(instance, this) >= 0) { |
|||
this.splice($.inArray(instance, this), 1); |
|||
} |
|||
return this; |
|||
}; |
|||
|
|||
var defaults = { |
|||
"autoScrollSize": true, // automatically calculate scrollsize
|
|||
"autoUpdate": true, // update scrollbar if content/container size changed
|
|||
"debug": false, // debug mode
|
|||
"disableBodyScroll": false, // disable body scroll if mouse over container
|
|||
"duration": 200, // scroll animate duration in ms
|
|||
"ignoreMobile": false, // ignore mobile devices
|
|||
"ignoreOverlay": false, // ignore browsers with overlay scrollbars (mobile, MacOS)
|
|||
"scrollStep": 30, // scroll step for scrollbar arrows
|
|||
"showArrows": false, // add class to show arrows
|
|||
"stepScrolling": true, // when scrolling to scrollbar mousedown position
|
|||
|
|||
"scrollx": null, // horizontal scroll element
|
|||
"scrolly": null, // vertical scroll element
|
|||
|
|||
"onDestroy": null, // callback function on destroy,
|
|||
"onInit": null, // callback function on first initialization
|
|||
"onScroll": null, // callback function on content scrolling
|
|||
"onUpdate": null // callback function on init/resize (before scrollbar size calculation)
|
|||
}; |
|||
|
|||
|
|||
var BaseScrollbar = function (container) { |
|||
|
|||
if (!browser.scroll) { |
|||
browser.overlay = isScrollOverlaysContent(); |
|||
browser.scroll = getBrowserScrollSize(); |
|||
updateScrollbars(); |
|||
|
|||
$(window).resize(function () { |
|||
var forceUpdate = false; |
|||
if (browser.scroll && (browser.scroll.height || browser.scroll.width)) { |
|||
var scroll = getBrowserScrollSize(); |
|||
if (scroll.height !== browser.scroll.height || scroll.width !== browser.scroll.width) { |
|||
browser.scroll = scroll; |
|||
forceUpdate = true; // handle page zoom
|
|||
} |
|||
} |
|||
updateScrollbars(forceUpdate); |
|||
}); |
|||
} |
|||
|
|||
this.container = container; |
|||
this.namespace = '.scrollbar_' + browser.data.index++; |
|||
this.options = $.extend({}, defaults, window.jQueryScrollbarOptions || {}); |
|||
this.scrollTo = null; |
|||
this.scrollx = {}; |
|||
this.scrolly = {}; |
|||
|
|||
container.data(browser.data.name, this); |
|||
browser.scrolls.add(this); |
|||
}; |
|||
|
|||
BaseScrollbar.prototype = { |
|||
|
|||
destroy: function () { |
|||
|
|||
if (!this.wrapper) { |
|||
return; |
|||
} |
|||
|
|||
this.container.removeData(browser.data.name); |
|||
browser.scrolls.remove(this); |
|||
|
|||
// init variables
|
|||
var scrollLeft = this.container.scrollLeft(); |
|||
var scrollTop = this.container.scrollTop(); |
|||
|
|||
this.container.insertBefore(this.wrapper).css({ |
|||
"height": "", |
|||
"margin": "", |
|||
"max-height": "" |
|||
}) |
|||
.removeClass('scroll-content scroll-scrollx_visible scroll-scrolly_visible') |
|||
.off(this.namespace) |
|||
.scrollLeft(scrollLeft) |
|||
.scrollTop(scrollTop); |
|||
|
|||
this.scrollx.scroll.removeClass('scroll-scrollx_visible').find('div').andSelf().off(this.namespace); |
|||
this.scrolly.scroll.removeClass('scroll-scrolly_visible').find('div').andSelf().off(this.namespace); |
|||
|
|||
this.wrapper.remove(); |
|||
|
|||
$(document).add('body').off(this.namespace); |
|||
|
|||
if ($.isFunction(this.options.onDestroy)){ |
|||
this.options.onDestroy.apply(this, [this.container]); |
|||
} |
|||
}, |
|||
init: function (options) { |
|||
|
|||
// init variables
|
|||
var S = this, |
|||
c = this.container, |
|||
cw = this.containerWrapper || c, |
|||
namespace = this.namespace, |
|||
o = $.extend(this.options, options || {}), |
|||
s = {x: this.scrollx, y: this.scrolly}, |
|||
w = this.wrapper; |
|||
|
|||
var initScroll = { |
|||
"scrollLeft": c.scrollLeft(), |
|||
"scrollTop": c.scrollTop() |
|||
}; |
|||
|
|||
// do not init if in ignorable browser
|
|||
if ((browser.mobile && o.ignoreMobile) |
|||
|| (browser.overlay && o.ignoreOverlay) |
|||
|| (browser.macosx && !browser.webkit) // still required to ignore nonWebKit browsers on Mac
|
|||
) { |
|||
return false; |
|||
} |
|||
|
|||
// init scroll container
|
|||
if (!w) { |
|||
this.wrapper = w = $('<div>').addClass('scroll-wrapper').addClass(c.attr('class')) |
|||
.css('position', c.css('position') == 'absolute' ? 'absolute' : 'relative') |
|||
.insertBefore(c).append(c); |
|||
|
|||
if (c.is('textarea')) { |
|||
this.containerWrapper = cw = $('<div>').insertBefore(c).append(c); |
|||
w.addClass('scroll-textarea'); |
|||
} |
|||
|
|||
cw.addClass('scroll-content').css({ |
|||
"height": "auto", |
|||
"margin-bottom": browser.scroll.height * -1 + 'px', |
|||
"margin-right": browser.scroll.width * -1 + 'px', |
|||
"max-height": "" |
|||
}); |
|||
|
|||
c.on('scroll' + namespace, function (event) { |
|||
if ($.isFunction(o.onScroll)) { |
|||
o.onScroll.call(S, { |
|||
"maxScroll": s.y.maxScrollOffset, |
|||
"scroll": c.scrollTop(), |
|||
"size": s.y.size, |
|||
"visible": s.y.visible |
|||
}, { |
|||
"maxScroll": s.x.maxScrollOffset, |
|||
"scroll": c.scrollLeft(), |
|||
"size": s.x.size, |
|||
"visible": s.x.visible |
|||
}); |
|||
} |
|||
s.x.isVisible && s.x.scroll.bar.css('left', c.scrollLeft() * s.x.kx + 'px'); |
|||
s.y.isVisible && s.y.scroll.bar.css('top', c.scrollTop() * s.y.kx + 'px'); |
|||
}); |
|||
|
|||
/* prevent native scrollbars to be visible on #anchor click */ |
|||
w.on('scroll' + namespace, function () { |
|||
w.scrollTop(0).scrollLeft(0); |
|||
}); |
|||
|
|||
if (o.disableBodyScroll) { |
|||
var handleMouseScroll = function (event) { |
|||
isVerticalScroll(event) ? |
|||
s.y.isVisible && s.y.mousewheel(event) : |
|||
s.x.isVisible && s.x.mousewheel(event); |
|||
}; |
|||
w.on('MozMousePixelScroll' + namespace, handleMouseScroll); |
|||
w.on('mousewheel' + namespace, handleMouseScroll); |
|||
|
|||
if (browser.mobile) { |
|||
w.on('touchstart' + namespace, function (event) { |
|||
var touch = event.originalEvent.touches && event.originalEvent.touches[0] || event; |
|||
var originalTouch = { |
|||
"pageX": touch.pageX, |
|||
"pageY": touch.pageY |
|||
}; |
|||
var originalScroll = { |
|||
"left": c.scrollLeft(), |
|||
"top": c.scrollTop() |
|||
}; |
|||
$(document).on('touchmove' + namespace, function (event) { |
|||
var touch = event.originalEvent.targetTouches && event.originalEvent.targetTouches[0] || event; |
|||
c.scrollLeft(originalScroll.left + originalTouch.pageX - touch.pageX); |
|||
c.scrollTop(originalScroll.top + originalTouch.pageY - touch.pageY); |
|||
event.preventDefault(); |
|||
}); |
|||
$(document).on('touchend' + namespace, function () { |
|||
$(document).off(namespace); |
|||
}); |
|||
}); |
|||
} |
|||
} |
|||
if ($.isFunction(o.onInit)){ |
|||
o.onInit.apply(this, [c]); |
|||
} |
|||
} else { |
|||
cw.css({ |
|||
"height": "auto", |
|||
"margin-bottom": browser.scroll.height * -1 + 'px', |
|||
"margin-right": browser.scroll.width * -1 + 'px', |
|||
"max-height": "" |
|||
}); |
|||
} |
|||
|
|||
// init scrollbars & recalculate sizes
|
|||
$.each(s, function (d, scrollx) { |
|||
|
|||
var scrollCallback = null; |
|||
var scrollForward = 1; |
|||
var scrollOffset = (d === 'x') ? 'scrollLeft' : 'scrollTop'; |
|||
var scrollStep = o.scrollStep; |
|||
var scrollTo = function () { |
|||
var currentOffset = c[scrollOffset](); |
|||
c[scrollOffset](currentOffset + scrollStep); |
|||
if (scrollForward == 1 && (currentOffset + scrollStep) >= scrollToValue) |
|||
currentOffset = c[scrollOffset](); |
|||
if (scrollForward == -1 && (currentOffset + scrollStep) <= scrollToValue) |
|||
currentOffset = c[scrollOffset](); |
|||
if (c[scrollOffset]() == currentOffset && scrollCallback) { |
|||
scrollCallback(); |
|||
} |
|||
} |
|||
var scrollToValue = 0; |
|||
|
|||
if (!scrollx.scroll) { |
|||
|
|||
scrollx.scroll = S._getScroll(o['scroll' + d]).addClass('scroll-' + d); |
|||
|
|||
if(o.showArrows){ |
|||
scrollx.scroll.addClass('scroll-element_arrows_visible'); |
|||
} |
|||
|
|||
scrollx.mousewheel = function (event) { |
|||
|
|||
if (!scrollx.isVisible || (d === 'x' && isVerticalScroll(event))) { |
|||
return true; |
|||
} |
|||
if (d === 'y' && !isVerticalScroll(event)) { |
|||
s.x.mousewheel(event); |
|||
return true; |
|||
} |
|||
|
|||
var delta = event.originalEvent.wheelDelta * -1 || event.originalEvent.detail; |
|||
var maxScrollValue = scrollx.size - scrollx.visible - scrollx.offset; |
|||
|
|||
if ((delta > 0 && scrollToValue < maxScrollValue) || (delta < 0 && scrollToValue > 0)) { |
|||
scrollToValue = scrollToValue + delta; |
|||
if (scrollToValue < 0) |
|||
scrollToValue = 0; |
|||
if (scrollToValue > maxScrollValue) |
|||
scrollToValue = maxScrollValue; |
|||
|
|||
S.scrollTo = S.scrollTo || {}; |
|||
S.scrollTo[scrollOffset] = scrollToValue; |
|||
setTimeout(function () { |
|||
if (S.scrollTo) { |
|||
c.stop().animate(S.scrollTo, 240, 'linear', function () { |
|||
scrollToValue = c[scrollOffset](); |
|||
}); |
|||
S.scrollTo = null; |
|||
} |
|||
}, 1); |
|||
} |
|||
|
|||
event.preventDefault(); |
|||
return false; |
|||
}; |
|||
|
|||
scrollx.scroll |
|||
.on('MozMousePixelScroll' + namespace, scrollx.mousewheel) |
|||
.on('mousewheel' + namespace, scrollx.mousewheel) |
|||
.on('mouseenter' + namespace, function () { |
|||
scrollToValue = c[scrollOffset](); |
|||
}); |
|||
|
|||
// handle arrows & scroll inner mousedown event
|
|||
scrollx.scroll.find('.scroll-arrow, .scroll-element_track') |
|||
.on('mousedown' + namespace, function (event) { |
|||
|
|||
if (event.which != 1) // lmb
|
|||
return true; |
|||
|
|||
scrollForward = 1; |
|||
|
|||
var data = { |
|||
"eventOffset": event[(d === 'x') ? 'pageX' : 'pageY'], |
|||
"maxScrollValue": scrollx.size - scrollx.visible - scrollx.offset, |
|||
"scrollbarOffset": scrollx.scroll.bar.offset()[(d === 'x') ? 'left' : 'top'], |
|||
"scrollbarSize": scrollx.scroll.bar[(d === 'x') ? 'outerWidth' : 'outerHeight']() |
|||
}; |
|||
var timeout = 0, timer = 0; |
|||
|
|||
if ($(this).hasClass('scroll-arrow')) { |
|||
scrollForward = $(this).hasClass("scroll-arrow_more") ? 1 : -1; |
|||
scrollStep = o.scrollStep * scrollForward; |
|||
scrollToValue = scrollForward > 0 ? data.maxScrollValue : 0; |
|||
} else { |
|||
scrollForward = (data.eventOffset > (data.scrollbarOffset + data.scrollbarSize) ? 1 |
|||
: (data.eventOffset < data.scrollbarOffset ? -1 : 0)); |
|||
scrollStep = Math.round(scrollx.visible * 0.75) * scrollForward; |
|||
scrollToValue = (data.eventOffset - data.scrollbarOffset - |
|||
(o.stepScrolling ? (scrollForward == 1 ? data.scrollbarSize : 0) |
|||
: Math.round(data.scrollbarSize / 2))); |
|||
scrollToValue = c[scrollOffset]() + (scrollToValue / scrollx.kx); |
|||
} |
|||
|
|||
S.scrollTo = S.scrollTo || {}; |
|||
S.scrollTo[scrollOffset] = o.stepScrolling ? c[scrollOffset]() + scrollStep : scrollToValue; |
|||
|
|||
if (o.stepScrolling) { |
|||
scrollCallback = function () { |
|||
scrollToValue = c[scrollOffset](); |
|||
clearInterval(timer); |
|||
clearTimeout(timeout); |
|||
timeout = 0; |
|||
timer = 0; |
|||
}; |
|||
timeout = setTimeout(function () { |
|||
timer = setInterval(scrollTo, 40); |
|||
}, o.duration + 100); |
|||
} |
|||
|
|||
setTimeout(function () { |
|||
if (S.scrollTo) { |
|||
c.animate(S.scrollTo, o.duration); |
|||
S.scrollTo = null; |
|||
} |
|||
}, 1); |
|||
|
|||
return S._handleMouseDown(scrollCallback, event); |
|||
}); |
|||
|
|||
// handle scrollbar drag'n'drop
|
|||
scrollx.scroll.bar.on('mousedown' + namespace, function (event) { |
|||
|
|||
if (event.which != 1) // lmb
|
|||
return true; |
|||
|
|||
var eventPosition = event[(d === 'x') ? 'pageX' : 'pageY']; |
|||
var initOffset = c[scrollOffset](); |
|||
|
|||
scrollx.scroll.addClass('scroll-draggable'); |
|||
|
|||
$(document).on('mousemove' + namespace, function (event) { |
|||
var diff = parseInt((event[(d === 'x') ? 'pageX' : 'pageY'] - eventPosition) / scrollx.kx, 10); |
|||
c[scrollOffset](initOffset + diff); |
|||
}); |
|||
|
|||
return S._handleMouseDown(function () { |
|||
scrollx.scroll.removeClass('scroll-draggable'); |
|||
scrollToValue = c[scrollOffset](); |
|||
}, event); |
|||
}); |
|||
} |
|||
}); |
|||
|
|||
// remove classes & reset applied styles
|
|||
$.each(s, function (d, scrollx) { |
|||
var scrollClass = 'scroll-scroll' + d + '_visible'; |
|||
var scrolly = (d == "x") ? s.y : s.x; |
|||
|
|||
scrollx.scroll.removeClass(scrollClass); |
|||
scrolly.scroll.removeClass(scrollClass); |
|||
cw.removeClass(scrollClass); |
|||
}); |
|||
|
|||
// calculate init sizes
|
|||
$.each(s, function (d, scrollx) { |
|||
$.extend(scrollx, (d == "x") ? { |
|||
"offset": parseInt(c.css('left'), 10) || 0, |
|||
"size": c.prop('scrollWidth'), |
|||
"visible": w.width() |
|||
} : { |
|||
"offset": parseInt(c.css('top'), 10) || 0, |
|||
"size": c.prop('scrollHeight'), |
|||
"visible": w.height() |
|||
}); |
|||
}); |
|||
|
|||
// update scrollbar visibility/dimensions
|
|||
this._updateScroll('x', this.scrollx); |
|||
this._updateScroll('y', this.scrolly); |
|||
|
|||
if ($.isFunction(o.onUpdate)){ |
|||
o.onUpdate.apply(this, [c]); |
|||
} |
|||
|
|||
// calculate scroll size
|
|||
$.each(s, function (d, scrollx) { |
|||
|
|||
var cssOffset = (d === 'x') ? 'left' : 'top'; |
|||
var cssFullSize = (d === 'x') ? 'outerWidth' : 'outerHeight'; |
|||
var cssSize = (d === 'x') ? 'width' : 'height'; |
|||
var offset = parseInt(c.css(cssOffset), 10) || 0; |
|||
|
|||
var AreaSize = scrollx.size; |
|||
var AreaVisible = scrollx.visible + offset; |
|||
|
|||
var scrollSize = scrollx.scroll.size[cssFullSize]() + (parseInt(scrollx.scroll.size.css(cssOffset), 10) || 0); |
|||
|
|||
if (o.autoScrollSize) { |
|||
scrollx.scrollbarSize = parseInt(scrollSize * AreaVisible / AreaSize, 10); |
|||
scrollx.scroll.bar.css(cssSize, scrollx.scrollbarSize + 'px'); |
|||
} |
|||
|
|||
scrollx.scrollbarSize = scrollx.scroll.bar[cssFullSize](); |
|||
scrollx.kx = ((scrollSize - scrollx.scrollbarSize) / (AreaSize - AreaVisible)) || 1; |
|||
scrollx.maxScrollOffset = AreaSize - AreaVisible; |
|||
}); |
|||
|
|||
c.scrollLeft(initScroll.scrollLeft).scrollTop(initScroll.scrollTop).trigger('scroll'); |
|||
}, |
|||
|
|||
/** |
|||
* Get scrollx/scrolly object |
|||
* |
|||
* @param {Mixed} scroll |
|||
* @returns {jQuery} scroll object |
|||
*/ |
|||
_getScroll: function (scroll) { |
|||
var types = { |
|||
advanced: [ |
|||
'<div class="scroll-element">', |
|||
'<div class="scroll-element_corner"></div>', |
|||
'<div class="scroll-arrow scroll-arrow_less"></div>', |
|||
'<div class="scroll-arrow scroll-arrow_more"></div>', |
|||
'<div class="scroll-element_outer">', |
|||
'<div class="scroll-element_size"></div>', // required! used for scrollbar size calculation !
|
|||
'<div class="scroll-element_inner-wrapper">', |
|||
'<div class="scroll-element_inner scroll-element_track">', // used for handling scrollbar click
|
|||
'<div class="scroll-element_inner-bottom"></div>', |
|||
'</div>', |
|||
'</div>', |
|||
'<div class="scroll-bar">', // required
|
|||
'<div class="scroll-bar_body">', |
|||
'<div class="scroll-bar_body-inner"></div>', |
|||
'</div>', |
|||
'<div class="scroll-bar_bottom"></div>', |
|||
'<div class="scroll-bar_center"></div>', |
|||
'</div>', |
|||
'</div>', |
|||
'</div>' |
|||
].join(''), |
|||
simple: [ |
|||
'<div class="scroll-element">', |
|||
'<div class="scroll-element_outer">', |
|||
'<div class="scroll-element_size"></div>', // required! used for scrollbar size calculation !
|
|||
'<div class="scroll-element_track"></div>', // used for handling scrollbar click
|
|||
'<div class="scroll-bar"></div>', // required
|
|||
'</div>', |
|||
'</div>' |
|||
].join('') |
|||
}; |
|||
if (types[scroll]) { |
|||
scroll = types[scroll]; |
|||
} |
|||
if (!scroll) { |
|||
scroll = types['simple']; |
|||
} |
|||
if (typeof (scroll) == 'string') { |
|||
scroll = $(scroll).appendTo(this.wrapper); |
|||
} else { |
|||
scroll = $(scroll); |
|||
} |
|||
$.extend(scroll, { |
|||
bar: scroll.find('.scroll-bar'), |
|||
size: scroll.find('.scroll-element_size'), |
|||
track: scroll.find('.scroll-element_track') |
|||
}); |
|||
return scroll; |
|||
}, |
|||
|
|||
_handleMouseDown: function(callback, event) { |
|||
|
|||
var namespace = this.namespace; |
|||
|
|||
$(document).on('blur' + namespace, function () { |
|||
$(document).add('body').off(namespace); |
|||
callback && callback(); |
|||
}); |
|||
$(document).on('dragstart' + namespace, function (event) { |
|||
event.preventDefault(); |
|||
return false; |
|||
}); |
|||
$(document).on('mouseup' + namespace, function () { |
|||
$(document).add('body').off(namespace); |
|||
callback && callback(); |
|||
}); |
|||
$('body').on('selectstart' + namespace, function (event) { |
|||
event.preventDefault(); |
|||
return false; |
|||
}); |
|||
|
|||
event && event.preventDefault(); |
|||
return false; |
|||
}, |
|||
|
|||
_updateScroll: function (d, scrollx) { |
|||
|
|||
var container = this.container, |
|||
containerWrapper = this.containerWrapper || container, |
|||
scrollClass = 'scroll-scroll' + d + '_visible', |
|||
scrolly = (d === 'x') ? this.scrolly : this.scrollx, |
|||
offset = parseInt(this.container.css((d === 'x') ? 'left' : 'top'), 10) || 0, |
|||
wrapper = this.wrapper; |
|||
|
|||
var AreaSize = scrollx.size; |
|||
var AreaVisible = scrollx.visible + offset; |
|||
|
|||
scrollx.isVisible = (AreaSize - AreaVisible) > 1; // bug in IE9/11 with 1px diff
|
|||
if (scrollx.isVisible) { |
|||
scrollx.scroll.addClass(scrollClass); |
|||
scrolly.scroll.addClass(scrollClass); |
|||
containerWrapper.addClass(scrollClass); |
|||
} else { |
|||
scrollx.scroll.removeClass(scrollClass); |
|||
scrolly.scroll.removeClass(scrollClass); |
|||
containerWrapper.removeClass(scrollClass); |
|||
} |
|||
|
|||
if (d === 'y') { |
|||
if(container.is('textarea') || AreaSize < AreaVisible){ |
|||
containerWrapper.css({ |
|||
"height": (AreaVisible + browser.scroll.height) + 'px', |
|||
"max-height": "none" |
|||
}); |
|||
} else { |
|||
containerWrapper.css({ |
|||
//"height": "auto", // do not reset height value: issue with height:100%!
|
|||
"max-height": (AreaVisible + browser.scroll.height) + 'px' |
|||
}); |
|||
} |
|||
} |
|||
|
|||
if (scrollx.size != container.prop('scrollWidth') |
|||
|| scrolly.size != container.prop('scrollHeight') |
|||
|| scrollx.visible != wrapper.width() |
|||
|| scrolly.visible != wrapper.height() |
|||
|| scrollx.offset != (parseInt(container.css('left'), 10) || 0) |
|||
|| scrolly.offset != (parseInt(container.css('top'), 10) || 0) |
|||
) { |
|||
$.extend(this.scrollx, { |
|||
"offset": parseInt(container.css('left'), 10) || 0, |
|||
"size": container.prop('scrollWidth'), |
|||
"visible": wrapper.width() |
|||
}); |
|||
$.extend(this.scrolly, { |
|||
"offset": parseInt(container.css('top'), 10) || 0, |
|||
"size": this.container.prop('scrollHeight'), |
|||
"visible": wrapper.height() |
|||
}); |
|||
this._updateScroll(d === 'x' ? 'y' : 'x', scrolly); |
|||
} |
|||
} |
|||
}; |
|||
|
|||
var CustomScrollbar = BaseScrollbar; |
|||
|
|||
/* |
|||
* Extend jQuery as plugin |
|||
* |
|||
* @param {Mixed} command to execute |
|||
* @param {Mixed} arguments as Array |
|||
* @return {jQuery} |
|||
*/ |
|||
$.fn.scrollbar = function (command, args) { |
|||
if (typeof command !== 'string') { |
|||
args = command; |
|||
command = 'init'; |
|||
} |
|||
if (typeof args === 'undefined') { |
|||
args = []; |
|||
} |
|||
if (!$.isArray(args)) { |
|||
args = [args]; |
|||
} |
|||
this.not('body, .scroll-wrapper').each(function () { |
|||
var element = $(this), |
|||
instance = element.data(browser.data.name); |
|||
if (instance || command === 'init') { |
|||
if (!instance) { |
|||
instance = new CustomScrollbar(element); |
|||
} |
|||
if (instance[command]) { |
|||
instance[command].apply(instance, args); |
|||
} |
|||
} |
|||
}); |
|||
return this; |
|||
}; |
|||
|
|||
/** |
|||
* Connect default options to global object |
|||
*/ |
|||
$.fn.scrollbar.options = defaults; |
|||
|
|||
|
|||
/** |
|||
* Check if scroll content/container size is changed |
|||
*/ |
|||
|
|||
var updateScrollbars = (function () { |
|||
var timer = 0, |
|||
timerCounter = 0; |
|||
|
|||
return function (force) { |
|||
var i, container, options, scroll, wrapper, scrollx, scrolly; |
|||
for (i = 0; i < browser.scrolls.length; i++) { |
|||
scroll = browser.scrolls[i]; |
|||
container = scroll.container; |
|||
options = scroll.options; |
|||
wrapper = scroll.wrapper; |
|||
scrollx = scroll.scrollx; |
|||
scrolly = scroll.scrolly; |
|||
if (force || (options.autoUpdate && wrapper && wrapper.is(':visible') && |
|||
(container.prop('scrollWidth') != scrollx.size || container.prop('scrollHeight') != scrolly.size || wrapper.width() != scrollx.visible || wrapper.height() != scrolly.visible))) { |
|||
scroll.init(); |
|||
|
|||
if (options.debug) { |
|||
window.console && console.log({ |
|||
scrollHeight: container.prop('scrollHeight') + ':' + scroll.scrolly.size, |
|||
scrollWidth: container.prop('scrollWidth') + ':' + scroll.scrollx.size, |
|||
visibleHeight: wrapper.height() + ':' + scroll.scrolly.visible, |
|||
visibleWidth: wrapper.width() + ':' + scroll.scrollx.visible |
|||
}, true); |
|||
timerCounter++; |
|||
} |
|||
} |
|||
} |
|||
if (debug && timerCounter > 10) { |
|||
window.console && console.log('Scroll updates exceed 10'); |
|||
updateScrollbars = function () {}; |
|||
} else { |
|||
clearTimeout(timer); |
|||
timer = setTimeout(updateScrollbars, 300); |
|||
} |
|||
}; |
|||
})(); |
|||
|
|||
/* ADDITIONAL FUNCTIONS */ |
|||
/** |
|||
* Get native browser scrollbar size (height/width) |
|||
* |
|||
* @param {Boolean} actual size or CSS size, default - CSS size |
|||
* @returns {Object} with height, width |
|||
*/ |
|||
function getBrowserScrollSize(actualSize) { |
|||
|
|||
if (browser.webkit && !actualSize) { |
|||
return { |
|||
"height": 0, |
|||
"width": 0 |
|||
}; |
|||
} |
|||
|
|||
if (!browser.data.outer) { |
|||
var css = { |
|||
"border": "none", |
|||
"box-sizing": "content-box", |
|||
"height": "200px", |
|||
"margin": "0", |
|||
"padding": "0", |
|||
"width": "200px" |
|||
}; |
|||
browser.data.inner = $("<div>").css($.extend({}, css)); |
|||
browser.data.outer = $("<div>").css($.extend({ |
|||
"left": "-1000px", |
|||
"overflow": "scroll", |
|||
"position": "absolute", |
|||
"top": "-1000px" |
|||
}, css)).append(browser.data.inner).appendTo("body"); |
|||
} |
|||
|
|||
browser.data.outer.scrollLeft(1000).scrollTop(1000); |
|||
|
|||
return { |
|||
"height": Math.ceil((browser.data.outer.offset().top - browser.data.inner.offset().top) || 0), |
|||
"width": Math.ceil((browser.data.outer.offset().left - browser.data.inner.offset().left) || 0) |
|||
}; |
|||
} |
|||
|
|||
/** |
|||
* Check if native browser scrollbars overlay content |
|||
* |
|||
* @returns {Boolean} |
|||
*/ |
|||
function isScrollOverlaysContent() { |
|||
var scrollSize = getBrowserScrollSize(true); |
|||
return !(scrollSize.height || scrollSize.width); |
|||
} |
|||
|
|||
function isVerticalScroll(event) { |
|||
var e = event.originalEvent; |
|||
if (e.axis && e.axis === e.HORIZONTAL_AXIS) |
|||
return false; |
|||
if (e.wheelDeltaX) |
|||
return false; |
|||
return true; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Extend AngularJS as UI directive |
|||
* and expose a provider for override default config |
|||
* |
|||
*/ |
|||
if (window.angular) { |
|||
(function (angular) { |
|||
angular.module('jQueryScrollbar', []) |
|||
.provider('jQueryScrollbar', function () { |
|||
var defaultOptions = defaults; |
|||
return { |
|||
setOptions: function (options) { |
|||
angular.extend(defaultOptions, options); |
|||
}, |
|||
$get: function () { |
|||
return { |
|||
options: angular.copy(defaultOptions) |
|||
}; |
|||
} |
|||
}; |
|||
}) |
|||
.directive('jqueryScrollbar', ['jQueryScrollbar', '$parse', function (jQueryScrollbar, $parse) { |
|||
return { |
|||
"restrict": "AC", |
|||
"link": function (scope, element, attrs) { |
|||
var model = $parse(attrs.jqueryScrollbar), |
|||
options = model(scope); |
|||
element.scrollbar(options || jQueryScrollbar.options) |
|||
.on('$destroy', function () { |
|||
element.scrollbar('destroy'); |
|||
}); |
|||
} |
|||
}; |
|||
}]); |
|||
})(window.angular); |
|||
} |
|||
})); |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,838 +0,0 @@ |
|||
/*! jQuery wizard - v0.3.1 - 2015-05-07 |
|||
* https://github.com/amazingSurge/jquery-wizard
|
|||
* Copyright (c) 2015 amazingSurge; Licensed GPL */ |
|||
(function($, document, window, undefined) { |
|||
"use strict"; |
|||
|
|||
var Support = (function() { |
|||
var style = $('<support>').get(0).style, |
|||
prefixes = ['webkit', 'Moz', 'O', 'ms'], |
|||
events = { |
|||
transition: { |
|||
end: { |
|||
WebkitTransition: 'webkitTransitionEnd', |
|||
MozTransition: 'transitionend', |
|||
OTransition: 'oTransitionEnd', |
|||
transition: 'transitionend' |
|||
} |
|||
} |
|||
}, |
|||
tests = { |
|||
csstransitions: function() { |
|||
return !!test('transition'); |
|||
} |
|||
}; |
|||
|
|||
function test(property, prefixed) { |
|||
var result = false, |
|||
upper = property.charAt(0).toUpperCase() + property.slice(1); |
|||
|
|||
if (style[property] !== undefined) { |
|||
result = property; |
|||
} |
|||
if (!result) { |
|||
$.each(prefixes, function(i, prefix) { |
|||
if (style[prefix + upper] !== undefined) { |
|||
result = '-' + prefix.toLowerCase() + '-' + upper; |
|||
return false; |
|||
} |
|||
}); |
|||
} |
|||
|
|||
if (prefixed) { |
|||
return result; |
|||
} |
|||
if (result) { |
|||
return true; |
|||
} else { |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
function prefixed(property) { |
|||
return test(property, true); |
|||
} |
|||
var support = {}; |
|||
if (tests.csstransitions()) { |
|||
/* jshint -W053 */ |
|||
support.transition = new String(prefixed('transition')) |
|||
support.transition.end = events.transition.end[support.transition]; |
|||
} |
|||
|
|||
return support; |
|||
})(); |
|||
|
|||
|
|||
var counter = 0; |
|||
|
|||
var Wizard = function(element, options) { |
|||
this.$element = $(element); |
|||
|
|||
this.options = $.extend(true, {}, Wizard.defaults, options); |
|||
|
|||
this.$steps = this.$element.find(this.options.step); |
|||
|
|||
this.id = this.$element.attr('id'); |
|||
if (!this.id) { |
|||
this.id = 'wizard-' + (++counter); |
|||
this.$element.attr('id', this.id); |
|||
} |
|||
|
|||
this.initialize(); |
|||
} |
|||
|
|||
function emulateTransitionEnd($el, duration) { |
|||
var called = false; |
|||
|
|||
$el.one(Support.transition.end, function() { |
|||
called = true; |
|||
}); |
|||
var callback = function() { |
|||
if (!called) { |
|||
$el.trigger(Support.transition.end); |
|||
} |
|||
} |
|||
setTimeout(callback, duration); |
|||
} |
|||
Wizard.defaults = { |
|||
step: '.wizard-steps > li', |
|||
|
|||
getPane: function(index, step) { |
|||
return this.$element.find('.wizard-content').children().eq(index); |
|||
}, |
|||
|
|||
buttonsAppendTo: 'this', |
|||
templates: { |
|||
buttons: function() { |
|||
var options = this.options; |
|||
return '<div class="wizard-buttons">' + |
|||
'<a class="wizard-back" href="#' + this.id + '" data-wizard="back" role="button">' + options.buttonLabels.back + '</a>' + |
|||
'<a class="wizard-next" href="#' + this.id + '" data-wizard="next" role="button">' + options.buttonLabels.next + '</a>' + |
|||
'<a class="wizard-finish" href="#' + this.id + '" data-wizard="finish" role="button">' + options.buttonLabels.finish + '</a>' + |
|||
'</div>'; |
|||
} |
|||
}, |
|||
|
|||
classes: { |
|||
step: { |
|||
done: 'done', |
|||
error: 'error', |
|||
active: 'current', |
|||
disabled: 'disabled', |
|||
activing: 'activing', |
|||
loading: 'loading' |
|||
}, |
|||
|
|||
pane: { |
|||
active: 'active', |
|||
activing: 'activing' |
|||
}, |
|||
|
|||
button: { |
|||
hide: 'hide', |
|||
disabled: 'disabled' |
|||
} |
|||
}, |
|||
|
|||
autoFocus: true, |
|||
keyboard: true, |
|||
|
|||
enableWhenVisited: false, |
|||
|
|||
buttonLabels: { |
|||
next: 'Next', |
|||
back: 'Back', |
|||
finish: 'Finish' |
|||
}, |
|||
|
|||
loading: { |
|||
show: function(step) {}, |
|||
hide: function(step) {}, |
|||
fail: function(step) {} |
|||
}, |
|||
|
|||
cacheContent: false, |
|||
|
|||
validator: function(step) { |
|||
return true; |
|||
}, |
|||
|
|||
onInit: null, |
|||
onNext: null, |
|||
onBack: null, |
|||
onReset: null, |
|||
|
|||
onBeforeShow: null, |
|||
onAfterShow: null, |
|||
onBeforeHide: null, |
|||
onAfterHide: null, |
|||
onBeforeLoad: null, |
|||
onAfterLoad: null, |
|||
|
|||
onBeforeChange: null, |
|||
onAfterChange: null, |
|||
|
|||
onStateChange: null, |
|||
|
|||
onFinish: null |
|||
}; |
|||
|
|||
// Step
|
|||
function Step() { |
|||
return this.initialize.apply(this, Array.prototype.slice.call(arguments)); |
|||
} |
|||
|
|||
$.extend(Step.prototype, { |
|||
TRANSITION_DURATION: 200, |
|||
initialize: function(element, wizard, index) { |
|||
this.$element = $(element); |
|||
this.wizard = wizard; |
|||
|
|||
this.events = {}; |
|||
this.loader = null; |
|||
this.loaded = false; |
|||
|
|||
this.validator = this.wizard.options.validator; |
|||
|
|||
this.states = { |
|||
done: false, |
|||
error: false, |
|||
active: false, |
|||
disabled: false, |
|||
activing: false |
|||
}; |
|||
|
|||
this.index = index; |
|||
this.$element.data('wizard-index', index); |
|||
|
|||
|
|||
this.$pane = this.getPaneFromTarget(); |
|||
|
|||
if (!this.$pane) { |
|||
this.$pane = this.wizard.options.getPane.call(this.wizard, index, element); |
|||
} |
|||
|
|||
this.setValidatorFromData(); |
|||
this.setLoaderFromData(); |
|||
}, |
|||
|
|||
getPaneFromTarget: function() { |
|||
var selector = this.$element.data('target'); |
|||
|
|||
if (!selector) { |
|||
selector = this.$element.attr('href'); |
|||
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, ''); |
|||
} |
|||
|
|||
if (selector) { |
|||
return $(selector); |
|||
} else { |
|||
return null; |
|||
} |
|||
}, |
|||
|
|||
setup: function() { |
|||
var current = this.wizard.currentIndex(); |
|||
if (this.index === current) { |
|||
this.enter('active'); |
|||
|
|||
if (this.loader) { |
|||
this.load(); |
|||
} |
|||
} else if (this.index > current) { |
|||
this.enter('disabled'); |
|||
} |
|||
|
|||
this.$element.attr('aria-expanded', this.is('active')); |
|||
this.$pane.attr('aria-expanded', this.is('active')); |
|||
|
|||
var classes = this.wizard.options.classes; |
|||
if (this.is('active')) { |
|||
this.$pane.addClass(classes.pane.active); |
|||
} else { |
|||
this.$pane.removeClass(classes.pane.active); |
|||
} |
|||
}, |
|||
|
|||
show: function(callback) { |
|||
if (this.is('activing') || this.is('active')) { |
|||
return; |
|||
} |
|||
|
|||
this.trigger('beforeShow'); |
|||
this.enter('activing'); |
|||
|
|||
var classes = this.wizard.options.classes; |
|||
|
|||
this.$element |
|||
.attr('aria-expanded', true); |
|||
|
|||
this.$pane |
|||
.addClass(classes.pane.activing) |
|||
.addClass(classes.pane.active) |
|||
.attr('aria-expanded', true); |
|||
|
|||
var complete = function() { |
|||
this.$pane |
|||
.removeClass(classes.pane.activing) |
|||
|
|||
this.leave('activing'); |
|||
this.enter('active'); |
|||
this.trigger('afterShow'); |
|||
|
|||
if ($.isFunction(callback)) { |
|||
callback.call(this); |
|||
} |
|||
} |
|||
|
|||
if (!Support.transition) { |
|||
return complete.call(this); |
|||
} |
|||
|
|||
this.$pane.one(Support.transition.end, $.proxy(complete, this)); |
|||
|
|||
emulateTransitionEnd(this.$pane, this.TRANSITION_DURATION); |
|||
}, |
|||
|
|||
hide: function(callback) { |
|||
if (this.is('activing') || !this.is('active')) { |
|||
return; |
|||
} |
|||
|
|||
this.trigger('beforeHide'); |
|||
this.enter('activing'); |
|||
|
|||
var classes = this.wizard.options.classes; |
|||
|
|||
this.$element |
|||
.attr('aria-expanded', false); |
|||
|
|||
this.$pane |
|||
.addClass(classes.pane.activing) |
|||
.removeClass(classes.pane.active) |
|||
.attr('aria-expanded', false); |
|||
|
|||
var complete = function() { |
|||
this.$pane |
|||
.removeClass(classes.pane.activing); |
|||
|
|||
this.leave('activing'); |
|||
this.leave('active'); |
|||
this.trigger('afterHide'); |
|||
|
|||
if ($.isFunction(callback)) { |
|||
callback.call(this); |
|||
} |
|||
} |
|||
|
|||
if (!Support.transition) { |
|||
return complete.call(this); |
|||
} |
|||
|
|||
this.$pane.one(Support.transition.end, $.proxy(complete, this)); |
|||
|
|||
emulateTransitionEnd(this.$pane, this.TRANSITION_DURATION); |
|||
}, |
|||
|
|||
empty: function() { |
|||
this.$pane.empty(); |
|||
}, |
|||
|
|||
load: function(callback) { |
|||
var self = this; |
|||
var loader = this.loader; |
|||
|
|||
if ($.isFunction(loader)) { |
|||
loader = loader.call(this.wizard, this); |
|||
} |
|||
|
|||
if (this.wizard.options.cacheContent && this.loaded) { |
|||
if ($.isFunction(callback)) { |
|||
callback.call(this); |
|||
} |
|||
return true; |
|||
} |
|||
|
|||
this.trigger('beforeLoad'); |
|||
this.enter('loading'); |
|||
|
|||
function setContent(content) { |
|||
self.$pane.html(content); |
|||
|
|||
self.leave('loading'); |
|||
self.loaded = true; |
|||
self.trigger('afterLoad'); |
|||
|
|||
if ($.isFunction(callback)) { |
|||
callback.call(self); |
|||
} |
|||
} |
|||
|
|||
if (typeof loader === 'string') { |
|||
setContent(loader); |
|||
} else if (typeof loader === 'object' && loader.hasOwnProperty('url')) { |
|||
self.wizard.options.loading.show.call(self.wizard, self); |
|||
|
|||
$.ajax(loader.url, loader.settings || {}).done(function(data) { |
|||
setContent(data); |
|||
|
|||
self.wizard.options.loading.hide.call(self.wizard, self); |
|||
}).fail(function() { |
|||
self.wizard.options.loading.fail.call(self.wizard, self); |
|||
}); |
|||
} else { |
|||
setContent(''); |
|||
} |
|||
}, |
|||
|
|||
trigger: function(event) { |
|||
var method_arguments = Array.prototype.slice.call(arguments, 1); |
|||
|
|||
if ($.isArray(this.events[event])) { |
|||
for (var i in this.events[event]) { |
|||
this.events[event][i].apply(this, method_arguments); |
|||
} |
|||
} |
|||
|
|||
this.wizard.trigger.apply(this.wizard, [event, this].concat(method_arguments)); |
|||
}, |
|||
|
|||
enter: function(state) { |
|||
this.states[state] = true; |
|||
|
|||
var classes = this.wizard.options.classes; |
|||
this.$element.addClass(classes.step[state]); |
|||
|
|||
this.trigger('stateChange', true, state); |
|||
}, |
|||
|
|||
leave: function(state) { |
|||
if (this.states[state]) { |
|||
this.states[state] = false; |
|||
|
|||
var classes = this.wizard.options.classes; |
|||
this.$element.removeClass(classes.step[state]); |
|||
|
|||
this.trigger('stateChange', false, state); |
|||
} |
|||
}, |
|||
|
|||
setValidatorFromData: function() { |
|||
var validator = this.$pane.data('validator'); |
|||
if (validator && $.isFunction(window[validator])) { |
|||
this.validator = window[validator]; |
|||
} |
|||
}, |
|||
|
|||
setLoaderFromData: function() { |
|||
var loader = this.$pane.data('loader'); |
|||
|
|||
if (loader) { |
|||
if ($.isFunction(window[loader])) { |
|||
this.loader = window[loader]; |
|||
} |
|||
} else { |
|||
var url = this.$pane.data('loader-url'); |
|||
if (url) { |
|||
this.loader = { |
|||
url: url, |
|||
settings: this.$pane.data('settings') || {} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
|
|||
/* |
|||
* Public methods below |
|||
*/ |
|||
active: function() { |
|||
return this.wizard.goTo(this.index); |
|||
}, |
|||
|
|||
on: function(event, handler) { |
|||
if ($.isFunction(handler)) { |
|||
if ($.isArray(this.events[event])) { |
|||
this.events[event].push(handler); |
|||
} else { |
|||
this.events[event] = [handler]; |
|||
} |
|||
} |
|||
|
|||
return this; |
|||
}, |
|||
|
|||
off: function(event, handler) { |
|||
if ($.isFunction(handler) && $.isArray(this.events[event])) { |
|||
$.each(this.events[event], function(i, f) { |
|||
if (f === handler) { |
|||
delete this.events[event][i]; |
|||
return false; |
|||
} |
|||
}); |
|||
} |
|||
|
|||
return this; |
|||
}, |
|||
|
|||
is: function(state) { |
|||
return this.states[state] && this.states[state] === true; |
|||
}, |
|||
|
|||
reset: function() { |
|||
for (var state in this.states) { |
|||
this.leave(state); |
|||
} |
|||
this.setup(); |
|||
|
|||
return this; |
|||
}, |
|||
|
|||
setLoader: function(loader) { |
|||
this.loader = loader; |
|||
|
|||
if (this.is('active')) { |
|||
this.load(); |
|||
} |
|||
|
|||
return this; |
|||
}, |
|||
|
|||
setValidator: function(validator) { |
|||
if ($.isFunction(validator)) { |
|||
this.validator = validator; |
|||
} |
|||
|
|||
return this; |
|||
}, |
|||
|
|||
validate: function() { |
|||
return this.validator.call(this.$pane.get(0), this); |
|||
} |
|||
}); |
|||
|
|||
$.extend(Wizard.prototype, { |
|||
Constructor: Wizard, |
|||
initialize: function() { |
|||
this.steps = []; |
|||
var self = this; |
|||
|
|||
this.$steps.each(function(index) { |
|||
self.steps.push(new Step(this, self, index)); |
|||
}); |
|||
|
|||
this._current = 0; |
|||
this.transitioning = null; |
|||
|
|||
$.each(this.steps, function(i, step) { |
|||
step.setup(); |
|||
}); |
|||
|
|||
this.setup(); |
|||
|
|||
this.$element.on('click', this.options.step, function(e) { |
|||
var index = $(this).data('wizard-index'); |
|||
|
|||
if (!self.get(index).is('disabled')) { |
|||
self.goTo(index); |
|||
} |
|||
|
|||
e.preventDefault(); |
|||
e.stopPropagation(); |
|||
}); |
|||
|
|||
if (this.options.keyboard) { |
|||
$(document).on('keyup', $.proxy(this.keydown, this)); |
|||
} |
|||
|
|||
this.trigger('init'); |
|||
}, |
|||
|
|||
setup: function() { |
|||
this.$buttons = $(this.options.templates.buttons.call(this)); |
|||
|
|||
this.updateButtons(); |
|||
|
|||
var buttonsAppendTo = this.options.buttonsAppendTo; |
|||
var $to; |
|||
if (buttonsAppendTo === 'this') { |
|||
$to = this.$element; |
|||
} else if ($.isFunction(buttonsAppendTo)) { |
|||
$to = buttonsAppendTo.call(this); |
|||
} else { |
|||
$to = this.$element.find(buttonsAppendTo); |
|||
} |
|||
this.$buttons = this.$buttons.appendTo($to); |
|||
}, |
|||
|
|||
updateButtons: function() { |
|||
var classes = this.options.classes.button; |
|||
var $back = this.$buttons.find('[data-wizard="back"]'); |
|||
var $next = this.$buttons.find('[data-wizard="next"]'); |
|||
var $finish = this.$buttons.find('[data-wizard="finish"]'); |
|||
|
|||
if (this._current === 0) { |
|||
$back.addClass(classes.disabled); |
|||
} else { |
|||
$back.removeClass(classes.disabled); |
|||
} |
|||
|
|||
if (this._current === this.lastIndex()) { |
|||
$next.addClass(classes.hide); |
|||
$finish.removeClass(classes.hide); |
|||
} else { |
|||
$next.removeClass(classes.hide); |
|||
$finish.addClass(classes.hide); |
|||
} |
|||
}, |
|||
|
|||
updateSteps: function() { |
|||
var self = this; |
|||
|
|||
$.each(this.steps, function(i, step) { |
|||
|
|||
if (i > self._current) { |
|||
step.leave('error'); |
|||
step.leave('active'); |
|||
step.leave('done'); |
|||
|
|||
if (!self.options.enableWhenVisited) { |
|||
step.enter('disabled'); |
|||
} |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
keydown: function(e) { |
|||
if (/input|textarea/i.test(e.target.tagName)) return; |
|||
switch (e.which) { |
|||
case 37: |
|||
this.back(); |
|||
break; |
|||
case 39: |
|||
this.next(); |
|||
break; |
|||
default: |
|||
return; |
|||
} |
|||
|
|||
e.preventDefault(); |
|||
}, |
|||
|
|||
trigger: function(eventType) { |
|||
var method_arguments = Array.prototype.slice.call(arguments, 1); |
|||
var data = [this].concat(method_arguments); |
|||
|
|||
this.$element.trigger('wizard::' + eventType, data); |
|||
|
|||
// callback
|
|||
eventType = eventType.replace(/\b\w+\b/g, function(word) { |
|||
return word.substring(0, 1).toUpperCase() + word.substring(1); |
|||
}); |
|||
|
|||
var onFunction = 'on' + eventType; |
|||
if (typeof this.options[onFunction] === 'function') { |
|||
this.options[onFunction].apply(this, method_arguments); |
|||
} |
|||
}, |
|||
|
|||
get: function(index) { |
|||
if (typeof index === 'string' && index.substring(0, 1) === '#') { |
|||
var id = index.substring(1); |
|||
for (var i in this.steps) { |
|||
if (this.steps[i].$pane.attr('id') === id) { |
|||
return this.steps[i]; |
|||
} |
|||
} |
|||
} |
|||
|
|||
if (index < this.length() && this.steps[index]) { |
|||
return this.steps[index]; |
|||
} |
|||
|
|||
return null; |
|||
}, |
|||
|
|||
goTo: function(index, callback) { |
|||
if (index === this._current || this.transitioning === true) { |
|||
return false; |
|||
} |
|||
|
|||
var current = this.current(); |
|||
var to = this.get(index); |
|||
|
|||
if (index > this._current) { |
|||
if (!current.validate()) { |
|||
current.leave('done'); |
|||
current.enter('error'); |
|||
|
|||
return -1; |
|||
} else { |
|||
current.leave('error'); |
|||
|
|||
if (index > this._current) { |
|||
current.enter('done'); |
|||
} |
|||
} |
|||
} |
|||
|
|||
var self = this; |
|||
var process = function() { |
|||
self.trigger('beforeChange', current, to); |
|||
self.transitioning = true; |
|||
|
|||
current.hide(); |
|||
to.show(function() { |
|||
self._current = index; |
|||
self.transitioning = false; |
|||
this.leave('disabled'); |
|||
|
|||
self.updateButtons(); |
|||
self.updateSteps(); |
|||
|
|||
if (self.options.autoFocus) { |
|||
var $input = this.$pane.find(':input'); |
|||
if ($input.length > 0) { |
|||
$input.eq(0).focus(); |
|||
} else { |
|||
this.$pane.focus(); |
|||
} |
|||
} |
|||
|
|||
if ($.isFunction(callback)) { |
|||
callback.call(self); |
|||
} |
|||
|
|||
self.trigger('afterChange', current, to); |
|||
}); |
|||
}; |
|||
|
|||
if (to.loader) { |
|||
to.load(function() { |
|||
process(); |
|||
}); |
|||
} else { |
|||
process(); |
|||
} |
|||
|
|||
return true; |
|||
}, |
|||
|
|||
length: function() { |
|||
return this.steps.length; |
|||
}, |
|||
|
|||
current: function() { |
|||
return this.get(this._current); |
|||
}, |
|||
|
|||
currentIndex: function() { |
|||
return this._current; |
|||
}, |
|||
|
|||
lastIndex: function() { |
|||
return this.length() - 1; |
|||
}, |
|||
|
|||
next: function() { |
|||
if (this._current < this.lastIndex()) { |
|||
var from = this._current, |
|||
to = this._current + 1; |
|||
|
|||
this.goTo(to, function() { |
|||
this.trigger('next', this.get(from), this.get(to)); |
|||
}); |
|||
} |
|||
|
|||
return false; |
|||
}, |
|||
|
|||
back: function() { |
|||
if (this._current > 0) { |
|||
var from = this._current, |
|||
to = this._current - 1; |
|||
|
|||
this.goTo(to, function() { |
|||
this.trigger('back', this.get(from), this.get(to)); |
|||
}); |
|||
} |
|||
|
|||
return false; |
|||
}, |
|||
|
|||
first: function() { |
|||
return this.goTo(0); |
|||
}, |
|||
|
|||
finish: function() { |
|||
if (this._current === this.lastIndex()) { |
|||
var current = this.current(); |
|||
if (current.validate()) { |
|||
this.trigger('finish'); |
|||
current.leave('error'); |
|||
current.enter('done'); |
|||
} else { |
|||
current.enter('error'); |
|||
} |
|||
} |
|||
}, |
|||
|
|||
reset: function() { |
|||
this._current = 0; |
|||
|
|||
$.each(this.steps, function(i, step) { |
|||
step.reset(); |
|||
}); |
|||
|
|||
this.trigger('reset'); |
|||
} |
|||
}); |
|||
|
|||
$(document).on('click', '[data-wizard]', function(e) { |
|||
var href; |
|||
var $this = $(this); |
|||
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')); |
|||
|
|||
var wizard = $target.data('wizard'); |
|||
|
|||
if (!wizard) { |
|||
return; |
|||
} |
|||
|
|||
var method = $this.data('wizard'); |
|||
|
|||
if (/^(back|next|first|finish|reset)$/.test(method)) { |
|||
wizard[method](); |
|||
} |
|||
|
|||
e.preventDefault(); |
|||
}); |
|||
|
|||
$.fn.wizard = function(options) { |
|||
if (typeof options === 'string') { |
|||
var method = options; |
|||
var method_arguments = Array.prototype.slice.call(arguments, 1); |
|||
|
|||
if (/^\_/.test(method)) { |
|||
return false; |
|||
} else if ((/^(get)$/.test(method))) { |
|||
var api = this.first().data('wizard'); |
|||
if (api && typeof api[method] === 'function') { |
|||
return api[method].apply(api, method_arguments); |
|||
} |
|||
} else { |
|||
return this.each(function() { |
|||
var api = $.data(this, 'wizard'); |
|||
if (api && typeof api[method] === 'function') { |
|||
api[method].apply(api, method_arguments); |
|||
} |
|||
}); |
|||
} |
|||
} else { |
|||
return this.each(function() { |
|||
if (!$.data(this, 'wizard')) { |
|||
$.data(this, 'wizard', new Wizard(this, options)); |
|||
} |
|||
}); |
|||
} |
|||
}; |
|||
})(jQuery, document, window); |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,8 +0,0 @@ |
|||
/*! |
|||
* Ladda 0.9.4 (2014-06-21, 11:24) |
|||
* http://lab.hakim.se/ladda
|
|||
* MIT licensed |
|||
* |
|||
* Copyright (C) 2014 Hakim El Hattab, http://hakim.se
|
|||
*/ |
|||
(function(t,e){"object"==typeof exports?module.exports=e(require("spin.js")):"function"==typeof define&&define.amd?define(["spin"],e):t.Ladda=e(t.Spinner)})(this,function(t){"use strict";function e(t){if(t===void 0)return console.warn("Ladda button target must be defined."),void 0;t.querySelector(".ladda-label")||(t.innerHTML='<span class="ladda-label">'+t.innerHTML+"</span>");var e,n=document.createElement("span");n.className="ladda-spinner",t.appendChild(n);var r,a={start:function(){return e||(e=o(t)),t.setAttribute("disabled",""),t.setAttribute("data-loading",""),clearTimeout(r),e.spin(n),this.setProgress(0),this},startAfter:function(t){return clearTimeout(r),r=setTimeout(function(){a.start()},t),this},stop:function(){return t.removeAttribute("disabled"),t.removeAttribute("data-loading"),clearTimeout(r),e&&(r=setTimeout(function(){e.stop()},1e3)),this},toggle:function(){return this.isLoading()?this.stop():this.start(),this},setProgress:function(e){e=Math.max(Math.min(e,1),0);var n=t.querySelector(".ladda-progress");0===e&&n&&n.parentNode?n.parentNode.removeChild(n):(n||(n=document.createElement("div"),n.className="ladda-progress",t.appendChild(n)),n.style.width=(e||0)*t.offsetWidth+"px")},enable:function(){return this.stop(),this},disable:function(){return this.stop(),t.setAttribute("disabled",""),this},isLoading:function(){return t.hasAttribute("data-loading")},remove:function(){clearTimeout(r),t.removeAttribute("disabled",""),t.removeAttribute("data-loading",""),e&&(e.stop(),e=null);for(var n=0,i=u.length;i>n;n++)if(a===u[n]){u.splice(n,1);break}}};return u.push(a),a}function n(t,e){for(;t.parentNode&&t.tagName!==e;)t=t.parentNode;return e===t.tagName?t:void 0}function r(t){for(var e=["input","textarea"],n=[],r=0;e.length>r;r++)for(var a=t.getElementsByTagName(e[r]),i=0;a.length>i;i++)a[i].hasAttribute("required")&&n.push(a[i]);return n}function a(t,a){a=a||{};var i=[];"string"==typeof t?i=s(document.querySelectorAll(t)):"object"==typeof t&&"string"==typeof t.nodeName&&(i=[t]);for(var o=0,u=i.length;u>o;o++)(function(){var t=i[o];if("function"==typeof t.addEventListener){var s=e(t),u=-1;t.addEventListener("click",function(){var e=!0,i=n(t,"FORM");if(i!==void 0)for(var o=r(i),d=0;o.length>d;d++)""===o[d].value.replace(/^\s+|\s+$/g,"")&&(e=!1);e&&(s.startAfter(1),"number"==typeof a.timeout&&(clearTimeout(u),u=setTimeout(s.stop,a.timeout)),"function"==typeof a.callback&&a.callback.apply(null,[s]))},!1)}})()}function i(){for(var t=0,e=u.length;e>t;t++)u[t].stop()}function o(e){var n,r=e.offsetHeight;0===r&&(r=parseFloat(window.getComputedStyle(e).height)),r>32&&(r*=.8),e.hasAttribute("data-spinner-size")&&(r=parseInt(e.getAttribute("data-spinner-size"),10)),e.hasAttribute("data-spinner-color")&&(n=e.getAttribute("data-spinner-color"));var a=12,i=.2*r,o=.6*i,s=7>i?2:3;return new t({color:n||"#fff",lines:a,radius:i,length:o,width:s,zIndex:"auto",top:"auto",left:"auto",className:""})}function s(t){for(var e=[],n=0;t.length>n;n++)e.push(t[n]);return e}var u=[];return{bind:a,create:e,stopAll:i}}); |
@ -1 +0,0 @@ |
|||
(function(t,e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Spinner=e()})(this,function(){"use strict";function t(t,e){var i,n=document.createElement(t||"div");for(i in e)n[i]=e[i];return n}function e(t){for(var e=1,i=arguments.length;i>e;e++)t.appendChild(arguments[e]);return t}function i(t,e,i,n){var r=["opacity",e,~~(100*t),i,n].join("-"),o=.01+100*(i/n),a=Math.max(1-(1-t)/e*(100-o),t),s=u.substring(0,u.indexOf("Animation")).toLowerCase(),l=s&&"-"+s+"-"||"";return c[r]||(p.insertRule("@"+l+"keyframes "+r+"{"+"0%{opacity:"+a+"}"+o+"%{opacity:"+t+"}"+(o+.01)+"%{opacity:1}"+(o+e)%100+"%{opacity:"+t+"}"+"100%{opacity:"+a+"}"+"}",p.cssRules.length),c[r]=1),r}function n(t,e){var i,n,r=t.style;for(e=e.charAt(0).toUpperCase()+e.slice(1),n=0;d.length>n;n++)if(i=d[n]+e,void 0!==r[i])return i;return void 0!==r[e]?e:void 0}function r(t,e){for(var i in e)t.style[n(t,i)||i]=e[i];return t}function o(t){for(var e=1;arguments.length>e;e++){var i=arguments[e];for(var n in i)void 0===t[n]&&(t[n]=i[n])}return t}function a(t,e){return"string"==typeof t?t:t[e%t.length]}function s(t){this.opts=o(t||{},s.defaults,f)}function l(){function i(e,i){return t("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',i)}p.addRule(".spin-vml","behavior:url(#default#VML)"),s.prototype.lines=function(t,n){function o(){return r(i("group",{coordsize:d+" "+d,coordorigin:-u+" "+-u}),{width:d,height:d})}function s(t,s,l){e(p,e(r(o(),{rotation:360/n.lines*t+"deg",left:~~s}),e(r(i("roundrect",{arcsize:n.corners}),{width:u,height:n.width,left:n.radius,top:-n.width>>1,filter:l}),i("fill",{color:a(n.color,t),opacity:n.opacity}),i("stroke",{opacity:0}))))}var l,u=n.length+n.width,d=2*u,c=2*-(n.width+n.length)+"px",p=r(o(),{position:"absolute",top:c,left:c});if(n.shadow)for(l=1;n.lines>=l;l++)s(l,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(l=1;n.lines>=l;l++)s(l);return e(t,p)},s.prototype.opacity=function(t,e,i,n){var r=t.firstChild;n=n.shadow&&n.lines||0,r&&r.childNodes.length>e+n&&(r=r.childNodes[e+n],r=r&&r.firstChild,r=r&&r.firstChild,r&&(r.opacity=i))}}var u,d=["webkit","Moz","ms","O"],c={},p=function(){var i=t("style",{type:"text/css"});return e(document.getElementsByTagName("head")[0],i),i.sheet||i.styleSheet}(),f={lines:12,length:7,width:5,radius:10,rotate:0,corners:1,color:"#000",direction:1,speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"50%",left:"50%",position:"absolute"};s.defaults={},o(s.prototype,{spin:function(e){this.stop();var i=this,n=i.opts,o=i.el=r(t(0,{className:n.className}),{position:n.position,width:0,zIndex:n.zIndex});if(n.radius+n.length+n.width,r(o,{left:n.left,top:n.top}),e&&e.insertBefore(o,e.firstChild||null),o.setAttribute("role","progressbar"),i.lines(o,i.opts),!u){var a,s=0,l=(n.lines-1)*(1-n.direction)/2,d=n.fps,c=d/n.speed,p=(1-n.opacity)/(c*n.trail/100),f=c/n.lines;(function h(){s++;for(var t=0;n.lines>t;t++)a=Math.max(1-(s+(n.lines-t)*f)%c*p,n.opacity),i.opacity(o,t*n.direction+l,a,n);i.timeout=i.el&&setTimeout(h,~~(1e3/d))})()}return i},stop:function(){var t=this.el;return t&&(clearTimeout(this.timeout),t.parentNode&&t.parentNode.removeChild(t),this.el=void 0),this},lines:function(n,o){function s(e,i){return r(t(),{position:"absolute",width:o.length+o.width+"px",height:o.width+"px",background:e,boxShadow:i,transformOrigin:"left",transform:"rotate("+~~(360/o.lines*d+o.rotate)+"deg) translate("+o.radius+"px"+",0)",borderRadius:(o.corners*o.width>>1)+"px"})}for(var l,d=0,c=(o.lines-1)*(1-o.direction)/2;o.lines>d;d++)l=r(t(),{position:"absolute",top:1+~(o.width/2)+"px",transform:o.hwaccel?"translate3d(0,0,0)":"",opacity:o.opacity,animation:u&&i(o.opacity,o.trail,c+d*o.direction,o.lines)+" "+1/o.speed+"s linear infinite"}),o.shadow&&e(l,r(s("#000","0 0 4px #000"),{top:"2px"})),e(n,e(l,s(a(o.color,d),"0 0 1px rgba(0,0,0,.1)")));return n},opacity:function(t,e,i){t.childNodes.length>e&&(t.childNodes[e].style.opacity=i)}});var h=r(t("group"),{behavior:"url(#default#VML)"});return!n(h,"transform")&&h.adj?l():u=n(h,"animation"),s}); |
File diff suppressed because one or more lines are too long
@ -1,8 +0,0 @@ |
|||
/*! |
|||
* jQuery Mousewheel 3.1.13 |
|||
* |
|||
* Copyright 2015 jQuery Foundation and other contributors |
|||
* Released under the MIT license. |
|||
* http://jquery.org/license
|
|||
*/ |
|||
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}); |
@ -1,476 +0,0 @@ |
|||
/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress |
|||
* @license MIT */ |
|||
|
|||
;(function(root, factory) { |
|||
|
|||
if (typeof define === 'function' && define.amd) { |
|||
define(factory); |
|||
} else if (typeof exports === 'object') { |
|||
module.exports = factory(); |
|||
} else { |
|||
root.NProgress = factory(); |
|||
} |
|||
|
|||
})(this, function() { |
|||
var NProgress = {}; |
|||
|
|||
NProgress.version = '0.2.0'; |
|||
|
|||
var Settings = NProgress.settings = { |
|||
minimum: 0.08, |
|||
easing: 'ease', |
|||
positionUsing: '', |
|||
speed: 200, |
|||
trickle: true, |
|||
trickleRate: 0.02, |
|||
trickleSpeed: 800, |
|||
showSpinner: true, |
|||
barSelector: '[role="bar"]', |
|||
spinnerSelector: '[role="spinner"]', |
|||
parent: 'body', |
|||
template: '<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>' |
|||
}; |
|||
|
|||
/** |
|||
* Updates configuration. |
|||
* |
|||
* NProgress.configure({ |
|||
* minimum: 0.1 |
|||
* }); |
|||
*/ |
|||
NProgress.configure = function(options) { |
|||
var key, value; |
|||
for (key in options) { |
|||
value = options[key]; |
|||
if (value !== undefined && options.hasOwnProperty(key)) Settings[key] = value; |
|||
} |
|||
|
|||
return this; |
|||
}; |
|||
|
|||
/** |
|||
* Last number. |
|||
*/ |
|||
|
|||
NProgress.status = null; |
|||
|
|||
/** |
|||
* Sets the progress bar status, where `n` is a number from `0.0` to `1.0`. |
|||
* |
|||
* NProgress.set(0.4); |
|||
* NProgress.set(1.0); |
|||
*/ |
|||
|
|||
NProgress.set = function(n) { |
|||
var started = NProgress.isStarted(); |
|||
|
|||
n = clamp(n, Settings.minimum, 1); |
|||
NProgress.status = (n === 1 ? null : n); |
|||
|
|||
var progress = NProgress.render(!started), |
|||
bar = progress.querySelector(Settings.barSelector), |
|||
speed = Settings.speed, |
|||
ease = Settings.easing; |
|||
|
|||
progress.offsetWidth; /* Repaint */ |
|||
|
|||
queue(function(next) { |
|||
// Set positionUsing if it hasn't already been set
|
|||
if (Settings.positionUsing === '') Settings.positionUsing = NProgress.getPositioningCSS(); |
|||
|
|||
// Add transition
|
|||
css(bar, barPositionCSS(n, speed, ease)); |
|||
|
|||
if (n === 1) { |
|||
// Fade out
|
|||
css(progress, { |
|||
transition: 'none', |
|||
opacity: 1 |
|||
}); |
|||
progress.offsetWidth; /* Repaint */ |
|||
|
|||
setTimeout(function() { |
|||
css(progress, { |
|||
transition: 'all ' + speed + 'ms linear', |
|||
opacity: 0 |
|||
}); |
|||
setTimeout(function() { |
|||
NProgress.remove(); |
|||
next(); |
|||
}, speed); |
|||
}, speed); |
|||
} else { |
|||
setTimeout(next, speed); |
|||
} |
|||
}); |
|||
|
|||
return this; |
|||
}; |
|||
|
|||
NProgress.isStarted = function() { |
|||
return typeof NProgress.status === 'number'; |
|||
}; |
|||
|
|||
/** |
|||
* Shows the progress bar. |
|||
* This is the same as setting the status to 0%, except that it doesn't go backwards. |
|||
* |
|||
* NProgress.start(); |
|||
* |
|||
*/ |
|||
NProgress.start = function() { |
|||
if (!NProgress.status) NProgress.set(0); |
|||
|
|||
var work = function() { |
|||
setTimeout(function() { |
|||
if (!NProgress.status) return; |
|||
NProgress.trickle(); |
|||
work(); |
|||
}, Settings.trickleSpeed); |
|||
}; |
|||
|
|||
if (Settings.trickle) work(); |
|||
|
|||
return this; |
|||
}; |
|||
|
|||
/** |
|||
* Hides the progress bar. |
|||
* This is the *sort of* the same as setting the status to 100%, with the |
|||
* difference being `done()` makes some placebo effect of some realistic motion. |
|||
* |
|||
* NProgress.done(); |
|||
* |
|||
* If `true` is passed, it will show the progress bar even if its hidden. |
|||
* |
|||
* NProgress.done(true); |
|||
*/ |
|||
|
|||
NProgress.done = function(force) { |
|||
if (!force && !NProgress.status) return this; |
|||
|
|||
return NProgress.inc(0.3 + 0.5 * Math.random()).set(1); |
|||
}; |
|||
|
|||
/** |
|||
* Increments by a random amount. |
|||
*/ |
|||
|
|||
NProgress.inc = function(amount) { |
|||
var n = NProgress.status; |
|||
|
|||
if (!n) { |
|||
return NProgress.start(); |
|||
} else { |
|||
if (typeof amount !== 'number') { |
|||
amount = (1 - n) * clamp(Math.random() * n, 0.1, 0.95); |
|||
} |
|||
|
|||
n = clamp(n + amount, 0, 0.994); |
|||
return NProgress.set(n); |
|||
} |
|||
}; |
|||
|
|||
NProgress.trickle = function() { |
|||
return NProgress.inc(Math.random() * Settings.trickleRate); |
|||
}; |
|||
|
|||
/** |
|||
* Waits for all supplied jQuery promises and |
|||
* increases the progress as the promises resolve. |
|||
* |
|||
* @param $promise jQUery Promise |
|||
*/ |
|||
(function() { |
|||
var initial = 0, current = 0; |
|||
|
|||
NProgress.promise = function($promise) { |
|||
if (!$promise || $promise.state() === "resolved") { |
|||
return this; |
|||
} |
|||
|
|||
if (current === 0) { |
|||
NProgress.start(); |
|||
} |
|||
|
|||
initial++; |
|||
current++; |
|||
|
|||
$promise.always(function() { |
|||
current--; |
|||
if (current === 0) { |
|||
initial = 0; |
|||
NProgress.done(); |
|||
} else { |
|||
NProgress.set((initial - current) / initial); |
|||
} |
|||
}); |
|||
|
|||
return this; |
|||
}; |
|||
|
|||
})(); |
|||
|
|||
/** |
|||
* (Internal) renders the progress bar markup based on the `template` |
|||
* setting. |
|||
*/ |
|||
|
|||
NProgress.render = function(fromStart) { |
|||
if (NProgress.isRendered()) return document.getElementById('nprogress'); |
|||
|
|||
addClass(document.documentElement, 'nprogress-busy'); |
|||
|
|||
var progress = document.createElement('div'); |
|||
progress.id = 'nprogress'; |
|||
progress.innerHTML = Settings.template; |
|||
|
|||
var bar = progress.querySelector(Settings.barSelector), |
|||
perc = fromStart ? '-100' : toBarPerc(NProgress.status || 0), |
|||
parent = document.querySelector(Settings.parent), |
|||
spinner; |
|||
|
|||
css(bar, { |
|||
transition: 'all 0 linear', |
|||
transform: 'translate3d(' + perc + '%,0,0)' |
|||
}); |
|||
|
|||
if (!Settings.showSpinner) { |
|||
spinner = progress.querySelector(Settings.spinnerSelector); |
|||
spinner && removeElement(spinner); |
|||
} |
|||
|
|||
if (parent != document.body) { |
|||
addClass(parent, 'nprogress-custom-parent'); |
|||
} |
|||
|
|||
parent.appendChild(progress); |
|||
return progress; |
|||
}; |
|||
|
|||
/** |
|||
* Removes the element. Opposite of render(). |
|||
*/ |
|||
|
|||
NProgress.remove = function() { |
|||
removeClass(document.documentElement, 'nprogress-busy'); |
|||
removeClass(document.querySelector(Settings.parent), 'nprogress-custom-parent'); |
|||
var progress = document.getElementById('nprogress'); |
|||
progress && removeElement(progress); |
|||
}; |
|||
|
|||
/** |
|||
* Checks if the progress bar is rendered. |
|||
*/ |
|||
|
|||
NProgress.isRendered = function() { |
|||
return !!document.getElementById('nprogress'); |
|||
}; |
|||
|
|||
/** |
|||
* Determine which positioning CSS rule to use. |
|||
*/ |
|||
|
|||
NProgress.getPositioningCSS = function() { |
|||
// Sniff on document.body.style
|
|||
var bodyStyle = document.body.style; |
|||
|
|||
// Sniff prefixes
|
|||
var vendorPrefix = ('WebkitTransform' in bodyStyle) ? 'Webkit' : |
|||
('MozTransform' in bodyStyle) ? 'Moz' : |
|||
('msTransform' in bodyStyle) ? 'ms' : |
|||
('OTransform' in bodyStyle) ? 'O' : ''; |
|||
|
|||
if (vendorPrefix + 'Perspective' in bodyStyle) { |
|||
// Modern browsers with 3D support, e.g. Webkit, IE10
|
|||
return 'translate3d'; |
|||
} else if (vendorPrefix + 'Transform' in bodyStyle) { |
|||
// Browsers without 3D support, e.g. IE9
|
|||
return 'translate'; |
|||
} else { |
|||
// Browsers without translate() support, e.g. IE7-8
|
|||
return 'margin'; |
|||
} |
|||
}; |
|||
|
|||
/** |
|||
* Helpers |
|||
*/ |
|||
|
|||
function clamp(n, min, max) { |
|||
if (n < min) return min; |
|||
if (n > max) return max; |
|||
return n; |
|||
} |
|||
|
|||
/** |
|||
* (Internal) converts a percentage (`0..1`) to a bar translateX |
|||
* percentage (`-100%..0%`). |
|||
*/ |
|||
|
|||
function toBarPerc(n) { |
|||
return (-1 + n) * 100; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* (Internal) returns the correct CSS for changing the bar's |
|||
* position given an n percentage, and speed and ease from Settings |
|||
*/ |
|||
|
|||
function barPositionCSS(n, speed, ease) { |
|||
var barCSS; |
|||
|
|||
if (Settings.positionUsing === 'translate3d') { |
|||
barCSS = { transform: 'translate3d('+toBarPerc(n)+'%,0,0)' }; |
|||
} else if (Settings.positionUsing === 'translate') { |
|||
barCSS = { transform: 'translate('+toBarPerc(n)+'%,0)' }; |
|||
} else { |
|||
barCSS = { 'margin-left': toBarPerc(n)+'%' }; |
|||
} |
|||
|
|||
barCSS.transition = 'all '+speed+'ms '+ease; |
|||
|
|||
return barCSS; |
|||
} |
|||
|
|||
/** |
|||
* (Internal) Queues a function to be executed. |
|||
*/ |
|||
|
|||
var queue = (function() { |
|||
var pending = []; |
|||
|
|||
function next() { |
|||
var fn = pending.shift(); |
|||
if (fn) { |
|||
fn(next); |
|||
} |
|||
} |
|||
|
|||
return function(fn) { |
|||
pending.push(fn); |
|||
if (pending.length == 1) next(); |
|||
}; |
|||
})(); |
|||
|
|||
/** |
|||
* (Internal) Applies css properties to an element, similar to the jQuery |
|||
* css method. |
|||
* |
|||
* While this helper does assist with vendor prefixed property names, it |
|||
* does not perform any manipulation of values prior to setting styles. |
|||
*/ |
|||
|
|||
var css = (function() { |
|||
var cssPrefixes = [ 'Webkit', 'O', 'Moz', 'ms' ], |
|||
cssProps = {}; |
|||
|
|||
function camelCase(string) { |
|||
return string.replace(/^-ms-/, 'ms-').replace(/-([\da-z])/gi, function(match, letter) { |
|||
return letter.toUpperCase(); |
|||
}); |
|||
} |
|||
|
|||
function getVendorProp(name) { |
|||
var style = document.body.style; |
|||
if (name in style) return name; |
|||
|
|||
var i = cssPrefixes.length, |
|||
capName = name.charAt(0).toUpperCase() + name.slice(1), |
|||
vendorName; |
|||
while (i--) { |
|||
vendorName = cssPrefixes[i] + capName; |
|||
if (vendorName in style) return vendorName; |
|||
} |
|||
|
|||
return name; |
|||
} |
|||
|
|||
function getStyleProp(name) { |
|||
name = camelCase(name); |
|||
return cssProps[name] || (cssProps[name] = getVendorProp(name)); |
|||
} |
|||
|
|||
function applyCss(element, prop, value) { |
|||
prop = getStyleProp(prop); |
|||
element.style[prop] = value; |
|||
} |
|||
|
|||
return function(element, properties) { |
|||
var args = arguments, |
|||
prop, |
|||
value; |
|||
|
|||
if (args.length == 2) { |
|||
for (prop in properties) { |
|||
value = properties[prop]; |
|||
if (value !== undefined && properties.hasOwnProperty(prop)) applyCss(element, prop, value); |
|||
} |
|||
} else { |
|||
applyCss(element, args[1], args[2]); |
|||
} |
|||
} |
|||
})(); |
|||
|
|||
/** |
|||
* (Internal) Determines if an element or space separated list of class names contains a class name. |
|||
*/ |
|||
|
|||
function hasClass(element, name) { |
|||
var list = typeof element == 'string' ? element : classList(element); |
|||
return list.indexOf(' ' + name + ' ') >= 0; |
|||
} |
|||
|
|||
/** |
|||
* (Internal) Adds a class to an element. |
|||
*/ |
|||
|
|||
function addClass(element, name) { |
|||
var oldList = classList(element), |
|||
newList = oldList + name; |
|||
|
|||
if (hasClass(oldList, name)) return; |
|||
|
|||
// Trim the opening space.
|
|||
element.className = newList.substring(1); |
|||
} |
|||
|
|||
/** |
|||
* (Internal) Removes a class from an element. |
|||
*/ |
|||
|
|||
function removeClass(element, name) { |
|||
var oldList = classList(element), |
|||
newList; |
|||
|
|||
if (!hasClass(element, name)) return; |
|||
|
|||
// Replace the class name.
|
|||
newList = oldList.replace(' ' + name + ' ', ' '); |
|||
|
|||
// Trim the opening and closing spaces.
|
|||
element.className = newList.substring(1, newList.length - 1); |
|||
} |
|||
|
|||
/** |
|||
* (Internal) Gets a space separated list of the class names on the element. |
|||
* The list is wrapped with a single space on each end to facilitate finding |
|||
* matches within the list. |
|||
*/ |
|||
|
|||
function classList(element) { |
|||
return (' ' + (element.className || '') + ' ').replace(/\s+/gi, ' '); |
|||
} |
|||
|
|||
/** |
|||
* (Internal) Removes an element from the DOM. |
|||
*/ |
|||
|
|||
function removeElement(element) { |
|||
element && element.parentNode && element.parentNode.removeChild(element); |
|||
} |
|||
|
|||
return NProgress; |
|||
}); |
|||
|
@ -1,6 +0,0 @@ |
|||
/*! |
|||
* screenfull |
|||
* v3.0.0 - 2015-11-24 |
|||
* (c) Sindre Sorhus; MIT License |
|||
*/ |
|||
!function(){"use strict";var a="undefined"!=typeof module&&module.exports,b="undefined"!=typeof Element&&"ALLOW_KEYBOARD_INPUT"in Element,c=function(){for(var a,b,c=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],d=0,e=c.length,f={};e>d;d++)if(a=c[d],a&&a[1]in document){for(d=0,b=a.length;b>d;d++)f[c[0][d]]=a[d];return f}return!1}(),d={request:function(a){var d=c.requestFullscreen;a=a||document.documentElement,/5\.1[\.\d]* Safari/.test(navigator.userAgent)?a[d]():a[d](b&&Element.ALLOW_KEYBOARD_INPUT)},exit:function(){document[c.exitFullscreen]()},toggle:function(a){this.isFullscreen?this.exit():this.request(a)},raw:c};return c?(Object.defineProperties(d,{isFullscreen:{get:function(){return Boolean(document[c.fullscreenElement])}},element:{enumerable:!0,get:function(){return document[c.fullscreenElement]}},enabled:{enumerable:!0,get:function(){return Boolean(document[c.fullscreenEnabled])}}}),void(a?module.exports=d:window.screenfull=d)):void(a?module.exports=!1:window.screenfull=!1)}(); |
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 173 KiB |
@ -1,29 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
(function(window, document, $) { |
|||
'use strict'; |
|||
|
|||
$.configs.set('tour', { |
|||
steps: [{ |
|||
element: "#toggleMenubar", |
|||
position: "right", |
|||
intro: "Offcanvas Menu <p class='content'>It is nice custom navigation for desktop users and a seek off-canvas menu for tablet and mobile users</p>" |
|||
}, { |
|||
element: "#toggleFullscreen", |
|||
intro: "Full Screen <p class='content'>Click this button you can view the admin template in full screen</p>" |
|||
}, { |
|||
element: "#toggleChat", |
|||
position: 'left', |
|||
intro: "Quick Conversations <p class='content'>This is a sidebar dialog box for user conversations list, you can even create a quick conversation with other users</p>" |
|||
}], |
|||
skipLabel: "<i class='md-close'></i>", |
|||
doneLabel: "<i class='md-close'></i>", |
|||
nextLabel: "Next <i class='md-chevron-right'></i>", |
|||
prevLabel: "<i class='md-chevron-left'></i>Prev", |
|||
showBullets: false |
|||
}); |
|||
|
|||
})(window, document, $); |
@ -1,6 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
!function(window,document,$){"use strict";$.configs.set("tour",{steps:[{element:"#toggleMenubar",position:"right",intro:"Offcanvas Menu <p class='content'>It is nice custom navigation for desktop users and a seek off-canvas menu for tablet and mobile users</p>"},{element:"#toggleFullscreen",intro:"Full Screen <p class='content'>Click this button you can view the admin template in full screen</p>"},{element:"#toggleChat",position:"left",intro:"Quick Conversations <p class='content'>This is a sidebar dialog box for user conversations list, you can even create a quick conversation with other users</p>"}],skipLabel:"<i class='md-close'></i>",doneLabel:"<i class='md-close'></i>",nextLabel:"Next <i class='md-chevron-right'></i>",prevLabel:"<i class='md-chevron-left'></i>Prev",showBullets:!1})}(window,document,$); |
@ -1,194 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
(function(window, document, $) { |
|||
'use strict'; |
|||
|
|||
$.site.menu = { |
|||
speed: 250, |
|||
init: function() { |
|||
this.$instance = $('.site-menu'); |
|||
|
|||
if (this.$instance.length === 0) { |
|||
return; |
|||
} |
|||
|
|||
this.bind(); |
|||
}, |
|||
|
|||
bind: function() { |
|||
var self = this; |
|||
|
|||
this.$instance.on('mouseenter.site.menu', '.site-menu-item', function(e) { |
|||
var $item = $(this); |
|||
if ($item.is('.has-sub') && $item.parent('.site-menu').length > 0) { |
|||
var $sub = $item.children('.site-menu-sub'); |
|||
self.position($item, $sub); |
|||
} |
|||
|
|||
$item.addClass('hover'); |
|||
}).on('mouseleave.site.menu', '.site-menu-item', function() { |
|||
var $item = $(this); |
|||
if ($item.is('.has-sub') && $item.parent('.site-menu').length > 0) { |
|||
$item.children('.site-menu-sub').css("max-height", ""); |
|||
} |
|||
|
|||
$item.removeClass('hover'); |
|||
}).on('deactive.site.menu', '.site-menu-item.active', function(e) { |
|||
var $item = $(this); |
|||
|
|||
$item.removeClass('active'); |
|||
|
|||
e.stopPropagation(); |
|||
}).on('active.site.menu', '.site-menu-item', function(e) { |
|||
var $item = $(this); |
|||
|
|||
$item.addClass('active'); |
|||
|
|||
e.stopPropagation(); |
|||
}).on('open.site.menu', '.site-menu-item', function(e) { |
|||
var $item = $(this); |
|||
|
|||
self.expand($item, function() { |
|||
$item.addClass('open'); |
|||
}); |
|||
|
|||
$item.siblings('.open').trigger('close.site.menu'); |
|||
|
|||
e.stopPropagation(); |
|||
}).on('close.site.menu', '.site-menu-item.open', function(e) { |
|||
var $item = $(this); |
|||
|
|||
self.collapse($item, function() { |
|||
$item.removeClass('open'); |
|||
}); |
|||
|
|||
e.stopPropagation(); |
|||
}).on('click.site.menu ', '.site-menu-item', function(e) { |
|||
var $item = $(this); |
|||
if ($item.parent('.site-menu').length == 0 && $item.is('.has-sub') && $(e.target).closest('.site-menu-item').is(this)) { |
|||
if ($item.is('.open')) { |
|||
$item.trigger('close.site.menu'); |
|||
} else { |
|||
$item.trigger('open.site.menu'); |
|||
} |
|||
} else { |
|||
if (!$item.is('.active')) { |
|||
$item.siblings('.active').trigger('deactive.site.menu'); |
|||
$item.trigger('active.site.menu'); |
|||
} |
|||
} |
|||
|
|||
e.stopPropagation(); |
|||
}).on('tap.site.menu', '> .site-menu-item', function() { |
|||
var $item = $(this); |
|||
|
|||
if ($item.is('.has-sub') && $item.parent('.site-menu').length > 0) { |
|||
$item.siblings('.hover').each(function() { |
|||
var $item = $(this); |
|||
if ($item.is('.has-sub') && $item.parent('.site-menu').length > 0) { |
|||
$item.children('.site-menu-sub').css("max-height", ""); |
|||
} |
|||
|
|||
$item.removeClass('hover'); |
|||
}); |
|||
|
|||
if ($item.is('.hover')) { |
|||
if ($item.is('.has-sub') && $item.parent('.site-menu').length > 0) { |
|||
$item.children('.site-menu-sub').css("max-height", ""); |
|||
} |
|||
$item.removeClass('hover'); |
|||
} else { |
|||
if ($item.is('.has-sub') && $item.parent('.site-menu').length > 0) { |
|||
var $sub = $item.children('.site-menu-sub'); |
|||
self.position($item, $sub); |
|||
} |
|||
$item.addClass('hover'); |
|||
} |
|||
} else { |
|||
var $link = $(this).find('a'); |
|||
if ($link.length > 0) { |
|||
var link = $link.attr('href'); |
|||
|
|||
if (link) { |
|||
window.location = link; |
|||
} |
|||
} |
|||
} |
|||
}).on('scroll.site.menu', '.site-menu-sub', function(e) { |
|||
e.stopPropagation(); |
|||
}); |
|||
}, |
|||
|
|||
collapse: function($item, callback) { |
|||
var self = this; |
|||
var $sub = $item.children('.site-menu-sub'); |
|||
|
|||
$sub.show().slideUp(this.speed, function() { |
|||
$(this).css('display', ''); |
|||
|
|||
$(this).find('> .site-menu-item').removeClass('is-shown'); |
|||
|
|||
if (callback) { |
|||
callback(); |
|||
} |
|||
self.$instance.trigger('collapsed.site.menu'); |
|||
}); |
|||
}, |
|||
|
|||
expand: function($item, callback) { |
|||
var self = this; |
|||
var $sub = $item.children('.site-menu-sub'); |
|||
var $children = $sub.children('.site-menu-item').addClass('is-hidden'); |
|||
|
|||
$sub.hide().slideDown(this.speed, function() { |
|||
$(this).css('display', ''); |
|||
|
|||
if (callback) { |
|||
callback(); |
|||
} |
|||
|
|||
self.$instance.trigger('expanded.site.menu'); |
|||
}); |
|||
|
|||
setTimeout(function() { |
|||
$children.addClass('is-shown'); |
|||
$children.removeClass('is-hidden'); |
|||
}, 0); |
|||
}, |
|||
|
|||
refresh: function() { |
|||
this.$instance.find('.open').filter(':not(.active)').removeClass('open'); |
|||
}, |
|||
|
|||
position: function($item, $dropdown) { |
|||
var offsetTop = $item.position().top, |
|||
dropdownHeight = $dropdown.outerHeight(), |
|||
menubarHeight = $.site.menubar.$instance.outerHeight(), |
|||
itemHeight = $item.find("> a").outerHeight(); |
|||
|
|||
$dropdown.removeClass('site-menu-sub-up').css('max-height', ""); |
|||
|
|||
//if (offsetTop + dropdownHeight > menubarHeight) {
|
|||
if (offsetTop > menubarHeight / 2) { |
|||
$dropdown.addClass('site-menu-sub-up'); |
|||
|
|||
if ($.site.menubar.foldAlt) { |
|||
offsetTop = offsetTop - itemHeight; |
|||
} |
|||
//if(dropdownHeight > offsetTop + itemHeight) {
|
|||
$dropdown.css('max-height', offsetTop + itemHeight); |
|||
//}
|
|||
} else { |
|||
if ($.site.menubar.foldAlt) { |
|||
offsetTop = offsetTop + itemHeight; |
|||
} |
|||
$dropdown.removeClass('site-menu-sub-up'); |
|||
$dropdown.css('max-height', menubarHeight - offsetTop); |
|||
} |
|||
//}
|
|||
} |
|||
}; |
|||
})(window, document, jQuery); |
@ -1,6 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
!function(window,document,$){"use strict";$.site.menu={speed:250,init:function(){this.$instance=$(".site-menu"),0!==this.$instance.length&&this.bind()},bind:function(){var self=this;this.$instance.on("mouseenter.site.menu",".site-menu-item",function(e){var $item=$(this);if($item.is(".has-sub")&&$item.parent(".site-menu").length>0){var $sub=$item.children(".site-menu-sub");self.position($item,$sub)}$item.addClass("hover")}).on("mouseleave.site.menu",".site-menu-item",function(){var $item=$(this);$item.is(".has-sub")&&$item.parent(".site-menu").length>0&&$item.children(".site-menu-sub").css("max-height",""),$item.removeClass("hover")}).on("deactive.site.menu",".site-menu-item.active",function(e){var $item=$(this);$item.removeClass("active"),e.stopPropagation()}).on("active.site.menu",".site-menu-item",function(e){var $item=$(this);$item.addClass("active"),e.stopPropagation()}).on("open.site.menu",".site-menu-item",function(e){var $item=$(this);self.expand($item,function(){$item.addClass("open")}),$item.siblings(".open").trigger("close.site.menu"),e.stopPropagation()}).on("close.site.menu",".site-menu-item.open",function(e){var $item=$(this);self.collapse($item,function(){$item.removeClass("open")}),e.stopPropagation()}).on("click.site.menu ",".site-menu-item",function(e){var $item=$(this);0==$item.parent(".site-menu").length&&$item.is(".has-sub")&&$(e.target).closest(".site-menu-item").is(this)?$item.is(".open")?$item.trigger("close.site.menu"):$item.trigger("open.site.menu"):$item.is(".active")||($item.siblings(".active").trigger("deactive.site.menu"),$item.trigger("active.site.menu")),e.stopPropagation()}).on("tap.site.menu","> .site-menu-item",function(){var $item=$(this);if($item.is(".has-sub")&&$item.parent(".site-menu").length>0)if($item.siblings(".hover").each(function(){var $item=$(this);$item.is(".has-sub")&&$item.parent(".site-menu").length>0&&$item.children(".site-menu-sub").css("max-height",""),$item.removeClass("hover")}),$item.is(".hover"))$item.is(".has-sub")&&$item.parent(".site-menu").length>0&&$item.children(".site-menu-sub").css("max-height",""),$item.removeClass("hover");else{if($item.is(".has-sub")&&$item.parent(".site-menu").length>0){var $sub=$item.children(".site-menu-sub");self.position($item,$sub)}$item.addClass("hover")}else{var $link=$(this).find("a");if($link.length>0){var link=$link.attr("href");link&&(window.location=link)}}}).on("scroll.site.menu",".site-menu-sub",function(e){e.stopPropagation()})},collapse:function($item,callback){var self=this,$sub=$item.children(".site-menu-sub");$sub.show().slideUp(this.speed,function(){$(this).css("display",""),$(this).find("> .site-menu-item").removeClass("is-shown"),callback&&callback(),self.$instance.trigger("collapsed.site.menu")})},expand:function($item,callback){var self=this,$sub=$item.children(".site-menu-sub"),$children=$sub.children(".site-menu-item").addClass("is-hidden");$sub.hide().slideDown(this.speed,function(){$(this).css("display",""),callback&&callback(),self.$instance.trigger("expanded.site.menu")}),setTimeout(function(){$children.addClass("is-shown"),$children.removeClass("is-hidden")},0)},refresh:function(){this.$instance.find(".open").filter(":not(.active)").removeClass("open")},position:function($item,$dropdown){var offsetTop=$item.position().top,menubarHeight=($dropdown.outerHeight(),$.site.menubar.$instance.outerHeight()),itemHeight=$item.find("> a").outerHeight();$dropdown.removeClass("site-menu-sub-up").css("max-height",""),offsetTop>menubarHeight/2?($dropdown.addClass("site-menu-sub-up"),$.site.menubar.foldAlt&&(offsetTop-=itemHeight),$dropdown.css("max-height",offsetTop+itemHeight)):($.site.menubar.foldAlt&&(offsetTop+=itemHeight),$dropdown.removeClass("site-menu-sub-up"),$dropdown.css("max-height",menubarHeight-offsetTop))}}}(window,document,jQuery); |
@ -1,164 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
(function(window, document, $) { |
|||
'use strict'; |
|||
|
|||
var $body = $('body'), |
|||
$html = $('html'); |
|||
|
|||
$.site.menubar = { |
|||
opened: null, |
|||
top: false, |
|||
$instance: null, |
|||
auto: true, |
|||
|
|||
init: function() { |
|||
$html.removeClass('css-menubar').addClass('js-menubar'); |
|||
|
|||
this.$instance = $(".site-menubar"); |
|||
|
|||
if (this.$instance.length === 0) { |
|||
return; |
|||
} |
|||
|
|||
var self = this; |
|||
|
|||
this.$instance.on('changed.site.menubar', function() { |
|||
self.update(); |
|||
}); |
|||
|
|||
this.hoverscroll.enable(); |
|||
|
|||
this.change(); |
|||
}, |
|||
|
|||
change: function() { |
|||
var breakpoint = Breakpoints.current(); |
|||
|
|||
if ($body.hasClass('site-menubar-keep') && $body.hasClass('site-menubar-hide')) { |
|||
this.hide(); |
|||
|
|||
if (breakpoint && $body.hasClass('site-menubar-unfold')) { |
|||
if (breakpoint.name === "xs") { |
|||
this.hide(); |
|||
} |
|||
} |
|||
} else { |
|||
this.reset(); |
|||
|
|||
if (breakpoint) { |
|||
if (breakpoint.name === "xs") { |
|||
this.hide(); |
|||
} else { |
|||
this.unfold(); |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
|
|||
animate: function(doing, callback) { |
|||
var self = this; |
|||
$body.addClass('site-menubar-changing'); |
|||
|
|||
doing.call(self); |
|||
this.$instance.trigger('changing.site.menubar'); |
|||
|
|||
setTimeout(function() { |
|||
callback.call(self); |
|||
$body.removeClass('site-menubar-changing'); |
|||
|
|||
self.$instance.trigger('changed.site.menubar'); |
|||
}, 500); |
|||
}, |
|||
|
|||
reset: function() { |
|||
this.opened = null; |
|||
$body.removeClass('site-menubar-hide site-menubar-unfold'); |
|||
}, |
|||
|
|||
hide: function() { |
|||
if (this.opened !== false) { |
|||
this.animate(function() { |
|||
$body.removeClass('site-menubar-unfold').addClass('site-menubar-hide'); |
|||
this.opened = false; |
|||
|
|||
}, function() { |
|||
|
|||
}); |
|||
} |
|||
}, |
|||
|
|||
unfold: function() { |
|||
if (this.opened !== true) { |
|||
this.animate(function() { |
|||
$body.removeClass('site-menubar-hide').addClass('site-menubar-unfold'); |
|||
this.opened = true; |
|||
}, function() { |
|||
$.site.resize(); |
|||
}); |
|||
} |
|||
}, |
|||
|
|||
toggle: function() { |
|||
var breakpoint = Breakpoints.current(); |
|||
var opened = this.opened; |
|||
|
|||
if (!opened) { |
|||
this.unfold(); |
|||
} else { |
|||
this.hide(); |
|||
} |
|||
}, |
|||
|
|||
update: function() { |
|||
this.hoverscroll.update(); |
|||
}, |
|||
|
|||
hoverscroll: { |
|||
api: null, |
|||
|
|||
init: function() { |
|||
this.api = $.site.menubar.$instance.children('.site-menubar-body').asHoverScroll({ |
|||
namespace: 'hoverscorll', |
|||
direction: 'vertical', |
|||
list: '.site-menu', |
|||
item: '> .site-menu-item', |
|||
exception: '.site-menu-sub', |
|||
fixed: false, |
|||
boundary: 100, |
|||
onEnter: function() { |
|||
//$(this).siblings().removeClass('hover');
|
|||
//$(this).addClass('hover');
|
|||
}, |
|||
onLeave: function() { |
|||
//$(this).removeClass('hover');
|
|||
} |
|||
}).data('asHoverScroll'); |
|||
}, |
|||
|
|||
update: function() { |
|||
if (this.api) { |
|||
this.api.update(); |
|||
} |
|||
}, |
|||
|
|||
enable: function() { |
|||
if (!this.api) { |
|||
this.init(); |
|||
} |
|||
if (this.api) { |
|||
this.api.enable(); |
|||
} |
|||
}, |
|||
|
|||
disable: function() { |
|||
if (this.api) { |
|||
this.api.disable(); |
|||
} |
|||
} |
|||
} |
|||
}; |
|||
})(window, document, jQuery); |
@ -1,6 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
!function(window,document,$){"use strict";var $body=$("body"),$html=$("html");$.site.menubar={opened:null,top:!1,$instance:null,auto:!0,init:function(){if($html.removeClass("css-menubar").addClass("js-menubar"),this.$instance=$(".site-menubar"),0!==this.$instance.length){var self=this;this.$instance.on("changed.site.menubar",function(){self.update()}),this.hoverscroll.enable(),this.change()}},change:function(){var breakpoint=Breakpoints.current();$body.hasClass("site-menubar-keep")&&$body.hasClass("site-menubar-hide")?(this.hide(),breakpoint&&$body.hasClass("site-menubar-unfold")&&"xs"===breakpoint.name&&this.hide()):(this.reset(),breakpoint&&("xs"===breakpoint.name?this.hide():this.unfold()))},animate:function(doing,callback){var self=this;$body.addClass("site-menubar-changing"),doing.call(self),this.$instance.trigger("changing.site.menubar"),setTimeout(function(){callback.call(self),$body.removeClass("site-menubar-changing"),self.$instance.trigger("changed.site.menubar")},500)},reset:function(){this.opened=null,$body.removeClass("site-menubar-hide site-menubar-unfold")},hide:function(){this.opened!==!1&&this.animate(function(){$body.removeClass("site-menubar-unfold").addClass("site-menubar-hide"),this.opened=!1},function(){})},unfold:function(){this.opened!==!0&&this.animate(function(){$body.removeClass("site-menubar-hide").addClass("site-menubar-unfold"),this.opened=!0},function(){$.site.resize()})},toggle:function(){var opened=(Breakpoints.current(),this.opened);opened?this.hide():this.unfold()},update:function(){this.hoverscroll.update()},hoverscroll:{api:null,init:function(){this.api=$.site.menubar.$instance.children(".site-menubar-body").asHoverScroll({namespace:"hoverscorll",direction:"vertical",list:".site-menu",item:"> .site-menu-item",exception:".site-menu-sub",fixed:!1,boundary:100,onEnter:function(){},onLeave:function(){}}).data("asHoverScroll")},update:function(){this.api&&this.api.update()},enable:function(){this.api||this.init(),this.api&&this.api.enable()},disable:function(){this.api&&this.api.disable()}}}}(window,document,jQuery); |
@ -1,84 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
(function(window, document, $) { |
|||
'use strict'; |
|||
|
|||
$.site.sidebar = { |
|||
init: function() { |
|||
if (typeof $.slidePanel === 'undefined') return; |
|||
|
|||
$(document).on('click', '[data-toggle="site-sidebar"]', function() { |
|||
var $this = $(this); |
|||
|
|||
var direction = 'right'; |
|||
if ($('body').hasClass('site-menubar-flipped')) { |
|||
direction = 'left'; |
|||
} |
|||
|
|||
var defaults = $.components.getDefaults("slidePanel"); |
|||
var options = $.extend({}, defaults, { |
|||
direction: direction, |
|||
skin: 'site-sidebar', |
|||
dragTolerance: 80, |
|||
template: function(options) { |
|||
return '<div class="' + options.classes.base + ' ' + options.classes.base + '-' + options.direction + '">' + |
|||
'<div class="' + options.classes.content + ' site-sidebar-content"></div>' + |
|||
'<div class="slidePanel-handler"></div>' + |
|||
'</div>'; |
|||
}, |
|||
afterLoad: function() { |
|||
var self = this; |
|||
this.$panel.find('.tab-pane').asScrollable({ |
|||
namespace: 'scrollable', |
|||
contentSelector: "> div", |
|||
containerSelector: "> div" |
|||
}); |
|||
|
|||
$.components.init('switchery', self.$panel); |
|||
|
|||
this.$panel.on('shown.bs.tab', function() { |
|||
self.$panel.find(".tab-pane.active").asScrollable('update'); |
|||
}); |
|||
}, |
|||
beforeShow: function() { |
|||
if (!$this.hasClass('active')) { |
|||
$this.addClass('active'); |
|||
} |
|||
}, |
|||
afterHide: function() { |
|||
if ($this.hasClass('active')) { |
|||
$this.removeClass('active'); |
|||
} |
|||
} |
|||
}); |
|||
|
|||
if ($this.hasClass('active')) { |
|||
$.slidePanel.hide(); |
|||
} else { |
|||
var url = $this.data('url'); |
|||
if (!url) { |
|||
url = $this.attr('href'); |
|||
url = url && url.replace(/.*(?=#[^\s]*$)/, ''); |
|||
} |
|||
|
|||
$.slidePanel.show({ |
|||
url: url |
|||
}, options); |
|||
} |
|||
}); |
|||
|
|||
$(document).on('click', '[data-toggle="show-chat"]', function() { |
|||
$('#conversation').addClass('active'); |
|||
}); |
|||
|
|||
|
|||
$(document).on('click', '[data-toggle="close-chat"]', function() { |
|||
$('#conversation').removeClass('active'); |
|||
}); |
|||
} |
|||
}; |
|||
|
|||
})(window, document, jQuery); |
@ -1,6 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
!function(window,document,$){"use strict";$.site.sidebar={init:function(){"undefined"!=typeof $.slidePanel&&($(document).on("click",'[data-toggle="site-sidebar"]',function(){var $this=$(this),direction="right";$("body").hasClass("site-menubar-flipped")&&(direction="left");var defaults=$.components.getDefaults("slidePanel"),options=$.extend({},defaults,{direction:direction,skin:"site-sidebar",dragTolerance:80,template:function(options){return'<div class="'+options.classes.base+" "+options.classes.base+"-"+options.direction+'"><div class="'+options.classes.content+' site-sidebar-content"></div><div class="slidePanel-handler"></div></div>'},afterLoad:function(){var self=this;this.$panel.find(".tab-pane").asScrollable({namespace:"scrollable",contentSelector:"> div",containerSelector:"> div"}),$.components.init("switchery",self.$panel),this.$panel.on("shown.bs.tab",function(){self.$panel.find(".tab-pane.active").asScrollable("update")})},beforeShow:function(){$this.hasClass("active")||$this.addClass("active")},afterHide:function(){$this.hasClass("active")&&$this.removeClass("active")}});if($this.hasClass("active"))$.slidePanel.hide();else{var url=$this.data("url");url||(url=$this.attr("href"),url=url&&url.replace(/.*(?=#[^\s]*$)/,"")),$.slidePanel.show({url:url},options)}}),$(document).on("click",'[data-toggle="show-chat"]',function(){$("#conversation").addClass("active")}),$(document).on("click",'[data-toggle="close-chat"]',function(){$("#conversation").removeClass("active")}))}}}(window,document,jQuery); |
@ -1,314 +0,0 @@ |
|||
/*! |
|||
* remark (http://getbootstrapadmin.com/remark)
|
|||
* Copyright 2016 amazingsurge |
|||
* Licensed under the Themeforest Standard Licenses |
|||
*/ |
|||
(function(window, document, $) { |
|||
'use strict'; |
|||
|
|||
var $body = $(document.body); |
|||
|
|||
// configs setup
|
|||
// =============
|
|||
$.configs.set('site', { |
|||
fontFamily: "Noto Sans, sans-serif", |
|||
primaryColor: "indigo", |
|||
assets: "../assets" |
|||
}); |
|||
|
|||
window.Site = $.site.extend({ |
|||
run: function(next) { |
|||
// polyfill
|
|||
this.polyfillIEWidth(); |
|||
|
|||
// Menubar setup
|
|||
// =============
|
|||
if (typeof $.site.menu !== 'undefined') { |
|||
$.site.menu.init(); |
|||
} |
|||
|
|||
if (typeof $.site.menubar !== 'undefined') { |
|||
$(".site-menubar").on('changing.site.menubar', function() { |
|||
$('[data-toggle="menubar"]').each(function() { |
|||
var $this = $(this); |
|||
var $hamburger = $(this).find('.hamburger'); |
|||
|
|||
function toggle($el) { |
|||
$el.toggleClass('hided', !$.site.menubar.opened); |
|||
$el.toggleClass('unfolded', !$.site.menubar.folded); |
|||
} |
|||
if ($hamburger.length > 0) { |
|||
toggle($hamburger); |
|||
} else { |
|||
toggle($this); |
|||
} |
|||
}); |
|||
|
|||
$.site.menu.refresh(); |
|||
}); |
|||
|
|||
$(document).on('click', '[data-toggle="collapse"]', function(e) { |
|||
var $trigger = $(e.target); |
|||
if (!$trigger.is('[data-toggle="collapse"]')) { |
|||
$trigger = $trigger.parents('[data-toggle="collapse"]'); |
|||
} |
|||
var href; |
|||
var target = $trigger.attr('data-target') || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, ''); |
|||
var $target = $(target); |
|||
if ($target.hasClass('navbar-search-overlap')) { |
|||
$target.find('input').focus(); |
|||
|
|||
e.preventDefault(); |
|||
} else if ($target.attr('id') === 'site-navbar-collapse') { |
|||
var isOpen = !$trigger.hasClass('collapsed'); |
|||
$body.addClass('site-navbar-collapsing'); |
|||
|
|||
$body.toggleClass('site-navbar-collapse-show', isOpen); |
|||
|
|||
setTimeout(function() { |
|||
$body.removeClass('site-navbar-collapsing'); |
|||
}, 350); |
|||
} |
|||
}); |
|||
|
|||
$(document).on('click', '[data-toggle="menubar"]', function() { |
|||
$.site.menubar.toggle(); |
|||
|
|||
return false; |
|||
}); |
|||
|
|||
$.site.menubar.init(); |
|||
|
|||
Breakpoints.on('change', function() { |
|||
$.site.menubar.change(); |
|||
}); |
|||
} |
|||
|
|||
// Sidebar setup
|
|||
// =============
|
|||
if (typeof $.site.sidebar !== 'undefined') { |
|||
$.site.sidebar.init(); |
|||
} |
|||
|
|||
// Tooltip setup
|
|||
// =============
|
|||
$(document).tooltip({ |
|||
selector: '[data-tooltip=true]', |
|||
container: 'body' |
|||
}); |
|||
|
|||
$('[data-toggle="tooltip"]').tooltip(); |
|||
$('[data-toggle="popover"]').popover(); |
|||
|
|||
// Fullscreen
|
|||
// ==========
|
|||
if (typeof screenfull !== 'undefined') { |
|||
$(document).on('click', '[data-toggle="fullscreen"]', function() { |
|||
if (screenfull.enabled) { |
|||
screenfull.toggle(); |
|||
} |
|||
|
|||
return false; |
|||
}); |
|||
|
|||
if (screenfull.enabled) { |
|||
document.addEventListener(screenfull.raw.fullscreenchange, function() { |
|||
$('[data-toggle="fullscreen"]').toggleClass('active', screenfull.isFullscreen); |
|||
}); |
|||
} |
|||
} |
|||
|
|||
// Dropdown menu setup
|
|||
// ===================
|
|||
$body.on('click', '.dropdown-menu-media', function(e) { |
|||
e.stopPropagation(); |
|||
}); |
|||
|
|||
|
|||
// Page Animate setup
|
|||
// ==================
|
|||
if (typeof $.animsition !== 'undefined') { |
|||
this.loadAnimate(function() { |
|||
$('.animsition').css({ |
|||
"animation-duration": '0s' |
|||
}); |
|||
next(); |
|||
}); |
|||
} else { |
|||
next(); |
|||
} |
|||
|
|||
// Mega navbar setup
|
|||
// =================
|
|||
$(document).on('click', '.navbar-mega .dropdown-menu', function(e) { |
|||
e.stopPropagation(); |
|||
}); |
|||
|
|||
$(document).on('show.bs.dropdown', function(e) { |
|||
var $target = $(e.target); |
|||
var $trigger = e.relatedTarget ? $(e.relatedTarget) : $target.children('[data-toggle="dropdown"]'); |
|||
|
|||
var animation = $trigger.data('animation'); |
|||
if (animation) { |
|||
var $menu = $target.children('.dropdown-menu'); |
|||
$menu.addClass('animation-' + animation); |
|||
|
|||
$menu.one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() { |
|||
$menu.removeClass('animation-' + animation); |
|||
}); |
|||
} |
|||
}); |
|||
|
|||
$(document).on('shown.bs.dropdown', function(e) { |
|||
var $target = $(e.target); |
|||
var $menu = $target.find('.dropdown-menu-media > .list-group'); |
|||
|
|||
if ($menu.length > 0) { |
|||
var api = $menu.data('asScrollable'); |
|||
if (api) { |
|||
api.update(); |
|||
} else { |
|||
var defaults = $.components.getDefaults("scrollable"); |
|||
$menu.asScrollable(defaults); |
|||
} |
|||
} |
|||
}); |
|||
|
|||
// Page Aside Scrollable
|
|||
// =====================
|
|||
|
|||
var pageAsideScroll = $('[data-plugin="pageAsideScroll"]'); |
|||
|
|||
if (pageAsideScroll.length > 0) { |
|||
pageAsideScroll.asScrollable({ |
|||
namespace: "scrollable", |
|||
contentSelector: "> [data-role='content']", |
|||
containerSelector: "> [data-role='container']" |
|||
}); |
|||
|
|||
var pageAside = $(".page-aside"); |
|||
var scrollable = pageAsideScroll.data('asScrollable'); |
|||
|
|||
if (scrollable) { |
|||
if ($body.is('.page-aside-fixed') || $body.is('.page-aside-scroll')) { |
|||
$(".page-aside").on("transitionend", function() { |
|||
scrollable.update(); |
|||
}); |
|||
} |
|||
|
|||
Breakpoints.on('change', function() { |
|||
var current = Breakpoints.current().name; |
|||
|
|||
if (!$body.is('.page-aside-fixed') && !$body.is('.page-aside-scroll')) { |
|||
if (current === 'xs') { |
|||
scrollable.enable(); |
|||
pageAside.on("transitionend", function() { |
|||
scrollable.update(); |
|||
}); |
|||
} else { |
|||
pageAside.off("transitionend"); |
|||
scrollable.disable(); |
|||
} |
|||
} |
|||
}); |
|||
|
|||
$(document).on('click.pageAsideScroll', '.page-aside-switch', function() { |
|||
var isOpen = pageAside.hasClass('open'); |
|||
|
|||
if (isOpen) { |
|||
pageAside.removeClass('open'); |
|||
} else { |
|||
scrollable.update(); |
|||
pageAside.addClass('open'); |
|||
} |
|||
}); |
|||
|
|||
$(document).on('click.pageAsideScroll', '[data-toggle="collapse"]', function(e) { |
|||
var $trigger = $(e.target); |
|||
if (!$trigger.is('[data-toggle="collapse"]')) { |
|||
$trigger = $trigger.parents('[data-toggle="collapse"]'); |
|||
} |
|||
var href; |
|||
var target = $trigger.attr('data-target') || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, ''); |
|||
var $target = $(target); |
|||
|
|||
if ($target.attr('id') === 'site-navbar-collapse') { |
|||
scrollable.update(); |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
|
|||
// Page Actions Waves
|
|||
// =========================
|
|||
if (typeof Waves !== 'undefined') { |
|||
Waves.init(); |
|||
Waves.attach('.site-menu-item > a', ['waves-classic']); |
|||
Waves.attach(".site-navbar .navbar-toolbar [data-toggle='menubar']", ["waves-light", "waves-round"]); |
|||
Waves.attach(".page-header-actions .btn:not(.btn-inverse)", ["waves-light", "waves-round"]); |
|||
Waves.attach(".page-header-actions .btn-inverse", ["waves-classic", "waves-round"]); |
|||
Waves.attach('.page > div:not(.page-header) .btn:not(.ladda-button):not(.btn-round):not(.btn-pure):not(.btn-floating):not(.btn-flat)', ['waves-light']); |
|||
Waves.attach('.page > div:not(.page-header) .btn-pure:not(.ladda-button):not(.btn-round):not(.btn-floating):not(.btn-flat):not(.icon)', ['waves-classic']); |
|||
} |
|||
|
|||
// Init Loaded Components
|
|||
// ======================
|
|||
$.components.init(); |
|||
|
|||
this.startTour(); |
|||
}, |
|||
|
|||
polyfillIEWidth: function() { |
|||
if (navigator.userAgent.match(/IEMobile\/10\.0/)) { |
|||
var msViewportStyle = document.createElement('style'); |
|||
msViewportStyle.appendChild( |
|||
document.createTextNode( |
|||
'@-ms-viewport{width:auto!important}' |
|||
) |
|||
); |
|||
document.querySelector('head').appendChild(msViewportStyle); |
|||
} |
|||
}, |
|||
|
|||
loadAnimate: function(callback) { |
|||
return $.components.call("animsition", document, callback); |
|||
}, |
|||
|
|||
startTour: function(flag) { |
|||
if (typeof this.tour === 'undefined') { |
|||
if (typeof introJs === 'undefined') { |
|||
return; |
|||
} |
|||
|
|||
var tourOptions = $.configs.get('tour'), |
|||
self = this; |
|||
flag = $('body').css('overflow'); |
|||
this.tour = introJs(); |
|||
|
|||
this.tour.onbeforechange(function() { |
|||
$('body').css('overflow', 'hidden'); |
|||
}); |
|||
|
|||
this.tour.oncomplete(function() { |
|||
$('body').css('overflow', flag); |
|||
}); |
|||
|
|||
this.tour.onexit(function() { |
|||
$('body').css('overflow', flag); |
|||
}); |
|||
|
|||
this.tour.setOptions(tourOptions); |
|||
$('.site-tour-trigger').on('click', function() { |
|||
self.tour.start(); |
|||
}); |
|||
} |
|||
// if (window.localStorage && window.localStorage.getItem('startTour') && (flag !== true)) {
|
|||
// return;
|
|||
// } else {
|
|||
// this.tour.start();
|
|||
// window.localStorage.setItem('startTour', true);
|
|||
// }
|
|||
} |
|||
}); |
|||
|
|||
})(window, document, jQuery); |
File diff suppressed because one or more lines are too long
@ -1,349 +0,0 @@ |
|||
var AtomicExplorer = function() { |
|||
toastr.options = toastrConfig; |
|||
|
|||
var handleExplorer = function() { |
|||
$('#atomic_explorer_getcoinpeers_btn').click(function() { |
|||
NProgress.done(true); |
|||
NProgress.configure({ |
|||
template: templates.nprogressBar |
|||
}); |
|||
NProgress.start(); |
|||
console.log('button pushed in atomic explorer'); |
|||
|
|||
var atomic_explorer_select_coin_val = $('select[id=\'atomic_explorer_select_coin_options\']').val(), |
|||
atomic_explorer_select_command_val = $('select[id=\'atomic_explorer_select_command_options\']').val(), |
|||
atomic_explorer_input_data_val = $('#atomic_explorer_input_data').val(), |
|||
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
|||
ExplorerInputData; |
|||
|
|||
console.log(atomic_explorer_select_coin_val); |
|||
console.log(atomic_explorer_select_command_val); |
|||
console.log(atomic_explorer_input_data_val); |
|||
|
|||
switch (atomic_explorer_select_command_val) { |
|||
case 'history': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'timeout': 20000, |
|||
'agent': 'basilisk', |
|||
'method': 'history', |
|||
'vals': { |
|||
'coin': atomic_explorer_select_coin_val, |
|||
'addresses': [ atomic_explorer_input_data_val ] |
|||
} |
|||
}; |
|||
break; |
|||
case 'getbalance': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'coin': atomic_explorer_select_coin_val, |
|||
'method': 'getbalance', |
|||
'params': [ atomic_explorer_input_data_val ] |
|||
}; |
|||
break; |
|||
case 'listunspent': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'coin': atomic_explorer_select_coin_val, |
|||
'method': 'listunspent', |
|||
'params': [ |
|||
1, |
|||
9999999, |
|||
[ atomic_explorer_input_data_val ] |
|||
] |
|||
}; |
|||
break; |
|||
case 'txid': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'coin': atomic_explorer_select_coin_val, |
|||
'method': 'getrawtransaction', |
|||
'params': [ atomic_explorer_input_data_val ] |
|||
}; |
|||
break; |
|||
case 'blockash': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'coin': atomic_explorer_select_coin_val, |
|||
'agent': 'bitcoinrpc', |
|||
'method': 'getblockhash', |
|||
'height': atomic_explorer_input_data_val |
|||
}; |
|||
break; |
|||
case 'chaintip': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'coin': atomic_explorer_select_coin_val, |
|||
'agent': 'bitcoinrpc', |
|||
'method': 'getbestblockhash' |
|||
}; |
|||
break; |
|||
case 'activehandle': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'SuperNET', |
|||
'method': 'activehandle' |
|||
}; |
|||
break; |
|||
case 'gettransaction': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'coin': atomic_explorer_select_coin_val, |
|||
'agent': 'bitcoinrpc', |
|||
'method': 'gettransaction', |
|||
'txid': atomic_explorer_input_data_val |
|||
}; |
|||
break; |
|||
case 'dex_getinfo': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'getinfo', |
|||
'symbol': atomic_explorer_select_coin_val |
|||
}; |
|||
break; |
|||
case 'dex_getnotaries': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'getnotaries', |
|||
'symbol': atomic_explorer_select_coin_val |
|||
}; |
|||
break; |
|||
case 'dex_alladdresses': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'alladdresses', |
|||
'symbol': atomic_explorer_select_coin_val |
|||
}; |
|||
break; |
|||
case 'dex_importaddress': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'importaddress', |
|||
'address': atomic_explorer_input_data_val, |
|||
'symbol': atomic_explorer_select_coin_val |
|||
}; |
|||
break; |
|||
case 'dex_checkaddress': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'checkaddress', |
|||
'ddress': atomic_explorer_input_data_val, |
|||
'symbol': atomic_explorer_select_coin_val |
|||
}; |
|||
break; |
|||
case 'dex_validateaddress': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'validateaddress', |
|||
'address': atomic_explorer_input_data_val, |
|||
'symbol': atomic_explorer_select_coin_val |
|||
}; |
|||
break; |
|||
case 'dex_getbestblockhash': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'getbestblockhash', |
|||
'symbol': atomic_explorer_select_coin_val |
|||
}; |
|||
break; |
|||
case 'dex_listtransactions': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'listtransactions', |
|||
'address': atomic_explorer_input_data_val, |
|||
'count': 100, |
|||
'skip': 0, |
|||
'symbol': atomic_explorer_select_coin_val |
|||
}; |
|||
break; |
|||
case 'dex_listtransactions2': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'listtransactions2', |
|||
'address': atomic_explorer_input_data_val, |
|||
'count': 100, |
|||
'skip': 0, |
|||
'symbol': atomic_explorer_select_coin_val |
|||
}; |
|||
break; |
|||
case 'dex_listunspent': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'listunspent', |
|||
'address': atomic_explorer_input_data_val, |
|||
'symbol': atomic_explorer_select_coin_val |
|||
}; |
|||
break; |
|||
case 'dex_listspent': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'listspent', |
|||
'address': atomic_explorer_input_data_val, |
|||
'symbol': atomic_explorer_select_coin_val |
|||
}; |
|||
break; |
|||
case 'dex_listunspent2': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'listunspent2', |
|||
'address': atomic_explorer_input_data_val, |
|||
'symbol': atomic_explorer_select_coin_val |
|||
}; |
|||
break; |
|||
case 'dex_getblockhash': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'getblockhash', |
|||
'height': 100, |
|||
'symbol': atomic_explorer_select_coin_val |
|||
}; |
|||
break; |
|||
case 'dex_getblock': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'getblock', |
|||
'hash': atomic_explorer_input_data_val, |
|||
'symbol': atomic_explorer_select_coin_val |
|||
}; |
|||
break; |
|||
case 'dex_gettxin': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'gettxin', |
|||
'vout': 0, |
|||
'txid': atomic_explorer_input_data_val, |
|||
'symbol': atomic_explorer_select_coin_val |
|||
}; |
|||
break; |
|||
case 'dex_gettxout': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'gettxout', |
|||
'vout': 0, |
|||
'txid': atomic_explorer_input_data_val, |
|||
'symbol': atomic_explorer_select_coin_val |
|||
}; |
|||
break; |
|||
case 'dex_gettransaction': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'gettransaction', |
|||
'txid': atomic_explorer_input_data_val, |
|||
'symbol': atomic_explorer_select_coin_val |
|||
}; |
|||
break; |
|||
case 'dex_getbalance': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'getbalance', |
|||
'address': atomic_explorer_input_data_val, |
|||
'symbol': atomic_explorer_select_coin_val |
|||
}; |
|||
break; |
|||
case 'dex_getsupply': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'getbalance', |
|||
'address': '*', |
|||
'symbol': atomic_explorer_select_coin_val, |
|||
'timeout': 600000 |
|||
}; |
|||
break; |
|||
case 'dex_sendrawtransaction': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'sendrawtransaction', |
|||
'signedtx': atomic_explorer_input_data_val, |
|||
'symbol': atomic_explorer_select_coin_val |
|||
}; |
|||
break; |
|||
case 'basilisk_refresh': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'basilisk', |
|||
'method': 'refresh', |
|||
'address': atomic_explorer_input_data_val, |
|||
'symbol': atomic_explorer_select_coin_val, |
|||
'timeout': 600000 |
|||
}; |
|||
break; |
|||
case 'jumblr_status': |
|||
ExplorerInputData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'jumblr', |
|||
'method': 'status' |
|||
}; |
|||
break; |
|||
} |
|||
console.log(ExplorerInputData); |
|||
|
|||
$.ajax({ |
|||
type: 'POST', |
|||
data: JSON.stringify(ExplorerInputData), |
|||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|||
success: function(data, textStatus, jqXHR) { |
|||
console.log(data); |
|||
if (atomic_explorer_select_command_val === 'txid' || |
|||
atomic_explorer_select_command_val === 'dex_getbestblockhash' || |
|||
atomic_explorer_select_command_val === 'dex_sendrawtransaction' || |
|||
atomic_explorer_select_command_val === 'dex_getblockhash') { |
|||
$('#atomic-explorer-commands-output').html(data); |
|||
} else { |
|||
var ExplorerOutputData = JSON.parse(data); |
|||
console.log(ExplorerOutputData); |
|||
$('#atomic-explorer-commands-output').html(JSON.stringify(ExplorerOutputData, null, '\t')); |
|||
} |
|||
|
|||
if (ExplorerOutputData.error === 'less than required responses') { |
|||
toastr.error(_lang[defaultLang].DASHBOARD.LESS_RESPONSES_REQ, _lang[defaultLang].DASHBOARD.BASILISC_NOTIFICATION) |
|||
} |
|||
|
|||
NProgress.done(); |
|||
}, |
|||
error: function(xhr, textStatus, error) { |
|||
console.log('failed getting Coin History.'); |
|||
console.log(xhr.statusText); |
|||
|
|||
if ( xhr.readyState == 0 ) { |
|||
Iguana_ServiceUnavailable(); |
|||
} |
|||
|
|||
console.log(textStatus); |
|||
console.log(error); |
|||
NProgress.done(); |
|||
} |
|||
}); |
|||
}); |
|||
}; |
|||
|
|||
return { |
|||
//main function to initiate the module
|
|||
init: function() { |
|||
handleExplorer(); |
|||
} |
|||
}; |
|||
}(); |
|||
|
|||
jQuery(document).ready(function() { |
|||
AtomicExplorer.init(); |
|||
}); |
@ -1,5 +0,0 @@ |
|||
if (navigator.appName == 'Microsoft Internet Explorer') { |
|||
$('#section-login').fadeOut(); |
|||
$('#section-ie-warning').fadeIn(); |
|||
$(body).css('background-color', '#757575'); |
|||
} |
@ -1,335 +0,0 @@ |
|||
// DOM Ready =============================================================
|
|||
$(document).ready(function() { |
|||
// By default set USD as Fiat Currency if there's none selected already.
|
|||
if ( localStorage.getItem('EasyDEX_FiatCurrency') == null ) { |
|||
var FiatCurrency = 'USD'; |
|||
localStorage.setItem('EasyDEX_FiatCurrency', FiatCurrency); |
|||
} |
|||
}); |
|||
|
|||
// Functions =============================================================
|
|||
|
|||
var fiat_symbol; |
|||
function getCurrency() { |
|||
if (localStorage.getItem('EasyDEX_FiatCurrency') == 'USD' || |
|||
localStorage.getItem('EasyDEX_FiatCurrency') == 'NZD' || |
|||
localStorage.getItem('EasyDEX_FiatCurrency') == 'AUD' ) { |
|||
fiat_symbol = '$'; |
|||
} |
|||
if ( localStorage.getItem('EasyDEX_FiatCurrency') == 'INR' ) { |
|||
fiat_symbol = '₹'; |
|||
} |
|||
if ( localStorage.getItem('EasyDEX_FiatCurrency') == 'CNY' || localStorage.getItem('EasyDEX_FiatCurrency') == 'JPY' ) { |
|||
fiat_symbol = '¥'; |
|||
} |
|||
if ( localStorage.getItem('EasyDEX_FiatCurrency') == 'GBP' ) { |
|||
fiat_symbol = '£'; |
|||
} |
|||
if ( localStorage.getItem('EasyDEX_FiatCurrency') == 'EUR' ) { |
|||
fiat_symbol = '€'; |
|||
} |
|||
} |
|||
|
|||
function sendCurrency(val) { |
|||
console.log(val); |
|||
$('#mdl_currency_balance').text($('span[data-currency="' + val.currency + '"][id="currency-balance"]').text()); |
|||
$('#mdl_currency_sendto').attr('placeholder', _lang[defaultLang].INDEX.ENTER + ' ' + val.currency + ' ' + _lang[defaultLang].INDEX.ADDR_SM); |
|||
$( |
|||
'#mdl_currency_amount_label,' + |
|||
'#mdl_currency_coin,' + |
|||
'#mdl_currency_total_coinname' |
|||
) |
|||
.text(val.currency); |
|||
|
|||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
|||
getinfoValues = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'coin': val.currency, |
|||
'agent': 'bitcoinrpc', |
|||
'method': 'getinfo' |
|||
}; |
|||
|
|||
$.ajax({ |
|||
type: 'POST', |
|||
data: JSON.stringify(getinfoValues), |
|||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|||
success: function(data, textStatus, jqXHR) { |
|||
var CoinInfoData = JSON.parse(data), |
|||
label_color = '', |
|||
label_icon = '', |
|||
wallettblContent = ''; |
|||
|
|||
$('#mdl_currency_fee').val(CoinInfoData.txfee); |
|||
}, |
|||
error: function(xhr, textStatus, error) { |
|||
console.log('failed getting Coin History.'); |
|||
console.log(xhr.statusText); |
|||
console.log(textStatus); |
|||
console.log(error); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
function ReceiveCurrency(rec_val) { |
|||
console.log(rec_val); |
|||
if ( sessionStorage.getItem('IguanaActiveAccount') === null ) { |
|||
console.log('=> No wallet logged in. No need to get Rates.'); |
|||
} else { |
|||
var tmp_activhndl = JSON.parse(sessionStorage.getItem('IguanaActiveAccount')), |
|||
coinAddr = JSON.parse(tmp_activhndl)[rec_val.currency]; |
|||
$('#mdl_receive_coin_name').text(rec_val.currency) |
|||
$('#mdl_receive_coin_addr').text(''); |
|||
$('#mdl_receive_coin_addr').val(coinAddr); |
|||
$('#mdl_receive_coin_addr_qr_code').text(''); |
|||
$('#mdl_receive_coin_addr_qr_code').qrcode({ |
|||
width: 120, |
|||
height: 120, |
|||
text: coinAddr |
|||
}); |
|||
} |
|||
|
|||
var clipboard = new Clipboard('.btn'); |
|||
clipboard.on('success', function(e) { |
|||
console.log(e); |
|||
}); |
|||
clipboard.on('error', function(e) { |
|||
console.log(e); |
|||
}); |
|||
} |
|||
|
|||
$('#mdl_currency_amount').keyup(function() { |
|||
var sum_val1 = parseFloat($('#mdl_currency_amount').val()), |
|||
sum_val2 = parseFloat($('#mdl_currency_fee').val()), |
|||
total_of_currency_fee = sum_val1 + sum_val2, |
|||
currency_fiat_value = '', |
|||
fiat_symbol = '', |
|||
mdl_send_btn = $('#mdl_currency_send_btn'); |
|||
|
|||
if ( $('#mdl_currency_total_coinname').text() == 'BTCD' ) { |
|||
currency_fiat_value = localStorage.getItem('EasyDEX_BTCD_Fiat_pair_value'); |
|||
} |
|||
if ( $('#mdl_currency_total_coinname').text() == 'BTC' ) { |
|||
currency_fiat_value = localStorage.getItem('EasyDEX_BTC_Fiat_pair_value'); |
|||
} |
|||
|
|||
getCurrency(); |
|||
var total_of_currency_fiat = total_of_currency_fee * currency_fiat_value; |
|||
$('#mdl_currency_total_value').text(total_of_currency_fee.toFixed(8)); |
|||
$('#mdl_currency_total_fiat_value').text(fiat_symbol + total_of_currency_fiat.toFixed(2)); |
|||
|
|||
if ($('#mdl_currency_amount').val() != '' && $('#mdl_currency_sendto') != '' && $('#mdl_currency_fee') != '' ) { |
|||
mdl_send_btn.removeClass('disabled'); |
|||
mdl_send_btn.attr('data-dismiss', 'modal'); |
|||
mdl_send_btn.attr('data-target', '#SendCoinModelStep2'); |
|||
mdl_send_btn.attr('onclick', 'ConfirmsendCurrency($(this).data())'); |
|||
} else { |
|||
mdl_send_btn.addClass('disabled'); |
|||
mdl_send_btn.removeAttr('data-dismiss'); |
|||
mdl_send_btn.removeAttr('data-target'); |
|||
mdl_send_btn.removeAttr('onclick'); |
|||
} |
|||
}); |
|||
|
|||
$('#mdl_currency_fee').keyup(function() { |
|||
var sum_val1 = parseFloat($('#mdl_currency_amount').val()), |
|||
sum_val2 = parseFloat($('#mdl_currency_fee').val()), |
|||
total_of_currency_fee = sum_val1 + sum_val2, |
|||
currency_fiat_value = '', |
|||
fiat_symbol = ''; |
|||
|
|||
if ( $('#mdl_currency_total_coinname').text() == 'BTCD' ) { |
|||
currency_fiat_value = localStorage.getItem('EasyDEX_BTCD_Fiat_pair_value'); |
|||
} |
|||
if ( $('#mdl_currency_total_coinname').text() == 'BTC' ) { |
|||
currency_fiat_value = localStorage.getItem('EasyDEX_BTC_Fiat_pair_value'); |
|||
} |
|||
|
|||
getCurrency(); |
|||
|
|||
var total_of_currency_fiat = total_of_currency_fee * currency_fiat_value; |
|||
$('#mdl_currency_total_value').text(total_of_currency_fee.toFixed(8)); |
|||
$('#mdl_currency_total_fiat_value').text(fiat_symbol + total_of_currency_fiat.toFixed(2)); |
|||
}); |
|||
|
|||
function CurrencyMdlBtnClean() { |
|||
$( |
|||
'#mdl_currency_sendto,' + |
|||
'#mdl_currency_amount' |
|||
) |
|||
.val(''); |
|||
$( |
|||
'#mdl_currency_total_value,' + |
|||
'#mdl_currency_total_fiat_value' |
|||
) |
|||
.text('0.00'); |
|||
} |
|||
|
|||
function ReceiveCoinMdlBtnClean() { |
|||
$( |
|||
'#mdl_receive_coin_addr,' + |
|||
'#mdl_receive_coin_addr_qr_code' |
|||
) |
|||
.text(''); |
|||
} |
|||
|
|||
function ConfirmsendCurrency(confirm_val) { |
|||
var confirm_coinname = $('#mdl_currency_total_coinname').text(), |
|||
confirm_selected_from_addr = $('div[data-currency="' + confirm_coinname + '"][id="currency-addr"]').text(), |
|||
confirm_send_amount_fiat = '', |
|||
confirm_send_amount_fee_fiat = '', |
|||
currency_fiat_value = '', |
|||
fiat_symbol = ''; |
|||
|
|||
if ( $('#mdl_currency_total_coinname').text() == 'BTCD' ) { |
|||
currency_fiat_value = localStorage.getItem('EasyDEX_BTCD_Fiat_pair_value'); |
|||
} |
|||
if ( $('#mdl_currency_total_coinname').text() == 'BTC' ) { |
|||
currency_fiat_value = localStorage.getItem('EasyDEX_BTC_Fiat_pair_value'); |
|||
} |
|||
|
|||
getCurrency(); |
|||
|
|||
$('#mdl_confirm_currency_sendto_addr').text($('#mdl_currency_sendto').val()); |
|||
$('#mdl_confirm_currency_send_amount').text($('#mdl_currency_amount').val()); |
|||
$( |
|||
'#mdl_confirm_currency_coinname,' + |
|||
'#mdl_confirm_currency_coinname_total,' + |
|||
'#mdl_confirm_currency_coinname_fee' |
|||
) |
|||
.text(confirm_coinname); |
|||
$('#mdl_confirm_currency_send_amount_fiat').text(fiat_symbol + ($('#mdl_confirm_currency_send_amount').text() * currency_fiat_value).toFixed(2)); |
|||
$('#mdl_confirm_currency_send_fee').text($('#mdl_currency_fee').val()); |
|||
$('#mdl_confirm_currency_send_fee_fiat').text(fiat_symbol + ($('#mdl_confirm_currency_send_fee').text() * currency_fiat_value).toFixed(2)); |
|||
$('#mdl_confirm_currency_sendfrom_addr').text(confirm_selected_from_addr); |
|||
$('#mdl_confirm_currency_sendfrom_total_dedcut').text($('#mdl_currency_total_value').text()); |
|||
$('#mdl_confirm_currency_sendfrom_total_deduct_fiat').text($('#mdl_currency_total_fiat_value').text()); |
|||
} |
|||
|
|||
function ExecuteSendCurrencyAPI() { |
|||
console.log('==> SendToAddress API Executed <=='); |
|||
|
|||
var confirm_coinname_to_send = $('#mdl_confirm_currency_coinname').text(), |
|||
confirm_send_amount = $('#mdl_confirm_currency_sendfrom_total_dedcut').text(), |
|||
confirm_sendto_address = $('#mdl_confirm_currency_sendto_addr').text(); |
|||
|
|||
// Get parameters values from confirm dialog and send currency
|
|||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
|||
sendtoaddrvalues = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'coin': confirm_coinname_to_send, |
|||
'method': 'sendtoaddress', |
|||
'params': [ |
|||
confirm_sendto_address, |
|||
confirm_send_amount, |
|||
'EasyDEX', |
|||
'EasyDEXTransaction' |
|||
] |
|||
}; |
|||
|
|||
console.log(sendtoaddrvalues); |
|||
$.ajax({ |
|||
type: 'POST', |
|||
data: JSON.stringify(sendtoaddrvalues), |
|||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|||
success: function(data, textStatus, jqXHR) { |
|||
var SendToAddrData = JSON.parse(data), |
|||
SendToAddrTxDataTitle; |
|||
|
|||
console.log('== Data OutPut =='); |
|||
console.log(SendToAddrData); |
|||
if ( SendToAddrData.error != 'couldnt create rawtx' ) { |
|||
SendToAddrTxDataTitle = _lang[defaultLang].COIN_WALLETS.TX_FAILED; |
|||
} |
|||
if ( SendToAddrData.sendrawtransaction == 'success' ) { |
|||
SendToAddrTxDataTitle = _lang[defaultLang].COIN_WALLETS.TX_SUCCESS; |
|||
} |
|||
|
|||
var SentToAddrTxData = '<font style="font-size: 13px; font-family: Menlo,Monaco,Consolas,Courier New,monospace">' + |
|||
'<font style="font-weight: 800">' + |
|||
'<b>' + _lang[defaultLang].COIN_WALLETS.TX + ' ID:</b>' |
|||
'</font>' + |
|||
SendToAddrData.result + |
|||
'</font>'; |
|||
bootbox.dialog({ |
|||
title: SendToAddrTxDataTitle, |
|||
message: SentToAddrTxData |
|||
}); |
|||
|
|||
if ( SendToAddrData.sendrawtransaction == 'success' ) { |
|||
toastr.success(_lang[defaultLang].TOASTR.TX_SENT, _lang[defaultLang].TOASTR.TX_NOTIFICATION); |
|||
} |
|||
}, |
|||
error: function(xhr, textStatus, error) { |
|||
console.log('failed getting Coin History.'); |
|||
console.log(xhr.statusText); |
|||
console.log(textStatus); |
|||
console.log(error); |
|||
toastr.error(_lang[defaultLang].TOASTR.TX_SEND_ERR, _lang[defaultLang].TOASTR.TX_NOTIFICATION); |
|||
} |
|||
}); |
|||
|
|||
// Clear Send Dialog values and set them to blank
|
|||
$( |
|||
'#mdl_currency_coin,' + |
|||
'#mdl_currency_balance,' + |
|||
'#mdl_currency_amount_label,' + |
|||
'#mdl_currency_total_coinname' |
|||
) |
|||
.text(''); |
|||
|
|||
// Clear Confirm Dialog values and set them to blank
|
|||
$( |
|||
'#mdl_confirm_currency_sendto_addr,' + |
|||
'#mdl_confirm_currency_send_amount,' + |
|||
'#mdl_confirm_currency_coinname,' + |
|||
'#mdl_confirm_currency_send_amount_fiat,' + |
|||
'#mdl_confirm_currency_send_fee,' + |
|||
'#mdl_confirm_currency_coinname_fee,' + |
|||
'#mdl_confirm_currency_send_fee_fiat,' + |
|||
'#mdl_confirm_currency_sendfrom_addr,' + |
|||
'#mdl_confirm_currency_sendfrom_total_dedcut,' + |
|||
'#mdl_confirm_currency_coinname_total,' + |
|||
'#mdl_confirm_currency_sendfrom_total_deduct_fiat' |
|||
) |
|||
.text(''); |
|||
|
|||
// Clean send dialog button fields
|
|||
CurrencyMdlBtnClean(); |
|||
} |
|||
|
|||
// Used this function to set desired Fiat Currency, selected from top menu bar of EasyDEX UI
|
|||
function WalletFiatCurrency(fiat_currency_value) { |
|||
var FiatCurrency = fiat_currency_value.fiatcurrency; |
|||
localStorage.setItem('EasyDEX_FiatCurrency', FiatCurrency); |
|||
} |
|||
|
|||
function Iguana_rmd160conv(rmd160conv_data) { |
|||
// comment
|
|||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
|||
ajax_data = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'SuperNET', |
|||
'method': 'rmd160conv', |
|||
'rmd160': rmd160conv_data.rmd160, |
|||
'coin': rmd160conv_data.coin |
|||
}; |
|||
|
|||
console.log(ajax_data); |
|||
$.ajax({ |
|||
type: 'POST', |
|||
data: JSON.stringify(ajax_data), |
|||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|||
success: function(data, textStatus, jqXHR) { |
|||
var AjaxOutputData = JSON.parse(data); |
|||
console.log('== Data OutPut =='); |
|||
console.log(AjaxOutputData); |
|||
return AjaxOutputData; |
|||
}, |
|||
error: function(xhr, textStatus, error) { |
|||
console.log('failed getting Coin History.'); |
|||
console.log(xhr.statusText); |
|||
console.log(textStatus); |
|||
console.log(error); |
|||
} |
|||
}); |
|||
} |
@ -1,3 +0,0 @@ |
|||
const config = { |
|||
'iguanaPort': 7778 |
|||
}; |
File diff suppressed because it is too large
@ -1,261 +0,0 @@ |
|||
function ShowBasiliskFetchDataProgress(coin) { |
|||
var active_edexcoinmodecode = sessionStorage.getItem('edexTmpMode'); |
|||
|
|||
Shepherd_GetBasiliskCache() |
|||
.then(function(result) { |
|||
var _data = JSON.parse(result), |
|||
NOT_FOUND = 'NOT FOUND', |
|||
query = _data.result.basilisk, |
|||
coin_exists = true, |
|||
addresses_exists = true, |
|||
getbalance_exists = true, |
|||
listtransactions_exists = true, |
|||
listunspent_exists = true, |
|||
refresh_exists = true, |
|||
getbalance_status = NOT_FOUND, |
|||
listtransactions_status = NOT_FOUND, |
|||
listunspent_status = NOT_FOUND, |
|||
refresh_status = NOT_FOUND, |
|||
res_data; |
|||
|
|||
res_data = { |
|||
'addresses': false, |
|||
'getbalance': false, |
|||
'listtransactions': false, |
|||
'listunspent': false, |
|||
'refresh': false |
|||
} |
|||
|
|||
if (!query) { |
|||
res_data.coin = false; |
|||
} else if (!query[coin]) { |
|||
coin_exists = false; |
|||
res_data.coin = coin_exists; |
|||
} else if (!('addresses' in query[coin])) { |
|||
addresses_exists = false; |
|||
res_data.coin = coin_exists; |
|||
} else { |
|||
Promise.all(query[coin].addresses.map((coinaddr_value,coinaddr_index) => { |
|||
return new Promise((resolve, reject) => { |
|||
var data = query[coin][coinaddr_value].getbalance; |
|||
|
|||
if (!('getbalance' in query[coin][coinaddr_value])) { |
|||
getbalance_exists = false; |
|||
} else { |
|||
getbalance_status = query[coin][coinaddr_value].getbalance.status; |
|||
} |
|||
|
|||
if (!('listtransactions' in query[coin][coinaddr_value])) { |
|||
listtransactions_exists = false; |
|||
} else { |
|||
listtransactions_status = query[coin][coinaddr_value].listtransactions.status; |
|||
} |
|||
|
|||
if (!('listunspent' in query[coin][coinaddr_value])) { |
|||
listunspent_exists = false; |
|||
} else { |
|||
listunspent_status = query[coin][coinaddr_value].listunspent.status; |
|||
} |
|||
|
|||
if (!('refresh' in query[coin][coinaddr_value])) { |
|||
refresh_exists = false; |
|||
} else { |
|||
refresh_status = query[coin][coinaddr_value].refresh.status; |
|||
} |
|||
|
|||
pass_data = { |
|||
'addr_index': coinaddr_index, |
|||
'addr_value': coinaddr_value, |
|||
'getbalance': getbalance_exists, |
|||
'getbalance_status': getbalance_status, |
|||
'listtransactions': listtransactions_exists, |
|||
'listtransactions_status': listtransactions_status, |
|||
'listunspent': listunspent_exists, |
|||
'listunspent_status': listunspent_status, |
|||
'refresh': refresh_exists, |
|||
'refresh_status': refresh_status |
|||
}; |
|||
|
|||
resolve(pass_data); |
|||
}); |
|||
})) |
|||
.then(result => { |
|||
var BasiliskFetchData = ''; |
|||
|
|||
$.each(result, function(result_index, result_val) { |
|||
var tmp_listunspent_lable_color = '', |
|||
tmp_listtransactions_lable_color = '', |
|||
tmp_getbalance_lable_color = '', |
|||
tmp_refresh_lable_color = ''; |
|||
|
|||
switch (result_val.listunspent_status) { |
|||
case 'waiting': |
|||
tmp_listunspent_lable_color = 'dark'; |
|||
break; |
|||
case 'in progress': |
|||
tmp_listunspent_lable_color = 'primary'; |
|||
break; |
|||
case 'done': |
|||
tmp_listunspent_lable_color = 'success'; |
|||
break; |
|||
case NOT_FOUND: |
|||
tmp_listunspent_lable_color = 'danger'; |
|||
break; |
|||
} |
|||
|
|||
switch (result_val.listtransactions_status) { |
|||
case 'waiting': |
|||
tmp_listtransactions_lable_color = 'dark'; |
|||
$('#edexcoin_dashboard_basilisk_refresh_status').show(); |
|||
break; |
|||
case 'in progress': |
|||
tmp_listtransactions_lable_color = 'primary'; |
|||
$('#edexcoin_dashboard_basilisk_refresh_status').show(); |
|||
break; |
|||
case 'done': |
|||
tmp_listtransactions_lable_color = 'success'; |
|||
$('#edexcoin_dashboard_basilisk_refresh_status').hide(); |
|||
break; |
|||
case NOT_FOUND: |
|||
tmp_listtransactions_lable_color = 'danger'; |
|||
$('#edexcoin_dashboard_basilisk_refresh_status').show(); |
|||
break; |
|||
} |
|||
|
|||
switch (result_val.getbalance_status) { |
|||
case 'waiting': |
|||
tmp_getbalance_lable_color = 'dark'; |
|||
$('#edexcoin_dashboard_basilisk_refresh_status').show(); |
|||
break; |
|||
case 'in progress': |
|||
tmp_getbalance_lable_color = 'primary'; |
|||
$('#edexcoin_dashboard_basilisk_refresh_status').show(); |
|||
break; |
|||
case 'done': |
|||
tmp_getbalance_lable_color = 'success'; |
|||
$('#edexcoin_dashboard_basilisk_refresh_status').hide(); |
|||
break; |
|||
case NOT_FOUND: |
|||
tmp_getbalance_lable_color = 'danger'; |
|||
$('#edexcoin_dashboard_basilisk_refresh_status').show(); |
|||
break; |
|||
} |
|||
|
|||
switch (result_val.refresh_status) { |
|||
case 'waiting': |
|||
tmp_refresh_lable_color = 'dark'; |
|||
$('#edexcoin_dashboard_basilisk_refresh_status').show(); |
|||
break; |
|||
case 'in progress': |
|||
tmp_refresh_lable_color = 'primary'; |
|||
$('#edexcoin_dashboard_basilisk_refresh_status').show(); |
|||
break; |
|||
case 'done': |
|||
tmp_refresh_lable_color = 'success'; |
|||
$('#edexcoin_dashboard_basilisk_refresh_status').hide(); |
|||
break; |
|||
case NOT_FOUND: |
|||
tmp_refresh_lable_color = 'danger'; |
|||
break; |
|||
} |
|||
|
|||
BasiliskFetchData += |
|||
'<tr>'; |
|||
'<td>' + result_val.addr_value.substring(0,5) + '...</td>' + |
|||
'<td>' + |
|||
'<span class="label label-' + tmp_listunspent_lable_color + ' text-uppercase">' + result_val.listunspent_status + '</span>' + |
|||
'</td>' + |
|||
'<td>' + |
|||
'<span class="label label-' + tmp_listtransactions_lable_color + ' text-uppercase">' + result_val.listtransactions_status + '</span>' + |
|||
'</td>' + |
|||
'<td>' + |
|||
'<span class="label label-' + tmp_getbalance_lable_color + ' text-uppercase">' + result_val.getbalance_status + '</span>' + |
|||
'</td>' + |
|||
'<td>' + |
|||
'<span class="label label-' + tmp_refresh_lable_color + ' text-uppercase">' + result_val.refresh_status + '</span>' + |
|||
'</td>' + |
|||
'</tr>'; |
|||
$('.tbl_edexcoin_dashboard_basilisk_refresh_status tbody').html(BasiliskFetchData); |
|||
}); |
|||
}); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
function SwitchBasicliskFull(switch_data) { |
|||
var relay_value = '', |
|||
validate_value = '', |
|||
mode_value = ''; |
|||
|
|||
if ( switch_data.modecode == 'B' ) { |
|||
relay_value = 1; |
|||
validate_value = 1; |
|||
mode_value = 'Basilisk'; |
|||
} |
|||
if ( switch_data.modecode == 'F' ) { |
|||
relay_value = 0; |
|||
validate_value = 0; |
|||
mode_value = 'Full'; |
|||
} |
|||
|
|||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
|||
SwitchCoinModeData = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'poll': 100, |
|||
'immediate':100, |
|||
'active': 1, |
|||
'newcoin': switch_data.currency, |
|||
'startpend': 1, |
|||
'endpend': 1, |
|||
'services': 128, |
|||
'maxpeers': 16, |
|||
'RELAY': relay_value, |
|||
'VALIDATE': validate_value, |
|||
'portp2p': 14631 |
|||
}; |
|||
|
|||
// Switch selected coins' mode
|
|||
$.ajax({ |
|||
type: 'GET', |
|||
data: SwitchCoinModeData, |
|||
url: 'http://127.0.0.1:' + config.iguanaPort + '/api/iguana/addcoin', |
|||
dataType: 'text', |
|||
success: function(data, textStatus, jqXHR) { |
|||
var SwitchCoinDataOutput = JSON.parse(data); |
|||
|
|||
if (SwitchCoinDataOutput.result === 'coin added') { |
|||
console.log('coin added'); |
|||
toastr.success(switch_data.currency + ' ' + _lang[defaultLang].TOASTR.SWITCHED_TO + ' ' + mode_value + ' ' + _lang[defaultLang].TOASTR.MODE, _lang[defaultLang].TOASTR.COIN_NOTIFICATION); |
|||
} else if (SwitchCoinDataOutput.result === 'coin already there') { |
|||
console.log('coin already there'); |
|||
} else if (SwitchCoinDataOutput.result === null) { |
|||
console.log('coin already there'); |
|||
} |
|||
}, |
|||
error: function(xhr, textStatus, error) { |
|||
console.log('failed starting BitcoinDark.'); |
|||
console.log(xhr.statusText); |
|||
if ( xhr.readyState == 0 ) { |
|||
Iguana_ServiceUnavailable(); |
|||
} |
|||
console.log(textStatus); |
|||
console.log(error); |
|||
if (xhr.readyState == '0' ) { |
|||
toastr.error(_lang[defaultLang].TOASTR.IGUANA_CONN_ERR, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION); |
|||
} |
|||
} |
|||
}); |
|||
} |
|||
|
|||
function getBasiliskCoinBalance(coin) { |
|||
EDEXMainAddr(coin) |
|||
.then(function(result){ |
|||
console.log(result); |
|||
|
|||
EDEX_DEXlistunspent(coin, result) |
|||
.then(function(result_listunspent) { |
|||
console.log(result_listunspent[0].amount); |
|||
$('span[data-edexcoincode="' + coin + '"][id="edexcoin-balance"]').text(result_listunspent[0].amount); |
|||
}); |
|||
}) |
|||
} |
@ -1,207 +0,0 @@ |
|||
function getCoinBalance(coin) { |
|||
var active_edexcoin = $('[data-edexcoin]').attr('data-edexcoin'); |
|||
|
|||
EDEXlistunspent(active_edexcoin) |
|||
.then(function(result) { |
|||
console.log(result) |
|||
if (result[0] != undefined) { |
|||
if ( result[0].interest !== undefined ) { |
|||
$( |
|||
'#edexcoin_getbalance_interest,' + |
|||
'#edexcoin_getbalance_total_interest' |
|||
) |
|||
.show(); |
|||
$('#edexcoin_getbalance_t') |
|||
.removeClass( 'col-lg-12' ) |
|||
.addClass( 'col-lg-4' ); |
|||
$('#edex_interest_balance').text(result[0].interest); |
|||
$('#edex_total_balance_interest').text(result[0].totalbalance); |
|||
$('#edex_total_interest_coincode').text(active_edexcoin); |
|||
$('#edex_total_balance_interest_coincode').text(active_edexcoin); |
|||
} |
|||
|
|||
if ( result[0].interest === undefined ) { |
|||
$( |
|||
'#edexcoin_getbalance_interest,' + |
|||
'#edexcoin_getbalance_total_interest' |
|||
) |
|||
.hide(); |
|||
$('#edexcoin_getbalance_t') |
|||
.removeClass( 'col-lg-4' ) |
|||
.addClass( 'col-lg-12' ); |
|||
$( |
|||
'#edex_interest_balance,' + |
|||
'#edex_total_balance_interest' |
|||
) |
|||
.text('-'); |
|||
} |
|||
|
|||
$('#edex_total_balance').text(result[0].total); |
|||
$('#edex_total_balance_coincode').text(active_edexcoin); |
|||
} else { |
|||
$('span[data-edexcoincode="' + coin + '"][id="edexcoin-balance"]').text('0'); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
function StopShowCoinHistory() { |
|||
clearInterval(ExecuteShowCoinHistory); |
|||
console.log('Stopped executing History and ProgressBar API.'); |
|||
} |
|||
|
|||
function TotalFiatValue() { |
|||
var BTC_balance = $('span[data-currency="BTC"][id="currency-balance"]').text(), |
|||
BTCD_balance = $('span[data-currency="BTCD"][id="currency-balance"]').text(), |
|||
Fiat_Currency = localStorage.getItem('EasyDEX_FiatCurrency'), |
|||
BTC_Fiat_pair_value = '', |
|||
Conversion_Fiat_Pair = '', |
|||
BTCD_Fiat_pair_value = ''; |
|||
|
|||
$('span[data-currency="BTC"][id="header_coinname_balance"]').text(BTC_balance + ' BTC'); |
|||
$('span[data-currency="BTCD"][id="header_coinname_balance"]').text(BTCD_balance + ' BTCD'); |
|||
|
|||
if ( Fiat_Currency == 'USD' ) { |
|||
BTC_Fiat_pair_value = 'BTC/' + Fiat_Currency; |
|||
Conversion_Fiat_Pair = 'EUR/USD'; |
|||
} else { |
|||
BTC_Fiat_pair_value = 'BTC/USD'; |
|||
Conversion_Fiat_Pair = Fiat_Currency + '/USD'; |
|||
} |
|||
|
|||
var TotalFiatValueData = { |
|||
'agent': 'iguana', |
|||
'method': 'rates', |
|||
'quotes': [ |
|||
'BTCD/BTC', |
|||
BTC_Fiat_pair_value, |
|||
Conversion_Fiat_Pair |
|||
], |
|||
'immediate': 100, |
|||
'timeout': 5000 |
|||
}; |
|||
|
|||
if ( sessionStorage.getItem('IguanaActiveAccount') === null ) { |
|||
console.log('=> No wallet logged in. No need to get Rates.'); |
|||
} else { |
|||
// Get Rates
|
|||
$.ajax({ |
|||
type: 'POST', |
|||
data: JSON.stringify(TotalFiatValueData), |
|||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|||
success: function(data, textStatus, jqXHR) { |
|||
var RatesData = JSON.parse(data), |
|||
label_color = '', |
|||
label_icon = '', |
|||
wallettblContent = ''; |
|||
|
|||
localStorage.setItem('EasyDEX_BTCD_BTC_pair_value', RatesData.rates[0]['BTCD/BTC']); // e.g BTCD/BTC
|
|||
localStorage.setItem('EasyDEX_BTC_Fiat_pair_value', RatesData.rates[1][BTC_Fiat_pair_value]); // e.g BTC/USD
|
|||
localStorage.setItem('EasyDEX_Conversion_Fiat_Pair', Conversion_Fiat_Pair); // e.g EUR/USD
|
|||
localStorage.setItem('EasyDEX_Conversion_Fiat_Pair_value', RatesData.rates[2][Conversion_Fiat_Pair]); // e.g EUR/USD: 1.11830926
|
|||
|
|||
var tmp_btcd_btc = RatesData.rates[0], |
|||
tmp_btc_fiat = RatesData.rates[1]; |
|||
|
|||
BTCD_Fiat_pair_value = parseFloat(tmp_btcd_btc['BTCD/BTC']) * parseFloat(tmp_btc_fiat[BTC_Fiat_pair_value]); |
|||
localStorage.setItem('EasyDEX_BTCD_Fiat_pair_value', BTCD_Fiat_pair_value); // e.g BTCD/USD: 2.0873619962
|
|||
|
|||
var tmp_btcd_fiat_toal = parseFloat(BTCD_balance) * parseFloat(BTCD_Fiat_pair_value), |
|||
tmp_btc_fiat_toal = parseFloat(BTC_balance) * parseFloat(tmp_btc_fiat[BTC_Fiat_pair_value]); |
|||
|
|||
$('span[data-currency="BTC"][id="header_coinfiatbalance"]').text(tmp_btc_fiat_toal.toFixed(2) + ' ' + Fiat_Currency); |
|||
$('span[data-currency="BTCD"][id="header_coinfiatbalance"]').text(tmp_btcd_fiat_toal.toFixed(2) + ' ' + Fiat_Currency); |
|||
}, |
|||
error: function(xhr, textStatus, error) { |
|||
console.log('failed getting Coin History.'); |
|||
console.log(xhr.statusText); |
|||
if ( xhr.readyState == 0 ) { |
|||
Iguana_ServiceUnavailable(); |
|||
} |
|||
console.log(textStatus); |
|||
console.log(error); |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
|
|||
function StopTotalFiatValue() { |
|||
clearInterval(RunTotalFiatValue); |
|||
console.log('Stopped executing Total Fiat Value API with Rates'); |
|||
} |
|||
|
|||
function ShowCoinProgressBar(coin) { |
|||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'); |
|||
getinfoValues = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'coin': coin, |
|||
'agent': 'bitcoinrpc', |
|||
'method': 'getinfo', |
|||
'immediate': 100, |
|||
'timeout': 4000 |
|||
}; |
|||
|
|||
$.ajax({ |
|||
type: 'POST', |
|||
data: JSON.stringify(getinfoValues), |
|||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|||
success: function(data, textStatus, jqXHR) { |
|||
var CoinInfoData = JSON.parse(data); |
|||
|
|||
// TODO: refactor
|
|||
if (typeof CoinInfoData.bundles == 'undefined') { |
|||
|
|||
} else { |
|||
if ( parseInt(CoinInfoData.RTheight) != 0 ) { |
|||
var coin_blocks = parseInt(CoinInfoData.blocks), |
|||
coin_blocks_plus1 = coin_blocks + 1; |
|||
|
|||
sessionStorage.setItem('Activate' + coin + 'History', 'Yes'); |
|||
$('div[data-edexcoin="' + coin + '"][id="currency-progressbars"]').show(); |
|||
$('div[data-edexcoin="' + coin + '"][id="currency-bundles"]').width(parseFloat(CoinInfoData.bundles).toFixed(2) + '%'); |
|||
$('span[data-edexcoin="' + coin + '"][id="currency-bundles-percent"]') |
|||
.text('(' + coin + ') ' + parseFloat(CoinInfoData.bundles).toFixed(2) + '% - ( ' + coin_blocks_plus1 + ' / '+ CoinInfoData.longestchain + ' ) ==>> RT' + CoinInfoData.RTheight); |
|||
$('div[data-edexcoin="' + coin + '"][id="additional-progress-bars"]').hide(); |
|||
$('div[data-edexcoin="' + coin + '"][id="currency-bundles"]') |
|||
.removeClass( 'progress-bar-info' ) |
|||
.addClass( 'progress-bar-indicating progress-bar-success' ); |
|||
$('#edex-footer').css('height', '11px'); |
|||
resizeDashboardWindow(); |
|||
$('#edexcoin-wallet-waitingrt-alert').hide(); |
|||
} |
|||
if ( parseInt(CoinInfoData.RTheight) == 0 ) { |
|||
var coin_blocks = parseInt(CoinInfoData.blocks), |
|||
coin_blocks_plus1 = coin_blocks + 1; |
|||
|
|||
sessionStorage.setItem('Activate' + coin + 'History', 'No'); |
|||
console.log(coin + ': ' + CoinInfoData.bundles); |
|||
$('div[data-edexcoin="' + coin + '"][id="additional-progress-bars"]').show(); |
|||
$('div[data-edexcoin="' + coin + '"][id="currency-progressbars"]').show(); |
|||
$('div[data-edexcoin="' + coin + '"][id="currency-bundles"]') |
|||
.removeClass( 'progress-bar-indicating progress-bar-success' ) |
|||
.addClass( 'progress-bar-info' ); |
|||
$('div[data-edexcoin="' + coin + '"][id="currency-bundles"]').width(parseFloat(CoinInfoData.bundles).toFixed(2) + '%'); |
|||
$('span[data-edexcoin="' + coin + '"][id="currency-bundles-percent"]') |
|||
.text('(' + coin + ') ' + parseFloat(CoinInfoData.bundles).toFixed(2) + '% - ( ' + coin_blocks_plus1 + ' / ' + CoinInfoData.longestchain + ' )'); |
|||
$('div[data-edexcoin="' + coin + '"][id="currency-utxo"]').width(parseFloat(CoinInfoData.utxo).toFixed(2) + '%'); |
|||
$('span[data-edexcoin="' + coin + '"][id="currency-utxo-percent"]').text('(' + coin + ') ' + parseFloat(CoinInfoData.utxo).toFixed(2) + '%'); |
|||
$('div[data-edexcoin="' + coin + '"][id="currency-balances"]').width(parseFloat(CoinInfoData.balances).toFixed(2) + '%'); |
|||
$('span[data-edexcoin="' + coin + '"][id="currency-balances-percent"]').text('(' + coin + ') '+parseFloat(CoinInfoData.balances).toFixed(2) + '%'); |
|||
$('div[data-edexcoin="' + coin + '"][id="currency-validated"]').width(parseFloat(CoinInfoData.validated).toFixed(2) + '%'); |
|||
$('span[data-edexcoin="' + coin + '"][id="currency-validated-percent"]').text('(' + coin + ') '+parseFloat(CoinInfoData.validated).toFixed(2) + '%'); |
|||
$('#edex-footer').css('height', '44px'); |
|||
resizeDashboardWindow(); |
|||
$('#edexcoin-wallet-waitingrt-alert').show(); |
|||
} |
|||
} |
|||
}, |
|||
error: function(xhr, textStatus, error) { |
|||
console.log('failed getting Coin History.'); |
|||
console.log(xhr.statusText); |
|||
if ( xhr.readyState == 0 ) { |
|||
Iguana_ServiceUnavailable(); |
|||
} |
|||
console.log(textStatus); |
|||
console.log(error); |
|||
} |
|||
}); |
|||
} |
@ -1,262 +0,0 @@ |
|||
function getDEXCoinBalance(coin) { |
|||
getDEXGetBalance_cache(coin).then(function(result) { |
|||
console.log(result); |
|||
}); |
|||
} |
|||
|
|||
function getDEXGetBalance(coin) { |
|||
NProgress.done(true); |
|||
NProgress.configure({ |
|||
template: templates.nprogressBar |
|||
}); |
|||
NProgress.start(); |
|||
return new Promise((resolve) => { |
|||
|
|||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
|||
ajax_data_2 = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'coin': coin, |
|||
'agent': 'bitcoinrpc', |
|||
'method': 'getaddressesbyaccount', |
|||
'account': '*' |
|||
}; |
|||
|
|||
$.ajax({ |
|||
data: JSON.stringify(ajax_data_2), |
|||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|||
type: 'POST', |
|||
dataType: 'json' |
|||
}) |
|||
.then(data => { |
|||
var total_balance = 0, |
|||
total_interest = 0; |
|||
|
|||
Promise.all(data.result.map((coinaddr_value, coinaddr_index) => { |
|||
let params = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'getbalance', |
|||
'address': coinaddr_value, |
|||
'symbol': coin |
|||
}; |
|||
|
|||
console.log(params); |
|||
|
|||
return new Promise((resolve, reject) => { |
|||
$.ajax({ |
|||
data: JSON.stringify(params), |
|||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|||
type: 'POST', |
|||
dataType: 'json' |
|||
}) |
|||
.then(data => { |
|||
console.log(data); |
|||
total_balance = total_balance + data.balance; |
|||
|
|||
if (data.interest !== undefined) { |
|||
total_interest = total_interest + data.interest; |
|||
pass_data = { |
|||
'total': total_balance.toFixed(8), |
|||
'interest': total_interest.toFixed(8) |
|||
} |
|||
} |
|||
|
|||
if (data.interest == undefined) { |
|||
pass_data = { 'total': total_balance }; |
|||
} |
|||
|
|||
console.log(pass_data); |
|||
resolve(pass_data); |
|||
}); |
|||
}); |
|||
})) |
|||
.then(result => { |
|||
resolve(result[result.length - 1]); |
|||
NProgress.done(); |
|||
}); |
|||
}); |
|||
}); |
|||
} |
|||
|
|||
function getDEXGetBalance_cache(coin) { |
|||
NProgress.done(true); |
|||
NProgress.configure({ |
|||
template: templates.nprogressBar |
|||
}); |
|||
NProgress.start(); |
|||
|
|||
return new Promise((resolve) => { |
|||
Shepherd_CheckBasiliskCacheData(coin) |
|||
.then(function(result) { |
|||
if (result.coin == false || result.addresses == false) { |
|||
var call_data = { |
|||
'allcoins': false, |
|||
'coin': coin, |
|||
'calls': 'listtransactions:getbalance:refresh' |
|||
}; |
|||
Shepherd_FetchBasiliskData(call_data) |
|||
.then(function(result) { |
|||
console.log(result); |
|||
}); |
|||
} else if (result.getbalance == false) { |
|||
var call_data = { |
|||
'allcoins': false, |
|||
'coin': coin, |
|||
'calls': 'getbalance:listtransactions' |
|||
}; |
|||
Shepherd_FetchBasiliskData(call_data).then(function(result) { |
|||
console.log(result); |
|||
}); |
|||
} |
|||
}); |
|||
|
|||
Shepherd_GetBasiliskCache() |
|||
.then(function(result) { |
|||
var _data = JSON.parse(result), |
|||
query = _data.result.basilisk, |
|||
total_balance = 0, |
|||
total_interest = 0; |
|||
|
|||
Promise.all(query[coin].addresses.map((coinaddr_value, coinaddr_index) => { |
|||
return new Promise((resolve, reject) => { |
|||
if ( query[coin][coinaddr_value].getbalance.data !== undefined ) { |
|||
var data = query[coin][coinaddr_value].getbalance.data; |
|||
|
|||
total_balance = parseFloat(total_balance) + parseFloat(data.balance); |
|||
if (data.interest !== undefined) { |
|||
total_interest = parseFloat(total_interest) + parseFloat(data.interest); |
|||
total_final = parseFloat(total_balance) + parseFloat(total_interest); |
|||
pass_data = { |
|||
'total': total_balance.toFixed(8), |
|||
'interest': total_interest.toFixed(8), |
|||
'totalbalance': total_final.toFixed(8) |
|||
}; |
|||
} |
|||
if (data.interest == undefined) { |
|||
if (isNaN(total_balance)) { |
|||
total_balance = parseFloat(0); |
|||
} |
|||
pass_data = { 'total': total_balance.toFixed(8) }; |
|||
} |
|||
} else { |
|||
pass_data = { 'total': 0.00000000 }; |
|||
} |
|||
|
|||
resolve(pass_data); |
|||
}); |
|||
})) |
|||
.then(result => { |
|||
if ( result[result.length - 1].total == 0 ) { |
|||
resolve(result[result.length - 2]); |
|||
} else { |
|||
resolve(result[result.length - 1]); |
|||
} |
|||
|
|||
NProgress.done(); |
|||
}); |
|||
}); |
|||
}); |
|||
} |
|||
|
|||
function getDEXGetBalance2(coin) { |
|||
NProgress.done(true); |
|||
NProgress.configure({ |
|||
template: templates.nprogressBar |
|||
}); |
|||
NProgress.start(); |
|||
|
|||
return new Promise((resolve) => { |
|||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
|||
ajax_data_1 = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'SuperNET', |
|||
'method': 'activehandle' |
|||
}, |
|||
tmp_coin_addr = null, |
|||
ajax_call_1 = $.ajax({ |
|||
data: JSON.stringify(ajax_data_1), |
|||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|||
type: 'POST', |
|||
dataType: 'json' |
|||
}), |
|||
ajax_call_2 = ajax_call_1.then(function(data) { |
|||
// .then() returns a new promise
|
|||
tmp_coin_addr = data[coin]; |
|||
|
|||
var ajax_data_2 = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'listunspent', |
|||
'address': data[coin], |
|||
'symbol': coin |
|||
}; |
|||
|
|||
return $.ajax({ |
|||
data: JSON.stringify(ajax_data_2), |
|||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|||
type: 'POST', |
|||
dataType: 'json' |
|||
}); |
|||
}); |
|||
|
|||
ajax_call_2.done(function(data) { |
|||
console.log(data); |
|||
if (data.error === 'less than required responses') { |
|||
toastr.error(_lang[defaultLang].TOASTR.LESS_RESPONSES_REQ, _lang[defaultLang].BASILISK_NOTIFICATION); |
|||
} |
|||
|
|||
var tmpcalcnum = 0, |
|||
tmpcalcinterest = 0, |
|||
interest_enable = false, |
|||
tmptotalbalance = 0; |
|||
|
|||
$.each(data, function(index) { |
|||
if ( data[index].interest !== undefined ) { |
|||
tmpcalcnum = tmpcalcnum + data[index].amount; |
|||
tmpcalcinterest = tmpcalcinterest + data[index].interest; |
|||
interest_enable = true; |
|||
} |
|||
|
|||
if ( data[index].interest === undefined ) { |
|||
tmpcalcnum = tmpcalcnum + data[index].amount; |
|||
} |
|||
}); |
|||
|
|||
if ( coin == 'KMD' ) { |
|||
tmptotalbalance = parseFloat(tmpcalcnum) + parseFloat(tmpcalcinterest); |
|||
var tmp_addr_total_balance_output = { |
|||
'addr': tmp_coin_addr, |
|||
'total': tmpcalcnum.toFixed(8), |
|||
'interest': tmpcalcinterest.toFixed(8), |
|||
'totalbalance': tmptotalbalance.toFixed(8) |
|||
}; |
|||
} |
|||
if ( coin !== 'KMD' ) { |
|||
var tmp_addr_total_balance_output = { |
|||
'addr': tmp_coin_addr, |
|||
'total': tmpcalcnum.toFixed(8) |
|||
}; |
|||
} |
|||
console.log(tmp_addr_total_balance_output); |
|||
|
|||
if (data == '' ) { |
|||
tmp_addr_total_balance_output = { |
|||
'addr': tmp_coin_addr, |
|||
'total': 0 |
|||
}; |
|||
} |
|||
|
|||
resolve(tmp_addr_total_balance_output); |
|||
NProgress.done(); |
|||
}) |
|||
.fail(function(xhr, textStatus, error) { |
|||
// handle request failures
|
|||
console.log(xhr.statusText); |
|||
if ( xhr.readyState == 0 ) { |
|||
Iguana_ServiceUnavailable(); |
|||
} |
|||
console.log(textStatus); |
|||
console.log(error); |
|||
}); |
|||
}); |
|||
} |
@ -1,776 +0,0 @@ |
|||
function EdexfillTxHistory(coin) { |
|||
$('#edexcoin_txhistory').data('panel-api').load(); |
|||
NProgress.done(true); |
|||
NProgress.configure({ |
|||
template: templates.nprogressBar |
|||
}); |
|||
NProgress.start(); |
|||
|
|||
var active_edexcoinmodecode = sessionStorage.getItem('edexTmpMode'); |
|||
|
|||
if ( active_edexcoinmodecode === 'Basilisk' ) { |
|||
EdexGetTxList_cache(coin) |
|||
.then(function(result) { |
|||
var edex_txhistory_table = ''; |
|||
edex_txhistory_table = $('#edex-tx-history-tbl').DataTable({ |
|||
data: result, |
|||
'order': [ |
|||
[ 3, 'desc' ] |
|||
], |
|||
select: true, |
|||
retrieve: true |
|||
}); |
|||
|
|||
edex_txhistory_table.destroy(); |
|||
edex_txhistory_table = $('#edex-tx-history-tbl').DataTable({ |
|||
data: result, |
|||
'order': [ |
|||
[ 3, 'desc' ] |
|||
], |
|||
select: true, |
|||
retrieve: true |
|||
}); |
|||
$('#edexcoin_txhistory').data('panel-api').done(); |
|||
$('.panel-loading').remove(); |
|||
}); |
|||
} |
|||
|
|||
if ( active_edexcoinmodecode === 'Full' ) { |
|||
EdexGetTxList(coin) |
|||
.then(function(result){ |
|||
var edex_txhistory_table = ''; |
|||
edex_txhistory_table = $('#edex-tx-history-tbl').DataTable({ |
|||
data: result, |
|||
'order': [ |
|||
[ 3, 'desc' ] |
|||
], |
|||
select: true, |
|||
retrieve: true |
|||
}); |
|||
|
|||
edex_txhistory_table.destroy(); |
|||
edex_txhistory_table = $('#edex-tx-history-tbl').DataTable({ |
|||
data: result, |
|||
'order': [ |
|||
[ 3, 'desc' ] |
|||
], |
|||
select: true, |
|||
retrieve: true |
|||
}); |
|||
$('#edexcoin_txhistory').data('panel-api').done(); |
|||
$('.panel-loading').remove(); |
|||
}); |
|||
} |
|||
} |
|||
|
|||
function refreshEDEXCoinWalletList() { |
|||
Dashboard.handleWalletWidgets(); |
|||
} |
|||
|
|||
function EdexGetTxList(coin) { |
|||
NProgress.done(true); |
|||
NProgress.configure({ |
|||
template: templates.nprogressBar |
|||
}); |
|||
NProgress.start(); |
|||
|
|||
return new Promise((resolve) => { |
|||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
|||
ajax_data_2 = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'coin': coin, |
|||
'agent': 'bitcoinrpc', |
|||
'method': 'getaddressesbyaccount', |
|||
'account': '*' |
|||
}, |
|||
active_edexcoinmodecode = sessionStorage.getItem('edexTmpMode'); |
|||
|
|||
$.ajax({ |
|||
data: JSON.stringify(ajax_data_2), |
|||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|||
type: 'POST', |
|||
dataType: 'json' |
|||
}) |
|||
.then(data => { |
|||
var total_utxos = []; |
|||
let params = ''; |
|||
|
|||
Promise.all(data.result.map((coinaddr_value,coinaddr_index) => { |
|||
if ( active_edexcoinmodecode == 'Basilisk' ) { |
|||
params = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'listtransactions', |
|||
'address': coinaddr_value, |
|||
'count': 100, |
|||
'skip': 0, |
|||
'symbol': coin |
|||
}; |
|||
} else { |
|||
params = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'coin': coin, |
|||
'method': 'listtransactions', |
|||
'params': [ |
|||
0, |
|||
9999999, |
|||
[] |
|||
] |
|||
}; |
|||
} |
|||
|
|||
return new Promise((resolve, reject) => { |
|||
$.ajax({ |
|||
data: JSON.stringify(params), |
|||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|||
type: 'POST', |
|||
dataType: 'json' |
|||
}) |
|||
.then(data => { |
|||
if ( active_edexcoinmodecode == 'Full' ) { |
|||
data = data.result; |
|||
} |
|||
//console.log(data)
|
|||
total_utxos = $.merge(total_utxos, data); |
|||
resolve(total_utxos); |
|||
}); |
|||
}); |
|||
})) |
|||
.then(result => { |
|||
let result_data = result[result.length - 1]; |
|||
let compiled_result = []; |
|||
|
|||
$.each(result_data, function(index, value) { |
|||
if ( active_edexcoinmodecode == 'Full' || |
|||
( active_edexcoinmodecode == 'Basilisk' && coin == 'BTC') || |
|||
( active_edexcoinmodecode == 'Basilisk' && coin == 'BTCD' ) || |
|||
( active_edexcoinmodecode == 'Basilisk' && coin == 'LTC' ) || |
|||
( active_edexcoinmodecode == 'Basilisk' && coin == 'DOGE' ) || |
|||
( active_edexcoinmodecode == 'Basilisk' && coin == 'DGB' ) || |
|||
( active_edexcoinmodecode == 'Basilisk' && coin == 'SYS' ) || |
|||
( active_edexcoinmodecode == 'Basilisk' && coin == 'MZC' ) || |
|||
( active_edexcoinmodecode == 'Basilisk' && coin == 'UNO' ) || |
|||
( active_edexcoinmodecode == 'Basilisk' && coin == 'ZET' ) || |
|||
( active_edexcoinmodecode == 'Basilisk' && coin == 'BTM' ) || |
|||
( active_edexcoinmodecode == 'Basilisk' && coin == 'CARB' ) || |
|||
( active_edexcoinmodecode == 'Basilisk' && coin == 'ANC' ) || |
|||
( active_edexcoinmodecode == 'Basilisk' && coin == 'FRK' ) ) { |
|||
|
|||
var tmp_category = '', |
|||
tmp_amount = result_data[index].amount; |
|||
|
|||
if (!('amount' in result_data[index])) { |
|||
tmp_amount = '<span class="label label-dark">' + _lang[defaultLang].DASHBOARD.UNKNOWN + '</span>'; |
|||
} |
|||
|
|||
var tmp_addr = result_data[index].address; |
|||
if (!('address' in result_data[index])) { |
|||
tmp_addr = '<i class="icon fa-bullseye"></i> <span class="label label-dark">' + _lang[defaultLang].DASHBOARD.ZADDR_NOT_LISTED + '!</span>'; |
|||
} |
|||
|
|||
var tmp_secondsToString = secondsToString(result_data[index].blocktime); |
|||
|
|||
if ( result_data[index].category == 'send' ) { |
|||
tmp_category = '<i class="icon fa-arrow-circle-left"></i> ' + _lang[defaultLang].DASHBOARD.OUT; |
|||
} |
|||
if ( result_data[index].category == 'receive' ) { |
|||
tmp_category = '<i class="icon fa-arrow-circle-right"></i> ' + _lang[defaultLang].DASHBOARD.IN; |
|||
} |
|||
if ( result_data[index].category == 'generate' ) { |
|||
tmp_category = '<i class="icon fa-cogs"></i> ' + _lang[defaultLang].DASHBOARD.IMMATURE; |
|||
}if ( result_data[index].category == 'immature' ) { |
|||
tmp_category = '<i class="icon fa-clock-o"></i> ' + _lang[defaultLang].DASHBOARD.OUT; |
|||
} |
|||
if ( result_data[index].category == 'unknown' ) { |
|||
tmp_category = '<i class="icon fa-meh-o"></i> ' + _lang[defaultLang].DASHBOARD.UNKNOWN; |
|||
} |
|||
|
|||
tmplisttransactions = [ |
|||
tmp_category, |
|||
result_data[index].confirmations, |
|||
tmp_amount, |
|||
tmp_secondsToString, |
|||
tmp_addr, |
|||
'<button type="button" class="btn btn-xs white btn-info waves-effect waves-light kmd-txid-details-btn" data-edexcoin="' + coin + '" data-txidtype="public" data-txid="' + result_data[index].txid + '">' + |
|||
'<i class="icon fa-search"></i>' + |
|||
'</button>' |
|||
]; |
|||
compiled_result.push(tmplisttransactions); |
|||
} |
|||
|
|||
if ( active_edexcoinmodecode == 'Basilisk' && |
|||
coin !== 'BTC' && |
|||
coin !== 'BTCD' && |
|||
coin !== 'LTC' && |
|||
coin !== 'DOGE' && |
|||
coin !== 'DGB' && |
|||
coin !== 'SYS' && |
|||
coin !== 'MZC' && |
|||
coin !== 'UNO' && |
|||
coin !== 'ZET' && |
|||
coin !== 'BTM' && |
|||
coin !== 'CARB' && |
|||
coin !== 'ANC' && |
|||
coin !== 'FRK' && |
|||
coin !== 'GMC' ) { |
|||
var tmp_category = '', |
|||
tmp_amount = result_data[index].amount; |
|||
|
|||
if (!('amount' in result_data[index])) { |
|||
tmp_amount = '<span class="label label-dark">' + _lang[defaultLang].DASHBOARD.UNKNOWN + '</span>'; |
|||
} |
|||
|
|||
var tmp_addr = null; |
|||
if (!('paid' in result_data[index])) { |
|||
tmp_addr = '<i class="icon fa-bullseye"></i> <span class="label label-dark">' + _lang[defaultLang].DASHBOARD.ZADDR_NOT_LISTED + '!</span>'; |
|||
} |
|||
if (('paid' in result_data[index])) { |
|||
var first_addr = Object.keys(result_data[index].paid['vouts'][0]), |
|||
tmp_addr = first_addr[0]; |
|||
} |
|||
|
|||
var tmp_secondsToString = secondsToString(result_data[index].timestamp); |
|||
|
|||
if ( result_data[index].type == 'sent' ) { |
|||
tmp_category = '<span class="label label-danger">' + |
|||
'<i class="icon fa-arrow-circle-left"></i> ' + _lang[defaultLang].DASHBOARD.OUT + |
|||
'</span>'; |
|||
} |
|||
if ( result_data[index].type == 'received' ) { |
|||
tmp_category = '<span class="label label-success">' + |
|||
'<i class="icon fa-arrow-circle-right"></i> ' + _lang[defaultLang].DASHBOARD.IN + |
|||
'</span>'; |
|||
} |
|||
if ( result_data[index].type == 'generate' ) { |
|||
tmp_category = '<i class="icon fa-cogs"></i> ' + _lang[defaultLang].DASHBOARD.MINED; |
|||
} |
|||
if ( result_data[index].type == 'immature' ) { |
|||
tmp_category = '<i class="icon fa-clock-o"></i> ' + _lang[defaultLang].DASHBOARD.IMMATURE; |
|||
} |
|||
if ( result_data[index].type == 'unknown' ) { |
|||
tmp_category = '<i class="icon fa-meh-o"></i> ' + _lang[defaultLang].DASHBOARD.UNKNOWN; |
|||
} |
|||
|
|||
if (!('confirmations' in result_data[index])) { |
|||
tmp_confirms = '<i class="icon fa-meh-o"></i> ' + _lang[defaultLang].DASHBOARD.UNKNOWN; |
|||
} |
|||
if (('confirmations' in result_data[index])) { |
|||
tmp_confirms = result_data[index].confirmations; |
|||
} |
|||
|
|||
tmplisttransactions = [ |
|||
tmp_category, |
|||
tmp_confirms, |
|||
tmp_amount, |
|||
tmp_secondsToString, |
|||
tmp_addr, |
|||
'<button type="button" class="btn btn-xs white btn-info waves-effect waves-light kmd-txid-details-btn" data-edexcoin="' + coin + '" data-txidtype="public" data-txid="' + result_data[index].txid + '">' + |
|||
'<i class="icon fa-search"></i>' + |
|||
'</button>' |
|||
]; |
|||
compiled_result.push(tmplisttransactions); |
|||
} |
|||
}); |
|||
|
|||
resolve(compiled_result); |
|||
NProgress.done(); |
|||
}); |
|||
}); |
|||
}); |
|||
} |
|||
|
|||
function EdexGetTxList_cache(coin) { |
|||
NProgress.done(true); |
|||
NProgress.configure({ |
|||
template: templates.nprogressBar |
|||
}); |
|||
NProgress.start(); |
|||
|
|||
return new Promise((resolve) => { |
|||
Shepherd_GetBasiliskCache() |
|||
.then(function(result) { |
|||
var _data = JSON.parse(result), |
|||
query = _data.result.basilisk, |
|||
active_edexcoinmodecode = sessionStorage.getItem('edexTmpMode'), |
|||
total_utxos = []; |
|||
|
|||
Promise.all(query[coin].addresses.map((coinaddr_value, coinaddr_index) => { |
|||
return new Promise((resolve, reject) => { |
|||
var data = query[coin][coinaddr_value].listtransactions.data; |
|||
|
|||
total_utxos = $.merge(total_utxos, data); |
|||
resolve(total_utxos); |
|||
}); |
|||
})) |
|||
.then(result => { |
|||
let result_data = result[result.length - 1], |
|||
compiled_result = []; |
|||
|
|||
$.each(result_data, function(index, value) { |
|||
if ( active_edexcoinmodecode == 'Basilisk' && coin !== 'BTC' && coin !== 'SYS') { |
|||
var tmp_category = '', |
|||
tmp_amount = result_data[index].amount; |
|||
|
|||
if (!('amount' in result_data[index])) { |
|||
tmp_amount = '<span class="label label-dark">' + _lang[defaultLang].DASHBOARD.UNKNOWN + '</span>'; |
|||
} |
|||
|
|||
var tmp_addr = null; |
|||
if (!('paid' in result_data[index])) { |
|||
tmp_addr = '<i class="icon fa-bullseye"></i> <span class="label label-dark">' + _lang[defaultLang].DASHBOARD.ZADDR_NOT_LISTED + '!</span>'; |
|||
} |
|||
if (('paid' in result_data[index])) { |
|||
var first_addr = Object.keys(result_data[index].paid['vouts'][0]), |
|||
tmp_addr = first_addr[0]; |
|||
} |
|||
|
|||
var tmp_secondsToString = secondsToString(result_data[index].timestamp); |
|||
|
|||
if ( result_data[index].type == 'sent' ) { |
|||
tmp_category = '<span class="label label-danger">' + |
|||
'<i class="icon fa-arrow-circle-left"></i> ' + _lang[defaultLang].DASHBOARD.OUT + |
|||
'</span>'; |
|||
} |
|||
if ( result_data[index].type == 'received' ) { |
|||
tmp_category = '<span class="label label-success">' + |
|||
'<i class="icon fa-arrow-circle-right"></i> ' + _lang[defaultLang].DASHBOARD.IN + |
|||
'</span>'; |
|||
} |
|||
if ( result_data[index].type == 'generate' ) { |
|||
tmp_category = '<i class="icon fa-cogs"></i> ' + _lang[defaultLang].DASHBOARD.MINED; |
|||
} |
|||
if ( result_data[index].type == 'immature' ) { |
|||
tmp_category = '<i class="icon fa-clock-o"></i> ' + _lang[defaultLang].DASHBOARD.IMMATURE; |
|||
} |
|||
if ( result_data[index].type == 'unknown' ) { |
|||
tmp_category = '<i class="icon fa-meh-o"></i> ' + _lang[defaultLang].DASHBOARD.UNKNOWN; |
|||
} |
|||
|
|||
if (!('confirmations' in result_data[index])) { |
|||
tmp_confirms = '<i class="icon fa-meh-o"></i> ' + _lang[defaultLang].DASHBOARD.UNKNOWN; |
|||
} |
|||
if (('confirmations' in result_data[index])) { |
|||
tmp_confirms = result_data[index].confirmations; |
|||
} |
|||
|
|||
tmplisttransactions = [ |
|||
tmp_category, |
|||
tmp_confirms, |
|||
tmp_amount, |
|||
tmp_secondsToString, |
|||
tmp_addr, |
|||
'<button type="button" class="btn btn-xs white btn-info waves-effect waves-light kmd-txid-details-btn" data-edexcoin="' + coin + '" data-txidtype="public" data-txid="' + result_data[index].txid + '">' + |
|||
'<i class="icon fa-search"></i>' + |
|||
'</button>' |
|||
]; |
|||
compiled_result.push(tmplisttransactions); |
|||
} |
|||
}) |
|||
|
|||
resolve(compiled_result); |
|||
NProgress.done(); |
|||
}); |
|||
}); |
|||
}); |
|||
} |
|||
|
|||
|
|||
function clearEdexSendFieldData() { |
|||
} |
|||
|
|||
function EdexListAllAddr(coin) { |
|||
NProgress.done(true); |
|||
NProgress.configure({ |
|||
template: templates.nprogressBar |
|||
}); |
|||
NProgress.start(); |
|||
|
|||
active_edexcoinmodecode = sessionStorage.getItem('edexTmpMode'); |
|||
|
|||
if (active_edexcoinmodecode == 'Basilisk' && coin !== 'BTC' && coin !== 'SYS') { |
|||
EDEXgetaddrbyaccount_cache(coin) |
|||
.then(function(result) { |
|||
var only_reciving_addr_data = []; |
|||
|
|||
console.log(result); |
|||
$.each(result, function(index, value) { |
|||
if (value.interest == undefined || coin !== 'KMD') { |
|||
console.log('interest is undefined'); |
|||
tmp_interest = 'NA'; |
|||
} else { |
|||
tmp_interest = value.interest; |
|||
} |
|||
only_reciving_addr_data.push([ |
|||
value.label, |
|||
value.addr, |
|||
value.total, |
|||
tmp_interest |
|||
]); |
|||
}); |
|||
console.log(only_reciving_addr_data); |
|||
|
|||
var edexcoin_recieve_table = ''; |
|||
|
|||
edexcoin_recieve_table = $('#edexcoin-recieve-addr-tbl').DataTable({ |
|||
data: only_reciving_addr_data, |
|||
select: false, |
|||
retrieve: true |
|||
}); |
|||
|
|||
edexcoin_recieve_table.destroy(); |
|||
|
|||
edexcoin_recieve_table = $('#edexcoin-recieve-addr-tbl').DataTable({ |
|||
data: only_reciving_addr_data, |
|||
select: false, |
|||
retrieve: true |
|||
}); |
|||
|
|||
NProgress.done(); |
|||
}); |
|||
} else if (active_edexcoinmodecode == 'Basilisk' ) { |
|||
EDEXgetaddrbyaccount(coin) |
|||
.then(function(result) { |
|||
var only_reciving_addr_data = []; |
|||
|
|||
console.log(result); |
|||
$.each(result, function(index, value) { |
|||
if (value.interest == undefined || coin !== 'KMD') { |
|||
console.log('interest is undefined'); |
|||
tmp_interest = 'NA'; |
|||
} else { |
|||
tmp_interest = value.interest; |
|||
} |
|||
only_reciving_addr_data.push([ |
|||
value.label, |
|||
value.addr, |
|||
value.total, |
|||
tmp_interest |
|||
]); |
|||
}); |
|||
console.log(only_reciving_addr_data); |
|||
|
|||
var edexcoin_recieve_table = ''; |
|||
|
|||
edexcoin_recieve_table = $('#edexcoin-recieve-addr-tbl').DataTable({ |
|||
data: only_reciving_addr_data, |
|||
select: false, |
|||
retrieve: true |
|||
}); |
|||
|
|||
edexcoin_recieve_table.destroy(); |
|||
|
|||
edexcoin_recieve_table = $('#edexcoin-recieve-addr-tbl').DataTable({ |
|||
data: only_reciving_addr_data, |
|||
select: false, |
|||
retrieve: true |
|||
}); |
|||
|
|||
NProgress.done(); |
|||
}); |
|||
} |
|||
|
|||
if (active_edexcoinmodecode == 'Full') { |
|||
EDEXgetaddrbyaccount(coin) |
|||
.then(function(result) { |
|||
var only_reciving_addr_data = []; |
|||
|
|||
console.log(result); |
|||
$.each(result, function(index, value) { |
|||
if (value.interest == undefined || coin !== 'KMD') { |
|||
console.log('interest is undefined'); |
|||
tmp_interest = 'NA'; |
|||
} else { |
|||
tmp_interest = value.interest; |
|||
} |
|||
only_reciving_addr_data.push([ |
|||
value.label, |
|||
value.addr, |
|||
value.total, |
|||
tmp_interest |
|||
]); |
|||
}); |
|||
console.log(only_reciving_addr_data); |
|||
|
|||
var edexcoin_recieve_table = ''; |
|||
|
|||
edexcoin_recieve_table = $('#edexcoin-recieve-addr-tbl').DataTable({ |
|||
data: only_reciving_addr_data, |
|||
select: false, |
|||
retrieve: true |
|||
}); |
|||
|
|||
edexcoin_recieve_table.destroy(); |
|||
|
|||
edexcoin_recieve_table = $('#edexcoin-recieve-addr-tbl').DataTable({ |
|||
data: only_reciving_addr_data, |
|||
select: false, |
|||
retrieve: true |
|||
}); |
|||
|
|||
NProgress.done(); |
|||
}); |
|||
} |
|||
} |
|||
|
|||
function edexCoinBtnAction() { |
|||
$('.edexcoin-logo').click(function() { |
|||
if ($(this).data('edexcoinmodecode') === 'Native') { |
|||
$.each($('.nav-top-menu'), function(index, value) { $(value).removeClass('active'); }); |
|||
} |
|||
$( '#edexcoin_send_coins_back_btn' ).trigger( 'click' ); |
|||
$('#btn_edexcoin_dashboard').hide(); |
|||
$( |
|||
'#btn_edexcoin_send,' + |
|||
'#btn_edexcoin_recieve' |
|||
) |
|||
.show(); |
|||
|
|||
var selected_coin = $(this).data('edexcoincode'), |
|||
selected_coinmode = $(this).data('edexcoinmodecode'), |
|||
selected_coinname = $(this).data('edexcoinname'); |
|||
|
|||
$( |
|||
'#edexcoin_getbalance_interest,' + |
|||
'#edexcoin_getbalance_total_interest' |
|||
) |
|||
.hide(); |
|||
$('#edexcoin_getbalance_t') |
|||
.removeClass( 'col-lg-4' ) |
|||
.addClass( 'col-lg-12' ); |
|||
$( |
|||
'#edex_interest_balance,' + |
|||
'#edex_total_balance_interest,' + |
|||
'#edex_total_balance' |
|||
) |
|||
.text('-'); |
|||
$('#edex_total_balance_coincode').text(selected_coin); |
|||
|
|||
sessionStorage.setItem('edexTmpMode', selected_coinmode); // set edex mode
|
|||
resizeDashboardWindow(); |
|||
|
|||
if ( selected_coinmode == 'Basilisk' ) { |
|||
$('#btn_edexcoin_basilisk').show(); |
|||
$( |
|||
'#edex-footer,' + |
|||
'#edexcoin-wallet-waitingrt-alert' |
|||
) |
|||
.hide(); |
|||
sessionStorage.setItem('edexTmpRefresh', 'start'); |
|||
} |
|||
if ( selected_coinmode == 'Full' ) { |
|||
$('#edex-footer').show(); |
|||
$('#btn_edexcoin_basilisk').hide(); |
|||
sessionStorage.setItem('edexTmpRefresh', 'start'); |
|||
} |
|||
if ( selected_coinmode !== 'Native' ) { |
|||
$( |
|||
'#edexcoin_dashoard_section,' + |
|||
'#header-dashboard,' + |
|||
'#wallet-widgets,' + |
|||
'#edexcoin_dashboardinfo,' + |
|||
'#currency-progressbars' |
|||
) |
|||
.show(); |
|||
$( |
|||
'#no_wallet_selected,' + |
|||
'#edexcoin_send,' + |
|||
'#edexcoin_recieve_section,' + |
|||
'#edexcoin_settings' |
|||
) |
|||
.hide(); |
|||
|
|||
// get selected coin's code and populate in easydex wallet widget's html elements
|
|||
var coincode = $(this).data('edexcoincode'); |
|||
$.each($('[data-edexcoin]'), function(index, value) { |
|||
$('[data-edexcoin]').attr('data-edexcoin', coincode); |
|||
$('[data-edexcoin="' + coincode + '"]'); |
|||
}); |
|||
$.each($('[data-edexcoinmenu]'), function(index, value) { |
|||
$('[data-edexcoinmenu]').attr('data-edexcoinmenu', coincode); |
|||
$('[data-edexcoinmenu="' + coincode + '"]'); |
|||
}); |
|||
|
|||
$('#edexcoin-active').text(selected_coinname); |
|||
$('#edex_total_balance_coincode').text(coincode); |
|||
// populate selected coin's address
|
|||
EDEXMainAddr(selected_coin) |
|||
.then(function(result) { |
|||
$('#edexcoin_active_addr').text(result); |
|||
$('#edexcoin_active_addr_clipboard').attr('data-clipboard-text', result); |
|||
}); |
|||
|
|||
$('#edexcoin_active_addr_clipboard').click(function() { |
|||
alertify.success(_lang[defaultLang].DASHBOARD.ADDR_COPIED + '.'); |
|||
}); |
|||
|
|||
if (clipboard && clipboard != null ) { |
|||
clipboard.destroy(); |
|||
} |
|||
|
|||
var clipboard = new Clipboard('.clipboard-edexaddr'); |
|||
clipboard.on('success', function(e) { |
|||
console.info('Action: ', e.action); |
|||
console.info('Text: ', e.text); |
|||
console.info('Trigger: ', e.trigger); |
|||
|
|||
e.clearSelection(); |
|||
}); |
|||
|
|||
clipboard.on('error', function(e) { |
|||
console.error('Action: ', e.action); |
|||
console.error('Trigger: ', e.trigger); |
|||
}); |
|||
|
|||
// populate selected coin's balance
|
|||
if ( selected_coinmode == 'Basilisk' && |
|||
selected_coin !== 'BTC' && |
|||
selected_coin !== 'BTCD' && |
|||
selected_coin !== 'LTC' && |
|||
selected_coin !== 'DOGE' && |
|||
selected_coin !== 'DGB' && |
|||
selected_coin !== 'SYS' && |
|||
selected_coin !== 'MZC' && |
|||
selected_coin !== 'UNO' && |
|||
selected_coin !== 'ZET' && |
|||
selected_coin !== 'BTM' && |
|||
selected_coin !== 'CARB' && |
|||
selected_coin !== 'ANC' && |
|||
selected_coin !== 'FRK' && |
|||
selected_coin !== 'GMC') { |
|||
getDEXGetBalance_cache(selected_coin) |
|||
.then(function(result) { |
|||
if ( result.interest !== undefined && selected_coin == 'KMD') { |
|||
$( |
|||
'#edexcoin_getbalance_interest,' + |
|||
'#edexcoin_getbalance_total_interest' |
|||
) |
|||
.show(); |
|||
$('#edexcoin_getbalance_t') |
|||
.removeClass( 'col-lg-12' ) |
|||
.addClass( 'col-lg-4' ); |
|||
$('#edex_interest_balance').text(result.interest); |
|||
$('#edex_total_balance_interest').text(result.totalbalance); |
|||
$('#edex_total_interest_coincode').text(selected_coin); |
|||
$('#edex_total_balance_interest_coincode').text(selected_coin); |
|||
} |
|||
|
|||
if ( result.interest === undefined || selected_coin !== 'KMD') { |
|||
$( |
|||
'#edexcoin_getbalance_interest,' + |
|||
'#edexcoin_getbalance_total_interest' |
|||
) |
|||
.hide(); |
|||
$('#edexcoin_getbalance_t') |
|||
.removeClass( 'col-lg-4' ) |
|||
.addClass( 'col-lg-12' ); |
|||
$( |
|||
'#edex_interest_balance,' + |
|||
'#edex_total_balance_interest' |
|||
) |
|||
.text('-'); |
|||
} |
|||
|
|||
$('#edex_total_balance').text(result.total); |
|||
$('#edex_total_balance_coincode').text(selected_coin); |
|||
}); |
|||
} else if (selected_coinmode == 'Basilisk') { |
|||
getDEXGetBalance2(selected_coin) |
|||
.then(function(result) { |
|||
if ( result.interest !== undefined ) { |
|||
$( |
|||
'#edexcoin_getbalance_interest,' + |
|||
'#edexcoin_getbalance_total_interest' |
|||
) |
|||
.show(); |
|||
$('#edexcoin_getbalance_t') |
|||
.removeClass( 'col-lg-12' ) |
|||
.addClass( 'col-lg-4' ); |
|||
$('#edex_interest_balance').text(result.interest); |
|||
$('#edex_total_balance_interest').text(result.totalbalance); |
|||
$('#edex_total_interest_coincode').text(selected_coin); |
|||
$('#edex_total_balance_interest_coincode').text(selected_coin); |
|||
} |
|||
|
|||
if ( result.interest === undefined || selected_coin !== 'KMD') { |
|||
$( |
|||
'#edexcoin_getbalance_interest,' + |
|||
'#edexcoin_getbalance_total_interest' |
|||
) |
|||
.hide(); |
|||
$('#edexcoin_getbalance_t') |
|||
.removeClass( 'col-lg-4' ) |
|||
.addClass( 'col-lg-12' ); |
|||
$( |
|||
'#edex_interest_balance,' + |
|||
'#edex_total_balance_interest' |
|||
) |
|||
.text('-'); |
|||
} |
|||
|
|||
$('#edex_total_balance').text(result.total); |
|||
$('#edex_total_balance_coincode').text(selected_coin); |
|||
}); |
|||
} else { |
|||
EDEXlistunspent(selected_coin) |
|||
.then(function(result) { |
|||
if (result[0] != undefined) { |
|||
if ( result[0].interest !== undefined ) { |
|||
$( |
|||
'#edexcoin_getbalance_interest,' + |
|||
'#edexcoin_getbalance_total_interest' |
|||
) |
|||
.show(); |
|||
$('#edexcoin_getbalance_t') |
|||
.removeClass( 'col-lg-12' ) |
|||
.addClass( 'col-lg-4' ); |
|||
$('#edex_interest_balance').text(result[0].interest); |
|||
$('#edex_total_balance_interest').text(result[0].totalbalance); |
|||
$('#edex_total_interest_coincode').text(selected_coin); |
|||
$('#edex_total_balance_interest_coincode').text(selected_coin); |
|||
} |
|||
|
|||
if ( result[0].interest === undefined ) { |
|||
$( |
|||
'#edexcoin_getbalance_interest,' + |
|||
'#edexcoin_getbalance_total_interest' |
|||
) |
|||
.hide(); |
|||
$('#edexcoin_getbalance_t') |
|||
.removeClass( 'col-lg-4' ) |
|||
.addClass( 'col-lg-12' ); |
|||
$( |
|||
'#edex_interest_balance,' + |
|||
'#edex_total_balance_interest' |
|||
) |
|||
.text('-'); |
|||
} |
|||
|
|||
$('#edex_total_balance').text(result[0].total); |
|||
$('#edex_total_balance_coincode').text(selected_coin); |
|||
} else { |
|||
$('#edex_total_balance').text('0'); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
EdexfillTxHistory(coincode); |
|||
} else { |
|||
$('#currency-progressbars').hide(); |
|||
if ( selected_coin == 'KMD' ) { |
|||
sessionStorage.setItem('edexTmpMode', selected_coinmode); |
|||
sessionStorage.setItem('edexTmpRefresh', 'start'); |
|||
$( '#nav-komodo-wallet' ).trigger( 'click' ); |
|||
} |
|||
if ( selected_coin == 'ZEC' ) { |
|||
sessionStorage.setItem('edexTmpMode', selected_coinmode); |
|||
sessionStorage.setItem('edexTmpRefresh', 'start'); |
|||
$( '#nav-zcash-wallet' ).trigger( 'click' ); |
|||
} |
|||
if (checkAC(selected_coin)) { |
|||
sessionStorage.setItem('edexTmpMode', selected_coinmode); |
|||
sessionStorage.setItem('edexTmpRefresh', 'start'); |
|||
assetchain_pax_menu_actions(selected_coin); |
|||
} |
|||
} |
|||
}); |
|||
} |
@ -1,263 +0,0 @@ |
|||
function IguanaAJAX(url, ajax_data) { |
|||
return $.ajax({ |
|||
data: JSON.stringify(ajax_data), |
|||
url: url, |
|||
type: 'POST', |
|||
dataType: 'json' |
|||
}) |
|||
.fail(function(xhr, textStatus, error) { |
|||
// handle request failures
|
|||
console.log(xhr.statusText); |
|||
if ( xhr.readyState == 0 ) { |
|||
Iguana_ServiceUnavailable(); |
|||
} |
|||
console.log(textStatus); |
|||
console.log(error); |
|||
}); |
|||
} |
|||
|
|||
function Iguana_dumpwallet() { |
|||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
|||
ajax_data = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'bitcoinrpc', |
|||
'method': 'dumpwallet', |
|||
'filename': '' |
|||
}; |
|||
|
|||
return_result = function () { |
|||
var tmp = null; |
|||
$.ajax({ |
|||
'async': false, |
|||
'type': 'POST', |
|||
'global': false, |
|||
'url': 'http://127.0.0.1:' + config.iguanaPort, |
|||
'data': JSON.stringify(ajax_data), |
|||
'success': function (data) { |
|||
tmp = data; |
|||
} |
|||
}); |
|||
|
|||
return tmp; |
|||
}(); |
|||
} |
|||
|
|||
function Iguana_ServiceUnavailable() { |
|||
console.log('Network Error api');_lang[defaultLang] |
|||
toastr.error(_lang[defaultLang].TOASTR.IGUANA_CONN_ERR_ALT, _lang[defaultLang].TOASTR.SERVICE_NOTIFICATION); |
|||
toastr.info(_lang[defaultLang].TOASTR.IGUANA_ARE_YOU_SURE, _lang[defaultLang].TOASTR.ACCOUNT_NOTIFICATION); |
|||
ClearOnLogout(true, true); |
|||
} |
|||
|
|||
function secondsToString(seconds) { |
|||
var a = new Date(seconds * 1000), |
|||
months = [ |
|||
'Jan', |
|||
'Feb', |
|||
'Mar', |
|||
'Apr', |
|||
'May', |
|||
'Jun', |
|||
'Jul', |
|||
'Aug', |
|||
'Sep', |
|||
'Oct', |
|||
'Nov', |
|||
'Dec' |
|||
], |
|||
year = a.getFullYear(), |
|||
month = months[a.getMonth()], |
|||
date = a.getDate(), |
|||
hour = a.getHours(), |
|||
min = a.getMinutes(), |
|||
sec = a.getSeconds(), |
|||
time = date + ' ' + month + ' ' + year + ' ' + hour + ':' + min + ':' + sec; |
|||
|
|||
return time; |
|||
} |
|||
|
|||
function Iguana_HashHex(data) { |
|||
var result = '', |
|||
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
|||
ajax_data = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'hash', |
|||
'method': 'hex', |
|||
'message': data |
|||
}; |
|||
|
|||
$.ajax({ |
|||
async: false, |
|||
type: 'POST', |
|||
data: JSON.stringify(ajax_data), |
|||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|||
success: function(data, textStatus, jqXHR) { |
|||
var AjaxOutputData = JSON.parse(data); |
|||
result = AjaxOutputData.hex; |
|||
}, |
|||
error: function(xhr, textStatus, error) { |
|||
console.log(xhr.statusText); |
|||
if ( xhr.readyState == 0 ) { |
|||
Iguana_ServiceUnavailable(); |
|||
} |
|||
console.log(textStatus); |
|||
console.log(error); |
|||
} |
|||
}); |
|||
|
|||
return result; |
|||
} |
|||
|
|||
function Iguana_SetRPCAuth() { |
|||
var tmpPass = '1234';//md5(PassPhraseGenerator.generatePassPhrase(128));
|
|||
sessionStorage.setItem('IguanaRPCAuth', tmpPass); |
|||
} |
|||
|
|||
function Iguana_CheckActiveCoins() { |
|||
return new Promise((resolve) => { |
|||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
|||
ajax_data = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'InstantDEX', |
|||
'method': 'allcoins' |
|||
}, |
|||
AjaxOutputData = IguanaAJAX('http://127.0.0.1:' + config.iguanaPort, ajax_data).done(function(data) { |
|||
console.log(data); |
|||
var result = []; |
|||
|
|||
AjaxOutputData = JSON.parse(AjaxOutputData.responseText); |
|||
$.each(AjaxOutputData, function( index, value ) { |
|||
if ( index === 'tag' ) { |
|||
|
|||
} else { |
|||
if (AjaxOutputData[index].length !== 0 ) { |
|||
result.push({ 'active': AjaxOutputData[index].length }); |
|||
} |
|||
} |
|||
}); |
|||
|
|||
resolve(result); |
|||
}) |
|||
.fail(function(xhr, textStatus, error) { |
|||
// handle request failures
|
|||
console.log(xhr.statusText); |
|||
if ( xhr.readyState == 0 ) { |
|||
} |
|||
console.log(textStatus); |
|||
console.log(error); |
|||
}) |
|||
}); |
|||
} |
|||
|
|||
function Iguana_utxorawtx(data) { |
|||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
|||
ajax_data = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'symbol': data.coin, |
|||
'agent': 'basilisk', |
|||
'method': 'utxorawtx', |
|||
'vals': { |
|||
'timelock': 0, |
|||
'changeaddr': data.sendfrom, |
|||
'destaddr': data.sendtoaddr, |
|||
'txfee': data.txfee, |
|||
'amount': data.amount, |
|||
'sendflag': data.sendsig |
|||
}, |
|||
'utxos': data.utxos |
|||
}; |
|||
|
|||
return new Promise((resolve) => { |
|||
console.log(ajax_data); |
|||
$.ajax({ |
|||
data: JSON.stringify(ajax_data), |
|||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|||
type: 'POST', |
|||
dataType: 'json' |
|||
}) |
|||
.then(result => { |
|||
console.log(result); |
|||
resolve(result); |
|||
}); |
|||
}); |
|||
} |
|||
|
|||
function checkAC(coinVal) { |
|||
if (coinVal == 'SUPERNET' || |
|||
coinVal == 'REVS' || |
|||
coinVal == 'WIRELESS' || |
|||
coinVal == 'DEX' || |
|||
coinVal == 'PANGEA' || |
|||
coinVal == 'JUMBLR' || |
|||
coinVal == 'BET' || |
|||
coinVal == 'CRYPTO' || |
|||
coinVal == 'HODL' || |
|||
coinVal == 'SHARK' || |
|||
coinVal == 'BOTS' || |
|||
coinVal == 'MGW' || |
|||
coinVal == 'MVP' || |
|||
coinVal == 'KV' || |
|||
coinVal == 'CEAL' || |
|||
coinVal == 'MESH' || |
|||
coinVal == 'USD' || |
|||
coinVal == 'RON' || |
|||
coinVal == 'EUR' || |
|||
coinVal == 'JPY' || |
|||
coinVal == 'GBP' || |
|||
coinVal == 'AUD' || |
|||
coinVal == 'CAD' || |
|||
coinVal == 'CHF' || |
|||
coinVal == 'NZD' || |
|||
coinVal == 'CNY' || |
|||
coinVal == 'RUB' || |
|||
coinVal == 'MXN' || |
|||
coinVal == 'BRL' || |
|||
coinVal == 'INR' || |
|||
coinVal == 'HKD' || |
|||
coinVal == 'TRY' || |
|||
coinVal == 'ZAR' || |
|||
coinVal == 'PLN' || |
|||
coinVal == 'NOK' || |
|||
coinVal == 'SEK' || |
|||
coinVal == 'DKK' || |
|||
coinVal == 'CZK' || |
|||
coinVal == 'HUF' || |
|||
coinVal == 'ILS' || |
|||
coinVal == 'KRW' || |
|||
coinVal == 'MYR' || |
|||
coinVal == 'PHP' || |
|||
coinVal == 'SGD' || |
|||
coinVal == 'THB' || |
|||
coinVal == 'BGN' || |
|||
coinVal == 'IDR' || |
|||
coinVal == 'HRK') { |
|||
return true; |
|||
} else { |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
function formatBytes(bytes, decimals) { |
|||
if (bytes == 0) |
|||
return '0 Bytes'; |
|||
|
|||
var k = 1000, |
|||
dm = decimals + 1 || 3, |
|||
sizes = [ |
|||
'Bytes', |
|||
'KB', |
|||
'MB', |
|||
'GB', |
|||
'TB', |
|||
'PB', |
|||
'EB', |
|||
'ZB', |
|||
'YB' |
|||
], |
|||
i = Math.floor(Math.log(bytes) / Math.log(k)); |
|||
|
|||
return { |
|||
'ramsize': parseFloat((bytes / Math.pow(k, i)).toFixed(dm)), |
|||
'size': sizes[i] |
|||
}; |
|||
} |
File diff suppressed because it is too large
@ -1,549 +0,0 @@ |
|||
function Iguana_DEXgetNotaries(coin) { |
|||
var result = []; |
|||
|
|||
// Get parameters values from confirm dialog and send currency
|
|||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
|||
ajax_data = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'getnotaries', |
|||
'symbol': coin |
|||
}; |
|||
|
|||
console.log(ajax_data); |
|||
$.ajax({ |
|||
type: 'POST', |
|||
data: JSON.stringify(ajax_data), |
|||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|||
success: function(data, textStatus, jqXHR) { |
|||
var AjaxOutputData = JSON.parse(data); |
|||
|
|||
result.push(AjaxOutputData); |
|||
if (AjaxOutputData.error === 'less than required responses') { |
|||
toastr.error(_lang[defaultLang].TOASTR.LESS_RESPONSES_REQ, _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION); |
|||
} |
|||
}, |
|||
error: function(xhr, textStatus, error) { |
|||
console.log(xhr.statusText); |
|||
if ( xhr.readyState == 0 ) { |
|||
Iguana_ServiceUnavailable(); |
|||
} |
|||
console.log(textStatus); |
|||
console.log(error); |
|||
} |
|||
}); |
|||
|
|||
return result[0]; |
|||
} |
|||
|
|||
function Iguana_DEXImportAddr(coin,addr) { |
|||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
|||
ajax_data_1 = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'checkaddress', |
|||
'address': addr, |
|||
'symbol': coin |
|||
}; |
|||
|
|||
ajax_call_1 = $.ajax({ |
|||
data: JSON.stringify(ajax_data_1), |
|||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|||
type: 'POST', |
|||
dataType: 'json' |
|||
}); |
|||
|
|||
var ajax_call_2 = ajax_call_1.then(function(data) { |
|||
if (('error' in data)) { |
|||
var ajax_data_2 = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'importaddress', |
|||
'address': addr, |
|||
'symbol': coin |
|||
}; |
|||
|
|||
return $.ajax({ |
|||
data: JSON.stringify(ajax_data_2), |
|||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|||
type: 'POST', |
|||
dataType: 'json' |
|||
}); |
|||
} else { |
|||
var tmp_result = 'already in list'; |
|||
return tmp_result; |
|||
} |
|||
}); |
|||
|
|||
ajax_call_2.done(function(data) { |
|||
console.log(data); |
|||
|
|||
if (data == 'already in list') { |
|||
toastr.info(coin + ' ' + _lang[defaultLang].TOASTR.ADDR_ALREADY_REG, _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION); |
|||
} else { |
|||
if (data.iswatchonly == true) { |
|||
toastr.success(_lang[defaultLang].TOASTR.REG + ' ' + coin + _lang[defaultLang].TOASTR.REG_ADDR, _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION); |
|||
} |
|||
if (data.iswatchonly == false) { |
|||
toastr.success(coin + _lang[defaultLang].TOASTR.REG_ADDR_FAILED, _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION); |
|||
} |
|||
if (data.iswatchonly == undefined) { |
|||
toastr.error(_lang[defaultLang].TOASTR.INVALID_QUERY + ' ' + coin + '. ' + _lang[defaultLang].TOASTR.TRY_AGAIN, _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION); |
|||
} |
|||
if (data.error === 'less than required responses') { |
|||
toastr.error(_lang[defaultLang].TOASTR.LESS_RESPONSES_REQ, _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION); |
|||
} |
|||
} |
|||
}); |
|||
} |
|||
|
|||
function Iguana_DEXImportAllWalletAddr(coin) { |
|||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
|||
ajax_data_2 = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'coin': coin, |
|||
'agent': 'bitcoinrpc', |
|||
'method': 'getaddressesbyaccount', |
|||
'account': '*' |
|||
}, |
|||
tmp_coin_addr = null, |
|||
ajax_call_2 = $.ajax({ |
|||
data: JSON.stringify(ajax_data_2), |
|||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|||
type: 'POST', |
|||
dataType: 'json' |
|||
}), |
|||
ajax_call_3 = ajax_call_2.then(function(data) { |
|||
$.each(data.result, function(coinaddr_index, coinaddr_value) { |
|||
console.log(coinaddr_index); |
|||
console.log(coinaddr_value); |
|||
|
|||
var ajax_data_4 = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'checkaddress', |
|||
'address': coinaddr_value, |
|||
'symbol': coin |
|||
}; |
|||
ajax_call_4 = $.ajax({ |
|||
data: JSON.stringify(ajax_data_4), |
|||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|||
type: 'POST', |
|||
dataType: 'json', |
|||
}); |
|||
var ajax_call_5 = ajax_call_4.then(function(data) { |
|||
console.log(data); |
|||
console.log(coinaddr_value); |
|||
|
|||
if (('error' in data) || !('address' in data)) { |
|||
var ajax_data_4 = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'importaddress', |
|||
'address': coinaddr_value, |
|||
'symbol': coin |
|||
}; |
|||
|
|||
return $.ajax({ |
|||
data: JSON.stringify(ajax_data_4), |
|||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|||
type: 'POST', |
|||
dataType: 'json' |
|||
}); |
|||
} else { |
|||
var tmp_result = 'already in list'; |
|||
return tmp_result; |
|||
} |
|||
}); |
|||
|
|||
ajax_call_5.done(function(data) { |
|||
console.log(coin) |
|||
console.log(data); |
|||
|
|||
if (data == 'already in list') {_lang[defaultLang] |
|||
toastr.info(coinaddr_value + ' ' + _lang[defaultLang].TOASTR.ADDR_ALREADY_REG, _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION + ' - ' + coin); |
|||
} else { |
|||
if (data.iswatchonly == true) { |
|||
toastr.success(_lang[defaultLang].TOASTR.REG + ' ' + coinaddr_value + ' ' + _lang[defaultLang].TOASTR.REG_ADDR, _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION + ' - ' + coin); |
|||
} |
|||
if (data.iswatchonly == false) { |
|||
toastr.success(coinaddr_value + ' ' + _lang[defaultLang].TOASTR.REG_ADDR_FAILED, _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION + ' - ' + coin); |
|||
} |
|||
if (data.iswatchonly == undefined) { |
|||
toastr.error(_lang[defaultLang].TOASTR.INVALID_QUERY + ' ' + coinaddr_value + '. ' + _lang[defaultLang].TOASTR.TRY_AGAIN, _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION + ' - ' + coin); |
|||
} |
|||
if (data.error === 'less than required responses') { |
|||
toastr.error(_lang[defaultLang].TOASTR.LESS_RESPONSES_REQ, _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION + ' - ' + coin); |
|||
} |
|||
} |
|||
}); |
|||
}); |
|||
}); |
|||
} |
|||
|
|||
function Iguana_DEXImportAll() { |
|||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
|||
ajax_data_1 = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'InstantDEX', |
|||
'method': 'allcoins' |
|||
}, |
|||
ajax_call_1 = $.ajax({ |
|||
data: JSON.stringify(ajax_data_1), |
|||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|||
type: 'POST', |
|||
dataType: 'json' |
|||
}); |
|||
|
|||
ajax_call_1.done(function(data) { |
|||
$.each([ |
|||
'basilisk', |
|||
'full' |
|||
], function(data_index, data_value) { |
|||
$.each(data[data_value], function(mode_index, mode_value) { |
|||
var ajax_data_2 = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'coin': mode_value, |
|||
'agent': 'bitcoinrpc', |
|||
'method': 'getaddressesbyaccount', |
|||
'account': '*' |
|||
}, |
|||
tmp_coin_addr = null, |
|||
ajax_call_2 = $.ajax({ |
|||
data: JSON.stringify(ajax_data_2), |
|||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|||
type: 'POST', |
|||
dataType: 'json' |
|||
}), |
|||
ajax_call_3 = ajax_call_2.then(function(data) { |
|||
$.each(data.result, function(coinaddr_index, coinaddr_value) { |
|||
console.log(coinaddr_index); |
|||
console.log(coinaddr_value); |
|||
|
|||
var ajax_data_4 = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'checkaddress', |
|||
'address': coinaddr_value, |
|||
'symbol': mode_value |
|||
}, |
|||
ajax_call_4 = $.ajax({ |
|||
data: JSON.stringify(ajax_data_4), |
|||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|||
type: 'POST', |
|||
dataType: 'json' |
|||
}), |
|||
ajax_call_5 = ajax_call_4.then(function(data) { |
|||
console.log(data); |
|||
console.log(coinaddr_value); |
|||
|
|||
if (('error' in data) || !('address' in data)) { |
|||
var ajax_data_4 = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'importaddress', |
|||
'address': coinaddr_value, |
|||
'symbol': mode_value |
|||
}; |
|||
|
|||
return $.ajax({ |
|||
data: JSON.stringify(ajax_data_4), |
|||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|||
type: 'POST', |
|||
dataType: 'json', |
|||
}); |
|||
} else { |
|||
var tmp_result = 'already in list'; |
|||
return tmp_result; |
|||
} |
|||
}); |
|||
|
|||
ajax_call_5.done(function(data) { |
|||
console.log(mode_value); |
|||
console.log(data); |
|||
|
|||
if (data == 'already in list') { |
|||
toastr.info(coinaddr_value + _lang[defaultLang].TOASTR.ADDR_ALREADY_REG, _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION + ' - ' + mode_value); |
|||
} else { |
|||
if (data.iswatchonly == true) { |
|||
toastr.success(_lang[defaultLang].TOASTR.REG + ' ' + coinaddr_value + ' ' + _lang[defaultLang].TOASTR.REG_ADDR, _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION + ' - ' + mode_value); |
|||
} |
|||
if (data.iswatchonly == false) { |
|||
toastr.success(coinaddr_value + ' ' + _lang[defaultLang].TOASTR.REG_ADDR_FAILED, _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION + ' - ' + mode_value); |
|||
} |
|||
if (data.iswatchonly == undefined) { |
|||
toastr.error(_lang[defaultLang].TOASTR.INVALID_QUERY + ' ' + coinaddr_value + '. ' + _lang[defaultLang].TOASTR.TRY_AGAIN, _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION + ' - ' + mode_value); |
|||
} |
|||
if (data.error === 'less than required responses') { |
|||
toastr.error(_lang[defaultLang].TOASTR.LESS_RESPONSES_REQ, _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION + ' - ' + mode_value); |
|||
} |
|||
} |
|||
}); |
|||
}); |
|||
}); |
|||
|
|||
ajax_call_3.done(function() { |
|||
console.log('Registered addresses from all active coin wallets.'); |
|||
}); |
|||
}); |
|||
}); |
|||
}); |
|||
} |
|||
|
|||
function Iguana_DEXCheckAddr(coin,addr) { |
|||
var result = []; |
|||
|
|||
// Get parameters values from confirm dialog and send currency
|
|||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
|||
ajax_data = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'checkaddress', |
|||
'address': addr, |
|||
'symbol': coin |
|||
}; |
|||
|
|||
console.log(ajax_data); |
|||
$.ajax({ |
|||
type: 'POST', |
|||
data: JSON.stringify(ajax_data), |
|||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|||
success: function(data, textStatus, jqXHR) { |
|||
var AjaxOutputData = JSON.parse(data); |
|||
result.push(AjaxOutputData); |
|||
|
|||
if (AjaxOutputData.error === 'less than required responses') { |
|||
toastr.error(_lang[defaultLang].TOASTR.LESS_RESPONSES_REQ, _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION); |
|||
} |
|||
}, |
|||
error: function(xhr, textStatus, error) { |
|||
console.log(xhr.statusText); |
|||
if ( xhr.readyState == 0 ) { |
|||
Iguana_ServiceUnavailable(); |
|||
} |
|||
console.log(textStatus); |
|||
console.log(error); |
|||
} |
|||
}); |
|||
|
|||
return result; |
|||
} |
|||
|
|||
function Iguana_DEXValidateAddr(coin, addr) { |
|||
var result = []; |
|||
|
|||
// Get parameters values from confirm dialog and send currency
|
|||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
|||
ajax_data = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'validateaddress', |
|||
'address': addr, |
|||
'symbol': coin |
|||
}; |
|||
|
|||
console.log(ajax_data); |
|||
$.ajax({ |
|||
type: 'POST', |
|||
data: JSON.stringify(ajax_data), |
|||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|||
success: function(data, textStatus, jqXHR) { |
|||
var AjaxOutputData = JSON.parse(data); |
|||
|
|||
if (AjaxOutputData.iswatchonly == true) { |
|||
toastr.success(_lang[defaultLang].TOASTR.VALIDATION_SUCCESS, _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION); |
|||
} |
|||
if (AjaxOutputData.iswatchonly == false) { |
|||
toastr.info(_lang[defaultLang].TOASTR.ADDR_ISNT_REG, _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION); |
|||
} |
|||
if (AjaxOutputData.iswatchonly == undefined) { |
|||
toastr.error(_lang[defaultLang].TOASTR.INVALID_QUERY_ALT, _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION); |
|||
} |
|||
result.push(AjaxOutputData); |
|||
if (AjaxOutputData.error === 'less than required responses') { |
|||
toastr.error(_lang[defaultLang].TOASTR.LESS_RESPONSES_REQ, _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION); |
|||
} |
|||
}, |
|||
error: function(xhr, textStatus, error) { |
|||
console.log(xhr.statusText); |
|||
if ( xhr.readyState == 0 ) { |
|||
Iguana_ServiceUnavailable(); |
|||
} |
|||
console.log(textStatus); |
|||
console.log(error); |
|||
} |
|||
}); |
|||
|
|||
return result; |
|||
} |
|||
|
|||
function Iguana_DEXsendrawtx(data) { |
|||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
|||
ajax_data = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'sendrawtransaction', |
|||
'signedtx': data.signedtx, |
|||
'symbol': data.coin |
|||
}; |
|||
|
|||
return new Promise((resolve) => { |
|||
console.log(ajax_data); |
|||
$.ajax({ |
|||
data: JSON.stringify(ajax_data), |
|||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|||
type: 'POST' |
|||
}) |
|||
.then(result => { |
|||
console.log(result); |
|||
resolve(result); |
|||
}); |
|||
}); |
|||
} |
|||
|
|||
function EDEX_DEXlistunspent(coin, addr) { |
|||
NProgress.done(true); |
|||
NProgress.configure({ |
|||
template: templates.nprogressBar |
|||
}); |
|||
NProgress.start(); |
|||
|
|||
return new Promise((resolve) => { |
|||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
|||
ajax_data = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'listunspent', |
|||
'address': addr, |
|||
'symbol': coin |
|||
}, |
|||
AjaxOutputData = IguanaAJAX('http://127.0.0.1:' + config.iguanaPort, ajax_data).done(function(data) { |
|||
AjaxOutputData = JSON.parse(AjaxOutputData.responseText) |
|||
|
|||
if (AjaxOutputData == '' ) { |
|||
result.push([{ 'amount': 0 }]); |
|||
} |
|||
if (AjaxOutputData.error === 'less than required responses') { |
|||
toastr.error(_lang[defaultLang].TOASTR.LESS_RESPONSES_REQ, _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION); |
|||
} |
|||
resolve(AjaxOutputData); |
|||
}) |
|||
.fail(function(xhr, textStatus, error) { |
|||
// handle request failures
|
|||
console.log(xhr.statusText); |
|||
if ( xhr.readyState == 0 ) { |
|||
} |
|||
console.log(textStatus); |
|||
console.log(error); |
|||
}); |
|||
|
|||
NProgress.done(); |
|||
}); |
|||
} |
|||
|
|||
function EDEX_DEXnotarychains() { |
|||
NProgress.done(true); |
|||
NProgress.configure({ |
|||
template: templates.nprogressBar |
|||
}); |
|||
NProgress.start(); |
|||
|
|||
var result = [], |
|||
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
|||
ajax_data = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dpow', |
|||
'method': 'notarychains' |
|||
}; |
|||
|
|||
console.log(ajax_data); |
|||
$.ajax({ |
|||
type: 'POST', |
|||
data: JSON.stringify(ajax_data), |
|||
url: 'http://127.0.0.1:' + config.iguanaPort, |
|||
success: function(data, textStatus, jqXHR) { |
|||
var AjaxOutputData = JSON.parse(data); // Ajax output gets the whole list of unspent coin with addresses
|
|||
console.log('== EDEX_DEXnotarychains Data OutPut =='); |
|||
result.push(AjaxOutputData); |
|||
}, |
|||
error: function(xhr, textStatus, error) { |
|||
console.log(xhr.statusText); |
|||
if ( xhr.readyState == 0 ) { |
|||
Iguana_ServiceUnavailable(); |
|||
} |
|||
console.log(textStatus); |
|||
console.log(error); |
|||
} |
|||
}); |
|||
|
|||
NProgress.done(); |
|||
return result[0]; |
|||
} |
|||
|
|||
function EDEX_DEXgetinfoAll() { |
|||
NProgress.done(true); |
|||
NProgress.configure({ |
|||
template: templates.nprogressBar |
|||
}); |
|||
NProgress.start(); |
|||
|
|||
var result = [], |
|||
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
|||
ajax_data = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dpow', |
|||
'method': 'notarychains' |
|||
}, |
|||
get_dex_notarychains = IguanaAJAX('http://127.0.0.1:' + config.iguanaPort, ajax_data).done(function(data) { |
|||
get_dex_notarychains = JSON.parse(get_dex_notarychains.responseText); |
|||
|
|||
var refresh_percent = ''; |
|||
|
|||
$.each(get_dex_notarychains, function( coin_index, coin_value ) { |
|||
console.log(coin_index + ': ' + coin_value); |
|||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
|||
ajax_data = { |
|||
'userpass': tmpIguanaRPCAuth, |
|||
'agent': 'dex', |
|||
'method': 'getinfo', |
|||
'symbol': coin_value |
|||
}; |
|||
console.log(ajax_data); |
|||
|
|||
if (coin_value !== 'MESH') { |
|||
var getinfo_each_chain = IguanaAJAX('http://127.0.0.1:' + config.iguanaPort, ajax_data).done(function(data) { |
|||
getinfo_each_chain = JSON.parse(getinfo_each_chain.responseText); |
|||
console.log('== EDEX_DEXgetinfoAll Data OutPut =='); |
|||
console.log(getinfo_each_chain); |
|||
|
|||
var tmp_index = parseInt(coin_index) + 1, |
|||
refresh_percent = parseFloat(parseInt(coin_index, 10) * 100) / parseInt(get_dex_notarychains.length, 10); |
|||
|
|||
console.log(refresh_percent); |
|||
$('#basilisk-connections-refresh-title').text(_lang[defaultLang].IAPI.CON_STATUS + '... ' + tmp_index + '/' + get_dex_notarychains.length + ': ' + coin_value); |
|||
$('#basilisk-connections-refresh-percent').text(refresh_percent + '%'); |
|||
$('#basilisk-connections-refresh-progress-bar').width(refresh_percent + '%'); |
|||
|
|||
if (getinfo_each_chain == '' ) { |
|||
result.push([{ 'amount': 0 }]); |
|||
} |
|||
result.push(getinfo_each_chain); |
|||
if (getinfo_each_chain.error === 'less than required responses') { |
|||
toastr.info(_lang[defaultLang].TOASTR.LESS_RESPONSES_REQ_FOR + ' ' + coin_value + '.', _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION); |
|||
$('#basilisk-connections-refresh-status-output').text('Output: ' + getinfo_each_chain.error); |
|||
} else { |
|||
$('#basilisk-connections-refresh-status-output').text('Output: Connected'); |
|||
} |
|||
if ( tmp_index == get_dex_notarychains.length-1 ) { |
|||
$('#basilisk-connections-refresh-progress-bar').width('100%'); |
|||
$('#RefreshBasiliskConnectionsMdl').modal('hide'); |
|||
toastr.success(_lang[defaultLang].TOASTR.BASILISK_CON_REFRESHED + '.', _lang[defaultLang].TOASTR.BASILISK_NOTIFICATION); |
|||
} |
|||
}); |
|||
} |
|||
}); |
|||
}); |
|||
|
|||
NProgress.done(); |
|||
return result[0]; |
|||
} |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue