initial source commit
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<bundle minify="true" runOnBuild="true">
|
||||
<file>/ClientSource/Scripts/Core/modernizr-2.6.2.js</file>
|
||||
<file>/ClientSource/Scripts/Core/jquery-1.8.3.js</file>
|
||||
<file>/ClientSource/Scripts/Core/jquery.validate.js</file>
|
||||
<file>/ClientSource/Scripts/Core/jquery.validate.unobtrusive.js</file>
|
||||
<file>/ClientSource/Scripts/Core/disco.unobtrusiveValidation.extensions.js</file>
|
||||
<file>/ClientSource/Scripts/Core/jquery-ui-1.9.2.js</file>
|
||||
<file>/ClientSource/Scripts/Core/jquery.watermark.js</file>
|
||||
<file>/ClientSource/Scripts/Core/jquery.dataTables.js</file>
|
||||
<file>/ClientSource/Scripts/Core/disco.dataTables.extensions.js</file>
|
||||
</bundle>
|
||||
+2
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,40 @@
|
||||
jQuery.fn.dataTableExt.afnSortData['text'] = function (oSettings, iColumn) {
|
||||
var aData = [];
|
||||
$('td:eq(' + iColumn + ')', oSettings.oApi._fnGetTrNodes(oSettings)).each(function () {
|
||||
aData.push(jQuery.trim($(this).text()));
|
||||
});
|
||||
return aData;
|
||||
}
|
||||
jQuery.fn.dataTableExt.afnSortData['disco_datetime'] = function (oSettings, iColumn) {
|
||||
var aData = [];
|
||||
$('td:eq(' + iColumn + ')', oSettings.oApi._fnGetTrNodes(oSettings)).each(function () {
|
||||
var d = $(this).children('span.date[data-discodatetime]');
|
||||
if (d.length > 0)
|
||||
aData.push((d.attr('data-discodatetime')) * 1);
|
||||
else
|
||||
aData.push(-1);
|
||||
});
|
||||
return aData;
|
||||
}
|
||||
|
||||
jQuery.fn.dataTableExt.oSort['au_date-pre'] = function (a) {
|
||||
var ukDatea = a.split('/');
|
||||
return (ukDatea[2] + ukDatea[1] + ukDatea[0]) * 1;
|
||||
};
|
||||
jQuery.fn.dataTableExt.oSort['au_date-asc'] = function (a, b) {
|
||||
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
||||
};
|
||||
jQuery.fn.dataTableExt.oSort['au_date-desc'] = function (a, b) {
|
||||
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
|
||||
};
|
||||
|
||||
jQuery.fn.dataTableExt.oSort['disco_datetime-asc'] = function (a, b) {
|
||||
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
||||
};
|
||||
jQuery.fn.dataTableExt.oSort['disco_datetime-desc'] = function (a, b) {
|
||||
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
|
||||
};
|
||||
|
||||
// Change Default Menu Lengths
|
||||
|
||||
jQuery.fn.DataTable.defaults.aLengthMenu = [[10, 20, 50, -1], [10, 20, 50, "All"]];
|
||||
@@ -0,0 +1,35 @@
|
||||
// Adapted from: http://xhalent.wordpress.com/2011/01/24/applying-unobtrusive-validation-to-dynamic-content/
|
||||
(function ($) {
|
||||
$.validator.unobtrusive.reparse = function (selector) {
|
||||
//use the normal unobstrusive.parse method
|
||||
$.validator.unobtrusive.parse(selector);
|
||||
|
||||
//get the relevant form
|
||||
var form = $(selector).first().closest('form');
|
||||
|
||||
//get the collections of unobstrusive validators, and jquery validators
|
||||
//and compare the two
|
||||
var unobtrusiveValidation = form.data('unobtrusiveValidation');
|
||||
var validator = form.validate();
|
||||
|
||||
$.each(unobtrusiveValidation.options.rules, function (elname, elrules) {
|
||||
if (validator.settings.rules[elname] == undefined) {
|
||||
var args = {};
|
||||
$.extend(args, elrules);
|
||||
args.messages = unobtrusiveValidation.options.messages[elname];
|
||||
//edit:use quoted strings for the name selector
|
||||
$("[name='" + elname + "']").rules("add", args);
|
||||
} else {
|
||||
$.each(elrules, function (rulename, data) {
|
||||
if (validator.settings.rules[elname][rulename] == undefined) {
|
||||
var args = {};
|
||||
args[rulename] = data;
|
||||
args.messages = unobtrusiveValidation.options.messages[elname][rulename];
|
||||
//edit:use quoted strings for the name selector
|
||||
$("[name='" + elname + "']").rules("add", args);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
})($);
|
||||
File diff suppressed because it is too large
Load Diff
+9472
File diff suppressed because it is too large
Load Diff
+14912
File diff suppressed because it is too large
Load Diff
+12092
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+1248
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,365 @@
|
||||
/*!
|
||||
** Unobtrusive validation support library for jQuery and jQuery Validate
|
||||
** Copyright (C) Microsoft Corporation. All rights reserved.
|
||||
*/
|
||||
|
||||
/*jslint white: true, browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: false */
|
||||
/*global document: false, jQuery: false */
|
||||
|
||||
(function ($) {
|
||||
var $jQval = $.validator,
|
||||
adapters,
|
||||
data_validation = "unobtrusiveValidation";
|
||||
|
||||
function setValidationValues(options, ruleName, value) {
|
||||
options.rules[ruleName] = value;
|
||||
if (options.message) {
|
||||
options.messages[ruleName] = options.message;
|
||||
}
|
||||
}
|
||||
|
||||
function splitAndTrim(value) {
|
||||
return value.replace(/^\s+|\s+$/g, "").split(/\s*,\s*/g);
|
||||
}
|
||||
|
||||
function escapeAttributeValue(value) {
|
||||
// As mentioned on http://api.jquery.com/category/selectors/
|
||||
return value.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g, "\\$1");
|
||||
}
|
||||
|
||||
function getModelPrefix(fieldName) {
|
||||
return fieldName.substr(0, fieldName.lastIndexOf(".") + 1);
|
||||
}
|
||||
|
||||
function appendModelPrefix(value, prefix) {
|
||||
if (value.indexOf("*.") === 0) {
|
||||
value = value.replace("*.", prefix);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
function onError(error, inputElement) { // 'this' is the form element
|
||||
var container = $(this).find("[data-valmsg-for='" + escapeAttributeValue(inputElement[0].name) + "']"),
|
||||
replace = $.parseJSON(container.attr("data-valmsg-replace")) !== false;
|
||||
|
||||
container.removeClass("field-validation-valid").addClass("field-validation-error");
|
||||
error.data("unobtrusiveContainer", container);
|
||||
|
||||
if (replace) {
|
||||
container.empty();
|
||||
error.removeClass("input-validation-error").appendTo(container);
|
||||
}
|
||||
else {
|
||||
error.hide();
|
||||
}
|
||||
}
|
||||
|
||||
function onErrors(event, validator) { // 'this' is the form element
|
||||
var container = $(this).find("[data-valmsg-summary=true]"),
|
||||
list = container.find("ul");
|
||||
|
||||
if (list && list.length && validator.errorList.length) {
|
||||
list.empty();
|
||||
container.addClass("validation-summary-errors").removeClass("validation-summary-valid");
|
||||
|
||||
$.each(validator.errorList, function () {
|
||||
$("<li />").html(this.message).appendTo(list);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function onSuccess(error) { // 'this' is the form element
|
||||
var container = error.data("unobtrusiveContainer"),
|
||||
replace = $.parseJSON(container.attr("data-valmsg-replace"));
|
||||
|
||||
if (container) {
|
||||
container.addClass("field-validation-valid").removeClass("field-validation-error");
|
||||
error.removeData("unobtrusiveContainer");
|
||||
|
||||
if (replace) {
|
||||
container.empty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onReset(event) { // 'this' is the form element
|
||||
var $form = $(this);
|
||||
$form.data("validator").resetForm();
|
||||
$form.find(".validation-summary-errors")
|
||||
.addClass("validation-summary-valid")
|
||||
.removeClass("validation-summary-errors");
|
||||
$form.find(".field-validation-error")
|
||||
.addClass("field-validation-valid")
|
||||
.removeClass("field-validation-error")
|
||||
.removeData("unobtrusiveContainer")
|
||||
.find(">*") // If we were using valmsg-replace, get the underlying error
|
||||
.removeData("unobtrusiveContainer");
|
||||
}
|
||||
|
||||
function validationInfo(form) {
|
||||
var $form = $(form),
|
||||
result = $form.data(data_validation),
|
||||
onResetProxy = $.proxy(onReset, form);
|
||||
|
||||
if (!result) {
|
||||
result = {
|
||||
options: { // options structure passed to jQuery Validate's validate() method
|
||||
errorClass: "input-validation-error",
|
||||
errorElement: "span",
|
||||
errorPlacement: $.proxy(onError, form),
|
||||
invalidHandler: $.proxy(onErrors, form),
|
||||
messages: {},
|
||||
rules: {},
|
||||
success: $.proxy(onSuccess, form)
|
||||
},
|
||||
attachValidation: function () {
|
||||
$form
|
||||
.unbind("reset." + data_validation, onResetProxy)
|
||||
.bind("reset." + data_validation, onResetProxy)
|
||||
.validate(this.options);
|
||||
},
|
||||
validate: function () { // a validation function that is called by unobtrusive Ajax
|
||||
$form.validate();
|
||||
return $form.valid();
|
||||
}
|
||||
};
|
||||
$form.data(data_validation, result);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
$jQval.unobtrusive = {
|
||||
adapters: [],
|
||||
|
||||
parseElement: function (element, skipAttach) {
|
||||
/// <summary>
|
||||
/// Parses a single HTML element for unobtrusive validation attributes.
|
||||
/// </summary>
|
||||
/// <param name="element" domElement="true">The HTML element to be parsed.</param>
|
||||
/// <param name="skipAttach" type="Boolean">[Optional] true to skip attaching the
|
||||
/// validation to the form. If parsing just this single element, you should specify true.
|
||||
/// If parsing several elements, you should specify false, and manually attach the validation
|
||||
/// to the form when you are finished. The default is false.</param>
|
||||
var $element = $(element),
|
||||
form = $element.parents("form")[0],
|
||||
valInfo, rules, messages;
|
||||
|
||||
if (!form) { // Cannot do client-side validation without a form
|
||||
return;
|
||||
}
|
||||
|
||||
valInfo = validationInfo(form);
|
||||
valInfo.options.rules[element.name] = rules = {};
|
||||
valInfo.options.messages[element.name] = messages = {};
|
||||
|
||||
$.each(this.adapters, function () {
|
||||
var prefix = "data-val-" + this.name,
|
||||
message = $element.attr(prefix),
|
||||
paramValues = {};
|
||||
|
||||
if (message !== undefined) { // Compare against undefined, because an empty message is legal (and falsy)
|
||||
prefix += "-";
|
||||
|
||||
$.each(this.params, function () {
|
||||
paramValues[this] = $element.attr(prefix + this);
|
||||
});
|
||||
|
||||
this.adapt({
|
||||
element: element,
|
||||
form: form,
|
||||
message: message,
|
||||
params: paramValues,
|
||||
rules: rules,
|
||||
messages: messages
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$.extend(rules, { "__dummy__": true });
|
||||
|
||||
if (!skipAttach) {
|
||||
valInfo.attachValidation();
|
||||
}
|
||||
},
|
||||
|
||||
parse: function (selector) {
|
||||
/// <summary>
|
||||
/// Parses all the HTML elements in the specified selector. It looks for input elements decorated
|
||||
/// with the [data-val=true] attribute value and enables validation according to the data-val-*
|
||||
/// attribute values.
|
||||
/// </summary>
|
||||
/// <param name="selector" type="String">Any valid jQuery selector.</param>
|
||||
var $forms = $(selector)
|
||||
.parents("form")
|
||||
.andSelf()
|
||||
.add($(selector).find("form"))
|
||||
.filter("form");
|
||||
|
||||
$(selector).find(":input[data-val=true]").each(function () {
|
||||
$jQval.unobtrusive.parseElement(this, true);
|
||||
});
|
||||
|
||||
$forms.each(function () {
|
||||
var info = validationInfo(this);
|
||||
if (info) {
|
||||
info.attachValidation();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
adapters = $jQval.unobtrusive.adapters;
|
||||
|
||||
adapters.add = function (adapterName, params, fn) {
|
||||
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation.</summary>
|
||||
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
|
||||
/// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
|
||||
/// <param name="params" type="Array" optional="true">[Optional] An array of parameter names (strings) that will
|
||||
/// be extracted from the data-val-nnnn-mmmm HTML attributes (where nnnn is the adapter name, and
|
||||
/// mmmm is the parameter name).</param>
|
||||
/// <param name="fn" type="Function">The function to call, which adapts the values from the HTML
|
||||
/// attributes into jQuery Validate rules and/or messages.</param>
|
||||
/// <returns type="jQuery.validator.unobtrusive.adapters" />
|
||||
if (!fn) { // Called with no params, just a function
|
||||
fn = params;
|
||||
params = [];
|
||||
}
|
||||
this.push({ name: adapterName, params: params, adapt: fn });
|
||||
return this;
|
||||
};
|
||||
|
||||
adapters.addBool = function (adapterName, ruleName) {
|
||||
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
|
||||
/// the jQuery Validate validation rule has no parameter values.</summary>
|
||||
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
|
||||
/// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
|
||||
/// <param name="ruleName" type="String" optional="true">[Optional] The name of the jQuery Validate rule. If not provided, the value
|
||||
/// of adapterName will be used instead.</param>
|
||||
/// <returns type="jQuery.validator.unobtrusive.adapters" />
|
||||
return this.add(adapterName, function (options) {
|
||||
setValidationValues(options, ruleName || adapterName, true);
|
||||
});
|
||||
};
|
||||
|
||||
adapters.addMinMax = function (adapterName, minRuleName, maxRuleName, minMaxRuleName, minAttribute, maxAttribute) {
|
||||
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
|
||||
/// the jQuery Validate validation has three potential rules (one for min-only, one for max-only, and
|
||||
/// one for min-and-max). The HTML parameters are expected to be named -min and -max.</summary>
|
||||
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
|
||||
/// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
|
||||
/// <param name="minRuleName" type="String">The name of the jQuery Validate rule to be used when you only
|
||||
/// have a minimum value.</param>
|
||||
/// <param name="maxRuleName" type="String">The name of the jQuery Validate rule to be used when you only
|
||||
/// have a maximum value.</param>
|
||||
/// <param name="minMaxRuleName" type="String">The name of the jQuery Validate rule to be used when you
|
||||
/// have both a minimum and maximum value.</param>
|
||||
/// <param name="minAttribute" type="String" optional="true">[Optional] The name of the HTML attribute that
|
||||
/// contains the minimum value. The default is "min".</param>
|
||||
/// <param name="maxAttribute" type="String" optional="true">[Optional] The name of the HTML attribute that
|
||||
/// contains the maximum value. The default is "max".</param>
|
||||
/// <returns type="jQuery.validator.unobtrusive.adapters" />
|
||||
return this.add(adapterName, [minAttribute || "min", maxAttribute || "max"], function (options) {
|
||||
var min = options.params.min,
|
||||
max = options.params.max;
|
||||
|
||||
if (min && max) {
|
||||
setValidationValues(options, minMaxRuleName, [min, max]);
|
||||
}
|
||||
else if (min) {
|
||||
setValidationValues(options, minRuleName, min);
|
||||
}
|
||||
else if (max) {
|
||||
setValidationValues(options, maxRuleName, max);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
adapters.addSingleVal = function (adapterName, attribute, ruleName) {
|
||||
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
|
||||
/// the jQuery Validate validation rule has a single value.</summary>
|
||||
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
|
||||
/// in the data-val-nnnn HTML attribute(where nnnn is the adapter name).</param>
|
||||
/// <param name="attribute" type="String">[Optional] The name of the HTML attribute that contains the value.
|
||||
/// The default is "val".</param>
|
||||
/// <param name="ruleName" type="String" optional="true">[Optional] The name of the jQuery Validate rule. If not provided, the value
|
||||
/// of adapterName will be used instead.</param>
|
||||
/// <returns type="jQuery.validator.unobtrusive.adapters" />
|
||||
return this.add(adapterName, [attribute || "val"], function (options) {
|
||||
setValidationValues(options, ruleName || adapterName, options.params[attribute]);
|
||||
});
|
||||
};
|
||||
|
||||
$jQval.addMethod("__dummy__", function (value, element, params) {
|
||||
return true;
|
||||
});
|
||||
|
||||
$jQval.addMethod("regex", function (value, element, params) {
|
||||
var match;
|
||||
if (this.optional(element)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
match = new RegExp(params).exec(value);
|
||||
return (match && (match.index === 0) && (match[0].length === value.length));
|
||||
});
|
||||
|
||||
$jQval.addMethod("nonalphamin", function (value, element, nonalphamin) {
|
||||
var match;
|
||||
if (nonalphamin) {
|
||||
match = value.match(/\W/g);
|
||||
match = match && match.length >= nonalphamin;
|
||||
}
|
||||
return match;
|
||||
});
|
||||
|
||||
adapters.addSingleVal("accept", "exts").addSingleVal("regex", "pattern");
|
||||
adapters.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url");
|
||||
adapters.addMinMax("length", "minlength", "maxlength", "rangelength").addMinMax("range", "min", "max", "range");
|
||||
adapters.add("equalto", ["other"], function (options) {
|
||||
var prefix = getModelPrefix(options.element.name),
|
||||
other = options.params.other,
|
||||
fullOtherName = appendModelPrefix(other, prefix),
|
||||
element = $(options.form).find(":input[name='" + escapeAttributeValue(fullOtherName) + "']")[0];
|
||||
|
||||
setValidationValues(options, "equalTo", element);
|
||||
});
|
||||
adapters.add("required", function (options) {
|
||||
// jQuery Validate equates "required" with "mandatory" for checkbox elements
|
||||
if (options.element.tagName.toUpperCase() !== "INPUT" || options.element.type.toUpperCase() !== "CHECKBOX") {
|
||||
setValidationValues(options, "required", true);
|
||||
}
|
||||
});
|
||||
adapters.add("remote", ["url", "type", "additionalfields"], function (options) {
|
||||
var value = {
|
||||
url: options.params.url,
|
||||
type: options.params.type || "GET",
|
||||
data: {}
|
||||
},
|
||||
prefix = getModelPrefix(options.element.name);
|
||||
|
||||
$.each(splitAndTrim(options.params.additionalfields || options.element.name), function (i, fieldName) {
|
||||
var paramName = appendModelPrefix(fieldName, prefix);
|
||||
value.data[paramName] = function () {
|
||||
return $(options.form).find(":input[name='" + escapeAttributeValue(paramName) + "']").val();
|
||||
};
|
||||
});
|
||||
|
||||
setValidationValues(options, "remote", value);
|
||||
});
|
||||
adapters.add("password", ["min", "nonalphamin", "regex"], function (options) {
|
||||
if (options.params.min) {
|
||||
setValidationValues(options, "minlength", options.params.min);
|
||||
}
|
||||
if (options.params.nonalphamin) {
|
||||
setValidationValues(options, "nonalphamin", options.params.nonalphamin);
|
||||
}
|
||||
if (options.params.regex) {
|
||||
setValidationValues(options, "regex", options.params.regex);
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
$jQval.unobtrusive.parse(document);
|
||||
});
|
||||
} (jQuery));
|
||||
@@ -0,0 +1,598 @@
|
||||
/*
|
||||
Watermark plugin for jQuery
|
||||
Version: 3.1.4
|
||||
http://jquery-watermark.googlecode.com/
|
||||
|
||||
Copyright (c) 2009-2012 Todd Northrop
|
||||
http://www.speednet.biz/
|
||||
|
||||
August 13, 2012
|
||||
|
||||
Requires: jQuery 1.2.3+
|
||||
|
||||
Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
See mit-license.txt and gpl2-license.txt in the project root for details.
|
||||
------------------------------------------------------*/
|
||||
|
||||
( function ( $, window, undefined ) {
|
||||
|
||||
var
|
||||
// String constants for data names
|
||||
dataFlag = "watermark",
|
||||
dataClass = "watermarkClass",
|
||||
dataFocus = "watermarkFocus",
|
||||
dataFormSubmit = "watermarkSubmit",
|
||||
dataMaxLen = "watermarkMaxLength",
|
||||
dataPassword = "watermarkPassword",
|
||||
dataText = "watermarkText",
|
||||
|
||||
// Copy of native jQuery regex use to strip return characters from element value
|
||||
rreturn = /\r/g,
|
||||
|
||||
// Used to determine if type attribute of input element is a non-text type (invalid)
|
||||
rInvalidType = /^(button|checkbox|hidden|image|radio|range|reset|submit)$/i,
|
||||
|
||||
// Includes only elements with watermark defined
|
||||
selWatermarkDefined = "input:data(" + dataFlag + "),textarea:data(" + dataFlag + ")",
|
||||
|
||||
// Includes only elements capable of having watermark
|
||||
selWatermarkAble = ":watermarkable",
|
||||
|
||||
// triggerFns:
|
||||
// Array of function names to look for in the global namespace.
|
||||
// Any such functions found will be hijacked to trigger a call to
|
||||
// hideAll() any time they are called. The default value is the
|
||||
// ASP.NET function that validates the controls on the page
|
||||
// prior to a postback.
|
||||
//
|
||||
// Am I missing other important trigger function(s) to look for?
|
||||
// Please leave me feedback:
|
||||
// http://code.google.com/p/jquery-watermark/issues/list
|
||||
triggerFns = [
|
||||
"Page_ClientValidate"
|
||||
],
|
||||
|
||||
// Holds a value of true if a watermark was displayed since the last
|
||||
// hideAll() was executed. Avoids repeatedly calling hideAll().
|
||||
pageDirty = false,
|
||||
|
||||
// Detects if the browser can handle native placeholders
|
||||
hasNativePlaceholder = ( "placeholder" in document.createElement( "input" ) );
|
||||
|
||||
// Best practice: this plugin adds only one method to the jQuery object.
|
||||
// Also ensures that the watermark code is only added once.
|
||||
$.watermark = $.watermark || {
|
||||
|
||||
// Current version number of the plugin
|
||||
version: "3.1.4",
|
||||
|
||||
runOnce: true,
|
||||
|
||||
// Default options used when watermarks are instantiated.
|
||||
// Can be changed to affect the default behavior for all
|
||||
// new or updated watermarks.
|
||||
options: {
|
||||
|
||||
// Default class name for all watermarks
|
||||
className: "watermark",
|
||||
|
||||
// If true, plugin will detect and use native browser support for
|
||||
// watermarks, if available. (e.g., WebKit's placeholder attribute.)
|
||||
useNative: true,
|
||||
|
||||
// If true, all watermarks will be hidden during the window's
|
||||
// beforeunload event. This is done mainly because WebKit
|
||||
// browsers remember the watermark text during navigation
|
||||
// and try to restore the watermark text after the user clicks
|
||||
// the Back button. We can avoid this by hiding the text before
|
||||
// the browser has a chance to save it. The regular unload event
|
||||
// was tried, but it seems the browser saves the text before
|
||||
// that event kicks off, because it didn't work.
|
||||
hideBeforeUnload: true
|
||||
},
|
||||
|
||||
// Hide one or more watermarks by specifying any selector type
|
||||
// i.e., DOM element, string selector, jQuery matched set, etc.
|
||||
hide: function ( selector ) {
|
||||
$( selector ).filter( selWatermarkDefined ).each(
|
||||
function () {
|
||||
$.watermark._hide( $( this ) );
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
// Internal use only.
|
||||
_hide: function ( $input, focus ) {
|
||||
var elem = $input[ 0 ],
|
||||
inputVal = ( elem.value || "" ).replace( rreturn, "" ),
|
||||
inputWm = $input.data( dataText ) || "",
|
||||
maxLen = $input.data( dataMaxLen ) || 0,
|
||||
className = $input.data( dataClass );
|
||||
|
||||
if ( ( inputWm.length ) && ( inputVal == inputWm ) ) {
|
||||
elem.value = "";
|
||||
|
||||
// Password type?
|
||||
if ( $input.data( dataPassword ) ) {
|
||||
|
||||
if ( ( $input.attr( "type" ) || "" ) === "text" ) {
|
||||
var $pwd = $input.data( dataPassword ) || [],
|
||||
$wrap = $input.parent() || [];
|
||||
|
||||
if ( ( $pwd.length ) && ( $wrap.length ) ) {
|
||||
$wrap[ 0 ].removeChild( $input[ 0 ] ); // Can't use jQuery methods, because they destroy data
|
||||
$wrap[ 0 ].appendChild( $pwd[ 0 ] );
|
||||
$input = $pwd;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( maxLen ) {
|
||||
$input.attr( "maxLength", maxLen );
|
||||
$input.removeData( dataMaxLen );
|
||||
}
|
||||
|
||||
if ( focus ) {
|
||||
$input.attr( "autocomplete", "off" ); // Avoid NS_ERROR_XPC_JS_THREW_STRING error in Firefox
|
||||
|
||||
window.setTimeout(
|
||||
function () {
|
||||
$input.select(); // Fix missing cursor in IE
|
||||
}
|
||||
, 1 );
|
||||
}
|
||||
}
|
||||
|
||||
className && $input.removeClass( className );
|
||||
},
|
||||
|
||||
// Display one or more watermarks by specifying any selector type
|
||||
// i.e., DOM element, string selector, jQuery matched set, etc.
|
||||
// If conditions are not right for displaying a watermark, ensures that watermark is not shown.
|
||||
show: function ( selector ) {
|
||||
$( selector ).filter( selWatermarkDefined ).each(
|
||||
function () {
|
||||
$.watermark._show( $( this ) );
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
// Internal use only.
|
||||
_show: function ( $input ) {
|
||||
var elem = $input[ 0 ],
|
||||
val = ( elem.value || "" ).replace( rreturn, "" ),
|
||||
text = $input.data( dataText ) || "",
|
||||
type = $input.attr( "type" ) || "",
|
||||
className = $input.data( dataClass );
|
||||
|
||||
if ( ( ( val.length == 0 ) || ( val == text ) ) && ( !$input.data( dataFocus ) ) ) {
|
||||
pageDirty = true;
|
||||
|
||||
// Password type?
|
||||
if ( $input.data( dataPassword ) ) {
|
||||
|
||||
if ( type === "password" ) {
|
||||
var $pwd = $input.data( dataPassword ) || [],
|
||||
$wrap = $input.parent() || [];
|
||||
|
||||
if ( ( $pwd.length ) && ( $wrap.length ) ) {
|
||||
$wrap[ 0 ].removeChild( $input[ 0 ] ); // Can't use jQuery methods, because they destroy data
|
||||
$wrap[ 0 ].appendChild( $pwd[ 0 ] );
|
||||
$input = $pwd;
|
||||
$input.attr( "maxLength", text.length );
|
||||
elem = $input[ 0 ];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure maxLength big enough to hold watermark (input of type="text" or type="search" only)
|
||||
if ( ( type === "text" ) || ( type === "search" ) ) {
|
||||
var maxLen = $input.attr( "maxLength" ) || 0;
|
||||
|
||||
if ( ( maxLen > 0 ) && ( text.length > maxLen ) ) {
|
||||
$input.data( dataMaxLen, maxLen );
|
||||
$input.attr( "maxLength", text.length );
|
||||
}
|
||||
}
|
||||
|
||||
className && $input.addClass( className );
|
||||
elem.value = text;
|
||||
}
|
||||
else {
|
||||
$.watermark._hide( $input );
|
||||
}
|
||||
},
|
||||
|
||||
// Hides all watermarks on the current page.
|
||||
hideAll: function () {
|
||||
if ( pageDirty ) {
|
||||
$.watermark.hide( selWatermarkAble );
|
||||
pageDirty = false;
|
||||
}
|
||||
},
|
||||
|
||||
// Displays all watermarks on the current page.
|
||||
showAll: function () {
|
||||
$.watermark.show( selWatermarkAble );
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.watermark = $.fn.watermark || function ( text, options ) {
|
||||
/// <summary>
|
||||
/// Set watermark text and class name on all input elements of type="text/password/search" and
|
||||
/// textareas within the matched set. If className is not specified in options, the default is
|
||||
/// "watermark". Within the matched set, only input elements with type="text/password/search"
|
||||
/// and textareas are affected; all other elements are ignored.
|
||||
/// </summary>
|
||||
/// <returns type="jQuery">
|
||||
/// Returns the original jQuery matched set (not just the input and texarea elements).
|
||||
/// </returns>
|
||||
/// <param name="text" type="String">
|
||||
/// Text to display as a watermark when the input or textarea element has an empty value and does not
|
||||
/// have focus. The first time watermark() is called on an element, if this argument is empty (or not
|
||||
/// a String type), then the watermark will have the net effect of only changing the class name when
|
||||
/// the input or textarea element's value is empty and it does not have focus.
|
||||
/// </param>
|
||||
/// <param name="options" type="Object" optional="true">
|
||||
/// Provides the ability to override the default watermark options ($.watermark.options). For backward
|
||||
/// compatibility, if a string value is supplied, it is used as the class name that overrides the class
|
||||
/// name in $.watermark.options.className. Properties include:
|
||||
/// className: When the watermark is visible, the element will be styled using this class name.
|
||||
/// useNative (Boolean or Function): Specifies if native browser support for watermarks will supersede
|
||||
/// plugin functionality. If useNative is a function, the return value from the function will
|
||||
/// determine if native support is used. The function is passed one argument -- a jQuery object
|
||||
/// containing the element being tested as the only element in its matched set -- and the DOM
|
||||
/// element being tested is the object on which the function is invoked (the value of "this").
|
||||
/// </param>
|
||||
/// <remarks>
|
||||
/// The effect of changing the text and class name on an input element is called a watermark because
|
||||
/// typically light gray text is used to provide a hint as to what type of input is required. However,
|
||||
/// the appearance of the watermark can be something completely different: simply change the CSS style
|
||||
/// pertaining to the supplied class name.
|
||||
///
|
||||
/// The first time watermark() is called on an element, the watermark text and class name are initialized,
|
||||
/// and the focus and blur events are hooked in order to control the display of the watermark. Also, as
|
||||
/// of version 3.0, drag and drop events are hooked to guard against dropped text being appended to the
|
||||
/// watermark. If native watermark support is provided by the browser, it is detected and used, unless
|
||||
/// the useNative option is set to false.
|
||||
///
|
||||
/// Subsequently, watermark() can be called again on an element in order to change the watermark text
|
||||
/// and/or class name, and it can also be called without any arguments in order to refresh the display.
|
||||
///
|
||||
/// For example, after changing the value of the input or textarea element programmatically, watermark()
|
||||
/// should be called without any arguments to refresh the display, because the change event is only
|
||||
/// triggered by user actions, not by programmatic changes to an input or textarea element's value.
|
||||
///
|
||||
/// The one exception to programmatic updates is for password input elements: you are strongly cautioned
|
||||
/// against changing the value of a password input element programmatically (after the page loads).
|
||||
/// The reason is that some fairly hairy code is required behind the scenes to make the watermarks bypass
|
||||
/// IE security and switch back and forth between clear text (for watermarks) and obscured text (for
|
||||
/// passwords). It is *possible* to make programmatic changes, but it must be done in a certain way, and
|
||||
/// overall it is not recommended.
|
||||
/// </remarks>
|
||||
|
||||
if ( !this.length ) {
|
||||
return this;
|
||||
}
|
||||
|
||||
var hasClass = false,
|
||||
hasText = ( typeof( text ) === "string" );
|
||||
|
||||
if ( hasText ) {
|
||||
text = text.replace( rreturn, "" );
|
||||
}
|
||||
|
||||
if ( typeof( options ) === "object" ) {
|
||||
hasClass = ( typeof( options.className ) === "string" );
|
||||
options = $.extend( {}, $.watermark.options, options );
|
||||
}
|
||||
else if ( typeof( options ) === "string" ) {
|
||||
hasClass = true;
|
||||
options = $.extend( {}, $.watermark.options, { className: options } );
|
||||
}
|
||||
else {
|
||||
options = $.watermark.options;
|
||||
}
|
||||
|
||||
if ( typeof( options.useNative ) !== "function" ) {
|
||||
options.useNative = options.useNative? function () { return true; } : function () { return false; };
|
||||
}
|
||||
|
||||
return this.each(
|
||||
function () {
|
||||
var $input = $( this );
|
||||
|
||||
if ( !$input.is( selWatermarkAble ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Watermark already initialized?
|
||||
if ( $input.data( dataFlag ) ) {
|
||||
|
||||
// If re-defining text or class, first remove existing watermark, then make changes
|
||||
if ( hasText || hasClass ) {
|
||||
$.watermark._hide( $input );
|
||||
|
||||
if ( hasText ) {
|
||||
$input.data( dataText, text );
|
||||
}
|
||||
|
||||
if ( hasClass ) {
|
||||
$input.data( dataClass, options.className );
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
// Detect and use native browser support, if enabled in options
|
||||
if (
|
||||
( hasNativePlaceholder )
|
||||
&& ( options.useNative.call( this, $input ) )
|
||||
&& ( ( $input.attr( "tagName" ) || "" ) !== "TEXTAREA" )
|
||||
) {
|
||||
// className is not set because current placeholder standard doesn't
|
||||
// have a separate class name property for placeholders (watermarks).
|
||||
if ( hasText ) {
|
||||
$input.attr( "placeholder", text );
|
||||
}
|
||||
|
||||
// Only set data flag for non-native watermarks
|
||||
// [purposely commented-out] -> $input.data(dataFlag, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
$input.data( dataText, hasText? text : "" );
|
||||
$input.data( dataClass, options.className );
|
||||
$input.data( dataFlag, 1 ); // Flag indicates watermark was initialized
|
||||
|
||||
// Special processing for password type
|
||||
if ( ( $input.attr( "type" ) || "" ) === "password" ) {
|
||||
var $wrap = $input.wrap( "<span>" ).parent(),
|
||||
$wm = $( $wrap.html().replace( /type=["']?password["']?/i, 'type="text"' ) );
|
||||
|
||||
$wm.data( dataText, $input.data( dataText ) );
|
||||
$wm.data( dataClass, $input.data( dataClass ) );
|
||||
$wm.data( dataFlag, 1 );
|
||||
$wm.attr( "maxLength", text.length );
|
||||
|
||||
$wm.focus(
|
||||
function () {
|
||||
$.watermark._hide( $wm, true );
|
||||
}
|
||||
).bind( "dragenter",
|
||||
function () {
|
||||
$.watermark._hide( $wm );
|
||||
}
|
||||
).bind( "dragend",
|
||||
function () {
|
||||
window.setTimeout( function () { $wm.blur(); }, 1 );
|
||||
}
|
||||
);
|
||||
|
||||
$input.blur(
|
||||
function () {
|
||||
$.watermark._show( $input );
|
||||
}
|
||||
).bind( "dragleave",
|
||||
function () {
|
||||
$.watermark._show( $input );
|
||||
}
|
||||
);
|
||||
|
||||
$wm.data( dataPassword, $input );
|
||||
$input.data( dataPassword, $wm );
|
||||
}
|
||||
else {
|
||||
|
||||
$input.focus(
|
||||
function () {
|
||||
$input.data( dataFocus, 1 );
|
||||
$.watermark._hide( $input, true );
|
||||
}
|
||||
).blur(
|
||||
function () {
|
||||
$input.data( dataFocus, 0 );
|
||||
$.watermark._show( $input );
|
||||
}
|
||||
).bind( "dragenter",
|
||||
function () {
|
||||
$.watermark._hide( $input );
|
||||
}
|
||||
).bind( "dragleave",
|
||||
function () {
|
||||
$.watermark._show( $input );
|
||||
}
|
||||
).bind( "dragend",
|
||||
function () {
|
||||
window.setTimeout( function () { $.watermark._show($input); }, 1 );
|
||||
}
|
||||
).bind( "drop",
|
||||
// Firefox makes this lovely function necessary because the dropped text
|
||||
// is merged with the watermark before the drop event is called.
|
||||
function ( evt ) {
|
||||
var elem = $input[ 0 ],
|
||||
dropText = evt.originalEvent.dataTransfer.getData( "Text" );
|
||||
|
||||
if ( ( elem.value || "" ).replace( rreturn, "" ).replace( dropText, "" ) === $input.data( dataText ) ) {
|
||||
elem.value = dropText;
|
||||
}
|
||||
|
||||
$input.focus();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// In order to reliably clear all watermarks before form submission,
|
||||
// we need to replace the form's submit function with our own
|
||||
// function. Otherwise watermarks won't be cleared when the form
|
||||
// is submitted programmatically.
|
||||
if ( this.form ) {
|
||||
var form = this.form,
|
||||
$form = $( form );
|
||||
|
||||
if ( !$form.data( dataFormSubmit ) ) {
|
||||
$form.submit( $.watermark.hideAll );
|
||||
|
||||
// form.submit exists for all browsers except Google Chrome
|
||||
// (see "else" below for explanation)
|
||||
if ( form.submit ) {
|
||||
$form.data( dataFormSubmit, form.submit );
|
||||
|
||||
form.submit = ( function ( f, $f ) {
|
||||
return function () {
|
||||
var nativeSubmit = $f.data( dataFormSubmit );
|
||||
|
||||
$.watermark.hideAll();
|
||||
|
||||
if ( nativeSubmit.apply ) {
|
||||
nativeSubmit.apply( f, Array.prototype.slice.call( arguments ) );
|
||||
}
|
||||
else {
|
||||
nativeSubmit();
|
||||
}
|
||||
};
|
||||
})( form, $form );
|
||||
}
|
||||
else {
|
||||
$form.data( dataFormSubmit, 1 );
|
||||
|
||||
// This strangeness is due to the fact that Google Chrome's
|
||||
// form.submit function is not visible to JavaScript (identifies
|
||||
// as "undefined"). I had to invent a solution here because hours
|
||||
// of Googling (ironically) for an answer did not turn up anything
|
||||
// useful. Within my own form.submit function I delete the form's
|
||||
// submit function, and then call the non-existent function --
|
||||
// which, in the world of Google Chrome, still exists.
|
||||
form.submit = ( function ( f ) {
|
||||
return function () {
|
||||
$.watermark.hideAll();
|
||||
delete f.submit;
|
||||
f.submit();
|
||||
};
|
||||
})( form );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$.watermark._show( $input );
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
// The code included within the following if structure is guaranteed to only run once,
|
||||
// even if the watermark script file is included multiple times in the page.
|
||||
if ( $.watermark.runOnce ) {
|
||||
$.watermark.runOnce = false;
|
||||
|
||||
$.extend( $.expr[ ":" ], {
|
||||
|
||||
// Extends jQuery with a custom selector - ":data(...)"
|
||||
// :data(<name>) Includes elements that have a specific name defined in the jQuery data
|
||||
// collection. (Only the existence of the name is checked; the value is ignored.)
|
||||
// A more sophisticated version of the :data() custom selector originally part of this plugin
|
||||
// was removed for compatibility with jQuery UI. The original code can be found in the SVN
|
||||
// source listing in the file, "jquery.data.js".
|
||||
data: $.expr.createPseudo ?
|
||||
$.expr.createPseudo( function( dataName ) {
|
||||
return function( elem ) {
|
||||
return !!$.data( elem, dataName );
|
||||
};
|
||||
}) :
|
||||
// support: jQuery <1.8
|
||||
function( elem, i, match ) {
|
||||
return !!$.data( elem, match[ 3 ] );
|
||||
},
|
||||
|
||||
// Extends jQuery with a custom selector - ":watermarkable"
|
||||
// Includes elements that can be watermarked, including textareas and most input elements
|
||||
// that accept text input. It uses a "negative" test (i.e., testing for input types that DON'T
|
||||
// work) because the HTML spec states that you can basically use any type, and if it doesn't
|
||||
// recognize the type it will default to type=text. So if we only looked for certain type attributes
|
||||
// we would fail to recognize non-standard types, which are still valid and watermarkable.
|
||||
watermarkable: function ( elem ) {
|
||||
var type,
|
||||
name = elem.nodeName;
|
||||
|
||||
if ( name === "TEXTAREA" ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( name !== "INPUT" ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
type = elem.getAttribute( "type" );
|
||||
|
||||
return ( ( !type ) || ( !rInvalidType.test( type ) ) );
|
||||
}
|
||||
});
|
||||
|
||||
// Overloads the jQuery .val() function to return the underlying input value on
|
||||
// watermarked input elements. When .val() is being used to set values, this
|
||||
// function ensures watermarks are properly set/removed after the values are set.
|
||||
// Uses self-executing function to override the default jQuery function.
|
||||
( function ( valOld ) {
|
||||
|
||||
$.fn.val = function () {
|
||||
var args = Array.prototype.slice.call( arguments );
|
||||
|
||||
// Best practice: return immediately if empty matched set
|
||||
if ( !this.length ) {
|
||||
return args.length? this : undefined;
|
||||
}
|
||||
|
||||
// If no args, then we're getting the value of the first element;
|
||||
// else we're setting values for all elements in matched set
|
||||
if ( !args.length ) {
|
||||
|
||||
// If element is watermarked, get the underlying value;
|
||||
// else use native jQuery .val()
|
||||
if ( this.data( dataFlag ) ) {
|
||||
var v = ( this[ 0 ].value || "" ).replace( rreturn, "" );
|
||||
return ( v === ( this.data( dataText ) || "" ) )? "" : v;
|
||||
}
|
||||
else {
|
||||
return valOld.apply( this );
|
||||
}
|
||||
}
|
||||
else {
|
||||
valOld.apply( this, args );
|
||||
$.watermark.show( this );
|
||||
return this;
|
||||
}
|
||||
};
|
||||
|
||||
})( $.fn.val );
|
||||
|
||||
// Hijack any functions found in the triggerFns list
|
||||
if ( triggerFns.length ) {
|
||||
|
||||
// Wait until DOM is ready before searching
|
||||
$( function () {
|
||||
var i, name, fn;
|
||||
|
||||
for ( i = triggerFns.length - 1; i >= 0; i-- ) {
|
||||
name = triggerFns[ i ];
|
||||
fn = window[ name ];
|
||||
|
||||
if ( typeof( fn ) === "function" ) {
|
||||
window[ name ] = ( function ( origFn ) {
|
||||
return function () {
|
||||
$.watermark.hideAll();
|
||||
return origFn.apply( null, Array.prototype.slice.call( arguments ) );
|
||||
};
|
||||
})( fn );
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$( window ).bind( "beforeunload", function () {
|
||||
if ( $.watermark.options.hideBeforeUnload ) {
|
||||
$.watermark.hideAll();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
})( jQuery, window );
|
||||
+1393
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,4 @@
|
||||
///#source 1 1 /ClientSource/Scripts/Modules/Disco-AjaxHelperIcons/disco.ajaxhelpericons.js
|
||||
$(function () {
|
||||
$('.ajaxHelperIcon:not(.ajaxShowInitially)').hide();
|
||||
})
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<bundle minify="true" runOnBuild="true">
|
||||
<file>/ClientSource/Scripts/Modules/Disco-AjaxHelperIcons/disco.ajaxhelpericons.js</file>
|
||||
</bundle>
|
||||
@@ -0,0 +1,2 @@
|
||||
$(function(){$(".ajaxHelperIcon:not(.ajaxShowInitially)").hide()});
|
||||
//@ sourceMappingURL=Disco-AjaxHelperIcons.min.js.map
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"version":3,
|
||||
"file":"Disco-AjaxHelperIcons.min.js",
|
||||
"lineCount":1,
|
||||
"mappings":"AAAAA,CAAC,CAAC,QAAS,CAAA,CAAG,CACVA,CAAC,CAAC,yCAAD,CAA2CC,KAAK,CAAA,CADvC,CAAb,C",
|
||||
"sources":["/ClientSource/Scripts/Modules/Disco-AjaxHelperIcons/disco.ajaxhelpericons.js"],
|
||||
"names":["$","hide"]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
$(function () {
|
||||
$('.ajaxHelperIcon:not(.ajaxShowInitially)').hide();
|
||||
})
|
||||
@@ -0,0 +1,46 @@
|
||||
///#source 1 1 /ClientSource/Scripts/Modules/Disco-CreateJob/disco.createjob.js
|
||||
/// <reference path="../../Core/jquery-1.8.1.js" />
|
||||
/// <reference path="../../Core/jquery-ui-1.8.23.js" />
|
||||
|
||||
(function ($, window, document) {
|
||||
$(function () {
|
||||
var createJobDialog = null;
|
||||
var dialogMethods = {
|
||||
close: function () {
|
||||
createJobDialog.dialog('close');
|
||||
},
|
||||
setButtons: function (buttons) {
|
||||
if (createJobDialog)
|
||||
createJobDialog.dialog('option', 'buttons', buttons);
|
||||
}
|
||||
}
|
||||
|
||||
// Create Job Button
|
||||
$('#buttonCreateJob').click(function () {
|
||||
var $this = $(this);
|
||||
var href = $this.attr('href');
|
||||
var iframe = $('<iframe>').attr({ 'src': href }).width('100%').height('100%').css('border', 'none');
|
||||
createJobDialog = $('<div>').attr('id', 'createJobDialog').width('100%').height('100%')
|
||||
.appendTo(document)
|
||||
.append(iframe)
|
||||
.dialog({
|
||||
resizable: false,
|
||||
draggable: false,
|
||||
modal: true,
|
||||
autoOpen: true,
|
||||
title: 'Create Job',
|
||||
width: 850,
|
||||
height: $(window).height() - 50,
|
||||
close: function () {
|
||||
createJobDialog.find('iframe').attr('src', 'about:blank');
|
||||
createJobDialog.dialog('destroy').remove();
|
||||
createJobDialog = null;
|
||||
},
|
||||
buttons: {}
|
||||
});
|
||||
createJobDialog[0].discoDialogMethods = dialogMethods;
|
||||
|
||||
return false;
|
||||
});
|
||||
})
|
||||
})($, window, document);
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<bundle minify="true" runOnBuild="true">
|
||||
<file>/ClientSource/Scripts/Modules/Disco-CreateJob/disco.createjob.js</file>
|
||||
</bundle>
|
||||
@@ -0,0 +1,2 @@
|
||||
(function(n,t,i){n(function(){var r=null,u={close:function(){r.dialog("close")},setButtons:function(n){r&&r.dialog("option","buttons",n)}};n("#buttonCreateJob").click(function(){var f=n(this),e=f.attr("href"),o=n("<iframe>").attr({src:e}).width("100%").height("100%").css("border","none");return r=n("<div>").attr("id","createJobDialog").width("100%").height("100%").appendTo(i).append(o).dialog({resizable:!1,draggable:!1,modal:!0,autoOpen:!0,title:"Create Job",width:850,height:n(t).height()-50,close:function(){r.find("iframe").attr("src","about:blank"),r.dialog("destroy").remove(),r=null},buttons:{}}),r[0].discoDialogMethods=u,!1})})})($,window,document);
|
||||
//@ sourceMappingURL=Disco-CreateJob.min.js.map
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"version":3,
|
||||
"file":"Disco-CreateJob.min.js",
|
||||
"lineCount":1,
|
||||
"mappings":"CAGC,QAAS,CAACA,CAAC,CAAEC,CAAM,CAAEC,CAAZ,CAAsB,CAC5BF,CAAC,CAAC,QAAS,CAAA,CAAG,CACV,IAAIG,EAAkB,KAClBC,EAAgB,CAChB,KAAK,CAAEC,QAAS,CAAA,CAAG,CACfF,CAAeG,OAAO,CAAC,OAAD,CADP,CAElB,CACD,UAAU,CAAEC,QAAS,CAACC,CAAD,CAAU,CACvBL,C,EACAA,CAAeG,OAAO,CAAC,QAAQ,CAAE,SAAS,CAAEE,CAAtB,CAFC,CAJf,CADM,CAY1BR,CAAC,CAAC,kBAAD,CAAoBS,MAAM,CAAC,QAAS,CAAA,CAAG,CACpC,IAAIC,EAAQV,CAAC,CAAC,IAAD,EACTW,EAAOD,CAAKE,KAAK,CAAC,MAAD,EACjBC,EAASb,CAAC,CAAC,UAAD,CAAYY,KAAK,CAAC,CAAE,GAAK,CAAED,CAAT,CAAD,CAAiBG,MAAM,CAAC,MAAD,CAAQC,OAAO,CAAC,MAAD,CAAQC,IAAI,CAAC,QAAQ,CAAE,MAAX,CAF9D,CAuBnB,OApBAb,CAAgB,CAAEH,CAAC,CAAC,OAAD,CAASY,KAAK,CAAC,IAAI,CAAE,iBAAP,CAAyBE,MAAM,CAAC,MAAD,CAAQC,OAAO,CAAC,MAAD,CAC3EE,SAAS,CAACf,CAAD,CACTgB,OAAO,CAACL,CAAD,CACPP,OAAO,CAAC,CACJ,SAAS,CAAE,CAAA,CAAK,CAChB,SAAS,CAAE,CAAA,CAAK,CAChB,KAAK,CAAE,CAAA,CAAI,CACX,QAAQ,CAAE,CAAA,CAAI,CACd,KAAK,CAAE,YAAY,CACnB,KAAK,CAAE,GAAG,CACV,MAAM,CAAEN,CAAC,CAACC,CAAD,CAAQc,OAAO,CAAA,CAAG,CAAE,EAAE,CAC/B,KAAK,CAAEV,QAAS,CAAA,CAAG,CACfF,CAAegB,KAAK,CAAC,QAAD,CAAUP,KAAK,CAAC,KAAK,CAAE,aAAR,CAAsB,CACzDT,CAAeG,OAAO,CAAC,SAAD,CAAWc,OAAO,CAAA,CAAE,CAC1CjB,CAAgB,CAAE,IAHH,CAIlB,CACD,OAAO,CAAE,CAAA,CAbL,CAAD,CAcL,CACNA,CAAgB,CAAA,CAAA,CAAEkB,mBAAoB,CAAEjB,CAAa,CAE9C,CAAA,CAxB6B,CAAb,CAbjB,CAAb,CAD2B,EAyC9B,CAACJ,CAAC,CAAEC,MAAM,CAAEC,QAAZ,CAAqB",
|
||||
"sources":["/ClientSource/Scripts/Modules/Disco-CreateJob/disco.createjob.js"],
|
||||
"names":["$","window","document","createJobDialog","dialogMethods","close","dialog","setButtons","buttons","click","$this","href","attr","iframe","width","height","css","appendTo","append","find","remove","discoDialogMethods"]
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/// <reference path="../../Core/jquery-1.8.1.js" />
|
||||
/// <reference path="../../Core/jquery-ui-1.8.23.js" />
|
||||
|
||||
(function ($, window, document) {
|
||||
$(function () {
|
||||
var createJobDialog = null;
|
||||
var dialogMethods = {
|
||||
close: function () {
|
||||
createJobDialog.dialog('close');
|
||||
},
|
||||
setButtons: function (buttons) {
|
||||
if (createJobDialog)
|
||||
createJobDialog.dialog('option', 'buttons', buttons);
|
||||
}
|
||||
}
|
||||
|
||||
// Create Job Button
|
||||
$('#buttonCreateJob').click(function () {
|
||||
var $this = $(this);
|
||||
var href = $this.attr('href');
|
||||
var iframe = $('<iframe>').attr({ 'src': href }).width('100%').height('100%').css('border', 'none');
|
||||
createJobDialog = $('<div>').attr('id', 'createJobDialog').width('100%').height('100%')
|
||||
.appendTo(document)
|
||||
.append(iframe)
|
||||
.dialog({
|
||||
resizable: false,
|
||||
draggable: false,
|
||||
modal: true,
|
||||
autoOpen: true,
|
||||
title: 'Create Job',
|
||||
width: 850,
|
||||
height: $(window).height() - 50,
|
||||
close: function () {
|
||||
createJobDialog.find('iframe').attr('src', 'about:blank');
|
||||
createJobDialog.dialog('destroy').remove();
|
||||
createJobDialog = null;
|
||||
},
|
||||
buttons: {}
|
||||
});
|
||||
createJobDialog[0].discoDialogMethods = dialogMethods;
|
||||
|
||||
return false;
|
||||
});
|
||||
})
|
||||
})($, window, document);
|
||||
@@ -0,0 +1,144 @@
|
||||
///#source 1 1 /ClientSource/Scripts/Modules/Disco-DataTableHelpers/disco.datatablehelpers.js
|
||||
(function (window, document, $) {
|
||||
var dataTables = [];
|
||||
|
||||
$(function () {
|
||||
$('table.jobTable').each(function () {
|
||||
var $table = $(this);
|
||||
var tableDrawn = false;
|
||||
|
||||
var dataTableOptionsPagination = ($table.find('tr').length > 20);
|
||||
var dataTableOptions = {
|
||||
"bPaginate": dataTableOptionsPagination,
|
||||
"sPaginationType": "full_numbers",
|
||||
"bLengthChange": dataTableOptionsPagination,
|
||||
"iDisplayLength": 20,
|
||||
"bFilter": true,
|
||||
"bSort": true,
|
||||
"bInfo": false,
|
||||
"bAutoWidth": false,
|
||||
"aoColumnDefs": [
|
||||
{ 'aTargets': ['dates'], 'sSortDataType': 'disco_datetime', 'sType': 'disco_datetime' }
|
||||
],
|
||||
"aaSorting": [],
|
||||
"oLanguage": {
|
||||
"sSearch": "Filter:"
|
||||
},
|
||||
"fnDrawCallback": function () {
|
||||
if (tableDrawn)
|
||||
scrollCheck.apply($table);
|
||||
else
|
||||
tableDrawn = true;
|
||||
}
|
||||
};
|
||||
|
||||
var $dataTable = $table.dataTable(dataTableOptions);
|
||||
|
||||
// hideStatusClosed Extension
|
||||
if ($table.hasClass('hideStatusClosed')) {
|
||||
var wrapper = $(this).closest('.dataTables_wrapper');
|
||||
|
||||
var wrapperContext = wrapper;
|
||||
if (wrapper.parent('.jobTable').length > 0)
|
||||
wrapperContext = wrapper.parent();
|
||||
var wrapperPrev = wrapperContext.prev();
|
||||
if (wrapperPrev.length > 0 && (wrapperPrev.is('h1') || wrapperPrev.is('h2') || wrapperPrev.is('h3'))) {
|
||||
wrapperPrev.data('dataTable_originalContent', wrapperPrev.html()).text('Active ' + wrapperPrev.text());
|
||||
} else {
|
||||
wrapperPrev = null;
|
||||
}
|
||||
|
||||
var showClosedAnchor = $('<a class="dataTables_showStatusClosed" href="#">').text('Show Closed');
|
||||
wrapper.prepend(showClosedAnchor);
|
||||
showClosedAnchor.click(function () {
|
||||
|
||||
$table.removeClass('hideStatusClosed');
|
||||
showClosedAnchor.remove();
|
||||
if (wrapperPrev)
|
||||
wrapperPrev.html(wrapperPrev.data('dataTable_originalContent'));
|
||||
|
||||
scrollCheck.apply($table[0]);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
dataTables.push(this);
|
||||
});
|
||||
|
||||
$('table.deviceTable').each(function () {
|
||||
var $table = $(this);
|
||||
|
||||
var dataTableOptionsPagination = ($table.find('tr').length > 20);
|
||||
var dataTableOptions = {
|
||||
"bPaginate": dataTableOptionsPagination,
|
||||
"sPaginationType": "full_numbers",
|
||||
"bLengthChange": dataTableOptionsPagination,
|
||||
"iDisplayLength": 20,
|
||||
"bFilter": true,
|
||||
"bSort": true,
|
||||
"bInfo": false,
|
||||
"bAutoWidth": false,
|
||||
"aaSorting": [],
|
||||
"oLanguage": {
|
||||
"sSearch": "Filter:"
|
||||
}
|
||||
};
|
||||
|
||||
$table.dataTable(dataTableOptions);
|
||||
dataTables.push(this);
|
||||
});
|
||||
|
||||
$('table.userTable').each(function () {
|
||||
var $table = $(this);
|
||||
|
||||
var dataTableOptionsPagination = ($table.find('tr').length > 20);
|
||||
var dataTableOptions = {
|
||||
"bPaginate": dataTableOptionsPagination,
|
||||
"sPaginationType": "full_numbers",
|
||||
"bLengthChange": dataTableOptionsPagination,
|
||||
"iDisplayLength": 20,
|
||||
"bFilter": true,
|
||||
"bSort": true,
|
||||
"bInfo": false,
|
||||
"bAutoWidth": false,
|
||||
"aaSorting": [],
|
||||
"oLanguage": {
|
||||
"sSearch": "Filter:"
|
||||
}
|
||||
};
|
||||
|
||||
$table.dataTable(dataTableOptions);
|
||||
dataTables.push(this);
|
||||
});
|
||||
|
||||
function scrollCheck() {
|
||||
var wrapper = $(this).closest('.dataTables_wrapper');
|
||||
if (wrapper.length > 0) {
|
||||
window.setTimeout(function () {
|
||||
var $window = $(window);
|
||||
var wrapperHeight = wrapper.height();
|
||||
var wrapperOffset = wrapper.offset();
|
||||
var windowScrollTop = $window.scrollTop();
|
||||
var windowHeight = $window.height();
|
||||
|
||||
var wrapperTopNotShown = windowScrollTop - wrapperOffset.top;
|
||||
if (wrapperTopNotShown > 0) {
|
||||
$('html').animate({ scrollTop: wrapperOffset.top }, 125);
|
||||
} else {
|
||||
var wrapperBottomNotShown = ((windowScrollTop + windowHeight) - (wrapperHeight + wrapperOffset.top)) * -1;
|
||||
if (wrapperBottomNotShown > 0) {
|
||||
if (wrapperHeight > windowHeight)
|
||||
$('html').animate({ scrollTop: wrapperOffset.top }, 125);
|
||||
else
|
||||
$('html').animate({ scrollTop: windowScrollTop + wrapperBottomNotShown }, 125);
|
||||
}
|
||||
}
|
||||
}, 1);
|
||||
}
|
||||
}
|
||||
|
||||
//$(dataTables).bind('page', scrollCheck);
|
||||
//$(dataTables).bind('filter', scrollCheck);
|
||||
//$(dataTables).bind('sort', scrollCheck);
|
||||
});
|
||||
})(window, document, $);
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<bundle minify="true" runOnBuild="true">
|
||||
<file>/ClientSource/Scripts/Modules/Disco-DataTableHelpers/disco.datatablehelpers.js</file>
|
||||
</bundle>
|
||||
@@ -0,0 +1,2 @@
|
||||
(function(n,t,i){var r=[];i(function(){function t(){var t=i(this).closest(".dataTables_wrapper");t.length>0&&n.setTimeout(function(){var e=i(n),o=t.height(),r=t.offset(),u=e.scrollTop(),s=e.height(),h=u-r.top,f;h>0?i("html").animate({scrollTop:r.top},125):(f=(u+s-(o+r.top))*-1,f>0&&(o>s?i("html").animate({scrollTop:r.top},125):i("html").animate({scrollTop:u+f},125)))},1)}i("table.jobTable").each(function(){var u=i(this),s=!1,h=u.find("tr").length>20,c={bPaginate:h,sPaginationType:"full_numbers",bLengthChange:h,iDisplayLength:20,bFilter:!0,bSort:!0,bInfo:!1,bAutoWidth:!1,aoColumnDefs:[{aTargets:["dates"],sSortDataType:"disco_datetime",sType:"disco_datetime"}],aaSorting:[],oLanguage:{sSearch:"Filter:"},fnDrawCallback:function(){s?t.apply(u):s=!0}},l=u.dataTable(c),f,o,n,e;u.hasClass("hideStatusClosed")&&(f=i(this).closest(".dataTables_wrapper"),o=f,f.parent(".jobTable").length>0&&(o=f.parent()),n=o.prev(),n.length>0&&(n.is("h1")||n.is("h2")||n.is("h3"))?n.data("dataTable_originalContent",n.html()).text("Active "+n.text()):n=null,e=i('<a class="dataTables_showStatusClosed" href="#">').text("Show Closed"),f.prepend(e),e.click(function(){return u.removeClass("hideStatusClosed"),e.remove(),n&&n.html(n.data("dataTable_originalContent")),t.apply(u[0]),!1})),r.push(this)}),i("table.deviceTable").each(function(){var n=i(this),t=n.find("tr").length>20,u={bPaginate:t,sPaginationType:"full_numbers",bLengthChange:t,iDisplayLength:20,bFilter:!0,bSort:!0,bInfo:!1,bAutoWidth:!1,aaSorting:[],oLanguage:{sSearch:"Filter:"}};n.dataTable(u),r.push(this)}),i("table.userTable").each(function(){var n=i(this),t=n.find("tr").length>20,u={bPaginate:t,sPaginationType:"full_numbers",bLengthChange:t,iDisplayLength:20,bFilter:!0,bSort:!0,bInfo:!1,bAutoWidth:!1,aaSorting:[],oLanguage:{sSearch:"Filter:"}};n.dataTable(u),r.push(this)})})})(window,document,$);
|
||||
//@ sourceMappingURL=Disco-DataTableHelpers.min.js.map
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"version":3,
|
||||
"file":"Disco-DataTableHelpers.min.js",
|
||||
"lineCount":1,
|
||||
"mappings":"CAAC,QAAS,CAACA,CAAM,CAAEC,CAAQ,CAAEC,CAAnB,CAAsB,CAC5B,IAAIC,EAAa,CAAA,CAAE,CAEnBD,CAAC,CAAC,QAAS,CAAA,CAAG,CA6GVE,SAASA,CAAW,CAAA,CAAG,CACnB,IAAIC,EAAUH,CAAC,CAAC,IAAD,CAAMI,QAAQ,CAAC,qBAAD,CAAuB,CAChDD,CAAOE,OAAQ,CAAE,C,EACjBP,CAAMQ,WAAW,CAAC,QAAS,CAAA,CAAG,CAC1B,IAAIC,EAAUP,CAAC,CAACF,CAAD,EACXU,EAAgBL,CAAOM,OAAO,CAAA,EAC9BC,EAAgBP,CAAOQ,OAAO,CAAA,EAC9BC,EAAkBL,CAAOM,UAAU,CAAA,EACnCC,EAAeP,CAAOE,OAAO,CAAA,EAE7BM,EAAqBH,CAAgB,CAAEF,CAAaM,KAIhDC,CAVe,CAOnBF,CAAmB,CAAE,CAAzB,CACIf,CAAC,CAAC,MAAD,CAAQkB,QAAQ,CAAC,CAAE,SAAS,CAAER,CAAaM,IAA1B,CAAgC,CAAE,GAAnC,CADrB,EAGQC,CAAsB,CAAE,CAAEL,CAAgB,CAAEE,CAAc,EAAGN,CAAc,CAAEE,CAAaM,KAAlE,CAAyE,CAAE,E,CACnGC,CAAsB,CAAE,C,GACpBT,CAAc,CAAEM,CAApB,CACId,CAAC,CAAC,MAAD,CAAQkB,QAAQ,CAAC,CAAE,SAAS,CAAER,CAAaM,IAA1B,CAAgC,CAAE,GAAnC,CADrB,CAGIhB,CAAC,CAAC,MAAD,CAAQkB,QAAQ,CAAC,CAAE,SAAS,CAAEN,CAAgB,CAAEK,CAA/B,CAAsD,CAAE,GAAzD,GAhBH,CAmB7B,CAAE,CAnBc,CAHF,CA5GvBjB,CAAC,CAAC,gBAAD,CAAkBmB,KAAK,CAAC,QAAS,CAAA,CAAG,CACjC,IAAIC,EAASpB,CAAC,CAAC,IAAD,EACVqB,EAAa,CAAA,EAEbC,EAA8BF,CAAMG,KAAK,CAAC,IAAD,CAAMlB,OAAQ,CAAE,GACzDmB,EAAmB,CACnB,SAAW,CAAEF,CAA0B,CACvC,eAAiB,CAAE,cAAc,CACjC,aAAe,CAAEA,CAA0B,CAC3C,cAAgB,CAAE,EAAE,CACpB,OAAS,CAAE,CAAA,CAAI,CACf,KAAO,CAAE,CAAA,CAAI,CACb,KAAO,CAAE,CAAA,CAAK,CACd,UAAY,CAAE,CAAA,CAAK,CACnB,YAAc,CAAE,CACZ,CAAE,QAAU,CAAE,CAAC,OAAD,CAAS,CAAE,aAAe,CAAE,gBAAgB,CAAE,KAAO,CAAE,gBAArE,CADY,CAEf,CACD,SAAW,CAAE,CAAA,CAAE,CACf,SAAW,CAAE,CACT,OAAS,CAAE,SADF,CAEZ,CACD,cAAgB,CAAEG,QAAS,CAAA,CAAG,CACtBJ,CAAJ,CACInB,CAAWwB,MAAM,CAACN,CAAD,CADrB,CAGIC,CAAW,CAAE,CAAA,CAJS,CAhBX,EAwBnBM,EAAaP,CAAMQ,UAAU,CAACJ,CAAD,EAIzBrB,EAEA0B,EAGAC,EAOAC,CA5CY,CA+BhBX,CAAMY,SAAS,CAAC,kBAAD,C,GACX7B,CAAQ,CAAEH,CAAC,CAAC,IAAD,CAAMI,QAAQ,CAAC,qBAAD,C,CAEzByB,CAAe,CAAE1B,C,CACjBA,CAAO8B,OAAO,CAAC,WAAD,CAAa5B,OAAQ,CAAE,C,GACrCwB,CAAe,CAAE1B,CAAO8B,OAAO,CAAA,EAAE,CACjCH,CAAY,CAAED,CAAcK,KAAK,CAAA,C,CACjCJ,CAAWzB,OAAQ,CAAE,CAAE,EAAG,CAACyB,CAAWK,GAAG,CAAC,IAAD,CAAO,EAAGL,CAAWK,GAAG,CAAC,IAAD,CAAO,EAAGL,CAAWK,GAAG,CAAC,IAAD,CAA/D,CAA9B,CACIL,CAAWM,KAAK,CAAC,2BAA2B,CAAEN,CAAWO,KAAK,CAAA,CAA9C,CAAiDC,KAAK,CAAC,SAAU,CAAER,CAAWQ,KAAK,CAAA,CAA7B,CAD1E,CAGIR,CAAY,CAAE,I,CAGdC,CAAiB,CAAE/B,CAAC,CAAC,kDAAD,CAAoDsC,KAAK,CAAC,aAAD,C,CACjFnC,CAAOoC,QAAQ,CAACR,CAAD,CAAkB,CACjCA,CAAgBS,MAAM,CAAC,QAAS,CAAA,CAAG,CAQ/B,OANApB,CAAMqB,YAAY,CAAC,kBAAD,CAAoB,CACtCV,CAAgBW,OAAO,CAAA,CAAE,CACrBZ,C,EACAA,CAAWO,KAAK,CAACP,CAAWM,KAAK,CAAC,2BAAD,CAAjB,CAA+C,CAEnElC,CAAWwB,MAAM,CAACN,CAAO,CAAA,CAAA,CAAR,CAAW,CACrB,CAAA,CARwB,CAAb,EASpB,CAGNnB,CAAU0C,KAAK,CAAC,IAAD,CA3DkB,CAAb,CA4DtB,CAEF3C,CAAC,CAAC,mBAAD,CAAqBmB,KAAK,CAAC,QAAS,CAAA,CAAG,CACpC,IAAIC,EAASpB,CAAC,CAAC,IAAD,EAEVsB,EAA8BF,CAAMG,KAAK,CAAC,IAAD,CAAMlB,OAAQ,CAAE,GACzDmB,EAAmB,CACnB,SAAW,CAAEF,CAA0B,CACvC,eAAiB,CAAE,cAAc,CACjC,aAAe,CAAEA,CAA0B,CAC3C,cAAgB,CAAE,EAAE,CACpB,OAAS,CAAE,CAAA,CAAI,CACf,KAAO,CAAE,CAAA,CAAI,CACb,KAAO,CAAE,CAAA,CAAK,CACd,UAAY,CAAE,CAAA,CAAK,CACnB,SAAW,CAAE,CAAA,CAAE,CACf,SAAW,CAAE,CACT,OAAS,CAAE,SADF,CAVM,CAHH,CAkBpBF,CAAMQ,UAAU,CAACJ,CAAD,CAAkB,CAClCvB,CAAU0C,KAAK,CAAC,IAAD,CApBqB,CAAb,CAqBzB,CAEF3C,CAAC,CAAC,iBAAD,CAAmBmB,KAAK,CAAC,QAAS,CAAA,CAAG,CAClC,IAAIC,EAASpB,CAAC,CAAC,IAAD,EAEVsB,EAA8BF,CAAMG,KAAK,CAAC,IAAD,CAAMlB,OAAQ,CAAE,GACzDmB,EAAmB,CACnB,SAAW,CAAEF,CAA0B,CACvC,eAAiB,CAAE,cAAc,CACjC,aAAe,CAAEA,CAA0B,CAC3C,cAAgB,CAAE,EAAE,CACpB,OAAS,CAAE,CAAA,CAAI,CACf,KAAO,CAAE,CAAA,CAAI,CACb,KAAO,CAAE,CAAA,CAAK,CACd,UAAY,CAAE,CAAA,CAAK,CACnB,SAAW,CAAE,CAAA,CAAE,CACf,SAAW,CAAE,CACT,OAAS,CAAE,SADF,CAVM,CAHH,CAkBpBF,CAAMQ,UAAU,CAACJ,CAAD,CAAkB,CAClCvB,CAAU0C,KAAK,CAAC,IAAD,CApBmB,CAAb,CAtFf,CAAb,CAH2B,EA8I9B,CAAC7C,MAAM,CAAEC,QAAQ,CAAEC,CAAnB,CAAqB",
|
||||
"sources":["/ClientSource/Scripts/Modules/Disco-DataTableHelpers/disco.datatablehelpers.js"],
|
||||
"names":["window","document","$","dataTables","scrollCheck","wrapper","closest","length","setTimeout","$window","wrapperHeight","height","wrapperOffset","offset","windowScrollTop","scrollTop","windowHeight","wrapperTopNotShown","top","wrapperBottomNotShown","animate","each","$table","tableDrawn","dataTableOptionsPagination","find","dataTableOptions","fnDrawCallback","apply","$dataTable","dataTable","wrapperContext","wrapperPrev","showClosedAnchor","hasClass","parent","prev","is","data","html","text","prepend","click","removeClass","remove","push"]
|
||||
}
|
||||
+143
@@ -0,0 +1,143 @@
|
||||
(function (window, document, $) {
|
||||
var dataTables = [];
|
||||
|
||||
$(function () {
|
||||
$('table.jobTable').each(function () {
|
||||
var $table = $(this);
|
||||
var tableDrawn = false;
|
||||
|
||||
var dataTableOptionsPagination = ($table.find('tr').length > 20);
|
||||
var dataTableOptions = {
|
||||
"bPaginate": dataTableOptionsPagination,
|
||||
"sPaginationType": "full_numbers",
|
||||
"bLengthChange": dataTableOptionsPagination,
|
||||
"iDisplayLength": 20,
|
||||
"bFilter": true,
|
||||
"bSort": true,
|
||||
"bInfo": false,
|
||||
"bAutoWidth": false,
|
||||
"aoColumnDefs": [
|
||||
{ 'aTargets': ['dates'], 'sSortDataType': 'disco_datetime', 'sType': 'disco_datetime' }
|
||||
],
|
||||
"aaSorting": [],
|
||||
"oLanguage": {
|
||||
"sSearch": "Filter:"
|
||||
},
|
||||
"fnDrawCallback": function () {
|
||||
if (tableDrawn)
|
||||
scrollCheck.apply($table);
|
||||
else
|
||||
tableDrawn = true;
|
||||
}
|
||||
};
|
||||
|
||||
var $dataTable = $table.dataTable(dataTableOptions);
|
||||
|
||||
// hideStatusClosed Extension
|
||||
if ($table.hasClass('hideStatusClosed')) {
|
||||
var wrapper = $(this).closest('.dataTables_wrapper');
|
||||
|
||||
var wrapperContext = wrapper;
|
||||
if (wrapper.parent('.jobTable').length > 0)
|
||||
wrapperContext = wrapper.parent();
|
||||
var wrapperPrev = wrapperContext.prev();
|
||||
if (wrapperPrev.length > 0 && (wrapperPrev.is('h1') || wrapperPrev.is('h2') || wrapperPrev.is('h3'))) {
|
||||
wrapperPrev.data('dataTable_originalContent', wrapperPrev.html()).text('Active ' + wrapperPrev.text());
|
||||
} else {
|
||||
wrapperPrev = null;
|
||||
}
|
||||
|
||||
var showClosedAnchor = $('<a class="dataTables_showStatusClosed" href="#">').text('Show Closed');
|
||||
wrapper.prepend(showClosedAnchor);
|
||||
showClosedAnchor.click(function () {
|
||||
|
||||
$table.removeClass('hideStatusClosed');
|
||||
showClosedAnchor.remove();
|
||||
if (wrapperPrev)
|
||||
wrapperPrev.html(wrapperPrev.data('dataTable_originalContent'));
|
||||
|
||||
scrollCheck.apply($table[0]);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
dataTables.push(this);
|
||||
});
|
||||
|
||||
$('table.deviceTable').each(function () {
|
||||
var $table = $(this);
|
||||
|
||||
var dataTableOptionsPagination = ($table.find('tr').length > 20);
|
||||
var dataTableOptions = {
|
||||
"bPaginate": dataTableOptionsPagination,
|
||||
"sPaginationType": "full_numbers",
|
||||
"bLengthChange": dataTableOptionsPagination,
|
||||
"iDisplayLength": 20,
|
||||
"bFilter": true,
|
||||
"bSort": true,
|
||||
"bInfo": false,
|
||||
"bAutoWidth": false,
|
||||
"aaSorting": [],
|
||||
"oLanguage": {
|
||||
"sSearch": "Filter:"
|
||||
}
|
||||
};
|
||||
|
||||
$table.dataTable(dataTableOptions);
|
||||
dataTables.push(this);
|
||||
});
|
||||
|
||||
$('table.userTable').each(function () {
|
||||
var $table = $(this);
|
||||
|
||||
var dataTableOptionsPagination = ($table.find('tr').length > 20);
|
||||
var dataTableOptions = {
|
||||
"bPaginate": dataTableOptionsPagination,
|
||||
"sPaginationType": "full_numbers",
|
||||
"bLengthChange": dataTableOptionsPagination,
|
||||
"iDisplayLength": 20,
|
||||
"bFilter": true,
|
||||
"bSort": true,
|
||||
"bInfo": false,
|
||||
"bAutoWidth": false,
|
||||
"aaSorting": [],
|
||||
"oLanguage": {
|
||||
"sSearch": "Filter:"
|
||||
}
|
||||
};
|
||||
|
||||
$table.dataTable(dataTableOptions);
|
||||
dataTables.push(this);
|
||||
});
|
||||
|
||||
function scrollCheck() {
|
||||
var wrapper = $(this).closest('.dataTables_wrapper');
|
||||
if (wrapper.length > 0) {
|
||||
window.setTimeout(function () {
|
||||
var $window = $(window);
|
||||
var wrapperHeight = wrapper.height();
|
||||
var wrapperOffset = wrapper.offset();
|
||||
var windowScrollTop = $window.scrollTop();
|
||||
var windowHeight = $window.height();
|
||||
|
||||
var wrapperTopNotShown = windowScrollTop - wrapperOffset.top;
|
||||
if (wrapperTopNotShown > 0) {
|
||||
$('html').animate({ scrollTop: wrapperOffset.top }, 125);
|
||||
} else {
|
||||
var wrapperBottomNotShown = ((windowScrollTop + windowHeight) - (wrapperHeight + wrapperOffset.top)) * -1;
|
||||
if (wrapperBottomNotShown > 0) {
|
||||
if (wrapperHeight > windowHeight)
|
||||
$('html').animate({ scrollTop: wrapperOffset.top }, 125);
|
||||
else
|
||||
$('html').animate({ scrollTop: windowScrollTop + wrapperBottomNotShown }, 125);
|
||||
}
|
||||
}
|
||||
}, 1);
|
||||
}
|
||||
}
|
||||
|
||||
//$(dataTables).bind('page', scrollCheck);
|
||||
//$(dataTables).bind('filter', scrollCheck);
|
||||
//$(dataTables).bind('sort', scrollCheck);
|
||||
});
|
||||
})(window, document, $);
|
||||
@@ -0,0 +1,113 @@
|
||||
///#source 1 1 /ClientSource/Scripts/Modules/Disco-ExpressionEditor/disco.expressioneditor.js
|
||||
/// <reference path="../../Core/jquery-1.7.1.js" />
|
||||
function DiscoExpressionEditor(host, validateUrl, expression) {
|
||||
this.host = host;
|
||||
this.hostDocument = null;
|
||||
this.hostContainer = null;
|
||||
this.validateUrl = validateUrl;
|
||||
if (expression)
|
||||
this.expression = expression;
|
||||
else
|
||||
this.expression = '';
|
||||
this.expressionHtml = '';
|
||||
this.expressionException = null;
|
||||
|
||||
// Events
|
||||
this.hostInited = null;
|
||||
this.expressionValidated = null;
|
||||
this.expressionExceptionChanged = null;
|
||||
}
|
||||
DiscoExpressionEditor.prototype = {
|
||||
hostInit: function () {
|
||||
var that = this;
|
||||
var hostInited = function () {
|
||||
that.hostDocument = that.host.contents();
|
||||
that.hostContainer = that.hostDocument.find('body');
|
||||
|
||||
that.host.focus(function () {
|
||||
that.setException(null);
|
||||
that.renderExpression();
|
||||
});
|
||||
|
||||
that.hostContainer.bind('paste', function (el) {
|
||||
setTimeout(function () { that.setExpression(that.hostContainer.text()); }, 50);
|
||||
});
|
||||
|
||||
if (that.expression)
|
||||
that.setExpression(that.expression);
|
||||
|
||||
if (that.hostInited)
|
||||
that.hostInited();
|
||||
}
|
||||
var designModeInit = function () {
|
||||
that.host.unbind('load', designModeInit);
|
||||
that.host.load(hostInited);
|
||||
that.host[0].contentWindow.document.designMode = 'on';
|
||||
}
|
||||
that.host.load(designModeInit);
|
||||
},
|
||||
parseExpression: function (expression, exception) {
|
||||
var expressionLines = expression.split('\n');
|
||||
for (var i = 0; i < expressionLines.length; i++) {
|
||||
if (exception && (exception.PositionRow == i + 1)) {
|
||||
// Exception Row
|
||||
var lineSrc = expressionLines[i].trim();
|
||||
var line = '<p id="line' + i + '" class="line lineError">';
|
||||
if (lineSrc.length >= exception.PositionColumn) {
|
||||
line += lineSrc.substr(0, exception.PositionColumn - 1);
|
||||
line += '<span class="error">' + lineSrc.substr(exception.PositionColumn - 1, 1) + '</span>';
|
||||
line += lineSrc.substr(exception.PositionColumn);
|
||||
} else {
|
||||
line += lineSrc;
|
||||
line += '<span class="error"> </span>';
|
||||
}
|
||||
line += '</p>';
|
||||
expressionLines[i] = line;
|
||||
} else {
|
||||
expressionLines[i] = '<p id="line' + i + '" class="line">' + expressionLines[i].trim() + '</p>';
|
||||
}
|
||||
}
|
||||
return expressionLines.join('');
|
||||
},
|
||||
setExpression: function (expression) {
|
||||
this.expression = expression;
|
||||
this.setException(null);
|
||||
this.renderExpression();
|
||||
},
|
||||
getExpression: function () {
|
||||
var e = null;
|
||||
$('p', this.hostContainer).each(function () {
|
||||
if (e == null)
|
||||
e = $(this).text();
|
||||
else
|
||||
e += '\n' + $(this).text();
|
||||
});
|
||||
this.expression = e;
|
||||
return e;
|
||||
},
|
||||
setException: function (exception) {
|
||||
if (this.expressionException !== exception) {
|
||||
this.expressionException = exception;
|
||||
if (this.expressionExceptionChanged)
|
||||
this.expressionExceptionChanged(exception);
|
||||
}
|
||||
},
|
||||
renderExpression: function () {
|
||||
this.expressionHtml = this.parseExpression(this.expression, this.expressionException);
|
||||
this.hostContainer.html(this.expressionHtml);
|
||||
},
|
||||
validateExpression: function () {
|
||||
var that = this;
|
||||
var e = that.getExpression();
|
||||
$.getJSON(that.validateUrl, { Expression: e }, function (response, result) {
|
||||
that.setException(response);
|
||||
that.renderExpression();
|
||||
|
||||
if (that.expressionValidated)
|
||||
that.expressionValidated(response.ExpressionValid, response);
|
||||
})
|
||||
}
|
||||
}
|
||||
String.prototype.trim = function () {
|
||||
return this.replace(/^\s+|\s+$/g, "");
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<bundle minify="true" runOnBuild="true">
|
||||
<file>/ClientSource/Scripts/Modules/Disco-ExpressionEditor/disco.expressioneditor.js</file>
|
||||
</bundle>
|
||||
@@ -0,0 +1,2 @@
|
||||
function DiscoExpressionEditor(n,t,i){this.host=n,this.hostDocument=null,this.hostContainer=null,this.validateUrl=t,this.expression=i?i:"",this.expressionHtml="",this.expressionException=null,this.hostInited=null,this.expressionValidated=null,this.expressionExceptionChanged=null}DiscoExpressionEditor.prototype={hostInit:function(){var n=this,i=function(){n.hostDocument=n.host.contents(),n.hostContainer=n.hostDocument.find("body"),n.host.focus(function(){n.setException(null),n.renderExpression()}),n.hostContainer.bind("paste",function(){setTimeout(function(){n.setExpression(n.hostContainer.text())},50)}),n.expression&&n.setExpression(n.expression),n.hostInited&&n.hostInited()},t=function(){n.host.unbind("load",t),n.host.load(i),n.host[0].contentWindow.document.designMode="on"};n.host.load(t)},parseExpression:function(n,t){for(var u=n.split("\n"),f,r,i=0;i<u.length;i++)t&&t.PositionRow==i+1?(f=u[i].trim(),r='<p id="line'+i+'" class="line lineError">',f.length>=t.PositionColumn?(r+=f.substr(0,t.PositionColumn-1),r+='<span class="error">'+f.substr(t.PositionColumn-1,1)+"<\/span>",r+=f.substr(t.PositionColumn)):(r+=f,r+='<span class="error"> <\/span>'),r+="<\/p>",u[i]=r):u[i]='<p id="line'+i+'" class="line">'+u[i].trim()+"<\/p>";return u.join("")},setExpression:function(n){this.expression=n,this.setException(null),this.renderExpression()},getExpression:function(){var n=null;return $("p",this.hostContainer).each(function(){n==null?n=$(this).text():n+="\n"+$(this).text()}),this.expression=n,n},setException:function(n){this.expressionException!==n&&(this.expressionException=n,this.expressionExceptionChanged&&this.expressionExceptionChanged(n))},renderExpression:function(){this.expressionHtml=this.parseExpression(this.expression,this.expressionException),this.hostContainer.html(this.expressionHtml)},validateExpression:function(){var n=this,t=n.getExpression();$.getJSON(n.validateUrl,{Expression:t},function(t){n.setException(t),n.renderExpression(),n.expressionValidated&&n.expressionValidated(t.ExpressionValid,t)})}},String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};
|
||||
//@ sourceMappingURL=Disco-ExpressionEditor.min.js.map
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"version":3,
|
||||
"file":"Disco-ExpressionEditor.min.js",
|
||||
"lineCount":1,
|
||||
"mappings":"AACAA,SAASA,qBAAqB,CAACC,CAAI,CAAEC,CAAW,CAAEC,CAApB,CAAgC,CAC1D,IAAIF,KAAM,CAAEA,CAAI,CAChB,IAAIG,aAAc,CAAE,IAAI,CACxB,IAAIC,cAAe,CAAE,IAAI,CACzB,IAAIH,YAAa,CAAEA,CAAW,CAE1B,IAAIC,WAAY,CADhBA,CAAJ,CACsBA,CADtB,CAGsB,E,CACtB,IAAIG,eAAgB,CAAE,EAAE,CACxB,IAAIC,oBAAqB,CAAE,IAAI,CAG/B,IAAIC,WAAY,CAAE,IAAI,CACtB,IAAIC,oBAAqB,CAAE,IAAI,CAC/B,IAAIC,2BAA4B,CAAE,IAfwB,CAiB9DV,qBAAqBW,UAAW,CAAE,CAC9B,QAAQ,CAAEC,QAAS,CAAA,CAAG,CAClB,IAAIC,EAAO,KACPL,EAAaA,QAAS,CAAA,CAAG,CACzBK,CAAIT,aAAc,CAAES,CAAIZ,KAAKa,SAAS,CAAA,CAAE,CACxCD,CAAIR,cAAe,CAAEQ,CAAIT,aAAaW,KAAK,CAAC,MAAD,CAAQ,CAEnDF,CAAIZ,KAAKe,MAAM,CAAC,QAAS,CAAA,CAAG,CACxBH,CAAII,aAAa,CAAC,IAAD,CAAM,CACvBJ,CAAIK,iBAAiB,CAAA,CAFG,CAAb,CAGb,CAEFL,CAAIR,cAAcc,KAAK,CAAC,OAAO,CAAE,QAAS,CAAA,CAAK,CAC3CC,UAAU,CAAC,QAAS,CAAA,CAAG,CAAEP,CAAIQ,cAAc,CAACR,CAAIR,cAAciB,KAAK,CAAA,CAAxB,CAApB,CAAkD,CAAE,EAAjE,CADiC,CAAxB,CAErB,CAEET,CAAIV,W,EACJU,CAAIQ,cAAc,CAACR,CAAIV,WAAL,CAAiB,CAEnCU,CAAIL,W,EACJK,CAAIL,WAAW,CAAA,CAjBM,EAmBzBe,EAAiBA,QAAS,CAAA,CAAG,CAC7BV,CAAIZ,KAAKuB,OAAO,CAAC,MAAM,CAAED,CAAT,CAAwB,CACxCV,CAAIZ,KAAKwB,KAAK,CAACjB,CAAD,CAAY,CAC1BK,CAAIZ,KAAM,CAAA,CAAA,CAAEyB,cAAcC,SAASC,WAAY,CAAE,IAHpB,CApBlB,CAyBff,CAAIZ,KAAKwB,KAAK,CAACF,CAAD,CA1BI,CA2BrB,CACD,eAAe,CAAEM,QAAS,CAAC1B,CAAU,CAAE2B,CAAb,CAAwB,CAE9C,IADA,IAAIC,EAAkB5B,CAAU6B,MAAM,CAAC,IAAD,EAI1BC,EACAC,EAJHC,EAAI,CAAC,CAAEA,CAAE,CAAEJ,CAAeK,OAAO,CAAED,CAAC,EAA7C,CACQL,CAAU,EAAIA,CAASO,YAAa,EAAGF,CAAE,CAAE,CAA/C,EAEQF,CAAQ,CAAEF,CAAgB,CAAAI,CAAA,CAAEG,KAAK,CAAA,C,CACjCJ,CAAK,CAAE,aAAc,CAAEC,CAAE,CAAE,2B,CAC3BF,CAAOG,OAAQ,EAAGN,CAASS,eAA/B,EACIL,CAAK,EAAGD,CAAOO,OAAO,CAAC,CAAC,CAAEV,CAASS,eAAgB,CAAE,CAA/B,CAAiC,CACvDL,CAAK,EAAG,sBAAuB,CAAED,CAAOO,OAAO,CAACV,CAASS,eAAgB,CAAE,CAAC,CAAE,CAA/B,CAAkC,CAAE,UAAS,CAC5FL,CAAK,EAAGD,CAAOO,OAAO,CAACV,CAASS,eAAV,EAH1B,EAKIL,CAAK,EAAGD,CAAO,CACfC,CAAK,EAAG,qC,CAEZA,CAAK,EAAG,OAAM,CACdH,CAAgB,CAAAI,CAAA,CAAG,CAAED,EAbzB,CAeIH,CAAgB,CAAAI,CAAA,CAAG,CAAE,aAAc,CAAEA,CAAE,CAAE,iBAAkB,CAAEJ,CAAgB,CAAAI,CAAA,CAAEG,KAAK,CAAA,CAAG,CAAE,O,CAGjG,OAAOP,CAAeU,KAAK,CAAC,EAAD,CArBmB,CAsBjD,CACD,aAAa,CAAEpB,QAAS,CAAClB,CAAD,CAAa,CACjC,IAAIA,WAAY,CAAEA,CAAU,CAC5B,IAAIc,aAAa,CAAC,IAAD,CAAM,CACvB,IAAIC,iBAAiB,CAAA,CAHY,CAIpC,CACD,aAAa,CAAEwB,QAAS,CAAA,CAAG,CACvB,IAAIC,EAAI,IAAI,CAQZ,OAPAC,CAAC,CAAC,GAAG,CAAE,IAAIvC,cAAV,CAAyBwC,KAAK,CAAC,QAAS,CAAA,CAAG,CACpCF,CAAE,EAAG,IAAT,CACIA,CAAE,CAAEC,CAAC,CAAC,IAAD,CAAMtB,KAAK,CAAA,CADpB,CAGIqB,CAAE,EAAG,IAAK,CAAEC,CAAC,CAAC,IAAD,CAAMtB,KAAK,CAAA,CAJY,CAAb,CAK7B,CACF,IAAInB,WAAY,CAAEwC,CAAC,CACZA,CATgB,CAU1B,CACD,YAAY,CAAE1B,QAAS,CAACa,CAAD,CAAY,CAC3B,IAAIvB,oBAAqB,GAAIuB,C,GAC7B,IAAIvB,oBAAqB,CAAEuB,CAAS,CAChC,IAAIpB,2B,EACJ,IAAIA,2BAA2B,CAACoB,CAAD,EAJR,CAMlC,CACD,gBAAgB,CAAEZ,QAAS,CAAA,CAAG,CAC1B,IAAIZ,eAAgB,CAAE,IAAIuB,gBAAgB,CAAC,IAAI1B,WAAW,CAAE,IAAII,oBAAtB,CAA2C,CACrF,IAAIF,cAAcyC,KAAK,CAAC,IAAIxC,eAAL,CAFG,CAG7B,CACD,kBAAkB,CAAEyC,QAAS,CAAA,CAAG,CAC5B,IAAIlC,EAAO,KACP8B,EAAI9B,CAAI6B,cAAc,CAAA,CADX,CAEfE,CAACI,QAAQ,CAACnC,CAAIX,YAAY,CAAE,CAAE,UAAU,CAAEyC,CAAd,CAAiB,CAAE,QAAS,CAACM,CAAD,CAAmB,CACvEpC,CAAII,aAAa,CAACgC,CAAD,CAAU,CAC3BpC,CAAIK,iBAAiB,CAAA,CAAE,CAEnBL,CAAIJ,oB,EACJI,CAAIJ,oBAAoB,CAACwC,CAAQC,gBAAgB,CAAED,CAA3B,CAL2C,CAAlE,CAHmB,CA/EF,C,CA2FlCE,MAAMxC,UAAU2B,KAAM,CAAEc,QAAS,CAAA,CAAG,CAChC,OAAO,IAAIC,QAAQ,CAAC,YAAY,CAAE,EAAf,CADa,C",
|
||||
"sources":["/ClientSource/Scripts/Modules/Disco-ExpressionEditor/disco.expressioneditor.js"],
|
||||
"names":["DiscoExpressionEditor","host","validateUrl","expression","hostDocument","hostContainer","expressionHtml","expressionException","hostInited","expressionValidated","expressionExceptionChanged","prototype","hostInit","that","contents","find","focus","setException","renderExpression","bind","setTimeout","setExpression","text","designModeInit","unbind","load","contentWindow","document","designMode","parseExpression","exception","expressionLines","split","lineSrc","line","i","length","PositionRow","trim","PositionColumn","substr","join","getExpression","e","$","each","html","validateExpression","getJSON","response","ExpressionValid","String","String.prototype.trim","replace"]
|
||||
}
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
/// <reference path="../../Core/jquery-1.7.1.js" />
|
||||
function DiscoExpressionEditor(host, validateUrl, expression) {
|
||||
this.host = host;
|
||||
this.hostDocument = null;
|
||||
this.hostContainer = null;
|
||||
this.validateUrl = validateUrl;
|
||||
if (expression)
|
||||
this.expression = expression;
|
||||
else
|
||||
this.expression = '';
|
||||
this.expressionHtml = '';
|
||||
this.expressionException = null;
|
||||
|
||||
// Events
|
||||
this.hostInited = null;
|
||||
this.expressionValidated = null;
|
||||
this.expressionExceptionChanged = null;
|
||||
}
|
||||
DiscoExpressionEditor.prototype = {
|
||||
hostInit: function () {
|
||||
var that = this;
|
||||
var hostInited = function () {
|
||||
that.hostDocument = that.host.contents();
|
||||
that.hostContainer = that.hostDocument.find('body');
|
||||
|
||||
that.host.focus(function () {
|
||||
that.setException(null);
|
||||
that.renderExpression();
|
||||
});
|
||||
|
||||
that.hostContainer.bind('paste', function (el) {
|
||||
setTimeout(function () { that.setExpression(that.hostContainer.text()); }, 50);
|
||||
});
|
||||
|
||||
if (that.expression)
|
||||
that.setExpression(that.expression);
|
||||
|
||||
if (that.hostInited)
|
||||
that.hostInited();
|
||||
}
|
||||
var designModeInit = function () {
|
||||
that.host.unbind('load', designModeInit);
|
||||
that.host.load(hostInited);
|
||||
that.host[0].contentWindow.document.designMode = 'on';
|
||||
}
|
||||
that.host.load(designModeInit);
|
||||
},
|
||||
parseExpression: function (expression, exception) {
|
||||
var expressionLines = expression.split('\n');
|
||||
for (var i = 0; i < expressionLines.length; i++) {
|
||||
if (exception && (exception.PositionRow == i + 1)) {
|
||||
// Exception Row
|
||||
var lineSrc = expressionLines[i].trim();
|
||||
var line = '<p id="line' + i + '" class="line lineError">';
|
||||
if (lineSrc.length >= exception.PositionColumn) {
|
||||
line += lineSrc.substr(0, exception.PositionColumn - 1);
|
||||
line += '<span class="error">' + lineSrc.substr(exception.PositionColumn - 1, 1) + '</span>';
|
||||
line += lineSrc.substr(exception.PositionColumn);
|
||||
} else {
|
||||
line += lineSrc;
|
||||
line += '<span class="error"> </span>';
|
||||
}
|
||||
line += '</p>';
|
||||
expressionLines[i] = line;
|
||||
} else {
|
||||
expressionLines[i] = '<p id="line' + i + '" class="line">' + expressionLines[i].trim() + '</p>';
|
||||
}
|
||||
}
|
||||
return expressionLines.join('');
|
||||
},
|
||||
setExpression: function (expression) {
|
||||
this.expression = expression;
|
||||
this.setException(null);
|
||||
this.renderExpression();
|
||||
},
|
||||
getExpression: function () {
|
||||
var e = null;
|
||||
$('p', this.hostContainer).each(function () {
|
||||
if (e == null)
|
||||
e = $(this).text();
|
||||
else
|
||||
e += '\n' + $(this).text();
|
||||
});
|
||||
this.expression = e;
|
||||
return e;
|
||||
},
|
||||
setException: function (exception) {
|
||||
if (this.expressionException !== exception) {
|
||||
this.expressionException = exception;
|
||||
if (this.expressionExceptionChanged)
|
||||
this.expressionExceptionChanged(exception);
|
||||
}
|
||||
},
|
||||
renderExpression: function () {
|
||||
this.expressionHtml = this.parseExpression(this.expression, this.expressionException);
|
||||
this.hostContainer.html(this.expressionHtml);
|
||||
},
|
||||
validateExpression: function () {
|
||||
var that = this;
|
||||
var e = that.getExpression();
|
||||
$.getJSON(that.validateUrl, { Expression: e }, function (response, result) {
|
||||
that.setException(response);
|
||||
that.renderExpression();
|
||||
|
||||
if (that.expressionValidated)
|
||||
that.expressionValidated(response.ExpressionValid, response);
|
||||
})
|
||||
}
|
||||
}
|
||||
String.prototype.trim = function () {
|
||||
return this.replace(/^\s+|\s+$/g, "");
|
||||
}
|
||||
@@ -0,0 +1,198 @@
|
||||
///#source 1 1 /ClientSource/Scripts/Modules/Disco-PropertyChangeHelpers/disco.propertychangehelpers.js
|
||||
if (!document.DiscoFunctions) {
|
||||
document.DiscoFunctions = {};
|
||||
}
|
||||
if (!document.DiscoFunctions.PropertyChangeHelper){
|
||||
document.DiscoFunctions.PropertyValue = function(PropertyField){
|
||||
if (PropertyField[0].nodeName.toLowerCase()=='input' && PropertyField.attr('type')=='checkbox'){
|
||||
return PropertyField.is(':checked');
|
||||
}
|
||||
return PropertyField.val();
|
||||
};
|
||||
document.DiscoFunctions.PropertyChangeHelper = function (PropertyField, FieldWatermark, UpdateUrl, UpdatePropertyName) {
|
||||
var fieldValue = document.DiscoFunctions.PropertyValue(PropertyField);
|
||||
var fieldChangeToken = null;
|
||||
var $ajaxSave = PropertyField.nextAll('.ajaxSave').first();
|
||||
var $ajaxLoading = PropertyField.nextAll('.ajaxLoading').first();
|
||||
var fieldChangeFunction = function(){
|
||||
$ajaxSave.hide();
|
||||
var changedValue = document.DiscoFunctions.PropertyValue(PropertyField);
|
||||
if (fieldValue != changedValue){
|
||||
fieldValue = changedValue;
|
||||
if (fieldChangeToken)
|
||||
window.clearTimeout(fieldChangeToken);
|
||||
fieldChangeToken = window.setTimeout(function(){
|
||||
$ajaxLoading.show();
|
||||
var data = {};
|
||||
data[UpdatePropertyName] = fieldValue;
|
||||
$.getJSON(UpdateUrl, data, function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change property "' + UpdatePropertyName + '":\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
})
|
||||
fieldChangeToken = null;
|
||||
}, 500);
|
||||
};
|
||||
}
|
||||
if (PropertyField[0].nodeName.toLowerCase()=='input' && PropertyField.attr('type')=='checkbox'){
|
||||
PropertyField.click(fieldChangeFunction);
|
||||
}else{
|
||||
PropertyField.change(fieldChangeFunction);
|
||||
}
|
||||
// For Input Text Boxes
|
||||
if (PropertyField[0].nodeName.toLowerCase()=='input' && PropertyField.attr('type')=='text'){
|
||||
PropertyField.keydown(function(e){
|
||||
$ajaxSave.show();
|
||||
if (e.which == 13) {
|
||||
$(this).blur();
|
||||
}
|
||||
})
|
||||
.watermark(FieldWatermark)
|
||||
.blur(function () {
|
||||
$ajaxSave.hide();
|
||||
}).focus(function(){
|
||||
$(this).select();
|
||||
});
|
||||
}
|
||||
// For TextAreas
|
||||
if (PropertyField[0].nodeName.toLowerCase()=='textarea'){
|
||||
PropertyField.keydown(function(){
|
||||
$ajaxSave.show();
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!document.DiscoFunctions.DateChangeUserHelper){
|
||||
document.DiscoFunctions.DateChangeUserHelper = function (DateField, UserField, DateFieldWatermark, UpdateUrl, UpdatePropertyName, minDate, dateOnly) {
|
||||
var dateFieldValue = DateField.val();
|
||||
var dateFieldChangeToken = null;
|
||||
var $ajaxLoading = UserField.next('.ajaxLoading');
|
||||
DateField
|
||||
.watermark(DateFieldWatermark)
|
||||
.change(function(){
|
||||
var dateText = DateField.val();
|
||||
if (dateFieldValue.toLowerCase() != dateText.toLowerCase()){
|
||||
dateFieldValue = dateText;
|
||||
if (dateFieldChangeToken)
|
||||
window.clearTimeout(dateFieldChangeToken);
|
||||
dateFieldChangeToken = window.setTimeout(function(){
|
||||
$ajaxLoading.show();
|
||||
var data = {};
|
||||
data[UpdatePropertyName] = dateFieldValue;
|
||||
$.getJSON(UpdateUrl, data, function (response, result) {
|
||||
if (result != 'success' || response.Result != 'OK') {
|
||||
alert('Unable to change Date:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
UserField.text('by ' + response.UserDescription);
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
})
|
||||
dateFieldChangeToken = null;
|
||||
}, 500);
|
||||
}
|
||||
}).focus(function(){
|
||||
$(this).select();
|
||||
});
|
||||
|
||||
if (dateOnly){
|
||||
DateField.datepicker({
|
||||
defaultDate: new Date(),
|
||||
minDate: minDate,
|
||||
changeYear: true,
|
||||
changeMonth: true,
|
||||
dateFormat: 'yy/mm/dd',
|
||||
beforeShow: function(input, inst){
|
||||
$input = $(input);
|
||||
if (!$input.val()){
|
||||
$input.datepicker('setDate', new Date());
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
DateField.datetimepicker({
|
||||
defaultDate: new Date(),
|
||||
ampm: true,
|
||||
minDate: minDate,
|
||||
changeYear: true,
|
||||
changeMonth: true,
|
||||
dateFormat: 'yy/mm/dd',
|
||||
beforeShow: function(input, inst){
|
||||
$input = $(input);
|
||||
if (!$input.val()){
|
||||
$input.datetimepicker('setDate', new Date());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
if (!document.DiscoFunctions.DateChangeHelper){
|
||||
document.DiscoFunctions.DateChangeHelper = function (DateField, DateFieldWatermark, UpdateUrl, UpdatePropertyName, minDate, dateOnly) {
|
||||
var dateFieldValue = DateField.val();
|
||||
var dateFieldChangeToken = null;
|
||||
var $ajaxLoading = DateField.next('.ajaxLoading');
|
||||
DateField
|
||||
.watermark(DateFieldWatermark)
|
||||
.change(function(){
|
||||
var dateText = DateField.val();
|
||||
if (dateFieldValue.toLowerCase() != dateText.toLowerCase()){
|
||||
dateFieldValue = dateText;
|
||||
if (dateFieldChangeToken)
|
||||
window.clearTimeout(dateFieldChangeToken);
|
||||
dateFieldChangeToken = window.setTimeout(function(){
|
||||
$ajaxLoading.show();
|
||||
var data = {};
|
||||
data[UpdatePropertyName] = dateFieldValue;
|
||||
$.getJSON(UpdateUrl, data, function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change Date:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
})
|
||||
dateFieldChangeToken = null;
|
||||
}, 500);
|
||||
}
|
||||
}).focus(function(){
|
||||
$(this).select();
|
||||
});
|
||||
|
||||
if (dateOnly){
|
||||
DateField.datepicker({
|
||||
defaultDate: new Date(),
|
||||
minDate: minDate,
|
||||
changeYear: true,
|
||||
changeMonth: true,
|
||||
dateFormat: 'yy/mm/dd',
|
||||
beforeShow: function(input, inst){
|
||||
$input = $(input);
|
||||
if (!$input.val()){
|
||||
$input.datepicker('setDate', new Date());
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
DateField.datetimepicker({
|
||||
defaultDate: new Date(),
|
||||
ampm: true,
|
||||
minDate: minDate,
|
||||
changeYear: true,
|
||||
changeMonth: true,
|
||||
dateFormat: 'yy/mm/dd',
|
||||
beforeShow: function(input, inst){
|
||||
$input = $(input);
|
||||
if (!$input.val()){
|
||||
$input.datetimepicker('setDate', new Date());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<bundle minify="true" runOnBuild="true">
|
||||
<file>/ClientSource/Scripts/Modules/Disco-PropertyChangeHelpers/disco.propertychangehelpers.js</file>
|
||||
</bundle>
|
||||
@@ -0,0 +1,2 @@
|
||||
document.DiscoFunctions||(document.DiscoFunctions={}),document.DiscoFunctions.PropertyChangeHelper||(document.DiscoFunctions.PropertyValue=function(n){return n[0].nodeName.toLowerCase()=="input"&&n.attr("type")=="checkbox"?n.is(":checked"):n.val()},document.DiscoFunctions.PropertyChangeHelper=function(n,t,i,r){var e=document.DiscoFunctions.PropertyValue(n),u=null,f=n.nextAll(".ajaxSave").first(),o=n.nextAll(".ajaxLoading").first(),s=function(){f.hide();var t=document.DiscoFunctions.PropertyValue(n);e!=t&&(e=t,u&&window.clearTimeout(u),u=window.setTimeout(function(){o.show();var n={};n[r]=e,$.getJSON(i,n,function(n,t){t!="success"||n!="OK"?(alert('Unable to change property "'+r+'":\n'+n),o.hide()):o.hide().next(".ajaxOk").show().delay("fast").fadeOut("slow")}),u=null},500))};n[0].nodeName.toLowerCase()=="input"&&n.attr("type")=="checkbox"?n.click(s):n.change(s),n[0].nodeName.toLowerCase()=="input"&&n.attr("type")=="text"&&n.keydown(function(n){f.show(),n.which==13&&$(this).blur()}).watermark(t).blur(function(){f.hide()}).focus(function(){$(this).select()}),n[0].nodeName.toLowerCase()=="textarea"&&n.keydown(function(){f.show()})}),document.DiscoFunctions.DateChangeUserHelper||(document.DiscoFunctions.DateChangeUserHelper=function(n,t,i,r,u,f,e){var s=n.val(),o=null,h=t.next(".ajaxLoading");n.watermark(i).change(function(){var i=n.val();s.toLowerCase()!=i.toLowerCase()&&(s=i,o&&window.clearTimeout(o),o=window.setTimeout(function(){h.show();var n={};n[u]=s,$.getJSON(r,n,function(n,i){i!="success"||n.Result!="OK"?(alert("Unable to change Date:\n"+n),h.hide()):(t.text("by "+n.UserDescription),h.hide().next(".ajaxOk").show().delay("fast").fadeOut("slow"))}),o=null},500))}).focus(function(){$(this).select()}),e?n.datepicker({defaultDate:new Date,minDate:f,changeYear:!0,changeMonth:!0,dateFormat:"yy/mm/dd",beforeShow:function(n){$input=$(n),$input.val()||$input.datepicker("setDate",new Date)}}):n.datetimepicker({defaultDate:new Date,ampm:!0,minDate:f,changeYear:!0,changeMonth:!0,dateFormat:"yy/mm/dd",beforeShow:function(n){$input=$(n),$input.val()||$input.datetimepicker("setDate",new Date)}})}),document.DiscoFunctions.DateChangeHelper||(document.DiscoFunctions.DateChangeHelper=function(n,t,i,r,u,f){var o=n.val(),e=null,s=n.next(".ajaxLoading");n.watermark(t).change(function(){var t=n.val();o.toLowerCase()!=t.toLowerCase()&&(o=t,e&&window.clearTimeout(e),e=window.setTimeout(function(){s.show();var n={};n[r]=o,$.getJSON(i,n,function(n,t){t!="success"||n!="OK"?(alert("Unable to change Date:\n"+n),s.hide()):s.hide().next(".ajaxOk").show().delay("fast").fadeOut("slow")}),e=null},500))}).focus(function(){$(this).select()}),f?n.datepicker({defaultDate:new Date,minDate:u,changeYear:!0,changeMonth:!0,dateFormat:"yy/mm/dd",beforeShow:function(n){$input=$(n),$input.val()||$input.datepicker("setDate",new Date)}}):n.datetimepicker({defaultDate:new Date,ampm:!0,minDate:u,changeYear:!0,changeMonth:!0,dateFormat:"yy/mm/dd",beforeShow:function(n){$input=$(n),$input.val()||$input.datetimepicker("setDate",new Date)}})});
|
||||
//@ sourceMappingURL=Disco-PropertyChangeHelpers.min.js.map
|
||||
File diff suppressed because one or more lines are too long
+197
@@ -0,0 +1,197 @@
|
||||
if (!document.DiscoFunctions) {
|
||||
document.DiscoFunctions = {};
|
||||
}
|
||||
if (!document.DiscoFunctions.PropertyChangeHelper){
|
||||
document.DiscoFunctions.PropertyValue = function(PropertyField){
|
||||
if (PropertyField[0].nodeName.toLowerCase()=='input' && PropertyField.attr('type')=='checkbox'){
|
||||
return PropertyField.is(':checked');
|
||||
}
|
||||
return PropertyField.val();
|
||||
};
|
||||
document.DiscoFunctions.PropertyChangeHelper = function (PropertyField, FieldWatermark, UpdateUrl, UpdatePropertyName) {
|
||||
var fieldValue = document.DiscoFunctions.PropertyValue(PropertyField);
|
||||
var fieldChangeToken = null;
|
||||
var $ajaxSave = PropertyField.nextAll('.ajaxSave').first();
|
||||
var $ajaxLoading = PropertyField.nextAll('.ajaxLoading').first();
|
||||
var fieldChangeFunction = function(){
|
||||
$ajaxSave.hide();
|
||||
var changedValue = document.DiscoFunctions.PropertyValue(PropertyField);
|
||||
if (fieldValue != changedValue){
|
||||
fieldValue = changedValue;
|
||||
if (fieldChangeToken)
|
||||
window.clearTimeout(fieldChangeToken);
|
||||
fieldChangeToken = window.setTimeout(function(){
|
||||
$ajaxLoading.show();
|
||||
var data = {};
|
||||
data[UpdatePropertyName] = fieldValue;
|
||||
$.getJSON(UpdateUrl, data, function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change property "' + UpdatePropertyName + '":\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
})
|
||||
fieldChangeToken = null;
|
||||
}, 500);
|
||||
};
|
||||
}
|
||||
if (PropertyField[0].nodeName.toLowerCase()=='input' && PropertyField.attr('type')=='checkbox'){
|
||||
PropertyField.click(fieldChangeFunction);
|
||||
}else{
|
||||
PropertyField.change(fieldChangeFunction);
|
||||
}
|
||||
// For Input Text Boxes
|
||||
if (PropertyField[0].nodeName.toLowerCase()=='input' && PropertyField.attr('type')=='text'){
|
||||
PropertyField.keydown(function(e){
|
||||
$ajaxSave.show();
|
||||
if (e.which == 13) {
|
||||
$(this).blur();
|
||||
}
|
||||
})
|
||||
.watermark(FieldWatermark)
|
||||
.blur(function () {
|
||||
$ajaxSave.hide();
|
||||
}).focus(function(){
|
||||
$(this).select();
|
||||
});
|
||||
}
|
||||
// For TextAreas
|
||||
if (PropertyField[0].nodeName.toLowerCase()=='textarea'){
|
||||
PropertyField.keydown(function(){
|
||||
$ajaxSave.show();
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!document.DiscoFunctions.DateChangeUserHelper){
|
||||
document.DiscoFunctions.DateChangeUserHelper = function (DateField, UserField, DateFieldWatermark, UpdateUrl, UpdatePropertyName, minDate, dateOnly) {
|
||||
var dateFieldValue = DateField.val();
|
||||
var dateFieldChangeToken = null;
|
||||
var $ajaxLoading = UserField.next('.ajaxLoading');
|
||||
DateField
|
||||
.watermark(DateFieldWatermark)
|
||||
.change(function(){
|
||||
var dateText = DateField.val();
|
||||
if (dateFieldValue.toLowerCase() != dateText.toLowerCase()){
|
||||
dateFieldValue = dateText;
|
||||
if (dateFieldChangeToken)
|
||||
window.clearTimeout(dateFieldChangeToken);
|
||||
dateFieldChangeToken = window.setTimeout(function(){
|
||||
$ajaxLoading.show();
|
||||
var data = {};
|
||||
data[UpdatePropertyName] = dateFieldValue;
|
||||
$.getJSON(UpdateUrl, data, function (response, result) {
|
||||
if (result != 'success' || response.Result != 'OK') {
|
||||
alert('Unable to change Date:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
UserField.text('by ' + response.UserDescription);
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
})
|
||||
dateFieldChangeToken = null;
|
||||
}, 500);
|
||||
}
|
||||
}).focus(function(){
|
||||
$(this).select();
|
||||
});
|
||||
|
||||
if (dateOnly){
|
||||
DateField.datepicker({
|
||||
defaultDate: new Date(),
|
||||
minDate: minDate,
|
||||
changeYear: true,
|
||||
changeMonth: true,
|
||||
dateFormat: 'yy/mm/dd',
|
||||
beforeShow: function(input, inst){
|
||||
$input = $(input);
|
||||
if (!$input.val()){
|
||||
$input.datepicker('setDate', new Date());
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
DateField.datetimepicker({
|
||||
defaultDate: new Date(),
|
||||
ampm: true,
|
||||
minDate: minDate,
|
||||
changeYear: true,
|
||||
changeMonth: true,
|
||||
dateFormat: 'yy/mm/dd',
|
||||
beforeShow: function(input, inst){
|
||||
$input = $(input);
|
||||
if (!$input.val()){
|
||||
$input.datetimepicker('setDate', new Date());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
if (!document.DiscoFunctions.DateChangeHelper){
|
||||
document.DiscoFunctions.DateChangeHelper = function (DateField, DateFieldWatermark, UpdateUrl, UpdatePropertyName, minDate, dateOnly) {
|
||||
var dateFieldValue = DateField.val();
|
||||
var dateFieldChangeToken = null;
|
||||
var $ajaxLoading = DateField.next('.ajaxLoading');
|
||||
DateField
|
||||
.watermark(DateFieldWatermark)
|
||||
.change(function(){
|
||||
var dateText = DateField.val();
|
||||
if (dateFieldValue.toLowerCase() != dateText.toLowerCase()){
|
||||
dateFieldValue = dateText;
|
||||
if (dateFieldChangeToken)
|
||||
window.clearTimeout(dateFieldChangeToken);
|
||||
dateFieldChangeToken = window.setTimeout(function(){
|
||||
$ajaxLoading.show();
|
||||
var data = {};
|
||||
data[UpdatePropertyName] = dateFieldValue;
|
||||
$.getJSON(UpdateUrl, data, function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change Date:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
})
|
||||
dateFieldChangeToken = null;
|
||||
}, 500);
|
||||
}
|
||||
}).focus(function(){
|
||||
$(this).select();
|
||||
});
|
||||
|
||||
if (dateOnly){
|
||||
DateField.datepicker({
|
||||
defaultDate: new Date(),
|
||||
minDate: minDate,
|
||||
changeYear: true,
|
||||
changeMonth: true,
|
||||
dateFormat: 'yy/mm/dd',
|
||||
beforeShow: function(input, inst){
|
||||
$input = $(input);
|
||||
if (!$input.val()){
|
||||
$input.datepicker('setDate', new Date());
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
DateField.datetimepicker({
|
||||
defaultDate: new Date(),
|
||||
ampm: true,
|
||||
minDate: minDate,
|
||||
changeYear: true,
|
||||
changeMonth: true,
|
||||
dateFormat: 'yy/mm/dd',
|
||||
beforeShow: function(input, inst){
|
||||
$input = $(input);
|
||||
if (!$input.val()){
|
||||
$input.datetimepicker('setDate', new Date());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
///#source 1 1 /ClientSource/Scripts/Modules/Disco-jQueryExtensions/disco.jQueryExtensions.js
|
||||
/// <reference path="../../Core/jquery-1.7.1.js" />
|
||||
(function ($) {
|
||||
|
||||
var checkboxBulkSelectMethods = {
|
||||
init: function (options) {
|
||||
|
||||
options = $.extend({ parentSelector: 'tr' }, options);
|
||||
|
||||
return this.each(function () {
|
||||
var $this = $(this);
|
||||
$this.data('checkboxBulkSelect_parentSelector', options.parentSelector);
|
||||
var $checkboxes = $this.closest(options.parentSelector).find('input[type="checkbox"]');
|
||||
|
||||
if ($checkboxes.length > 0) {
|
||||
var $selectAll, $selectNone;
|
||||
|
||||
$selectAll = $('<a>').addClass('selectAll').attr('href', '#').text('ALL').click(selectAll);
|
||||
$selectNone = $('<a>').addClass('selectNone').attr('href', '#').text('NONE').click(selectNone);
|
||||
|
||||
$this.append($('<span>').text('Select: '), $selectAll, $('<span>').text(' | '), $selectNone);
|
||||
$checkboxes.click(update);
|
||||
|
||||
update();
|
||||
|
||||
function selectAll() {
|
||||
$checkboxes.attr('checked', 'checked');
|
||||
update();
|
||||
return false;
|
||||
}
|
||||
function selectNone() {
|
||||
$checkboxes.removeAttr('checked');
|
||||
update();
|
||||
return false;
|
||||
}
|
||||
function update() {
|
||||
checkboxBulkSelectMethods.update.apply($this, [$checkboxes, options.parentSelector, $selectAll, $selectNone]);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
update: function ($checkboxes, parentSelector, $selectAll, $selectNone) {
|
||||
return this.each(function () {
|
||||
$this = $(this);
|
||||
if (!parentSelector)
|
||||
parentSelector = $this.data('checkboxBulkSelect_parentSelector');
|
||||
if (!$checkboxes)
|
||||
$checkboxes = $this.closest(parentSelector).find('input[type="checkbox"]');
|
||||
if (!$selectAll)
|
||||
$selectAll = $this.find('a.selectAll').first();
|
||||
if (!$selectNone)
|
||||
$selectNone = $this.find('a.selectNone').first();
|
||||
var $selectedCheckboxes = $checkboxes.filter(':checked');
|
||||
|
||||
if ($checkboxes.length == $selectedCheckboxes.length) {
|
||||
// All Selected
|
||||
$selectAll.attr('disabled', 'disabled');
|
||||
$selectNone.removeAttr('disabled');
|
||||
} else {
|
||||
if ($selectedCheckboxes.length == 0) {
|
||||
// None Selected
|
||||
$selectNone.attr('disabled', 'disabled');
|
||||
$selectAll.removeAttr('disabled');
|
||||
} else {
|
||||
// Some Selected
|
||||
$selectAll.removeAttr('disabled');
|
||||
$selectNone.removeAttr('disabled');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$.fn.checkboxBulkSelect = function (method) {
|
||||
if (checkboxBulkSelectMethods[method]) {
|
||||
return checkboxBulkSelectMethods[method].apply(this, Array.prototype.slice(arguments, 1));
|
||||
} else if (typeof method === 'object' || !method) {
|
||||
return checkboxBulkSelectMethods.init.apply(this, arguments);
|
||||
} else {
|
||||
$.error('Method ' + method + ' does not exist on jQuery.checkboxBulkSelect');
|
||||
}
|
||||
}
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<bundle minify="true" runOnBuild="true">
|
||||
<file>/ClientSource/Scripts/Modules/Disco-jQueryExtensions/disco.jQueryExtensions.js</file>
|
||||
</bundle>
|
||||
@@ -0,0 +1,2 @@
|
||||
(function(n){var t={init:function(i){return i=n.extend({parentSelector:"tr"},i),this.each(function(){var u=n(this),r,f,e;if(u.data("checkboxBulkSelect_parentSelector",i.parentSelector),r=u.closest(i.parentSelector).find('input[type="checkbox"]'),r.length>0){f=n("<a>").addClass("selectAll").attr("href","#").text("ALL").click(s),e=n("<a>").addClass("selectNone").attr("href","#").text("NONE").click(h),u.append(n("<span>").text("Select: "),f,n("<span>").text(" | "),e),r.click(o),o();function s(){return r.attr("checked","checked"),o(),!1}function h(){return r.removeAttr("checked"),o(),!1}function o(){t.update.apply(u,[r,i.parentSelector,f,e])}}})},update:function(t,i,r,u){return this.each(function(){$this=n(this),i||(i=$this.data("checkboxBulkSelect_parentSelector")),t||(t=$this.closest(i).find('input[type="checkbox"]')),r||(r=$this.find("a.selectAll").first()),u||(u=$this.find("a.selectNone").first());var f=t.filter(":checked");t.length==f.length?(r.attr("disabled","disabled"),u.removeAttr("disabled")):f.length==0?(u.attr("disabled","disabled"),r.removeAttr("disabled")):(r.removeAttr("disabled"),u.removeAttr("disabled"))})}};n.fn.checkboxBulkSelect=function(i){if(t[i])return t[i].apply(this,Array.prototype.slice(arguments,1));if(typeof i!="object"&&i)n.error("Method "+i+" does not exist on jQuery.checkboxBulkSelect");else return t.init.apply(this,arguments)}})(jQuery);
|
||||
//@ sourceMappingURL=Disco-jQueryExtensions.min.js.map
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"version":3,
|
||||
"file":"Disco-jQueryExtensions.min.js",
|
||||
"lineCount":1,
|
||||
"mappings":"CACC,QAAS,CAACA,CAAD,CAAI,CAEV,IAAIC,EAA4B,CAC5B,IAAI,CAAEC,QAAS,CAACC,CAAD,CAAU,CAIrB,OAFAA,CAAQ,CAAEH,CAACI,OAAO,CAAC,CAAE,cAAc,CAAE,IAAlB,CAAwB,CAAED,CAA3B,CAAmC,CAE9C,IAAIE,KAAK,CAAC,QAAS,CAAA,CAAG,CACzB,IAAIC,EAAQN,CAAC,CAAC,IAAD,EAETO,EAGIC,EAAYC,CALD,CAInB,GAHAH,CAAKI,KAAK,CAAC,mCAAmC,CAAEP,CAAOQ,eAA7C,CAA6D,CACnEJ,CAAY,CAAED,CAAKM,QAAQ,CAACT,CAAOQ,eAAR,CAAwBE,KAAK,CAAC,wBAAD,C,CAExDN,CAAWO,OAAQ,CAAE,EAAG,CAGxBN,CAAW,CAAER,CAAC,CAAC,KAAD,CAAOe,SAAS,CAAC,WAAD,CAAaC,KAAK,CAAC,MAAM,CAAE,GAAT,CAAaC,KAAK,CAAC,KAAD,CAAOC,MAAM,CAACC,CAAD,CAAW,CAC1FV,CAAY,CAAET,CAAC,CAAC,KAAD,CAAOe,SAAS,CAAC,YAAD,CAAcC,KAAK,CAAC,MAAM,CAAE,GAAT,CAAaC,KAAK,CAAC,MAAD,CAAQC,MAAM,CAACE,CAAD,CAAY,CAE9Fd,CAAKe,OAAO,CAACrB,CAAC,CAAC,QAAD,CAAUiB,KAAK,CAAC,UAAD,CAAY,CAAET,CAAU,CAAER,CAAC,CAAC,QAAD,CAAUiB,KAAK,CAAC,KAAD,CAAO,CAAER,CAApE,CAAgF,CAC5FF,CAAWW,MAAM,CAACI,CAAD,CAAQ,CAEzBA,CAAM,CAAA,CAAE,CAERH,SAASA,CAAS,CAAA,CAAG,CAGjB,OAFAZ,CAAWS,KAAK,CAAC,SAAS,CAAE,SAAZ,CAAsB,CACtCM,CAAM,CAAA,CAAE,CACD,CAAA,CAHU,CAKrBF,SAASA,CAAU,CAAA,CAAG,CAGlB,OAFAb,CAAWgB,WAAW,CAAC,SAAD,CAAW,CACjCD,CAAM,CAAA,CAAE,CACD,CAAA,CAHW,CAKtBA,SAASA,CAAM,CAAA,CAAG,CACdrB,CAAyBqB,OAAOE,MAAM,CAAClB,CAAK,CAAE,CAACC,CAAW,CAAEJ,CAAOQ,eAAe,CAAEH,CAAU,CAAEC,CAAlD,CAAR,CADxB,CArBM,CALH,CAAb,CAJK,CAmCxB,CACD,MAAM,CAAEa,QAAS,CAACf,CAAW,CAAEI,CAAc,CAAEH,CAAU,CAAEC,CAA1C,CAAuD,CACpE,OAAO,IAAIJ,KAAK,CAAC,QAAS,CAAA,CAAG,CACzBC,KAAM,CAAEN,CAAC,CAAC,IAAD,CAAM,CACVW,C,GACDA,CAAe,CAAEL,KAAKI,KAAK,CAAC,mCAAD,EAAqC,CAC/DH,C,GACDA,CAAY,CAAED,KAAKM,QAAQ,CAACD,CAAD,CAAgBE,KAAK,CAAC,wBAAD,EAA0B,CACzEL,C,GACDA,CAAW,CAAEF,KAAKO,KAAK,CAAC,aAAD,CAAeY,MAAM,CAAA,EAAE,CAC7ChB,C,GACDA,CAAY,CAAEH,KAAKO,KAAK,CAAC,cAAD,CAAgBY,MAAM,CAAA,EAAE,CACpD,IAAIC,EAAsBnB,CAAWoB,OAAO,CAAC,UAAD,CAAY,CAEpDpB,CAAWO,OAAQ,EAAGY,CAAmBZ,OAA7C,EAEIN,CAAUQ,KAAK,CAAC,UAAU,CAAE,UAAb,CAAwB,CACvCP,CAAWc,WAAW,CAAC,UAAD,EAH1B,CAKQG,CAAmBZ,OAAQ,EAAG,CAAlC,EAEIL,CAAWO,KAAK,CAAC,UAAU,CAAE,UAAb,CAAwB,CACxCR,CAAUe,WAAW,CAAC,UAAD,EAHzB,EAMIf,CAAUe,WAAW,CAAC,UAAD,CAAY,CACjCd,CAAWc,WAAW,CAAC,UAAD,EAxBL,CAAb,CADoD,CArC5C,C,CAqEhCvB,CAAC4B,GAAGC,mBAAoB,CAAEC,QAAS,CAACC,CAAD,CAAS,CACxC,GAAI9B,CAA0B,CAAA8B,CAAA,EAC1B,OAAO9B,CAA0B,CAAA8B,CAAA,CAAOP,MAAM,CAAC,IAAI,CAAEQ,KAAKC,UAAUC,MAAM,CAACC,SAAS,CAAE,CAAZ,CAA5B,CAA2C,CACtF,GAAI,OAAOJ,CAAO,EAAI,QAAS,EAAIA,EAGtC/B,CAACoC,MAAM,CAAC,SAAU,CAAEL,CAAO,CAAE,8CAAtB,CAAqE,CAD9E,KADE,OAAO9B,CAAyBC,KAAKsB,MAAM,CAAC,IAAI,CAAEW,SAAP,CAJP,CAvElC,EAgFZ,CAACE,MAAD,CAAQ",
|
||||
"sources":["/ClientSource/Scripts/Modules/Disco-jQueryExtensions/disco.jQueryExtensions.js"],
|
||||
"names":["$","checkboxBulkSelectMethods","init","options","extend","each","$this","$checkboxes","$selectAll","$selectNone","data","parentSelector","closest","find","length","addClass","attr","text","click","selectAll","selectNone","append","update","removeAttr","apply","first","$selectedCheckboxes","filter","fn","checkboxBulkSelect","$.fn.checkboxBulkSelect","method","Array","prototype","slice","arguments","error","jQuery"]
|
||||
}
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
/// <reference path="../../Core/jquery-1.7.1.js" />
|
||||
(function ($) {
|
||||
|
||||
var checkboxBulkSelectMethods = {
|
||||
init: function (options) {
|
||||
|
||||
options = $.extend({ parentSelector: 'tr' }, options);
|
||||
|
||||
return this.each(function () {
|
||||
var $this = $(this);
|
||||
$this.data('checkboxBulkSelect_parentSelector', options.parentSelector);
|
||||
var $checkboxes = $this.closest(options.parentSelector).find('input[type="checkbox"]');
|
||||
|
||||
if ($checkboxes.length > 0) {
|
||||
var $selectAll, $selectNone;
|
||||
|
||||
$selectAll = $('<a>').addClass('selectAll').attr('href', '#').text('ALL').click(selectAll);
|
||||
$selectNone = $('<a>').addClass('selectNone').attr('href', '#').text('NONE').click(selectNone);
|
||||
|
||||
$this.append($('<span>').text('Select: '), $selectAll, $('<span>').text(' | '), $selectNone);
|
||||
$checkboxes.click(update);
|
||||
|
||||
update();
|
||||
|
||||
function selectAll() {
|
||||
$checkboxes.attr('checked', 'checked');
|
||||
update();
|
||||
return false;
|
||||
}
|
||||
function selectNone() {
|
||||
$checkboxes.removeAttr('checked');
|
||||
update();
|
||||
return false;
|
||||
}
|
||||
function update() {
|
||||
checkboxBulkSelectMethods.update.apply($this, [$checkboxes, options.parentSelector, $selectAll, $selectNone]);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
update: function ($checkboxes, parentSelector, $selectAll, $selectNone) {
|
||||
return this.each(function () {
|
||||
$this = $(this);
|
||||
if (!parentSelector)
|
||||
parentSelector = $this.data('checkboxBulkSelect_parentSelector');
|
||||
if (!$checkboxes)
|
||||
$checkboxes = $this.closest(parentSelector).find('input[type="checkbox"]');
|
||||
if (!$selectAll)
|
||||
$selectAll = $this.find('a.selectAll').first();
|
||||
if (!$selectNone)
|
||||
$selectNone = $this.find('a.selectNone').first();
|
||||
var $selectedCheckboxes = $checkboxes.filter(':checked');
|
||||
|
||||
if ($checkboxes.length == $selectedCheckboxes.length) {
|
||||
// All Selected
|
||||
$selectAll.attr('disabled', 'disabled');
|
||||
$selectNone.removeAttr('disabled');
|
||||
} else {
|
||||
if ($selectedCheckboxes.length == 0) {
|
||||
// None Selected
|
||||
$selectNone.attr('disabled', 'disabled');
|
||||
$selectAll.removeAttr('disabled');
|
||||
} else {
|
||||
// Some Selected
|
||||
$selectAll.removeAttr('disabled');
|
||||
$selectNone.removeAttr('disabled');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$.fn.checkboxBulkSelect = function (method) {
|
||||
if (checkboxBulkSelectMethods[method]) {
|
||||
return checkboxBulkSelectMethods[method].apply(this, Array.prototype.slice(arguments, 1));
|
||||
} else if (typeof method === 'object' || !method) {
|
||||
return checkboxBulkSelectMethods.init.apply(this, arguments);
|
||||
} else {
|
||||
$.error('Method ' + method + ' does not exist on jQuery.checkboxBulkSelect');
|
||||
}
|
||||
}
|
||||
})(jQuery);
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<bundle minify="true" runOnBuild="true">
|
||||
<file>/ClientSource/Scripts/Modules/Highcharts/highcharts.src.js</file>
|
||||
</bundle>
|
||||
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 it is too large
Load Diff
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
A class to parse color values
|
||||
@author Stoyan Stefanov <sstoo@gmail.com>
|
||||
@link http://www.phpied.com/rgb-color-parser-in-javascript/
|
||||
Use it if you like it
|
||||
|
||||
canvg.js - Javascript SVG parser and renderer on Canvas
|
||||
MIT Licensed
|
||||
Gabe Lerner (gabelerner@gmail.com)
|
||||
http://code.google.com/p/canvg/
|
||||
|
||||
Requires: rgbcolor.js - http://www.phpied.com/rgb-color-parser-in-javascript/
|
||||
|
||||
Highcharts JS v2.2.1 (2012-03-15)
|
||||
CanVGRenderer Extension module
|
||||
|
||||
(c) 2011-2012 Torstein H?nsi, Erik Olsson
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
function RGBColor(m){this.ok=!1;m.charAt(0)=="#"&&(m=m.substr(1,6));var m=m.replace(/ /g,""),m=m.toLowerCase(),a={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",
|
||||
darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",
|
||||
gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",
|
||||
lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",
|
||||
oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",
|
||||
slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},c;for(c in a)m==c&&(m=a[c]);var d=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(b){return[parseInt(b[1]),parseInt(b[2]),parseInt(b[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,
|
||||
example:["#00ff00","336699"],process:function(b){return[parseInt(b[1],16),parseInt(b[2],16),parseInt(b[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(b){return[parseInt(b[1]+b[1],16),parseInt(b[2]+b[2],16),parseInt(b[3]+b[3],16)]}}];for(c=0;c<d.length;c++){var b=d[c].process,k=d[c].re.exec(m);if(k)channels=b(k),this.r=channels[0],this.g=channels[1],this.b=channels[2],this.ok=!0}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r;this.g=this.g<0||isNaN(this.g)?0:
|
||||
this.g>255?255:this.g;this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b;this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"};this.toHex=function(){var b=this.r.toString(16),a=this.g.toString(16),d=this.b.toString(16);b.length==1&&(b="0"+b);a.length==1&&(a="0"+a);d.length==1&&(d="0"+d);return"#"+b+a+d};this.getHelpXML=function(){for(var b=[],k=0;k<d.length;k++)for(var c=d[k].example,h=0;h<c.length;h++)b[b.length]=c[h];for(var j in a)b[b.length]=j;c=document.createElement("ul");
|
||||
c.setAttribute("id","rgbcolor-examples");for(k=0;k<b.length;k++)try{var l=document.createElement("li"),o=new RGBColor(b[k]),n=document.createElement("div");n.style.cssText="margin: 3px; border: 1px solid black; background:"+o.toHex()+"; color:"+o.toHex();n.appendChild(document.createTextNode("test"));var q=document.createTextNode(" "+b[k]+" -> "+o.toRGB()+" -> "+o.toHex());l.appendChild(n);l.appendChild(q);c.appendChild(l)}catch(p){}return c}}
|
||||
if(!window.console)window.console={},window.console.log=function(){},window.console.dir=function(){};if(!Array.prototype.indexOf)Array.prototype.indexOf=function(m){for(var a=0;a<this.length;a++)if(this[a]==m)return a;return-1};
|
||||
(function(){function m(){var a={FRAMERATE:30,MAX_VIRTUAL_PIXELS:3E4};a.init=function(c){a.Definitions={};a.Styles={};a.Animations=[];a.Images=[];a.ctx=c;a.ViewPort=new function(){this.viewPorts=[];this.Clear=function(){this.viewPorts=[]};this.SetCurrent=function(a,b){this.viewPorts.push({width:a,height:b})};this.RemoveCurrent=function(){this.viewPorts.pop()};this.Current=function(){return this.viewPorts[this.viewPorts.length-1]};this.width=function(){return this.Current().width};this.height=function(){return this.Current().height};
|
||||
this.ComputeSize=function(a){return a!=null&&typeof a=="number"?a:a=="x"?this.width():a=="y"?this.height():Math.sqrt(Math.pow(this.width(),2)+Math.pow(this.height(),2))/Math.sqrt(2)}}};a.init();a.ImagesLoaded=function(){for(var c=0;c<a.Images.length;c++)if(!a.Images[c].loaded)return!1;return!0};a.trim=function(a){return a.replace(/^\s+|\s+$/g,"")};a.compressSpaces=function(a){return a.replace(/[\s\r\t\n]+/gm," ")};a.ajax=function(a){var d;return(d=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"))?
|
||||
(d.open("GET",a,!1),d.send(null),d.responseText):null};a.parseXml=function(a){if(window.DOMParser)return(new DOMParser).parseFromString(a,"text/xml");else{var a=a.replace(/<!DOCTYPE svg[^>]*>/,""),d=new ActiveXObject("Microsoft.XMLDOM");d.async="false";d.loadXML(a);return d}};a.Property=function(c,d){this.name=c;this.value=d;this.hasValue=function(){return this.value!=null&&this.value!==""};this.numValue=function(){if(!this.hasValue())return 0;var b=parseFloat(this.value);(this.value+"").match(/%$/)&&
|
||||
(b/=100);return b};this.valueOrDefault=function(b){return this.hasValue()?this.value:b};this.numValueOrDefault=function(b){return this.hasValue()?this.numValue():b};var b=this;this.Color={addOpacity:function(d){var c=b.value;if(d!=null&&d!=""){var f=new RGBColor(b.value);f.ok&&(c="rgba("+f.r+", "+f.g+", "+f.b+", "+d+")")}return new a.Property(b.name,c)}};this.Definition={getDefinition:function(){var d=b.value.replace(/^(url\()?#([^\)]+)\)?$/,"$2");return a.Definitions[d]},isUrl:function(){return b.value.indexOf("url(")==
|
||||
0},getFillStyle:function(b){var d=this.getDefinition();return d!=null&&d.createGradient?d.createGradient(a.ctx,b):d!=null&&d.createPattern?d.createPattern(a.ctx,b):null}};this.Length={DPI:function(){return 96},EM:function(b){var d=12,c=new a.Property("fontSize",a.Font.Parse(a.ctx.font).fontSize);c.hasValue()&&(d=c.Length.toPixels(b));return d},toPixels:function(d){if(!b.hasValue())return 0;var c=b.value+"";return c.match(/em$/)?b.numValue()*this.EM(d):c.match(/ex$/)?b.numValue()*this.EM(d)/2:c.match(/px$/)?
|
||||
b.numValue():c.match(/pt$/)?b.numValue()*1.25:c.match(/pc$/)?b.numValue()*15:c.match(/cm$/)?b.numValue()*this.DPI(d)/2.54:c.match(/mm$/)?b.numValue()*this.DPI(d)/25.4:c.match(/in$/)?b.numValue()*this.DPI(d):c.match(/%$/)?b.numValue()*a.ViewPort.ComputeSize(d):b.numValue()}};this.Time={toMilliseconds:function(){if(!b.hasValue())return 0;var a=b.value+"";if(a.match(/s$/))return b.numValue()*1E3;a.match(/ms$/);return b.numValue()}};this.Angle={toRadians:function(){if(!b.hasValue())return 0;var a=b.value+
|
||||
"";return a.match(/deg$/)?b.numValue()*(Math.PI/180):a.match(/grad$/)?b.numValue()*(Math.PI/200):a.match(/rad$/)?b.numValue():b.numValue()*(Math.PI/180)}}};a.Font=new function(){this.Styles=["normal","italic","oblique","inherit"];this.Variants=["normal","small-caps","inherit"];this.Weights="normal,bold,bolder,lighter,100,200,300,400,500,600,700,800,900,inherit".split(",");this.CreateFont=function(d,b,c,e,f,g){g=g!=null?this.Parse(g):this.CreateFont("","","","","",a.ctx.font);return{fontFamily:f||
|
||||
g.fontFamily,fontSize:e||g.fontSize,fontStyle:d||g.fontStyle,fontWeight:c||g.fontWeight,fontVariant:b||g.fontVariant,toString:function(){return[this.fontStyle,this.fontVariant,this.fontWeight,this.fontSize,this.fontFamily].join(" ")}}};var c=this;this.Parse=function(d){for(var b={},d=a.trim(a.compressSpaces(d||"")).split(" "),k=!1,e=!1,f=!1,g=!1,h="",j=0;j<d.length;j++)if(!e&&c.Styles.indexOf(d[j])!=-1){if(d[j]!="inherit")b.fontStyle=d[j];e=!0}else if(!g&&c.Variants.indexOf(d[j])!=-1){if(d[j]!="inherit")b.fontVariant=
|
||||
d[j];e=g=!0}else if(!f&&c.Weights.indexOf(d[j])!=-1){if(d[j]!="inherit")b.fontWeight=d[j];e=g=f=!0}else if(k)d[j]!="inherit"&&(h+=d[j]);else{if(d[j]!="inherit")b.fontSize=d[j].split("/")[0];e=g=f=k=!0}if(h!="")b.fontFamily=h;return b}};a.ToNumberArray=function(c){for(var c=a.trim(a.compressSpaces((c||"").replace(/,/g," "))).split(" "),d=0;d<c.length;d++)c[d]=parseFloat(c[d]);return c};a.Point=function(a,d){this.x=a;this.y=d;this.angleTo=function(b){return Math.atan2(b.y-this.y,b.x-this.x)};this.applyTransform=
|
||||
function(b){var a=this.x*b[1]+this.y*b[3]+b[5];this.x=this.x*b[0]+this.y*b[2]+b[4];this.y=a}};a.CreatePoint=function(c){c=a.ToNumberArray(c);return new a.Point(c[0],c[1])};a.CreatePath=function(c){for(var c=a.ToNumberArray(c),d=[],b=0;b<c.length;b+=2)d.push(new a.Point(c[b],c[b+1]));return d};a.BoundingBox=function(a,d,b,k){this.y2=this.x2=this.y1=this.x1=Number.NaN;this.x=function(){return this.x1};this.y=function(){return this.y1};this.width=function(){return this.x2-this.x1};this.height=function(){return this.y2-
|
||||
this.y1};this.addPoint=function(b,a){if(b!=null){if(isNaN(this.x1)||isNaN(this.x2))this.x2=this.x1=b;if(b<this.x1)this.x1=b;if(b>this.x2)this.x2=b}if(a!=null){if(isNaN(this.y1)||isNaN(this.y2))this.y2=this.y1=a;if(a<this.y1)this.y1=a;if(a>this.y2)this.y2=a}};this.addX=function(b){this.addPoint(b,null)};this.addY=function(b){this.addPoint(null,b)};this.addBoundingBox=function(b){this.addPoint(b.x1,b.y1);this.addPoint(b.x2,b.y2)};this.addQuadraticCurve=function(b,a,d,c,k,l){d=b+2/3*(d-b);c=a+2/3*(c-
|
||||
a);this.addBezierCurve(b,a,d,d+1/3*(k-b),c,c+1/3*(l-a),k,l)};this.addBezierCurve=function(b,a,d,c,k,l,o,n){var q=[b,a],p=[d,c],s=[k,l],m=[o,n];this.addPoint(q[0],q[1]);this.addPoint(m[0],m[1]);for(i=0;i<=1;i++)b=function(b){return Math.pow(1-b,3)*q[i]+3*Math.pow(1-b,2)*b*p[i]+3*(1-b)*Math.pow(b,2)*s[i]+Math.pow(b,3)*m[i]},a=6*q[i]-12*p[i]+6*s[i],d=-3*q[i]+9*p[i]-9*s[i]+3*m[i],c=3*p[i]-3*q[i],d==0?a!=0&&(a=-c/a,0<a&&a<1&&(i==0&&this.addX(b(a)),i==1&&this.addY(b(a)))):(c=Math.pow(a,2)-4*c*d,c<0||(k=
|
||||
(-a+Math.sqrt(c))/(2*d),0<k&&k<1&&(i==0&&this.addX(b(k)),i==1&&this.addY(b(k))),a=(-a-Math.sqrt(c))/(2*d),0<a&&a<1&&(i==0&&this.addX(b(a)),i==1&&this.addY(b(a)))))};this.isPointInBox=function(b,a){return this.x1<=b&&b<=this.x2&&this.y1<=a&&a<=this.y2};this.addPoint(a,d);this.addPoint(b,k)};a.Transform=function(c){var d=this;this.Type={};this.Type.translate=function(b){this.p=a.CreatePoint(b);this.apply=function(b){b.translate(this.p.x||0,this.p.y||0)};this.applyToPoint=function(b){b.applyTransform([1,
|
||||
0,0,1,this.p.x||0,this.p.y||0])}};this.Type.rotate=function(b){b=a.ToNumberArray(b);this.angle=new a.Property("angle",b[0]);this.cx=b[1]||0;this.cy=b[2]||0;this.apply=function(b){b.translate(this.cx,this.cy);b.rotate(this.angle.Angle.toRadians());b.translate(-this.cx,-this.cy)};this.applyToPoint=function(b){var a=this.angle.Angle.toRadians();b.applyTransform([1,0,0,1,this.p.x||0,this.p.y||0]);b.applyTransform([Math.cos(a),Math.sin(a),-Math.sin(a),Math.cos(a),0,0]);b.applyTransform([1,0,0,1,-this.p.x||
|
||||
0,-this.p.y||0])}};this.Type.scale=function(b){this.p=a.CreatePoint(b);this.apply=function(b){b.scale(this.p.x||1,this.p.y||this.p.x||1)};this.applyToPoint=function(b){b.applyTransform([this.p.x||0,0,0,this.p.y||0,0,0])}};this.Type.matrix=function(b){this.m=a.ToNumberArray(b);this.apply=function(b){b.transform(this.m[0],this.m[1],this.m[2],this.m[3],this.m[4],this.m[5])};this.applyToPoint=function(b){b.applyTransform(this.m)}};this.Type.SkewBase=function(b){this.base=d.Type.matrix;this.base(b);this.angle=
|
||||
new a.Property("angle",b)};this.Type.SkewBase.prototype=new this.Type.matrix;this.Type.skewX=function(b){this.base=d.Type.SkewBase;this.base(b);this.m=[1,0,Math.tan(this.angle.Angle.toRadians()),1,0,0]};this.Type.skewX.prototype=new this.Type.SkewBase;this.Type.skewY=function(b){this.base=d.Type.SkewBase;this.base(b);this.m=[1,Math.tan(this.angle.Angle.toRadians()),0,1,0,0]};this.Type.skewY.prototype=new this.Type.SkewBase;this.transforms=[];this.apply=function(b){for(var a=0;a<this.transforms.length;a++)this.transforms[a].apply(b)};
|
||||
this.applyToPoint=function(b){for(var a=0;a<this.transforms.length;a++)this.transforms[a].applyToPoint(b)};for(var c=a.trim(a.compressSpaces(c)).split(/\s(?=[a-z])/),b=0;b<c.length;b++){var k=c[b].split("(")[0],e=c[b].split("(")[1].replace(")","");this.transforms.push(new this.Type[k](e))}};a.AspectRatio=function(c,d,b,k,e,f,g,h,j,l){var d=a.compressSpaces(d),d=d.replace(/^defer\s/,""),o=d.split(" ")[0]||"xMidYMid",d=d.split(" ")[1]||"meet",n=b/k,q=e/f,p=Math.min(n,q),m=Math.max(n,q);d=="meet"&&(k*=
|
||||
p,f*=p);d=="slice"&&(k*=m,f*=m);j=new a.Property("refX",j);l=new a.Property("refY",l);j.hasValue()&&l.hasValue()?c.translate(-p*j.Length.toPixels("x"),-p*l.Length.toPixels("y")):(o.match(/^xMid/)&&(d=="meet"&&p==q||d=="slice"&&m==q)&&c.translate(b/2-k/2,0),o.match(/YMid$/)&&(d=="meet"&&p==n||d=="slice"&&m==n)&&c.translate(0,e/2-f/2),o.match(/^xMax/)&&(d=="meet"&&p==q||d=="slice"&&m==q)&&c.translate(b-k,0),o.match(/YMax$/)&&(d=="meet"&&p==n||d=="slice"&&m==n)&&c.translate(0,e-f));o=="none"?c.scale(n,
|
||||
q):d=="meet"?c.scale(p,p):d=="slice"&&c.scale(m,m);c.translate(g==null?0:-g,h==null?0:-h)};a.Element={};a.Element.ElementBase=function(c){this.attributes={};this.styles={};this.children=[];this.attribute=function(b,d){var c=this.attributes[b];if(c!=null)return c;c=new a.Property(b,"");d==!0&&(this.attributes[b]=c);return c};this.style=function(b,d){var c=this.styles[b];if(c!=null)return c;c=this.attribute(b);if(c!=null&&c.hasValue())return c;c=this.parent;if(c!=null&&(c=c.style(b),c!=null&&c.hasValue()))return c;
|
||||
c=new a.Property(b,"");d==!0&&(this.styles[b]=c);return c};this.render=function(b){if(this.style("display").value!="none"&&this.attribute("visibility").value!="hidden"){b.save();this.setContext(b);if(this.attribute("mask").hasValue()){var a=this.attribute("mask").Definition.getDefinition();a!=null&&a.apply(b,this)}else this.style("filter").hasValue()?(a=this.style("filter").Definition.getDefinition(),a!=null&&a.apply(b,this)):this.renderChildren(b);this.clearContext(b);b.restore()}};this.setContext=
|
||||
function(){};this.clearContext=function(){};this.renderChildren=function(b){for(var a=0;a<this.children.length;a++)this.children[a].render(b)};this.addChild=function(b,d){var c=b;d&&(c=a.CreateElement(b));c.parent=this;this.children.push(c)};if(c!=null&&c.nodeType==1){for(var d=0;d<c.childNodes.length;d++){var b=c.childNodes[d];b.nodeType==1&&this.addChild(b,!0)}for(d=0;d<c.attributes.length;d++)b=c.attributes[d],this.attributes[b.nodeName]=new a.Property(b.nodeName,b.nodeValue);b=a.Styles[c.nodeName];
|
||||
if(b!=null)for(var k in b)this.styles[k]=b[k];if(this.attribute("class").hasValue())for(var d=a.compressSpaces(this.attribute("class").value).split(" "),e=0;e<d.length;e++){b=a.Styles["."+d[e]];if(b!=null)for(k in b)this.styles[k]=b[k];b=a.Styles[c.nodeName+"."+d[e]];if(b!=null)for(k in b)this.styles[k]=b[k]}if(this.attribute("style").hasValue()){b=this.attribute("style").value.split(";");for(d=0;d<b.length;d++)a.trim(b[d])!=""&&(c=b[d].split(":"),k=a.trim(c[0]),c=a.trim(c[1]),this.styles[k]=new a.Property(k,
|
||||
c))}this.attribute("id").hasValue()&&a.Definitions[this.attribute("id").value]==null&&(a.Definitions[this.attribute("id").value]=this)}};a.Element.RenderedElementBase=function(c){this.base=a.Element.ElementBase;this.base(c);this.setContext=function(d){if(this.style("fill").Definition.isUrl()){var b=this.style("fill").Definition.getFillStyle(this);if(b!=null)d.fillStyle=b}else if(this.style("fill").hasValue())b=this.style("fill"),this.style("fill-opacity").hasValue()&&(b=b.Color.addOpacity(this.style("fill-opacity").value)),
|
||||
d.fillStyle=b.value=="none"?"rgba(0,0,0,0)":b.value;if(this.style("stroke").Definition.isUrl()){if(b=this.style("stroke").Definition.getFillStyle(this),b!=null)d.strokeStyle=b}else if(this.style("stroke").hasValue())b=this.style("stroke"),this.style("stroke-opacity").hasValue()&&(b=b.Color.addOpacity(this.style("stroke-opacity").value)),d.strokeStyle=b.value=="none"?"rgba(0,0,0,0)":b.value;if(this.style("stroke-width").hasValue())d.lineWidth=this.style("stroke-width").Length.toPixels();if(this.style("stroke-linecap").hasValue())d.lineCap=
|
||||
this.style("stroke-linecap").value;if(this.style("stroke-linejoin").hasValue())d.lineJoin=this.style("stroke-linejoin").value;if(this.style("stroke-miterlimit").hasValue())d.miterLimit=this.style("stroke-miterlimit").value;if(typeof d.font!="undefined")d.font=a.Font.CreateFont(this.style("font-style").value,this.style("font-variant").value,this.style("font-weight").value,this.style("font-size").hasValue()?this.style("font-size").Length.toPixels()+"px":"",this.style("font-family").value).toString();
|
||||
this.attribute("transform").hasValue()&&(new a.Transform(this.attribute("transform").value)).apply(d);this.attribute("clip-path").hasValue()&&(b=this.attribute("clip-path").Definition.getDefinition(),b!=null&&b.apply(d));if(this.style("opacity").hasValue())d.globalAlpha=this.style("opacity").numValue()}};a.Element.RenderedElementBase.prototype=new a.Element.ElementBase;a.Element.PathElementBase=function(c){this.base=a.Element.RenderedElementBase;this.base(c);this.path=function(d){d!=null&&d.beginPath();
|
||||
return new a.BoundingBox};this.renderChildren=function(d){this.path(d);a.Mouse.checkPath(this,d);d.fillStyle!=""&&d.fill();d.strokeStyle!=""&&d.stroke();var b=this.getMarkers();if(b!=null){if(this.style("marker-start").Definition.isUrl()){var c=this.style("marker-start").Definition.getDefinition();c.render(d,b[0][0],b[0][1])}if(this.style("marker-mid").Definition.isUrl())for(var c=this.style("marker-mid").Definition.getDefinition(),e=1;e<b.length-1;e++)c.render(d,b[e][0],b[e][1]);this.style("marker-end").Definition.isUrl()&&
|
||||
(c=this.style("marker-end").Definition.getDefinition(),c.render(d,b[b.length-1][0],b[b.length-1][1]))}};this.getBoundingBox=function(){return this.path()};this.getMarkers=function(){return null}};a.Element.PathElementBase.prototype=new a.Element.RenderedElementBase;a.Element.svg=function(c){this.base=a.Element.RenderedElementBase;this.base(c);this.baseClearContext=this.clearContext;this.clearContext=function(d){this.baseClearContext(d);a.ViewPort.RemoveCurrent()};this.baseSetContext=this.setContext;
|
||||
this.setContext=function(d){d.strokeStyle="rgba(0,0,0,0)";d.lineCap="butt";d.lineJoin="miter";d.miterLimit=4;this.baseSetContext(d);this.attribute("x").hasValue()&&this.attribute("y").hasValue()&&d.translate(this.attribute("x").Length.toPixels("x"),this.attribute("y").Length.toPixels("y"));var b=a.ViewPort.width(),c=a.ViewPort.height();if(typeof this.root=="undefined"&&this.attribute("width").hasValue()&&this.attribute("height").hasValue()){var b=this.attribute("width").Length.toPixels("x"),c=this.attribute("height").Length.toPixels("y"),
|
||||
e=0,f=0;this.attribute("refX").hasValue()&&this.attribute("refY").hasValue()&&(e=-this.attribute("refX").Length.toPixels("x"),f=-this.attribute("refY").Length.toPixels("y"));d.beginPath();d.moveTo(e,f);d.lineTo(b,f);d.lineTo(b,c);d.lineTo(e,c);d.closePath();d.clip()}a.ViewPort.SetCurrent(b,c);if(this.attribute("viewBox").hasValue()){var e=a.ToNumberArray(this.attribute("viewBox").value),f=e[0],g=e[1],b=e[2],c=e[3];a.AspectRatio(d,this.attribute("preserveAspectRatio").value,a.ViewPort.width(),b,a.ViewPort.height(),
|
||||
c,f,g,this.attribute("refX").value,this.attribute("refY").value);a.ViewPort.RemoveCurrent();a.ViewPort.SetCurrent(e[2],e[3])}}};a.Element.svg.prototype=new a.Element.RenderedElementBase;a.Element.rect=function(c){this.base=a.Element.PathElementBase;this.base(c);this.path=function(d){var b=this.attribute("x").Length.toPixels("x"),c=this.attribute("y").Length.toPixels("y"),e=this.attribute("width").Length.toPixels("x"),f=this.attribute("height").Length.toPixels("y"),g=this.attribute("rx").Length.toPixels("x"),
|
||||
h=this.attribute("ry").Length.toPixels("y");this.attribute("rx").hasValue()&&!this.attribute("ry").hasValue()&&(h=g);this.attribute("ry").hasValue()&&!this.attribute("rx").hasValue()&&(g=h);d!=null&&(d.beginPath(),d.moveTo(b+g,c),d.lineTo(b+e-g,c),d.quadraticCurveTo(b+e,c,b+e,c+h),d.lineTo(b+e,c+f-h),d.quadraticCurveTo(b+e,c+f,b+e-g,c+f),d.lineTo(b+g,c+f),d.quadraticCurveTo(b,c+f,b,c+f-h),d.lineTo(b,c+h),d.quadraticCurveTo(b,c,b+g,c),d.closePath());return new a.BoundingBox(b,c,b+e,c+f)}};a.Element.rect.prototype=
|
||||
new a.Element.PathElementBase;a.Element.circle=function(c){this.base=a.Element.PathElementBase;this.base(c);this.path=function(d){var b=this.attribute("cx").Length.toPixels("x"),c=this.attribute("cy").Length.toPixels("y"),e=this.attribute("r").Length.toPixels();d!=null&&(d.beginPath(),d.arc(b,c,e,0,Math.PI*2,!0),d.closePath());return new a.BoundingBox(b-e,c-e,b+e,c+e)}};a.Element.circle.prototype=new a.Element.PathElementBase;a.Element.ellipse=function(c){this.base=a.Element.PathElementBase;this.base(c);
|
||||
this.path=function(d){var b=4*((Math.sqrt(2)-1)/3),c=this.attribute("rx").Length.toPixels("x"),e=this.attribute("ry").Length.toPixels("y"),f=this.attribute("cx").Length.toPixels("x"),g=this.attribute("cy").Length.toPixels("y");d!=null&&(d.beginPath(),d.moveTo(f,g-e),d.bezierCurveTo(f+b*c,g-e,f+c,g-b*e,f+c,g),d.bezierCurveTo(f+c,g+b*e,f+b*c,g+e,f,g+e),d.bezierCurveTo(f-b*c,g+e,f-c,g+b*e,f-c,g),d.bezierCurveTo(f-c,g-b*e,f-b*c,g-e,f,g-e),d.closePath());return new a.BoundingBox(f-c,g-e,f+c,g+e)}};a.Element.ellipse.prototype=
|
||||
new a.Element.PathElementBase;a.Element.line=function(c){this.base=a.Element.PathElementBase;this.base(c);this.getPoints=function(){return[new a.Point(this.attribute("x1").Length.toPixels("x"),this.attribute("y1").Length.toPixels("y")),new a.Point(this.attribute("x2").Length.toPixels("x"),this.attribute("y2").Length.toPixels("y"))]};this.path=function(d){var b=this.getPoints();d!=null&&(d.beginPath(),d.moveTo(b[0].x,b[0].y),d.lineTo(b[1].x,b[1].y));return new a.BoundingBox(b[0].x,b[0].y,b[1].x,b[1].y)};
|
||||
this.getMarkers=function(){var a=this.getPoints(),b=a[0].angleTo(a[1]);return[[a[0],b],[a[1],b]]}};a.Element.line.prototype=new a.Element.PathElementBase;a.Element.polyline=function(c){this.base=a.Element.PathElementBase;this.base(c);this.points=a.CreatePath(this.attribute("points").value);this.path=function(d){var b=new a.BoundingBox(this.points[0].x,this.points[0].y);d!=null&&(d.beginPath(),d.moveTo(this.points[0].x,this.points[0].y));for(var c=1;c<this.points.length;c++)b.addPoint(this.points[c].x,
|
||||
this.points[c].y),d!=null&&d.lineTo(this.points[c].x,this.points[c].y);return b};this.getMarkers=function(){for(var a=[],b=0;b<this.points.length-1;b++)a.push([this.points[b],this.points[b].angleTo(this.points[b+1])]);a.push([this.points[this.points.length-1],a[a.length-1][1]]);return a}};a.Element.polyline.prototype=new a.Element.PathElementBase;a.Element.polygon=function(c){this.base=a.Element.polyline;this.base(c);this.basePath=this.path;this.path=function(a){var b=this.basePath(a);a!=null&&(a.lineTo(this.points[0].x,
|
||||
this.points[0].y),a.closePath());return b}};a.Element.polygon.prototype=new a.Element.polyline;a.Element.path=function(c){this.base=a.Element.PathElementBase;this.base(c);c=this.attribute("d").value;c=c.replace(/,/gm," ");c=c.replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");c=c.replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");c=c.replace(/([MmZzLlHhVvCcSsQqTtAa])([^\s])/gm,"$1 $2");c=c.replace(/([^\s])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");c=c.replace(/([0-9])([+\-])/gm,
|
||||
"$1 $2");c=c.replace(/(\.[0-9]*)(\.)/gm,"$1 $2");c=c.replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm,"$1 $3 $4 ");c=a.compressSpaces(c);c=a.trim(c);this.PathParser=new function(d){this.tokens=d.split(" ");this.reset=function(){this.i=-1;this.previousCommand=this.command="";this.start=new a.Point(0,0);this.control=new a.Point(0,0);this.current=new a.Point(0,0);this.points=[];this.angles=[]};this.isEnd=function(){return this.i>=this.tokens.length-1};this.isCommandOrEnd=function(){return this.isEnd()?
|
||||
!0:this.tokens[this.i+1].match(/^[A-Za-z]$/)!=null};this.isRelativeCommand=function(){return this.command==this.command.toLowerCase()};this.getToken=function(){this.i+=1;return this.tokens[this.i]};this.getScalar=function(){return parseFloat(this.getToken())};this.nextCommand=function(){this.previousCommand=this.command;this.command=this.getToken()};this.getPoint=function(){return this.makeAbsolute(new a.Point(this.getScalar(),this.getScalar()))};this.getAsControlPoint=function(){var b=this.getPoint();
|
||||
return this.control=b};this.getAsCurrentPoint=function(){var b=this.getPoint();return this.current=b};this.getReflectedControlPoint=function(){return this.previousCommand.toLowerCase()!="c"&&this.previousCommand.toLowerCase()!="s"?this.current:new a.Point(2*this.current.x-this.control.x,2*this.current.y-this.control.y)};this.makeAbsolute=function(b){if(this.isRelativeCommand())b.x=this.current.x+b.x,b.y=this.current.y+b.y;return b};this.addMarker=function(b,a,d){d!=null&&this.angles.length>0&&this.angles[this.angles.length-
|
||||
1]==null&&(this.angles[this.angles.length-1]=this.points[this.points.length-1].angleTo(d));this.addMarkerAngle(b,a==null?null:a.angleTo(b))};this.addMarkerAngle=function(b,a){this.points.push(b);this.angles.push(a)};this.getMarkerPoints=function(){return this.points};this.getMarkerAngles=function(){for(var b=0;b<this.angles.length;b++)if(this.angles[b]==null)for(var a=b+1;a<this.angles.length;a++)if(this.angles[a]!=null){this.angles[b]=this.angles[a];break}return this.angles}}(c);this.path=function(d){var b=
|
||||
this.PathParser;b.reset();var c=new a.BoundingBox;for(d!=null&&d.beginPath();!b.isEnd();)switch(b.nextCommand(),b.command.toUpperCase()){case "M":var e=b.getAsCurrentPoint();b.addMarker(e);c.addPoint(e.x,e.y);d!=null&&d.moveTo(e.x,e.y);for(b.start=b.current;!b.isCommandOrEnd();)e=b.getAsCurrentPoint(),b.addMarker(e,b.start),c.addPoint(e.x,e.y),d!=null&&d.lineTo(e.x,e.y);break;case "L":for(;!b.isCommandOrEnd();){var f=b.current,e=b.getAsCurrentPoint();b.addMarker(e,f);c.addPoint(e.x,e.y);d!=null&&
|
||||
d.lineTo(e.x,e.y)}break;case "H":for(;!b.isCommandOrEnd();)e=new a.Point((b.isRelativeCommand()?b.current.x:0)+b.getScalar(),b.current.y),b.addMarker(e,b.current),b.current=e,c.addPoint(b.current.x,b.current.y),d!=null&&d.lineTo(b.current.x,b.current.y);break;case "V":for(;!b.isCommandOrEnd();)e=new a.Point(b.current.x,(b.isRelativeCommand()?b.current.y:0)+b.getScalar()),b.addMarker(e,b.current),b.current=e,c.addPoint(b.current.x,b.current.y),d!=null&&d.lineTo(b.current.x,b.current.y);break;case "C":for(;!b.isCommandOrEnd();){var g=
|
||||
b.current,f=b.getPoint(),h=b.getAsControlPoint(),e=b.getAsCurrentPoint();b.addMarker(e,h,f);c.addBezierCurve(g.x,g.y,f.x,f.y,h.x,h.y,e.x,e.y);d!=null&&d.bezierCurveTo(f.x,f.y,h.x,h.y,e.x,e.y)}break;case "S":for(;!b.isCommandOrEnd();)g=b.current,f=b.getReflectedControlPoint(),h=b.getAsControlPoint(),e=b.getAsCurrentPoint(),b.addMarker(e,h,f),c.addBezierCurve(g.x,g.y,f.x,f.y,h.x,h.y,e.x,e.y),d!=null&&d.bezierCurveTo(f.x,f.y,h.x,h.y,e.x,e.y);break;case "Q":for(;!b.isCommandOrEnd();)g=b.current,h=b.getAsControlPoint(),
|
||||
e=b.getAsCurrentPoint(),b.addMarker(e,h,h),c.addQuadraticCurve(g.x,g.y,h.x,h.y,e.x,e.y),d!=null&&d.quadraticCurveTo(h.x,h.y,e.x,e.y);break;case "T":for(;!b.isCommandOrEnd();)g=b.current,h=b.getReflectedControlPoint(),b.control=h,e=b.getAsCurrentPoint(),b.addMarker(e,h,h),c.addQuadraticCurve(g.x,g.y,h.x,h.y,e.x,e.y),d!=null&&d.quadraticCurveTo(h.x,h.y,e.x,e.y);break;case "A":for(;!b.isCommandOrEnd();){var g=b.current,j=b.getScalar(),l=b.getScalar(),f=b.getScalar()*(Math.PI/180),o=b.getScalar(),h=b.getScalar(),
|
||||
e=b.getAsCurrentPoint(),n=new a.Point(Math.cos(f)*(g.x-e.x)/2+Math.sin(f)*(g.y-e.y)/2,-Math.sin(f)*(g.x-e.x)/2+Math.cos(f)*(g.y-e.y)/2),q=Math.pow(n.x,2)/Math.pow(j,2)+Math.pow(n.y,2)/Math.pow(l,2);q>1&&(j*=Math.sqrt(q),l*=Math.sqrt(q));o=(o==h?-1:1)*Math.sqrt((Math.pow(j,2)*Math.pow(l,2)-Math.pow(j,2)*Math.pow(n.y,2)-Math.pow(l,2)*Math.pow(n.x,2))/(Math.pow(j,2)*Math.pow(n.y,2)+Math.pow(l,2)*Math.pow(n.x,2)));isNaN(o)&&(o=0);var p=new a.Point(o*j*n.y/l,o*-l*n.x/j),g=new a.Point((g.x+e.x)/2+Math.cos(f)*
|
||||
p.x-Math.sin(f)*p.y,(g.y+e.y)/2+Math.sin(f)*p.x+Math.cos(f)*p.y),m=function(b,a){return(b[0]*a[0]+b[1]*a[1])/(Math.sqrt(Math.pow(b[0],2)+Math.pow(b[1],2))*Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2)))},t=function(b,a){return(b[0]*a[1]<b[1]*a[0]?-1:1)*Math.acos(m(b,a))},o=t([1,0],[(n.x-p.x)/j,(n.y-p.y)/l]),q=[(n.x-p.x)/j,(n.y-p.y)/l],p=[(-n.x-p.x)/j,(-n.y-p.y)/l],n=t(q,p);if(m(q,p)<=-1)n=Math.PI;m(q,p)>=1&&(n=0);h==0&&n>0&&(n-=2*Math.PI);h==1&&n<0&&(n+=2*Math.PI);q=new a.Point(g.x-j*Math.cos((o+n)/
|
||||
2),g.y-l*Math.sin((o+n)/2));b.addMarkerAngle(q,(o+n)/2+(h==0?1:-1)*Math.PI/2);b.addMarkerAngle(e,n+(h==0?1:-1)*Math.PI/2);c.addPoint(e.x,e.y);d!=null&&(m=j>l?j:l,e=j>l?1:j/l,j=j>l?l/j:1,d.translate(g.x,g.y),d.rotate(f),d.scale(e,j),d.arc(0,0,m,o,o+n,1-h),d.scale(1/e,1/j),d.rotate(-f),d.translate(-g.x,-g.y))}break;case "Z":d!=null&&d.closePath(),b.current=b.start}return c};this.getMarkers=function(){for(var a=this.PathParser.getMarkerPoints(),b=this.PathParser.getMarkerAngles(),c=[],e=0;e<a.length;e++)c.push([a[e],
|
||||
b[e]]);return c}};a.Element.path.prototype=new a.Element.PathElementBase;a.Element.pattern=function(c){this.base=a.Element.ElementBase;this.base(c);this.createPattern=function(d){var b=new a.Element.svg;b.attributes.viewBox=new a.Property("viewBox",this.attribute("viewBox").value);b.attributes.x=new a.Property("x",this.attribute("x").value);b.attributes.y=new a.Property("y",this.attribute("y").value);b.attributes.width=new a.Property("width",this.attribute("width").value);b.attributes.height=new a.Property("height",
|
||||
this.attribute("height").value);b.children=this.children;var c=document.createElement("canvas");c.width=this.attribute("width").Length.toPixels("x");c.height=this.attribute("height").Length.toPixels("y");b.render(c.getContext("2d"));return d.createPattern(c,"repeat")}};a.Element.pattern.prototype=new a.Element.ElementBase;a.Element.marker=function(c){this.base=a.Element.ElementBase;this.base(c);this.baseRender=this.render;this.render=function(d,b,c){d.translate(b.x,b.y);this.attribute("orient").valueOrDefault("auto")==
|
||||
"auto"&&d.rotate(c);this.attribute("markerUnits").valueOrDefault("strokeWidth")=="strokeWidth"&&d.scale(d.lineWidth,d.lineWidth);d.save();var e=new a.Element.svg;e.attributes.viewBox=new a.Property("viewBox",this.attribute("viewBox").value);e.attributes.refX=new a.Property("refX",this.attribute("refX").value);e.attributes.refY=new a.Property("refY",this.attribute("refY").value);e.attributes.width=new a.Property("width",this.attribute("markerWidth").value);e.attributes.height=new a.Property("height",
|
||||
this.attribute("markerHeight").value);e.attributes.fill=new a.Property("fill",this.attribute("fill").valueOrDefault("black"));e.attributes.stroke=new a.Property("stroke",this.attribute("stroke").valueOrDefault("none"));e.children=this.children;e.render(d);d.restore();this.attribute("markerUnits").valueOrDefault("strokeWidth")=="strokeWidth"&&d.scale(1/d.lineWidth,1/d.lineWidth);this.attribute("orient").valueOrDefault("auto")=="auto"&&d.rotate(-c);d.translate(-b.x,-b.y)}};a.Element.marker.prototype=
|
||||
new a.Element.ElementBase;a.Element.defs=function(c){this.base=a.Element.ElementBase;this.base(c);this.render=function(){}};a.Element.defs.prototype=new a.Element.ElementBase;a.Element.GradientBase=function(c){this.base=a.Element.ElementBase;this.base(c);this.gradientUnits=this.attribute("gradientUnits").valueOrDefault("objectBoundingBox");this.stops=[];for(c=0;c<this.children.length;c++)this.stops.push(this.children[c]);this.getGradient=function(){};this.createGradient=function(d,b){var c=this;this.attribute("xlink:href").hasValue()&&
|
||||
(c=this.attribute("xlink:href").Definition.getDefinition());for(var e=this.getGradient(d,b),f=0;f<c.stops.length;f++)e.addColorStop(c.stops[f].offset,c.stops[f].color);if(this.attribute("gradientTransform").hasValue()){c=a.ViewPort.viewPorts[0];f=new a.Element.rect;f.attributes.x=new a.Property("x",-a.MAX_VIRTUAL_PIXELS/3);f.attributes.y=new a.Property("y",-a.MAX_VIRTUAL_PIXELS/3);f.attributes.width=new a.Property("width",a.MAX_VIRTUAL_PIXELS);f.attributes.height=new a.Property("height",a.MAX_VIRTUAL_PIXELS);
|
||||
var g=new a.Element.g;g.attributes.transform=new a.Property("transform",this.attribute("gradientTransform").value);g.children=[f];f=new a.Element.svg;f.attributes.x=new a.Property("x",0);f.attributes.y=new a.Property("y",0);f.attributes.width=new a.Property("width",c.width);f.attributes.height=new a.Property("height",c.height);f.children=[g];g=document.createElement("canvas");g.width=c.width;g.height=c.height;c=g.getContext("2d");c.fillStyle=e;f.render(c);return c.createPattern(g,"no-repeat")}return e}};
|
||||
a.Element.GradientBase.prototype=new a.Element.ElementBase;a.Element.linearGradient=function(c){this.base=a.Element.GradientBase;this.base(c);this.getGradient=function(a,b){var c=b.getBoundingBox(),e=this.gradientUnits=="objectBoundingBox"?c.x()+c.width()*this.attribute("x1").numValue():this.attribute("x1").Length.toPixels("x"),f=this.gradientUnits=="objectBoundingBox"?c.y()+c.height()*this.attribute("y1").numValue():this.attribute("y1").Length.toPixels("y"),g=this.gradientUnits=="objectBoundingBox"?
|
||||
c.x()+c.width()*this.attribute("x2").numValue():this.attribute("x2").Length.toPixels("x"),c=this.gradientUnits=="objectBoundingBox"?c.y()+c.height()*this.attribute("y2").numValue():this.attribute("y2").Length.toPixels("y");return a.createLinearGradient(e,f,g,c)}};a.Element.linearGradient.prototype=new a.Element.GradientBase;a.Element.radialGradient=function(c){this.base=a.Element.GradientBase;this.base(c);this.getGradient=function(a,b){var c=b.getBoundingBox(),e=this.gradientUnits=="objectBoundingBox"?
|
||||
c.x()+c.width()*this.attribute("cx").numValue():this.attribute("cx").Length.toPixels("x"),f=this.gradientUnits=="objectBoundingBox"?c.y()+c.height()*this.attribute("cy").numValue():this.attribute("cy").Length.toPixels("y"),g=e,h=f;this.attribute("fx").hasValue()&&(g=this.gradientUnits=="objectBoundingBox"?c.x()+c.width()*this.attribute("fx").numValue():this.attribute("fx").Length.toPixels("x"));this.attribute("fy").hasValue()&&(h=this.gradientUnits=="objectBoundingBox"?c.y()+c.height()*this.attribute("fy").numValue():
|
||||
this.attribute("fy").Length.toPixels("y"));c=this.gradientUnits=="objectBoundingBox"?(c.width()+c.height())/2*this.attribute("r").numValue():this.attribute("r").Length.toPixels();return a.createRadialGradient(g,h,0,e,f,c)}};a.Element.radialGradient.prototype=new a.Element.GradientBase;a.Element.stop=function(c){this.base=a.Element.ElementBase;this.base(c);this.offset=this.attribute("offset").numValue();c=this.style("stop-color");this.style("stop-opacity").hasValue()&&(c=c.Color.addOpacity(this.style("stop-opacity").value));
|
||||
this.color=c.value};a.Element.stop.prototype=new a.Element.ElementBase;a.Element.AnimateBase=function(c){this.base=a.Element.ElementBase;this.base(c);a.Animations.push(this);this.duration=0;this.begin=this.attribute("begin").Time.toMilliseconds();this.maxDuration=this.begin+this.attribute("dur").Time.toMilliseconds();this.getProperty=function(){var a=this.attribute("attributeType").value,b=this.attribute("attributeName").value;return a=="CSS"?this.parent.style(b,!0):this.parent.attribute(b,!0)};this.initialValue=
|
||||
null;this.removed=!1;this.calcValue=function(){return""};this.update=function(a){if(this.initialValue==null)this.initialValue=this.getProperty().value;if(this.duration>this.maxDuration)if(this.attribute("repeatCount").value=="indefinite")this.duration=0;else return this.attribute("fill").valueOrDefault("remove")=="remove"&&!this.removed?(this.removed=!0,this.getProperty().value=this.initialValue,!0):!1;this.duration+=a;a=!1;if(this.begin<this.duration)a=this.calcValue(),this.attribute("type").hasValue()&&
|
||||
(a=this.attribute("type").value+"("+a+")"),this.getProperty().value=a,a=!0;return a};this.progress=function(){return(this.duration-this.begin)/(this.maxDuration-this.begin)}};a.Element.AnimateBase.prototype=new a.Element.ElementBase;a.Element.animate=function(c){this.base=a.Element.AnimateBase;this.base(c);this.calcValue=function(){var a=this.attribute("from").numValue(),b=this.attribute("to").numValue();return a+(b-a)*this.progress()}};a.Element.animate.prototype=new a.Element.AnimateBase;a.Element.animateColor=
|
||||
function(c){this.base=a.Element.AnimateBase;this.base(c);this.calcValue=function(){var a=new RGBColor(this.attribute("from").value),b=new RGBColor(this.attribute("to").value);if(a.ok&&b.ok){var c=a.r+(b.r-a.r)*this.progress(),e=a.g+(b.g-a.g)*this.progress(),a=a.b+(b.b-a.b)*this.progress();return"rgb("+parseInt(c,10)+","+parseInt(e,10)+","+parseInt(a,10)+")"}return this.attribute("from").value}};a.Element.animateColor.prototype=new a.Element.AnimateBase;a.Element.animateTransform=function(c){this.base=
|
||||
a.Element.animate;this.base(c)};a.Element.animateTransform.prototype=new a.Element.animate;a.Element.font=function(c){this.base=a.Element.ElementBase;this.base(c);this.horizAdvX=this.attribute("horiz-adv-x").numValue();this.isArabic=this.isRTL=!1;this.missingGlyph=this.fontFace=null;this.glyphs=[];for(c=0;c<this.children.length;c++){var d=this.children[c];if(d.type=="font-face")this.fontFace=d,d.style("font-family").hasValue()&&(a.Definitions[d.style("font-family").value]=this);else if(d.type=="missing-glyph")this.missingGlyph=
|
||||
d;else if(d.type=="glyph")d.arabicForm!=""?(this.isArabic=this.isRTL=!0,typeof this.glyphs[d.unicode]=="undefined"&&(this.glyphs[d.unicode]=[]),this.glyphs[d.unicode][d.arabicForm]=d):this.glyphs[d.unicode]=d}};a.Element.font.prototype=new a.Element.ElementBase;a.Element.fontface=function(c){this.base=a.Element.ElementBase;this.base(c);this.ascent=this.attribute("ascent").value;this.descent=this.attribute("descent").value;this.unitsPerEm=this.attribute("units-per-em").numValue()};a.Element.fontface.prototype=
|
||||
new a.Element.ElementBase;a.Element.missingglyph=function(c){this.base=a.Element.path;this.base(c);this.horizAdvX=0};a.Element.missingglyph.prototype=new a.Element.path;a.Element.glyph=function(c){this.base=a.Element.path;this.base(c);this.horizAdvX=this.attribute("horiz-adv-x").numValue();this.unicode=this.attribute("unicode").value;this.arabicForm=this.attribute("arabic-form").value};a.Element.glyph.prototype=new a.Element.path;a.Element.text=function(c){this.base=a.Element.RenderedElementBase;
|
||||
this.base(c);if(c!=null){this.children=[];for(var d=0;d<c.childNodes.length;d++){var b=c.childNodes[d];b.nodeType==1?this.addChild(b,!0):b.nodeType==3&&this.addChild(new a.Element.tspan(b),!1)}}this.baseSetContext=this.setContext;this.setContext=function(b){this.baseSetContext(b);if(this.style("dominant-baseline").hasValue())b.textBaseline=this.style("dominant-baseline").value;if(this.style("alignment-baseline").hasValue())b.textBaseline=this.style("alignment-baseline").value};this.renderChildren=
|
||||
function(b){for(var a=this.style("text-anchor").valueOrDefault("start"),c=this.attribute("x").Length.toPixels("x"),d=this.attribute("y").Length.toPixels("y"),h=0;h<this.children.length;h++){var j=this.children[h];j.attribute("x").hasValue()?j.x=j.attribute("x").Length.toPixels("x"):(j.attribute("dx").hasValue()&&(c+=j.attribute("dx").Length.toPixels("x")),j.x=c);c=j.measureText(b);if(a!="start"&&(h==0||j.attribute("x").hasValue())){for(var l=c,o=h+1;o<this.children.length;o++){var n=this.children[o];
|
||||
if(n.attribute("x").hasValue())break;l+=n.measureText(b)}j.x-=a=="end"?l:l/2}c=j.x+c;j.attribute("y").hasValue()?j.y=j.attribute("y").Length.toPixels("y"):(j.attribute("dy").hasValue()&&(d+=j.attribute("dy").Length.toPixels("y")),j.y=d);d=j.y;j.render(b)}}};a.Element.text.prototype=new a.Element.RenderedElementBase;a.Element.TextElementBase=function(c){this.base=a.Element.RenderedElementBase;this.base(c);this.getGlyph=function(a,b,c){var e=b[c],f=null;if(a.isArabic){var g="isolated";if((c==0||b[c-
|
||||
1]==" ")&&c<b.length-2&&b[c+1]!=" ")g="terminal";c>0&&b[c-1]!=" "&&c<b.length-2&&b[c+1]!=" "&&(g="medial");if(c>0&&b[c-1]!=" "&&(c==b.length-1||b[c+1]==" "))g="initial";typeof a.glyphs[e]!="undefined"&&(f=a.glyphs[e][g],f==null&&a.glyphs[e].type=="glyph"&&(f=a.glyphs[e]))}else f=a.glyphs[e];if(f==null)f=a.missingGlyph;return f};this.renderChildren=function(c){var b=this.parent.style("font-family").Definition.getDefinition();if(b!=null){var k=this.parent.style("font-size").numValueOrDefault(a.Font.Parse(a.ctx.font).fontSize),
|
||||
e=this.parent.style("font-style").valueOrDefault(a.Font.Parse(a.ctx.font).fontStyle),f=this.getText();b.isRTL&&(f=f.split("").reverse().join(""));for(var g=a.ToNumberArray(this.parent.attribute("dx").value),h=0;h<f.length;h++){var j=this.getGlyph(b,f,h),l=k/b.fontFace.unitsPerEm;c.translate(this.x,this.y);c.scale(l,-l);var o=c.lineWidth;c.lineWidth=c.lineWidth*b.fontFace.unitsPerEm/k;e=="italic"&&c.transform(1,0,0.4,1,0,0);j.render(c);e=="italic"&&c.transform(1,0,-0.4,1,0,0);c.lineWidth=o;c.scale(1/
|
||||
l,-1/l);c.translate(-this.x,-this.y);this.x+=k*(j.horizAdvX||b.horizAdvX)/b.fontFace.unitsPerEm;typeof g[h]!="undefined"&&!isNaN(g[h])&&(this.x+=g[h])}}else c.strokeStyle!=""&&c.strokeText(a.compressSpaces(this.getText()),this.x,this.y),c.fillStyle!=""&&c.fillText(a.compressSpaces(this.getText()),this.x,this.y)};this.getText=function(){};this.measureText=function(c){var b=this.parent.style("font-family").Definition.getDefinition();if(b!=null){var c=this.parent.style("font-size").numValueOrDefault(a.Font.Parse(a.ctx.font).fontSize),
|
||||
k=0,e=this.getText();b.isRTL&&(e=e.split("").reverse().join(""));for(var f=a.ToNumberArray(this.parent.attribute("dx").value),g=0;g<e.length;g++){var h=this.getGlyph(b,e,g);k+=(h.horizAdvX||b.horizAdvX)*c/b.fontFace.unitsPerEm;typeof f[g]!="undefined"&&!isNaN(f[g])&&(k+=f[g])}return k}b=a.compressSpaces(this.getText());if(!c.measureText)return b.length*10;c.save();this.setContext(c);b=c.measureText(b).width;c.restore();return b}};a.Element.TextElementBase.prototype=new a.Element.RenderedElementBase;
|
||||
a.Element.tspan=function(c){this.base=a.Element.TextElementBase;this.base(c);this.text=c.nodeType==3?c.nodeValue:c.childNodes.length>0?c.childNodes[0].nodeValue:c.text;this.getText=function(){return this.text}};a.Element.tspan.prototype=new a.Element.TextElementBase;a.Element.tref=function(c){this.base=a.Element.TextElementBase;this.base(c);this.getText=function(){var a=this.attribute("xlink:href").Definition.getDefinition();if(a!=null)return a.children[0].getText()}};a.Element.tref.prototype=new a.Element.TextElementBase;
|
||||
a.Element.a=function(c){this.base=a.Element.TextElementBase;this.base(c);this.hasText=!0;for(var d=0;d<c.childNodes.length;d++)if(c.childNodes[d].nodeType!=3)this.hasText=!1;this.text=this.hasText?c.childNodes[0].nodeValue:"";this.getText=function(){return this.text};this.baseRenderChildren=this.renderChildren;this.renderChildren=function(b){if(this.hasText){this.baseRenderChildren(b);var c=new a.Property("fontSize",a.Font.Parse(a.ctx.font).fontSize);a.Mouse.checkBoundingBox(this,new a.BoundingBox(this.x,
|
||||
this.y-c.Length.toPixels("y"),this.x+this.measureText(b),this.y))}else c=new a.Element.g,c.children=this.children,c.parent=this,c.render(b)};this.onclick=function(){window.open(this.attribute("xlink:href").value)};this.onmousemove=function(){a.ctx.canvas.style.cursor="pointer"}};a.Element.a.prototype=new a.Element.TextElementBase;a.Element.image=function(c){this.base=a.Element.RenderedElementBase;this.base(c);a.Images.push(this);this.img=document.createElement("img");this.loaded=!1;var d=this;this.img.onload=
|
||||
function(){d.loaded=!0};this.img.src=this.attribute("xlink:href").value;this.renderChildren=function(b){var c=this.attribute("x").Length.toPixels("x"),d=this.attribute("y").Length.toPixels("y"),f=this.attribute("width").Length.toPixels("x"),g=this.attribute("height").Length.toPixels("y");f==0||g==0||(b.save(),b.translate(c,d),a.AspectRatio(b,this.attribute("preserveAspectRatio").value,f,this.img.width,g,this.img.height,0,0),b.drawImage(this.img,0,0),b.restore())}};a.Element.image.prototype=new a.Element.RenderedElementBase;
|
||||
a.Element.g=function(c){this.base=a.Element.RenderedElementBase;this.base(c);this.getBoundingBox=function(){for(var c=new a.BoundingBox,b=0;b<this.children.length;b++)c.addBoundingBox(this.children[b].getBoundingBox());return c}};a.Element.g.prototype=new a.Element.RenderedElementBase;a.Element.symbol=function(c){this.base=a.Element.RenderedElementBase;this.base(c);this.baseSetContext=this.setContext;this.setContext=function(c){this.baseSetContext(c);if(this.attribute("viewBox").hasValue()){var b=
|
||||
a.ToNumberArray(this.attribute("viewBox").value),k=b[0],e=b[1];width=b[2];height=b[3];a.AspectRatio(c,this.attribute("preserveAspectRatio").value,this.attribute("width").Length.toPixels("x"),width,this.attribute("height").Length.toPixels("y"),height,k,e);a.ViewPort.SetCurrent(b[2],b[3])}}};a.Element.symbol.prototype=new a.Element.RenderedElementBase;a.Element.style=function(c){this.base=a.Element.ElementBase;this.base(c);for(var c=c.childNodes[0].nodeValue+(c.childNodes.length>1?c.childNodes[1].nodeValue:
|
||||
""),c=c.replace(/(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,""),c=a.compressSpaces(c),c=c.split("}"),d=0;d<c.length;d++)if(a.trim(c[d])!="")for(var b=c[d].split("{"),k=b[0].split(","),b=b[1].split(";"),e=0;e<k.length;e++){var f=a.trim(k[e]);if(f!=""){for(var g={},h=0;h<b.length;h++){var j=b[h].indexOf(":"),l=b[h].substr(0,j),j=b[h].substr(j+1,b[h].length-j);l!=null&&j!=null&&(g[a.trim(l)]=new a.Property(a.trim(l),a.trim(j)))}a.Styles[f]=g;if(f=="@font-face"){f=g["font-family"].value.replace(/"/g,
|
||||
"");g=g.src.value.split(",");for(h=0;h<g.length;h++)if(g[h].indexOf('format("svg")')>0){l=g[h].indexOf("url");j=g[h].indexOf(")",l);l=g[h].substr(l+5,j-l-6);l=a.parseXml(a.ajax(l)).getElementsByTagName("font");for(j=0;j<l.length;j++){var o=a.CreateElement(l[j]);a.Definitions[f]=o}}}}}};a.Element.style.prototype=new a.Element.ElementBase;a.Element.use=function(c){this.base=a.Element.RenderedElementBase;this.base(c);this.baseSetContext=this.setContext;this.setContext=function(a){this.baseSetContext(a);
|
||||
this.attribute("x").hasValue()&&a.translate(this.attribute("x").Length.toPixels("x"),0);this.attribute("y").hasValue()&&a.translate(0,this.attribute("y").Length.toPixels("y"))};this.getDefinition=function(){var a=this.attribute("xlink:href").Definition.getDefinition();if(this.attribute("width").hasValue())a.attribute("width",!0).value=this.attribute("width").value;if(this.attribute("height").hasValue())a.attribute("height",!0).value=this.attribute("height").value;return a};this.path=function(a){var b=
|
||||
this.getDefinition();b!=null&&b.path(a)};this.renderChildren=function(a){var b=this.getDefinition();b!=null&&b.render(a)}};a.Element.use.prototype=new a.Element.RenderedElementBase;a.Element.mask=function(c){this.base=a.Element.ElementBase;this.base(c);this.apply=function(a,b){var c=this.attribute("x").Length.toPixels("x"),e=this.attribute("y").Length.toPixels("y"),f=this.attribute("width").Length.toPixels("x"),g=this.attribute("height").Length.toPixels("y"),h=b.attribute("mask").value;b.attribute("mask").value=
|
||||
"";var j=document.createElement("canvas");j.width=c+f;j.height=e+g;var l=j.getContext("2d");this.renderChildren(l);var o=document.createElement("canvas");o.width=c+f;o.height=e+g;var n=o.getContext("2d");b.render(n);n.globalCompositeOperation="destination-in";n.fillStyle=l.createPattern(j,"no-repeat");n.fillRect(0,0,c+f,e+g);a.fillStyle=n.createPattern(o,"no-repeat");a.fillRect(0,0,c+f,e+g);b.attribute("mask").value=h};this.render=function(){}};a.Element.mask.prototype=new a.Element.ElementBase;a.Element.clipPath=
|
||||
function(c){this.base=a.Element.ElementBase;this.base(c);this.apply=function(a){for(var b=0;b<this.children.length;b++)this.children[b].path&&(this.children[b].path(a),a.clip())};this.render=function(){}};a.Element.clipPath.prototype=new a.Element.ElementBase;a.Element.filter=function(c){this.base=a.Element.ElementBase;this.base(c);this.apply=function(a,b){var c=b.getBoundingBox(),e=this.attribute("x").Length.toPixels("x"),f=this.attribute("y").Length.toPixels("y");if(e==0||f==0)e=c.x1,f=c.y1;var g=
|
||||
this.attribute("width").Length.toPixels("x"),h=this.attribute("height").Length.toPixels("y");if(g==0||h==0)g=c.width(),h=c.height();c=b.style("filter").value;b.style("filter").value="";var j=0.2*g,l=0.2*h,o=document.createElement("canvas");o.width=g+2*j;o.height=h+2*l;var n=o.getContext("2d");n.translate(-e+j,-f+l);b.render(n);for(var q=0;q<this.children.length;q++)this.children[q].apply(n,0,0,g+2*j,h+2*l);a.drawImage(o,0,0,g+2*j,h+2*l,e-j,f-l,g+2*j,h+2*l);b.style("filter",!0).value=c};this.render=
|
||||
function(){}};a.Element.filter.prototype=new a.Element.ElementBase;a.Element.feGaussianBlur=function(c){function d(a,c,d,f,g){for(var h=0;h<g;h++)for(var j=0;j<f;j++)for(var l=a[h*f*4+j*4+3]/255,o=0;o<4;o++){for(var n=d[0]*(l==0?255:a[h*f*4+j*4+o])*(l==0||o==3?1:l),q=1;q<d.length;q++){var p=Math.max(j-q,0),m=a[h*f*4+p*4+3]/255,p=Math.min(j+q,f-1),p=a[h*f*4+p*4+3]/255,t=d[q],r;m==0?r=255:(r=Math.max(j-q,0),r=a[h*f*4+r*4+o]);m=r*(m==0||o==3?1:m);p==0?r=255:(r=Math.min(j+q,f-1),r=a[h*f*4+r*4+o]);n+=
|
||||
t*(m+r*(p==0||o==3?1:p))}c[j*g*4+h*4+o]=n}}this.base=a.Element.ElementBase;this.base(c);this.apply=function(a,c,e,f,g){var e=this.attribute("stdDeviation").numValue(),c=a.getImageData(0,0,f,g),e=Math.max(e,0.01),h=Math.ceil(e*4)+1;mask=[];for(var j=0;j<h;j++)mask[j]=Math.exp(-0.5*(j/e)*(j/e));e=mask;h=0;for(j=1;j<e.length;j++)h+=Math.abs(e[j]);h=2*h+Math.abs(e[0]);for(j=0;j<e.length;j++)e[j]/=h;tmp=[];d(c.data,tmp,e,f,g);d(tmp,c.data,e,g,f);a.clearRect(0,0,f,g);a.putImageData(c,0,0)}};a.Element.filter.prototype=
|
||||
new a.Element.feGaussianBlur;a.Element.title=function(){};a.Element.title.prototype=new a.Element.ElementBase;a.Element.desc=function(){};a.Element.desc.prototype=new a.Element.ElementBase;a.Element.MISSING=function(a){console.log("ERROR: Element '"+a.nodeName+"' not yet implemented.")};a.Element.MISSING.prototype=new a.Element.ElementBase;a.CreateElement=function(c){var d=c.nodeName.replace(/^[^:]+:/,""),d=d.replace(/\-/g,""),b=null,b=typeof a.Element[d]!="undefined"?new a.Element[d](c):new a.Element.MISSING(c);
|
||||
b.type=c.nodeName;return b};a.load=function(c,d){a.loadXml(c,a.ajax(d))};a.loadXml=function(c,d){a.loadXmlDoc(c,a.parseXml(d))};a.loadXmlDoc=function(c,d){a.init(c);var b=function(a){for(var b=c.canvas;b;)a.x-=b.offsetLeft,a.y-=b.offsetTop,b=b.offsetParent;window.scrollX&&(a.x+=window.scrollX);window.scrollY&&(a.y+=window.scrollY);return a};if(a.opts.ignoreMouse!=!0)c.canvas.onclick=function(c){c=b(new a.Point(c!=null?c.clientX:event.clientX,c!=null?c.clientY:event.clientY));a.Mouse.onclick(c.x,c.y)},
|
||||
c.canvas.onmousemove=function(c){c=b(new a.Point(c!=null?c.clientX:event.clientX,c!=null?c.clientY:event.clientY));a.Mouse.onmousemove(c.x,c.y)};var k=a.CreateElement(d.documentElement),e=k.root=!0,f=function(){a.ViewPort.Clear();c.canvas.parentNode&&a.ViewPort.SetCurrent(c.canvas.parentNode.clientWidth,c.canvas.parentNode.clientHeight);if(a.opts.ignoreDimensions!=!0){if(k.style("width").hasValue())c.canvas.width=k.style("width").Length.toPixels("x"),c.canvas.style.width=c.canvas.width+"px";if(k.style("height").hasValue())c.canvas.height=
|
||||
k.style("height").Length.toPixels("y"),c.canvas.style.height=c.canvas.height+"px"}var b=c.canvas.clientWidth||c.canvas.width,d=c.canvas.clientHeight||c.canvas.height;a.ViewPort.SetCurrent(b,d);if(a.opts!=null&&a.opts.offsetX!=null)k.attribute("x",!0).value=a.opts.offsetX;if(a.opts!=null&&a.opts.offsetY!=null)k.attribute("y",!0).value=a.opts.offsetY;if(a.opts!=null&&a.opts.scaleWidth!=null&&a.opts.scaleHeight!=null){var f=1,g=1;k.attribute("width").hasValue()&&(f=k.attribute("width").Length.toPixels("x")/
|
||||
a.opts.scaleWidth);k.attribute("height").hasValue()&&(g=k.attribute("height").Length.toPixels("y")/a.opts.scaleHeight);k.attribute("width",!0).value=a.opts.scaleWidth;k.attribute("height",!0).value=a.opts.scaleHeight;k.attribute("viewBox",!0).value="0 0 "+b*f+" "+d*g;k.attribute("preserveAspectRatio",!0).value="none"}a.opts.ignoreClear!=!0&&c.clearRect(0,0,b,d);k.render(c);e&&(e=!1,a.opts!=null&&typeof a.opts.renderCallback=="function"&&a.opts.renderCallback())},g=!0;a.ImagesLoaded()&&(g=!1,f());
|
||||
a.intervalID=setInterval(function(){var b=!1;g&&a.ImagesLoaded()&&(g=!1,b=!0);a.opts.ignoreMouse!=!0&&(b|=a.Mouse.hasEvents());if(a.opts.ignoreAnimation!=!0)for(var c=0;c<a.Animations.length;c++)b|=a.Animations[c].update(1E3/a.FRAMERATE);a.opts!=null&&typeof a.opts.forceRedraw=="function"&&a.opts.forceRedraw()==!0&&(b=!0);b&&(f(),a.Mouse.runEvents())},1E3/a.FRAMERATE)};a.stop=function(){a.intervalID&&clearInterval(a.intervalID)};a.Mouse=new function(){this.events=[];this.hasEvents=function(){return this.events.length!=
|
||||
0};this.onclick=function(a,d){this.events.push({type:"onclick",x:a,y:d,run:function(a){if(a.onclick)a.onclick()}})};this.onmousemove=function(a,d){this.events.push({type:"onmousemove",x:a,y:d,run:function(a){if(a.onmousemove)a.onmousemove()}})};this.eventElements=[];this.checkPath=function(a,d){for(var b=0;b<this.events.length;b++){var k=this.events[b];d.isPointInPath&&d.isPointInPath(k.x,k.y)&&(this.eventElements[b]=a)}};this.checkBoundingBox=function(a,d){for(var b=0;b<this.events.length;b++){var k=
|
||||
this.events[b];d.isPointInBox(k.x,k.y)&&(this.eventElements[b]=a)}};this.runEvents=function(){a.ctx.canvas.style.cursor="";for(var c=0;c<this.events.length;c++)for(var d=this.events[c],b=this.eventElements[c];b;)d.run(b),b=b.parent;this.events=[];this.eventElements=[]}};return a}this.canvg=function(a,c,d){if(a==null&&c==null&&d==null)for(var c=document.getElementsByTagName("svg"),b=0;b<c.length;b++){a=c[b];d=document.createElement("canvas");d.width=a.clientWidth;d.height=a.clientHeight;a.parentNode.insertBefore(d,
|
||||
a);a.parentNode.removeChild(a);var k=document.createElement("div");k.appendChild(a);canvg(d,k.innerHTML)}else d=d||{},typeof a=="string"&&(a=document.getElementById(a)),a.svg==null?(b=m(),a.svg=b):(b=a.svg,b.stop()),b.opts=d,a=a.getContext("2d"),typeof c.documentElement!="undefined"?b.loadXmlDoc(a,c):c.substr(0,1)=="<"?b.loadXml(a,c):b.load(a,c)}})();
|
||||
if(CanvasRenderingContext2D)CanvasRenderingContext2D.prototype.drawSvg=function(m,a,c,d,b){canvg(this.canvas,m,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:a,offsetY:c,scaleWidth:d,scaleHeight:b})};
|
||||
(function(m){var a=m.css,c=m.CanVGRenderer,d=m.SVGRenderer,b=m.extend,k=m.merge,e=m.addEvent,f=m.placeBox,g=m.createElement,h=m.discardElement;b(c.prototype,d.prototype);b(c.prototype,{create:function(a,b,c,d){this.setContainer(b,c,d);this.configure(a)},setContainer:function(a,b,c){var d=a.style,e=a.parentNode,f=d.left,d=d.top,h=a.offsetWidth,k=a.offsetHeight,m={visibility:"hidden",position:"absolute"};this.init.apply(this,[a,b,c]);this.canvas=g("canvas",{width:h,height:k},{position:"relative",left:f,
|
||||
top:d},a);this.ttLine=g("div",null,m,e);this.ttDiv=g("div",null,m,e);this.ttTimer=void 0;this.hiddenSvg=a=g("div",{width:h,height:k},{visibility:"hidden",left:f,top:d},e);a.appendChild(this.box)},configure:function(b){var c=this,d=b.options.tooltip,g=d.borderWidth,h=c.ttDiv,m=d.style,s=c.ttLine,t=parseInt(m.padding,10),m=k(m,{padding:t+"px","background-color":d.backgroundColor,"border-style":"solid","border-width":g+"px","border-radius":d.borderRadius+"px"});d.shadow&&(m=k(m,{"box-shadow":"1px 1px 3px gray",
|
||||
"-webkit-box-shadow":"1px 1px 3px gray"}));a(h,m);a(s,{"border-left":"1px solid darkgray"});e(b,"tooltipRefresh",function(d){var e=b.container,g=e.offsetLeft,k=e.offsetTop;h.innerHTML=d.text;e=f(h.offsetWidth,h.offsetHeight,g,k,e.offsetWidth,e.offsetHeight,{x:d.x,y:d.y},12);a(h,{visibility:"visible",left:e.x+"px",top:e.y+"px","border-color":d.borderColor});a(s,{visibility:"visible",left:g+d.x+"px",top:k+b.plotTop+"px",height:b.plotHeight+"px"});c.ttTimer!==void 0&&clearTimeout(c.ttTimer);c.ttTimer=
|
||||
setTimeout(function(){a(h,{visibility:"hidden"});a(s,{visibility:"hidden"})},3E3)})},destroy:function(){h(this.canvas);this.ttTimer!==void 0&&clearTimeout(this.ttTimer);h(this.ttLine);h(this.ttDiv);h(this.hiddenSvg);return d.prototype.destroy.apply(this)},color:function(a,b,c){a&&a.linearGradient&&(a=a.stops[a.stops.length-1][1]);return d.prototype.color.call(this,a,b,c)},draw:function(){window.canvg(this.canvas,this.hiddenSvg.innerHTML)}})})(Highcharts);
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
Highcharts JS v2.2.1 (2012-03-15)
|
||||
Exporting module
|
||||
|
||||
(c) 2010-2011 Torstein H?nsi
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
(function(){function x(a){for(var b=a.length;b--;)typeof a[b]==="number"&&(a[b]=Math.round(a[b])-0.5);return a}var f=Highcharts,y=f.Chart,z=f.addEvent,B=f.removeEvent,r=f.createElement,u=f.discardElement,t=f.css,s=f.merge,k=f.each,n=f.extend,C=Math.max,h=document,D=window,A=h.documentElement.ontouchstart!==void 0,v=f.getOptions();n(v.lang,{downloadPNG:"Download PNG image",downloadJPEG:"Download JPEG image",downloadPDF:"Download PDF document",downloadSVG:"Download SVG vector image",exportButtonTitle:"Export to raster or vector image",
|
||||
printButtonTitle:"Print the chart"});v.navigation={menuStyle:{border:"1px solid #A0A0A0",background:"#FFFFFF"},menuItemStyle:{padding:"0 5px",background:"none",color:"#303030",fontSize:A?"14px":"11px"},menuItemHoverStyle:{background:"#4572A5",color:"#FFFFFF"},buttonOptions:{align:"right",backgroundColor:{linearGradient:[0,0,0,20],stops:[[0.4,"#F7F7F7"],[0.6,"#E3E3E3"]]},borderColor:"#B0B0B0",borderRadius:3,borderWidth:1,height:20,hoverBorderColor:"#909090",hoverSymbolFill:"#81A7CF",hoverSymbolStroke:"#4572A5",
|
||||
symbolFill:"#E0E0E0",symbolStroke:"#A0A0A0",symbolX:11.5,symbolY:10.5,verticalAlign:"top",width:24,y:10}};v.exporting={type:"image/png",url:"http://export.highcharts.com/",width:800,buttons:{exportButton:{symbol:"exportIcon",x:-10,symbolFill:"#A8BF77",hoverSymbolFill:"#768F3E",_id:"exportButton",_titleKey:"exportButtonTitle",menuItems:[{textKey:"downloadPNG",onclick:function(){this.exportChart()}},{textKey:"downloadJPEG",onclick:function(){this.exportChart({type:"image/jpeg"})}},{textKey:"downloadPDF",
|
||||
onclick:function(){this.exportChart({type:"application/pdf"})}},{textKey:"downloadSVG",onclick:function(){this.exportChart({type:"image/svg+xml"})}}]},printButton:{symbol:"printIcon",x:-36,symbolFill:"#B5C9DF",hoverSymbolFill:"#779ABF",_id:"printButton",_titleKey:"printButtonTitle",onclick:function(){this.print()}}}};n(y.prototype,{getSVG:function(a){var b=this,c,d,e,g=s(b.options,a);if(!h.createElementNS)h.createElementNS=function(a,b){var c=h.createElement(b);c.getBBox=function(){return f.Renderer.prototype.Element.prototype.getBBox.apply({element:c})};
|
||||
return c};a=r("div",null,{position:"absolute",top:"-9999em",width:b.chartWidth+"px",height:b.chartHeight+"px"},h.body);n(g.chart,{renderTo:a,forExport:!0});g.exporting.enabled=!1;g.chart.plotBackgroundImage=null;g.series=[];k(b.series,function(a){e=s(a.options,{animation:!1,showCheckbox:!1,visible:a.visible});if(!e.isInternal){if(e&&e.marker&&/^url\(/.test(e.marker.symbol))e.marker.symbol="circle";g.series.push(e)}});c=new Highcharts.Chart(g);k(["xAxis","yAxis"],function(a){k(b[a],function(b,d){var e=
|
||||
c[a][d],g=b.getExtremes(),f=g.userMin,g=g.userMax;(f!==void 0||g!==void 0)&&e.setExtremes(f,g,!0,!1)})});d=c.container.innerHTML;g=null;c.destroy();u(a);d=d.replace(/zIndex="[^"]+"/g,"").replace(/isShadow="[^"]+"/g,"").replace(/symbolName="[^"]+"/g,"").replace(/jQuery[0-9]+="[^"]+"/g,"").replace(/isTracker="[^"]+"/g,"").replace(/url\([^#]+#/g,"url(#").replace(/<svg /,'<svg xmlns:xlink="http://www.w3.org/1999/xlink" ').replace(/ href=/g," xlink:href=").replace(/ /g,"\u00a0").replace(/­/g,
|
||||
"\u00ad").replace(/<IMG /g,"<image ").replace(/height=([^" ]+)/g,'height="$1"').replace(/width=([^" ]+)/g,'width="$1"').replace(/hc-svg-href="([^"]+)">/g,'xlink:href="$1"/>').replace(/id=([^" >]+)/g,'id="$1"').replace(/class=([^" ]+)/g,'class="$1"').replace(/ transform /g," ").replace(/:(path|rect)/g,"$1").replace(/style="([^"]+)"/g,function(a){return a.toLowerCase()});d=d.replace(/(url\(#highcharts-[0-9]+)"/g,"$1").replace(/"/g,"'");d.match(/ xmlns="/g).length===2&&(d=d.replace(/xmlns="[^"]+"/,
|
||||
""));return d},exportChart:function(a,b){var c,d=this.getSVG(s(this.options.exporting.chartOptions,b)),a=s(this.options.exporting,a);c=r("form",{method:"post",action:a.url},{display:"none"},h.body);k(["filename","type","width","svg"],function(b){r("input",{type:"hidden",name:b,value:{filename:a.filename||"chart",type:a.type,width:a.width,svg:d}[b]},null,c)});c.submit();u(c)},print:function(){var a=this,b=a.container,c=[],d=b.parentNode,e=h.body,g=e.childNodes;if(!a.isPrinting)a.isPrinting=!0,k(g,
|
||||
function(a,b){if(a.nodeType===1)c[b]=a.style.display,a.style.display="none"}),e.appendChild(b),D.print(),setTimeout(function(){d.appendChild(b);k(g,function(a,b){if(a.nodeType===1)a.style.display=c[b]});a.isPrinting=!1},1E3)},contextMenu:function(a,b,c,d,e,g){var i=this,f=i.options.navigation,h=f.menuItemStyle,o=i.chartWidth,p=i.chartHeight,q="cache-"+a,j=i[q],l=C(e,g),m,w;if(!j)i[q]=j=r("div",{className:"highcharts-"+a},{position:"absolute",zIndex:1E3,padding:l+"px"},i.container),m=r("div",null,
|
||||
n({MozBoxShadow:"3px 3px 10px #888",WebkitBoxShadow:"3px 3px 10px #888",boxShadow:"3px 3px 10px #888"},f.menuStyle),j),w=function(){t(j,{display:"none"})},z(j,"mouseleave",w),k(b,function(a){if(a){var b=r("div",{onmouseover:function(){t(this,f.menuItemHoverStyle)},onmouseout:function(){t(this,h)},innerHTML:a.text||i.options.lang[a.textKey]},n({cursor:"pointer"},h),m);b[A?"ontouchstart":"onclick"]=function(){w();a.onclick.apply(i,arguments)};i.exportDivElements.push(b)}}),i.exportDivElements.push(m,
|
||||
j),i.exportMenuWidth=j.offsetWidth,i.exportMenuHeight=j.offsetHeight;a={display:"block"};c+i.exportMenuWidth>o?a.right=o-c-e-l+"px":a.left=c-l+"px";d+g+i.exportMenuHeight>p?a.bottom=p-d-l+"px":a.top=d+g-l+"px";t(j,a)},addButton:function(a){function b(){p.attr(l);o.attr(j)}var c=this,d=c.renderer,e=s(c.options.navigation.buttonOptions,a),g=e.onclick,f=e.menuItems,h=e.width,k=e.height,o,p,q,a=e.borderWidth,j={stroke:e.borderColor},l={stroke:e.symbolStroke,fill:e.symbolFill},m=e.symbolSize||12;if(!c.exportDivElements)c.exportDivElements=
|
||||
[],c.exportSVGElements=[];e.enabled!==!1&&(o=d.rect(0,0,h,k,e.borderRadius,a).align(e,!0).attr(n({fill:e.backgroundColor,"stroke-width":a,zIndex:19},j)).add(),q=d.rect(0,0,h,k,0).align(e).attr({id:e._id,fill:"rgba(255, 255, 255, 0.001)",title:c.options.lang[e._titleKey],zIndex:21}).css({cursor:"pointer"}).on("mouseover",function(){p.attr({stroke:e.hoverSymbolStroke,fill:e.hoverSymbolFill});o.attr({stroke:e.hoverBorderColor})}).on("mouseout",b).on("click",b).add(),f&&(g=function(){b();var a=q.getBBox();
|
||||
c.contextMenu("export-menu",f,a.x,a.y,h,k)}),q.on("click",function(){g.apply(c,arguments)}),p=d.symbol(e.symbol,e.symbolX-m/2,e.symbolY-m/2,m,m).align(e,!0).attr(n(l,{"stroke-width":e.symbolStrokeWidth||1,zIndex:20})).add(),c.exportSVGElements.push(o,q,p))},destroyExport:function(){var a,b;for(a=0;a<this.exportSVGElements.length;a++)b=this.exportSVGElements[a],b.onclick=b.ontouchstart=null,this.exportSVGElements[a]=b.destroy();for(a=0;a<this.exportDivElements.length;a++)b=this.exportDivElements[a],
|
||||
B(b,"mouseleave"),this.exportDivElements[a]=b.onmouseout=b.onmouseover=b.ontouchstart=b.onclick=null,u(b)}});f.Renderer.prototype.symbols.exportIcon=function(a,b,c,d){return x(["M",a,b+c,"L",a+c,b+d,a+c,b+d*0.8,a,b+d*0.8,"Z","M",a+c*0.5,b+d*0.8,"L",a+c*0.8,b+d*0.4,a+c*0.4,b+d*0.4,a+c*0.4,b,a+c*0.6,b,a+c*0.6,b+d*0.4,a+c*0.2,b+d*0.4,"Z"])};f.Renderer.prototype.symbols.printIcon=function(a,b,c,d){return x(["M",a,b+d*0.7,"L",a+c,b+d*0.7,a+c,b+d*0.4,a,b+d*0.4,"Z","M",a+c*0.2,b+d*0.4,"L",a+c*0.2,b,a+c*
|
||||
0.8,b,a+c*0.8,b+d*0.4,"Z","M",a+c*0.2,b+d*0.7,"L",a,b+d,a+c,b+d,a+c*0.8,b+d*0.7,"Z"])};y.prototype.callbacks.push(function(a){var b,c=a.options.exporting,d=c.buttons;if(c.enabled!==!1){for(b in d)a.addButton(d[b]);z(a,"destroy",a.destroyExport)}})})();
|
||||
@@ -0,0 +1,737 @@
|
||||
/**
|
||||
* @license Highcharts JS v2.2.1 (2012-03-15)
|
||||
* Exporting module
|
||||
*
|
||||
* (c) 2010-2011 Torstein Hønsi
|
||||
*
|
||||
* License: www.highcharts.com/license
|
||||
*/
|
||||
|
||||
// JSLint options:
|
||||
/*global Highcharts, document, window, Math, setTimeout */
|
||||
|
||||
(function () { // encapsulate
|
||||
|
||||
// create shortcuts
|
||||
var HC = Highcharts,
|
||||
Chart = HC.Chart,
|
||||
addEvent = HC.addEvent,
|
||||
removeEvent = HC.removeEvent,
|
||||
createElement = HC.createElement,
|
||||
discardElement = HC.discardElement,
|
||||
css = HC.css,
|
||||
merge = HC.merge,
|
||||
each = HC.each,
|
||||
extend = HC.extend,
|
||||
math = Math,
|
||||
mathMax = math.max,
|
||||
doc = document,
|
||||
win = window,
|
||||
hasTouch = doc.documentElement.ontouchstart !== undefined,
|
||||
M = 'M',
|
||||
L = 'L',
|
||||
DIV = 'div',
|
||||
HIDDEN = 'hidden',
|
||||
NONE = 'none',
|
||||
PREFIX = 'highcharts-',
|
||||
ABSOLUTE = 'absolute',
|
||||
PX = 'px',
|
||||
UNDEFINED,
|
||||
defaultOptions = HC.getOptions();
|
||||
|
||||
// Add language
|
||||
extend(defaultOptions.lang, {
|
||||
downloadPNG: 'Download PNG image',
|
||||
downloadJPEG: 'Download JPEG image',
|
||||
downloadPDF: 'Download PDF document',
|
||||
downloadSVG: 'Download SVG vector image',
|
||||
exportButtonTitle: 'Export to raster or vector image',
|
||||
printButtonTitle: 'Print the chart'
|
||||
});
|
||||
|
||||
// Buttons and menus are collected in a separate config option set called 'navigation'.
|
||||
// This can be extended later to add control buttons like zoom and pan right click menus.
|
||||
defaultOptions.navigation = {
|
||||
menuStyle: {
|
||||
border: '1px solid #A0A0A0',
|
||||
background: '#FFFFFF'
|
||||
},
|
||||
menuItemStyle: {
|
||||
padding: '0 5px',
|
||||
background: NONE,
|
||||
color: '#303030',
|
||||
fontSize: hasTouch ? '14px' : '11px'
|
||||
},
|
||||
menuItemHoverStyle: {
|
||||
background: '#4572A5',
|
||||
color: '#FFFFFF'
|
||||
},
|
||||
|
||||
buttonOptions: {
|
||||
align: 'right',
|
||||
backgroundColor: {
|
||||
linearGradient: [0, 0, 0, 20],
|
||||
stops: [
|
||||
[0.4, '#F7F7F7'],
|
||||
[0.6, '#E3E3E3']
|
||||
]
|
||||
},
|
||||
borderColor: '#B0B0B0',
|
||||
borderRadius: 3,
|
||||
borderWidth: 1,
|
||||
//enabled: true,
|
||||
height: 20,
|
||||
hoverBorderColor: '#909090',
|
||||
hoverSymbolFill: '#81A7CF',
|
||||
hoverSymbolStroke: '#4572A5',
|
||||
symbolFill: '#E0E0E0',
|
||||
//symbolSize: 12,
|
||||
symbolStroke: '#A0A0A0',
|
||||
//symbolStrokeWidth: 1,
|
||||
symbolX: 11.5,
|
||||
symbolY: 10.5,
|
||||
verticalAlign: 'top',
|
||||
width: 24,
|
||||
y: 10
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Add the export related options
|
||||
defaultOptions.exporting = {
|
||||
//enabled: true,
|
||||
//filename: 'chart',
|
||||
type: 'image/png',
|
||||
url: 'http://export.highcharts.com/',
|
||||
width: 800,
|
||||
buttons: {
|
||||
exportButton: {
|
||||
//enabled: true,
|
||||
symbol: 'exportIcon',
|
||||
x: -10,
|
||||
symbolFill: '#A8BF77',
|
||||
hoverSymbolFill: '#768F3E',
|
||||
_id: 'exportButton',
|
||||
_titleKey: 'exportButtonTitle',
|
||||
menuItems: [{
|
||||
textKey: 'downloadPNG',
|
||||
onclick: function () {
|
||||
this.exportChart();
|
||||
}
|
||||
}, {
|
||||
textKey: 'downloadJPEG',
|
||||
onclick: function () {
|
||||
this.exportChart({
|
||||
type: 'image/jpeg'
|
||||
});
|
||||
}
|
||||
}, {
|
||||
textKey: 'downloadPDF',
|
||||
onclick: function () {
|
||||
this.exportChart({
|
||||
type: 'application/pdf'
|
||||
});
|
||||
}
|
||||
}, {
|
||||
textKey: 'downloadSVG',
|
||||
onclick: function () {
|
||||
this.exportChart({
|
||||
type: 'image/svg+xml'
|
||||
});
|
||||
}
|
||||
}
|
||||
// Enable this block to add "View SVG" to the dropdown menu
|
||||
/*
|
||||
,{
|
||||
|
||||
text: 'View SVG',
|
||||
onclick: function () {
|
||||
var svg = this.getSVG()
|
||||
.replace(/</g, '\n<')
|
||||
.replace(/>/g, '>');
|
||||
|
||||
doc.body.innerHTML = '<pre>' + svg + '</pre>';
|
||||
}
|
||||
} // */
|
||||
]
|
||||
|
||||
},
|
||||
printButton: {
|
||||
//enabled: true,
|
||||
symbol: 'printIcon',
|
||||
x: -36,
|
||||
symbolFill: '#B5C9DF',
|
||||
hoverSymbolFill: '#779ABF',
|
||||
_id: 'printButton',
|
||||
_titleKey: 'printButtonTitle',
|
||||
onclick: function () {
|
||||
this.print();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
extend(Chart.prototype, {
|
||||
/**
|
||||
* Return an SVG representation of the chart
|
||||
*
|
||||
* @param additionalOptions {Object} Additional chart options for the generated SVG representation
|
||||
*/
|
||||
getSVG: function (additionalOptions) {
|
||||
var chart = this,
|
||||
chartCopy,
|
||||
sandbox,
|
||||
svg,
|
||||
seriesOptions,
|
||||
options = merge(chart.options, additionalOptions); // copy the options and add extra options
|
||||
|
||||
// IE compatibility hack for generating SVG content that it doesn't really understand
|
||||
if (!doc.createElementNS) {
|
||||
/*jslint unparam: true*//* allow unused parameter ns in function below */
|
||||
doc.createElementNS = function (ns, tagName) {
|
||||
var elem = doc.createElement(tagName);
|
||||
elem.getBBox = function () {
|
||||
return HC.Renderer.prototype.Element.prototype.getBBox.apply({ element: elem });
|
||||
};
|
||||
return elem;
|
||||
};
|
||||
/*jslint unparam: false*/
|
||||
}
|
||||
|
||||
// create a sandbox where a new chart will be generated
|
||||
sandbox = createElement(DIV, null, {
|
||||
position: ABSOLUTE,
|
||||
top: '-9999em',
|
||||
width: chart.chartWidth + PX,
|
||||
height: chart.chartHeight + PX
|
||||
}, doc.body);
|
||||
|
||||
// override some options
|
||||
extend(options.chart, {
|
||||
renderTo: sandbox,
|
||||
forExport: true
|
||||
});
|
||||
options.exporting.enabled = false; // hide buttons in print
|
||||
options.chart.plotBackgroundImage = null; // the converter doesn't handle images
|
||||
|
||||
// prepare for replicating the chart
|
||||
options.series = [];
|
||||
each(chart.series, function (serie) {
|
||||
seriesOptions = merge(serie.options, {
|
||||
animation: false, // turn off animation
|
||||
showCheckbox: false,
|
||||
visible: serie.visible
|
||||
});
|
||||
|
||||
if (!seriesOptions.isInternal) { // used for the navigator series that has its own option set
|
||||
|
||||
// remove image markers
|
||||
if (seriesOptions && seriesOptions.marker && /^url\(/.test(seriesOptions.marker.symbol)) {
|
||||
seriesOptions.marker.symbol = 'circle';
|
||||
}
|
||||
|
||||
options.series.push(seriesOptions);
|
||||
}
|
||||
});
|
||||
|
||||
// generate the chart copy
|
||||
chartCopy = new Highcharts.Chart(options);
|
||||
|
||||
// reflect axis extremes in the export
|
||||
each(['xAxis', 'yAxis'], function (axisType) {
|
||||
each(chart[axisType], function (axis, i) {
|
||||
var axisCopy = chartCopy[axisType][i],
|
||||
extremes = axis.getExtremes(),
|
||||
userMin = extremes.userMin,
|
||||
userMax = extremes.userMax;
|
||||
|
||||
if (userMin !== UNDEFINED || userMax !== UNDEFINED) {
|
||||
axisCopy.setExtremes(userMin, userMax, true, false);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// get the SVG from the container's innerHTML
|
||||
svg = chartCopy.container.innerHTML;
|
||||
|
||||
// free up memory
|
||||
options = null;
|
||||
chartCopy.destroy();
|
||||
discardElement(sandbox);
|
||||
|
||||
// sanitize
|
||||
svg = svg
|
||||
.replace(/zIndex="[^"]+"/g, '')
|
||||
.replace(/isShadow="[^"]+"/g, '')
|
||||
.replace(/symbolName="[^"]+"/g, '')
|
||||
.replace(/jQuery[0-9]+="[^"]+"/g, '')
|
||||
.replace(/isTracker="[^"]+"/g, '')
|
||||
.replace(/url\([^#]+#/g, 'url(#')
|
||||
.replace(/<svg /, '<svg xmlns:xlink="http://www.w3.org/1999/xlink" ')
|
||||
.replace(/ href=/g, ' xlink:href=')
|
||||
/* This fails in IE < 8
|
||||
.replace(/([0-9]+)\.([0-9]+)/g, function(s1, s2, s3) { // round off to save weight
|
||||
return s2 +'.'+ s3[0];
|
||||
})*/
|
||||
|
||||
// Replace HTML entities, issue #347
|
||||
.replace(/ /g, '\u00A0') // no-break space
|
||||
.replace(/­/g, '\u00AD') // soft hyphen
|
||||
|
||||
// IE specific
|
||||
.replace(/<IMG /g, '<image ')
|
||||
.replace(/height=([^" ]+)/g, 'height="$1"')
|
||||
.replace(/width=([^" ]+)/g, 'width="$1"')
|
||||
.replace(/hc-svg-href="([^"]+)">/g, 'xlink:href="$1"/>')
|
||||
.replace(/id=([^" >]+)/g, 'id="$1"')
|
||||
.replace(/class=([^" ]+)/g, 'class="$1"')
|
||||
.replace(/ transform /g, ' ')
|
||||
.replace(/:(path|rect)/g, '$1')
|
||||
.replace(/style="([^"]+)"/g, function (s) {
|
||||
return s.toLowerCase();
|
||||
});
|
||||
|
||||
// IE9 beta bugs with innerHTML. Test again with final IE9.
|
||||
svg = svg.replace(/(url\(#highcharts-[0-9]+)"/g, '$1')
|
||||
.replace(/"/g, "'");
|
||||
if (svg.match(/ xmlns="/g).length === 2) {
|
||||
svg = svg.replace(/xmlns="[^"]+"/, '');
|
||||
}
|
||||
|
||||
return svg;
|
||||
},
|
||||
|
||||
/**
|
||||
* Submit the SVG representation of the chart to the server
|
||||
* @param {Object} options Exporting options. Possible members are url, type and width.
|
||||
* @param {Object} chartOptions Additional chart options for the SVG representation of the chart
|
||||
*/
|
||||
exportChart: function (options, chartOptions) {
|
||||
var form,
|
||||
chart = this,
|
||||
svg = chart.getSVG(merge(chart.options.exporting.chartOptions, chartOptions)); // docs
|
||||
|
||||
// merge the options
|
||||
options = merge(chart.options.exporting, options);
|
||||
|
||||
// create the form
|
||||
form = createElement('form', {
|
||||
method: 'post',
|
||||
action: options.url
|
||||
}, {
|
||||
display: NONE
|
||||
}, doc.body);
|
||||
|
||||
// add the values
|
||||
each(['filename', 'type', 'width', 'svg'], function (name) {
|
||||
createElement('input', {
|
||||
type: HIDDEN,
|
||||
name: name,
|
||||
value: {
|
||||
filename: options.filename || 'chart',
|
||||
type: options.type,
|
||||
width: options.width,
|
||||
svg: svg
|
||||
}[name]
|
||||
}, null, form);
|
||||
});
|
||||
|
||||
// submit
|
||||
form.submit();
|
||||
|
||||
// clean up
|
||||
discardElement(form);
|
||||
},
|
||||
|
||||
/**
|
||||
* Print the chart
|
||||
*/
|
||||
print: function () {
|
||||
|
||||
var chart = this,
|
||||
container = chart.container,
|
||||
origDisplay = [],
|
||||
origParent = container.parentNode,
|
||||
body = doc.body,
|
||||
childNodes = body.childNodes;
|
||||
|
||||
if (chart.isPrinting) { // block the button while in printing mode
|
||||
return;
|
||||
}
|
||||
|
||||
chart.isPrinting = true;
|
||||
|
||||
// hide all body content
|
||||
each(childNodes, function (node, i) {
|
||||
if (node.nodeType === 1) {
|
||||
origDisplay[i] = node.style.display;
|
||||
node.style.display = NONE;
|
||||
}
|
||||
});
|
||||
|
||||
// pull out the chart
|
||||
body.appendChild(container);
|
||||
|
||||
// print
|
||||
win.print();
|
||||
|
||||
// allow the browser to prepare before reverting
|
||||
setTimeout(function () {
|
||||
|
||||
// put the chart back in
|
||||
origParent.appendChild(container);
|
||||
|
||||
// restore all body content
|
||||
each(childNodes, function (node, i) {
|
||||
if (node.nodeType === 1) {
|
||||
node.style.display = origDisplay[i];
|
||||
}
|
||||
});
|
||||
|
||||
chart.isPrinting = false;
|
||||
|
||||
}, 1000);
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Display a popup menu for choosing the export type
|
||||
*
|
||||
* @param {String} name An identifier for the menu
|
||||
* @param {Array} items A collection with text and onclicks for the items
|
||||
* @param {Number} x The x position of the opener button
|
||||
* @param {Number} y The y position of the opener button
|
||||
* @param {Number} width The width of the opener button
|
||||
* @param {Number} height The height of the opener button
|
||||
*/
|
||||
contextMenu: function (name, items, x, y, width, height) {
|
||||
var chart = this,
|
||||
navOptions = chart.options.navigation,
|
||||
menuItemStyle = navOptions.menuItemStyle,
|
||||
chartWidth = chart.chartWidth,
|
||||
chartHeight = chart.chartHeight,
|
||||
cacheName = 'cache-' + name,
|
||||
menu = chart[cacheName],
|
||||
menuPadding = mathMax(width, height), // for mouse leave detection
|
||||
boxShadow = '3px 3px 10px #888',
|
||||
innerMenu,
|
||||
hide,
|
||||
menuStyle;
|
||||
|
||||
// create the menu only the first time
|
||||
if (!menu) {
|
||||
|
||||
// create a HTML element above the SVG
|
||||
chart[cacheName] = menu = createElement(DIV, {
|
||||
className: PREFIX + name
|
||||
}, {
|
||||
position: ABSOLUTE,
|
||||
zIndex: 1000,
|
||||
padding: menuPadding + PX
|
||||
}, chart.container);
|
||||
|
||||
innerMenu = createElement(DIV, null,
|
||||
extend({
|
||||
MozBoxShadow: boxShadow,
|
||||
WebkitBoxShadow: boxShadow,
|
||||
boxShadow: boxShadow
|
||||
}, navOptions.menuStyle), menu);
|
||||
|
||||
// hide on mouse out
|
||||
hide = function () {
|
||||
css(menu, { display: NONE });
|
||||
};
|
||||
|
||||
addEvent(menu, 'mouseleave', hide);
|
||||
|
||||
|
||||
// create the items
|
||||
each(items, function (item) {
|
||||
if (item) {
|
||||
var div = createElement(DIV, {
|
||||
onmouseover: function () {
|
||||
css(this, navOptions.menuItemHoverStyle);
|
||||
},
|
||||
onmouseout: function () {
|
||||
css(this, menuItemStyle);
|
||||
},
|
||||
innerHTML: item.text || chart.options.lang[item.textKey]
|
||||
}, extend({
|
||||
cursor: 'pointer'
|
||||
}, menuItemStyle), innerMenu);
|
||||
|
||||
div[hasTouch ? 'ontouchstart' : 'onclick'] = function () {
|
||||
hide();
|
||||
item.onclick.apply(chart, arguments);
|
||||
};
|
||||
|
||||
// Keep references to menu divs to be able to destroy them
|
||||
chart.exportDivElements.push(div);
|
||||
}
|
||||
});
|
||||
|
||||
// Keep references to menu and innerMenu div to be able to destroy them
|
||||
chart.exportDivElements.push(innerMenu, menu);
|
||||
|
||||
chart.exportMenuWidth = menu.offsetWidth;
|
||||
chart.exportMenuHeight = menu.offsetHeight;
|
||||
}
|
||||
|
||||
menuStyle = { display: 'block' };
|
||||
|
||||
// if outside right, right align it
|
||||
if (x + chart.exportMenuWidth > chartWidth) {
|
||||
menuStyle.right = (chartWidth - x - width - menuPadding) + PX;
|
||||
} else {
|
||||
menuStyle.left = (x - menuPadding) + PX;
|
||||
}
|
||||
// if outside bottom, bottom align it
|
||||
if (y + height + chart.exportMenuHeight > chartHeight) {
|
||||
menuStyle.bottom = (chartHeight - y - menuPadding) + PX;
|
||||
} else {
|
||||
menuStyle.top = (y + height - menuPadding) + PX;
|
||||
}
|
||||
|
||||
css(menu, menuStyle);
|
||||
},
|
||||
|
||||
/**
|
||||
* Add the export button to the chart
|
||||
*/
|
||||
addButton: function (options) {
|
||||
var chart = this,
|
||||
renderer = chart.renderer,
|
||||
btnOptions = merge(chart.options.navigation.buttonOptions, options),
|
||||
onclick = btnOptions.onclick,
|
||||
menuItems = btnOptions.menuItems,
|
||||
buttonWidth = btnOptions.width,
|
||||
buttonHeight = btnOptions.height,
|
||||
box,
|
||||
symbol,
|
||||
button,
|
||||
borderWidth = btnOptions.borderWidth,
|
||||
boxAttr = {
|
||||
stroke: btnOptions.borderColor
|
||||
|
||||
},
|
||||
symbolAttr = {
|
||||
stroke: btnOptions.symbolStroke,
|
||||
fill: btnOptions.symbolFill
|
||||
},
|
||||
symbolSize = btnOptions.symbolSize || 12;
|
||||
|
||||
// Keeps references to the button elements
|
||||
if (!chart.exportDivElements) {
|
||||
chart.exportDivElements = [];
|
||||
chart.exportSVGElements = [];
|
||||
}
|
||||
|
||||
if (btnOptions.enabled === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
// element to capture the click
|
||||
function revert() {
|
||||
symbol.attr(symbolAttr);
|
||||
box.attr(boxAttr);
|
||||
}
|
||||
|
||||
// the box border
|
||||
box = renderer.rect(
|
||||
0,
|
||||
0,
|
||||
buttonWidth,
|
||||
buttonHeight,
|
||||
btnOptions.borderRadius,
|
||||
borderWidth
|
||||
)
|
||||
//.translate(buttonLeft, buttonTop) // to allow gradients
|
||||
.align(btnOptions, true)
|
||||
.attr(extend({
|
||||
fill: btnOptions.backgroundColor,
|
||||
'stroke-width': borderWidth,
|
||||
zIndex: 19
|
||||
}, boxAttr)).add();
|
||||
|
||||
// the invisible element to track the clicks
|
||||
button = renderer.rect(
|
||||
0,
|
||||
0,
|
||||
buttonWidth,
|
||||
buttonHeight,
|
||||
0
|
||||
)
|
||||
.align(btnOptions)
|
||||
.attr({
|
||||
id: btnOptions._id,
|
||||
fill: 'rgba(255, 255, 255, 0.001)',
|
||||
title: chart.options.lang[btnOptions._titleKey],
|
||||
zIndex: 21
|
||||
}).css({
|
||||
cursor: 'pointer'
|
||||
})
|
||||
.on('mouseover', function () {
|
||||
symbol.attr({
|
||||
stroke: btnOptions.hoverSymbolStroke,
|
||||
fill: btnOptions.hoverSymbolFill
|
||||
});
|
||||
box.attr({
|
||||
stroke: btnOptions.hoverBorderColor
|
||||
});
|
||||
})
|
||||
.on('mouseout', revert)
|
||||
.on('click', revert)
|
||||
.add();
|
||||
|
||||
// add the click event
|
||||
if (menuItems) {
|
||||
onclick = function () {
|
||||
revert();
|
||||
var bBox = button.getBBox();
|
||||
chart.contextMenu('export-menu', menuItems, bBox.x, bBox.y, buttonWidth, buttonHeight);
|
||||
};
|
||||
}
|
||||
/*addEvent(button.element, 'click', function() {
|
||||
onclick.apply(chart, arguments);
|
||||
});*/
|
||||
button.on('click', function () {
|
||||
onclick.apply(chart, arguments);
|
||||
});
|
||||
|
||||
// the icon
|
||||
symbol = renderer.symbol(
|
||||
btnOptions.symbol,
|
||||
btnOptions.symbolX - (symbolSize / 2),
|
||||
btnOptions.symbolY - (symbolSize / 2),
|
||||
symbolSize,
|
||||
symbolSize
|
||||
)
|
||||
.align(btnOptions, true)
|
||||
.attr(extend(symbolAttr, {
|
||||
'stroke-width': btnOptions.symbolStrokeWidth || 1,
|
||||
zIndex: 20
|
||||
})).add();
|
||||
|
||||
// Keep references to the renderer element so to be able to destroy them later.
|
||||
chart.exportSVGElements.push(box, button, symbol);
|
||||
},
|
||||
|
||||
/**
|
||||
* Destroy the buttons.
|
||||
*/
|
||||
destroyExport: function () {
|
||||
var i,
|
||||
chart = this,
|
||||
elem;
|
||||
|
||||
// Destroy the extra buttons added
|
||||
for (i = 0; i < chart.exportSVGElements.length; i++) {
|
||||
elem = chart.exportSVGElements[i];
|
||||
// Destroy and null the svg/vml elements
|
||||
elem.onclick = elem.ontouchstart = null;
|
||||
chart.exportSVGElements[i] = elem.destroy();
|
||||
}
|
||||
|
||||
// Destroy the divs for the menu
|
||||
for (i = 0; i < chart.exportDivElements.length; i++) {
|
||||
elem = chart.exportDivElements[i];
|
||||
|
||||
// Remove the event handler
|
||||
removeEvent(elem, 'mouseleave');
|
||||
|
||||
// Remove inline events
|
||||
chart.exportDivElements[i] = elem.onmouseout = elem.onmouseover = elem.ontouchstart = elem.onclick = null;
|
||||
|
||||
// Destroy the div by moving to garbage bin
|
||||
discardElement(elem);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Crisp for 1px stroke width, which is default. In the future, consider a smarter,
|
||||
* global function.
|
||||
*/
|
||||
function crisp(arr) {
|
||||
var i = arr.length;
|
||||
while (i--) {
|
||||
if (typeof arr[i] === 'number') {
|
||||
arr[i] = Math.round(arr[i]) - 0.5;
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
// Create the export icon
|
||||
HC.Renderer.prototype.symbols.exportIcon = function (x, y, width, height) {
|
||||
return crisp([
|
||||
M, // the disk
|
||||
x, y + width,
|
||||
L,
|
||||
x + width, y + height,
|
||||
x + width, y + height * 0.8,
|
||||
x, y + height * 0.8,
|
||||
'Z',
|
||||
M, // the arrow
|
||||
x + width * 0.5, y + height * 0.8,
|
||||
L,
|
||||
x + width * 0.8, y + height * 0.4,
|
||||
x + width * 0.4, y + height * 0.4,
|
||||
x + width * 0.4, y,
|
||||
x + width * 0.6, y,
|
||||
x + width * 0.6, y + height * 0.4,
|
||||
x + width * 0.2, y + height * 0.4,
|
||||
'Z'
|
||||
]);
|
||||
};
|
||||
// Create the print icon
|
||||
HC.Renderer.prototype.symbols.printIcon = function (x, y, width, height) {
|
||||
return crisp([
|
||||
M, // the printer
|
||||
x, y + height * 0.7,
|
||||
L,
|
||||
x + width, y + height * 0.7,
|
||||
x + width, y + height * 0.4,
|
||||
x, y + height * 0.4,
|
||||
'Z',
|
||||
M, // the upper sheet
|
||||
x + width * 0.2, y + height * 0.4,
|
||||
L,
|
||||
x + width * 0.2, y,
|
||||
x + width * 0.8, y,
|
||||
x + width * 0.8, y + height * 0.4,
|
||||
'Z',
|
||||
M, // the lower sheet
|
||||
x + width * 0.2, y + height * 0.7,
|
||||
L,
|
||||
x, y + height,
|
||||
x + width, y + height,
|
||||
x + width * 0.8, y + height * 0.7,
|
||||
'Z'
|
||||
]);
|
||||
};
|
||||
|
||||
|
||||
// Add the buttons on chart load
|
||||
Chart.prototype.callbacks.push(function (chart) {
|
||||
var n,
|
||||
exportingOptions = chart.options.exporting,
|
||||
buttons = exportingOptions.buttons;
|
||||
|
||||
if (exportingOptions.enabled !== false) {
|
||||
|
||||
for (n in buttons) {
|
||||
chart.addButton(buttons[n]);
|
||||
}
|
||||
|
||||
// Destroy the export elements at chart destroy
|
||||
addEvent(chart, 'destroy', chart.destroyExport);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
}());
|
||||
@@ -0,0 +1,263 @@
|
||||
/**
|
||||
* Dark blue theme for Highcharts JS
|
||||
* @author Torstein Hønsi
|
||||
*/
|
||||
|
||||
Highcharts.theme = {
|
||||
colors: ["#DDDF0D", "#55BF3B", "#DF5353", "#7798BF", "#aaeeee", "#ff0066", "#eeaaee",
|
||||
"#55BF3B", "#DF5353", "#7798BF", "#aaeeee"],
|
||||
chart: {
|
||||
backgroundColor: {
|
||||
linearGradient: [0, 0, 250, 500],
|
||||
stops: [
|
||||
[0, 'rgb(48, 48, 96)'],
|
||||
[1, 'rgb(0, 0, 0)']
|
||||
]
|
||||
},
|
||||
borderColor: '#000000',
|
||||
borderWidth: 2,
|
||||
className: 'dark-container',
|
||||
plotBackgroundColor: 'rgba(255, 255, 255, .1)',
|
||||
plotBorderColor: '#CCCCCC',
|
||||
plotBorderWidth: 1
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#C0C0C0',
|
||||
font: 'bold 16px "Trebuchet MS", Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
subtitle: {
|
||||
style: {
|
||||
color: '#666666',
|
||||
font: 'bold 12px "Trebuchet MS", Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
gridLineColor: '#333333',
|
||||
gridLineWidth: 1,
|
||||
labels: {
|
||||
style: {
|
||||
color: '#A0A0A0'
|
||||
}
|
||||
},
|
||||
lineColor: '#A0A0A0',
|
||||
tickColor: '#A0A0A0',
|
||||
title: {
|
||||
style: {
|
||||
color: '#CCC',
|
||||
fontWeight: 'bold',
|
||||
fontSize: '12px',
|
||||
fontFamily: 'Trebuchet MS, Verdana, sans-serif'
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
gridLineColor: '#333333',
|
||||
labels: {
|
||||
style: {
|
||||
color: '#A0A0A0'
|
||||
}
|
||||
},
|
||||
lineColor: '#A0A0A0',
|
||||
minorTickInterval: null,
|
||||
tickColor: '#A0A0A0',
|
||||
tickWidth: 1,
|
||||
title: {
|
||||
style: {
|
||||
color: '#CCC',
|
||||
fontWeight: 'bold',
|
||||
fontSize: '12px',
|
||||
fontFamily: 'Trebuchet MS, Verdana, sans-serif'
|
||||
}
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
backgroundColor: 'rgba(0, 0, 0, 0.75)',
|
||||
style: {
|
||||
color: '#F0F0F0'
|
||||
}
|
||||
},
|
||||
toolbar: {
|
||||
itemStyle: {
|
||||
color: 'silver'
|
||||
}
|
||||
},
|
||||
plotOptions: {
|
||||
line: {
|
||||
dataLabels: {
|
||||
color: '#CCC'
|
||||
},
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
spline: {
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
scatter: {
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
candlestick: {
|
||||
lineColor: 'white'
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
itemStyle: {
|
||||
font: '9pt Trebuchet MS, Verdana, sans-serif',
|
||||
color: '#A0A0A0'
|
||||
},
|
||||
itemHoverStyle: {
|
||||
color: '#FFF'
|
||||
},
|
||||
itemHiddenStyle: {
|
||||
color: '#444'
|
||||
}
|
||||
},
|
||||
credits: {
|
||||
style: {
|
||||
color: '#666'
|
||||
}
|
||||
},
|
||||
labels: {
|
||||
style: {
|
||||
color: '#CCC'
|
||||
}
|
||||
},
|
||||
|
||||
navigation: {
|
||||
buttonOptions: {
|
||||
backgroundColor: {
|
||||
linearGradient: [0, 0, 0, 20],
|
||||
stops: [
|
||||
[0.4, '#606060'],
|
||||
[0.6, '#333333']
|
||||
]
|
||||
},
|
||||
borderColor: '#000000',
|
||||
symbolStroke: '#C0C0C0',
|
||||
hoverSymbolStroke: '#FFFFFF'
|
||||
}
|
||||
},
|
||||
|
||||
exporting: {
|
||||
buttons: {
|
||||
exportButton: {
|
||||
symbolFill: '#55BE3B'
|
||||
},
|
||||
printButton: {
|
||||
symbolFill: '#7797BE'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// scroll charts
|
||||
rangeSelector: {
|
||||
buttonTheme: {
|
||||
fill: {
|
||||
linearGradient: [0, 0, 0, 20],
|
||||
stops: [
|
||||
[0.4, '#888'],
|
||||
[0.6, '#555']
|
||||
]
|
||||
},
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: '#CCC',
|
||||
fontWeight: 'bold'
|
||||
},
|
||||
states: {
|
||||
hover: {
|
||||
fill: {
|
||||
linearGradient: [0, 0, 0, 20],
|
||||
stops: [
|
||||
[0.4, '#BBB'],
|
||||
[0.6, '#888']
|
||||
]
|
||||
},
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: 'white'
|
||||
}
|
||||
},
|
||||
select: {
|
||||
fill: {
|
||||
linearGradient: [0, 0, 0, 20],
|
||||
stops: [
|
||||
[0.1, '#000'],
|
||||
[0.3, '#333']
|
||||
]
|
||||
},
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: 'yellow'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
inputStyle: {
|
||||
backgroundColor: '#333',
|
||||
color: 'silver'
|
||||
},
|
||||
labelStyle: {
|
||||
color: 'silver'
|
||||
}
|
||||
},
|
||||
|
||||
navigator: {
|
||||
handles: {
|
||||
backgroundColor: '#666',
|
||||
borderColor: '#AAA'
|
||||
},
|
||||
outlineColor: '#CCC',
|
||||
maskFill: 'rgba(16, 16, 16, 0.5)',
|
||||
series: {
|
||||
color: '#7798BF',
|
||||
lineColor: '#A6C7ED'
|
||||
}
|
||||
},
|
||||
|
||||
scrollbar: {
|
||||
barBackgroundColor: {
|
||||
linearGradient: [0, 0, 0, 20],
|
||||
stops: [
|
||||
[0.4, '#888'],
|
||||
[0.6, '#555']
|
||||
]
|
||||
},
|
||||
barBorderColor: '#CCC',
|
||||
buttonArrowColor: '#CCC',
|
||||
buttonBackgroundColor: {
|
||||
linearGradient: [0, 0, 0, 20],
|
||||
stops: [
|
||||
[0.4, '#888'],
|
||||
[0.6, '#555']
|
||||
]
|
||||
},
|
||||
buttonBorderColor: '#CCC',
|
||||
rifleColor: '#FFF',
|
||||
trackBackgroundColor: {
|
||||
linearGradient: [0, 0, 0, 10],
|
||||
stops: [
|
||||
[0, '#000'],
|
||||
[1, '#333']
|
||||
]
|
||||
},
|
||||
trackBorderColor: '#666'
|
||||
},
|
||||
|
||||
// special colors for some of the
|
||||
legendBackgroundColor: 'rgba(0, 0, 0, 0.5)',
|
||||
legendBackgroundColorSolid: 'rgb(35, 35, 70)',
|
||||
dataLabelsColor: '#444',
|
||||
textColor: '#C0C0C0',
|
||||
maskColor: 'rgba(255,255,255,0.3)'
|
||||
};
|
||||
|
||||
// Apply the theme
|
||||
var highchartsOptions = Highcharts.setOptions(Highcharts.theme);
|
||||
@@ -0,0 +1,263 @@
|
||||
/**
|
||||
* Dark blue theme for Highcharts JS
|
||||
* @author Torstein Hønsi
|
||||
*/
|
||||
|
||||
Highcharts.theme = {
|
||||
colors: ["#DDDF0D", "#55BF3B", "#DF5353", "#7798BF", "#aaeeee", "#ff0066", "#eeaaee",
|
||||
"#55BF3B", "#DF5353", "#7798BF", "#aaeeee"],
|
||||
chart: {
|
||||
backgroundColor: {
|
||||
linearGradient: [0, 0, 250, 500],
|
||||
stops: [
|
||||
[0, 'rgb(48, 96, 48)'],
|
||||
[1, 'rgb(0, 0, 0)']
|
||||
]
|
||||
},
|
||||
borderColor: '#000000',
|
||||
borderWidth: 2,
|
||||
className: 'dark-container',
|
||||
plotBackgroundColor: 'rgba(255, 255, 255, .1)',
|
||||
plotBorderColor: '#CCCCCC',
|
||||
plotBorderWidth: 1
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#C0C0C0',
|
||||
font: 'bold 16px "Trebuchet MS", Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
subtitle: {
|
||||
style: {
|
||||
color: '#666666',
|
||||
font: 'bold 12px "Trebuchet MS", Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
gridLineColor: '#333333',
|
||||
gridLineWidth: 1,
|
||||
labels: {
|
||||
style: {
|
||||
color: '#A0A0A0'
|
||||
}
|
||||
},
|
||||
lineColor: '#A0A0A0',
|
||||
tickColor: '#A0A0A0',
|
||||
title: {
|
||||
style: {
|
||||
color: '#CCC',
|
||||
fontWeight: 'bold',
|
||||
fontSize: '12px',
|
||||
fontFamily: 'Trebuchet MS, Verdana, sans-serif'
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
gridLineColor: '#333333',
|
||||
labels: {
|
||||
style: {
|
||||
color: '#A0A0A0'
|
||||
}
|
||||
},
|
||||
lineColor: '#A0A0A0',
|
||||
minorTickInterval: null,
|
||||
tickColor: '#A0A0A0',
|
||||
tickWidth: 1,
|
||||
title: {
|
||||
style: {
|
||||
color: '#CCC',
|
||||
fontWeight: 'bold',
|
||||
fontSize: '12px',
|
||||
fontFamily: 'Trebuchet MS, Verdana, sans-serif'
|
||||
}
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
backgroundColor: 'rgba(0, 0, 0, 0.75)',
|
||||
style: {
|
||||
color: '#F0F0F0'
|
||||
}
|
||||
},
|
||||
toolbar: {
|
||||
itemStyle: {
|
||||
color: 'silver'
|
||||
}
|
||||
},
|
||||
plotOptions: {
|
||||
line: {
|
||||
dataLabels: {
|
||||
color: '#CCC'
|
||||
},
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
spline: {
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
scatter: {
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
candlestick: {
|
||||
lineColor: 'white'
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
itemStyle: {
|
||||
font: '9pt Trebuchet MS, Verdana, sans-serif',
|
||||
color: '#A0A0A0'
|
||||
},
|
||||
itemHoverStyle: {
|
||||
color: '#FFF'
|
||||
},
|
||||
itemHiddenStyle: {
|
||||
color: '#444'
|
||||
}
|
||||
},
|
||||
credits: {
|
||||
style: {
|
||||
color: '#666'
|
||||
}
|
||||
},
|
||||
labels: {
|
||||
style: {
|
||||
color: '#CCC'
|
||||
}
|
||||
},
|
||||
|
||||
navigation: {
|
||||
buttonOptions: {
|
||||
backgroundColor: {
|
||||
linearGradient: [0, 0, 0, 20],
|
||||
stops: [
|
||||
[0.4, '#606060'],
|
||||
[0.6, '#333333']
|
||||
]
|
||||
},
|
||||
borderColor: '#000000',
|
||||
symbolStroke: '#C0C0C0',
|
||||
hoverSymbolStroke: '#FFFFFF'
|
||||
}
|
||||
},
|
||||
|
||||
exporting: {
|
||||
buttons: {
|
||||
exportButton: {
|
||||
symbolFill: '#55BE3B'
|
||||
},
|
||||
printButton: {
|
||||
symbolFill: '#7797BE'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// scroll charts
|
||||
rangeSelector: {
|
||||
buttonTheme: {
|
||||
fill: {
|
||||
linearGradient: [0, 0, 0, 20],
|
||||
stops: [
|
||||
[0.4, '#888'],
|
||||
[0.6, '#555']
|
||||
]
|
||||
},
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: '#CCC',
|
||||
fontWeight: 'bold'
|
||||
},
|
||||
states: {
|
||||
hover: {
|
||||
fill: {
|
||||
linearGradient: [0, 0, 0, 20],
|
||||
stops: [
|
||||
[0.4, '#BBB'],
|
||||
[0.6, '#888']
|
||||
]
|
||||
},
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: 'white'
|
||||
}
|
||||
},
|
||||
select: {
|
||||
fill: {
|
||||
linearGradient: [0, 0, 0, 20],
|
||||
stops: [
|
||||
[0.1, '#000'],
|
||||
[0.3, '#333']
|
||||
]
|
||||
},
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: 'yellow'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
inputStyle: {
|
||||
backgroundColor: '#333',
|
||||
color: 'silver'
|
||||
},
|
||||
labelStyle: {
|
||||
color: 'silver'
|
||||
}
|
||||
},
|
||||
|
||||
navigator: {
|
||||
handles: {
|
||||
backgroundColor: '#666',
|
||||
borderColor: '#AAA'
|
||||
},
|
||||
outlineColor: '#CCC',
|
||||
maskFill: 'rgba(16, 16, 16, 0.5)',
|
||||
series: {
|
||||
color: '#7798BF',
|
||||
lineColor: '#A6C7ED'
|
||||
}
|
||||
},
|
||||
|
||||
scrollbar: {
|
||||
barBackgroundColor: {
|
||||
linearGradient: [0, 0, 0, 20],
|
||||
stops: [
|
||||
[0.4, '#888'],
|
||||
[0.6, '#555']
|
||||
]
|
||||
},
|
||||
barBorderColor: '#CCC',
|
||||
buttonArrowColor: '#CCC',
|
||||
buttonBackgroundColor: {
|
||||
linearGradient: [0, 0, 0, 20],
|
||||
stops: [
|
||||
[0.4, '#888'],
|
||||
[0.6, '#555']
|
||||
]
|
||||
},
|
||||
buttonBorderColor: '#CCC',
|
||||
rifleColor: '#FFF',
|
||||
trackBackgroundColor: {
|
||||
linearGradient: [0, 0, 0, 10],
|
||||
stops: [
|
||||
[0, '#000'],
|
||||
[1, '#333']
|
||||
]
|
||||
},
|
||||
trackBorderColor: '#666'
|
||||
},
|
||||
|
||||
// special colors for some of the
|
||||
legendBackgroundColor: 'rgba(0, 0, 0, 0.5)',
|
||||
legendBackgroundColorSolid: 'rgb(35, 35, 70)',
|
||||
dataLabelsColor: '#444',
|
||||
textColor: '#C0C0C0',
|
||||
maskColor: 'rgba(255,255,255,0.3)'
|
||||
};
|
||||
|
||||
// Apply the theme
|
||||
var highchartsOptions = Highcharts.setOptions(Highcharts.theme);
|
||||
@@ -0,0 +1,262 @@
|
||||
/**
|
||||
* Gray theme for Highcharts JS
|
||||
* @author Torstein Hønsi
|
||||
*/
|
||||
|
||||
Highcharts.theme = {
|
||||
colors: ["#DDDF0D", "#7798BF", "#55BF3B", "#DF5353", "#aaeeee", "#ff0066", "#eeaaee",
|
||||
"#55BF3B", "#DF5353", "#7798BF", "#aaeeee"],
|
||||
chart: {
|
||||
backgroundColor: {
|
||||
linearGradient: [0, 0, 0, 400],
|
||||
stops: [
|
||||
[0, 'rgb(96, 96, 96)'],
|
||||
[1, 'rgb(16, 16, 16)']
|
||||
]
|
||||
},
|
||||
borderWidth: 0,
|
||||
borderRadius: 15,
|
||||
plotBackgroundColor: null,
|
||||
plotShadow: false,
|
||||
plotBorderWidth: 0
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#FFF',
|
||||
font: '16px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
|
||||
}
|
||||
},
|
||||
subtitle: {
|
||||
style: {
|
||||
color: '#DDD',
|
||||
font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
gridLineWidth: 0,
|
||||
lineColor: '#999',
|
||||
tickColor: '#999',
|
||||
labels: {
|
||||
style: {
|
||||
color: '#999',
|
||||
fontWeight: 'bold'
|
||||
}
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#AAA',
|
||||
font: 'bold 12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
alternateGridColor: null,
|
||||
minorTickInterval: null,
|
||||
gridLineColor: 'rgba(255, 255, 255, .1)',
|
||||
lineWidth: 0,
|
||||
tickWidth: 0,
|
||||
labels: {
|
||||
style: {
|
||||
color: '#999',
|
||||
fontWeight: 'bold'
|
||||
}
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#AAA',
|
||||
font: 'bold 12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
itemStyle: {
|
||||
color: '#CCC'
|
||||
},
|
||||
itemHoverStyle: {
|
||||
color: '#FFF'
|
||||
},
|
||||
itemHiddenStyle: {
|
||||
color: '#333'
|
||||
}
|
||||
},
|
||||
labels: {
|
||||
style: {
|
||||
color: '#CCC'
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
backgroundColor: {
|
||||
linearGradient: [0, 0, 0, 50],
|
||||
stops: [
|
||||
[0, 'rgba(96, 96, 96, .8)'],
|
||||
[1, 'rgba(16, 16, 16, .8)']
|
||||
]
|
||||
},
|
||||
borderWidth: 0,
|
||||
style: {
|
||||
color: '#FFF'
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
plotOptions: {
|
||||
line: {
|
||||
dataLabels: {
|
||||
color: '#CCC'
|
||||
},
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
spline: {
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
scatter: {
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
candlestick: {
|
||||
lineColor: 'white'
|
||||
}
|
||||
},
|
||||
|
||||
toolbar: {
|
||||
itemStyle: {
|
||||
color: '#CCC'
|
||||
}
|
||||
},
|
||||
|
||||
navigation: {
|
||||
buttonOptions: {
|
||||
backgroundColor: {
|
||||
linearGradient: [0, 0, 0, 20],
|
||||
stops: [
|
||||
[0.4, '#606060'],
|
||||
[0.6, '#333333']
|
||||
]
|
||||
},
|
||||
borderColor: '#000000',
|
||||
symbolStroke: '#C0C0C0',
|
||||
hoverSymbolStroke: '#FFFFFF'
|
||||
}
|
||||
},
|
||||
|
||||
exporting: {
|
||||
buttons: {
|
||||
exportButton: {
|
||||
symbolFill: '#55BE3B'
|
||||
},
|
||||
printButton: {
|
||||
symbolFill: '#7797BE'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// scroll charts
|
||||
rangeSelector: {
|
||||
buttonTheme: {
|
||||
fill: {
|
||||
linearGradient: [0, 0, 0, 20],
|
||||
stops: [
|
||||
[0.4, '#888'],
|
||||
[0.6, '#555']
|
||||
]
|
||||
},
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: '#CCC',
|
||||
fontWeight: 'bold'
|
||||
},
|
||||
states: {
|
||||
hover: {
|
||||
fill: {
|
||||
linearGradient: [0, 0, 0, 20],
|
||||
stops: [
|
||||
[0.4, '#BBB'],
|
||||
[0.6, '#888']
|
||||
]
|
||||
},
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: 'white'
|
||||
}
|
||||
},
|
||||
select: {
|
||||
fill: {
|
||||
linearGradient: [0, 0, 0, 20],
|
||||
stops: [
|
||||
[0.1, '#000'],
|
||||
[0.3, '#333']
|
||||
]
|
||||
},
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: 'yellow'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
inputStyle: {
|
||||
backgroundColor: '#333',
|
||||
color: 'silver'
|
||||
},
|
||||
labelStyle: {
|
||||
color: 'silver'
|
||||
}
|
||||
},
|
||||
|
||||
navigator: {
|
||||
handles: {
|
||||
backgroundColor: '#666',
|
||||
borderColor: '#AAA'
|
||||
},
|
||||
outlineColor: '#CCC',
|
||||
maskFill: 'rgba(16, 16, 16, 0.5)',
|
||||
series: {
|
||||
color: '#7798BF',
|
||||
lineColor: '#A6C7ED'
|
||||
}
|
||||
},
|
||||
|
||||
scrollbar: {
|
||||
barBackgroundColor: {
|
||||
linearGradient: [0, 0, 0, 20],
|
||||
stops: [
|
||||
[0.4, '#888'],
|
||||
[0.6, '#555']
|
||||
]
|
||||
},
|
||||
barBorderColor: '#CCC',
|
||||
buttonArrowColor: '#CCC',
|
||||
buttonBackgroundColor: {
|
||||
linearGradient: [0, 0, 0, 20],
|
||||
stops: [
|
||||
[0.4, '#888'],
|
||||
[0.6, '#555']
|
||||
]
|
||||
},
|
||||
buttonBorderColor: '#CCC',
|
||||
rifleColor: '#FFF',
|
||||
trackBackgroundColor: {
|
||||
linearGradient: [0, 0, 0, 10],
|
||||
stops: [
|
||||
[0, '#000'],
|
||||
[1, '#333']
|
||||
]
|
||||
},
|
||||
trackBorderColor: '#666'
|
||||
},
|
||||
|
||||
// special colors for some of the demo examples
|
||||
legendBackgroundColor: 'rgba(48, 48, 48, 0.8)',
|
||||
legendBackgroundColorSolid: 'rgb(70, 70, 70)',
|
||||
dataLabelsColor: '#444',
|
||||
textColor: '#E0E0E0',
|
||||
maskColor: 'rgba(255,255,255,0.3)'
|
||||
};
|
||||
|
||||
// Apply the theme
|
||||
var highchartsOptions = Highcharts.setOptions(Highcharts.theme);
|
||||
@@ -0,0 +1,95 @@
|
||||
/**
|
||||
* Grid theme for Highcharts JS
|
||||
* @author Torstein Hønsi
|
||||
*/
|
||||
|
||||
Highcharts.theme = {
|
||||
colors: ['#058DC7', '#50B432', '#ED561B', '#DDDF00', '#24CBE5', '#64E572', '#FF9655', '#FFF263', '#6AF9C4'],
|
||||
chart: {
|
||||
backgroundColor: {
|
||||
linearGradient: [0, 0, 500, 500],
|
||||
stops: [
|
||||
[0, 'rgb(255, 255, 255)'],
|
||||
[1, 'rgb(240, 240, 255)']
|
||||
]
|
||||
},
|
||||
borderWidth: 2,
|
||||
plotBackgroundColor: 'rgba(255, 255, 255, .9)',
|
||||
plotShadow: true,
|
||||
plotBorderWidth: 1
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#000',
|
||||
font: 'bold 16px "Trebuchet MS", Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
subtitle: {
|
||||
style: {
|
||||
color: '#666666',
|
||||
font: 'bold 12px "Trebuchet MS", Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
gridLineWidth: 1,
|
||||
lineColor: '#000',
|
||||
tickColor: '#000',
|
||||
labels: {
|
||||
style: {
|
||||
color: '#000',
|
||||
font: '11px Trebuchet MS, Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#333',
|
||||
fontWeight: 'bold',
|
||||
fontSize: '12px',
|
||||
fontFamily: 'Trebuchet MS, Verdana, sans-serif'
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
minorTickInterval: 'auto',
|
||||
lineColor: '#000',
|
||||
lineWidth: 1,
|
||||
tickWidth: 1,
|
||||
tickColor: '#000',
|
||||
labels: {
|
||||
style: {
|
||||
color: '#000',
|
||||
font: '11px Trebuchet MS, Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#333',
|
||||
fontWeight: 'bold',
|
||||
fontSize: '12px',
|
||||
fontFamily: 'Trebuchet MS, Verdana, sans-serif'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
itemStyle: {
|
||||
font: '9pt Trebuchet MS, Verdana, sans-serif',
|
||||
color: 'black'
|
||||
|
||||
},
|
||||
itemHoverStyle: {
|
||||
color: '#039'
|
||||
},
|
||||
itemHiddenStyle: {
|
||||
color: 'gray'
|
||||
}
|
||||
},
|
||||
labels: {
|
||||
style: {
|
||||
color: '#99b'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Apply the theme
|
||||
var highchartsOptions = Highcharts.setOptions(Highcharts.theme);
|
||||
@@ -0,0 +1,89 @@
|
||||
/**
|
||||
* Skies theme for Highcharts JS
|
||||
* @author Torstein Hønsi
|
||||
*/
|
||||
|
||||
Highcharts.theme = {
|
||||
colors: ["#514F78", "#42A07B", "#9B5E4A", "#72727F", "#1F949A", "#82914E", "#86777F", "#42A07B"],
|
||||
chart: {
|
||||
className: 'skies',
|
||||
borderWidth: 0,
|
||||
plotShadow: true,
|
||||
plotBackgroundImage: '/demo/gfx/skies.jpg',
|
||||
plotBackgroundColor: {
|
||||
linearGradient: [0, 0, 250, 500],
|
||||
stops: [
|
||||
[0, 'rgba(255, 255, 255, 1)'],
|
||||
[1, 'rgba(255, 255, 255, 0)']
|
||||
]
|
||||
},
|
||||
plotBorderWidth: 1
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#3E576F',
|
||||
font: '16px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
|
||||
}
|
||||
},
|
||||
subtitle: {
|
||||
style: {
|
||||
color: '#6D869F',
|
||||
font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
gridLineWidth: 0,
|
||||
lineColor: '#C0D0E0',
|
||||
tickColor: '#C0D0E0',
|
||||
labels: {
|
||||
style: {
|
||||
color: '#666',
|
||||
fontWeight: 'bold'
|
||||
}
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#666',
|
||||
font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
alternateGridColor: 'rgba(255, 255, 255, .5)',
|
||||
lineColor: '#C0D0E0',
|
||||
tickColor: '#C0D0E0',
|
||||
tickWidth: 1,
|
||||
labels: {
|
||||
style: {
|
||||
color: '#666',
|
||||
fontWeight: 'bold'
|
||||
}
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#666',
|
||||
font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
itemStyle: {
|
||||
font: '9pt Trebuchet MS, Verdana, sans-serif',
|
||||
color: '#3E576F'
|
||||
},
|
||||
itemHoverStyle: {
|
||||
color: 'black'
|
||||
},
|
||||
itemHiddenStyle: {
|
||||
color: 'silver'
|
||||
}
|
||||
},
|
||||
labels: {
|
||||
style: {
|
||||
color: '#3E576F'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Apply the theme
|
||||
var highchartsOptions = Highcharts.setOptions(Highcharts.theme);
|
||||
@@ -0,0 +1,87 @@
|
||||
///#source 1 1 /ClientSource/Scripts/Modules/Knockout/knockout-2.2.0.js
|
||||
// Knockout JavaScript library v2.2.0
|
||||
// (c) Steven Sanderson - http://knockoutjs.com/
|
||||
// License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
||||
|
||||
(function() {function i(v){throw v;}var l=!0,n=null,q=!1;function t(v){return function(){return v}};var w=window,x=document,fa=navigator,E=window.jQuery,H=void 0;
|
||||
function K(v){function ga(a,d,c,e,f){var g=[],a=b.j(function(){var a=d(c,f)||[];0<g.length&&(b.a.Xa(L(g),a),e&&b.r.K(e,n,[c,a,f]));g.splice(0,g.length);b.a.P(g,a)},n,{W:a,Ja:function(){return 0==g.length||!b.a.X(g[0])}});return{M:g,j:a.oa()?a:H}}function L(a){for(;a.length&&!b.a.X(a[0]);)a.splice(0,1);if(1<a.length){for(var d=a[0],c=a[a.length-1],e=[d];d!==c;){d=d.nextSibling;if(!d)return;e.push(d)}Array.prototype.splice.apply(a,[0,a.length].concat(e))}return a}function R(a,b,c,e,f){var g=Math.min,
|
||||
h=Math.max,j=[],k,m=a.length,p,r=b.length,u=r-m||1,F=m+r+1,I,z,y;for(k=0;k<=m;k++){z=I;j.push(I=[]);y=g(r,k+u);for(p=h(0,k-1);p<=y;p++)I[p]=p?k?a[k-1]===b[p-1]?z[p-1]:g(z[p]||F,I[p-1]||F)+1:p+1:k+1}g=[];h=[];u=[];k=m;for(p=r;k||p;)r=j[k][p]-1,p&&r===j[k][p-1]?h.push(g[g.length]={status:c,value:b[--p],index:p}):k&&r===j[k-1][p]?u.push(g[g.length]={status:e,value:a[--k],index:k}):(g.push({status:"retained",value:b[--p]}),--k);if(h.length&&u.length)for(var a=10*m,s,b=c=0;(f||b<a)&&(s=h[c]);c++){for(e=
|
||||
0;j=u[e];e++)if(s.value===j.value){s.moved=j.index;j.moved=s.index;u.splice(e,1);b=e=0;break}b+=e}return g.reverse()}function S(a,d,c,e,f){var f=f||{},g=a&&M(a),g=g&&g.ownerDocument,h=f.templateEngine||N;b.ya.ub(c,h,g);c=h.renderTemplate(c,e,f,g);("number"!=typeof c.length||0<c.length&&"number"!=typeof c[0].nodeType)&&i(Error("Template engine must return an array of DOM nodes"));g=q;switch(d){case "replaceChildren":b.e.N(a,c);g=l;break;case "replaceNode":b.a.Xa(a,c);g=l;break;case "ignoreTargetNode":break;
|
||||
default:i(Error("Unknown renderMode: "+d))}g&&(T(c,e),f.afterRender&&b.r.K(f.afterRender,n,[c,e.$data]));return c}function M(a){return a.nodeType?a:0<a.length?a[0]:n}function T(a,d){if(a.length){var c=a[0],e=a[a.length-1];U(c,e,function(a){b.Ca(d,a)});U(c,e,function(a){b.s.hb(a,[d])})}}function U(a,d,c){for(var e,d=b.e.nextSibling(d);a&&(e=a)!==d;)a=b.e.nextSibling(e),(1===e.nodeType||8===e.nodeType)&&c(e)}function V(a,d,c){for(var a=b.g.aa(a),e=b.g.Q,f=0;f<a.length;f++){var g=a[f].key;if(e.hasOwnProperty(g)){var h=
|
||||
e[g];"function"===typeof h?(g=h(a[f].value))&&i(Error(g)):h||i(Error("This template engine does not support the '"+g+"' binding within its templates"))}}a="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+b.g.ba(a)+" } })()})";return c.createJavaScriptEvaluatorBlock(a)+d}function W(a,d,c,e){function f(a){return function(){return j[a]}}function g(){return j}var h=0,j,k;b.j(function(){var m=c&&c instanceof b.z?c:new b.z(b.a.d(c)),p=m.$data;e&&b.cb(a,m);if(j=("function"==typeof d?
|
||||
d(m,a):d)||b.J.instance.getBindings(a,m)){if(0===h){h=1;for(var r in j){var u=b.c[r];u&&8===a.nodeType&&!b.e.I[r]&&i(Error("The binding '"+r+"' cannot be used with virtual elements"));if(u&&"function"==typeof u.init&&(u=(0,u.init)(a,f(r),g,p,m))&&u.controlsDescendantBindings)k!==H&&i(Error("Multiple bindings ("+k+" and "+r+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.")),k=r}h=2}if(2===h)for(r in j)(u=b.c[r])&&"function"==
|
||||
typeof u.update&&(0,u.update)(a,f(r),g,p,m)}},n,{W:a});return{Mb:k===H}}function X(a,d,c){var e=l,f=1===d.nodeType;f&&b.e.Sa(d);if(f&&c||b.J.instance.nodeHasBindings(d))e=W(d,n,a,c).Mb;e&&Y(a,d,!f)}function Y(a,d,c){for(var e=b.e.firstChild(d);d=e;)e=b.e.nextSibling(d),X(a,d,c)}function Z(a,b){var c=$(a,b);return c?0<c.length?c[c.length-1].nextSibling:a.nextSibling:n}function $(a,b){for(var c=a,e=1,f=[];c=c.nextSibling;){if(G(c)&&(e--,0===e))return f;f.push(c);A(c)&&e++}b||i(Error("Cannot find closing comment tag to match: "+
|
||||
a.nodeValue));return n}function G(a){return 8==a.nodeType&&(J?a.text:a.nodeValue).match(ha)}function A(a){return 8==a.nodeType&&(J?a.text:a.nodeValue).match(ia)}function O(a,b){for(var c=n;a!=c;)c=a,a=a.replace(ja,function(a,c){return b[c]});return a}function ka(){var a=[],d=[];this.save=function(c,e){var f=b.a.i(a,c);0<=f?d[f]=e:(a.push(c),d.push(e))};this.get=function(c){c=b.a.i(a,c);return 0<=c?d[c]:H}}function aa(a,b,c){function e(e){var g=b(a[e]);switch(typeof g){case "boolean":case "number":case "string":case "function":f[e]=
|
||||
g;break;case "object":case "undefined":var h=c.get(g);f[e]=h!==H?h:aa(g,b,c)}}c=c||new ka;a=b(a);if(!("object"==typeof a&&a!==n&&a!==H&&!(a instanceof Date)))return a;var f=a instanceof Array?[]:{};c.save(a,f);var g=a;if(g instanceof Array){for(var h=0;h<g.length;h++)e(h);"function"==typeof g.toJSON&&e("toJSON")}else for(h in g)e(h);return f}function ba(a,d){if(a)if(8==a.nodeType){var c=b.s.Ta(a.nodeValue);c!=n&&d.push({rb:a,Eb:c})}else if(1==a.nodeType)for(var c=0,e=a.childNodes,f=e.length;c<f;c++)ba(e[c],
|
||||
d)}function P(a,d,c,e){b.c[a]={init:function(a){b.a.f.set(a,ca,{});return{controlsDescendantBindings:l}},update:function(a,g,h,j,k){var h=b.a.f.get(a,ca),g=b.a.d(g()),j=!c!==!g,m=!h.Ya;if(m||d||j!==h.pb)m&&(h.Ya=b.a.Ha(b.e.childNodes(a),l)),j?(m||b.e.N(a,b.a.Ha(h.Ya)),b.Da(e?e(k,g):k,a)):b.e.Y(a),h.pb=j}};b.g.Q[a]=q;b.e.I[a]=l}function da(a,d,c){c&&d!==b.k.q(a)&&b.k.T(a,d);d!==b.k.q(a)&&b.r.K(b.a.Aa,n,[a,"change"])}var b="undefined"!==typeof v?v:{};b.b=function(a,d){for(var c=a.split("."),e=b,f=0;f<
|
||||
c.length-1;f++)e=e[c[f]];e[c[c.length-1]]=d};b.p=function(a,b,c){a[b]=c};b.version="2.2.0";b.b("version",b.version);b.a=new function(){function a(a,d){if("input"!==b.a.u(a)||!a.type||"click"!=d.toLowerCase())return q;var c=a.type;return"checkbox"==c||"radio"==c}var d=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,c={},e={};c[/Firefox\/2/i.test(fa.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"];c.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" ");
|
||||
for(var f in c){var g=c[f];if(g.length)for(var h=0,j=g.length;h<j;h++)e[g[h]]=f}var k={propertychange:l},m,c=3;f=x.createElement("div");for(g=f.getElementsByTagName("i");f.innerHTML="<\!--[if gt IE "+ ++c+"]><i></i><![endif]--\>",g[0];);m=4<c?c:H;return{Ma:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],o:function(a,b){for(var d=0,c=a.length;d<c;d++)b(a[d])},i:function(a,b){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(a,b);for(var d=0,c=a.length;d<
|
||||
c;d++)if(a[d]===b)return d;return-1},kb:function(a,b,d){for(var c=0,e=a.length;c<e;c++)if(b.call(d,a[c]))return a[c];return n},ga:function(a,d){var c=b.a.i(a,d);0<=c&&a.splice(c,1)},Fa:function(a){for(var a=a||[],d=[],c=0,e=a.length;c<e;c++)0>b.a.i(d,a[c])&&d.push(a[c]);return d},V:function(a,b){for(var a=a||[],d=[],c=0,e=a.length;c<e;c++)d.push(b(a[c]));return d},fa:function(a,b){for(var a=a||[],d=[],c=0,e=a.length;c<e;c++)b(a[c])&&d.push(a[c]);return d},P:function(a,b){if(b instanceof Array)a.push.apply(a,
|
||||
b);else for(var d=0,c=b.length;d<c;d++)a.push(b[d]);return a},extend:function(a,b){if(b)for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);return a},ka:function(a){for(;a.firstChild;)b.removeNode(a.firstChild)},Gb:function(a){for(var a=b.a.L(a),d=x.createElement("div"),c=0,e=a.length;c<e;c++)d.appendChild(b.A(a[c]));return d},Ha:function(a,d){for(var c=0,e=a.length,g=[];c<e;c++){var f=a[c].cloneNode(l);g.push(d?b.A(f):f)}return g},N:function(a,d){b.a.ka(a);if(d)for(var c=0,e=d.length;c<e;c++)a.appendChild(d[c])},
|
||||
Xa:function(a,d){var c=a.nodeType?[a]:a;if(0<c.length){for(var e=c[0],g=e.parentNode,f=0,h=d.length;f<h;f++)g.insertBefore(d[f],e);f=0;for(h=c.length;f<h;f++)b.removeNode(c[f])}},ab:function(a,b){7>m?a.setAttribute("selected",b):a.selected=b},D:function(a){return(a||"").replace(d,"")},Qb:function(a,d){for(var c=[],e=(a||"").split(d),f=0,g=e.length;f<g;f++){var h=b.a.D(e[f]);""!==h&&c.push(h)}return c},Nb:function(a,b){a=a||"";return b.length>a.length?q:a.substring(0,b.length)===b},sb:function(a,b){if(b.compareDocumentPosition)return 16==
|
||||
(b.compareDocumentPosition(a)&16);for(;a!=n;){if(a==b)return l;a=a.parentNode}return q},X:function(a){return b.a.sb(a,a.ownerDocument)},u:function(a){return a&&a.tagName&&a.tagName.toLowerCase()},n:function(b,d,c){var e=m&&k[d];if(!e&&"undefined"!=typeof E){if(a(b,d))var f=c,c=function(a,b){var d=this.checked;b&&(this.checked=b.mb!==l);f.call(this,a);this.checked=d};E(b).bind(d,c)}else!e&&"function"==typeof b.addEventListener?b.addEventListener(d,c,q):"undefined"!=typeof b.attachEvent?b.attachEvent("on"+
|
||||
d,function(a){c.call(b,a)}):i(Error("Browser doesn't support addEventListener or attachEvent"))},Aa:function(b,d){(!b||!b.nodeType)&&i(Error("element must be a DOM node when calling triggerEvent"));if("undefined"!=typeof E){var c=[];a(b,d)&&c.push({mb:b.checked});E(b).trigger(d,c)}else"function"==typeof x.createEvent?"function"==typeof b.dispatchEvent?(c=x.createEvent(e[d]||"HTMLEvents"),c.initEvent(d,l,l,w,0,0,0,0,0,q,q,q,q,0,b),b.dispatchEvent(c)):i(Error("The supplied element doesn't support dispatchEvent")):
|
||||
"undefined"!=typeof b.fireEvent?(a(b,d)&&(b.checked=b.checked!==l),b.fireEvent("on"+d)):i(Error("Browser doesn't support triggering events"))},d:function(a){return b.$(a)?a():a},ta:function(a){return b.$(a)?a.t():a},da:function(a,d,c){if(d){var e=/[\w-]+/g,f=a.className.match(e)||[];b.a.o(d.match(e),function(a){var d=b.a.i(f,a);0<=d?c||f.splice(d,1):c&&f.push(a)});a.className=f.join(" ")}},bb:function(a,d){var c=b.a.d(d);if(c===n||c===H)c="";if(3===a.nodeType)a.data=c;else{var e=b.e.firstChild(a);
|
||||
!e||3!=e.nodeType||b.e.nextSibling(e)?b.e.N(a,[x.createTextNode(c)]):e.data=c;b.a.vb(a)}},$a:function(a,b){a.name=b;if(7>=m)try{a.mergeAttributes(x.createElement("<input name='"+a.name+"'/>"),q)}catch(d){}},vb:function(a){9<=m&&(a=1==a.nodeType?a:a.parentNode,a.style&&(a.style.zoom=a.style.zoom))},tb:function(a){if(9<=m){var b=a.style.width;a.style.width=0;a.style.width=b}},Kb:function(a,d){for(var a=b.a.d(a),d=b.a.d(d),c=[],e=a;e<=d;e++)c.push(e);return c},L:function(a){for(var b=[],d=0,c=a.length;d<
|
||||
c;d++)b.push(a[d]);return b},Ob:6===m,Pb:7===m,Z:m,Na:function(a,d){for(var c=b.a.L(a.getElementsByTagName("input")).concat(b.a.L(a.getElementsByTagName("textarea"))),e="string"==typeof d?function(a){return a.name===d}:function(a){return d.test(a.name)},f=[],g=c.length-1;0<=g;g--)e(c[g])&&f.push(c[g]);return f},Hb:function(a){return"string"==typeof a&&(a=b.a.D(a))?w.JSON&&w.JSON.parse?w.JSON.parse(a):(new Function("return "+a))():n},wa:function(a,d,c){("undefined"==typeof JSON||"undefined"==typeof JSON.stringify)&&
|
||||
i(Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js"));return JSON.stringify(b.a.d(a),d,c)},Ib:function(a,d,c){var c=c||{},e=c.params||{},f=c.includeFields||this.Ma,g=a;if("object"==typeof a&&"form"===b.a.u(a))for(var g=a.action,h=f.length-1;0<=h;h--)for(var j=b.a.Na(a,f[h]),k=j.length-1;0<=k;k--)e[j[k].name]=j[k].value;var d=b.a.d(d),m=x.createElement("form");
|
||||
m.style.display="none";m.action=g;m.method="post";for(var v in d)a=x.createElement("input"),a.name=v,a.value=b.a.wa(b.a.d(d[v])),m.appendChild(a);for(v in e)a=x.createElement("input"),a.name=v,a.value=e[v],m.appendChild(a);x.body.appendChild(m);c.submitter?c.submitter(m):m.submit();setTimeout(function(){m.parentNode.removeChild(m)},0)}}};b.b("utils",b.a);b.b("utils.arrayForEach",b.a.o);b.b("utils.arrayFirst",b.a.kb);b.b("utils.arrayFilter",b.a.fa);b.b("utils.arrayGetDistinctValues",b.a.Fa);b.b("utils.arrayIndexOf",
|
||||
b.a.i);b.b("utils.arrayMap",b.a.V);b.b("utils.arrayPushAll",b.a.P);b.b("utils.arrayRemoveItem",b.a.ga);b.b("utils.extend",b.a.extend);b.b("utils.fieldsIncludedWithJsonPost",b.a.Ma);b.b("utils.getFormFields",b.a.Na);b.b("utils.peekObservable",b.a.ta);b.b("utils.postJson",b.a.Ib);b.b("utils.parseJson",b.a.Hb);b.b("utils.registerEventHandler",b.a.n);b.b("utils.stringifyJson",b.a.wa);b.b("utils.range",b.a.Kb);b.b("utils.toggleDomNodeCssClass",b.a.da);b.b("utils.triggerEvent",b.a.Aa);b.b("utils.unwrapObservable",
|
||||
b.a.d);Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Array.prototype.slice.call(arguments),a=c.shift();return function(){return b.apply(a,c.concat(Array.prototype.slice.call(arguments)))}});b.a.f=new function(){var a=0,d="__ko__"+(new Date).getTime(),c={};return{get:function(a,d){var c=b.a.f.getAll(a,q);return c===H?H:c[d]},set:function(a,d,c){c===H&&b.a.f.getAll(a,q)===H||(b.a.f.getAll(a,l)[d]=c)},getAll:function(b,f){var g=b[d];if(!g||!("null"!==g&&c[g])){if(!f)return H;
|
||||
g=b[d]="ko"+a++;c[g]={}}return c[g]},clear:function(a){var b=a[d];return b?(delete c[b],a[d]=n,l):q}}};b.b("utils.domData",b.a.f);b.b("utils.domData.clear",b.a.f.clear);b.a.F=new function(){function a(a,d){var e=b.a.f.get(a,c);e===H&&d&&(e=[],b.a.f.set(a,c,e));return e}function d(c){var e=a(c,q);if(e)for(var e=e.slice(0),j=0;j<e.length;j++)e[j](c);b.a.f.clear(c);"function"==typeof E&&"function"==typeof E.cleanData&&E.cleanData([c]);if(f[c.nodeType])for(e=c.firstChild;c=e;)e=c.nextSibling,8===c.nodeType&&
|
||||
d(c)}var c="__ko_domNodeDisposal__"+(new Date).getTime(),e={1:l,8:l,9:l},f={1:l,9:l};return{Ba:function(b,d){"function"!=typeof d&&i(Error("Callback must be a function"));a(b,l).push(d)},Wa:function(d,e){var f=a(d,q);f&&(b.a.ga(f,e),0==f.length&&b.a.f.set(d,c,H))},A:function(a){if(e[a.nodeType]&&(d(a),f[a.nodeType])){var c=[];b.a.P(c,a.getElementsByTagName("*"));for(var j=0,k=c.length;j<k;j++)d(c[j])}return a},removeNode:function(a){b.A(a);a.parentNode&&a.parentNode.removeChild(a)}}};b.A=b.a.F.A;
|
||||
b.removeNode=b.a.F.removeNode;b.b("cleanNode",b.A);b.b("removeNode",b.removeNode);b.b("utils.domNodeDisposal",b.a.F);b.b("utils.domNodeDisposal.addDisposeCallback",b.a.F.Ba);b.b("utils.domNodeDisposal.removeDisposeCallback",b.a.F.Wa);b.a.sa=function(a){var d;if("undefined"!=typeof E){if((d=E.clean([a]))&&d[0]){for(a=d[0];a.parentNode&&11!==a.parentNode.nodeType;)a=a.parentNode;a.parentNode&&a.parentNode.removeChild(a)}}else{var c=b.a.D(a).toLowerCase();d=x.createElement("div");c=c.match(/^<(thead|tbody|tfoot)/)&&
|
||||
[1,"<table>","</table>"]||!c.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!c.indexOf("<td")||!c.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||[0,"",""];a="ignored<div>"+c[1]+a+c[2]+"</div>";for("function"==typeof w.innerShiv?d.appendChild(w.innerShiv(a)):d.innerHTML=a;c[0]--;)d=d.lastChild;d=b.a.L(d.lastChild.childNodes)}return d};b.a.ca=function(a,d){b.a.ka(a);d=b.a.d(d);if(d!==n&&d!==H)if("string"!=typeof d&&(d=d.toString()),"undefined"!=typeof E)E(a).html(d);else for(var c=
|
||||
b.a.sa(d),e=0;e<c.length;e++)a.appendChild(c[e])};b.b("utils.parseHtmlFragment",b.a.sa);b.b("utils.setHtml",b.a.ca);var Q={};b.s={qa:function(a){"function"!=typeof a&&i(Error("You can only pass a function to ko.memoization.memoize()"));var b=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);Q[b]=a;return"<\!--[ko_memo:"+b+"]--\>"},gb:function(a,b){var c=Q[a];c===H&&i(Error("Couldn't find any memo with ID "+a+". Perhaps it's already been unmemoized."));
|
||||
try{return c.apply(n,b||[]),l}finally{delete Q[a]}},hb:function(a,d){var c=[];ba(a,c);for(var e=0,f=c.length;e<f;e++){var g=c[e].rb,h=[g];d&&b.a.P(h,d);b.s.gb(c[e].Eb,h);g.nodeValue="";g.parentNode&&g.parentNode.removeChild(g)}},Ta:function(a){return(a=a.match(/^\[ko_memo\:(.*?)\]$/))?a[1]:n}};b.b("memoization",b.s);b.b("memoization.memoize",b.s.qa);b.b("memoization.unmemoize",b.s.gb);b.b("memoization.parseMemoText",b.s.Ta);b.b("memoization.unmemoizeDomNodeAndDescendants",b.s.hb);b.La={throttle:function(a,
|
||||
d){a.throttleEvaluation=d;var c=n;return b.j({read:a,write:function(b){clearTimeout(c);c=setTimeout(function(){a(b)},d)}})},notify:function(a,d){a.equalityComparer="always"==d?t(q):b.m.fn.equalityComparer;return a}};b.b("extenders",b.La);b.eb=function(a,d,c){this.target=a;this.ha=d;this.qb=c;b.p(this,"dispose",this.B)};b.eb.prototype.B=function(){this.Bb=l;this.qb()};b.S=function(){this.w={};b.a.extend(this,b.S.fn);b.p(this,"subscribe",this.xa);b.p(this,"extend",this.extend);b.p(this,"getSubscriptionsCount",
|
||||
this.xb)};b.S.fn={xa:function(a,d,c){var c=c||"change",a=d?a.bind(d):a,e=new b.eb(this,a,function(){b.a.ga(this.w[c],e)}.bind(this));this.w[c]||(this.w[c]=[]);this.w[c].push(e);return e},notifySubscribers:function(a,d){d=d||"change";this.w[d]&&b.r.K(function(){b.a.o(this.w[d].slice(0),function(b){b&&b.Bb!==l&&b.ha(a)})},this)},xb:function(){var a=0,b;for(b in this.w)this.w.hasOwnProperty(b)&&(a+=this.w[b].length);return a},extend:function(a){var d=this;if(a)for(var c in a){var e=b.La[c];"function"==
|
||||
typeof e&&(d=e(d,a[c]))}return d}};b.Pa=function(a){return"function"==typeof a.xa&&"function"==typeof a.notifySubscribers};b.b("subscribable",b.S);b.b("isSubscribable",b.Pa);var B=[];b.r={lb:function(a){B.push({ha:a,Ka:[]})},end:function(){B.pop()},Va:function(a){b.Pa(a)||i(Error("Only subscribable things can act as dependencies"));if(0<B.length){var d=B[B.length-1];d&&!(0<=b.a.i(d.Ka,a))&&(d.Ka.push(a),d.ha(a))}},K:function(a,b,c){try{return B.push(n),a.apply(b,c||[])}finally{B.pop()}}};var la={undefined:l,
|
||||
"boolean":l,number:l,string:l};b.m=function(a){function d(){if(0<arguments.length){if(!d.equalityComparer||!d.equalityComparer(c,arguments[0]))d.H(),c=arguments[0],d.G();return this}b.r.Va(d);return c}var c=a;b.S.call(d);d.t=function(){return c};d.G=function(){d.notifySubscribers(c)};d.H=function(){d.notifySubscribers(c,"beforeChange")};b.a.extend(d,b.m.fn);b.p(d,"peek",d.t);b.p(d,"valueHasMutated",d.G);b.p(d,"valueWillMutate",d.H);return d};b.m.fn={equalityComparer:function(a,b){return a===n||typeof a in
|
||||
la?a===b:q}};var D=b.m.Jb="__ko_proto__";b.m.fn[D]=b.m;b.la=function(a,d){return a===n||a===H||a[D]===H?q:a[D]===d?l:b.la(a[D],d)};b.$=function(a){return b.la(a,b.m)};b.Qa=function(a){return"function"==typeof a&&a[D]===b.m||"function"==typeof a&&a[D]===b.j&&a.yb?l:q};b.b("observable",b.m);b.b("isObservable",b.$);b.b("isWriteableObservable",b.Qa);b.R=function(a){0==arguments.length&&(a=[]);a!==n&&(a!==H&&!("length"in a))&&i(Error("The argument passed when initializing an observable array must be an array, or null, or undefined."));
|
||||
var d=b.m(a);b.a.extend(d,b.R.fn);return d};b.R.fn={remove:function(a){for(var b=this.t(),c=[],e="function"==typeof a?a:function(b){return b===a},f=0;f<b.length;f++){var g=b[f];e(g)&&(0===c.length&&this.H(),c.push(g),b.splice(f,1),f--)}c.length&&this.G();return c},removeAll:function(a){if(a===H){var d=this.t(),c=d.slice(0);this.H();d.splice(0,d.length);this.G();return c}return!a?[]:this.remove(function(d){return 0<=b.a.i(a,d)})},destroy:function(a){var b=this.t(),c="function"==typeof a?a:function(b){return b===
|
||||
a};this.H();for(var e=b.length-1;0<=e;e--)c(b[e])&&(b[e]._destroy=l);this.G()},destroyAll:function(a){return a===H?this.destroy(t(l)):!a?[]:this.destroy(function(d){return 0<=b.a.i(a,d)})},indexOf:function(a){var d=this();return b.a.i(d,a)},replace:function(a,b){var c=this.indexOf(a);0<=c&&(this.H(),this.t()[c]=b,this.G())}};b.a.o("pop push reverse shift sort splice unshift".split(" "),function(a){b.R.fn[a]=function(){var b=this.t();this.H();b=b[a].apply(b,arguments);this.G();return b}});b.a.o(["slice"],
|
||||
function(a){b.R.fn[a]=function(){var b=this();return b[a].apply(b,arguments)}});b.b("observableArray",b.R);b.j=function(a,d,c){function e(){b.a.o(y,function(a){a.B()});y=[]}function f(){var a=h.throttleEvaluation;a&&0<=a?(clearTimeout(s),s=setTimeout(g,a)):g()}function g(){if(!p)if(m&&v())z();else{p=l;try{var a=b.a.V(y,function(a){return a.target});b.r.lb(function(c){var d;0<=(d=b.a.i(a,c))?a[d]=H:y.push(c.xa(f))});for(var c=r.call(d),e=a.length-1;0<=e;e--)a[e]&&y.splice(e,1)[0].B();m=l;h.notifySubscribers(k,
|
||||
"beforeChange");k=c}finally{b.r.end()}h.notifySubscribers(k);p=q;y.length||z()}}function h(){if(0<arguments.length)return"function"===typeof u?u.apply(d,arguments):i(Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.")),this;m||g();b.r.Va(h);return k}function j(){return!m||0<y.length}var k,m=q,p=q,r=a;r&&"object"==typeof r?(c=r,r=c.read):(c=c||{},r||(r=c.read));"function"!=typeof r&&i(Error("Pass a function that returns the value of the ko.computed"));
|
||||
var u=c.write,F=c.disposeWhenNodeIsRemoved||c.W||n,v=c.disposeWhen||c.Ja||t(q),z=e,y=[],s=n;d||(d=c.owner);h.t=function(){m||g();return k};h.wb=function(){return y.length};h.yb="function"===typeof c.write;h.B=function(){z()};h.oa=j;b.S.call(h);b.a.extend(h,b.j.fn);b.p(h,"peek",h.t);b.p(h,"dispose",h.B);b.p(h,"isActive",h.oa);b.p(h,"getDependenciesCount",h.wb);c.deferEvaluation!==l&&g();if(F&&j()){z=function(){b.a.F.Wa(F,arguments.callee);e()};b.a.F.Ba(F,z);var C=v,v=function(){return!b.a.X(F)||C()}}return h};
|
||||
b.Ab=function(a){return b.la(a,b.j)};v=b.m.Jb;b.j[v]=b.m;b.j.fn={};b.j.fn[v]=b.j;b.b("dependentObservable",b.j);b.b("computed",b.j);b.b("isComputed",b.Ab);b.fb=function(a){0==arguments.length&&i(Error("When calling ko.toJS, pass the object you want to convert."));return aa(a,function(a){for(var c=0;b.$(a)&&10>c;c++)a=a();return a})};b.toJSON=function(a,d,c){a=b.fb(a);return b.a.wa(a,d,c)};b.b("toJS",b.fb);b.b("toJSON",b.toJSON);b.k={q:function(a){switch(b.a.u(a)){case "option":return a.__ko__hasDomDataOptionValue__===
|
||||
l?b.a.f.get(a,b.c.options.ra):7>=b.a.Z?a.getAttributeNode("value").specified?a.value:a.text:a.value;case "select":return 0<=a.selectedIndex?b.k.q(a.options[a.selectedIndex]):H;default:return a.value}},T:function(a,d){switch(b.a.u(a)){case "option":switch(typeof d){case "string":b.a.f.set(a,b.c.options.ra,H);"__ko__hasDomDataOptionValue__"in a&&delete a.__ko__hasDomDataOptionValue__;a.value=d;break;default:b.a.f.set(a,b.c.options.ra,d),a.__ko__hasDomDataOptionValue__=l,a.value="number"===typeof d?
|
||||
d:""}break;case "select":for(var c=a.options.length-1;0<=c;c--)if(b.k.q(a.options[c])==d){a.selectedIndex=c;break}break;default:if(d===n||d===H)d="";a.value=d}}};b.b("selectExtensions",b.k);b.b("selectExtensions.readValue",b.k.q);b.b("selectExtensions.writeValue",b.k.T);var ja=/\@ko_token_(\d+)\@/g,ma=["true","false"],na=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i;b.g={Q:[],aa:function(a){var d=b.a.D(a);if(3>d.length)return[];"{"===d.charAt(0)&&(d=d.substring(1,d.length-1));for(var a=[],
|
||||
c=n,e,f=0;f<d.length;f++){var g=d.charAt(f);if(c===n)switch(g){case '"':case "'":case "/":c=f,e=g}else if(g==e&&"\\"!==d.charAt(f-1)){g=d.substring(c,f+1);a.push(g);var h="@ko_token_"+(a.length-1)+"@",d=d.substring(0,c)+h+d.substring(f+1),f=f-(g.length-h.length),c=n}}e=c=n;for(var j=0,k=n,f=0;f<d.length;f++){g=d.charAt(f);if(c===n)switch(g){case "{":c=f;k=g;e="}";break;case "(":c=f;k=g;e=")";break;case "[":c=f,k=g,e="]"}g===k?j++:g===e&&(j--,0===j&&(g=d.substring(c,f+1),a.push(g),h="@ko_token_"+(a.length-
|
||||
1)+"@",d=d.substring(0,c)+h+d.substring(f+1),f-=g.length-h.length,c=n))}e=[];d=d.split(",");c=0;for(f=d.length;c<f;c++)j=d[c],k=j.indexOf(":"),0<k&&k<j.length-1?(g=j.substring(k+1),e.push({key:O(j.substring(0,k),a),value:O(g,a)})):e.push({unknown:O(j,a)});return e},ba:function(a){for(var d="string"===typeof a?b.g.aa(a):a,c=[],a=[],e,f=0;e=d[f];f++)if(0<c.length&&c.push(","),e.key){var g;a:{g=e.key;var h=b.a.D(g);switch(h.length&&h.charAt(0)){case "'":case '"':break a;default:g="'"+h+"'"}}e=e.value;
|
||||
c.push(g);c.push(":");c.push(e);e=b.a.D(e);0<=b.a.i(ma,b.a.D(e).toLowerCase())?e=q:(h=e.match(na),e=h===n?q:h[1]?"Object("+h[1]+")"+h[2]:e);e&&(0<a.length&&a.push(", "),a.push(g+" : function(__ko_value) { "+e+" = __ko_value; }"))}else e.unknown&&c.push(e.unknown);d=c.join("");0<a.length&&(d=d+", '_ko_property_writers' : { "+a.join("")+" } ");return d},Db:function(a,d){for(var c=0;c<a.length;c++)if(b.a.D(a[c].key)==d)return l;return q},ea:function(a,d,c,e,f){if(!a||!b.Qa(a)){if((a=d()._ko_property_writers)&&
|
||||
a[c])a[c](e)}else(!f||a.t()!==e)&&a(e)}};b.b("expressionRewriting",b.g);b.b("expressionRewriting.bindingRewriteValidators",b.g.Q);b.b("expressionRewriting.parseObjectLiteral",b.g.aa);b.b("expressionRewriting.preProcessBindings",b.g.ba);b.b("jsonExpressionRewriting",b.g);b.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",b.g.ba);var J="<\!--test--\>"===x.createComment("test").text,ia=J?/^<\!--\s*ko(?:\s+(.+\s*\:[\s\S]*))?\s*--\>$/:/^\s*ko(?:\s+(.+\s*\:[\s\S]*))?\s*$/,ha=J?/^<\!--\s*\/ko\s*--\>$/:
|
||||
/^\s*\/ko\s*$/,oa={ul:l,ol:l};b.e={I:{},childNodes:function(a){return A(a)?$(a):a.childNodes},Y:function(a){if(A(a))for(var a=b.e.childNodes(a),d=0,c=a.length;d<c;d++)b.removeNode(a[d]);else b.a.ka(a)},N:function(a,d){if(A(a)){b.e.Y(a);for(var c=a.nextSibling,e=0,f=d.length;e<f;e++)c.parentNode.insertBefore(d[e],c)}else b.a.N(a,d)},Ua:function(a,b){A(a)?a.parentNode.insertBefore(b,a.nextSibling):a.firstChild?a.insertBefore(b,a.firstChild):a.appendChild(b)},Oa:function(a,d,c){c?A(a)?a.parentNode.insertBefore(d,
|
||||
c.nextSibling):c.nextSibling?a.insertBefore(d,c.nextSibling):a.appendChild(d):b.e.Ua(a,d)},firstChild:function(a){return!A(a)?a.firstChild:!a.nextSibling||G(a.nextSibling)?n:a.nextSibling},nextSibling:function(a){A(a)&&(a=Z(a));return a.nextSibling&&G(a.nextSibling)?n:a.nextSibling},ib:function(a){return(a=A(a))?a[1]:n},Sa:function(a){if(oa[b.a.u(a)]){var d=a.firstChild;if(d){do if(1===d.nodeType){var c;c=d.firstChild;var e=n;if(c){do if(e)e.push(c);else if(A(c)){var f=Z(c,l);f?c=f:e=[c]}else G(c)&&
|
||||
(e=[c]);while(c=c.nextSibling)}if(c=e){e=d.nextSibling;for(f=0;f<c.length;f++)e?a.insertBefore(c[f],e):a.appendChild(c[f])}}while(d=d.nextSibling)}}}};b.b("virtualElements",b.e);b.b("virtualElements.allowedBindings",b.e.I);b.b("virtualElements.emptyNode",b.e.Y);b.b("virtualElements.insertAfter",b.e.Oa);b.b("virtualElements.prepend",b.e.Ua);b.b("virtualElements.setDomNodeChildren",b.e.N);b.J=function(){this.Ga={}};b.a.extend(b.J.prototype,{nodeHasBindings:function(a){switch(a.nodeType){case 1:return a.getAttribute("data-bind")!=
|
||||
n;case 8:return b.e.ib(a)!=n;default:return q}},getBindings:function(a,b){var c=this.getBindingsString(a,b);return c?this.parseBindingsString(c,b,a):n},getBindingsString:function(a){switch(a.nodeType){case 1:return a.getAttribute("data-bind");case 8:return b.e.ib(a);default:return n}},parseBindingsString:function(a,d,c){try{var e;if(!(e=this.Ga[a])){var f=this.Ga,g="with($context){with($data||{}){return{"+b.g.ba(a)+"}}}";e=f[a]=new Function("$context","$element",g)}return e(d,c)}catch(h){i(Error("Unable to parse bindings.\nMessage: "+
|
||||
h+";\nBindings value: "+a))}}});b.J.instance=new b.J;b.b("bindingProvider",b.J);b.c={};b.z=function(a,d,c){d?(b.a.extend(this,d),this.$parentContext=d,this.$parent=d.$data,this.$parents=(d.$parents||[]).slice(0),this.$parents.unshift(this.$parent)):(this.$parents=[],this.$root=a,this.ko=b);this.$data=a;c&&(this[c]=a)};b.z.prototype.createChildContext=function(a,d){return new b.z(a,this,d)};b.z.prototype.extend=function(a){var d=b.a.extend(new b.z,this);return b.a.extend(d,a)};b.cb=function(a,d){if(2==
|
||||
arguments.length)b.a.f.set(a,"__ko_bindingContext__",d);else return b.a.f.get(a,"__ko_bindingContext__")};b.Ea=function(a,d,c){1===a.nodeType&&b.e.Sa(a);return W(a,d,c,l)};b.Da=function(a,b){(1===b.nodeType||8===b.nodeType)&&Y(a,b,l)};b.Ca=function(a,b){b&&(1!==b.nodeType&&8!==b.nodeType)&&i(Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node"));b=b||w.document.body;X(a,b,l)};b.ja=function(a){switch(a.nodeType){case 1:case 8:var d=b.cb(a);if(d)return d;
|
||||
if(a.parentNode)return b.ja(a.parentNode)}return H};b.ob=function(a){return(a=b.ja(a))?a.$data:H};b.b("bindingHandlers",b.c);b.b("applyBindings",b.Ca);b.b("applyBindingsToDescendants",b.Da);b.b("applyBindingsToNode",b.Ea);b.b("contextFor",b.ja);b.b("dataFor",b.ob);var ea={"class":"className","for":"htmlFor"};b.c.attr={update:function(a,d){var c=b.a.d(d())||{},e;for(e in c)if("string"==typeof e){var f=b.a.d(c[e]),g=f===q||f===n||f===H;g&&a.removeAttribute(e);8>=b.a.Z&&e in ea?(e=ea[e],g?a.removeAttribute(e):
|
||||
a[e]=f):g||a.setAttribute(e,f.toString());"name"===e&&b.a.$a(a,g?"":f.toString())}}};b.c.checked={init:function(a,d,c){b.a.n(a,"click",function(){var e;if("checkbox"==a.type)e=a.checked;else if("radio"==a.type&&a.checked)e=a.value;else return;var f=d(),g=b.a.d(f);"checkbox"==a.type&&g instanceof Array?(e=b.a.i(g,a.value),a.checked&&0>e?f.push(a.value):!a.checked&&0<=e&&f.splice(e,1)):b.g.ea(f,c,"checked",e,l)});"radio"==a.type&&!a.name&&b.c.uniqueName.init(a,t(l))},update:function(a,d){var c=b.a.d(d());
|
||||
"checkbox"==a.type?a.checked=c instanceof Array?0<=b.a.i(c,a.value):c:"radio"==a.type&&(a.checked=a.value==c)}};b.c.css={update:function(a,d){var c=b.a.d(d());if("object"==typeof c)for(var e in c){var f=b.a.d(c[e]);b.a.da(a,e,f)}else c=String(c||""),b.a.da(a,a.__ko__cssValue,q),a.__ko__cssValue=c,b.a.da(a,c,l)}};b.c.enable={update:function(a,d){var c=b.a.d(d());c&&a.disabled?a.removeAttribute("disabled"):!c&&!a.disabled&&(a.disabled=l)}};b.c.disable={update:function(a,d){b.c.enable.update(a,function(){return!b.a.d(d())})}};
|
||||
b.c.event={init:function(a,d,c,e){var f=d()||{},g;for(g in f)(function(){var f=g;"string"==typeof f&&b.a.n(a,f,function(a){var g,m=d()[f];if(m){var p=c();try{var r=b.a.L(arguments);r.unshift(e);g=m.apply(e,r)}finally{g!==l&&(a.preventDefault?a.preventDefault():a.returnValue=q)}p[f+"Bubble"]===q&&(a.cancelBubble=l,a.stopPropagation&&a.stopPropagation())}})})()}};b.c.foreach={Ra:function(a){return function(){var d=a(),c=b.a.ta(d);if(!c||"number"==typeof c.length)return{foreach:d,templateEngine:b.C.na};
|
||||
b.a.d(d);return{foreach:c.data,as:c.as,includeDestroyed:c.includeDestroyed,afterAdd:c.afterAdd,beforeRemove:c.beforeRemove,afterRender:c.afterRender,beforeMove:c.beforeMove,afterMove:c.afterMove,templateEngine:b.C.na}}},init:function(a,d){return b.c.template.init(a,b.c.foreach.Ra(d))},update:function(a,d,c,e,f){return b.c.template.update(a,b.c.foreach.Ra(d),c,e,f)}};b.g.Q.foreach=q;b.e.I.foreach=l;b.c.hasfocus={init:function(a,d,c){function e(e){a.__ko_hasfocusUpdating=l;var f=a.ownerDocument;"activeElement"in
|
||||
f&&(e=f.activeElement===a);f=d();b.g.ea(f,c,"hasfocus",e,l);a.__ko_hasfocusUpdating=q}var f=e.bind(n,l),g=e.bind(n,q);b.a.n(a,"focus",f);b.a.n(a,"focusin",f);b.a.n(a,"blur",g);b.a.n(a,"focusout",g)},update:function(a,d){var c=b.a.d(d());a.__ko_hasfocusUpdating||(c?a.focus():a.blur(),b.r.K(b.a.Aa,n,[a,c?"focusin":"focusout"]))}};b.c.html={init:function(){return{controlsDescendantBindings:l}},update:function(a,d){b.a.ca(a,d())}};var ca="__ko_withIfBindingData";P("if");P("ifnot",q,l);P("with",l,q,function(a,
|
||||
b){return a.createChildContext(b)});b.c.options={update:function(a,d,c){"select"!==b.a.u(a)&&i(Error("options binding applies only to SELECT elements"));for(var e=0==a.length,f=b.a.V(b.a.fa(a.childNodes,function(a){return a.tagName&&"option"===b.a.u(a)&&a.selected}),function(a){return b.k.q(a)||a.innerText||a.textContent}),g=a.scrollTop,h=b.a.d(d());0<a.length;)b.A(a.options[0]),a.remove(0);if(h){var c=c(),j=c.optionsIncludeDestroyed;"number"!=typeof h.length&&(h=[h]);if(c.optionsCaption){var k=x.createElement("option");
|
||||
b.a.ca(k,c.optionsCaption);b.k.T(k,H);a.appendChild(k)}for(var d=0,m=h.length;d<m;d++){var p=h[d];if(!p||!p._destroy||j){var k=x.createElement("option"),r=function(a,b,c){var d=typeof b;return"function"==d?b(a):"string"==d?a[b]:c},u=r(p,c.optionsValue,p);b.k.T(k,b.a.d(u));p=r(p,c.optionsText,u);b.a.bb(k,p);a.appendChild(k)}}h=a.getElementsByTagName("option");d=j=0;for(m=h.length;d<m;d++)0<=b.a.i(f,b.k.q(h[d]))&&(b.a.ab(h[d],l),j++);a.scrollTop=g;e&&"value"in c&&da(a,b.a.ta(c.value),l);b.a.tb(a)}}};
|
||||
b.c.options.ra="__ko.optionValueDomData__";b.c.selectedOptions={init:function(a,d,c){b.a.n(a,"change",function(){var e=d(),f=[];b.a.o(a.getElementsByTagName("option"),function(a){a.selected&&f.push(b.k.q(a))});b.g.ea(e,c,"value",f)})},update:function(a,d){"select"!=b.a.u(a)&&i(Error("values binding applies only to SELECT elements"));var c=b.a.d(d());c&&"number"==typeof c.length&&b.a.o(a.getElementsByTagName("option"),function(a){var d=0<=b.a.i(c,b.k.q(a));b.a.ab(a,d)})}};b.c.style={update:function(a,
|
||||
d){var c=b.a.d(d()||{}),e;for(e in c)if("string"==typeof e){var f=b.a.d(c[e]);a.style[e]=f||""}}};b.c.submit={init:function(a,d,c,e){"function"!=typeof d()&&i(Error("The value for a submit binding must be a function"));b.a.n(a,"submit",function(b){var c,h=d();try{c=h.call(e,a)}finally{c!==l&&(b.preventDefault?b.preventDefault():b.returnValue=q)}})}};b.c.text={update:function(a,d){b.a.bb(a,d())}};b.e.I.text=l;b.c.uniqueName={init:function(a,d){if(d()){var c="ko_unique_"+ ++b.c.uniqueName.nb;b.a.$a(a,
|
||||
c)}}};b.c.uniqueName.nb=0;b.c.value={init:function(a,d,c){function e(){h=q;var e=d(),f=b.k.q(a);b.g.ea(e,c,"value",f)}var f=["change"],g=c().valueUpdate,h=q;g&&("string"==typeof g&&(g=[g]),b.a.P(f,g),f=b.a.Fa(f));if(b.a.Z&&("input"==a.tagName.toLowerCase()&&"text"==a.type&&"off"!=a.autocomplete&&(!a.form||"off"!=a.form.autocomplete))&&-1==b.a.i(f,"propertychange"))b.a.n(a,"propertychange",function(){h=l}),b.a.n(a,"blur",function(){h&&e()});b.a.o(f,function(c){var d=e;b.a.Nb(c,"after")&&(d=function(){setTimeout(e,
|
||||
0)},c=c.substring(5));b.a.n(a,c,d)})},update:function(a,d){var c="select"===b.a.u(a),e=b.a.d(d()),f=b.k.q(a),g=e!=f;0===e&&(0!==f&&"0"!==f)&&(g=l);g&&(f=function(){b.k.T(a,e)},f(),c&&setTimeout(f,0));c&&0<a.length&&da(a,e,q)}};b.c.visible={update:function(a,d){var c=b.a.d(d()),e="none"!=a.style.display;c&&!e?a.style.display="":!c&&e&&(a.style.display="none")}};b.c.click={init:function(a,d,c,e){return b.c.event.init.call(this,a,function(){var a={};a.click=d();return a},c,e)}};b.v=function(){};b.v.prototype.renderTemplateSource=
|
||||
function(){i(Error("Override renderTemplateSource"))};b.v.prototype.createJavaScriptEvaluatorBlock=function(){i(Error("Override createJavaScriptEvaluatorBlock"))};b.v.prototype.makeTemplateSource=function(a,d){if("string"==typeof a){var d=d||x,c=d.getElementById(a);c||i(Error("Cannot find template with ID "+a));return new b.l.h(c)}if(1==a.nodeType||8==a.nodeType)return new b.l.O(a);i(Error("Unknown template type: "+a))};b.v.prototype.renderTemplate=function(a,b,c,e){a=this.makeTemplateSource(a,e);
|
||||
return this.renderTemplateSource(a,b,c)};b.v.prototype.isTemplateRewritten=function(a,b){return this.allowTemplateRewriting===q?l:this.makeTemplateSource(a,b).data("isRewritten")};b.v.prototype.rewriteTemplate=function(a,b,c){a=this.makeTemplateSource(a,c);b=b(a.text());a.text(b);a.data("isRewritten",l)};b.b("templateEngine",b.v);var pa=/(<[a-z]+\d*(\s+(?!data-bind=)[a-z0-9\-]+(=(\"[^\"]*\"|\'[^\']*\'))?)*\s+)data-bind=(["'])([\s\S]*?)\5/gi,qa=/<\!--\s*ko\b\s*([\s\S]*?)\s*--\>/g;b.ya={ub:function(a,
|
||||
d,c){d.isTemplateRewritten(a,c)||d.rewriteTemplate(a,function(a){return b.ya.Fb(a,d)},c)},Fb:function(a,b){return a.replace(pa,function(a,e,f,g,h,j,k){return V(k,e,b)}).replace(qa,function(a,e){return V(e,"<\!-- ko --\>",b)})},jb:function(a){return b.s.qa(function(d,c){d.nextSibling&&b.Ea(d.nextSibling,a,c)})}};b.b("__tr_ambtns",b.ya.jb);b.l={};b.l.h=function(a){this.h=a};b.l.h.prototype.text=function(){var a=b.a.u(this.h),a="script"===a?"text":"textarea"===a?"value":"innerHTML";if(0==arguments.length)return this.h[a];
|
||||
var d=arguments[0];"innerHTML"===a?b.a.ca(this.h,d):this.h[a]=d};b.l.h.prototype.data=function(a){if(1===arguments.length)return b.a.f.get(this.h,"templateSourceData_"+a);b.a.f.set(this.h,"templateSourceData_"+a,arguments[1])};b.l.O=function(a){this.h=a};b.l.O.prototype=new b.l.h;b.l.O.prototype.text=function(){if(0==arguments.length){var a=b.a.f.get(this.h,"__ko_anon_template__")||{};a.za===H&&a.ia&&(a.za=a.ia.innerHTML);return a.za}b.a.f.set(this.h,"__ko_anon_template__",{za:arguments[0]})};b.l.h.prototype.nodes=
|
||||
function(){if(0==arguments.length)return(b.a.f.get(this.h,"__ko_anon_template__")||{}).ia;b.a.f.set(this.h,"__ko_anon_template__",{ia:arguments[0]})};b.b("templateSources",b.l);b.b("templateSources.domElement",b.l.h);b.b("templateSources.anonymousTemplate",b.l.O);var N;b.va=function(a){a!=H&&!(a instanceof b.v)&&i(Error("templateEngine must inherit from ko.templateEngine"));N=a};b.ua=function(a,d,c,e,f){c=c||{};(c.templateEngine||N)==H&&i(Error("Set a template engine before calling renderTemplate"));
|
||||
f=f||"replaceChildren";if(e){var g=M(e);return b.j(function(){var h=d&&d instanceof b.z?d:new b.z(b.a.d(d)),j="function"==typeof a?a(h.$data,h):a,h=S(e,f,j,h,c);"replaceNode"==f&&(e=h,g=M(e))},n,{Ja:function(){return!g||!b.a.X(g)},W:g&&"replaceNode"==f?g.parentNode:g})}return b.s.qa(function(e){b.ua(a,d,c,e,"replaceNode")})};b.Lb=function(a,d,c,e,f){function g(a,b){T(b,j);c.afterRender&&c.afterRender(b,a)}function h(d,e){j=f.createChildContext(b.a.d(d),c.as);j.$index=e;var g="function"==typeof a?
|
||||
a(d,j):a;return S(n,"ignoreTargetNode",g,j,c)}var j;return b.j(function(){var a=b.a.d(d)||[];"undefined"==typeof a.length&&(a=[a]);a=b.a.fa(a,function(a){return c.includeDestroyed||a===H||a===n||!b.a.d(a._destroy)});b.r.K(b.a.Za,n,[e,a,h,c,g])},n,{W:e})};b.c.template={init:function(a,d){var c=b.a.d(d());if("string"!=typeof c&&!c.name&&(1==a.nodeType||8==a.nodeType))c=1==a.nodeType?a.childNodes:b.e.childNodes(a),c=b.a.Gb(c),(new b.l.O(a)).nodes(c);return{controlsDescendantBindings:l}},update:function(a,
|
||||
d,c,e,f){var d=b.a.d(d()),c={},e=l,g,h=n;"string"!=typeof d&&(c=d,d=c.name,"if"in c&&(e=b.a.d(c["if"])),e&&"ifnot"in c&&(e=!b.a.d(c.ifnot)),g=b.a.d(c.data));"foreach"in c?h=b.Lb(d||a,e&&c.foreach||[],c,a,f):e?(f="data"in c?f.createChildContext(g,c.as):f,h=b.ua(d||a,f,c,a)):b.e.Y(a);f=h;(g=b.a.f.get(a,"__ko__templateComputedDomDataKey__"))&&"function"==typeof g.B&&g.B();b.a.f.set(a,"__ko__templateComputedDomDataKey__",f&&f.oa()?f:H)}};b.g.Q.template=function(a){a=b.g.aa(a);return 1==a.length&&a[0].unknown||
|
||||
b.g.Db(a,"name")?n:"This template engine does not support anonymous templates nested within its templates"};b.e.I.template=l;b.b("setTemplateEngine",b.va);b.b("renderTemplate",b.ua);b.a.Ia=function(a,b,c){a=a||[];b=b||[];return a.length<=b.length?R(a,b,"added","deleted",c):R(b,a,"deleted","added",c)};b.b("utils.compareArrays",b.a.Ia);b.a.Za=function(a,d,c,e,f){function g(a,b){s=k[b];v!==b&&(y[a]=s);s.ma(v++);L(s.M);r.push(s);z.push(s)}function h(a,c){if(a)for(var d=0,e=c.length;d<e;d++)c[d]&&b.a.o(c[d].M,
|
||||
function(b){a(b,d,c[d].U)})}for(var d=d||[],e=e||{},j=b.a.f.get(a,"setDomNodeChildrenFromArrayMapping_lastMappingResult")===H,k=b.a.f.get(a,"setDomNodeChildrenFromArrayMapping_lastMappingResult")||[],m=b.a.V(k,function(a){return a.U}),p=b.a.Ia(m,d),r=[],u=0,v=0,A=[],z=[],d=[],y=[],m=[],s,C=0,B,D;B=p[C];C++)switch(D=B.moved,B.status){case "deleted":D===H&&(s=k[u],s.j&&s.j.B(),A.push.apply(A,L(s.M)),e.beforeRemove&&(d[C]=s,z.push(s)));u++;break;case "retained":g(C,u++);break;case "added":D!==H?g(C,
|
||||
D):(s={U:B.value,ma:b.m(v++)},r.push(s),z.push(s),j||(m[C]=s))}h(e.beforeMove,y);b.a.o(A,e.beforeRemove?b.A:b.removeNode);for(var C=0,j=b.e.firstChild(a),G;s=z[C];C++){s.M||b.a.extend(s,ga(a,c,s.U,f,s.ma));for(u=0;p=s.M[u];j=p.nextSibling,G=p,u++)p!==j&&b.e.Oa(a,p,G);!s.zb&&f&&(f(s.U,s.M,s.ma),s.zb=l)}h(e.beforeRemove,d);h(e.afterMove,y);h(e.afterAdd,m);b.a.f.set(a,"setDomNodeChildrenFromArrayMapping_lastMappingResult",r)};b.b("utils.setDomNodeChildrenFromArrayMapping",b.a.Za);b.C=function(){this.allowTemplateRewriting=
|
||||
q};b.C.prototype=new b.v;b.C.prototype.renderTemplateSource=function(a){var d=!(9>b.a.Z)&&a.nodes?a.nodes():n;if(d)return b.a.L(d.cloneNode(l).childNodes);a=a.text();return b.a.sa(a)};b.C.na=new b.C;b.va(b.C.na);b.b("nativeTemplateEngine",b.C);b.pa=function(){var a=this.Cb=function(){if("undefined"==typeof E||!E.tmpl)return 0;try{if(0<=E.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(a){}return 1}();this.renderTemplateSource=function(b,c,e){e=e||{};2>a&&i(Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later."));
|
||||
var f=b.data("precompiled");f||(f=b.text()||"",f=E.template(n,"{{ko_with $item.koBindingContext}}"+f+"{{/ko_with}}"),b.data("precompiled",f));b=[c.$data];c=E.extend({koBindingContext:c},e.templateOptions);c=E.tmpl(f,b,c);c.appendTo(x.createElement("div"));E.fragments={};return c};this.createJavaScriptEvaluatorBlock=function(a){return"{{ko_code ((function() { return "+a+" })()) }}"};this.addTemplate=function(a,b){x.write("<script type='text/html' id='"+a+"'>"+b+"<\/script>")};0<a&&(E.tmpl.tag.ko_code=
|
||||
{open:"__.push($1 || '');"},E.tmpl.tag.ko_with={open:"with($1) {",close:"} "})};b.pa.prototype=new b.v;v=new b.pa;0<v.Cb&&b.va(v);b.b("jqueryTmplTemplateEngine",b.pa)}"function"===typeof require&&"object"===typeof exports&&"object"===typeof module?K(module.exports||exports):"function"===typeof define&&define.amd?define(["exports"],K):K(w.ko={});l;
|
||||
})();
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<bundle minify="true" runOnBuild="true">
|
||||
<file>/ClientSource/Scripts/Modules/Knockout/knockout-2.2.0.js</file>
|
||||
</bundle>
|
||||
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 it is too large
Load Diff
@@ -0,0 +1,85 @@
|
||||
// Knockout JavaScript library v2.2.0
|
||||
// (c) Steven Sanderson - http://knockoutjs.com/
|
||||
// License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
||||
|
||||
(function() {function i(v){throw v;}var l=!0,n=null,q=!1;function t(v){return function(){return v}};var w=window,x=document,fa=navigator,E=window.jQuery,H=void 0;
|
||||
function K(v){function ga(a,d,c,e,f){var g=[],a=b.j(function(){var a=d(c,f)||[];0<g.length&&(b.a.Xa(L(g),a),e&&b.r.K(e,n,[c,a,f]));g.splice(0,g.length);b.a.P(g,a)},n,{W:a,Ja:function(){return 0==g.length||!b.a.X(g[0])}});return{M:g,j:a.oa()?a:H}}function L(a){for(;a.length&&!b.a.X(a[0]);)a.splice(0,1);if(1<a.length){for(var d=a[0],c=a[a.length-1],e=[d];d!==c;){d=d.nextSibling;if(!d)return;e.push(d)}Array.prototype.splice.apply(a,[0,a.length].concat(e))}return a}function R(a,b,c,e,f){var g=Math.min,
|
||||
h=Math.max,j=[],k,m=a.length,p,r=b.length,u=r-m||1,F=m+r+1,I,z,y;for(k=0;k<=m;k++){z=I;j.push(I=[]);y=g(r,k+u);for(p=h(0,k-1);p<=y;p++)I[p]=p?k?a[k-1]===b[p-1]?z[p-1]:g(z[p]||F,I[p-1]||F)+1:p+1:k+1}g=[];h=[];u=[];k=m;for(p=r;k||p;)r=j[k][p]-1,p&&r===j[k][p-1]?h.push(g[g.length]={status:c,value:b[--p],index:p}):k&&r===j[k-1][p]?u.push(g[g.length]={status:e,value:a[--k],index:k}):(g.push({status:"retained",value:b[--p]}),--k);if(h.length&&u.length)for(var a=10*m,s,b=c=0;(f||b<a)&&(s=h[c]);c++){for(e=
|
||||
0;j=u[e];e++)if(s.value===j.value){s.moved=j.index;j.moved=s.index;u.splice(e,1);b=e=0;break}b+=e}return g.reverse()}function S(a,d,c,e,f){var f=f||{},g=a&&M(a),g=g&&g.ownerDocument,h=f.templateEngine||N;b.ya.ub(c,h,g);c=h.renderTemplate(c,e,f,g);("number"!=typeof c.length||0<c.length&&"number"!=typeof c[0].nodeType)&&i(Error("Template engine must return an array of DOM nodes"));g=q;switch(d){case "replaceChildren":b.e.N(a,c);g=l;break;case "replaceNode":b.a.Xa(a,c);g=l;break;case "ignoreTargetNode":break;
|
||||
default:i(Error("Unknown renderMode: "+d))}g&&(T(c,e),f.afterRender&&b.r.K(f.afterRender,n,[c,e.$data]));return c}function M(a){return a.nodeType?a:0<a.length?a[0]:n}function T(a,d){if(a.length){var c=a[0],e=a[a.length-1];U(c,e,function(a){b.Ca(d,a)});U(c,e,function(a){b.s.hb(a,[d])})}}function U(a,d,c){for(var e,d=b.e.nextSibling(d);a&&(e=a)!==d;)a=b.e.nextSibling(e),(1===e.nodeType||8===e.nodeType)&&c(e)}function V(a,d,c){for(var a=b.g.aa(a),e=b.g.Q,f=0;f<a.length;f++){var g=a[f].key;if(e.hasOwnProperty(g)){var h=
|
||||
e[g];"function"===typeof h?(g=h(a[f].value))&&i(Error(g)):h||i(Error("This template engine does not support the '"+g+"' binding within its templates"))}}a="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+b.g.ba(a)+" } })()})";return c.createJavaScriptEvaluatorBlock(a)+d}function W(a,d,c,e){function f(a){return function(){return j[a]}}function g(){return j}var h=0,j,k;b.j(function(){var m=c&&c instanceof b.z?c:new b.z(b.a.d(c)),p=m.$data;e&&b.cb(a,m);if(j=("function"==typeof d?
|
||||
d(m,a):d)||b.J.instance.getBindings(a,m)){if(0===h){h=1;for(var r in j){var u=b.c[r];u&&8===a.nodeType&&!b.e.I[r]&&i(Error("The binding '"+r+"' cannot be used with virtual elements"));if(u&&"function"==typeof u.init&&(u=(0,u.init)(a,f(r),g,p,m))&&u.controlsDescendantBindings)k!==H&&i(Error("Multiple bindings ("+k+" and "+r+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.")),k=r}h=2}if(2===h)for(r in j)(u=b.c[r])&&"function"==
|
||||
typeof u.update&&(0,u.update)(a,f(r),g,p,m)}},n,{W:a});return{Mb:k===H}}function X(a,d,c){var e=l,f=1===d.nodeType;f&&b.e.Sa(d);if(f&&c||b.J.instance.nodeHasBindings(d))e=W(d,n,a,c).Mb;e&&Y(a,d,!f)}function Y(a,d,c){for(var e=b.e.firstChild(d);d=e;)e=b.e.nextSibling(d),X(a,d,c)}function Z(a,b){var c=$(a,b);return c?0<c.length?c[c.length-1].nextSibling:a.nextSibling:n}function $(a,b){for(var c=a,e=1,f=[];c=c.nextSibling;){if(G(c)&&(e--,0===e))return f;f.push(c);A(c)&&e++}b||i(Error("Cannot find closing comment tag to match: "+
|
||||
a.nodeValue));return n}function G(a){return 8==a.nodeType&&(J?a.text:a.nodeValue).match(ha)}function A(a){return 8==a.nodeType&&(J?a.text:a.nodeValue).match(ia)}function O(a,b){for(var c=n;a!=c;)c=a,a=a.replace(ja,function(a,c){return b[c]});return a}function ka(){var a=[],d=[];this.save=function(c,e){var f=b.a.i(a,c);0<=f?d[f]=e:(a.push(c),d.push(e))};this.get=function(c){c=b.a.i(a,c);return 0<=c?d[c]:H}}function aa(a,b,c){function e(e){var g=b(a[e]);switch(typeof g){case "boolean":case "number":case "string":case "function":f[e]=
|
||||
g;break;case "object":case "undefined":var h=c.get(g);f[e]=h!==H?h:aa(g,b,c)}}c=c||new ka;a=b(a);if(!("object"==typeof a&&a!==n&&a!==H&&!(a instanceof Date)))return a;var f=a instanceof Array?[]:{};c.save(a,f);var g=a;if(g instanceof Array){for(var h=0;h<g.length;h++)e(h);"function"==typeof g.toJSON&&e("toJSON")}else for(h in g)e(h);return f}function ba(a,d){if(a)if(8==a.nodeType){var c=b.s.Ta(a.nodeValue);c!=n&&d.push({rb:a,Eb:c})}else if(1==a.nodeType)for(var c=0,e=a.childNodes,f=e.length;c<f;c++)ba(e[c],
|
||||
d)}function P(a,d,c,e){b.c[a]={init:function(a){b.a.f.set(a,ca,{});return{controlsDescendantBindings:l}},update:function(a,g,h,j,k){var h=b.a.f.get(a,ca),g=b.a.d(g()),j=!c!==!g,m=!h.Ya;if(m||d||j!==h.pb)m&&(h.Ya=b.a.Ha(b.e.childNodes(a),l)),j?(m||b.e.N(a,b.a.Ha(h.Ya)),b.Da(e?e(k,g):k,a)):b.e.Y(a),h.pb=j}};b.g.Q[a]=q;b.e.I[a]=l}function da(a,d,c){c&&d!==b.k.q(a)&&b.k.T(a,d);d!==b.k.q(a)&&b.r.K(b.a.Aa,n,[a,"change"])}var b="undefined"!==typeof v?v:{};b.b=function(a,d){for(var c=a.split("."),e=b,f=0;f<
|
||||
c.length-1;f++)e=e[c[f]];e[c[c.length-1]]=d};b.p=function(a,b,c){a[b]=c};b.version="2.2.0";b.b("version",b.version);b.a=new function(){function a(a,d){if("input"!==b.a.u(a)||!a.type||"click"!=d.toLowerCase())return q;var c=a.type;return"checkbox"==c||"radio"==c}var d=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,c={},e={};c[/Firefox\/2/i.test(fa.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"];c.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" ");
|
||||
for(var f in c){var g=c[f];if(g.length)for(var h=0,j=g.length;h<j;h++)e[g[h]]=f}var k={propertychange:l},m,c=3;f=x.createElement("div");for(g=f.getElementsByTagName("i");f.innerHTML="<\!--[if gt IE "+ ++c+"]><i></i><![endif]--\>",g[0];);m=4<c?c:H;return{Ma:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],o:function(a,b){for(var d=0,c=a.length;d<c;d++)b(a[d])},i:function(a,b){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(a,b);for(var d=0,c=a.length;d<
|
||||
c;d++)if(a[d]===b)return d;return-1},kb:function(a,b,d){for(var c=0,e=a.length;c<e;c++)if(b.call(d,a[c]))return a[c];return n},ga:function(a,d){var c=b.a.i(a,d);0<=c&&a.splice(c,1)},Fa:function(a){for(var a=a||[],d=[],c=0,e=a.length;c<e;c++)0>b.a.i(d,a[c])&&d.push(a[c]);return d},V:function(a,b){for(var a=a||[],d=[],c=0,e=a.length;c<e;c++)d.push(b(a[c]));return d},fa:function(a,b){for(var a=a||[],d=[],c=0,e=a.length;c<e;c++)b(a[c])&&d.push(a[c]);return d},P:function(a,b){if(b instanceof Array)a.push.apply(a,
|
||||
b);else for(var d=0,c=b.length;d<c;d++)a.push(b[d]);return a},extend:function(a,b){if(b)for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);return a},ka:function(a){for(;a.firstChild;)b.removeNode(a.firstChild)},Gb:function(a){for(var a=b.a.L(a),d=x.createElement("div"),c=0,e=a.length;c<e;c++)d.appendChild(b.A(a[c]));return d},Ha:function(a,d){for(var c=0,e=a.length,g=[];c<e;c++){var f=a[c].cloneNode(l);g.push(d?b.A(f):f)}return g},N:function(a,d){b.a.ka(a);if(d)for(var c=0,e=d.length;c<e;c++)a.appendChild(d[c])},
|
||||
Xa:function(a,d){var c=a.nodeType?[a]:a;if(0<c.length){for(var e=c[0],g=e.parentNode,f=0,h=d.length;f<h;f++)g.insertBefore(d[f],e);f=0;for(h=c.length;f<h;f++)b.removeNode(c[f])}},ab:function(a,b){7>m?a.setAttribute("selected",b):a.selected=b},D:function(a){return(a||"").replace(d,"")},Qb:function(a,d){for(var c=[],e=(a||"").split(d),f=0,g=e.length;f<g;f++){var h=b.a.D(e[f]);""!==h&&c.push(h)}return c},Nb:function(a,b){a=a||"";return b.length>a.length?q:a.substring(0,b.length)===b},sb:function(a,b){if(b.compareDocumentPosition)return 16==
|
||||
(b.compareDocumentPosition(a)&16);for(;a!=n;){if(a==b)return l;a=a.parentNode}return q},X:function(a){return b.a.sb(a,a.ownerDocument)},u:function(a){return a&&a.tagName&&a.tagName.toLowerCase()},n:function(b,d,c){var e=m&&k[d];if(!e&&"undefined"!=typeof E){if(a(b,d))var f=c,c=function(a,b){var d=this.checked;b&&(this.checked=b.mb!==l);f.call(this,a);this.checked=d};E(b).bind(d,c)}else!e&&"function"==typeof b.addEventListener?b.addEventListener(d,c,q):"undefined"!=typeof b.attachEvent?b.attachEvent("on"+
|
||||
d,function(a){c.call(b,a)}):i(Error("Browser doesn't support addEventListener or attachEvent"))},Aa:function(b,d){(!b||!b.nodeType)&&i(Error("element must be a DOM node when calling triggerEvent"));if("undefined"!=typeof E){var c=[];a(b,d)&&c.push({mb:b.checked});E(b).trigger(d,c)}else"function"==typeof x.createEvent?"function"==typeof b.dispatchEvent?(c=x.createEvent(e[d]||"HTMLEvents"),c.initEvent(d,l,l,w,0,0,0,0,0,q,q,q,q,0,b),b.dispatchEvent(c)):i(Error("The supplied element doesn't support dispatchEvent")):
|
||||
"undefined"!=typeof b.fireEvent?(a(b,d)&&(b.checked=b.checked!==l),b.fireEvent("on"+d)):i(Error("Browser doesn't support triggering events"))},d:function(a){return b.$(a)?a():a},ta:function(a){return b.$(a)?a.t():a},da:function(a,d,c){if(d){var e=/[\w-]+/g,f=a.className.match(e)||[];b.a.o(d.match(e),function(a){var d=b.a.i(f,a);0<=d?c||f.splice(d,1):c&&f.push(a)});a.className=f.join(" ")}},bb:function(a,d){var c=b.a.d(d);if(c===n||c===H)c="";if(3===a.nodeType)a.data=c;else{var e=b.e.firstChild(a);
|
||||
!e||3!=e.nodeType||b.e.nextSibling(e)?b.e.N(a,[x.createTextNode(c)]):e.data=c;b.a.vb(a)}},$a:function(a,b){a.name=b;if(7>=m)try{a.mergeAttributes(x.createElement("<input name='"+a.name+"'/>"),q)}catch(d){}},vb:function(a){9<=m&&(a=1==a.nodeType?a:a.parentNode,a.style&&(a.style.zoom=a.style.zoom))},tb:function(a){if(9<=m){var b=a.style.width;a.style.width=0;a.style.width=b}},Kb:function(a,d){for(var a=b.a.d(a),d=b.a.d(d),c=[],e=a;e<=d;e++)c.push(e);return c},L:function(a){for(var b=[],d=0,c=a.length;d<
|
||||
c;d++)b.push(a[d]);return b},Ob:6===m,Pb:7===m,Z:m,Na:function(a,d){for(var c=b.a.L(a.getElementsByTagName("input")).concat(b.a.L(a.getElementsByTagName("textarea"))),e="string"==typeof d?function(a){return a.name===d}:function(a){return d.test(a.name)},f=[],g=c.length-1;0<=g;g--)e(c[g])&&f.push(c[g]);return f},Hb:function(a){return"string"==typeof a&&(a=b.a.D(a))?w.JSON&&w.JSON.parse?w.JSON.parse(a):(new Function("return "+a))():n},wa:function(a,d,c){("undefined"==typeof JSON||"undefined"==typeof JSON.stringify)&&
|
||||
i(Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js"));return JSON.stringify(b.a.d(a),d,c)},Ib:function(a,d,c){var c=c||{},e=c.params||{},f=c.includeFields||this.Ma,g=a;if("object"==typeof a&&"form"===b.a.u(a))for(var g=a.action,h=f.length-1;0<=h;h--)for(var j=b.a.Na(a,f[h]),k=j.length-1;0<=k;k--)e[j[k].name]=j[k].value;var d=b.a.d(d),m=x.createElement("form");
|
||||
m.style.display="none";m.action=g;m.method="post";for(var v in d)a=x.createElement("input"),a.name=v,a.value=b.a.wa(b.a.d(d[v])),m.appendChild(a);for(v in e)a=x.createElement("input"),a.name=v,a.value=e[v],m.appendChild(a);x.body.appendChild(m);c.submitter?c.submitter(m):m.submit();setTimeout(function(){m.parentNode.removeChild(m)},0)}}};b.b("utils",b.a);b.b("utils.arrayForEach",b.a.o);b.b("utils.arrayFirst",b.a.kb);b.b("utils.arrayFilter",b.a.fa);b.b("utils.arrayGetDistinctValues",b.a.Fa);b.b("utils.arrayIndexOf",
|
||||
b.a.i);b.b("utils.arrayMap",b.a.V);b.b("utils.arrayPushAll",b.a.P);b.b("utils.arrayRemoveItem",b.a.ga);b.b("utils.extend",b.a.extend);b.b("utils.fieldsIncludedWithJsonPost",b.a.Ma);b.b("utils.getFormFields",b.a.Na);b.b("utils.peekObservable",b.a.ta);b.b("utils.postJson",b.a.Ib);b.b("utils.parseJson",b.a.Hb);b.b("utils.registerEventHandler",b.a.n);b.b("utils.stringifyJson",b.a.wa);b.b("utils.range",b.a.Kb);b.b("utils.toggleDomNodeCssClass",b.a.da);b.b("utils.triggerEvent",b.a.Aa);b.b("utils.unwrapObservable",
|
||||
b.a.d);Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Array.prototype.slice.call(arguments),a=c.shift();return function(){return b.apply(a,c.concat(Array.prototype.slice.call(arguments)))}});b.a.f=new function(){var a=0,d="__ko__"+(new Date).getTime(),c={};return{get:function(a,d){var c=b.a.f.getAll(a,q);return c===H?H:c[d]},set:function(a,d,c){c===H&&b.a.f.getAll(a,q)===H||(b.a.f.getAll(a,l)[d]=c)},getAll:function(b,f){var g=b[d];if(!g||!("null"!==g&&c[g])){if(!f)return H;
|
||||
g=b[d]="ko"+a++;c[g]={}}return c[g]},clear:function(a){var b=a[d];return b?(delete c[b],a[d]=n,l):q}}};b.b("utils.domData",b.a.f);b.b("utils.domData.clear",b.a.f.clear);b.a.F=new function(){function a(a,d){var e=b.a.f.get(a,c);e===H&&d&&(e=[],b.a.f.set(a,c,e));return e}function d(c){var e=a(c,q);if(e)for(var e=e.slice(0),j=0;j<e.length;j++)e[j](c);b.a.f.clear(c);"function"==typeof E&&"function"==typeof E.cleanData&&E.cleanData([c]);if(f[c.nodeType])for(e=c.firstChild;c=e;)e=c.nextSibling,8===c.nodeType&&
|
||||
d(c)}var c="__ko_domNodeDisposal__"+(new Date).getTime(),e={1:l,8:l,9:l},f={1:l,9:l};return{Ba:function(b,d){"function"!=typeof d&&i(Error("Callback must be a function"));a(b,l).push(d)},Wa:function(d,e){var f=a(d,q);f&&(b.a.ga(f,e),0==f.length&&b.a.f.set(d,c,H))},A:function(a){if(e[a.nodeType]&&(d(a),f[a.nodeType])){var c=[];b.a.P(c,a.getElementsByTagName("*"));for(var j=0,k=c.length;j<k;j++)d(c[j])}return a},removeNode:function(a){b.A(a);a.parentNode&&a.parentNode.removeChild(a)}}};b.A=b.a.F.A;
|
||||
b.removeNode=b.a.F.removeNode;b.b("cleanNode",b.A);b.b("removeNode",b.removeNode);b.b("utils.domNodeDisposal",b.a.F);b.b("utils.domNodeDisposal.addDisposeCallback",b.a.F.Ba);b.b("utils.domNodeDisposal.removeDisposeCallback",b.a.F.Wa);b.a.sa=function(a){var d;if("undefined"!=typeof E){if((d=E.clean([a]))&&d[0]){for(a=d[0];a.parentNode&&11!==a.parentNode.nodeType;)a=a.parentNode;a.parentNode&&a.parentNode.removeChild(a)}}else{var c=b.a.D(a).toLowerCase();d=x.createElement("div");c=c.match(/^<(thead|tbody|tfoot)/)&&
|
||||
[1,"<table>","</table>"]||!c.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!c.indexOf("<td")||!c.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||[0,"",""];a="ignored<div>"+c[1]+a+c[2]+"</div>";for("function"==typeof w.innerShiv?d.appendChild(w.innerShiv(a)):d.innerHTML=a;c[0]--;)d=d.lastChild;d=b.a.L(d.lastChild.childNodes)}return d};b.a.ca=function(a,d){b.a.ka(a);d=b.a.d(d);if(d!==n&&d!==H)if("string"!=typeof d&&(d=d.toString()),"undefined"!=typeof E)E(a).html(d);else for(var c=
|
||||
b.a.sa(d),e=0;e<c.length;e++)a.appendChild(c[e])};b.b("utils.parseHtmlFragment",b.a.sa);b.b("utils.setHtml",b.a.ca);var Q={};b.s={qa:function(a){"function"!=typeof a&&i(Error("You can only pass a function to ko.memoization.memoize()"));var b=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);Q[b]=a;return"<\!--[ko_memo:"+b+"]--\>"},gb:function(a,b){var c=Q[a];c===H&&i(Error("Couldn't find any memo with ID "+a+". Perhaps it's already been unmemoized."));
|
||||
try{return c.apply(n,b||[]),l}finally{delete Q[a]}},hb:function(a,d){var c=[];ba(a,c);for(var e=0,f=c.length;e<f;e++){var g=c[e].rb,h=[g];d&&b.a.P(h,d);b.s.gb(c[e].Eb,h);g.nodeValue="";g.parentNode&&g.parentNode.removeChild(g)}},Ta:function(a){return(a=a.match(/^\[ko_memo\:(.*?)\]$/))?a[1]:n}};b.b("memoization",b.s);b.b("memoization.memoize",b.s.qa);b.b("memoization.unmemoize",b.s.gb);b.b("memoization.parseMemoText",b.s.Ta);b.b("memoization.unmemoizeDomNodeAndDescendants",b.s.hb);b.La={throttle:function(a,
|
||||
d){a.throttleEvaluation=d;var c=n;return b.j({read:a,write:function(b){clearTimeout(c);c=setTimeout(function(){a(b)},d)}})},notify:function(a,d){a.equalityComparer="always"==d?t(q):b.m.fn.equalityComparer;return a}};b.b("extenders",b.La);b.eb=function(a,d,c){this.target=a;this.ha=d;this.qb=c;b.p(this,"dispose",this.B)};b.eb.prototype.B=function(){this.Bb=l;this.qb()};b.S=function(){this.w={};b.a.extend(this,b.S.fn);b.p(this,"subscribe",this.xa);b.p(this,"extend",this.extend);b.p(this,"getSubscriptionsCount",
|
||||
this.xb)};b.S.fn={xa:function(a,d,c){var c=c||"change",a=d?a.bind(d):a,e=new b.eb(this,a,function(){b.a.ga(this.w[c],e)}.bind(this));this.w[c]||(this.w[c]=[]);this.w[c].push(e);return e},notifySubscribers:function(a,d){d=d||"change";this.w[d]&&b.r.K(function(){b.a.o(this.w[d].slice(0),function(b){b&&b.Bb!==l&&b.ha(a)})},this)},xb:function(){var a=0,b;for(b in this.w)this.w.hasOwnProperty(b)&&(a+=this.w[b].length);return a},extend:function(a){var d=this;if(a)for(var c in a){var e=b.La[c];"function"==
|
||||
typeof e&&(d=e(d,a[c]))}return d}};b.Pa=function(a){return"function"==typeof a.xa&&"function"==typeof a.notifySubscribers};b.b("subscribable",b.S);b.b("isSubscribable",b.Pa);var B=[];b.r={lb:function(a){B.push({ha:a,Ka:[]})},end:function(){B.pop()},Va:function(a){b.Pa(a)||i(Error("Only subscribable things can act as dependencies"));if(0<B.length){var d=B[B.length-1];d&&!(0<=b.a.i(d.Ka,a))&&(d.Ka.push(a),d.ha(a))}},K:function(a,b,c){try{return B.push(n),a.apply(b,c||[])}finally{B.pop()}}};var la={undefined:l,
|
||||
"boolean":l,number:l,string:l};b.m=function(a){function d(){if(0<arguments.length){if(!d.equalityComparer||!d.equalityComparer(c,arguments[0]))d.H(),c=arguments[0],d.G();return this}b.r.Va(d);return c}var c=a;b.S.call(d);d.t=function(){return c};d.G=function(){d.notifySubscribers(c)};d.H=function(){d.notifySubscribers(c,"beforeChange")};b.a.extend(d,b.m.fn);b.p(d,"peek",d.t);b.p(d,"valueHasMutated",d.G);b.p(d,"valueWillMutate",d.H);return d};b.m.fn={equalityComparer:function(a,b){return a===n||typeof a in
|
||||
la?a===b:q}};var D=b.m.Jb="__ko_proto__";b.m.fn[D]=b.m;b.la=function(a,d){return a===n||a===H||a[D]===H?q:a[D]===d?l:b.la(a[D],d)};b.$=function(a){return b.la(a,b.m)};b.Qa=function(a){return"function"==typeof a&&a[D]===b.m||"function"==typeof a&&a[D]===b.j&&a.yb?l:q};b.b("observable",b.m);b.b("isObservable",b.$);b.b("isWriteableObservable",b.Qa);b.R=function(a){0==arguments.length&&(a=[]);a!==n&&(a!==H&&!("length"in a))&&i(Error("The argument passed when initializing an observable array must be an array, or null, or undefined."));
|
||||
var d=b.m(a);b.a.extend(d,b.R.fn);return d};b.R.fn={remove:function(a){for(var b=this.t(),c=[],e="function"==typeof a?a:function(b){return b===a},f=0;f<b.length;f++){var g=b[f];e(g)&&(0===c.length&&this.H(),c.push(g),b.splice(f,1),f--)}c.length&&this.G();return c},removeAll:function(a){if(a===H){var d=this.t(),c=d.slice(0);this.H();d.splice(0,d.length);this.G();return c}return!a?[]:this.remove(function(d){return 0<=b.a.i(a,d)})},destroy:function(a){var b=this.t(),c="function"==typeof a?a:function(b){return b===
|
||||
a};this.H();for(var e=b.length-1;0<=e;e--)c(b[e])&&(b[e]._destroy=l);this.G()},destroyAll:function(a){return a===H?this.destroy(t(l)):!a?[]:this.destroy(function(d){return 0<=b.a.i(a,d)})},indexOf:function(a){var d=this();return b.a.i(d,a)},replace:function(a,b){var c=this.indexOf(a);0<=c&&(this.H(),this.t()[c]=b,this.G())}};b.a.o("pop push reverse shift sort splice unshift".split(" "),function(a){b.R.fn[a]=function(){var b=this.t();this.H();b=b[a].apply(b,arguments);this.G();return b}});b.a.o(["slice"],
|
||||
function(a){b.R.fn[a]=function(){var b=this();return b[a].apply(b,arguments)}});b.b("observableArray",b.R);b.j=function(a,d,c){function e(){b.a.o(y,function(a){a.B()});y=[]}function f(){var a=h.throttleEvaluation;a&&0<=a?(clearTimeout(s),s=setTimeout(g,a)):g()}function g(){if(!p)if(m&&v())z();else{p=l;try{var a=b.a.V(y,function(a){return a.target});b.r.lb(function(c){var d;0<=(d=b.a.i(a,c))?a[d]=H:y.push(c.xa(f))});for(var c=r.call(d),e=a.length-1;0<=e;e--)a[e]&&y.splice(e,1)[0].B();m=l;h.notifySubscribers(k,
|
||||
"beforeChange");k=c}finally{b.r.end()}h.notifySubscribers(k);p=q;y.length||z()}}function h(){if(0<arguments.length)return"function"===typeof u?u.apply(d,arguments):i(Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.")),this;m||g();b.r.Va(h);return k}function j(){return!m||0<y.length}var k,m=q,p=q,r=a;r&&"object"==typeof r?(c=r,r=c.read):(c=c||{},r||(r=c.read));"function"!=typeof r&&i(Error("Pass a function that returns the value of the ko.computed"));
|
||||
var u=c.write,F=c.disposeWhenNodeIsRemoved||c.W||n,v=c.disposeWhen||c.Ja||t(q),z=e,y=[],s=n;d||(d=c.owner);h.t=function(){m||g();return k};h.wb=function(){return y.length};h.yb="function"===typeof c.write;h.B=function(){z()};h.oa=j;b.S.call(h);b.a.extend(h,b.j.fn);b.p(h,"peek",h.t);b.p(h,"dispose",h.B);b.p(h,"isActive",h.oa);b.p(h,"getDependenciesCount",h.wb);c.deferEvaluation!==l&&g();if(F&&j()){z=function(){b.a.F.Wa(F,arguments.callee);e()};b.a.F.Ba(F,z);var C=v,v=function(){return!b.a.X(F)||C()}}return h};
|
||||
b.Ab=function(a){return b.la(a,b.j)};v=b.m.Jb;b.j[v]=b.m;b.j.fn={};b.j.fn[v]=b.j;b.b("dependentObservable",b.j);b.b("computed",b.j);b.b("isComputed",b.Ab);b.fb=function(a){0==arguments.length&&i(Error("When calling ko.toJS, pass the object you want to convert."));return aa(a,function(a){for(var c=0;b.$(a)&&10>c;c++)a=a();return a})};b.toJSON=function(a,d,c){a=b.fb(a);return b.a.wa(a,d,c)};b.b("toJS",b.fb);b.b("toJSON",b.toJSON);b.k={q:function(a){switch(b.a.u(a)){case "option":return a.__ko__hasDomDataOptionValue__===
|
||||
l?b.a.f.get(a,b.c.options.ra):7>=b.a.Z?a.getAttributeNode("value").specified?a.value:a.text:a.value;case "select":return 0<=a.selectedIndex?b.k.q(a.options[a.selectedIndex]):H;default:return a.value}},T:function(a,d){switch(b.a.u(a)){case "option":switch(typeof d){case "string":b.a.f.set(a,b.c.options.ra,H);"__ko__hasDomDataOptionValue__"in a&&delete a.__ko__hasDomDataOptionValue__;a.value=d;break;default:b.a.f.set(a,b.c.options.ra,d),a.__ko__hasDomDataOptionValue__=l,a.value="number"===typeof d?
|
||||
d:""}break;case "select":for(var c=a.options.length-1;0<=c;c--)if(b.k.q(a.options[c])==d){a.selectedIndex=c;break}break;default:if(d===n||d===H)d="";a.value=d}}};b.b("selectExtensions",b.k);b.b("selectExtensions.readValue",b.k.q);b.b("selectExtensions.writeValue",b.k.T);var ja=/\@ko_token_(\d+)\@/g,ma=["true","false"],na=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i;b.g={Q:[],aa:function(a){var d=b.a.D(a);if(3>d.length)return[];"{"===d.charAt(0)&&(d=d.substring(1,d.length-1));for(var a=[],
|
||||
c=n,e,f=0;f<d.length;f++){var g=d.charAt(f);if(c===n)switch(g){case '"':case "'":case "/":c=f,e=g}else if(g==e&&"\\"!==d.charAt(f-1)){g=d.substring(c,f+1);a.push(g);var h="@ko_token_"+(a.length-1)+"@",d=d.substring(0,c)+h+d.substring(f+1),f=f-(g.length-h.length),c=n}}e=c=n;for(var j=0,k=n,f=0;f<d.length;f++){g=d.charAt(f);if(c===n)switch(g){case "{":c=f;k=g;e="}";break;case "(":c=f;k=g;e=")";break;case "[":c=f,k=g,e="]"}g===k?j++:g===e&&(j--,0===j&&(g=d.substring(c,f+1),a.push(g),h="@ko_token_"+(a.length-
|
||||
1)+"@",d=d.substring(0,c)+h+d.substring(f+1),f-=g.length-h.length,c=n))}e=[];d=d.split(",");c=0;for(f=d.length;c<f;c++)j=d[c],k=j.indexOf(":"),0<k&&k<j.length-1?(g=j.substring(k+1),e.push({key:O(j.substring(0,k),a),value:O(g,a)})):e.push({unknown:O(j,a)});return e},ba:function(a){for(var d="string"===typeof a?b.g.aa(a):a,c=[],a=[],e,f=0;e=d[f];f++)if(0<c.length&&c.push(","),e.key){var g;a:{g=e.key;var h=b.a.D(g);switch(h.length&&h.charAt(0)){case "'":case '"':break a;default:g="'"+h+"'"}}e=e.value;
|
||||
c.push(g);c.push(":");c.push(e);e=b.a.D(e);0<=b.a.i(ma,b.a.D(e).toLowerCase())?e=q:(h=e.match(na),e=h===n?q:h[1]?"Object("+h[1]+")"+h[2]:e);e&&(0<a.length&&a.push(", "),a.push(g+" : function(__ko_value) { "+e+" = __ko_value; }"))}else e.unknown&&c.push(e.unknown);d=c.join("");0<a.length&&(d=d+", '_ko_property_writers' : { "+a.join("")+" } ");return d},Db:function(a,d){for(var c=0;c<a.length;c++)if(b.a.D(a[c].key)==d)return l;return q},ea:function(a,d,c,e,f){if(!a||!b.Qa(a)){if((a=d()._ko_property_writers)&&
|
||||
a[c])a[c](e)}else(!f||a.t()!==e)&&a(e)}};b.b("expressionRewriting",b.g);b.b("expressionRewriting.bindingRewriteValidators",b.g.Q);b.b("expressionRewriting.parseObjectLiteral",b.g.aa);b.b("expressionRewriting.preProcessBindings",b.g.ba);b.b("jsonExpressionRewriting",b.g);b.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",b.g.ba);var J="<\!--test--\>"===x.createComment("test").text,ia=J?/^<\!--\s*ko(?:\s+(.+\s*\:[\s\S]*))?\s*--\>$/:/^\s*ko(?:\s+(.+\s*\:[\s\S]*))?\s*$/,ha=J?/^<\!--\s*\/ko\s*--\>$/:
|
||||
/^\s*\/ko\s*$/,oa={ul:l,ol:l};b.e={I:{},childNodes:function(a){return A(a)?$(a):a.childNodes},Y:function(a){if(A(a))for(var a=b.e.childNodes(a),d=0,c=a.length;d<c;d++)b.removeNode(a[d]);else b.a.ka(a)},N:function(a,d){if(A(a)){b.e.Y(a);for(var c=a.nextSibling,e=0,f=d.length;e<f;e++)c.parentNode.insertBefore(d[e],c)}else b.a.N(a,d)},Ua:function(a,b){A(a)?a.parentNode.insertBefore(b,a.nextSibling):a.firstChild?a.insertBefore(b,a.firstChild):a.appendChild(b)},Oa:function(a,d,c){c?A(a)?a.parentNode.insertBefore(d,
|
||||
c.nextSibling):c.nextSibling?a.insertBefore(d,c.nextSibling):a.appendChild(d):b.e.Ua(a,d)},firstChild:function(a){return!A(a)?a.firstChild:!a.nextSibling||G(a.nextSibling)?n:a.nextSibling},nextSibling:function(a){A(a)&&(a=Z(a));return a.nextSibling&&G(a.nextSibling)?n:a.nextSibling},ib:function(a){return(a=A(a))?a[1]:n},Sa:function(a){if(oa[b.a.u(a)]){var d=a.firstChild;if(d){do if(1===d.nodeType){var c;c=d.firstChild;var e=n;if(c){do if(e)e.push(c);else if(A(c)){var f=Z(c,l);f?c=f:e=[c]}else G(c)&&
|
||||
(e=[c]);while(c=c.nextSibling)}if(c=e){e=d.nextSibling;for(f=0;f<c.length;f++)e?a.insertBefore(c[f],e):a.appendChild(c[f])}}while(d=d.nextSibling)}}}};b.b("virtualElements",b.e);b.b("virtualElements.allowedBindings",b.e.I);b.b("virtualElements.emptyNode",b.e.Y);b.b("virtualElements.insertAfter",b.e.Oa);b.b("virtualElements.prepend",b.e.Ua);b.b("virtualElements.setDomNodeChildren",b.e.N);b.J=function(){this.Ga={}};b.a.extend(b.J.prototype,{nodeHasBindings:function(a){switch(a.nodeType){case 1:return a.getAttribute("data-bind")!=
|
||||
n;case 8:return b.e.ib(a)!=n;default:return q}},getBindings:function(a,b){var c=this.getBindingsString(a,b);return c?this.parseBindingsString(c,b,a):n},getBindingsString:function(a){switch(a.nodeType){case 1:return a.getAttribute("data-bind");case 8:return b.e.ib(a);default:return n}},parseBindingsString:function(a,d,c){try{var e;if(!(e=this.Ga[a])){var f=this.Ga,g="with($context){with($data||{}){return{"+b.g.ba(a)+"}}}";e=f[a]=new Function("$context","$element",g)}return e(d,c)}catch(h){i(Error("Unable to parse bindings.\nMessage: "+
|
||||
h+";\nBindings value: "+a))}}});b.J.instance=new b.J;b.b("bindingProvider",b.J);b.c={};b.z=function(a,d,c){d?(b.a.extend(this,d),this.$parentContext=d,this.$parent=d.$data,this.$parents=(d.$parents||[]).slice(0),this.$parents.unshift(this.$parent)):(this.$parents=[],this.$root=a,this.ko=b);this.$data=a;c&&(this[c]=a)};b.z.prototype.createChildContext=function(a,d){return new b.z(a,this,d)};b.z.prototype.extend=function(a){var d=b.a.extend(new b.z,this);return b.a.extend(d,a)};b.cb=function(a,d){if(2==
|
||||
arguments.length)b.a.f.set(a,"__ko_bindingContext__",d);else return b.a.f.get(a,"__ko_bindingContext__")};b.Ea=function(a,d,c){1===a.nodeType&&b.e.Sa(a);return W(a,d,c,l)};b.Da=function(a,b){(1===b.nodeType||8===b.nodeType)&&Y(a,b,l)};b.Ca=function(a,b){b&&(1!==b.nodeType&&8!==b.nodeType)&&i(Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node"));b=b||w.document.body;X(a,b,l)};b.ja=function(a){switch(a.nodeType){case 1:case 8:var d=b.cb(a);if(d)return d;
|
||||
if(a.parentNode)return b.ja(a.parentNode)}return H};b.ob=function(a){return(a=b.ja(a))?a.$data:H};b.b("bindingHandlers",b.c);b.b("applyBindings",b.Ca);b.b("applyBindingsToDescendants",b.Da);b.b("applyBindingsToNode",b.Ea);b.b("contextFor",b.ja);b.b("dataFor",b.ob);var ea={"class":"className","for":"htmlFor"};b.c.attr={update:function(a,d){var c=b.a.d(d())||{},e;for(e in c)if("string"==typeof e){var f=b.a.d(c[e]),g=f===q||f===n||f===H;g&&a.removeAttribute(e);8>=b.a.Z&&e in ea?(e=ea[e],g?a.removeAttribute(e):
|
||||
a[e]=f):g||a.setAttribute(e,f.toString());"name"===e&&b.a.$a(a,g?"":f.toString())}}};b.c.checked={init:function(a,d,c){b.a.n(a,"click",function(){var e;if("checkbox"==a.type)e=a.checked;else if("radio"==a.type&&a.checked)e=a.value;else return;var f=d(),g=b.a.d(f);"checkbox"==a.type&&g instanceof Array?(e=b.a.i(g,a.value),a.checked&&0>e?f.push(a.value):!a.checked&&0<=e&&f.splice(e,1)):b.g.ea(f,c,"checked",e,l)});"radio"==a.type&&!a.name&&b.c.uniqueName.init(a,t(l))},update:function(a,d){var c=b.a.d(d());
|
||||
"checkbox"==a.type?a.checked=c instanceof Array?0<=b.a.i(c,a.value):c:"radio"==a.type&&(a.checked=a.value==c)}};b.c.css={update:function(a,d){var c=b.a.d(d());if("object"==typeof c)for(var e in c){var f=b.a.d(c[e]);b.a.da(a,e,f)}else c=String(c||""),b.a.da(a,a.__ko__cssValue,q),a.__ko__cssValue=c,b.a.da(a,c,l)}};b.c.enable={update:function(a,d){var c=b.a.d(d());c&&a.disabled?a.removeAttribute("disabled"):!c&&!a.disabled&&(a.disabled=l)}};b.c.disable={update:function(a,d){b.c.enable.update(a,function(){return!b.a.d(d())})}};
|
||||
b.c.event={init:function(a,d,c,e){var f=d()||{},g;for(g in f)(function(){var f=g;"string"==typeof f&&b.a.n(a,f,function(a){var g,m=d()[f];if(m){var p=c();try{var r=b.a.L(arguments);r.unshift(e);g=m.apply(e,r)}finally{g!==l&&(a.preventDefault?a.preventDefault():a.returnValue=q)}p[f+"Bubble"]===q&&(a.cancelBubble=l,a.stopPropagation&&a.stopPropagation())}})})()}};b.c.foreach={Ra:function(a){return function(){var d=a(),c=b.a.ta(d);if(!c||"number"==typeof c.length)return{foreach:d,templateEngine:b.C.na};
|
||||
b.a.d(d);return{foreach:c.data,as:c.as,includeDestroyed:c.includeDestroyed,afterAdd:c.afterAdd,beforeRemove:c.beforeRemove,afterRender:c.afterRender,beforeMove:c.beforeMove,afterMove:c.afterMove,templateEngine:b.C.na}}},init:function(a,d){return b.c.template.init(a,b.c.foreach.Ra(d))},update:function(a,d,c,e,f){return b.c.template.update(a,b.c.foreach.Ra(d),c,e,f)}};b.g.Q.foreach=q;b.e.I.foreach=l;b.c.hasfocus={init:function(a,d,c){function e(e){a.__ko_hasfocusUpdating=l;var f=a.ownerDocument;"activeElement"in
|
||||
f&&(e=f.activeElement===a);f=d();b.g.ea(f,c,"hasfocus",e,l);a.__ko_hasfocusUpdating=q}var f=e.bind(n,l),g=e.bind(n,q);b.a.n(a,"focus",f);b.a.n(a,"focusin",f);b.a.n(a,"blur",g);b.a.n(a,"focusout",g)},update:function(a,d){var c=b.a.d(d());a.__ko_hasfocusUpdating||(c?a.focus():a.blur(),b.r.K(b.a.Aa,n,[a,c?"focusin":"focusout"]))}};b.c.html={init:function(){return{controlsDescendantBindings:l}},update:function(a,d){b.a.ca(a,d())}};var ca="__ko_withIfBindingData";P("if");P("ifnot",q,l);P("with",l,q,function(a,
|
||||
b){return a.createChildContext(b)});b.c.options={update:function(a,d,c){"select"!==b.a.u(a)&&i(Error("options binding applies only to SELECT elements"));for(var e=0==a.length,f=b.a.V(b.a.fa(a.childNodes,function(a){return a.tagName&&"option"===b.a.u(a)&&a.selected}),function(a){return b.k.q(a)||a.innerText||a.textContent}),g=a.scrollTop,h=b.a.d(d());0<a.length;)b.A(a.options[0]),a.remove(0);if(h){var c=c(),j=c.optionsIncludeDestroyed;"number"!=typeof h.length&&(h=[h]);if(c.optionsCaption){var k=x.createElement("option");
|
||||
b.a.ca(k,c.optionsCaption);b.k.T(k,H);a.appendChild(k)}for(var d=0,m=h.length;d<m;d++){var p=h[d];if(!p||!p._destroy||j){var k=x.createElement("option"),r=function(a,b,c){var d=typeof b;return"function"==d?b(a):"string"==d?a[b]:c},u=r(p,c.optionsValue,p);b.k.T(k,b.a.d(u));p=r(p,c.optionsText,u);b.a.bb(k,p);a.appendChild(k)}}h=a.getElementsByTagName("option");d=j=0;for(m=h.length;d<m;d++)0<=b.a.i(f,b.k.q(h[d]))&&(b.a.ab(h[d],l),j++);a.scrollTop=g;e&&"value"in c&&da(a,b.a.ta(c.value),l);b.a.tb(a)}}};
|
||||
b.c.options.ra="__ko.optionValueDomData__";b.c.selectedOptions={init:function(a,d,c){b.a.n(a,"change",function(){var e=d(),f=[];b.a.o(a.getElementsByTagName("option"),function(a){a.selected&&f.push(b.k.q(a))});b.g.ea(e,c,"value",f)})},update:function(a,d){"select"!=b.a.u(a)&&i(Error("values binding applies only to SELECT elements"));var c=b.a.d(d());c&&"number"==typeof c.length&&b.a.o(a.getElementsByTagName("option"),function(a){var d=0<=b.a.i(c,b.k.q(a));b.a.ab(a,d)})}};b.c.style={update:function(a,
|
||||
d){var c=b.a.d(d()||{}),e;for(e in c)if("string"==typeof e){var f=b.a.d(c[e]);a.style[e]=f||""}}};b.c.submit={init:function(a,d,c,e){"function"!=typeof d()&&i(Error("The value for a submit binding must be a function"));b.a.n(a,"submit",function(b){var c,h=d();try{c=h.call(e,a)}finally{c!==l&&(b.preventDefault?b.preventDefault():b.returnValue=q)}})}};b.c.text={update:function(a,d){b.a.bb(a,d())}};b.e.I.text=l;b.c.uniqueName={init:function(a,d){if(d()){var c="ko_unique_"+ ++b.c.uniqueName.nb;b.a.$a(a,
|
||||
c)}}};b.c.uniqueName.nb=0;b.c.value={init:function(a,d,c){function e(){h=q;var e=d(),f=b.k.q(a);b.g.ea(e,c,"value",f)}var f=["change"],g=c().valueUpdate,h=q;g&&("string"==typeof g&&(g=[g]),b.a.P(f,g),f=b.a.Fa(f));if(b.a.Z&&("input"==a.tagName.toLowerCase()&&"text"==a.type&&"off"!=a.autocomplete&&(!a.form||"off"!=a.form.autocomplete))&&-1==b.a.i(f,"propertychange"))b.a.n(a,"propertychange",function(){h=l}),b.a.n(a,"blur",function(){h&&e()});b.a.o(f,function(c){var d=e;b.a.Nb(c,"after")&&(d=function(){setTimeout(e,
|
||||
0)},c=c.substring(5));b.a.n(a,c,d)})},update:function(a,d){var c="select"===b.a.u(a),e=b.a.d(d()),f=b.k.q(a),g=e!=f;0===e&&(0!==f&&"0"!==f)&&(g=l);g&&(f=function(){b.k.T(a,e)},f(),c&&setTimeout(f,0));c&&0<a.length&&da(a,e,q)}};b.c.visible={update:function(a,d){var c=b.a.d(d()),e="none"!=a.style.display;c&&!e?a.style.display="":!c&&e&&(a.style.display="none")}};b.c.click={init:function(a,d,c,e){return b.c.event.init.call(this,a,function(){var a={};a.click=d();return a},c,e)}};b.v=function(){};b.v.prototype.renderTemplateSource=
|
||||
function(){i(Error("Override renderTemplateSource"))};b.v.prototype.createJavaScriptEvaluatorBlock=function(){i(Error("Override createJavaScriptEvaluatorBlock"))};b.v.prototype.makeTemplateSource=function(a,d){if("string"==typeof a){var d=d||x,c=d.getElementById(a);c||i(Error("Cannot find template with ID "+a));return new b.l.h(c)}if(1==a.nodeType||8==a.nodeType)return new b.l.O(a);i(Error("Unknown template type: "+a))};b.v.prototype.renderTemplate=function(a,b,c,e){a=this.makeTemplateSource(a,e);
|
||||
return this.renderTemplateSource(a,b,c)};b.v.prototype.isTemplateRewritten=function(a,b){return this.allowTemplateRewriting===q?l:this.makeTemplateSource(a,b).data("isRewritten")};b.v.prototype.rewriteTemplate=function(a,b,c){a=this.makeTemplateSource(a,c);b=b(a.text());a.text(b);a.data("isRewritten",l)};b.b("templateEngine",b.v);var pa=/(<[a-z]+\d*(\s+(?!data-bind=)[a-z0-9\-]+(=(\"[^\"]*\"|\'[^\']*\'))?)*\s+)data-bind=(["'])([\s\S]*?)\5/gi,qa=/<\!--\s*ko\b\s*([\s\S]*?)\s*--\>/g;b.ya={ub:function(a,
|
||||
d,c){d.isTemplateRewritten(a,c)||d.rewriteTemplate(a,function(a){return b.ya.Fb(a,d)},c)},Fb:function(a,b){return a.replace(pa,function(a,e,f,g,h,j,k){return V(k,e,b)}).replace(qa,function(a,e){return V(e,"<\!-- ko --\>",b)})},jb:function(a){return b.s.qa(function(d,c){d.nextSibling&&b.Ea(d.nextSibling,a,c)})}};b.b("__tr_ambtns",b.ya.jb);b.l={};b.l.h=function(a){this.h=a};b.l.h.prototype.text=function(){var a=b.a.u(this.h),a="script"===a?"text":"textarea"===a?"value":"innerHTML";if(0==arguments.length)return this.h[a];
|
||||
var d=arguments[0];"innerHTML"===a?b.a.ca(this.h,d):this.h[a]=d};b.l.h.prototype.data=function(a){if(1===arguments.length)return b.a.f.get(this.h,"templateSourceData_"+a);b.a.f.set(this.h,"templateSourceData_"+a,arguments[1])};b.l.O=function(a){this.h=a};b.l.O.prototype=new b.l.h;b.l.O.prototype.text=function(){if(0==arguments.length){var a=b.a.f.get(this.h,"__ko_anon_template__")||{};a.za===H&&a.ia&&(a.za=a.ia.innerHTML);return a.za}b.a.f.set(this.h,"__ko_anon_template__",{za:arguments[0]})};b.l.h.prototype.nodes=
|
||||
function(){if(0==arguments.length)return(b.a.f.get(this.h,"__ko_anon_template__")||{}).ia;b.a.f.set(this.h,"__ko_anon_template__",{ia:arguments[0]})};b.b("templateSources",b.l);b.b("templateSources.domElement",b.l.h);b.b("templateSources.anonymousTemplate",b.l.O);var N;b.va=function(a){a!=H&&!(a instanceof b.v)&&i(Error("templateEngine must inherit from ko.templateEngine"));N=a};b.ua=function(a,d,c,e,f){c=c||{};(c.templateEngine||N)==H&&i(Error("Set a template engine before calling renderTemplate"));
|
||||
f=f||"replaceChildren";if(e){var g=M(e);return b.j(function(){var h=d&&d instanceof b.z?d:new b.z(b.a.d(d)),j="function"==typeof a?a(h.$data,h):a,h=S(e,f,j,h,c);"replaceNode"==f&&(e=h,g=M(e))},n,{Ja:function(){return!g||!b.a.X(g)},W:g&&"replaceNode"==f?g.parentNode:g})}return b.s.qa(function(e){b.ua(a,d,c,e,"replaceNode")})};b.Lb=function(a,d,c,e,f){function g(a,b){T(b,j);c.afterRender&&c.afterRender(b,a)}function h(d,e){j=f.createChildContext(b.a.d(d),c.as);j.$index=e;var g="function"==typeof a?
|
||||
a(d,j):a;return S(n,"ignoreTargetNode",g,j,c)}var j;return b.j(function(){var a=b.a.d(d)||[];"undefined"==typeof a.length&&(a=[a]);a=b.a.fa(a,function(a){return c.includeDestroyed||a===H||a===n||!b.a.d(a._destroy)});b.r.K(b.a.Za,n,[e,a,h,c,g])},n,{W:e})};b.c.template={init:function(a,d){var c=b.a.d(d());if("string"!=typeof c&&!c.name&&(1==a.nodeType||8==a.nodeType))c=1==a.nodeType?a.childNodes:b.e.childNodes(a),c=b.a.Gb(c),(new b.l.O(a)).nodes(c);return{controlsDescendantBindings:l}},update:function(a,
|
||||
d,c,e,f){var d=b.a.d(d()),c={},e=l,g,h=n;"string"!=typeof d&&(c=d,d=c.name,"if"in c&&(e=b.a.d(c["if"])),e&&"ifnot"in c&&(e=!b.a.d(c.ifnot)),g=b.a.d(c.data));"foreach"in c?h=b.Lb(d||a,e&&c.foreach||[],c,a,f):e?(f="data"in c?f.createChildContext(g,c.as):f,h=b.ua(d||a,f,c,a)):b.e.Y(a);f=h;(g=b.a.f.get(a,"__ko__templateComputedDomDataKey__"))&&"function"==typeof g.B&&g.B();b.a.f.set(a,"__ko__templateComputedDomDataKey__",f&&f.oa()?f:H)}};b.g.Q.template=function(a){a=b.g.aa(a);return 1==a.length&&a[0].unknown||
|
||||
b.g.Db(a,"name")?n:"This template engine does not support anonymous templates nested within its templates"};b.e.I.template=l;b.b("setTemplateEngine",b.va);b.b("renderTemplate",b.ua);b.a.Ia=function(a,b,c){a=a||[];b=b||[];return a.length<=b.length?R(a,b,"added","deleted",c):R(b,a,"deleted","added",c)};b.b("utils.compareArrays",b.a.Ia);b.a.Za=function(a,d,c,e,f){function g(a,b){s=k[b];v!==b&&(y[a]=s);s.ma(v++);L(s.M);r.push(s);z.push(s)}function h(a,c){if(a)for(var d=0,e=c.length;d<e;d++)c[d]&&b.a.o(c[d].M,
|
||||
function(b){a(b,d,c[d].U)})}for(var d=d||[],e=e||{},j=b.a.f.get(a,"setDomNodeChildrenFromArrayMapping_lastMappingResult")===H,k=b.a.f.get(a,"setDomNodeChildrenFromArrayMapping_lastMappingResult")||[],m=b.a.V(k,function(a){return a.U}),p=b.a.Ia(m,d),r=[],u=0,v=0,A=[],z=[],d=[],y=[],m=[],s,C=0,B,D;B=p[C];C++)switch(D=B.moved,B.status){case "deleted":D===H&&(s=k[u],s.j&&s.j.B(),A.push.apply(A,L(s.M)),e.beforeRemove&&(d[C]=s,z.push(s)));u++;break;case "retained":g(C,u++);break;case "added":D!==H?g(C,
|
||||
D):(s={U:B.value,ma:b.m(v++)},r.push(s),z.push(s),j||(m[C]=s))}h(e.beforeMove,y);b.a.o(A,e.beforeRemove?b.A:b.removeNode);for(var C=0,j=b.e.firstChild(a),G;s=z[C];C++){s.M||b.a.extend(s,ga(a,c,s.U,f,s.ma));for(u=0;p=s.M[u];j=p.nextSibling,G=p,u++)p!==j&&b.e.Oa(a,p,G);!s.zb&&f&&(f(s.U,s.M,s.ma),s.zb=l)}h(e.beforeRemove,d);h(e.afterMove,y);h(e.afterAdd,m);b.a.f.set(a,"setDomNodeChildrenFromArrayMapping_lastMappingResult",r)};b.b("utils.setDomNodeChildrenFromArrayMapping",b.a.Za);b.C=function(){this.allowTemplateRewriting=
|
||||
q};b.C.prototype=new b.v;b.C.prototype.renderTemplateSource=function(a){var d=!(9>b.a.Z)&&a.nodes?a.nodes():n;if(d)return b.a.L(d.cloneNode(l).childNodes);a=a.text();return b.a.sa(a)};b.C.na=new b.C;b.va(b.C.na);b.b("nativeTemplateEngine",b.C);b.pa=function(){var a=this.Cb=function(){if("undefined"==typeof E||!E.tmpl)return 0;try{if(0<=E.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(a){}return 1}();this.renderTemplateSource=function(b,c,e){e=e||{};2>a&&i(Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later."));
|
||||
var f=b.data("precompiled");f||(f=b.text()||"",f=E.template(n,"{{ko_with $item.koBindingContext}}"+f+"{{/ko_with}}"),b.data("precompiled",f));b=[c.$data];c=E.extend({koBindingContext:c},e.templateOptions);c=E.tmpl(f,b,c);c.appendTo(x.createElement("div"));E.fragments={};return c};this.createJavaScriptEvaluatorBlock=function(a){return"{{ko_code ((function() { return "+a+" })()) }}"};this.addTemplate=function(a,b){x.write("<script type='text/html' id='"+a+"'>"+b+"<\/script>")};0<a&&(E.tmpl.tag.ko_code=
|
||||
{open:"__.push($1 || '');"},E.tmpl.tag.ko_with={open:"with($1) {",close:"} "})};b.pa.prototype=new b.v;v=new b.pa;0<v.Cb&&b.va(v);b.b("jqueryTmplTemplateEngine",b.pa)}"function"===typeof require&&"object"===typeof exports&&"object"===typeof module?K(module.exports||exports):"function"===typeof define&&define.amd?define(["exports"],K):K(w.ko={});l;
|
||||
})();
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<bundle minify="true" runOnBuild="true">
|
||||
<file>/ClientSource/Scripts/Modules/Shadowbox/shadowbox.js</file>
|
||||
</bundle>
|
||||
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
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<bundle minify="true" runOnBuild="true">
|
||||
<file>/ClientSource/Scripts/Modules/Silverlight/Silverlight.js</file>
|
||||
</bundle>
|
||||
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
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<bundle minify="true" runOnBuild="true">
|
||||
<file>/ClientSource/Scripts/Modules/Timeline/disco.simileajaxextensions.js</file>
|
||||
<file>/ClientSource/Scripts/Modules/Timeline/simile-ajax-bundle-DiscoMod.js</file>
|
||||
<file>/ClientSource/Scripts/Modules/Timeline/disco.timelineextensions.js</file>
|
||||
<file>/ClientSource/Scripts/Modules/Timeline/timeline-bundle.js</file>
|
||||
<file>/ClientSource/Scripts/Modules/Timeline/timeline.js</file>
|
||||
<file>/ClientSource/Scripts/Modules/Timeline/labellers.js</file>
|
||||
</bundle>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,7 @@
|
||||
window.SimileAjax = {
|
||||
loaded: true,
|
||||
loadingScriptsCount: 0,
|
||||
error: null,
|
||||
params: { bundle: "true" },
|
||||
Platform: new Object()
|
||||
};
|
||||
@@ -0,0 +1,6 @@
|
||||
window.Timeline = new Object();
|
||||
window.Timeline.DateTime = window.SimileAjax.DateTime; // for backward compatibility
|
||||
window.Timeline.urlPrefix = '/ClientSource/Style/Timeline/';
|
||||
window.Timeline.serverLocale = 'en';
|
||||
window.Timeline.clientLocale = 'en';
|
||||
window.Timeline.timeZone = 10;
|
||||
@@ -0,0 +1,12 @@
|
||||
/*==================================================
|
||||
* Localization of labellers.js
|
||||
*==================================================
|
||||
*/
|
||||
|
||||
Timeline.GregorianDateLabeller.monthNames["en"] = [
|
||||
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
|
||||
];
|
||||
|
||||
Timeline.GregorianDateLabeller.dayNames["en"] = [
|
||||
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
|
||||
];
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,9 @@
|
||||
/*==================================================
|
||||
* Common localization strings
|
||||
*==================================================
|
||||
*/
|
||||
|
||||
Timeline.strings["en"] = {
|
||||
wikiLinkLabel: "Discuss"
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<bundle minify="true" runOnBuild="true">
|
||||
<file>/ClientSource/Scripts/Modules/jQuery-Isotope/jquery.isotope.js</file>
|
||||
</bundle>
|
||||
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 it is too large
Load Diff
@@ -0,0 +1,528 @@
|
||||
///#source 1 1 /ClientSource/Scripts/Modules/jQuery-NumberFormatter/jshashtable-2.1.js
|
||||
/**
|
||||
* Copyright 2010 Tim Down.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var Hashtable=(function(){var p="function";var n=(typeof Array.prototype.splice==p)?function(s,r){s.splice(r,1)}:function(u,t){var s,v,r;if(t===u.length-1){u.length=t}else{s=u.slice(t+1);u.length=t;for(v=0,r=s.length;v<r;++v){u[t+v]=s[v]}}};function a(t){var r;if(typeof t=="string"){return t}else{if(typeof t.hashCode==p){r=t.hashCode();return(typeof r=="string")?r:a(r)}else{if(typeof t.toString==p){return t.toString()}else{try{return String(t)}catch(s){return Object.prototype.toString.call(t)}}}}}function g(r,s){return r.equals(s)}function e(r,s){return(typeof s.equals==p)?s.equals(r):(r===s)}function c(r){return function(s){if(s===null){throw new Error("null is not a valid "+r)}else{if(typeof s=="undefined"){throw new Error(r+" must not be undefined")}}}}var q=c("key"),l=c("value");function d(u,s,t,r){this[0]=u;this.entries=[];this.addEntry(s,t);if(r!==null){this.getEqualityFunction=function(){return r}}}var h=0,j=1,f=2;function o(r){return function(t){var s=this.entries.length,v,u=this.getEqualityFunction(t);while(s--){v=this.entries[s];if(u(t,v[0])){switch(r){case h:return true;case j:return v;case f:return[s,v[1]]}}}return false}}function k(r){return function(u){var v=u.length;for(var t=0,s=this.entries.length;t<s;++t){u[v+t]=this.entries[t][r]}}}d.prototype={getEqualityFunction:function(r){return(typeof r.equals==p)?g:e},getEntryForKey:o(j),getEntryAndIndexForKey:o(f),removeEntryForKey:function(s){var r=this.getEntryAndIndexForKey(s);if(r){n(this.entries,r[0]);return r[1]}return null},addEntry:function(r,s){this.entries[this.entries.length]=[r,s]},keys:k(0),values:k(1),getEntries:function(s){var u=s.length;for(var t=0,r=this.entries.length;t<r;++t){s[u+t]=this.entries[t].slice(0)}},containsKey:o(h),containsValue:function(s){var r=this.entries.length;while(r--){if(s===this.entries[r][1]){return true}}return false}};function m(s,t){var r=s.length,u;while(r--){u=s[r];if(t===u[0]){return r}}return null}function i(r,s){var t=r[s];return(t&&(t instanceof d))?t:null}function b(t,r){var w=this;var v=[];var u={};var x=(typeof t==p)?t:a;var s=(typeof r==p)?r:null;this.put=function(B,C){q(B);l(C);var D=x(B),E,A,z=null;E=i(u,D);if(E){A=E.getEntryForKey(B);if(A){z=A[1];A[1]=C}else{E.addEntry(B,C)}}else{E=new d(D,B,C,s);v[v.length]=E;u[D]=E}return z};this.get=function(A){q(A);var B=x(A);var C=i(u,B);if(C){var z=C.getEntryForKey(A);if(z){return z[1]}}return null};this.containsKey=function(A){q(A);var z=x(A);var B=i(u,z);return B?B.containsKey(A):false};this.containsValue=function(A){l(A);var z=v.length;while(z--){if(v[z].containsValue(A)){return true}}return false};this.clear=function(){v.length=0;u={}};this.isEmpty=function(){return !v.length};var y=function(z){return function(){var A=[],B=v.length;while(B--){v[B][z](A)}return A}};this.keys=y("keys");this.values=y("values");this.entries=y("getEntries");this.remove=function(B){q(B);var C=x(B),z,A=null;var D=i(u,C);if(D){A=D.removeEntryForKey(B);if(A!==null){if(!D.entries.length){z=m(v,C);n(v,z);delete u[C]}}}return A};this.size=function(){var A=0,z=v.length;while(z--){A+=v[z].entries.length}return A};this.each=function(C){var z=w.entries(),A=z.length,B;while(A--){B=z[A];C(B[0],B[1])}};this.putAll=function(H,C){var B=H.entries();var E,F,D,z,A=B.length;var G=(typeof C==p);while(A--){E=B[A];F=E[0];D=E[1];if(G&&(z=w.get(F))){D=C(F,z,D)}w.put(F,D)}};this.clone=function(){var z=new b(t,r);z.putAll(w);return z}}return b})();
|
||||
///#source 1 1 /ClientSource/Scripts/Modules/jQuery-NumberFormatter/jquery.numberformatter.js
|
||||
/**
|
||||
* jquery.numberformatter - Formatting/Parsing Numbers in jQuery
|
||||
*
|
||||
* Written by
|
||||
* Michael Abernethy (mike@abernethysoft.com),
|
||||
* Andrew Parry (aparry0@gmail.com)
|
||||
*
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||
* and GPL (GPL-LICENSE.txt) licenses.
|
||||
*
|
||||
* @author Michael Abernethy, Andrew Parry
|
||||
* @version 1.2.3-SNAPSHOT ($Id$)
|
||||
*
|
||||
* Dependencies
|
||||
*
|
||||
* jQuery (http://jquery.com)
|
||||
* jshashtable (http://www.timdown.co.uk/jshashtable)
|
||||
*
|
||||
* Notes & Thanks
|
||||
*
|
||||
* many thanks to advweb.nanasi.jp for his bug fixes
|
||||
* jsHashtable is now used also, so thanks to the author for that excellent little class.
|
||||
*
|
||||
* This plugin can be used to format numbers as text and parse text as Numbers
|
||||
* Because we live in an international world, we cannot assume that everyone
|
||||
* uses "," to divide thousands, and "." as a decimal point.
|
||||
*
|
||||
* As of 1.2 the way this plugin works has changed slightly, parsing text to a number
|
||||
* has 1 set of functions, formatting a number to text has it's own. Before things
|
||||
* were a little confusing, so I wanted to separate the 2 out more.
|
||||
*
|
||||
*
|
||||
* jQuery extension functions:
|
||||
*
|
||||
* formatNumber(options, writeBack, giveReturnValue) - Reads the value from the subject, parses to
|
||||
* a Javascript Number object, then formats back to text using the passed options and write back to
|
||||
* the subject.
|
||||
*
|
||||
* parseNumber(options) - Parses the value in the subject to a Number object using the passed options
|
||||
* to decipher the actual number from the text, then writes the value as text back to the subject.
|
||||
*
|
||||
*
|
||||
* Generic functions:
|
||||
*
|
||||
* formatNumber(numberString, options) - Takes a plain number as a string (e.g. '1002.0123') and returns
|
||||
* a string of the given format options.
|
||||
*
|
||||
* parseNumber(numberString, options) - Takes a number as text that is formatted the same as the given
|
||||
* options then and returns it as a plain Number object.
|
||||
*
|
||||
* To achieve the old way of combining parsing and formatting to keep say a input field always formatted
|
||||
* to a given format after it has lost focus you'd simply use a combination of the functions.
|
||||
*
|
||||
* e.g.
|
||||
* $("#salary").blur(function(){
|
||||
* $(this).parseNumber({format:"#,###.00", locale:"us"});
|
||||
* $(this).formatNumber({format:"#,###.00", locale:"us"});
|
||||
* });
|
||||
*
|
||||
* The syntax for the formatting is:
|
||||
* 0 = Digit
|
||||
* # = Digit, zero shows as absent
|
||||
* . = Decimal separator
|
||||
* - = Negative sign
|
||||
* , = Grouping Separator
|
||||
* % = Percent (multiplies the number by 100)
|
||||
*
|
||||
* For example, a format of "#,###.00" and text of 4500.20 will
|
||||
* display as "4.500,20" with a locale of "de", and "4,500.20" with a locale of "us"
|
||||
*
|
||||
*
|
||||
* As of now, the only acceptable locales are
|
||||
* Arab Emirates -> "ae"
|
||||
* Australia -> "au"
|
||||
* Austria -> "at"
|
||||
* Brazil -> "br"
|
||||
* Canada -> "ca"
|
||||
* China -> "cn"
|
||||
* Czech -> "cz"
|
||||
* Denmark -> "dk"
|
||||
* Egypt -> "eg"
|
||||
* Finland -> "fi"
|
||||
* France -> "fr"
|
||||
* Germany -> "de"
|
||||
* Greece -> "gr"
|
||||
* Great Britain -> "gb"
|
||||
* Hong Kong -> "hk"
|
||||
* India -> "in"
|
||||
* Israel -> "il"
|
||||
* Japan -> "jp"
|
||||
* Russia -> "ru"
|
||||
* South Korea -> "kr"
|
||||
* Spain -> "es"
|
||||
* Sweden -> "se"
|
||||
* Switzerland -> "ch"
|
||||
* Taiwan -> "tw"
|
||||
* Thailand -> "th"
|
||||
* United States -> "us"
|
||||
* Vietnam -> "vn"
|
||||
**/
|
||||
|
||||
(function(jQuery) {
|
||||
|
||||
var nfLocales = new Hashtable();
|
||||
|
||||
var nfLocalesLikeUS = [ 'ae','au','ca','cn','eg','gb','hk','il','in','jp','sk','th','tw','us' ];
|
||||
var nfLocalesLikeDE = [ 'at','br','de','dk','es','gr','it','nl','pt','tr','vn' ];
|
||||
var nfLocalesLikeFR = [ 'cz','fi','fr','ru','se','pl' ];
|
||||
var nfLocalesLikeCH = [ 'ch' ];
|
||||
|
||||
var nfLocaleFormatting = [ [".", ","], [",", "."], [",", " "], [".", "'"] ];
|
||||
var nfAllLocales = [ nfLocalesLikeUS, nfLocalesLikeDE, nfLocalesLikeFR, nfLocalesLikeCH ]
|
||||
|
||||
function FormatData(dec, group, neg) {
|
||||
this.dec = dec;
|
||||
this.group = group;
|
||||
this.neg = neg;
|
||||
};
|
||||
|
||||
function init() {
|
||||
// write the arrays into the hashtable
|
||||
for (var localeGroupIdx = 0; localeGroupIdx < nfAllLocales.length; localeGroupIdx++) {
|
||||
localeGroup = nfAllLocales[localeGroupIdx];
|
||||
for (var i = 0; i < localeGroup.length; i++) {
|
||||
nfLocales.put(localeGroup[i], localeGroupIdx);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function formatCodes(locale, isFullLocale) {
|
||||
if (nfLocales.size() == 0)
|
||||
init();
|
||||
|
||||
// default values
|
||||
var dec = ".";
|
||||
var group = ",";
|
||||
var neg = "-";
|
||||
|
||||
if (isFullLocale == false) {
|
||||
// Extract and convert to lower-case any language code from a real 'locale' formatted string, if not use as-is
|
||||
// (To prevent locale format like : "fr_FR", "en_US", "de_DE", "fr_FR", "en-US", "de-DE")
|
||||
if (locale.indexOf('_') != -1)
|
||||
locale = locale.split('_')[1].toLowerCase();
|
||||
else if (locale.indexOf('-') != -1)
|
||||
locale = locale.split('-')[1].toLowerCase();
|
||||
}
|
||||
|
||||
// hashtable lookup to match locale with codes
|
||||
var codesIndex = nfLocales.get(locale);
|
||||
if (codesIndex) {
|
||||
var codes = nfLocaleFormatting[codesIndex];
|
||||
if (codes) {
|
||||
dec = codes[0];
|
||||
group = codes[1];
|
||||
}
|
||||
}
|
||||
return new FormatData(dec, group, neg);
|
||||
};
|
||||
|
||||
|
||||
/* Formatting Methods */
|
||||
|
||||
|
||||
/**
|
||||
* Formats anything containing a number in standard js number notation.
|
||||
*
|
||||
* @param {Object} options The formatting options to use
|
||||
* @param {Boolean} writeBack (true) If the output value should be written back to the subject
|
||||
* @param {Boolean} giveReturnValue (true) If the function should return the output string
|
||||
*/
|
||||
jQuery.fn.formatNumber = function(options, writeBack, giveReturnValue) {
|
||||
|
||||
return this.each(function() {
|
||||
// enforce defaults
|
||||
if (writeBack == null)
|
||||
writeBack = true;
|
||||
if (giveReturnValue == null)
|
||||
giveReturnValue = true;
|
||||
|
||||
// get text
|
||||
var text;
|
||||
if (jQuery(this).is(":input"))
|
||||
text = new String(jQuery(this).val());
|
||||
else
|
||||
text = new String(jQuery(this).text());
|
||||
|
||||
// format
|
||||
var returnString = jQuery.formatNumber(text, options);
|
||||
|
||||
// set formatted string back, only if a success
|
||||
// if (returnString) {
|
||||
if (writeBack) {
|
||||
if (jQuery(this).is(":input"))
|
||||
jQuery(this).val(returnString);
|
||||
else
|
||||
jQuery(this).text(returnString);
|
||||
}
|
||||
if (giveReturnValue)
|
||||
return returnString;
|
||||
// }
|
||||
// return '';
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* First parses a string and reformats it with the given options.
|
||||
*
|
||||
* @param {Object} numberString
|
||||
* @param {Object} options
|
||||
*/
|
||||
jQuery.formatNumber = function(numberString, options){
|
||||
var options = jQuery.extend({}, jQuery.fn.formatNumber.defaults, options);
|
||||
var formatData = formatCodes(options.locale.toLowerCase(), options.isFullLocale);
|
||||
|
||||
var dec = formatData.dec;
|
||||
var group = formatData.group;
|
||||
var neg = formatData.neg;
|
||||
|
||||
var validFormat = "0#-,.";
|
||||
|
||||
// strip all the invalid characters at the beginning and the end
|
||||
// of the format, and we'll stick them back on at the end
|
||||
// make a special case for the negative sign "-" though, so
|
||||
// we can have formats like -$23.32
|
||||
var prefix = "";
|
||||
var negativeInFront = false;
|
||||
for (var i = 0; i < options.format.length; i++) {
|
||||
if (validFormat.indexOf(options.format.charAt(i)) == -1)
|
||||
prefix = prefix + options.format.charAt(i);
|
||||
else
|
||||
if (i == 0 && options.format.charAt(i) == '-') {
|
||||
negativeInFront = true;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
var suffix = "";
|
||||
for (var i = options.format.length - 1; i >= 0; i--) {
|
||||
if (validFormat.indexOf(options.format.charAt(i)) == -1)
|
||||
suffix = options.format.charAt(i) + suffix;
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
options.format = options.format.substring(prefix.length);
|
||||
options.format = options.format.substring(0, options.format.length - suffix.length);
|
||||
|
||||
// now we need to convert it into a number
|
||||
//while (numberString.indexOf(group) > -1)
|
||||
// numberString = numberString.replace(group, '');
|
||||
//var number = new Number(numberString.replace(dec, ".").replace(neg, "-"));
|
||||
var number = new Number(numberString);
|
||||
|
||||
return jQuery._formatNumber(number, options, suffix, prefix, negativeInFront);
|
||||
};
|
||||
|
||||
/**
|
||||
* Formats a Number object into a string, using the given formatting options
|
||||
*
|
||||
* @param {Object} numberString
|
||||
* @param {Object} options
|
||||
*/
|
||||
jQuery._formatNumber = function(number, options, suffix, prefix, negativeInFront) {
|
||||
var options = jQuery.extend({}, jQuery.fn.formatNumber.defaults, options);
|
||||
var formatData = formatCodes(options.locale.toLowerCase(), options.isFullLocale);
|
||||
|
||||
var dec = formatData.dec;
|
||||
var group = formatData.group;
|
||||
var neg = formatData.neg;
|
||||
|
||||
var forcedToZero = false;
|
||||
if (isNaN(number)) {
|
||||
if (options.nanForceZero == true) {
|
||||
number = 0;
|
||||
forcedToZero = true;
|
||||
} else
|
||||
return null;
|
||||
}
|
||||
|
||||
// special case for percentages
|
||||
if (suffix == "%")
|
||||
number = number * 100;
|
||||
|
||||
var returnString = "";
|
||||
if (options.format.indexOf(".") > -1) {
|
||||
var decimalPortion = dec;
|
||||
var decimalFormat = options.format.substring(options.format.lastIndexOf(".") + 1);
|
||||
|
||||
// round or truncate number as needed
|
||||
if (options.round == true)
|
||||
number = new Number(number.toFixed(decimalFormat.length));
|
||||
else {
|
||||
var numStr = number.toString();
|
||||
numStr = numStr.substring(0, numStr.lastIndexOf('.') + decimalFormat.length + 1);
|
||||
number = new Number(numStr);
|
||||
}
|
||||
|
||||
var decimalValue = number % 1;
|
||||
var decimalString = new String(decimalValue.toFixed(decimalFormat.length));
|
||||
decimalString = decimalString.substring(decimalString.lastIndexOf(".") + 1);
|
||||
|
||||
for (var i = 0; i < decimalFormat.length; i++) {
|
||||
if (decimalFormat.charAt(i) == '#' && decimalString.charAt(i) != '0') {
|
||||
decimalPortion += decimalString.charAt(i);
|
||||
continue;
|
||||
} else if (decimalFormat.charAt(i) == '#' && decimalString.charAt(i) == '0') {
|
||||
var notParsed = decimalString.substring(i);
|
||||
if (notParsed.match('[1-9]')) {
|
||||
decimalPortion += decimalString.charAt(i);
|
||||
continue;
|
||||
} else
|
||||
break;
|
||||
} else if (decimalFormat.charAt(i) == "0")
|
||||
decimalPortion += decimalString.charAt(i);
|
||||
}
|
||||
returnString += decimalPortion
|
||||
} else
|
||||
number = Math.round(number);
|
||||
|
||||
var ones = Math.floor(number);
|
||||
if (number < 0)
|
||||
ones = Math.ceil(number);
|
||||
|
||||
var onesFormat = "";
|
||||
if (options.format.indexOf(".") == -1)
|
||||
onesFormat = options.format;
|
||||
else
|
||||
onesFormat = options.format.substring(0, options.format.indexOf("."));
|
||||
|
||||
var onePortion = "";
|
||||
if (!(ones == 0 && onesFormat.substr(onesFormat.length - 1) == '#') || forcedToZero) {
|
||||
// find how many digits are in the group
|
||||
var oneText = new String(Math.abs(ones));
|
||||
var groupLength = 9999;
|
||||
if (onesFormat.lastIndexOf(",") != -1)
|
||||
groupLength = onesFormat.length - onesFormat.lastIndexOf(",") - 1;
|
||||
var groupCount = 0;
|
||||
for (var i = oneText.length - 1; i > -1; i--) {
|
||||
onePortion = oneText.charAt(i) + onePortion;
|
||||
groupCount++;
|
||||
if (groupCount == groupLength && i != 0) {
|
||||
onePortion = group + onePortion;
|
||||
groupCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// account for any pre-data padding
|
||||
if (onesFormat.length > onePortion.length) {
|
||||
var padStart = onesFormat.indexOf('0');
|
||||
if (padStart != -1) {
|
||||
var padLen = onesFormat.length - padStart;
|
||||
|
||||
// pad to left with 0's or group char
|
||||
var pos = onesFormat.length - onePortion.length - 1;
|
||||
while (onePortion.length < padLen) {
|
||||
var padChar = onesFormat.charAt(pos);
|
||||
// replace with real group char if needed
|
||||
if (padChar == ',')
|
||||
padChar = group;
|
||||
onePortion = padChar + onePortion;
|
||||
pos--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!onePortion && onesFormat.indexOf('0', onesFormat.length - 1) !== -1)
|
||||
onePortion = '0';
|
||||
|
||||
returnString = onePortion + returnString;
|
||||
|
||||
// handle special case where negative is in front of the invalid characters
|
||||
if (number < 0 && negativeInFront && prefix.length > 0)
|
||||
prefix = neg + prefix;
|
||||
else if (number < 0)
|
||||
returnString = neg + returnString;
|
||||
|
||||
if (!options.decimalSeparatorAlwaysShown) {
|
||||
if (returnString.lastIndexOf(dec) == returnString.length - 1) {
|
||||
returnString = returnString.substring(0, returnString.length - 1);
|
||||
}
|
||||
}
|
||||
returnString = prefix + returnString + suffix;
|
||||
return returnString;
|
||||
};
|
||||
|
||||
|
||||
/* Parsing Methods */
|
||||
|
||||
|
||||
/**
|
||||
* Parses a number of given format from the element and returns a Number object.
|
||||
* @param {Object} options
|
||||
*/
|
||||
jQuery.fn.parseNumber = function(options, writeBack, giveReturnValue) {
|
||||
// enforce defaults
|
||||
if (writeBack == null)
|
||||
writeBack = true;
|
||||
if (giveReturnValue == null)
|
||||
giveReturnValue = true;
|
||||
|
||||
// get text
|
||||
var text;
|
||||
if (jQuery(this).is(":input"))
|
||||
text = new String(jQuery(this).val());
|
||||
else
|
||||
text = new String(jQuery(this).text());
|
||||
|
||||
// parse text
|
||||
var number = jQuery.parseNumber(text, options);
|
||||
|
||||
if (number) {
|
||||
if (writeBack) {
|
||||
if (jQuery(this).is(":input"))
|
||||
jQuery(this).val(number.toString());
|
||||
else
|
||||
jQuery(this).text(number.toString());
|
||||
}
|
||||
if (giveReturnValue)
|
||||
return number;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Parses a string of given format into a Number object.
|
||||
*
|
||||
* @param {Object} string
|
||||
* @param {Object} options
|
||||
*/
|
||||
jQuery.parseNumber = function(numberString, options) {
|
||||
var options = jQuery.extend({}, jQuery.fn.parseNumber.defaults, options);
|
||||
var formatData = formatCodes(options.locale.toLowerCase(), options.isFullLocale);
|
||||
|
||||
var dec = formatData.dec;
|
||||
var group = formatData.group;
|
||||
var neg = formatData.neg;
|
||||
|
||||
var valid = "1234567890.-";
|
||||
|
||||
// now we need to convert it into a number
|
||||
while (numberString.indexOf(group)>-1)
|
||||
numberString = numberString.replace(group,'');
|
||||
numberString = numberString.replace(dec,".").replace(neg,"-");
|
||||
var validText = "";
|
||||
var hasPercent = false;
|
||||
if (numberString.charAt(numberString.length - 1) == "%" || options.isPercentage == true)
|
||||
hasPercent = true;
|
||||
for (var i=0; i<numberString.length; i++) {
|
||||
if (valid.indexOf(numberString.charAt(i))>-1)
|
||||
validText = validText + numberString.charAt(i);
|
||||
}
|
||||
var number = new Number(validText);
|
||||
if (hasPercent) {
|
||||
number = number / 100;
|
||||
var decimalPos = validText.indexOf('.');
|
||||
if (decimalPos != -1) {
|
||||
var decimalPoints = validText.length - decimalPos - 1;
|
||||
number = number.toFixed(decimalPoints + 2);
|
||||
} else {
|
||||
number = number.toFixed(validText.length - 1);
|
||||
}
|
||||
}
|
||||
|
||||
return number;
|
||||
};
|
||||
|
||||
jQuery.fn.parseNumber.defaults = {
|
||||
locale: "us",
|
||||
decimalSeparatorAlwaysShown: false,
|
||||
isPercentage: false,
|
||||
isFullLocale: false
|
||||
};
|
||||
|
||||
jQuery.fn.formatNumber.defaults = {
|
||||
format: "#,###.00",
|
||||
locale: "us",
|
||||
decimalSeparatorAlwaysShown: false,
|
||||
nanForceZero: true,
|
||||
round: true,
|
||||
isFullLocale: false
|
||||
};
|
||||
|
||||
Number.prototype.toFixed = function(precision) {
|
||||
return jQuery._roundNumber(this, precision);
|
||||
};
|
||||
|
||||
jQuery._roundNumber = function(number, decimalPlaces) {
|
||||
var power = Math.pow(10, decimalPlaces || 0);
|
||||
var value = String(Math.round(number * power) / power);
|
||||
|
||||
// ensure the decimal places are there
|
||||
if (decimalPlaces > 0) {
|
||||
var dp = value.indexOf(".");
|
||||
if (dp == -1) {
|
||||
value += '.';
|
||||
dp = 0;
|
||||
} else {
|
||||
dp = value.length - (dp + 1);
|
||||
}
|
||||
|
||||
while (dp < decimalPlaces) {
|
||||
value += '0';
|
||||
dp++;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<bundle minify="true" runOnBuild="true">
|
||||
<file>/ClientSource/Scripts/Modules/jQuery-NumberFormatter/jshashtable-2.1.js</file>
|
||||
<file>/ClientSource/Scripts/Modules/jQuery-NumberFormatter/jquery.numberformatter.js</file>
|
||||
</bundle>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+510
@@ -0,0 +1,510 @@
|
||||
/**
|
||||
* jquery.numberformatter - Formatting/Parsing Numbers in jQuery
|
||||
*
|
||||
* Written by
|
||||
* Michael Abernethy (mike@abernethysoft.com),
|
||||
* Andrew Parry (aparry0@gmail.com)
|
||||
*
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||
* and GPL (GPL-LICENSE.txt) licenses.
|
||||
*
|
||||
* @author Michael Abernethy, Andrew Parry
|
||||
* @version 1.2.3-SNAPSHOT ($Id$)
|
||||
*
|
||||
* Dependencies
|
||||
*
|
||||
* jQuery (http://jquery.com)
|
||||
* jshashtable (http://www.timdown.co.uk/jshashtable)
|
||||
*
|
||||
* Notes & Thanks
|
||||
*
|
||||
* many thanks to advweb.nanasi.jp for his bug fixes
|
||||
* jsHashtable is now used also, so thanks to the author for that excellent little class.
|
||||
*
|
||||
* This plugin can be used to format numbers as text and parse text as Numbers
|
||||
* Because we live in an international world, we cannot assume that everyone
|
||||
* uses "," to divide thousands, and "." as a decimal point.
|
||||
*
|
||||
* As of 1.2 the way this plugin works has changed slightly, parsing text to a number
|
||||
* has 1 set of functions, formatting a number to text has it's own. Before things
|
||||
* were a little confusing, so I wanted to separate the 2 out more.
|
||||
*
|
||||
*
|
||||
* jQuery extension functions:
|
||||
*
|
||||
* formatNumber(options, writeBack, giveReturnValue) - Reads the value from the subject, parses to
|
||||
* a Javascript Number object, then formats back to text using the passed options and write back to
|
||||
* the subject.
|
||||
*
|
||||
* parseNumber(options) - Parses the value in the subject to a Number object using the passed options
|
||||
* to decipher the actual number from the text, then writes the value as text back to the subject.
|
||||
*
|
||||
*
|
||||
* Generic functions:
|
||||
*
|
||||
* formatNumber(numberString, options) - Takes a plain number as a string (e.g. '1002.0123') and returns
|
||||
* a string of the given format options.
|
||||
*
|
||||
* parseNumber(numberString, options) - Takes a number as text that is formatted the same as the given
|
||||
* options then and returns it as a plain Number object.
|
||||
*
|
||||
* To achieve the old way of combining parsing and formatting to keep say a input field always formatted
|
||||
* to a given format after it has lost focus you'd simply use a combination of the functions.
|
||||
*
|
||||
* e.g.
|
||||
* $("#salary").blur(function(){
|
||||
* $(this).parseNumber({format:"#,###.00", locale:"us"});
|
||||
* $(this).formatNumber({format:"#,###.00", locale:"us"});
|
||||
* });
|
||||
*
|
||||
* The syntax for the formatting is:
|
||||
* 0 = Digit
|
||||
* # = Digit, zero shows as absent
|
||||
* . = Decimal separator
|
||||
* - = Negative sign
|
||||
* , = Grouping Separator
|
||||
* % = Percent (multiplies the number by 100)
|
||||
*
|
||||
* For example, a format of "#,###.00" and text of 4500.20 will
|
||||
* display as "4.500,20" with a locale of "de", and "4,500.20" with a locale of "us"
|
||||
*
|
||||
*
|
||||
* As of now, the only acceptable locales are
|
||||
* Arab Emirates -> "ae"
|
||||
* Australia -> "au"
|
||||
* Austria -> "at"
|
||||
* Brazil -> "br"
|
||||
* Canada -> "ca"
|
||||
* China -> "cn"
|
||||
* Czech -> "cz"
|
||||
* Denmark -> "dk"
|
||||
* Egypt -> "eg"
|
||||
* Finland -> "fi"
|
||||
* France -> "fr"
|
||||
* Germany -> "de"
|
||||
* Greece -> "gr"
|
||||
* Great Britain -> "gb"
|
||||
* Hong Kong -> "hk"
|
||||
* India -> "in"
|
||||
* Israel -> "il"
|
||||
* Japan -> "jp"
|
||||
* Russia -> "ru"
|
||||
* South Korea -> "kr"
|
||||
* Spain -> "es"
|
||||
* Sweden -> "se"
|
||||
* Switzerland -> "ch"
|
||||
* Taiwan -> "tw"
|
||||
* Thailand -> "th"
|
||||
* United States -> "us"
|
||||
* Vietnam -> "vn"
|
||||
**/
|
||||
|
||||
(function(jQuery) {
|
||||
|
||||
var nfLocales = new Hashtable();
|
||||
|
||||
var nfLocalesLikeUS = [ 'ae','au','ca','cn','eg','gb','hk','il','in','jp','sk','th','tw','us' ];
|
||||
var nfLocalesLikeDE = [ 'at','br','de','dk','es','gr','it','nl','pt','tr','vn' ];
|
||||
var nfLocalesLikeFR = [ 'cz','fi','fr','ru','se','pl' ];
|
||||
var nfLocalesLikeCH = [ 'ch' ];
|
||||
|
||||
var nfLocaleFormatting = [ [".", ","], [",", "."], [",", " "], [".", "'"] ];
|
||||
var nfAllLocales = [ nfLocalesLikeUS, nfLocalesLikeDE, nfLocalesLikeFR, nfLocalesLikeCH ]
|
||||
|
||||
function FormatData(dec, group, neg) {
|
||||
this.dec = dec;
|
||||
this.group = group;
|
||||
this.neg = neg;
|
||||
};
|
||||
|
||||
function init() {
|
||||
// write the arrays into the hashtable
|
||||
for (var localeGroupIdx = 0; localeGroupIdx < nfAllLocales.length; localeGroupIdx++) {
|
||||
localeGroup = nfAllLocales[localeGroupIdx];
|
||||
for (var i = 0; i < localeGroup.length; i++) {
|
||||
nfLocales.put(localeGroup[i], localeGroupIdx);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function formatCodes(locale, isFullLocale) {
|
||||
if (nfLocales.size() == 0)
|
||||
init();
|
||||
|
||||
// default values
|
||||
var dec = ".";
|
||||
var group = ",";
|
||||
var neg = "-";
|
||||
|
||||
if (isFullLocale == false) {
|
||||
// Extract and convert to lower-case any language code from a real 'locale' formatted string, if not use as-is
|
||||
// (To prevent locale format like : "fr_FR", "en_US", "de_DE", "fr_FR", "en-US", "de-DE")
|
||||
if (locale.indexOf('_') != -1)
|
||||
locale = locale.split('_')[1].toLowerCase();
|
||||
else if (locale.indexOf('-') != -1)
|
||||
locale = locale.split('-')[1].toLowerCase();
|
||||
}
|
||||
|
||||
// hashtable lookup to match locale with codes
|
||||
var codesIndex = nfLocales.get(locale);
|
||||
if (codesIndex) {
|
||||
var codes = nfLocaleFormatting[codesIndex];
|
||||
if (codes) {
|
||||
dec = codes[0];
|
||||
group = codes[1];
|
||||
}
|
||||
}
|
||||
return new FormatData(dec, group, neg);
|
||||
};
|
||||
|
||||
|
||||
/* Formatting Methods */
|
||||
|
||||
|
||||
/**
|
||||
* Formats anything containing a number in standard js number notation.
|
||||
*
|
||||
* @param {Object} options The formatting options to use
|
||||
* @param {Boolean} writeBack (true) If the output value should be written back to the subject
|
||||
* @param {Boolean} giveReturnValue (true) If the function should return the output string
|
||||
*/
|
||||
jQuery.fn.formatNumber = function(options, writeBack, giveReturnValue) {
|
||||
|
||||
return this.each(function() {
|
||||
// enforce defaults
|
||||
if (writeBack == null)
|
||||
writeBack = true;
|
||||
if (giveReturnValue == null)
|
||||
giveReturnValue = true;
|
||||
|
||||
// get text
|
||||
var text;
|
||||
if (jQuery(this).is(":input"))
|
||||
text = new String(jQuery(this).val());
|
||||
else
|
||||
text = new String(jQuery(this).text());
|
||||
|
||||
// format
|
||||
var returnString = jQuery.formatNumber(text, options);
|
||||
|
||||
// set formatted string back, only if a success
|
||||
// if (returnString) {
|
||||
if (writeBack) {
|
||||
if (jQuery(this).is(":input"))
|
||||
jQuery(this).val(returnString);
|
||||
else
|
||||
jQuery(this).text(returnString);
|
||||
}
|
||||
if (giveReturnValue)
|
||||
return returnString;
|
||||
// }
|
||||
// return '';
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* First parses a string and reformats it with the given options.
|
||||
*
|
||||
* @param {Object} numberString
|
||||
* @param {Object} options
|
||||
*/
|
||||
jQuery.formatNumber = function(numberString, options){
|
||||
var options = jQuery.extend({}, jQuery.fn.formatNumber.defaults, options);
|
||||
var formatData = formatCodes(options.locale.toLowerCase(), options.isFullLocale);
|
||||
|
||||
var dec = formatData.dec;
|
||||
var group = formatData.group;
|
||||
var neg = formatData.neg;
|
||||
|
||||
var validFormat = "0#-,.";
|
||||
|
||||
// strip all the invalid characters at the beginning and the end
|
||||
// of the format, and we'll stick them back on at the end
|
||||
// make a special case for the negative sign "-" though, so
|
||||
// we can have formats like -$23.32
|
||||
var prefix = "";
|
||||
var negativeInFront = false;
|
||||
for (var i = 0; i < options.format.length; i++) {
|
||||
if (validFormat.indexOf(options.format.charAt(i)) == -1)
|
||||
prefix = prefix + options.format.charAt(i);
|
||||
else
|
||||
if (i == 0 && options.format.charAt(i) == '-') {
|
||||
negativeInFront = true;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
var suffix = "";
|
||||
for (var i = options.format.length - 1; i >= 0; i--) {
|
||||
if (validFormat.indexOf(options.format.charAt(i)) == -1)
|
||||
suffix = options.format.charAt(i) + suffix;
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
options.format = options.format.substring(prefix.length);
|
||||
options.format = options.format.substring(0, options.format.length - suffix.length);
|
||||
|
||||
// now we need to convert it into a number
|
||||
//while (numberString.indexOf(group) > -1)
|
||||
// numberString = numberString.replace(group, '');
|
||||
//var number = new Number(numberString.replace(dec, ".").replace(neg, "-"));
|
||||
var number = new Number(numberString);
|
||||
|
||||
return jQuery._formatNumber(number, options, suffix, prefix, negativeInFront);
|
||||
};
|
||||
|
||||
/**
|
||||
* Formats a Number object into a string, using the given formatting options
|
||||
*
|
||||
* @param {Object} numberString
|
||||
* @param {Object} options
|
||||
*/
|
||||
jQuery._formatNumber = function(number, options, suffix, prefix, negativeInFront) {
|
||||
var options = jQuery.extend({}, jQuery.fn.formatNumber.defaults, options);
|
||||
var formatData = formatCodes(options.locale.toLowerCase(), options.isFullLocale);
|
||||
|
||||
var dec = formatData.dec;
|
||||
var group = formatData.group;
|
||||
var neg = formatData.neg;
|
||||
|
||||
var forcedToZero = false;
|
||||
if (isNaN(number)) {
|
||||
if (options.nanForceZero == true) {
|
||||
number = 0;
|
||||
forcedToZero = true;
|
||||
} else
|
||||
return null;
|
||||
}
|
||||
|
||||
// special case for percentages
|
||||
if (suffix == "%")
|
||||
number = number * 100;
|
||||
|
||||
var returnString = "";
|
||||
if (options.format.indexOf(".") > -1) {
|
||||
var decimalPortion = dec;
|
||||
var decimalFormat = options.format.substring(options.format.lastIndexOf(".") + 1);
|
||||
|
||||
// round or truncate number as needed
|
||||
if (options.round == true)
|
||||
number = new Number(number.toFixed(decimalFormat.length));
|
||||
else {
|
||||
var numStr = number.toString();
|
||||
numStr = numStr.substring(0, numStr.lastIndexOf('.') + decimalFormat.length + 1);
|
||||
number = new Number(numStr);
|
||||
}
|
||||
|
||||
var decimalValue = number % 1;
|
||||
var decimalString = new String(decimalValue.toFixed(decimalFormat.length));
|
||||
decimalString = decimalString.substring(decimalString.lastIndexOf(".") + 1);
|
||||
|
||||
for (var i = 0; i < decimalFormat.length; i++) {
|
||||
if (decimalFormat.charAt(i) == '#' && decimalString.charAt(i) != '0') {
|
||||
decimalPortion += decimalString.charAt(i);
|
||||
continue;
|
||||
} else if (decimalFormat.charAt(i) == '#' && decimalString.charAt(i) == '0') {
|
||||
var notParsed = decimalString.substring(i);
|
||||
if (notParsed.match('[1-9]')) {
|
||||
decimalPortion += decimalString.charAt(i);
|
||||
continue;
|
||||
} else
|
||||
break;
|
||||
} else if (decimalFormat.charAt(i) == "0")
|
||||
decimalPortion += decimalString.charAt(i);
|
||||
}
|
||||
returnString += decimalPortion
|
||||
} else
|
||||
number = Math.round(number);
|
||||
|
||||
var ones = Math.floor(number);
|
||||
if (number < 0)
|
||||
ones = Math.ceil(number);
|
||||
|
||||
var onesFormat = "";
|
||||
if (options.format.indexOf(".") == -1)
|
||||
onesFormat = options.format;
|
||||
else
|
||||
onesFormat = options.format.substring(0, options.format.indexOf("."));
|
||||
|
||||
var onePortion = "";
|
||||
if (!(ones == 0 && onesFormat.substr(onesFormat.length - 1) == '#') || forcedToZero) {
|
||||
// find how many digits are in the group
|
||||
var oneText = new String(Math.abs(ones));
|
||||
var groupLength = 9999;
|
||||
if (onesFormat.lastIndexOf(",") != -1)
|
||||
groupLength = onesFormat.length - onesFormat.lastIndexOf(",") - 1;
|
||||
var groupCount = 0;
|
||||
for (var i = oneText.length - 1; i > -1; i--) {
|
||||
onePortion = oneText.charAt(i) + onePortion;
|
||||
groupCount++;
|
||||
if (groupCount == groupLength && i != 0) {
|
||||
onePortion = group + onePortion;
|
||||
groupCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// account for any pre-data padding
|
||||
if (onesFormat.length > onePortion.length) {
|
||||
var padStart = onesFormat.indexOf('0');
|
||||
if (padStart != -1) {
|
||||
var padLen = onesFormat.length - padStart;
|
||||
|
||||
// pad to left with 0's or group char
|
||||
var pos = onesFormat.length - onePortion.length - 1;
|
||||
while (onePortion.length < padLen) {
|
||||
var padChar = onesFormat.charAt(pos);
|
||||
// replace with real group char if needed
|
||||
if (padChar == ',')
|
||||
padChar = group;
|
||||
onePortion = padChar + onePortion;
|
||||
pos--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!onePortion && onesFormat.indexOf('0', onesFormat.length - 1) !== -1)
|
||||
onePortion = '0';
|
||||
|
||||
returnString = onePortion + returnString;
|
||||
|
||||
// handle special case where negative is in front of the invalid characters
|
||||
if (number < 0 && negativeInFront && prefix.length > 0)
|
||||
prefix = neg + prefix;
|
||||
else if (number < 0)
|
||||
returnString = neg + returnString;
|
||||
|
||||
if (!options.decimalSeparatorAlwaysShown) {
|
||||
if (returnString.lastIndexOf(dec) == returnString.length - 1) {
|
||||
returnString = returnString.substring(0, returnString.length - 1);
|
||||
}
|
||||
}
|
||||
returnString = prefix + returnString + suffix;
|
||||
return returnString;
|
||||
};
|
||||
|
||||
|
||||
/* Parsing Methods */
|
||||
|
||||
|
||||
/**
|
||||
* Parses a number of given format from the element and returns a Number object.
|
||||
* @param {Object} options
|
||||
*/
|
||||
jQuery.fn.parseNumber = function(options, writeBack, giveReturnValue) {
|
||||
// enforce defaults
|
||||
if (writeBack == null)
|
||||
writeBack = true;
|
||||
if (giveReturnValue == null)
|
||||
giveReturnValue = true;
|
||||
|
||||
// get text
|
||||
var text;
|
||||
if (jQuery(this).is(":input"))
|
||||
text = new String(jQuery(this).val());
|
||||
else
|
||||
text = new String(jQuery(this).text());
|
||||
|
||||
// parse text
|
||||
var number = jQuery.parseNumber(text, options);
|
||||
|
||||
if (number) {
|
||||
if (writeBack) {
|
||||
if (jQuery(this).is(":input"))
|
||||
jQuery(this).val(number.toString());
|
||||
else
|
||||
jQuery(this).text(number.toString());
|
||||
}
|
||||
if (giveReturnValue)
|
||||
return number;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Parses a string of given format into a Number object.
|
||||
*
|
||||
* @param {Object} string
|
||||
* @param {Object} options
|
||||
*/
|
||||
jQuery.parseNumber = function(numberString, options) {
|
||||
var options = jQuery.extend({}, jQuery.fn.parseNumber.defaults, options);
|
||||
var formatData = formatCodes(options.locale.toLowerCase(), options.isFullLocale);
|
||||
|
||||
var dec = formatData.dec;
|
||||
var group = formatData.group;
|
||||
var neg = formatData.neg;
|
||||
|
||||
var valid = "1234567890.-";
|
||||
|
||||
// now we need to convert it into a number
|
||||
while (numberString.indexOf(group)>-1)
|
||||
numberString = numberString.replace(group,'');
|
||||
numberString = numberString.replace(dec,".").replace(neg,"-");
|
||||
var validText = "";
|
||||
var hasPercent = false;
|
||||
if (numberString.charAt(numberString.length - 1) == "%" || options.isPercentage == true)
|
||||
hasPercent = true;
|
||||
for (var i=0; i<numberString.length; i++) {
|
||||
if (valid.indexOf(numberString.charAt(i))>-1)
|
||||
validText = validText + numberString.charAt(i);
|
||||
}
|
||||
var number = new Number(validText);
|
||||
if (hasPercent) {
|
||||
number = number / 100;
|
||||
var decimalPos = validText.indexOf('.');
|
||||
if (decimalPos != -1) {
|
||||
var decimalPoints = validText.length - decimalPos - 1;
|
||||
number = number.toFixed(decimalPoints + 2);
|
||||
} else {
|
||||
number = number.toFixed(validText.length - 1);
|
||||
}
|
||||
}
|
||||
|
||||
return number;
|
||||
};
|
||||
|
||||
jQuery.fn.parseNumber.defaults = {
|
||||
locale: "us",
|
||||
decimalSeparatorAlwaysShown: false,
|
||||
isPercentage: false,
|
||||
isFullLocale: false
|
||||
};
|
||||
|
||||
jQuery.fn.formatNumber.defaults = {
|
||||
format: "#,###.00",
|
||||
locale: "us",
|
||||
decimalSeparatorAlwaysShown: false,
|
||||
nanForceZero: true,
|
||||
round: true,
|
||||
isFullLocale: false
|
||||
};
|
||||
|
||||
Number.prototype.toFixed = function(precision) {
|
||||
return jQuery._roundNumber(this, precision);
|
||||
};
|
||||
|
||||
jQuery._roundNumber = function(number, decimalPlaces) {
|
||||
var power = Math.pow(10, decimalPlaces || 0);
|
||||
var value = String(Math.round(number * power) / power);
|
||||
|
||||
// ensure the decimal places are there
|
||||
if (decimalPlaces > 0) {
|
||||
var dp = value.indexOf(".");
|
||||
if (dp == -1) {
|
||||
value += '.';
|
||||
dp = 0;
|
||||
} else {
|
||||
dp = value.length - (dp + 1);
|
||||
}
|
||||
|
||||
while (dp < decimalPlaces) {
|
||||
value += '0';
|
||||
dp++;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Copyright 2010 Tim Down.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var Hashtable=(function(){var p="function";var n=(typeof Array.prototype.splice==p)?function(s,r){s.splice(r,1)}:function(u,t){var s,v,r;if(t===u.length-1){u.length=t}else{s=u.slice(t+1);u.length=t;for(v=0,r=s.length;v<r;++v){u[t+v]=s[v]}}};function a(t){var r;if(typeof t=="string"){return t}else{if(typeof t.hashCode==p){r=t.hashCode();return(typeof r=="string")?r:a(r)}else{if(typeof t.toString==p){return t.toString()}else{try{return String(t)}catch(s){return Object.prototype.toString.call(t)}}}}}function g(r,s){return r.equals(s)}function e(r,s){return(typeof s.equals==p)?s.equals(r):(r===s)}function c(r){return function(s){if(s===null){throw new Error("null is not a valid "+r)}else{if(typeof s=="undefined"){throw new Error(r+" must not be undefined")}}}}var q=c("key"),l=c("value");function d(u,s,t,r){this[0]=u;this.entries=[];this.addEntry(s,t);if(r!==null){this.getEqualityFunction=function(){return r}}}var h=0,j=1,f=2;function o(r){return function(t){var s=this.entries.length,v,u=this.getEqualityFunction(t);while(s--){v=this.entries[s];if(u(t,v[0])){switch(r){case h:return true;case j:return v;case f:return[s,v[1]]}}}return false}}function k(r){return function(u){var v=u.length;for(var t=0,s=this.entries.length;t<s;++t){u[v+t]=this.entries[t][r]}}}d.prototype={getEqualityFunction:function(r){return(typeof r.equals==p)?g:e},getEntryForKey:o(j),getEntryAndIndexForKey:o(f),removeEntryForKey:function(s){var r=this.getEntryAndIndexForKey(s);if(r){n(this.entries,r[0]);return r[1]}return null},addEntry:function(r,s){this.entries[this.entries.length]=[r,s]},keys:k(0),values:k(1),getEntries:function(s){var u=s.length;for(var t=0,r=this.entries.length;t<r;++t){s[u+t]=this.entries[t].slice(0)}},containsKey:o(h),containsValue:function(s){var r=this.entries.length;while(r--){if(s===this.entries[r][1]){return true}}return false}};function m(s,t){var r=s.length,u;while(r--){u=s[r];if(t===u[0]){return r}}return null}function i(r,s){var t=r[s];return(t&&(t instanceof d))?t:null}function b(t,r){var w=this;var v=[];var u={};var x=(typeof t==p)?t:a;var s=(typeof r==p)?r:null;this.put=function(B,C){q(B);l(C);var D=x(B),E,A,z=null;E=i(u,D);if(E){A=E.getEntryForKey(B);if(A){z=A[1];A[1]=C}else{E.addEntry(B,C)}}else{E=new d(D,B,C,s);v[v.length]=E;u[D]=E}return z};this.get=function(A){q(A);var B=x(A);var C=i(u,B);if(C){var z=C.getEntryForKey(A);if(z){return z[1]}}return null};this.containsKey=function(A){q(A);var z=x(A);var B=i(u,z);return B?B.containsKey(A):false};this.containsValue=function(A){l(A);var z=v.length;while(z--){if(v[z].containsValue(A)){return true}}return false};this.clear=function(){v.length=0;u={}};this.isEmpty=function(){return !v.length};var y=function(z){return function(){var A=[],B=v.length;while(B--){v[B][z](A)}return A}};this.keys=y("keys");this.values=y("values");this.entries=y("getEntries");this.remove=function(B){q(B);var C=x(B),z,A=null;var D=i(u,C);if(D){A=D.removeEntryForKey(B);if(A!==null){if(!D.entries.length){z=m(v,C);n(v,z);delete u[C]}}}return A};this.size=function(){var A=0,z=v.length;while(z--){A+=v[z].entries.length}return A};this.each=function(C){var z=w.entries(),A=z.length,B;while(A--){B=z[A];C(B[0],B[1])}};this.putAll=function(H,C){var B=H.entries();var E,F,D,z,A=B.length;var G=(typeof C==p);while(A--){E=B[A];F=E[0];D=E[1];if(G&&(z=w.get(F))){D=C(F,z,D)}w.put(F,D)}};this.clone=function(){var z=new b(t,r);z.putAll(w);return z}}return b})();
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<bundle minify="true" runOnBuild="true">
|
||||
<file>/ClientSource/Scripts/Modules/jQuery-SignalR/jquery.signalR-0.5.3.js</file>
|
||||
</bundle>
|
||||
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 it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user