Nuiton-js-commits
Threads by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- 636 discussions
Author: echatellier
Date: 2013-03-15 15:06:25 +0100 (Fri, 15 Mar 2013)
New Revision: 42
Url: http://nuiton.org/projects/nuiton-js/repository/revisions/42
Log:
Init structure
Added:
branches/
1
0
Author: echatellier
Date: 2013-03-15 15:06:17 +0100 (Fri, 15 Mar 2013)
New Revision: 41
Url: http://nuiton.org/projects/nuiton-js/repository/revisions/41
Log:
Init structure
Added:
tags/
1
0
March 13, 2013
Author: echatellier
Date: 2013-03-13 17:30:40 +0100 (Wed, 13 Mar 2013)
New Revision: 40
Url: http://nuiton.org/projects/nuiton-js/repository/revisions/40
Log:
various fixes
Modified:
trunk/nuiton-js-wro/pom.xml
trunk/src/site/rst/index.rst
Modified: trunk/nuiton-js-wro/pom.xml
===================================================================
--- trunk/nuiton-js-wro/pom.xml 2013-03-13 16:30:28 UTC (rev 39)
+++ trunk/nuiton-js-wro/pom.xml 2013-03-13 16:30:40 UTC (rev 40)
@@ -15,7 +15,7 @@
<artifactId>nuiton-js-wro</artifactId>
- <name>Nuiton JS :: WRO</name>
+ <name>Nuiton JS :: Wro</name>
<description>Nuiton JS WRO extension</description>
<dependencies>
Modified: trunk/src/site/rst/index.rst
===================================================================
--- trunk/src/site/rst/index.rst 2013-03-13 16:30:28 UTC (rev 39)
+++ trunk/src/site/rst/index.rst 2013-03-13 16:30:40 UTC (rev 40)
@@ -21,6 +21,7 @@
.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
.. * #L%
.. -
+
Utilisation
===========
1
0
r39 - in trunk/nuiton-js-jstree: . src/main/resources/META-INF/nuiton-js src/main/resources/nuiton-js-jstree src/main/resources/nuiton-js-jstree/themes src/main/resources/nuiton-js-jstree/themes/apple src/main/resources/nuiton-js-jstree/themes/classic src/main/resources/nuiton-js-jstree/themes/default src/main/resources/nuiton-js-jstree/themes/default-rtl
by echatellier@users.nuiton.org March 13, 2013
by echatellier@users.nuiton.org March 13, 2013
March 13, 2013
Author: echatellier
Date: 2013-03-13 17:30:28 +0100 (Wed, 13 Mar 2013)
New Revision: 39
Url: http://nuiton.org/projects/nuiton-js/repository/revisions/39
Log:
back to jstree stable version 1.0-rc3
Added:
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/jquery.jstree.js
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/apple/
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/apple/bg.jpg
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/apple/d.png
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/apple/dot_for_ie.gif
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/apple/style.css
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/apple/throbber.gif
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/classic/
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/classic/d.gif
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/classic/d.png
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/classic/dot_for_ie.gif
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/classic/style.css
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/classic/throbber.gif
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default-rtl/
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default-rtl/d.gif
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default-rtl/d.png
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default-rtl/dots.gif
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default-rtl/style.css
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default-rtl/throbber.gif
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default/d.gif
Removed:
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/js/
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default/dots_rtl.gif
Modified:
trunk/nuiton-js-jstree/pom.xml
trunk/nuiton-js-jstree/src/main/resources/META-INF/nuiton-js/wro-jstree.xml
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default/style.css
Modified: trunk/nuiton-js-jstree/pom.xml
===================================================================
(Binary files differ)
Modified: trunk/nuiton-js-jstree/src/main/resources/META-INF/nuiton-js/wro-jstree.xml
===================================================================
--- trunk/nuiton-js-jstree/src/main/resources/META-INF/nuiton-js/wro-jstree.xml 2013-03-13 15:39:21 UTC (rev 38)
+++ trunk/nuiton-js-jstree/src/main/resources/META-INF/nuiton-js/wro-jstree.xml 2013-03-13 16:30:28 UTC (rev 39)
@@ -26,7 +26,7 @@
<import>classpath:META-INF/nuiton-js/wro-jquery.xml</import>
<group name='jstree'>
- <js>classpath:nuiton-js-jstree/js/*.js</js>
+ <js>classpath:nuiton-js-jstree/*.js</js>
<css>classpath:nuiton-js-jstree/themes/*.css</css>
</group>
Added: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/jquery.jstree.js
===================================================================
--- trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/jquery.jstree.js (rev 0)
+++ trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/jquery.jstree.js 2013-03-13 16:30:28 UTC (rev 39)
@@ -0,0 +1,4564 @@
+/* %%Ignore-License
+ * jsTree 1.0-rc3
+ * http://jstree.com/
+ *
+ * Copyright (c) 2010 Ivan Bozhanov (vakata.com)
+ *
+ * Licensed same as jquery - under the terms of either the MIT License or the GPL Version 2 License
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * $Date: 2011-02-09 01:17:14 +0200 (ср, 09 февр 2011) $
+ * $Revision: 236 $
+ */
+
+/*jslint browser: true, onevar: true, undef: true, bitwise: true, strict: true */
+/*global window : false, clearInterval: false, clearTimeout: false, document: false, setInterval: false, setTimeout: false, jQuery: false, navigator: false, XSLTProcessor: false, DOMParser: false, XMLSerializer: false, ActiveXObject: false */
+
+"use strict";
+
+// top wrapper to prevent multiple inclusion (is this OK?)
+(function () { if(jQuery && jQuery.jstree) { return; }
+ var is_ie6 = false, is_ie7 = false, is_ff2 = false;
+
+/*
+ * jsTree core
+ */
+(function ($) {
+ // Common functions not related to jsTree
+ // decided to move them to a `vakata` "namespace"
+ $.vakata = {};
+ // CSS related functions
+ $.vakata.css = {
+ get_css : function(rule_name, delete_flag, sheet) {
+ rule_name = rule_name.toLowerCase();
+ var css_rules = sheet.cssRules || sheet.rules,
+ j = 0;
+ do {
+ if(css_rules.length && j > css_rules.length + 5) { return false; }
+ if(css_rules[j].selectorText && css_rules[j].selectorText.toLowerCase() == rule_name) {
+ if(delete_flag === true) {
+ if(sheet.removeRule) { sheet.removeRule(j); }
+ if(sheet.deleteRule) { sheet.deleteRule(j); }
+ return true;
+ }
+ else { return css_rules[j]; }
+ }
+ }
+ while (css_rules[++j]);
+ return false;
+ },
+ add_css : function(rule_name, sheet) {
+ if($.jstree.css.get_css(rule_name, false, sheet)) { return false; }
+ if(sheet.insertRule) { sheet.insertRule(rule_name + ' { }', 0); } else { sheet.addRule(rule_name, null, 0); }
+ return $.vakata.css.get_css(rule_name);
+ },
+ remove_css : function(rule_name, sheet) {
+ return $.vakata.css.get_css(rule_name, true, sheet);
+ },
+ add_sheet : function(opts) {
+ var tmp = false, is_new = true;
+ if(opts.str) {
+ if(opts.title) { tmp = $("style[id='" + opts.title + "-stylesheet']")[0]; }
+ if(tmp) { is_new = false; }
+ else {
+ tmp = document.createElement("style");
+ tmp.setAttribute('type',"text/css");
+ if(opts.title) { tmp.setAttribute("id", opts.title + "-stylesheet"); }
+ }
+ if(tmp.styleSheet) {
+ if(is_new) {
+ document.getElementsByTagName("head")[0].appendChild(tmp);
+ tmp.styleSheet.cssText = opts.str;
+ }
+ else {
+ tmp.styleSheet.cssText = tmp.styleSheet.cssText + " " + opts.str;
+ }
+ }
+ else {
+ tmp.appendChild(document.createTextNode(opts.str));
+ document.getElementsByTagName("head")[0].appendChild(tmp);
+ }
+ return tmp.sheet || tmp.styleSheet;
+ }
+ if(opts.url) {
+ if(document.createStyleSheet) {
+ try { tmp = document.createStyleSheet(opts.url); } catch (e) { }
+ }
+ else {
+ tmp = document.createElement('link');
+ tmp.rel = 'stylesheet';
+ tmp.type = 'text/css';
+ tmp.media = "all";
+ tmp.href = opts.url;
+ document.getElementsByTagName("head")[0].appendChild(tmp);
+ return tmp.styleSheet;
+ }
+ }
+ }
+ };
+
+ // private variables
+ var instances = [], // instance array (used by $.jstree.reference/create/focused)
+ focused_instance = -1, // the index in the instance array of the currently focused instance
+ plugins = {}, // list of included plugins
+ prepared_move = {}; // for the move_node function
+
+ // jQuery plugin wrapper (thanks to jquery UI widget function)
+ $.fn.jstree = function (settings) {
+ var isMethodCall = (typeof settings == 'string'), // is this a method call like $().jstree("open_node")
+ args = Array.prototype.slice.call(arguments, 1),
+ returnValue = this;
+
+ // if a method call execute the method on all selected instances
+ if(isMethodCall) {
+ if(settings.substring(0, 1) == '_') { return returnValue; }
+ this.each(function() {
+ var instance = instances[$.data(this, "jstree_instance_id")],
+ methodValue = (instance && $.isFunction(instance[settings])) ? instance[settings].apply(instance, args) : instance;
+ if(typeof methodValue !== "undefined" && (settings.indexOf("is_") === 0 || (methodValue !== true && methodValue !== false))) { returnValue = methodValue; return false; }
+ });
+ }
+ else {
+ this.each(function() {
+ // extend settings and allow for multiple hashes and $.data
+ var instance_id = $.data(this, "jstree_instance_id"),
+ a = [],
+ b = settings ? $.extend({}, true, settings) : {},
+ c = $(this),
+ s = false,
+ t = [];
+ a = a.concat(args);
+ if(c.data("jstree")) { a.push(c.data("jstree")); }
+ b = a.length ? $.extend.apply(null, [true, b].concat(a)) : b;
+
+ // if an instance already exists, destroy it first
+ if(typeof instance_id !== "undefined" && instances[instance_id]) { instances[instance_id].destroy(); }
+ // push a new empty object to the instances array
+ instance_id = parseInt(instances.push({}),10) - 1;
+ // store the jstree instance id to the container element
+ $.data(this, "jstree_instance_id", instance_id);
+ // clean up all plugins
+ b.plugins = $.isArray(b.plugins) ? b.plugins : $.jstree.defaults.plugins.slice();
+ b.plugins.unshift("core");
+ // only unique plugins
+ b.plugins = b.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");
+
+ // extend defaults with passed data
+ s = $.extend(true, {}, $.jstree.defaults, b);
+ s.plugins = b.plugins;
+ $.each(plugins, function (i, val) {
+ if($.inArray(i, s.plugins) === -1) { s[i] = null; delete s[i]; }
+ else { t.push(i); }
+ });
+ s.plugins = t;
+
+ // push the new object to the instances array (at the same time set the default classes to the container) and init
+ instances[instance_id] = new $.jstree._instance(instance_id, $(this).addClass("jstree jstree-" + instance_id), s);
+ // init all activated plugins for this instance
+ $.each(instances[instance_id]._get_settings().plugins, function (i, val) { instances[instance_id].data[val] = {}; });
+ $.each(instances[instance_id]._get_settings().plugins, function (i, val) { if(plugins[val]) { plugins[val].__init.apply(instances[instance_id]); } });
+ // initialize the instance
+ setTimeout(function() { if(instances[instance_id]) { instances[instance_id].init(); } }, 0);
+ });
+ }
+ // return the jquery selection (or if it was a method call that returned a value - the returned value)
+ return returnValue;
+ };
+ // object to store exposed functions and objects
+ $.jstree = {
+ defaults : {
+ plugins : []
+ },
+ _focused : function () { return instances[focused_instance] || null; },
+ _reference : function (needle) {
+ // get by instance id
+ if(instances[needle]) { return instances[needle]; }
+ // get by DOM (if still no luck - return null
+ var o = $(needle);
+ if(!o.length && typeof needle === "string") { o = $("#" + needle); }
+ if(!o.length) { return null; }
+ return instances[o.closest(".jstree").data("jstree_instance_id")] || null;
+ },
+ _instance : function (index, container, settings) {
+ // for plugins to store data in
+ this.data = { core : {} };
+ this.get_settings = function () { return $.extend(true, {}, settings); };
+ this._get_settings = function () { return settings; };
+ this.get_index = function () { return index; };
+ this.get_container = function () { return container; };
+ this.get_container_ul = function () { return container.children("ul:eq(0)"); };
+ this._set_settings = function (s) {
+ settings = $.extend(true, {}, settings, s);
+ };
+ },
+ _fn : { },
+ plugin : function (pname, pdata) {
+ pdata = $.extend({}, {
+ __init : $.noop,
+ __destroy : $.noop,
+ _fn : {},
+ defaults : false
+ }, pdata);
+ plugins[pname] = pdata;
+
+ $.jstree.defaults[pname] = pdata.defaults;
+ $.each(pdata._fn, function (i, val) {
+ val.plugin = pname;
+ val.old = $.jstree._fn[i];
+ $.jstree._fn[i] = function () {
+ var rslt,
+ func = val,
+ args = Array.prototype.slice.call(arguments),
+ evnt = new $.Event("before.jstree"),
+ rlbk = false;
+
+ if(this.data.core.locked === true && i !== "unlock" && i !== "is_locked") { return; }
+
+ // Check if function belongs to the included plugins of this instance
+ do {
+ if(func && func.plugin && $.inArray(func.plugin, this._get_settings().plugins) !== -1) { break; }
+ func = func.old;
+ } while(func);
+ if(!func) { return; }
+
+ // context and function to trigger events, then finally call the function
+ if(i.indexOf("_") === 0) {
+ rslt = func.apply(this, args);
+ }
+ else {
+ rslt = this.get_container().triggerHandler(evnt, { "func" : i, "inst" : this, "args" : args, "plugin" : func.plugin });
+ if(rslt === false) { return; }
+ if(typeof rslt !== "undefined") { args = rslt; }
+
+ rslt = func.apply(
+ $.extend({}, this, {
+ __callback : function (data) {
+ this.get_container().triggerHandler( i + '.jstree', { "inst" : this, "args" : args, "rslt" : data, "rlbk" : rlbk });
+ },
+ __rollback : function () {
+ rlbk = this.get_rollback();
+ return rlbk;
+ },
+ __call_old : function (replace_arguments) {
+ return func.old.apply(this, (replace_arguments ? Array.prototype.slice.call(arguments, 1) : args ) );
+ }
+ }), args);
+ }
+
+ // return the result
+ return rslt;
+ };
+ $.jstree._fn[i].old = val.old;
+ $.jstree._fn[i].plugin = pname;
+ });
+ },
+ rollback : function (rb) {
+ if(rb) {
+ if(!$.isArray(rb)) { rb = [ rb ]; }
+ $.each(rb, function (i, val) {
+ instances[val.i].set_rollback(val.h, val.d);
+ });
+ }
+ }
+ };
+ // set the prototype for all instances
+ $.jstree._fn = $.jstree._instance.prototype = {};
+
+ // load the css when DOM is ready
+ $(function() {
+ // code is copied from jQuery ($.browser is deprecated + there is a bug in IE)
+ var u = navigator.userAgent.toLowerCase(),
+ v = (u.match( /.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
+ css_string = '' +
+ '.jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } ' +
+ '.jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; min-width:18px; } ' +
+ '.jstree-rtl li { margin-left:0; margin-right:18px; } ' +
+ '.jstree > ul > li { margin-left:0px; } ' +
+ '.jstree-rtl > ul > li { margin-right:0px; } ' +
+ '.jstree ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } ' +
+ '.jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } ' +
+ '.jstree a:focus { outline: none; } ' +
+ '.jstree a > ins { height:16px; width:16px; } ' +
+ '.jstree a > .jstree-icon { margin-right:3px; } ' +
+ '.jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } ' +
+ 'li.jstree-open > ul { display:block; } ' +
+ 'li.jstree-closed > ul { display:none; } ';
+ // Correct IE 6 (does not support the > CSS selector)
+ if(/msie/.test(u) && parseInt(v, 10) == 6) {
+ is_ie6 = true;
+
+ // fix image flicker and lack of caching
+ try {
+ document.execCommand("BackgroundImageCache", false, true);
+ } catch (err) { }
+
+ css_string += '' +
+ '.jstree li { height:18px; margin-left:0; margin-right:0; } ' +
+ '.jstree li li { margin-left:18px; } ' +
+ '.jstree-rtl li li { margin-left:0px; margin-right:18px; } ' +
+ 'li.jstree-open ul { display:block; } ' +
+ 'li.jstree-closed ul { display:none !important; } ' +
+ '.jstree li a { display:inline; border-width:0 !important; padding:0px 2px !important; } ' +
+ '.jstree li a ins { height:16px; width:16px; margin-right:3px; } ' +
+ '.jstree-rtl li a ins { margin-right:0px; margin-left:3px; } ';
+ }
+ // Correct IE 7 (shifts anchor nodes onhover)
+ if(/msie/.test(u) && parseInt(v, 10) == 7) {
+ is_ie7 = true;
+ css_string += '.jstree li a { border-width:0 !important; padding:0px 2px !important; } ';
+ }
+ // correct ff2 lack of display:inline-block
+ if(!/compatible/.test(u) && /mozilla/.test(u) && parseFloat(v, 10) < 1.9) {
+ is_ff2 = true;
+ css_string += '' +
+ '.jstree ins { display:-moz-inline-box; } ' +
+ '.jstree li { line-height:12px; } ' + // WHY??
+ '.jstree a { display:-moz-inline-box; } ' +
+ '.jstree .jstree-no-icons .jstree-checkbox { display:-moz-inline-stack !important; } ';
+ /* this shouldn't be here as it is theme specific */
+ }
+ // the default stylesheet
+ $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
+ });
+
+ // core functions (open, close, create, update, delete)
+ $.jstree.plugin("core", {
+ __init : function () {
+ this.data.core.locked = false;
+ this.data.core.to_open = this.get_settings().core.initially_open;
+ this.data.core.to_load = this.get_settings().core.initially_load;
+ },
+ defaults : {
+ html_titles : false,
+ animation : 500,
+ initially_open : [],
+ initially_load : [],
+ open_parents : true,
+ notify_plugins : true,
+ rtl : false,
+ load_open : false,
+ strings : {
+ loading : "Loading ...",
+ new_node : "New node",
+ multiple_selection : "Multiple selection"
+ }
+ },
+ _fn : {
+ init : function () {
+ this.set_focus();
+ if(this._get_settings().core.rtl) {
+ this.get_container().addClass("jstree-rtl").css("direction", "rtl");
+ }
+ this.get_container().html("<ul><li class='jstree-last jstree-leaf'><ins> </ins><a class='jstree-loading' href='#'><ins class='jstree-icon'> </ins>" + this._get_string("loading") + "</a></li></ul>");
+ this.data.core.li_height = this.get_container_ul().find("li.jstree-closed, li.jstree-leaf").eq(0).height() || 18;
+
+ this.get_container()
+ .delegate("li > ins", "click.jstree", $.proxy(function (event) {
+ var trgt = $(event.target);
+ // if(trgt.is("ins") && event.pageY - trgt.offset().top < this.data.core.li_height) { this.toggle_node(trgt); }
+ this.toggle_node(trgt);
+ }, this))
+ .bind("mousedown.jstree", $.proxy(function () {
+ this.set_focus(); // This used to be setTimeout(set_focus,0) - why?
+ }, this))
+ .bind("dblclick.jstree", function (event) {
+ var sel;
+ if(document.selection && document.selection.empty) { document.selection.empty(); }
+ else {
+ if(window.getSelection) {
+ sel = window.getSelection();
+ try {
+ sel.removeAllRanges();
+ sel.collapse();
+ } catch (err) { }
+ }
+ }
+ });
+ if(this._get_settings().core.notify_plugins) {
+ this.get_container()
+ .bind("load_node.jstree", $.proxy(function (e, data) {
+ var o = this._get_node(data.rslt.obj),
+ t = this;
+ if(o === -1) { o = this.get_container_ul(); }
+ if(!o.length) { return; }
+ o.find("li").each(function () {
+ var th = $(this);
+ if(th.data("jstree")) {
+ $.each(th.data("jstree"), function (plugin, values) {
+ if(t.data[plugin] && $.isFunction(t["_" + plugin + "_notify"])) {
+ t["_" + plugin + "_notify"].call(t, th, values);
+ }
+ });
+ }
+ });
+ }, this));
+ }
+ if(this._get_settings().core.load_open) {
+ this.get_container()
+ .bind("load_node.jstree", $.proxy(function (e, data) {
+ var o = this._get_node(data.rslt.obj),
+ t = this;
+ if(o === -1) { o = this.get_container_ul(); }
+ if(!o.length) { return; }
+ o.find("li.jstree-open:not(:has(ul))").each(function () {
+ t.load_node(this, $.noop, $.noop);
+ });
+ }, this));
+ }
+ this.__callback();
+ this.load_node(-1, function () { this.loaded(); this.reload_nodes(); });
+ },
+ destroy : function () {
+ var i,
+ n = this.get_index(),
+ s = this._get_settings(),
+ _this = this;
+
+ $.each(s.plugins, function (i, val) {
+ try { plugins[val].__destroy.apply(_this); } catch(err) { }
+ });
+ this.__callback();
+ // set focus to another instance if this one is focused
+ if(this.is_focused()) {
+ for(i in instances) {
+ if(instances.hasOwnProperty(i) && i != n) {
+ instances[i].set_focus();
+ break;
+ }
+ }
+ }
+ // if no other instance found
+ if(n === focused_instance) { focused_instance = -1; }
+ // remove all traces of jstree in the DOM (only the ones set using jstree*) and cleans all events
+ this.get_container()
+ .unbind(".jstree")
+ .undelegate(".jstree")
+ .removeData("jstree_instance_id")
+ .find("[class^='jstree']")
+ .addBack()
+ .attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); });
+ $(document)
+ .unbind(".jstree-" + n)
+ .undelegate(".jstree-" + n);
+ // remove the actual data
+ instances[n] = null;
+ delete instances[n];
+ },
+
+ _core_notify : function (n, data) {
+ if(data.opened) {
+ this.open_node(n, false, true);
+ }
+ },
+
+ lock : function () {
+ this.data.core.locked = true;
+ this.get_container().children("ul").addClass("jstree-locked").css("opacity","0.7");
+ this.__callback({});
+ },
+ unlock : function () {
+ this.data.core.locked = false;
+ this.get_container().children("ul").removeClass("jstree-locked").css("opacity","1");
+ this.__callback({});
+ },
+ is_locked : function () { return this.data.core.locked; },
+ save_opened : function () {
+ var _this = this;
+ this.data.core.to_open = [];
+ this.get_container_ul().find("li.jstree-open").each(function () {
+ if(this.id) { _this.data.core.to_open.push("#" + this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")); }
+ });
+ this.__callback(_this.data.core.to_open);
+ },
+ save_loaded : function () { },
+ reload_nodes : function (is_callback) {
+ var _this = this,
+ done = true,
+ current = [],
+ remaining = [];
+ if(!is_callback) {
+ this.data.core.reopen = false;
+ this.data.core.refreshing = true;
+ this.data.core.to_open = $.map($.makeArray(this.data.core.to_open), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
+ this.data.core.to_load = $.map($.makeArray(this.data.core.to_load), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
+ if(this.data.core.to_open.length) {
+ this.data.core.to_load = this.data.core.to_load.concat(this.data.core.to_open);
+ }
+ }
+ if(this.data.core.to_load.length) {
+ $.each(this.data.core.to_load, function (i, val) {
+ if(val == "#") { return true; }
+ if($(val).length) { current.push(val); }
+ else { remaining.push(val); }
+ });
+ if(current.length) {
+ this.data.core.to_load = remaining;
+ $.each(current, function (i, val) {
+ if(!_this._is_loaded(val)) {
+ _this.load_node(val, function () { _this.reload_nodes(true); }, function () { _this.reload_nodes(true); });
+ done = false;
+ }
+ });
+ }
+ }
+ if(this.data.core.to_open.length) {
+ $.each(this.data.core.to_open, function (i, val) {
+ _this.open_node(val, false, true);
+ });
+ }
+ if(done) {
+ // TODO: find a more elegant approach to syncronizing returning requests
+ if(this.data.core.reopen) { clearTimeout(this.data.core.reopen); }
+ this.data.core.reopen = setTimeout(function () { _this.__callback({}, _this); }, 50);
+ this.data.core.refreshing = false;
+ this.reopen();
+ }
+ },
+ reopen : function () {
+ var _this = this;
+ if(this.data.core.to_open.length) {
+ $.each(this.data.core.to_open, function (i, val) {
+ _this.open_node(val, false, true);
+ });
+ }
+ this.__callback({});
+ },
+ refresh : function (obj) {
+ var _this = this;
+ this.save_opened();
+ if(!obj) { obj = -1; }
+ obj = this._get_node(obj);
+ if(!obj) { obj = -1; }
+ if(obj !== -1) { obj.children("UL").remove(); }
+ else { this.get_container_ul().empty(); }
+ this.load_node(obj, function () { _this.__callback({ "obj" : obj}); _this.reload_nodes(); });
+ },
+ // Dummy function to fire after the first load (so that there is a jstree.loaded event)
+ loaded : function () {
+ this.__callback();
+ },
+ // deal with focus
+ set_focus : function () {
+ if(this.is_focused()) { return; }
+ var f = $.jstree._focused();
+ if(f) { f.unset_focus(); }
+
+ this.get_container().addClass("jstree-focused");
+ focused_instance = this.get_index();
+ this.__callback();
+ },
+ is_focused : function () {
+ return focused_instance == this.get_index();
+ },
+ unset_focus : function () {
+ if(this.is_focused()) {
+ this.get_container().removeClass("jstree-focused");
+ focused_instance = -1;
+ }
+ this.__callback();
+ },
+
+ // traverse
+ _get_node : function (obj) {
+ var $obj = $(obj, this.get_container());
+ if($obj.is(".jstree") || obj == -1) { return -1; }
+ $obj = $obj.closest("li", this.get_container());
+ return $obj.length ? $obj : false;
+ },
+ _get_next : function (obj, strict) {
+ obj = this._get_node(obj);
+ if(obj === -1) { return this.get_container().find("> ul > li:first-child"); }
+ if(!obj.length) { return false; }
+ if(strict) { return (obj.nextAll("li").size() > 0) ? obj.nextAll("li:eq(0)") : false; }
+
+ if(obj.hasClass("jstree-open")) { return obj.find("li:eq(0)"); }
+ else if(obj.nextAll("li").size() > 0) { return obj.nextAll("li:eq(0)"); }
+ else { return obj.parentsUntil(".jstree","li").next("li").eq(0); }
+ },
+ _get_prev : function (obj, strict) {
+ obj = this._get_node(obj);
+ if(obj === -1) { return this.get_container().find("> ul > li:last-child"); }
+ if(!obj.length) { return false; }
+ if(strict) { return (obj.prevAll("li").length > 0) ? obj.prevAll("li:eq(0)") : false; }
+
+ if(obj.prev("li").length) {
+ obj = obj.prev("li").eq(0);
+ while(obj.hasClass("jstree-open")) { obj = obj.children("ul:eq(0)").children("li:last"); }
+ return obj;
+ }
+ else { var o = obj.parentsUntil(".jstree","li:eq(0)"); return o.length ? o : false; }
+ },
+ _get_parent : function (obj) {
+ obj = this._get_node(obj);
+ if(obj == -1 || !obj.length) { return false; }
+ var o = obj.parentsUntil(".jstree", "li:eq(0)");
+ return o.length ? o : -1;
+ },
+ _get_children : function (obj) {
+ obj = this._get_node(obj);
+ if(obj === -1) { return this.get_container().children("ul:eq(0)").children("li"); }
+ if(!obj.length) { return false; }
+ return obj.children("ul:eq(0)").children("li");
+ },
+ get_path : function (obj, id_mode) {
+ var p = [],
+ _this = this;
+ obj = this._get_node(obj);
+ if(obj === -1 || !obj || !obj.length) { return false; }
+ obj.parentsUntil(".jstree", "li").each(function () {
+ p.push( id_mode ? this.id : _this.get_text(this) );
+ });
+ p.reverse();
+ p.push( id_mode ? obj.attr("id") : this.get_text(obj) );
+ return p;
+ },
+
+ // string functions
+ _get_string : function (key) {
+ return this._get_settings().core.strings[key] || key;
+ },
+
+ is_open : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-open"); },
+ is_closed : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-closed"); },
+ is_leaf : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-leaf"); },
+ correct_state : function (obj) {
+ obj = this._get_node(obj);
+ if(!obj || obj === -1) { return false; }
+ obj.removeClass("jstree-closed jstree-open").addClass("jstree-leaf").children("ul").remove();
+ this.__callback({ "obj" : obj });
+ },
+ // open/close
+ open_node : function (obj, callback, skip_animation) {
+ obj = this._get_node(obj);
+ if(!obj.length) { return false; }
+ if(!obj.hasClass("jstree-closed")) { if(callback) { callback.call(); } return false; }
+ var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation,
+ t = this;
+ if(!this._is_loaded(obj)) {
+ obj.children("a").addClass("jstree-loading");
+ this.load_node(obj, function () { t.open_node(obj, callback, skip_animation); }, callback);
+ }
+ else {
+ if(this._get_settings().core.open_parents) {
+ obj.parentsUntil(".jstree",".jstree-closed").each(function () {
+ t.open_node(this, false, true);
+ });
+ }
+ if(s) { obj.children("ul").css("display","none"); }
+ obj.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading");
+ if(s) { obj.children("ul").stop(true, true).slideDown(s, function () { this.style.display = ""; t.after_open(obj); }); }
+ else { t.after_open(obj); }
+ this.__callback({ "obj" : obj });
+ if(callback) { callback.call(); }
+ }
+ },
+ after_open : function (obj) { this.__callback({ "obj" : obj }); },
+ close_node : function (obj, skip_animation) {
+ obj = this._get_node(obj);
+ var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation,
+ t = this;
+ if(!obj.length || !obj.hasClass("jstree-open")) { return false; }
+ if(s) { obj.children("ul").attr("style","display:block !important"); }
+ obj.removeClass("jstree-open").addClass("jstree-closed");
+ if(s) { obj.children("ul").stop(true, true).slideUp(s, function () { this.style.display = ""; t.after_close(obj); }); }
+ else { t.after_close(obj); }
+ this.__callback({ "obj" : obj });
+ },
+ after_close : function (obj) { this.__callback({ "obj" : obj }); },
+ toggle_node : function (obj) {
+ obj = this._get_node(obj);
+ if(obj.hasClass("jstree-closed")) { return this.open_node(obj); }
+ if(obj.hasClass("jstree-open")) { return this.close_node(obj); }
+ },
+ open_all : function (obj, do_animation, original_obj) {
+ obj = obj ? this._get_node(obj) : -1;
+ if(!obj || obj === -1) { obj = this.get_container_ul(); }
+ if(original_obj) {
+ obj = obj.find("li.jstree-closed");
+ }
+ else {
+ original_obj = obj;
+ if(obj.is(".jstree-closed")) { obj = obj.find("li.jstree-closed").addBack(); }
+ else { obj = obj.find("li.jstree-closed"); }
+ }
+ var _this = this;
+ obj.each(function () {
+ var __this = this;
+ if(!_this._is_loaded(this)) { _this.open_node(this, function() { _this.open_all(__this, do_animation, original_obj); }, !do_animation); }
+ else { _this.open_node(this, false, !do_animation); }
+ });
+ // so that callback is fired AFTER all nodes are open
+ if(original_obj.find('li.jstree-closed').length === 0) { this.__callback({ "obj" : original_obj }); }
+ },
+ close_all : function (obj, do_animation) {
+ var _this = this;
+ obj = obj ? this._get_node(obj) : this.get_container();
+ if(!obj || obj === -1) { obj = this.get_container_ul(); }
+ obj.find("li.jstree-open").addBack().each(function () { _this.close_node(this, !do_animation); });
+ this.__callback({ "obj" : obj });
+ },
+ clean_node : function (obj) {
+ obj = obj && obj != -1 ? $(obj) : this.get_container_ul();
+ obj = obj.is("li") ? obj.find("li").addBack() : obj.find("li");
+ obj.removeClass("jstree-last")
+ .filter("li:last-child").addClass("jstree-last").end()
+ .filter(":has(li)")
+ .not(".jstree-open").removeClass("jstree-leaf").addClass("jstree-closed");
+ obj.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove();
+ this.__callback({ "obj" : obj });
+ },
+ // rollback
+ get_rollback : function () {
+ this.__callback();
+ return { i : this.get_index(), h : this.get_container().children("ul").clone(true), d : this.data };
+ },
+ set_rollback : function (html, data) {
+ this.get_container().empty().append(html);
+ this.data = data;
+ this.__callback();
+ },
+ // Dummy functions to be overwritten by any datastore plugin included
+ load_node : function (obj, s_call, e_call) { this.__callback({ "obj" : obj }); },
+ _is_loaded : function (obj) { return true; },
+
+ // Basic operations: create
+ create_node : function (obj, position, js, callback, is_loaded) {
+ obj = this._get_node(obj);
+ position = typeof position === "undefined" ? "last" : position;
+ var d = $("<li />"),
+ s = this._get_settings().core,
+ tmp;
+
+ if(obj !== -1 && !obj.length) { return false; }
+ if(!is_loaded && !this._is_loaded(obj)) { this.load_node(obj, function () { this.create_node(obj, position, js, callback, true); }); return false; }
+
+ this.__rollback();
+
+ if(typeof js === "string") { js = { "data" : js }; }
+ if(!js) { js = {}; }
+ if(js.attr) { d.attr(js.attr); }
+ if(js.metadata) { d.data(js.metadata); }
+ if(js.state) { d.addClass("jstree-" + js.state); }
+ if(!js.data) { js.data = this._get_string("new_node"); }
+ if(!$.isArray(js.data)) { tmp = js.data; js.data = []; js.data.push(tmp); }
+ $.each(js.data, function (i, m) {
+ tmp = $("<a />");
+ if($.isFunction(m)) { m = m.call(this, js); }
+ if(typeof m == "string") { tmp.attr('href','#')[ s.html_titles ? "html" : "text" ](m); }
+ else {
+ if(!m.attr) { m.attr = {}; }
+ if(!m.attr.href) { m.attr.href = '#'; }
+ tmp.attr(m.attr)[ s.html_titles ? "html" : "text" ](m.title);
+ if(m.language) { tmp.addClass(m.language); }
+ }
+ tmp.prepend("<ins class='jstree-icon'> </ins>");
+ if(!m.icon && js.icon) { m.icon = js.icon; }
+ if(m.icon) {
+ if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); }
+ else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); }
+ }
+ d.append(tmp);
+ });
+ d.prepend("<ins class='jstree-icon'> </ins>");
+ if(obj === -1) {
+ obj = this.get_container();
+ if(position === "before") { position = "first"; }
+ if(position === "after") { position = "last"; }
+ }
+ switch(position) {
+ case "before": obj.before(d); tmp = this._get_parent(obj); break;
+ case "after" : obj.after(d); tmp = this._get_parent(obj); break;
+ case "inside":
+ case "first" :
+ if(!obj.children("ul").length) { obj.append("<ul />"); }
+ obj.children("ul").prepend(d);
+ tmp = obj;
+ break;
+ case "last":
+ if(!obj.children("ul").length) { obj.append("<ul />"); }
+ obj.children("ul").append(d);
+ tmp = obj;
+ break;
+ default:
+ if(!obj.children("ul").length) { obj.append("<ul />"); }
+ if(!position) { position = 0; }
+ tmp = obj.children("ul").children("li").eq(position);
+ if(tmp.length) { tmp.before(d); }
+ else { obj.children("ul").append(d); }
+ tmp = obj;
+ break;
+ }
+ if(tmp === -1 || tmp.get(0) === this.get_container().get(0)) { tmp = -1; }
+ this.clean_node(tmp);
+ this.__callback({ "obj" : d, "parent" : tmp });
+ if(callback) { callback.call(this, d); }
+ return d;
+ },
+ // Basic operations: rename (deal with text)
+ get_text : function (obj) {
+ obj = this._get_node(obj);
+ if(!obj.length) { return false; }
+ var s = this._get_settings().core.html_titles;
+ obj = obj.children("a:eq(0)");
+ if(s) {
+ obj = obj.clone();
+ obj.children("INS").remove();
+ return obj.html();
+ }
+ else {
+ obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
+ return obj.nodeValue;
+ }
+ },
+ set_text : function (obj, val) {
+ obj = this._get_node(obj);
+ if(!obj.length) { return false; }
+ obj = obj.children("a:eq(0)");
+ if(this._get_settings().core.html_titles) {
+ var tmp = obj.children("INS").clone();
+ obj.html(val).prepend(tmp);
+ this.__callback({ "obj" : obj, "name" : val });
+ return true;
+ }
+ else {
+ obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
+ this.__callback({ "obj" : obj, "name" : val });
+ return (obj.nodeValue = val);
+ }
+ },
+ rename_node : function (obj, val) {
+ obj = this._get_node(obj);
+ this.__rollback();
+ if(obj && obj.length && this.set_text.apply(this, Array.prototype.slice.call(arguments))) { this.__callback({ "obj" : obj, "name" : val }); }
+ },
+ // Basic operations: deleting nodes
+ delete_node : function (obj) {
+ obj = this._get_node(obj);
+ if(!obj.length) { return false; }
+ this.__rollback();
+ var p = this._get_parent(obj), prev = $([]), t = this;
+ obj.each(function () {
+ prev = prev.add(t._get_prev(this));
+ });
+ obj = obj.detach();
+ if(p !== -1 && p.find("> ul > li").length === 0) {
+ p.removeClass("jstree-open jstree-closed").addClass("jstree-leaf");
+ }
+ this.clean_node(p);
+ this.__callback({ "obj" : obj, "prev" : prev, "parent" : p });
+ return obj;
+ },
+ prepare_move : function (o, r, pos, cb, is_cb) {
+ var p = {};
+
+ p.ot = $.jstree._reference(o) || this;
+ p.o = p.ot._get_node(o);
+ p.r = r === - 1 ? -1 : this._get_node(r);
+ p.p = (typeof pos === "undefined" || pos === false) ? "last" : pos; // TODO: move to a setting
+ if(!is_cb && prepared_move.o && prepared_move.o[0] === p.o[0] && prepared_move.r[0] === p.r[0] && prepared_move.p === p.p) {
+ this.__callback(prepared_move);
+ if(cb) { cb.call(this, prepared_move); }
+ return;
+ }
+ p.ot = $.jstree._reference(p.o) || this;
+ p.rt = $.jstree._reference(p.r) || this; // r === -1 ? p.ot : $.jstree._reference(p.r) || this
+ if(p.r === -1 || !p.r) {
+ p.cr = -1;
+ switch(p.p) {
+ case "first":
+ case "before":
+ case "inside":
+ p.cp = 0;
+ break;
+ case "after":
+ case "last":
+ p.cp = p.rt.get_container().find(" > ul > li").length;
+ break;
+ default:
+ p.cp = p.p;
+ break;
+ }
+ }
+ else {
+ if(!/^(before|after)$/.test(p.p) && !this._is_loaded(p.r)) {
+ return this.load_node(p.r, function () { this.prepare_move(o, r, pos, cb, true); });
+ }
+ switch(p.p) {
+ case "before":
+ p.cp = p.r.index();
+ p.cr = p.rt._get_parent(p.r);
+ break;
+ case "after":
+ p.cp = p.r.index() + 1;
+ p.cr = p.rt._get_parent(p.r);
+ break;
+ case "inside":
+ case "first":
+ p.cp = 0;
+ p.cr = p.r;
+ break;
+ case "last":
+ p.cp = p.r.find(" > ul > li").length;
+ p.cr = p.r;
+ break;
+ default:
+ p.cp = p.p;
+ p.cr = p.r;
+ break;
+ }
+ }
+ p.np = p.cr == -1 ? p.rt.get_container() : p.cr;
+ p.op = p.ot._get_parent(p.o);
+ p.cop = p.o.index();
+ if(p.op === -1) { p.op = p.ot ? p.ot.get_container() : this.get_container(); }
+ if(!/^(before|after)$/.test(p.p) && p.op && p.np && p.op[0] === p.np[0] && p.o.index() < p.cp) { p.cp++; }
+ //if(p.p === "before" && p.op && p.np && p.op[0] === p.np[0] && p.o.index() < p.cp) { p.cp--; }
+ p.or = p.np.find(" > ul > li:nth-child(" + (p.cp + 1) + ")");
+ prepared_move = p;
+ this.__callback(prepared_move);
+ if(cb) { cb.call(this, prepared_move); }
+ },
+ check_move : function () {
+ var obj = prepared_move, ret = true, r = obj.r === -1 ? this.get_container() : obj.r;
+ if(!obj || !obj.o || obj.or[0] === obj.o[0]) { return false; }
+ if(!obj.cy) {
+ if(obj.op && obj.np && obj.op[0] === obj.np[0] && obj.cp - 1 === obj.o.index()) { return false; }
+ obj.o.each(function () {
+ if(r.parentsUntil(".jstree", "li").addBack().index(this) !== -1) { ret = false; return false; }
+ });
+ }
+ return ret;
+ },
+ move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) {
+ if(!is_prepared) {
+ return this.prepare_move(obj, ref, position, function (p) {
+ this.move_node(p, false, false, is_copy, true, skip_check);
+ });
+ }
+ if(is_copy) {
+ prepared_move.cy = true;
+ }
+ if(!skip_check && !this.check_move()) { return false; }
+
+ this.__rollback();
+ var o = false;
+ if(is_copy) {
+ o = obj.o.clone(true);
+ o.find("*[id]").addBack().each(function () {
+ if(this.id) { this.id = "copy_" + this.id; }
+ });
+ }
+ else { o = obj.o; }
+
+ if(obj.or.length) { obj.or.before(o); }
+ else {
+ if(!obj.np.children("ul").length) { $("<ul />").appendTo(obj.np); }
+ obj.np.children("ul:eq(0)").append(o);
+ }
+
+ try {
+ obj.ot.clean_node(obj.op);
+ obj.rt.clean_node(obj.np);
+ if(!obj.op.find("> ul > li").length) {
+ obj.op.removeClass("jstree-open jstree-closed").addClass("jstree-leaf").children("ul").remove();
+ }
+ } catch (e) { }
+
+ if(is_copy) {
+ prepared_move.cy = true;
+ prepared_move.oc = o;
+ }
+ this.__callback(prepared_move);
+ return prepared_move;
+ },
+ _get_move : function () { return prepared_move; }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree ui plugin
+ * This plugins handles selecting/deselecting/hovering/dehovering nodes
+ */
+(function ($) {
+ var scrollbar_width, e1, e2;
+ $(function() {
+ if (/msie/.test(navigator.userAgent.toLowerCase())) {
+ e1 = $('<textarea cols="10" rows="2"></textarea>').css({ position: 'absolute', top: -1000, left: 0 }).appendTo('body');
+ e2 = $('<textarea cols="10" rows="2" style="overflow: hidden;"></textarea>').css({ position: 'absolute', top: -1000, left: 0 }).appendTo('body');
+ scrollbar_width = e1.width() - e2.width();
+ e1.add(e2).remove();
+ }
+ else {
+ e1 = $('<div />').css({ width: 100, height: 100, overflow: 'auto', position: 'absolute', top: -1000, left: 0 })
+ .prependTo('body').append('<div />').find('div').css({ width: '100%', height: 200 });
+ scrollbar_width = 100 - e1.width();
+ e1.parent().remove();
+ }
+ });
+ $.jstree.plugin("ui", {
+ __init : function () {
+ this.data.ui.selected = $();
+ this.data.ui.last_selected = false;
+ this.data.ui.hovered = null;
+ this.data.ui.to_select = this.get_settings().ui.initially_select;
+
+ this.get_container()
+ .delegate("a", "click.jstree", $.proxy(function (event) {
+ event.preventDefault();
+ event.currentTarget.blur();
+ if(!$(event.currentTarget).hasClass("jstree-loading")) {
+ this.select_node(event.currentTarget, true, event);
+ }
+ }, this))
+ .delegate("a", "mouseenter.jstree", $.proxy(function (event) {
+ if(!$(event.currentTarget).hasClass("jstree-loading")) {
+ this.hover_node(event.target);
+ }
+ }, this))
+ .delegate("a", "mouseleave.jstree", $.proxy(function (event) {
+ if(!$(event.currentTarget).hasClass("jstree-loading")) {
+ this.dehover_node(event.target);
+ }
+ }, this))
+ .bind("reopen.jstree", $.proxy(function () {
+ this.reselect();
+ }, this))
+ .bind("get_rollback.jstree", $.proxy(function () {
+ this.dehover_node();
+ this.save_selected();
+ }, this))
+ .bind("set_rollback.jstree", $.proxy(function () {
+ this.reselect();
+ }, this))
+ .bind("close_node.jstree", $.proxy(function (event, data) {
+ var s = this._get_settings().ui,
+ obj = this._get_node(data.rslt.obj),
+ clk = (obj && obj.length) ? obj.children("ul").find("a.jstree-clicked") : $(),
+ _this = this;
+ if(s.selected_parent_close === false || !clk.length) { return; }
+ clk.each(function () {
+ _this.deselect_node(this);
+ if(s.selected_parent_close === "select_parent") { _this.select_node(obj); }
+ });
+ }, this))
+ .bind("delete_node.jstree", $.proxy(function (event, data) {
+ var s = this._get_settings().ui.select_prev_on_delete,
+ obj = this._get_node(data.rslt.obj),
+ clk = (obj && obj.length) ? obj.find("a.jstree-clicked") : [],
+ _this = this;
+ clk.each(function () { _this.deselect_node(this); });
+ if(s && clk.length) {
+ data.rslt.prev.each(function () {
+ if(this.parentNode) { _this.select_node(this); return false; /* if return false is removed all prev nodes will be selected */}
+ });
+ }
+ }, this))
+ .bind("move_node.jstree", $.proxy(function (event, data) {
+ if(data.rslt.cy) {
+ data.rslt.oc.find("a.jstree-clicked").removeClass("jstree-clicked");
+ }
+ }, this));
+ },
+ defaults : {
+ select_limit : -1, // 0, 1, 2 ... or -1 for unlimited
+ select_multiple_modifier : "ctrl", // on, or ctrl, shift, alt
+ select_range_modifier : "shift",
+ selected_parent_close : "select_parent", // false, "deselect", "select_parent"
+ selected_parent_open : true,
+ select_prev_on_delete : true,
+ disable_selecting_children : false,
+ initially_select : []
+ },
+ _fn : {
+ _get_node : function (obj, allow_multiple) {
+ if(typeof obj === "undefined" || obj === null) { return allow_multiple ? this.data.ui.selected : this.data.ui.last_selected; }
+ var $obj = $(obj, this.get_container());
+ if($obj.is(".jstree") || obj == -1) { return -1; }
+ $obj = $obj.closest("li", this.get_container());
+ return $obj.length ? $obj : false;
+ },
+ _ui_notify : function (n, data) {
+ if(data.selected) {
+ this.select_node(n, false);
+ }
+ },
+ save_selected : function () {
+ var _this = this;
+ this.data.ui.to_select = [];
+ this.data.ui.selected.each(function () { if(this.id) { _this.data.ui.to_select.push("#" + this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")); } });
+ this.__callback(this.data.ui.to_select);
+ },
+ reselect : function () {
+ var _this = this,
+ s = this.data.ui.to_select;
+ s = $.map($.makeArray(s), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
+ // this.deselect_all(); WHY deselect, breaks plugin state notifier?
+ $.each(s, function (i, val) { if(val && val !== "#") { _this.select_node(val); } });
+ this.data.ui.selected = this.data.ui.selected.filter(function () { return this.parentNode; });
+ this.__callback();
+ },
+ refresh : function (obj) {
+ this.save_selected();
+ return this.__call_old();
+ },
+ hover_node : function (obj) {
+ obj = this._get_node(obj);
+ if(!obj.length) { return false; }
+ //if(this.data.ui.hovered && obj.get(0) === this.data.ui.hovered.get(0)) { return; }
+ if(!obj.hasClass("jstree-hovered")) { this.dehover_node(); }
+ this.data.ui.hovered = obj.children("a").addClass("jstree-hovered").parent();
+ this._fix_scroll(obj);
+ this.__callback({ "obj" : obj });
+ },
+ dehover_node : function () {
+ var obj = this.data.ui.hovered, p;
+ if(!obj || !obj.length) { return false; }
+ p = obj.children("a").removeClass("jstree-hovered").parent();
+ if(this.data.ui.hovered[0] === p[0]) { this.data.ui.hovered = null; }
+ this.__callback({ "obj" : obj });
+ },
+ select_node : function (obj, check, e) {
+ obj = this._get_node(obj);
+ if(obj == -1 || !obj || !obj.length) { return false; }
+ var s = this._get_settings().ui,
+ is_multiple = (s.select_multiple_modifier == "on" || (s.select_multiple_modifier !== false && e && e[s.select_multiple_modifier + "Key"])),
+ is_range = (s.select_range_modifier !== false && e && e[s.select_range_modifier + "Key"] && this.data.ui.last_selected && this.data.ui.last_selected[0] !== obj[0] && this.data.ui.last_selected.parent()[0] === obj.parent()[0]),
+ is_selected = this.is_selected(obj),
+ proceed = true,
+ t = this;
+ if(check) {
+ if(s.disable_selecting_children && is_multiple &&
+ (
+ (obj.parentsUntil(".jstree","li").children("a.jstree-clicked").length) ||
+ (obj.children("ul").find("a.jstree-clicked:eq(0)").length)
+ )
+ ) {
+ return false;
+ }
+ proceed = false;
+ switch(!0) {
+ case (is_range):
+ this.data.ui.last_selected.addClass("jstree-last-selected");
+ obj = obj[ obj.index() < this.data.ui.last_selected.index() ? "nextUntil" : "prevUntil" ](".jstree-last-selected").addBack();
+ if(s.select_limit == -1 || obj.length < s.select_limit) {
+ this.data.ui.last_selected.removeClass("jstree-last-selected");
+ this.data.ui.selected.each(function () {
+ if(this !== t.data.ui.last_selected[0]) { t.deselect_node(this); }
+ });
+ is_selected = false;
+ proceed = true;
+ }
+ else {
+ proceed = false;
+ }
+ break;
+ case (is_selected && !is_multiple):
+ this.deselect_all();
+ is_selected = false;
+ proceed = true;
+ break;
+ case (!is_selected && !is_multiple):
+ if(s.select_limit == -1 || s.select_limit > 0) {
+ this.deselect_all();
+ proceed = true;
+ }
+ break;
+ case (is_selected && is_multiple):
+ this.deselect_node(obj);
+ break;
+ case (!is_selected && is_multiple):
+ if(s.select_limit == -1 || this.data.ui.selected.length + 1 <= s.select_limit) {
+ proceed = true;
+ }
+ break;
+ }
+ }
+ if(proceed && !is_selected) {
+ if(!is_range) { this.data.ui.last_selected = obj; }
+ obj.children("a").addClass("jstree-clicked");
+ if(s.selected_parent_open) {
+ obj.parents(".jstree-closed").each(function () { t.open_node(this, false, true); });
+ }
+ this.data.ui.selected = this.data.ui.selected.add(obj);
+ this._fix_scroll(obj.eq(0));
+ this.__callback({ "obj" : obj, "e" : e });
+ }
+ },
+ _fix_scroll : function (obj) {
+ var c = this.get_container()[0], t;
+ if(c.scrollHeight > c.offsetHeight) {
+ obj = this._get_node(obj);
+ if(!obj || obj === -1 || !obj.length || !obj.is(":visible")) { return; }
+ t = obj.offset().top - this.get_container().offset().top;
+ if(t < 0) {
+ c.scrollTop = c.scrollTop + t - 1;
+ }
+ if(t + this.data.core.li_height + (c.scrollWidth > c.offsetWidth ? scrollbar_width : 0) > c.offsetHeight) {
+ c.scrollTop = c.scrollTop + (t - c.offsetHeight + this.data.core.li_height + 1 + (c.scrollWidth > c.offsetWidth ? scrollbar_width : 0));
+ }
+ }
+ },
+ deselect_node : function (obj) {
+ obj = this._get_node(obj);
+ if(!obj.length) { return false; }
+ if(this.is_selected(obj)) {
+ obj.children("a").removeClass("jstree-clicked");
+ this.data.ui.selected = this.data.ui.selected.not(obj);
+ if(this.data.ui.last_selected.get(0) === obj.get(0)) { this.data.ui.last_selected = this.data.ui.selected.eq(0); }
+ this.__callback({ "obj" : obj });
+ }
+ },
+ toggle_select : function (obj) {
+ obj = this._get_node(obj);
+ if(!obj.length) { return false; }
+ if(this.is_selected(obj)) { this.deselect_node(obj); }
+ else { this.select_node(obj); }
+ },
+ is_selected : function (obj) { return this.data.ui.selected.index(this._get_node(obj)) >= 0; },
+ get_selected : function (context) {
+ return context ? $(context).find("a.jstree-clicked").parent() : this.data.ui.selected;
+ },
+ deselect_all : function (context) {
+ var ret = context ? $(context).find("a.jstree-clicked").parent() : this.get_container().find("a.jstree-clicked").parent();
+ ret.children("a.jstree-clicked").removeClass("jstree-clicked");
+ this.data.ui.selected = $([]);
+ this.data.ui.last_selected = false;
+ this.__callback({ "obj" : ret });
+ }
+ }
+ });
+ // include the selection plugin by default
+ $.jstree.defaults.plugins.push("ui");
+})(jQuery);
+//*/
+
+/*
+ * jsTree CRRM plugin
+ * Handles creating/renaming/removing/moving nodes by user interaction.
+ */
+(function ($) {
+ $.jstree.plugin("crrm", {
+ __init : function () {
+ this.get_container()
+ .bind("move_node.jstree", $.proxy(function (e, data) {
+ if(this._get_settings().crrm.move.open_onmove) {
+ var t = this;
+ data.rslt.np.parentsUntil(".jstree").addBack().filter(".jstree-closed").each(function () {
+ t.open_node(this, false, true);
+ });
+ }
+ }, this));
+ },
+ defaults : {
+ input_width_limit : 200,
+ move : {
+ always_copy : false, // false, true or "multitree"
+ open_onmove : true,
+ default_position : "last",
+ check_move : function (m) { return true; }
+ }
+ },
+ _fn : {
+ _show_input : function (obj, callback) {
+ obj = this._get_node(obj);
+ var rtl = this._get_settings().core.rtl,
+ w = this._get_settings().crrm.input_width_limit,
+ w1 = obj.children("ins").width(),
+ w2 = obj.find("> a:visible > ins").width() * obj.find("> a:visible > ins").length,
+ t = this.get_text(obj),
+ h1 = $("<div />", { css : { "position" : "absolute", "top" : "-200px", "left" : (rtl ? "0px" : "-1000px"), "visibility" : "hidden" } }).appendTo("body"),
+ h2 = obj.css("position","relative").append(
+ $("<input />", {
+ "value" : t,
+ "class" : "jstree-rename-input",
+ // "size" : t.length,
+ "css" : {
+ "padding" : "0",
+ "border" : "1px solid silver",
+ "position" : "absolute",
+ "left" : (rtl ? "auto" : (w1 + w2 + 4) + "px"),
+ "right" : (rtl ? (w1 + w2 + 4) + "px" : "auto"),
+ "top" : "0px",
+ "height" : (this.data.core.li_height - 2) + "px",
+ "lineHeight" : (this.data.core.li_height - 2) + "px",
+ "width" : "150px" // will be set a bit further down
+ },
+ "blur" : $.proxy(function () {
+ var i = obj.children(".jstree-rename-input"),
+ v = i.val();
+ if(v === "") { v = t; }
+ h1.remove();
+ i.remove(); // rollback purposes
+ this.set_text(obj,t); // rollback purposes
+ this.rename_node(obj, v);
+ callback.call(this, obj, v, t);
+ obj.css("position","");
+ }, this),
+ "keyup" : function (event) {
+ var key = event.keyCode || event.which;
+ if(key == 27) { this.value = t; this.blur(); return; }
+ else if(key == 13) { this.blur(); return; }
+ else {
+ h2.width(Math.min(h1.text("pW" + this.value).width(),w));
+ }
+ },
+ "keypress" : function(event) {
+ var key = event.keyCode || event.which;
+ if(key == 13) { return false; }
+ }
+ })
+ ).children(".jstree-rename-input");
+ this.set_text(obj, "");
+ h1.css({
+ fontFamily : h2.css('fontFamily') || '',
+ fontSize : h2.css('fontSize') || '',
+ fontWeight : h2.css('fontWeight') || '',
+ fontStyle : h2.css('fontStyle') || '',
+ fontStretch : h2.css('fontStretch') || '',
+ fontVariant : h2.css('fontVariant') || '',
+ letterSpacing : h2.css('letterSpacing') || '',
+ wordSpacing : h2.css('wordSpacing') || ''
+ });
+ h2.width(Math.min(h1.text("pW" + h2[0].value).width(),w))[0].select();
+ },
+ rename : function (obj) {
+ obj = this._get_node(obj);
+ this.__rollback();
+ var f = this.__callback;
+ this._show_input(obj, function (obj, new_name, old_name) {
+ f.call(this, { "obj" : obj, "new_name" : new_name, "old_name" : old_name });
+ });
+ },
+ create : function (obj, position, js, callback, skip_rename) {
+ var t, _this = this;
+ obj = this._get_node(obj);
+ if(!obj) { obj = -1; }
+ this.__rollback();
+ t = this.create_node(obj, position, js, function (t) {
+ var p = this._get_parent(t),
+ pos = $(t).index();
+ if(callback) { callback.call(this, t); }
+ if(p.length && p.hasClass("jstree-closed")) { this.open_node(p, false, true); }
+ if(!skip_rename) {
+ this._show_input(t, function (obj, new_name, old_name) {
+ _this.__callback({ "obj" : obj, "name" : new_name, "parent" : p, "position" : pos });
+ });
+ }
+ else { _this.__callback({ "obj" : t, "name" : this.get_text(t), "parent" : p, "position" : pos }); }
+ });
+ return t;
+ },
+ remove : function (obj) {
+ obj = this._get_node(obj, true);
+ var p = this._get_parent(obj), prev = this._get_prev(obj);
+ this.__rollback();
+ obj = this.delete_node(obj);
+ if(obj !== false) { this.__callback({ "obj" : obj, "prev" : prev, "parent" : p }); }
+ },
+ check_move : function () {
+ if(!this.__call_old()) { return false; }
+ var s = this._get_settings().crrm.move;
+ if(!s.check_move.call(this, this._get_move())) { return false; }
+ return true;
+ },
+ move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) {
+ var s = this._get_settings().crrm.move;
+ if(!is_prepared) {
+ if(typeof position === "undefined") { position = s.default_position; }
+ if(position === "inside" && !s.default_position.match(/^(before|after)$/)) { position = s.default_position; }
+ return this.__call_old(true, obj, ref, position, is_copy, false, skip_check);
+ }
+ // if the move is already prepared
+ if(s.always_copy === true || (s.always_copy === "multitree" && obj.rt.get_index() !== obj.ot.get_index() )) {
+ is_copy = true;
+ }
+ this.__call_old(true, obj, ref, position, is_copy, true, skip_check);
+ },
+
+ cut : function (obj) {
+ obj = this._get_node(obj, true);
+ if(!obj || !obj.length) { return false; }
+ this.data.crrm.cp_nodes = false;
+ this.data.crrm.ct_nodes = obj;
+ this.__callback({ "obj" : obj });
+ },
+ copy : function (obj) {
+ obj = this._get_node(obj, true);
+ if(!obj || !obj.length) { return false; }
+ this.data.crrm.ct_nodes = false;
+ this.data.crrm.cp_nodes = obj;
+ this.__callback({ "obj" : obj });
+ },
+ paste : function (obj) {
+ obj = this._get_node(obj);
+ if(!obj || !obj.length) { return false; }
+ var nodes = this.data.crrm.ct_nodes ? this.data.crrm.ct_nodes : this.data.crrm.cp_nodes;
+ if(!this.data.crrm.ct_nodes && !this.data.crrm.cp_nodes) { return false; }
+ if(this.data.crrm.ct_nodes) { this.move_node(this.data.crrm.ct_nodes, obj); this.data.crrm.ct_nodes = false; }
+ if(this.data.crrm.cp_nodes) { this.move_node(this.data.crrm.cp_nodes, obj, false, true); }
+ this.__callback({ "obj" : obj, "nodes" : nodes });
+ }
+ }
+ });
+ // include the crr plugin by default
+ // $.jstree.defaults.plugins.push("crrm");
+})(jQuery);
+//*/
+
+/*
+ * jsTree themes plugin
+ * Handles loading and setting themes, as well as detecting path to themes, etc.
+ */
+(function ($) {
+ var themes_loaded = [];
+ // this variable stores the path to the themes folder - if left as false - it will be autodetected
+ $.jstree._themes = false;
+ $.jstree.plugin("themes", {
+ __init : function () {
+ this.get_container()
+ .bind("init.jstree", $.proxy(function () {
+ var s = this._get_settings().themes;
+ this.data.themes.dots = s.dots;
+ this.data.themes.icons = s.icons;
+ this.set_theme(s.theme, s.url);
+ }, this))
+ .bind("loaded.jstree", $.proxy(function () {
+ // bound here too, as simple HTML tree's won't honor dots & icons otherwise
+ if(!this.data.themes.dots) { this.hide_dots(); }
+ else { this.show_dots(); }
+ if(!this.data.themes.icons) { this.hide_icons(); }
+ else { this.show_icons(); }
+ }, this));
+ },
+ defaults : {
+ theme : "default",
+ url : false,
+ dots : true,
+ icons : true
+ },
+ _fn : {
+ set_theme : function (theme_name, theme_url) {
+ if(!theme_name) { return false; }
+ if(!theme_url) { theme_url = $.jstree._themes + theme_name + '/style.css'; }
+ if($.inArray(theme_url, themes_loaded) == -1) {
+ $.vakata.css.add_sheet({ "url" : theme_url });
+ themes_loaded.push(theme_url);
+ }
+ if(this.data.themes.theme != theme_name) {
+ this.get_container().removeClass('jstree-' + this.data.themes.theme);
+ this.data.themes.theme = theme_name;
+ }
+ this.get_container().addClass('jstree-' + theme_name);
+ if(!this.data.themes.dots) { this.hide_dots(); }
+ else { this.show_dots(); }
+ if(!this.data.themes.icons) { this.hide_icons(); }
+ else { this.show_icons(); }
+ this.__callback();
+ },
+ get_theme : function () { return this.data.themes.theme; },
+
+ show_dots : function () { this.data.themes.dots = true; this.get_container().children("ul").removeClass("jstree-no-dots"); },
+ hide_dots : function () { this.data.themes.dots = false; this.get_container().children("ul").addClass("jstree-no-dots"); },
+ toggle_dots : function () { if(this.data.themes.dots) { this.hide_dots(); } else { this.show_dots(); } },
+
+ show_icons : function () { this.data.themes.icons = true; this.get_container().children("ul").removeClass("jstree-no-icons"); },
+ hide_icons : function () { this.data.themes.icons = false; this.get_container().children("ul").addClass("jstree-no-icons"); },
+ toggle_icons: function () { if(this.data.themes.icons) { this.hide_icons(); } else { this.show_icons(); } }
+ }
+ });
+ // autodetect themes path
+ $(function () {
+ if($.jstree._themes === false) {
+ $("script").each(function () {
+ if(this.src.toString().match(/jquery\.jstree[^\/]*?\.js(\?.*)?$/)) {
+ $.jstree._themes = this.src.toString().replace(/jquery\.jstree[^\/]*?\.js(\?.*)?$/, "") + 'themes/';
+ return false;
+ }
+ });
+ }
+ if($.jstree._themes === false) { $.jstree._themes = "themes/"; }
+ });
+ // include the themes plugin by default
+ $.jstree.defaults.plugins.push("themes");
+})(jQuery);
+//*/
+
+/*
+ * jsTree hotkeys plugin
+ * Enables keyboard navigation for all tree instances
+ * Depends on the jstree ui & jquery hotkeys plugins
+ */
+(function ($) {
+ var bound = [];
+ function exec(i, event) {
+ var f = $.jstree._focused(), tmp;
+ if(f && f.data && f.data.hotkeys && f.data.hotkeys.enabled) {
+ tmp = f._get_settings().hotkeys[i];
+ if(tmp) { return tmp.call(f, event); }
+ }
+ }
+ $.jstree.plugin("hotkeys", {
+ __init : function () {
+ if(typeof $.hotkeys === "undefined") { throw "jsTree hotkeys: jQuery hotkeys plugin not included."; }
+ if(!this.data.ui) { throw "jsTree hotkeys: jsTree UI plugin not included."; }
+ $.each(this._get_settings().hotkeys, function (i, v) {
+ if(v !== false && $.inArray(i, bound) == -1) {
+ $(document).bind("keydown", i, function (event) { return exec(i, event); });
+ bound.push(i);
+ }
+ });
+ this.get_container()
+ .bind("lock.jstree", $.proxy(function () {
+ if(this.data.hotkeys.enabled) { this.data.hotkeys.enabled = false; this.data.hotkeys.revert = true; }
+ }, this))
+ .bind("unlock.jstree", $.proxy(function () {
+ if(this.data.hotkeys.revert) { this.data.hotkeys.enabled = true; }
+ }, this));
+ this.enable_hotkeys();
+ },
+ defaults : {
+ "up" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+ this.hover_node(this._get_prev(o));
+ return false;
+ },
+ "ctrl+up" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+ this.hover_node(this._get_prev(o));
+ return false;
+ },
+ "shift+up" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+ this.hover_node(this._get_prev(o));
+ return false;
+ },
+ "down" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+ this.hover_node(this._get_next(o));
+ return false;
+ },
+ "ctrl+down" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+ this.hover_node(this._get_next(o));
+ return false;
+ },
+ "shift+down" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+ this.hover_node(this._get_next(o));
+ return false;
+ },
+ "left" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected;
+ if(o) {
+ if(o.hasClass("jstree-open")) { this.close_node(o); }
+ else { this.hover_node(this._get_prev(o)); }
+ }
+ return false;
+ },
+ "ctrl+left" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected;
+ if(o) {
+ if(o.hasClass("jstree-open")) { this.close_node(o); }
+ else { this.hover_node(this._get_prev(o)); }
+ }
+ return false;
+ },
+ "shift+left" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected;
+ if(o) {
+ if(o.hasClass("jstree-open")) { this.close_node(o); }
+ else { this.hover_node(this._get_prev(o)); }
+ }
+ return false;
+ },
+ "right" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected;
+ if(o && o.length) {
+ if(o.hasClass("jstree-closed")) { this.open_node(o); }
+ else { this.hover_node(this._get_next(o)); }
+ }
+ return false;
+ },
+ "ctrl+right" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected;
+ if(o && o.length) {
+ if(o.hasClass("jstree-closed")) { this.open_node(o); }
+ else { this.hover_node(this._get_next(o)); }
+ }
+ return false;
+ },
+ "shift+right" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected;
+ if(o && o.length) {
+ if(o.hasClass("jstree-closed")) { this.open_node(o); }
+ else { this.hover_node(this._get_next(o)); }
+ }
+ return false;
+ },
+ "space" : function () {
+ if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").click(); }
+ return false;
+ },
+ "ctrl+space" : function (event) {
+ event.type = "click";
+ if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").trigger(event); }
+ return false;
+ },
+ "shift+space" : function (event) {
+ event.type = "click";
+ if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").trigger(event); }
+ return false;
+ },
+ "f2" : function () { this.rename(this.data.ui.hovered || this.data.ui.last_selected); },
+ "del" : function () { this.remove(this.data.ui.hovered || this._get_node(null)); }
+ },
+ _fn : {
+ enable_hotkeys : function () {
+ this.data.hotkeys.enabled = true;
+ },
+ disable_hotkeys : function () {
+ this.data.hotkeys.enabled = false;
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree JSON plugin
+ * The JSON data store. Datastores are build by overriding the `load_node` and `_is_loaded` functions.
+ */
+(function ($) {
+ $.jstree.plugin("json_data", {
+ __init : function() {
+ var s = this._get_settings().json_data;
+ if(s.progressive_unload) {
+ this.get_container().bind("after_close.jstree", function (e, data) {
+ data.rslt.obj.children("ul").remove();
+ });
+ }
+ },
+ defaults : {
+ // `data` can be a function:
+ // * accepts two arguments - node being loaded and a callback to pass the result to
+ // * will be executed in the current tree's scope & ajax won't be supported
+ data : false,
+ ajax : false,
+ correct_state : true,
+ progressive_render : false,
+ progressive_unload : false
+ },
+ _fn : {
+ load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_json(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); },
+ _is_loaded : function (obj) {
+ var s = this._get_settings().json_data;
+ obj = this._get_node(obj);
+ return obj == -1 || !obj || (!s.ajax && !s.progressive_render && !$.isFunction(s.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").length > 0;
+ },
+ refresh : function (obj) {
+ obj = this._get_node(obj);
+ var s = this._get_settings().json_data;
+ if(obj && obj !== -1 && s.progressive_unload && ($.isFunction(s.data) || !!s.ajax)) {
+ obj.removeData("jstree_children");
+ }
+ return this.__call_old();
+ },
+ load_node_json : function (obj, s_call, e_call) {
+ var s = this.get_settings().json_data, d,
+ error_func = function () {},
+ success_func = function () {};
+ obj = this._get_node(obj);
+
+ if(obj && obj !== -1 && (s.progressive_render || s.progressive_unload) && !obj.is(".jstree-open, .jstree-leaf") && obj.children("ul").children("li").length === 0 && obj.data("jstree_children")) {
+ d = this._parse_json(obj.data("jstree_children"), obj);
+ if(d) {
+ obj.append(d);
+ if(!s.progressive_unload) { obj.removeData("jstree_children"); }
+ }
+ this.clean_node(obj);
+ if(s_call) { s_call.call(this); }
+ return;
+ }
+
+ if(obj && obj !== -1) {
+ if(obj.data("jstree_is_loading")) { return; }
+ else { obj.data("jstree_is_loading",true); }
+ }
+ switch(!0) {
+ case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
+ // function option added here for easier model integration (also supporting async - see callback)
+ case ($.isFunction(s.data)):
+ s.data.call(this, obj, $.proxy(function (d) {
+ d = this._parse_json(d, obj);
+ if(!d) {
+ if(obj === -1 || !obj) {
+ if(s.correct_state) { this.get_container().children("ul").empty(); }
+ }
+ else {
+ obj.children("a.jstree-loading").removeClass("jstree-loading");
+ obj.removeData("jstree_is_loading");
+ if(s.correct_state) { this.correct_state(obj); }
+ }
+ if(e_call) { e_call.call(this); }
+ }
+ else {
+ if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
+ else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree_is_loading"); }
+ this.clean_node(obj);
+ if(s_call) { s_call.call(this); }
+ }
+ }, this));
+ break;
+ case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
+ if(!obj || obj == -1) {
+ d = this._parse_json(s.data, obj);
+ if(d) {
+ this.get_container().children("ul").empty().append(d.children());
+ this.clean_node();
+ }
+ else {
+ if(s.correct_state) { this.get_container().children("ul").empty(); }
+ }
+ }
+ if(s_call) { s_call.call(this); }
+ break;
+ case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
+ error_func = function (x, t, e) {
+ var ef = this.get_settings().json_data.ajax.error;
+ if(ef) { ef.call(this, x, t, e); }
+ if(obj != -1 && obj.length) {
+ obj.children("a.jstree-loading").removeClass("jstree-loading");
+ obj.removeData("jstree_is_loading");
+ if(t === "success" && s.correct_state) { this.correct_state(obj); }
+ }
+ else {
+ if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
+ }
+ if(e_call) { e_call.call(this); }
+ };
+ success_func = function (d, t, x) {
+ var sf = this.get_settings().json_data.ajax.success;
+ if(sf) { d = sf.call(this,d,t,x) || d; }
+ if(d === "" || (d && d.toString && d.toString().replace(/^[\s\n]+$/,"") === "") || (!$.isArray(d) && !$.isPlainObject(d))) {
+ return error_func.call(this, x, t, "");
+ }
+ d = this._parse_json(d, obj);
+ if(d) {
+ if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
+ else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree_is_loading"); }
+ this.clean_node(obj);
+ if(s_call) { s_call.call(this); }
+ }
+ else {
+ if(obj === -1 || !obj) {
+ if(s.correct_state) {
+ this.get_container().children("ul").empty();
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ else {
+ obj.children("a.jstree-loading").removeClass("jstree-loading");
+ obj.removeData("jstree_is_loading");
+ if(s.correct_state) {
+ this.correct_state(obj);
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ }
+ };
+ s.ajax.context = this;
+ s.ajax.error = error_func;
+ s.ajax.success = success_func;
+ if(!s.ajax.dataType) { s.ajax.dataType = "json"; }
+ if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
+ if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
+ $.ajax(s.ajax);
+ break;
+ }
+ },
+ _parse_json : function (js, obj, is_callback) {
+ var d = false,
+ p = this._get_settings(),
+ s = p.json_data,
+ t = p.core.html_titles,
+ tmp, i, j, ul1, ul2;
+
+ if(!js) { return d; }
+ if(s.progressive_unload && obj && obj !== -1) {
+ obj.data("jstree_children", d);
+ }
+ if($.isArray(js)) {
+ d = $('<ul>');
+ if(!js.length) { return false; }
+ for(i = 0, j = js.length; i < j; i++) {
+ tmp = this._parse_json(js[i], obj, true);
+ if(tmp.length) {
+ d = d.append(tmp);
+ }
+ }
+ d = d.children();
+ }
+ else {
+ if(typeof js == "string") { js = { data : js }; }
+ if(!js.data && js.data !== "") { return d; }
+ d = $("<li />");
+ if(js.attr) { d.attr(js.attr); }
+ if(js.metadata) { d.data(js.metadata); }
+ if(js.state) { d.addClass("jstree-" + js.state); }
+ if(!$.isArray(js.data)) { tmp = js.data; js.data = []; js.data.push(tmp); }
+ $.each(js.data, function (i, m) {
+ tmp = $("<a />");
+ if($.isFunction(m)) { m = m.call(this, js); }
+ if(typeof m == "string") { tmp.attr('href','#')[ t ? "html" : "text" ](m); }
+ else {
+ if(!m.attr) { m.attr = {}; }
+ if(!m.attr.href) { m.attr.href = '#'; }
+ tmp.attr(m.attr)[ t ? "html" : "text" ](m.title);
+ if(m.language) { tmp.addClass(m.language); }
+ }
+ tmp.prepend("<ins class='jstree-icon'> </ins>");
+ if(!m.icon && js.icon) { m.icon = js.icon; }
+ if(m.icon) {
+ if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); }
+ else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); }
+ }
+ d.append(tmp);
+ });
+ d.prepend("<ins class='jstree-icon'> </ins>");
+ if(js.children) {
+ if(s.progressive_render && js.state !== "open") {
+ d.addClass("jstree-closed").data("jstree_children", js.children);
+ }
+ else {
+ if(s.progressive_unload) { d.data("jstree_children", js.children); }
+ if($.isArray(js.children) && js.children.length) {
+ tmp = this._parse_json(js.children, obj, true);
+ if(tmp.length) {
+ ul2 = $("<ul />");
+ ul2.append(tmp);
+ d.append(ul2);
+ }
+ }
+ }
+ }
+ }
+ if(!is_callback) {
+ ul1 = $("<ul />");
+ ul1.append(d);
+ d = ul1;
+ }
+ return d;
+ },
+ get_json : function (obj, li_attr, a_attr, is_callback) {
+ var result = [],
+ s = this._get_settings(),
+ _this = this,
+ tmp1, tmp2, li, a, t, lang;
+ obj = this._get_node(obj);
+ if(!obj || obj === -1) { obj = this.get_container().find("> ul > li"); }
+ li_attr = $.isArray(li_attr) ? li_attr : [ "id", "class" ];
+ if(!is_callback && this.data.types) { li_attr.push(s.types.type_attr); }
+ a_attr = $.isArray(a_attr) ? a_attr : [ ];
+
+ obj.each(function () {
+ li = $(this);
+ tmp1 = { data : [] };
+ if(li_attr.length) { tmp1.attr = { }; }
+ $.each(li_attr, function (i, v) {
+ tmp2 = li.attr(v);
+ if(tmp2 && tmp2.length && tmp2.replace(/jstree[^ ]*/ig,'').length) {
+ tmp1.attr[v] = (" " + tmp2).replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");
+ }
+ });
+ if(li.hasClass("jstree-open")) { tmp1.state = "open"; }
+ if(li.hasClass("jstree-closed")) { tmp1.state = "closed"; }
+ if(li.data()) { tmp1.metadata = li.data(); }
+ a = li.children("a");
+ a.each(function () {
+ t = $(this);
+ if(
+ a_attr.length ||
+ $.inArray("languages", s.plugins) !== -1 ||
+ t.children("ins").get(0).style.backgroundImage.length ||
+ (t.children("ins").get(0).className && t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').length)
+ ) {
+ lang = false;
+ if($.inArray("languages", s.plugins) !== -1 && $.isArray(s.languages) && s.languages.length) {
+ $.each(s.languages, function (l, lv) {
+ if(t.hasClass(lv)) {
+ lang = lv;
+ return false;
+ }
+ });
+ }
+ tmp2 = { attr : { }, title : _this.get_text(t, lang) };
+ $.each(a_attr, function (k, z) {
+ tmp2.attr[z] = (" " + (t.attr(z) || "")).replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");
+ });
+ if($.inArray("languages", s.plugins) !== -1 && $.isArray(s.languages) && s.languages.length) {
+ $.each(s.languages, function (k, z) {
+ if(t.hasClass(z)) { tmp2.language = z; return true; }
+ });
+ }
+ if(t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/^\s+$/ig,"").length) {
+ tmp2.icon = t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");
+ }
+ if(t.children("ins").get(0).style.backgroundImage.length) {
+ tmp2.icon = t.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","");
+ }
+ }
+ else {
+ tmp2 = _this.get_text(t);
+ }
+ if(a.length > 1) { tmp1.data.push(tmp2); }
+ else { tmp1.data = tmp2; }
+ });
+ li = li.find("> ul > li");
+ if(li.length) { tmp1.children = _this.get_json(li, li_attr, a_attr, true); }
+ result.push(tmp1);
+ });
+ return result;
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree languages plugin
+ * Adds support for multiple language versions in one tree
+ * This basically allows for many titles coexisting in one node, but only one of them being visible at any given time
+ * This is useful for maintaining the same structure in many languages (hence the name of the plugin)
+ */
+(function ($) {
+ var sh = false;
+ $.jstree.plugin("languages", {
+ __init : function () { this._load_css(); },
+ defaults : [],
+ _fn : {
+ set_lang : function (i) {
+ var langs = this._get_settings().languages,
+ st = false,
+ selector = ".jstree-" + this.get_index() + ' a';
+ if(!$.isArray(langs) || langs.length === 0) { return false; }
+ if($.inArray(i,langs) == -1) {
+ if(!!langs[i]) { i = langs[i]; }
+ else { return false; }
+ }
+ if(i == this.data.languages.current_language) { return true; }
+ st = $.vakata.css.get_css(selector + "." + this.data.languages.current_language, false, sh);
+ if(st !== false) { st.style.display = "none"; }
+ st = $.vakata.css.get_css(selector + "." + i, false, sh);
+ if(st !== false) { st.style.display = ""; }
+ this.data.languages.current_language = i;
+ this.__callback(i);
+ return true;
+ },
+ get_lang : function () {
+ return this.data.languages.current_language;
+ },
+ _get_string : function (key, lang) {
+ var langs = this._get_settings().languages,
+ s = this._get_settings().core.strings;
+ if($.isArray(langs) && langs.length) {
+ lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
+ }
+ if(s[lang] && s[lang][key]) { return s[lang][key]; }
+ if(s[key]) { return s[key]; }
+ return key;
+ },
+ get_text : function (obj, lang) {
+ obj = this._get_node(obj) || this.data.ui.last_selected;
+ if(!obj.size()) { return false; }
+ var langs = this._get_settings().languages,
+ s = this._get_settings().core.html_titles;
+ if($.isArray(langs) && langs.length) {
+ lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
+ obj = obj.children("a." + lang);
+ }
+ else { obj = obj.children("a:eq(0)"); }
+ if(s) {
+ obj = obj.clone();
+ obj.children("INS").remove();
+ return obj.html();
+ }
+ else {
+ obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
+ return obj.nodeValue;
+ }
+ },
+ set_text : function (obj, val, lang) {
+ obj = this._get_node(obj) || this.data.ui.last_selected;
+ if(!obj.size()) { return false; }
+ var langs = this._get_settings().languages,
+ s = this._get_settings().core.html_titles,
+ tmp;
+ if($.isArray(langs) && langs.length) {
+ lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
+ obj = obj.children("a." + lang);
+ }
+ else { obj = obj.children("a:eq(0)"); }
+ if(s) {
+ tmp = obj.children("INS").clone();
+ obj.html(val).prepend(tmp);
+ this.__callback({ "obj" : obj, "name" : val, "lang" : lang });
+ return true;
+ }
+ else {
+ obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
+ this.__callback({ "obj" : obj, "name" : val, "lang" : lang });
+ return (obj.nodeValue = val);
+ }
+ },
+ _load_css : function () {
+ var langs = this._get_settings().languages,
+ str = "/* languages css */",
+ selector = ".jstree-" + this.get_index() + ' a',
+ ln;
+ if($.isArray(langs) && langs.length) {
+ this.data.languages.current_language = langs[0];
+ for(ln = 0; ln < langs.length; ln++) {
+ str += selector + "." + langs[ln] + " {";
+ if(langs[ln] != this.data.languages.current_language) { str += " display:none; "; }
+ str += " } ";
+ }
+ sh = $.vakata.css.add_sheet({ 'str' : str, 'title' : "jstree-languages" });
+ }
+ },
+ create_node : function (obj, position, js, callback) {
+ var t = this.__call_old(true, obj, position, js, function (t) {
+ var langs = this._get_settings().languages,
+ a = t.children("a"),
+ ln;
+ if($.isArray(langs) && langs.length) {
+ for(ln = 0; ln < langs.length; ln++) {
+ if(!a.is("." + langs[ln])) {
+ t.append(a.eq(0).clone().removeClass(langs.join(" ")).addClass(langs[ln]));
+ }
+ }
+ a.not("." + langs.join(", .")).remove();
+ }
+ if(callback) { callback.call(this, t); }
+ });
+ return t;
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree cookies plugin
+ * Stores the currently opened/selected nodes in a cookie and then restores them
+ * Depends on the jquery.cookie plugin
+ */
+(function ($) {
+ $.jstree.plugin("cookies", {
+ __init : function () {
+ if(typeof $.cookie === "undefined") { throw "jsTree cookie: jQuery cookie plugin not included."; }
+
+ var s = this._get_settings().cookies,
+ tmp;
+ if(!!s.save_loaded) {
+ tmp = $.cookie(s.save_loaded);
+ if(tmp && tmp.length) { this.data.core.to_load = tmp.split(","); }
+ }
+ if(!!s.save_opened) {
+ tmp = $.cookie(s.save_opened);
+ if(tmp && tmp.length) { this.data.core.to_open = tmp.split(","); }
+ }
+ if(!!s.save_selected) {
+ tmp = $.cookie(s.save_selected);
+ if(tmp && tmp.length && this.data.ui) { this.data.ui.to_select = tmp.split(","); }
+ }
+ this.get_container()
+ .one( ( this.data.ui ? "reselect" : "reopen" ) + ".jstree", $.proxy(function () {
+ this.get_container()
+ .bind("open_node.jstree close_node.jstree select_node.jstree deselect_node.jstree", $.proxy(function (e) {
+ if(this._get_settings().cookies.auto_save) { this.save_cookie((e.handleObj.namespace + e.handleObj.type).replace("jstree","")); }
+ }, this));
+ }, this));
+ },
+ defaults : {
+ save_loaded : "jstree_load",
+ save_opened : "jstree_open",
+ save_selected : "jstree_select",
+ auto_save : true,
+ cookie_options : {}
+ },
+ _fn : {
+ save_cookie : function (c) {
+ if(this.data.core.refreshing) { return; }
+ var s = this._get_settings().cookies;
+ if(!c) { // if called manually and not by event
+ if(s.save_loaded) {
+ this.save_loaded();
+ $.cookie(s.save_loaded, this.data.core.to_load.join(","), s.cookie_options);
+ }
+ if(s.save_opened) {
+ this.save_opened();
+ $.cookie(s.save_opened, this.data.core.to_open.join(","), s.cookie_options);
+ }
+ if(s.save_selected && this.data.ui) {
+ this.save_selected();
+ $.cookie(s.save_selected, this.data.ui.to_select.join(","), s.cookie_options);
+ }
+ return;
+ }
+ switch(c) {
+ case "open_node":
+ case "close_node":
+ if(!!s.save_opened) {
+ this.save_opened();
+ $.cookie(s.save_opened, this.data.core.to_open.join(","), s.cookie_options);
+ }
+ if(!!s.save_loaded) {
+ this.save_loaded();
+ $.cookie(s.save_loaded, this.data.core.to_load.join(","), s.cookie_options);
+ }
+ break;
+ case "select_node":
+ case "deselect_node":
+ if(!!s.save_selected && this.data.ui) {
+ this.save_selected();
+ $.cookie(s.save_selected, this.data.ui.to_select.join(","), s.cookie_options);
+ }
+ break;
+ }
+ }
+ }
+ });
+ // include cookies by default
+ // $.jstree.defaults.plugins.push("cookies");
+})(jQuery);
+//*/
+
+/*
+ * jsTree sort plugin
+ * Sorts items alphabetically (or using any other function)
+ */
+(function ($) {
+ $.jstree.plugin("sort", {
+ __init : function () {
+ this.get_container()
+ .bind("load_node.jstree", $.proxy(function (e, data) {
+ var obj = this._get_node(data.rslt.obj);
+ obj = obj === -1 ? this.get_container().children("ul") : obj.children("ul");
+ this.sort(obj);
+ }, this))
+ .bind("rename_node.jstree create_node.jstree create.jstree", $.proxy(function (e, data) {
+ this.sort(data.rslt.obj.parent());
+ }, this))
+ .bind("move_node.jstree", $.proxy(function (e, data) {
+ var m = data.rslt.np == -1 ? this.get_container() : data.rslt.np;
+ this.sort(m.children("ul"));
+ }, this));
+ },
+ defaults : function (a, b) { return this.get_text(a) > this.get_text(b) ? 1 : -1; },
+ _fn : {
+ sort : function (obj) {
+ var s = this._get_settings().sort,
+ t = this;
+ obj.append($.makeArray(obj.children("li")).sort($.proxy(s, t)));
+ obj.find("> li > ul").each(function() { t.sort($(this)); });
+ this.clean_node(obj);
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree DND plugin
+ * Drag and drop plugin for moving/copying nodes
+ */
+(function ($) {
+ var o = false,
+ r = false,
+ m = false,
+ ml = false,
+ sli = false,
+ sti = false,
+ dir1 = false,
+ dir2 = false,
+ last_pos = false;
+ $.vakata.dnd = {
+ is_down : false,
+ is_drag : false,
+ helper : false,
+ scroll_spd : 10,
+ init_x : 0,
+ init_y : 0,
+ threshold : 5,
+ helper_left : 5,
+ helper_top : 10,
+ user_data : {},
+
+ drag_start : function (e, data, html) {
+ if($.vakata.dnd.is_drag) { $.vakata.drag_stop({}); }
+ try {
+ e.currentTarget.unselectable = "on";
+ e.currentTarget.onselectstart = function() { return false; };
+ if(e.currentTarget.style) { e.currentTarget.style.MozUserSelect = "none"; }
+ } catch(err) { }
+ $.vakata.dnd.init_x = e.pageX;
+ $.vakata.dnd.init_y = e.pageY;
+ $.vakata.dnd.user_data = data;
+ $.vakata.dnd.is_down = true;
+ $.vakata.dnd.helper = $("<div id='vakata-dragged' />").html(html); //.fadeTo(10,0.25);
+ $(document).bind("mousemove", $.vakata.dnd.drag);
+ $(document).bind("mouseup", $.vakata.dnd.drag_stop);
+ return false;
+ },
+ drag : function (e) {
+ if(!$.vakata.dnd.is_down) { return; }
+ if(!$.vakata.dnd.is_drag) {
+ if(Math.abs(e.pageX - $.vakata.dnd.init_x) > 5 || Math.abs(e.pageY - $.vakata.dnd.init_y) > 5) {
+ $.vakata.dnd.helper.appendTo("body");
+ $.vakata.dnd.is_drag = true;
+ $(document).triggerHandler("drag_start.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
+ }
+ else { return; }
+ }
+
+ // maybe use a scrolling parent element instead of document?
+ if(e.type === "mousemove") { // thought of adding scroll in order to move the helper, but mouse poisition is n/a
+ var d = $(document), t = d.scrollTop(), l = d.scrollLeft();
+ if(e.pageY - t < 20) {
+ if(sti && dir1 === "down") { clearInterval(sti); sti = false; }
+ if(!sti) { dir1 = "up"; sti = setInterval(function () { $(document).scrollTop($(document).scrollTop() - $.vakata.dnd.scroll_spd); }, 150); }
+ }
+ else {
+ if(sti && dir1 === "up") { clearInterval(sti); sti = false; }
+ }
+ if($(window).height() - (e.pageY - t) < 20) {
+ if(sti && dir1 === "up") { clearInterval(sti); sti = false; }
+ if(!sti) { dir1 = "down"; sti = setInterval(function () { $(document).scrollTop($(document).scrollTop() + $.vakata.dnd.scroll_spd); }, 150); }
+ }
+ else {
+ if(sti && dir1 === "down") { clearInterval(sti); sti = false; }
+ }
+
+ if(e.pageX - l < 20) {
+ if(sli && dir2 === "right") { clearInterval(sli); sli = false; }
+ if(!sli) { dir2 = "left"; sli = setInterval(function () { $(document).scrollLeft($(document).scrollLeft() - $.vakata.dnd.scroll_spd); }, 150); }
+ }
+ else {
+ if(sli && dir2 === "left") { clearInterval(sli); sli = false; }
+ }
+ if($(window).width() - (e.pageX - l) < 20) {
+ if(sli && dir2 === "left") { clearInterval(sli); sli = false; }
+ if(!sli) { dir2 = "right"; sli = setInterval(function () { $(document).scrollLeft($(document).scrollLeft() + $.vakata.dnd.scroll_spd); }, 150); }
+ }
+ else {
+ if(sli && dir2 === "right") { clearInterval(sli); sli = false; }
+ }
+ }
+
+ $.vakata.dnd.helper.css({ left : (e.pageX + $.vakata.dnd.helper_left) + "px", top : (e.pageY + $.vakata.dnd.helper_top) + "px" });
+ $(document).triggerHandler("drag.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
+ },
+ drag_stop : function (e) {
+ if(sli) { clearInterval(sli); }
+ if(sti) { clearInterval(sti); }
+ $(document).unbind("mousemove", $.vakata.dnd.drag);
+ $(document).unbind("mouseup", $.vakata.dnd.drag_stop);
+ $(document).triggerHandler("drag_stop.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
+ $.vakata.dnd.helper.remove();
+ $.vakata.dnd.init_x = 0;
+ $.vakata.dnd.init_y = 0;
+ $.vakata.dnd.user_data = {};
+ $.vakata.dnd.is_down = false;
+ $.vakata.dnd.is_drag = false;
+ }
+ };
+ $(function() {
+ var css_string = '#vakata-dragged { display:block; margin:0 0 0 0; padding:4px 4px 4px 24px; position:absolute; top:-2000px; line-height:16px; z-index:10000; } ';
+ $.vakata.css.add_sheet({ str : css_string, title : "vakata" });
+ });
+
+ $.jstree.plugin("dnd", {
+ __init : function () {
+ this.data.dnd = {
+ active : false,
+ after : false,
+ inside : false,
+ before : false,
+ off : false,
+ prepared : false,
+ w : 0,
+ to1 : false,
+ to2 : false,
+ cof : false,
+ cw : false,
+ ch : false,
+ i1 : false,
+ i2 : false,
+ mto : false
+ };
+ this.get_container()
+ .bind("mouseenter.jstree", $.proxy(function (e) {
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+ if(this.data.themes) {
+ m.attr("class", "jstree-" + this.data.themes.theme);
+ if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
+ $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);
+ }
+ //if($(e.currentTarget).find("> ul > li").length === 0) {
+ if(e.currentTarget === e.target && $.vakata.dnd.user_data.obj && $($.vakata.dnd.user_data.obj).length && $($.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0] !== e.target) { // node should not be from the same tree
+ var tr = $.jstree._reference(e.target), dc;
+ if(tr.data.dnd.foreign) {
+ dc = tr._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : tr.get_container(), is_root : true });
+ if(dc === true || dc.inside === true || dc.before === true || dc.after === true) {
+ $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
+ }
+ }
+ else {
+ tr.prepare_move(o, tr.get_container(), "last");
+ if(tr.check_move()) {
+ $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
+ }
+ }
+ }
+ }
+ }, this))
+ .bind("mouseup.jstree", $.proxy(function (e) {
+ //if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && $(e.currentTarget).find("> ul > li").length === 0) {
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && e.currentTarget === e.target && $.vakata.dnd.user_data.obj && $($.vakata.dnd.user_data.obj).length && $($.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0] !== e.target) { // node should not be from the same tree
+ var tr = $.jstree._reference(e.currentTarget), dc;
+ if(tr.data.dnd.foreign) {
+ dc = tr._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : tr.get_container(), is_root : true });
+ if(dc === true || dc.inside === true || dc.before === true || dc.after === true) {
+ tr._get_settings().dnd.drag_finish.call(this, { "o" : o, "r" : tr.get_container(), is_root : true });
+ }
+ }
+ else {
+ tr.move_node(o, tr.get_container(), "last", e[tr._get_settings().dnd.copy_modifier + "Key"]);
+ }
+ }
+ }, this))
+ .bind("mouseleave.jstree", $.proxy(function (e) {
+ if(e.relatedTarget && e.relatedTarget.id && e.relatedTarget.id === "jstree-marker-line") {
+ return false;
+ }
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+ if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
+ if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
+ if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }
+ if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }
+ if($.vakata.dnd.helper.children("ins").hasClass("jstree-ok")) {
+ $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
+ }
+ }
+ }, this))
+ .bind("mousemove.jstree", $.proxy(function (e) {
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+ var cnt = this.get_container()[0];
+
+ // Horizontal scroll
+ if(e.pageX + 24 > this.data.dnd.cof.left + this.data.dnd.cw) {
+ if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
+ this.data.dnd.i1 = setInterval($.proxy(function () { this.scrollLeft += $.vakata.dnd.scroll_spd; }, cnt), 100);
+ }
+ else if(e.pageX - 24 < this.data.dnd.cof.left) {
+ if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
+ this.data.dnd.i1 = setInterval($.proxy(function () { this.scrollLeft -= $.vakata.dnd.scroll_spd; }, cnt), 100);
+ }
+ else {
+ if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
+ }
+
+ // Vertical scroll
+ if(e.pageY + 24 > this.data.dnd.cof.top + this.data.dnd.ch) {
+ if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
+ this.data.dnd.i2 = setInterval($.proxy(function () { this.scrollTop += $.vakata.dnd.scroll_spd; }, cnt), 100);
+ }
+ else if(e.pageY - 24 < this.data.dnd.cof.top) {
+ if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
+ this.data.dnd.i2 = setInterval($.proxy(function () { this.scrollTop -= $.vakata.dnd.scroll_spd; }, cnt), 100);
+ }
+ else {
+ if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
+ }
+
+ }
+ }, this))
+ .bind("scroll.jstree", $.proxy(function (e) {
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && m && ml) {
+ m.hide();
+ ml.hide();
+ }
+ }, this))
+ .delegate("a", "mousedown.jstree", $.proxy(function (e) {
+ if(e.which === 1) {
+ this.start_drag(e.currentTarget, e);
+ return false;
+ }
+ }, this))
+ .delegate("a", "mouseenter.jstree", $.proxy(function (e) {
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+ this.dnd_enter(e.currentTarget);
+ }
+ }, this))
+ .delegate("a", "mousemove.jstree", $.proxy(function (e) {
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+ if(!r || !r.length || r.children("a")[0] !== e.currentTarget) {
+ this.dnd_enter(e.currentTarget);
+ }
+ if(typeof this.data.dnd.off.top === "undefined") { this.data.dnd.off = $(e.target).offset(); }
+ this.data.dnd.w = (e.pageY - (this.data.dnd.off.top || 0)) % this.data.core.li_height;
+ if(this.data.dnd.w < 0) { this.data.dnd.w += this.data.core.li_height; }
+ this.dnd_show();
+ }
+ }, this))
+ .delegate("a", "mouseleave.jstree", $.proxy(function (e) {
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+ if(e.relatedTarget && e.relatedTarget.id && e.relatedTarget.id === "jstree-marker-line") {
+ return false;
+ }
+ if(m) { m.hide(); }
+ if(ml) { ml.hide(); }
+ /*
+ var ec = $(e.currentTarget).closest("li"),
+ er = $(e.relatedTarget).closest("li");
+ if(er[0] !== ec.prev()[0] && er[0] !== ec.next()[0]) {
+ if(m) { m.hide(); }
+ if(ml) { ml.hide(); }
+ }
+ */
+ this.data.dnd.mto = setTimeout(
+ (function (t) { return function () { t.dnd_leave(e); }; })(this),
+ 0);
+ }
+ }, this))
+ .delegate("a", "mouseup.jstree", $.proxy(function (e) {
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+ this.dnd_finish(e);
+ }
+ }, this));
+
+ $(document)
+ .bind("drag_stop.vakata", $.proxy(function () {
+ if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }
+ if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }
+ if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
+ if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
+ this.data.dnd.after = false;
+ this.data.dnd.before = false;
+ this.data.dnd.inside = false;
+ this.data.dnd.off = false;
+ this.data.dnd.prepared = false;
+ this.data.dnd.w = false;
+ this.data.dnd.to1 = false;
+ this.data.dnd.to2 = false;
+ this.data.dnd.i1 = false;
+ this.data.dnd.i2 = false;
+ this.data.dnd.active = false;
+ this.data.dnd.foreign = false;
+ if(m) { m.css({ "top" : "-2000px" }); }
+ if(ml) { ml.css({ "top" : "-2000px" }); }
+ }, this))
+ .bind("drag_start.vakata", $.proxy(function (e, data) {
+ if(data.data.jstree) {
+ var et = $(data.event.target);
+ if(et.closest(".jstree").hasClass("jstree-" + this.get_index())) {
+ this.dnd_enter(et);
+ }
+ }
+ }, this));
+ /*
+ .bind("keydown.jstree-" + this.get_index() + " keyup.jstree-" + this.get_index(), $.proxy(function(e) {
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && !this.data.dnd.foreign) {
+ var h = $.vakata.dnd.helper.children("ins");
+ if(e[this._get_settings().dnd.copy_modifier + "Key"] && h.hasClass("jstree-ok")) {
+ h.parent().html(h.parent().html().replace(/ \(Copy\)$/, "") + " (Copy)");
+ }
+ else {
+ h.parent().html(h.parent().html().replace(/ \(Copy\)$/, ""));
+ }
+ }
+ }, this)); */
+
+
+
+ var s = this._get_settings().dnd;
+ if(s.drag_target) {
+ $(document)
+ .delegate(s.drag_target, "mousedown.jstree-" + this.get_index(), $.proxy(function (e) {
+ o = e.target;
+ $.vakata.dnd.drag_start(e, { jstree : true, obj : e.target }, "<ins class='jstree-icon'></ins>" + $(e.target).text() );
+ if(this.data.themes) {
+ if(m) { m.attr("class", "jstree-" + this.data.themes.theme); }
+ if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
+ $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);
+ }
+ $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
+ var cnt = this.get_container();
+ this.data.dnd.cof = cnt.offset();
+ this.data.dnd.cw = parseInt(cnt.width(),10);
+ this.data.dnd.ch = parseInt(cnt.height(),10);
+ this.data.dnd.foreign = true;
+ e.preventDefault();
+ }, this));
+ }
+ if(s.drop_target) {
+ $(document)
+ .delegate(s.drop_target, "mouseenter.jstree-" + this.get_index(), $.proxy(function (e) {
+ if(this.data.dnd.active && this._get_settings().dnd.drop_check.call(this, { "o" : o, "r" : $(e.target), "e" : e })) {
+ $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
+ }
+ }, this))
+ .delegate(s.drop_target, "mouseleave.jstree-" + this.get_index(), $.proxy(function (e) {
+ if(this.data.dnd.active) {
+ $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
+ }
+ }, this))
+ .delegate(s.drop_target, "mouseup.jstree-" + this.get_index(), $.proxy(function (e) {
+ if(this.data.dnd.active && $.vakata.dnd.helper.children("ins").hasClass("jstree-ok")) {
+ this._get_settings().dnd.drop_finish.call(this, { "o" : o, "r" : $(e.target), "e" : e });
+ }
+ }, this));
+ }
+ },
+ defaults : {
+ copy_modifier : "ctrl",
+ check_timeout : 100,
+ open_timeout : 500,
+ drop_target : ".jstree-drop",
+ drop_check : function (data) { return true; },
+ drop_finish : $.noop,
+ drag_target : ".jstree-draggable",
+ drag_finish : $.noop,
+ drag_check : function (data) { return { after : false, before : false, inside : true }; }
+ },
+ _fn : {
+ dnd_prepare : function () {
+ if(!r || !r.length) { return; }
+ this.data.dnd.off = r.offset();
+ if(this._get_settings().core.rtl) {
+ this.data.dnd.off.right = this.data.dnd.off.left + r.width();
+ }
+ if(this.data.dnd.foreign) {
+ var a = this._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : r });
+ this.data.dnd.after = a.after;
+ this.data.dnd.before = a.before;
+ this.data.dnd.inside = a.inside;
+ this.data.dnd.prepared = true;
+ return this.dnd_show();
+ }
+ this.prepare_move(o, r, "before");
+ this.data.dnd.before = this.check_move();
+ this.prepare_move(o, r, "after");
+ this.data.dnd.after = this.check_move();
+ if(this._is_loaded(r)) {
+ this.prepare_move(o, r, "inside");
+ this.data.dnd.inside = this.check_move();
+ }
+ else {
+ this.data.dnd.inside = false;
+ }
+ this.data.dnd.prepared = true;
+ return this.dnd_show();
+ },
+ dnd_show : function () {
+ if(!this.data.dnd.prepared) { return; }
+ var o = ["before","inside","after"],
+ r = false,
+ rtl = this._get_settings().core.rtl,
+ pos;
+ if(this.data.dnd.w < this.data.core.li_height/3) { o = ["before","inside","after"]; }
+ else if(this.data.dnd.w <= this.data.core.li_height*2/3) {
+ o = this.data.dnd.w < this.data.core.li_height/2 ? ["inside","before","after"] : ["inside","after","before"];
+ }
+ else { o = ["after","inside","before"]; }
+ $.each(o, $.proxy(function (i, val) {
+ if(this.data.dnd[val]) {
+ $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
+ r = val;
+ return false;
+ }
+ }, this));
+ if(r === false) { $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid"); }
+
+ pos = rtl ? (this.data.dnd.off.right - 18) : (this.data.dnd.off.left + 10);
+ switch(r) {
+ case "before":
+ m.css({ "left" : pos + "px", "top" : (this.data.dnd.off.top - 6) + "px" }).show();
+ if(ml) { ml.css({ "left" : (pos + 8) + "px", "top" : (this.data.dnd.off.top - 1) + "px" }).show(); }
+ break;
+ case "after":
+ m.css({ "left" : pos + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height - 6) + "px" }).show();
+ if(ml) { ml.css({ "left" : (pos + 8) + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height - 1) + "px" }).show(); }
+ break;
+ case "inside":
+ m.css({ "left" : pos + ( rtl ? -4 : 4) + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height/2 - 5) + "px" }).show();
+ if(ml) { ml.hide(); }
+ break;
+ default:
+ m.hide();
+ if(ml) { ml.hide(); }
+ break;
+ }
+ last_pos = r;
+ return r;
+ },
+ dnd_open : function () {
+ this.data.dnd.to2 = false;
+ this.open_node(r, $.proxy(this.dnd_prepare,this), true);
+ },
+ dnd_finish : function (e) {
+ if(this.data.dnd.foreign) {
+ if(this.data.dnd.after || this.data.dnd.before || this.data.dnd.inside) {
+ this._get_settings().dnd.drag_finish.call(this, { "o" : o, "r" : r, "p" : last_pos });
+ }
+ }
+ else {
+ this.dnd_prepare();
+ this.move_node(o, r, last_pos, e[this._get_settings().dnd.copy_modifier + "Key"]);
+ }
+ o = false;
+ r = false;
+ m.hide();
+ if(ml) { ml.hide(); }
+ },
+ dnd_enter : function (obj) {
+ if(this.data.dnd.mto) {
+ clearTimeout(this.data.dnd.mto);
+ this.data.dnd.mto = false;
+ }
+ var s = this._get_settings().dnd;
+ this.data.dnd.prepared = false;
+ r = this._get_node(obj);
+ if(s.check_timeout) {
+ // do the calculations after a minimal timeout (users tend to drag quickly to the desired location)
+ if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }
+ this.data.dnd.to1 = setTimeout($.proxy(this.dnd_prepare, this), s.check_timeout);
+ }
+ else {
+ this.dnd_prepare();
+ }
+ if(s.open_timeout) {
+ if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }
+ if(r && r.length && r.hasClass("jstree-closed")) {
+ // if the node is closed - open it, then recalculate
+ this.data.dnd.to2 = setTimeout($.proxy(this.dnd_open, this), s.open_timeout);
+ }
+ }
+ else {
+ if(r && r.length && r.hasClass("jstree-closed")) {
+ this.dnd_open();
+ }
+ }
+ },
+ dnd_leave : function (e) {
+ this.data.dnd.after = false;
+ this.data.dnd.before = false;
+ this.data.dnd.inside = false;
+ $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
+ m.hide();
+ if(ml) { ml.hide(); }
+ if(r && r[0] === e.target.parentNode) {
+ if(this.data.dnd.to1) {
+ clearTimeout(this.data.dnd.to1);
+ this.data.dnd.to1 = false;
+ }
+ if(this.data.dnd.to2) {
+ clearTimeout(this.data.dnd.to2);
+ this.data.dnd.to2 = false;
+ }
+ }
+ },
+ start_drag : function (obj, e) {
+ o = this._get_node(obj);
+ if(this.data.ui && this.is_selected(o)) { o = this._get_node(null, true); }
+ var dt = o.length > 1 ? this._get_string("multiple_selection") : this.get_text(o),
+ cnt = this.get_container();
+ if(!this._get_settings().core.html_titles) { dt = dt.replace(/</ig,"<").replace(/>/ig,">"); }
+ $.vakata.dnd.drag_start(e, { jstree : true, obj : o }, "<ins class='jstree-icon'></ins>" + dt );
+ if(this.data.themes) {
+ if(m) { m.attr("class", "jstree-" + this.data.themes.theme); }
+ if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
+ $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);
+ }
+ this.data.dnd.cof = cnt.offset();
+ this.data.dnd.cw = parseInt(cnt.width(),10);
+ this.data.dnd.ch = parseInt(cnt.height(),10);
+ this.data.dnd.active = true;
+ }
+ }
+ });
+ $(function() {
+ var css_string = '' +
+ '#vakata-dragged ins { display:block; text-decoration:none; width:16px; height:16px; margin:0 0 0 0; padding:0; position:absolute; top:4px; left:4px; ' +
+ ' -moz-border-radius:4px; border-radius:4px; -webkit-border-radius:4px; ' +
+ '} ' +
+ '#vakata-dragged .jstree-ok { background:green; } ' +
+ '#vakata-dragged .jstree-invalid { background:red; } ' +
+ '#jstree-marker { padding:0; margin:0; font-size:12px; overflow:hidden; height:12px; width:8px; position:absolute; top:-30px; z-index:10001; background-repeat:no-repeat; display:none; background-color:transparent; text-shadow:1px 1px 1px white; color:black; line-height:10px; } ' +
+ '#jstree-marker-line { padding:0; margin:0; line-height:0%; font-size:1px; overflow:hidden; height:1px; width:100px; position:absolute; top:-30px; z-index:10000; background-repeat:no-repeat; display:none; background-color:#456c43; ' +
+ ' cursor:pointer; border:1px solid #eeeeee; border-left:0; -moz-box-shadow: 0px 0px 2px #666; -webkit-box-shadow: 0px 0px 2px #666; box-shadow: 0px 0px 2px #666; ' +
+ ' -moz-border-radius:1px; border-radius:1px; -webkit-border-radius:1px; ' +
+ '}' +
+ '';
+ $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
+ m = $("<div />").attr({ id : "jstree-marker" }).hide().html("»")
+ .bind("mouseleave mouseenter", function (e) {
+ m.hide();
+ ml.hide();
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ return false;
+ })
+ .appendTo("body");
+ ml = $("<div />").attr({ id : "jstree-marker-line" }).hide()
+ .bind("mouseup", function (e) {
+ if(r && r.length) {
+ r.children("a").trigger(e);
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ return false;
+ }
+ })
+ .bind("mouseleave", function (e) {
+ var rt = $(e.relatedTarget);
+ if(rt.is(".jstree") || rt.closest(".jstree").length === 0) {
+ if(r && r.length) {
+ r.children("a").trigger(e);
+ m.hide();
+ ml.hide();
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ return false;
+ }
+ }
+ })
+ .appendTo("body");
+ $(document).bind("drag_start.vakata", function (e, data) {
+ if(data.data.jstree) { m.show(); if(ml) { ml.show(); } }
+ });
+ $(document).bind("drag_stop.vakata", function (e, data) {
+ if(data.data.jstree) { m.hide(); if(ml) { ml.hide(); } }
+ });
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree checkbox plugin
+ * Inserts checkboxes in front of every node
+ * Depends on the ui plugin
+ * DOES NOT WORK NICELY WITH MULTITREE DRAG'N'DROP
+ */
+(function ($) {
+ $.jstree.plugin("checkbox", {
+ __init : function () {
+ this.data.checkbox.noui = this._get_settings().checkbox.override_ui;
+ if(this.data.ui && this.data.checkbox.noui) {
+ this.select_node = this.deselect_node = this.deselect_all = $.noop;
+ this.get_selected = this.get_checked;
+ }
+
+ this.get_container()
+ .bind("open_node.jstree create_node.jstree clean_node.jstree refresh.jstree", $.proxy(function (e, data) {
+ this._prepare_checkboxes(data.rslt.obj);
+ }, this))
+ .bind("loaded.jstree", $.proxy(function (e) {
+ this._prepare_checkboxes();
+ }, this))
+ .delegate( (this.data.ui && this.data.checkbox.noui ? "a" : "ins.jstree-checkbox") , "click.jstree", $.proxy(function (e) {
+ e.preventDefault();
+ if(this._get_node(e.target).hasClass("jstree-checked")) { this.uncheck_node(e.target); }
+ else { this.check_node(e.target); }
+ if(this.data.ui && this.data.checkbox.noui) {
+ this.save_selected();
+ if(this.data.cookies) { this.save_cookie("select_node"); }
+ }
+ else {
+ e.stopImmediatePropagation();
+ return false;
+ }
+ }, this));
+ },
+ defaults : {
+ override_ui : false,
+ two_state : false,
+ real_checkboxes : false,
+ checked_parent_open : true,
+ real_checkboxes_names : function (n) { return [ ("check_" + (n[0].id || Math.ceil(Math.random() * 10000))) , 1]; }
+ },
+ __destroy : function () {
+ this.get_container()
+ .find("input.jstree-real-checkbox").removeClass("jstree-real-checkbox").end()
+ .find("ins.jstree-checkbox").remove();
+ },
+ _fn : {
+ _checkbox_notify : function (n, data) {
+ if(data.checked) {
+ this.check_node(n, false);
+ }
+ },
+ _prepare_checkboxes : function (obj) {
+ obj = !obj || obj == -1 ? this.get_container().find("> ul > li") : this._get_node(obj);
+ if(obj === false) { return; } // added for removing root nodes
+ var c, _this = this, t, ts = this._get_settings().checkbox.two_state, rc = this._get_settings().checkbox.real_checkboxes, rcn = this._get_settings().checkbox.real_checkboxes_names;
+ obj.each(function () {
+ t = $(this);
+ c = t.is("li") && (t.hasClass("jstree-checked") || (rc && t.children(":checked").length)) ? "jstree-checked" : "jstree-unchecked";
+ t.find("li").addBack().each(function () {
+ var $t = $(this), nm;
+ $t.children("a" + (_this.data.languages ? "" : ":eq(0)") ).not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'> </ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass( ts ? "jstree-unchecked" : c );
+ if(rc) {
+ if(!$t.children(":checkbox").length) {
+ nm = rcn.call(_this, $t);
+ $t.prepend("<input type='checkbox' class='jstree-real-checkbox' id='" + nm[0] + "' name='" + nm[0] + "' value='" + nm[1] + "' />");
+ }
+ else {
+ $t.children(":checkbox").addClass("jstree-real-checkbox");
+ }
+ }
+ if(!ts) {
+ if(c === "jstree-checked" || $t.hasClass("jstree-checked") || $t.children(':checked').length) {
+ $t.find("li").addBack().addClass("jstree-checked").children(":checkbox").prop("checked", true);
+ }
+ }
+ else {
+ if($t.hasClass("jstree-checked") || $t.children(':checked').length) {
+ $t.addClass("jstree-checked").children(":checkbox").prop("checked", true);
+ }
+ }
+ });
+ });
+ if(!ts) {
+ obj.find(".jstree-checked").parent().parent().each(function () { _this._repair_state(this); });
+ }
+ },
+ change_state : function (obj, state) {
+ obj = this._get_node(obj);
+ var coll = false, rc = this._get_settings().checkbox.real_checkboxes;
+ if(!obj || obj === -1) { return false; }
+ state = (state === false || state === true) ? state : obj.hasClass("jstree-checked");
+ if(this._get_settings().checkbox.two_state) {
+ if(state) {
+ obj.removeClass("jstree-checked").addClass("jstree-unchecked");
+ if(rc) { obj.children(":checkbox").prop("checked", false); }
+ }
+ else {
+ obj.removeClass("jstree-unchecked").addClass("jstree-checked");
+ if(rc) { obj.children(":checkbox").prop("checked", true); }
+ }
+ }
+ else {
+ if(state) {
+ coll = obj.find("li").addBack();
+ if(!coll.filter(".jstree-checked, .jstree-undetermined").length) { return false; }
+ coll.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
+ if(rc) { coll.children(":checkbox").prop("checked", false); }
+ }
+ else {
+ coll = obj.find("li").addBack();
+ if(!coll.filter(".jstree-unchecked, .jstree-undetermined").length) { return false; }
+ coll.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
+ if(rc) { coll.children(":checkbox").prop("checked", true); }
+ if(this.data.ui) { this.data.ui.last_selected = obj; }
+ this.data.checkbox.last_selected = obj;
+ }
+ obj.parentsUntil(".jstree", "li").each(function () {
+ var $this = $(this);
+ if(state) {
+ if($this.children("ul").children("li.jstree-checked, li.jstree-undetermined").length) {
+ $this.parentsUntil(".jstree", "li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
+ if(rc) { $this.parentsUntil(".jstree", "li").addBack().children(":checkbox").prop("checked", false); }
+ return false;
+ }
+ else {
+ $this.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
+ if(rc) { $this.children(":checkbox").prop("checked", false); }
+ }
+ }
+ else {
+ if($this.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length) {
+ $this.parentsUntil(".jstree", "li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
+ if(rc) { $this.parentsUntil(".jstree", "li").addBack().children(":checkbox").prop("checked", false); }
+ return false;
+ }
+ else {
+ $this.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
+ if(rc) { $this.children(":checkbox").prop("checked", true); }
+ }
+ }
+ });
+ }
+ if(this.data.ui && this.data.checkbox.noui) { this.data.ui.selected = this.get_checked(); }
+ this.__callback(obj);
+ return true;
+ },
+ check_node : function (obj) {
+ if(this.change_state(obj, false)) {
+ obj = this._get_node(obj);
+ if(this._get_settings().checkbox.checked_parent_open) {
+ var t = this;
+ obj.parents(".jstree-closed").each(function () { t.open_node(this, false, true); });
+ }
+ this.__callback({ "obj" : obj });
+ }
+ },
+ uncheck_node : function (obj) {
+ if(this.change_state(obj, true)) { this.__callback({ "obj" : this._get_node(obj) }); }
+ },
+ check_all : function () {
+ var _this = this,
+ coll = this._get_settings().checkbox.two_state ? this.get_container_ul().find("li") : this.get_container_ul().children("li");
+ coll.each(function () {
+ _this.change_state(this, false);
+ });
+ this.__callback();
+ },
+ uncheck_all : function () {
+ var _this = this,
+ coll = this._get_settings().checkbox.two_state ? this.get_container_ul().find("li") : this.get_container_ul().children("li");
+ coll.each(function () {
+ _this.change_state(this, true);
+ });
+ this.__callback();
+ },
+
+ is_checked : function(obj) {
+ obj = this._get_node(obj);
+ return obj.length ? obj.is(".jstree-checked") : false;
+ },
+ get_checked : function (obj, get_all) {
+ obj = !obj || obj === -1 ? this.get_container() : this._get_node(obj);
+ return get_all || this._get_settings().checkbox.two_state ? obj.find(".jstree-checked") : obj.find("> ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked");
+ },
+ get_unchecked : function (obj, get_all) {
+ obj = !obj || obj === -1 ? this.get_container() : this._get_node(obj);
+ return get_all || this._get_settings().checkbox.two_state ? obj.find(".jstree-unchecked") : obj.find("> ul > .jstree-unchecked, .jstree-undetermined > ul > .jstree-unchecked");
+ },
+
+ show_checkboxes : function () { this.get_container().children("ul").removeClass("jstree-no-checkboxes"); },
+ hide_checkboxes : function () { this.get_container().children("ul").addClass("jstree-no-checkboxes"); },
+
+ _repair_state : function (obj) {
+ obj = this._get_node(obj);
+ if(!obj.length) { return; }
+ if(this._get_settings().checkbox.two_state) {
+ obj.find('li').addBack().not('.jstree-checked').removeClass('jstree-undetermined').addClass('jstree-unchecked').children(':checkbox').prop('checked', true);
+ return;
+ }
+ var rc = this._get_settings().checkbox.real_checkboxes,
+ a = obj.find("> ul > .jstree-checked").length,
+ b = obj.find("> ul > .jstree-undetermined").length,
+ c = obj.find("> ul > li").length;
+ if(c === 0) { if(obj.hasClass("jstree-undetermined")) { this.change_state(obj, false); } }
+ else if(a === 0 && b === 0) { this.change_state(obj, true); }
+ else if(a === c) { this.change_state(obj, false); }
+ else {
+ obj.parentsUntil(".jstree","li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
+ if(rc) { obj.parentsUntil(".jstree", "li").addBack().children(":checkbox").prop("checked", false); }
+ }
+ },
+ reselect : function () {
+ if(this.data.ui && this.data.checkbox.noui) {
+ var _this = this,
+ s = this.data.ui.to_select;
+ s = $.map($.makeArray(s), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
+ this.deselect_all();
+ $.each(s, function (i, val) { _this.check_node(val); });
+ this.__callback();
+ }
+ else {
+ this.__call_old();
+ }
+ },
+ save_loaded : function () {
+ var _this = this;
+ this.data.core.to_load = [];
+ this.get_container_ul().find("li.jstree-closed.jstree-undetermined").each(function () {
+ if(this.id) { _this.data.core.to_load.push("#" + this.id); }
+ });
+ }
+ }
+ });
+ $(function() {
+ var css_string = '.jstree .jstree-real-checkbox { display:none; } ';
+ $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree XML plugin
+ * The XML data store. Datastores are build by overriding the `load_node` and `_is_loaded` functions.
+ */
+(function ($) {
+ $.vakata.xslt = function (xml, xsl, callback) {
+ var r = false, p, q, s;
+ // IE9
+ if(r === false && window.ActiveXObject) {
+ try {
+ r = new ActiveXObject("Msxml2.XSLTemplate");
+ q = new ActiveXObject("Msxml2.DOMDocument");
+ q.loadXML(xml);
+ s = new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
+ s.loadXML(xsl);
+ r.stylesheet = s;
+ p = r.createProcessor();
+ p.input = q;
+ p.transform();
+ r = p.output;
+ }
+ catch (e) { }
+ }
+ xml = $.parseXML(xml);
+ xsl = $.parseXML(xsl);
+ // FF, Chrome
+ if(r === false && typeof (XSLTProcessor) !== "undefined") {
+ p = new XSLTProcessor();
+ p.importStylesheet(xsl);
+ r = p.transformToFragment(xml, document);
+ r = $('<div />').append(r).html();
+ }
+ // OLD IE
+ if(r === false && typeof (xml.transformNode) !== "undefined") {
+ r = xml.transformNode(xsl);
+ }
+ callback.call(null, r);
+ };
+ var xsl = {
+ 'nest' : '<' + '?xml version="1.0" encoding="utf-8" ?>' +
+ '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >' +
+ '<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/html" />' +
+ '<xsl:template match="/">' +
+ ' <xsl:call-template name="nodes">' +
+ ' <xsl:with-param name="node" select="/root" />' +
+ ' </xsl:call-template>' +
+ '</xsl:template>' +
+ '<xsl:template name="nodes">' +
+ ' <xsl:param name="node" />' +
+ ' <ul>' +
+ ' <xsl:for-each select="$node/item">' +
+ ' <xsl:variable name="children" select="count(./item) > 0" />' +
+ ' <li>' +
+ ' <xsl:attribute name="class">' +
+ ' <xsl:if test="position() = last()">jstree-last </xsl:if>' +
+ ' <xsl:choose>' +
+ ' <xsl:when test="@state = \'open\'">jstree-open </xsl:when>' +
+ ' <xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>' +
+ ' <xsl:otherwise>jstree-leaf </xsl:otherwise>' +
+ ' </xsl:choose>' +
+ ' <xsl:value-of select="@class" />' +
+ ' </xsl:attribute>' +
+ ' <xsl:for-each select="@*">' +
+ ' <xsl:if test="name() != \'class\' and name() != \'state\' and name() != \'hasChildren\'">' +
+ ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
+ ' </xsl:if>' +
+ ' </xsl:for-each>' +
+ ' <ins class="jstree-icon"><xsl:text> </xsl:text></ins>' +
+ ' <xsl:for-each select="content/name">' +
+ ' <a>' +
+ ' <xsl:attribute name="href">' +
+ ' <xsl:choose>' +
+ ' <xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>' +
+ ' <xsl:otherwise>#</xsl:otherwise>' +
+ ' </xsl:choose>' +
+ ' </xsl:attribute>' +
+ ' <xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>' +
+ ' <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>' +
+ ' <xsl:for-each select="@*">' +
+ ' <xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">' +
+ ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
+ ' </xsl:if>' +
+ ' </xsl:for-each>' +
+ ' <ins>' +
+ ' <xsl:attribute name="class">jstree-icon ' +
+ ' <xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>' +
+ ' </xsl:attribute>' +
+ ' <xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>' +
+ ' <xsl:text> </xsl:text>' +
+ ' </ins>' +
+ ' <xsl:copy-of select="./child::node()" />' +
+ ' </a>' +
+ ' </xsl:for-each>' +
+ ' <xsl:if test="$children or @hasChildren"><xsl:call-template name="nodes"><xsl:with-param name="node" select="current()" /></xsl:call-template></xsl:if>' +
+ ' </li>' +
+ ' </xsl:for-each>' +
+ ' </ul>' +
+ '</xsl:template>' +
+ '</xsl:stylesheet>',
+
+ 'flat' : '<' + '?xml version="1.0" encoding="utf-8" ?>' +
+ '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >' +
+ '<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/xml" />' +
+ '<xsl:template match="/">' +
+ ' <ul>' +
+ ' <xsl:for-each select="//item[not(@parent_id) or @parent_id=0 or not(@parent_id = //item/@id)]">' + /* the last `or` may be removed */
+ ' <xsl:call-template name="nodes">' +
+ ' <xsl:with-param name="node" select="." />' +
+ ' <xsl:with-param name="is_last" select="number(position() = last())" />' +
+ ' </xsl:call-template>' +
+ ' </xsl:for-each>' +
+ ' </ul>' +
+ '</xsl:template>' +
+ '<xsl:template name="nodes">' +
+ ' <xsl:param name="node" />' +
+ ' <xsl:param name="is_last" />' +
+ ' <xsl:variable name="children" select="count(//item[@parent_id=$node/attribute::id]) > 0" />' +
+ ' <li>' +
+ ' <xsl:attribute name="class">' +
+ ' <xsl:if test="$is_last = true()">jstree-last </xsl:if>' +
+ ' <xsl:choose>' +
+ ' <xsl:when test="@state = \'open\'">jstree-open </xsl:when>' +
+ ' <xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>' +
+ ' <xsl:otherwise>jstree-leaf </xsl:otherwise>' +
+ ' </xsl:choose>' +
+ ' <xsl:value-of select="@class" />' +
+ ' </xsl:attribute>' +
+ ' <xsl:for-each select="@*">' +
+ ' <xsl:if test="name() != \'parent_id\' and name() != \'hasChildren\' and name() != \'class\' and name() != \'state\'">' +
+ ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
+ ' </xsl:if>' +
+ ' </xsl:for-each>' +
+ ' <ins class="jstree-icon"><xsl:text> </xsl:text></ins>' +
+ ' <xsl:for-each select="content/name">' +
+ ' <a>' +
+ ' <xsl:attribute name="href">' +
+ ' <xsl:choose>' +
+ ' <xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>' +
+ ' <xsl:otherwise>#</xsl:otherwise>' +
+ ' </xsl:choose>' +
+ ' </xsl:attribute>' +
+ ' <xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>' +
+ ' <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>' +
+ ' <xsl:for-each select="@*">' +
+ ' <xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">' +
+ ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
+ ' </xsl:if>' +
+ ' </xsl:for-each>' +
+ ' <ins>' +
+ ' <xsl:attribute name="class">jstree-icon ' +
+ ' <xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>' +
+ ' </xsl:attribute>' +
+ ' <xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>' +
+ ' <xsl:text> </xsl:text>' +
+ ' </ins>' +
+ ' <xsl:copy-of select="./child::node()" />' +
+ ' </a>' +
+ ' </xsl:for-each>' +
+ ' <xsl:if test="$children">' +
+ ' <ul>' +
+ ' <xsl:for-each select="//item[@parent_id=$node/attribute::id]">' +
+ ' <xsl:call-template name="nodes">' +
+ ' <xsl:with-param name="node" select="." />' +
+ ' <xsl:with-param name="is_last" select="number(position() = last())" />' +
+ ' </xsl:call-template>' +
+ ' </xsl:for-each>' +
+ ' </ul>' +
+ ' </xsl:if>' +
+ ' </li>' +
+ '</xsl:template>' +
+ '</xsl:stylesheet>'
+ },
+ escape_xml = function(string) {
+ return string
+ .toString()
+ .replace(/&/g, '&')
+ .replace(/</g, '<')
+ .replace(/>/g, '>')
+ .replace(/"/g, '"')
+ .replace(/'/g, ''');
+ };
+ $.jstree.plugin("xml_data", {
+ defaults : {
+ data : false,
+ ajax : false,
+ xsl : "flat",
+ clean_node : false,
+ correct_state : true,
+ get_skip_empty : false,
+ get_include_preamble : true
+ },
+ _fn : {
+ load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_xml(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); },
+ _is_loaded : function (obj) {
+ var s = this._get_settings().xml_data;
+ obj = this._get_node(obj);
+ return obj == -1 || !obj || (!s.ajax && !$.isFunction(s.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").size() > 0;
+ },
+ load_node_xml : function (obj, s_call, e_call) {
+ var s = this.get_settings().xml_data,
+ error_func = function () {},
+ success_func = function () {};
+
+ obj = this._get_node(obj);
+ if(obj && obj !== -1) {
+ if(obj.data("jstree_is_loading")) { return; }
+ else { obj.data("jstree_is_loading",true); }
+ }
+ switch(!0) {
+ case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
+ case ($.isFunction(s.data)):
+ s.data.call(this, obj, $.proxy(function (d) {
+ this.parse_xml(d, $.proxy(function (d) {
+ if(d) {
+ d = d.replace(/ ?xmlns="[^"]*"/ig, "");
+ if(d.length > 10) {
+ d = $(d);
+ if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
+ else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree_is_loading"); }
+ if(s.clean_node) { this.clean_node(obj); }
+ if(s_call) { s_call.call(this); }
+ }
+ else {
+ if(obj && obj !== -1) {
+ obj.children("a.jstree-loading").removeClass("jstree-loading");
+ obj.removeData("jstree_is_loading");
+ if(s.correct_state) {
+ this.correct_state(obj);
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ else {
+ if(s.correct_state) {
+ this.get_container().children("ul").empty();
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ }
+ }
+ }, this));
+ }, this));
+ break;
+ case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
+ if(!obj || obj == -1) {
+ this.parse_xml(s.data, $.proxy(function (d) {
+ if(d) {
+ d = d.replace(/ ?xmlns="[^"]*"/ig, "");
+ if(d.length > 10) {
+ d = $(d);
+ this.get_container().children("ul").empty().append(d.children());
+ if(s.clean_node) { this.clean_node(obj); }
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ else {
+ if(s.correct_state) {
+ this.get_container().children("ul").empty();
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ }, this));
+ }
+ break;
+ case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
+ error_func = function (x, t, e) {
+ var ef = this.get_settings().xml_data.ajax.error;
+ if(ef) { ef.call(this, x, t, e); }
+ if(obj !== -1 && obj.length) {
+ obj.children("a.jstree-loading").removeClass("jstree-loading");
+ obj.removeData("jstree_is_loading");
+ if(t === "success" && s.correct_state) { this.correct_state(obj); }
+ }
+ else {
+ if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
+ }
+ if(e_call) { e_call.call(this); }
+ };
+ success_func = function (d, t, x) {
+ d = x.responseText;
+ var sf = this.get_settings().xml_data.ajax.success;
+ if(sf) { d = sf.call(this,d,t,x) || d; }
+ if(d === "" || (d && d.toString && d.toString().replace(/^[\s\n]+$/,"") === "")) {
+ return error_func.call(this, x, t, "");
+ }
+ this.parse_xml(d, $.proxy(function (d) {
+ if(d) {
+ d = d.replace(/ ?xmlns="[^"]*"/ig, "");
+ if(d.length > 10) {
+ d = $(d);
+ if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
+ else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree_is_loading"); }
+ if(s.clean_node) { this.clean_node(obj); }
+ if(s_call) { s_call.call(this); }
+ }
+ else {
+ if(obj && obj !== -1) {
+ obj.children("a.jstree-loading").removeClass("jstree-loading");
+ obj.removeData("jstree_is_loading");
+ if(s.correct_state) {
+ this.correct_state(obj);
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ else {
+ if(s.correct_state) {
+ this.get_container().children("ul").empty();
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ }
+ }
+ }, this));
+ };
+ s.ajax.context = this;
+ s.ajax.error = error_func;
+ s.ajax.success = success_func;
+ if(!s.ajax.dataType) { s.ajax.dataType = "xml"; }
+ if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
+ if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
+ $.ajax(s.ajax);
+ break;
+ }
+ },
+ parse_xml : function (xml, callback) {
+ var s = this._get_settings().xml_data;
+ $.vakata.xslt(xml, xsl[s.xsl], callback);
+ },
+ get_xml : function (tp, obj, li_attr, a_attr, is_callback) {
+ var result = "",
+ s = this._get_settings(),
+ _this = this,
+ tmp1, tmp2, li, a, lang;
+ if(!tp) { tp = "flat"; }
+ if(!is_callback) { is_callback = 0; }
+ obj = this._get_node(obj);
+ if(!obj || obj === -1) { obj = this.get_container().find("> ul > li"); }
+ li_attr = $.isArray(li_attr) ? li_attr : [ "id", "class" ];
+ if(!is_callback && this.data.types && $.inArray(s.types.type_attr, li_attr) === -1) { li_attr.push(s.types.type_attr); }
+
+ a_attr = $.isArray(a_attr) ? a_attr : [ ];
+
+ if(!is_callback) {
+ if(s.xml_data.get_include_preamble) {
+ result += '<' + '?xml version="1.0" encoding="UTF-8"?' + '>';
+ }
+ result += "<root>";
+ }
+ obj.each(function () {
+ result += "<item";
+ li = $(this);
+ $.each(li_attr, function (i, v) {
+ var t = li.attr(v);
+ if(!s.xml_data.get_skip_empty || typeof t !== "undefined") {
+ result += " " + v + "=\"" + escape_xml((" " + (t || "")).replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")) + "\"";
+ }
+ });
+ if(li.hasClass("jstree-open")) { result += " state=\"open\""; }
+ if(li.hasClass("jstree-closed")) { result += " state=\"closed\""; }
+ if(tp === "flat") { result += " parent_id=\"" + escape_xml(is_callback) + "\""; }
+ result += ">";
+ result += "<content>";
+ a = li.children("a");
+ a.each(function () {
+ tmp1 = $(this);
+ lang = false;
+ result += "<name";
+ if($.inArray("languages", s.plugins) !== -1) {
+ $.each(s.languages, function (k, z) {
+ if(tmp1.hasClass(z)) { result += " lang=\"" + escape_xml(z) + "\""; lang = z; return false; }
+ });
+ }
+ if(a_attr.length) {
+ $.each(a_attr, function (k, z) {
+ var t = tmp1.attr(z);
+ if(!s.xml_data.get_skip_empty || typeof t !== "undefined") {
+ result += " " + z + "=\"" + escape_xml((" " + t || "").replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")) + "\"";
+ }
+ });
+ }
+ if(tmp1.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/^\s+$/ig,"").length) {
+ result += ' icon="' + escape_xml(tmp1.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")) + '"';
+ }
+ if(tmp1.children("ins").get(0).style.backgroundImage.length) {
+ result += ' icon="' + escape_xml(tmp1.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","").replace(/'/ig,"").replace(/"/ig,"")) + '"';
+ }
+ result += ">";
+ result += "<![CDATA[" + _this.get_text(tmp1, lang) + "]]>";
+ result += "</name>";
+ });
+ result += "</content>";
+ tmp2 = li[0].id || true;
+ li = li.find("> ul > li");
+ if(li.length) { tmp2 = _this.get_xml(tp, li, li_attr, a_attr, tmp2); }
+ else { tmp2 = ""; }
+ if(tp == "nest") { result += tmp2; }
+ result += "</item>";
+ if(tp == "flat") { result += tmp2; }
+ });
+ if(!is_callback) { result += "</root>"; }
+ return result;
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree search plugin
+ * Enables both sync and async search on the tree
+ * DOES NOT WORK WITH JSON PROGRESSIVE RENDER
+ */
+(function ($) {
+ if($().jquery.split('.')[1] >= 8) {
+ $.expr[':'].jstree_contains = $.expr.createPseudo(function(search) {
+ return function(a) {
+ return (a.textContent || a.innerText || "").toLowerCase().indexOf(search.toLowerCase())>=0;
+ };
+ });
+ $.expr[':'].jstree_title_contains = $.expr.createPseudo(function(search) {
+ return function(a) {
+ return (a.getAttribute("title") || "").toLowerCase().indexOf(search.toLowerCase())>=0;
+ };
+ });
+ }
+ else {
+ $.expr[':'].jstree_contains = function(a,i,m){
+ return (a.textContent || a.innerText || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
+ };
+ $.expr[':'].jstree_title_contains = function(a,i,m) {
+ return (a.getAttribute("title") || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
+ };
+ }
+ $.jstree.plugin("search", {
+ __init : function () {
+ this.data.search.str = "";
+ this.data.search.result = $();
+ if(this._get_settings().search.show_only_matches) {
+ this.get_container()
+ .bind("search.jstree", function (e, data) {
+ $(this).children("ul").find("li").hide().removeClass("jstree-last");
+ data.rslt.nodes.parentsUntil(".jstree").addBack().show()
+ .filter("ul").each(function () { $(this).children("li:visible").eq(-1).addClass("jstree-last"); });
+ })
+ .bind("clear_search.jstree", function () {
+ $(this).children("ul").find("li").css("display","").end().end().jstree("clean_node", -1);
+ });
+ }
+ },
+ defaults : {
+ ajax : false,
+ search_method : "jstree_contains", // for case insensitive - jstree_contains
+ show_only_matches : false
+ },
+ _fn : {
+ search : function (str, skip_async) {
+ if($.trim(str) === "") { this.clear_search(); return; }
+ var s = this.get_settings().search,
+ t = this,
+ error_func = function () { },
+ success_func = function () { };
+ this.data.search.str = str;
+
+ if(!skip_async && s.ajax !== false && this.get_container_ul().find("li.jstree-closed:not(:has(ul)):eq(0)").length > 0) {
+ this.search.supress_callback = true;
+ error_func = function () { };
+ success_func = function (d, t, x) {
+ var sf = this.get_settings().search.ajax.success;
+ if(sf) { d = sf.call(this,d,t,x) || d; }
+ this.data.search.to_open = d;
+ this._search_open();
+ };
+ s.ajax.context = this;
+ s.ajax.error = error_func;
+ s.ajax.success = success_func;
+ if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, str); }
+ if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, str); }
+ if(!s.ajax.data) { s.ajax.data = { "search_string" : str }; }
+ if(!s.ajax.dataType || /^json/.exec(s.ajax.dataType)) { s.ajax.dataType = "json"; }
+ $.ajax(s.ajax);
+ return;
+ }
+ if(this.data.search.result.length) { this.clear_search(); }
+ this.data.search.result = this.get_container().find("a" + (this.data.languages ? "." + this.get_lang() : "" ) + ":" + (s.search_method) + "(" + this.data.search.str + ")");
+ this.data.search.result.addClass("jstree-search").parent().parents(".jstree-closed").each(function () {
+ t.open_node(this, false, true);
+ });
+ this.__callback({ nodes : this.data.search.result, str : str });
+ },
+ clear_search : function (str) {
+ this.data.search.result.removeClass("jstree-search");
+ this.__callback(this.data.search.result);
+ this.data.search.result = $();
+ },
+ _search_open : function (is_callback) {
+ var _this = this,
+ done = true,
+ current = [],
+ remaining = [];
+ if(this.data.search.to_open.length) {
+ $.each(this.data.search.to_open, function (i, val) {
+ if(val == "#") { return true; }
+ if($(val).length && $(val).is(".jstree-closed")) { current.push(val); }
+ else { remaining.push(val); }
+ });
+ if(current.length) {
+ this.data.search.to_open = remaining;
+ $.each(current, function (i, val) {
+ _this.open_node(val, function () { _this._search_open(true); });
+ });
+ done = false;
+ }
+ }
+ if(done) { this.search(this.data.search.str, true); }
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree contextmenu plugin
+ */
+(function ($) {
+ $.vakata.context = {
+ hide_on_mouseleave : false,
+
+ cnt : $("<div id='vakata-contextmenu' />"),
+ vis : false,
+ tgt : false,
+ par : false,
+ func : false,
+ data : false,
+ rtl : false,
+ show : function (s, t, x, y, d, p, rtl) {
+ $.vakata.context.rtl = !!rtl;
+ var html = $.vakata.context.parse(s), h, w;
+ if(!html) { return; }
+ $.vakata.context.vis = true;
+ $.vakata.context.tgt = t;
+ $.vakata.context.par = p || t || null;
+ $.vakata.context.data = d || null;
+ $.vakata.context.cnt
+ .html(html)
+ .css({ "visibility" : "hidden", "display" : "block", "left" : 0, "top" : 0 });
+
+ if($.vakata.context.hide_on_mouseleave) {
+ $.vakata.context.cnt
+ .one("mouseleave", function(e) { $.vakata.context.hide(); });
+ }
+
+ h = $.vakata.context.cnt.height();
+ w = $.vakata.context.cnt.width();
+ if(x + w > $(document).width()) {
+ x = $(document).width() - (w + 5);
+ $.vakata.context.cnt.find("li > ul").addClass("right");
+ }
+ if(y + h > $(document).height()) {
+ y = y - (h + t[0].offsetHeight);
+ $.vakata.context.cnt.find("li > ul").addClass("bottom");
+ }
+
+ $.vakata.context.cnt
+ .css({ "left" : x, "top" : y })
+ .find("li:has(ul)")
+ .bind("mouseenter", function (e) {
+ var w = $(document).width(),
+ h = $(document).height(),
+ ul = $(this).children("ul").show();
+ if(w !== $(document).width()) { ul.toggleClass("right"); }
+ if(h !== $(document).height()) { ul.toggleClass("bottom"); }
+ })
+ .bind("mouseleave", function (e) {
+ $(this).children("ul").hide();
+ })
+ .end()
+ .css({ "visibility" : "visible" })
+ .show();
+ $(document).triggerHandler("context_show.vakata");
+ },
+ hide : function () {
+ $.vakata.context.vis = false;
+ $.vakata.context.cnt.attr("class","").css({ "visibility" : "hidden" });
+ $(document).triggerHandler("context_hide.vakata");
+ },
+ parse : function (s, is_callback) {
+ if(!s) { return false; }
+ var str = "",
+ tmp = false,
+ was_sep = true;
+ if(!is_callback) { $.vakata.context.func = {}; }
+ str += "<ul>";
+ $.each(s, function (i, val) {
+ if(!val) { return true; }
+ $.vakata.context.func[i] = val.action;
+ if(!was_sep && val.separator_before) {
+ str += "<li class='vakata-separator vakata-separator-before'></li>";
+ }
+ was_sep = false;
+ str += "<li class='" + (val._class || "") + (val._disabled ? " jstree-contextmenu-disabled " : "") + "'><ins ";
+ if(val.icon && val.icon.indexOf("/") === -1) { str += " class='" + val.icon + "' "; }
+ if(val.icon && val.icon.indexOf("/") !== -1) { str += " style='background:url(" + val.icon + ") center center no-repeat;' "; }
+ str += "> </ins><a href='#' rel='" + i + "'>";
+ if(val.submenu) {
+ str += "<span style='float:" + ($.vakata.context.rtl ? "left" : "right") + ";'>»</span>";
+ }
+ str += val.label + "</a>";
+ if(val.submenu) {
+ tmp = $.vakata.context.parse(val.submenu, true);
+ if(tmp) { str += tmp; }
+ }
+ str += "</li>";
+ if(val.separator_after) {
+ str += "<li class='vakata-separator vakata-separator-after'></li>";
+ was_sep = true;
+ }
+ });
+ str = str.replace(/<li class\='vakata-separator vakata-separator-after'\><\/li\>$/,"");
+ str += "</ul>";
+ $(document).triggerHandler("context_parse.vakata");
+ return str.length > 10 ? str : false;
+ },
+ exec : function (i) {
+ if($.isFunction($.vakata.context.func[i])) {
+ // if is string - eval and call it!
+ $.vakata.context.func[i].call($.vakata.context.data, $.vakata.context.par);
+ return true;
+ }
+ else { return false; }
+ }
+ };
+ $(function () {
+ var css_string = '' +
+ '#vakata-contextmenu { display:block; visibility:hidden; left:0; top:-200px; position:absolute; margin:0; padding:0; min-width:180px; background:#ebebeb; border:1px solid silver; z-index:10000; *width:180px; } ' +
+ '#vakata-contextmenu ul { min-width:180px; *width:180px; } ' +
+ '#vakata-contextmenu ul, #vakata-contextmenu li { margin:0; padding:0; list-style-type:none; display:block; } ' +
+ '#vakata-contextmenu li { line-height:20px; min-height:20px; position:relative; padding:0px; } ' +
+ '#vakata-contextmenu li a { padding:1px 6px; line-height:17px; display:block; text-decoration:none; margin:1px 1px 0 1px; } ' +
+ '#vakata-contextmenu li ins { float:left; width:16px; height:16px; text-decoration:none; margin-right:2px; } ' +
+ '#vakata-contextmenu li a:hover, #vakata-contextmenu li.vakata-hover > a { background:gray; color:white; } ' +
+ '#vakata-contextmenu li ul { display:none; position:absolute; top:-2px; left:100%; background:#ebebeb; border:1px solid gray; } ' +
+ '#vakata-contextmenu .right { right:100%; left:auto; } ' +
+ '#vakata-contextmenu .bottom { bottom:-1px; top:auto; } ' +
+ '#vakata-contextmenu li.vakata-separator { min-height:0; height:1px; line-height:1px; font-size:1px; overflow:hidden; margin:0 2px; background:silver; /* border-top:1px solid #fefefe; */ padding:0; } ';
+ $.vakata.css.add_sheet({ str : css_string, title : "vakata" });
+ $.vakata.context.cnt
+ .delegate("a","click", function (e) { e.preventDefault(); })
+ .delegate("a","mouseup", function (e) {
+ if(!$(this).parent().hasClass("jstree-contextmenu-disabled") && $.vakata.context.exec($(this).attr("rel"))) {
+ $.vakata.context.hide();
+ }
+ else { $(this).blur(); }
+ })
+ .delegate("a","mouseover", function () {
+ $.vakata.context.cnt.find(".vakata-hover").removeClass("vakata-hover");
+ })
+ .appendTo("body");
+ $(document).bind("mousedown", function (e) { if($.vakata.context.vis && !$.contains($.vakata.context.cnt[0], e.target)) { $.vakata.context.hide(); } });
+ if(typeof $.hotkeys !== "undefined") {
+ $(document)
+ .bind("keydown", "up", function (e) {
+ if($.vakata.context.vis) {
+ var o = $.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").prevAll("li:not(.vakata-separator)").first();
+ if(!o.length) { o = $.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").last(); }
+ o.addClass("vakata-hover");
+ e.stopImmediatePropagation();
+ e.preventDefault();
+ }
+ })
+ .bind("keydown", "down", function (e) {
+ if($.vakata.context.vis) {
+ var o = $.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").nextAll("li:not(.vakata-separator)").first();
+ if(!o.length) { o = $.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").first(); }
+ o.addClass("vakata-hover");
+ e.stopImmediatePropagation();
+ e.preventDefault();
+ }
+ })
+ .bind("keydown", "right", function (e) {
+ if($.vakata.context.vis) {
+ $.vakata.context.cnt.find(".vakata-hover").children("ul").show().children("li:not(.vakata-separator)").removeClass("vakata-hover").first().addClass("vakata-hover");
+ e.stopImmediatePropagation();
+ e.preventDefault();
+ }
+ })
+ .bind("keydown", "left", function (e) {
+ if($.vakata.context.vis) {
+ $.vakata.context.cnt.find(".vakata-hover").children("ul").hide().children(".vakata-separator").removeClass("vakata-hover");
+ e.stopImmediatePropagation();
+ e.preventDefault();
+ }
+ })
+ .bind("keydown", "esc", function (e) {
+ $.vakata.context.hide();
+ e.preventDefault();
+ })
+ .bind("keydown", "space", function (e) {
+ $.vakata.context.cnt.find(".vakata-hover").last().children("a").click();
+ e.preventDefault();
+ });
+ }
+ });
+
+ $.jstree.plugin("contextmenu", {
+ __init : function () {
+ this.get_container()
+ .delegate("a", "contextmenu.jstree", $.proxy(function (e) {
+ e.preventDefault();
+ if(!$(e.currentTarget).hasClass("jstree-loading")) {
+ this.show_contextmenu(e.currentTarget, e.pageX, e.pageY);
+ }
+ }, this))
+ .delegate("a", "click.jstree", $.proxy(function (e) {
+ if(this.data.contextmenu) {
+ $.vakata.context.hide();
+ }
+ }, this))
+ .bind("destroy.jstree", $.proxy(function () {
+ // TODO: move this to descruct method
+ if(this.data.contextmenu) {
+ $.vakata.context.hide();
+ }
+ }, this));
+ $(document).bind("context_hide.vakata", $.proxy(function () { this.data.contextmenu = false; }, this));
+ },
+ defaults : {
+ select_node : false, // requires UI plugin
+ show_at_node : true,
+ items : { // Could be a function that should return an object like this one
+ "create" : {
+ "separator_before" : false,
+ "separator_after" : true,
+ "label" : "Create",
+ "action" : function (obj) { this.create(obj); }
+ },
+ "rename" : {
+ "separator_before" : false,
+ "separator_after" : false,
+ "label" : "Rename",
+ "action" : function (obj) { this.rename(obj); }
+ },
+ "remove" : {
+ "separator_before" : false,
+ "icon" : false,
+ "separator_after" : false,
+ "label" : "Delete",
+ "action" : function (obj) { if(this.is_selected(obj)) { this.remove(); } else { this.remove(obj); } }
+ },
+ "ccp" : {
+ "separator_before" : true,
+ "icon" : false,
+ "separator_after" : false,
+ "label" : "Edit",
+ "action" : false,
+ "submenu" : {
+ "cut" : {
+ "separator_before" : false,
+ "separator_after" : false,
+ "label" : "Cut",
+ "action" : function (obj) { this.cut(obj); }
+ },
+ "copy" : {
+ "separator_before" : false,
+ "icon" : false,
+ "separator_after" : false,
+ "label" : "Copy",
+ "action" : function (obj) { this.copy(obj); }
+ },
+ "paste" : {
+ "separator_before" : false,
+ "icon" : false,
+ "separator_after" : false,
+ "label" : "Paste",
+ "action" : function (obj) { this.paste(obj); }
+ }
+ }
+ }
+ }
+ },
+ _fn : {
+ show_contextmenu : function (obj, x, y) {
+ obj = this._get_node(obj);
+ var s = this.get_settings().contextmenu,
+ a = obj.children("a:visible:eq(0)"),
+ o = false,
+ i = false;
+ if(s.select_node && this.data.ui && !this.is_selected(obj)) {
+ this.deselect_all();
+ this.select_node(obj, true);
+ }
+ if(s.show_at_node || typeof x === "undefined" || typeof y === "undefined") {
+ o = a.offset();
+ x = o.left;
+ y = o.top + this.data.core.li_height;
+ }
+ i = obj.data("jstree") && obj.data("jstree").contextmenu ? obj.data("jstree").contextmenu : s.items;
+ if($.isFunction(i)) { i = i.call(this, obj); }
+ this.data.contextmenu = true;
+ $.vakata.context.show(i, a, x, y, this, obj, this._get_settings().core.rtl);
+ if(this.data.themes) { $.vakata.context.cnt.attr("class", "jstree-" + this.data.themes.theme + "-context"); }
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree types plugin
+ * Adds support types of nodes
+ * You can set an attribute on each li node, that represents its type.
+ * According to the type setting the node may get custom icon/validation rules
+ */
+(function ($) {
+ $.jstree.plugin("types", {
+ __init : function () {
+ var s = this._get_settings().types;
+ this.data.types.attach_to = [];
+ this.get_container()
+ .bind("init.jstree", $.proxy(function () {
+ var types = s.types,
+ attr = s.type_attr,
+ icons_css = "",
+ _this = this;
+
+ $.each(types, function (i, tp) {
+ $.each(tp, function (k, v) {
+ if(!/^(max_depth|max_children|icon|valid_children)$/.test(k)) { _this.data.types.attach_to.push(k); }
+ });
+ if(!tp.icon) { return true; }
+ if( tp.icon.image || tp.icon.position) {
+ if(i == "default") { icons_css += '.jstree-' + _this.get_index() + ' a > .jstree-icon { '; }
+ else { icons_css += '.jstree-' + _this.get_index() + ' li[' + attr + '="' + i + '"] > a > .jstree-icon { '; }
+ if(tp.icon.image) { icons_css += ' background-image:url(' + tp.icon.image + '); '; }
+ if(tp.icon.position){ icons_css += ' background-position:' + tp.icon.position + '; '; }
+ else { icons_css += ' background-position:0 0; '; }
+ icons_css += '} ';
+ }
+ });
+ if(icons_css !== "") { $.vakata.css.add_sheet({ 'str' : icons_css, title : "jstree-types" }); }
+ }, this))
+ .bind("before.jstree", $.proxy(function (e, data) {
+ var s, t,
+ o = this._get_settings().types.use_data ? this._get_node(data.args[0]) : false,
+ d = o && o !== -1 && o.length ? o.data("jstree") : false;
+ if(d && d.types && d.types[data.func] === false) { e.stopImmediatePropagation(); return false; }
+ if($.inArray(data.func, this.data.types.attach_to) !== -1) {
+ if(!data.args[0] || (!data.args[0].tagName && !data.args[0].jquery)) { return; }
+ s = this._get_settings().types.types;
+ t = this._get_type(data.args[0]);
+ if(
+ (
+ (s[t] && typeof s[t][data.func] !== "undefined") ||
+ (s["default"] && typeof s["default"][data.func] !== "undefined")
+ ) && this._check(data.func, data.args[0]) === false
+ ) {
+ e.stopImmediatePropagation();
+ return false;
+ }
+ }
+ }, this));
+ if(is_ie6) {
+ this.get_container()
+ .bind("load_node.jstree set_type.jstree", $.proxy(function (e, data) {
+ var r = data && data.rslt && data.rslt.obj && data.rslt.obj !== -1 ? this._get_node(data.rslt.obj).parent() : this.get_container_ul(),
+ c = false,
+ s = this._get_settings().types;
+ $.each(s.types, function (i, tp) {
+ if(tp.icon && (tp.icon.image || tp.icon.position)) {
+ c = i === "default" ? r.find("li > a > .jstree-icon") : r.find("li[" + s.type_attr + "='" + i + "'] > a > .jstree-icon");
+ if(tp.icon.image) { c.css("backgroundImage","url(" + tp.icon.image + ")"); }
+ c.css("backgroundPosition", tp.icon.position || "0 0");
+ }
+ });
+ }, this));
+ }
+ },
+ defaults : {
+ // defines maximum number of root nodes (-1 means unlimited, -2 means disable max_children checking)
+ max_children : -1,
+ // defines the maximum depth of the tree (-1 means unlimited, -2 means disable max_depth checking)
+ max_depth : -1,
+ // defines valid node types for the root nodes
+ valid_children : "all",
+
+ // whether to use $.data
+ use_data : false,
+ // where is the type stores (the rel attribute of the LI element)
+ type_attr : "rel",
+ // a list of types
+ types : {
+ // the default type
+ "default" : {
+ "max_children" : -1,
+ "max_depth" : -1,
+ "valid_children": "all"
+
+ // Bound functions - you can bind any other function here (using boolean or function)
+ //"select_node" : true
+ }
+ }
+ },
+ _fn : {
+ _types_notify : function (n, data) {
+ if(data.type && this._get_settings().types.use_data) {
+ this.set_type(data.type, n);
+ }
+ },
+ _get_type : function (obj) {
+ obj = this._get_node(obj);
+ return (!obj || !obj.length) ? false : obj.attr(this._get_settings().types.type_attr) || "default";
+ },
+ set_type : function (str, obj) {
+ obj = this._get_node(obj);
+ var ret = (!obj.length || !str) ? false : obj.attr(this._get_settings().types.type_attr, str);
+ if(ret) { this.__callback({ obj : obj, type : str}); }
+ return ret;
+ },
+ _check : function (rule, obj, opts) {
+ obj = this._get_node(obj);
+ var v = false, t = this._get_type(obj), d = 0, _this = this, s = this._get_settings().types, data = false;
+ if(obj === -1) {
+ if(!!s[rule]) { v = s[rule]; }
+ else { return; }
+ }
+ else {
+ if(t === false) { return; }
+ data = s.use_data ? obj.data("jstree") : false;
+ if(data && data.types && typeof data.types[rule] !== "undefined") { v = data.types[rule]; }
+ else if(!!s.types[t] && typeof s.types[t][rule] !== "undefined") { v = s.types[t][rule]; }
+ else if(!!s.types["default"] && typeof s.types["default"][rule] !== "undefined") { v = s.types["default"][rule]; }
+ }
+ if($.isFunction(v)) { v = v.call(this, obj); }
+ if(rule === "max_depth" && obj !== -1 && opts !== false && s.max_depth !== -2 && v !== 0) {
+ // also include the node itself - otherwise if root node it is not checked
+ obj.children("a:eq(0)").parentsUntil(".jstree","li").each(function (i) {
+ // check if current depth already exceeds global tree depth
+ if(s.max_depth !== -1 && s.max_depth - (i + 1) <= 0) { v = 0; return false; }
+ d = (i === 0) ? v : _this._check(rule, this, false);
+ // check if current node max depth is already matched or exceeded
+ if(d !== -1 && d - (i + 1) <= 0) { v = 0; return false; }
+ // otherwise - set the max depth to the current value minus current depth
+ if(d >= 0 && (d - (i + 1) < v || v < 0) ) { v = d - (i + 1); }
+ // if the global tree depth exists and it minus the nodes calculated so far is less than `v` or `v` is unlimited
+ if(s.max_depth >= 0 && (s.max_depth - (i + 1) < v || v < 0) ) { v = s.max_depth - (i + 1); }
+ });
+ }
+ return v;
+ },
+ check_move : function () {
+ if(!this.__call_old()) { return false; }
+ var m = this._get_move(),
+ s = m.rt._get_settings().types,
+ mc = m.rt._check("max_children", m.cr),
+ md = m.rt._check("max_depth", m.cr),
+ vc = m.rt._check("valid_children", m.cr),
+ ch = 0, d = 1, t;
+
+ if(vc === "none") { return false; }
+ if($.isArray(vc) && m.ot && m.ot._get_type) {
+ m.o.each(function () {
+ if($.inArray(m.ot._get_type(this), vc) === -1) { d = false; return false; }
+ });
+ if(d === false) { return false; }
+ }
+ if(s.max_children !== -2 && mc !== -1) {
+ ch = m.cr === -1 ? this.get_container().find("> ul > li").not(m.o).length : m.cr.find("> ul > li").not(m.o).length;
+ if(ch + m.o.length > mc) { return false; }
+ }
+ if(s.max_depth !== -2 && md !== -1) {
+ d = 0;
+ if(md === 0) { return false; }
+ if(typeof m.o.d === "undefined") {
+ // TODO: deal with progressive rendering and async when checking max_depth (how to know the depth of the moved node)
+ t = m.o;
+ while(t.length > 0) {
+ t = t.find("> ul > li");
+ d ++;
+ }
+ m.o.d = d;
+ }
+ if(md - m.o.d < 0) { return false; }
+ }
+ return true;
+ },
+ create_node : function (obj, position, js, callback, is_loaded, skip_check) {
+ if(!skip_check && (is_loaded || this._is_loaded(obj))) {
+ var p = (typeof position == "string" && position.match(/^before|after$/i) && obj !== -1) ? this._get_parent(obj) : this._get_node(obj),
+ s = this._get_settings().types,
+ mc = this._check("max_children", p),
+ md = this._check("max_depth", p),
+ vc = this._check("valid_children", p),
+ ch;
+ if(typeof js === "string") { js = { data : js }; }
+ if(!js) { js = {}; }
+ if(vc === "none") { return false; }
+ if($.isArray(vc)) {
+ if(!js.attr || !js.attr[s.type_attr]) {
+ if(!js.attr) { js.attr = {}; }
+ js.attr[s.type_attr] = vc[0];
+ }
+ else {
+ if($.inArray(js.attr[s.type_attr], vc) === -1) { return false; }
+ }
+ }
+ if(s.max_children !== -2 && mc !== -1) {
+ ch = p === -1 ? this.get_container().find("> ul > li").length : p.find("> ul > li").length;
+ if(ch + 1 > mc) { return false; }
+ }
+ if(s.max_depth !== -2 && md !== -1 && (md - 1) < 0) { return false; }
+ }
+ return this.__call_old(true, obj, position, js, callback, is_loaded, skip_check);
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree HTML plugin
+ * The HTML data store. Datastores are build by replacing the `load_node` and `_is_loaded` functions.
+ */
+(function ($) {
+ $.jstree.plugin("html_data", {
+ __init : function () {
+ // this used to use html() and clean the whitespace, but this way any attached data was lost
+ this.data.html_data.original_container_html = this.get_container().find(" > ul > li").clone(true);
+ // remove white space from LI node - otherwise nodes appear a bit to the right
+ this.data.html_data.original_container_html.find("li").addBack().contents().filter(function() { return this.nodeType == 3; }).remove();
+ },
+ defaults : {
+ data : false,
+ ajax : false,
+ correct_state : true
+ },
+ _fn : {
+ load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_html(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); },
+ _is_loaded : function (obj) {
+ obj = this._get_node(obj);
+ return obj == -1 || !obj || (!this._get_settings().html_data.ajax && !$.isFunction(this._get_settings().html_data.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").size() > 0;
+ },
+ load_node_html : function (obj, s_call, e_call) {
+ var d,
+ s = this.get_settings().html_data,
+ error_func = function () {},
+ success_func = function () {};
+ obj = this._get_node(obj);
+ if(obj && obj !== -1) {
+ if(obj.data("jstree_is_loading")) { return; }
+ else { obj.data("jstree_is_loading",true); }
+ }
+ switch(!0) {
+ case ($.isFunction(s.data)):
+ s.data.call(this, obj, $.proxy(function (d) {
+ if(d && d !== "" && d.toString && d.toString().replace(/^[\s\n]+$/,"") !== "") {
+ d = $(d);
+ if(!d.is("ul")) { d = $("<ul />").append(d); }
+ if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
+ else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree_is_loading"); }
+ this.clean_node(obj);
+ if(s_call) { s_call.call(this); }
+ }
+ else {
+ if(obj && obj !== -1) {
+ obj.children("a.jstree-loading").removeClass("jstree-loading");
+ obj.removeData("jstree_is_loading");
+ if(s.correct_state) {
+ this.correct_state(obj);
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ else {
+ if(s.correct_state) {
+ this.get_container().children("ul").empty();
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ }
+ }, this));
+ break;
+ case (!s.data && !s.ajax):
+ if(!obj || obj == -1) {
+ this.get_container()
+ .children("ul").empty()
+ .append(this.data.html_data.original_container_html)
+ .find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end()
+ .filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");
+ this.clean_node();
+ }
+ if(s_call) { s_call.call(this); }
+ break;
+ case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
+ if(!obj || obj == -1) {
+ d = $(s.data);
+ if(!d.is("ul")) { d = $("<ul />").append(d); }
+ this.get_container()
+ .children("ul").empty().append(d.children())
+ .find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end()
+ .filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");
+ this.clean_node();
+ }
+ if(s_call) { s_call.call(this); }
+ break;
+ case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
+ obj = this._get_node(obj);
+ error_func = function (x, t, e) {
+ var ef = this.get_settings().html_data.ajax.error;
+ if(ef) { ef.call(this, x, t, e); }
+ if(obj != -1 && obj.length) {
+ obj.children("a.jstree-loading").removeClass("jstree-loading");
+ obj.removeData("jstree_is_loading");
+ if(t === "success" && s.correct_state) { this.correct_state(obj); }
+ }
+ else {
+ if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
+ }
+ if(e_call) { e_call.call(this); }
+ };
+ success_func = function (d, t, x) {
+ var sf = this.get_settings().html_data.ajax.success;
+ if(sf) { d = sf.call(this,d,t,x) || d; }
+ if(d === "" || (d && d.toString && d.toString().replace(/^[\s\n]+$/,"") === "")) {
+ return error_func.call(this, x, t, "");
+ }
+ if(d) {
+ d = $(d);
+ if(!d.is("ul")) { d = $("<ul />").append(d); }
+ if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
+ else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree_is_loading"); }
+ this.clean_node(obj);
+ if(s_call) { s_call.call(this); }
+ }
+ else {
+ if(obj && obj !== -1) {
+ obj.children("a.jstree-loading").removeClass("jstree-loading");
+ obj.removeData("jstree_is_loading");
+ if(s.correct_state) {
+ this.correct_state(obj);
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ else {
+ if(s.correct_state) {
+ this.get_container().children("ul").empty();
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ }
+ };
+ s.ajax.context = this;
+ s.ajax.error = error_func;
+ s.ajax.success = success_func;
+ if(!s.ajax.dataType) { s.ajax.dataType = "html"; }
+ if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
+ if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
+ $.ajax(s.ajax);
+ break;
+ }
+ }
+ }
+ });
+ // include the HTML data plugin by default
+ $.jstree.defaults.plugins.push("html_data");
+})(jQuery);
+//*/
+
+/*
+ * jsTree themeroller plugin
+ * Adds support for jQuery UI themes. Include this at the end of your plugins list, also make sure "themes" is not included.
+ */
+(function ($) {
+ $.jstree.plugin("themeroller", {
+ __init : function () {
+ var s = this._get_settings().themeroller;
+ this.get_container()
+ .addClass("ui-widget-content")
+ .addClass("jstree-themeroller")
+ .delegate("a","mouseenter.jstree", function (e) {
+ if(!$(e.currentTarget).hasClass("jstree-loading")) {
+ $(this).addClass(s.item_h);
+ }
+ })
+ .delegate("a","mouseleave.jstree", function () {
+ $(this).removeClass(s.item_h);
+ })
+ .bind("init.jstree", $.proxy(function (e, data) {
+ data.inst.get_container().find("> ul > li > .jstree-loading > ins").addClass("ui-icon-refresh");
+ this._themeroller(data.inst.get_container().find("> ul > li"));
+ }, this))
+ .bind("open_node.jstree create_node.jstree", $.proxy(function (e, data) {
+ this._themeroller(data.rslt.obj);
+ }, this))
+ .bind("loaded.jstree refresh.jstree", $.proxy(function (e) {
+ this._themeroller();
+ }, this))
+ .bind("close_node.jstree", $.proxy(function (e, data) {
+ this._themeroller(data.rslt.obj);
+ }, this))
+ .bind("delete_node.jstree", $.proxy(function (e, data) {
+ this._themeroller(data.rslt.parent);
+ }, this))
+ .bind("correct_state.jstree", $.proxy(function (e, data) {
+ data.rslt.obj
+ .children("ins.jstree-icon").removeClass(s.opened + " " + s.closed + " ui-icon").end()
+ .find("> a > ins.ui-icon")
+ .filter(function() {
+ return this.className.toString()
+ .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
+ .indexOf("ui-icon-") === -1;
+ }).removeClass(s.item_open + " " + s.item_clsd).addClass(s.item_leaf || "jstree-no-icon");
+ }, this))
+ .bind("select_node.jstree", $.proxy(function (e, data) {
+ data.rslt.obj.children("a").addClass(s.item_a);
+ }, this))
+ .bind("deselect_node.jstree deselect_all.jstree", $.proxy(function (e, data) {
+ this.get_container()
+ .find("a." + s.item_a).removeClass(s.item_a).end()
+ .find("a.jstree-clicked").addClass(s.item_a);
+ }, this))
+ .bind("dehover_node.jstree", $.proxy(function (e, data) {
+ data.rslt.obj.children("a").removeClass(s.item_h);
+ }, this))
+ .bind("hover_node.jstree", $.proxy(function (e, data) {
+ this.get_container()
+ .find("a." + s.item_h).not(data.rslt.obj).removeClass(s.item_h);
+ data.rslt.obj.children("a").addClass(s.item_h);
+ }, this))
+ .bind("move_node.jstree", $.proxy(function (e, data) {
+ this._themeroller(data.rslt.o);
+ this._themeroller(data.rslt.op);
+ }, this));
+ },
+ __destroy : function () {
+ var s = this._get_settings().themeroller,
+ c = [ "ui-icon" ];
+ $.each(s, function (i, v) {
+ v = v.split(" ");
+ if(v.length) { c = c.concat(v); }
+ });
+ this.get_container()
+ .removeClass("ui-widget-content")
+ .find("." + c.join(", .")).removeClass(c.join(" "));
+ },
+ _fn : {
+ _themeroller : function (obj) {
+ var s = this._get_settings().themeroller;
+ obj = (!obj || obj == -1) ? this.get_container_ul() : this._get_node(obj);
+ obj = (!obj || obj == -1) ? this.get_container_ul() : obj.parent();
+ obj
+ .find("li.jstree-closed")
+ .children("ins.jstree-icon").removeClass(s.opened).addClass("ui-icon " + s.closed).end()
+ .children("a").addClass(s.item)
+ .children("ins.jstree-icon").addClass("ui-icon")
+ .filter(function() {
+ return this.className.toString()
+ .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
+ .indexOf("ui-icon-") === -1;
+ }).removeClass(s.item_leaf + " " + s.item_open).addClass(s.item_clsd || "jstree-no-icon")
+ .end()
+ .end()
+ .end()
+ .end()
+ .find("li.jstree-open")
+ .children("ins.jstree-icon").removeClass(s.closed).addClass("ui-icon " + s.opened).end()
+ .children("a").addClass(s.item)
+ .children("ins.jstree-icon").addClass("ui-icon")
+ .filter(function() {
+ return this.className.toString()
+ .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
+ .indexOf("ui-icon-") === -1;
+ }).removeClass(s.item_leaf + " " + s.item_clsd).addClass(s.item_open || "jstree-no-icon")
+ .end()
+ .end()
+ .end()
+ .end()
+ .find("li.jstree-leaf")
+ .children("ins.jstree-icon").removeClass(s.closed + " ui-icon " + s.opened).end()
+ .children("a").addClass(s.item)
+ .children("ins.jstree-icon").addClass("ui-icon")
+ .filter(function() {
+ return this.className.toString()
+ .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
+ .indexOf("ui-icon-") === -1;
+ }).removeClass(s.item_clsd + " " + s.item_open).addClass(s.item_leaf || "jstree-no-icon");
+ }
+ },
+ defaults : {
+ "opened" : "ui-icon-triangle-1-se",
+ "closed" : "ui-icon-triangle-1-e",
+ "item" : "ui-state-default",
+ "item_h" : "ui-state-hover",
+ "item_a" : "ui-state-active",
+ "item_open" : "ui-icon-folder-open",
+ "item_clsd" : "ui-icon-folder-collapsed",
+ "item_leaf" : "ui-icon-document"
+ }
+ });
+ $(function() {
+ var css_string = '' +
+ '.jstree-themeroller .ui-icon { overflow:visible; } ' +
+ '.jstree-themeroller a { padding:0 2px; } ' +
+ '.jstree-themeroller .jstree-no-icon { display:none; }';
+ $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree unique plugin
+ * Forces different names amongst siblings (still a bit experimental)
+ * NOTE: does not check language versions (it will not be possible to have nodes with the same title, even in different languages)
+ */
+(function ($) {
+ $.jstree.plugin("unique", {
+ __init : function () {
+ this.get_container()
+ .bind("before.jstree", $.proxy(function (e, data) {
+ var nms = [], res = true, p, t;
+ if(data.func == "move_node") {
+ // obj, ref, position, is_copy, is_prepared, skip_check
+ if(data.args[4] === true) {
+ if(data.args[0].o && data.args[0].o.length) {
+ data.args[0].o.children("a").each(function () { nms.push($(this).text().replace(/^\s+/g,"")); });
+ res = this._check_unique(nms, data.args[0].np.find("> ul > li").not(data.args[0].o), "move_node");
+ }
+ }
+ }
+ if(data.func == "create_node") {
+ // obj, position, js, callback, is_loaded
+ if(data.args[4] || this._is_loaded(data.args[0])) {
+ p = this._get_node(data.args[0]);
+ if(data.args[1] && (data.args[1] === "before" || data.args[1] === "after")) {
+ p = this._get_parent(data.args[0]);
+ if(!p || p === -1) { p = this.get_container(); }
+ }
+ if(typeof data.args[2] === "string") { nms.push(data.args[2]); }
+ else if(!data.args[2] || !data.args[2].data) { nms.push(this._get_string("new_node")); }
+ else { nms.push(data.args[2].data); }
+ res = this._check_unique(nms, p.find("> ul > li"), "create_node");
+ }
+ }
+ if(data.func == "rename_node") {
+ // obj, val
+ nms.push(data.args[1]);
+ t = this._get_node(data.args[0]);
+ p = this._get_parent(t);
+ if(!p || p === -1) { p = this.get_container(); }
+ res = this._check_unique(nms, p.find("> ul > li").not(t), "rename_node");
+ }
+ if(!res) {
+ e.stopPropagation();
+ return false;
+ }
+ }, this));
+ },
+ defaults : {
+ error_callback : $.noop
+ },
+ _fn : {
+ _check_unique : function (nms, p, func) {
+ var cnms = [], ok = true;
+ p.children("a").each(function () { cnms.push($(this).text().replace(/^\s+/g,"")); });
+ if(!cnms.length || !nms.length) { return true; }
+ $.each(nms, function (i, v) {
+ if($.inArray(v, cnms) !== -1) {
+ ok = false;
+ return false;
+ }
+ });
+ if(!ok) {
+ this._get_settings().unique.error_callback.call(null, nms, p, func);
+ }
+ return ok;
+ },
+ check_move : function () {
+ if(!this.__call_old()) { return false; }
+ var p = this._get_move(), nms = [];
+ if(p.o && p.o.length) {
+ p.o.children("a").each(function () { nms.push($(this).text().replace(/^\s+/g,"")); });
+ return this._check_unique(nms, p.np.find("> ul > li").not(p.o), "check_move");
+ }
+ return true;
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree wholerow plugin
+ * Makes select and hover work on the entire width of the node
+ * MAY BE HEAVY IN LARGE DOM
+ */
+(function ($) {
+ $.jstree.plugin("wholerow", {
+ __init : function () {
+ if(!this.data.ui) { throw "jsTree wholerow: jsTree UI plugin not included."; }
+ this.data.wholerow.html = false;
+ this.data.wholerow.to = false;
+ this.get_container()
+ .bind("init.jstree", $.proxy(function (e, data) {
+ this._get_settings().core.animation = 0;
+ }, this))
+ .bind("open_node.jstree create_node.jstree clean_node.jstree loaded.jstree", $.proxy(function (e, data) {
+ this._prepare_wholerow_span( data && data.rslt && data.rslt.obj ? data.rslt.obj : -1 );
+ }, this))
+ .bind("search.jstree clear_search.jstree reopen.jstree after_open.jstree after_close.jstree create_node.jstree delete_node.jstree clean_node.jstree", $.proxy(function (e, data) {
+ if(this.data.to) { clearTimeout(this.data.to); }
+ this.data.to = setTimeout( (function (t, o) { return function() { t._prepare_wholerow_ul(o); }; })(this, data && data.rslt && data.rslt.obj ? data.rslt.obj : -1), 0);
+ }, this))
+ .bind("deselect_all.jstree", $.proxy(function (e, data) {
+ this.get_container().find(" > .jstree-wholerow .jstree-clicked").removeClass("jstree-clicked " + (this.data.themeroller ? this._get_settings().themeroller.item_a : "" ));
+ }, this))
+ .bind("select_node.jstree deselect_node.jstree ", $.proxy(function (e, data) {
+ data.rslt.obj.each(function () {
+ var ref = data.inst.get_container().find(" > .jstree-wholerow li:visible:eq(" + ( parseInt((($(this).offset().top - data.inst.get_container().offset().top + data.inst.get_container()[0].scrollTop) / data.inst.data.core.li_height),10)) + ")");
+ // ref.children("a")[e.type === "select_node" ? "addClass" : "removeClass"]("jstree-clicked");
+ ref.children("a").attr("class",data.rslt.obj.children("a").attr("class"));
+ });
+ }, this))
+ .bind("hover_node.jstree dehover_node.jstree", $.proxy(function (e, data) {
+ this.get_container().find(" > .jstree-wholerow .jstree-hovered").removeClass("jstree-hovered " + (this.data.themeroller ? this._get_settings().themeroller.item_h : "" ));
+ if(e.type === "hover_node") {
+ var ref = this.get_container().find(" > .jstree-wholerow li:visible:eq(" + ( parseInt(((data.rslt.obj.offset().top - this.get_container().offset().top + this.get_container()[0].scrollTop) / this.data.core.li_height),10)) + ")");
+ // ref.children("a").addClass("jstree-hovered");
+ ref.children("a").attr("class",data.rslt.obj.children(".jstree-hovered").attr("class"));
+ }
+ }, this))
+ .delegate(".jstree-wholerow-span, ins.jstree-icon, li", "click.jstree", function (e) {
+ var n = $(e.currentTarget);
+ if(e.target.tagName === "A" || (e.target.tagName === "INS" && n.closest("li").is(".jstree-open, .jstree-closed"))) { return; }
+ n.closest("li").children("a:visible:eq(0)").click();
+ e.stopImmediatePropagation();
+ })
+ .delegate("li", "mouseover.jstree", $.proxy(function (e) {
+ e.stopImmediatePropagation();
+ if($(e.currentTarget).children(".jstree-hovered, .jstree-clicked").length) { return false; }
+ this.hover_node(e.currentTarget);
+ return false;
+ }, this))
+ .delegate("li", "mouseleave.jstree", $.proxy(function (e) {
+ if($(e.currentTarget).children("a").hasClass("jstree-hovered").length) { return; }
+ this.dehover_node(e.currentTarget);
+ }, this));
+ if(is_ie7 || is_ie6) {
+ $.vakata.css.add_sheet({ str : ".jstree-" + this.get_index() + " { position:relative; } ", title : "jstree" });
+ }
+ },
+ defaults : {
+ },
+ __destroy : function () {
+ this.get_container().children(".jstree-wholerow").remove();
+ this.get_container().find(".jstree-wholerow-span").remove();
+ },
+ _fn : {
+ _prepare_wholerow_span : function (obj) {
+ obj = !obj || obj == -1 ? this.get_container().find("> ul > li") : this._get_node(obj);
+ if(obj === false) { return; } // added for removing root nodes
+ obj.each(function () {
+ $(this).find("li").addBack().each(function () {
+ var $t = $(this);
+ if($t.children(".jstree-wholerow-span").length) { return true; }
+ $t.prepend("<span class='jstree-wholerow-span' style='width:" + ($t.parentsUntil(".jstree","li").length * 18) + "px;'> </span>");
+ });
+ });
+ },
+ _prepare_wholerow_ul : function () {
+ var o = this.get_container().children("ul").eq(0), h = o.html();
+ o.addClass("jstree-wholerow-real");
+ if(this.data.wholerow.last_html !== h) {
+ this.data.wholerow.last_html = h;
+ this.get_container().children(".jstree-wholerow").remove();
+ this.get_container().append(
+ o.clone().removeClass("jstree-wholerow-real")
+ .wrapAll("<div class='jstree-wholerow' />").parent()
+ .width(o.parent()[0].scrollWidth)
+ .css("top", (o.height() + ( is_ie7 ? 5 : 0)) * -1 )
+ .find("li[id]").each(function () { this.removeAttribute("id"); }).end()
+ );
+ }
+ }
+ }
+ });
+ $(function() {
+ var css_string = '' +
+ '.jstree .jstree-wholerow-real { position:relative; z-index:1; } ' +
+ '.jstree .jstree-wholerow-real li { cursor:pointer; } ' +
+ '.jstree .jstree-wholerow-real a { border-left-color:transparent !important; border-right-color:transparent !important; } ' +
+ '.jstree .jstree-wholerow { position:relative; z-index:0; height:0; } ' +
+ '.jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { width:100%; } ' +
+ '.jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li, .jstree .jstree-wholerow a { margin:0 !important; padding:0 !important; } ' +
+ '.jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { background:transparent !important; }' +
+ '.jstree .jstree-wholerow ins, .jstree .jstree-wholerow span, .jstree .jstree-wholerow input { display:none !important; }' +
+ '.jstree .jstree-wholerow a, .jstree .jstree-wholerow a:hover { text-indent:-9999px; !important; width:100%; padding:0 !important; border-right-width:0px !important; border-left-width:0px !important; } ' +
+ '.jstree .jstree-wholerow-span { position:absolute; left:0; margin:0px; padding:0; height:18px; border-width:0; padding:0; z-index:0; }';
+ if(is_ff2) {
+ css_string += '' +
+ '.jstree .jstree-wholerow a { display:block; height:18px; margin:0; padding:0; border:0; } ' +
+ '.jstree .jstree-wholerow-real a { border-color:transparent !important; } ';
+ }
+ if(is_ie7 || is_ie6) {
+ css_string += '' +
+ '.jstree .jstree-wholerow, .jstree .jstree-wholerow li, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow a { margin:0; padding:0; line-height:18px; } ' +
+ '.jstree .jstree-wholerow a { display:block; height:18px; line-height:18px; overflow:hidden; } ';
+ }
+ $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
+ });
+})(jQuery);
+//*/
+
+/*
+* jsTree model plugin
+* This plugin gets jstree to use a class model to retrieve data, creating great dynamism
+*/
+(function ($) {
+ var nodeInterface = ["getChildren","getChildrenCount","getAttr","getName","getProps"],
+ validateInterface = function(obj, inter) {
+ var valid = true;
+ obj = obj || {};
+ inter = [].concat(inter);
+ $.each(inter, function (i, v) {
+ if(!$.isFunction(obj[v])) { valid = false; return false; }
+ });
+ return valid;
+ };
+ $.jstree.plugin("model", {
+ __init : function () {
+ if(!this.data.json_data) { throw "jsTree model: jsTree json_data plugin not included."; }
+ this._get_settings().json_data.data = function (n, b) {
+ var obj = (n == -1) ? this._get_settings().model.object : n.data("jstree_model");
+ if(!validateInterface(obj, nodeInterface)) { return b.call(null, false); }
+ if(this._get_settings().model.async) {
+ obj.getChildren($.proxy(function (data) {
+ this.model_done(data, b);
+ }, this));
+ }
+ else {
+ this.model_done(obj.getChildren(), b);
+ }
+ };
+ },
+ defaults : {
+ object : false,
+ id_prefix : false,
+ async : false
+ },
+ _fn : {
+ model_done : function (data, callback) {
+ var ret = [],
+ s = this._get_settings(),
+ _this = this;
+
+ if(!$.isArray(data)) { data = [data]; }
+ $.each(data, function (i, nd) {
+ var r = nd.getProps() || {};
+ r.attr = nd.getAttr() || {};
+ if(nd.getChildrenCount()) { r.state = "closed"; }
+ r.data = nd.getName();
+ if(!$.isArray(r.data)) { r.data = [r.data]; }
+ if(_this.data.types && $.isFunction(nd.getType)) {
+ r.attr[s.types.type_attr] = nd.getType();
+ }
+ if(r.attr.id && s.model.id_prefix) { r.attr.id = s.model.id_prefix + r.attr.id; }
+ if(!r.metadata) { r.metadata = { }; }
+ r.metadata.jstree_model = nd;
+ ret.push(r);
+ });
+ callback.call(null, ret);
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+})();
\ No newline at end of file
Added: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/apple/bg.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/apple/bg.jpg
___________________________________________________________________
Added: svn:mime-type
+ image/jpeg
Added: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/apple/d.png
===================================================================
(Binary files differ)
Property changes on: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/apple/d.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/apple/dot_for_ie.gif
===================================================================
(Binary files differ)
Property changes on: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/apple/dot_for_ie.gif
___________________________________________________________________
Added: svn:mime-type
+ image/gif
Added: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/apple/style.css
===================================================================
--- trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/apple/style.css (rev 0)
+++ trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/apple/style.css 2013-03-13 16:30:28 UTC (rev 39)
@@ -0,0 +1,61 @@
+/* %%Ignore-License
+ * jsTree apple theme 1.0
+ * Supported features: dots/no-dots, icons/no-icons, focused, loading
+ * Supported plugins: ui (hovered, clicked), checkbox, contextmenu, search
+ */
+
+.jstree-apple > ul { background:url("bg.jpg") left top repeat; }
+.jstree-apple li,
+.jstree-apple ins { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; }
+.jstree-apple li { background-position:-90px 0; background-repeat:repeat-y; }
+.jstree-apple li.jstree-last { background:transparent; }
+.jstree-apple .jstree-open > ins { background-position:-72px 0; }
+.jstree-apple .jstree-closed > ins { background-position:-54px 0; }
+.jstree-apple .jstree-leaf > ins { background-position:-36px 0; }
+
+.jstree-apple a { border-radius:4px; -moz-border-radius:4px; -webkit-border-radius:4px; text-shadow:1px 1px 1px white; }
+.jstree-apple .jstree-hovered { background:#e7f4f9; border:1px solid #d8f0fa; padding:0 3px 0 1px; text-shadow:1px 1px 1px silver; }
+.jstree-apple .jstree-clicked { background:#beebff; border:1px solid #99defd; padding:0 3px 0 1px; }
+.jstree-apple a .jstree-icon { background-position:-56px -20px; }
+.jstree-apple a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; }
+
+.jstree-apple.jstree-focused { background:white; }
+
+.jstree-apple .jstree-no-dots li,
+.jstree-apple .jstree-no-dots .jstree-leaf > ins { background:transparent; }
+.jstree-apple .jstree-no-dots .jstree-open > ins { background-position:-18px 0; }
+.jstree-apple .jstree-no-dots .jstree-closed > ins { background-position:0 0; }
+
+.jstree-apple .jstree-no-icons a .jstree-icon { display:none; }
+
+.jstree-apple .jstree-search { font-style:italic; }
+
+.jstree-apple .jstree-no-icons .jstree-checkbox { display:inline-block; }
+.jstree-apple .jstree-no-checkboxes .jstree-checkbox { display:none !important; }
+.jstree-apple .jstree-checked > a > .jstree-checkbox { background-position:-38px -19px; }
+.jstree-apple .jstree-unchecked > a > .jstree-checkbox { background-position:-2px -19px; }
+.jstree-apple .jstree-undetermined > a > .jstree-checkbox { background-position:-20px -19px; }
+.jstree-apple .jstree-checked > a > .checkbox:hover { background-position:-38px -37px; }
+.jstree-apple .jstree-unchecked > a > .jstree-checkbox:hover { background-position:-2px -37px; }
+.jstree-apple .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; }
+
+#vakata-dragged.jstree-apple ins { background:transparent !important; }
+#vakata-dragged.jstree-apple .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; }
+#vakata-dragged.jstree-apple .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; }
+#jstree-marker.jstree-apple { background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px; }
+
+.jstree-apple a.jstree-search { color:aqua; }
+.jstree-apple .jstree-locked a { color:silver; cursor:default; }
+
+#vakata-contextmenu.jstree-apple-context,
+#vakata-contextmenu.jstree-apple-context li ul { background:#f0f0f0; border:1px solid #979797; -moz-box-shadow: 1px 1px 2px #999; -webkit-box-shadow: 1px 1px 2px #999; box-shadow: 1px 1px 2px #999; }
+#vakata-contextmenu.jstree-apple-context li { }
+#vakata-contextmenu.jstree-apple-context a { color:black; }
+#vakata-contextmenu.jstree-apple-context a:hover,
+#vakata-contextmenu.jstree-apple-context .vakata-hover > a { padding:0 5px; background:#e8eff7; border:1px solid #aecff7; color:black; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; }
+#vakata-contextmenu.jstree-apple-context li.jstree-contextmenu-disabled a,
+#vakata-contextmenu.jstree-apple-context li.jstree-contextmenu-disabled a:hover { color:silver; background:transparent; border:0; padding:1px 4px; }
+#vakata-contextmenu.jstree-apple-context li.vakata-separator { background:white; border-top:1px solid #e0e0e0; margin:0; }
+#vakata-contextmenu.jstree-apple-context li ul { margin-left:-4px; }
+
+/* TODO: IE6 support - the `>` selectors */
\ No newline at end of file
Added: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/apple/throbber.gif
===================================================================
(Binary files differ)
Property changes on: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/apple/throbber.gif
___________________________________________________________________
Added: svn:mime-type
+ image/gif
Added: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/classic/d.gif
===================================================================
(Binary files differ)
Property changes on: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/classic/d.gif
___________________________________________________________________
Added: svn:mime-type
+ image/gif
Added: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/classic/d.png
===================================================================
(Binary files differ)
Property changes on: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/classic/d.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/classic/dot_for_ie.gif
===================================================================
(Binary files differ)
Property changes on: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/classic/dot_for_ie.gif
___________________________________________________________________
Added: svn:mime-type
+ image/gif
Added: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/classic/style.css
===================================================================
--- trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/classic/style.css (rev 0)
+++ trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/classic/style.css 2013-03-13 16:30:28 UTC (rev 39)
@@ -0,0 +1,77 @@
+/* %%Ignore-License
+ * jsTree classic theme 1.0
+ * Supported features: dots/no-dots, icons/no-icons, focused, loading
+ * Supported plugins: ui (hovered, clicked), checkbox, contextmenu, search
+ */
+
+.jstree-classic li,
+.jstree-classic ins { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; }
+.jstree-classic li { background-position:-90px 0; background-repeat:repeat-y; }
+.jstree-classic li.jstree-last { background:transparent; }
+.jstree-classic .jstree-open > ins { background-position:-72px 0; }
+.jstree-classic .jstree-closed > ins { background-position:-54px 0; }
+.jstree-classic .jstree-leaf > ins { background-position:-36px 0; }
+
+.jstree-classic .jstree-hovered { background:#e7f4f9; border:1px solid #e7f4f9; padding:0 2px 0 1px; }
+.jstree-classic .jstree-clicked { background:navy; border:1px solid navy; padding:0 2px 0 1px; color:white; }
+.jstree-classic a .jstree-icon { background-position:-56px -19px; }
+.jstree-classic .jstree-open > a .jstree-icon { background-position:-56px -36px; }
+.jstree-classic a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; }
+
+.jstree-classic.jstree-focused { background:white; }
+
+.jstree-classic .jstree-no-dots li,
+.jstree-classic .jstree-no-dots .jstree-leaf > ins { background:transparent; }
+.jstree-classic .jstree-no-dots .jstree-open > ins { background-position:-18px 0; }
+.jstree-classic .jstree-no-dots .jstree-closed > ins { background-position:0 0; }
+
+.jstree-classic .jstree-no-icons a .jstree-icon { display:none; }
+
+.jstree-classic .jstree-search { font-style:italic; }
+
+.jstree-classic .jstree-no-icons .jstree-checkbox { display:inline-block; }
+.jstree-classic .jstree-no-checkboxes .jstree-checkbox { display:none !important; }
+.jstree-classic .jstree-checked > a > .jstree-checkbox { background-position:-38px -19px; }
+.jstree-classic .jstree-unchecked > a > .jstree-checkbox { background-position:-2px -19px; }
+.jstree-classic .jstree-undetermined > a > .jstree-checkbox { background-position:-20px -19px; }
+.jstree-classic .jstree-checked > a > .jstree-checkbox:hover { background-position:-38px -37px; }
+.jstree-classic .jstree-unchecked > a > .jstree-checkbox:hover { background-position:-2px -37px; }
+.jstree-classic .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; }
+
+#vakata-dragged.jstree-classic ins { background:transparent !important; }
+#vakata-dragged.jstree-classic .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; }
+#vakata-dragged.jstree-classic .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; }
+#jstree-marker.jstree-classic { background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px; }
+
+.jstree-classic a.jstree-search { color:aqua; }
+.jstree-classic .jstree-locked a { color:silver; cursor:default; }
+
+#vakata-contextmenu.jstree-classic-context,
+#vakata-contextmenu.jstree-classic-context li ul { background:#f0f0f0; border:1px solid #979797; -moz-box-shadow: 1px 1px 2px #999; -webkit-box-shadow: 1px 1px 2px #999; box-shadow: 1px 1px 2px #999; }
+#vakata-contextmenu.jstree-classic-context li { }
+#vakata-contextmenu.jstree-classic-context a { color:black; }
+#vakata-contextmenu.jstree-classic-context a:hover,
+#vakata-contextmenu.jstree-classic-context .vakata-hover > a { padding:0 5px; background:#e8eff7; border:1px solid #aecff7; color:black; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; }
+#vakata-contextmenu.jstree-classic-context li.jstree-contextmenu-disabled a,
+#vakata-contextmenu.jstree-classic-context li.jstree-contextmenu-disabled a:hover { color:silver; background:transparent; border:0; padding:1px 4px; }
+#vakata-contextmenu.jstree-classic-context li.vakata-separator { background:white; border-top:1px solid #e0e0e0; margin:0; }
+#vakata-contextmenu.jstree-classic-context li ul { margin-left:-4px; }
+
+/* IE6 BEGIN */
+.jstree-classic li,
+.jstree-classic ins,
+#vakata-dragged.jstree-classic .jstree-invalid,
+#vakata-dragged.jstree-classic .jstree-ok,
+#jstree-marker.jstree-classic { _background-image:url("d.gif"); }
+.jstree-classic .jstree-open ins { _background-position:-72px 0; }
+.jstree-classic .jstree-closed ins { _background-position:-54px 0; }
+.jstree-classic .jstree-leaf ins { _background-position:-36px 0; }
+.jstree-classic .jstree-open a ins.jstree-icon { _background-position:-56px -36px; }
+.jstree-classic .jstree-closed a ins.jstree-icon { _background-position:-56px -19px; }
+.jstree-classic .jstree-leaf a ins.jstree-icon { _background-position:-56px -19px; }
+#vakata-contextmenu.jstree-classic-context ins { _display:none; }
+#vakata-contextmenu.jstree-classic-context li { _zoom:1; }
+.jstree-classic .jstree-undetermined a .jstree-checkbox { _background-position:-20px -19px; }
+.jstree-classic .jstree-checked a .jstree-checkbox { _background-position:-38px -19px; }
+.jstree-classic .jstree-unchecked a .jstree-checkbox { _background-position:-2px -19px; }
+/* IE6 END */
\ No newline at end of file
Added: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/classic/throbber.gif
===================================================================
(Binary files differ)
Property changes on: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/classic/throbber.gif
___________________________________________________________________
Added: svn:mime-type
+ image/gif
Added: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default/d.gif
===================================================================
(Binary files differ)
Property changes on: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default/d.gif
___________________________________________________________________
Added: svn:mime-type
+ image/gif
Deleted: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default/dots_rtl.gif
===================================================================
(Binary files differ)
Modified: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default/style.css
===================================================================
--- trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default/style.css 2013-03-13 15:39:21 UTC (rev 38)
+++ trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default/style.css 2013-03-13 16:30:28 UTC (rev 39)
@@ -1,66 +1,74 @@
/* %%Ignore-License
- * jsTree default theme 2.0.0
- * Supported features: dots/no-dots, icons/no-icons, loading, clicked, hovered, checkbox, search
- */
+ * jsTree default theme 1.0
+ * Supported features: dots/no-dots, icons/no-icons, focused, loading
+ * Supported plugins: ui (hovered, clicked), checkbox, contextmenu, search
+ */
.jstree-default li,
-.jstree-default i { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; }
+.jstree-default ins { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; }
.jstree-default li { background-position:-90px 0; background-repeat:repeat-y; }
.jstree-default li.jstree-last { background:transparent; }
-.jstree-default .jstree-open > .jstree-ocl { background-position:-72px 0; }
-.jstree-default .jstree-closed > .jstree-ocl { background-position:-54px 0; }
-.jstree-default .jstree-leaf > .jstree-ocl { background-position:-36px 0; }
-.jstree-default .jstree-loading > .jstree-ocl { background:url("throbber.gif") center center no-repeat !important; }
+.jstree-default .jstree-open > ins { background-position:-72px 0; }
+.jstree-default .jstree-closed > ins { background-position:-54px 0; }
+.jstree-default .jstree-leaf > ins { background-position:-36px 0; }
-.jstree-default .jstree-hovered { background:#e7f4f9; border:1px solid #d8f0fa; padding:0 2px 0 1px; border-radius:2px; }
-.jstree-default .jstree-clicked { background:#beebff; border:1px solid #99defd; padding:0 2px 0 1px; border-radius:2px; }
+.jstree-default .jstree-hovered { background:#e7f4f9; border:1px solid #d8f0fa; padding:0 2px 0 1px; }
+.jstree-default .jstree-clicked { background:#beebff; border:1px solid #99defd; padding:0 2px 0 1px; }
+.jstree-default a .jstree-icon { background-position:-56px -19px; }
+.jstree-default a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; }
-.jstree-default .jstree-anchor > .jstree-themeicon { background-position:-56px -19px; }
+.jstree-default.jstree-focused { background:#ffffee; }
.jstree-default .jstree-no-dots li,
-.jstree-default .jstree-no-dots .jstree-leaf > .jstree-ocl { background:transparent; }
-.jstree-default .jstree-no-dots .jstree-open > .jstree-ocl { background-position:-18px 0; }
-.jstree-default .jstree-no-dots .jstree-closed > .jstree-ocl { background-position:0 0; }
+.jstree-default .jstree-no-dots .jstree-leaf > ins { background:transparent; }
+.jstree-default .jstree-no-dots .jstree-open > ins { background-position:-18px 0; }
+.jstree-default .jstree-no-dots .jstree-closed > ins { background-position:0 0; }
-.jstree-default > .jstree-wholerow-ul .jstree-hovered,
-.jstree-default > .jstree-wholerow-ul .jstree-clicked { background:transparent; border:0; padding:1px 2px; border-radius:0; }
+.jstree-default .jstree-no-icons a .jstree-icon { display:none; }
-.jstree-default > .jstree-wholerow-ul .jstree-wholerow-hovered { background:#e7f4f9; }
-.jstree-default > .jstree-wholerow-ul .jstree-wholerow-clicked { background:#beebff; }
+.jstree-default .jstree-search { font-style:italic; }
-.jstree-default .jstree-no-icons .jstree-anchor > .jstree-themeicon { display:none; }
-
-.jstree-default .jstree-search { font-style:italic; color:aqua; }
-
+.jstree-default .jstree-no-icons .jstree-checkbox { display:inline-block; }
.jstree-default .jstree-no-checkboxes .jstree-checkbox { display:none !important; }
+.jstree-default .jstree-checked > a > .jstree-checkbox { background-position:-38px -19px; }
+.jstree-default .jstree-unchecked > a > .jstree-checkbox { background-position:-2px -19px; }
+.jstree-default .jstree-undetermined > a > .jstree-checkbox { background-position:-20px -19px; }
+.jstree-default .jstree-checked > a > .jstree-checkbox:hover { background-position:-38px -37px; }
+.jstree-default .jstree-unchecked > a > .jstree-checkbox:hover { background-position:-2px -37px; }
+.jstree-default .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; }
-.jstree-default .jstree-checkbox { background-position:-2px -19px; }
-.jstree-default .jstree-checkbox:hover { background-position:-2px -37px; }
-.jstree-default .jstree-clicked > .jstree-checkbox { background-position:-38px -19px; }
-.jstree-default .jstree-clicked > .jstree-checkbox:hover { background-position:-38px -37px; }
-.jstree-default.jstree-checkbox-no-clicked .jstree-clicked { background:transparent; border:0; padding:1px 2px; }
-.jstree-default.jstree-checkbox-no-clicked .jstree-clicked.jstree-hovered { background:#e7f4f9; border:1px solid #d8f0fa; padding:0 2px 0 1px; border-radius:2px; }
-.jstree-default.jstree-checkbox-no-clicked > .jstree-wholerow-ul .jstree-wholerow-clicked { background:transparent; }
-.jstree-default.jstree-checkbox-no-clicked > .jstree-wholerow-ul .jstree-wholerow-clicked.jstree-wholerow-hovered { background:#e7f4f9; }
-
-.jstree-default .jstree-anchor .jstree-undetermined { background-position:-20px -19px; }
-.jstree-default .jstree-anchor .jstree-undetermined:hover { background-position:-20px -37px; }
-
-#jstree-dnd.jstree-default i { background:transparent; }
-#jstree-dnd.jstree-default .jstree-ok { background:url("d.png") -2px -53px no-repeat; }
-#jstree-dnd.jstree-default .jstree-er { background:url("d.png") -18px -53px no-repeat; }
-
+#vakata-dragged.jstree-default ins { background:transparent !important; }
+#vakata-dragged.jstree-default .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; }
+#vakata-dragged.jstree-default .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; }
#jstree-marker.jstree-default { background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px; }
-/* RTL PART */
-.jstree-rtl.jstree-default .jstree-hovered,
-.jstree-rtl.jstree-default .jstree-clicked { padding:0 1px 0 2px; }
-.jstree-rtl.jstree-default li { background-image:url("dots_rtl.gif"); background-position: 100% 0px; }
+.jstree-default a.jstree-search { color:aqua; }
+.jstree-default .jstree-locked a { color:silver; cursor:default; }
-.jstree-rtl.jstree-default .jstree-checkbox { background-position:0px -19px; margin-left:2px; }
-.jstree-rtl.jstree-default .jstree-checkbox:hover { background-position:0px -37px; }
-.jstree-rtl.jstree-default .jstree-clicked > .jstree-checkbox { background-position:-36px -19px; }
-.jstree-rtl.jstree-default .jstree-clicked > .jstree-checkbox:hover { background-position:-36px -37px; }
+#vakata-contextmenu.jstree-default-context,
+#vakata-contextmenu.jstree-default-context li ul { background:#f0f0f0; border:1px solid #979797; -moz-box-shadow: 1px 1px 2px #999; -webkit-box-shadow: 1px 1px 2px #999; box-shadow: 1px 1px 2px #999; }
+#vakata-contextmenu.jstree-default-context li { }
+#vakata-contextmenu.jstree-default-context a { color:black; }
+#vakata-contextmenu.jstree-default-context a:hover,
+#vakata-contextmenu.jstree-default-context .vakata-hover > a { padding:0 5px; background:#e8eff7; border:1px solid #aecff7; color:black; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; }
+#vakata-contextmenu.jstree-default-context li.jstree-contextmenu-disabled a,
+#vakata-contextmenu.jstree-default-context li.jstree-contextmenu-disabled a:hover { color:silver; background:transparent; border:0; padding:1px 4px; }
+#vakata-contextmenu.jstree-default-context li.vakata-separator { background:white; border-top:1px solid #e0e0e0; margin:0; }
+#vakata-contextmenu.jstree-default-context li ul { margin-left:-4px; }
-.jstree-rtl.jstree-default .jstree-anchor .jstree-undetermined { background-position:-18px -19px; }
-.jstree-rtl.jstree-default .jstree-anchor .jstree-undetermined:hover { background-position:-18px -37px; }
\ No newline at end of file
+/* IE6 BEGIN */
+.jstree-default li,
+.jstree-default ins,
+#vakata-dragged.jstree-default .jstree-invalid,
+#vakata-dragged.jstree-default .jstree-ok,
+#jstree-marker.jstree-default { _background-image:url("d.gif"); }
+.jstree-default .jstree-open ins { _background-position:-72px 0; }
+.jstree-default .jstree-closed ins { _background-position:-54px 0; }
+.jstree-default .jstree-leaf ins { _background-position:-36px 0; }
+.jstree-default a ins.jstree-icon { _background-position:-56px -19px; }
+#vakata-contextmenu.jstree-default-context ins { _display:none; }
+#vakata-contextmenu.jstree-default-context li { _zoom:1; }
+.jstree-default .jstree-undetermined a .jstree-checkbox { _background-position:-20px -19px; }
+.jstree-default .jstree-checked a .jstree-checkbox { _background-position:-38px -19px; }
+.jstree-default .jstree-unchecked a .jstree-checkbox { _background-position:-2px -19px; }
+/* IE6 END */
\ No newline at end of file
Added: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default-rtl/d.gif
===================================================================
(Binary files differ)
Property changes on: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default-rtl/d.gif
___________________________________________________________________
Added: svn:mime-type
+ image/gif
Added: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default-rtl/d.png
===================================================================
(Binary files differ)
Property changes on: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default-rtl/d.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default-rtl/dots.gif
===================================================================
(Binary files differ)
Property changes on: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default-rtl/dots.gif
___________________________________________________________________
Added: svn:mime-type
+ image/gif
Added: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default-rtl/style.css
===================================================================
--- trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default-rtl/style.css (rev 0)
+++ trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default-rtl/style.css 2013-03-13 16:30:28 UTC (rev 39)
@@ -0,0 +1,84 @@
+/* %%Ignore-License
+ * jsTree default-rtl theme 1.0
+ * Supported features: dots/no-dots, icons/no-icons, focused, loading
+ * Supported plugins: ui (hovered, clicked), checkbox, contextmenu, search
+ */
+
+.jstree-default-rtl li,
+.jstree-default-rtl ins { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; }
+.jstree-default-rtl li { background-position:-90px 0; background-repeat:repeat-y; }
+.jstree-default-rtl li.jstree-last { background:transparent; }
+.jstree-default-rtl .jstree-open > ins { background-position:-72px 0; }
+.jstree-default-rtl .jstree-closed > ins { background-position:-54px 0; }
+.jstree-default-rtl .jstree-leaf > ins { background-position:-36px 0; }
+
+.jstree-default-rtl .jstree-hovered { background:#e7f4f9; border:1px solid #d8f0fa; padding:0 2px 0 1px; }
+.jstree-default-rtl .jstree-clicked { background:#beebff; border:1px solid #99defd; padding:0 2px 0 1px; }
+.jstree-default-rtl a .jstree-icon { background-position:-56px -19px; }
+.jstree-default-rtl a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; }
+
+.jstree-default-rtl.jstree-focused { background:#ffffee; }
+
+.jstree-default-rtl .jstree-no-dots li,
+.jstree-default-rtl .jstree-no-dots .jstree-leaf > ins { background:transparent; }
+.jstree-default-rtl .jstree-no-dots .jstree-open > ins { background-position:-18px 0; }
+.jstree-default-rtl .jstree-no-dots .jstree-closed > ins { background-position:0 0; }
+
+.jstree-default-rtl .jstree-no-icons a .jstree-icon { display:none; }
+
+.jstree-default-rtl .jstree-search { font-style:italic; }
+
+.jstree-default-rtl .jstree-no-icons .jstree-checkbox { display:inline-block; }
+.jstree-default-rtl .jstree-no-checkboxes .jstree-checkbox { display:none !important; }
+.jstree-default-rtl .jstree-checked > a > .jstree-checkbox { background-position:-38px -19px; }
+.jstree-default-rtl .jstree-unchecked > a > .jstree-checkbox { background-position:-2px -19px; }
+.jstree-default-rtl .jstree-undetermined > a > .jstree-checkbox { background-position:-20px -19px; }
+.jstree-default-rtl .jstree-checked > a > .jstree-checkbox:hover { background-position:-38px -37px; }
+.jstree-default-rtl .jstree-unchecked > a > .jstree-checkbox:hover { background-position:-2px -37px; }
+.jstree-default-rtl .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; }
+
+#vakata-dragged.jstree-default-rtl ins { background:transparent !important; }
+#vakata-dragged.jstree-default-rtl .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; }
+#vakata-dragged.jstree-default-rtl .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; }
+#jstree-marker.jstree-default-rtl { background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px; }
+
+.jstree-default-rtl a.jstree-search { color:aqua; }
+.jstree-default-rtl .jstree-locked a { color:silver; cursor:default; }
+
+#vakata-contextmenu.jstree-default-rtl-context,
+#vakata-contextmenu.jstree-default-rtl-context li ul { background:#f0f0f0; border:1px solid #979797; -moz-box-shadow: 1px 1px 2px #999; -webkit-box-shadow: 1px 1px 2px #999; box-shadow: 1px 1px 2px #999; }
+#vakata-contextmenu.jstree-default-rtl-context li { }
+#vakata-contextmenu.jstree-default-rtl-context a { color:black; }
+#vakata-contextmenu.jstree-default-rtl-context a:hover,
+#vakata-contextmenu.jstree-default-rtl-context .vakata-hover > a { padding:0 5px; background:#e8eff7; border:1px solid #aecff7; color:black; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; }
+#vakata-contextmenu.jstree-default-rtl-context li.jstree-contextmenu-disabled a,
+#vakata-contextmenu.jstree-default-rtl-context li.jstree-contextmenu-disabled a:hover { color:silver; background:transparent; border:0; padding:1px 4px; }
+#vakata-contextmenu.jstree-default-rtl-context li.vakata-separator { background:white; border-top:1px solid #e0e0e0; margin:0; }
+#vakata-contextmenu.jstree-default-rtl-context li ul { margin-left:-4px; }
+
+/* IE6 BEGIN */
+.jstree-default-rtl li,
+.jstree-default-rtl ins,
+#vakata-dragged.jstree-default-rtl .jstree-invalid,
+#vakata-dragged.jstree-default-rtl .jstree-ok,
+#jstree-marker.jstree-default-rtl { _background-image:url("d.gif"); }
+.jstree-default-rtl .jstree-open ins { _background-position:-72px 0; }
+.jstree-default-rtl .jstree-closed ins { _background-position:-54px 0; }
+.jstree-default-rtl .jstree-leaf ins { _background-position:-36px 0; }
+.jstree-default-rtl a ins.jstree-icon { _background-position:-56px -19px; }
+#vakata-contextmenu.jstree-default-rtl-context ins { _display:none; }
+#vakata-contextmenu.jstree-default-rtl-context li { _zoom:1; }
+.jstree-default-rtl .jstree-undetermined a .jstree-checkbox { _background-position:-18px -19px; }
+.jstree-default-rtl .jstree-checked a .jstree-checkbox { _background-position:-36px -19px; }
+.jstree-default-rtl .jstree-unchecked a .jstree-checkbox { _background-position:0px -19px; }
+/* IE6 END */
+
+/* RTL part */
+.jstree-default-rtl .jstree-hovered, .jstree-default-rtl .jstree-clicked { padding:0 1px 0 2px; }
+.jstree-default-rtl li { background-image:url("dots.gif"); background-position: 100% 0px; }
+.jstree-default-rtl .jstree-checked > a > .jstree-checkbox { background-position:-36px -19px; margin-left:2px; }
+.jstree-default-rtl .jstree-unchecked > a > .jstree-checkbox { background-position:0px -19px; margin-left:2px; }
+.jstree-default-rtl .jstree-undetermined > a > .jstree-checkbox { background-position:-18px -19px; margin-left:2px; }
+.jstree-default-rtl .jstree-checked > a > .jstree-checkbox:hover { background-position:-36px -37px; }
+.jstree-default-rtl .jstree-unchecked > a > .jstree-checkbox:hover { background-position:0px -37px; }
+.jstree-default-rtl .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-18px -37px; }
\ No newline at end of file
Added: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default-rtl/throbber.gif
===================================================================
(Binary files differ)
Property changes on: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default-rtl/throbber.gif
___________________________________________________________________
Added: svn:mime-type
+ image/gif
1
0
Author: echatellier
Date: 2013-03-13 16:39:21 +0100 (Wed, 13 Mar 2013)
New Revision: 38
Url: http://nuiton.org/projects/nuiton-js/repository/revisions/38
Log:
Don't attach sources
Modified:
trunk/nuiton-js-lib/pom.xml
Modified: trunk/nuiton-js-lib/pom.xml
===================================================================
(Binary files differ)
1
0
r37 - trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins
by echatellier@users.nuiton.org March 13, 2013
by echatellier@users.nuiton.org March 13, 2013
March 13, 2013
Author: echatellier
Date: 2013-03-13 16:39:07 +0100 (Wed, 13 Mar 2013)
New Revision: 37
Url: http://nuiton.org/projects/nuiton-js/repository/revisions/37
Log:
Add %%Ignore-License tag for license
Modified:
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.BezierCurveRenderer.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.barRenderer.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.blockRenderer.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.bubbleRenderer.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasAxisLabelRenderer.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasAxisTickRenderer.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasOverlay.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasTextRenderer.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.categoryAxisRenderer.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.ciParser.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.cursor.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.dateAxisRenderer.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.donutRenderer.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.dragable.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.enhancedLegendRenderer.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.funnelRenderer.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.highlighter.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.json2.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.logAxisRenderer.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.mekkoAxisRenderer.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.mekkoRenderer.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.meterGaugeRenderer.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.mobile.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.ohlcRenderer.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pieRenderer.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pointLabels.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pyramidAxisRenderer.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pyramidGridRenderer.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pyramidRenderer.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.trendline.js
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.BezierCurveRenderer.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.BezierCurveRenderer.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.BezierCurveRenderer.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.barRenderer.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.barRenderer.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.barRenderer.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.blockRenderer.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.blockRenderer.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.blockRenderer.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.bubbleRenderer.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.bubbleRenderer.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.bubbleRenderer.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasAxisLabelRenderer.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasAxisLabelRenderer.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasAxisLabelRenderer.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasAxisTickRenderer.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasAxisTickRenderer.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasAxisTickRenderer.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasOverlay.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasOverlay.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasOverlay.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasTextRenderer.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasTextRenderer.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasTextRenderer.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.categoryAxisRenderer.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.categoryAxisRenderer.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.categoryAxisRenderer.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.ciParser.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.ciParser.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.ciParser.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.cursor.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.cursor.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.cursor.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.dateAxisRenderer.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.dateAxisRenderer.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.dateAxisRenderer.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.donutRenderer.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.donutRenderer.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.donutRenderer.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.dragable.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.dragable.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.dragable.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.enhancedLegendRenderer.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.enhancedLegendRenderer.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.enhancedLegendRenderer.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.funnelRenderer.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.funnelRenderer.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.funnelRenderer.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.highlighter.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.highlighter.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.highlighter.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.json2.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.json2.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.json2.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/*
+/* %%Ignore-License
2010-11-01 Chris Leonello
Slightly modified version of the original json2.js to put JSON
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.logAxisRenderer.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.logAxisRenderer.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.logAxisRenderer.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.mekkoAxisRenderer.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.mekkoAxisRenderer.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.mekkoAxisRenderer.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.mekkoRenderer.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.mekkoRenderer.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.mekkoRenderer.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.meterGaugeRenderer.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.meterGaugeRenderer.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.meterGaugeRenderer.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.mobile.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.mobile.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.mobile.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqplot.jquerymobile plugin
* jQuery Mobile virtual event support.
*
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.ohlcRenderer.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.ohlcRenderer.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.ohlcRenderer.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pieRenderer.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pieRenderer.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pieRenderer.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pointLabels.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pointLabels.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pointLabels.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pyramidAxisRenderer.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pyramidAxisRenderer.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pyramidAxisRenderer.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pyramidGridRenderer.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pyramidGridRenderer.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pyramidGridRenderer.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pyramidRenderer.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pyramidRenderer.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pyramidRenderer.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.trendline.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.trendline.js 2013-03-13 15:28:42 UTC (rev 36)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/plugins/jqplot.trendline.js 2013-03-13 15:39:07 UTC (rev 37)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
1
0
March 13, 2013
Author: echatellier
Date: 2013-03-13 16:28:42 +0100 (Wed, 13 Mar 2013)
New Revision: 36
Url: http://nuiton.org/projects/nuiton-js/repository/revisions/36
Log:
Add %%Ignore-License tag for license
Added:
trunk/nuiton-js-jqgrid/.classpath
Modified:
trunk/nuiton-js-bootstrap/src/main/resources/nuiton-js-bootstrap/css/bootstrap-responsive.css
trunk/nuiton-js-bootstrap/src/main/resources/nuiton-js-bootstrap/css/bootstrap.css
trunk/nuiton-js-bootstrap/src/main/resources/nuiton-js-bootstrap/js/bootstrap.js
trunk/nuiton-js-font-awesome/src/main/resources/nuiton-js-font-awesome/css/font-awesome.css
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/css/ellipsis-xbl.xml
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/css/ui.jqgrid.css
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ar.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-bg.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-bg1251.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-cat.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-cn.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-cs.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-da.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-de.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-dk.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-el.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-en.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-es.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-fa.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-fi.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-fr.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-gl.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-he.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-hr.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-hr1250.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-hu.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-is.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-it.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ja.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-kr.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-lt.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-mne.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-nl.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-no.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-pl.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-pt-br.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-pt.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ro.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ru.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sk.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sr-latin.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sr.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sv.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-th.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-tr.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-tw.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ua.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/jquery.jqGrid.src.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/grid.addons.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/grid.postext.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/grid.setcolumns.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/jquery.contextmenu.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/jquery.searchFilter.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/jquery.tablednd.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/searchFilter.css
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/ui.multiselect.css
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/ui.multiselect.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/excanvas.js
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/jquery.jqplot.css
trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/jquery.jqplot.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/base/jquery-ui.css
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/black-tie/jquery-ui-1.9.2.custom.css
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/blitzer/jquery-ui-1.9.2.custom.css
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/cupertino/jquery-ui-1.9.2.custom.css
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/dark-hive/jquery-ui-1.9.2.custom.css
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/dot-luv/jquery-ui-1.9.2.custom.css
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/eggplant/jquery-ui-1.9.2.custom.css
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/excite-bike/jquery-ui-1.9.2.custom.css
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/flick/jquery-ui-1.9.2.custom.css
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/hot-sneaks/jquery-ui-1.9.2.custom.css
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/humanity/jquery-ui-1.9.2.custom.css
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/le-frog/jquery-ui-1.9.2.custom.css
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/mint-choc/jquery-ui-1.9.2.custom.css
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/no-theme/jquery-ui-1.9.2.custom.css
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/overcast/jquery-ui-1.9.2.custom.css
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/pepper-grinder/jquery-ui-1.9.2.custom.css
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/redmond/jquery-ui-1.9.2.custom.css
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/smoothness/jquery-ui-1.9.2.custom.css
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/south-street/jquery-ui-1.9.2.custom.css
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/start/jquery-ui-1.9.2.custom.css
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/sunny/jquery-ui-1.9.2.custom.css
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/swanky-purse/jquery-ui-1.9.2.custom.css
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/trontastic/jquery-ui-1.9.2.custom.css
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/ui-darkness/jquery-ui-1.9.2.custom.css
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/ui-lightness/jquery-ui-1.9.2.custom.css
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/vader/jquery-ui-1.9.2.custom.css
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery-ui-i18n.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-af.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ar-DZ.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ar.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-az.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-bg.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-bs.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ca.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-cs.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-cy-GB.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-da.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-de.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-el.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-en-AU.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-en-GB.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-en-NZ.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-eo.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-es.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-et.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-eu.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-fa.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-fi.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-fo.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-fr-CH.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-fr.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-gl.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-he.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-hi.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-hr.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-hu.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-hy.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-id.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-is.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-it.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ja.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ka.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-kk.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-km.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ko.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-lb.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-lt.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-lv.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-mk.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ml.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ms.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-nl-BE.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-nl.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-no.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-pl.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-pt-BR.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-pt.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-rm.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ro.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ru.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sk.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sl.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sq.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sr-SR.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sr.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sv.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ta.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-th.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-tj.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-tr.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-uk.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-vi.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-zh-CN.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-zh-HK.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-zh-TW.js
trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/jquery-ui-1.9.2.custom.js
trunk/nuiton-js-jquery/src/main/resources/nuiton-js-jquery/jquery-1.8.3.js
trunk/nuiton-js-lib/src/site/resources/announcement/release-email-announcement.vm
trunk/nuiton-js-lib/src/site/resources/announcement/release-news-announcement.vm
Modified: trunk/nuiton-js-bootstrap/src/main/resources/nuiton-js-bootstrap/css/bootstrap-responsive.css
===================================================================
--- trunk/nuiton-js-bootstrap/src/main/resources/nuiton-js-bootstrap/css/bootstrap-responsive.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-bootstrap/src/main/resources/nuiton-js-bootstrap/css/bootstrap-responsive.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*!
+/*! %%Ignore-License
* Bootstrap Responsive v2.2.2
*
* Copyright 2012 Twitter, Inc
Modified: trunk/nuiton-js-bootstrap/src/main/resources/nuiton-js-bootstrap/css/bootstrap.css
===================================================================
--- trunk/nuiton-js-bootstrap/src/main/resources/nuiton-js-bootstrap/css/bootstrap.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-bootstrap/src/main/resources/nuiton-js-bootstrap/css/bootstrap.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*!
+/*! %%Ignore-License
* Bootstrap v2.2.2
*
* Copyright 2012 Twitter, Inc
Modified: trunk/nuiton-js-bootstrap/src/main/resources/nuiton-js-bootstrap/js/bootstrap.js
===================================================================
--- trunk/nuiton-js-bootstrap/src/main/resources/nuiton-js-bootstrap/js/bootstrap.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-bootstrap/src/main/resources/nuiton-js-bootstrap/js/bootstrap.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,5 @@
-/* ===================================================
+/* %%Ignore-License
+ * ===================================================
* bootstrap-transition.js v2.2.2
* http://twitter.github.com/bootstrap/javascript.html#transitions
* ===================================================
Modified: trunk/nuiton-js-font-awesome/src/main/resources/nuiton-js-font-awesome/css/font-awesome.css
===================================================================
--- trunk/nuiton-js-font-awesome/src/main/resources/nuiton-js-font-awesome/css/font-awesome.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-font-awesome/src/main/resources/nuiton-js-font-awesome/css/font-awesome.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*!
+/*! %%Ignore-License
* Font Awesome 3.0.2
* the iconic font designed for use with Twitter Bootstrap
* -------------------------------------------------------
Added: trunk/nuiton-js-jqgrid/.classpath
===================================================================
(Binary files differ)
Property changes on: trunk/nuiton-js-jqgrid/.classpath
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/css/ellipsis-xbl.xml
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/css/ellipsis-xbl.xml 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/css/ellipsis-xbl.xml 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,5 @@
<?xml version="1.0"?>
+<!-- %%Ignore-License -->
<bindings
xmlns="http://www.mozilla.org/xbl"
xmlns:xbl="http://www.mozilla.org/xbl"
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/css/ui.jqgrid.css
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/css/ui.jqgrid.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/css/ui.jqgrid.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*Grid*/
+/*%%Ignore-License Grid*/
.ui-jqgrid {position: relative;}
.ui-jqgrid .ui-jqgrid-view {position: relative;left:0px; top: 0px; padding: .0em; font-size:11px;}
/* caption*/
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ar.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ar.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ar.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Arabic Translation
*
* http://trirand.com/blog/
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-bg.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-bg.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-bg.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Bulgarian Translation
* Tony Tomov tony(a)trirand.com
* http://trirand.com/blog/
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-bg1251.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-bg1251.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-bg1251.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Bulgarian Translation
* Tony Tomov tony(a)trirand.com
* http://trirand.com/blog/
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-cat.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-cat.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-cat.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Catalan Translation
* Traducció jqGrid en Catatà per Faserline, S.L.
* http://www.faserline.com
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-cn.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-cn.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-cn.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Chinese Translation for v4.2
* henryyan 2011.11.30
* http://www.wsria.com
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-cs.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-cs.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-cs.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Czech Translation
* Pavel Jirak pavel.jirak(a)jipas.cz
* doplnil Thomas Wagner xwagne01(a)stud.fit.vutbr.cz
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-da.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-da.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-da.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Danish Translation
* Aesiras A/S
* http://www.aesiras.dk
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-de.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-de.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-de.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid German Translation
* Version 1.0.0 (developed for jQuery Grid 3.3.1)
* Olaf Klöppel opensource(a)blue-hit.de
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-dk.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-dk.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-dk.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Danish Translation
* Kaare Rasmussen kjs(a)jasonic.dk
* http://jasonic.dk/blog
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-el.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-el.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-el.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Greek (el) Translation
* Alex Cicovic
* http://www.alexcicovic.com
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-en.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-en.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-en.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid English Translation
* Tony Tomov tony(a)trirand.com
* http://trirand.com/blog/
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-es.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-es.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-es.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Spanish Translation
* Traduccion jqGrid en Español por Yamil Bracho
* Traduccion corregida y ampliada por Faserline, S.L.
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-fa.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-fa.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-fa.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function ($) {
/**
+ * %%Ignore-License
* jqGrid Persian Translation
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-fi.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-fi.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-fi.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid (fi) Finnish Translation
* Jukka Inkeri awot.fi 2010-05-19
* Alex Grönholm alex.gronholm(a)nextday.fi 2011-05-18
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-fr.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-fr.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-fr.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid French Translation
* Tony Tomov tony(a)trirand.com
* http://trirand.com/blog/
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-gl.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-gl.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-gl.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Galician Translation
* Translated by Jorge Barreiro <yortx.barry(a)gmail.com>
* Dual licensed under the MIT and GPL licenses:
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-he.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-he.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-he.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Hebrew Translation
* Shuki Shukrun shukrun.shuki(a)gmail.com
* http://trirand.com/blog/
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-hr.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-hr.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-hr.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Translation
* Tony Tomov tony(a)trirand.com
* http://trirand.com/blog/
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-hr1250.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-hr1250.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-hr1250.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Translation
* Tony Tomov tony(a)trirand.com
* http://trirand.com/blog/
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-hu.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-hu.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-hu.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Hungarian Translation
* Őrszigety Ádám udx6bs(a)freemail.hu
* http://trirand.com/blog/
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-is.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-is.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-is.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Icelandic Translation
* jtm(a)hi.is Univercity of Iceland
* Dual licensed under the MIT and GPL licenses:
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-it.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-it.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-it.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1 +1,2 @@
+/** %%Ignore-License */
(function(a){a.jgrid = a.jgrid || {};a.extend(a.jgrid,{ defaults:{recordtext:"Visualizzati {0} - {1} di {2}",emptyrecords:"Nessun record da visualizzare",loadtext:"Caricamento...",pgtext:"Pagina {0} di {1}"},search:{caption:"Ricerca...",Find:"Cerca",Reset:"Pulisci",odata:["uguale","diverso","minore","minore o uguale","maggiore","maggiore o uguale","inizia con","non inizia con","in","non in","termina con","non termina con","contiene","non contiene"],groupOps:[{op:"AND",text:"tutto"},{op:"OR",text:"almeno uno"}],matchText:" corrisponde",rulesText:" regole"},edit:{addCaption:"Aggiungi Record",editCaption:"Modifica Record",bSubmit:"Invia",bCancel:"Chiudi",bClose:"Chiudi",saveData:"Alcuni dati modificati! Salvare i cambiamenti?",bYes:"Si",bNo:"No",bExit:"Esci",msg:{required:"Campo richiesto",number:"Per favore, inserisci un valore valido",minValue:"il valore deve essere maggiore o uguale a ",maxValue:"il valore deve essere minore o uguale a",email:"e-mail non corretta",integer:"Per favore, inserisci un numero intero valido",date:"Per favore, inserisci una data valida",url:"URL non valido. Prefisso richiesto ('http://' or 'https://')",nodefined:" non � definito!",novalue:" valore di ritorno richiesto!",customarray:"La function custon deve tornare un array!",customfcheck:"La function custom deve esistere per il custom checking!"}},view:{caption:"Visualizzazione Record",bClose:"Chiudi"},del:{caption:"Cancella",msg:"Cancellare record selezionato/i?",bSubmit:"Cancella",bCancel:"Annulla"},nav:{edittext:" ",edittitle:"Modifica record selezionato",addtext:" ",addtitle:"Aggiungi nuovo record",deltext:" ",deltitle:"Cancella record selezionato",searchtext:" ",searchtitle:"Ricerca record",refreshtext:"",refreshtitle:"Aggiorna griglia",alertcap:"Attenzione",alerttext:"Per favore, seleziona un record",viewtext:"",viewtitle:"Visualizza riga selezionata"},col:{caption:"Mostra/Nascondi Colonne",bSubmit:"Invia",bCancel:"Annulla"},errors:{errcap:"Errore",nourl:"Url non settata",norecords:"Nessun record da elaborare",model:"Lunghezza di colNames <> colModel!"},formatter:{integer:{thousandsSeparator:" ",defaultValue:"0"},number:{decimalSeparator:",",thousandsSeparator:" ",decimalPlaces:2,defaultValue:"0,00"},currency:{decimalSeparator:",",thousandsSeparator:" ",decimalPlaces:2,prefix:"",suffix:"",defaultValue:"0,00"},date:{dayNames:["Dom","Lun","Mar","Mer","Gio","Ven","Sab","Domenica","Luned�","Marted�","Mercoled�","Gioved�","Venerd�","Sabato"],monthNames:["Gen","Feb","Mar","Apr","Mag","Gui","Lug","Ago","Set","Ott","Nov","Dic","Genneio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Movembre","Dicembre"],AmPm:["am","pm","AM","PM"],S:function(b){return b<11||b>13?["st","nd","rd","th"][Math.min((b-1)%10,3)]:"th"},srcformat:"Y-m-d",newformat:"d/m/Y",masks:{ISO8601Long:"Y-m-d H:i:s",ISO8601Short:"Y-m-d",ShortDate:"n/j/Y",LongDate:"l, F d, Y",FullDateTime:"l, F d, Y g:i:s A",MonthDay:"F d",ShortTime:"g:i A",LongTime:"g:i:s A",SortableDateTime:"Y-m-d\\TH:i:s",UniversalSortableDateTime:"Y-m-d H:i:sO",YearMonth:"F, Y"},reformatAfterEdit:false},baseLinkUrl:"",showAction:"",target:"",checkbox:{disabled:true},idName:"id"}});})(jQuery);
\ No newline at end of file
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ja.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ja.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ja.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Japanese Translation
* OKADA Yoshitada okada.dev(a)sth.jp
* http://trirand.com/blog/
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-kr.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-kr.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-kr.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid English Translation
* Tony Tomov tony(a)trirand.com
* http://trirand.com/blog/
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-lt.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-lt.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-lt.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Lithuanian Translation
* aur1mas aur1mas(a)devnet.lt
* http://aur1mas.devnet.lt
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-mne.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-mne.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-mne.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Montenegrian Translation
* Bild Studio info(a)bild-studio.net
* http://www.bild-studio.com
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-nl.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-nl.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-nl.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,3 +1,4 @@
+/**%%Ignore-License */
(function(a) {
a.jgrid = a.jgrid || {};
a.extend(a.jgrid,{
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-no.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-no.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-no.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1 +1,2 @@
+/** %%Ignore-License */
(function(a){a.jgrid= a.jgrid || {};a.jgrid.defaults={recordtext:"Rad {0} - {1}, totalt {2}",loadtext:"Laster...",pgtext:"Side {0} av {1}"};a.jgrid.search={caption:"S�k...",Find:"Finn",Reset:"Nullstill",odata:["lik","forskjellig fra","mindre enn","mindre eller lik","st�rre enn"," st�rre eller lik","starter med","slutter med","inneholder"]};a.jgrid.edit={addCaption:"Ny rad",editCaption:"Rediger",bSubmit:"Send",bCancel:"Avbryt",bClose:"Lukk",processData:"Laster...",msg:{required:"Felt er obligatorisk",number:"Legg inn et gyldig tall",minValue:"verdi m� v�re st�rre enn eller lik",maxValue:"verdi m� v�re mindre enn eller lik",email:"er ikke en gyldig e-post adresse",integer:"Legg inn et gyldig heltall",date:"Legg inn en gyldig dato",url:"er ikke en gyldig URL. Prefiks p�krevd ('http://' eller 'https://')",nodefined:" er ikke definert!",novalue:" returverdi er p�krevd!",customarray:"Tilpasset funksjon m� returnere en tabell!",customfcheck:"Tilpasset funksjon m� eksistere!"}};a.jgrid.view={caption:"�pne post",bClose:"Lukk"};a.jgrid.del={caption:"Slett",msg:"Slett valgte rad(er)?",bSubmit:"Slett",bCancel:"Avbryt",processData:"Behandler..."};a.jgrid.nav={edittext:" ",edittitle:"Rediger valgte rad(er)",addtext:" ",addtitle:"Legg til ny rad",deltext:" ",deltitle:"Slett valgte rad(er)",searchtext:" ",searchtitle:"S�k",refreshtext:"",refreshtitle:"Oppdater tabell",alertcap:"Advarsel",alerttext:"Velg rad",viewtext:" ",viewtitle:"�pne valgt rad"};a.jgrid.col={caption:"Vis/skjul kolonner",bSubmit:"Utf�r",bCancel:"Avbryt"};a.jgrid.errors={errcap:"Feil",nourl:"Ingen url er satt",norecords:"Ingen poster � behandle",model:"colNames og colModel har forskjellig lengde!"};a.jgrid.formatter={integer:{thousandsSeparator:" ",defaulValue:0},number:{decimalSeparator:",",thousandsSeparator:" ",decimalPlaces:2,defaulValue:0},currency:{decimalSeparator:",",thousandsSeparator:" ",decimalPlaces:2,prefix:"",suffix:"",defaulValue:0},date:{dayNames:["s�.","ma.","ti.","on.","to.","fr.","l�.","S�ndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","L�rdag"],monthNames:["jan.","feb.","mars","april","mai","juni","juli","aug.","sep.","okt.","nov.","des.","januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"],AmPm:["","","",""],S:function(b){return"."},srcformat:"Y-m-d H:i:s",newformat:"Y-m-d H:i:s",masks:{ISO8601Long:"Y-m-d H:i:s",ISO8601Short:"Y-m-d",ShortDate:"j.n.Y",LongDate:"l j. F Y",FullDateTime:"l j. F Y kl. G.i.s",MonthDay:"j. F",ShortTime:"H:i",LongTime:"H:i:s",SortableDateTime:"Y-m-d\\TH:i:s",UniversalSortableDateTime:"Y-m-d H:i:sO",YearMonth:"F Y"},reformatAfterEdit:false},baseLinkUrl:"",showAction:"show",addParam:"",checkbox:{disabled:true}}})(jQuery);
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-pl.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-pl.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-pl.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Polish Translation
* Łukasz Schab lukasz(a)freetree.pl
* http://FreeTree.pl
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-pt-br.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-pt-br.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-pt-br.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Brazilian-Portuguese Translation
* Sergio Righi sergio.righi(a)gmail.com
* http://curve.com.br
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-pt.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-pt.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-pt.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Portuguese Translation
* Tradu��o da jqGrid em Portugues por Frederico Carvalho, http://www.eyeviewdesign.pt
* Dual licensed under the MIT and GPL licenses:
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ro.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ro.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ro.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Romanian Translation
* Alexandru Emil Lupu contact(a)alecslupu.ro
* http://www.alecslupu.ro/
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ru.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ru.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ru.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Russian Translation v1.0 02.07.2009 (based on translation by Alexey Kanaev v1.1 21.01.2009, http://softcore.com.ru)
* Sergey Dyagovchenko
* http://d.sumy.ua
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sk.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sk.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sk.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Slovak Translation
* Milan Cibulka
* http://trirand.com/blog/
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sr-latin.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sr-latin.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sr-latin.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Serbian latin Translation
* Bild Studio info(a)bild-studio.net
* http://www.bild-studio.com
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sr.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sr.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sr.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Serbian Translation
* Александар Миловац(Aleksandar Milovac) aleksandar.milovac(a)gmail.com
* http://trirand.com/blog/
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sv.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sv.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sv.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Swedish Translation
* Harald Normann harald.normann(a)wts.se, harald.normann(a)gmail.com
* http://www.worldteamsoftware.com
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-th.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-th.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-th.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Thai Translation
* Kittituch Manakul m.kittituch(a)Gmail.com
* http://trirand.com/blog/
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-tr.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-tr.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-tr.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Turkish Translation
* Erhan Gündoğan (erhan(a)trposta.net)
* http://blog.zakkum.com
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-tw.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-tw.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-tw.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Chinese (Taiwan) Translation for v4.2
* linquize
* https://github.com/linquize/jqGrid
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ua.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ua.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ua.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid Ukrainian Translation v1.0 02.07.2009
* Sergey Dyagovchenko
* http://d.sumy.ua
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/jquery.jqGrid.src.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/jquery.jqGrid.src.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/jquery.jqGrid.src.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -2,6 +2,7 @@
// @compilation_level SIMPLE_OPTIMIZATIONS
/**
+ * %%Ignore-License
* @license jqGrid 4.4.1 - jQuery Grid
* Copyright (c) 2008, Tony Tomov, tony(a)trirand.com
* Dual licensed under the MIT and GPL licenses
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/grid.addons.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/grid.addons.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/grid.addons.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
(function($){
/*
+ * %%Ignore-License
* jqGrid methods without support. Use as you wish
* Tony Tomov tony(a)trirand.com
* http://trirand.com/blog/
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/grid.postext.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/grid.postext.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/grid.postext.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid extension
* Paul Tiseo ptiseo(a)wasteconsultants.com
*
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/grid.setcolumns.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/grid.setcolumns.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/grid.setcolumns.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,5 +1,6 @@
;(function($){
/**
+ * %%Ignore-License
* jqGrid extension for manipulating columns properties
* Piotr Roznicki roznicki(a)o2.pl
* http://www.roznicki.prv.pl
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/jquery.contextmenu.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/jquery.contextmenu.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/jquery.contextmenu.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*
+/* %%Ignore-License
* ContextMenu - jQuery plugin for right-click context menus
*
* Author: Chris Domigan
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/jquery.searchFilter.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/jquery.searchFilter.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/jquery.searchFilter.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,5 @@
-/* Plugin: searchFilter v1.2.9
+/* %%Ignore-License
+ * Plugin: searchFilter v1.2.9
* Author: Kasey Speakman (kasey(a)cornerspeed.com)
* License: Dual Licensed, MIT and GPL v2 (http://www.gnu.org/licenses/gpl-2.0.html)
*
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/jquery.tablednd.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/jquery.tablednd.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/jquery.tablednd.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* TableDnD plug-in for JQuery, allows you to drag and drop table rows
* You can set up various options to control how the system will work
* Copyright (c) Denis Howlett <denish(a)isocra.com>
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/searchFilter.css
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/searchFilter.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/searchFilter.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,3 +1,4 @@
+/* %%Ignore-License */
.ui-searchFilter { display: none; position: absolute; z-index: 770; overflow: visible;}
.ui-searchFilter table {position:relative; margin:0em; width:auto}
.ui-searchFilter table td {margin: 0em; padding: 1px;}
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/ui.multiselect.css
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/ui.multiselect.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/ui.multiselect.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,5 @@
-/* Multiselect
+/* %%Ignore-License
+ Multiselect
----------------------------------*/
.ui-multiselect { border: solid 1px; font-size: 0.8em; }
Modified: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/ui.multiselect.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/ui.multiselect.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/ui.multiselect.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*
+/* %%Ignore-License
* jQuery UI Multiselect
*
* Authors:
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/excanvas.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/excanvas.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/excanvas.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,3 +1,4 @@
+// %%Ignore-License
// Memory Leaks patch from http://explorercanvas.googlecode.com/svn/trunk/
// svn : r73
// ------------------------------------------------------------------
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/jquery.jqplot.css
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/jquery.jqplot.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/jquery.jqplot.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,5 @@
-/*rules for the plot target div. These will be cascaded down to all plot elements according to css rules*/
+/*%%Ignore-License
+ rules for the plot target div. These will be cascaded down to all plot elements according to css rules*/
.jqplot-target {
position: relative;
color: #666666;
Modified: trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/jquery.jqplot.js
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/jquery.jqplot.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jqplot/src/main/resources/nuiton-js-jqplot/jquery.jqplot.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* Title: jqPlot Charts
*
* Pure JavaScript plotting plugin for jQuery.
Modified: trunk/nuiton-js-jquery/src/main/resources/nuiton-js-jquery/jquery-1.8.3.js
===================================================================
--- trunk/nuiton-js-jquery/src/main/resources/nuiton-js-jquery/jquery-1.8.3.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery/src/main/resources/nuiton-js-jquery/jquery-1.8.3.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*!
+/*! %%Ignore-License
* jQuery JavaScript Library v1.8.3
* http://jquery.com/
*
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/base/jquery-ui.css
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/base/jquery-ui.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/base/jquery-ui.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,5 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! %%Ignore-License
+* jQuery UI - v1.9.2 - 2012-11-23
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/black-tie/jquery-ui-1.9.2.custom.css
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/black-tie/jquery-ui-1.9.2.custom.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/black-tie/jquery-ui-1.9.2.custom.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-12-24
+/*! %%Ignore-License jQuery UI - v1.9.2 - 2012-12-24
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwD…
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/blitzer/jquery-ui-1.9.2.custom.css
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/blitzer/jquery-ui-1.9.2.custom.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/blitzer/jquery-ui-1.9.2.custom.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-12-24
+/*! %%Ignore-License jQuery UI - v1.9.2 - 2012-12-24
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Arial%2Csans-serif&fwDefault=bol…
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/cupertino/jquery-ui-1.9.2.custom.css
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/cupertino/jquery-ui-1.9.2.custom.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/cupertino/jquery-ui-1.9.2.custom.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-12-24
+/*! %%Ignore-License jQuery UI - v1.9.2 - 2012-12-24
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Lucida%20Grande%2CLucida%20Sans%…
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/dark-hive/jquery-ui-1.9.2.custom.css
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/dark-hive/jquery-ui-1.9.2.custom.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/dark-hive/jquery-ui-1.9.2.custom.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-12-24
+/*! %%Ignore-License jQuery UI - v1.9.2 - 2012-12-24
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwD…
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/dot-luv/jquery-ui-1.9.2.custom.css
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/dot-luv/jquery-ui-1.9.2.custom.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/dot-luv/jquery-ui-1.9.2.custom.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-12-24
+/*! %%Ignore-License jQuery UI - v1.9.2 - 2012-12-24
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Arial%2Csans-serif&fwDefault=bol…
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/eggplant/jquery-ui-1.9.2.custom.css
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/eggplant/jquery-ui-1.9.2.custom.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/eggplant/jquery-ui-1.9.2.custom.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-12-24
+/*! %%Ignore-License jQuery UI - v1.9.2 - 2012-12-24
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Lucida%20Grande%2CLucida%20Sans%…
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/excite-bike/jquery-ui-1.9.2.custom.css
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/excite-bike/jquery-ui-1.9.2.custom.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/excite-bike/jquery-ui-1.9.2.custom.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-12-24
+/*! %%Ignore-License jQuery UI - v1.9.2 - 2012-12-24
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=segoe%20ui%2CArial%2Csans-serif&…
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/flick/jquery-ui-1.9.2.custom.css
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/flick/jquery-ui-1.9.2.custom.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/flick/jquery-ui-1.9.2.custom.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-12-24
+/*! %%Ignore-License jQuery UI - v1.9.2 - 2012-12-24
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Helvetica%2CArial%2Csans-serif&f…
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/hot-sneaks/jquery-ui-1.9.2.custom.css
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/hot-sneaks/jquery-ui-1.9.2.custom.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/hot-sneaks/jquery-ui-1.9.2.custom.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-12-24
+/*! %%Ignore-License jQuery UI - v1.9.2 - 2012-12-24
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Gill%20Sans%2CArial%2Csans-serif…
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/humanity/jquery-ui-1.9.2.custom.css
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/humanity/jquery-ui-1.9.2.custom.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/humanity/jquery-ui-1.9.2.custom.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-12-24
+/*! %%Ignore-License jQuery UI - v1.9.2 - 2012-12-24
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Helvetica%2CArial%2Csans-serif&f…
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/le-frog/jquery-ui-1.9.2.custom.css
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/le-frog/jquery-ui-1.9.2.custom.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/le-frog/jquery-ui-1.9.2.custom.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-12-24
+/*! %%Ignore-License jQuery UI - v1.9.2 - 2012-12-24
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Lucida%20Grande%2CLucida%20Sans%…
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/mint-choc/jquery-ui-1.9.2.custom.css
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/mint-choc/jquery-ui-1.9.2.custom.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/mint-choc/jquery-ui-1.9.2.custom.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-12-24
+/*! %%Ignore-License jQuery UI - v1.9.2 - 2012-12-24
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Segoe%20UI%2CHelvetica%2CArial%2…
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/no-theme/jquery-ui-1.9.2.custom.css
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/no-theme/jquery-ui-1.9.2.custom.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/no-theme/jquery-ui-1.9.2.custom.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-12-24
+/*! %%Ignore-License jQuery UI - v1.9.2 - 2012-12-24
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/overcast/jquery-ui-1.9.2.custom.css
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/overcast/jquery-ui-1.9.2.custom.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/overcast/jquery-ui-1.9.2.custom.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-12-24
+/*! %%Ignore-License jQuery UI - v1.9.2 - 2012-12-24
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS%2CHelvetica%2CAri…
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/pepper-grinder/jquery-ui-1.9.2.custom.css
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/pepper-grinder/jquery-ui-1.9.2.custom.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/pepper-grinder/jquery-ui-1.9.2.custom.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-12-24
+/*! %%Ignore-License jQuery UI - v1.9.2 - 2012-12-24
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS%2CTahoma%2CVerdan…
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/redmond/jquery-ui-1.9.2.custom.css
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/redmond/jquery-ui-1.9.2.custom.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/redmond/jquery-ui-1.9.2.custom.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-12-24
+/*! %%Ignore-License jQuery UI - v1.9.2 - 2012-12-24
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Lucida%20Grande%2CLucida%20Sans%…
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/smoothness/jquery-ui-1.9.2.custom.css
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/smoothness/jquery-ui-1.9.2.custom.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/smoothness/jquery-ui-1.9.2.custom.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-12-24
+/*! %%Ignore-License jQuery UI - v1.9.2 - 2012-12-24
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwD…
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/south-street/jquery-ui-1.9.2.custom.css
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/south-street/jquery-ui-1.9.2.custom.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/south-street/jquery-ui-1.9.2.custom.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-12-24
+/*! %%Ignore-License jQuery UI - v1.9.2 - 2012-12-24
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=segoe%20ui%2CArial%2Csans-serif&…
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/start/jquery-ui-1.9.2.custom.css
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/start/jquery-ui-1.9.2.custom.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/start/jquery-ui-1.9.2.custom.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-12-24
+/*! %%Ignore-License jQuery UI - v1.9.2 - 2012-12-24
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwD…
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/sunny/jquery-ui-1.9.2.custom.css
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/sunny/jquery-ui-1.9.2.custom.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/sunny/jquery-ui-1.9.2.custom.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-12-24
+/*! %%Ignore-License jQuery UI - v1.9.2 - 2012-12-24
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Segoe%20UI%2CArial%2Csans-serif&…
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/swanky-purse/jquery-ui-1.9.2.custom.css
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/swanky-purse/jquery-ui-1.9.2.custom.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/swanky-purse/jquery-ui-1.9.2.custom.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-12-24
+/*! %%Ignore-License jQuery UI - v1.9.2 - 2012-12-24
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Georgia%2CVerdana%2CArial%2Csans…
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/trontastic/jquery-ui-1.9.2.custom.css
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/trontastic/jquery-ui-1.9.2.custom.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/trontastic/jquery-ui-1.9.2.custom.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-12-24
+/*! %%Ignore-License jQuery UI - v1.9.2 - 2012-12-24
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Segoe%20UI%2CHelvetica%2CArial%2…
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/ui-darkness/jquery-ui-1.9.2.custom.css
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/ui-darkness/jquery-ui-1.9.2.custom.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/ui-darkness/jquery-ui-1.9.2.custom.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-12-24
+/*! %%Ignore-License jQuery UI - v1.9.2 - 2012-12-24
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Segoe%20UI%2CArial%2Csans-serif&…
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/ui-lightness/jquery-ui-1.9.2.custom.css
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/ui-lightness/jquery-ui-1.9.2.custom.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/ui-lightness/jquery-ui-1.9.2.custom.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-12-24
+/*! %%Ignore-License jQuery UI - v1.9.2 - 2012-12-24
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS%2CTahoma%2CVerdan…
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/vader/jquery-ui-1.9.2.custom.css
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/vader/jquery-ui-1.9.2.custom.css 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/css/vader/jquery-ui-1.9.2.custom.css 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-12-24
+/*! %%Ignore-License jQuery UI - v1.9.2 - 2012-12-24
* http://jqueryui.com
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* To view and modify this theme, visit http://jqueryui.com/themeroller/?tr%26ffDefault=Helvetica%2CArial%2Csans-se…
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery-ui-i18n.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery-ui-i18n.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery-ui-i18n.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! %%Ignore-License jQuery UI - v1.9.2 - 2012-11-23
* http://jqueryui.com
* Includes: jquery.ui.datepicker-af.js, jquery.ui.datepicker-ar-DZ.js, jquery.ui.datepicker-ar.js, jquery.ui.datepicker-az.js, jquery.ui.datepicker-bg.js, jquery.ui.datepicker-bs.js, jquery.ui.datepicker-ca.js, jquery.ui.datepicker-cs.js, jquery.ui.datepicker-cy-GB.js, jquery.ui.datepicker-da.js, jquery.ui.datepicker-de.js, jquery.ui.datepicker-el.js, jquery.ui.datepicker-en-AU.js, jquery.ui.datepicker-en-GB.js, jquery.ui.datepicker-en-NZ.js, jquery.ui.datepicker-eo.js, jquery.ui.datepicker-es.js, jquery.ui.datepicker-et.js, jquery.ui.datepicker-eu.js, jquery.ui.datepicker-fa.js, jquery.ui.datepicker-fi.js, jquery.ui.datepicker-fo.js, jquery.ui.datepicker-fr-CH.js, jquery.ui.datepicker-fr.js, jquery.ui.datepicker-gl.js, jquery.ui.datepicker-he.js, jquery.ui.datepicker-hi.js, jquery.ui.datepicker-hr.js, jquery.ui.datepicker-hu.js, jquery.ui.datepicker-hy.js, jquery.ui.datepicker-id.js, jquery.ui.datepicker-is.js, jquery.ui.datepicker-it.js, jquery.ui.datepicker-ja.js, jquery.ui.datepicker-ka.js, jquery.ui.datepicker-kk.js, jquery.ui.datepicker-km.js, jquery.ui.datepicker-ko.js, jquery.ui.datepicker-lb.js, jquery.ui.datepicker-lt.js, jquery.ui.datepicker-lv.js, jquery.ui.datepicker-mk.js, jquery.ui.datepicker-ml.js, jquery.ui.datepicker-ms.js, jquery.ui.datepicker-nl-BE.js, jquery.ui.datepicker-nl.js, jquery.ui.datepicker-no.js, jquery.ui.datepicker-pl.js, jquery.ui.datepicker-pt-BR.js, jquery.ui.datepicker-pt.js, jquery.ui.datepicker-rm.js, jquery.ui.datepicker-ro.js, jquery.ui.datepicker-ru.js, jquery.ui.datepicker-sk.js, jquery.ui.datepicker-sl.js, jquery.ui.datepicker-sq.js, jquery.ui.datepicker-sr-SR.js, jquery.ui.datepicker-sr.js, jquery.ui.datepicker-sv.js, jquery.ui.datepicker-ta.js, jquery.ui.datepicker-th.js, jquery.ui.datepicker-tj.js, jquery.ui.datepicker-tr.js, jquery.ui.datepicker-uk.js, jquery.ui.datepicker-vi.js, jquery.ui.datepicker-zh-CN.js, jquery.ui.datepicker-zh-HK.js, jquery.ui.datepicker-zh-TW.js
* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-af.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-af.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-af.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Afrikaans initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Afrikaans initialisation for the jQuery UI date picker plugin. */
/* Written by Renier Pretorius. */
jQuery(function($){
$.datepicker.regional['af'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ar-DZ.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ar-DZ.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ar-DZ.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Algerian Arabic Translation for jQuery UI date picker plugin. (can be used for Tunisia)*/
+/* %%Ignore-License Algerian Arabic Translation for jQuery UI date picker plugin. (can be used for Tunisia)*/
/* Mohamed Cherif BOUCHELAGHEM -- cherifbouchelaghem(a)yahoo.fr */
jQuery(function($){
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ar.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ar.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ar.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Arabic Translation for jQuery UI date picker plugin. */
+/* %%Ignore-License Arabic Translation for jQuery UI date picker plugin. */
/* Khaled Alhourani -- me(a)khaledalhourani.com */
/* NOTE: monthNames are the original months names and they are the Arabic names, not the new months name فبراير - يناير and there isn't any Arabic roots for these months */
jQuery(function($){
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-az.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-az.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-az.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Azerbaijani (UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Azerbaijani (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* Written by Jamil Najafov (necefov33(a)gmail.com) */
jQuery(function($) {
$.datepicker.regional['az'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-bg.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-bg.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-bg.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Bulgarian initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Bulgarian initialisation for the jQuery UI date picker plugin. */
/* Written by Stoyan Kyosev (http://svest.org) */
jQuery(function($){
$.datepicker.regional['bg'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-bs.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-bs.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-bs.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Bosnian i18n for the jQuery UI date picker plugin. */
+/* %%Ignore-License Bosnian i18n for the jQuery UI date picker plugin. */
/* Written by Kenan Konjo. */
jQuery(function($){
$.datepicker.regional['bs'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ca.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ca.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ca.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Inicialització en català per a l'extensió 'UI date picker' per jQuery. */
+/* %%Ignore-License Inicialització en català per a l'extensió 'UI date picker' per jQuery. */
/* Writers: (joan.leon(a)gmail.com) */
jQuery(function($){
$.datepicker.regional['ca'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-cs.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-cs.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-cs.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Czech initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Czech initialisation for the jQuery UI date picker plugin. */
/* Written by Tomas Muller (tomas(a)tomas-muller.net) */
jQuery(function($){
$.datepicker.regional['cs'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-cy-GB.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-cy-GB.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-cy-GB.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Welsh/UK initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Welsh/UK initialisation for the jQuery UI date picker plugin. */
/* Written by William Griffiths. */
jQuery(function($){
$.datepicker.regional['cy-GB'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-da.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-da.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-da.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Danish initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Danish initialisation for the jQuery UI date picker plugin. */
/* Written by Jan Christensen ( deletestuff(a)gmail.com) */
jQuery(function($){
$.datepicker.regional['da'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-de.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-de.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-de.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* German initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License German initialisation for the jQuery UI date picker plugin. */
/* Written by Milian Wolff (mail(a)milianw.de) */
jQuery(function($){
$.datepicker.regional['de'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-el.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-el.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-el.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Greek (el) initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Greek (el) initialisation for the jQuery UI date picker plugin. */
/* Written by Alex Cicovic (http://www.alexcicovic.com) */
jQuery(function($){
$.datepicker.regional['el'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-en-AU.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-en-AU.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-en-AU.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* English/Australia initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License English/Australia initialisation for the jQuery UI date picker plugin. */
/* Based on the en-GB initialisation. */
jQuery(function($){
$.datepicker.regional['en-AU'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-en-GB.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-en-GB.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-en-GB.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* English/UK initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License English/UK initialisation for the jQuery UI date picker plugin. */
/* Written by Stuart. */
jQuery(function($){
$.datepicker.regional['en-GB'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-en-NZ.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-en-NZ.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-en-NZ.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* English/New Zealand initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License English/New Zealand initialisation for the jQuery UI date picker plugin. */
/* Based on the en-GB initialisation. */
jQuery(function($){
$.datepicker.regional['en-NZ'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-eo.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-eo.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-eo.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Esperanto initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Esperanto initialisation for the jQuery UI date picker plugin. */
/* Written by Olivier M. (olivierweb(a)ifrance.com) */
jQuery(function($){
$.datepicker.regional['eo'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-es.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-es.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-es.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Inicialización en español para la extensión 'UI date picker' para jQuery. */
+/* %%Ignore-License Inicialización en español para la extensión 'UI date picker' para jQuery. */
/* Traducido por Vester (xvester(a)gmail.com) */
jQuery(function($){
$.datepicker.regional['es'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-et.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-et.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-et.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Estonian initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Estonian initialisation for the jQuery UI date picker plugin. */
/* Written by Mart Sõmermaa (mrts.pydev at gmail com). */
jQuery(function($){
$.datepicker.regional['et'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-eu.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-eu.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-eu.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Euskarako oinarria 'UI date picker' jquery-ko extentsioarentzat */
+/* %%Ignore-License Euskarako oinarria 'UI date picker' jquery-ko extentsioarentzat */
/* Karrikas-ek itzulia (karrikas(a)karrikas.com) */
jQuery(function($){
$.datepicker.regional['eu'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-fa.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-fa.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-fa.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Persian (Farsi) Translation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Persian (Farsi) Translation for the jQuery UI date picker plugin. */
/* Javad Mowlanezhad -- jmowla(a)gmail.com */
/* Jalali calendar should supported soon! (Its implemented but I have to test it) */
jQuery(function($) {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-fi.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-fi.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-fi.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Finnish initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Finnish initialisation for the jQuery UI date picker plugin. */
/* Written by Harri Kilpiö (harrikilpio(a)gmail.com) */
jQuery(function($){
$.datepicker.regional['fi'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-fo.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-fo.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-fo.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Faroese initialisation for the jQuery UI date picker plugin */
+/* %%Ignore-License Faroese initialisation for the jQuery UI date picker plugin */
/* Written by Sverri Mohr Olsen, sverrimo(a)gmail.com */
jQuery(function($){
$.datepicker.regional['fo'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-fr-CH.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-fr-CH.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-fr-CH.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Swiss-French initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Swiss-French initialisation for the jQuery UI date picker plugin. */
/* Written Martin Voelkle (martin.voelkle(a)e-tc.ch) */
jQuery(function($){
$.datepicker.regional['fr-CH'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-fr.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-fr.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-fr.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* French initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License French initialisation for the jQuery UI date picker plugin. */
/* Written by Keith Wood (kbwood{at}iinet.com.au),
Stéphane Nahmani (sholby(a)sholby.net)
Stéphane Raimbault <stephane.raimbault(a)gmail.com> */
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-gl.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-gl.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-gl.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Galician localization for 'UI date picker' jQuery extension. */
+/* %%Ignore-License Galician localization for 'UI date picker' jQuery extension. */
/* Translated by Jorge Barreiro <yortx.barry(a)gmail.com>. */
jQuery(function($){
$.datepicker.regional['gl'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-he.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-he.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-he.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Hebrew initialisation for the UI Datepicker extension. */
+/* %%Ignore-License Hebrew initialisation for the UI Datepicker extension. */
/* Written by Amir Hardon (ahardon at gmail dot com). */
jQuery(function($){
$.datepicker.regional['he'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-hi.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-hi.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-hi.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Hindi initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Hindi initialisation for the jQuery UI date picker plugin. */
/* Written by Michael Dawart. */
jQuery(function($){
$.datepicker.regional['hi'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-hr.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-hr.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-hr.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Croatian i18n for the jQuery UI date picker plugin. */
+/* %%Ignore-License Croatian i18n for the jQuery UI date picker plugin. */
/* Written by Vjekoslav Nesek. */
jQuery(function($){
$.datepicker.regional['hr'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-hu.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-hu.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-hu.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Hungarian initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Hungarian initialisation for the jQuery UI date picker plugin. */
/* Written by Istvan Karaszi (jquery(a)spam.raszi.hu) */
jQuery(function($){
$.datepicker.regional['hu'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-hy.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-hy.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-hy.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Armenian(UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Armenian(UTF-8) initialisation for the jQuery UI date picker plugin. */
/* Written by Levon Zakaryan (levon.zakaryan(a)gmail.com)*/
jQuery(function($){
$.datepicker.regional['hy'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-id.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-id.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-id.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Indonesian initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Indonesian initialisation for the jQuery UI date picker plugin. */
/* Written by Deden Fathurahman (dedenf(a)gmail.com) */
jQuery(function($){
$.datepicker.regional['id'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-is.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-is.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-is.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Icelandic initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Icelandic initialisation for the jQuery UI date picker plugin. */
/* Written by Haukur H. Thorsson (haukur(a)eskill.is) */
jQuery(function($){
$.datepicker.regional['is'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-it.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-it.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-it.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Italian initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Italian initialisation for the jQuery UI date picker plugin. */
/* Written by Antonello Pasella (antonello.pasella(a)gmail.com) */
jQuery(function($){
$.datepicker.regional['it'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ja.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ja.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ja.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Japanese initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Japanese initialisation for the jQuery UI date picker plugin. */
/* Written by Kentaro SATO (kentaro(a)ranvis.com) */
jQuery(function($){
$.datepicker.regional['ja'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ka.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ka.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ka.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Georgian (UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Georgian (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* Written by Lado Lomidze (lado.lomidze(a)gmail.com) */
jQuery(function($){
$.datepicker.regional['ka'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-kk.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-kk.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-kk.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Kazakh (UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Kazakh (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* Written by Dmitriy Karasyov (dmitriy.karasyov(a)gmail.com) */
jQuery(function($){
$.datepicker.regional['kk'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-km.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-km.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-km.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Khmer initialisation for the jQuery calendar extension. */
+/* %%Ignore-License Khmer initialisation for the jQuery calendar extension. */
/* Written by Chandara Om (chandara.teacher(a)gmail.com) */
jQuery(function($){
$.datepicker.regional['km'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ko.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ko.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ko.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Korean initialisation for the jQuery calendar extension. */
+/* %%Ignore-License Korean initialisation for the jQuery calendar extension. */
/* Written by DaeKwon Kang (ncrash.dk(a)gmail.com) Edited by Genie. */
jQuery(function($){
$.datepicker.regional['ko'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-lb.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-lb.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-lb.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Luxembourgish initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Luxembourgish initialisation for the jQuery UI date picker plugin. */
/* Written by Michel Weimerskirch <michel(a)weimerskirch.net> */
jQuery(function($){
$.datepicker.regional['lb'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-lt.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-lt.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-lt.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Lithuanian (UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Lithuanian (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* @author Arturas Paleicikas <arturas(a)avalon.lt> */
jQuery(function($){
$.datepicker.regional['lt'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-lv.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-lv.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-lv.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Latvian (UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Latvian (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* @author Arturas Paleicikas <arturas.paleicikas(a)metasite.net> */
jQuery(function($){
$.datepicker.regional['lv'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-mk.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-mk.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-mk.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Macedonian i18n for the jQuery UI date picker plugin. */
+/* %%Ignore-License Macedonian i18n for the jQuery UI date picker plugin. */
/* Written by Stojce Slavkovski. */
jQuery(function($){
$.datepicker.regional['mk'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ml.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ml.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ml.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Malayalam (UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Malayalam (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* Written by Saji Nediyanchath (saji89(a)gmail.com) */
jQuery(function($){
$.datepicker.regional['ml'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ms.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ms.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ms.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Malaysian initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Malaysian initialisation for the jQuery UI date picker plugin. */
/* Written by Mohd Nawawi Mohamad Jamili (nawawi(a)ronggeng.net) */
jQuery(function($){
$.datepicker.regional['ms'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-nl-BE.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-nl-BE.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-nl-BE.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Dutch (Belgium) initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Dutch (Belgium) initialisation for the jQuery UI date picker plugin. */
/* David De Sloovere @DavidDeSloovere */
jQuery(function($){
$.datepicker.regional['nl-BE'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-nl.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-nl.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-nl.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Dutch (UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Dutch (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* Written by Mathias Bynens <http://mathiasbynens.be/> */
jQuery(function($){
$.datepicker.regional.nl = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-no.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-no.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-no.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Norwegian initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Norwegian initialisation for the jQuery UI date picker plugin. */
/* Written by Naimdjon Takhirov (naimdjon(a)gmail.com) */
jQuery(function($){
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-pl.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-pl.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-pl.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Polish initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Polish initialisation for the jQuery UI date picker plugin. */
/* Written by Jacek Wysocki (jacek.wysocki(a)gmail.com) */
jQuery(function($){
$.datepicker.regional['pl'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-pt-BR.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-pt-BR.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-pt-BR.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Brazilian initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Brazilian initialisation for the jQuery UI date picker plugin. */
/* Written by Leonildo Costa Silva (leocsilva(a)gmail.com) */
jQuery(function($){
$.datepicker.regional['pt-BR'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-pt.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-pt.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-pt.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Portuguese initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Portuguese initialisation for the jQuery UI date picker plugin. */
jQuery(function($){
$.datepicker.regional['pt'] = {
closeText: 'Fechar',
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-rm.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-rm.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-rm.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Romansh initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Romansh initialisation for the jQuery UI date picker plugin. */
/* Written by Yvonne Gienal (yvonne.gienal(a)educa.ch) */
jQuery(function($){
$.datepicker.regional['rm'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ro.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ro.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ro.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Romanian initialisation for the jQuery UI date picker plugin.
+/* %%Ignore-License Romanian initialisation for the jQuery UI date picker plugin.
*
* Written by Edmond L. (ll_edmond(a)walla.com)
* and Ionut G. Stan (ionut.g.stan(a)gmail.com)
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ru.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ru.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ru.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* Written by Andrew Stromnov (stromnov(a)gmail.com) */
jQuery(function($){
$.datepicker.regional['ru'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sk.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sk.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sk.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Slovak initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Slovak initialisation for the jQuery UI date picker plugin. */
/* Written by Vojtech Rinik (vojto(a)hmm.sk) */
jQuery(function($){
$.datepicker.regional['sk'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sl.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sl.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sl.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Slovenian initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Slovenian initialisation for the jQuery UI date picker plugin. */
/* Written by Jaka Jancar (jaka(a)kubje.org) */
/* c = č, s = š z = ž C = Č S = Š Z = Ž */
jQuery(function($){
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sq.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sq.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sq.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Albanian initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Albanian initialisation for the jQuery UI date picker plugin. */
/* Written by Flakron Bytyqi (flakron(a)gmail.com) */
jQuery(function($){
$.datepicker.regional['sq'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sr-SR.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sr-SR.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sr-SR.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Serbian i18n for the jQuery UI date picker plugin. */
+/* %%Ignore-License Serbian i18n for the jQuery UI date picker plugin. */
/* Written by Dejan Dimić. */
jQuery(function($){
$.datepicker.regional['sr-SR'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sr.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sr.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sr.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Serbian i18n for the jQuery UI date picker plugin. */
+/* %%Ignore-License Serbian i18n for the jQuery UI date picker plugin. */
/* Written by Dejan Dimić. */
jQuery(function($){
$.datepicker.regional['sr'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sv.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sv.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sv.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Swedish initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Swedish initialisation for the jQuery UI date picker plugin. */
/* Written by Anders Ekdahl ( anders(a)nomadiz.se) */
jQuery(function($){
$.datepicker.regional['sv'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ta.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ta.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ta.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Tamil (UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Tamil (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* Written by S A Sureshkumar (saskumar(a)live.com) */
jQuery(function($){
$.datepicker.regional['ta'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-th.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-th.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-th.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Thai initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Thai initialisation for the jQuery UI date picker plugin. */
/* Written by pipo (pipo(a)sixhead.com) */
jQuery(function($){
$.datepicker.regional['th'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-tj.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-tj.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-tj.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Tajiki (UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Tajiki (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* Written by Abdurahmon Saidov (saidovab(a)gmail.com) */
jQuery(function($){
$.datepicker.regional['tj'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-tr.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-tr.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-tr.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Turkish initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Turkish initialisation for the jQuery UI date picker plugin. */
/* Written by Izzet Emre Erkan (kara(a)karalamalar.net) */
jQuery(function($){
$.datepicker.regional['tr'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-uk.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-uk.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-uk.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Ukrainian (UTF-8) initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Ukrainian (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* Written by Maxim Drogobitskiy (maxdao(a)gmail.com) */
/* Corrected by Igor Milla (igor.fsp.milla(a)gmail.com) */
jQuery(function($){
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-vi.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-vi.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-vi.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Vietnamese initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Vietnamese initialisation for the jQuery UI date picker plugin. */
/* Translated by Le Thanh Huy (lthanhhuy(a)cit.ctu.edu.vn) */
jQuery(function($){
$.datepicker.regional['vi'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-zh-CN.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-zh-CN.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-zh-CN.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Chinese initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Chinese initialisation for the jQuery UI date picker plugin. */
/* Written by Cloudream (cloudream(a)gmail.com) */
jQuery(function($){
$.datepicker.regional['zh-CN'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-zh-HK.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-zh-HK.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-zh-HK.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Chinese initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Chinese initialisation for the jQuery UI date picker plugin. */
/* Written by SCCY (samuelcychan(a)gmail.com) */
jQuery(function($){
$.datepicker.regional['zh-HK'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-zh-TW.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-zh-TW.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-zh-TW.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/* Chinese initialisation for the jQuery UI date picker plugin. */
+/* %%Ignore-License Chinese initialisation for the jQuery UI date picker plugin. */
/* Written by Ressol (ressol(a)gmail.com) */
jQuery(function($){
$.datepicker.regional['zh-TW'] = {
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/jquery-ui-1.9.2.custom.js
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/jquery-ui-1.9.2.custom.js 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/nuiton-js-jquery-ui/js/jquery-ui-1.9.2.custom.js 2013-03-13 15:28:42 UTC (rev 36)
@@ -1,4 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! %%Ignore-License jQuery UI - v1.9.2 - 2012-11-23
* http://jqueryui.com
* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.effect.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js, jquery.ui.menu.js, jquery.ui.progressbar.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.slider.js, jquery.ui.sortable.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js
* Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */
Modified: trunk/nuiton-js-lib/src/site/resources/announcement/release-email-announcement.vm
===================================================================
--- trunk/nuiton-js-lib/src/site/resources/announcement/release-email-announcement.vm 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-lib/src/site/resources/announcement/release-email-announcement.vm 2013-03-13 15:28:42 UTC (rev 36)
@@ -8,8 +8,17 @@
Usage
-----
-TODO
+You should add the version in your project's dependencies configuration:
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>${project.artifactId}</artifactId
+ <version>${project.version}</version>
+ <scope>runtime</scope>
+ <plugin>
+
+For additional configuration or usage, please refer to project documentation.
+
Maven artifacts
---------------
@@ -22,4 +31,3 @@
Have fun!
-${developmentTeam}
-
Modified: trunk/nuiton-js-lib/src/site/resources/announcement/release-news-announcement.vm
===================================================================
--- trunk/nuiton-js-lib/src/site/resources/announcement/release-news-announcement.vm 2013-03-13 14:34:29 UTC (rev 35)
+++ trunk/nuiton-js-lib/src/site/resources/announcement/release-news-announcement.vm 2013-03-13 15:28:42 UTC (rev 36)
@@ -7,8 +7,17 @@
h3. Usage
-TODO
+You should add the version in your project's dependencies configuration:
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>${project.artifactId}</artifactId
+ <version>${project.version}</version>
+ <scope>runtime</scope>
+ <plugin>
+
+For additional configuration or usage, please refer to project documentation.
+
h3. Maven artifacts
Artifacts are deployed in Maven Central Repository
@@ -21,4 +30,3 @@
Have fun!
-${developmentTeam}
-
1
0
r35 - in trunk: . nuiton-js-jstree/src/main/resources/nuiton-js-jstree/js nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default nuiton-js-lib nuiton-js-lib/src/site/resources/announcement
by tchemit@users.nuiton.org March 13, 2013
by tchemit@users.nuiton.org March 13, 2013
March 13, 2013
Author: tchemit
Date: 2013-03-13 15:34:29 +0100 (Wed, 13 Mar 2013)
New Revision: 35
Url: http://nuiton.org/projects/nuiton-js/repository/revisions/35
Log:
fix release process
fix templates
add ignore license header for js-tree lib
Modified:
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/js/jstree.js
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default/style.css
trunk/nuiton-js-lib/pom.xml
trunk/nuiton-js-lib/src/site/resources/announcement/release-email-announcement.vm
trunk/pom.xml
Modified: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/js/jstree.js
===================================================================
--- trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/js/jstree.js 2013-03-13 14:20:03 UTC (rev 34)
+++ trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/js/jstree.js 2013-03-13 14:34:29 UTC (rev 35)
@@ -1,4 +1,4 @@
-/*
+/* %%Ignore-License
* jsTree 2.0.0
* http://jstree.com/
*
Modified: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default/style.css
===================================================================
--- trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default/style.css 2013-03-13 14:20:03 UTC (rev 34)
+++ trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default/style.css 2013-03-13 14:34:29 UTC (rev 35)
@@ -1,4 +1,4 @@
-/*
+/* %%Ignore-License
* jsTree default theme 2.0.0
* Supported features: dots/no-dots, icons/no-icons, loading, clicked, hovered, checkbox, search
*/
Modified: trunk/nuiton-js-lib/pom.xml
===================================================================
(Binary files differ)
Modified: trunk/nuiton-js-lib/src/site/resources/announcement/release-email-announcement.vm
===================================================================
--- trunk/nuiton-js-lib/src/site/resources/announcement/release-email-announcement.vm 2013-03-13 14:20:03 UTC (rev 34)
+++ trunk/nuiton-js-lib/src/site/resources/announcement/release-email-announcement.vm 2013-03-13 14:34:29 UTC (rev 35)
@@ -5,23 +5,11 @@
Documentation of the project can be found here:
${projectUrl}
-Usages
-------
+Usage
+-----
TODO
-Downloads
----------
-
-
-#foreach($a in $attachmentUrls.entrySet())
-#set($attachment=$a.getKey())
- * ${attachment.getFilename()} - ${a.getValue()}
-#end
-#else
-No release file deployed. (all files are deployed in the maven repository)
-#end
-
Maven artifacts
---------------
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-03-13 14:20:03 UTC (rev 34)
+++ trunk/pom.xml 2013-03-13 14:34:29 UTC (rev 35)
@@ -113,8 +113,6 @@
<!-- redmine configuration -->
<projectId>nuiton-js</projectId>
- <!-- redmine project version (use also nuiton-js-lib-XXX releases) -->
- <redmineVersionId>${project.version}</redmineVersionId>
<!-- site langue -->
<siteLocales>fr</siteLocales>
1
0
r34 - in trunk: . nuiton-js-bootstrap nuiton-js-font-awesome nuiton-js-jqgrid nuiton-js-jqplot nuiton-js-jquery nuiton-js-jquery-ui nuiton-js-jstree nuiton-js-lib nuiton-js-lib/src nuiton-js-lib/src/site nuiton-js-lib/src/site/resources nuiton-js-lib/src/site/resources/announcement nuiton-js-lib/src/site/rst nuiton-js-wro
by tchemit@users.nuiton.org March 13, 2013
by tchemit@users.nuiton.org March 13, 2013
March 13, 2013
Author: tchemit
Date: 2013-03-13 15:20:03 +0100 (Wed, 13 Mar 2013)
New Revision: 34
Url: http://nuiton.org/projects/nuiton-js/repository/revisions/34
Log:
- add svn:ignores
- fix nuiton-js-lib release process (test me!)
- add nuiton-js-lib release announcement templates (fill me!)
Added:
trunk/nuiton-js-lib/src/site/resources/
trunk/nuiton-js-lib/src/site/resources/announcement/
trunk/nuiton-js-lib/src/site/resources/announcement/release-email-announcement.vm
trunk/nuiton-js-lib/src/site/resources/announcement/release-news-announcement.vm
Removed:
trunk/nuiton-js-lib/src/main/
Modified:
trunk/
trunk/nuiton-js-bootstrap/
trunk/nuiton-js-font-awesome/
trunk/nuiton-js-jqgrid/
trunk/nuiton-js-jqplot/
trunk/nuiton-js-jquery-ui/
trunk/nuiton-js-jquery/
trunk/nuiton-js-jstree/
trunk/nuiton-js-lib/
trunk/nuiton-js-lib/LICENSE.txt
trunk/nuiton-js-lib/README.txt
trunk/nuiton-js-lib/changelog.txt
trunk/nuiton-js-lib/pom.xml
trunk/nuiton-js-lib/src/site/rst/index.rst
trunk/nuiton-js-lib/src/site/site_fr.xml
trunk/nuiton-js-wro/
trunk/pom.xml
Property changes on: trunk
___________________________________________________________________
Modified: svn:ignore
- target
.idea
.ipr
.iws
.iml
.settings
.project
+ target
.idea
*.ipr
*.iws
*.iml
.settings
.project
Property changes on: trunk/nuiton-js-bootstrap
___________________________________________________________________
Modified: svn:ignore
- .classpath
.project
.settings
target
+ .classpath
.project
.settings
target
*.ipr
*.iws
*.iml
.idea
Property changes on: trunk/nuiton-js-font-awesome
___________________________________________________________________
Modified: svn:ignore
- target
.settings
.classpath
.project
+ target
.settings
.classpath
.project
*.ipr
*.iws
*.iml
.idea
Property changes on: trunk/nuiton-js-jqgrid
___________________________________________________________________
Modified: svn:ignore
- target
+ target
*.ipr
*.iws
*.iml
.idea
.project
.settings
Property changes on: trunk/nuiton-js-jqplot
___________________________________________________________________
Modified: svn:ignore
- .classpath
.project
.settings
target
+ .classpath
.project
.settings
target
*.ipr
*.iws
*.iml
.idea
Property changes on: trunk/nuiton-js-jquery
___________________________________________________________________
Modified: svn:ignore
- target
.idea
.ipr
.iws
.iml
.classpath
.project
.settings
+ target
.idea
*.ipr
*.iws
*.iml
.classpath
.project
.settings
Property changes on: trunk/nuiton-js-jquery-ui
___________________________________________________________________
Modified: svn:ignore
- target
.idea
.ipr
.iws
.iml
.classpath
.project
.settings
+ target
.idea
*.ipr
*.iws
*.iml
.classpath
.project
.settings
Property changes on: trunk/nuiton-js-jstree
___________________________________________________________________
Modified: svn:ignore
- .classpath
.project
.settings
target
+ .classpath
.project
.settings
target
*.ipr
*.iws
*.iml
.idea
Property changes on: trunk/nuiton-js-lib
___________________________________________________________________
Modified: svn:ignore
- target
.settings
.project
+ target
.settings
.project
*.ipr
*.iws
*.iml
.idea
Property changes on: trunk/nuiton-js-lib/LICENSE.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/nuiton-js-lib/README.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Property changes on: trunk/nuiton-js-lib/changelog.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/nuiton-js-lib/pom.xml
===================================================================
(Binary files differ)
Property changes on: trunk/nuiton-js-lib/pom.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/nuiton-js-lib/src/site/resources/announcement/release-email-announcement.vm
===================================================================
--- trunk/nuiton-js-lib/src/site/resources/announcement/release-email-announcement.vm (rev 0)
+++ trunk/nuiton-js-lib/src/site/resources/announcement/release-email-announcement.vm 2013-03-13 14:20:03 UTC (rev 34)
@@ -0,0 +1,37 @@
+The ${developmentTeam} is pleased to announce the ${finalName} release!
+
+${introduction}
+
+Documentation of the project can be found here:
+${projectUrl}
+
+Usages
+------
+
+TODO
+
+Downloads
+---------
+
+
+#foreach($a in $attachmentUrls.entrySet())
+#set($attachment=$a.getKey())
+ * ${attachment.getFilename()} - ${a.getValue()}
+#end
+#else
+No release file deployed. (all files are deployed in the maven repository)
+#end
+
+Maven artifacts
+---------------
+
+Artifacts are deployed in Maven Central Repository
+${mavenRepoUrl}
+
+Find us at
+
+* http://search.maven.org/#artifactdetails|${project.groupId}|${project.artif…
+
+Have fun!
+-${developmentTeam}
+
Property changes on: trunk/nuiton-js-lib/src/site/resources/announcement/release-email-announcement.vm
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/nuiton-js-lib/src/site/resources/announcement/release-news-announcement.vm
===================================================================
--- trunk/nuiton-js-lib/src/site/resources/announcement/release-news-announcement.vm (rev 0)
+++ trunk/nuiton-js-lib/src/site/resources/announcement/release-news-announcement.vm 2013-03-13 14:20:03 UTC (rev 34)
@@ -0,0 +1,24 @@
+The ${developmentTeam} is pleased to announce the *${finalName}* release!
+
+${introduction}
+
+Documentation of the project can be found here:
+${projectUrl}
+
+h3. Usage
+
+TODO
+
+h3. Maven artifacts
+
+Artifacts are deployed in Maven Central Repository
+${mavenRepoUrl}
+
+Find us at
+
+* http://search.maven.org/#artifactdetails|${project.groupId}|${project.artif…
+
+
+Have fun!
+-${developmentTeam}
+
Property changes on: trunk/nuiton-js-lib/src/site/resources/announcement/release-news-announcement.vm
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/nuiton-js-lib/src/site/rst/index.rst
===================================================================
--- trunk/nuiton-js-lib/src/site/rst/index.rst 2013-03-13 10:53:32 UTC (rev 33)
+++ trunk/nuiton-js-lib/src/site/rst/index.rst 2013-03-13 14:20:03 UTC (rev 34)
@@ -1,8 +1,8 @@
.. -
.. * #%L
.. * Nuiton JS :: Libraries
-.. * $Id:$
-.. * $HeadURL:$
+.. * $Id$
+.. * $HeadURL$
.. * %%
.. * Copyright (C) 2012 - 2013 CodeLutin
.. * %%
Property changes on: trunk/nuiton-js-lib/src/site/rst/index.rst
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/nuiton-js-lib/src/site/site_fr.xml
===================================================================
--- trunk/nuiton-js-lib/src/site/site_fr.xml 2013-03-13 10:53:32 UTC (rev 33)
+++ trunk/nuiton-js-lib/src/site/site_fr.xml 2013-03-13 14:20:03 UTC (rev 34)
@@ -1,8 +1,8 @@
<!--
#%L
Nuiton JS :: Libraries
- $Id:$
- $HeadURL:$
+ $Id$
+ $HeadURL$
%%
Copyright (C) 2012 - 2013 CodeLutin
%%
Property changes on: trunk/nuiton-js-lib/src/site/site_fr.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/nuiton-js-wro
___________________________________________________________________
Modified: svn:ignore
- target
.idea
.ipr
.iws
.iml
.classpath
.project
.settings
+ target
.idea
*.ipr
*.iws
*.iml
.classpath
.project
.settings
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-03-13 10:53:32 UTC (rev 33)
+++ trunk/pom.xml 2013-03-13 14:20:03 UTC (rev 34)
@@ -113,6 +113,8 @@
<!-- redmine configuration -->
<projectId>nuiton-js</projectId>
+ <!-- redmine project version (use also nuiton-js-lib-XXX releases) -->
+ <redmineVersionId>${project.version}</redmineVersionId>
<!-- site langue -->
<siteLocales>fr</siteLocales>
1
0
March 13, 2013
Author: echatellier
Date: 2013-03-13 11:53:32 +0100 (Wed, 13 Mar 2013)
New Revision: 33
Url: http://nuiton.org/projects/nuiton-js/repository/revisions/33
Log:
Fix version and site
Modified:
trunk/nuiton-js-bootstrap/pom.xml
trunk/nuiton-js-bootstrap/src/site/rst/index.rst
trunk/nuiton-js-font-awesome/pom.xml
trunk/nuiton-js-font-awesome/src/site/rst/index.rst
trunk/nuiton-js-jqgrid/pom.xml
trunk/nuiton-js-jqgrid/src/site/rst/index.rst
trunk/nuiton-js-jqplot/pom.xml
trunk/nuiton-js-jqplot/src/site/rst/index.rst
trunk/nuiton-js-jquery-ui/pom.xml
trunk/nuiton-js-jquery-ui/src/site/rst/index.rst
trunk/nuiton-js-jquery/pom.xml
trunk/nuiton-js-jquery/src/site/rst/index.rst
trunk/nuiton-js-jstree/pom.xml
trunk/nuiton-js-jstree/src/site/rst/index.rst
trunk/nuiton-js-lib/pom.xml
trunk/nuiton-js-lib/src/site/rst/index.rst
trunk/nuiton-js-wro/pom.xml
trunk/pom.xml
Modified: trunk/nuiton-js-bootstrap/pom.xml
===================================================================
(Binary files differ)
Modified: trunk/nuiton-js-bootstrap/src/site/rst/index.rst
===================================================================
--- trunk/nuiton-js-bootstrap/src/site/rst/index.rst 2013-03-13 10:34:53 UTC (rev 32)
+++ trunk/nuiton-js-bootstrap/src/site/rst/index.rst 2013-03-13 10:53:32 UTC (rev 33)
@@ -21,6 +21,7 @@
.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
.. * #L%
.. -
+
Utilisation
===========
Modified: trunk/nuiton-js-font-awesome/pom.xml
===================================================================
(Binary files differ)
Modified: trunk/nuiton-js-font-awesome/src/site/rst/index.rst
===================================================================
--- trunk/nuiton-js-font-awesome/src/site/rst/index.rst 2013-03-13 10:34:53 UTC (rev 32)
+++ trunk/nuiton-js-font-awesome/src/site/rst/index.rst 2013-03-13 10:53:32 UTC (rev 33)
@@ -21,6 +21,7 @@
.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
.. * #L%
.. -
+
Source
======
Modified: trunk/nuiton-js-jqgrid/pom.xml
===================================================================
--- trunk/nuiton-js-jqgrid/pom.xml 2013-03-13 10:34:53 UTC (rev 32)
+++ trunk/nuiton-js-jqgrid/pom.xml 2013-03-13 10:53:32 UTC (rev 33)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.nuiton.js</groupId>
<artifactId>nuiton-js-lib</artifactId>
- <version>0.1-SNAPSHOT</version>
+ <version>1.0-SNAPSHOT</version>
<relativePath>../nuiton-js-lib</relativePath>
</parent>
Modified: trunk/nuiton-js-jqgrid/src/site/rst/index.rst
===================================================================
--- trunk/nuiton-js-jqgrid/src/site/rst/index.rst 2013-03-13 10:34:53 UTC (rev 32)
+++ trunk/nuiton-js-jqgrid/src/site/rst/index.rst 2013-03-13 10:53:32 UTC (rev 33)
@@ -21,6 +21,7 @@
.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
.. * #L%
.. -
+
Utilisation
===========
Modified: trunk/nuiton-js-jqplot/pom.xml
===================================================================
(Binary files differ)
Modified: trunk/nuiton-js-jqplot/src/site/rst/index.rst
===================================================================
--- trunk/nuiton-js-jqplot/src/site/rst/index.rst 2013-03-13 10:34:53 UTC (rev 32)
+++ trunk/nuiton-js-jqplot/src/site/rst/index.rst 2013-03-13 10:53:32 UTC (rev 33)
@@ -21,6 +21,7 @@
.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
.. * #L%
.. -
+
Utilisation
===========
Modified: trunk/nuiton-js-jquery/pom.xml
===================================================================
(Binary files differ)
Modified: trunk/nuiton-js-jquery/src/site/rst/index.rst
===================================================================
--- trunk/nuiton-js-jquery/src/site/rst/index.rst 2013-03-13 10:34:53 UTC (rev 32)
+++ trunk/nuiton-js-jquery/src/site/rst/index.rst 2013-03-13 10:53:32 UTC (rev 33)
@@ -21,6 +21,7 @@
.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
.. * #L%
.. -
+
Utilisation
===========
Modified: trunk/nuiton-js-jquery-ui/pom.xml
===================================================================
(Binary files differ)
Modified: trunk/nuiton-js-jquery-ui/src/site/rst/index.rst
===================================================================
--- trunk/nuiton-js-jquery-ui/src/site/rst/index.rst 2013-03-13 10:34:53 UTC (rev 32)
+++ trunk/nuiton-js-jquery-ui/src/site/rst/index.rst 2013-03-13 10:53:32 UTC (rev 33)
@@ -21,6 +21,7 @@
.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
.. * #L%
.. -
+
Utilisation
===========
Modified: trunk/nuiton-js-jstree/pom.xml
===================================================================
(Binary files differ)
Modified: trunk/nuiton-js-jstree/src/site/rst/index.rst
===================================================================
--- trunk/nuiton-js-jstree/src/site/rst/index.rst 2013-03-13 10:34:53 UTC (rev 32)
+++ trunk/nuiton-js-jstree/src/site/rst/index.rst 2013-03-13 10:53:32 UTC (rev 33)
@@ -21,6 +21,7 @@
.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
.. * #L%
.. -
+
Utilisation
===========
Modified: trunk/nuiton-js-lib/pom.xml
===================================================================
(Binary files differ)
Modified: trunk/nuiton-js-lib/src/site/rst/index.rst
===================================================================
--- trunk/nuiton-js-lib/src/site/rst/index.rst 2013-03-13 10:34:53 UTC (rev 32)
+++ trunk/nuiton-js-lib/src/site/rst/index.rst 2013-03-13 10:53:32 UTC (rev 33)
@@ -21,60 +21,6 @@
.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
.. * #L%
.. -
+
Utilisation
===========
-
-::
-
- <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
-
- <link rel="stylesheet" type="text/css" href="<c:url value="/nuiton-js/jqplot.css"/>" />
- <!--[if lt IE 9]><script language="javascript" type="text/javascript" src="<c:url value="/nuiton-js/jqplot-excanvas.js"/>"></script><![endif]-->
- <script language="javascript" type="text/javascript" src="<c:url value="/nuiton-js/jqplot.js"/>"></script>
- <script language="javascript" type="text/javascript" src="<c:url value="/nuiton-js/jqplot-all-plugins.js"/>"></script>
-
-JS disponible
--------------
-
-- jqplot-only : jplot
-- jqplot.js : jquery et jplot
-- jqplot-excanvas.js : excanvas pour le support IE
-- jqplot-all-plugins.js : tous les plugins
-
-Ou pour importer un plugin particulier au lieu de tous les plugins:
-
-- jqplot.BezierCurveRenderer.js
-- jqplot.barRenderer.js
-- jqplot.blockRenderer.js
-- jqplot.bubbleRenderer.js
-- jqplot.canvasAxisLabelRenderer.js
-- jqplot.canvasAxisTickRenderer.js
-- jqplot.canvasOverlay.js
-- jqplot.canvasTextRenderer.js
-- jqplot.categoryAxisRenderer.js
-- jqplot.ciParser.js
-- jqplot.cursor.js
-- jqplot.dateAxisRenderer.js
-- jqplot.donutRenderer.js
-- jqplot.dragable.js
-- jqplot.enhancedLegendRenderer.js
-- jqplot.funnelRenderer.js
-- jqplot.highlighter.js
-- jqplot.json2.js
-- jqplot.logAxisRenderer.js
-- jqplot.mekkoAxisRenderer.js
-- jqplot.mekkoRenderer.js
-- jqplot.meterGaugeRenderer.js
-- jqplot.mobile.js
-- jqplot.ohlcRenderer.js
-- jqplot.pieRenderer.js
-- jqplot.pointLabels.js
-- jqplot.pyramidAxisRenderer.js
-- jqplot.pyramidGridRenderer.js
-- jqplot.pyramidRenderer.js
-- jqplot.trendline.js
-
-CSS disponible
---------------
-
-- jqplot.css
Modified: trunk/nuiton-js-wro/pom.xml
===================================================================
--- trunk/nuiton-js-wro/pom.xml 2013-03-13 10:34:53 UTC (rev 32)
+++ trunk/nuiton-js-wro/pom.xml 2013-03-13 10:53:32 UTC (rev 33)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.nuiton.js</groupId>
<artifactId>nuiton-js</artifactId>
- <version>0.1-SNAPSHOT</version>
+ <version>1.0-SNAPSHOT</version>
</parent>
<artifactId>nuiton-js-wro</artifactId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-03-13 10:34:53 UTC (rev 32)
+++ trunk/pom.xml 2013-03-13 10:53:32 UTC (rev 33)
@@ -10,12 +10,12 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmineAndCentral</artifactId>
- <version>3.4.7</version>
+ <version>3.4.8</version>
</parent>
<groupId>org.nuiton.js</groupId>
<artifactId>nuiton-js</artifactId>
- <version>0.1-SNAPSHOT</version>
+ <version>1.0-SNAPSHOT</version>
<modules>
<module>nuiton-js-wro</module>
@@ -32,12 +32,6 @@
<artifactId>slf4j-api</artifactId>
<version>${slf4jVersion}</version>
</dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>${slf4jVersion}</version>
- <scope>runtime</scope>
- </dependency>
<dependency>
<groupId>ro.isdc.wro4j</groupId>
@@ -227,7 +221,7 @@
<activation>
<property>
<name>performRelease</name>
- <value>true</value>
+ <value>!true</value>
</property>
</activation>
1
0
March 13, 2013
Author: echatellier
Date: 2013-03-13 11:34:53 +0100 (Wed, 13 Mar 2013)
New Revision: 32
Url: http://nuiton.org/projects/nuiton-js/repository/revisions/32
Log:
Fix build add license and url
Added:
trunk/nuiton-js-lib/
trunk/nuiton-js-lib/LICENSE.txt
trunk/nuiton-js-lib/README.txt
trunk/nuiton-js-lib/changelog.txt
trunk/nuiton-js-lib/pom.xml
trunk/nuiton-js-lib/src/
trunk/nuiton-js-lib/src/main/
trunk/nuiton-js-lib/src/main/resources/
trunk/nuiton-js-lib/src/main/resources/META-INF/
trunk/nuiton-js-lib/src/main/resources/META-INF/nuiton-js/
trunk/nuiton-js-lib/src/main/resources/META-INF/nuiton-js/wro-jqplot.xml
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/excanvas.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/jquery.jqplot.css
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/jquery.jqplot.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.BezierCurveRenderer.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.barRenderer.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.blockRenderer.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.bubbleRenderer.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasAxisLabelRenderer.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasAxisTickRenderer.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasOverlay.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasTextRenderer.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.categoryAxisRenderer.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.ciParser.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.cursor.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.dateAxisRenderer.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.donutRenderer.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.dragable.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.enhancedLegendRenderer.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.funnelRenderer.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.highlighter.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.json2.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.logAxisRenderer.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.mekkoAxisRenderer.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.mekkoRenderer.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.meterGaugeRenderer.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.mobile.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.ohlcRenderer.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pieRenderer.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pointLabels.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pyramidAxisRenderer.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pyramidGridRenderer.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pyramidRenderer.js
trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.trendline.js
trunk/nuiton-js-lib/src/site/
trunk/nuiton-js-lib/src/site/rst/
trunk/nuiton-js-lib/src/site/rst/index.rst
trunk/nuiton-js-lib/src/site/site_fr.xml
Modified:
trunk/nuiton-js-bootstrap/pom.xml
trunk/nuiton-js-bootstrap/src/main/resources/META-INF/nuiton-js/wro-bootstrap.xml
trunk/nuiton-js-bootstrap/src/site/rst/index.rst
trunk/nuiton-js-bootstrap/src/site/site_fr.xml
trunk/nuiton-js-font-awesome/
trunk/nuiton-js-font-awesome/pom.xml
trunk/nuiton-js-font-awesome/src/main/resources/META-INF/nuiton-js/wro-font-awesome.xml
trunk/nuiton-js-font-awesome/src/site/rst/index.rst
trunk/nuiton-js-font-awesome/src/site/site_fr.xml
trunk/nuiton-js-jqgrid/pom.xml
trunk/nuiton-js-jqgrid/src/main/resources/META-INF/nuiton-js/wro-jqgrid.xml
trunk/nuiton-js-jqgrid/src/site/rst/index.rst
trunk/nuiton-js-jqgrid/src/site/site_fr.xml
trunk/nuiton-js-jqplot/pom.xml
trunk/nuiton-js-jqplot/src/main/resources/META-INF/nuiton-js/wro-jqplot.xml
trunk/nuiton-js-jqplot/src/site/rst/index.rst
trunk/nuiton-js-jqplot/src/site/site_fr.xml
trunk/nuiton-js-jquery-ui/pom.xml
trunk/nuiton-js-jquery-ui/src/main/resources/META-INF/nuiton-js/wro-jquery-ui.xml
trunk/nuiton-js-jquery-ui/src/site/rst/index.rst
trunk/nuiton-js-jquery-ui/src/site/site_fr.xml
trunk/nuiton-js-jquery/pom.xml
trunk/nuiton-js-jquery/src/main/resources/META-INF/nuiton-js/wro-jquery.xml
trunk/nuiton-js-jquery/src/site/rst/index.rst
trunk/nuiton-js-jquery/src/site/site_fr.xml
trunk/nuiton-js-jstree/pom.xml
trunk/nuiton-js-jstree/src/main/resources/META-INF/nuiton-js/wro-jstree.xml
trunk/nuiton-js-jstree/src/site/rst/index.rst
trunk/nuiton-js-jstree/src/site/site_fr.xml
trunk/nuiton-js-wro/pom.xml
trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/ForceCssDataUriPreProcessor.java
trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/ImportWildcardXmlModelFactory.java
trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsFilter.java
trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsMavenWroManagerFactory.java
trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsWroConfigurationFactory.java
trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsWroManagerFactory.java
trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsXmlModelFactory.java
trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/ProtectedXmlModelFactory.java
trunk/nuiton-js-wro/src/main/resources/META-INF/web-fragment.xml
trunk/pom.xml
trunk/src/site/rst/index.rst
trunk/src/site/site_fr.xml
Modified: trunk/nuiton-js-bootstrap/pom.xml
===================================================================
(Binary files differ)
Modified: trunk/nuiton-js-bootstrap/src/main/resources/META-INF/nuiton-js/wro-bootstrap.xml
===================================================================
--- trunk/nuiton-js-bootstrap/src/main/resources/META-INF/nuiton-js/wro-bootstrap.xml 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-bootstrap/src/main/resources/META-INF/nuiton-js/wro-bootstrap.xml 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,3 +1,26 @@
+<!--
+ #%L
+ Nuiton JS :: Bootstrap
+ $Id:$
+ $HeadURL:$
+ %%
+ Copyright (C) 2012 - 2013 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
<groups xmlns="http://www.isdc.ro/wro">
<group name='bootstrap'>
Modified: trunk/nuiton-js-bootstrap/src/site/rst/index.rst
===================================================================
--- trunk/nuiton-js-bootstrap/src/site/rst/index.rst 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-bootstrap/src/site/rst/index.rst 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,3 +1,26 @@
+.. -
+.. * #%L
+.. * Nuiton JS :: Bootstrap
+.. * $Id:$
+.. * $HeadURL:$
+.. * %%
+.. * Copyright (C) 2012 - 2013 CodeLutin
+.. * %%
+.. * This program is free software: you can redistribute it and/or modify
+.. * it under the terms of the GNU Lesser General Public License as
+.. * published by the Free Software Foundation, either version 3 of the
+.. * License, or (at your option) any later version.
+.. *
+.. * This program is distributed in the hope that it will be useful,
+.. * but WITHOUT ANY WARRANTY; without even the implied warranty of
+.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+.. * GNU General Lesser Public License for more details.
+.. *
+.. * You should have received a copy of the GNU General Lesser Public
+.. * License along with this program. If not, see
+.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+.. * #L%
+.. -
Utilisation
===========
Modified: trunk/nuiton-js-bootstrap/src/site/site_fr.xml
===================================================================
--- trunk/nuiton-js-bootstrap/src/site/site_fr.xml 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-bootstrap/src/site/site_fr.xml 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,3 +1,26 @@
+<!--
+ #%L
+ Nuiton JS :: Bootstrap
+ $Id:$
+ $HeadURL:$
+ %%
+ Copyright (C) 2012 - 2013 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
<project name="${project.name}">
<bannerLeft>
Property changes on: trunk/nuiton-js-font-awesome
___________________________________________________________________
Added: svn:ignore
+ target
.settings
.classpath
.project
Modified: trunk/nuiton-js-font-awesome/pom.xml
===================================================================
(Binary files differ)
Modified: trunk/nuiton-js-font-awesome/src/main/resources/META-INF/nuiton-js/wro-font-awesome.xml
===================================================================
--- trunk/nuiton-js-font-awesome/src/main/resources/META-INF/nuiton-js/wro-font-awesome.xml 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-font-awesome/src/main/resources/META-INF/nuiton-js/wro-font-awesome.xml 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,3 +1,26 @@
+<!--
+ #%L
+ Nuiton JS :: Font Awesome
+ $Id:$
+ $HeadURL:$
+ %%
+ Copyright (C) 2012 - 2013 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
<groups xmlns="http://www.isdc.ro/wro">
<group name='font-awesome'>
Modified: trunk/nuiton-js-font-awesome/src/site/rst/index.rst
===================================================================
--- trunk/nuiton-js-font-awesome/src/site/rst/index.rst 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-font-awesome/src/site/rst/index.rst 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,3 +1,26 @@
+.. -
+.. * #%L
+.. * Nuiton JS :: Font Awesome
+.. * $Id:$
+.. * $HeadURL:$
+.. * %%
+.. * Copyright (C) 2012 - 2013 CodeLutin
+.. * %%
+.. * This program is free software: you can redistribute it and/or modify
+.. * it under the terms of the GNU Lesser General Public License as
+.. * published by the Free Software Foundation, either version 3 of the
+.. * License, or (at your option) any later version.
+.. *
+.. * This program is distributed in the hope that it will be useful,
+.. * but WITHOUT ANY WARRANTY; without even the implied warranty of
+.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+.. * GNU General Lesser Public License for more details.
+.. *
+.. * You should have received a copy of the GNU General Lesser Public
+.. * License along with this program. If not, see
+.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+.. * #L%
+.. -
Source
======
Modified: trunk/nuiton-js-font-awesome/src/site/site_fr.xml
===================================================================
--- trunk/nuiton-js-font-awesome/src/site/site_fr.xml 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-font-awesome/src/site/site_fr.xml 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,3 +1,26 @@
+<!--
+ #%L
+ Nuiton JS :: Font Awesome
+ $Id:$
+ $HeadURL:$
+ %%
+ Copyright (C) 2012 - 2013 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
<project name="${project.name}">
<bannerLeft>
Modified: trunk/nuiton-js-jqgrid/pom.xml
===================================================================
--- trunk/nuiton-js-jqgrid/pom.xml 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-jqgrid/pom.xml 2013-03-13 10:34:53 UTC (rev 32)
@@ -9,8 +9,9 @@
<parent>
<groupId>org.nuiton.js</groupId>
- <artifactId>nuiton-js-parent</artifactId>
+ <artifactId>nuiton-js-lib</artifactId>
<version>0.1-SNAPSHOT</version>
+ <relativePath>../nuiton-js-lib</relativePath>
</parent>
<artifactId>nuiton-js-jqgrid</artifactId>
@@ -19,15 +20,22 @@
<name>Nuiton JS :: jqGrid</name>
<description>jqGrid jar packaging</description>
+ <url>http://www.trirand.com/</url>
+
+ <licenses>
+ <license>
+ <name>MIT license</name>
+ <url>http://opensource.org/licenses/mit-license.php</url>
+ </license>
+ </licenses>
+
<dependencies>
-
<dependency>
<groupId>org.nuiton.js</groupId>
<artifactId>nuiton-js-jquery</artifactId>
<version>[1.7.2,)</version> <!-- jqgrid compatible avec jquery >= 1.8 -->
<scope>runtime</scope>
</dependency>
-
</dependencies>
</project>
Modified: trunk/nuiton-js-jqgrid/src/main/resources/META-INF/nuiton-js/wro-jqgrid.xml
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/META-INF/nuiton-js/wro-jqgrid.xml 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-jqgrid/src/main/resources/META-INF/nuiton-js/wro-jqgrid.xml 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,3 +1,26 @@
+<!--
+ #%L
+ Nuiton JS :: jqGrid
+ $Id:$
+ $HeadURL:$
+ %%
+ Copyright (C) 2012 - 2013 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
<groups xmlns="http://www.isdc.ro/wro">
<import>classpath:META-INF/nuiton-js/wro-jquery.xml</import>
Modified: trunk/nuiton-js-jqgrid/src/site/rst/index.rst
===================================================================
--- trunk/nuiton-js-jqgrid/src/site/rst/index.rst 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-jqgrid/src/site/rst/index.rst 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,3 +1,26 @@
+.. -
+.. * #%L
+.. * Nuiton JS :: jqGrid
+.. * $Id:$
+.. * $HeadURL:$
+.. * %%
+.. * Copyright (C) 2012 - 2013 CodeLutin
+.. * %%
+.. * This program is free software: you can redistribute it and/or modify
+.. * it under the terms of the GNU Lesser General Public License as
+.. * published by the Free Software Foundation, either version 3 of the
+.. * License, or (at your option) any later version.
+.. *
+.. * This program is distributed in the hope that it will be useful,
+.. * but WITHOUT ANY WARRANTY; without even the implied warranty of
+.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+.. * GNU General Lesser Public License for more details.
+.. *
+.. * You should have received a copy of the GNU General Lesser Public
+.. * License along with this program. If not, see
+.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+.. * #L%
+.. -
Utilisation
===========
Modified: trunk/nuiton-js-jqgrid/src/site/site_fr.xml
===================================================================
--- trunk/nuiton-js-jqgrid/src/site/site_fr.xml 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-jqgrid/src/site/site_fr.xml 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,3 +1,26 @@
+<!--
+ #%L
+ Nuiton JS :: jqGrid
+ $Id:$
+ $HeadURL:$
+ %%
+ Copyright (C) 2012 - 2013 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
<project name="${project.name}">
<bannerLeft>
Modified: trunk/nuiton-js-jqplot/pom.xml
===================================================================
(Binary files differ)
Modified: trunk/nuiton-js-jqplot/src/main/resources/META-INF/nuiton-js/wro-jqplot.xml
===================================================================
--- trunk/nuiton-js-jqplot/src/main/resources/META-INF/nuiton-js/wro-jqplot.xml 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-jqplot/src/main/resources/META-INF/nuiton-js/wro-jqplot.xml 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,3 +1,26 @@
+<!--
+ #%L
+ Nuiton JS :: jqPlot
+ $Id:$
+ $HeadURL:$
+ %%
+ Copyright (C) 2012 - 2013 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
<groups xmlns="http://www.isdc.ro/wro">
<import>classpath:META-INF/nuiton-js/wro-jquery.xml</import>
Modified: trunk/nuiton-js-jqplot/src/site/rst/index.rst
===================================================================
--- trunk/nuiton-js-jqplot/src/site/rst/index.rst 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-jqplot/src/site/rst/index.rst 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,3 +1,26 @@
+.. -
+.. * #%L
+.. * Nuiton JS :: jqPlot
+.. * $Id:$
+.. * $HeadURL:$
+.. * %%
+.. * Copyright (C) 2012 - 2013 CodeLutin
+.. * %%
+.. * This program is free software: you can redistribute it and/or modify
+.. * it under the terms of the GNU Lesser General Public License as
+.. * published by the Free Software Foundation, either version 3 of the
+.. * License, or (at your option) any later version.
+.. *
+.. * This program is distributed in the hope that it will be useful,
+.. * but WITHOUT ANY WARRANTY; without even the implied warranty of
+.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+.. * GNU General Lesser Public License for more details.
+.. *
+.. * You should have received a copy of the GNU General Lesser Public
+.. * License along with this program. If not, see
+.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+.. * #L%
+.. -
Utilisation
===========
Modified: trunk/nuiton-js-jqplot/src/site/site_fr.xml
===================================================================
--- trunk/nuiton-js-jqplot/src/site/site_fr.xml 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-jqplot/src/site/site_fr.xml 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,3 +1,26 @@
+<!--
+ #%L
+ Nuiton JS :: jqPlot
+ $Id:$
+ $HeadURL:$
+ %%
+ Copyright (C) 2012 - 2013 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
<project name="${project.name}">
<bannerLeft>
Modified: trunk/nuiton-js-jquery/pom.xml
===================================================================
(Binary files differ)
Modified: trunk/nuiton-js-jquery/src/main/resources/META-INF/nuiton-js/wro-jquery.xml
===================================================================
--- trunk/nuiton-js-jquery/src/main/resources/META-INF/nuiton-js/wro-jquery.xml 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-jquery/src/main/resources/META-INF/nuiton-js/wro-jquery.xml 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,3 +1,26 @@
+<!--
+ #%L
+ Nuiton JS :: JQuery
+ $Id:$
+ $HeadURL:$
+ %%
+ Copyright (C) 2012 - 2013 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
<groups xmlns="http://www.isdc.ro/wro">
<group name='jquery'>
<js>classpath:nuiton-js-jquery/*.js</js>
Modified: trunk/nuiton-js-jquery/src/site/rst/index.rst
===================================================================
--- trunk/nuiton-js-jquery/src/site/rst/index.rst 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-jquery/src/site/rst/index.rst 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,3 +1,26 @@
+.. -
+.. * #%L
+.. * Nuiton JS :: JQuery
+.. * $Id:$
+.. * $HeadURL:$
+.. * %%
+.. * Copyright (C) 2012 - 2013 CodeLutin
+.. * %%
+.. * This program is free software: you can redistribute it and/or modify
+.. * it under the terms of the GNU Lesser General Public License as
+.. * published by the Free Software Foundation, either version 3 of the
+.. * License, or (at your option) any later version.
+.. *
+.. * This program is distributed in the hope that it will be useful,
+.. * but WITHOUT ANY WARRANTY; without even the implied warranty of
+.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+.. * GNU General Lesser Public License for more details.
+.. *
+.. * You should have received a copy of the GNU General Lesser Public
+.. * License along with this program. If not, see
+.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+.. * #L%
+.. -
Utilisation
===========
Modified: trunk/nuiton-js-jquery/src/site/site_fr.xml
===================================================================
--- trunk/nuiton-js-jquery/src/site/site_fr.xml 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-jquery/src/site/site_fr.xml 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,3 +1,26 @@
+<!--
+ #%L
+ Nuiton JS :: JQuery
+ $Id:$
+ $HeadURL:$
+ %%
+ Copyright (C) 2012 - 2013 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
<project name="${project.name}">
<bannerLeft>
Modified: trunk/nuiton-js-jquery-ui/pom.xml
===================================================================
(Binary files differ)
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/META-INF/nuiton-js/wro-jquery-ui.xml
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/META-INF/nuiton-js/wro-jquery-ui.xml 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/META-INF/nuiton-js/wro-jquery-ui.xml 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,3 +1,26 @@
+<!--
+ #%L
+ Nuiton JS :: JQuery UI
+ $Id:$
+ $HeadURL:$
+ %%
+ Copyright (C) 2012 - 2013 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
<groups xmlns="http://www.isdc.ro/wro">
<import>classpath:META-INF/nuiton-js/wro-jquery.xml</import>
Modified: trunk/nuiton-js-jquery-ui/src/site/rst/index.rst
===================================================================
--- trunk/nuiton-js-jquery-ui/src/site/rst/index.rst 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-jquery-ui/src/site/rst/index.rst 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,3 +1,26 @@
+.. -
+.. * #%L
+.. * Nuiton JS :: JQuery UI
+.. * $Id:$
+.. * $HeadURL:$
+.. * %%
+.. * Copyright (C) 2012 - 2013 CodeLutin
+.. * %%
+.. * This program is free software: you can redistribute it and/or modify
+.. * it under the terms of the GNU Lesser General Public License as
+.. * published by the Free Software Foundation, either version 3 of the
+.. * License, or (at your option) any later version.
+.. *
+.. * This program is distributed in the hope that it will be useful,
+.. * but WITHOUT ANY WARRANTY; without even the implied warranty of
+.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+.. * GNU General Lesser Public License for more details.
+.. *
+.. * You should have received a copy of the GNU General Lesser Public
+.. * License along with this program. If not, see
+.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+.. * #L%
+.. -
Utilisation
===========
Modified: trunk/nuiton-js-jquery-ui/src/site/site_fr.xml
===================================================================
--- trunk/nuiton-js-jquery-ui/src/site/site_fr.xml 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-jquery-ui/src/site/site_fr.xml 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,3 +1,26 @@
+<!--
+ #%L
+ Nuiton JS :: JQuery UI
+ $Id:$
+ $HeadURL:$
+ %%
+ Copyright (C) 2012 - 2013 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
<project name="${project.name}">
<bannerLeft>
Modified: trunk/nuiton-js-jstree/pom.xml
===================================================================
(Binary files differ)
Modified: trunk/nuiton-js-jstree/src/main/resources/META-INF/nuiton-js/wro-jstree.xml
===================================================================
--- trunk/nuiton-js-jstree/src/main/resources/META-INF/nuiton-js/wro-jstree.xml 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-jstree/src/main/resources/META-INF/nuiton-js/wro-jstree.xml 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,3 +1,26 @@
+<!--
+ #%L
+ Nuiton JS :: JsTree
+ $Id:$
+ $HeadURL:$
+ %%
+ Copyright (C) 2012 - 2013 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
<groups xmlns="http://www.isdc.ro/wro">
<import>classpath:META-INF/nuiton-js/wro-jquery.xml</import>
Modified: trunk/nuiton-js-jstree/src/site/rst/index.rst
===================================================================
--- trunk/nuiton-js-jstree/src/site/rst/index.rst 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-jstree/src/site/rst/index.rst 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,3 +1,26 @@
+.. -
+.. * #%L
+.. * Nuiton JS :: JsTree
+.. * $Id:$
+.. * $HeadURL:$
+.. * %%
+.. * Copyright (C) 2012 - 2013 CodeLutin
+.. * %%
+.. * This program is free software: you can redistribute it and/or modify
+.. * it under the terms of the GNU Lesser General Public License as
+.. * published by the Free Software Foundation, either version 3 of the
+.. * License, or (at your option) any later version.
+.. *
+.. * This program is distributed in the hope that it will be useful,
+.. * but WITHOUT ANY WARRANTY; without even the implied warranty of
+.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+.. * GNU General Lesser Public License for more details.
+.. *
+.. * You should have received a copy of the GNU General Lesser Public
+.. * License along with this program. If not, see
+.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+.. * #L%
+.. -
Utilisation
===========
Modified: trunk/nuiton-js-jstree/src/site/site_fr.xml
===================================================================
--- trunk/nuiton-js-jstree/src/site/site_fr.xml 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-jstree/src/site/site_fr.xml 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,3 +1,26 @@
+<!--
+ #%L
+ Nuiton JS :: JsTree
+ $Id:$
+ $HeadURL:$
+ %%
+ Copyright (C) 2012 - 2013 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
<project name="${project.name}">
<bannerLeft>
Property changes on: trunk/nuiton-js-lib
___________________________________________________________________
Added: svn:ignore
+ target
.settings
.project
Added: trunk/nuiton-js-lib/LICENSE.txt
===================================================================
--- trunk/nuiton-js-lib/LICENSE.txt (rev 0)
+++ trunk/nuiton-js-lib/LICENSE.txt 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,166 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
+
Added: trunk/nuiton-js-lib/README.txt
===================================================================
(Binary files differ)
Property changes on: trunk/nuiton-js-lib/README.txt
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/nuiton-js-lib/changelog.txt
===================================================================
--- trunk/nuiton-js-lib/changelog.txt (rev 0)
+++ trunk/nuiton-js-lib/changelog.txt 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,2 @@
+Please refer to the release note :
+ http://maven-site.nuiton.org/nuiton-js/changes-report.html
Added: trunk/nuiton-js-lib/pom.xml
===================================================================
(Binary files differ)
Property changes on: trunk/nuiton-js-lib/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: trunk/nuiton-js-lib/src/main/resources/META-INF/nuiton-js/wro-jqplot.xml
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/META-INF/nuiton-js/wro-jqplot.xml (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/META-INF/nuiton-js/wro-jqplot.xml 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,171 @@
+<!--
+ #%L
+ Nuiton JS :: Libraries
+ $Id:$
+ $HeadURL:$
+ %%
+ Copyright (C) 2012 - 2013 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
+<groups xmlns="http://www.isdc.ro/wro">
+
+<import>classpath:META-INF/nuiton-js/wro-jquery.xml</import>
+
+ <group name='jqplot'>
+ <group-ref>jquery</group-ref>
+ <group-ref>jqplot-only</group-ref>
+ </group>
+
+ <group name='jqplot-only'>
+ <css>classpath:nuiton-js-jqplot/jquery.jqplot.css</css>
+ <js>classpath:nuiton-js-jqplot/jquery.jqplot.js</js>
+ </group>
+
+ <group name='jqplot-excanvas'>
+ <js>classpath:nuiton-js-jqplot/excanvas.js</js>
+ </group>
+
+ <group name='jqplot-all-plugins'>
+ <js>classpath:nuiton-js-jqplot/plugins/*.js</js>
+ </group>
+
+ <!--
+ | le reste du fichier est genere par generate-plugin-group.sh a la
+ | racine du module
+ +-->
+
+ <group name='jqplot.BezierCurveRenderer'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.BezierCurveRenderer.js</js>
+ </group>
+
+ <group name='jqplot.barRenderer'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.barRenderer.js</js>
+ </group>
+
+ <group name='jqplot.blockRenderer'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.blockRenderer.js</js>
+ </group>
+
+ <group name='jqplot.bubbleRenderer'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.bubbleRenderer.js</js>
+ </group>
+
+ <group name='jqplot.canvasAxisLabelRenderer'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.canvasAxisLabelRenderer.js</js>
+ </group>
+
+ <group name='jqplot.canvasAxisTickRenderer'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.canvasAxisTickRenderer.js</js>
+ </group>
+
+ <group name='jqplot.canvasOverlay'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.canvasOverlay.js</js>
+ </group>
+
+ <group name='jqplot.canvasTextRenderer'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.canvasTextRenderer.js</js>
+ </group>
+
+ <group name='jqplot.categoryAxisRenderer'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.categoryAxisRenderer.js</js>
+ </group>
+
+ <group name='jqplot.ciParser'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.ciParser.js</js>
+ </group>
+
+ <group name='jqplot.cursor'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.cursor.js</js>
+ </group>
+
+ <group name='jqplot.dateAxisRenderer'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.dateAxisRenderer.js</js>
+ </group>
+
+ <group name='jqplot.donutRenderer'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.donutRenderer.js</js>
+ </group>
+
+ <group name='jqplot.dragable'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.dragable.js</js>
+ </group>
+
+ <group name='jqplot.enhancedLegendRenderer'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.enhancedLegendRenderer.js</js>
+ </group>
+
+ <group name='jqplot.funnelRenderer'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.funnelRenderer.js</js>
+ </group>
+
+ <group name='jqplot.highlighter'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.highlighter.js</js>
+ </group>
+
+ <group name='jqplot.json2'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.json2.js</js>
+ </group>
+
+ <group name='jqplot.logAxisRenderer'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.logAxisRenderer.js</js>
+ </group>
+
+ <group name='jqplot.mekkoAxisRenderer'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.mekkoAxisRenderer.js</js>
+ </group>
+
+ <group name='jqplot.mekkoRenderer'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.mekkoRenderer.js</js>
+ </group>
+
+ <group name='jqplot.meterGaugeRenderer'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.meterGaugeRenderer.js</js>
+ </group>
+
+ <group name='jqplot.mobile'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.mobile.js</js>
+ </group>
+
+ <group name='jqplot.ohlcRenderer'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.ohlcRenderer.js</js>
+ </group>
+
+ <group name='jqplot.pieRenderer'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.pieRenderer.js</js>
+ </group>
+
+ <group name='jqplot.pointLabels'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.pointLabels.js</js>
+ </group>
+
+ <group name='jqplot.pyramidAxisRenderer'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.pyramidAxisRenderer.js</js>
+ </group>
+
+ <group name='jqplot.pyramidGridRenderer'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.pyramidGridRenderer.js</js>
+ </group>
+
+ <group name='jqplot.pyramidRenderer'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.pyramidRenderer.js</js>
+ </group>
+
+ <group name='jqplot.trendline'>
+ <js>classpath:nuiton-js-jqplot/plugins/jqplot.trendline.js</js>
+ </group>
+
+</groups>
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/excanvas.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/excanvas.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/excanvas.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,1461 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+// Memory Leaks patch from http://explorercanvas.googlecode.com/svn/trunk/
+// svn : r73
+// ------------------------------------------------------------------
+// Copyright 2006 Google Inc.
+//
+// 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.
+
+
+// Known Issues:
+//
+// * Patterns only support repeat.
+// * Radial gradient are not implemented. The VML version of these look very
+// different from the canvas one.
+// * Clipping paths are not implemented.
+// * Coordsize. The width and height attribute have higher priority than the
+// width and height style values which isn't correct.
+// * Painting mode isn't implemented.
+// * Canvas width/height should is using content-box by default. IE in
+// Quirks mode will draw the canvas using border-box. Either change your
+// doctype to HTML5
+// (http://www.whatwg.org/specs/web-apps/current-work/#the-doctype)
+// or use Box Sizing Behavior from WebFX
+// (http://webfx.eae.net/dhtml/boxsizing/boxsizing.html)
+// * Non uniform scaling does not correctly scale strokes.
+// * Optimize. There is always room for speed improvements.
+
+// Only add this code if we do not already have a canvas implementation
+if (!document.createElement('canvas').getContext) {
+
+(function() {
+
+ // alias some functions to make (compiled) code shorter
+ var m = Math;
+ var mr = m.round;
+ var ms = m.sin;
+ var mc = m.cos;
+ var abs = m.abs;
+ var sqrt = m.sqrt;
+
+ // this is used for sub pixel precision
+ var Z = 10;
+ var Z2 = Z / 2;
+
+ var IE_VERSION = +navigator.userAgent.match(/MSIE ([\d.]+)?/)[1];
+
+ /**
+ * This funtion is assigned to the <canvas> elements as element.getContext().
+ * @this {HTMLElement}
+ * @return {CanvasRenderingContext2D_}
+ */
+ function getContext() {
+ return this.context_ ||
+ (this.context_ = new CanvasRenderingContext2D_(this));
+ }
+
+ var slice = Array.prototype.slice;
+
+ /**
+ * Binds a function to an object. The returned function will always use the
+ * passed in {@code obj} as {@code this}.
+ *
+ * Example:
+ *
+ * g = bind(f, obj, a, b)
+ * g(c, d) // will do f.call(obj, a, b, c, d)
+ *
+ * @param {Function} f The function to bind the object to
+ * @param {Object} obj The object that should act as this when the function
+ * is called
+ * @param {*} var_args Rest arguments that will be used as the initial
+ * arguments when the function is called
+ * @return {Function} A new function that has bound this
+ */
+ function bind(f, obj, var_args) {
+ var a = slice.call(arguments, 2);
+ return function() {
+ return f.apply(obj, a.concat(slice.call(arguments)));
+ };
+ }
+
+ function encodeHtmlAttribute(s) {
+ return String(s).replace(/&/g, '&').replace(/"/g, '"');
+ }
+
+ function addNamespace(doc, prefix, urn) {
+ if (!doc.namespaces[prefix]) {
+ doc.namespaces.add(prefix, urn, '#default#VML');
+ }
+ }
+
+ function addNamespacesAndStylesheet(doc) {
+ addNamespace(doc, 'g_vml_', 'urn:schemas-microsoft-com:vml');
+ addNamespace(doc, 'g_o_', 'urn:schemas-microsoft-com:office:office');
+
+ // Setup default CSS. Only add one style sheet per document
+ if (!doc.styleSheets['ex_canvas_']) {
+ var ss = doc.createStyleSheet();
+ ss.owningElement.id = 'ex_canvas_';
+ ss.cssText = 'canvas{display:inline-block;overflow:hidden;' +
+ // default size is 300x150 in Gecko and Opera
+ 'text-align:left;width:300px;height:150px}';
+ }
+ }
+
+ // Add namespaces and stylesheet at startup.
+ addNamespacesAndStylesheet(document);
+
+ var G_vmlCanvasManager_ = {
+ init: function(opt_doc) {
+ var doc = opt_doc || document;
+ // Create a dummy element so that IE will allow canvas elements to be
+ // recognized.
+ doc.createElement('canvas');
+ doc.attachEvent('onreadystatechange', bind(this.init_, this, doc));
+ },
+
+ init_: function(doc) {
+ // find all canvas elements
+ var els = doc.getElementsByTagName('canvas');
+ for (var i = 0; i < els.length; i++) {
+ this.initElement(els[i]);
+ }
+ },
+
+ /**
+ * Public initializes a canvas element so that it can be used as canvas
+ * element from now on. This is called automatically before the page is
+ * loaded but if you are creating elements using createElement you need to
+ * make sure this is called on the element.
+ * @param {HTMLElement} el The canvas element to initialize.
+ * @return {HTMLElement} the element that was created.
+ */
+ initElement: function(el) {
+ if (!el.getContext) {
+ el.getContext = getContext;
+
+ // Add namespaces and stylesheet to document of the element.
+ addNamespacesAndStylesheet(el.ownerDocument);
+
+ // Remove fallback content. There is no way to hide text nodes so we
+ // just remove all childNodes. We could hide all elements and remove
+ // text nodes but who really cares about the fallback content.
+ el.innerHTML = '';
+
+ // do not use inline function because that will leak memory
+ el.attachEvent('onpropertychange', onPropertyChange);
+ el.attachEvent('onresize', onResize);
+
+ var attrs = el.attributes;
+ if (attrs.width && attrs.width.specified) {
+ // TODO: use runtimeStyle and coordsize
+ // el.getContext().setWidth_(attrs.width.nodeValue);
+ el.style.width = attrs.width.nodeValue + 'px';
+ } else {
+ el.width = el.clientWidth;
+ }
+ if (attrs.height && attrs.height.specified) {
+ // TODO: use runtimeStyle and coordsize
+ // el.getContext().setHeight_(attrs.height.nodeValue);
+ el.style.height = attrs.height.nodeValue + 'px';
+ } else {
+ el.height = el.clientHeight;
+ }
+ //el.getContext().setCoordsize_()
+ }
+ return el;
+ },
+
+ // Memory Leaks patch : see http://code.google.com/p/explorercanvas/issues/detail?id=82
+ uninitElement: function(el){
+ if (el.getContext) {
+ var ctx = el.getContext();
+ delete ctx.element_;
+ delete ctx.canvas;
+ el.innerHTML = "";
+ //el.outerHTML = "";
+ el.context_ = null;
+ el.getContext = null;
+ el.detachEvent("onpropertychange", onPropertyChange);
+ el.detachEvent("onresize", onResize);
+ }
+ }
+ };
+
+ function onPropertyChange(e) {
+ var el = e.srcElement;
+
+ switch (e.propertyName) {
+ case 'width':
+ el.getContext().clearRect();
+ el.style.width = el.attributes.width.nodeValue + 'px';
+ // In IE8 this does not trigger onresize.
+ el.firstChild.style.width = el.clientWidth + 'px';
+ break;
+ case 'height':
+ el.getContext().clearRect();
+ el.style.height = el.attributes.height.nodeValue + 'px';
+ el.firstChild.style.height = el.clientHeight + 'px';
+ break;
+ }
+ }
+
+ function onResize(e) {
+ var el = e.srcElement;
+ if (el.firstChild) {
+ el.firstChild.style.width = el.clientWidth + 'px';
+ el.firstChild.style.height = el.clientHeight + 'px';
+ }
+ }
+
+ G_vmlCanvasManager_.init();
+
+ // precompute "00" to "FF"
+ var decToHex = [];
+ for (var i = 0; i < 16; i++) {
+ for (var j = 0; j < 16; j++) {
+ decToHex[i * 16 + j] = i.toString(16) + j.toString(16);
+ }
+ }
+
+ function createMatrixIdentity() {
+ return [
+ [1, 0, 0],
+ [0, 1, 0],
+ [0, 0, 1]
+ ];
+ }
+
+ function matrixMultiply(m1, m2) {
+ var result = createMatrixIdentity();
+
+ for (var x = 0; x < 3; x++) {
+ for (var y = 0; y < 3; y++) {
+ var sum = 0;
+
+ for (var z = 0; z < 3; z++) {
+ sum += m1[x][z] * m2[z][y];
+ }
+
+ result[x][y] = sum;
+ }
+ }
+ return result;
+ }
+
+ function copyState(o1, o2) {
+ o2.fillStyle = o1.fillStyle;
+ o2.lineCap = o1.lineCap;
+ o2.lineJoin = o1.lineJoin;
+ o2.lineWidth = o1.lineWidth;
+ o2.miterLimit = o1.miterLimit;
+ o2.shadowBlur = o1.shadowBlur;
+ o2.shadowColor = o1.shadowColor;
+ o2.shadowOffsetX = o1.shadowOffsetX;
+ o2.shadowOffsetY = o1.shadowOffsetY;
+ o2.strokeStyle = o1.strokeStyle;
+ o2.globalAlpha = o1.globalAlpha;
+ o2.font = o1.font;
+ o2.textAlign = o1.textAlign;
+ o2.textBaseline = o1.textBaseline;
+ o2.arcScaleX_ = o1.arcScaleX_;
+ o2.arcScaleY_ = o1.arcScaleY_;
+ o2.lineScale_ = o1.lineScale_;
+ }
+
+ var colorData = {
+ aliceblue: '#F0F8FF',
+ antiquewhite: '#FAEBD7',
+ aquamarine: '#7FFFD4',
+ azure: '#F0FFFF',
+ beige: '#F5F5DC',
+ bisque: '#FFE4C4',
+ black: '#000000',
+ blanchedalmond: '#FFEBCD',
+ 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',
+ darkgrey: '#A9A9A9',
+ darkkhaki: '#BDB76B',
+ darkmagenta: '#8B008B',
+ darkolivegreen: '#556B2F',
+ darkorange: '#FF8C00',
+ darkorchid: '#9932CC',
+ darkred: '#8B0000',
+ darksalmon: '#E9967A',
+ darkseagreen: '#8FBC8F',
+ darkslateblue: '#483D8B',
+ darkslategray: '#2F4F4F',
+ darkslategrey: '#2F4F4F',
+ darkturquoise: '#00CED1',
+ darkviolet: '#9400D3',
+ deeppink: '#FF1493',
+ deepskyblue: '#00BFFF',
+ dimgray: '#696969',
+ dimgrey: '#696969',
+ dodgerblue: '#1E90FF',
+ firebrick: '#B22222',
+ floralwhite: '#FFFAF0',
+ forestgreen: '#228B22',
+ gainsboro: '#DCDCDC',
+ ghostwhite: '#F8F8FF',
+ gold: '#FFD700',
+ goldenrod: '#DAA520',
+ grey: '#808080',
+ 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',
+ lightgreen: '#90EE90',
+ lightgrey: '#D3D3D3',
+ lightpink: '#FFB6C1',
+ lightsalmon: '#FFA07A',
+ lightseagreen: '#20B2AA',
+ lightskyblue: '#87CEFA',
+ lightslategray: '#778899',
+ lightslategrey: '#778899',
+ lightsteelblue: '#B0C4DE',
+ lightyellow: '#FFFFE0',
+ limegreen: '#32CD32',
+ linen: '#FAF0E6',
+ magenta: '#FF00FF',
+ mediumaquamarine: '#66CDAA',
+ mediumblue: '#0000CD',
+ mediumorchid: '#BA55D3',
+ mediumpurple: '#9370DB',
+ mediumseagreen: '#3CB371',
+ mediumslateblue: '#7B68EE',
+ mediumspringgreen: '#00FA9A',
+ mediumturquoise: '#48D1CC',
+ mediumvioletred: '#C71585',
+ midnightblue: '#191970',
+ mintcream: '#F5FFFA',
+ mistyrose: '#FFE4E1',
+ moccasin: '#FFE4B5',
+ navajowhite: '#FFDEAD',
+ oldlace: '#FDF5E6',
+ olivedrab: '#6B8E23',
+ orange: '#FFA500',
+ orangered: '#FF4500',
+ orchid: '#DA70D6',
+ palegoldenrod: '#EEE8AA',
+ palegreen: '#98FB98',
+ paleturquoise: '#AFEEEE',
+ palevioletred: '#DB7093',
+ papayawhip: '#FFEFD5',
+ peachpuff: '#FFDAB9',
+ peru: '#CD853F',
+ pink: '#FFC0CB',
+ plum: '#DDA0DD',
+ powderblue: '#B0E0E6',
+ rosybrown: '#BC8F8F',
+ royalblue: '#4169E1',
+ saddlebrown: '#8B4513',
+ salmon: '#FA8072',
+ sandybrown: '#F4A460',
+ seagreen: '#2E8B57',
+ seashell: '#FFF5EE',
+ sienna: '#A0522D',
+ skyblue: '#87CEEB',
+ slateblue: '#6A5ACD',
+ slategray: '#708090',
+ slategrey: '#708090',
+ snow: '#FFFAFA',
+ springgreen: '#00FF7F',
+ steelblue: '#4682B4',
+ tan: '#D2B48C',
+ thistle: '#D8BFD8',
+ tomato: '#FF6347',
+ turquoise: '#40E0D0',
+ violet: '#EE82EE',
+ wheat: '#F5DEB3',
+ whitesmoke: '#F5F5F5',
+ yellowgreen: '#9ACD32'
+ };
+
+
+ function getRgbHslContent(styleString) {
+ var start = styleString.indexOf('(', 3);
+ var end = styleString.indexOf(')', start + 1);
+ var parts = styleString.substring(start + 1, end).split(',');
+ // add alpha if needed
+ if (parts.length != 4 || styleString.charAt(3) != 'a') {
+ parts[3] = 1;
+ }
+ return parts;
+ }
+
+ function percent(s) {
+ return parseFloat(s) / 100;
+ }
+
+ function clamp(v, min, max) {
+ return Math.min(max, Math.max(min, v));
+ }
+
+ function hslToRgb(parts){
+ var r, g, b, h, s, l;
+ h = parseFloat(parts[0]) / 360 % 360;
+ if (h < 0)
+ h++;
+ s = clamp(percent(parts[1]), 0, 1);
+ l = clamp(percent(parts[2]), 0, 1);
+ if (s == 0) {
+ r = g = b = l; // achromatic
+ } else {
+ var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
+ var p = 2 * l - q;
+ r = hueToRgb(p, q, h + 1 / 3);
+ g = hueToRgb(p, q, h);
+ b = hueToRgb(p, q, h - 1 / 3);
+ }
+
+ return '#' + decToHex[Math.floor(r * 255)] +
+ decToHex[Math.floor(g * 255)] +
+ decToHex[Math.floor(b * 255)];
+ }
+
+ function hueToRgb(m1, m2, h) {
+ if (h < 0)
+ h++;
+ if (h > 1)
+ h--;
+
+ if (6 * h < 1)
+ return m1 + (m2 - m1) * 6 * h;
+ else if (2 * h < 1)
+ return m2;
+ else if (3 * h < 2)
+ return m1 + (m2 - m1) * (2 / 3 - h) * 6;
+ else
+ return m1;
+ }
+
+ var processStyleCache = {};
+
+ function processStyle(styleString) {
+ if (styleString in processStyleCache) {
+ return processStyleCache[styleString];
+ }
+
+ var str, alpha = 1;
+
+ styleString = String(styleString);
+ if (styleString.charAt(0) == '#') {
+ str = styleString;
+ } else if (/^rgb/.test(styleString)) {
+ var parts = getRgbHslContent(styleString);
+ var str = '#', n;
+ for (var i = 0; i < 3; i++) {
+ if (parts[i].indexOf('%') != -1) {
+ n = Math.floor(percent(parts[i]) * 255);
+ } else {
+ n = +parts[i];
+ }
+ str += decToHex[clamp(n, 0, 255)];
+ }
+ alpha = +parts[3];
+ } else if (/^hsl/.test(styleString)) {
+ var parts = getRgbHslContent(styleString);
+ str = hslToRgb(parts);
+ alpha = parts[3];
+ } else {
+ str = colorData[styleString] || styleString;
+ }
+ return processStyleCache[styleString] = {color: str, alpha: alpha};
+ }
+
+ var DEFAULT_STYLE = {
+ style: 'normal',
+ variant: 'normal',
+ weight: 'normal',
+ size: 10,
+ family: 'sans-serif'
+ };
+
+ // Internal text style cache
+ var fontStyleCache = {};
+
+ function processFontStyle(styleString) {
+ if (fontStyleCache[styleString]) {
+ return fontStyleCache[styleString];
+ }
+
+ var el = document.createElement('div');
+ var style = el.style;
+ try {
+ style.font = styleString;
+ } catch (ex) {
+ // Ignore failures to set to invalid font.
+ }
+
+ return fontStyleCache[styleString] = {
+ style: style.fontStyle || DEFAULT_STYLE.style,
+ variant: style.fontVariant || DEFAULT_STYLE.variant,
+ weight: style.fontWeight || DEFAULT_STYLE.weight,
+ size: style.fontSize || DEFAULT_STYLE.size,
+ family: style.fontFamily || DEFAULT_STYLE.family
+ };
+ }
+
+ function getComputedStyle(style, element) {
+ var computedStyle = {};
+
+ for (var p in style) {
+ computedStyle[p] = style[p];
+ }
+
+ // Compute the size
+ var canvasFontSize = parseFloat(element.currentStyle.fontSize),
+ fontSize = parseFloat(style.size);
+
+ if (typeof style.size == 'number') {
+ computedStyle.size = style.size;
+ } else if (style.size.indexOf('px') != -1) {
+ computedStyle.size = fontSize;
+ } else if (style.size.indexOf('em') != -1) {
+ computedStyle.size = canvasFontSize * fontSize;
+ } else if(style.size.indexOf('%') != -1) {
+ computedStyle.size = (canvasFontSize / 100) * fontSize;
+ } else if (style.size.indexOf('pt') != -1) {
+ computedStyle.size = fontSize / .75;
+ } else {
+ computedStyle.size = canvasFontSize;
+ }
+
+ // Different scaling between normal text and VML text. This was found using
+ // trial and error to get the same size as non VML text.
+ computedStyle.size *= 0.981;
+
+ // Fix for VML handling of bare font family names. Add a '' around font family names.
+ computedStyle.family = "'" + computedStyle.family.replace(/(\'|\")/g,'').replace(/\s*,\s*/g, "', '") + "'";
+
+ return computedStyle;
+ }
+
+ function buildStyle(style) {
+ return style.style + ' ' + style.variant + ' ' + style.weight + ' ' +
+ style.size + 'px ' + style.family;
+ }
+
+ var lineCapMap = {
+ 'butt': 'flat',
+ 'round': 'round'
+ };
+
+ function processLineCap(lineCap) {
+ return lineCapMap[lineCap] || 'square';
+ }
+
+ /**
+ * This class implements CanvasRenderingContext2D interface as described by
+ * the WHATWG.
+ * @param {HTMLElement} canvasElement The element that the 2D context should
+ * be associated with
+ */
+ function CanvasRenderingContext2D_(canvasElement) {
+ this.m_ = createMatrixIdentity();
+
+ this.mStack_ = [];
+ this.aStack_ = [];
+ this.currentPath_ = [];
+
+ // Canvas context properties
+ this.strokeStyle = '#000';
+ this.fillStyle = '#000';
+
+ this.lineWidth = 1;
+ this.lineJoin = 'miter';
+ this.lineCap = 'butt';
+ this.miterLimit = Z * 1;
+ this.globalAlpha = 1;
+ this.font = '10px sans-serif';
+ this.textAlign = 'left';
+ this.textBaseline = 'alphabetic';
+ this.canvas = canvasElement;
+
+ var cssText = 'width:' + canvasElement.clientWidth + 'px;height:' +
+ canvasElement.clientHeight + 'px;overflow:hidden;position:absolute';
+ var el = canvasElement.ownerDocument.createElement('div');
+ el.style.cssText = cssText;
+ canvasElement.appendChild(el);
+
+ var overlayEl = el.cloneNode(false);
+ // Use a non transparent background.
+ overlayEl.style.backgroundColor = 'red';
+ overlayEl.style.filter = 'alpha(opacity=0)';
+ canvasElement.appendChild(overlayEl);
+
+ this.element_ = el;
+ this.arcScaleX_ = 1;
+ this.arcScaleY_ = 1;
+ this.lineScale_ = 1;
+ }
+
+ var contextPrototype = CanvasRenderingContext2D_.prototype;
+ contextPrototype.clearRect = function() {
+ if (this.textMeasureEl_) {
+ this.textMeasureEl_.removeNode(true);
+ this.textMeasureEl_ = null;
+ }
+ this.element_.innerHTML = '';
+ };
+
+ contextPrototype.beginPath = function() {
+ // TODO: Branch current matrix so that save/restore has no effect
+ // as per safari docs.
+ this.currentPath_ = [];
+ };
+
+ contextPrototype.moveTo = function(aX, aY) {
+ var p = getCoords(this, aX, aY);
+ this.currentPath_.push({type: 'moveTo', x: p.x, y: p.y});
+ this.currentX_ = p.x;
+ this.currentY_ = p.y;
+ };
+
+ contextPrototype.lineTo = function(aX, aY) {
+ var p = getCoords(this, aX, aY);
+ this.currentPath_.push({type: 'lineTo', x: p.x, y: p.y});
+
+ this.currentX_ = p.x;
+ this.currentY_ = p.y;
+ };
+
+ contextPrototype.bezierCurveTo = function(aCP1x, aCP1y,
+ aCP2x, aCP2y,
+ aX, aY) {
+ var p = getCoords(this, aX, aY);
+ var cp1 = getCoords(this, aCP1x, aCP1y);
+ var cp2 = getCoords(this, aCP2x, aCP2y);
+ bezierCurveTo(this, cp1, cp2, p);
+ };
+
+ // Helper function that takes the already fixed cordinates.
+ function bezierCurveTo(self, cp1, cp2, p) {
+ self.currentPath_.push({
+ type: 'bezierCurveTo',
+ cp1x: cp1.x,
+ cp1y: cp1.y,
+ cp2x: cp2.x,
+ cp2y: cp2.y,
+ x: p.x,
+ y: p.y
+ });
+ self.currentX_ = p.x;
+ self.currentY_ = p.y;
+ }
+
+ contextPrototype.quadraticCurveTo = function(aCPx, aCPy, aX, aY) {
+ // the following is lifted almost directly from
+ // http://developer.mozilla.org/en/docs/Canvas_tutorial:Drawing_shapes
+
+ var cp = getCoords(this, aCPx, aCPy);
+ var p = getCoords(this, aX, aY);
+
+ var cp1 = {
+ x: this.currentX_ + 2.0 / 3.0 * (cp.x - this.currentX_),
+ y: this.currentY_ + 2.0 / 3.0 * (cp.y - this.currentY_)
+ };
+ var cp2 = {
+ x: cp1.x + (p.x - this.currentX_) / 3.0,
+ y: cp1.y + (p.y - this.currentY_) / 3.0
+ };
+
+ bezierCurveTo(this, cp1, cp2, p);
+ };
+
+ contextPrototype.arc = function(aX, aY, aRadius,
+ aStartAngle, aEndAngle, aClockwise) {
+ aRadius *= Z;
+ var arcType = aClockwise ? 'at' : 'wa';
+
+ var xStart = aX + mc(aStartAngle) * aRadius - Z2;
+ var yStart = aY + ms(aStartAngle) * aRadius - Z2;
+
+ var xEnd = aX + mc(aEndAngle) * aRadius - Z2;
+ var yEnd = aY + ms(aEndAngle) * aRadius - Z2;
+
+ // IE won't render arches drawn counter clockwise if xStart == xEnd.
+ if (xStart == xEnd && !aClockwise) {
+ xStart += 0.125; // Offset xStart by 1/80 of a pixel. Use something
+ // that can be represented in binary
+ }
+
+ var p = getCoords(this, aX, aY);
+ var pStart = getCoords(this, xStart, yStart);
+ var pEnd = getCoords(this, xEnd, yEnd);
+
+ this.currentPath_.push({type: arcType,
+ x: p.x,
+ y: p.y,
+ radius: aRadius,
+ xStart: pStart.x,
+ yStart: pStart.y,
+ xEnd: pEnd.x,
+ yEnd: pEnd.y});
+
+ };
+
+ contextPrototype.rect = function(aX, aY, aWidth, aHeight) {
+ this.moveTo(aX, aY);
+ this.lineTo(aX + aWidth, aY);
+ this.lineTo(aX + aWidth, aY + aHeight);
+ this.lineTo(aX, aY + aHeight);
+ this.closePath();
+ };
+
+ contextPrototype.strokeRect = function(aX, aY, aWidth, aHeight) {
+ var oldPath = this.currentPath_;
+ this.beginPath();
+
+ this.moveTo(aX, aY);
+ this.lineTo(aX + aWidth, aY);
+ this.lineTo(aX + aWidth, aY + aHeight);
+ this.lineTo(aX, aY + aHeight);
+ this.closePath();
+ this.stroke();
+
+ this.currentPath_ = oldPath;
+ };
+
+ contextPrototype.fillRect = function(aX, aY, aWidth, aHeight) {
+ var oldPath = this.currentPath_;
+ this.beginPath();
+
+ this.moveTo(aX, aY);
+ this.lineTo(aX + aWidth, aY);
+ this.lineTo(aX + aWidth, aY + aHeight);
+ this.lineTo(aX, aY + aHeight);
+ this.closePath();
+ this.fill();
+
+ this.currentPath_ = oldPath;
+ };
+
+ contextPrototype.createLinearGradient = function(aX0, aY0, aX1, aY1) {
+ var gradient = new CanvasGradient_('gradient');
+ gradient.x0_ = aX0;
+ gradient.y0_ = aY0;
+ gradient.x1_ = aX1;
+ gradient.y1_ = aY1;
+ return gradient;
+ };
+
+ contextPrototype.createRadialGradient = function(aX0, aY0, aR0,
+ aX1, aY1, aR1) {
+ var gradient = new CanvasGradient_('gradientradial');
+ gradient.x0_ = aX0;
+ gradient.y0_ = aY0;
+ gradient.r0_ = aR0;
+ gradient.x1_ = aX1;
+ gradient.y1_ = aY1;
+ gradient.r1_ = aR1;
+ return gradient;
+ };
+
+ contextPrototype.drawImage = function(image, var_args) {
+ var dx, dy, dw, dh, sx, sy, sw, sh;
+
+ // to find the original width we overide the width and height
+ var oldRuntimeWidth = image.runtimeStyle.width;
+ var oldRuntimeHeight = image.runtimeStyle.height;
+ image.runtimeStyle.width = 'auto';
+ image.runtimeStyle.height = 'auto';
+
+ // get the original size
+ var w = image.width;
+ var h = image.height;
+
+ // and remove overides
+ image.runtimeStyle.width = oldRuntimeWidth;
+ image.runtimeStyle.height = oldRuntimeHeight;
+
+ if (arguments.length == 3) {
+ dx = arguments[1];
+ dy = arguments[2];
+ sx = sy = 0;
+ sw = dw = w;
+ sh = dh = h;
+ } else if (arguments.length == 5) {
+ dx = arguments[1];
+ dy = arguments[2];
+ dw = arguments[3];
+ dh = arguments[4];
+ sx = sy = 0;
+ sw = w;
+ sh = h;
+ } else if (arguments.length == 9) {
+ sx = arguments[1];
+ sy = arguments[2];
+ sw = arguments[3];
+ sh = arguments[4];
+ dx = arguments[5];
+ dy = arguments[6];
+ dw = arguments[7];
+ dh = arguments[8];
+ } else {
+ throw Error('Invalid number of arguments');
+ }
+
+ var d = getCoords(this, dx, dy);
+
+ var w2 = sw / 2;
+ var h2 = sh / 2;
+
+ var vmlStr = [];
+
+ var W = 10;
+ var H = 10;
+
+ // For some reason that I've now forgotten, using divs didn't work
+ vmlStr.push(' <g_vml_:group',
+ ' coordsize="', Z * W, ',', Z * H, '"',
+ ' coordorigin="0,0"' ,
+ ' style="width:', W, 'px;height:', H, 'px;position:absolute;');
+
+ // If filters are necessary (rotation exists), create them
+ // filters are bog-slow, so only create them if abbsolutely necessary
+ // The following check doesn't account for skews (which don't exist
+ // in the canvas spec (yet) anyway.
+
+ if (this.m_[0][0] != 1 || this.m_[0][1] ||
+ this.m_[1][1] != 1 || this.m_[1][0]) {
+ var filter = [];
+
+ // Note the 12/21 reversal
+ filter.push('M11=', this.m_[0][0], ',',
+ 'M12=', this.m_[1][0], ',',
+ 'M21=', this.m_[0][1], ',',
+ 'M22=', this.m_[1][1], ',',
+ 'Dx=', mr(d.x / Z), ',',
+ 'Dy=', mr(d.y / Z), '');
+
+ // Bounding box calculation (need to minimize displayed area so that
+ // filters don't waste time on unused pixels.
+ var max = d;
+ var c2 = getCoords(this, dx + dw, dy);
+ var c3 = getCoords(this, dx, dy + dh);
+ var c4 = getCoords(this, dx + dw, dy + dh);
+
+ max.x = m.max(max.x, c2.x, c3.x, c4.x);
+ max.y = m.max(max.y, c2.y, c3.y, c4.y);
+
+ vmlStr.push('padding:0 ', mr(max.x / Z), 'px ', mr(max.y / Z),
+ 'px 0;filter:progid:DXImageTransform.Microsoft.Matrix(',
+ filter.join(''), ", sizingmethod='clip');");
+
+ } else {
+ vmlStr.push('top:', mr(d.y / Z), 'px;left:', mr(d.x / Z), 'px;');
+ }
+
+ vmlStr.push(' ">' ,
+ '<g_vml_:image src="', image.src, '"',
+ ' style="width:', Z * dw, 'px;',
+ ' height:', Z * dh, 'px"',
+ ' cropleft="', sx / w, '"',
+ ' croptop="', sy / h, '"',
+ ' cropright="', (w - sx - sw) / w, '"',
+ ' cropbottom="', (h - sy - sh) / h, '"',
+ ' />',
+ '</g_vml_:group>');
+
+ this.element_.insertAdjacentHTML('BeforeEnd', vmlStr.join(''));
+ };
+
+ contextPrototype.stroke = function(aFill) {
+ var lineStr = [];
+ var lineOpen = false;
+
+ var W = 10;
+ var H = 10;
+
+ lineStr.push('<g_vml_:shape',
+ ' filled="', !!aFill, '"',
+ ' style="position:absolute;width:', W, 'px;height:', H, 'px;"',
+ ' coordorigin="0,0"',
+ ' coordsize="', Z * W, ',', Z * H, '"',
+ ' stroked="', !aFill, '"',
+ ' path="');
+
+ var newSeq = false;
+ var min = {x: null, y: null};
+ var max = {x: null, y: null};
+
+ for (var i = 0; i < this.currentPath_.length; i++) {
+ var p = this.currentPath_[i];
+ var c;
+
+ switch (p.type) {
+ case 'moveTo':
+ c = p;
+ lineStr.push(' m ', mr(p.x), ',', mr(p.y));
+ break;
+ case 'lineTo':
+ lineStr.push(' l ', mr(p.x), ',', mr(p.y));
+ break;
+ case 'close':
+ lineStr.push(' x ');
+ p = null;
+ break;
+ case 'bezierCurveTo':
+ lineStr.push(' c ',
+ mr(p.cp1x), ',', mr(p.cp1y), ',',
+ mr(p.cp2x), ',', mr(p.cp2y), ',',
+ mr(p.x), ',', mr(p.y));
+ break;
+ case 'at':
+ case 'wa':
+ lineStr.push(' ', p.type, ' ',
+ mr(p.x - this.arcScaleX_ * p.radius), ',',
+ mr(p.y - this.arcScaleY_ * p.radius), ' ',
+ mr(p.x + this.arcScaleX_ * p.radius), ',',
+ mr(p.y + this.arcScaleY_ * p.radius), ' ',
+ mr(p.xStart), ',', mr(p.yStart), ' ',
+ mr(p.xEnd), ',', mr(p.yEnd));
+ break;
+ }
+
+
+ // TODO: Following is broken for curves due to
+ // move to proper paths.
+
+ // Figure out dimensions so we can do gradient fills
+ // properly
+ if (p) {
+ if (min.x == null || p.x < min.x) {
+ min.x = p.x;
+ }
+ if (max.x == null || p.x > max.x) {
+ max.x = p.x;
+ }
+ if (min.y == null || p.y < min.y) {
+ min.y = p.y;
+ }
+ if (max.y == null || p.y > max.y) {
+ max.y = p.y;
+ }
+ }
+ }
+ lineStr.push(' ">');
+
+ if (!aFill) {
+ appendStroke(this, lineStr);
+ } else {
+ appendFill(this, lineStr, min, max);
+ }
+
+ lineStr.push('</g_vml_:shape>');
+
+ this.element_.insertAdjacentHTML('beforeEnd', lineStr.join(''));
+ };
+
+ function appendStroke(ctx, lineStr) {
+ var a = processStyle(ctx.strokeStyle);
+ var color = a.color;
+ var opacity = a.alpha * ctx.globalAlpha;
+ var lineWidth = ctx.lineScale_ * ctx.lineWidth;
+
+ // VML cannot correctly render a line if the width is less than 1px.
+ // In that case, we dilute the color to make the line look thinner.
+ if (lineWidth < 1) {
+ opacity *= lineWidth;
+ }
+
+ lineStr.push(
+ '<g_vml_:stroke',
+ ' opacity="', opacity, '"',
+ ' joinstyle="', ctx.lineJoin, '"',
+ ' miterlimit="', ctx.miterLimit, '"',
+ ' endcap="', processLineCap(ctx.lineCap), '"',
+ ' weight="', lineWidth, 'px"',
+ ' color="', color, '" />'
+ );
+ }
+
+ function appendFill(ctx, lineStr, min, max) {
+ var fillStyle = ctx.fillStyle;
+ var arcScaleX = ctx.arcScaleX_;
+ var arcScaleY = ctx.arcScaleY_;
+ var width = max.x - min.x;
+ var height = max.y - min.y;
+ if (fillStyle instanceof CanvasGradient_) {
+ // TODO: Gradients transformed with the transformation matrix.
+ var angle = 0;
+ var focus = {x: 0, y: 0};
+
+ // additional offset
+ var shift = 0;
+ // scale factor for offset
+ var expansion = 1;
+
+ if (fillStyle.type_ == 'gradient') {
+ var x0 = fillStyle.x0_ / arcScaleX;
+ var y0 = fillStyle.y0_ / arcScaleY;
+ var x1 = fillStyle.x1_ / arcScaleX;
+ var y1 = fillStyle.y1_ / arcScaleY;
+ var p0 = getCoords(ctx, x0, y0);
+ var p1 = getCoords(ctx, x1, y1);
+ var dx = p1.x - p0.x;
+ var dy = p1.y - p0.y;
+ angle = Math.atan2(dx, dy) * 180 / Math.PI;
+
+ // The angle should be a non-negative number.
+ if (angle < 0) {
+ angle += 360;
+ }
+
+ // Very small angles produce an unexpected result because they are
+ // converted to a scientific notation string.
+ if (angle < 1e-6) {
+ angle = 0;
+ }
+ } else {
+ var p0 = getCoords(ctx, fillStyle.x0_, fillStyle.y0_);
+ focus = {
+ x: (p0.x - min.x) / width,
+ y: (p0.y - min.y) / height
+ };
+
+ width /= arcScaleX * Z;
+ height /= arcScaleY * Z;
+ var dimension = m.max(width, height);
+ shift = 2 * fillStyle.r0_ / dimension;
+ expansion = 2 * fillStyle.r1_ / dimension - shift;
+ }
+
+ // We need to sort the color stops in ascending order by offset,
+ // otherwise IE won't interpret it correctly.
+ var stops = fillStyle.colors_;
+ stops.sort(function(cs1, cs2) {
+ return cs1.offset - cs2.offset;
+ });
+
+ var length = stops.length;
+ var color1 = stops[0].color;
+ var color2 = stops[length - 1].color;
+ var opacity1 = stops[0].alpha * ctx.globalAlpha;
+ var opacity2 = stops[length - 1].alpha * ctx.globalAlpha;
+
+ var colors = [];
+ for (var i = 0; i < length; i++) {
+ var stop = stops[i];
+ colors.push(stop.offset * expansion + shift + ' ' + stop.color);
+ }
+
+ // When colors attribute is used, the meanings of opacity and o:opacity2
+ // are reversed.
+ lineStr.push('<g_vml_:fill type="', fillStyle.type_, '"',
+ ' method="none" focus="100%"',
+ ' color="', color1, '"',
+ ' color2="', color2, '"',
+ ' colors="', colors.join(','), '"',
+ ' opacity="', opacity2, '"',
+ ' g_o_:opacity2="', opacity1, '"',
+ ' angle="', angle, '"',
+ ' focusposition="', focus.x, ',', focus.y, '" />');
+ } else if (fillStyle instanceof CanvasPattern_) {
+ if (width && height) {
+ var deltaLeft = -min.x;
+ var deltaTop = -min.y;
+ lineStr.push('<g_vml_:fill',
+ ' position="',
+ deltaLeft / width * arcScaleX * arcScaleX, ',',
+ deltaTop / height * arcScaleY * arcScaleY, '"',
+ ' type="tile"',
+ // TODO: Figure out the correct size to fit the scale.
+ //' size="', w, 'px ', h, 'px"',
+ ' src="', fillStyle.src_, '" />');
+ }
+ } else {
+ var a = processStyle(ctx.fillStyle);
+ var color = a.color;
+ var opacity = a.alpha * ctx.globalAlpha;
+ lineStr.push('<g_vml_:fill color="', color, '" opacity="', opacity,
+ '" />');
+ }
+ }
+
+ contextPrototype.fill = function() {
+ this.stroke(true);
+ };
+
+ contextPrototype.closePath = function() {
+ this.currentPath_.push({type: 'close'});
+ };
+
+ function getCoords(ctx, aX, aY) {
+ var m = ctx.m_;
+ return {
+ x: Z * (aX * m[0][0] + aY * m[1][0] + m[2][0]) - Z2,
+ y: Z * (aX * m[0][1] + aY * m[1][1] + m[2][1]) - Z2
+ };
+ };
+
+ contextPrototype.save = function() {
+ var o = {};
+ copyState(this, o);
+ this.aStack_.push(o);
+ this.mStack_.push(this.m_);
+ this.m_ = matrixMultiply(createMatrixIdentity(), this.m_);
+ };
+
+ contextPrototype.restore = function() {
+ if (this.aStack_.length) {
+ copyState(this.aStack_.pop(), this);
+ this.m_ = this.mStack_.pop();
+ }
+ };
+
+ function matrixIsFinite(m) {
+ return isFinite(m[0][0]) && isFinite(m[0][1]) &&
+ isFinite(m[1][0]) && isFinite(m[1][1]) &&
+ isFinite(m[2][0]) && isFinite(m[2][1]);
+ }
+
+ function setM(ctx, m, updateLineScale) {
+ if (!matrixIsFinite(m)) {
+ return;
+ }
+ ctx.m_ = m;
+
+ if (updateLineScale) {
+ // Get the line scale.
+ // Determinant of this.m_ means how much the area is enlarged by the
+ // transformation. So its square root can be used as a scale factor
+ // for width.
+ var det = m[0][0] * m[1][1] - m[0][1] * m[1][0];
+ ctx.lineScale_ = sqrt(abs(det));
+ }
+ }
+
+ contextPrototype.translate = function(aX, aY) {
+ var m1 = [
+ [1, 0, 0],
+ [0, 1, 0],
+ [aX, aY, 1]
+ ];
+
+ setM(this, matrixMultiply(m1, this.m_), false);
+ };
+
+ contextPrototype.rotate = function(aRot) {
+ var c = mc(aRot);
+ var s = ms(aRot);
+
+ var m1 = [
+ [c, s, 0],
+ [-s, c, 0],
+ [0, 0, 1]
+ ];
+
+ setM(this, matrixMultiply(m1, this.m_), false);
+ };
+
+ contextPrototype.scale = function(aX, aY) {
+ this.arcScaleX_ *= aX;
+ this.arcScaleY_ *= aY;
+ var m1 = [
+ [aX, 0, 0],
+ [0, aY, 0],
+ [0, 0, 1]
+ ];
+
+ setM(this, matrixMultiply(m1, this.m_), true);
+ };
+
+ contextPrototype.transform = function(m11, m12, m21, m22, dx, dy) {
+ var m1 = [
+ [m11, m12, 0],
+ [m21, m22, 0],
+ [dx, dy, 1]
+ ];
+
+ setM(this, matrixMultiply(m1, this.m_), true);
+ };
+
+ contextPrototype.setTransform = function(m11, m12, m21, m22, dx, dy) {
+ var m = [
+ [m11, m12, 0],
+ [m21, m22, 0],
+ [dx, dy, 1]
+ ];
+
+ setM(this, m, true);
+ };
+
+ /**
+ * The text drawing function.
+ * The maxWidth argument isn't taken in account, since no browser supports
+ * it yet.
+ */
+ contextPrototype.drawText_ = function(text, x, y, maxWidth, stroke) {
+ var m = this.m_,
+ delta = 1000,
+ left = 0,
+ right = delta,
+ offset = {x: 0, y: 0},
+ lineStr = [];
+
+ var fontStyle = getComputedStyle(processFontStyle(this.font), this.element_);
+
+ var fontStyleString = buildStyle(fontStyle);
+
+ var elementStyle = this.element_.currentStyle;
+ var textAlign = this.textAlign.toLowerCase();
+ switch (textAlign) {
+ case 'left':
+ case 'center':
+ case 'right':
+ break;
+ case 'end':
+ textAlign = elementStyle.direction == 'ltr' ? 'right' : 'left';
+ break;
+ case 'start':
+ textAlign = elementStyle.direction == 'rtl' ? 'right' : 'left';
+ break;
+ default:
+ textAlign = 'left';
+ }
+
+ // 1.75 is an arbitrary number, as there is no info about the text baseline
+ switch (this.textBaseline) {
+ case 'hanging':
+ case 'top':
+ offset.y = fontStyle.size / 1.75;
+ break;
+ case 'middle':
+ break;
+ default:
+ case null:
+ case 'alphabetic':
+ case 'ideographic':
+ case 'bottom':
+ offset.y = -fontStyle.size / 2.25;
+ break;
+ }
+
+ switch(textAlign) {
+ case 'right':
+ left = delta;
+ right = 0.05;
+ break;
+ case 'center':
+ left = right = delta / 2;
+ break;
+ }
+
+ var d = getCoords(this, x + offset.x, y + offset.y);
+
+ lineStr.push('<g_vml_:line from="', -left ,' 0" to="', right ,' 0.05" ',
+ ' coordsize="100 100" coordorigin="0 0"',
+ ' filled="', !stroke, '" stroked="', !!stroke,
+ '" style="position:absolute;width:1px;height:1px;">');
+
+ if (stroke) {
+ appendStroke(this, lineStr);
+ } else {
+ // TODO: Fix the min and max params.
+ appendFill(this, lineStr, {x: -left, y: 0},
+ {x: right, y: fontStyle.size});
+ }
+
+ var skewM = m[0][0].toFixed(3) + ',' + m[1][0].toFixed(3) + ',' +
+ m[0][1].toFixed(3) + ',' + m[1][1].toFixed(3) + ',0,0';
+
+ var skewOffset = mr(d.x / Z + 1 - m[0][0]) + ',' + mr(d.y / Z - 2 * m[1][0]);
+
+
+ lineStr.push('<g_vml_:skew on="t" matrix="', skewM ,'" ',
+ ' offset="', skewOffset, '" origin="', left ,' 0" />',
+ '<g_vml_:path textpathok="true" />',
+ '<g_vml_:textpath on="true" string="',
+ encodeHtmlAttribute(text),
+ '" style="v-text-align:', textAlign,
+ ';font:', encodeHtmlAttribute(fontStyleString),
+ '" /></g_vml_:line>');
+
+ this.element_.insertAdjacentHTML('beforeEnd', lineStr.join(''));
+ };
+
+ contextPrototype.fillText = function(text, x, y, maxWidth) {
+ this.drawText_(text, x, y, maxWidth, false);
+ };
+
+ contextPrototype.strokeText = function(text, x, y, maxWidth) {
+ this.drawText_(text, x, y, maxWidth, true);
+ };
+
+ contextPrototype.measureText = function(text) {
+ if (!this.textMeasureEl_) {
+ var s = '<span style="position:absolute;' +
+ 'top:-20000px;left:0;padding:0;margin:0;border:none;' +
+ 'white-space:pre;"></span>';
+ this.element_.insertAdjacentHTML('beforeEnd', s);
+ this.textMeasureEl_ = this.element_.lastChild;
+ }
+ var doc = this.element_.ownerDocument;
+ this.textMeasureEl_.innerHTML = '';
+ this.textMeasureEl_.style.font = this.font;
+ // Don't use innerHTML or innerText because they allow markup/whitespace.
+ this.textMeasureEl_.appendChild(doc.createTextNode(text));
+ return {width: this.textMeasureEl_.offsetWidth};
+ };
+
+ /******** STUBS ********/
+ contextPrototype.clip = function() {
+ // TODO: Implement
+ };
+
+ contextPrototype.arcTo = function() {
+ // TODO: Implement
+ };
+
+ contextPrototype.createPattern = function(image, repetition) {
+ return new CanvasPattern_(image, repetition);
+ };
+
+ // Gradient / Pattern Stubs
+ function CanvasGradient_(aType) {
+ this.type_ = aType;
+ this.x0_ = 0;
+ this.y0_ = 0;
+ this.r0_ = 0;
+ this.x1_ = 0;
+ this.y1_ = 0;
+ this.r1_ = 0;
+ this.colors_ = [];
+ }
+
+ CanvasGradient_.prototype.addColorStop = function(aOffset, aColor) {
+ aColor = processStyle(aColor);
+ this.colors_.push({offset: aOffset,
+ color: aColor.color,
+ alpha: aColor.alpha});
+ };
+
+ function CanvasPattern_(image, repetition) {
+ assertImageIsValid(image);
+ switch (repetition) {
+ case 'repeat':
+ case null:
+ case '':
+ this.repetition_ = 'repeat';
+ break;
+ case 'repeat-x':
+ case 'repeat-y':
+ case 'no-repeat':
+ this.repetition_ = repetition;
+ break;
+ default:
+ throwException('SYNTAX_ERR');
+ }
+
+ this.src_ = image.src;
+ this.width_ = image.width;
+ this.height_ = image.height;
+ }
+
+ function throwException(s) {
+ throw new DOMException_(s);
+ }
+
+ function assertImageIsValid(img) {
+ if (!img || img.nodeType != 1 || img.tagName != 'IMG') {
+ throwException('TYPE_MISMATCH_ERR');
+ }
+ if (img.readyState != 'complete') {
+ throwException('INVALID_STATE_ERR');
+ }
+ }
+
+ function DOMException_(s) {
+ this.code = this[s];
+ this.message = s +': DOM Exception ' + this.code;
+ }
+ var p = DOMException_.prototype = new Error;
+ p.INDEX_SIZE_ERR = 1;
+ p.DOMSTRING_SIZE_ERR = 2;
+ p.HIERARCHY_REQUEST_ERR = 3;
+ p.WRONG_DOCUMENT_ERR = 4;
+ p.INVALID_CHARACTER_ERR = 5;
+ p.NO_DATA_ALLOWED_ERR = 6;
+ p.NO_MODIFICATION_ALLOWED_ERR = 7;
+ p.NOT_FOUND_ERR = 8;
+ p.NOT_SUPPORTED_ERR = 9;
+ p.INUSE_ATTRIBUTE_ERR = 10;
+ p.INVALID_STATE_ERR = 11;
+ p.SYNTAX_ERR = 12;
+ p.INVALID_MODIFICATION_ERR = 13;
+ p.NAMESPACE_ERR = 14;
+ p.INVALID_ACCESS_ERR = 15;
+ p.VALIDATION_ERR = 16;
+ p.TYPE_MISMATCH_ERR = 17;
+
+ // set up externs
+ G_vmlCanvasManager = G_vmlCanvasManager_;
+ CanvasRenderingContext2D = CanvasRenderingContext2D_;
+ CanvasGradient = CanvasGradient_;
+ CanvasPattern = CanvasPattern_;
+ DOMException = DOMException_;
+ G_vmlCanvasManager._version = 888;
+})();
+
+} // if
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/jquery.jqplot.css
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/jquery.jqplot.css (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/jquery.jqplot.css 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,282 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/*rules for the plot target div. These will be cascaded down to all plot elements according to css rules*/
+.jqplot-target {
+ position: relative;
+ color: #666666;
+ font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
+ font-size: 1em;
+/* height: 300px;
+ width: 400px;*/
+}
+
+/*rules applied to all axes*/
+.jqplot-axis {
+ font-size: 0.75em;
+}
+
+.jqplot-xaxis {
+ margin-top: 10px;
+}
+
+.jqplot-x2axis {
+ margin-bottom: 10px;
+}
+
+.jqplot-yaxis {
+ margin-right: 10px;
+}
+
+.jqplot-y2axis, .jqplot-y3axis, .jqplot-y4axis, .jqplot-y5axis, .jqplot-y6axis, .jqplot-y7axis, .jqplot-y8axis, .jqplot-y9axis, .jqplot-yMidAxis {
+ margin-left: 10px;
+ margin-right: 10px;
+}
+
+/*rules applied to all axis tick divs*/
+.jqplot-axis-tick, .jqplot-xaxis-tick, .jqplot-yaxis-tick, .jqplot-x2axis-tick, .jqplot-y2axis-tick, .jqplot-y3axis-tick, .jqplot-y4axis-tick, .jqplot-y5axis-tick, .jqplot-y6axis-tick, .jqplot-y7axis-tick, .jqplot-y8axis-tick, .jqplot-y9axis-tick, .jqplot-yMidAxis-tick {
+ position: absolute;
+ white-space: pre;
+}
+
+
+.jqplot-xaxis-tick {
+ top: 0px;
+ /* initial position untill tick is drawn in proper place */
+ left: 15px;
+/* padding-top: 10px;*/
+ vertical-align: top;
+}
+
+.jqplot-x2axis-tick {
+ bottom: 0px;
+ /* initial position untill tick is drawn in proper place */
+ left: 15px;
+/* padding-bottom: 10px;*/
+ vertical-align: bottom;
+}
+
+.jqplot-yaxis-tick {
+ right: 0px;
+ /* initial position untill tick is drawn in proper place */
+ top: 15px;
+/* padding-right: 10px;*/
+ text-align: right;
+}
+
+.jqplot-yaxis-tick.jqplot-breakTick {
+ right: -20px;
+ margin-right: 0px;
+ padding:1px 5px 1px 5px;
+/* background-color: white;*/
+ z-index: 2;
+ font-size: 1.5em;
+}
+
+.jqplot-y2axis-tick, .jqplot-y3axis-tick, .jqplot-y4axis-tick, .jqplot-y5axis-tick, .jqplot-y6axis-tick, .jqplot-y7axis-tick, .jqplot-y8axis-tick, .jqplot-y9axis-tick {
+ left: 0px;
+ /* initial position untill tick is drawn in proper place */
+ top: 15px;
+/* padding-left: 10px;*/
+/* padding-right: 15px;*/
+ text-align: left;
+}
+
+.jqplot-yMidAxis-tick {
+ text-align: center;
+ white-space: nowrap;
+}
+
+.jqplot-xaxis-label {
+ margin-top: 10px;
+ font-size: 11pt;
+ position: absolute;
+}
+
+.jqplot-x2axis-label {
+ margin-bottom: 10px;
+ font-size: 11pt;
+ position: absolute;
+}
+
+.jqplot-yaxis-label {
+ margin-right: 10px;
+/* text-align: center;*/
+ font-size: 11pt;
+ position: absolute;
+}
+
+.jqplot-yMidAxis-label {
+ font-size: 11pt;
+ position: absolute;
+}
+
+.jqplot-y2axis-label, .jqplot-y3axis-label, .jqplot-y4axis-label, .jqplot-y5axis-label, .jqplot-y6axis-label, .jqplot-y7axis-label, .jqplot-y8axis-label, .jqplot-y9axis-label {
+/* text-align: center;*/
+ font-size: 11pt;
+ margin-left: 10px;
+ position: absolute;
+}
+
+.jqplot-meterGauge-tick {
+ font-size: 0.75em;
+ color: #999999;
+}
+
+.jqplot-meterGauge-label {
+ font-size: 1em;
+ color: #999999;
+}
+
+table.jqplot-table-legend {
+ margin-top: 12px;
+ margin-bottom: 12px;
+ margin-left: 12px;
+ margin-right: 12px;
+}
+
+table.jqplot-table-legend, table.jqplot-cursor-legend {
+ background-color: rgba(255,255,255,0.6);
+ border: 1px solid #cccccc;
+ position: absolute;
+ font-size: 0.75em;
+}
+
+td.jqplot-table-legend {
+ vertical-align:middle;
+}
+
+/*
+These rules could be used instead of assigning
+element styles and relying on js object properties.
+*/
+
+/*
+td.jqplot-table-legend-swatch {
+ padding-top: 0.5em;
+ text-align: center;
+}
+
+tr.jqplot-table-legend:first td.jqplot-table-legend-swatch {
+ padding-top: 0px;
+}
+*/
+
+td.jqplot-seriesToggle:hover, td.jqplot-seriesToggle:active {
+ cursor: pointer;
+}
+
+.jqplot-table-legend .jqplot-series-hidden {
+ text-decoration: line-through;
+}
+
+div.jqplot-table-legend-swatch-outline {
+ border: 1px solid #cccccc;
+ padding:1px;
+}
+
+div.jqplot-table-legend-swatch {
+ width:0px;
+ height:0px;
+ border-top-width: 5px;
+ border-bottom-width: 5px;
+ border-left-width: 6px;
+ border-right-width: 6px;
+ border-top-style: solid;
+ border-bottom-style: solid;
+ border-left-style: solid;
+ border-right-style: solid;
+}
+
+.jqplot-title {
+ top: 0px;
+ left: 0px;
+ padding-bottom: 0.5em;
+ font-size: 1.2em;
+}
+
+table.jqplot-cursor-tooltip {
+ border: 1px solid #cccccc;
+ font-size: 0.75em;
+}
+
+
+.jqplot-cursor-tooltip {
+ border: 1px solid #cccccc;
+ font-size: 0.75em;
+ white-space: nowrap;
+ background: rgba(208,208,208,0.5);
+ padding: 1px;
+}
+
+.jqplot-highlighter-tooltip, .jqplot-canvasOverlay-tooltip {
+ border: 1px solid #cccccc;
+ font-size: 0.75em;
+ white-space: nowrap;
+ background: rgba(208,208,208,0.5);
+ padding: 1px;
+}
+
+.jqplot-point-label {
+ font-size: 0.75em;
+ z-index: 2;
+}
+
+td.jqplot-cursor-legend-swatch {
+ vertical-align: middle;
+ text-align: center;
+}
+
+div.jqplot-cursor-legend-swatch {
+ width: 1.2em;
+ height: 0.7em;
+}
+
+.jqplot-error {
+/* Styles added to the plot target container when there is an error go here.*/
+ text-align: center;
+}
+
+.jqplot-error-message {
+/* Styling of the custom error message div goes here.*/
+ position: relative;
+ top: 46%;
+ display: inline-block;
+}
+
+div.jqplot-bubble-label {
+ font-size: 0.8em;
+/* background: rgba(90%, 90%, 90%, 0.15);*/
+ padding-left: 2px;
+ padding-right: 2px;
+ color: rgb(20%, 20%, 20%);
+}
+
+div.jqplot-bubble-label.jqplot-bubble-label-highlight {
+ background: rgba(90%, 90%, 90%, 0.7);
+}
+
+div.jqplot-noData-container {
+ text-align: center;
+ background-color: rgba(96%, 96%, 96%, 0.3);
+}
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/jquery.jqplot.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/jquery.jqplot.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/jquery.jqplot.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,11404 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * Title: jqPlot Charts
+ *
+ * Pure JavaScript plotting plugin for jQuery.
+ *
+ * About: Version
+ *
+ * version: 1.0.4
+ * revision: 1121
+ *
+ * About: Copyright & License
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT and GPL version 2.0 licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * See <GPL Version 2> and <MIT License> contained within this distribution for further information.
+ *
+ * The author would appreciate an email letting him know of any substantial
+ * use of jqPlot. You can reach the author at: chris at jqplot dot com
+ * or see http://www.jqplot.com/info.php. This is, of course, not required.
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php.
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ *
+ * About: Introduction
+ *
+ * jqPlot requires jQuery (1.4+ required for certain features). jQuery 1.4.2 is included in the distribution.
+ * To use jqPlot include jQuery, the jqPlot jQuery plugin, the jqPlot css file and optionally
+ * the excanvas script for IE support in your web page:
+ *
+ * > <!--[if lt IE 9]><script language="javascript" type="text/javascript" src="excanvas.js"></script><![endif]-->
+ * > <script language="javascript" type="text/javascript" src="jquery-1.4.4.min.js"></script>
+ * > <script language="javascript" type="text/javascript" src="jquery.jqplot.min.js"></script>
+ * > <link rel="stylesheet" type="text/css" href="jquery.jqplot.css" />
+ *
+ * jqPlot can be customized by overriding the defaults of any of the objects which make
+ * up the plot. The general usage of jqplot is:
+ *
+ * > chart = $.jqplot('targetElemId', [dataArray,...], {optionsObject});
+ *
+ * The options available to jqplot are detailed in <jqPlot Options> in the jqPlotOptions.txt file.
+ *
+ * An actual call to $.jqplot() may look like the
+ * examples below:
+ *
+ * > chart = $.jqplot('chartdiv', [[[1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],[11,219.9]]]);
+ *
+ * or
+ *
+ * > dataArray = [34,12,43,55,77];
+ * > chart = $.jqplot('targetElemId', [dataArray, ...], {title:'My Plot', axes:{yaxis:{min:20, max:100}}});
+ *
+ * For more inforrmation, see <jqPlot Usage>.
+ *
+ * About: Usage
+ *
+ * See <jqPlot Usage>
+ *
+ * About: Available Options
+ *
+ * See <jqPlot Options> for a list of options available thorugh the options object (not complete yet!)
+ *
+ * About: Options Usage
+ *
+ * See <Options Tutorial>
+ *
+ * About: Changes
+ *
+ * See <Change Log>
+ *
+ */
+
+(function($) {
+ // make sure undefined is undefined
+ var undefined;
+
+ $.fn.emptyForce = function() {
+ for ( var i = 0, elem; (elem = $(this)[i]) != null; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ if ( elem.nodeType === 1 ) {
+ $.cleanData( elem.getElementsByTagName("*") );
+ }
+
+ // Remove any remaining nodes
+ if ($.jqplot.use_excanvas) {
+ elem.outerHTML = "";
+ }
+ else {
+ while ( elem.firstChild ) {
+ elem.removeChild( elem.firstChild );
+ }
+ }
+
+ elem = null;
+ }
+
+ return $(this);
+ };
+
+ $.fn.removeChildForce = function(parent) {
+ while ( parent.firstChild ) {
+ this.removeChildForce( parent.firstChild );
+ parent.removeChild( parent.firstChild );
+ }
+ };
+
+ $.fn.jqplot = function() {
+ var datas = [];
+ var options = [];
+ // see how many data arrays we have
+ for (var i=0, l=arguments.length; i<l; i++) {
+ if ($.isArray(arguments[i])) {
+ datas.push(arguments[i]);
+ }
+ else if ($.isPlainObject(arguments[i])) {
+ options.push(arguments[i]);
+ }
+ }
+
+ return this.each(function(index) {
+ var tid,
+ plot,
+ $this = $(this),
+ dl = datas.length,
+ ol = options.length,
+ data,
+ opts;
+
+ if (index < dl) {
+ data = datas[index];
+ }
+ else {
+ data = dl ? datas[dl-1] : null;
+ }
+
+ if (index < ol) {
+ opts = options[index];
+ }
+ else {
+ opts = ol ? options[ol-1] : null;
+ }
+
+ // does el have an id?
+ // if not assign it one.
+ tid = $this.attr('id');
+ if (tid === undefined) {
+ tid = 'jqplot_target_' + $.jqplot.targetCounter++;
+ $this.attr('id', tid);
+ }
+
+ plot = $.jqplot(tid, data, opts);
+
+ $this.data('jqplot', plot);
+ });
+ };
+
+
+ /**
+ * Namespace: $.jqplot
+ * jQuery function called by the user to create a plot.
+ *
+ * Parameters:
+ * target - ID of target element to render the plot into.
+ * data - an array of data series.
+ * options - user defined options object. See the individual classes for available options.
+ *
+ * Properties:
+ * config - object to hold configuration information for jqPlot plot object.
+ *
+ * attributes:
+ * enablePlugins - False to disable plugins by default. Plugins must then be explicitly
+ * enabled in the individual plot options. Default: false.
+ * This property sets the "show" property of certain plugins to true or false.
+ * Only plugins that can be immediately active upon loading are affected. This includes
+ * non-renderer plugins like cursor, dragable, highlighter, and trendline.
+ * defaultHeight - Default height for plots where no css height specification exists. This
+ * is a jqplot wide default.
+ * defaultWidth - Default height for plots where no css height specification exists. This
+ * is a jqplot wide default.
+ */
+
+ $.jqplot = function(target, data, options) {
+ var _data = null, _options = null;
+
+ if (arguments.length === 3) {
+ _data = data;
+ _options = options;
+ }
+
+ else if (arguments.length === 2) {
+ if ($.isArray(data)) {
+ _data = data;
+ }
+
+ else if ($.isPlainObject(data)) {
+ _options = data;
+ }
+ }
+
+ if (_data === null && _options !== null && _options.data) {
+ _data = _options.data;
+ }
+
+ var plot = new jqPlot();
+ // remove any error class that may be stuck on target.
+ $('#'+target).removeClass('jqplot-error');
+
+ if ($.jqplot.config.catchErrors) {
+ try {
+ plot.init(target, _data, _options);
+ plot.draw();
+ plot.themeEngine.init.call(plot);
+ return plot;
+ }
+ catch(e) {
+ var msg = $.jqplot.config.errorMessage || e.message;
+ $('#'+target).append('<div class="jqplot-error-message">'+msg+'</div>');
+ $('#'+target).addClass('jqplot-error');
+ document.getElementById(target).style.background = $.jqplot.config.errorBackground;
+ document.getElementById(target).style.border = $.jqplot.config.errorBorder;
+ document.getElementById(target).style.fontFamily = $.jqplot.config.errorFontFamily;
+ document.getElementById(target).style.fontSize = $.jqplot.config.errorFontSize;
+ document.getElementById(target).style.fontStyle = $.jqplot.config.errorFontStyle;
+ document.getElementById(target).style.fontWeight = $.jqplot.config.errorFontWeight;
+ }
+ }
+ else {
+ plot.init(target, _data, _options);
+ plot.draw();
+ plot.themeEngine.init.call(plot);
+ return plot;
+ }
+ };
+
+ $.jqplot.version = "1.0.4";
+ $.jqplot.revision = "1121";
+
+ $.jqplot.targetCounter = 1;
+
+ // canvas manager to reuse canvases on the plot.
+ // Should help solve problem of canvases not being freed and
+ // problem of waiting forever for firefox to decide to free memory.
+ $.jqplot.CanvasManager = function() {
+ // canvases are managed globally so that they can be reused
+ // across plots after they have been freed
+ if (typeof $.jqplot.CanvasManager.canvases == 'undefined') {
+ $.jqplot.CanvasManager.canvases = [];
+ $.jqplot.CanvasManager.free = [];
+ }
+
+ var myCanvases = [];
+
+ this.getCanvas = function() {
+ var canvas;
+ var makeNew = true;
+
+ if (!$.jqplot.use_excanvas) {
+ for (var i = 0, l = $.jqplot.CanvasManager.canvases.length; i < l; i++) {
+ if ($.jqplot.CanvasManager.free[i] === true) {
+ makeNew = false;
+ canvas = $.jqplot.CanvasManager.canvases[i];
+ // $(canvas).removeClass('jqplot-canvasManager-free').addClass('jqplot-canvasManager-inuse');
+ $.jqplot.CanvasManager.free[i] = false;
+ myCanvases.push(i);
+ break;
+ }
+ }
+ }
+
+ if (makeNew) {
+ canvas = document.createElement('canvas');
+ myCanvases.push($.jqplot.CanvasManager.canvases.length);
+ $.jqplot.CanvasManager.canvases.push(canvas);
+ $.jqplot.CanvasManager.free.push(false);
+ }
+
+ return canvas;
+ };
+
+ // this method has to be used after settings the dimesions
+ // on the element returned by getCanvas()
+ this.initCanvas = function(canvas) {
+ if ($.jqplot.use_excanvas) {
+ return window.G_vmlCanvasManager.initElement(canvas);
+ }
+ return canvas;
+ };
+
+ this.freeAllCanvases = function() {
+ for (var i = 0, l=myCanvases.length; i < l; i++) {
+ this.freeCanvas(myCanvases[i]);
+ }
+ myCanvases = [];
+ };
+
+ this.freeCanvas = function(idx) {
+ if ($.jqplot.use_excanvas && window.G_vmlCanvasManager.uninitElement !== undefined) {
+ // excanvas can't be reused, but properly unset
+ window.G_vmlCanvasManager.uninitElement($.jqplot.CanvasManager.canvases[idx]);
+ $.jqplot.CanvasManager.canvases[idx] = null;
+ }
+ else {
+ var canvas = $.jqplot.CanvasManager.canvases[idx];
+ canvas.getContext('2d').clearRect(0, 0, canvas.width, canvas.height);
+ $(canvas).unbind().removeAttr('class').removeAttr('style');
+ // Style attributes seemed to be still hanging around. wierd. Some ticks
+ // still retained a left: 0px attribute after reusing a canvas.
+ $(canvas).css({left: '', top: '', position: ''});
+ // setting size to 0 may save memory of unused canvases?
+ canvas.width = 0;
+ canvas.height = 0;
+ $.jqplot.CanvasManager.free[idx] = true;
+ }
+ };
+
+ };
+
+
+ // Convienence function that won't hang IE or FF without FireBug.
+ $.jqplot.log = function() {
+ if (window.console) {
+ window.console.log.apply(window.console, arguments);
+ }
+ };
+
+ $.jqplot.config = {
+ addDomReference: false,
+ enablePlugins:false,
+ defaultHeight:300,
+ defaultWidth:400,
+ UTCAdjust:false,
+ timezoneOffset: new Date(new Date().getTimezoneOffset() * 60000),
+ errorMessage: '',
+ errorBackground: '',
+ errorBorder: '',
+ errorFontFamily: '',
+ errorFontSize: '',
+ errorFontStyle: '',
+ errorFontWeight: '',
+ catchErrors: false,
+ defaultTickFormatString: "%.1f",
+ defaultColors: [ "#4bb2c5", "#EAA228", "#c5b47f", "#579575", "#839557", "#958c12", "#953579", "#4b5de4", "#d8b83f", "#ff5800", "#0085cc", "#c747a3", "#cddf54", "#FBD178", "#26B4E3", "#bd70c7"],
+ defaultNegativeColors: [ "#498991", "#C08840", "#9F9274", "#546D61", "#646C4A", "#6F6621", "#6E3F5F", "#4F64B0", "#A89050", "#C45923", "#187399", "#945381", "#959E5C", "#C7AF7B", "#478396", "#907294"],
+ dashLength: 4,
+ gapLength: 4,
+ dotGapLength: 2.5,
+ srcLocation: 'jqplot/src/',
+ pluginLocation: 'jqplot/src/plugins/'
+ };
+
+
+ $.jqplot.arrayMax = function( array ){
+ return Math.max.apply( Math, array );
+ };
+
+ $.jqplot.arrayMin = function( array ){
+ return Math.min.apply( Math, array );
+ };
+
+ $.jqplot.enablePlugins = $.jqplot.config.enablePlugins;
+
+ // canvas related tests taken from modernizer:
+ // Copyright (c) 2009 - 2010 Faruk Ates.
+ // http://www.modernizr.com
+
+ $.jqplot.support_canvas = function() {
+ if (typeof $.jqplot.support_canvas.result == 'undefined') {
+ $.jqplot.support_canvas.result = !!document.createElement('canvas').getContext;
+ }
+ return $.jqplot.support_canvas.result;
+ };
+
+ $.jqplot.support_canvas_text = function() {
+ if (typeof $.jqplot.support_canvas_text.result == 'undefined') {
+ if (window.G_vmlCanvasManager !== undefined && window.G_vmlCanvasManager._version > 887) {
+ $.jqplot.support_canvas_text.result = true;
+ }
+ else {
+ $.jqplot.support_canvas_text.result = !!(document.createElement('canvas').getContext && typeof document.createElement('canvas').getContext('2d').fillText == 'function');
+ }
+
+ }
+ return $.jqplot.support_canvas_text.result;
+ };
+
+ $.jqplot.use_excanvas = ($.browser.msie && !$.jqplot.support_canvas()) ? true : false;
+
+ /**
+ *
+ * Hooks: jqPlot Pugin Hooks
+ *
+ * $.jqplot.preInitHooks - called before initialization.
+ * $.jqplot.postInitHooks - called after initialization.
+ * $.jqplot.preParseOptionsHooks - called before user options are parsed.
+ * $.jqplot.postParseOptionsHooks - called after user options are parsed.
+ * $.jqplot.preDrawHooks - called before plot draw.
+ * $.jqplot.postDrawHooks - called after plot draw.
+ * $.jqplot.preDrawSeriesHooks - called before each series is drawn.
+ * $.jqplot.postDrawSeriesHooks - called after each series is drawn.
+ * $.jqplot.preDrawLegendHooks - called before the legend is drawn.
+ * $.jqplot.addLegendRowHooks - called at the end of legend draw, so plugins
+ * can add rows to the legend table.
+ * $.jqplot.preSeriesInitHooks - called before series is initialized.
+ * $.jqplot.postSeriesInitHooks - called after series is initialized.
+ * $.jqplot.preParseSeriesOptionsHooks - called before series related options
+ * are parsed.
+ * $.jqplot.postParseSeriesOptionsHooks - called after series related options
+ * are parsed.
+ * $.jqplot.eventListenerHooks - called at the end of plot drawing, binds
+ * listeners to the event canvas which lays on top of the grid area.
+ * $.jqplot.preDrawSeriesShadowHooks - called before series shadows are drawn.
+ * $.jqplot.postDrawSeriesShadowHooks - called after series shadows are drawn.
+ *
+ */
+
+ $.jqplot.preInitHooks = [];
+ $.jqplot.postInitHooks = [];
+ $.jqplot.preParseOptionsHooks = [];
+ $.jqplot.postParseOptionsHooks = [];
+ $.jqplot.preDrawHooks = [];
+ $.jqplot.postDrawHooks = [];
+ $.jqplot.preDrawSeriesHooks = [];
+ $.jqplot.postDrawSeriesHooks = [];
+ $.jqplot.preDrawLegendHooks = [];
+ $.jqplot.addLegendRowHooks = [];
+ $.jqplot.preSeriesInitHooks = [];
+ $.jqplot.postSeriesInitHooks = [];
+ $.jqplot.preParseSeriesOptionsHooks = [];
+ $.jqplot.postParseSeriesOptionsHooks = [];
+ $.jqplot.eventListenerHooks = [];
+ $.jqplot.preDrawSeriesShadowHooks = [];
+ $.jqplot.postDrawSeriesShadowHooks = [];
+
+ // A superclass holding some common properties and methods.
+ $.jqplot.ElemContainer = function() {
+ this._elem;
+ this._plotWidth;
+ this._plotHeight;
+ this._plotDimensions = {height:null, width:null};
+ };
+
+ $.jqplot.ElemContainer.prototype.createElement = function(el, offsets, clss, cssopts, attrib) {
+ this._offsets = offsets;
+ var klass = clss || 'jqplot';
+ var elem = document.createElement(el);
+ this._elem = $(elem);
+ this._elem.addClass(klass);
+ this._elem.css(cssopts);
+ this._elem.attr(attrib);
+ // avoid memory leak;
+ elem = null;
+ return this._elem;
+ };
+
+ $.jqplot.ElemContainer.prototype.getWidth = function() {
+ if (this._elem) {
+ return this._elem.outerWidth(true);
+ }
+ else {
+ return null;
+ }
+ };
+
+ $.jqplot.ElemContainer.prototype.getHeight = function() {
+ if (this._elem) {
+ return this._elem.outerHeight(true);
+ }
+ else {
+ return null;
+ }
+ };
+
+ $.jqplot.ElemContainer.prototype.getPosition = function() {
+ if (this._elem) {
+ return this._elem.position();
+ }
+ else {
+ return {top:null, left:null, bottom:null, right:null};
+ }
+ };
+
+ $.jqplot.ElemContainer.prototype.getTop = function() {
+ return this.getPosition().top;
+ };
+
+ $.jqplot.ElemContainer.prototype.getLeft = function() {
+ return this.getPosition().left;
+ };
+
+ $.jqplot.ElemContainer.prototype.getBottom = function() {
+ return this._elem.css('bottom');
+ };
+
+ $.jqplot.ElemContainer.prototype.getRight = function() {
+ return this._elem.css('right');
+ };
+
+
+ /**
+ * Class: Axis
+ * An individual axis object. Cannot be instantiated directly, but created
+ * by the Plot oject. Axis properties can be set or overriden by the
+ * options passed in from the user.
+ *
+ */
+ function Axis(name) {
+ $.jqplot.ElemContainer.call(this);
+ // Group: Properties
+ //
+ // Axes options are specified within an axes object at the top level of the
+ // plot options like so:
+ // > {
+ // > axes: {
+ // > xaxis: {min: 5},
+ // > yaxis: {min: 2, max: 8, numberTicks:4},
+ // > x2axis: {pad: 1.5},
+ // > y2axis: {ticks:[22, 44, 66, 88]}
+ // > }
+ // > }
+ // There are 2 x axes, 'xaxis' and 'x2axis', and
+ // 9 yaxes, 'yaxis', 'y2axis'. 'y3axis', ... Any or all of which may be specified.
+ this.name = name;
+ this._series = [];
+ // prop: show
+ // Wether to display the axis on the graph.
+ this.show = false;
+ // prop: tickRenderer
+ // A class of a rendering engine for creating the ticks labels displayed on the plot,
+ // See <$.jqplot.AxisTickRenderer>.
+ this.tickRenderer = $.jqplot.AxisTickRenderer;
+ // prop: tickOptions
+ // Options that will be passed to the tickRenderer, see <$.jqplot.AxisTickRenderer> options.
+ this.tickOptions = {};
+ // prop: labelRenderer
+ // A class of a rendering engine for creating an axis label.
+ this.labelRenderer = $.jqplot.AxisLabelRenderer;
+ // prop: labelOptions
+ // Options passed to the label renderer.
+ this.labelOptions = {};
+ // prop: label
+ // Label for the axis
+ this.label = null;
+ // prop: showLabel
+ // true to show the axis label.
+ this.showLabel = true;
+ // prop: min
+ // minimum value of the axis (in data units, not pixels).
+ this.min = null;
+ // prop: max
+ // maximum value of the axis (in data units, not pixels).
+ this.max = null;
+ // prop: autoscale
+ // DEPRECATED
+ // the default scaling algorithm produces superior results.
+ this.autoscale = false;
+ // prop: pad
+ // Padding to extend the range above and below the data bounds.
+ // The data range is multiplied by this factor to determine minimum and maximum axis bounds.
+ // A value of 0 will be interpreted to mean no padding, and pad will be set to 1.0.
+ this.pad = 1.2;
+ // prop: padMax
+ // Padding to extend the range above data bounds.
+ // The top of the data range is multiplied by this factor to determine maximum axis bounds.
+ // A value of 0 will be interpreted to mean no padding, and padMax will be set to 1.0.
+ this.padMax = null;
+ // prop: padMin
+ // Padding to extend the range below data bounds.
+ // The bottom of the data range is multiplied by this factor to determine minimum axis bounds.
+ // A value of 0 will be interpreted to mean no padding, and padMin will be set to 1.0.
+ this.padMin = null;
+ // prop: ticks
+ // 1D [val, val, ...] or 2D [[val, label], [val, label], ...] array of ticks for the axis.
+ // If no label is specified, the value is formatted into an appropriate label.
+ this.ticks = [];
+ // prop: numberTicks
+ // Desired number of ticks. Default is to compute automatically.
+ this.numberTicks;
+ // prop: tickInterval
+ // number of units between ticks. Mutually exclusive with numberTicks.
+ this.tickInterval;
+ // prop: renderer
+ // A class of a rendering engine that handles tick generation,
+ // scaling input data to pixel grid units and drawing the axis element.
+ this.renderer = $.jqplot.LinearAxisRenderer;
+ // prop: rendererOptions
+ // renderer specific options. See <$.jqplot.LinearAxisRenderer> for options.
+ this.rendererOptions = {};
+ // prop: showTicks
+ // Wether to show the ticks (both marks and labels) or not.
+ // Will not override showMark and showLabel options if specified on the ticks themselves.
+ this.showTicks = true;
+ // prop: showTickMarks
+ // Wether to show the tick marks (line crossing grid) or not.
+ // Overridden by showTicks and showMark option of tick itself.
+ this.showTickMarks = true;
+ // prop: showMinorTicks
+ // Wether or not to show minor ticks. This is renderer dependent.
+ this.showMinorTicks = true;
+ // prop: drawMajorGridlines
+ // True to draw gridlines for major axis ticks.
+ this.drawMajorGridlines = true;
+ // prop: drawMinorGridlines
+ // True to draw gridlines for minor ticks.
+ this.drawMinorGridlines = false;
+ // prop: drawMajorTickMarks
+ // True to draw tick marks for major axis ticks.
+ this.drawMajorTickMarks = true;
+ // prop: drawMinorTickMarks
+ // True to draw tick marks for minor ticks. This is renderer dependent.
+ this.drawMinorTickMarks = true;
+ // prop: useSeriesColor
+ // Use the color of the first series associated with this axis for the
+ // tick marks and line bordering this axis.
+ this.useSeriesColor = false;
+ // prop: borderWidth
+ // width of line stroked at the border of the axis. Defaults
+ // to the width of the grid boarder.
+ this.borderWidth = null;
+ // prop: borderColor
+ // color of the border adjacent to the axis. Defaults to grid border color.
+ this.borderColor = null;
+ // prop: scaleToHiddenSeries
+ // True to include hidden series when computing axes bounds and scaling.
+ this.scaleToHiddenSeries = false;
+ // minimum and maximum values on the axis.
+ this._dataBounds = {min:null, max:null};
+ // statistics (min, max, mean) as well as actual data intervals for each series attached to axis.
+ // holds collection of {intervals:[], min:, max:, mean: } objects for each series on axis.
+ this._intervalStats = [];
+ // pixel position from the top left of the min value and max value on the axis.
+ this._offsets = {min:null, max:null};
+ this._ticks=[];
+ this._label = null;
+ // prop: syncTicks
+ // true to try and synchronize tick spacing across multiple axes so that ticks and
+ // grid lines line up. This has an impact on autoscaling algorithm, however.
+ // In general, autoscaling an individual axis will work better if it does not
+ // have to sync ticks.
+ this.syncTicks = null;
+ // prop: tickSpacing
+ // Approximate pixel spacing between ticks on graph. Used during autoscaling.
+ // This number will be an upper bound, actual spacing will be less.
+ this.tickSpacing = 75;
+ // Properties to hold the original values for min, max, ticks, tickInterval and numberTicks
+ // so they can be restored if altered by plugins.
+ this._min = null;
+ this._max = null;
+ this._tickInterval = null;
+ this._numberTicks = null;
+ this.__ticks = null;
+ // hold original user options.
+ this._options = {};
+ }
+
+ Axis.prototype = new $.jqplot.ElemContainer();
+ Axis.prototype.constructor = Axis;
+
+ Axis.prototype.init = function() {
+ if ($.isFunction(this.renderer)) {
+ this.renderer = new this.renderer();
+ }
+ // set the axis name
+ this.tickOptions.axis = this.name;
+ // if showMark or showLabel tick options not specified, use value of axis option.
+ // showTicks overrides showTickMarks.
+ if (this.tickOptions.showMark == null) {
+ this.tickOptions.showMark = this.showTicks;
+ }
+ if (this.tickOptions.showMark == null) {
+ this.tickOptions.showMark = this.showTickMarks;
+ }
+ if (this.tickOptions.showLabel == null) {
+ this.tickOptions.showLabel = this.showTicks;
+ }
+
+ if (this.label == null || this.label == '') {
+ this.showLabel = false;
+ }
+ else {
+ this.labelOptions.label = this.label;
+ }
+ if (this.showLabel == false) {
+ this.labelOptions.show = false;
+ }
+ // set the default padMax, padMin if not specified
+ // special check, if no padding desired, padding
+ // should be set to 1.0
+ if (this.pad == 0) {
+ this.pad = 1.0;
+ }
+ if (this.padMax == 0) {
+ this.padMax = 1.0;
+ }
+ if (this.padMin == 0) {
+ this.padMin = 1.0;
+ }
+ if (this.padMax == null) {
+ this.padMax = (this.pad-1)/2 + 1;
+ }
+ if (this.padMin == null) {
+ this.padMin = (this.pad-1)/2 + 1;
+ }
+ // now that padMin and padMax are correctly set, reset pad in case user has supplied
+ // padMin and/or padMax
+ this.pad = this.padMax + this.padMin - 1;
+ if (this.min != null || this.max != null) {
+ this.autoscale = false;
+ }
+ // if not set, sync ticks for y axes but not x by default.
+ if (this.syncTicks == null && this.name.indexOf('y') > -1) {
+ this.syncTicks = true;
+ }
+ else if (this.syncTicks == null){
+ this.syncTicks = false;
+ }
+ this.renderer.init.call(this, this.rendererOptions);
+
+ };
+
+ Axis.prototype.draw = function(ctx, plot) {
+ // Memory Leaks patch
+ if (this.__ticks) {
+ this.__ticks = null;
+ }
+
+ return this.renderer.draw.call(this, ctx, plot);
+
+ };
+
+ Axis.prototype.set = function() {
+ this.renderer.set.call(this);
+ };
+
+ Axis.prototype.pack = function(pos, offsets) {
+ if (this.show) {
+ this.renderer.pack.call(this, pos, offsets);
+ }
+ // these properties should all be available now.
+ if (this._min == null) {
+ this._min = this.min;
+ this._max = this.max;
+ this._tickInterval = this.tickInterval;
+ this._numberTicks = this.numberTicks;
+ this.__ticks = this._ticks;
+ }
+ };
+
+ // reset the axis back to original values if it has been scaled, zoomed, etc.
+ Axis.prototype.reset = function() {
+ this.renderer.reset.call(this);
+ };
+
+ Axis.prototype.resetScale = function(opts) {
+ $.extend(true, this, {min: null, max: null, numberTicks: null, tickInterval: null, _ticks: [], ticks: []}, opts);
+ this.resetDataBounds();
+ };
+
+ Axis.prototype.resetDataBounds = function() {
+ // Go through all the series attached to this axis and find
+ // the min/max bounds for this axis.
+ var db = this._dataBounds;
+ db.min = null;
+ db.max = null;
+ var l, s, d;
+ // check for when to force min 0 on bar series plots.
+ var doforce = (this.show) ? true : false;
+ for (var i=0; i<this._series.length; i++) {
+ s = this._series[i];
+ if (s.show || this.scaleToHiddenSeries) {
+ d = s._plotData;
+ if (s._type === 'line' && s.renderer.bands.show && this.name.charAt(0) !== 'x') {
+ d = [[0, s.renderer.bands._min], [1, s.renderer.bands._max]];
+ }
+
+ var minyidx = 1, maxyidx = 1;
+
+ if (s._type != null && s._type == 'ohlc') {
+ minyidx = 3;
+ maxyidx = 2;
+ }
+
+ for (var j=0, l=d.length; j<l; j++) {
+ if (this.name == 'xaxis' || this.name == 'x2axis') {
+ if ((d[j][0] != null && d[j][0] < db.min) || db.min == null) {
+ db.min = d[j][0];
+ }
+ if ((d[j][0] != null && d[j][0] > db.max) || db.max == null) {
+ db.max = d[j][0];
+ }
+ }
+ else {
+ if ((d[j][minyidx] != null && d[j][minyidx] < db.min) || db.min == null) {
+ db.min = d[j][minyidx];
+ }
+ if ((d[j][maxyidx] != null && d[j][maxyidx] > db.max) || db.max == null) {
+ db.max = d[j][maxyidx];
+ }
+ }
+ }
+
+ // Hack to not pad out bottom of bar plots unless user has specified a padding.
+ // every series will have a chance to set doforce to false. once it is set to
+ // false, it cannot be reset to true.
+ // If any series attached to axis is not a bar, wont force 0.
+ if (doforce && s.renderer.constructor !== $.jqplot.BarRenderer) {
+ doforce = false;
+ }
+
+ else if (doforce && this._options.hasOwnProperty('forceTickAt0') && this._options.forceTickAt0 == false) {
+ doforce = false;
+ }
+
+ else if (doforce && s.renderer.constructor === $.jqplot.BarRenderer) {
+ if (s.barDirection == 'vertical' && this.name != 'xaxis' && this.name != 'x2axis') {
+ if (this._options.pad != null || this._options.padMin != null) {
+ doforce = false;
+ }
+ }
+
+ else if (s.barDirection == 'horizontal' && (this.name == 'xaxis' || this.name == 'x2axis')) {
+ if (this._options.pad != null || this._options.padMin != null) {
+ doforce = false;
+ }
+ }
+
+ }
+ }
+ }
+
+ if (doforce && this.renderer.constructor === $.jqplot.LinearAxisRenderer && db.min >= 0) {
+ this.padMin = 1.0;
+ this.forceTickAt0 = true;
+ }
+ };
+
+ /**
+ * Class: Legend
+ * Legend object. Cannot be instantiated directly, but created
+ * by the Plot oject. Legend properties can be set or overriden by the
+ * options passed in from the user.
+ */
+ function Legend(options) {
+ $.jqplot.ElemContainer.call(this);
+ // Group: Properties
+
+ // prop: show
+ // Wether to display the legend on the graph.
+ this.show = false;
+ // prop: location
+ // Placement of the legend. one of the compass directions: nw, n, ne, e, se, s, sw, w
+ this.location = 'ne';
+ // prop: labels
+ // Array of labels to use. By default the renderer will look for labels on the series.
+ // Labels specified in this array will override labels specified on the series.
+ this.labels = [];
+ // prop: showLabels
+ // true to show the label text on the legend.
+ this.showLabels = true;
+ // prop: showSwatch
+ // true to show the color swatches on the legend.
+ this.showSwatches = true;
+ // prop: placement
+ // "insideGrid" places legend inside the grid area of the plot.
+ // "outsideGrid" places the legend outside the grid but inside the plot container,
+ // shrinking the grid to accomodate the legend.
+ // "inside" synonym for "insideGrid",
+ // "outside" places the legend ouside the grid area, but does not shrink the grid which
+ // can cause the legend to overflow the plot container.
+ this.placement = "insideGrid";
+ // prop: xoffset
+ // DEPRECATED. Set the margins on the legend using the marginTop, marginLeft, etc.
+ // properties or via CSS margin styling of the .jqplot-table-legend class.
+ this.xoffset = 0;
+ // prop: yoffset
+ // DEPRECATED. Set the margins on the legend using the marginTop, marginLeft, etc.
+ // properties or via CSS margin styling of the .jqplot-table-legend class.
+ this.yoffset = 0;
+ // prop: border
+ // css spec for the border around the legend box.
+ this.border;
+ // prop: background
+ // css spec for the background of the legend box.
+ this.background;
+ // prop: textColor
+ // css color spec for the legend text.
+ this.textColor;
+ // prop: fontFamily
+ // css font-family spec for the legend text.
+ this.fontFamily;
+ // prop: fontSize
+ // css font-size spec for the legend text.
+ this.fontSize ;
+ // prop: rowSpacing
+ // css padding-top spec for the rows in the legend.
+ this.rowSpacing = '0.5em';
+ // renderer
+ // A class that will create a DOM object for the legend,
+ // see <$.jqplot.TableLegendRenderer>.
+ this.renderer = $.jqplot.TableLegendRenderer;
+ // prop: rendererOptions
+ // renderer specific options passed to the renderer.
+ this.rendererOptions = {};
+ // prop: predraw
+ // Wether to draw the legend before the series or not.
+ // Used with series specific legend renderers for pie, donut, mekko charts, etc.
+ this.preDraw = false;
+ // prop: marginTop
+ // CSS margin for the legend DOM element. This will set an element
+ // CSS style for the margin which will override any style sheet setting.
+ // The default will be taken from the stylesheet.
+ this.marginTop = null;
+ // prop: marginRight
+ // CSS margin for the legend DOM element. This will set an element
+ // CSS style for the margin which will override any style sheet setting.
+ // The default will be taken from the stylesheet.
+ this.marginRight = null;
+ // prop: marginBottom
+ // CSS margin for the legend DOM element. This will set an element
+ // CSS style for the margin which will override any style sheet setting.
+ // The default will be taken from the stylesheet.
+ this.marginBottom = null;
+ // prop: marginLeft
+ // CSS margin for the legend DOM element. This will set an element
+ // CSS style for the margin which will override any style sheet setting.
+ // The default will be taken from the stylesheet.
+ this.marginLeft = null;
+ // prop: escapeHtml
+ // True to escape special characters with their html entity equivalents
+ // in legend text. "<" becomes < and so on, so html tags are not rendered.
+ this.escapeHtml = false;
+ this._series = [];
+
+ $.extend(true, this, options);
+ }
+
+ Legend.prototype = new $.jqplot.ElemContainer();
+ Legend.prototype.constructor = Legend;
+
+ Legend.prototype.setOptions = function(options) {
+ $.extend(true, this, options);
+
+ // Try to emulate deprecated behaviour
+ // if user has specified xoffset or yoffset, copy these to
+ // the margin properties.
+
+ if (this.placement == 'inside') {
+ this.placement = 'insideGrid';
+ }
+
+ if (this.xoffset >0) {
+ if (this.placement == 'insideGrid') {
+ switch (this.location) {
+ case 'nw':
+ case 'w':
+ case 'sw':
+ if (this.marginLeft == null) {
+ this.marginLeft = this.xoffset + 'px';
+ }
+ this.marginRight = '0px';
+ break;
+ case 'ne':
+ case 'e':
+ case 'se':
+ default:
+ if (this.marginRight == null) {
+ this.marginRight = this.xoffset + 'px';
+ }
+ this.marginLeft = '0px';
+ break;
+ }
+ }
+ else if (this.placement == 'outside') {
+ switch (this.location) {
+ case 'nw':
+ case 'w':
+ case 'sw':
+ if (this.marginRight == null) {
+ this.marginRight = this.xoffset + 'px';
+ }
+ this.marginLeft = '0px';
+ break;
+ case 'ne':
+ case 'e':
+ case 'se':
+ default:
+ if (this.marginLeft == null) {
+ this.marginLeft = this.xoffset + 'px';
+ }
+ this.marginRight = '0px';
+ break;
+ }
+ }
+ this.xoffset = 0;
+ }
+
+ if (this.yoffset >0) {
+ if (this.placement == 'outside') {
+ switch (this.location) {
+ case 'sw':
+ case 's':
+ case 'se':
+ if (this.marginTop == null) {
+ this.marginTop = this.yoffset + 'px';
+ }
+ this.marginBottom = '0px';
+ break;
+ case 'ne':
+ case 'n':
+ case 'nw':
+ default:
+ if (this.marginBottom == null) {
+ this.marginBottom = this.yoffset + 'px';
+ }
+ this.marginTop = '0px';
+ break;
+ }
+ }
+ else if (this.placement == 'insideGrid') {
+ switch (this.location) {
+ case 'sw':
+ case 's':
+ case 'se':
+ if (this.marginBottom == null) {
+ this.marginBottom = this.yoffset + 'px';
+ }
+ this.marginTop = '0px';
+ break;
+ case 'ne':
+ case 'n':
+ case 'nw':
+ default:
+ if (this.marginTop == null) {
+ this.marginTop = this.yoffset + 'px';
+ }
+ this.marginBottom = '0px';
+ break;
+ }
+ }
+ this.yoffset = 0;
+ }
+
+ // TO-DO:
+ // Handle case where offsets are < 0.
+ //
+ };
+
+ Legend.prototype.init = function() {
+ if ($.isFunction(this.renderer)) {
+ this.renderer = new this.renderer();
+ }
+ this.renderer.init.call(this, this.rendererOptions);
+ };
+
+ Legend.prototype.draw = function(offsets, plot) {
+ for (var i=0; i<$.jqplot.preDrawLegendHooks.length; i++){
+ $.jqplot.preDrawLegendHooks[i].call(this, offsets);
+ }
+ return this.renderer.draw.call(this, offsets, plot);
+ };
+
+ Legend.prototype.pack = function(offsets) {
+ this.renderer.pack.call(this, offsets);
+ };
+
+ /**
+ * Class: Title
+ * Plot Title object. Cannot be instantiated directly, but created
+ * by the Plot oject. Title properties can be set or overriden by the
+ * options passed in from the user.
+ *
+ * Parameters:
+ * text - text of the title.
+ */
+ function Title(text) {
+ $.jqplot.ElemContainer.call(this);
+ // Group: Properties
+
+ // prop: text
+ // text of the title;
+ this.text = text;
+ // prop: show
+ // wether or not to show the title
+ this.show = true;
+ // prop: fontFamily
+ // css font-family spec for the text.
+ this.fontFamily;
+ // prop: fontSize
+ // css font-size spec for the text.
+ this.fontSize ;
+ // prop: textAlign
+ // css text-align spec for the text.
+ this.textAlign;
+ // prop: textColor
+ // css color spec for the text.
+ this.textColor;
+ // prop: renderer
+ // A class for creating a DOM element for the title,
+ // see <$.jqplot.DivTitleRenderer>.
+ this.renderer = $.jqplot.DivTitleRenderer;
+ // prop: rendererOptions
+ // renderer specific options passed to the renderer.
+ this.rendererOptions = {};
+ // prop: escapeHtml
+ // True to escape special characters with their html entity equivalents
+ // in title text. "<" becomes < and so on, so html tags are not rendered.
+ this.escapeHtml = false;
+ }
+
+ Title.prototype = new $.jqplot.ElemContainer();
+ Title.prototype.constructor = Title;
+
+ Title.prototype.init = function() {
+ if ($.isFunction(this.renderer)) {
+ this.renderer = new this.renderer();
+ }
+ this.renderer.init.call(this, this.rendererOptions);
+ };
+
+ Title.prototype.draw = function(width) {
+ return this.renderer.draw.call(this, width);
+ };
+
+ Title.prototype.pack = function() {
+ this.renderer.pack.call(this);
+ };
+
+
+ /**
+ * Class: Series
+ * An individual data series object. Cannot be instantiated directly, but created
+ * by the Plot oject. Series properties can be set or overriden by the
+ * options passed in from the user.
+ */
+ function Series(options) {
+ options = options || {};
+ $.jqplot.ElemContainer.call(this);
+ // Group: Properties
+ // Properties will be assigned from a series array at the top level of the
+ // options. If you had two series and wanted to change the color and line
+ // width of the first and set the second to use the secondary y axis with
+ // no shadow and supply custom labels for each:
+ // > {
+ // > series:[
+ // > {color: '#ff4466', lineWidth: 5, label:'good line'},
+ // > {yaxis: 'y2axis', shadow: false, label:'bad line'}
+ // > ]
+ // > }
+
+ // prop: show
+ // wether or not to draw the series.
+ this.show = true;
+ // prop: xaxis
+ // which x axis to use with this series, either 'xaxis' or 'x2axis'.
+ this.xaxis = 'xaxis';
+ this._xaxis;
+ // prop: yaxis
+ // which y axis to use with this series, either 'yaxis' or 'y2axis'.
+ this.yaxis = 'yaxis';
+ this._yaxis;
+ this.gridBorderWidth = 2.0;
+ // prop: renderer
+ // A class of a renderer which will draw the series,
+ // see <$.jqplot.LineRenderer>.
+ this.renderer = $.jqplot.LineRenderer;
+ // prop: rendererOptions
+ // Options to pass on to the renderer.
+ this.rendererOptions = {};
+ this.data = [];
+ this.gridData = [];
+ // prop: label
+ // Line label to use in the legend.
+ this.label = '';
+ // prop: showLabel
+ // true to show label for this series in the legend.
+ this.showLabel = true;
+ // prop: color
+ // css color spec for the series
+ this.color;
+ // prop: negativeColor
+ // css color spec used for filled (area) plots that are filled to zero and
+ // the "useNegativeColors" option is true.
+ this.negativeColor;
+ // prop: lineWidth
+ // width of the line in pixels. May have different meanings depending on renderer.
+ this.lineWidth = 2.5;
+ // prop: lineJoin
+ // Canvas lineJoin style between segments of series.
+ this.lineJoin = 'round';
+ // prop: lineCap
+ // Canvas lineCap style at ends of line.
+ this.lineCap = 'round';
+ // prop: linePattern
+ // line pattern 'dashed', 'dotted', 'solid', some combination
+ // of '-' and '.' characters such as '.-.' or a numerical array like
+ // [draw, skip, draw, skip, ...] such as [1, 10] to draw a dotted line,
+ // [1, 10, 20, 10] to draw a dot-dash line, and so on.
+ this.linePattern = 'solid';
+ this.shadow = true;
+ // prop: shadowAngle
+ // Shadow angle in degrees
+ this.shadowAngle = 45;
+ // prop: shadowOffset
+ // Shadow offset from line in pixels
+ this.shadowOffset = 1.25;
+ // prop: shadowDepth
+ // Number of times shadow is stroked, each stroke offset shadowOffset from the last.
+ this.shadowDepth = 3;
+ // prop: shadowAlpha
+ // Alpha channel transparency of shadow. 0 = transparent.
+ this.shadowAlpha = '0.1';
+ // prop: breakOnNull
+ // Wether line segments should be be broken at null value.
+ // False will join point on either side of line.
+ this.breakOnNull = false;
+ // prop: markerRenderer
+ // A class of a renderer which will draw marker (e.g. circle, square, ...) at the data points,
+ // see <$.jqplot.MarkerRenderer>.
+ this.markerRenderer = $.jqplot.MarkerRenderer;
+ // prop: markerOptions
+ // renderer specific options to pass to the markerRenderer,
+ // see <$.jqplot.MarkerRenderer>.
+ this.markerOptions = {};
+ // prop: showLine
+ // wether to actually draw the line or not. Series will still be renderered, even if no line is drawn.
+ this.showLine = true;
+ // prop: showMarker
+ // wether or not to show the markers at the data points.
+ this.showMarker = true;
+ // prop: index
+ // 0 based index of this series in the plot series array.
+ this.index;
+ // prop: fill
+ // true or false, wether to fill under lines or in bars.
+ // May not be implemented in all renderers.
+ this.fill = false;
+ // prop: fillColor
+ // CSS color spec to use for fill under line. Defaults to line color.
+ this.fillColor;
+ // prop: fillAlpha
+ // Alpha transparency to apply to the fill under the line.
+ // Use this to adjust alpha separate from fill color.
+ this.fillAlpha;
+ // prop: fillAndStroke
+ // If true will stroke the line (with color this.color) as well as fill under it.
+ // Applies only when fill is true.
+ this.fillAndStroke = false;
+ // prop: disableStack
+ // true to not stack this series with other series in the plot.
+ // To render properly, non-stacked series must come after any stacked series
+ // in the plot's data series array. So, the plot's data series array would look like:
+ // > [stackedSeries1, stackedSeries2, ..., nonStackedSeries1, nonStackedSeries2, ...]
+ // disableStack will put a gap in the stacking order of series, and subsequent
+ // stacked series will not fill down through the non-stacked series and will
+ // most likely not stack properly on top of the non-stacked series.
+ this.disableStack = false;
+ // _stack is set by the Plot if the plot is a stacked chart.
+ // will stack lines or bars on top of one another to build a "mountain" style chart.
+ // May not be implemented in all renderers.
+ this._stack = false;
+ // prop: neighborThreshold
+ // how close or far (in pixels) the cursor must be from a point marker to detect the point.
+ this.neighborThreshold = 4;
+ // prop: fillToZero
+ // true will force bar and filled series to fill toward zero on the fill Axis.
+ this.fillToZero = false;
+ // prop: fillToValue
+ // fill a filled series to this value on the fill axis.
+ // Works in conjunction with fillToZero, so that must be true.
+ this.fillToValue = 0;
+ // prop: fillAxis
+ // Either 'x' or 'y'. Which axis to fill the line toward if fillToZero is true.
+ // 'y' means fill up/down to 0 on the y axis for this series.
+ this.fillAxis = 'y';
+ // prop: useNegativeColors
+ // true to color negative values differently in filled and bar charts.
+ this.useNegativeColors = true;
+ this._stackData = [];
+ // _plotData accounts for stacking. If plots not stacked, _plotData and data are same. If
+ // stacked, _plotData is accumulation of stacking data.
+ this._plotData = [];
+ // _plotValues hold the individual x and y values that will be plotted for this series.
+ this._plotValues = {x:[], y:[]};
+ // statistics about the intervals between data points. Used for auto scaling.
+ this._intervals = {x:{}, y:{}};
+ // data from the previous series, for stacked charts.
+ this._prevPlotData = [];
+ this._prevGridData = [];
+ this._stackAxis = 'y';
+ this._primaryAxis = '_xaxis';
+ // give each series a canvas to draw on. This should allow for redrawing speedups.
+ this.canvas = new $.jqplot.GenericCanvas();
+ this.shadowCanvas = new $.jqplot.GenericCanvas();
+ this.plugins = {};
+ // sum of y values in this series.
+ this._sumy = 0;
+ this._sumx = 0;
+ this._type = '';
+ }
+
+ Series.prototype = new $.jqplot.ElemContainer();
+ Series.prototype.constructor = Series;
+
+ Series.prototype.init = function(index, gridbw, plot) {
+ // weed out any null values in the data.
+ this.index = index;
+ this.gridBorderWidth = gridbw;
+ var d = this.data;
+ var temp = [], i, l;
+ for (i=0, l=d.length; i<l; i++) {
+ if (! this.breakOnNull) {
+ if (d[i] == null || d[i][0] == null || d[i][1] == null) {
+ continue;
+ }
+ else {
+ temp.push(d[i]);
+ }
+ }
+ else {
+ // TODO: figure out what to do with null values
+ // probably involve keeping nulls in data array
+ // and then updating renderers to break line
+ // when it hits null value.
+ // For now, just keep value.
+ temp.push(d[i]);
+ }
+ }
+ this.data = temp;
+
+ // parse the renderer options and apply default colors if not provided
+ // Set color even if not shown, so series don't change colors when other
+ // series on plot shown/hidden.
+ if (!this.color) {
+ this.color = plot.colorGenerator.get(this.index);
+ }
+ if (!this.negativeColor) {
+ this.negativeColor = plot.negativeColorGenerator.get(this.index);
+ }
+
+
+ if (!this.fillColor) {
+ this.fillColor = this.color;
+ }
+ if (this.fillAlpha) {
+ var comp = $.jqplot.normalize2rgb(this.fillColor);
+ var comp = $.jqplot.getColorComponents(comp);
+ this.fillColor = 'rgba('+comp[0]+','+comp[1]+','+comp[2]+','+this.fillAlpha+')';
+ }
+ if ($.isFunction(this.renderer)) {
+ this.renderer = new this.renderer();
+ }
+ this.renderer.init.call(this, this.rendererOptions, plot);
+ this.markerRenderer = new this.markerRenderer();
+ if (!this.markerOptions.color) {
+ this.markerOptions.color = this.color;
+ }
+ if (this.markerOptions.show == null) {
+ this.markerOptions.show = this.showMarker;
+ }
+ this.showMarker = this.markerOptions.show;
+ // the markerRenderer is called within it's own scaope, don't want to overwrite series options!!
+ this.markerRenderer.init(this.markerOptions);
+ };
+
+ // data - optional data point array to draw using this series renderer
+ // gridData - optional grid data point array to draw using this series renderer
+ // stackData - array of cumulative data for stacked plots.
+ Series.prototype.draw = function(sctx, opts, plot) {
+ var options = (opts == undefined) ? {} : opts;
+ sctx = (sctx == undefined) ? this.canvas._ctx : sctx;
+
+ var j, data, gridData;
+
+ // hooks get called even if series not shown
+ // we don't clear canvas here, it would wipe out all other series as well.
+ for (j=0; j<$.jqplot.preDrawSeriesHooks.length; j++) {
+ $.jqplot.preDrawSeriesHooks[j].call(this, sctx, options);
+ }
+ if (this.show) {
+ this.renderer.setGridData.call(this, plot);
+ if (!options.preventJqPlotSeriesDrawTrigger) {
+ $(sctx.canvas).trigger('jqplotSeriesDraw', [this.data, this.gridData]);
+ }
+ data = [];
+ if (options.data) {
+ data = options.data;
+ }
+ else if (!this._stack) {
+ data = this.data;
+ }
+ else {
+ data = this._plotData;
+ }
+ gridData = options.gridData || this.renderer.makeGridData.call(this, data, plot);
+
+ if (this._type === 'line' && this.renderer.smooth && this.renderer._smoothedData.length) {
+ gridData = this.renderer._smoothedData;
+ }
+
+ this.renderer.draw.call(this, sctx, gridData, options, plot);
+ }
+
+ for (j=0; j<$.jqplot.postDrawSeriesHooks.length; j++) {
+ $.jqplot.postDrawSeriesHooks[j].call(this, sctx, options, plot);
+ }
+
+ sctx = opts = plot = j = data = gridData = null;
+ };
+
+ Series.prototype.drawShadow = function(sctx, opts, plot) {
+ var options = (opts == undefined) ? {} : opts;
+ sctx = (sctx == undefined) ? this.shadowCanvas._ctx : sctx;
+
+ var j, data, gridData;
+
+ // hooks get called even if series not shown
+ // we don't clear canvas here, it would wipe out all other series as well.
+ for (j=0; j<$.jqplot.preDrawSeriesShadowHooks.length; j++) {
+ $.jqplot.preDrawSeriesShadowHooks[j].call(this, sctx, options);
+ }
+ if (this.shadow) {
+ this.renderer.setGridData.call(this, plot);
+
+ data = [];
+ if (options.data) {
+ data = options.data;
+ }
+ else if (!this._stack) {
+ data = this.data;
+ }
+ else {
+ data = this._plotData;
+ }
+ gridData = options.gridData || this.renderer.makeGridData.call(this, data, plot);
+
+ this.renderer.drawShadow.call(this, sctx, gridData, options, plot);
+ }
+
+ for (j=0; j<$.jqplot.postDrawSeriesShadowHooks.length; j++) {
+ $.jqplot.postDrawSeriesShadowHooks[j].call(this, sctx, options);
+ }
+
+ sctx = opts = plot = j = data = gridData = null;
+
+ };
+
+ // toggles series display on plot, e.g. show/hide series
+ Series.prototype.toggleDisplay = function(ev, callback) {
+ var s, speed;
+ if (ev.data.series) {
+ s = ev.data.series;
+ }
+ else {
+ s = this;
+ }
+
+ if (ev.data.speed) {
+ speed = ev.data.speed;
+ }
+ if (speed) {
+ // this can be tricky because series may not have a canvas element if replotting.
+ if (s.canvas._elem.is(':hidden') || !s.show) {
+ s.show = true;
+
+ s.canvas._elem.removeClass('jqplot-series-hidden');
+ if (s.shadowCanvas._elem) {
+ s.shadowCanvas._elem.fadeIn(speed);
+ }
+ s.canvas._elem.fadeIn(speed, callback);
+ s.canvas._elem.nextAll('.jqplot-point-label.jqplot-series-'+s.index).fadeIn(speed);
+ }
+ else {
+ s.show = false;
+
+ s.canvas._elem.addClass('jqplot-series-hidden');
+ if (s.shadowCanvas._elem) {
+ s.shadowCanvas._elem.fadeOut(speed);
+ }
+ s.canvas._elem.fadeOut(speed, callback);
+ s.canvas._elem.nextAll('.jqplot-point-label.jqplot-series-'+s.index).fadeOut(speed);
+ }
+ }
+ else {
+ // this can be tricky because series may not have a canvas element if replotting.
+ if (s.canvas._elem.is(':hidden') || !s.show) {
+ s.show = true;
+
+ s.canvas._elem.removeClass('jqplot-series-hidden');
+ if (s.shadowCanvas._elem) {
+ s.shadowCanvas._elem.show();
+ }
+ s.canvas._elem.show(0, callback);
+ s.canvas._elem.nextAll('.jqplot-point-label.jqplot-series-'+s.index).show();
+ }
+ else {
+ s.show = false;
+
+ s.canvas._elem.addClass('jqplot-series-hidden');
+ if (s.shadowCanvas._elem) {
+ s.shadowCanvas._elem.hide();
+ }
+ s.canvas._elem.hide(0, callback);
+ s.canvas._elem.nextAll('.jqplot-point-label.jqplot-series-'+s.index).hide();
+ }
+ }
+ };
+
+
+
+ /**
+ * Class: Grid
+ *
+ * Object representing the grid on which the plot is drawn. The grid in this
+ * context is the area bounded by the axes, the area which will contain the series.
+ * Note, the series are drawn on their own canvas.
+ * The Grid object cannot be instantiated directly, but is created by the Plot oject.
+ * Grid properties can be set or overriden by the options passed in from the user.
+ */
+ function Grid() {
+ $.jqplot.ElemContainer.call(this);
+ // Group: Properties
+
+ // prop: drawGridlines
+ // wether to draw the gridlines on the plot.
+ this.drawGridlines = true;
+ // prop: gridLineColor
+ // color of the grid lines.
+ this.gridLineColor = '#cccccc';
+ // prop: gridLineWidth
+ // width of the grid lines.
+ this.gridLineWidth = 1.0;
+ // prop: background
+ // css spec for the background color.
+ this.background = '#fffdf6';
+ // prop: borderColor
+ // css spec for the color of the grid border.
+ this.borderColor = '#999999';
+ // prop: borderWidth
+ // width of the border in pixels.
+ this.borderWidth = 2.0;
+ // prop: drawBorder
+ // True to draw border around grid.
+ this.drawBorder = true;
+ // prop: shadow
+ // wether to show a shadow behind the grid.
+ this.shadow = true;
+ // prop: shadowAngle
+ // shadow angle in degrees
+ this.shadowAngle = 45;
+ // prop: shadowOffset
+ // Offset of each shadow stroke from the border in pixels
+ this.shadowOffset = 1.5;
+ // prop: shadowWidth
+ // width of the stoke for the shadow
+ this.shadowWidth = 3;
+ // prop: shadowDepth
+ // Number of times shadow is stroked, each stroke offset shadowOffset from the last.
+ this.shadowDepth = 3;
+ // prop: shadowColor
+ // an optional css color spec for the shadow in 'rgba(n, n, n, n)' form
+ this.shadowColor = null;
+ // prop: shadowAlpha
+ // Alpha channel transparency of shadow. 0 = transparent.
+ this.shadowAlpha = '0.07';
+ this._left;
+ this._top;
+ this._right;
+ this._bottom;
+ this._width;
+ this._height;
+ this._axes = [];
+ // prop: renderer
+ // Instance of a renderer which will actually render the grid,
+ // see <$.jqplot.CanvasGridRenderer>.
+ this.renderer = $.jqplot.CanvasGridRenderer;
+ // prop: rendererOptions
+ // Options to pass on to the renderer,
+ // see <$.jqplot.CanvasGridRenderer>.
+ this.rendererOptions = {};
+ this._offsets = {top:null, bottom:null, left:null, right:null};
+ }
+
+ Grid.prototype = new $.jqplot.ElemContainer();
+ Grid.prototype.constructor = Grid;
+
+ Grid.prototype.init = function() {
+ if ($.isFunction(this.renderer)) {
+ this.renderer = new this.renderer();
+ }
+ this.renderer.init.call(this, this.rendererOptions);
+ };
+
+ Grid.prototype.createElement = function(offsets,plot) {
+ this._offsets = offsets;
+ return this.renderer.createElement.call(this, plot);
+ };
+
+ Grid.prototype.draw = function() {
+ this.renderer.draw.call(this);
+ };
+
+ $.jqplot.GenericCanvas = function() {
+ $.jqplot.ElemContainer.call(this);
+ this._ctx;
+ };
+
+ $.jqplot.GenericCanvas.prototype = new $.jqplot.ElemContainer();
+ $.jqplot.GenericCanvas.prototype.constructor = $.jqplot.GenericCanvas;
+
+ $.jqplot.GenericCanvas.prototype.createElement = function(offsets, clss, plotDimensions, plot) {
+ this._offsets = offsets;
+ var klass = 'jqplot';
+ if (clss != undefined) {
+ klass = clss;
+ }
+ var elem;
+
+ elem = plot.canvasManager.getCanvas();
+
+ // if new plotDimensions supplied, use them.
+ if (plotDimensions != null) {
+ this._plotDimensions = plotDimensions;
+ }
+
+ elem.width = this._plotDimensions.width - this._offsets.left - this._offsets.right;
+ elem.height = this._plotDimensions.height - this._offsets.top - this._offsets.bottom;
+ this._elem = $(elem);
+ this._elem.css({ position: 'absolute', left: this._offsets.left, top: this._offsets.top });
+
+ this._elem.addClass(klass);
+
+ elem = plot.canvasManager.initCanvas(elem);
+
+ elem = null;
+ return this._elem;
+ };
+
+ $.jqplot.GenericCanvas.prototype.setContext = function() {
+ this._ctx = this._elem.get(0).getContext("2d");
+ return this._ctx;
+ };
+
+ // Memory Leaks patch
+ $.jqplot.GenericCanvas.prototype.resetCanvas = function() {
+ if (this._elem) {
+ if ($.jqplot.use_excanvas && window.G_vmlCanvasManager.uninitElement !== undefined) {
+ window.G_vmlCanvasManager.uninitElement(this._elem.get(0));
+ }
+
+ //this._elem.remove();
+ this._elem.emptyForce();
+ }
+
+ this._ctx = null;
+ };
+
+ $.jqplot.HooksManager = function () {
+ this.hooks =[];
+ this.args = [];
+ };
+
+ $.jqplot.HooksManager.prototype.addOnce = function(fn, args) {
+ args = args || [];
+ var havehook = false;
+ for (var i=0, l=this.hooks.length; i<l; i++) {
+ if (this.hooks[i] == fn) {
+ havehook = true;
+ }
+ }
+ if (!havehook) {
+ this.hooks.push(fn);
+ this.args.push(args);
+ }
+ };
+
+ $.jqplot.HooksManager.prototype.add = function(fn, args) {
+ args = args || [];
+ this.hooks.push(fn);
+ this.args.push(args);
+ };
+
+ $.jqplot.EventListenerManager = function () {
+ this.hooks =[];
+ };
+
+ $.jqplot.EventListenerManager.prototype.addOnce = function(ev, fn) {
+ var havehook = false, h, i;
+ for (var i=0, l=this.hooks.length; i<l; i++) {
+ h = this.hooks[i];
+ if (h[0] == ev && h[1] == fn) {
+ havehook = true;
+ }
+ }
+ if (!havehook) {
+ this.hooks.push([ev, fn]);
+ }
+ };
+
+ $.jqplot.EventListenerManager.prototype.add = function(ev, fn) {
+ this.hooks.push([ev, fn]);
+ };
+
+
+ var _axisNames = ['yMidAxis', 'xaxis', 'yaxis', 'x2axis', 'y2axis', 'y3axis', 'y4axis', 'y5axis', 'y6axis', 'y7axis', 'y8axis', 'y9axis'];
+
+ /**
+ * Class: jqPlot
+ * Plot object returned by call to $.jqplot. Handles parsing user options,
+ * creating sub objects (Axes, legend, title, series) and rendering the plot.
+ */
+ function jqPlot() {
+ // Group: Properties
+ // These properties are specified at the top of the options object
+ // like so:
+ // > {
+ // > axesDefaults:{min:0},
+ // > series:[{color:'#6633dd'}],
+ // > title: 'A Plot'
+ // > }
+ //
+
+ // prop: animate
+ // True to animate the series on initial plot draw (renderer dependent).
+ // Actual animation functionality must be supported in the renderer.
+ this.animate = false;
+ // prop: animateReplot
+ // True to animate series after a call to the replot() method.
+ // Use with caution! Replots can happen very frequently under
+ // certain circumstances (e.g. resizing, dragging points) and
+ // animation in these situations can cause problems.
+ this.animateReplot = false;
+ // prop: axes
+ // up to 4 axes are supported, each with it's own options,
+ // See <Axis> for axis specific options.
+ this.axes = {xaxis: new Axis('xaxis'), yaxis: new Axis('yaxis'), x2axis: new Axis('x2axis'), y2axis: new Axis('y2axis'), y3axis: new Axis('y3axis'), y4axis: new Axis('y4axis'), y5axis: new Axis('y5axis'), y6axis: new Axis('y6axis'), y7axis: new Axis('y7axis'), y8axis: new Axis('y8axis'), y9axis: new Axis('y9axis'), yMidAxis: new Axis('yMidAxis')};
+ this.baseCanvas = new $.jqplot.GenericCanvas();
+ // true to intercept right click events and fire a 'jqplotRightClick' event.
+ // this will also block the context menu.
+ this.captureRightClick = false;
+ // prop: data
+ // user's data. Data should *NOT* be specified in the options object,
+ // but be passed in as the second argument to the $.jqplot() function.
+ // The data property is described here soley for reference.
+ // The data should be in the form of an array of 2D or 1D arrays like
+ // > [ [[x1, y1], [x2, y2],...], [y1, y2, ...] ].
+ this.data = [];
+ // prop: dataRenderer
+ // A callable which can be used to preprocess data passed into the plot.
+ // Will be called with 2 arguments, the plot data and a reference to the plot.
+ this.dataRenderer;
+ // prop: dataRendererOptions
+ // Options that will be passed to the dataRenderer.
+ // Can be of any type.
+ this.dataRendererOptions;
+ this.defaults = {
+ // prop: axesDefaults
+ // default options that will be applied to all axes.
+ // see <Axis> for axes options.
+ axesDefaults: {},
+ axes: {xaxis:{}, yaxis:{}, x2axis:{}, y2axis:{}, y3axis:{}, y4axis:{}, y5axis:{}, y6axis:{}, y7axis:{}, y8axis:{}, y9axis:{}, yMidAxis:{}},
+ // prop: seriesDefaults
+ // default options that will be applied to all series.
+ // see <Series> for series options.
+ seriesDefaults: {},
+ series:[]
+ };
+ // prop: defaultAxisStart
+ // 1-D data series are internally converted into 2-D [x,y] data point arrays
+ // by jqPlot. This is the default starting value for the missing x or y value.
+ // The added data will be a monotonically increasing series (e.g. [1, 2, 3, ...])
+ // starting at this value.
+ this.defaultAxisStart = 1;
+ // this.doCustomEventBinding = true;
+ // prop: drawIfHidden
+ // True to execute the draw method even if the plot target is hidden.
+ // Generally, this should be false. Most plot elements will not be sized/
+ // positioned correclty if renderered into a hidden container. To render into
+ // a hidden container, call the replot method when the container is shown.
+ this.drawIfHidden = false;
+ this.eventCanvas = new $.jqplot.GenericCanvas();
+ // prop: fillBetween
+ // Fill between 2 line series in a plot.
+ // Options object:
+ // {
+ // series1: first index (0 based) of series in fill
+ // series2: second index (0 based) of series in fill
+ // color: color of fill [default fillColor of series1]
+ // baseSeries: fill will be drawn below this series (0 based index)
+ // fill: false to turn off fill [default true].
+ // }
+ this.fillBetween = {
+ series1: null,
+ series2: null,
+ color: null,
+ baseSeries: 0,
+ fill: true
+ };
+ // prop; fontFamily
+ // css spec for the font-family attribute. Default for the entire plot.
+ this.fontFamily;
+ // prop: fontSize
+ // css spec for the font-size attribute. Default for the entire plot.
+ this.fontSize;
+ // prop: grid
+ // See <Grid> for grid specific options.
+ this.grid = new Grid();
+ // prop: legend
+ // see <$.jqplot.TableLegendRenderer>
+ this.legend = new Legend();
+ // prop: noDataIndicator
+ // Options to set up a mock plot with a data loading indicator if no data is specified.
+ this.negativeSeriesColors = $.jqplot.config.defaultNegativeColors;
+ this.noDataIndicator = {
+ show: false,
+ indicator: 'Loading Data...',
+ axes: {
+ xaxis: {
+ min: 0,
+ max: 10,
+ tickInterval: 2,
+ show: true
+ },
+ yaxis: {
+ min: 0,
+ max: 12,
+ tickInterval: 3,
+ show: true
+ }
+ }
+ };
+ // container to hold all of the merged options. Convienence for plugins.
+ this.options = {};
+ this.previousSeriesStack = [];
+ // Namespece to hold plugins. Generally non-renderer plugins add themselves to here.
+ this.plugins = {};
+ // prop: series
+ // Array of series object options.
+ // see <Series> for series specific options.
+ this.series = [];
+ // array of series indicies. Keep track of order
+ // which series canvases are displayed, lowest
+ // to highest, back to front.
+ this.seriesStack = [];
+ // prop: seriesColors
+ // Ann array of CSS color specifications that will be applied, in order,
+ // to the series in the plot. Colors will wrap around so, if their
+ // are more series than colors, colors will be reused starting at the
+ // beginning. For pie charts, this specifies the colors of the slices.
+ this.seriesColors = $.jqplot.config.defaultColors;
+ // prop: sortData
+ // false to not sort the data passed in by the user.
+ // Many bar, stakced and other graphs as well as many plugins depend on
+ // having sorted data.
+ this.sortData = true;
+ // prop: stackSeries
+ // true or false, creates a stack or "mountain" plot.
+ // Not all series renderers may implement this option.
+ this.stackSeries = false;
+ // a shortcut for axis syncTicks options. Not implemented yet.
+ this.syncXTicks = true;
+ // a shortcut for axis syncTicks options. Not implemented yet.
+ this.syncYTicks = true;
+ // the jquery object for the dom target.
+ this.target = null;
+ // The id of the dom element to render the plot into
+ this.targetId = null;
+ // prop textColor
+ // css spec for the css color attribute. Default for the entire plot.
+ this.textColor;
+ // prop: title
+ // Title object. See <Title> for specific options. As a shortcut, you
+ // can specify the title option as just a string like: title: 'My Plot'
+ // and this will create a new title object with the specified text.
+ this.title = new Title();
+ // Count how many times the draw method has been called while the plot is visible.
+ // Mostly used to test if plot has never been dran (=0), has been successfully drawn
+ // into a visible container once (=1) or draw more than once into a visible container.
+ // Can use this in tests to see if plot has been visibly drawn at least one time.
+ // After plot has been visibly drawn once, it generally doesn't need redrawn if its
+ // container is hidden and shown.
+ this._drawCount = 0;
+ // sum of y values for all series in plot.
+ // used in mekko chart.
+ this._sumy = 0;
+ this._sumx = 0;
+ // array to hold the cumulative stacked series data.
+ // used to ajust the individual series data, which won't have access to other
+ // series data.
+ this._stackData = [];
+ // array that holds the data to be plotted. This will be the series data
+ // merged with the the appropriate data from _stackData according to the stackAxis.
+ this._plotData = [];
+ this._width = null;
+ this._height = null;
+ this._plotDimensions = {height:null, width:null};
+ this._gridPadding = {top:null, right:null, bottom:null, left:null};
+ this._defaultGridPadding = {top:10, right:10, bottom:23, left:10};
+
+ this._addDomReference = $.jqplot.config.addDomReference;
+
+ this.preInitHooks = new $.jqplot.HooksManager();
+ this.postInitHooks = new $.jqplot.HooksManager();
+ this.preParseOptionsHooks = new $.jqplot.HooksManager();
+ this.postParseOptionsHooks = new $.jqplot.HooksManager();
+ this.preDrawHooks = new $.jqplot.HooksManager();
+ this.postDrawHooks = new $.jqplot.HooksManager();
+ this.preDrawSeriesHooks = new $.jqplot.HooksManager();
+ this.postDrawSeriesHooks = new $.jqplot.HooksManager();
+ this.preDrawLegendHooks = new $.jqplot.HooksManager();
+ this.addLegendRowHooks = new $.jqplot.HooksManager();
+ this.preSeriesInitHooks = new $.jqplot.HooksManager();
+ this.postSeriesInitHooks = new $.jqplot.HooksManager();
+ this.preParseSeriesOptionsHooks = new $.jqplot.HooksManager();
+ this.postParseSeriesOptionsHooks = new $.jqplot.HooksManager();
+ this.eventListenerHooks = new $.jqplot.EventListenerManager();
+ this.preDrawSeriesShadowHooks = new $.jqplot.HooksManager();
+ this.postDrawSeriesShadowHooks = new $.jqplot.HooksManager();
+
+ this.colorGenerator = new $.jqplot.ColorGenerator();
+ this.negativeColorGenerator = new $.jqplot.ColorGenerator();
+
+ this.canvasManager = new $.jqplot.CanvasManager();
+
+ this.themeEngine = new $.jqplot.ThemeEngine();
+
+ var seriesColorsIndex = 0;
+
+ // Group: methods
+ //
+ // method: init
+ // sets the plot target, checks data and applies user
+ // options to plot.
+ this.init = function(target, data, options) {
+ options = options || {};
+ for (var i=0; i<$.jqplot.preInitHooks.length; i++) {
+ $.jqplot.preInitHooks[i].call(this, target, data, options);
+ }
+
+ for (var i=0; i<this.preInitHooks.hooks.length; i++) {
+ this.preInitHooks.hooks[i].call(this, target, data, options);
+ }
+
+ this.targetId = '#'+target;
+ this.target = $('#'+target);
+
+ //////
+ // Add a reference to plot
+ //////
+ if (this._addDomReference) {
+ this.target.data('jqplot', this);
+ }
+ // remove any error class that may be stuck on target.
+ this.target.removeClass('jqplot-error');
+ if (!this.target.get(0)) {
+ throw "No plot target specified";
+ }
+
+ // make sure the target is positioned by some means and set css
+ if (this.target.css('position') == 'static') {
+ this.target.css('position', 'relative');
+ }
+ if (!this.target.hasClass('jqplot-target')) {
+ this.target.addClass('jqplot-target');
+ }
+
+ // if no height or width specified, use a default.
+ if (!this.target.height()) {
+ var h;
+ if (options && options.height) {
+ h = parseInt(options.height, 10);
+ }
+ else if (this.target.attr('data-height')) {
+ h = parseInt(this.target.attr('data-height'), 10);
+ }
+ else {
+ h = parseInt($.jqplot.config.defaultHeight, 10);
+ }
+ this._height = h;
+ this.target.css('height', h+'px');
+ }
+ else {
+ this._height = h = this.target.height();
+ }
+ if (!this.target.width()) {
+ var w;
+ if (options && options.width) {
+ w = parseInt(options.width, 10);
+ }
+ else if (this.target.attr('data-width')) {
+ w = parseInt(this.target.attr('data-width'), 10);
+ }
+ else {
+ w = parseInt($.jqplot.config.defaultWidth, 10);
+ }
+ this._width = w;
+ this.target.css('width', w+'px');
+ }
+ else {
+ this._width = w = this.target.width();
+ }
+
+ for (var i=0, l=_axisNames.length; i<l; i++) {
+ this.axes[_axisNames[i]] = new Axis(_axisNames[i]);
+ }
+
+ this._plotDimensions.height = this._height;
+ this._plotDimensions.width = this._width;
+ this.grid._plotDimensions = this._plotDimensions;
+ this.title._plotDimensions = this._plotDimensions;
+ this.baseCanvas._plotDimensions = this._plotDimensions;
+ this.eventCanvas._plotDimensions = this._plotDimensions;
+ this.legend._plotDimensions = this._plotDimensions;
+ if (this._height <=0 || this._width <=0 || !this._height || !this._width) {
+ throw "Canvas dimension not set";
+ }
+
+ if (options.dataRenderer && $.isFunction(options.dataRenderer)) {
+ if (options.dataRendererOptions) {
+ this.dataRendererOptions = options.dataRendererOptions;
+ }
+ this.dataRenderer = options.dataRenderer;
+ data = this.dataRenderer(data, this, this.dataRendererOptions);
+ }
+
+ if (options.noDataIndicator && $.isPlainObject(options.noDataIndicator)) {
+ $.extend(true, this.noDataIndicator, options.noDataIndicator);
+ }
+
+ if (data == null || $.isArray(data) == false || data.length == 0 || $.isArray(data[0]) == false || data[0].length == 0) {
+
+ if (this.noDataIndicator.show == false) {
+ throw "No Data";
+ }
+
+ else {
+ // have to be descructive here in order for plot to not try and render series.
+ // This means that $.jqplot() will have to be called again when there is data.
+ //delete options.series;
+
+ for (var ax in this.noDataIndicator.axes) {
+ for (var prop in this.noDataIndicator.axes[ax]) {
+ this.axes[ax][prop] = this.noDataIndicator.axes[ax][prop];
+ }
+ }
+
+ this.postDrawHooks.add(function() {
+ var eh = this.eventCanvas.getHeight();
+ var ew = this.eventCanvas.getWidth();
+ var temp = $('<div class="jqplot-noData-container" style="position:absolute;"></div>');
+ this.target.append(temp);
+ temp.height(eh);
+ temp.width(ew);
+ temp.css('top', this.eventCanvas._offsets.top);
+ temp.css('left', this.eventCanvas._offsets.left);
+
+ var temp2 = $('<div class="jqplot-noData-contents" style="text-align:center; position:relative; margin-left:auto; margin-right:auto;"></div>');
+ temp.append(temp2);
+ temp2.html(this.noDataIndicator.indicator);
+ var th = temp2.height();
+ var tw = temp2.width();
+ temp2.height(th);
+ temp2.width(tw);
+ temp2.css('top', (eh - th)/2 + 'px');
+ });
+
+ }
+ }
+
+ // make a copy of the data
+ this.data = $.extend(true, [], data);
+
+ this.parseOptions(options);
+
+ if (this.textColor) {
+ this.target.css('color', this.textColor);
+ }
+ if (this.fontFamily) {
+ this.target.css('font-family', this.fontFamily);
+ }
+ if (this.fontSize) {
+ this.target.css('font-size', this.fontSize);
+ }
+
+ this.title.init();
+ this.legend.init();
+ this._sumy = 0;
+ this._sumx = 0;
+ this.computePlotData();
+ for (var i=0; i<this.series.length; i++) {
+ // set default stacking order for series canvases
+ this.seriesStack.push(i);
+ this.previousSeriesStack.push(i);
+ this.series[i].shadowCanvas._plotDimensions = this._plotDimensions;
+ this.series[i].canvas._plotDimensions = this._plotDimensions;
+ for (var j=0; j<$.jqplot.preSeriesInitHooks.length; j++) {
+ $.jqplot.preSeriesInitHooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this);
+ }
+ for (var j=0; j<this.preSeriesInitHooks.hooks.length; j++) {
+ this.preSeriesInitHooks.hooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this);
+ }
+ // this.populatePlotData(this.series[i], i);
+ this.series[i]._plotDimensions = this._plotDimensions;
+ this.series[i].init(i, this.grid.borderWidth, this);
+ for (var j=0; j<$.jqplot.postSeriesInitHooks.length; j++) {
+ $.jqplot.postSeriesInitHooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this);
+ }
+ for (var j=0; j<this.postSeriesInitHooks.hooks.length; j++) {
+ this.postSeriesInitHooks.hooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this);
+ }
+ this._sumy += this.series[i]._sumy;
+ this._sumx += this.series[i]._sumx;
+ }
+
+ var name,
+ axis;
+ for (var i=0, l=_axisNames.length; i<l; i++) {
+ name = _axisNames[i];
+ axis = this.axes[name];
+ axis._plotDimensions = this._plotDimensions;
+ axis.init();
+ if (this.axes[name].borderColor == null) {
+ if (name.charAt(0) !== 'x' && axis.useSeriesColor === true && axis.show) {
+ axis.borderColor = axis._series[0].color;
+ }
+ else {
+ axis.borderColor = this.grid.borderColor;
+ }
+ }
+ }
+
+ if (this.sortData) {
+ sortData(this.series);
+ }
+ this.grid.init();
+ this.grid._axes = this.axes;
+
+ this.legend._series = this.series;
+
+ for (var i=0; i<$.jqplot.postInitHooks.length; i++) {
+ $.jqplot.postInitHooks[i].call(this, target, this.data, options);
+ }
+
+ for (var i=0; i<this.postInitHooks.hooks.length; i++) {
+ this.postInitHooks.hooks[i].call(this, target, this.data, options);
+ }
+ };
+
+ // method: resetAxesScale
+ // Reset the specified axes min, max, numberTicks and tickInterval properties to null
+ // or reset these properties on all axes if no list of axes is provided.
+ //
+ // Parameters:
+ // axes - Boolean to reset or not reset all axes or an array or object of axis names to reset.
+ this.resetAxesScale = function(axes, options) {
+ var opts = options || {};
+ var ax = axes || this.axes;
+ if (ax === true) {
+ ax = this.axes;
+ }
+ if ($.isArray(ax)) {
+ for (var i = 0; i < ax.length; i++) {
+ this.axes[ax[i]].resetScale(opts[ax[i]]);
+ }
+ }
+ else if (typeof(ax) === 'object') {
+ for (var name in ax) {
+ this.axes[name].resetScale(opts[name]);
+ }
+ }
+ };
+ // method: reInitialize
+ // reinitialize plot for replotting.
+ // not called directly.
+ this.reInitialize = function (data, opts) {
+ // Plot should be visible and have a height and width.
+ // If plot doesn't have height and width for some
+ // reason, set it by other means. Plot must not have
+ // a display:none attribute, however.
+
+ var options = $.extend(true, {}, this.options, opts);
+
+ var target = this.targetId.substr(1);
+ var tdata = (data == null) ? this.data : data;
+
+ for (var i=0; i<$.jqplot.preInitHooks.length; i++) {
+ $.jqplot.preInitHooks[i].call(this, target, tdata, options);
+ }
+
+ for (var i=0; i<this.preInitHooks.hooks.length; i++) {
+ this.preInitHooks.hooks[i].call(this, target, tdata, options);
+ }
+
+ this._height = this.target.height();
+ this._width = this.target.width();
+
+ if (this._height <=0 || this._width <=0 || !this._height || !this._width) {
+ throw "Target dimension not set";
+ }
+
+ this._plotDimensions.height = this._height;
+ this._plotDimensions.width = this._width;
+ this.grid._plotDimensions = this._plotDimensions;
+ this.title._plotDimensions = this._plotDimensions;
+ this.baseCanvas._plotDimensions = this._plotDimensions;
+ this.eventCanvas._plotDimensions = this._plotDimensions;
+ this.legend._plotDimensions = this._plotDimensions;
+
+ var name,
+ t,
+ j,
+ axis;
+
+ for (var i=0, l=_axisNames.length; i<l; i++) {
+ name = _axisNames[i];
+ axis = this.axes[name];
+
+ // Memory Leaks patch : clear ticks elements
+ t = axis._ticks;
+ for (var j = 0, tlen = t.length; j < tlen; j++) {
+ var el = t[j]._elem;
+ if (el) {
+ // if canvas renderer
+ if ($.jqplot.use_excanvas && window.G_vmlCanvasManager.uninitElement !== undefined) {
+ window.G_vmlCanvasManager.uninitElement(el.get(0));
+ }
+ el.emptyForce();
+ el = null;
+ t._elem = null;
+ }
+ }
+ t = null;
+
+ delete axis.ticks;
+ delete axis._ticks;
+ this.axes[name] = new Axis(name);
+ this.axes[name]._plotWidth = this._width;
+ this.axes[name]._plotHeight = this._height;
+ }
+
+ if (data) {
+ if (options.dataRenderer && $.isFunction(options.dataRenderer)) {
+ if (options.dataRendererOptions) {
+ this.dataRendererOptions = options.dataRendererOptions;
+ }
+ this.dataRenderer = options.dataRenderer;
+ data = this.dataRenderer(data, this, this.dataRendererOptions);
+ }
+
+ // make a copy of the data
+ this.data = $.extend(true, [], data);
+ }
+
+ if (opts) {
+ this.parseOptions(options);
+ }
+
+ this.title._plotWidth = this._width;
+
+ if (this.textColor) {
+ this.target.css('color', this.textColor);
+ }
+ if (this.fontFamily) {
+ this.target.css('font-family', this.fontFamily);
+ }
+ if (this.fontSize) {
+ this.target.css('font-size', this.fontSize);
+ }
+
+ this.title.init();
+ this.legend.init();
+ this._sumy = 0;
+ this._sumx = 0;
+
+ this.seriesStack = [];
+ this.previousSeriesStack = [];
+
+ this.computePlotData();
+ for (var i=0, l=this.series.length; i<l; i++) {
+ // set default stacking order for series canvases
+ this.seriesStack.push(i);
+ this.previousSeriesStack.push(i);
+ this.series[i].shadowCanvas._plotDimensions = this._plotDimensions;
+ this.series[i].canvas._plotDimensions = this._plotDimensions;
+ for (var j=0; j<$.jqplot.preSeriesInitHooks.length; j++) {
+ $.jqplot.preSeriesInitHooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this);
+ }
+ for (var j=0; j<this.preSeriesInitHooks.hooks.length; j++) {
+ this.preSeriesInitHooks.hooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this);
+ }
+ // this.populatePlotData(this.series[i], i);
+ this.series[i]._plotDimensions = this._plotDimensions;
+ this.series[i].init(i, this.grid.borderWidth, this);
+ for (var j=0; j<$.jqplot.postSeriesInitHooks.length; j++) {
+ $.jqplot.postSeriesInitHooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this);
+ }
+ for (var j=0; j<this.postSeriesInitHooks.hooks.length; j++) {
+ this.postSeriesInitHooks.hooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this);
+ }
+ this._sumy += this.series[i]._sumy;
+ this._sumx += this.series[i]._sumx;
+ }
+
+ for (var i=0, l=_axisNames.length; i<l; i++) {
+ name = _axisNames[i];
+ axis = this.axes[name];
+
+ axis._plotDimensions = this._plotDimensions;
+ axis.init();
+ if (axis.borderColor == null) {
+ if (name.charAt(0) !== 'x' && axis.useSeriesColor === true && axis.show) {
+ axis.borderColor = axis._series[0].color;
+ }
+ else {
+ axis.borderColor = this.grid.borderColor;
+ }
+ }
+ }
+
+ if (this.sortData) {
+ sortData(this.series);
+ }
+ this.grid.init();
+ this.grid._axes = this.axes;
+
+ this.legend._series = this.series;
+
+ for (var i=0, l=$.jqplot.postInitHooks.length; i<l; i++) {
+ $.jqplot.postInitHooks[i].call(this, target, this.data, options);
+ }
+
+ for (var i=0, l=this.postInitHooks.hooks.length; i<l; i++) {
+ this.postInitHooks.hooks[i].call(this, target, this.data, options);
+ }
+ };
+
+
+
+ // method: quickInit
+ //
+ // Quick reinitialization plot for replotting.
+ // Does not parse options ore recreate axes and series.
+ // not called directly.
+ this.quickInit = function () {
+ // Plot should be visible and have a height and width.
+ // If plot doesn't have height and width for some
+ // reason, set it by other means. Plot must not have
+ // a display:none attribute, however.
+
+ this._height = this.target.height();
+ this._width = this.target.width();
+
+ if (this._height <=0 || this._width <=0 || !this._height || !this._width) {
+ throw "Target dimension not set";
+ }
+
+ this._plotDimensions.height = this._height;
+ this._plotDimensions.width = this._width;
+ this.grid._plotDimensions = this._plotDimensions;
+ this.title._plotDimensions = this._plotDimensions;
+ this.baseCanvas._plotDimensions = this._plotDimensions;
+ this.eventCanvas._plotDimensions = this._plotDimensions;
+ this.legend._plotDimensions = this._plotDimensions;
+
+ for (var n in this.axes) {
+ this.axes[n]._plotWidth = this._width;
+ this.axes[n]._plotHeight = this._height;
+ }
+
+ this.title._plotWidth = this._width;
+
+ if (this.textColor) {
+ this.target.css('color', this.textColor);
+ }
+ if (this.fontFamily) {
+ this.target.css('font-family', this.fontFamily);
+ }
+ if (this.fontSize) {
+ this.target.css('font-size', this.fontSize);
+ }
+
+ this._sumy = 0;
+ this._sumx = 0;
+ this.computePlotData();
+ for (var i=0; i<this.series.length; i++) {
+ // this.populatePlotData(this.series[i], i);
+ if (this.series[i]._type === 'line' && this.series[i].renderer.bands.show) {
+ this.series[i].renderer.initBands.call(this.series[i], this.series[i].renderer.options, this);
+ }
+ this.series[i]._plotDimensions = this._plotDimensions;
+ this.series[i].canvas._plotDimensions = this._plotDimensions;
+ //this.series[i].init(i, this.grid.borderWidth);
+ this._sumy += this.series[i]._sumy;
+ this._sumx += this.series[i]._sumx;
+ }
+
+ var name;
+
+ for (var j=0; j<12; j++) {
+ name = _axisNames[j];
+ // Memory Leaks patch : clear ticks elements
+ var t = this.axes[name]._ticks;
+ for (var i = 0; i < t.length; i++) {
+ var el = t[i]._elem;
+ if (el) {
+ // if canvas renderer
+ if ($.jqplot.use_excanvas && window.G_vmlCanvasManager.uninitElement !== undefined) {
+ window.G_vmlCanvasManager.uninitElement(el.get(0));
+ }
+ el.emptyForce();
+ el = null;
+ t._elem = null;
+ }
+ }
+ t = null;
+
+ this.axes[name]._plotDimensions = this._plotDimensions;
+ this.axes[name]._ticks = [];
+ // this.axes[name].renderer.init.call(this.axes[name], {});
+ }
+
+ if (this.sortData) {
+ sortData(this.series);
+ }
+
+ this.grid._axes = this.axes;
+
+ this.legend._series = this.series;
+ };
+
+ // sort the series data in increasing order.
+ function sortData(series) {
+ var d, sd, pd, ppd, ret;
+ for (var i=0; i<series.length; i++) {
+ var check;
+ var bat = [series[i].data, series[i]._stackData, series[i]._plotData, series[i]._prevPlotData];
+ for (var n=0; n<4; n++) {
+ check = true;
+ d = bat[n];
+ if (series[i]._stackAxis == 'x') {
+ for (var j = 0; j < d.length; j++) {
+ if (typeof(d[j][1]) != "number") {
+ check = false;
+ break;
+ }
+ }
+ if (check) {
+ d.sort(function(a,b) { return a[1] - b[1]; });
+ }
+ }
+ else {
+ for (var j = 0; j < d.length; j++) {
+ if (typeof(d[j][0]) != "number") {
+ check = false;
+ break;
+ }
+ }
+ if (check) {
+ d.sort(function(a,b) { return a[0] - b[0]; });
+ }
+ }
+ }
+
+ }
+ }
+
+ this.computePlotData = function() {
+ this._plotData = [];
+ this._stackData = [];
+ var series,
+ index,
+ l;
+
+
+ for (index=0, l=this.series.length; index<l; index++) {
+ series = this.series[index];
+ this._plotData.push([]);
+ this._stackData.push([]);
+ var cd = series.data;
+ this._plotData[index] = $.extend(true, [], cd);
+ this._stackData[index] = $.extend(true, [], cd);
+ series._plotData = this._plotData[index];
+ series._stackData = this._stackData[index];
+ var plotValues = {x:[], y:[]};
+
+ if (this.stackSeries && !series.disableStack) {
+ series._stack = true;
+ ///////////////////////////
+ // have to check for nulls
+ ///////////////////////////
+ var sidx = (series._stackAxis === 'x') ? 0 : 1;
+
+ for (var k=0, cdl=cd.length; k<cdl; k++) {
+ var temp = cd[k][sidx];
+ if (temp == null) {
+ temp = 0;
+ }
+ this._plotData[index][k][sidx] = temp;
+ this._stackData[index][k][sidx] = temp;
+
+ if (index > 0) {
+ for (var j=index; j--;) {
+ var prevval = this._plotData[j][k][sidx];
+ // only need to sum up the stack axis column of data
+ // and only sum if it is of same sign.
+ // if previous series isn't same sign, keep looking
+ // at earlier series untill we find one of same sign.
+ if (temp * prevval >= 0) {
+ this._plotData[index][k][sidx] += prevval;
+ this._stackData[index][k][sidx] += prevval;
+ break;
+ }
+ }
+ }
+ }
+
+ }
+ else {
+ for (var i=0; i<series.data.length; i++) {
+ plotValues.x.push(series.data[i][0]);
+ plotValues.y.push(series.data[i][1]);
+ }
+ this._stackData.push(series.data);
+ this.series[index]._stackData = series.data;
+ this._plotData.push(series.data);
+ series._plotData = series.data;
+ series._plotValues = plotValues;
+ }
+ if (index>0) {
+ series._prevPlotData = this.series[index-1]._plotData;
+ }
+ series._sumy = 0;
+ series._sumx = 0;
+ for (i=series.data.length-1; i>-1; i--) {
+ series._sumy += series.data[i][1];
+ series._sumx += series.data[i][0];
+ }
+ }
+
+ };
+
+ // populate the _stackData and _plotData arrays for the plot and the series.
+ this.populatePlotData = function(series, index) {
+ // if a stacked chart, compute the stacked data
+ this._plotData = [];
+ this._stackData = [];
+ series._stackData = [];
+ series._plotData = [];
+ var plotValues = {x:[], y:[]};
+ if (this.stackSeries && !series.disableStack) {
+ series._stack = true;
+ var sidx = (series._stackAxis === 'x') ? 0 : 1;
+ // var idx = sidx ? 0 : 1;
+ // push the current data into stackData
+ //this._stackData.push(this.series[i].data);
+ var temp = $.extend(true, [], series.data);
+ // create the data that will be plotted for this series
+ var plotdata = $.extend(true, [], series.data);
+ var tempx, tempy, dval, stackval, comparator;
+ // for first series, nothing to add to stackData.
+ for (var j=0; j<index; j++) {
+ var cd = this.series[j].data;
+ for (var k=0; k<cd.length; k++) {
+ dval = cd[k];
+ tempx = (dval[0] != null) ? dval[0] : 0;
+ tempy = (dval[1] != null) ? dval[1] : 0;
+ temp[k][0] += tempx;
+ temp[k][1] += tempy;
+ stackval = (sidx) ? tempy : tempx;
+ // only need to sum up the stack axis column of data
+ // and only sum if it is of same sign.
+ if (series.data[k][sidx] * stackval >= 0) {
+ plotdata[k][sidx] += stackval;
+ }
+ }
+ }
+ for (var i=0; i<plotdata.length; i++) {
+ plotValues.x.push(plotdata[i][0]);
+ plotValues.y.push(plotdata[i][1]);
+ }
+ this._plotData.push(plotdata);
+ this._stackData.push(temp);
+ series._stackData = temp;
+ series._plotData = plotdata;
+ series._plotValues = plotValues;
+ }
+ else {
+ for (var i=0; i<series.data.length; i++) {
+ plotValues.x.push(series.data[i][0]);
+ plotValues.y.push(series.data[i][1]);
+ }
+ this._stackData.push(series.data);
+ this.series[index]._stackData = series.data;
+ this._plotData.push(series.data);
+ series._plotData = series.data;
+ series._plotValues = plotValues;
+ }
+ if (index>0) {
+ series._prevPlotData = this.series[index-1]._plotData;
+ }
+ series._sumy = 0;
+ series._sumx = 0;
+ for (i=series.data.length-1; i>-1; i--) {
+ series._sumy += series.data[i][1];
+ series._sumx += series.data[i][0];
+ }
+ };
+
+ // function to safely return colors from the color array and wrap around at the end.
+ this.getNextSeriesColor = (function(t) {
+ var idx = 0;
+ var sc = t.seriesColors;
+
+ return function () {
+ if (idx < sc.length) {
+ return sc[idx++];
+ }
+ else {
+ idx = 0;
+ return sc[idx++];
+ }
+ };
+ })(this);
+
+ this.parseOptions = function(options){
+ for (var i=0; i<this.preParseOptionsHooks.hooks.length; i++) {
+ this.preParseOptionsHooks.hooks[i].call(this, options);
+ }
+ for (var i=0; i<$.jqplot.preParseOptionsHooks.length; i++) {
+ $.jqplot.preParseOptionsHooks[i].call(this, options);
+ }
+ this.options = $.extend(true, {}, this.defaults, options);
+ var opts = this.options;
+ this.animate = opts.animate;
+ this.animateReplot = opts.animateReplot;
+ this.stackSeries = opts.stackSeries;
+ if ($.isPlainObject(opts.fillBetween)) {
+
+ var temp = ['series1', 'series2', 'color', 'baseSeries', 'fill'],
+ tempi;
+
+ for (var i=0, l=temp.length; i<l; i++) {
+ tempi = temp[i];
+ if (opts.fillBetween[tempi] != null) {
+ this.fillBetween[tempi] = opts.fillBetween[tempi];
+ }
+ }
+ }
+
+ if (opts.seriesColors) {
+ this.seriesColors = opts.seriesColors;
+ }
+ if (opts.negativeSeriesColors) {
+ this.negativeSeriesColors = opts.negativeSeriesColors;
+ }
+ if (opts.captureRightClick) {
+ this.captureRightClick = opts.captureRightClick;
+ }
+ this.defaultAxisStart = (options && options.defaultAxisStart != null) ? options.defaultAxisStart : this.defaultAxisStart;
+ this.colorGenerator.setColors(this.seriesColors);
+ this.negativeColorGenerator.setColors(this.negativeSeriesColors);
+ // var cg = new this.colorGenerator(this.seriesColors);
+ // var ncg = new this.colorGenerator(this.negativeSeriesColors);
+ // this._gridPadding = this.options.gridPadding;
+ $.extend(true, this._gridPadding, opts.gridPadding);
+ this.sortData = (opts.sortData != null) ? opts.sortData : this.sortData;
+ for (var i=0; i<12; i++) {
+ var n = _axisNames[i];
+ var axis = this.axes[n];
+ axis._options = $.extend(true, {}, opts.axesDefaults, opts.axes[n]);
+ $.extend(true, axis, opts.axesDefaults, opts.axes[n]);
+ axis._plotWidth = this._width;
+ axis._plotHeight = this._height;
+ }
+ // if (this.data.length == 0) {
+ // this.data = [];
+ // for (var i=0; i<this.options.series.length; i++) {
+ // this.data.push(this.options.series.data);
+ // }
+ // }
+
+ var normalizeData = function(data, dir, start) {
+ // return data as an array of point arrays,
+ // in form [[x1,y1...], [x2,y2...], ...]
+ var temp = [];
+ var i, l;
+ dir = dir || 'vertical';
+ if (!$.isArray(data[0])) {
+ // we have a series of scalars. One line with just y values.
+ // turn the scalar list of data into a data array of form:
+ // [[1, data[0]], [2, data[1]], ...]
+ for (i=0, l=data.length; i<l; i++) {
+ if (dir == 'vertical') {
+ temp.push([start + i, data[i]]);
+ }
+ else {
+ temp.push([data[i], start+i]);
+ }
+ }
+ }
+ else {
+ // we have a properly formatted data series, copy it.
+ $.extend(true, temp, data);
+ }
+ return temp;
+ };
+
+ var colorIndex = 0;
+ this.series = [];
+ for (var i=0; i<this.data.length; i++) {
+ var sopts = $.extend(true, {index: i}, {seriesColors:this.seriesColors, negativeSeriesColors:this.negativeSeriesColors}, this.options.seriesDefaults, this.options.series[i], {rendererOptions:{animation:{show: this.animate}}});
+ // pass in options in case something needs set prior to initialization.
+ var temp = new Series(sopts);
+ for (var j=0; j<$.jqplot.preParseSeriesOptionsHooks.length; j++) {
+ $.jqplot.preParseSeriesOptionsHooks[j].call(temp, this.options.seriesDefaults, this.options.series[i]);
+ }
+ for (var j=0; j<this.preParseSeriesOptionsHooks.hooks.length; j++) {
+ this.preParseSeriesOptionsHooks.hooks[j].call(temp, this.options.seriesDefaults, this.options.series[i]);
+ }
+ // Now go back and apply the options to the series. Really should just do this during initializaiton, but don't want to
+ // mess up preParseSeriesOptionsHooks at this point.
+ $.extend(true, temp, sopts);
+ var dir = 'vertical';
+ if (temp.renderer === $.jqplot.BarRenderer && temp.rendererOptions && temp.rendererOptions.barDirection == 'horizontal') {
+ dir = 'horizontal';
+ temp._stackAxis = 'x';
+ temp._primaryAxis = '_yaxis';
+ }
+ temp.data = normalizeData(this.data[i], dir, this.defaultAxisStart);
+ switch (temp.xaxis) {
+ case 'xaxis':
+ temp._xaxis = this.axes.xaxis;
+ break;
+ case 'x2axis':
+ temp._xaxis = this.axes.x2axis;
+ break;
+ default:
+ break;
+ }
+ temp._yaxis = this.axes[temp.yaxis];
+ temp._xaxis._series.push(temp);
+ temp._yaxis._series.push(temp);
+ if (temp.show) {
+ temp._xaxis.show = true;
+ temp._yaxis.show = true;
+ }
+ else {
+ if (temp._xaxis.scaleToHiddenSeries) {
+ temp._xaxis.show = true;
+ }
+ if (temp._yaxis.scaleToHiddenSeries) {
+ temp._yaxis.show = true;
+ }
+ }
+
+ // // parse the renderer options and apply default colors if not provided
+ // if (!temp.color && temp.show != false) {
+ // temp.color = cg.next();
+ // colorIndex = cg.getIndex() - 1;;
+ // }
+ // if (!temp.negativeColor && temp.show != false) {
+ // temp.negativeColor = ncg.get(colorIndex);
+ // ncg.setIndex(colorIndex);
+ // }
+ if (!temp.label) {
+ temp.label = 'Series '+ (i+1).toString();
+ }
+ // temp.rendererOptions.show = temp.show;
+ // $.extend(true, temp.renderer, {color:this.seriesColors[i]}, this.rendererOptions);
+ this.series.push(temp);
+ for (var j=0; j<$.jqplot.postParseSeriesOptionsHooks.length; j++) {
+ $.jqplot.postParseSeriesOptionsHooks[j].call(this.series[i], this.options.seriesDefaults, this.options.series[i]);
+ }
+ for (var j=0; j<this.postParseSeriesOptionsHooks.hooks.length; j++) {
+ this.postParseSeriesOptionsHooks.hooks[j].call(this.series[i], this.options.seriesDefaults, this.options.series[i]);
+ }
+ }
+
+ // copy the grid and title options into this object.
+ $.extend(true, this.grid, this.options.grid);
+ // if axis border properties aren't set, set default.
+ for (var i=0, l=_axisNames.length; i<l; i++) {
+ var n = _axisNames[i];
+ var axis = this.axes[n];
+ if (axis.borderWidth == null) {
+ axis.borderWidth =this.grid.borderWidth;
+ }
+ }
+
+ if (typeof this.options.title == 'string') {
+ this.title.text = this.options.title;
+ }
+ else if (typeof this.options.title == 'object') {
+ $.extend(true, this.title, this.options.title);
+ }
+ this.title._plotWidth = this._width;
+ this.legend.setOptions(this.options.legend);
+
+ for (var i=0; i<$.jqplot.postParseOptionsHooks.length; i++) {
+ $.jqplot.postParseOptionsHooks[i].call(this, options);
+ }
+ for (var i=0; i<this.postParseOptionsHooks.hooks.length; i++) {
+ this.postParseOptionsHooks.hooks[i].call(this, options);
+ }
+ };
+
+ // method: destroy
+ // Releases all resources occupied by the plot
+ this.destroy = function() {
+ this.canvasManager.freeAllCanvases();
+ if (this.eventCanvas && this.eventCanvas._elem) {
+ this.eventCanvas._elem.unbind();
+ }
+ // Couple of posts on Stack Overflow indicate that empty() doesn't
+ // always cear up the dom and release memory. Sometimes setting
+ // innerHTML property to null is needed. Particularly on IE, may
+ // have to directly set it to null, bypassing $.
+ this.target.empty();
+
+ this.target[0].innerHTML = '';
+ };
+
+ // method: replot
+ // Does a reinitialization of the plot followed by
+ // a redraw. Method could be used to interactively
+ // change plot characteristics and then replot.
+ //
+ // Parameters:
+ // options - Options used for replotting.
+ //
+ // Properties:
+ // clear - false to not clear (empty) the plot container before replotting (default: true).
+ // resetAxes - true to reset all axes min, max, numberTicks and tickInterval setting so axes will rescale themselves.
+ // optionally pass in list of axes to reset (e.g. ['xaxis', 'y2axis']) (default: false).
+ this.replot = function(options) {
+ var opts = options || {};
+ var data = opts.data || null;
+ var clear = (opts.clear === false) ? false : true;
+ var resetAxes = opts.resetAxes || false;
+ delete opts.data;
+ delete opts.clear;
+ delete opts.resetAxes;
+
+ this.target.trigger('jqplotPreReplot');
+
+ if (clear) {
+ this.destroy();
+ }
+ // if have data or other options, full reinit.
+ // otherwise, quickinit.
+ if (data || !$.isEmptyObject(opts)) {
+ this.reInitialize(data, opts);
+ }
+ else {
+ this.quickInit();
+ }
+
+ if (resetAxes) {
+ this.resetAxesScale(resetAxes, opts.axes);
+ }
+ this.draw();
+ this.target.trigger('jqplotPostReplot');
+ };
+
+ // method: redraw
+ // Empties the plot target div and redraws the plot.
+ // This enables plot data and properties to be changed
+ // and then to comletely clear the plot and redraw.
+ // redraw *will not* reinitialize any plot elements.
+ // That is, axes will not be autoscaled and defaults
+ // will not be reapplied to any plot elements. redraw
+ // is used primarily with zooming.
+ //
+ // Parameters:
+ // clear - false to not clear (empty) the plot container before redrawing (default: true).
+ this.redraw = function(clear) {
+ clear = (clear != null) ? clear : true;
+ this.target.trigger('jqplotPreRedraw');
+ if (clear) {
+ this.canvasManager.freeAllCanvases();
+ this.eventCanvas._elem.unbind();
+ // Dont think I bind any events to the target, this shouldn't be necessary.
+ // It will remove user's events.
+ // this.target.unbind();
+ this.target.empty();
+ }
+ for (var ax in this.axes) {
+ this.axes[ax]._ticks = [];
+ }
+ this.computePlotData();
+ // for (var i=0; i<this.series.length; i++) {
+ // this.populatePlotData(this.series[i], i);
+ // }
+ this._sumy = 0;
+ this._sumx = 0;
+ for (var i=0, tsl = this.series.length; i<tsl; i++) {
+ this._sumy += this.series[i]._sumy;
+ this._sumx += this.series[i]._sumx;
+ }
+ this.draw();
+ this.target.trigger('jqplotPostRedraw');
+ };
+
+ // method: draw
+ // Draws all elements of the plot into the container.
+ // Does not clear the container before drawing.
+ this.draw = function(){
+ if (this.drawIfHidden || this.target.is(':visible')) {
+ this.target.trigger('jqplotPreDraw');
+ var i,
+ j,
+ l,
+ tempseries;
+ for (i=0, l=$.jqplot.preDrawHooks.length; i<l; i++) {
+ $.jqplot.preDrawHooks[i].call(this);
+ }
+ for (i=0, l=this.preDrawHooks.length; i<l; i++) {
+ this.preDrawHooks.hooks[i].apply(this, this.preDrawSeriesHooks.args[i]);
+ }
+ // create an underlying canvas to be used for special features.
+ this.target.append(this.baseCanvas.createElement({left:0, right:0, top:0, bottom:0}, 'jqplot-base-canvas', null, this));
+ this.baseCanvas.setContext();
+ this.target.append(this.title.draw());
+ this.title.pack({top:0, left:0});
+
+ // make room for the legend between the grid and the edge.
+ // pass a dummy offsets object and a reference to the plot.
+ var legendElem = this.legend.draw({}, this);
+
+ var gridPadding = {top:0, left:0, bottom:0, right:0};
+
+ if (this.legend.placement == "outsideGrid") {
+ // temporarily append the legend to get dimensions
+ this.target.append(legendElem);
+ switch (this.legend.location) {
+ case 'n':
+ gridPadding.top += this.legend.getHeight();
+ break;
+ case 's':
+ gridPadding.bottom += this.legend.getHeight();
+ break;
+ case 'ne':
+ case 'e':
+ case 'se':
+ gridPadding.right += this.legend.getWidth();
+ break;
+ case 'nw':
+ case 'w':
+ case 'sw':
+ gridPadding.left += this.legend.getWidth();
+ break;
+ default: // same as 'ne'
+ gridPadding.right += this.legend.getWidth();
+ break;
+ }
+ legendElem = legendElem.detach();
+ }
+
+ var ax = this.axes;
+ var name;
+ // draw the yMidAxis first, so xaxis of pyramid chart can adjust itself if needed.
+ for (i=0; i<12; i++) {
+ name = _axisNames[i];
+ this.target.append(ax[name].draw(this.baseCanvas._ctx, this));
+ ax[name].set();
+ }
+ if (ax.yaxis.show) {
+ gridPadding.left += ax.yaxis.getWidth();
+ }
+ var ra = ['y2axis', 'y3axis', 'y4axis', 'y5axis', 'y6axis', 'y7axis', 'y8axis', 'y9axis'];
+ var rapad = [0, 0, 0, 0, 0, 0, 0, 0];
+ var gpr = 0;
+ var n;
+ for (n=0; n<8; n++) {
+ if (ax[ra[n]].show) {
+ gpr += ax[ra[n]].getWidth();
+ rapad[n] = gpr;
+ }
+ }
+ gridPadding.right += gpr;
+ if (ax.x2axis.show) {
+ gridPadding.top += ax.x2axis.getHeight();
+ }
+ if (this.title.show) {
+ gridPadding.top += this.title.getHeight();
+ }
+ if (ax.xaxis.show) {
+ gridPadding.bottom += ax.xaxis.getHeight();
+ }
+
+ // end of gridPadding adjustments.
+
+ // if user passed in gridDimensions option, check against calculated gridPadding
+ if (this.options.gridDimensions && $.isPlainObject(this.options.gridDimensions)) {
+ var gdw = parseInt(this.options.gridDimensions.width, 10) || 0;
+ var gdh = parseInt(this.options.gridDimensions.height, 10) || 0;
+ var widthAdj = (this._width - gridPadding.left - gridPadding.right - gdw)/2;
+ var heightAdj = (this._height - gridPadding.top - gridPadding.bottom - gdh)/2;
+
+ if (heightAdj >= 0 && widthAdj >= 0) {
+ gridPadding.top += heightAdj;
+ gridPadding.bottom += heightAdj;
+ gridPadding.left += widthAdj;
+ gridPadding.right += widthAdj;
+ }
+ }
+ var arr = ['top', 'bottom', 'left', 'right'];
+ for (var n in arr) {
+ if (this._gridPadding[arr[n]] == null && gridPadding[arr[n]] > 0) {
+ this._gridPadding[arr[n]] = gridPadding[arr[n]];
+ }
+ else if (this._gridPadding[arr[n]] == null) {
+ this._gridPadding[arr[n]] = this._defaultGridPadding[arr[n]];
+ }
+ }
+
+ var legendPadding = this._gridPadding;
+
+ if (this.legend.placement === 'outsideGrid') {
+ legendPadding = {top:this.title.getHeight(), left: 0, right: 0, bottom: 0};
+ if (this.legend.location === 's') {
+ legendPadding.left = this._gridPadding.left;
+ legendPadding.right = this._gridPadding.right;
+ }
+ }
+
+ ax.xaxis.pack({position:'absolute', bottom:this._gridPadding.bottom - ax.xaxis.getHeight(), left:0, width:this._width}, {min:this._gridPadding.left, max:this._width - this._gridPadding.right});
+ ax.yaxis.pack({position:'absolute', top:0, left:this._gridPadding.left - ax.yaxis.getWidth(), height:this._height}, {min:this._height - this._gridPadding.bottom, max: this._gridPadding.top});
+ ax.x2axis.pack({position:'absolute', top:this._gridPadding.top - ax.x2axis.getHeight(), left:0, width:this._width}, {min:this._gridPadding.left, max:this._width - this._gridPadding.right});
+ for (i=8; i>0; i--) {
+ ax[ra[i-1]].pack({position:'absolute', top:0, right:this._gridPadding.right - rapad[i-1]}, {min:this._height - this._gridPadding.bottom, max: this._gridPadding.top});
+ }
+ var ltemp = (this._width - this._gridPadding.left - this._gridPadding.right)/2.0 + this._gridPadding.left - ax.yMidAxis.getWidth()/2.0;
+ ax.yMidAxis.pack({position:'absolute', top:0, left:ltemp, zIndex:9, textAlign: 'center'}, {min:this._height - this._gridPadding.bottom, max: this._gridPadding.top});
+
+ this.target.append(this.grid.createElement(this._gridPadding, this));
+ this.grid.draw();
+
+ var series = this.series;
+ var seriesLength = series.length;
+ // put the shadow canvases behind the series canvases so shadows don't overlap on stacked bars.
+ for (i=0, l=seriesLength; i<l; i++) {
+ // draw series in order of stacking. This affects only
+ // order in which canvases are added to dom.
+ j = this.seriesStack[i];
+ this.target.append(series[j].shadowCanvas.createElement(this._gridPadding, 'jqplot-series-shadowCanvas', null, this));
+ series[j].shadowCanvas.setContext();
+ series[j].shadowCanvas._elem.data('seriesIndex', j);
+ }
+
+ for (i=0, l=seriesLength; i<l; i++) {
+ // draw series in order of stacking. This affects only
+ // order in which canvases are added to dom.
+ j = this.seriesStack[i];
+ this.target.append(series[j].canvas.createElement(this._gridPadding, 'jqplot-series-canvas', null, this));
+ series[j].canvas.setContext();
+ series[j].canvas._elem.data('seriesIndex', j);
+ }
+ // Need to use filled canvas to capture events in IE.
+ // Also, canvas seems to block selection of other elements in document on FF.
+ this.target.append(this.eventCanvas.createElement(this._gridPadding, 'jqplot-event-canvas', null, this));
+ this.eventCanvas.setContext();
+ this.eventCanvas._ctx.fillStyle = 'rgba(0,0,0,0)';
+ this.eventCanvas._ctx.fillRect(0,0,this.eventCanvas._ctx.canvas.width, this.eventCanvas._ctx.canvas.height);
+
+ // bind custom event handlers to regular events.
+ this.bindCustomEvents();
+
+ // draw legend before series if the series needs to know the legend dimensions.
+ if (this.legend.preDraw) {
+ this.eventCanvas._elem.before(legendElem);
+ this.legend.pack(legendPadding);
+ if (this.legend._elem) {
+ this.drawSeries({legendInfo:{location:this.legend.location, placement:this.legend.placement, width:this.legend.getWidth(), height:this.legend.getHeight(), xoffset:this.legend.xoffset, yoffset:this.legend.yoffset}});
+ }
+ else {
+ this.drawSeries();
+ }
+ }
+ else { // draw series before legend
+ this.drawSeries();
+ if (seriesLength) {
+ $(series[seriesLength-1].canvas._elem).after(legendElem);
+ }
+ this.legend.pack(legendPadding);
+ }
+
+ // register event listeners on the overlay canvas
+ for (var i=0, l=$.jqplot.eventListenerHooks.length; i<l; i++) {
+ // in the handler, this will refer to the eventCanvas dom element.
+ // make sure there are references back into plot objects.
+ this.eventCanvas._elem.bind($.jqplot.eventListenerHooks[i][0], {plot:this}, $.jqplot.eventListenerHooks[i][1]);
+ }
+
+ // register event listeners on the overlay canvas
+ for (var i=0, l=this.eventListenerHooks.hooks.length; i<l; i++) {
+ // in the handler, this will refer to the eventCanvas dom element.
+ // make sure there are references back into plot objects.
+ this.eventCanvas._elem.bind(this.eventListenerHooks.hooks[i][0], {plot:this}, this.eventListenerHooks.hooks[i][1]);
+ }
+
+ var fb = this.fillBetween;
+ if (fb.fill && fb.series1 !== fb.series2 && fb.series1 < seriesLength && fb.series2 < seriesLength && series[fb.series1]._type === 'line' && series[fb.series2]._type === 'line') {
+ this.doFillBetweenLines();
+ }
+
+ for (var i=0, l=$.jqplot.postDrawHooks.length; i<l; i++) {
+ $.jqplot.postDrawHooks[i].call(this);
+ }
+
+ for (var i=0, l=this.postDrawHooks.hooks.length; i<l; i++) {
+ this.postDrawHooks.hooks[i].apply(this, this.postDrawHooks.args[i]);
+ }
+
+ if (this.target.is(':visible')) {
+ this._drawCount += 1;
+ }
+
+ var temps,
+ tempr,
+ sel,
+ _els;
+ // ughh. ideally would hide all series then show them.
+ for (i=0, l=seriesLength; i<l; i++) {
+ temps = series[i];
+ tempr = temps.renderer;
+ sel = '.jqplot-point-label.jqplot-series-'+i;
+ if (tempr.animation && tempr.animation._supported && tempr.animation.show && (this._drawCount < 2 || this.animateReplot)) {
+ _els = this.target.find(sel);
+ _els.stop(true, true).hide();
+ temps.canvas._elem.stop(true, true).hide();
+ temps.shadowCanvas._elem.stop(true, true).hide();
+ temps.canvas._elem.jqplotEffect('blind', {mode: 'show', direction: tempr.animation.direction}, tempr.animation.speed);
+ temps.shadowCanvas._elem.jqplotEffect('blind', {mode: 'show', direction: tempr.animation.direction}, tempr.animation.speed);
+ _els.fadeIn(tempr.animation.speed*0.8);
+ }
+ }
+ _els = null;
+
+ this.target.trigger('jqplotPostDraw', [this]);
+ }
+ };
+
+ jqPlot.prototype.doFillBetweenLines = function () {
+ var fb = this.fillBetween;
+ var sid1 = fb.series1;
+ var sid2 = fb.series2;
+ // first series should always be lowest index
+ var id1 = (sid1 < sid2) ? sid1 : sid2;
+ var id2 = (sid2 > sid1) ? sid2 : sid1;
+
+ var series1 = this.series[id1];
+ var series2 = this.series[id2];
+
+ if (series2.renderer.smooth) {
+ var tempgd = series2.renderer._smoothedData.slice(0).reverse();
+ }
+ else {
+ var tempgd = series2.gridData.slice(0).reverse();
+ }
+
+ if (series1.renderer.smooth) {
+ var gd = series1.renderer._smoothedData.concat(tempgd);
+ }
+ else {
+ var gd = series1.gridData.concat(tempgd);
+ }
+
+ var color = (fb.color !== null) ? fb.color : this.series[sid1].fillColor;
+ var baseSeries = (fb.baseSeries !== null) ? fb.baseSeries : id1;
+
+ // now apply a fill to the shape on the lower series shadow canvas,
+ // so it is behind both series.
+ var sr = this.series[baseSeries].renderer.shapeRenderer;
+ var opts = {fillStyle: color, fill: true, closePath: true};
+ sr.draw(series1.shadowCanvas._ctx, gd, opts);
+ };
+
+ this.bindCustomEvents = function() {
+ this.eventCanvas._elem.bind('click', {plot:this}, this.onClick);
+ this.eventCanvas._elem.bind('dblclick', {plot:this}, this.onDblClick);
+ this.eventCanvas._elem.bind('mousedown', {plot:this}, this.onMouseDown);
+ this.eventCanvas._elem.bind('mousemove', {plot:this}, this.onMouseMove);
+ this.eventCanvas._elem.bind('mouseenter', {plot:this}, this.onMouseEnter);
+ this.eventCanvas._elem.bind('mouseleave', {plot:this}, this.onMouseLeave);
+ if (this.captureRightClick) {
+ this.eventCanvas._elem.bind('mouseup', {plot:this}, this.onRightClick);
+ this.eventCanvas._elem.get(0).oncontextmenu = function() {
+ return false;
+ };
+ }
+ else {
+ this.eventCanvas._elem.bind('mouseup', {plot:this}, this.onMouseUp);
+ }
+ };
+
+ function getEventPosition(ev) {
+ var plot = ev.data.plot;
+ var go = plot.eventCanvas._elem.offset();
+ var gridPos = {x:ev.pageX - go.left, y:ev.pageY - go.top};
+ var dataPos = {xaxis:null, yaxis:null, x2axis:null, y2axis:null, y3axis:null, y4axis:null, y5axis:null, y6axis:null, y7axis:null, y8axis:null, y9axis:null, yMidAxis:null};
+ var an = ['xaxis', 'yaxis', 'x2axis', 'y2axis', 'y3axis', 'y4axis', 'y5axis', 'y6axis', 'y7axis', 'y8axis', 'y9axis', 'yMidAxis'];
+ var ax = plot.axes;
+ var n, axis;
+ for (n=11; n>0; n--) {
+ axis = an[n-1];
+ if (ax[axis].show) {
+ dataPos[axis] = ax[axis].series_p2u(gridPos[axis.charAt(0)]);
+ }
+ }
+
+ return {offsets:go, gridPos:gridPos, dataPos:dataPos};
+ }
+
+
+ // function to check if event location is over a area area
+ function checkIntersection(gridpos, plot) {
+ var series = plot.series;
+ var i, j, k, s, r, x, y, theta, sm, sa, minang, maxang;
+ var d0, d, p, pp, points, bw, hp;
+ var threshold, t;
+ for (k=plot.seriesStack.length-1; k>=0; k--) {
+ i = plot.seriesStack[k];
+ s = series[i];
+ hp = s._highlightThreshold;
+ switch (s.renderer.constructor) {
+ case $.jqplot.BarRenderer:
+ x = gridpos.x;
+ y = gridpos.y;
+ for (j=0; j<s._barPoints.length; j++) {
+ points = s._barPoints[j];
+ p = s.gridData[j];
+ if (x>points[0][0] && x<points[2][0] && y>points[2][1] && y<points[0][1]) {
+ return {seriesIndex:s.index, pointIndex:j, gridData:p, data:s.data[j], points:s._barPoints[j]};
+ }
+ }
+ break;
+ case $.jqplot.PyramidRenderer:
+ x = gridpos.x;
+ y = gridpos.y;
+ for (j=0; j<s._barPoints.length; j++) {
+ points = s._barPoints[j];
+ p = s.gridData[j];
+ if (x > points[0][0] + hp[0][0] && x < points[2][0] + hp[2][0] && y > points[2][1] && y < points[0][1]) {
+ return {seriesIndex:s.index, pointIndex:j, gridData:p, data:s.data[j], points:s._barPoints[j]};
+ }
+ }
+ break;
+
+ case $.jqplot.DonutRenderer:
+ sa = s.startAngle/180*Math.PI;
+ x = gridpos.x - s._center[0];
+ y = gridpos.y - s._center[1];
+ r = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
+ if (x > 0 && -y >= 0) {
+ theta = 2*Math.PI - Math.atan(-y/x);
+ }
+ else if (x > 0 && -y < 0) {
+ theta = -Math.atan(-y/x);
+ }
+ else if (x < 0) {
+ theta = Math.PI - Math.atan(-y/x);
+ }
+ else if (x == 0 && -y > 0) {
+ theta = 3*Math.PI/2;
+ }
+ else if (x == 0 && -y < 0) {
+ theta = Math.PI/2;
+ }
+ else if (x == 0 && y == 0) {
+ theta = 0;
+ }
+ if (sa) {
+ theta -= sa;
+ if (theta < 0) {
+ theta += 2*Math.PI;
+ }
+ else if (theta > 2*Math.PI) {
+ theta -= 2*Math.PI;
+ }
+ }
+
+ sm = s.sliceMargin/180*Math.PI;
+ if (r < s._radius && r > s._innerRadius) {
+ for (j=0; j<s.gridData.length; j++) {
+ minang = (j>0) ? s.gridData[j-1][1]+sm : sm;
+ maxang = s.gridData[j][1];
+ if (theta > minang && theta < maxang) {
+ return {seriesIndex:s.index, pointIndex:j, gridData:s.gridData[j], data:s.data[j]};
+ }
+ }
+ }
+ break;
+
+ case $.jqplot.PieRenderer:
+ sa = s.startAngle/180*Math.PI;
+ x = gridpos.x - s._center[0];
+ y = gridpos.y - s._center[1];
+ r = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
+ if (x > 0 && -y >= 0) {
+ theta = 2*Math.PI - Math.atan(-y/x);
+ }
+ else if (x > 0 && -y < 0) {
+ theta = -Math.atan(-y/x);
+ }
+ else if (x < 0) {
+ theta = Math.PI - Math.atan(-y/x);
+ }
+ else if (x == 0 && -y > 0) {
+ theta = 3*Math.PI/2;
+ }
+ else if (x == 0 && -y < 0) {
+ theta = Math.PI/2;
+ }
+ else if (x == 0 && y == 0) {
+ theta = 0;
+ }
+ if (sa) {
+ theta -= sa;
+ if (theta < 0) {
+ theta += 2*Math.PI;
+ }
+ else if (theta > 2*Math.PI) {
+ theta -= 2*Math.PI;
+ }
+ }
+
+ sm = s.sliceMargin/180*Math.PI;
+ if (r < s._radius) {
+ for (j=0; j<s.gridData.length; j++) {
+ minang = (j>0) ? s.gridData[j-1][1]+sm : sm;
+ maxang = s.gridData[j][1];
+ if (theta > minang && theta < maxang) {
+ return {seriesIndex:s.index, pointIndex:j, gridData:s.gridData[j], data:s.data[j]};
+ }
+ }
+ }
+ break;
+
+ case $.jqplot.BubbleRenderer:
+ x = gridpos.x;
+ y = gridpos.y;
+ var ret = null;
+
+ if (s.show) {
+ for (var j=0; j<s.gridData.length; j++) {
+ p = s.gridData[j];
+ d = Math.sqrt( (x-p[0]) * (x-p[0]) + (y-p[1]) * (y-p[1]) );
+ if (d <= p[2] && (d <= d0 || d0 == null)) {
+ d0 = d;
+ ret = {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
+ }
+ }
+ if (ret != null) {
+ return ret;
+ }
+ }
+ break;
+
+ case $.jqplot.FunnelRenderer:
+ x = gridpos.x;
+ y = gridpos.y;
+ var v = s._vertices,
+ vfirst = v[0],
+ vlast = v[v.length-1],
+ lex,
+ rex,
+ cv;
+
+ // equations of right and left sides, returns x, y values given height of section (y value and 2 points)
+
+ function findedge (l, p1 , p2) {
+ var m = (p1[1] - p2[1])/(p1[0] - p2[0]);
+ var b = p1[1] - m*p1[0];
+ var y = l + p1[1];
+
+ return [(y - b)/m, y];
+ }
+
+ // check each section
+ lex = findedge(y, vfirst[0], vlast[3]);
+ rex = findedge(y, vfirst[1], vlast[2]);
+ for (j=0; j<v.length; j++) {
+ cv = v[j];
+ if (y >= cv[0][1] && y <= cv[3][1] && x >= lex[0] && x <= rex[0]) {
+ return {seriesIndex:s.index, pointIndex:j, gridData:null, data:s.data[j]};
+ }
+ }
+ break;
+
+ case $.jqplot.LineRenderer:
+ x = gridpos.x;
+ y = gridpos.y;
+ r = s.renderer;
+ if (s.show) {
+ if ((s.fill || (s.renderer.bands.show && s.renderer.bands.fill)) && (!plot.plugins.highlighter || !plot.plugins.highlighter.show)) {
+ // first check if it is in bounding box
+ var inside = false;
+ if (x>s._boundingBox[0][0] && x<s._boundingBox[1][0] && y>s._boundingBox[1][1] && y<s._boundingBox[0][1]) {
+ // now check the crossing number
+
+ var numPoints = s._areaPoints.length;
+ var ii;
+ var j = numPoints-1;
+
+ for(var ii=0; ii < numPoints; ii++) {
+ var vertex1 = [s._areaPoints[ii][0], s._areaPoints[ii][1]];
+ var vertex2 = [s._areaPoints[j][0], s._areaPoints[j][1]];
+
+ if (vertex1[1] < y && vertex2[1] >= y || vertex2[1] < y && vertex1[1] >= y) {
+ if (vertex1[0] + (y - vertex1[1]) / (vertex2[1] - vertex1[1]) * (vertex2[0] - vertex1[0]) < x) {
+ inside = !inside;
+ }
+ }
+
+ j = ii;
+ }
+ }
+ if (inside) {
+ return {seriesIndex:i, pointIndex:null, gridData:s.gridData, data:s.data, points:s._areaPoints};
+ }
+ break;
+
+ }
+
+ else {
+ t = s.markerRenderer.size/2+s.neighborThreshold;
+ threshold = (t > 0) ? t : 0;
+ for (var j=0; j<s.gridData.length; j++) {
+ p = s.gridData[j];
+ // neighbor looks different to OHLC chart.
+ if (r.constructor == $.jqplot.OHLCRenderer) {
+ if (r.candleStick) {
+ var yp = s._yaxis.series_u2p;
+ if (x >= p[0]-r._bodyWidth/2 && x <= p[0]+r._bodyWidth/2 && y >= yp(s.data[j][2]) && y <= yp(s.data[j][3])) {
+ return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
+ }
+ }
+ // if an open hi low close chart
+ else if (!r.hlc){
+ var yp = s._yaxis.series_u2p;
+ if (x >= p[0]-r._tickLength && x <= p[0]+r._tickLength && y >= yp(s.data[j][2]) && y <= yp(s.data[j][3])) {
+ return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
+ }
+ }
+ // a hi low close chart
+ else {
+ var yp = s._yaxis.series_u2p;
+ if (x >= p[0]-r._tickLength && x <= p[0]+r._tickLength && y >= yp(s.data[j][1]) && y <= yp(s.data[j][2])) {
+ return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
+ }
+ }
+
+ }
+ else if (p[0] != null && p[1] != null){
+ d = Math.sqrt( (x-p[0]) * (x-p[0]) + (y-p[1]) * (y-p[1]) );
+ if (d <= threshold && (d <= d0 || d0 == null)) {
+ d0 = d;
+ return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
+ }
+ }
+ }
+ }
+ }
+ break;
+
+ default:
+ x = gridpos.x;
+ y = gridpos.y;
+ r = s.renderer;
+ if (s.show) {
+ t = s.markerRenderer.size/2+s.neighborThreshold;
+ threshold = (t > 0) ? t : 0;
+ for (var j=0; j<s.gridData.length; j++) {
+ p = s.gridData[j];
+ // neighbor looks different to OHLC chart.
+ if (r.constructor == $.jqplot.OHLCRenderer) {
+ if (r.candleStick) {
+ var yp = s._yaxis.series_u2p;
+ if (x >= p[0]-r._bodyWidth/2 && x <= p[0]+r._bodyWidth/2 && y >= yp(s.data[j][2]) && y <= yp(s.data[j][3])) {
+ return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
+ }
+ }
+ // if an open hi low close chart
+ else if (!r.hlc){
+ var yp = s._yaxis.series_u2p;
+ if (x >= p[0]-r._tickLength && x <= p[0]+r._tickLength && y >= yp(s.data[j][2]) && y <= yp(s.data[j][3])) {
+ return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
+ }
+ }
+ // a hi low close chart
+ else {
+ var yp = s._yaxis.series_u2p;
+ if (x >= p[0]-r._tickLength && x <= p[0]+r._tickLength && y >= yp(s.data[j][1]) && y <= yp(s.data[j][2])) {
+ return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
+ }
+ }
+
+ }
+ else {
+ d = Math.sqrt( (x-p[0]) * (x-p[0]) + (y-p[1]) * (y-p[1]) );
+ if (d <= threshold && (d <= d0 || d0 == null)) {
+ d0 = d;
+ return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
+ }
+ }
+ }
+ }
+ break;
+ }
+ }
+
+ return null;
+ }
+
+
+
+ this.onClick = function(ev) {
+ // Event passed in is normalized and will have data attribute.
+ // Event passed out is unnormalized.
+ var positions = getEventPosition(ev);
+ var p = ev.data.plot;
+ var neighbor = checkIntersection(positions.gridPos, p);
+ var evt = $.Event('jqplotClick');
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]);
+ };
+
+ this.onDblClick = function(ev) {
+ // Event passed in is normalized and will have data attribute.
+ // Event passed out is unnormalized.
+ var positions = getEventPosition(ev);
+ var p = ev.data.plot;
+ var neighbor = checkIntersection(positions.gridPos, p);
+ var evt = $.Event('jqplotDblClick');
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]);
+ };
+
+ this.onMouseDown = function(ev) {
+ var positions = getEventPosition(ev);
+ var p = ev.data.plot;
+ var neighbor = checkIntersection(positions.gridPos, p);
+ var evt = $.Event('jqplotMouseDown');
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]);
+ };
+
+ this.onMouseUp = function(ev) {
+ var positions = getEventPosition(ev);
+ var evt = $.Event('jqplotMouseUp');
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ $(this).trigger(evt, [positions.gridPos, positions.dataPos, null, ev.data.plot]);
+ };
+
+ this.onRightClick = function(ev) {
+ var positions = getEventPosition(ev);
+ var p = ev.data.plot;
+ var neighbor = checkIntersection(positions.gridPos, p);
+ if (p.captureRightClick) {
+ if (ev.which == 3) {
+ var evt = $.Event('jqplotRightClick');
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]);
+ }
+ else {
+ var evt = $.Event('jqplotMouseUp');
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]);
+ }
+ }
+ };
+
+ this.onMouseMove = function(ev) {
+ var positions = getEventPosition(ev);
+ var p = ev.data.plot;
+ var neighbor = checkIntersection(positions.gridPos, p);
+ var evt = $.Event('jqplotMouseMove');
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]);
+ };
+
+ this.onMouseEnter = function(ev) {
+ var positions = getEventPosition(ev);
+ var p = ev.data.plot;
+ var evt = $.Event('jqplotMouseEnter');
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ evt.relatedTarget = ev.relatedTarget;
+ $(this).trigger(evt, [positions.gridPos, positions.dataPos, null, p]);
+ };
+
+ this.onMouseLeave = function(ev) {
+ var positions = getEventPosition(ev);
+ var p = ev.data.plot;
+ var evt = $.Event('jqplotMouseLeave');
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ evt.relatedTarget = ev.relatedTarget;
+ $(this).trigger(evt, [positions.gridPos, positions.dataPos, null, p]);
+ };
+
+ // method: drawSeries
+ // Redraws all or just one series on the plot. No axis scaling
+ // is performed and no other elements on the plot are redrawn.
+ // options is an options object to pass on to the series renderers.
+ // It can be an empty object {}. idx is the series index
+ // to redraw if only one series is to be redrawn.
+ this.drawSeries = function(options, idx){
+ var i, series, ctx;
+ // if only one argument passed in and it is a number, use it ad idx.
+ idx = (typeof(options) === "number" && idx == null) ? options : idx;
+ options = (typeof(options) === "object") ? options : {};
+ // draw specified series
+ if (idx != undefined) {
+ series = this.series[idx];
+ ctx = series.shadowCanvas._ctx;
+ ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
+ series.drawShadow(ctx, options, this);
+ ctx = series.canvas._ctx;
+ ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
+ series.draw(ctx, options, this);
+ if (series.renderer.constructor == $.jqplot.BezierCurveRenderer) {
+ if (idx < this.series.length - 1) {
+ this.drawSeries(idx+1);
+ }
+ }
+ }
+
+ else {
+ // if call series drawShadow method first, in case all series shadows
+ // should be drawn before any series. This will ensure, like for
+ // stacked bar plots, that shadows don't overlap series.
+ for (i=0; i<this.series.length; i++) {
+ // first clear the canvas
+ series = this.series[i];
+ ctx = series.shadowCanvas._ctx;
+ ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
+ series.drawShadow(ctx, options, this);
+ ctx = series.canvas._ctx;
+ ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
+ series.draw(ctx, options, this);
+ }
+ }
+ options = idx = i = series = ctx = null;
+ };
+
+ // method: moveSeriesToFront
+ // This method requires jQuery 1.4+
+ // Moves the specified series canvas in front of all other series canvases.
+ // This effectively "draws" the specified series on top of all other series,
+ // although it is performed through DOM manipulation, no redrawing is performed.
+ //
+ // Parameters:
+ // idx - 0 based index of the series to move. This will be the index of the series
+ // as it was first passed into the jqplot function.
+ this.moveSeriesToFront = function (idx) {
+ idx = parseInt(idx, 10);
+ var stackIndex = $.inArray(idx, this.seriesStack);
+ // if already in front, return
+ if (stackIndex == -1) {
+ return;
+ }
+ if (stackIndex == this.seriesStack.length -1) {
+ this.previousSeriesStack = this.seriesStack.slice(0);
+ return;
+ }
+ var opidx = this.seriesStack[this.seriesStack.length -1];
+ var serelem = this.series[idx].canvas._elem.detach();
+ var shadelem = this.series[idx].shadowCanvas._elem.detach();
+ this.series[opidx].shadowCanvas._elem.after(shadelem);
+ this.series[opidx].canvas._elem.after(serelem);
+ this.previousSeriesStack = this.seriesStack.slice(0);
+ this.seriesStack.splice(stackIndex, 1);
+ this.seriesStack.push(idx);
+ };
+
+ // method: moveSeriesToBack
+ // This method requires jQuery 1.4+
+ // Moves the specified series canvas behind all other series canvases.
+ //
+ // Parameters:
+ // idx - 0 based index of the series to move. This will be the index of the series
+ // as it was first passed into the jqplot function.
+ this.moveSeriesToBack = function (idx) {
+ idx = parseInt(idx, 10);
+ var stackIndex = $.inArray(idx, this.seriesStack);
+ // if already in back, return
+ if (stackIndex == 0 || stackIndex == -1) {
+ return;
+ }
+ var opidx = this.seriesStack[0];
+ var serelem = this.series[idx].canvas._elem.detach();
+ var shadelem = this.series[idx].shadowCanvas._elem.detach();
+ this.series[opidx].shadowCanvas._elem.before(shadelem);
+ this.series[opidx].canvas._elem.before(serelem);
+ this.previousSeriesStack = this.seriesStack.slice(0);
+ this.seriesStack.splice(stackIndex, 1);
+ this.seriesStack.unshift(idx);
+ };
+
+ // method: restorePreviousSeriesOrder
+ // This method requires jQuery 1.4+
+ // Restore the series canvas order to its previous state.
+ // Useful to put a series back where it belongs after moving
+ // it to the front.
+ this.restorePreviousSeriesOrder = function () {
+ var i, j, serelem, shadelem, temp, move, keep;
+ // if no change, return.
+ if (this.seriesStack == this.previousSeriesStack) {
+ return;
+ }
+ for (i=1; i<this.previousSeriesStack.length; i++) {
+ move = this.previousSeriesStack[i];
+ keep = this.previousSeriesStack[i-1];
+ serelem = this.series[move].canvas._elem.detach();
+ shadelem = this.series[move].shadowCanvas._elem.detach();
+ this.series[keep].shadowCanvas._elem.after(shadelem);
+ this.series[keep].canvas._elem.after(serelem);
+ }
+ temp = this.seriesStack.slice(0);
+ this.seriesStack = this.previousSeriesStack.slice(0);
+ this.previousSeriesStack = temp;
+ };
+
+ // method: restoreOriginalSeriesOrder
+ // This method requires jQuery 1.4+
+ // Restore the series canvas order to its original order
+ // when the plot was created.
+ this.restoreOriginalSeriesOrder = function () {
+ var i, j, arr=[], serelem, shadelem;
+ for (i=0; i<this.series.length; i++) {
+ arr.push(i);
+ }
+ if (this.seriesStack == arr) {
+ return;
+ }
+ this.previousSeriesStack = this.seriesStack.slice(0);
+ this.seriesStack = arr;
+ for (i=1; i<this.seriesStack.length; i++) {
+ serelem = this.series[i].canvas._elem.detach();
+ shadelem = this.series[i].shadowCanvas._elem.detach();
+ this.series[i-1].shadowCanvas._elem.after(shadelem);
+ this.series[i-1].canvas._elem.after(serelem);
+ }
+ };
+
+ this.activateTheme = function (name) {
+ this.themeEngine.activate(this, name);
+ };
+ }
+
+
+ // conpute a highlight color or array of highlight colors from given colors.
+ $.jqplot.computeHighlightColors = function(colors) {
+ var ret;
+ if ($.isArray(colors)) {
+ ret = [];
+ for (var i=0; i<colors.length; i++){
+ var rgba = $.jqplot.getColorComponents(colors[i]);
+ var newrgb = [rgba[0], rgba[1], rgba[2]];
+ var sum = newrgb[0] + newrgb[1] + newrgb[2];
+ for (var j=0; j<3; j++) {
+ // when darkening, lowest color component can be is 60.
+ newrgb[j] = (sum > 660) ? newrgb[j] * 0.85 : 0.73 * newrgb[j] + 90;
+ newrgb[j] = parseInt(newrgb[j], 10);
+ (newrgb[j] > 255) ? 255 : newrgb[j];
+ }
+ // newrgb[3] = (rgba[3] > 0.4) ? rgba[3] * 0.4 : rgba[3] * 1.5;
+ // newrgb[3] = (rgba[3] > 0.5) ? 0.8 * rgba[3] - .1 : rgba[3] + 0.2;
+ newrgb[3] = 0.3 + 0.35 * rgba[3];
+ ret.push('rgba('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+','+newrgb[3]+')');
+ }
+ }
+ else {
+ var rgba = $.jqplot.getColorComponents(colors);
+ var newrgb = [rgba[0], rgba[1], rgba[2]];
+ var sum = newrgb[0] + newrgb[1] + newrgb[2];
+ for (var j=0; j<3; j++) {
+ // when darkening, lowest color component can be is 60.
+ // newrgb[j] = (sum > 570) ? newrgb[j] * 0.8 : newrgb[j] + 0.3 * (255 - newrgb[j]);
+ // newrgb[j] = parseInt(newrgb[j], 10);
+ newrgb[j] = (sum > 660) ? newrgb[j] * 0.85 : 0.73 * newrgb[j] + 90;
+ newrgb[j] = parseInt(newrgb[j], 10);
+ (newrgb[j] > 255) ? 255 : newrgb[j];
+ }
+ // newrgb[3] = (rgba[3] > 0.4) ? rgba[3] * 0.4 : rgba[3] * 1.5;
+ // newrgb[3] = (rgba[3] > 0.5) ? 0.8 * rgba[3] - .1 : rgba[3] + 0.2;
+ newrgb[3] = 0.3 + 0.35 * rgba[3];
+ ret = 'rgba('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+','+newrgb[3]+')';
+ }
+ return ret;
+ };
+
+ $.jqplot.ColorGenerator = function(colors) {
+ colors = colors || $.jqplot.config.defaultColors;
+ var idx = 0;
+
+ this.next = function () {
+ if (idx < colors.length) {
+ return colors[idx++];
+ }
+ else {
+ idx = 0;
+ return colors[idx++];
+ }
+ };
+
+ this.previous = function () {
+ if (idx > 0) {
+ return colors[idx--];
+ }
+ else {
+ idx = colors.length-1;
+ return colors[idx];
+ }
+ };
+
+ // get a color by index without advancing pointer.
+ this.get = function(i) {
+ var idx = i - colors.length * Math.floor(i/colors.length);
+ return colors[idx];
+ };
+
+ this.setColors = function(c) {
+ colors = c;
+ };
+
+ this.reset = function() {
+ idx = 0;
+ };
+
+ this.getIndex = function() {
+ return idx;
+ };
+
+ this.setIndex = function(index) {
+ idx = index;
+ };
+ };
+
+ // convert a hex color string to rgb string.
+ // h - 3 or 6 character hex string, with or without leading #
+ // a - optional alpha
+ $.jqplot.hex2rgb = function(h, a) {
+ h = h.replace('#', '');
+ if (h.length == 3) {
+ h = h.charAt(0)+h.charAt(0)+h.charAt(1)+h.charAt(1)+h.charAt(2)+h.charAt(2);
+ }
+ var rgb;
+ rgb = 'rgba('+parseInt(h.slice(0,2), 16)+', '+parseInt(h.slice(2,4), 16)+', '+parseInt(h.slice(4,6), 16);
+ if (a) {
+ rgb += ', '+a;
+ }
+ rgb += ')';
+ return rgb;
+ };
+
+ // convert an rgb color spec to a hex spec. ignore any alpha specification.
+ $.jqplot.rgb2hex = function(s) {
+ var pat = /rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *(?:, *[0-9.]*)?\)/;
+ var m = s.match(pat);
+ var h = '#';
+ for (var i=1; i<4; i++) {
+ var temp;
+ if (m[i].search(/%/) != -1) {
+ temp = parseInt(255*m[i]/100, 10).toString(16);
+ if (temp.length == 1) {
+ temp = '0'+temp;
+ }
+ }
+ else {
+ temp = parseInt(m[i], 10).toString(16);
+ if (temp.length == 1) {
+ temp = '0'+temp;
+ }
+ }
+ h += temp;
+ }
+ return h;
+ };
+
+ // given a css color spec, return an rgb css color spec
+ $.jqplot.normalize2rgb = function(s, a) {
+ if (s.search(/^ *rgba?\(/) != -1) {
+ return s;
+ }
+ else if (s.search(/^ *#?[0-9a-fA-F]?[0-9a-fA-F]/) != -1) {
+ return $.jqplot.hex2rgb(s, a);
+ }
+ else {
+ throw 'invalid color spec';
+ }
+ };
+
+ // extract the r, g, b, a color components out of a css color spec.
+ $.jqplot.getColorComponents = function(s) {
+ // check to see if a color keyword.
+ s = $.jqplot.colorKeywordMap[s] || s;
+ var rgb = $.jqplot.normalize2rgb(s);
+ var pat = /rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *,? *([0-9.]* *)?\)/;
+ var m = rgb.match(pat);
+ var ret = [];
+ for (var i=1; i<4; i++) {
+ if (m[i].search(/%/) != -1) {
+ ret[i-1] = parseInt(255*m[i]/100, 10);
+ }
+ else {
+ ret[i-1] = parseInt(m[i], 10);
+ }
+ }
+ ret[3] = parseFloat(m[4]) ? parseFloat(m[4]) : 1.0;
+ return ret;
+ };
+
+ $.jqplot.colorKeywordMap = {
+ aliceblue: 'rgb(240, 248, 255)',
+ antiquewhite: 'rgb(250, 235, 215)',
+ aqua: 'rgb( 0, 255, 255)',
+ aquamarine: 'rgb(127, 255, 212)',
+ azure: 'rgb(240, 255, 255)',
+ beige: 'rgb(245, 245, 220)',
+ bisque: 'rgb(255, 228, 196)',
+ black: 'rgb( 0, 0, 0)',
+ blanchedalmond: 'rgb(255, 235, 205)',
+ blue: 'rgb( 0, 0, 255)',
+ blueviolet: 'rgb(138, 43, 226)',
+ brown: 'rgb(165, 42, 42)',
+ burlywood: 'rgb(222, 184, 135)',
+ cadetblue: 'rgb( 95, 158, 160)',
+ chartreuse: 'rgb(127, 255, 0)',
+ chocolate: 'rgb(210, 105, 30)',
+ coral: 'rgb(255, 127, 80)',
+ cornflowerblue: 'rgb(100, 149, 237)',
+ cornsilk: 'rgb(255, 248, 220)',
+ crimson: 'rgb(220, 20, 60)',
+ cyan: 'rgb( 0, 255, 255)',
+ darkblue: 'rgb( 0, 0, 139)',
+ darkcyan: 'rgb( 0, 139, 139)',
+ darkgoldenrod: 'rgb(184, 134, 11)',
+ darkgray: 'rgb(169, 169, 169)',
+ darkgreen: 'rgb( 0, 100, 0)',
+ darkgrey: 'rgb(169, 169, 169)',
+ darkkhaki: 'rgb(189, 183, 107)',
+ darkmagenta: 'rgb(139, 0, 139)',
+ darkolivegreen: 'rgb( 85, 107, 47)',
+ darkorange: 'rgb(255, 140, 0)',
+ darkorchid: 'rgb(153, 50, 204)',
+ darkred: 'rgb(139, 0, 0)',
+ darksalmon: 'rgb(233, 150, 122)',
+ darkseagreen: 'rgb(143, 188, 143)',
+ darkslateblue: 'rgb( 72, 61, 139)',
+ darkslategray: 'rgb( 47, 79, 79)',
+ darkslategrey: 'rgb( 47, 79, 79)',
+ darkturquoise: 'rgb( 0, 206, 209)',
+ darkviolet: 'rgb(148, 0, 211)',
+ deeppink: 'rgb(255, 20, 147)',
+ deepskyblue: 'rgb( 0, 191, 255)',
+ dimgray: 'rgb(105, 105, 105)',
+ dimgrey: 'rgb(105, 105, 105)',
+ dodgerblue: 'rgb( 30, 144, 255)',
+ firebrick: 'rgb(178, 34, 34)',
+ floralwhite: 'rgb(255, 250, 240)',
+ forestgreen: 'rgb( 34, 139, 34)',
+ fuchsia: 'rgb(255, 0, 255)',
+ gainsboro: 'rgb(220, 220, 220)',
+ ghostwhite: 'rgb(248, 248, 255)',
+ gold: 'rgb(255, 215, 0)',
+ goldenrod: 'rgb(218, 165, 32)',
+ gray: 'rgb(128, 128, 128)',
+ grey: 'rgb(128, 128, 128)',
+ green: 'rgb( 0, 128, 0)',
+ greenyellow: 'rgb(173, 255, 47)',
+ honeydew: 'rgb(240, 255, 240)',
+ hotpink: 'rgb(255, 105, 180)',
+ indianred: 'rgb(205, 92, 92)',
+ indigo: 'rgb( 75, 0, 130)',
+ ivory: 'rgb(255, 255, 240)',
+ khaki: 'rgb(240, 230, 140)',
+ lavender: 'rgb(230, 230, 250)',
+ lavenderblush: 'rgb(255, 240, 245)',
+ lawngreen: 'rgb(124, 252, 0)',
+ lemonchiffon: 'rgb(255, 250, 205)',
+ lightblue: 'rgb(173, 216, 230)',
+ lightcoral: 'rgb(240, 128, 128)',
+ lightcyan: 'rgb(224, 255, 255)',
+ lightgoldenrodyellow: 'rgb(250, 250, 210)',
+ lightgray: 'rgb(211, 211, 211)',
+ lightgreen: 'rgb(144, 238, 144)',
+ lightgrey: 'rgb(211, 211, 211)',
+ lightpink: 'rgb(255, 182, 193)',
+ lightsalmon: 'rgb(255, 160, 122)',
+ lightseagreen: 'rgb( 32, 178, 170)',
+ lightskyblue: 'rgb(135, 206, 250)',
+ lightslategray: 'rgb(119, 136, 153)',
+ lightslategrey: 'rgb(119, 136, 153)',
+ lightsteelblue: 'rgb(176, 196, 222)',
+ lightyellow: 'rgb(255, 255, 224)',
+ lime: 'rgb( 0, 255, 0)',
+ limegreen: 'rgb( 50, 205, 50)',
+ linen: 'rgb(250, 240, 230)',
+ magenta: 'rgb(255, 0, 255)',
+ maroon: 'rgb(128, 0, 0)',
+ mediumaquamarine: 'rgb(102, 205, 170)',
+ mediumblue: 'rgb( 0, 0, 205)',
+ mediumorchid: 'rgb(186, 85, 211)',
+ mediumpurple: 'rgb(147, 112, 219)',
+ mediumseagreen: 'rgb( 60, 179, 113)',
+ mediumslateblue: 'rgb(123, 104, 238)',
+ mediumspringgreen: 'rgb( 0, 250, 154)',
+ mediumturquoise: 'rgb( 72, 209, 204)',
+ mediumvioletred: 'rgb(199, 21, 133)',
+ midnightblue: 'rgb( 25, 25, 112)',
+ mintcream: 'rgb(245, 255, 250)',
+ mistyrose: 'rgb(255, 228, 225)',
+ moccasin: 'rgb(255, 228, 181)',
+ navajowhite: 'rgb(255, 222, 173)',
+ navy: 'rgb( 0, 0, 128)',
+ oldlace: 'rgb(253, 245, 230)',
+ olive: 'rgb(128, 128, 0)',
+ olivedrab: 'rgb(107, 142, 35)',
+ orange: 'rgb(255, 165, 0)',
+ orangered: 'rgb(255, 69, 0)',
+ orchid: 'rgb(218, 112, 214)',
+ palegoldenrod: 'rgb(238, 232, 170)',
+ palegreen: 'rgb(152, 251, 152)',
+ paleturquoise: 'rgb(175, 238, 238)',
+ palevioletred: 'rgb(219, 112, 147)',
+ papayawhip: 'rgb(255, 239, 213)',
+ peachpuff: 'rgb(255, 218, 185)',
+ peru: 'rgb(205, 133, 63)',
+ pink: 'rgb(255, 192, 203)',
+ plum: 'rgb(221, 160, 221)',
+ powderblue: 'rgb(176, 224, 230)',
+ purple: 'rgb(128, 0, 128)',
+ red: 'rgb(255, 0, 0)',
+ rosybrown: 'rgb(188, 143, 143)',
+ royalblue: 'rgb( 65, 105, 225)',
+ saddlebrown: 'rgb(139, 69, 19)',
+ salmon: 'rgb(250, 128, 114)',
+ sandybrown: 'rgb(244, 164, 96)',
+ seagreen: 'rgb( 46, 139, 87)',
+ seashell: 'rgb(255, 245, 238)',
+ sienna: 'rgb(160, 82, 45)',
+ silver: 'rgb(192, 192, 192)',
+ skyblue: 'rgb(135, 206, 235)',
+ slateblue: 'rgb(106, 90, 205)',
+ slategray: 'rgb(112, 128, 144)',
+ slategrey: 'rgb(112, 128, 144)',
+ snow: 'rgb(255, 250, 250)',
+ springgreen: 'rgb( 0, 255, 127)',
+ steelblue: 'rgb( 70, 130, 180)',
+ tan: 'rgb(210, 180, 140)',
+ teal: 'rgb( 0, 128, 128)',
+ thistle: 'rgb(216, 191, 216)',
+ tomato: 'rgb(255, 99, 71)',
+ turquoise: 'rgb( 64, 224, 208)',
+ violet: 'rgb(238, 130, 238)',
+ wheat: 'rgb(245, 222, 179)',
+ white: 'rgb(255, 255, 255)',
+ whitesmoke: 'rgb(245, 245, 245)',
+ yellow: 'rgb(255, 255, 0)',
+ yellowgreen: 'rgb(154, 205, 50)'
+ };
+
+
+
+ // class: $.jqplot.AxisLabelRenderer
+ // Renderer to place labels on the axes.
+ $.jqplot.AxisLabelRenderer = function(options) {
+ // Group: Properties
+ $.jqplot.ElemContainer.call(this);
+ // name of the axis associated with this tick
+ this.axis;
+ // prop: show
+ // wether or not to show the tick (mark and label).
+ this.show = true;
+ // prop: label
+ // The text or html for the label.
+ this.label = '';
+ this.fontFamily = null;
+ this.fontSize = null;
+ this.textColor = null;
+ this._elem;
+ // prop: escapeHTML
+ // true to escape HTML entities in the label.
+ this.escapeHTML = false;
+
+ $.extend(true, this, options);
+ };
+
+ $.jqplot.AxisLabelRenderer.prototype = new $.jqplot.ElemContainer();
+ $.jqplot.AxisLabelRenderer.prototype.constructor = $.jqplot.AxisLabelRenderer;
+
+ $.jqplot.AxisLabelRenderer.prototype.init = function(options) {
+ $.extend(true, this, options);
+ };
+
+ $.jqplot.AxisLabelRenderer.prototype.draw = function(ctx, plot) {
+ // Memory Leaks patch
+ if (this._elem) {
+ this._elem.emptyForce();
+ this._elem = null;
+ }
+
+ this._elem = $('<div style="position:absolute;" class="jqplot-'+this.axis+'-label"></div>');
+
+ if (Number(this.label)) {
+ this._elem.css('white-space', 'nowrap');
+ }
+
+ if (!this.escapeHTML) {
+ this._elem.html(this.label);
+ }
+ else {
+ this._elem.text(this.label);
+ }
+ if (this.fontFamily) {
+ this._elem.css('font-family', this.fontFamily);
+ }
+ if (this.fontSize) {
+ this._elem.css('font-size', this.fontSize);
+ }
+ if (this.textColor) {
+ this._elem.css('color', this.textColor);
+ }
+
+ return this._elem;
+ };
+
+ $.jqplot.AxisLabelRenderer.prototype.pack = function() {
+ };
+
+ // class: $.jqplot.AxisTickRenderer
+ // A "tick" object showing the value of a tick/gridline on the plot.
+ $.jqplot.AxisTickRenderer = function(options) {
+ // Group: Properties
+ $.jqplot.ElemContainer.call(this);
+ // prop: mark
+ // tick mark on the axis. One of 'inside', 'outside', 'cross', '' or null.
+ this.mark = 'outside';
+ // name of the axis associated with this tick
+ this.axis;
+ // prop: showMark
+ // wether or not to show the mark on the axis.
+ this.showMark = true;
+ // prop: showGridline
+ // wether or not to draw the gridline on the grid at this tick.
+ this.showGridline = true;
+ // prop: isMinorTick
+ // if this is a minor tick.
+ this.isMinorTick = false;
+ // prop: size
+ // Length of the tick beyond the grid in pixels.
+ // DEPRECATED: This has been superceeded by markSize
+ this.size = 4;
+ // prop: markSize
+ // Length of the tick marks in pixels. For 'cross' style, length
+ // will be stoked above and below axis, so total length will be twice this.
+ this.markSize = 6;
+ // prop: show
+ // wether or not to show the tick (mark and label).
+ // Setting this to false requires more testing. It is recommended
+ // to set showLabel and showMark to false instead.
+ this.show = true;
+ // prop: showLabel
+ // wether or not to show the label.
+ this.showLabel = true;
+ this.label = null;
+ this.value = null;
+ this._styles = {};
+ // prop: formatter
+ // A class of a formatter for the tick text. sprintf by default.
+ this.formatter = $.jqplot.DefaultTickFormatter;
+ // prop: prefix
+ // String to prepend to the tick label.
+ // Prefix is prepended to the formatted tick label.
+ this.prefix = '';
+ // prop: suffix
+ // String to append to the tick label.
+ // Suffix is appended to the formatted tick label.
+ this.suffix = '';
+ // prop: formatString
+ // string passed to the formatter.
+ this.formatString = '';
+ // prop: fontFamily
+ // css spec for the font-family css attribute.
+ this.fontFamily;
+ // prop: fontSize
+ // css spec for the font-size css attribute.
+ this.fontSize;
+ // prop: textColor
+ // css spec for the color attribute.
+ this.textColor;
+ // prop: escapeHTML
+ // true to escape HTML entities in the label.
+ this.escapeHTML = false;
+ this._elem;
+ this._breakTick = false;
+
+ $.extend(true, this, options);
+ };
+
+ $.jqplot.AxisTickRenderer.prototype.init = function(options) {
+ $.extend(true, this, options);
+ };
+
+ $.jqplot.AxisTickRenderer.prototype = new $.jqplot.ElemContainer();
+ $.jqplot.AxisTickRenderer.prototype.constructor = $.jqplot.AxisTickRenderer;
+
+ $.jqplot.AxisTickRenderer.prototype.setTick = function(value, axisName, isMinor) {
+ this.value = value;
+ this.axis = axisName;
+ if (isMinor) {
+ this.isMinorTick = true;
+ }
+ return this;
+ };
+
+ $.jqplot.AxisTickRenderer.prototype.draw = function() {
+ if (this.label === null) {
+ this.label = this.prefix + this.formatter(this.formatString, this.value) + this.suffix;
+ }
+ var style = {position: 'absolute'};
+ if (Number(this.label)) {
+ style['whitSpace'] = 'nowrap';
+ }
+
+ // Memory Leaks patch
+ if (this._elem) {
+ this._elem.emptyForce();
+ this._elem = null;
+ }
+
+ this._elem = $(document.createElement('div'));
+ this._elem.addClass("jqplot-"+this.axis+"-tick");
+
+ if (!this.escapeHTML) {
+ this._elem.html(this.label);
+ }
+ else {
+ this._elem.text(this.label);
+ }
+
+ this._elem.css(style);
+
+ for (var s in this._styles) {
+ this._elem.css(s, this._styles[s]);
+ }
+ if (this.fontFamily) {
+ this._elem.css('font-family', this.fontFamily);
+ }
+ if (this.fontSize) {
+ this._elem.css('font-size', this.fontSize);
+ }
+ if (this.textColor) {
+ this._elem.css('color', this.textColor);
+ }
+ if (this._breakTick) {
+ this._elem.addClass('jqplot-breakTick');
+ }
+
+ return this._elem;
+ };
+
+ $.jqplot.DefaultTickFormatter = function (format, val) {
+ if (typeof val == 'number') {
+ if (!format) {
+ format = $.jqplot.config.defaultTickFormatString;
+ }
+ return $.jqplot.sprintf(format, val);
+ }
+ else {
+ return String(val);
+ }
+ };
+
+ $.jqplot.PercentTickFormatter = function (format, val) {
+ if (typeof val == 'number') {
+ val = 100 * val;
+ if (!format) {
+ format = $.jqplot.config.defaultTickFormatString;
+ }
+ return $.jqplot.sprintf(format, val);
+ }
+ else {
+ return String(val);
+ }
+ };
+
+ $.jqplot.AxisTickRenderer.prototype.pack = function() {
+ };
+
+ // Class: $.jqplot.CanvasGridRenderer
+ // The default jqPlot grid renderer, creating a grid on a canvas element.
+ // The renderer has no additional options beyond the <Grid> class.
+ $.jqplot.CanvasGridRenderer = function(){
+ this.shadowRenderer = new $.jqplot.ShadowRenderer();
+ };
+
+ // called with context of Grid object
+ $.jqplot.CanvasGridRenderer.prototype.init = function(options) {
+ this._ctx;
+ $.extend(true, this, options);
+ // set the shadow renderer options
+ var sopts = {lineJoin:'miter', lineCap:'round', fill:false, isarc:false, angle:this.shadowAngle, offset:this.shadowOffset, alpha:this.shadowAlpha, depth:this.shadowDepth, lineWidth:this.shadowWidth, closePath:false, strokeStyle:this.shadowColor};
+ this.renderer.shadowRenderer.init(sopts);
+ };
+
+ // called with context of Grid.
+ $.jqplot.CanvasGridRenderer.prototype.createElement = function(plot) {
+ var elem;
+ // Memory Leaks patch
+ if (this._elem) {
+ if ($.jqplot.use_excanvas && window.G_vmlCanvasManager.uninitElement !== undefined) {
+ elem = this._elem.get(0);
+ window.G_vmlCanvasManager.uninitElement(elem);
+ elem = null;
+ }
+
+ this._elem.emptyForce();
+ this._elem = null;
+ }
+
+ elem = plot.canvasManager.getCanvas();
+
+ var w = this._plotDimensions.width;
+ var h = this._plotDimensions.height;
+ elem.width = w;
+ elem.height = h;
+ this._elem = $(elem);
+ this._elem.addClass('jqplot-grid-canvas');
+ this._elem.css({ position: 'absolute', left: 0, top: 0 });
+
+ elem = plot.canvasManager.initCanvas(elem);
+
+ this._top = this._offsets.top;
+ this._bottom = h - this._offsets.bottom;
+ this._left = this._offsets.left;
+ this._right = w - this._offsets.right;
+ this._width = this._right - this._left;
+ this._height = this._bottom - this._top;
+ // avoid memory leak
+ elem = null;
+ return this._elem;
+ };
+
+ $.jqplot.CanvasGridRenderer.prototype.draw = function() {
+ this._ctx = this._elem.get(0).getContext("2d");
+ var ctx = this._ctx;
+ var axes = this._axes;
+ // Add the grid onto the grid canvas. This is the bottom most layer.
+ ctx.save();
+ ctx.clearRect(0, 0, this._plotDimensions.width, this._plotDimensions.height);
+ ctx.fillStyle = this.backgroundColor || this.background;
+ ctx.fillRect(this._left, this._top, this._width, this._height);
+
+ ctx.save();
+ ctx.lineJoin = 'miter';
+ ctx.lineCap = 'butt';
+ ctx.lineWidth = this.gridLineWidth;
+ ctx.strokeStyle = this.gridLineColor;
+ var b, e, s, m;
+ var ax = ['xaxis', 'yaxis', 'x2axis', 'y2axis'];
+ for (var i=4; i>0; i--) {
+ var name = ax[i-1];
+ var axis = axes[name];
+ var ticks = axis._ticks;
+ var numticks = ticks.length;
+ if (axis.show) {
+ if (axis.drawBaseline) {
+ var bopts = {};
+ if (axis.baselineWidth !== null) {
+ bopts.lineWidth = axis.baselineWidth;
+ }
+ if (axis.baselineColor !== null) {
+ bopts.strokeStyle = axis.baselineColor;
+ }
+ switch (name) {
+ case 'xaxis':
+ drawLine (this._left, this._bottom, this._right, this._bottom, bopts);
+ break;
+ case 'yaxis':
+ drawLine (this._left, this._bottom, this._left, this._top, bopts);
+ break;
+ case 'x2axis':
+ drawLine (this._left, this._bottom, this._right, this._bottom, bopts);
+ break;
+ case 'y2axis':
+ drawLine (this._right, this._bottom, this._right, this._top, bopts);
+ break;
+ }
+ }
+ for (var j=numticks; j>0; j--) {
+ var t = ticks[j-1];
+ if (t.show) {
+ var pos = Math.round(axis.u2p(t.value)) + 0.5;
+ switch (name) {
+ case 'xaxis':
+ // draw the grid line if we should
+ if (t.showGridline && this.drawGridlines && ((!t.isMinorTick && axis.drawMajorGridlines) || (t.isMinorTick && axis.drawMinorGridlines)) ) {
+ drawLine(pos, this._top, pos, this._bottom);
+ }
+ // draw the mark
+ if (t.showMark && t.mark && ((!t.isMinorTick && axis.drawMajorTickMarks) || (t.isMinorTick && axis.drawMinorTickMarks)) ) {
+ s = t.markSize;
+ m = t.mark;
+ var pos = Math.round(axis.u2p(t.value)) + 0.5;
+ switch (m) {
+ case 'outside':
+ b = this._bottom;
+ e = this._bottom+s;
+ break;
+ case 'inside':
+ b = this._bottom-s;
+ e = this._bottom;
+ break;
+ case 'cross':
+ b = this._bottom-s;
+ e = this._bottom+s;
+ break;
+ default:
+ b = this._bottom;
+ e = this._bottom+s;
+ break;
+ }
+ // draw the shadow
+ if (this.shadow) {
+ this.renderer.shadowRenderer.draw(ctx, [[pos,b],[pos,e]], {lineCap:'butt', lineWidth:this.gridLineWidth, offset:this.gridLineWidth*0.75, depth:2, fill:false, closePath:false});
+ }
+ // draw the line
+ drawLine(pos, b, pos, e);
+ }
+ break;
+ case 'yaxis':
+ // draw the grid line
+ if (t.showGridline && this.drawGridlines && ((!t.isMinorTick && axis.drawMajorGridlines) || (t.isMinorTick && axis.drawMinorGridlines)) ) {
+ drawLine(this._right, pos, this._left, pos);
+ }
+ // draw the mark
+ if (t.showMark && t.mark && ((!t.isMinorTick && axis.drawMajorTickMarks) || (t.isMinorTick && axis.drawMinorTickMarks)) ) {
+ s = t.markSize;
+ m = t.mark;
+ var pos = Math.round(axis.u2p(t.value)) + 0.5;
+ switch (m) {
+ case 'outside':
+ b = this._left-s;
+ e = this._left;
+ break;
+ case 'inside':
+ b = this._left;
+ e = this._left+s;
+ break;
+ case 'cross':
+ b = this._left-s;
+ e = this._left+s;
+ break;
+ default:
+ b = this._left-s;
+ e = this._left;
+ break;
+ }
+ // draw the shadow
+ if (this.shadow) {
+ this.renderer.shadowRenderer.draw(ctx, [[b, pos], [e, pos]], {lineCap:'butt', lineWidth:this.gridLineWidth*1.5, offset:this.gridLineWidth*0.75, fill:false, closePath:false});
+ }
+ drawLine(b, pos, e, pos, {strokeStyle:axis.borderColor});
+ }
+ break;
+ case 'x2axis':
+ // draw the grid line
+ if (t.showGridline && this.drawGridlines && ((!t.isMinorTick && axis.drawMajorGridlines) || (t.isMinorTick && axis.drawMinorGridlines)) ) {
+ drawLine(pos, this._bottom, pos, this._top);
+ }
+ // draw the mark
+ if (t.showMark && t.mark && ((!t.isMinorTick && axis.drawMajorTickMarks) || (t.isMinorTick && axis.drawMinorTickMarks)) ) {
+ s = t.markSize;
+ m = t.mark;
+ var pos = Math.round(axis.u2p(t.value)) + 0.5;
+ switch (m) {
+ case 'outside':
+ b = this._top-s;
+ e = this._top;
+ break;
+ case 'inside':
+ b = this._top;
+ e = this._top+s;
+ break;
+ case 'cross':
+ b = this._top-s;
+ e = this._top+s;
+ break;
+ default:
+ b = this._top-s;
+ e = this._top;
+ break;
+ }
+ // draw the shadow
+ if (this.shadow) {
+ this.renderer.shadowRenderer.draw(ctx, [[pos,b],[pos,e]], {lineCap:'butt', lineWidth:this.gridLineWidth, offset:this.gridLineWidth*0.75, depth:2, fill:false, closePath:false});
+ }
+ drawLine(pos, b, pos, e);
+ }
+ break;
+ case 'y2axis':
+ // draw the grid line
+ if (t.showGridline && this.drawGridlines && ((!t.isMinorTick && axis.drawMajorGridlines) || (t.isMinorTick && axis.drawMinorGridlines)) ) {
+ drawLine(this._left, pos, this._right, pos);
+ }
+ // draw the mark
+ if (t.showMark && t.mark && ((!t.isMinorTick && axis.drawMajorTickMarks) || (t.isMinorTick && axis.drawMinorTickMarks)) ) {
+ s = t.markSize;
+ m = t.mark;
+ var pos = Math.round(axis.u2p(t.value)) + 0.5;
+ switch (m) {
+ case 'outside':
+ b = this._right;
+ e = this._right+s;
+ break;
+ case 'inside':
+ b = this._right-s;
+ e = this._right;
+ break;
+ case 'cross':
+ b = this._right-s;
+ e = this._right+s;
+ break;
+ default:
+ b = this._right;
+ e = this._right+s;
+ break;
+ }
+ // draw the shadow
+ if (this.shadow) {
+ this.renderer.shadowRenderer.draw(ctx, [[b, pos], [e, pos]], {lineCap:'butt', lineWidth:this.gridLineWidth*1.5, offset:this.gridLineWidth*0.75, fill:false, closePath:false});
+ }
+ drawLine(b, pos, e, pos, {strokeStyle:axis.borderColor});
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ t = null;
+ }
+ axis = null;
+ ticks = null;
+ }
+ // Now draw grid lines for additional y axes
+ //////
+ // TO DO: handle yMidAxis
+ //////
+ ax = ['y3axis', 'y4axis', 'y5axis', 'y6axis', 'y7axis', 'y8axis', 'y9axis', 'yMidAxis'];
+ for (var i=7; i>0; i--) {
+ var axis = axes[ax[i-1]];
+ var ticks = axis._ticks;
+ if (axis.show) {
+ var tn = ticks[axis.numberTicks-1];
+ var t0 = ticks[0];
+ var left = axis.getLeft();
+ var points = [[left, tn.getTop() + tn.getHeight()/2], [left, t0.getTop() + t0.getHeight()/2 + 1.0]];
+ // draw the shadow
+ if (this.shadow) {
+ this.renderer.shadowRenderer.draw(ctx, points, {lineCap:'butt', fill:false, closePath:false});
+ }
+ // draw the line
+ drawLine(points[0][0], points[0][1], points[1][0], points[1][1], {lineCap:'butt', strokeStyle:axis.borderColor, lineWidth:axis.borderWidth});
+ // draw the tick marks
+ for (var j=ticks.length; j>0; j--) {
+ var t = ticks[j-1];
+ s = t.markSize;
+ m = t.mark;
+ var pos = Math.round(axis.u2p(t.value)) + 0.5;
+ if (t.showMark && t.mark) {
+ switch (m) {
+ case 'outside':
+ b = left;
+ e = left+s;
+ break;
+ case 'inside':
+ b = left-s;
+ e = left;
+ break;
+ case 'cross':
+ b = left-s;
+ e = left+s;
+ break;
+ default:
+ b = left;
+ e = left+s;
+ break;
+ }
+ points = [[b,pos], [e,pos]];
+ // draw the shadow
+ if (this.shadow) {
+ this.renderer.shadowRenderer.draw(ctx, points, {lineCap:'butt', lineWidth:this.gridLineWidth*1.5, offset:this.gridLineWidth*0.75, fill:false, closePath:false});
+ }
+ // draw the line
+ drawLine(b, pos, e, pos, {strokeStyle:axis.borderColor});
+ }
+ t = null;
+ }
+ t0 = null;
+ }
+ axis = null;
+ ticks = null;
+ }
+
+ ctx.restore();
+
+ function drawLine(bx, by, ex, ey, opts) {
+ ctx.save();
+ opts = opts || {};
+ if (opts.lineWidth == null || opts.lineWidth != 0){
+ $.extend(true, ctx, opts);
+ ctx.beginPath();
+ ctx.moveTo(bx, by);
+ ctx.lineTo(ex, ey);
+ ctx.stroke();
+ ctx.restore();
+ }
+ }
+
+ if (this.shadow) {
+ var points = [[this._left, this._bottom], [this._right, this._bottom], [this._right, this._top]];
+ this.renderer.shadowRenderer.draw(ctx, points);
+ }
+ // Now draw border around grid. Use axis border definitions. start at
+ // upper left and go clockwise.
+ if (this.borderWidth != 0 && this.drawBorder) {
+ drawLine (this._left, this._top, this._right, this._top, {lineCap:'round', strokeStyle:axes.x2axis.borderColor, lineWidth:axes.x2axis.borderWidth});
+ drawLine (this._right, this._top, this._right, this._bottom, {lineCap:'round', strokeStyle:axes.y2axis.borderColor, lineWidth:axes.y2axis.borderWidth});
+ drawLine (this._right, this._bottom, this._left, this._bottom, {lineCap:'round', strokeStyle:axes.xaxis.borderColor, lineWidth:axes.xaxis.borderWidth});
+ drawLine (this._left, this._bottom, this._left, this._top, {lineCap:'round', strokeStyle:axes.yaxis.borderColor, lineWidth:axes.yaxis.borderWidth});
+ }
+ // ctx.lineWidth = this.borderWidth;
+ // ctx.strokeStyle = this.borderColor;
+ // ctx.strokeRect(this._left, this._top, this._width, this._height);
+
+ ctx.restore();
+ ctx = null;
+ axes = null;
+ };
+
+ // Class: $.jqplot.DivTitleRenderer
+ // The default title renderer for jqPlot. This class has no options beyond the <Title> class.
+ $.jqplot.DivTitleRenderer = function() {
+ };
+
+ $.jqplot.DivTitleRenderer.prototype.init = function(options) {
+ $.extend(true, this, options);
+ };
+
+ $.jqplot.DivTitleRenderer.prototype.draw = function() {
+ // Memory Leaks patch
+ if (this._elem) {
+ this._elem.emptyForce();
+ this._elem = null;
+ }
+
+ var r = this.renderer;
+ var elem = document.createElement('div');
+ this._elem = $(elem);
+ this._elem.addClass('jqplot-title');
+
+ if (!this.text) {
+ this.show = false;
+ this._elem.height(0);
+ this._elem.width(0);
+ }
+ else if (this.text) {
+ var color;
+ if (this.color) {
+ color = this.color;
+ }
+ else if (this.textColor) {
+ color = this.textColor;
+ }
+
+ // don't trust that a stylesheet is present, set the position.
+ var styles = {position:'absolute', top:'0px', left:'0px'};
+
+ if (this._plotWidth) {
+ styles['width'] = this._plotWidth+'px';
+ }
+ if (this.fontSize) {
+ styles['fontSize'] = this.fontSize;
+ }
+ if (typeof this.textAlign === 'string') {
+ styles['textAlign'] = this.textAlign;
+ }
+ else {
+ styles['textAlign'] = 'center';
+ }
+ if (color) {
+ styles['color'] = color;
+ }
+ if (this.paddingBottom) {
+ styles['paddingBottom'] = this.paddingBottom;
+ }
+ if (this.fontFamily) {
+ styles['fontFamily'] = this.fontFamily;
+ }
+
+ this._elem.css(styles);
+ if (this.escapeHtml) {
+ this._elem.text(this.text);
+ }
+ else {
+ this._elem.html(this.text);
+ }
+
+
+ // styletext += (this._plotWidth) ? 'width:'+this._plotWidth+'px;' : '';
+ // styletext += (this.fontSize) ? 'font-size:'+this.fontSize+';' : '';
+ // styletext += (this.textAlign) ? 'text-align:'+this.textAlign+';' : 'text-align:center;';
+ // styletext += (color) ? 'color:'+color+';' : '';
+ // styletext += (this.paddingBottom) ? 'padding-bottom:'+this.paddingBottom+';' : '';
+ // this._elem = $('<div class="jqplot-title" style="'+styletext+'">'+this.text+'</div>');
+ // if (this.fontFamily) {
+ // this._elem.css('font-family', this.fontFamily);
+ // }
+ }
+
+ elem = null;
+
+ return this._elem;
+ };
+
+ $.jqplot.DivTitleRenderer.prototype.pack = function() {
+ // nothing to do here
+ };
+
+
+ var dotlen = 0.1;
+
+ $.jqplot.LinePattern = function (ctx, pattern) {
+
+ var defaultLinePatterns = {
+ dotted: [ dotlen, $.jqplot.config.dotGapLength ],
+ dashed: [ $.jqplot.config.dashLength, $.jqplot.config.gapLength ],
+ solid: null
+ };
+
+ if (typeof pattern === 'string') {
+ if (pattern[0] === '.' || pattern[0] === '-') {
+ var s = pattern;
+ pattern = [];
+ for (var i=0, imax=s.length; i<imax; i++) {
+ if (s[i] === '.') {
+ pattern.push( dotlen );
+ }
+ else if (s[i] === '-') {
+ pattern.push( $.jqplot.config.dashLength );
+ }
+ else {
+ continue;
+ }
+ pattern.push( $.jqplot.config.gapLength );
+ }
+ }
+ else {
+ pattern = defaultLinePatterns[pattern];
+ }
+ }
+
+ if (!(pattern && pattern.length)) {
+ return ctx;
+ }
+
+ var patternIndex = 0;
+ var patternDistance = pattern[0];
+ var px = 0;
+ var py = 0;
+ var pathx0 = 0;
+ var pathy0 = 0;
+
+ var moveTo = function (x, y) {
+ ctx.moveTo( x, y );
+ px = x;
+ py = y;
+ pathx0 = x;
+ pathy0 = y;
+ };
+
+ var lineTo = function (x, y) {
+ var scale = ctx.lineWidth;
+ var dx = x - px;
+ var dy = y - py;
+ var dist = Math.sqrt(dx*dx+dy*dy);
+ if ((dist > 0) && (scale > 0)) {
+ dx /= dist;
+ dy /= dist;
+ while (true) {
+ var dp = scale * patternDistance;
+ if (dp < dist) {
+ px += dp * dx;
+ py += dp * dy;
+ if ((patternIndex & 1) == 0) {
+ ctx.lineTo( px, py );
+ }
+ else {
+ ctx.moveTo( px, py );
+ }
+ dist -= dp;
+ patternIndex++;
+ if (patternIndex >= pattern.length) {
+ patternIndex = 0;
+ }
+ patternDistance = pattern[patternIndex];
+ }
+ else {
+ px = x;
+ py = y;
+ if ((patternIndex & 1) == 0) {
+ ctx.lineTo( px, py );
+ }
+ else {
+ ctx.moveTo( px, py );
+ }
+ patternDistance -= dist / scale;
+ break;
+ }
+ }
+ }
+ };
+
+ var beginPath = function () {
+ ctx.beginPath();
+ };
+
+ var closePath = function () {
+ lineTo( pathx0, pathy0 );
+ };
+
+ return {
+ moveTo: moveTo,
+ lineTo: lineTo,
+ beginPath: beginPath,
+ closePath: closePath
+ };
+ };
+
+ // Class: $.jqplot.LineRenderer
+ // The default line renderer for jqPlot, this class has no options beyond the <Series> class.
+ // Draws series as a line.
+ $.jqplot.LineRenderer = function(){
+ this.shapeRenderer = new $.jqplot.ShapeRenderer();
+ this.shadowRenderer = new $.jqplot.ShadowRenderer();
+ };
+
+ // called with scope of series.
+ $.jqplot.LineRenderer.prototype.init = function(options, plot) {
+ // Group: Properties
+ //
+ options = options || {};
+ this._type='line';
+ this.renderer.animation = {
+ show: false,
+ direction: 'left',
+ speed: 2500,
+ _supported: true
+ };
+ // prop: smooth
+ // True to draw a smoothed (interpolated) line through the data points
+ // with automatically computed number of smoothing points.
+ // Set to an integer number > 2 to specify number of smoothing points
+ // to use between each data point.
+ this.renderer.smooth = false; // true or a number > 2 for smoothing.
+ this.renderer.tension = null; // null to auto compute or a number typically > 6. Fewer points requires higher tension.
+ // prop: constrainSmoothing
+ // True to use a more accurate smoothing algorithm that will
+ // not overshoot any data points. False to allow overshoot but
+ // produce a smoother looking line.
+ this.renderer.constrainSmoothing = true;
+ // this is smoothed data in grid coordinates, like gridData
+ this.renderer._smoothedData = [];
+ // this is smoothed data in plot units (plot coordinates), like plotData.
+ this.renderer._smoothedPlotData = [];
+ this.renderer._hiBandGridData = [];
+ this.renderer._lowBandGridData = [];
+ this.renderer._hiBandSmoothedData = [];
+ this.renderer._lowBandSmoothedData = [];
+
+ // prop: bandData
+ // Data used to draw error bands or confidence intervals above/below a line.
+ //
+ // bandData can be input in 3 forms. jqPlot will figure out which is the
+ // low band line and which is the high band line for all forms:
+ //
+ // A 2 dimensional array like [[yl1, yl2, ...], [yu1, yu2, ...]] where
+ // [yl1, yl2, ...] are y values of the lower line and
+ // [yu1, yu2, ...] are y values of the upper line.
+ // In this case there must be the same number of y data points as data points
+ // in the series and the bands will inherit the x values of the series.
+ //
+ // A 2 dimensional array like [[[xl1, yl1], [xl2, yl2], ...], [[xh1, yh1], [xh2, yh2], ...]]
+ // where [xl1, yl1] are x,y data points for the lower line and
+ // [xh1, yh1] are x,y data points for the high line.
+ // x values do not have to correspond to the x values of the series and can
+ // be of any arbitrary length.
+ //
+ // Can be of form [[yl1, yu1], [yl2, yu2], [yl3, yu3], ...] where
+ // there must be 3 or more arrays and there must be the same number of arrays
+ // as there are data points in the series. In this case,
+ // [yl1, yu1] specifies the lower and upper y values for the 1st
+ // data point and so on. The bands will inherit the x
+ // values from the series.
+ this.renderer.bandData = [];
+
+ // Group: bands
+ // Banding around line, e.g error bands or confidence intervals.
+ this.renderer.bands = {
+ // prop: show
+ // true to show the bands. If bandData or interval is
+ // supplied, show will be set to true by default.
+ show: false,
+ hiData: [],
+ lowData: [],
+ // prop: color
+ // color of lines at top and bottom of bands [default: series color].
+ color: this.color,
+ // prop: showLines
+ // True to show lines at top and bottom of bands [default: false].
+ showLines: false,
+ // prop: fill
+ // True to fill area between bands [default: true].
+ fill: true,
+ // prop: fillColor
+ // css color spec for filled area. [default: series color].
+ fillColor: null,
+ _min: null,
+ _max: null,
+ // prop: interval
+ // User specified interval above and below line for bands [default: '3%''].
+ // Can be a value like 3 or a string like '3%'
+ // or an upper/lower array like [1, -2] or ['2%', '-1.5%']
+ interval: '3%'
+ };
+
+
+ var lopts = {highlightMouseOver: options.highlightMouseOver, highlightMouseDown: options.highlightMouseDown, highlightColor: options.highlightColor};
+
+ delete (options.highlightMouseOver);
+ delete (options.highlightMouseDown);
+ delete (options.highlightColor);
+
+ $.extend(true, this.renderer, options);
+
+ this.renderer.options = options;
+
+ // if we are given some band data, and bands aren't explicity set to false in options, turn them on.
+ if (this.renderer.bandData.length > 1 && (!options.bands || options.bands.show == null)) {
+ this.renderer.bands.show = true;
+ }
+
+ // if we are given an interval, and bands aren't explicity set to false in options, turn them on.
+ else if (options.bands && options.bands.show == null && options.bands.interval != null) {
+ this.renderer.bands.show = true;
+ }
+
+ // if plot is filled, turn off bands.
+ if (this.fill) {
+ this.renderer.bands.show = false;
+ }
+
+ if (this.renderer.bands.show) {
+ this.renderer.initBands.call(this, this.renderer.options, plot);
+ }
+
+
+ // smoothing is not compatible with stacked lines, disable
+ if (this._stack) {
+ this.renderer.smooth = false;
+ }
+
+ // set the shape renderer options
+ var opts = {lineJoin:this.lineJoin, lineCap:this.lineCap, fill:this.fill, isarc:false, strokeStyle:this.color, fillStyle:this.fillColor, lineWidth:this.lineWidth, linePattern:this.linePattern, closePath:this.fill};
+ this.renderer.shapeRenderer.init(opts);
+
+ var shadow_offset = options.shadowOffset;
+ // set the shadow renderer options
+ if (shadow_offset == null) {
+ // scale the shadowOffset to the width of the line.
+ if (this.lineWidth > 2.5) {
+ shadow_offset = 1.25 * (1 + (Math.atan((this.lineWidth/2.5))/0.785398163 - 1)*0.6);
+ // var shadow_offset = this.shadowOffset;
+ }
+ // for skinny lines, don't make such a big shadow.
+ else {
+ shadow_offset = 1.25 * Math.atan((this.lineWidth/2.5))/0.785398163;
+ }
+ }
+
+ var sopts = {lineJoin:this.lineJoin, lineCap:this.lineCap, fill:this.fill, isarc:false, angle:this.shadowAngle, offset:shadow_offset, alpha:this.shadowAlpha, depth:this.shadowDepth, lineWidth:this.lineWidth, linePattern:this.linePattern, closePath:this.fill};
+ this.renderer.shadowRenderer.init(sopts);
+ this._areaPoints = [];
+ this._boundingBox = [[],[]];
+
+ if (!this.isTrendline && this.fill || this.renderer.bands.show) {
+ // Group: Properties
+ //
+ // prop: highlightMouseOver
+ // True to highlight area on a filled plot when moused over.
+ // This must be false to enable highlightMouseDown to highlight when clicking on an area on a filled plot.
+ this.highlightMouseOver = true;
+ // prop: highlightMouseDown
+ // True to highlight when a mouse button is pressed over an area on a filled plot.
+ // This will be disabled if highlightMouseOver is true.
+ this.highlightMouseDown = false;
+ // prop: highlightColor
+ // color to use when highlighting an area on a filled plot.
+ this.highlightColor = null;
+ // if user has passed in highlightMouseDown option and not set highlightMouseOver, disable highlightMouseOver
+ if (lopts.highlightMouseDown && lopts.highlightMouseOver == null) {
+ lopts.highlightMouseOver = false;
+ }
+
+ $.extend(true, this, {highlightMouseOver: lopts.highlightMouseOver, highlightMouseDown: lopts.highlightMouseDown, highlightColor: lopts.highlightColor});
+
+ if (!this.highlightColor) {
+ var fc = (this.renderer.bands.show) ? this.renderer.bands.fillColor : this.fillColor;
+ this.highlightColor = $.jqplot.computeHighlightColors(fc);
+ }
+ // turn off (disable) the highlighter plugin
+ if (this.highlighter) {
+ this.highlighter.show = false;
+ }
+ }
+
+ if (!this.isTrendline && plot) {
+ plot.plugins.lineRenderer = {};
+ plot.postInitHooks.addOnce(postInit);
+ plot.postDrawHooks.addOnce(postPlotDraw);
+ plot.eventListenerHooks.addOnce('jqplotMouseMove', handleMove);
+ plot.eventListenerHooks.addOnce('jqplotMouseDown', handleMouseDown);
+ plot.eventListenerHooks.addOnce('jqplotMouseUp', handleMouseUp);
+ plot.eventListenerHooks.addOnce('jqplotClick', handleClick);
+ plot.eventListenerHooks.addOnce('jqplotRightClick', handleRightClick);
+ }
+
+ };
+
+ $.jqplot.LineRenderer.prototype.initBands = function(options, plot) {
+ // use bandData if no data specified in bands option
+ //var bd = this.renderer.bandData;
+ var bd = options.bandData || [];
+ var bands = this.renderer.bands;
+ bands.hiData = [];
+ bands.lowData = [];
+ var data = this.data;
+ bands._max = null;
+ bands._min = null;
+ // If 2 arrays, and each array greater than 2 elements, assume it is hi and low data bands of y values.
+ if (bd.length == 2) {
+ // Do we have an array of x,y values?
+ // like [[[1,1], [2,4], [3,3]], [[1,3], [2,6], [3,5]]]
+ if ($.isArray(bd[0][0])) {
+ // since an arbitrary array of points, spin through all of them to determine max and min lines.
+
+ var p;
+ var bdminidx = 0, bdmaxidx = 0;
+ for (var i = 0, l = bd[0].length; i<l; i++) {
+ p = bd[0][i];
+ if ((p[1] != null && p[1] > bands._max) || bands._max == null) {
+ bands._max = p[1];
+ }
+ if ((p[1] != null && p[1] < bands._min) || bands._min == null) {
+ bands._min = p[1];
+ }
+ }
+ for (var i = 0, l = bd[1].length; i<l; i++) {
+ p = bd[1][i];
+ if ((p[1] != null && p[1] > bands._max) || bands._max == null) {
+ bands._max = p[1];
+ bdmaxidx = 1;
+ }
+ if ((p[1] != null && p[1] < bands._min) || bands._min == null) {
+ bands._min = p[1];
+ bdminidx = 1;
+ }
+ }
+
+ if (bdmaxidx === bdminidx) {
+ bands.show = false;
+ }
+
+ bands.hiData = bd[bdmaxidx];
+ bands.lowData = bd[bdminidx];
+ }
+ // else data is arrays of y values
+ // like [[1,4,3], [3,6,5]]
+ // must have same number of band data points as points in series
+ else if (bd[0].length === data.length && bd[1].length === data.length) {
+ var hi = (bd[0][0] > bd[1][0]) ? 0 : 1;
+ var low = (hi) ? 0 : 1;
+ for (var i=0, l=data.length; i < l; i++) {
+ bands.hiData.push([data[i][0], bd[hi][i]]);
+ bands.lowData.push([data[i][0], bd[low][i]]);
+ }
+ }
+
+ // we don't have proper data array, don't show bands.
+ else {
+ bands.show = false;
+ }
+ }
+
+ // if more than 2 arrays, have arrays of [ylow, yhi] values.
+ // note, can't distinguish case of [[ylow, yhi], [ylow, yhi]] from [[ylow, ylow], [yhi, yhi]]
+ // this is assumed to be of the latter form.
+ else if (bd.length > 2 && !$.isArray(bd[0][0])) {
+ var hi = (bd[0][0] > bd[0][1]) ? 0 : 1;
+ var low = (hi) ? 0 : 1;
+ for (var i=0, l=bd.length; i<l; i++) {
+ bands.hiData.push([data[i][0], bd[i][hi]]);
+ bands.lowData.push([data[i][0], bd[i][low]]);
+ }
+ }
+
+ // don't have proper data, auto calculate
+ else {
+ var intrv = bands.interval;
+ var a = null;
+ var b = null;
+ var afunc = null;
+ var bfunc = null;
+
+ if ($.isArray(intrv)) {
+ a = intrv[0];
+ b = intrv[1];
+ }
+ else {
+ a = intrv;
+ }
+
+ if (isNaN(a)) {
+ // we have a string
+ if (a.charAt(a.length - 1) === '%') {
+ afunc = 'multiply';
+ a = parseFloat(a)/100 + 1;
+ }
+ }
+
+ else {
+ a = parseFloat(a);
+ afunc = 'add';
+ }
+
+ if (b !== null && isNaN(b)) {
+ // we have a string
+ if (b.charAt(b.length - 1) === '%') {
+ bfunc = 'multiply';
+ b = parseFloat(b)/100 + 1;
+ }
+ }
+
+ else if (b !== null) {
+ b = parseFloat(b);
+ bfunc = 'add';
+ }
+
+ if (a !== null) {
+ if (b === null) {
+ b = -a;
+ bfunc = afunc;
+ if (bfunc === 'multiply') {
+ b += 2;
+ }
+ }
+
+ // make sure a always applies to hi band.
+ if (a < b) {
+ var temp = a;
+ a = b;
+ b = temp;
+ temp = afunc;
+ afunc = bfunc;
+ bfunc = temp;
+ }
+
+ for (var i=0, l = data.length; i < l; i++) {
+ switch (afunc) {
+ case 'add':
+ bands.hiData.push([data[i][0], data[i][1] + a]);
+ break;
+ case 'multiply':
+ bands.hiData.push([data[i][0], data[i][1] * a]);
+ break;
+ }
+ switch (bfunc) {
+ case 'add':
+ bands.lowData.push([data[i][0], data[i][1] + b]);
+ break;
+ case 'multiply':
+ bands.lowData.push([data[i][0], data[i][1] * b]);
+ break;
+ }
+ }
+ }
+
+ else {
+ bands.show = false;
+ }
+ }
+
+ var hd = bands.hiData;
+ var ld = bands.lowData;
+ for (var i = 0, l = hd.length; i<l; i++) {
+ if ((hd[i][1] != null && hd[i][1] > bands._max) || bands._max == null) {
+ bands._max = hd[i][1];
+ }
+ }
+ for (var i = 0, l = ld.length; i<l; i++) {
+ if ((ld[i][1] != null && ld[i][1] < bands._min) || bands._min == null) {
+ bands._min = ld[i][1];
+ }
+ }
+
+ // one last check for proper data
+ // these don't apply any more since allowing arbitrary x,y values
+ // if (bands.hiData.length != bands.lowData.length) {
+ // bands.show = false;
+ // }
+
+ // if (bands.hiData.length != this.data.length) {
+ // bands.show = false;
+ // }
+
+ if (bands.fillColor === null) {
+ var c = $.jqplot.getColorComponents(bands.color);
+ // now adjust alpha to differentiate fill
+ c[3] = c[3] * 0.5;
+ bands.fillColor = 'rgba(' + c[0] +', '+ c[1] +', '+ c[2] +', '+ c[3] + ')';
+ }
+ };
+
+ function getSteps (d, f) {
+ return (3.4182054+f) * Math.pow(d, -0.3534992);
+ }
+
+ function computeSteps (d1, d2) {
+ var s = Math.sqrt(Math.pow((d2[0]- d1[0]), 2) + Math.pow ((d2[1] - d1[1]), 2));
+ return 5.7648 * Math.log(s) + 7.4456;
+ }
+
+ function tanh (x) {
+ var a = (Math.exp(2*x) - 1) / (Math.exp(2*x) + 1);
+ return a;
+ }
+
+ //////////
+ // computeConstrainedSmoothedData
+ // An implementation of the constrained cubic spline interpolation
+ // method as presented in:
+ //
+ // Kruger, CJC, Constrained Cubic Spine Interpolation for Chemical Engineering Applications
+ // http://www.korf.co.uk/spline.pdf
+ //
+ // The implementation below borrows heavily from the sample Visual Basic
+ // implementation by CJC Kruger found in http://www.korf.co.uk/spline.xls
+ //
+ /////////
+
+ // called with scope of series
+ function computeConstrainedSmoothedData (gd) {
+ var smooth = this.renderer.smooth;
+ var dim = this.canvas.getWidth();
+ var xp = this._xaxis.series_p2u;
+ var yp = this._yaxis.series_p2u;
+ var steps =null;
+ var _steps = null;
+ var dist = gd.length/dim;
+ var _smoothedData = [];
+ var _smoothedPlotData = [];
+
+ if (!isNaN(parseFloat(smooth))) {
+ steps = parseFloat(smooth);
+ }
+ else {
+ steps = getSteps(dist, 0.5);
+ }
+
+ var yy = [];
+ var xx = [];
+
+ for (var i=0, l = gd.length; i<l; i++) {
+ yy.push(gd[i][1]);
+ xx.push(gd[i][0]);
+ }
+
+ function dxx(x1, x0) {
+ if (x1 - x0 == 0) {
+ return Math.pow(10,10);
+ }
+ else {
+ return x1 - x0;
+ }
+ }
+
+ var A, B, C, D;
+ // loop through each line segment. Have # points - 1 line segments. Nmber segments starting at 1.
+ var nmax = gd.length - 1;
+ for (var num = 1, gdl = gd.length; num<gdl; num++) {
+ var gxx = [];
+ var ggxx = [];
+ // point at each end of segment.
+ for (var j = 0; j < 2; j++) {
+ var i = num - 1 + j; // point number, 0 to # points.
+
+ if (i == 0 || i == nmax) {
+ gxx[j] = Math.pow(10, 10);
+ }
+ else if (yy[i+1] - yy[i] == 0 || yy[i] - yy[i-1] == 0) {
+ gxx[j] = 0;
+ }
+ else if (((xx[i+1] - xx[i]) / (yy[i+1] - yy[i]) + (xx[i] - xx[i-1]) / (yy[i] - yy[i-1])) == 0 ) {
+ gxx[j] = 0;
+ }
+ else if ( (yy[i+1] - yy[i]) * (yy[i] - yy[i-1]) < 0 ) {
+ gxx[j] = 0;
+ }
+
+ else {
+ gxx[j] = 2 / (dxx(xx[i + 1], xx[i]) / (yy[i + 1] - yy[i]) + dxx(xx[i], xx[i - 1]) / (yy[i] - yy[i - 1]));
+ }
+ }
+
+ // Reset first derivative (slope) at first and last point
+ if (num == 1) {
+ // First point has 0 2nd derivative
+ gxx[0] = 3 / 2 * (yy[1] - yy[0]) / dxx(xx[1], xx[0]) - gxx[1] / 2;
+ }
+ else if (num == nmax) {
+ // Last point has 0 2nd derivative
+ gxx[1] = 3 / 2 * (yy[nmax] - yy[nmax - 1]) / dxx(xx[nmax], xx[nmax - 1]) - gxx[0] / 2;
+ }
+
+ // Calc second derivative at points
+ ggxx[0] = -2 * (gxx[1] + 2 * gxx[0]) / dxx(xx[num], xx[num - 1]) + 6 * (yy[num] - yy[num - 1]) / Math.pow(dxx(xx[num], xx[num - 1]), 2);
+ ggxx[1] = 2 * (2 * gxx[1] + gxx[0]) / dxx(xx[num], xx[num - 1]) - 6 * (yy[num] - yy[num - 1]) / Math.pow(dxx(xx[num], xx[num - 1]), 2);
+
+ // Calc constants for cubic interpolation
+ D = 1 / 6 * (ggxx[1] - ggxx[0]) / dxx(xx[num], xx[num - 1]);
+ C = 1 / 2 * (xx[num] * ggxx[0] - xx[num - 1] * ggxx[1]) / dxx(xx[num], xx[num - 1]);
+ B = (yy[num] - yy[num - 1] - C * (Math.pow(xx[num], 2) - Math.pow(xx[num - 1], 2)) - D * (Math.pow(xx[num], 3) - Math.pow(xx[num - 1], 3))) / dxx(xx[num], xx[num - 1]);
+ A = yy[num - 1] - B * xx[num - 1] - C * Math.pow(xx[num - 1], 2) - D * Math.pow(xx[num - 1], 3);
+
+ var increment = (xx[num] - xx[num - 1]) / steps;
+ var temp, tempx;
+
+ for (var j = 0, l = steps; j < l; j++) {
+ temp = [];
+ tempx = xx[num - 1] + j * increment;
+ temp.push(tempx);
+ temp.push(A + B * tempx + C * Math.pow(tempx, 2) + D * Math.pow(tempx, 3));
+ _smoothedData.push(temp);
+ _smoothedPlotData.push([xp(temp[0]), yp(temp[1])]);
+ }
+ }
+
+ _smoothedData.push(gd[i]);
+ _smoothedPlotData.push([xp(gd[i][0]), yp(gd[i][1])]);
+
+ return [_smoothedData, _smoothedPlotData];
+ }
+
+ ///////
+ // computeHermiteSmoothedData
+ // A hermite spline smoothing of the plot data.
+ // This implementation is derived from the one posted
+ // by krypin on the jqplot-users mailing list:
+ //
+ // http://groups.google.com/group/jqplot-users/browse_thread/thread/748be6a445…
+ //
+ // with a blog post:
+ //
+ // http://blog.statscollector.com/a-plugin-renderer-for-jqplot-to-draw-a-hermi…
+ //
+ // and download of the original plugin:
+ //
+ // http://blog.statscollector.com/wp-content/uploads/2010/02/jqplot.hermiteSpl…
+ //////////
+
+ // called with scope of series
+ function computeHermiteSmoothedData (gd) {
+ var smooth = this.renderer.smooth;
+ var tension = this.renderer.tension;
+ var dim = this.canvas.getWidth();
+ var xp = this._xaxis.series_p2u;
+ var yp = this._yaxis.series_p2u;
+ var steps =null;
+ var _steps = null;
+ var a = null;
+ var a1 = null;
+ var a2 = null;
+ var slope = null;
+ var slope2 = null;
+ var temp = null;
+ var t, s, h1, h2, h3, h4;
+ var TiX, TiY, Ti1X, Ti1Y;
+ var pX, pY, p;
+ var sd = [];
+ var spd = [];
+ var dist = gd.length/dim;
+ var min, max, stretch, scale, shift;
+ var _smoothedData = [];
+ var _smoothedPlotData = [];
+ if (!isNaN(parseFloat(smooth))) {
+ steps = parseFloat(smooth);
+ }
+ else {
+ steps = getSteps(dist, 0.5);
+ }
+ if (!isNaN(parseFloat(tension))) {
+ tension = parseFloat(tension);
+ }
+
+ for (var i=0, l = gd.length-1; i < l; i++) {
+
+ if (tension === null) {
+ slope = Math.abs((gd[i+1][1] - gd[i][1]) / (gd[i+1][0] - gd[i][0]));
+
+ min = 0.3;
+ max = 0.6;
+ stretch = (max - min)/2.0;
+ scale = 2.5;
+ shift = -1.4;
+
+ temp = slope/scale + shift;
+
+ a1 = stretch * tanh(temp) - stretch * tanh(shift) + min;
+
+ // if have both left and right line segments, will use minimum tension.
+ if (i > 0) {
+ slope2 = Math.abs((gd[i][1] - gd[i-1][1]) / (gd[i][0] - gd[i-1][0]));
+ }
+ temp = slope2/scale + shift;
+
+ a2 = stretch * tanh(temp) - stretch * tanh(shift) + min;
+
+ a = (a1 + a2)/2.0;
+
+ }
+ else {
+ a = tension;
+ }
+ for (t=0; t < steps; t++) {
+ s = t / steps;
+ h1 = (1 + 2*s)*Math.pow((1-s),2);
+ h2 = s*Math.pow((1-s),2);
+ h3 = Math.pow(s,2)*(3-2*s);
+ h4 = Math.pow(s,2)*(s-1);
+
+ if (gd[i-1]) {
+ TiX = a * (gd[i+1][0] - gd[i-1][0]);
+ TiY = a * (gd[i+1][1] - gd[i-1][1]);
+ } else {
+ TiX = a * (gd[i+1][0] - gd[i][0]);
+ TiY = a * (gd[i+1][1] - gd[i][1]);
+ }
+ if (gd[i+2]) {
+ Ti1X = a * (gd[i+2][0] - gd[i][0]);
+ Ti1Y = a * (gd[i+2][1] - gd[i][1]);
+ } else {
+ Ti1X = a * (gd[i+1][0] - gd[i][0]);
+ Ti1Y = a * (gd[i+1][1] - gd[i][1]);
+ }
+
+ pX = h1*gd[i][0] + h3*gd[i+1][0] + h2*TiX + h4*Ti1X;
+ pY = h1*gd[i][1] + h3*gd[i+1][1] + h2*TiY + h4*Ti1Y;
+ p = [pX, pY];
+
+ _smoothedData.push(p);
+ _smoothedPlotData.push([xp(pX), yp(pY)]);
+ }
+ }
+ _smoothedData.push(gd[l]);
+ _smoothedPlotData.push([xp(gd[l][0]), yp(gd[l][1])]);
+
+ return [_smoothedData, _smoothedPlotData];
+ }
+
+ // setGridData
+ // converts the user data values to grid coordinates and stores them
+ // in the gridData array.
+ // Called with scope of a series.
+ $.jqplot.LineRenderer.prototype.setGridData = function(plot) {
+ // recalculate the grid data
+ var xp = this._xaxis.series_u2p;
+ var yp = this._yaxis.series_u2p;
+ var data = this._plotData;
+ var pdata = this._prevPlotData;
+ this.gridData = [];
+ this._prevGridData = [];
+ this.renderer._smoothedData = [];
+ this.renderer._smoothedPlotData = [];
+ this.renderer._hiBandGridData = [];
+ this.renderer._lowBandGridData = [];
+ this.renderer._hiBandSmoothedData = [];
+ this.renderer._lowBandSmoothedData = [];
+ var bands = this.renderer.bands;
+ var hasNull = false;
+ for (var i=0, l=data.length; i < l; i++) {
+ // if not a line series or if no nulls in data, push the converted point onto the array.
+ if (data[i][0] != null && data[i][1] != null) {
+ this.gridData.push([xp.call(this._xaxis, data[i][0]), yp.call(this._yaxis, data[i][1])]);
+ }
+ // else if there is a null, preserve it.
+ else if (data[i][0] == null) {
+ hasNull = true;
+ this.gridData.push([null, yp.call(this._yaxis, data[i][1])]);
+ }
+ else if (data[i][1] == null) {
+ hasNull = true;
+ this.gridData.push([xp.call(this._xaxis, data[i][0]), null]);
+ }
+ // if not a line series or if no nulls in data, push the converted point onto the array.
+ if (pdata[i] != null && pdata[i][0] != null && pdata[i][1] != null) {
+ this._prevGridData.push([xp.call(this._xaxis, pdata[i][0]), yp.call(this._yaxis, pdata[i][1])]);
+ }
+ // else if there is a null, preserve it.
+ else if (pdata[i] != null && pdata[i][0] == null) {
+ this._prevGridData.push([null, yp.call(this._yaxis, pdata[i][1])]);
+ }
+ else if (pdata[i] != null && pdata[i][0] != null && pdata[i][1] == null) {
+ this._prevGridData.push([xp.call(this._xaxis, pdata[i][0]), null]);
+ }
+ }
+
+ // don't do smoothing or bands on broken lines.
+ if (hasNull) {
+ this.renderer.smooth = false;
+ if (this._type === 'line') {
+ bands.show = false;
+ }
+ }
+
+ if (this._type === 'line' && bands.show) {
+ for (var i=0, l=bands.hiData.length; i<l; i++) {
+ this.renderer._hiBandGridData.push([xp.call(this._xaxis, bands.hiData[i][0]), yp.call(this._yaxis, bands.hiData[i][1])]);
+ }
+ for (var i=0, l=bands.lowData.length; i<l; i++) {
+ this.renderer._lowBandGridData.push([xp.call(this._xaxis, bands.lowData[i][0]), yp.call(this._yaxis, bands.lowData[i][1])]);
+ }
+ }
+
+ // calculate smoothed data if enough points and no nulls
+ if (this._type === 'line' && this.renderer.smooth && this.gridData.length > 2) {
+ var ret;
+ if (this.renderer.constrainSmoothing) {
+ ret = computeConstrainedSmoothedData.call(this, this.gridData);
+ this.renderer._smoothedData = ret[0];
+ this.renderer._smoothedPlotData = ret[1];
+
+ if (bands.show) {
+ ret = computeConstrainedSmoothedData.call(this, this.renderer._hiBandGridData);
+ this.renderer._hiBandSmoothedData = ret[0];
+ ret = computeConstrainedSmoothedData.call(this, this.renderer._lowBandGridData);
+ this.renderer._lowBandSmoothedData = ret[0];
+ }
+
+ ret = null;
+ }
+ else {
+ ret = computeHermiteSmoothedData.call(this, this.gridData);
+ this.renderer._smoothedData = ret[0];
+ this.renderer._smoothedPlotData = ret[1];
+
+ if (bands.show) {
+ ret = computeHermiteSmoothedData.call(this, this.renderer._hiBandGridData);
+ this.renderer._hiBandSmoothedData = ret[0];
+ ret = computeHermiteSmoothedData.call(this, this.renderer._lowBandGridData);
+ this.renderer._lowBandSmoothedData = ret[0];
+ }
+
+ ret = null;
+ }
+ }
+ };
+
+ // makeGridData
+ // converts any arbitrary data values to grid coordinates and
+ // returns them. This method exists so that plugins can use a series'
+ // linerenderer to generate grid data points without overwriting the
+ // grid data associated with that series.
+ // Called with scope of a series.
+ $.jqplot.LineRenderer.prototype.makeGridData = function(data, plot) {
+ // recalculate the grid data
+ var xp = this._xaxis.series_u2p;
+ var yp = this._yaxis.series_u2p;
+ var gd = [];
+ var pgd = [];
+ this.renderer._smoothedData = [];
+ this.renderer._smoothedPlotData = [];
+ this.renderer._hiBandGridData = [];
+ this.renderer._lowBandGridData = [];
+ this.renderer._hiBandSmoothedData = [];
+ this.renderer._lowBandSmoothedData = [];
+ var bands = this.renderer.bands;
+ var hasNull = false;
+ for (var i=0; i<data.length; i++) {
+ // if not a line series or if no nulls in data, push the converted point onto the array.
+ if (data[i][0] != null && data[i][1] != null) {
+ gd.push([xp.call(this._xaxis, data[i][0]), yp.call(this._yaxis, data[i][1])]);
+ }
+ // else if there is a null, preserve it.
+ else if (data[i][0] == null) {
+ hasNull = true;
+ gd.push([null, yp.call(this._yaxis, data[i][1])]);
+ }
+ else if (data[i][1] == null) {
+ hasNull = true;
+ gd.push([xp.call(this._xaxis, data[i][0]), null]);
+ }
+ }
+
+ // don't do smoothing or bands on broken lines.
+ if (hasNull) {
+ this.renderer.smooth = false;
+ if (this._type === 'line') {
+ bands.show = false;
+ }
+ }
+
+ if (this._type === 'line' && bands.show) {
+ for (var i=0, l=bands.hiData.length; i<l; i++) {
+ this.renderer._hiBandGridData.push([xp.call(this._xaxis, bands.hiData[i][0]), yp.call(this._yaxis, bands.hiData[i][1])]);
+ }
+ for (var i=0, l=bands.lowData.length; i<l; i++) {
+ this.renderer._lowBandGridData.push([xp.call(this._xaxis, bands.lowData[i][0]), yp.call(this._yaxis, bands.lowData[i][1])]);
+ }
+ }
+
+ if (this._type === 'line' && this.renderer.smooth && gd.length > 2) {
+ var ret;
+ if (this.renderer.constrainSmoothing) {
+ ret = computeConstrainedSmoothedData.call(this, gd);
+ this.renderer._smoothedData = ret[0];
+ this.renderer._smoothedPlotData = ret[1];
+
+ if (bands.show) {
+ ret = computeConstrainedSmoothedData.call(this, this.renderer._hiBandGridData);
+ this.renderer._hiBandSmoothedData = ret[0];
+ ret = computeConstrainedSmoothedData.call(this, this.renderer._lowBandGridData);
+ this.renderer._lowBandSmoothedData = ret[0];
+ }
+
+ ret = null;
+ }
+ else {
+ ret = computeHermiteSmoothedData.call(this, gd);
+ this.renderer._smoothedData = ret[0];
+ this.renderer._smoothedPlotData = ret[1];
+
+ if (bands.show) {
+ ret = computeHermiteSmoothedData.call(this, this.renderer._hiBandGridData);
+ this.renderer._hiBandSmoothedData = ret[0];
+ ret = computeHermiteSmoothedData.call(this, this.renderer._lowBandGridData);
+ this.renderer._lowBandSmoothedData = ret[0];
+ }
+
+ ret = null;
+ }
+ }
+ return gd;
+ };
+
+
+ // called within scope of series.
+ $.jqplot.LineRenderer.prototype.draw = function(ctx, gd, options, plot) {
+ var i;
+ // get a copy of the options, so we don't modify the original object.
+ var opts = $.extend(true, {}, options);
+ var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
+ var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine;
+ var fill = (opts.fill != undefined) ? opts.fill : this.fill;
+ var fillAndStroke = (opts.fillAndStroke != undefined) ? opts.fillAndStroke : this.fillAndStroke;
+ var xmin, ymin, xmax, ymax;
+ ctx.save();
+ if (gd.length) {
+ if (showLine) {
+ // if we fill, we'll have to add points to close the curve.
+ if (fill) {
+ if (this.fillToZero) {
+ // have to break line up into shapes at axis crossings
+ var negativeColor = this.negativeColor;
+ if (! this.useNegativeColors) {
+ negativeColor = opts.fillStyle;
+ }
+ var isnegative = false;
+ var posfs = opts.fillStyle;
+
+ // if stoking line as well as filling, get a copy of line data.
+ if (fillAndStroke) {
+ var fasgd = gd.slice(0);
+ }
+ // if not stacked, fill down to axis
+ if (this.index == 0 || !this._stack) {
+
+ var tempgd = [];
+ var pd = (this.renderer.smooth) ? this.renderer._smoothedPlotData : this._plotData;
+ this._areaPoints = [];
+ var pyzero = this._yaxis.series_u2p(this.fillToValue);
+ var pxzero = this._xaxis.series_u2p(this.fillToValue);
+
+ opts.closePath = true;
+
+ if (this.fillAxis == 'y') {
+ tempgd.push([gd[0][0], pyzero]);
+ this._areaPoints.push([gd[0][0], pyzero]);
+
+ for (var i=0; i<gd.length-1; i++) {
+ tempgd.push(gd[i]);
+ this._areaPoints.push(gd[i]);
+ // do we have an axis crossing?
+ if (pd[i][1] * pd[i+1][1] < 0) {
+ if (pd[i][1] < 0) {
+ isnegative = true;
+ opts.fillStyle = negativeColor;
+ }
+ else {
+ isnegative = false;
+ opts.fillStyle = posfs;
+ }
+
+ var xintercept = gd[i][0] + (gd[i+1][0] - gd[i][0]) * (pyzero-gd[i][1])/(gd[i+1][1] - gd[i][1]);
+ tempgd.push([xintercept, pyzero]);
+ this._areaPoints.push([xintercept, pyzero]);
+ // now draw this shape and shadow.
+ if (shadow) {
+ this.renderer.shadowRenderer.draw(ctx, tempgd, opts);
+ }
+ this.renderer.shapeRenderer.draw(ctx, tempgd, opts);
+ // now empty temp array and continue
+ tempgd = [[xintercept, pyzero]];
+ // this._areaPoints = [[xintercept, pyzero]];
+ }
+ }
+ if (pd[gd.length-1][1] < 0) {
+ isnegative = true;
+ opts.fillStyle = negativeColor;
+ }
+ else {
+ isnegative = false;
+ opts.fillStyle = posfs;
+ }
+ tempgd.push(gd[gd.length-1]);
+ this._areaPoints.push(gd[gd.length-1]);
+ tempgd.push([gd[gd.length-1][0], pyzero]);
+ this._areaPoints.push([gd[gd.length-1][0], pyzero]);
+ }
+ // now draw the last area.
+ if (shadow) {
+ this.renderer.shadowRenderer.draw(ctx, tempgd, opts);
+ }
+ this.renderer.shapeRenderer.draw(ctx, tempgd, opts);
+
+
+ // var gridymin = this._yaxis.series_u2p(0);
+ // // IE doesn't return new length on unshift
+ // gd.unshift([gd[0][0], gridymin]);
+ // len = gd.length;
+ // gd.push([gd[len - 1][0], gridymin]);
+ }
+ // if stacked, fill to line below
+ else {
+ var prev = this._prevGridData;
+ for (var i=prev.length; i>0; i--) {
+ gd.push(prev[i-1]);
+ // this._areaPoints.push(prev[i-1]);
+ }
+ if (shadow) {
+ this.renderer.shadowRenderer.draw(ctx, gd, opts);
+ }
+ this._areaPoints = gd;
+ this.renderer.shapeRenderer.draw(ctx, gd, opts);
+ }
+ }
+ /////////////////////////
+ // Not filled to zero
+ ////////////////////////
+ else {
+ // if stoking line as well as filling, get a copy of line data.
+ if (fillAndStroke) {
+ var fasgd = gd.slice(0);
+ }
+ // if not stacked, fill down to axis
+ if (this.index == 0 || !this._stack) {
+ // var gridymin = this._yaxis.series_u2p(this._yaxis.min) - this.gridBorderWidth / 2;
+ var gridymin = ctx.canvas.height;
+ // IE doesn't return new length on unshift
+ gd.unshift([gd[0][0], gridymin]);
+ var len = gd.length;
+ gd.push([gd[len - 1][0], gridymin]);
+ }
+ // if stacked, fill to line below
+ else {
+ var prev = this._prevGridData;
+ for (var i=prev.length; i>0; i--) {
+ gd.push(prev[i-1]);
+ }
+ }
+ this._areaPoints = gd;
+
+ if (shadow) {
+ this.renderer.shadowRenderer.draw(ctx, gd, opts);
+ }
+
+ this.renderer.shapeRenderer.draw(ctx, gd, opts);
+ }
+ if (fillAndStroke) {
+ var fasopts = $.extend(true, {}, opts, {fill:false, closePath:false});
+ this.renderer.shapeRenderer.draw(ctx, fasgd, fasopts);
+ //////////
+ // TODO: figure out some way to do shadows nicely
+ // if (shadow) {
+ // this.renderer.shadowRenderer.draw(ctx, fasgd, fasopts);
+ // }
+ // now draw the markers
+ if (this.markerRenderer.show) {
+ if (this.renderer.smooth) {
+ fasgd = this.gridData;
+ }
+ for (i=0; i<fasgd.length; i++) {
+ this.markerRenderer.draw(fasgd[i][0], fasgd[i][1], ctx, opts.markerOptions);
+ }
+ }
+ }
+ }
+ else {
+
+ if (this.renderer.bands.show) {
+ var bdat;
+ var bopts = $.extend(true, {}, opts);
+ if (this.renderer.bands.showLines) {
+ bdat = (this.renderer.smooth) ? this.renderer._hiBandSmoothedData : this.renderer._hiBandGridData;
+ this.renderer.shapeRenderer.draw(ctx, bdat, opts);
+ bdat = (this.renderer.smooth) ? this.renderer._lowBandSmoothedData : this.renderer._lowBandGridData;
+ this.renderer.shapeRenderer.draw(ctx, bdat, bopts);
+ }
+
+ if (this.renderer.bands.fill) {
+ if (this.renderer.smooth) {
+ bdat = this.renderer._hiBandSmoothedData.concat(this.renderer._lowBandSmoothedData.reverse());
+ }
+ else {
+ bdat = this.renderer._hiBandGridData.concat(this.renderer._lowBandGridData.reverse());
+ }
+ this._areaPoints = bdat;
+ bopts.closePath = true;
+ bopts.fill = true;
+ bopts.fillStyle = this.renderer.bands.fillColor;
+ this.renderer.shapeRenderer.draw(ctx, bdat, bopts);
+ }
+ }
+
+ if (shadow) {
+ this.renderer.shadowRenderer.draw(ctx, gd, opts);
+ }
+
+ this.renderer.shapeRenderer.draw(ctx, gd, opts);
+ }
+ }
+ // calculate the bounding box
+ var xmin = xmax = ymin = ymax = null;
+ for (i=0; i<this._areaPoints.length; i++) {
+ var p = this._areaPoints[i];
+ if (xmin > p[0] || xmin == null) {
+ xmin = p[0];
+ }
+ if (ymax < p[1] || ymax == null) {
+ ymax = p[1];
+ }
+ if (xmax < p[0] || xmax == null) {
+ xmax = p[0];
+ }
+ if (ymin > p[1] || ymin == null) {
+ ymin = p[1];
+ }
+ }
+
+ if (this.type === 'line' && this.renderer.bands.show) {
+ ymax = this._yaxis.series_u2p(this.renderer.bands._min);
+ ymin = this._yaxis.series_u2p(this.renderer.bands._max);
+ }
+
+ this._boundingBox = [[xmin, ymax], [xmax, ymin]];
+
+ // now draw the markers
+ if (this.markerRenderer.show && !fill) {
+ if (this.renderer.smooth) {
+ gd = this.gridData;
+ }
+ for (i=0; i<gd.length; i++) {
+ if (gd[i][0] != null && gd[i][1] != null) {
+ this.markerRenderer.draw(gd[i][0], gd[i][1], ctx, opts.markerOptions);
+ }
+ }
+ }
+ }
+
+ ctx.restore();
+ };
+
+ $.jqplot.LineRenderer.prototype.drawShadow = function(ctx, gd, options) {
+ // This is a no-op, shadows drawn with lines.
+ };
+
+ // called with scope of plot.
+ // make sure to not leave anything highlighted.
+ function postInit(target, data, options) {
+ for (var i=0; i<this.series.length; i++) {
+ if (this.series[i].renderer.constructor == $.jqplot.LineRenderer) {
+ // don't allow mouseover and mousedown at same time.
+ if (this.series[i].highlightMouseOver) {
+ this.series[i].highlightMouseDown = false;
+ }
+ }
+ }
+ }
+
+ // called within context of plot
+ // create a canvas which we can draw on.
+ // insert it before the eventCanvas, so eventCanvas will still capture events.
+ function postPlotDraw() {
+ // Memory Leaks patch
+ if (this.plugins.lineRenderer && this.plugins.lineRenderer.highlightCanvas) {
+ this.plugins.lineRenderer.highlightCanvas.resetCanvas();
+ this.plugins.lineRenderer.highlightCanvas = null;
+ }
+
+ this.plugins.lineRenderer.highlightedSeriesIndex = null;
+ this.plugins.lineRenderer.highlightCanvas = new $.jqplot.GenericCanvas();
+
+ this.eventCanvas._elem.before(this.plugins.lineRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-lineRenderer-highlight-canvas', this._plotDimensions, this));
+ this.plugins.lineRenderer.highlightCanvas.setContext();
+ this.eventCanvas._elem.bind('mouseleave', {plot:this}, function (ev) { unhighlight(ev.data.plot); });
+ }
+
+ function highlight (plot, sidx, pidx, points) {
+ var s = plot.series[sidx];
+ var canvas = plot.plugins.lineRenderer.highlightCanvas;
+ canvas._ctx.clearRect(0,0,canvas._ctx.canvas.width, canvas._ctx.canvas.height);
+ s._highlightedPoint = pidx;
+ plot.plugins.lineRenderer.highlightedSeriesIndex = sidx;
+ var opts = {fillStyle: s.highlightColor};
+ if (s.type === 'line' && s.renderer.bands.show) {
+ opts.fill = true;
+ opts.closePath = true;
+ }
+ s.renderer.shapeRenderer.draw(canvas._ctx, points, opts);
+ canvas = null;
+ }
+
+ function unhighlight (plot) {
+ var canvas = plot.plugins.lineRenderer.highlightCanvas;
+ canvas._ctx.clearRect(0,0, canvas._ctx.canvas.width, canvas._ctx.canvas.height);
+ for (var i=0; i<plot.series.length; i++) {
+ plot.series[i]._highlightedPoint = null;
+ }
+ plot.plugins.lineRenderer.highlightedSeriesIndex = null;
+ plot.target.trigger('jqplotDataUnhighlight');
+ canvas = null;
+ }
+
+
+ function handleMove(ev, gridpos, datapos, neighbor, plot) {
+ if (neighbor) {
+ var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
+ var evt1 = jQuery.Event('jqplotDataMouseOver');
+ evt1.pageX = ev.pageX;
+ evt1.pageY = ev.pageY;
+ plot.target.trigger(evt1, ins);
+ if (plot.series[ins[0]].highlightMouseOver && !(ins[0] == plot.plugins.lineRenderer.highlightedSeriesIndex)) {
+ var evt = jQuery.Event('jqplotDataHighlight');
+ evt.which = ev.which;
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ plot.target.trigger(evt, ins);
+ highlight (plot, neighbor.seriesIndex, neighbor.pointIndex, neighbor.points);
+ }
+ }
+ else if (neighbor == null) {
+ unhighlight (plot);
+ }
+ }
+
+ function handleMouseDown(ev, gridpos, datapos, neighbor, plot) {
+ if (neighbor) {
+ var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
+ if (plot.series[ins[0]].highlightMouseDown && !(ins[0] == plot.plugins.lineRenderer.highlightedSeriesIndex)) {
+ var evt = jQuery.Event('jqplotDataHighlight');
+ evt.which = ev.which;
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ plot.target.trigger(evt, ins);
+ highlight (plot, neighbor.seriesIndex, neighbor.pointIndex, neighbor.points);
+ }
+ }
+ else if (neighbor == null) {
+ unhighlight (plot);
+ }
+ }
+
+ function handleMouseUp(ev, gridpos, datapos, neighbor, plot) {
+ var idx = plot.plugins.lineRenderer.highlightedSeriesIndex;
+ if (idx != null && plot.series[idx].highlightMouseDown) {
+ unhighlight(plot);
+ }
+ }
+
+ function handleClick(ev, gridpos, datapos, neighbor, plot) {
+ if (neighbor) {
+ var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
+ var evt = jQuery.Event('jqplotDataClick');
+ evt.which = ev.which;
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ plot.target.trigger(evt, ins);
+ }
+ }
+
+ function handleRightClick(ev, gridpos, datapos, neighbor, plot) {
+ if (neighbor) {
+ var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
+ var idx = plot.plugins.lineRenderer.highlightedSeriesIndex;
+ if (idx != null && plot.series[idx].highlightMouseDown) {
+ unhighlight(plot);
+ }
+ var evt = jQuery.Event('jqplotDataRightClick');
+ evt.which = ev.which;
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ plot.target.trigger(evt, ins);
+ }
+ }
+
+
+ // class: $.jqplot.LinearAxisRenderer
+ // The default jqPlot axis renderer, creating a numeric axis.
+ $.jqplot.LinearAxisRenderer = function() {
+ };
+
+ // called with scope of axis object.
+ $.jqplot.LinearAxisRenderer.prototype.init = function(options){
+ // prop: breakPoints
+ // EXPERIMENTAL!! Use at your own risk!
+ // Works only with linear axes and the default tick renderer.
+ // Array of [start, stop] points to create a broken axis.
+ // Broken axes have a "jump" in them, which is an immediate
+ // transition from a smaller value to a larger value.
+ // Currently, axis ticks MUST be manually assigned if using breakPoints
+ // by using the axis ticks array option.
+ this.breakPoints = null;
+ // prop: breakTickLabel
+ // Label to use at the axis break if breakPoints are specified.
+ this.breakTickLabel = "≈";
+ // prop: drawBaseline
+ // True to draw the axis baseline.
+ this.drawBaseline = true;
+ // prop: baselineWidth
+ // width of the baseline in pixels.
+ this.baselineWidth = null;
+ // prop: baselineColor
+ // CSS color spec for the baseline.
+ this.baselineColor = null;
+ // prop: forceTickAt0
+ // This will ensure that there is always a tick mark at 0.
+ // If data range is strictly positive or negative,
+ // this will force 0 to be inside the axis bounds unless
+ // the appropriate axis pad (pad, padMin or padMax) is set
+ // to 0, then this will force an axis min or max value at 0.
+ // This has know effect when any of the following options
+ // are set: autoscale, min, max, numberTicks or tickInterval.
+ this.forceTickAt0 = false;
+ // prop: forceTickAt100
+ // This will ensure that there is always a tick mark at 100.
+ // If data range is strictly above or below 100,
+ // this will force 100 to be inside the axis bounds unless
+ // the appropriate axis pad (pad, padMin or padMax) is set
+ // to 0, then this will force an axis min or max value at 100.
+ // This has know effect when any of the following options
+ // are set: autoscale, min, max, numberTicks or tickInterval.
+ this.forceTickAt100 = false;
+ // prop: tickInset
+ // Controls the amount to inset the first and last ticks from
+ // the edges of the grid, in multiples of the tick interval.
+ // 0 is no inset, 0.5 is one half a tick interval, 1 is a full
+ // tick interval, etc.
+ this.tickInset = 0;
+ // prop: minorTicks
+ // Number of ticks to add between "major" ticks.
+ // Major ticks are ticks supplied by user or auto computed.
+ // Minor ticks cannot be created by user.
+ this.minorTicks = 0;
+ // prop: alignTicks
+ // true to align tick marks across opposed axes
+ // such as from the y2axis to yaxis.
+ this.alignTicks = false;
+ this._autoFormatString = '';
+ this._overrideFormatString = false;
+ this._scalefact = 1.0;
+ $.extend(true, this, options);
+ if (this.breakPoints) {
+ if (!$.isArray(this.breakPoints)) {
+ this.breakPoints = null;
+ }
+ else if (this.breakPoints.length < 2 || this.breakPoints[1] <= this.breakPoints[0]) {
+ this.breakPoints = null;
+ }
+ }
+ if (this.numberTicks != null && this.numberTicks < 2) {
+ this.numberTicks = 2;
+ }
+ this.resetDataBounds();
+ };
+
+ // called with scope of axis
+ $.jqplot.LinearAxisRenderer.prototype.draw = function(ctx, plot) {
+ if (this.show) {
+ // populate the axis label and value properties.
+ // createTicks is a method on the renderer, but
+ // call it within the scope of the axis.
+ this.renderer.createTicks.call(this, plot);
+ // fill a div with axes labels in the right direction.
+ // Need to pregenerate each axis to get it's bounds and
+ // position it and the labels correctly on the plot.
+ var dim=0;
+ var temp;
+ // Added for theming.
+ if (this._elem) {
+ // Memory Leaks patch
+ //this._elem.empty();
+ this._elem.emptyForce();
+ this._elem = null;
+ }
+
+ this._elem = $(document.createElement('div'));
+ this._elem.addClass('jqplot-axis jqplot-'+this.name);
+ this._elem.css('position', 'absolute');
+
+
+ if (this.name == 'xaxis' || this.name == 'x2axis') {
+ this._elem.width(this._plotDimensions.width);
+ }
+ else {
+ this._elem.height(this._plotDimensions.height);
+ }
+
+ // create a _label object.
+ this.labelOptions.axis = this.name;
+ this._label = new this.labelRenderer(this.labelOptions);
+ if (this._label.show) {
+ var elem = this._label.draw(ctx, plot);
+ elem.appendTo(this._elem);
+ elem = null;
+ }
+
+ var t = this._ticks;
+ var tick;
+ for (var i=0; i<t.length; i++) {
+ tick = t[i];
+ if (tick.show && tick.showLabel && (!tick.isMinorTick || this.showMinorTicks)) {
+ this._elem.append(tick.draw(ctx, plot));
+ }
+ }
+ tick = null;
+ t = null;
+ }
+ return this._elem;
+ };
+
+ // called with scope of an axis
+ $.jqplot.LinearAxisRenderer.prototype.reset = function() {
+ this.min = this._options.min;
+ this.max = this._options.max;
+ this.tickInterval = this._options.tickInterval;
+ this.numberTicks = this._options.numberTicks;
+ this._autoFormatString = '';
+ if (this._overrideFormatString && this.tickOptions && this.tickOptions.formatString) {
+ this.tickOptions.formatString = '';
+ }
+
+ // this._ticks = this.__ticks;
+ };
+
+ // called with scope of axis
+ $.jqplot.LinearAxisRenderer.prototype.set = function() {
+ var dim = 0;
+ var temp;
+ var w = 0;
+ var h = 0;
+ var lshow = (this._label == null) ? false : this._label.show;
+ if (this.show) {
+ var t = this._ticks;
+ var tick;
+ for (var i=0; i<t.length; i++) {
+ tick = t[i];
+ if (!tick._breakTick && tick.show && tick.showLabel && (!tick.isMinorTick || this.showMinorTicks)) {
+ if (this.name == 'xaxis' || this.name == 'x2axis') {
+ temp = tick._elem.outerHeight(true);
+ }
+ else {
+ temp = tick._elem.outerWidth(true);
+ }
+ if (temp > dim) {
+ dim = temp;
+ }
+ }
+ }
+ tick = null;
+ t = null;
+
+ if (lshow) {
+ w = this._label._elem.outerWidth(true);
+ h = this._label._elem.outerHeight(true);
+ }
+ if (this.name == 'xaxis') {
+ dim = dim + h;
+ this._elem.css({'height':dim+'px', left:'0px', bottom:'0px'});
+ }
+ else if (this.name == 'x2axis') {
+ dim = dim + h;
+ this._elem.css({'height':dim+'px', left:'0px', top:'0px'});
+ }
+ else if (this.name == 'yaxis') {
+ dim = dim + w;
+ this._elem.css({'width':dim+'px', left:'0px', top:'0px'});
+ if (lshow && this._label.constructor == $.jqplot.AxisLabelRenderer) {
+ this._label._elem.css('width', w+'px');
+ }
+ }
+ else {
+ dim = dim + w;
+ this._elem.css({'width':dim+'px', right:'0px', top:'0px'});
+ if (lshow && this._label.constructor == $.jqplot.AxisLabelRenderer) {
+ this._label._elem.css('width', w+'px');
+ }
+ }
+ }
+ };
+
+ // called with scope of axis
+ $.jqplot.LinearAxisRenderer.prototype.createTicks = function(plot) {
+ // we're are operating on an axis here
+ var ticks = this._ticks;
+ var userTicks = this.ticks;
+ var name = this.name;
+ // databounds were set on axis initialization.
+ var db = this._dataBounds;
+ var dim = (this.name.charAt(0) === 'x') ? this._plotDimensions.width : this._plotDimensions.height;
+ var interval;
+ var min, max;
+ var pos1, pos2;
+ var tt, i;
+ // get a copy of user's settings for min/max.
+ var userMin = this.min;
+ var userMax = this.max;
+ var userNT = this.numberTicks;
+ var userTI = this.tickInterval;
+
+ var threshold = 30;
+ this._scalefact = (Math.max(dim, threshold+1) - threshold)/300.0;
+
+ // if we already have ticks, use them.
+ // ticks must be in order of increasing value.
+
+ if (userTicks.length) {
+ // ticks could be 1D or 2D array of [val, val, ,,,] or [[val, label], [val, label], ...] or mixed
+ for (i=0; i<userTicks.length; i++){
+ var ut = userTicks[i];
+ var t = new this.tickRenderer(this.tickOptions);
+ if ($.isArray(ut)) {
+ t.value = ut[0];
+ if (this.breakPoints) {
+ if (ut[0] == this.breakPoints[0]) {
+ t.label = this.breakTickLabel;
+ t._breakTick = true;
+ t.showGridline = false;
+ t.showMark = false;
+ }
+ else if (ut[0] > this.breakPoints[0] && ut[0] <= this.breakPoints[1]) {
+ t.show = false;
+ t.showGridline = false;
+ t.label = ut[1];
+ }
+ else {
+ t.label = ut[1];
+ }
+ }
+ else {
+ t.label = ut[1];
+ }
+ t.setTick(ut[0], this.name);
+ this._ticks.push(t);
+ }
+
+ else if ($.isPlainObject(ut)) {
+ $.extend(true, t, ut);
+ t.axis = this.name;
+ this._ticks.push(t);
+ }
+
+ else {
+ t.value = ut;
+ if (this.breakPoints) {
+ if (ut == this.breakPoints[0]) {
+ t.label = this.breakTickLabel;
+ t._breakTick = true;
+ t.showGridline = false;
+ t.showMark = false;
+ }
+ else if (ut > this.breakPoints[0] && ut <= this.breakPoints[1]) {
+ t.show = false;
+ t.showGridline = false;
+ }
+ }
+ t.setTick(ut, this.name);
+ this._ticks.push(t);
+ }
+ }
+ this.numberTicks = userTicks.length;
+ this.min = this._ticks[0].value;
+ this.max = this._ticks[this.numberTicks-1].value;
+ this.tickInterval = (this.max - this.min) / (this.numberTicks - 1);
+ }
+
+ // we don't have any ticks yet, let's make some!
+ else {
+ if (name == 'xaxis' || name == 'x2axis') {
+ dim = this._plotDimensions.width;
+ }
+ else {
+ dim = this._plotDimensions.height;
+ }
+
+ var _numberTicks = this.numberTicks;
+
+ // if aligning this axis, use number of ticks from previous axis.
+ // Do I need to reset somehow if alignTicks is changed and then graph is replotted??
+ if (this.alignTicks) {
+ if (this.name === 'x2axis' && plot.axes.xaxis.show) {
+ _numberTicks = plot.axes.xaxis.numberTicks;
+ }
+ else if (this.name.charAt(0) === 'y' && this.name !== 'yaxis' && this.name !== 'yMidAxis' && plot.axes.yaxis.show) {
+ _numberTicks = plot.axes.yaxis.numberTicks;
+ }
+ }
+
+ min = ((this.min != null) ? this.min : db.min);
+ max = ((this.max != null) ? this.max : db.max);
+
+ var range = max - min;
+ var rmin, rmax;
+ var temp;
+
+ if (this.tickOptions == null || !this.tickOptions.formatString) {
+ this._overrideFormatString = true;
+ }
+
+ // Doing complete autoscaling
+ if (this.min == null || this.max == null && this.tickInterval == null && !this.autoscale) {
+ // Check if user must have tick at 0 or 100 and ensure they are in range.
+ // The autoscaling algorithm will always place ticks at 0 and 100 if they are in range.
+ if (this.forceTickAt0) {
+ if (min > 0) {
+ min = 0;
+ }
+ if (max < 0) {
+ max = 0;
+ }
+ }
+
+ if (this.forceTickAt100) {
+ if (min > 100) {
+ min = 100;
+ }
+ if (max < 100) {
+ max = 100;
+ }
+ }
+
+ var keepMin = false,
+ keepMax = false;
+
+ if (this.min != null) {
+ keepMin = true;
+ }
+
+ else if (this.max != null) {
+ keepMax = true;
+ }
+
+ // var threshold = 30;
+ // var tdim = Math.max(dim, threshold+1);
+ // this._scalefact = (tdim-threshold)/300.0;
+ var ret = $.jqplot.LinearTickGenerator(min, max, this._scalefact, _numberTicks, keepMin, keepMax);
+ // calculate a padded max and min, points should be less than these
+ // so that they aren't too close to the edges of the plot.
+ // User can adjust how much padding is allowed with pad, padMin and PadMax options.
+ // If min or max is set, don't pad that end of axis.
+ var tumin = (this.min != null) ? min : min + range*(this.padMin - 1);
+ var tumax = (this.max != null) ? max : max - range*(this.padMax - 1);
+
+ // if they're equal, we shouldn't have to do anything, right?
+ // if (min <=tumin || max >= tumax) {
+ if (min <tumin || max > tumax) {
+ tumin = (this.min != null) ? min : min - range*(this.padMin - 1);
+ tumax = (this.max != null) ? max : max + range*(this.padMax - 1);
+ ret = $.jqplot.LinearTickGenerator(tumin, tumax, this._scalefact, _numberTicks, keepMin, keepMax);
+ }
+
+ this.min = ret[0];
+ this.max = ret[1];
+ // if numberTicks specified, it should return the same.
+ this.numberTicks = ret[2];
+ this._autoFormatString = ret[3];
+ this.tickInterval = ret[4];
+ }
+
+ // User has specified some axis scale related option, can use auto algorithm
+ else {
+
+ // if min and max are same, space them out a bit
+ if (min == max) {
+ var adj = 0.05;
+ if (min > 0) {
+ adj = Math.max(Math.log(min)/Math.LN10, 0.05);
+ }
+ min -= adj;
+ max += adj;
+ }
+
+ // autoscale. Can't autoscale if min or max is supplied.
+ // Will use numberTicks and tickInterval if supplied. Ticks
+ // across multiple axes may not line up depending on how
+ // bars are to be plotted.
+ if (this.autoscale && this.min == null && this.max == null) {
+ var rrange, ti, margin;
+ var forceMinZero = false;
+ var forceZeroLine = false;
+ var intervals = {min:null, max:null, average:null, stddev:null};
+ // if any series are bars, or if any are fill to zero, and if this
+ // is the axis to fill toward, check to see if we can start axis at zero.
+ for (var i=0; i<this._series.length; i++) {
+ var s = this._series[i];
+ var faname = (s.fillAxis == 'x') ? s._xaxis.name : s._yaxis.name;
+ // check to see if this is the fill axis
+ if (this.name == faname) {
+ var vals = s._plotValues[s.fillAxis];
+ var vmin = vals[0];
+ var vmax = vals[0];
+ for (var j=1; j<vals.length; j++) {
+ if (vals[j] < vmin) {
+ vmin = vals[j];
+ }
+ else if (vals[j] > vmax) {
+ vmax = vals[j];
+ }
+ }
+ var dp = (vmax - vmin) / vmax;
+ // is this sries a bar?
+ if (s.renderer.constructor == $.jqplot.BarRenderer) {
+ // if no negative values and could also check range.
+ if (vmin >= 0 && (s.fillToZero || dp > 0.1)) {
+ forceMinZero = true;
+ }
+ else {
+ forceMinZero = false;
+ if (s.fill && s.fillToZero && vmin < 0 && vmax > 0) {
+ forceZeroLine = true;
+ }
+ else {
+ forceZeroLine = false;
+ }
+ }
+ }
+
+ // if not a bar and filling, use appropriate method.
+ else if (s.fill) {
+ if (vmin >= 0 && (s.fillToZero || dp > 0.1)) {
+ forceMinZero = true;
+ }
+ else if (vmin < 0 && vmax > 0 && s.fillToZero) {
+ forceMinZero = false;
+ forceZeroLine = true;
+ }
+ else {
+ forceMinZero = false;
+ forceZeroLine = false;
+ }
+ }
+
+ // if not a bar and not filling, only change existing state
+ // if it doesn't make sense
+ else if (vmin < 0) {
+ forceMinZero = false;
+ }
+ }
+ }
+
+ // check if we need make axis min at 0.
+ if (forceMinZero) {
+ // compute number of ticks
+ this.numberTicks = 2 + Math.ceil((dim-(this.tickSpacing-1))/this.tickSpacing);
+ this.min = 0;
+ userMin = 0;
+ // what order is this range?
+ // what tick interval does that give us?
+ ti = max/(this.numberTicks-1);
+ temp = Math.pow(10, Math.abs(Math.floor(Math.log(ti)/Math.LN10)));
+ if (ti/temp == parseInt(ti/temp, 10)) {
+ ti += temp;
+ }
+ this.tickInterval = Math.ceil(ti/temp) * temp;
+ this.max = this.tickInterval * (this.numberTicks - 1);
+ }
+
+ // check if we need to make sure there is a tick at 0.
+ else if (forceZeroLine) {
+ // compute number of ticks
+ this.numberTicks = 2 + Math.ceil((dim-(this.tickSpacing-1))/this.tickSpacing);
+ var ntmin = Math.ceil(Math.abs(min)/range*(this.numberTicks-1));
+ var ntmax = this.numberTicks - 1 - ntmin;
+ ti = Math.max(Math.abs(min/ntmin), Math.abs(max/ntmax));
+ temp = Math.pow(10, Math.abs(Math.floor(Math.log(ti)/Math.LN10)));
+ this.tickInterval = Math.ceil(ti/temp) * temp;
+ this.max = this.tickInterval * ntmax;
+ this.min = -this.tickInterval * ntmin;
+ }
+
+ // if nothing else, do autoscaling which will try to line up ticks across axes.
+ else {
+ if (this.numberTicks == null){
+ if (this.tickInterval) {
+ this.numberTicks = 3 + Math.ceil(range / this.tickInterval);
+ }
+ else {
+ this.numberTicks = 2 + Math.ceil((dim-(this.tickSpacing-1))/this.tickSpacing);
+ }
+ }
+
+ if (this.tickInterval == null) {
+ // get a tick interval
+ ti = range/(this.numberTicks - 1);
+
+ if (ti < 1) {
+ temp = Math.pow(10, Math.abs(Math.floor(Math.log(ti)/Math.LN10)));
+ }
+ else {
+ temp = 1;
+ }
+ this.tickInterval = Math.ceil(ti*temp*this.pad)/temp;
+ }
+ else {
+ temp = 1 / this.tickInterval;
+ }
+
+ // try to compute a nicer, more even tick interval
+ // temp = Math.pow(10, Math.floor(Math.log(ti)/Math.LN10));
+ // this.tickInterval = Math.ceil(ti/temp) * temp;
+ rrange = this.tickInterval * (this.numberTicks - 1);
+ margin = (rrange - range)/2;
+
+ if (this.min == null) {
+ this.min = Math.floor(temp*(min-margin))/temp;
+ }
+ if (this.max == null) {
+ this.max = this.min + rrange;
+ }
+ }
+
+ // Compute a somewhat decent format string if it is needed.
+ // get precision of interval and determine a format string.
+ var sf = $.jqplot.getSignificantFigures(this.tickInterval);
+
+ var fstr;
+
+ // if we have only a whole number, use integer formatting
+ if (sf.digitsLeft >= sf.significantDigits) {
+ fstr = '%d';
+ }
+
+ else {
+ var temp = Math.max(0, 5 - sf.digitsLeft);
+ temp = Math.min(temp, sf.digitsRight);
+ fstr = '%.'+ temp + 'f';
+ }
+
+ this._autoFormatString = fstr;
+ }
+
+ // Use the default algorithm which pads each axis to make the chart
+ // centered nicely on the grid.
+ else {
+
+ rmin = (this.min != null) ? this.min : min - range*(this.padMin - 1);
+ rmax = (this.max != null) ? this.max : max + range*(this.padMax - 1);
+ range = rmax - rmin;
+
+ if (this.numberTicks == null){
+ // if tickInterval is specified by user, we will ignore computed maximum.
+ // max will be equal or greater to fit even # of ticks.
+ if (this.tickInterval != null) {
+ this.numberTicks = Math.ceil((rmax - rmin)/this.tickInterval)+1;
+ }
+ else if (dim > 100) {
+ this.numberTicks = parseInt(3+(dim-100)/75, 10);
+ }
+ else {
+ this.numberTicks = 2;
+ }
+ }
+
+ if (this.tickInterval == null) {
+ this.tickInterval = range / (this.numberTicks-1);
+ }
+
+ if (this.max == null) {
+ rmax = rmin + this.tickInterval*(this.numberTicks - 1);
+ }
+ if (this.min == null) {
+ rmin = rmax - this.tickInterval*(this.numberTicks - 1);
+ }
+
+ // get precision of interval and determine a format string.
+ var sf = $.jqplot.getSignificantFigures(this.tickInterval);
+
+ var fstr;
+
+ // if we have only a whole number, use integer formatting
+ if (sf.digitsLeft >= sf.significantDigits) {
+ fstr = '%d';
+ }
+
+ else {
+ var temp = Math.max(0, 5 - sf.digitsLeft);
+ temp = Math.min(temp, sf.digitsRight);
+ fstr = '%.'+ temp + 'f';
+ }
+
+
+ this._autoFormatString = fstr;
+
+ this.min = rmin;
+ this.max = rmax;
+ }
+
+ if (this.renderer.constructor == $.jqplot.LinearAxisRenderer && this._autoFormatString == '') {
+ // fix for misleading tick display with small range and low precision.
+ range = this.max - this.min;
+ // figure out precision
+ var temptick = new this.tickRenderer(this.tickOptions);
+ // use the tick formatString or, the default.
+ var fs = temptick.formatString || $.jqplot.config.defaultTickFormatString;
+ var fs = fs.match($.jqplot.sprintf.regex)[0];
+ var precision = 0;
+ if (fs) {
+ if (fs.search(/[fFeEgGpP]/) > -1) {
+ var m = fs.match(/\%\.(\d{0,})?[eEfFgGpP]/);
+ if (m) {
+ precision = parseInt(m[1], 10);
+ }
+ else {
+ precision = 6;
+ }
+ }
+ else if (fs.search(/[di]/) > -1) {
+ precision = 0;
+ }
+ // fact will be <= 1;
+ var fact = Math.pow(10, -precision);
+ if (this.tickInterval < fact) {
+ // need to correct underrange
+ if (userNT == null && userTI == null) {
+ this.tickInterval = fact;
+ if (userMax == null && userMin == null) {
+ // this.min = Math.floor((this._dataBounds.min - this.tickInterval)/fact) * fact;
+ this.min = Math.floor(this._dataBounds.min/fact) * fact;
+ if (this.min == this._dataBounds.min) {
+ this.min = this._dataBounds.min - this.tickInterval;
+ }
+ // this.max = Math.ceil((this._dataBounds.max + this.tickInterval)/fact) * fact;
+ this.max = Math.ceil(this._dataBounds.max/fact) * fact;
+ if (this.max == this._dataBounds.max) {
+ this.max = this._dataBounds.max + this.tickInterval;
+ }
+ var n = (this.max - this.min)/this.tickInterval;
+ n = n.toFixed(11);
+ n = Math.ceil(n);
+ this.numberTicks = n + 1;
+ }
+ else if (userMax == null) {
+ // add one tick for top of range.
+ var n = (this._dataBounds.max - this.min) / this.tickInterval;
+ n = n.toFixed(11);
+ this.numberTicks = Math.ceil(n) + 2;
+ this.max = this.min + this.tickInterval * (this.numberTicks-1);
+ }
+ else if (userMin == null) {
+ // add one tick for bottom of range.
+ var n = (this.max - this._dataBounds.min) / this.tickInterval;
+ n = n.toFixed(11);
+ this.numberTicks = Math.ceil(n) + 2;
+ this.min = this.max - this.tickInterval * (this.numberTicks-1);
+ }
+ else {
+ // calculate a number of ticks so max is within axis scale
+ this.numberTicks = Math.ceil((userMax - userMin)/this.tickInterval) + 1;
+ // if user's min and max don't fit evenly in ticks, adjust.
+ // This takes care of cases such as user min set to 0, max set to 3.5 but tick
+ // format string set to %d (integer ticks)
+ this.min = Math.floor(userMin*Math.pow(10, precision))/Math.pow(10, precision);
+ this.max = Math.ceil(userMax*Math.pow(10, precision))/Math.pow(10, precision);
+ // this.max = this.min + this.tickInterval*(this.numberTicks-1);
+ this.numberTicks = Math.ceil((this.max - this.min)/this.tickInterval) + 1;
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+ if (this._overrideFormatString && this._autoFormatString != '') {
+ this.tickOptions = this.tickOptions || {};
+ this.tickOptions.formatString = this._autoFormatString;
+ }
+
+ var t, to;
+ for (var i=0; i<this.numberTicks; i++){
+ tt = this.min + i * this.tickInterval;
+ t = new this.tickRenderer(this.tickOptions);
+ // var t = new $.jqplot.AxisTickRenderer(this.tickOptions);
+
+ t.setTick(tt, this.name);
+ this._ticks.push(t);
+
+ if (i < this.numberTicks - 1) {
+ for (var j=0; j<this.minorTicks; j++) {
+ tt += this.tickInterval/(this.minorTicks+1);
+ to = $.extend(true, {}, this.tickOptions, {name:this.name, value:tt, label:'', isMinorTick:true});
+ t = new this.tickRenderer(to);
+ this._ticks.push(t);
+ }
+ }
+ t = null;
+ }
+ }
+
+ if (this.tickInset) {
+ this.min = this.min - this.tickInset * this.tickInterval;
+ this.max = this.max + this.tickInset * this.tickInterval;
+ }
+
+ ticks = null;
+ };
+
+ // Used to reset just the values of the ticks and then repack, which will
+ // recalculate the positioning functions. It is assuemd that the
+ // number of ticks is the same and the values of the new array are at the
+ // proper interval.
+ // This method needs to be called with the scope of an axis object, like:
+ //
+ // > plot.axes.yaxis.renderer.resetTickValues.call(plot.axes.yaxis, yarr);
+ //
+ $.jqplot.LinearAxisRenderer.prototype.resetTickValues = function(opts) {
+ if ($.isArray(opts) && opts.length == this._ticks.length) {
+ var t;
+ for (var i=0; i<opts.length; i++) {
+ t = this._ticks[i];
+ t.value = opts[i];
+ t.label = t.formatter(t.formatString, opts[i]);
+ t.label = t.prefix + t.label;
+ t._elem.html(t.label);
+ }
+ t = null;
+ this.min = $.jqplot.arrayMin(opts);
+ this.max = $.jqplot.arrayMax(opts);
+ this.pack();
+ }
+ // Not implemented yet.
+ // else if ($.isPlainObject(opts)) {
+ //
+ // }
+ };
+
+ // called with scope of axis
+ $.jqplot.LinearAxisRenderer.prototype.pack = function(pos, offsets) {
+ // Add defaults for repacking from resetTickValues function.
+ pos = pos || {};
+ offsets = offsets || this._offsets;
+
+ var ticks = this._ticks;
+ var max = this.max;
+ var min = this.min;
+ var offmax = offsets.max;
+ var offmin = offsets.min;
+ var lshow = (this._label == null) ? false : this._label.show;
+
+ for (var p in pos) {
+ this._elem.css(p, pos[p]);
+ }
+
+ this._offsets = offsets;
+ // pixellength will be + for x axes and - for y axes becasue pixels always measured from top left.
+ var pixellength = offmax - offmin;
+ var unitlength = max - min;
+
+ // point to unit and unit to point conversions references to Plot DOM element top left corner.
+ if (this.breakPoints) {
+ unitlength = unitlength - this.breakPoints[1] + this.breakPoints[0];
+
+ this.p2u = function(p){
+ return (p - offmin) * unitlength / pixellength + min;
+ };
+
+ this.u2p = function(u){
+ if (u > this.breakPoints[0] && u < this.breakPoints[1]){
+ u = this.breakPoints[0];
+ }
+ if (u <= this.breakPoints[0]) {
+ return (u - min) * pixellength / unitlength + offmin;
+ }
+ else {
+ return (u - this.breakPoints[1] + this.breakPoints[0] - min) * pixellength / unitlength + offmin;
+ }
+ };
+
+ if (this.name.charAt(0) == 'x'){
+ this.series_u2p = function(u){
+ if (u > this.breakPoints[0] && u < this.breakPoints[1]){
+ u = this.breakPoints[0];
+ }
+ if (u <= this.breakPoints[0]) {
+ return (u - min) * pixellength / unitlength;
+ }
+ else {
+ return (u - this.breakPoints[1] + this.breakPoints[0] - min) * pixellength / unitlength;
+ }
+ };
+ this.series_p2u = function(p){
+ return p * unitlength / pixellength + min;
+ };
+ }
+
+ else {
+ this.series_u2p = function(u){
+ if (u > this.breakPoints[0] && u < this.breakPoints[1]){
+ u = this.breakPoints[0];
+ }
+ if (u >= this.breakPoints[1]) {
+ return (u - max) * pixellength / unitlength;
+ }
+ else {
+ return (u + this.breakPoints[1] - this.breakPoints[0] - max) * pixellength / unitlength;
+ }
+ };
+ this.series_p2u = function(p){
+ return p * unitlength / pixellength + max;
+ };
+ }
+ }
+ else {
+ this.p2u = function(p){
+ return (p - offmin) * unitlength / pixellength + min;
+ };
+
+ this.u2p = function(u){
+ return (u - min) * pixellength / unitlength + offmin;
+ };
+
+ if (this.name == 'xaxis' || this.name == 'x2axis'){
+ this.series_u2p = function(u){
+ return (u - min) * pixellength / unitlength;
+ };
+ this.series_p2u = function(p){
+ return p * unitlength / pixellength + min;
+ };
+ }
+
+ else {
+ this.series_u2p = function(u){
+ return (u - max) * pixellength / unitlength;
+ };
+ this.series_p2u = function(p){
+ return p * unitlength / pixellength + max;
+ };
+ }
+ }
+
+ if (this.show) {
+ if (this.name == 'xaxis' || this.name == 'x2axis') {
+ for (var i=0; i<ticks.length; i++) {
+ var t = ticks[i];
+ if (t.show && t.showLabel) {
+ var shim;
+
+ if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) {
+ // will need to adjust auto positioning based on which axis this is.
+ var temp = (this.name == 'xaxis') ? 1 : -1;
+ switch (t.labelPosition) {
+ case 'auto':
+ // position at end
+ if (temp * t.angle < 0) {
+ shim = -t.getWidth() + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
+ }
+ // position at start
+ else {
+ shim = -t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
+ }
+ break;
+ case 'end':
+ shim = -t.getWidth() + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
+ break;
+ case 'start':
+ shim = -t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
+ break;
+ case 'middle':
+ shim = -t.getWidth()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
+ break;
+ default:
+ shim = -t.getWidth()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
+ break;
+ }
+ }
+ else {
+ shim = -t.getWidth()/2;
+ }
+ var val = this.u2p(t.value) + shim + 'px';
+ t._elem.css('left', val);
+ t.pack();
+ }
+ }
+ if (lshow) {
+ var w = this._label._elem.outerWidth(true);
+ this._label._elem.css('left', offmin + pixellength/2 - w/2 + 'px');
+ if (this.name == 'xaxis') {
+ this._label._elem.css('bottom', '0px');
+ }
+ else {
+ this._label._elem.css('top', '0px');
+ }
+ this._label.pack();
+ }
+ }
+ else {
+ for (var i=0; i<ticks.length; i++) {
+ var t = ticks[i];
+ if (t.show && t.showLabel) {
+ var shim;
+ if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) {
+ // will need to adjust auto positioning based on which axis this is.
+ var temp = (this.name == 'yaxis') ? 1 : -1;
+ switch (t.labelPosition) {
+ case 'auto':
+ // position at end
+ case 'end':
+ if (temp * t.angle < 0) {
+ shim = -t._textRenderer.height * Math.cos(-t._textRenderer.angle) / 2;
+ }
+ else {
+ shim = -t.getHeight() + t._textRenderer.height * Math.cos(t._textRenderer.angle) / 2;
+ }
+ break;
+ case 'start':
+ if (t.angle > 0) {
+ shim = -t._textRenderer.height * Math.cos(-t._textRenderer.angle) / 2;
+ }
+ else {
+ shim = -t.getHeight() + t._textRenderer.height * Math.cos(t._textRenderer.angle) / 2;
+ }
+ break;
+ case 'middle':
+ // if (t.angle > 0) {
+ // shim = -t.getHeight()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
+ // }
+ // else {
+ // shim = -t.getHeight()/2 - t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
+ // }
+ shim = -t.getHeight()/2;
+ break;
+ default:
+ shim = -t.getHeight()/2;
+ break;
+ }
+ }
+ else {
+ shim = -t.getHeight()/2;
+ }
+
+ var val = this.u2p(t.value) + shim + 'px';
+ t._elem.css('top', val);
+ t.pack();
+ }
+ }
+ if (lshow) {
+ var h = this._label._elem.outerHeight(true);
+ this._label._elem.css('top', offmax - pixellength/2 - h/2 + 'px');
+ if (this.name == 'yaxis') {
+ this._label._elem.css('left', '0px');
+ }
+ else {
+ this._label._elem.css('right', '0px');
+ }
+ this._label.pack();
+ }
+ }
+ }
+
+ ticks = null;
+ };
+
+
+ /**
+ * The following code was generaously given to me a while back by Scott Prahl.
+ * He did a good job at computing axes min, max and number of ticks for the
+ * case where the user has not set any scale related parameters (tickInterval,
+ * numberTicks, min or max). I had ignored this use case for a long time,
+ * focusing on the more difficult case where user has set some option controlling
+ * tick generation. Anyway, about time I got this into jqPlot.
+ * Thanks Scott!!
+ */
+
+ /**
+ * Copyright (c) 2010 Scott Prahl
+ * The next three routines are currently available for use in all personal
+ * or commercial projects under both the MIT and GPL version 2.0 licenses.
+ * This means that you can choose the license that best suits your project
+ * and use it accordingly.
+ */
+
+ // A good format string depends on the interval. If the interval is greater
+ // than 1 then there is no need to show any decimal digits. If it is < 1.0, then
+ // use the magnitude of the interval to determine the number of digits to show.
+ function bestFormatString (interval)
+ {
+ var fstr;
+ interval = Math.abs(interval);
+ if (interval >= 10) {
+ fstr = '%d';
+ }
+
+ else if (interval > 1) {
+ if (interval === parseInt(interval, 10)) {
+ fstr = '%d';
+ }
+ else {
+ fstr = '%.1f';
+ }
+ }
+
+ else {
+ var expv = -Math.floor(Math.log(interval)/Math.LN10);
+ fstr = '%.' + expv + 'f';
+ }
+
+ return fstr;
+ }
+
+ var _factors = [0.1, 0.2, 0.3, 0.4, 0.5, 0.8, 1, 2, 3, 4, 5];
+
+ var _getLowerFactor = function(f) {
+ var i = _factors.indexOf(f);
+ if (i > 0) {
+ return _factors[i-1];
+ }
+ else {
+ return _factors[_factors.length - 1] / 100;
+ }
+ };
+
+ var _getHigherFactor = function(f) {
+ var i = _factors.indexOf(f);
+ if (i < _factors.length-1) {
+ return _factors[i+1];
+ }
+ else {
+ return _factors[0] * 100;
+ }
+ };
+
+ // Given a fixed minimum and maximum and a target number ot ticks
+ // figure out the best interval and
+ // return min, max, number ticks, format string and tick interval
+ function bestConstrainedInterval(min, max, nttarget) {
+ // run through possible number to ticks and see which interval is best
+ var low = Math.floor(nttarget/2);
+ var hi = Math.ceil(nttarget*1.5);
+ var badness = Number.MAX_VALUE;
+ var r = (max - min);
+ var temp;
+ var sd;
+ var bestNT;
+ var gsf = $.jqplot.getSignificantFigures;
+ var fsd;
+ var fs;
+ var currentNT;
+ var bestPrec;
+
+ for (var i=0, l=hi-low+1; i<l; i++) {
+ currentNT = low + i;
+ temp = r/(currentNT-1);
+ sd = gsf(temp);
+
+ temp = Math.abs(nttarget - currentNT) + sd.digitsRight;
+ if (temp < badness) {
+ badness = temp;
+ bestNT = currentNT;
+ bestPrec = sd.digitsRight;
+ }
+ else if (temp === badness) {
+ // let nicer ticks trump number ot ticks
+ if (sd.digitsRight < bestPrec) {
+ bestNT = currentNT;
+ bestPrec = sd.digitsRight;
+ }
+ }
+
+ }
+
+ fsd = Math.max(bestPrec, Math.max(gsf(min).digitsRight, gsf(max).digitsRight));
+ if (fsd === 0) {
+ fs = '%d';
+ }
+ else {
+ fs = '%.' + fsd + 'f';
+ }
+ temp = r / (bestNT - 1);
+ // min, max, number ticks, format string, tick interval
+ return [min, max, bestNT, fs, temp];
+ }
+
+ // This will return an interval of form 2 * 10^n, 5 * 10^n or 10 * 10^n
+ // it is based soley on the range and number of ticks. So if user specifies
+ // number of ticks, use this.
+ function bestInterval(range, numberTicks) {
+ numberTicks = numberTicks || 7;
+ var minimum = range / (numberTicks - 1);
+ var magnitude = Math.pow(10, Math.floor(Math.log(minimum) / Math.LN10));
+ var residual = minimum / magnitude;
+ var interval;
+ // "nicest" ranges are 1, 2, 5 or powers of these.
+ // for magnitudes below 1, only allow these.
+ if (magnitude < 1) {
+ if (residual > 5) {
+ interval = 10 * magnitude;
+ }
+ else if (residual > 2) {
+ interval = 5 * magnitude;
+ }
+ else if (residual > 1) {
+ interval = 2 * magnitude;
+ }
+ else {
+ interval = magnitude;
+ }
+ }
+ // for large ranges (whole integers), allow intervals like 3, 4 or powers of these.
+ // this helps a lot with poor choices for number of ticks.
+ else {
+ if (residual > 5) {
+ interval = 10 * magnitude;
+ }
+ else if (residual > 4) {
+ interval = 5 * magnitude;
+ }
+ else if (residual > 3) {
+ interval = 4 * magnitude;
+ }
+ else if (residual > 2) {
+ interval = 3 * magnitude;
+ }
+ else if (residual > 1) {
+ interval = 2 * magnitude;
+ }
+ else {
+ interval = magnitude;
+ }
+ }
+
+ return interval;
+ }
+
+ // This will return an interval of form 2 * 10^n, 5 * 10^n or 10 * 10^n
+ // it is based soley on the range of data, number of ticks must be computed later.
+ function bestLinearInterval(range, scalefact) {
+ scalefact = scalefact || 1;
+ var expv = Math.floor(Math.log(range)/Math.LN10);
+ var magnitude = Math.pow(10, expv);
+ // 0 < f < 10
+ var f = range / magnitude;
+ var fact;
+ // for large plots, scalefact will decrease f and increase number of ticks.
+ // for small plots, scalefact will increase f and decrease number of ticks.
+ f = f/scalefact;
+
+ // for large plots, smaller interval, more ticks.
+ if (f<=0.38) {
+ fact = 0.1;
+ }
+ else if (f<=1.6) {
+ fact = 0.2;
+ }
+ else if (f<=4.0) {
+ fact = 0.5;
+ }
+ else if (f<=8.0) {
+ fact = 1.0;
+ }
+ // for very small plots, larger interval, less ticks in number ticks
+ else if (f<=16.0) {
+ fact = 2;
+ }
+ else {
+ fact = 5;
+ }
+
+ return fact*magnitude;
+ }
+
+ function bestLinearComponents(range, scalefact) {
+ var expv = Math.floor(Math.log(range)/Math.LN10);
+ var magnitude = Math.pow(10, expv);
+ // 0 < f < 10
+ var f = range / magnitude;
+ var interval;
+ var fact;
+ // for large plots, scalefact will decrease f and increase number of ticks.
+ // for small plots, scalefact will increase f and decrease number of ticks.
+ f = f/scalefact;
+
+ // for large plots, smaller interval, more ticks.
+ if (f<=0.38) {
+ fact = 0.1;
+ }
+ else if (f<=1.6) {
+ fact = 0.2;
+ }
+ else if (f<=4.0) {
+ fact = 0.5;
+ }
+ else if (f<=8.0) {
+ fact = 1.0;
+ }
+ // for very small plots, larger interval, less ticks in number ticks
+ else if (f<=16.0) {
+ fact = 2;
+ }
+ // else if (f<=20.0) {
+ // fact = 3;
+ // }
+ // else if (f<=24.0) {
+ // fact = 4;
+ // }
+ else {
+ fact = 5;
+ }
+
+ interval = fact * magnitude;
+
+ return [interval, fact, magnitude];
+ }
+
+ // Given the min and max for a dataset, return suitable endpoints
+ // for the graphing, a good number for the number of ticks, and a
+ // format string so that extraneous digits are not displayed.
+ // returned is an array containing [min, max, nTicks, format]
+ $.jqplot.LinearTickGenerator = function(axis_min, axis_max, scalefact, numberTicks, keepMin, keepMax) {
+ // Set to preserve EITHER min OR max.
+ // If min is preserved, max must be free.
+ keepMin = (keepMin === null) ? false : keepMin;
+ keepMax = (keepMax === null || keepMin) ? false : keepMax;
+ // if endpoints are equal try to include zero otherwise include one
+ if (axis_min === axis_max) {
+ axis_max = (axis_max) ? 0 : 1;
+ }
+
+ scalefact = scalefact || 1.0;
+
+ // make sure range is positive
+ if (axis_max < axis_min) {
+ var a = axis_max;
+ axis_max = axis_min;
+ axis_min = a;
+ }
+
+ var r = [];
+ var ss = bestLinearInterval(axis_max - axis_min, scalefact);
+
+ var gsf = $.jqplot.getSignificantFigures;
+
+ if (numberTicks == null) {
+
+ // Figure out the axis min, max and number of ticks
+ // the min and max will be some multiple of the tick interval,
+ // 1*10^n, 2*10^n or 5*10^n. This gaurantees that, if the
+ // axis min is negative, 0 will be a tick.
+ if (!keepMin && !keepMax) {
+ r[0] = Math.floor(axis_min / ss) * ss; // min
+ r[1] = Math.ceil(axis_max / ss) * ss; // max
+ r[2] = Math.round((r[1]-r[0])/ss+1.0); // number of ticks
+ r[3] = bestFormatString(ss); // format string
+ r[4] = ss; // tick Interval
+ }
+
+ else if (keepMin) {
+ r[0] = axis_min; // min
+ r[2] = Math.ceil((axis_max - axis_min) / ss + 1.0); // number of ticks
+ r[1] = axis_min + (r[2] - 1) * ss; // max
+ var digitsMin = gsf(axis_min).digitsRight;
+ var digitsSS = gsf(ss).digitsRight;
+ if (digitsMin < digitsSS) {
+ r[3] = bestFormatString(ss); // format string
+ }
+ else {
+ r[3] = '%.' + digitsMin + 'f';
+ }
+ r[4] = ss; // tick Interval
+ }
+
+ else if (keepMax) {
+ r[1] = axis_max; // max
+ r[2] = Math.ceil((axis_max - axis_min) / ss + 1.0); // number of ticks
+ r[0] = axis_max - (r[2] - 1) * ss; // min
+ var digitsMax = gsf(axis_max).digitsRight;
+ var digitsSS = gsf(ss).digitsRight;
+ if (digitsMax < digitsSS) {
+ r[3] = bestFormatString(ss); // format string
+ }
+ else {
+ r[3] = '%.' + digitsMax + 'f';
+ }
+ r[4] = ss; // tick Interval
+ }
+ }
+
+ else {
+ var tempr = [];
+
+ // Figure out the axis min, max and number of ticks
+ // the min and max will be some multiple of the tick interval,
+ // 1*10^n, 2*10^n or 5*10^n. This gaurantees that, if the
+ // axis min is negative, 0 will be a tick.
+ tempr[0] = Math.floor(axis_min / ss) * ss; // min
+ tempr[1] = Math.ceil(axis_max / ss) * ss; // max
+ tempr[2] = Math.round((tempr[1]-tempr[0])/ss+1.0); // number of ticks
+ tempr[3] = bestFormatString(ss); // format string
+ tempr[4] = ss; // tick Interval
+
+ // first, see if we happen to get the right number of ticks
+ if (tempr[2] === numberTicks) {
+ r = tempr;
+ }
+
+ else {
+
+ var newti = bestInterval(tempr[1] - tempr[0], numberTicks);
+
+ r[0] = tempr[0]; // min
+ r[2] = numberTicks; // number of ticks
+ r[4] = newti; // tick interval
+ r[3] = bestFormatString(newti); // format string
+ r[1] = r[0] + (r[2] - 1) * r[4]; // max
+ }
+ }
+
+ return r;
+ };
+
+ $.jqplot.LinearTickGenerator.bestLinearInterval = bestLinearInterval;
+ $.jqplot.LinearTickGenerator.bestInterval = bestInterval;
+ $.jqplot.LinearTickGenerator.bestLinearComponents = bestLinearComponents;
+ $.jqplot.LinearTickGenerator.bestConstrainedInterval = bestConstrainedInterval;
+
+
+ // class: $.jqplot.MarkerRenderer
+ // The default jqPlot marker renderer, rendering the points on the line.
+ $.jqplot.MarkerRenderer = function(options){
+ // Group: Properties
+
+ // prop: show
+ // wether or not to show the marker.
+ this.show = true;
+ // prop: style
+ // One of diamond, circle, square, x, plus, dash, filledDiamond, filledCircle, filledSquare
+ this.style = 'filledCircle';
+ // prop: lineWidth
+ // size of the line for non-filled markers.
+ this.lineWidth = 2;
+ // prop: size
+ // Size of the marker (diameter or circle, length of edge of square, etc.)
+ this.size = 9.0;
+ // prop: color
+ // color of marker. Will be set to color of series by default on init.
+ this.color = '#666666';
+ // prop: shadow
+ // wether or not to draw a shadow on the line
+ this.shadow = true;
+ // prop: shadowAngle
+ // Shadow angle in degrees
+ this.shadowAngle = 45;
+ // prop: shadowOffset
+ // Shadow offset from line in pixels
+ this.shadowOffset = 1;
+ // prop: shadowDepth
+ // Number of times shadow is stroked, each stroke offset shadowOffset from the last.
+ this.shadowDepth = 3;
+ // prop: shadowAlpha
+ // Alpha channel transparency of shadow. 0 = transparent.
+ this.shadowAlpha = '0.07';
+ // prop: shadowRenderer
+ // Renderer that will draws the shadows on the marker.
+ this.shadowRenderer = new $.jqplot.ShadowRenderer();
+ // prop: shapeRenderer
+ // Renderer that will draw the marker.
+ this.shapeRenderer = new $.jqplot.ShapeRenderer();
+
+ $.extend(true, this, options);
+ };
+
+ $.jqplot.MarkerRenderer.prototype.init = function(options) {
+ $.extend(true, this, options);
+ var sdopt = {angle:this.shadowAngle, offset:this.shadowOffset, alpha:this.shadowAlpha, lineWidth:this.lineWidth, depth:this.shadowDepth, closePath:true};
+ if (this.style.indexOf('filled') != -1) {
+ sdopt.fill = true;
+ }
+ if (this.style.indexOf('ircle') != -1) {
+ sdopt.isarc = true;
+ sdopt.closePath = false;
+ }
+ this.shadowRenderer.init(sdopt);
+
+ var shopt = {fill:false, isarc:false, strokeStyle:this.color, fillStyle:this.color, lineWidth:this.lineWidth, closePath:true};
+ if (this.style.indexOf('filled') != -1) {
+ shopt.fill = true;
+ }
+ if (this.style.indexOf('ircle') != -1) {
+ shopt.isarc = true;
+ shopt.closePath = false;
+ }
+ this.shapeRenderer.init(shopt);
+ };
+
+ $.jqplot.MarkerRenderer.prototype.drawDiamond = function(x, y, ctx, fill, options) {
+ var stretch = 1.2;
+ var dx = this.size/2/stretch;
+ var dy = this.size/2*stretch;
+ var points = [[x-dx, y], [x, y+dy], [x+dx, y], [x, y-dy]];
+ if (this.shadow) {
+ this.shadowRenderer.draw(ctx, points);
+ }
+ this.shapeRenderer.draw(ctx, points, options);
+ };
+
+ $.jqplot.MarkerRenderer.prototype.drawPlus = function(x, y, ctx, fill, options) {
+ var stretch = 1.0;
+ var dx = this.size/2*stretch;
+ var dy = this.size/2*stretch;
+ var points1 = [[x, y-dy], [x, y+dy]];
+ var points2 = [[x+dx, y], [x-dx, y]];
+ var opts = $.extend(true, {}, this.options, {closePath:false});
+ if (this.shadow) {
+ this.shadowRenderer.draw(ctx, points1, {closePath:false});
+ this.shadowRenderer.draw(ctx, points2, {closePath:false});
+ }
+ this.shapeRenderer.draw(ctx, points1, opts);
+ this.shapeRenderer.draw(ctx, points2, opts);
+ };
+
+ $.jqplot.MarkerRenderer.prototype.drawX = function(x, y, ctx, fill, options) {
+ var stretch = 1.0;
+ var dx = this.size/2*stretch;
+ var dy = this.size/2*stretch;
+ var opts = $.extend(true, {}, this.options, {closePath:false});
+ var points1 = [[x-dx, y-dy], [x+dx, y+dy]];
+ var points2 = [[x-dx, y+dy], [x+dx, y-dy]];
+ if (this.shadow) {
+ this.shadowRenderer.draw(ctx, points1, {closePath:false});
+ this.shadowRenderer.draw(ctx, points2, {closePath:false});
+ }
+ this.shapeRenderer.draw(ctx, points1, opts);
+ this.shapeRenderer.draw(ctx, points2, opts);
+ };
+
+ $.jqplot.MarkerRenderer.prototype.drawDash = function(x, y, ctx, fill, options) {
+ var stretch = 1.0;
+ var dx = this.size/2*stretch;
+ var dy = this.size/2*stretch;
+ var points = [[x-dx, y], [x+dx, y]];
+ if (this.shadow) {
+ this.shadowRenderer.draw(ctx, points);
+ }
+ this.shapeRenderer.draw(ctx, points, options);
+ };
+
+ $.jqplot.MarkerRenderer.prototype.drawLine = function(p1, p2, ctx, fill, options) {
+ var points = [p1, p2];
+ if (this.shadow) {
+ this.shadowRenderer.draw(ctx, points);
+ }
+ this.shapeRenderer.draw(ctx, points, options);
+ };
+
+ $.jqplot.MarkerRenderer.prototype.drawSquare = function(x, y, ctx, fill, options) {
+ var stretch = 1.0;
+ var dx = this.size/2/stretch;
+ var dy = this.size/2*stretch;
+ var points = [[x-dx, y-dy], [x-dx, y+dy], [x+dx, y+dy], [x+dx, y-dy]];
+ if (this.shadow) {
+ this.shadowRenderer.draw(ctx, points);
+ }
+ this.shapeRenderer.draw(ctx, points, options);
+ };
+
+ $.jqplot.MarkerRenderer.prototype.drawCircle = function(x, y, ctx, fill, options) {
+ var radius = this.size/2;
+ var end = 2*Math.PI;
+ var points = [x, y, radius, 0, end, true];
+ if (this.shadow) {
+ this.shadowRenderer.draw(ctx, points);
+ }
+ this.shapeRenderer.draw(ctx, points, options);
+ };
+
+ $.jqplot.MarkerRenderer.prototype.draw = function(x, y, ctx, options) {
+ options = options || {};
+ // hack here b/c shape renderer uses canvas based color style options
+ // and marker uses css style names.
+ if (options.show == null || options.show != false) {
+ if (options.color && !options.fillStyle) {
+ options.fillStyle = options.color;
+ }
+ if (options.color && !options.strokeStyle) {
+ options.strokeStyle = options.color;
+ }
+ switch (this.style) {
+ case 'diamond':
+ this.drawDiamond(x,y,ctx, false, options);
+ break;
+ case 'filledDiamond':
+ this.drawDiamond(x,y,ctx, true, options);
+ break;
+ case 'circle':
+ this.drawCircle(x,y,ctx, false, options);
+ break;
+ case 'filledCircle':
+ this.drawCircle(x,y,ctx, true, options);
+ break;
+ case 'square':
+ this.drawSquare(x,y,ctx, false, options);
+ break;
+ case 'filledSquare':
+ this.drawSquare(x,y,ctx, true, options);
+ break;
+ case 'x':
+ this.drawX(x,y,ctx, true, options);
+ break;
+ case 'plus':
+ this.drawPlus(x,y,ctx, true, options);
+ break;
+ case 'dash':
+ this.drawDash(x,y,ctx, true, options);
+ break;
+ case 'line':
+ this.drawLine(x, y, ctx, false, options);
+ break;
+ default:
+ this.drawDiamond(x,y,ctx, false, options);
+ break;
+ }
+ }
+ };
+
+ // class: $.jqplot.shadowRenderer
+ // The default jqPlot shadow renderer, rendering shadows behind shapes.
+ $.jqplot.ShadowRenderer = function(options){
+ // Group: Properties
+
+ // prop: angle
+ // Angle of the shadow in degrees. Measured counter-clockwise from the x axis.
+ this.angle = 45;
+ // prop: offset
+ // Pixel offset at the given shadow angle of each shadow stroke from the last stroke.
+ this.offset = 1;
+ // prop: alpha
+ // alpha transparency of shadow stroke.
+ this.alpha = 0.07;
+ // prop: lineWidth
+ // width of the shadow line stroke.
+ this.lineWidth = 1.5;
+ // prop: lineJoin
+ // How line segments of the shadow are joined.
+ this.lineJoin = 'miter';
+ // prop: lineCap
+ // how ends of the shadow line are rendered.
+ this.lineCap = 'round';
+ // prop; closePath
+ // whether line path segment is closed upon itself.
+ this.closePath = false;
+ // prop: fill
+ // whether to fill the shape.
+ this.fill = false;
+ // prop: depth
+ // how many times the shadow is stroked. Each stroke will be offset by offset at angle degrees.
+ this.depth = 3;
+ this.strokeStyle = 'rgba(0,0,0,0.1)';
+ // prop: isarc
+ // wether the shadow is an arc or not.
+ this.isarc = false;
+
+ $.extend(true, this, options);
+ };
+
+ $.jqplot.ShadowRenderer.prototype.init = function(options) {
+ $.extend(true, this, options);
+ };
+
+ // function: draw
+ // draws an transparent black (i.e. gray) shadow.
+ //
+ // ctx - canvas drawing context
+ // points - array of points or [x, y, radius, start angle (rad), end angle (rad)]
+ $.jqplot.ShadowRenderer.prototype.draw = function(ctx, points, options) {
+ ctx.save();
+ var opts = (options != null) ? options : {};
+ var fill = (opts.fill != null) ? opts.fill : this.fill;
+ var fillRect = (opts.fillRect != null) ? opts.fillRect : this.fillRect;
+ var closePath = (opts.closePath != null) ? opts.closePath : this.closePath;
+ var offset = (opts.offset != null) ? opts.offset : this.offset;
+ var alpha = (opts.alpha != null) ? opts.alpha : this.alpha;
+ var depth = (opts.depth != null) ? opts.depth : this.depth;
+ var isarc = (opts.isarc != null) ? opts.isarc : this.isarc;
+ var linePattern = (opts.linePattern != null) ? opts.linePattern : this.linePattern;
+ ctx.lineWidth = (opts.lineWidth != null) ? opts.lineWidth : this.lineWidth;
+ ctx.lineJoin = (opts.lineJoin != null) ? opts.lineJoin : this.lineJoin;
+ ctx.lineCap = (opts.lineCap != null) ? opts.lineCap : this.lineCap;
+ ctx.strokeStyle = opts.strokeStyle || this.strokeStyle || 'rgba(0,0,0,'+alpha+')';
+ ctx.fillStyle = opts.fillStyle || this.fillStyle || 'rgba(0,0,0,'+alpha+')';
+ for (var j=0; j<depth; j++) {
+ var ctxPattern = $.jqplot.LinePattern(ctx, linePattern);
+ ctx.translate(Math.cos(this.angle*Math.PI/180)*offset, Math.sin(this.angle*Math.PI/180)*offset);
+ ctxPattern.beginPath();
+ if (isarc) {
+ ctx.arc(points[0], points[1], points[2], points[3], points[4], true);
+ }
+ else if (fillRect) {
+ if (fillRect) {
+ ctx.fillRect(points[0], points[1], points[2], points[3]);
+ }
+ }
+ else if (points && points.length){
+ var move = true;
+ for (var i=0; i<points.length; i++) {
+ // skip to the first non-null point and move to it.
+ if (points[i][0] != null && points[i][1] != null) {
+ if (move) {
+ ctxPattern.moveTo(points[i][0], points[i][1]);
+ move = false;
+ }
+ else {
+ ctxPattern.lineTo(points[i][0], points[i][1]);
+ }
+ }
+ else {
+ move = true;
+ }
+ }
+
+ }
+ if (closePath) {
+ ctxPattern.closePath();
+ }
+ if (fill) {
+ ctx.fill();
+ }
+ else {
+ ctx.stroke();
+ }
+ }
+ ctx.restore();
+ };
+
+ // class: $.jqplot.shapeRenderer
+ // The default jqPlot shape renderer. Given a set of points will
+ // plot them and either stroke a line (fill = false) or fill them (fill = true).
+ // If a filled shape is desired, closePath = true must also be set to close
+ // the shape.
+ $.jqplot.ShapeRenderer = function(options){
+
+ this.lineWidth = 1.5;
+ // prop: linePattern
+ // line pattern 'dashed', 'dotted', 'solid', some combination
+ // of '-' and '.' characters such as '.-.' or a numerical array like
+ // [draw, skip, draw, skip, ...] such as [1, 10] to draw a dotted line,
+ // [1, 10, 20, 10] to draw a dot-dash line, and so on.
+ this.linePattern = 'solid';
+ // prop: lineJoin
+ // How line segments of the shadow are joined.
+ this.lineJoin = 'miter';
+ // prop: lineCap
+ // how ends of the shadow line are rendered.
+ this.lineCap = 'round';
+ // prop; closePath
+ // whether line path segment is closed upon itself.
+ this.closePath = false;
+ // prop: fill
+ // whether to fill the shape.
+ this.fill = false;
+ // prop: isarc
+ // wether the shadow is an arc or not.
+ this.isarc = false;
+ // prop: fillRect
+ // true to draw shape as a filled rectangle.
+ this.fillRect = false;
+ // prop: strokeRect
+ // true to draw shape as a stroked rectangle.
+ this.strokeRect = false;
+ // prop: clearRect
+ // true to cear a rectangle.
+ this.clearRect = false;
+ // prop: strokeStyle
+ // css color spec for the stoke style
+ this.strokeStyle = '#999999';
+ // prop: fillStyle
+ // css color spec for the fill style.
+ this.fillStyle = '#999999';
+
+ $.extend(true, this, options);
+ };
+
+ $.jqplot.ShapeRenderer.prototype.init = function(options) {
+ $.extend(true, this, options);
+ };
+
+ // function: draw
+ // draws the shape.
+ //
+ // ctx - canvas drawing context
+ // points - array of points for shapes or
+ // [x, y, width, height] for rectangles or
+ // [x, y, radius, start angle (rad), end angle (rad)] for circles and arcs.
+ $.jqplot.ShapeRenderer.prototype.draw = function(ctx, points, options) {
+ ctx.save();
+ var opts = (options != null) ? options : {};
+ var fill = (opts.fill != null) ? opts.fill : this.fill;
+ var closePath = (opts.closePath != null) ? opts.closePath : this.closePath;
+ var fillRect = (opts.fillRect != null) ? opts.fillRect : this.fillRect;
+ var strokeRect = (opts.strokeRect != null) ? opts.strokeRect : this.strokeRect;
+ var clearRect = (opts.clearRect != null) ? opts.clearRect : this.clearRect;
+ var isarc = (opts.isarc != null) ? opts.isarc : this.isarc;
+ var linePattern = (opts.linePattern != null) ? opts.linePattern : this.linePattern;
+ var ctxPattern = $.jqplot.LinePattern(ctx, linePattern);
+ ctx.lineWidth = opts.lineWidth || this.lineWidth;
+ ctx.lineJoin = opts.lineJoin || this.lineJoin;
+ ctx.lineCap = opts.lineCap || this.lineCap;
+ ctx.strokeStyle = (opts.strokeStyle || opts.color) || this.strokeStyle;
+ ctx.fillStyle = opts.fillStyle || this.fillStyle;
+ ctx.beginPath();
+ if (isarc) {
+ ctx.arc(points[0], points[1], points[2], points[3], points[4], true);
+ if (closePath) {
+ ctx.closePath();
+ }
+ if (fill) {
+ ctx.fill();
+ }
+ else {
+ ctx.stroke();
+ }
+ ctx.restore();
+ return;
+ }
+ else if (clearRect) {
+ ctx.clearRect(points[0], points[1], points[2], points[3]);
+ ctx.restore();
+ return;
+ }
+ else if (fillRect || strokeRect) {
+ if (fillRect) {
+ ctx.fillRect(points[0], points[1], points[2], points[3]);
+ }
+ if (strokeRect) {
+ ctx.strokeRect(points[0], points[1], points[2], points[3]);
+ ctx.restore();
+ return;
+ }
+ }
+ else if (points && points.length){
+ var move = true;
+ for (var i=0; i<points.length; i++) {
+ // skip to the first non-null point and move to it.
+ if (points[i][0] != null && points[i][1] != null) {
+ if (move) {
+ ctxPattern.moveTo(points[i][0], points[i][1]);
+ move = false;
+ }
+ else {
+ ctxPattern.lineTo(points[i][0], points[i][1]);
+ }
+ }
+ else {
+ move = true;
+ }
+ }
+ if (closePath) {
+ ctxPattern.closePath();
+ }
+ if (fill) {
+ ctx.fill();
+ }
+ else {
+ ctx.stroke();
+ }
+ }
+ ctx.restore();
+ };
+
+ // class $.jqplot.TableLegendRenderer
+ // The default legend renderer for jqPlot.
+ $.jqplot.TableLegendRenderer = function(){
+ //
+ };
+
+ $.jqplot.TableLegendRenderer.prototype.init = function(options) {
+ $.extend(true, this, options);
+ };
+
+ $.jqplot.TableLegendRenderer.prototype.addrow = function (label, color, pad, reverse) {
+ var rs = (pad) ? this.rowSpacing+'px' : '0px';
+ var tr;
+ var td;
+ var elem;
+ var div0;
+ var div1;
+ elem = document.createElement('tr');
+ tr = $(elem);
+ tr.addClass('jqplot-table-legend');
+ elem = null;
+
+ if (reverse){
+ tr.prependTo(this._elem);
+ }
+
+ else{
+ tr.appendTo(this._elem);
+ }
+
+ if (this.showSwatches) {
+ td = $(document.createElement('td'));
+ td.addClass('jqplot-table-legend jqplot-table-legend-swatch');
+ td.css({textAlign: 'center', paddingTop: rs});
+
+ div0 = $(document.createElement('div'));
+ div0.addClass('jqplot-table-legend-swatch-outline');
+ div1 = $(document.createElement('div'));
+ div1.addClass('jqplot-table-legend-swatch');
+ div1.css({backgroundColor: color, borderColor: color});
+
+ tr.append(td.append(div0.append(div1)));
+
+ // $('<td class="jqplot-table-legend" style="text-align:center;padding-top:'+rs+';">'+
+ // '<div><div class="jqplot-table-legend-swatch" style="background-color:'+color+';border-color:'+color+';"></div>'+
+ // '</div></td>').appendTo(tr);
+ }
+ if (this.showLabels) {
+ td = $(document.createElement('td'));
+ td.addClass('jqplot-table-legend jqplot-table-legend-label');
+ td.css('paddingTop', rs);
+ tr.append(td);
+
+ // elem = $('<td class="jqplot-table-legend" style="padding-top:'+rs+';"></td>');
+ // elem.appendTo(tr);
+ if (this.escapeHtml) {
+ td.text(label);
+ }
+ else {
+ td.html(label);
+ }
+ }
+ td = null;
+ div0 = null;
+ div1 = null;
+ tr = null;
+ elem = null;
+ };
+
+ // called with scope of legend
+ $.jqplot.TableLegendRenderer.prototype.draw = function() {
+ if (this._elem) {
+ this._elem.emptyForce();
+ this._elem = null;
+ }
+
+ if (this.show) {
+ var series = this._series;
+ // make a table. one line label per row.
+ var elem = document.createElement('table');
+ this._elem = $(elem);
+ this._elem.addClass('jqplot-table-legend');
+
+ var ss = {position:'absolute'};
+ if (this.background) {
+ ss['background'] = this.background;
+ }
+ if (this.border) {
+ ss['border'] = this.border;
+ }
+ if (this.fontSize) {
+ ss['fontSize'] = this.fontSize;
+ }
+ if (this.fontFamily) {
+ ss['fontFamily'] = this.fontFamily;
+ }
+ if (this.textColor) {
+ ss['textColor'] = this.textColor;
+ }
+ if (this.marginTop != null) {
+ ss['marginTop'] = this.marginTop;
+ }
+ if (this.marginBottom != null) {
+ ss['marginBottom'] = this.marginBottom;
+ }
+ if (this.marginLeft != null) {
+ ss['marginLeft'] = this.marginLeft;
+ }
+ if (this.marginRight != null) {
+ ss['marginRight'] = this.marginRight;
+ }
+
+
+ var pad = false,
+ reverse = false,
+ s;
+ for (var i = 0; i< series.length; i++) {
+ s = series[i];
+ if (s._stack || s.renderer.constructor == $.jqplot.BezierCurveRenderer){
+ reverse = true;
+ }
+ if (s.show && s.showLabel) {
+ var lt = this.labels[i] || s.label.toString();
+ if (lt) {
+ var color = s.color;
+ if (reverse && i < series.length - 1){
+ pad = true;
+ }
+ else if (reverse && i == series.length - 1){
+ pad = false;
+ }
+ this.renderer.addrow.call(this, lt, color, pad, reverse);
+ pad = true;
+ }
+ // let plugins add more rows to legend. Used by trend line plugin.
+ for (var j=0; j<$.jqplot.addLegendRowHooks.length; j++) {
+ var item = $.jqplot.addLegendRowHooks[j].call(this, s);
+ if (item) {
+ this.renderer.addrow.call(this, item.label, item.color, pad);
+ pad = true;
+ }
+ }
+ lt = null;
+ }
+ }
+ }
+ return this._elem;
+ };
+
+ $.jqplot.TableLegendRenderer.prototype.pack = function(offsets) {
+ if (this.show) {
+ if (this.placement == 'insideGrid') {
+ switch (this.location) {
+ case 'nw':
+ var a = offsets.left;
+ var b = offsets.top;
+ this._elem.css('left', a);
+ this._elem.css('top', b);
+ break;
+ case 'n':
+ var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
+ var b = offsets.top;
+ this._elem.css('left', a);
+ this._elem.css('top', b);
+ break;
+ case 'ne':
+ var a = offsets.right;
+ var b = offsets.top;
+ this._elem.css({right:a, top:b});
+ break;
+ case 'e':
+ var a = offsets.right;
+ var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
+ this._elem.css({right:a, top:b});
+ break;
+ case 'se':
+ var a = offsets.right;
+ var b = offsets.bottom;
+ this._elem.css({right:a, bottom:b});
+ break;
+ case 's':
+ var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
+ var b = offsets.bottom;
+ this._elem.css({left:a, bottom:b});
+ break;
+ case 'sw':
+ var a = offsets.left;
+ var b = offsets.bottom;
+ this._elem.css({left:a, bottom:b});
+ break;
+ case 'w':
+ var a = offsets.left;
+ var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
+ this._elem.css({left:a, top:b});
+ break;
+ default: // same as 'se'
+ var a = offsets.right;
+ var b = offsets.bottom;
+ this._elem.css({right:a, bottom:b});
+ break;
+ }
+
+ }
+ else if (this.placement == 'outside'){
+ switch (this.location) {
+ case 'nw':
+ var a = this._plotDimensions.width - offsets.left;
+ var b = offsets.top;
+ this._elem.css('right', a);
+ this._elem.css('top', b);
+ break;
+ case 'n':
+ var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
+ var b = this._plotDimensions.height - offsets.top;
+ this._elem.css('left', a);
+ this._elem.css('bottom', b);
+ break;
+ case 'ne':
+ var a = this._plotDimensions.width - offsets.right;
+ var b = offsets.top;
+ this._elem.css({left:a, top:b});
+ break;
+ case 'e':
+ var a = this._plotDimensions.width - offsets.right;
+ var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
+ this._elem.css({left:a, top:b});
+ break;
+ case 'se':
+ var a = this._plotDimensions.width - offsets.right;
+ var b = offsets.bottom;
+ this._elem.css({left:a, bottom:b});
+ break;
+ case 's':
+ var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
+ var b = this._plotDimensions.height - offsets.bottom;
+ this._elem.css({left:a, top:b});
+ break;
+ case 'sw':
+ var a = this._plotDimensions.width - offsets.left;
+ var b = offsets.bottom;
+ this._elem.css({right:a, bottom:b});
+ break;
+ case 'w':
+ var a = this._plotDimensions.width - offsets.left;
+ var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
+ this._elem.css({right:a, top:b});
+ break;
+ default: // same as 'se'
+ var a = offsets.right;
+ var b = offsets.bottom;
+ this._elem.css({right:a, bottom:b});
+ break;
+ }
+ }
+ else {
+ switch (this.location) {
+ case 'nw':
+ this._elem.css({left:0, top:offsets.top});
+ break;
+ case 'n':
+ var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
+ this._elem.css({left: a, top:offsets.top});
+ break;
+ case 'ne':
+ this._elem.css({right:0, top:offsets.top});
+ break;
+ case 'e':
+ var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
+ this._elem.css({right:offsets.right, top:b});
+ break;
+ case 'se':
+ this._elem.css({right:offsets.right, bottom:offsets.bottom});
+ break;
+ case 's':
+ var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
+ this._elem.css({left: a, bottom:offsets.bottom});
+ break;
+ case 'sw':
+ this._elem.css({left:offsets.left, bottom:offsets.bottom});
+ break;
+ case 'w':
+ var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
+ this._elem.css({left:offsets.left, top:b});
+ break;
+ default: // same as 'se'
+ this._elem.css({right:offsets.right, bottom:offsets.bottom});
+ break;
+ }
+ }
+ }
+ };
+
+ /**
+ * Class: $.jqplot.ThemeEngine
+ * Theme Engine provides a programatic way to change some of the more
+ * common jqplot styling options such as fonts, colors and grid options.
+ * A theme engine instance is created with each plot. The theme engine
+ * manages a collection of themes which can be modified, added to, or
+ * applied to the plot.
+ *
+ * The themeEngine class is not instantiated directly.
+ * When a plot is initialized, the current plot options are scanned
+ * an a default theme named "Default" is created. This theme is
+ * used as the basis for other themes added to the theme engine and
+ * is always available.
+ *
+ * A theme is a simple javascript object with styling parameters for
+ * various entities of the plot. A theme has the form:
+ *
+ *
+ * > {
+ * > _name:f "Default",
+ * > target: {
+ * > backgroundColor: "transparent"
+ * > },
+ * > legend: {
+ * > textColor: null,
+ * > fontFamily: null,
+ * > fontSize: null,
+ * > border: null,
+ * > background: null
+ * > },
+ * > title: {
+ * > textColor: "rgb(102, 102, 102)",
+ * > fontFamily: "'Trebuchet MS',Arial,Helvetica,sans-serif",
+ * > fontSize: "19.2px",
+ * > textAlign: "center"
+ * > },
+ * > seriesStyles: {},
+ * > series: [{
+ * > color: "#4bb2c5",
+ * > lineWidth: 2.5,
+ * > linePattern: "solid",
+ * > shadow: true,
+ * > fillColor: "#4bb2c5",
+ * > showMarker: true,
+ * > markerOptions: {
+ * > color: "#4bb2c5",
+ * > show: true,
+ * > style: 'filledCircle',
+ * > lineWidth: 1.5,
+ * > size: 4,
+ * > shadow: true
+ * > }
+ * > }],
+ * > grid: {
+ * > drawGridlines: true,
+ * > gridLineColor: "#cccccc",
+ * > gridLineWidth: 1,
+ * > backgroundColor: "#fffdf6",
+ * > borderColor: "#999999",
+ * > borderWidth: 2,
+ * > shadow: true
+ * > },
+ * > axesStyles: {
+ * > label: {},
+ * > ticks: {}
+ * > },
+ * > axes: {
+ * > xaxis: {
+ * > borderColor: "#999999",
+ * > borderWidth: 2,
+ * > ticks: {
+ * > show: true,
+ * > showGridline: true,
+ * > showLabel: true,
+ * > showMark: true,
+ * > size: 4,
+ * > textColor: "",
+ * > whiteSpace: "nowrap",
+ * > fontSize: "12px",
+ * > fontFamily: "'Trebuchet MS',Arial,Helvetica,sans-serif"
+ * > },
+ * > label: {
+ * > textColor: "rgb(102, 102, 102)",
+ * > whiteSpace: "normal",
+ * > fontSize: "14.6667px",
+ * > fontFamily: "'Trebuchet MS',Arial,Helvetica,sans-serif",
+ * > fontWeight: "400"
+ * > }
+ * > },
+ * > yaxis: {
+ * > borderColor: "#999999",
+ * > borderWidth: 2,
+ * > ticks: {
+ * > show: true,
+ * > showGridline: true,
+ * > showLabel: true,
+ * > showMark: true,
+ * > size: 4,
+ * > textColor: "",
+ * > whiteSpace: "nowrap",
+ * > fontSize: "12px",
+ * > fontFamily: "'Trebuchet MS',Arial,Helvetica,sans-serif"
+ * > },
+ * > label: {
+ * > textColor: null,
+ * > whiteSpace: null,
+ * > fontSize: null,
+ * > fontFamily: null,
+ * > fontWeight: null
+ * > }
+ * > },
+ * > x2axis: {...
+ * > },
+ * > ...
+ * > y9axis: {...
+ * > }
+ * > }
+ * > }
+ *
+ * "seriesStyles" is a style object that will be applied to all series in the plot.
+ * It will forcibly override any styles applied on the individual series. "axesStyles" is
+ * a style object that will be applied to all axes in the plot. It will also forcibly
+ * override any styles on the individual axes.
+ *
+ * The example shown above has series options for a line series. Options for other
+ * series types are shown below:
+ *
+ * Bar Series:
+ *
+ * > {
+ * > color: "#4bb2c5",
+ * > seriesColors: ["#4bb2c5", "#EAA228", "#c5b47f", "#579575", "#839557", "#958c12", "#953579", "#4b5de4", "#d8b83f", "#ff5800", "#0085cc", "#c747a3", "#cddf54", "#FBD178", "#26B4E3", "#bd70c7"],
+ * > lineWidth: 2.5,
+ * > shadow: true,
+ * > barPadding: 2,
+ * > barMargin: 10,
+ * > barWidth: 15.09375,
+ * > highlightColors: ["rgb(129,201,214)", "rgb(129,201,214)", "rgb(129,201,214)", "rgb(129,201,214)", "rgb(129,201,214)", "rgb(129,201,214)", "rgb(129,201,214)", "rgb(129,201,214)"]
+ * > }
+ *
+ * Pie Series:
+ *
+ * > {
+ * > seriesColors: ["#4bb2c5", "#EAA228", "#c5b47f", "#579575", "#839557", "#958c12", "#953579", "#4b5de4", "#d8b83f", "#ff5800", "#0085cc", "#c747a3", "#cddf54", "#FBD178", "#26B4E3", "#bd70c7"],
+ * > padding: 20,
+ * > sliceMargin: 0,
+ * > fill: true,
+ * > shadow: true,
+ * > startAngle: 0,
+ * > lineWidth: 2.5,
+ * > highlightColors: ["rgb(129,201,214)", "rgb(240,189,104)", "rgb(214,202,165)", "rgb(137,180,158)", "rgb(168,180,137)", "rgb(180,174,89)", "rgb(180,113,161)", "rgb(129,141,236)", "rgb(227,205,120)", "rgb(255,138,76)", "rgb(76,169,219)", "rgb(215,126,190)", "rgb(220,232,135)", "rgb(200,167,96)", "rgb(103,202,235)", "rgb(208,154,215)"]
+ * > }
+ *
+ * Funnel Series:
+ *
+ * > {
+ * > color: "#4bb2c5",
+ * > lineWidth: 2,
+ * > shadow: true,
+ * > padding: {
+ * > top: 20,
+ * > right: 20,
+ * > bottom: 20,
+ * > left: 20
+ * > },
+ * > sectionMargin: 6,
+ * > seriesColors: ["#4bb2c5", "#EAA228", "#c5b47f", "#579575", "#839557", "#958c12", "#953579", "#4b5de4", "#d8b83f", "#ff5800", "#0085cc", "#c747a3", "#cddf54", "#FBD178", "#26B4E3", "#bd70c7"],
+ * > highlightColors: ["rgb(147,208,220)", "rgb(242,199,126)", "rgb(220,210,178)", "rgb(154,191,172)", "rgb(180,191,154)", "rgb(191,186,112)", "rgb(191,133,174)", "rgb(147,157,238)", "rgb(231,212,139)", "rgb(255,154,102)", "rgb(102,181,224)", "rgb(221,144,199)", "rgb(225,235,152)", "rgb(200,167,96)", "rgb(124,210,238)", "rgb(215,169,221)"]
+ * > }
+ *
+ */
+ $.jqplot.ThemeEngine = function(){
+ // Group: Properties
+ //
+ // prop: themes
+ // hash of themes managed by the theme engine.
+ // Indexed by theme name.
+ this.themes = {};
+ // prop: activeTheme
+ // Pointer to currently active theme
+ this.activeTheme=null;
+
+ };
+
+ // called with scope of plot
+ $.jqplot.ThemeEngine.prototype.init = function() {
+ // get the Default theme from the current plot settings.
+ var th = new $.jqplot.Theme({_name:'Default'});
+ var n, i, nn;
+
+ for (n in th.target) {
+ if (n == "textColor") {
+ th.target[n] = this.target.css('color');
+ }
+ else {
+ th.target[n] = this.target.css(n);
+ }
+ }
+
+ if (this.title.show && this.title._elem) {
+ for (n in th.title) {
+ if (n == "textColor") {
+ th.title[n] = this.title._elem.css('color');
+ }
+ else {
+ th.title[n] = this.title._elem.css(n);
+ }
+ }
+ }
+
+ for (n in th.grid) {
+ th.grid[n] = this.grid[n];
+ }
+ if (th.grid.backgroundColor == null && this.grid.background != null) {
+ th.grid.backgroundColor = this.grid.background;
+ }
+ if (this.legend.show && this.legend._elem) {
+ for (n in th.legend) {
+ if (n == 'textColor') {
+ th.legend[n] = this.legend._elem.css('color');
+ }
+ else {
+ th.legend[n] = this.legend._elem.css(n);
+ }
+ }
+ }
+ var s;
+
+ for (i=0; i<this.series.length; i++) {
+ s = this.series[i];
+ if (s.renderer.constructor == $.jqplot.LineRenderer) {
+ th.series.push(new LineSeriesProperties());
+ }
+ else if (s.renderer.constructor == $.jqplot.BarRenderer) {
+ th.series.push(new BarSeriesProperties());
+ }
+ else if (s.renderer.constructor == $.jqplot.PieRenderer) {
+ th.series.push(new PieSeriesProperties());
+ }
+ else if (s.renderer.constructor == $.jqplot.DonutRenderer) {
+ th.series.push(new DonutSeriesProperties());
+ }
+ else if (s.renderer.constructor == $.jqplot.FunnelRenderer) {
+ th.series.push(new FunnelSeriesProperties());
+ }
+ else if (s.renderer.constructor == $.jqplot.MeterGaugeRenderer) {
+ th.series.push(new MeterSeriesProperties());
+ }
+ else {
+ th.series.push({});
+ }
+ for (n in th.series[i]) {
+ th.series[i][n] = s[n];
+ }
+ }
+ var a, ax;
+ for (n in this.axes) {
+ ax = this.axes[n];
+ a = th.axes[n] = new AxisProperties();
+ a.borderColor = ax.borderColor;
+ a.borderWidth = ax.borderWidth;
+ if (ax._ticks && ax._ticks[0]) {
+ for (nn in a.ticks) {
+ if (ax._ticks[0].hasOwnProperty(nn)) {
+ a.ticks[nn] = ax._ticks[0][nn];
+ }
+ else if (ax._ticks[0]._elem){
+ a.ticks[nn] = ax._ticks[0]._elem.css(nn);
+ }
+ }
+ }
+ if (ax._label && ax._label.show) {
+ for (nn in a.label) {
+ // a.label[nn] = ax._label._elem.css(nn);
+ if (ax._label[nn]) {
+ a.label[nn] = ax._label[nn];
+ }
+ else if (ax._label._elem){
+ if (nn == 'textColor') {
+ a.label[nn] = ax._label._elem.css('color');
+ }
+ else {
+ a.label[nn] = ax._label._elem.css(nn);
+ }
+ }
+ }
+ }
+ }
+ this.themeEngine._add(th);
+ this.themeEngine.activeTheme = this.themeEngine.themes[th._name];
+ };
+ /**
+ * Group: methods
+ *
+ * method: get
+ *
+ * Get and return the named theme or the active theme if no name given.
+ *
+ * parameter:
+ *
+ * name - name of theme to get.
+ *
+ * returns:
+ *
+ * Theme instance of given name.
+ */
+ $.jqplot.ThemeEngine.prototype.get = function(name) {
+ if (!name) {
+ // return the active theme
+ return this.activeTheme;
+ }
+ else {
+ return this.themes[name];
+ }
+ };
+
+ function numericalOrder(a,b) { return a-b; }
+
+ /**
+ * method: getThemeNames
+ *
+ * Return the list of theme names in this manager in alpha-numerical order.
+ *
+ * parameter:
+ *
+ * None
+ *
+ * returns:
+ *
+ * A the list of theme names in this manager in alpha-numerical order.
+ */
+ $.jqplot.ThemeEngine.prototype.getThemeNames = function() {
+ var tn = [];
+ for (var n in this.themes) {
+ tn.push(n);
+ }
+ return tn.sort(numericalOrder);
+ };
+
+ /**
+ * method: getThemes
+ *
+ * Return a list of themes in alpha-numerical order by name.
+ *
+ * parameter:
+ *
+ * None
+ *
+ * returns:
+ *
+ * A list of themes in alpha-numerical order by name.
+ */
+ $.jqplot.ThemeEngine.prototype.getThemes = function() {
+ var tn = [];
+ var themes = [];
+ for (var n in this.themes) {
+ tn.push(n);
+ }
+ tn.sort(numericalOrder);
+ for (var i=0; i<tn.length; i++) {
+ themes.push(this.themes[tn[i]]);
+ }
+ return themes;
+ };
+
+ $.jqplot.ThemeEngine.prototype.activate = function(plot, name) {
+ // sometimes need to redraw whole plot.
+ var redrawPlot = false;
+ if (!name && this.activeTheme && this.activeTheme._name) {
+ name = this.activeTheme._name;
+ }
+ if (!this.themes.hasOwnProperty(name)) {
+ throw new Error("No theme of that name");
+ }
+ else {
+ var th = this.themes[name];
+ this.activeTheme = th;
+ var val, checkBorderColor = false, checkBorderWidth = false;
+ var arr = ['xaxis', 'x2axis', 'yaxis', 'y2axis'];
+
+ for (i=0; i<arr.length; i++) {
+ var ax = arr[i];
+ if (th.axesStyles.borderColor != null) {
+ plot.axes[ax].borderColor = th.axesStyles.borderColor;
+ }
+ if (th.axesStyles.borderWidth != null) {
+ plot.axes[ax].borderWidth = th.axesStyles.borderWidth;
+ }
+ }
+
+ for (var axname in plot.axes) {
+ var axis = plot.axes[axname];
+ if (axis.show) {
+ var thaxis = th.axes[axname] || {};
+ var thaxstyle = th.axesStyles;
+ var thax = $.jqplot.extend(true, {}, thaxis, thaxstyle);
+ val = (th.axesStyles.borderColor != null) ? th.axesStyles.borderColor : thax.borderColor;
+ if (thax.borderColor != null) {
+ axis.borderColor = thax.borderColor;
+ redrawPlot = true;
+ }
+ val = (th.axesStyles.borderWidth != null) ? th.axesStyles.borderWidth : thax.borderWidth;
+ if (thax.borderWidth != null) {
+ axis.borderWidth = thax.borderWidth;
+ redrawPlot = true;
+ }
+ if (axis._ticks && axis._ticks[0]) {
+ for (var nn in thax.ticks) {
+ // val = null;
+ // if (th.axesStyles.ticks && th.axesStyles.ticks[nn] != null) {
+ // val = th.axesStyles.ticks[nn];
+ // }
+ // else if (thax.ticks[nn] != null){
+ // val = thax.ticks[nn]
+ // }
+ val = thax.ticks[nn];
+ if (val != null) {
+ axis.tickOptions[nn] = val;
+ axis._ticks = [];
+ redrawPlot = true;
+ }
+ }
+ }
+ if (axis._label && axis._label.show) {
+ for (var nn in thax.label) {
+ // val = null;
+ // if (th.axesStyles.label && th.axesStyles.label[nn] != null) {
+ // val = th.axesStyles.label[nn];
+ // }
+ // else if (thax.label && thax.label[nn] != null){
+ // val = thax.label[nn]
+ // }
+ val = thax.label[nn];
+ if (val != null) {
+ axis.labelOptions[nn] = val;
+ redrawPlot = true;
+ }
+ }
+ }
+
+ }
+ }
+
+ for (var n in th.grid) {
+ if (th.grid[n] != null) {
+ plot.grid[n] = th.grid[n];
+ }
+ }
+ if (!redrawPlot) {
+ plot.grid.draw();
+ }
+
+ if (plot.legend.show) {
+ for (n in th.legend) {
+ if (th.legend[n] != null) {
+ plot.legend[n] = th.legend[n];
+ }
+ }
+ }
+ if (plot.title.show) {
+ for (n in th.title) {
+ if (th.title[n] != null) {
+ plot.title[n] = th.title[n];
+ }
+ }
+ }
+
+ var i;
+ for (i=0; i<th.series.length; i++) {
+ var opts = {};
+ var redrawSeries = false;
+ for (n in th.series[i]) {
+ val = (th.seriesStyles[n] != null) ? th.seriesStyles[n] : th.series[i][n];
+ if (val != null) {
+ opts[n] = val;
+ if (n == 'color') {
+ plot.series[i].renderer.shapeRenderer.fillStyle = val;
+ plot.series[i].renderer.shapeRenderer.strokeStyle = val;
+ plot.series[i][n] = val;
+ }
+ else if ((n == 'lineWidth') || (n == 'linePattern')) {
+ plot.series[i].renderer.shapeRenderer[n] = val;
+ plot.series[i][n] = val;
+ }
+ else if (n == 'markerOptions') {
+ merge (plot.series[i].markerOptions, val);
+ merge (plot.series[i].markerRenderer, val);
+ }
+ else {
+ plot.series[i][n] = val;
+ }
+ redrawPlot = true;
+ }
+ }
+ }
+
+ if (redrawPlot) {
+ plot.target.empty();
+ plot.draw();
+ }
+
+ for (n in th.target) {
+ if (th.target[n] != null) {
+ plot.target.css(n, th.target[n]);
+ }
+ }
+ }
+
+ };
+
+ $.jqplot.ThemeEngine.prototype._add = function(theme, name) {
+ if (name) {
+ theme._name = name;
+ }
+ if (!theme._name) {
+ theme._name = Date.parse(new Date());
+ }
+ if (!this.themes.hasOwnProperty(theme._name)) {
+ this.themes[theme._name] = theme;
+ }
+ else {
+ throw new Error("jqplot.ThemeEngine Error: Theme already in use");
+ }
+ };
+
+ // method remove
+ // Delete the named theme, return true on success, false on failure.
+
+
+ /**
+ * method: remove
+ *
+ * Remove the given theme from the themeEngine.
+ *
+ * parameters:
+ *
+ * name - name of the theme to remove.
+ *
+ * returns:
+ *
+ * true on success, false on failure.
+ */
+ $.jqplot.ThemeEngine.prototype.remove = function(name) {
+ if (name == 'Default') {
+ return false;
+ }
+ return delete this.themes[name];
+ };
+
+ /**
+ * method: newTheme
+ *
+ * Create a new theme based on the default theme, adding it the themeEngine.
+ *
+ * parameters:
+ *
+ * name - name of the new theme.
+ * obj - optional object of styles to be applied to this new theme.
+ *
+ * returns:
+ *
+ * new Theme object.
+ */
+ $.jqplot.ThemeEngine.prototype.newTheme = function(name, obj) {
+ if (typeof(name) == 'object') {
+ obj = obj || name;
+ name = null;
+ }
+ if (obj && obj._name) {
+ name = obj._name;
+ }
+ else {
+ name = name || Date.parse(new Date());
+ }
+ // var th = new $.jqplot.Theme(name);
+ var th = this.copy(this.themes['Default']._name, name);
+ $.jqplot.extend(th, obj);
+ return th;
+ };
+
+ // function clone(obj) {
+ // return eval(obj.toSource());
+ // }
+
+ function clone(obj){
+ if(obj == null || typeof(obj) != 'object'){
+ return obj;
+ }
+
+ var temp = new obj.constructor();
+ for(var key in obj){
+ temp[key] = clone(obj[key]);
+ }
+ return temp;
+ }
+
+ $.jqplot.clone = clone;
+
+ function merge(obj1, obj2) {
+ if (obj2 == null || typeof(obj2) != 'object') {
+ return;
+ }
+ for (var key in obj2) {
+ if (key == 'highlightColors') {
+ obj1[key] = clone(obj2[key]);
+ }
+ if (obj2[key] != null && typeof(obj2[key]) == 'object') {
+ if (!obj1.hasOwnProperty(key)) {
+ obj1[key] = {};
+ }
+ merge(obj1[key], obj2[key]);
+ }
+ else {
+ obj1[key] = obj2[key];
+ }
+ }
+ }
+
+ $.jqplot.merge = merge;
+
+ // Use the jQuery 1.3.2 extend function since behaviour in jQuery 1.4 seems problematic
+ $.jqplot.extend = function() {
+ // copy reference to target object
+ var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+ target = arguments[1] || {};
+ // skip the boolean and the target
+ i = 2;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !toString.call(target) === "[object Function]" ) {
+ target = {};
+ }
+
+ for ( ; i < length; i++ ){
+ // Only deal with non-null/undefined values
+ if ( (options = arguments[ i ]) != null ) {
+ // Extend the base object
+ for ( var name in options ) {
+ var src = target[ name ], copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging object values
+ if ( deep && copy && typeof copy === "object" && !copy.nodeType ) {
+ target[ name ] = $.jqplot.extend( deep,
+ // Never move original objects, clone them
+ src || ( copy.length != null ? [ ] : { } )
+ , copy );
+ }
+ // Don't bring in undefined values
+ else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+ // Return the modified object
+ return target;
+ };
+
+ /**
+ * method: rename
+ *
+ * Rename a theme.
+ *
+ * parameters:
+ *
+ * oldName - current name of the theme.
+ * newName - desired name of the theme.
+ *
+ * returns:
+ *
+ * new Theme object.
+ */
+ $.jqplot.ThemeEngine.prototype.rename = function (oldName, newName) {
+ if (oldName == 'Default' || newName == 'Default') {
+ throw new Error ("jqplot.ThemeEngine Error: Cannot rename from/to Default");
+ }
+ if (this.themes.hasOwnProperty(newName)) {
+ throw new Error ("jqplot.ThemeEngine Error: New name already in use.");
+ }
+ else if (this.themes.hasOwnProperty(oldName)) {
+ var th = this.copy (oldName, newName);
+ this.remove(oldName);
+ return th;
+ }
+ throw new Error("jqplot.ThemeEngine Error: Old name or new name invalid");
+ };
+
+ /**
+ * method: copy
+ *
+ * Create a copy of an existing theme in the themeEngine, adding it the themeEngine.
+ *
+ * parameters:
+ *
+ * sourceName - name of the existing theme.
+ * targetName - name of the copy.
+ * obj - optional object of style parameter to apply to the new theme.
+ *
+ * returns:
+ *
+ * new Theme object.
+ */
+ $.jqplot.ThemeEngine.prototype.copy = function (sourceName, targetName, obj) {
+ if (targetName == 'Default') {
+ throw new Error ("jqplot.ThemeEngine Error: Cannot copy over Default theme");
+ }
+ if (!this.themes.hasOwnProperty(sourceName)) {
+ var s = "jqplot.ThemeEngine Error: Source name invalid";
+ throw new Error(s);
+ }
+ if (this.themes.hasOwnProperty(targetName)) {
+ var s = "jqplot.ThemeEngine Error: Target name invalid";
+ throw new Error(s);
+ }
+ else {
+ var th = clone(this.themes[sourceName]);
+ th._name = targetName;
+ $.jqplot.extend(true, th, obj);
+ this._add(th);
+ return th;
+ }
+ };
+
+
+ $.jqplot.Theme = function(name, obj) {
+ if (typeof(name) == 'object') {
+ obj = obj || name;
+ name = null;
+ }
+ name = name || Date.parse(new Date());
+ this._name = name;
+ this.target = {
+ backgroundColor: null
+ };
+ this.legend = {
+ textColor: null,
+ fontFamily: null,
+ fontSize: null,
+ border: null,
+ background: null
+ };
+ this.title = {
+ textColor: null,
+ fontFamily: null,
+ fontSize: null,
+ textAlign: null
+ };
+ this.seriesStyles = {};
+ this.series = [];
+ this.grid = {
+ drawGridlines: null,
+ gridLineColor: null,
+ gridLineWidth: null,
+ backgroundColor: null,
+ borderColor: null,
+ borderWidth: null,
+ shadow: null
+ };
+ this.axesStyles = {label:{}, ticks:{}};
+ this.axes = {};
+ if (typeof(obj) == 'string') {
+ this._name = obj;
+ }
+ else if(typeof(obj) == 'object') {
+ $.jqplot.extend(true, this, obj);
+ }
+ };
+
+ var AxisProperties = function() {
+ this.borderColor = null;
+ this.borderWidth = null;
+ this.ticks = new AxisTicks();
+ this.label = new AxisLabel();
+ };
+
+ var AxisTicks = function() {
+ this.show = null;
+ this.showGridline = null;
+ this.showLabel = null;
+ this.showMark = null;
+ this.size = null;
+ this.textColor = null;
+ this.whiteSpace = null;
+ this.fontSize = null;
+ this.fontFamily = null;
+ };
+
+ var AxisLabel = function() {
+ this.textColor = null;
+ this.whiteSpace = null;
+ this.fontSize = null;
+ this.fontFamily = null;
+ this.fontWeight = null;
+ };
+
+ var LineSeriesProperties = function() {
+ this.color=null;
+ this.lineWidth=null;
+ this.linePattern=null;
+ this.shadow=null;
+ this.fillColor=null;
+ this.showMarker=null;
+ this.markerOptions = new MarkerOptions();
+ };
+
+ var MarkerOptions = function() {
+ this.show = null;
+ this.style = null;
+ this.lineWidth = null;
+ this.size = null;
+ this.color = null;
+ this.shadow = null;
+ };
+
+ var BarSeriesProperties = function() {
+ this.color=null;
+ this.seriesColors=null;
+ this.lineWidth=null;
+ this.shadow=null;
+ this.barPadding=null;
+ this.barMargin=null;
+ this.barWidth=null;
+ this.highlightColors=null;
+ };
+
+ var PieSeriesProperties = function() {
+ this.seriesColors=null;
+ this.padding=null;
+ this.sliceMargin=null;
+ this.fill=null;
+ this.shadow=null;
+ this.startAngle=null;
+ this.lineWidth=null;
+ this.highlightColors=null;
+ };
+
+ var DonutSeriesProperties = function() {
+ this.seriesColors=null;
+ this.padding=null;
+ this.sliceMargin=null;
+ this.fill=null;
+ this.shadow=null;
+ this.startAngle=null;
+ this.lineWidth=null;
+ this.innerDiameter=null;
+ this.thickness=null;
+ this.ringMargin=null;
+ this.highlightColors=null;
+ };
+
+ var FunnelSeriesProperties = function() {
+ this.color=null;
+ this.lineWidth=null;
+ this.shadow=null;
+ this.padding=null;
+ this.sectionMargin=null;
+ this.seriesColors=null;
+ this.highlightColors=null;
+ };
+
+ var MeterSeriesProperties = function() {
+ this.padding=null;
+ this.backgroundColor=null;
+ this.ringColor=null;
+ this.tickColor=null;
+ this.ringWidth=null;
+ this.intervalColors=null;
+ this.intervalInnerRadius=null;
+ this.intervalOuterRadius=null;
+ this.hubRadius=null;
+ this.needleThickness=null;
+ this.needlePad=null;
+ };
+
+
+
+
+ $.fn.jqplotChildText = function() {
+ return $(this).contents().filter(function() {
+ return this.nodeType == 3; // Node.TEXT_NODE not defined in I7
+ }).text();
+ };
+
+ // Returns font style as abbreviation for "font" property.
+ $.fn.jqplotGetComputedFontStyle = function() {
+ var css = window.getComputedStyle ? window.getComputedStyle(this[0], "") : this[0].currentStyle;
+ var attrs = css['font-style'] ? ['font-style', 'font-weight', 'font-size', 'font-family'] : ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily'];
+ var style = [];
+
+ for (var i=0 ; i < attrs.length; ++i) {
+ var attr = String(css[attrs[i]]);
+
+ if (attr && attr != 'normal') {
+ style.push(attr);
+ }
+ }
+ return style.join(' ');
+ };
+
+ /**
+ * Namespace: $.fn
+ * jQuery namespace to attach functions to jQuery elements.
+ *
+ */
+
+ $.fn.jqplotToImageCanvas = function(options) {
+
+ options = options || {};
+ var x_offset = (options.x_offset == null) ? 0 : options.x_offset;
+ var y_offset = (options.y_offset == null) ? 0 : options.y_offset;
+ var backgroundColor = (options.backgroundColor == null) ? 'rgb(255,255,255)' : options.backgroundColor;
+
+ if ($(this).width() == 0 || $(this).height() == 0) {
+ return null;
+ }
+
+ // excanvas and hence IE < 9 do not support toDataURL and cannot export images.
+ if ($.jqplot.use_excanvas) {
+ return null;
+ }
+
+ var newCanvas = document.createElement("canvas");
+ var h = $(this).outerHeight(true);
+ var w = $(this).outerWidth(true);
+ var offs = $(this).offset();
+ var plotleft = offs.left;
+ var plottop = offs.top;
+ var transx = 0, transy = 0;
+
+ // have to check if any elements are hanging outside of plot area before rendering,
+ // since changing width of canvas will erase canvas.
+
+ var clses = ['jqplot-table-legend', 'jqplot-xaxis-tick', 'jqplot-x2axis-tick', 'jqplot-yaxis-tick', 'jqplot-y2axis-tick', 'jqplot-y3axis-tick',
+ 'jqplot-y4axis-tick', 'jqplot-y5axis-tick', 'jqplot-y6axis-tick', 'jqplot-y7axis-tick', 'jqplot-y8axis-tick', 'jqplot-y9axis-tick',
+ 'jqplot-xaxis-label', 'jqplot-x2axis-label', 'jqplot-yaxis-label', 'jqplot-y2axis-label', 'jqplot-y3axis-label', 'jqplot-y4axis-label',
+ 'jqplot-y5axis-label', 'jqplot-y6axis-label', 'jqplot-y7axis-label', 'jqplot-y8axis-label', 'jqplot-y9axis-label' ];
+
+ var temptop, templeft, tempbottom, tempright;
+
+ for (var i = 0; i < clses.length; i++) {
+ $(this).find('.'+clses[i]).each(function() {
+ temptop = $(this).offset().top - plottop;
+ templeft = $(this).offset().left - plotleft;
+ tempright = templeft + $(this).outerWidth(true) + transx;
+ tempbottom = temptop + $(this).outerHeight(true) + transy;
+ if (templeft < -transx) {
+ w = w - transx - templeft;
+ transx = -templeft;
+ }
+ if (temptop < -transy) {
+ h = h - transy - temptop;
+ transy = - temptop;
+ }
+ if (tempright > w) {
+ w = tempright;
+ }
+ if (tempbottom > h) {
+ h = tempbottom;
+ }
+ });
+ }
+
+ newCanvas.width = w + Number(x_offset);
+ newCanvas.height = h + Number(y_offset);
+
+ var newContext = newCanvas.getContext("2d");
+
+ newContext.save();
+ newContext.fillStyle = backgroundColor;
+ newContext.fillRect(0,0, newCanvas.width, newCanvas.height);
+ newContext.restore();
+
+ newContext.translate(transx, transy);
+ newContext.textAlign = 'left';
+ newContext.textBaseline = 'top';
+
+ function getLineheight(el) {
+ var lineheight = parseInt($(el).css('line-height'), 10);
+
+ if (isNaN(lineheight)) {
+ lineheight = parseInt($(el).css('font-size'), 10) * 1.2;
+ }
+ return lineheight;
+ }
+
+ function writeWrappedText (el, context, text, left, top, canvasWidth) {
+ var lineheight = getLineheight(el);
+ var tagwidth = $(el).innerWidth();
+ var tagheight = $(el).innerHeight();
+ var words = text.split(/\s+/);
+ var wl = words.length;
+ var w = '';
+ var breaks = [];
+ var temptop = top;
+ var templeft = left;
+
+ for (var i=0; i<wl; i++) {
+ w += words[i];
+ if (context.measureText(w).width > tagwidth) {
+ breaks.push(i);
+ w = '';
+ i--;
+ }
+ }
+ if (breaks.length === 0) {
+ // center text if necessary
+ if ($(el).css('textAlign') === 'center') {
+ templeft = left + (canvasWidth - context.measureText(w).width)/2 - transx;
+ }
+ context.fillText(text, templeft, top);
+ }
+ else {
+ w = words.slice(0, breaks[0]).join(' ');
+ // center text if necessary
+ if ($(el).css('textAlign') === 'center') {
+ templeft = left + (canvasWidth - context.measureText(w).width)/2 - transx;
+ }
+ context.fillText(w, templeft, temptop);
+ temptop += lineheight;
+ for (var i=1, l=breaks.length; i<l; i++) {
+ w = words.slice(breaks[i-1], breaks[i]).join(' ');
+ // center text if necessary
+ if ($(el).css('textAlign') === 'center') {
+ templeft = left + (canvasWidth - context.measureText(w).width)/2 - transx;
+ }
+ context.fillText(w, templeft, temptop);
+ temptop += lineheight;
+ }
+ w = words.slice(breaks[i-1], words.length).join(' ');
+ // center text if necessary
+ if ($(el).css('textAlign') === 'center') {
+ templeft = left + (canvasWidth - context.measureText(w).width)/2 - transx;
+ }
+ context.fillText(w, templeft, temptop);
+ }
+
+ }
+
+ function _jqpToImage(el, x_offset, y_offset) {
+ var tagname = el.tagName.toLowerCase();
+ var p = $(el).position();
+ var css = window.getComputedStyle ? window.getComputedStyle(el, "") : el.currentStyle; // for IE < 9
+ var left = x_offset + p.left + parseInt(css.marginLeft, 10) + parseInt(css.borderLeftWidth, 10) + parseInt(css.paddingLeft, 10);
+ var top = y_offset + p.top + parseInt(css.marginTop, 10) + parseInt(css.borderTopWidth, 10)+ parseInt(css.paddingTop, 10);
+ var w = newCanvas.width;
+ // var left = x_offset + p.left + $(el).css('marginLeft') + $(el).css('borderLeftWidth')
+
+ // somehow in here, for divs within divs, the width of the inner div should be used instead of the canvas.
+
+ if ((tagname == 'div' || tagname == 'span') && !$(el).hasClass('jqplot-highlighter-tooltip')) {
+ $(el).children().each(function() {
+ _jqpToImage(this, left, top);
+ });
+ var text = $(el).jqplotChildText();
+
+ if (text) {
+ newContext.font = $(el).jqplotGetComputedFontStyle();
+ newContext.fillStyle = $(el).css('color');
+
+ writeWrappedText(el, newContext, text, left, top, w);
+ }
+ }
+
+ // handle the standard table legend
+
+ else if (tagname === 'table' && $(el).hasClass('jqplot-table-legend')) {
+ newContext.strokeStyle = $(el).css('border-top-color');
+ newContext.fillStyle = $(el).css('background-color');
+ newContext.fillRect(left, top, $(el).innerWidth(), $(el).innerHeight());
+ if (parseInt($(el).css('border-top-width'), 10) > 0) {
+ newContext.strokeRect(left, top, $(el).innerWidth(), $(el).innerHeight());
+ }
+
+ // find all the swatches
+ $(el).find('div.jqplot-table-legend-swatch-outline').each(function() {
+ // get the first div and stroke it
+ var elem = $(this);
+ newContext.strokeStyle = elem.css('border-top-color');
+ var l = left + elem.position().left;
+ var t = top + elem.position().top;
+ newContext.strokeRect(l, t, elem.innerWidth(), elem.innerHeight());
+
+ // now fill the swatch
+
+ l += parseInt(elem.css('padding-left'), 10);
+ t += parseInt(elem.css('padding-top'), 10);
+ var h = elem.innerHeight() - 2 * parseInt(elem.css('padding-top'), 10);
+ var w = elem.innerWidth() - 2 * parseInt(elem.css('padding-left'), 10);
+
+ var swatch = elem.children('div.jqplot-table-legend-swatch');
+ newContext.fillStyle = swatch.css('background-color');
+ newContext.fillRect(l, t, w, h);
+ });
+
+ // now add text
+
+ $(el).find('td.jqplot-table-legend-label').each(function(){
+ var elem = $(this);
+ var l = left + elem.position().left;
+ var t = top + elem.position().top + parseInt(elem.css('padding-top'), 10);
+ newContext.font = elem.jqplotGetComputedFontStyle();
+ newContext.fillStyle = elem.css('color');
+ writeWrappedText(elem, newContext, elem.text(), l, t, w);
+ });
+
+ var elem = null;
+ }
+
+ else if (tagname == 'canvas') {
+ newContext.drawImage(el, left, top);
+ }
+ }
+ $(this).children().each(function() {
+ _jqpToImage(this, x_offset, y_offset);
+ });
+ return newCanvas;
+ };
+
+ // return the raw image data string.
+ // Should work on canvas supporting browsers.
+ $.fn.jqplotToImageStr = function(options) {
+ var imgCanvas = $(this).jqplotToImageCanvas(options);
+ if (imgCanvas) {
+ return imgCanvas.toDataURL("image/png");
+ }
+ else {
+ return null;
+ }
+ };
+
+ // return a DOM <img> element and return it.
+ // Should work on canvas supporting browsers.
+ $.fn.jqplotToImageElem = function(options) {
+ var elem = document.createElement("img");
+ var str = $(this).jqplotToImageStr(options);
+ elem.src = str;
+ return elem;
+ };
+
+ // return a string for an <img> element and return it.
+ // Should work on canvas supporting browsers.
+ $.fn.jqplotToImageElemStr = function(options) {
+ var str = '<img src='+$(this).jqplotToImageStr(options)+' />';
+ return str;
+ };
+
+ // Not gauranteed to work, even on canvas supporting browsers due to
+ // limitations with location.href and browser support.
+ $.fn.jqplotSaveImage = function() {
+ var imgData = $(this).jqplotToImageStr({});
+ if (imgData) {
+ window.location.href = imgData.replace("image/png", "image/octet-stream");
+ }
+
+ };
+
+ // Not gauranteed to work, even on canvas supporting browsers due to
+ // limitations with window.open and arbitrary data.
+ $.fn.jqplotViewImage = function() {
+ var imgStr = $(this).jqplotToImageElemStr({});
+ var imgData = $(this).jqplotToImageStr({});
+ if (imgStr) {
+ var w = window.open('');
+ w.document.open("image/png");
+ w.document.write(imgStr);
+ w.document.close();
+ w = null;
+ }
+ };
+
+
+
+
+ /**
+ * @description
+ * <p>Object with extended date parsing and formatting capabilities.
+ * This library borrows many concepts and ideas from the Date Instance
+ * Methods by Ken Snyder along with some parts of Ken's actual code.</p>
+ *
+ * <p>jsDate takes a different approach by not extending the built-in
+ * Date Object, improving date parsing, allowing for multiple formatting
+ * syntaxes and multiple and more easily expandable localization.</p>
+ *
+ * @author Chris Leonello
+ * @date #date#
+ * @version #VERSION#
+ * @copyright (c) 2010 Chris Leonello
+ * jsDate is currently available for use in all personal or commercial projects
+ * under both the MIT and GPL version 2.0 licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * <p>Ken's origianl Date Instance Methods and copyright notice:</p>
+ * <pre>
+ * Ken Snyder (ken d snyder at gmail dot com)
+ * 2008-09-10
+ * version 2.0.2 (http://kendsnyder.com/sandbox/date/)
+ * Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
+ * </pre>
+ *
+ * @class
+ * @name jsDate
+ * @param {String | Number | Array | Date Object | Options Object} arguments Optional arguments, either a parsable date/time string,
+ * a JavaScript timestamp, an array of numbers of form [year, month, day, hours, minutes, seconds, milliseconds],
+ * a Date object, or an options object of form {syntax: "perl", date:some Date} where all options are optional.
+ */
+
+ var jsDate = function () {
+
+ this.syntax = jsDate.config.syntax;
+ this._type = "jsDate";
+ this.proxy = new Date();
+ this.options = {};
+ this.locale = jsDate.regional.getLocale();
+ this.formatString = '';
+ this.defaultCentury = jsDate.config.defaultCentury;
+
+ switch ( arguments.length ) {
+ case 0:
+ break;
+ case 1:
+ // other objects either won't have a _type property or,
+ // if they do, it shouldn't be set to "jsDate", so
+ // assume it is an options argument.
+ if (get_type(arguments[0]) == "[object Object]" && arguments[0]._type != "jsDate") {
+ var opts = this.options = arguments[0];
+ this.syntax = opts.syntax || this.syntax;
+ this.defaultCentury = opts.defaultCentury || this.defaultCentury;
+ this.proxy = jsDate.createDate(opts.date);
+ }
+ else {
+ this.proxy = jsDate.createDate(arguments[0]);
+ }
+ break;
+ default:
+ var a = [];
+ for ( var i=0; i<arguments.length; i++ ) {
+ a.push(arguments[i]);
+ }
+ // this should be the current date/time?
+ this.proxy = new Date();
+ this.proxy.setFullYear.apply( this.proxy, a.slice(0,3) );
+ if ( a.slice(3).length ) {
+ this.proxy.setHours.apply( this.proxy, a.slice(3) );
+ }
+ break;
+ }
+ };
+
+ /**
+ * @namespace Configuration options that will be used as defaults for all instances on the page.
+ * @property {String} defaultLocale The default locale to use [en].
+ * @property {String} syntax The default syntax to use [perl].
+ * @property {Number} defaultCentury The default centry for 2 digit dates.
+ */
+ jsDate.config = {
+ defaultLocale: 'en',
+ syntax: 'perl',
+ defaultCentury: 1900
+ };
+
+ /**
+ * Add an arbitrary amount to the currently stored date
+ *
+ * @param {Number} number
+ * @param {String} unit
+ * @returns {jsDate}
+ */
+
+ jsDate.prototype.add = function(number, unit) {
+ var factor = multipliers[unit] || multipliers.day;
+ if (typeof factor == 'number') {
+ this.proxy.setTime(this.proxy.getTime() + (factor * number));
+ } else {
+ factor.add(this, number);
+ }
+ return this;
+ };
+
+ /**
+ * Create a new jqplot.date object with the same date
+ *
+ * @returns {jsDate}
+ */
+
+ jsDate.prototype.clone = function() {
+ return new jsDate(this.proxy.getTime());
+ };
+
+ /**
+ * Get the UTC TimeZone Offset of this date in milliseconds.
+ *
+ * @returns {Number}
+ */
+
+ jsDate.prototype.getUtcOffset = function() {
+ return this.proxy.getTimezoneOffset() * 60000;
+ };
+
+ /**
+ * Find the difference between this jsDate and another date.
+ *
+ * @param {String| Number| Array| jsDate Object| Date Object} dateObj
+ * @param {String} unit
+ * @param {Boolean} allowDecimal
+ * @returns {Number} Number of units difference between dates.
+ */
+
+ jsDate.prototype.diff = function(dateObj, unit, allowDecimal) {
+ // ensure we have a Date object
+ dateObj = new jsDate(dateObj);
+ if (dateObj === null) {
+ return null;
+ }
+ // get the multiplying factor integer or factor function
+ var factor = multipliers[unit] || multipliers.day;
+ if (typeof factor == 'number') {
+ // multiply
+ var unitDiff = (this.proxy.getTime() - dateObj.proxy.getTime()) / factor;
+ } else {
+ // run function
+ var unitDiff = factor.diff(this.proxy, dateObj.proxy);
+ }
+ // if decimals are not allowed, round toward zero
+ return (allowDecimal ? unitDiff : Math[unitDiff > 0 ? 'floor' : 'ceil'](unitDiff));
+ };
+
+ /**
+ * Get the abbreviated name of the current week day
+ *
+ * @returns {String}
+ */
+
+ jsDate.prototype.getAbbrDayName = function() {
+ return jsDate.regional[this.locale]["dayNamesShort"][this.proxy.getDay()];
+ };
+
+ /**
+ * Get the abbreviated name of the current month
+ *
+ * @returns {String}
+ */
+
+ jsDate.prototype.getAbbrMonthName = function() {
+ return jsDate.regional[this.locale]["monthNamesShort"][this.proxy.getMonth()];
+ };
+
+ /**
+ * Get UPPER CASE AM or PM for the current time
+ *
+ * @returns {String}
+ */
+
+ jsDate.prototype.getAMPM = function() {
+ return this.proxy.getHours() >= 12 ? 'PM' : 'AM';
+ };
+
+ /**
+ * Get lower case am or pm for the current time
+ *
+ * @returns {String}
+ */
+
+ jsDate.prototype.getAmPm = function() {
+ return this.proxy.getHours() >= 12 ? 'pm' : 'am';
+ };
+
+ /**
+ * Get the century (19 for 20th Century)
+ *
+ * @returns {Integer} Century (19 for 20th century).
+ */
+ jsDate.prototype.getCentury = function() {
+ return parseInt(this.proxy.getFullYear()/100, 10);
+ };
+
+ /**
+ * Implements Date functionality
+ */
+ jsDate.prototype.getDate = function() {
+ return this.proxy.getDate();
+ };
+
+ /**
+ * Implements Date functionality
+ */
+ jsDate.prototype.getDay = function() {
+ return this.proxy.getDay();
+ };
+
+ /**
+ * Get the Day of week 1 (Monday) thru 7 (Sunday)
+ *
+ * @returns {Integer} Day of week 1 (Monday) thru 7 (Sunday)
+ */
+ jsDate.prototype.getDayOfWeek = function() {
+ var dow = this.proxy.getDay();
+ return dow===0?7:dow;
+ };
+
+ /**
+ * Get the day of the year
+ *
+ * @returns {Integer} 1 - 366, day of the year
+ */
+ jsDate.prototype.getDayOfYear = function() {
+ var d = this.proxy;
+ var ms = d - new Date('' + d.getFullYear() + '/1/1 GMT');
+ ms += d.getTimezoneOffset()*60000;
+ d = null;
+ return parseInt(ms/60000/60/24, 10)+1;
+ };
+
+ /**
+ * Get the name of the current week day
+ *
+ * @returns {String}
+ */
+
+ jsDate.prototype.getDayName = function() {
+ return jsDate.regional[this.locale]["dayNames"][this.proxy.getDay()];
+ };
+
+ /**
+ * Get the week number of the given year, starting with the first Sunday as the first week
+ * @returns {Integer} Week number (13 for the 13th full week of the year).
+ */
+ jsDate.prototype.getFullWeekOfYear = function() {
+ var d = this.proxy;
+ var doy = this.getDayOfYear();
+ var rdow = 6-d.getDay();
+ var woy = parseInt((doy+rdow)/7, 10);
+ return woy;
+ };
+
+ /**
+ * Implements Date functionality
+ */
+ jsDate.prototype.getFullYear = function() {
+ return this.proxy.getFullYear();
+ };
+
+ /**
+ * Get the GMT offset in hours and minutes (e.g. +06:30)
+ *
+ * @returns {String}
+ */
+
+ jsDate.prototype.getGmtOffset = function() {
+ // divide the minutes offset by 60
+ var hours = this.proxy.getTimezoneOffset() / 60;
+ // decide if we are ahead of or behind GMT
+ var prefix = hours < 0 ? '+' : '-';
+ // remove the negative sign if any
+ hours = Math.abs(hours);
+ // add the +/- to the padded number of hours to : to the padded minutes
+ return prefix + addZeros(Math.floor(hours), 2) + ':' + addZeros((hours % 1) * 60, 2);
+ };
+
+ /**
+ * Implements Date functionality
+ */
+ jsDate.prototype.getHours = function() {
+ return this.proxy.getHours();
+ };
+
+ /**
+ * Get the current hour on a 12-hour scheme
+ *
+ * @returns {Integer}
+ */
+
+ jsDate.prototype.getHours12 = function() {
+ var hours = this.proxy.getHours();
+ return hours > 12 ? hours - 12 : (hours == 0 ? 12 : hours);
+ };
+
+
+ jsDate.prototype.getIsoWeek = function() {
+ var d = this.proxy;
+ var woy = d.getWeekOfYear();
+ var dow1_1 = (new Date('' + d.getFullYear() + '/1/1')).getDay();
+ // First week is 01 and not 00 as in the case of %U and %W,
+ // so we add 1 to the final result except if day 1 of the year
+ // is a Monday (then %W returns 01).
+ // We also need to subtract 1 if the day 1 of the year is
+ // Friday-Sunday, so the resulting equation becomes:
+ var idow = woy + (dow1_1 > 4 || dow1_1 <= 1 ? 0 : 1);
+ if(idow == 53 && (new Date('' + d.getFullYear() + '/12/31')).getDay() < 4)
+ {
+ idow = 1;
+ }
+ else if(idow === 0)
+ {
+ d = new jsDate(new Date('' + (d.getFullYear()-1) + '/12/31'));
+ idow = d.getIsoWeek();
+ }
+ d = null;
+ return idow;
+ };
+
+ /**
+ * Implements Date functionality
+ */
+ jsDate.prototype.getMilliseconds = function() {
+ return this.proxy.getMilliseconds();
+ };
+
+ /**
+ * Implements Date functionality
+ */
+ jsDate.prototype.getMinutes = function() {
+ return this.proxy.getMinutes();
+ };
+
+ /**
+ * Implements Date functionality
+ */
+ jsDate.prototype.getMonth = function() {
+ return this.proxy.getMonth();
+ };
+
+ /**
+ * Get the name of the current month
+ *
+ * @returns {String}
+ */
+
+ jsDate.prototype.getMonthName = function() {
+ return jsDate.regional[this.locale]["monthNames"][this.proxy.getMonth()];
+ };
+
+ /**
+ * Get the number of the current month, 1-12
+ *
+ * @returns {Integer}
+ */
+
+ jsDate.prototype.getMonthNumber = function() {
+ return this.proxy.getMonth() + 1;
+ };
+
+ /**
+ * Implements Date functionality
+ */
+ jsDate.prototype.getSeconds = function() {
+ return this.proxy.getSeconds();
+ };
+
+ /**
+ * Return a proper two-digit year integer
+ *
+ * @returns {Integer}
+ */
+
+ jsDate.prototype.getShortYear = function() {
+ return this.proxy.getYear() % 100;
+ };
+
+ /**
+ * Implements Date functionality
+ */
+ jsDate.prototype.getTime = function() {
+ return this.proxy.getTime();
+ };
+
+ /**
+ * Get the timezone abbreviation
+ *
+ * @returns {String} Abbreviation for the timezone
+ */
+ jsDate.prototype.getTimezoneAbbr = function() {
+ return this.proxy.toString().replace(/^.*\(([^)]+)\)$/, '$1');
+ };
+
+ /**
+ * Get the browser-reported name for the current timezone (e.g. MDT, Mountain Daylight Time)
+ *
+ * @returns {String}
+ */
+ jsDate.prototype.getTimezoneName = function() {
+ var match = /(?:\((.+)\)$| ([A-Z]{3}) )/.exec(this.toString());
+ return match[1] || match[2] || 'GMT' + this.getGmtOffset();
+ };
+
+ /**
+ * Implements Date functionality
+ */
+ jsDate.prototype.getTimezoneOffset = function() {
+ return this.proxy.getTimezoneOffset();
+ };
+
+
+ /**
+ * Get the week number of the given year, starting with the first Monday as the first week
+ * @returns {Integer} Week number (13 for the 13th week of the year).
+ */
+ jsDate.prototype.getWeekOfYear = function() {
+ var doy = this.getDayOfYear();
+ var rdow = 7 - this.getDayOfWeek();
+ var woy = parseInt((doy+rdow)/7, 10);
+ return woy;
+ };
+
+ /**
+ * Get the current date as a Unix timestamp
+ *
+ * @returns {Integer}
+ */
+
+ jsDate.prototype.getUnix = function() {
+ return Math.round(this.proxy.getTime() / 1000, 0);
+ };
+
+ /**
+ * Implements Date functionality
+ */
+ jsDate.prototype.getYear = function() {
+ return this.proxy.getYear();
+ };
+
+ /**
+ * Return a date one day ahead (or any other unit)
+ *
+ * @param {String} unit Optional, year | month | day | week | hour | minute | second | millisecond
+ * @returns {jsDate}
+ */
+
+ jsDate.prototype.next = function(unit) {
+ unit = unit || 'day';
+ return this.clone().add(1, unit);
+ };
+
+ /**
+ * Set the jsDate instance to a new date.
+ *
+ * @param {String | Number | Array | Date Object | jsDate Object | Options Object} arguments Optional arguments,
+ * either a parsable date/time string,
+ * a JavaScript timestamp, an array of numbers of form [year, month, day, hours, minutes, seconds, milliseconds],
+ * a Date object, jsDate Object or an options object of form {syntax: "perl", date:some Date} where all options are optional.
+ */
+ jsDate.prototype.set = function() {
+ switch ( arguments.length ) {
+ case 0:
+ this.proxy = new Date();
+ break;
+ case 1:
+ // other objects either won't have a _type property or,
+ // if they do, it shouldn't be set to "jsDate", so
+ // assume it is an options argument.
+ if (get_type(arguments[0]) == "[object Object]" && arguments[0]._type != "jsDate") {
+ var opts = this.options = arguments[0];
+ this.syntax = opts.syntax || this.syntax;
+ this.defaultCentury = opts.defaultCentury || this.defaultCentury;
+ this.proxy = jsDate.createDate(opts.date);
+ }
+ else {
+ this.proxy = jsDate.createDate(arguments[0]);
+ }
+ break;
+ default:
+ var a = [];
+ for ( var i=0; i<arguments.length; i++ ) {
+ a.push(arguments[i]);
+ }
+ // this should be the current date/time
+ this.proxy = new Date();
+ this.proxy.setFullYear.apply( this.proxy, a.slice(0,3) );
+ if ( a.slice(3).length ) {
+ this.proxy.setHours.apply( this.proxy, a.slice(3) );
+ }
+ break;
+ }
+ return this;
+ };
+
+ /**
+ * Sets the day of the month for a specified date according to local time.
+ * @param {Integer} dayValue An integer from 1 to 31, representing the day of the month.
+ */
+ jsDate.prototype.setDate = function(n) {
+ this.proxy.setDate(n);
+ return this;
+ };
+
+ /**
+ * Sets the full year for a specified date according to local time.
+ * @param {Integer} yearValue The numeric value of the year, for example, 1995.
+ * @param {Integer} monthValue Optional, between 0 and 11 representing the months January through December.
+ * @param {Integer} dayValue Optional, between 1 and 31 representing the day of the month. If you specify the dayValue parameter, you must also specify the monthValue.
+ */
+ jsDate.prototype.setFullYear = function() {
+ this.proxy.setFullYear.apply(this.proxy, arguments);
+ return this;
+ };
+
+ /**
+ * Sets the hours for a specified date according to local time.
+ *
+ * @param {Integer} hoursValue An integer between 0 and 23, representing the hour.
+ * @param {Integer} minutesValue Optional, An integer between 0 and 59, representing the minutes.
+ * @param {Integer} secondsValue Optional, An integer between 0 and 59, representing the seconds.
+ * If you specify the secondsValue parameter, you must also specify the minutesValue.
+ * @param {Integer} msValue Optional, A number between 0 and 999, representing the milliseconds.
+ * If you specify the msValue parameter, you must also specify the minutesValue and secondsValue.
+ */
+ jsDate.prototype.setHours = function() {
+ this.proxy.setHours.apply(this.proxy, arguments);
+ return this;
+ };
+
+ /**
+ * Implements Date functionality
+ */
+ jsDate.prototype.setMilliseconds = function(n) {
+ this.proxy.setMilliseconds(n);
+ return this;
+ };
+
+ /**
+ * Implements Date functionality
+ */
+ jsDate.prototype.setMinutes = function() {
+ this.proxy.setMinutes.apply(this.proxy, arguments);
+ return this;
+ };
+
+ /**
+ * Implements Date functionality
+ */
+ jsDate.prototype.setMonth = function() {
+ this.proxy.setMonth.apply(this.proxy, arguments);
+ return this;
+ };
+
+ /**
+ * Implements Date functionality
+ */
+ jsDate.prototype.setSeconds = function() {
+ this.proxy.setSeconds.apply(this.proxy, arguments);
+ return this;
+ };
+
+ /**
+ * Implements Date functionality
+ */
+ jsDate.prototype.setTime = function(n) {
+ this.proxy.setTime(n);
+ return this;
+ };
+
+ /**
+ * Implements Date functionality
+ */
+ jsDate.prototype.setYear = function() {
+ this.proxy.setYear.apply(this.proxy, arguments);
+ return this;
+ };
+
+ /**
+ * Provide a formatted string representation of this date.
+ *
+ * @param {String} formatString A format string.
+ * See: {@link jsDate.formats}.
+ * @returns {String} Date String.
+ */
+
+ jsDate.prototype.strftime = function(formatString) {
+ formatString = formatString || this.formatString || jsDate.regional[this.locale]['formatString'];
+ return jsDate.strftime(this, formatString, this.syntax);
+ };
+
+ /**
+ * Return a String representation of this jsDate object.
+ * @returns {String} Date string.
+ */
+
+ jsDate.prototype.toString = function() {
+ return this.proxy.toString();
+ };
+
+ /**
+ * Convert the current date to an 8-digit integer (%Y%m%d)
+ *
+ * @returns {Integer}
+ */
+
+ jsDate.prototype.toYmdInt = function() {
+ return (this.proxy.getFullYear() * 10000) + (this.getMonthNumber() * 100) + this.proxy.getDate();
+ };
+
+ /**
+ * @namespace Holds localizations for month/day names.
+ * <p>jsDate attempts to detect locale when loaded and defaults to 'en'.
+ * If a localization is detected which is not available, jsDate defaults to 'en'.
+ * Additional localizations can be added after jsDate loads. After adding a localization,
+ * call the jsDate.regional.getLocale() method. Currently, en, fr and de are defined.</p>
+ *
+ * <p>Localizations must be an object and have the following properties defined: monthNames, monthNamesShort, dayNames, dayNamesShort and Localizations are added like:</p>
+ * <pre class="code">
+ * jsDate.regional['en'] = {
+ * monthNames : 'January February March April May June July August September October November December'.split(' '),
+ * monthNamesShort : 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' '),
+ * dayNames : 'Sunday Monday Tuesday Wednesday Thursday Friday Saturday'.split(' '),
+ * dayNamesShort : 'Sun Mon Tue Wed Thu Fri Sat'.split(' ')
+ * };
+ * </pre>
+ * <p>After adding localizations, call <code>jsDate.regional.getLocale();</code> to update the locale setting with the
+ * new localizations.</p>
+ */
+
+ jsDate.regional = {
+ 'en': {
+ monthNames: ['January','February','March','April','May','June','July','August','September','October','November','December'],
+ monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun','Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
+ dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
+ dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
+ formatString: '%Y-%m-%d %H:%M:%S'
+ },
+
+ 'fr': {
+ monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin','Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
+ monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun','Jul','Aoû','Sep','Oct','Nov','Déc'],
+ dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
+ dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
+ formatString: '%Y-%m-%d %H:%M:%S'
+ },
+
+ 'de': {
+ monthNames: ['Januar','Februar','März','April','Mai','Juni','Juli','August','September','Oktober','November','Dezember'],
+ monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun','Jul','Aug','Sep','Okt','Nov','Dez'],
+ dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
+ dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
+ formatString: '%Y-%m-%d %H:%M:%S'
+ },
+
+ 'es': {
+ monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio', 'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'],
+ monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun', 'Jul','Ago','Sep','Oct','Nov','Dic'],
+ dayNames: ['Domingo','Lunes','Martes','Miércoles','Jueves','Viernes','Sábado'],
+ dayNamesShort: ['Dom','Lun','Mar','Mié','Juv','Vie','Sáb'],
+ formatString: '%Y-%m-%d %H:%M:%S'
+ },
+
+ 'ru': {
+ monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь','Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],
+ monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн','Июл','Авг','Сен','Окт','Ноя','Дек'],
+ dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'],
+ dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'],
+ formatString: '%Y-%m-%d %H:%M:%S'
+ },
+
+ 'ar': {
+ monthNames: ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'آذار', 'حزيران','تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'],
+ monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'],
+ dayNames: ['السبت', 'الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة'],
+ dayNamesShort: ['سبت', 'أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة'],
+ formatString: '%Y-%m-%d %H:%M:%S'
+ },
+
+ 'pt': {
+ monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
+ monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'],
+ dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sábado'],
+ dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'],
+ formatString: '%Y-%m-%d %H:%M:%S'
+ },
+
+ 'pt-BR': {
+ monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho', 'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
+ monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'],
+ dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sábado'],
+ dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'],
+ formatString: '%Y-%m-%d %H:%M:%S'
+ }
+
+
+ };
+
+ // Set english variants to 'en'
+ jsDate.regional['en-US'] = jsDate.regional['en-GB'] = jsDate.regional['en'];
+
+ /**
+ * Try to determine the users locale based on the lang attribute of the html page. Defaults to 'en'
+ * if it cannot figure out a locale of if the locale does not have a localization defined.
+ * @returns {String} locale
+ */
+
+ jsDate.regional.getLocale = function () {
+ var l = jsDate.config.defaultLocale;
+
+ if ( document && document.getElementsByTagName('html') && document.getElementsByTagName('html')[0].lang ) {
+ l = document.getElementsByTagName('html')[0].lang;
+ if (!jsDate.regional.hasOwnProperty(l)) {
+ l = jsDate.config.defaultLocale;
+ }
+ }
+
+ return l;
+ };
+
+ // ms in day
+ var day = 24 * 60 * 60 * 1000;
+
+ // padd a number with zeros
+ var addZeros = function(num, digits) {
+ num = String(num);
+ var i = digits - num.length;
+ var s = String(Math.pow(10, i)).slice(1);
+ return s.concat(num);
+ };
+
+ // representations used for calculating differences between dates.
+ // This borrows heavily from Ken Snyder's work.
+ var multipliers = {
+ millisecond: 1,
+ second: 1000,
+ minute: 60 * 1000,
+ hour: 60 * 60 * 1000,
+ day: day,
+ week: 7 * day,
+ month: {
+ // add a number of months
+ add: function(d, number) {
+ // add any years needed (increments of 12)
+ multipliers.year.add(d, Math[number > 0 ? 'floor' : 'ceil'](number / 12));
+ // ensure that we properly wrap betwen December and January
+ // 11 % 12 = 11
+ // 12 % 12 = 0
+ var prevMonth = d.getMonth() + (number % 12);
+ if (prevMonth == 12) {
+ prevMonth = 0;
+ d.setYear(d.getFullYear() + 1);
+ } else if (prevMonth == -1) {
+ prevMonth = 11;
+ d.setYear(d.getFullYear() - 1);
+ }
+ d.setMonth(prevMonth);
+ },
+ // get the number of months between two Date objects (decimal to the nearest day)
+ diff: function(d1, d2) {
+ // get the number of years
+ var diffYears = d1.getFullYear() - d2.getFullYear();
+ // get the number of remaining months
+ var diffMonths = d1.getMonth() - d2.getMonth() + (diffYears * 12);
+ // get the number of remaining days
+ var diffDays = d1.getDate() - d2.getDate();
+ // return the month difference with the days difference as a decimal
+ return diffMonths + (diffDays / 30);
+ }
+ },
+ year: {
+ // add a number of years
+ add: function(d, number) {
+ d.setYear(d.getFullYear() + Math[number > 0 ? 'floor' : 'ceil'](number));
+ },
+ // get the number of years between two Date objects (decimal to the nearest day)
+ diff: function(d1, d2) {
+ return multipliers.month.diff(d1, d2) / 12;
+ }
+ }
+ };
+ //
+ // Alias each multiplier with an 's' to allow 'year' and 'years' for example.
+ // This comes from Ken Snyders work.
+ //
+ for (var unit in multipliers) {
+ if (unit.substring(unit.length - 1) != 's') { // IE will iterate newly added properties :|
+ multipliers[unit + 's'] = multipliers[unit];
+ }
+ }
+
+ //
+ // take a jsDate instance and a format code and return the formatted value.
+ // This is a somewhat modified version of Ken Snyder's method.
+ //
+ var format = function(d, code, syntax) {
+ // if shorcut codes are used, recursively expand those.
+ if (jsDate.formats[syntax]["shortcuts"][code]) {
+ return jsDate.strftime(d, jsDate.formats[syntax]["shortcuts"][code], syntax);
+ } else {
+ // get the format code function and addZeros() argument
+ var getter = (jsDate.formats[syntax]["codes"][code] || '').split('.');
+ var nbr = d['get' + getter[0]] ? d['get' + getter[0]]() : '';
+ if (getter[1]) {
+ nbr = addZeros(nbr, getter[1]);
+ }
+ return nbr;
+ }
+ };
+
+ /**
+ * @static
+ * Static function for convert a date to a string according to a given format. Also acts as namespace for strftime format codes.
+ * <p>strftime formatting can be accomplished without creating a jsDate object by calling jsDate.strftime():</p>
+ * <pre class="code">
+ * var formattedDate = jsDate.strftime('Feb 8, 2006 8:48:32', '%Y-%m-%d %H:%M:%S');
+ * </pre>
+ * @param {String | Number | Array | jsDate Object | Date Object} date A parsable date string, JavaScript time stamp, Array of form [year, month, day, hours, minutes, seconds, milliseconds], jsDate Object or Date object.
+ * @param {String} formatString String with embedded date formatting codes.
+ * See: {@link jsDate.formats}.
+ * @param {String} syntax Optional syntax to use [default perl].
+ * @param {String} locale Optional locale to use.
+ * @returns {String} Formatted representation of the date.
+ */
+ //
+ // Logic as implemented here is very similar to Ken Snyder's Date Instance Methods.
+ //
+ jsDate.strftime = function(d, formatString, syntax, locale) {
+ var syn = 'perl';
+ var loc = jsDate.regional.getLocale();
+
+ // check if syntax and locale are available or reversed
+ if (syntax && jsDate.formats.hasOwnProperty(syntax)) {
+ syn = syntax;
+ }
+ else if (syntax && jsDate.regional.hasOwnProperty(syntax)) {
+ loc = syntax;
+ }
+
+ if (locale && jsDate.formats.hasOwnProperty(locale)) {
+ syn = locale;
+ }
+ else if (locale && jsDate.regional.hasOwnProperty(locale)) {
+ loc = locale;
+ }
+
+ if (get_type(d) != "[object Object]" || d._type != "jsDate") {
+ d = new jsDate(d);
+ d.locale = loc;
+ }
+ if (!formatString) {
+ formatString = d.formatString || jsDate.regional[loc]['formatString'];
+ }
+ // default the format string to year-month-day
+ var source = formatString || '%Y-%m-%d',
+ result = '',
+ match;
+ // replace each format code
+ while (source.length > 0) {
+ if (match = source.match(jsDate.formats[syn].codes.matcher)) {
+ result += source.slice(0, match.index);
+ result += (match[1] || '') + format(d, match[2], syn);
+ source = source.slice(match.index + match[0].length);
+ } else {
+ result += source;
+ source = '';
+ }
+ }
+ return result;
+ };
+
+ /**
+ * @namespace
+ * Namespace to hold format codes and format shortcuts. "perl" and "php" format codes
+ * and shortcuts are defined by default. Additional codes and shortcuts can be
+ * added like:
+ *
+ * <pre class="code">
+ * jsDate.formats["perl"] = {
+ * "codes": {
+ * matcher: /someregex/,
+ * Y: "fullYear", // name of "get" method without the "get",
+ * ..., // more codes
+ * },
+ * "shortcuts": {
+ * F: '%Y-%m-%d',
+ * ..., // more shortcuts
+ * }
+ * };
+ * </pre>
+ *
+ * <p>Additionally, ISO and SQL shortcuts are defined and can be accesses via:
+ * <code>jsDate.formats.ISO</code> and <code>jsDate.formats.SQL</code>
+ */
+
+ jsDate.formats = {
+ ISO:'%Y-%m-%dT%H:%M:%S.%N%G',
+ SQL:'%Y-%m-%d %H:%M:%S'
+ };
+
+ /**
+ * Perl format codes and shortcuts for strftime.
+ *
+ * A hash (object) of codes where each code must be an array where the first member is
+ * the name of a Date.prototype or jsDate.prototype function to call
+ * and optionally a second member indicating the number to pass to addZeros()
+ *
+ * <p>The following format codes are defined:</p>
+ *
+ * <pre class="code">
+ * Code Result Description
+ * == Years ==
+ * %Y 2008 Four-digit year
+ * %y 08 Two-digit year
+ *
+ * == Months ==
+ * %m 09 Two-digit month
+ * %#m 9 One or two-digit month
+ * %B September Full month name
+ * %b Sep Abbreviated month name
+ *
+ * == Days ==
+ * %d 05 Two-digit day of month
+ * %#d 5 One or two-digit day of month
+ * %e 5 One or two-digit day of month
+ * %A Sunday Full name of the day of the week
+ * %a Sun Abbreviated name of the day of the week
+ * %w 0 Number of the day of the week (0 = Sunday, 6 = Saturday)
+ *
+ * == Hours ==
+ * %H 23 Hours in 24-hour format (two digits)
+ * %#H 3 Hours in 24-hour integer format (one or two digits)
+ * %I 11 Hours in 12-hour format (two digits)
+ * %#I 3 Hours in 12-hour integer format (one or two digits)
+ * %p PM AM or PM
+ *
+ * == Minutes ==
+ * %M 09 Minutes (two digits)
+ * %#M 9 Minutes (one or two digits)
+ *
+ * == Seconds ==
+ * %S 02 Seconds (two digits)
+ * %#S 2 Seconds (one or two digits)
+ * %s 1206567625723 Unix timestamp (Seconds past 1970-01-01 00:00:00)
+ *
+ * == Milliseconds ==
+ * %N 008 Milliseconds (three digits)
+ * %#N 8 Milliseconds (one to three digits)
+ *
+ * == Timezone ==
+ * %O 360 difference in minutes between local time and GMT
+ * %Z Mountain Standard Time Name of timezone as reported by browser
+ * %G 06:00 Hours and minutes between GMT
+ *
+ * == Shortcuts ==
+ * %F 2008-03-26 %Y-%m-%d
+ * %T 05:06:30 %H:%M:%S
+ * %X 05:06:30 %H:%M:%S
+ * %x 03/26/08 %m/%d/%y
+ * %D 03/26/08 %m/%d/%y
+ * %#c Wed Mar 26 15:31:00 2008 %a %b %e %H:%M:%S %Y
+ * %v 3-Sep-2008 %e-%b-%Y
+ * %R 15:31 %H:%M
+ * %r 03:31:00 PM %I:%M:%S %p
+ *
+ * == Characters ==
+ * %n \n Newline
+ * %t \t Tab
+ * %% % Percent Symbol
+ * </pre>
+ *
+ * <p>Formatting shortcuts that will be translated into their longer version.
+ * Be sure that format shortcuts do not refer to themselves: this will cause an infinite loop.</p>
+ *
+ * <p>Format codes and format shortcuts can be redefined after the jsDate
+ * module is imported.</p>
+ *
+ * <p>Note that if you redefine the whole hash (object), you must supply a "matcher"
+ * regex for the parser. The default matcher is:</p>
+ *
+ * <code>/()%(#?(%|[a-z]))/i</code>
+ *
+ * <p>which corresponds to the Perl syntax used by default.</p>
+ *
+ * <p>By customizing the matcher and format codes, nearly any strftime functionality is possible.</p>
+ */
+
+ jsDate.formats.perl = {
+ codes: {
+ //
+ // 2-part regex matcher for format codes
+ //
+ // first match must be the character before the code (to account for escaping)
+ // second match must be the format code character(s)
+ //
+ matcher: /()%(#?(%|[a-z]))/i,
+ // year
+ Y: 'FullYear',
+ y: 'ShortYear.2',
+ // month
+ m: 'MonthNumber.2',
+ '#m': 'MonthNumber',
+ B: 'MonthName',
+ b: 'AbbrMonthName',
+ // day
+ d: 'Date.2',
+ '#d': 'Date',
+ e: 'Date',
+ A: 'DayName',
+ a: 'AbbrDayName',
+ w: 'Day',
+ // hours
+ H: 'Hours.2',
+ '#H': 'Hours',
+ I: 'Hours12.2',
+ '#I': 'Hours12',
+ p: 'AMPM',
+ // minutes
+ M: 'Minutes.2',
+ '#M': 'Minutes',
+ // seconds
+ S: 'Seconds.2',
+ '#S': 'Seconds',
+ s: 'Unix',
+ // milliseconds
+ N: 'Milliseconds.3',
+ '#N': 'Milliseconds',
+ // timezone
+ O: 'TimezoneOffset',
+ Z: 'TimezoneName',
+ G: 'GmtOffset'
+ },
+
+ shortcuts: {
+ // date
+ F: '%Y-%m-%d',
+ // time
+ T: '%H:%M:%S',
+ X: '%H:%M:%S',
+ // local format date
+ x: '%m/%d/%y',
+ D: '%m/%d/%y',
+ // local format extended
+ '#c': '%a %b %e %H:%M:%S %Y',
+ // local format short
+ v: '%e-%b-%Y',
+ R: '%H:%M',
+ r: '%I:%M:%S %p',
+ // tab and newline
+ t: '\t',
+ n: '\n',
+ '%': '%'
+ }
+ };
+
+ /**
+ * PHP format codes and shortcuts for strftime.
+ *
+ * A hash (object) of codes where each code must be an array where the first member is
+ * the name of a Date.prototype or jsDate.prototype function to call
+ * and optionally a second member indicating the number to pass to addZeros()
+ *
+ * <p>The following format codes are defined:</p>
+ *
+ * <pre class="code">
+ * Code Result Description
+ * === Days ===
+ * %a Sun through Sat An abbreviated textual representation of the day
+ * %A Sunday - Saturday A full textual representation of the day
+ * %d 01 to 31 Two-digit day of the month (with leading zeros)
+ * %e 1 to 31 Day of the month, with a space preceding single digits.
+ * %j 001 to 366 Day of the year, 3 digits with leading zeros
+ * %u 1 - 7 (Mon - Sun) ISO-8601 numeric representation of the day of the week
+ * %w 0 - 6 (Sun - Sat) Numeric representation of the day of the week
+ *
+ * === Week ===
+ * %U 13 Full Week number, starting with the first Sunday as the first week
+ * %V 01 through 53 ISO-8601:1988 week number, starting with the first week of the year
+ * with at least 4 weekdays, with Monday being the start of the week
+ * %W 46 A numeric representation of the week of the year,
+ * starting with the first Monday as the first week
+ * === Month ===
+ * %b Jan through Dec Abbreviated month name, based on the locale
+ * %B January - December Full month name, based on the locale
+ * %h Jan through Dec Abbreviated month name, based on the locale (an alias of %b)
+ * %m 01 - 12 (Jan - Dec) Two digit representation of the month
+ *
+ * === Year ===
+ * %C 19 Two digit century (year/100, truncated to an integer)
+ * %y 09 for 2009 Two digit year
+ * %Y 2038 Four digit year
+ *
+ * === Time ===
+ * %H 00 through 23 Two digit representation of the hour in 24-hour format
+ * %I 01 through 12 Two digit representation of the hour in 12-hour format
+ * %l 1 through 12 Hour in 12-hour format, with a space preceeding single digits
+ * %M 00 through 59 Two digit representation of the minute
+ * %p AM/PM UPPER-CASE 'AM' or 'PM' based on the given time
+ * %P am/pm lower-case 'am' or 'pm' based on the given time
+ * %r 09:34:17 PM Same as %I:%M:%S %p
+ * %R 00:35 Same as %H:%M
+ * %S 00 through 59 Two digit representation of the second
+ * %T 21:34:17 Same as %H:%M:%S
+ * %X 03:59:16 Preferred time representation based on locale, without the date
+ * %z -0500 or EST Either the time zone offset from UTC or the abbreviation
+ * %Z -0500 or EST The time zone offset/abbreviation option NOT given by %z
+ *
+ * === Time and Date ===
+ * %D 02/05/09 Same as %m/%d/%y
+ * %F 2009-02-05 Same as %Y-%m-%d (commonly used in database datestamps)
+ * %s 305815200 Unix Epoch Time timestamp (same as the time() function)
+ * %x 02/05/09 Preferred date representation, without the time
+ *
+ * === Miscellaneous ===
+ * %n --- A newline character (\n)
+ * %t --- A Tab character (\t)
+ * %% --- A literal percentage character (%)
+ * </pre>
+ */
+
+ jsDate.formats.php = {
+ codes: {
+ //
+ // 2-part regex matcher for format codes
+ //
+ // first match must be the character before the code (to account for escaping)
+ // second match must be the format code character(s)
+ //
+ matcher: /()%((%|[a-z]))/i,
+ // day
+ a: 'AbbrDayName',
+ A: 'DayName',
+ d: 'Date.2',
+ e: 'Date',
+ j: 'DayOfYear.3',
+ u: 'DayOfWeek',
+ w: 'Day',
+ // week
+ U: 'FullWeekOfYear.2',
+ V: 'IsoWeek.2',
+ W: 'WeekOfYear.2',
+ // month
+ b: 'AbbrMonthName',
+ B: 'MonthName',
+ m: 'MonthNumber.2',
+ h: 'AbbrMonthName',
+ // year
+ C: 'Century.2',
+ y: 'ShortYear.2',
+ Y: 'FullYear',
+ // time
+ H: 'Hours.2',
+ I: 'Hours12.2',
+ l: 'Hours12',
+ p: 'AMPM',
+ P: 'AmPm',
+ M: 'Minutes.2',
+ S: 'Seconds.2',
+ s: 'Unix',
+ O: 'TimezoneOffset',
+ z: 'GmtOffset',
+ Z: 'TimezoneAbbr'
+ },
+
+ shortcuts: {
+ D: '%m/%d/%y',
+ F: '%Y-%m-%d',
+ T: '%H:%M:%S',
+ X: '%H:%M:%S',
+ x: '%m/%d/%y',
+ R: '%H:%M',
+ r: '%I:%M:%S %p',
+ t: '\t',
+ n: '\n',
+ '%': '%'
+ }
+ };
+ //
+ // Conceptually, the logic implemented here is similar to Ken Snyder's Date Instance Methods.
+ // I use his idea of a set of parsers which can be regular expressions or functions,
+ // iterating through those, and then seeing if Date.parse() will create a date.
+ // The parser expressions and functions are a little different and some bugs have been
+ // worked out. Also, a lot of "pre-parsing" is done to fix implementation
+ // variations of Date.parse() between browsers.
+ //
+ jsDate.createDate = function(date) {
+ // if passing in multiple arguments, try Date constructor
+ if (date == null) {
+ return new Date();
+ }
+ // If the passed value is already a date object, return it
+ if (date instanceof Date) {
+ return date;
+ }
+ // if (typeof date == 'number') return new Date(date * 1000);
+ // If the passed value is an integer, interpret it as a javascript timestamp
+ if (typeof date == 'number') {
+ return new Date(date);
+ }
+
+ // Before passing strings into Date.parse(), have to normalize them for certain conditions.
+ // If strings are not formatted staccording to the EcmaScript spec, results from Date parse will be implementation dependent.
+ //
+ // For example:
+ // * FF and Opera assume 2 digit dates are pre y2k, Chome assumes <50 is pre y2k, 50+ is 21st century.
+ // * Chrome will correctly parse '1984-1-25' into localtime, FF and Opera will not parse.
+ // * Both FF, Chrome and Opera will parse '1984/1/25' into localtime.
+
+ // remove leading and trailing spaces
+ var parsable = String(date).replace(/^\s*(.+)\s*$/g, '$1');
+
+ // replace dahses (-) with slashes (/) in dates like n[nnn]/n[n]/n[nnn]
+ parsable = parsable.replace(/^([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,4})/, "$1/$2/$3");
+
+ /////////
+ // Need to check for '15-Dec-09' also.
+ // FF will not parse, but Chrome will.
+ // Chrome will set date to 2009 as well.
+ /////////
+
+ // first check for 'dd-mmm-yyyy' or 'dd/mmm/yyyy' like '15-Dec-2010'
+ parsable = parsable.replace(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{4})/i, "$1 $2 $3");
+
+ // Now check for 'dd-mmm-yy' or 'dd/mmm/yy' and normalize years to default century.
+ var match = parsable.match(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{2})\D*/i);
+ if (match && match.length > 3) {
+ var m3 = parseFloat(match[3]);
+ var ny = jsDate.config.defaultCentury + m3;
+ ny = String(ny);
+
+ // now replace 2 digit year with 4 digit year
+ parsable = parsable.replace(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{2})\D*/i, match[1] +' '+ match[2] +' '+ ny);
+
+ }
+
+ // Check for '1/19/70 8:14PM'
+ // where starts with mm/dd/yy or yy/mm/dd and have something after
+ // Check if 1st postiion is greater than 31, assume it is year.
+ // Assme all 2 digit years are 1900's.
+ // Finally, change them into US style mm/dd/yyyy representations.
+ match = parsable.match(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})[^0-9]/);
+
+ function h1(parsable, match) {
+ var m1 = parseFloat(match[1]);
+ var m2 = parseFloat(match[2]);
+ var m3 = parseFloat(match[3]);
+ var cent = jsDate.config.defaultCentury;
+ var ny, nd, nm, str;
+
+ if (m1 > 31) { // first number is a year
+ nd = m3;
+ nm = m2;
+ ny = cent + m1;
+ }
+
+ else { // last number is the year
+ nd = m2;
+ nm = m1;
+ ny = cent + m3;
+ }
+
+ str = nm+'/'+nd+'/'+ny;
+
+ // now replace 2 digit year with 4 digit year
+ return parsable.replace(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})/, str);
+
+ }
+
+ if (match && match.length > 3) {
+ parsable = h1(parsable, match);
+ }
+
+ // Now check for '1/19/70' with nothing after and do as above
+ var match = parsable.match(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})$/);
+
+ if (match && match.length > 3) {
+ parsable = h1(parsable, match);
+ }
+
+
+ var i = 0;
+ var length = jsDate.matchers.length;
+ var pattern,
+ ms,
+ current = parsable,
+ obj;
+ while (i < length) {
+ ms = Date.parse(current);
+ if (!isNaN(ms)) {
+ return new Date(ms);
+ }
+ pattern = jsDate.matchers[i];
+ if (typeof pattern == 'function') {
+ obj = pattern.call(jsDate, current);
+ if (obj instanceof Date) {
+ return obj;
+ }
+ } else {
+ current = parsable.replace(pattern[0], pattern[1]);
+ }
+ i++;
+ }
+ return NaN;
+ };
+
+
+ /**
+ * @static
+ * Handy static utility function to return the number of days in a given month.
+ * @param {Integer} year Year
+ * @param {Integer} month Month (1-12)
+ * @returns {Integer} Number of days in the month.
+ */
+ //
+ // handy utility method Borrowed right from Ken Snyder's Date Instance Mehtods.
+ //
+ jsDate.daysInMonth = function(year, month) {
+ if (month == 2) {
+ return new Date(year, 1, 29).getDate() == 29 ? 29 : 28;
+ }
+ return [undefined,31,undefined,31,30,31,30,31,31,30,31,30,31][month];
+ };
+
+
+ //
+ // An Array of regular expressions or functions that will attempt to match the date string.
+ // Functions are called with scope of a jsDate instance.
+ //
+ jsDate.matchers = [
+ // convert dd.mmm.yyyy to mm/dd/yyyy (world date to US date).
+ [/(3[01]|[0-2]\d)\s*\.\s*(1[0-2]|0\d)\s*\.\s*([1-9]\d{3})/, '$2/$1/$3'],
+ // convert yyyy-mm-dd to mm/dd/yyyy (ISO date to US date).
+ [/([1-9]\d{3})\s*-\s*(1[0-2]|0\d)\s*-\s*(3[01]|[0-2]\d)/, '$2/$3/$1'],
+ // Handle 12 hour or 24 hour time with milliseconds am/pm and optional date part.
+ function(str) {
+ var match = str.match(/^(?:(.+)\s+)?([012]?\d)(?:\s*\:\s*(\d\d))?(?:\s*\:\s*(\d\d(\.\d*)?))?\s*(am|pm)?\s*$/i);
+ // opt. date hour opt. minute opt. second opt. msec opt. am or pm
+ if (match) {
+ if (match[1]) {
+ var d = this.createDate(match[1]);
+ if (isNaN(d)) {
+ return;
+ }
+ } else {
+ var d = new Date();
+ d.setMilliseconds(0);
+ }
+ var hour = parseFloat(match[2]);
+ if (match[6]) {
+ hour = match[6].toLowerCase() == 'am' ? (hour == 12 ? 0 : hour) : (hour == 12 ? 12 : hour + 12);
+ }
+ d.setHours(hour, parseInt(match[3] || 0, 10), parseInt(match[4] || 0, 10), ((parseFloat(match[5] || 0)) || 0)*1000);
+ return d;
+ }
+ else {
+ return str;
+ }
+ },
+ // Handle ISO timestamp with time zone.
+ function(str) {
+ var match = str.match(/^(?:(.+))[T|\s+]([012]\d)(?:\:(\d\d))(?:\:(\d\d))(?:\.\d+)([\+\-]\d\d\:\d\d)$/i);
+ if (match) {
+ if (match[1]) {
+ var d = this.createDate(match[1]);
+ if (isNaN(d)) {
+ return;
+ }
+ } else {
+ var d = new Date();
+ d.setMilliseconds(0);
+ }
+ var hour = parseFloat(match[2]);
+ d.setHours(hour, parseInt(match[3], 10), parseInt(match[4], 10), parseFloat(match[5])*1000);
+ return d;
+ }
+ else {
+ return str;
+ }
+ },
+ // Try to match ambiguous strings like 12/8/22.
+ // Use FF date assumption that 2 digit years are 20th century (i.e. 1900's).
+ // This may be redundant with pre processing of date already performed.
+ function(str) {
+ var match = str.match(/^([0-3]?\d)\s*[-\/.\s]{1}\s*([a-zA-Z]{3,9})\s*[-\/.\s]{1}\s*([0-3]?\d)$/);
+ if (match) {
+ var d = new Date();
+ var cent = jsDate.config.defaultCentury;
+ var m1 = parseFloat(match[1]);
+ var m3 = parseFloat(match[3]);
+ var ny, nd, nm;
+ if (m1 > 31) { // first number is a year
+ nd = m3;
+ ny = cent + m1;
+ }
+
+ else { // last number is the year
+ nd = m1;
+ ny = cent + m3;
+ }
+
+ var nm = inArray(match[2], jsDate.regional[jsDate.regional.getLocale()]["monthNamesShort"]);
+
+ if (nm == -1) {
+ nm = inArray(match[2], jsDate.regional[jsDate.regional.getLocale()]["monthNames"]);
+ }
+
+ d.setFullYear(ny, nm, nd);
+ d.setHours(0,0,0,0);
+ return d;
+ }
+
+ else {
+ return str;
+ }
+ }
+ ];
+
+ //
+ // I think John Reisig published this method on his blog, ejohn.
+ //
+ function inArray( elem, array ) {
+ if ( array.indexOf ) {
+ return array.indexOf( elem );
+ }
+
+ for ( var i = 0, length = array.length; i < length; i++ ) {
+ if ( array[ i ] === elem ) {
+ return i;
+ }
+ }
+
+ return -1;
+ }
+
+ //
+ // Thanks to Kangax, Christian Sciberras and Stack Overflow for this method.
+ //
+ function get_type(thing){
+ if(thing===null) return "[object Null]"; // special case
+ return Object.prototype.toString.call(thing);
+ }
+
+ $.jsDate = jsDate;
+
+
+ /**
+ * JavaScript printf/sprintf functions.
+ *
+ * This code has been adapted from the publicly available sprintf methods
+ * by Ash Searle. His original header follows:
+ *
+ * This code is unrestricted: you are free to use it however you like.
+ *
+ * The functions should work as expected, performing left or right alignment,
+ * truncating strings, outputting numbers with a required precision etc.
+ *
+ * For complex cases, these functions follow the Perl implementations of
+ * (s)printf, allowing arguments to be passed out-of-order, and to set the
+ * precision or length of the output based on arguments instead of fixed
+ * numbers.
+ *
+ * See http://perldoc.perl.org/functions/sprintf.html for more information.
+ *
+ * Implemented:
+ * - zero and space-padding
+ * - right and left-alignment,
+ * - base X prefix (binary, octal and hex)
+ * - positive number prefix
+ * - (minimum) width
+ * - precision / truncation / maximum width
+ * - out of order arguments
+ *
+ * Not implemented (yet):
+ * - vector flag
+ * - size (bytes, words, long-words etc.)
+ *
+ * Will not implement:
+ * - %n or %p (no pass-by-reference in JavaScript)
+ *
+ * @version 2007.04.27
+ * @author Ash Searle
+ *
+ * You can see the original work and comments on his blog:
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ */
+
+ /**
+ * @Modifications 2009.05.26
+ * @author Chris Leonello
+ *
+ * Added %p %P specifier
+ * Acts like %g or %G but will not add more significant digits to the output than present in the input.
+ * Example:
+ * Format: '%.3p', Input: 0.012, Output: 0.012
+ * Format: '%.3g', Input: 0.012, Output: 0.0120
+ * Format: '%.4p', Input: 12.0, Output: 12.0
+ * Format: '%.4g', Input: 12.0, Output: 12.00
+ * Format: '%.4p', Input: 4.321e-5, Output: 4.321e-5
+ * Format: '%.4g', Input: 4.321e-5, Output: 4.3210e-5
+ *
+ * Example:
+ * >>> $.jqplot.sprintf('%.2f, %d', 23.3452, 43.23)
+ * "23.35, 43"
+ * >>> $.jqplot.sprintf("no value: %n, decimal with thousands separator: %'d", 23.3452, 433524)
+ * "no value: , decimal with thousands separator: 433,524"
+ */
+ $.jqplot.sprintf = function() {
+ function pad(str, len, chr, leftJustify) {
+ var padding = (str.length >= len) ? '' : Array(1 + len - str.length >>> 0).join(chr);
+ return leftJustify ? str + padding : padding + str;
+
+ }
+
+ function thousand_separate(value) {
+ var value_str = new String(value);
+ for (var i=10; i>0; i--) {
+ if (value_str == (value_str = value_str.replace(/^(\d+)(\d{3})/, "$1"+$.jqplot.sprintf.thousandsSeparator+"$2"))) break;
+ }
+ return value_str;
+ }
+
+ function justify(value, prefix, leftJustify, minWidth, zeroPad, htmlSpace) {
+ var diff = minWidth - value.length;
+ if (diff > 0) {
+ var spchar = ' ';
+ if (htmlSpace) { spchar = ' '; }
+ if (leftJustify || !zeroPad) {
+ value = pad(value, minWidth, spchar, leftJustify);
+ } else {
+ value = value.slice(0, prefix.length) + pad('', diff, '0', true) + value.slice(prefix.length);
+ }
+ }
+ return value;
+ }
+
+ function formatBaseX(value, base, prefix, leftJustify, minWidth, precision, zeroPad, htmlSpace) {
+ // Note: casts negative numbers to positive ones
+ var number = value >>> 0;
+ prefix = prefix && number && {'2': '0b', '8': '0', '16': '0x'}[base] || '';
+ value = prefix + pad(number.toString(base), precision || 0, '0', false);
+ return justify(value, prefix, leftJustify, minWidth, zeroPad, htmlSpace);
+ }
+
+ function formatString(value, leftJustify, minWidth, precision, zeroPad, htmlSpace) {
+ if (precision != null) {
+ value = value.slice(0, precision);
+ }
+ return justify(value, '', leftJustify, minWidth, zeroPad, htmlSpace);
+ }
+
+ var a = arguments, i = 0, format = a[i++];
+
+ return format.replace($.jqplot.sprintf.regex, function(substring, valueIndex, flags, minWidth, _, precision, type) {
+ if (substring == '%%') { return '%'; }
+
+ // parse flags
+ var leftJustify = false, positivePrefix = '', zeroPad = false, prefixBaseX = false, htmlSpace = false, thousandSeparation = false;
+ for (var j = 0; flags && j < flags.length; j++) switch (flags.charAt(j)) {
+ case ' ': positivePrefix = ' '; break;
+ case '+': positivePrefix = '+'; break;
+ case '-': leftJustify = true; break;
+ case '0': zeroPad = true; break;
+ case '#': prefixBaseX = true; break;
+ case '&': htmlSpace = true; break;
+ case '\'': thousandSeparation = true; break;
+ }
+
+ // parameters may be null, undefined, empty-string or real valued
+ // we want to ignore null, undefined and empty-string values
+
+ if (!minWidth) {
+ minWidth = 0;
+ }
+ else if (minWidth == '*') {
+ minWidth = +a[i++];
+ }
+ else if (minWidth.charAt(0) == '*') {
+ minWidth = +a[minWidth.slice(1, -1)];
+ }
+ else {
+ minWidth = +minWidth;
+ }
+
+ // Note: undocumented perl feature:
+ if (minWidth < 0) {
+ minWidth = -minWidth;
+ leftJustify = true;
+ }
+
+ if (!isFinite(minWidth)) {
+ throw new Error('$.jqplot.sprintf: (minimum-)width must be finite');
+ }
+
+ if (!precision) {
+ precision = 'fFeE'.indexOf(type) > -1 ? 6 : (type == 'd') ? 0 : void(0);
+ }
+ else if (precision == '*') {
+ precision = +a[i++];
+ }
+ else if (precision.charAt(0) == '*') {
+ precision = +a[precision.slice(1, -1)];
+ }
+ else {
+ precision = +precision;
+ }
+
+ // grab value using valueIndex if required?
+ var value = valueIndex ? a[valueIndex.slice(0, -1)] : a[i++];
+
+ switch (type) {
+ case 's': {
+ if (value == null) {
+ return '';
+ }
+ return formatString(String(value), leftJustify, minWidth, precision, zeroPad, htmlSpace);
+ }
+ case 'c': return formatString(String.fromCharCode(+value), leftJustify, minWidth, precision, zeroPad, htmlSpace);
+ case 'b': return formatBaseX(value, 2, prefixBaseX, leftJustify, minWidth, precision, zeroPad,htmlSpace);
+ case 'o': return formatBaseX(value, 8, prefixBaseX, leftJustify, minWidth, precision, zeroPad, htmlSpace);
+ case 'x': return formatBaseX(value, 16, prefixBaseX, leftJustify, minWidth, precision, zeroPad, htmlSpace);
+ case 'X': return formatBaseX(value, 16, prefixBaseX, leftJustify, minWidth, precision, zeroPad, htmlSpace).toUpperCase();
+ case 'u': return formatBaseX(value, 10, prefixBaseX, leftJustify, minWidth, precision, zeroPad, htmlSpace);
+ case 'i': {
+ var number = parseInt(+value, 10);
+ if (isNaN(number)) {
+ return '';
+ }
+ var prefix = number < 0 ? '-' : positivePrefix;
+ var number_str = thousandSeparation ? thousand_separate(String(Math.abs(number))): String(Math.abs(number));
+ value = prefix + pad(number_str, precision, '0', false);
+ //value = prefix + pad(String(Math.abs(number)), precision, '0', false);
+ return justify(value, prefix, leftJustify, minWidth, zeroPad, htmlSpace);
+ }
+ case 'd': {
+ var number = Math.round(+value);
+ if (isNaN(number)) {
+ return '';
+ }
+ var prefix = number < 0 ? '-' : positivePrefix;
+ var number_str = thousandSeparation ? thousand_separate(String(Math.abs(number))): String(Math.abs(number));
+ value = prefix + pad(number_str, precision, '0', false);
+ return justify(value, prefix, leftJustify, minWidth, zeroPad, htmlSpace);
+ }
+ case 'e':
+ case 'E':
+ case 'f':
+ case 'F':
+ case 'g':
+ case 'G':
+ {
+ var number = +value;
+ if (isNaN(number)) {
+ return '';
+ }
+ var prefix = number < 0 ? '-' : positivePrefix;
+ var method = ['toExponential', 'toFixed', 'toPrecision']['efg'.indexOf(type.toLowerCase())];
+ var textTransform = ['toString', 'toUpperCase']['eEfFgG'.indexOf(type) % 2];
+ var number_str = Math.abs(number)[method](precision);
+ number_str = thousandSeparation ? thousand_separate(number_str): number_str;
+ value = prefix + number_str;
+ var justified = justify(value, prefix, leftJustify, minWidth, zeroPad, htmlSpace)[textTransform]();
+
+ if ($.jqplot.sprintf.decimalMark !== '.' && $.jqplot.sprintf.decimalMark !== $.jqplot.sprintf.thousandsSeparator) {
+ return justified.replace(/\./, $.jqplot.sprintf.decimalMark);
+ } else {
+ return justified;
+ }
+ }
+ case 'p':
+ case 'P':
+ {
+ // make sure number is a number
+ var number = +value;
+ if (isNaN(number)) {
+ return '';
+ }
+ var prefix = number < 0 ? '-' : positivePrefix;
+
+ var parts = String(Number(Math.abs(number)).toExponential()).split(/e|E/);
+ var sd = (parts[0].indexOf('.') != -1) ? parts[0].length - 1 : parts[0].length;
+ var zeros = (parts[1] < 0) ? -parts[1] - 1 : 0;
+
+ if (Math.abs(number) < 1) {
+ if (sd + zeros <= precision) {
+ value = prefix + Math.abs(number).toPrecision(sd);
+ }
+ else {
+ if (sd <= precision - 1) {
+ value = prefix + Math.abs(number).toExponential(sd-1);
+ }
+ else {
+ value = prefix + Math.abs(number).toExponential(precision-1);
+ }
+ }
+ }
+ else {
+ var prec = (sd <= precision) ? sd : precision;
+ value = prefix + Math.abs(number).toPrecision(prec);
+ }
+ var textTransform = ['toString', 'toUpperCase']['pP'.indexOf(type) % 2];
+ return justify(value, prefix, leftJustify, minWidth, zeroPad, htmlSpace)[textTransform]();
+ }
+ case 'n': return '';
+ default: return substring;
+ }
+ });
+ };
+
+ $.jqplot.sprintf.thousandsSeparator = ',';
+ // Specifies the decimal mark for floating point values. By default a period '.'
+ // is used. If you change this value to for example a comma be sure to also
+ // change the thousands separator or else this won't work since a simple String
+ // replace is used (replacing all periods with the mark specified here).
+ $.jqplot.sprintf.decimalMark = '.';
+
+ $.jqplot.sprintf.regex = /%%|%(\d+\$)?([-+#0&\' ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([nAscboxXuidfegpEGP])/g;
+
+ $.jqplot.getSignificantFigures = function(number) {
+ var parts = String(Number(Math.abs(number)).toExponential()).split(/e|E/);
+ // total significant digits
+ var sd = (parts[0].indexOf('.') != -1) ? parts[0].length - 1 : parts[0].length;
+ var zeros = (parts[1] < 0) ? -parts[1] - 1 : 0;
+ // exponent
+ var expn = parseInt(parts[1], 10);
+ // digits to the left of the decimal place
+ var dleft = (expn + 1 > 0) ? expn + 1 : 0;
+ // digits to the right of the decimal place
+ var dright = (sd <= dleft) ? 0 : sd - expn - 1;
+ return {significantDigits: sd, digitsLeft: dleft, digitsRight: dright, zeros: zeros, exponent: expn} ;
+ };
+
+ $.jqplot.getPrecision = function(number) {
+ return $.jqplot.getSignificantFigures(number).digitsRight;
+ };
+
+})(jQuery);
+
+
+ var backCompat = $.uiBackCompat !== false;
+
+ $.jqplot.effects = {
+ effect: {}
+ };
+
+ // prefix used for storing data on .data()
+ var dataSpace = "jqplot.storage.";
+
+ /******************************************************************************/
+ /*********************************** EFFECTS **********************************/
+ /******************************************************************************/
+
+ $.extend( $.jqplot.effects, {
+ version: "1.9pre",
+
+ // Saves a set of properties in a data storage
+ save: function( element, set ) {
+ for( var i=0; i < set.length; i++ ) {
+ if ( set[ i ] !== null ) {
+ element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
+ }
+ }
+ },
+
+ // Restores a set of previously saved properties from a data storage
+ restore: function( element, set ) {
+ for( var i=0; i < set.length; i++ ) {
+ if ( set[ i ] !== null ) {
+ element.css( set[ i ], element.data( dataSpace + set[ i ] ) );
+ }
+ }
+ },
+
+ setMode: function( el, mode ) {
+ if (mode === "toggle") {
+ mode = el.is( ":hidden" ) ? "show" : "hide";
+ }
+ return mode;
+ },
+
+ // Wraps the element around a wrapper that copies position properties
+ createWrapper: function( element ) {
+
+ // if the element is already wrapped, return it
+ if ( element.parent().is( ".ui-effects-wrapper" )) {
+ return element.parent();
+ }
+
+ // wrap the element
+ var props = {
+ width: element.outerWidth(true),
+ height: element.outerHeight(true),
+ "float": element.css( "float" )
+ },
+ wrapper = $( "<div></div>" )
+ .addClass( "ui-effects-wrapper" )
+ .css({
+ fontSize: "100%",
+ background: "transparent",
+ border: "none",
+ margin: 0,
+ padding: 0
+ }),
+ // Store the size in case width/height are defined in % - Fixes #5245
+ size = {
+ width: element.width(),
+ height: element.height()
+ },
+ active = document.activeElement;
+
+ element.wrap( wrapper );
+
+ // Fixes #7595 - Elements lose focus when wrapped.
+ if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
+ $( active ).focus();
+ }
+
+ wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually loose the reference to the wrapped element
+
+ // transfer positioning properties to the wrapper
+ if ( element.css( "position" ) === "static" ) {
+ wrapper.css({ position: "relative" });
+ element.css({ position: "relative" });
+ } else {
+ $.extend( props, {
+ position: element.css( "position" ),
+ zIndex: element.css( "z-index" )
+ });
+ $.each([ "top", "left", "bottom", "right" ], function(i, pos) {
+ props[ pos ] = element.css( pos );
+ if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
+ props[ pos ] = "auto";
+ }
+ });
+ element.css({
+ position: "relative",
+ top: 0,
+ left: 0,
+ right: "auto",
+ bottom: "auto"
+ });
+ }
+ element.css(size);
+
+ return wrapper.css( props ).show();
+ },
+
+ removeWrapper: function( element ) {
+ var active = document.activeElement;
+
+ if ( element.parent().is( ".ui-effects-wrapper" ) ) {
+ element.parent().replaceWith( element );
+
+ // Fixes #7595 - Elements lose focus when wrapped.
+ if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
+ $( active ).focus();
+ }
+ }
+
+
+ return element;
+ }
+ });
+
+ // return an effect options object for the given parameters:
+ function _normalizeArguments( effect, options, speed, callback ) {
+
+ // short path for passing an effect options object:
+ if ( $.isPlainObject( effect ) ) {
+ return effect;
+ }
+
+ // convert to an object
+ effect = { effect: effect };
+
+ // catch (effect)
+ if ( options === undefined ) {
+ options = {};
+ }
+
+ // catch (effect, callback)
+ if ( $.isFunction( options ) ) {
+ callback = options;
+ speed = null;
+ options = {};
+ }
+
+ // catch (effect, speed, ?)
+ if ( $.type( options ) === "number" || $.fx.speeds[ options ]) {
+ callback = speed;
+ speed = options;
+ options = {};
+ }
+
+ // catch (effect, options, callback)
+ if ( $.isFunction( speed ) ) {
+ callback = speed;
+ speed = null;
+ }
+
+ // add options to effect
+ if ( options ) {
+ $.extend( effect, options );
+ }
+
+ speed = speed || options.duration;
+ effect.duration = $.fx.off ? 0 : typeof speed === "number"
+ ? speed : speed in $.fx.speeds ? $.fx.speeds[ speed ] : $.fx.speeds._default;
+
+ effect.complete = callback || options.complete;
+
+ return effect;
+ }
+
+ function standardSpeed( speed ) {
+ // valid standard speeds
+ if ( !speed || typeof speed === "number" || $.fx.speeds[ speed ] ) {
+ return true;
+ }
+
+ // invalid strings - treat as "normal" speed
+ if ( typeof speed === "string" && !$.jqplot.effects.effect[ speed ] ) {
+ // TODO: remove in 2.0 (#7115)
+ if ( backCompat && $.jqplot.effects[ speed ] ) {
+ return false;
+ }
+ return true;
+ }
+
+ return false;
+ }
+
+ $.fn.extend({
+ jqplotEffect: function( effect, options, speed, callback ) {
+ var args = _normalizeArguments.apply( this, arguments ),
+ mode = args.mode,
+ queue = args.queue,
+ effectMethod = $.jqplot.effects.effect[ args.effect ],
+
+ // DEPRECATED: remove in 2.0 (#7115)
+ oldEffectMethod = !effectMethod && backCompat && $.jqplot.effects[ args.effect ];
+
+ if ( $.fx.off || !( effectMethod || oldEffectMethod ) ) {
+ // delegate to the original method (e.g., .show()) if possible
+ if ( mode ) {
+ return this[ mode ]( args.duration, args.complete );
+ } else {
+ return this.each( function() {
+ if ( args.complete ) {
+ args.complete.call( this );
+ }
+ });
+ }
+ }
+
+ function run( next ) {
+ var elem = $( this ),
+ complete = args.complete,
+ mode = args.mode;
+
+ function done() {
+ if ( $.isFunction( complete ) ) {
+ complete.call( elem[0] );
+ }
+ if ( $.isFunction( next ) ) {
+ next();
+ }
+ }
+
+ // if the element is hiddden and mode is hide,
+ // or element is visible and mode is show
+ if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
+ done();
+ } else {
+ effectMethod.call( elem[0], args, done );
+ }
+ }
+
+ // TODO: remove this check in 2.0, effectMethod will always be true
+ if ( effectMethod ) {
+ return queue === false ? this.each( run ) : this.queue( queue || "fx", run );
+ } else {
+ // DEPRECATED: remove in 2.0 (#7115)
+ return oldEffectMethod.call(this, {
+ options: args,
+ duration: args.duration,
+ callback: args.complete,
+ mode: args.mode
+ });
+ }
+ }
+ });
+
+
+
+
+ var rvertical = /up|down|vertical/,
+ rpositivemotion = /up|left|vertical|horizontal/;
+
+ $.jqplot.effects.effect.blind = function( o, done ) {
+ // Create element
+ var el = $( this ),
+ props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
+ mode = $.jqplot.effects.setMode( el, o.mode || "hide" ),
+ direction = o.direction || "up",
+ vertical = rvertical.test( direction ),
+ ref = vertical ? "height" : "width",
+ ref2 = vertical ? "top" : "left",
+ motion = rpositivemotion.test( direction ),
+ animation = {},
+ show = mode === "show",
+ wrapper, distance, top;
+
+ // // if already wrapped, the wrapper's properties are my property. #6245
+ if ( el.parent().is( ".ui-effects-wrapper" ) ) {
+ $.jqplot.effects.save( el.parent(), props );
+ } else {
+ $.jqplot.effects.save( el, props );
+ }
+ el.show();
+ top = parseInt(el.css('top'), 10);
+ wrapper = $.jqplot.effects.createWrapper( el ).css({
+ overflow: "hidden"
+ });
+
+ distance = vertical ? wrapper[ ref ]() + top : wrapper[ ref ]();
+
+ animation[ ref ] = show ? String(distance) : '0';
+ if ( !motion ) {
+ el
+ .css( vertical ? "bottom" : "right", 0 )
+ .css( vertical ? "top" : "left", "" )
+ .css({ position: "absolute" });
+ animation[ ref2 ] = show ? '0' : String(distance);
+ }
+
+ // // start at 0 if we are showing
+ if ( show ) {
+ wrapper.css( ref, 0 );
+ if ( ! motion ) {
+ wrapper.css( ref2, distance );
+ }
+ }
+
+ // // Animate
+ wrapper.animate( animation, {
+ duration: o.duration,
+ easing: o.easing,
+ queue: false,
+ complete: function() {
+ if ( mode === "hide" ) {
+ el.hide();
+ }
+ $.jqplot.effects.restore( el, props );
+ $.jqplot.effects.removeWrapper( el );
+ done();
+ }
+ });
+
+ };
+
+
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.BezierCurveRenderer.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.BezierCurveRenderer.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.BezierCurveRenderer.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,336 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ */
+(function($) {
+ // Class: $.jqplot.BezierCurveRenderer.js
+ // Renderer which draws lines as stacked bezier curves.
+ // Data for the line will not be specified as an array of
+ // [x, y] data point values, but as a an array of [start piont, bezier curve]
+ // So, the line is specified as: [[xstart, ystart], [cp1x, cp1y, cp2x, cp2y, xend, yend]].
+ $.jqplot.BezierCurveRenderer = function(){
+ $.jqplot.LineRenderer.call(this);
+ };
+
+ $.jqplot.BezierCurveRenderer.prototype = new $.jqplot.LineRenderer();
+ $.jqplot.BezierCurveRenderer.prototype.constructor = $.jqplot.BezierCurveRenderer;
+
+
+ // Method: setGridData
+ // converts the user data values to grid coordinates and stores them
+ // in the gridData array.
+ // Called with scope of a series.
+ $.jqplot.BezierCurveRenderer.prototype.setGridData = function(plot) {
+ // recalculate the grid data
+ var xp = this._xaxis.series_u2p;
+ var yp = this._yaxis.series_u2p;
+ // this._plotData should be same as this.data
+ var data = this.data;
+ this.gridData = [];
+ this._prevGridData = [];
+ // if seriesIndex = 0, fill to x axis.
+ // if seriesIndex > 0, fill to previous series data.
+ var idx = this.index;
+ if (data.length == 2) {
+ if (idx == 0) {
+ this.gridData = [
+ [xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
+ [xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
+ xp.call(this._xaxis, data[1][2]), yp.call(this._yaxis, data[1][3]),
+ xp.call(this._xaxis, data[1][4]), yp.call(this._yaxis, data[1][5])],
+ [xp.call(this._xaxis, data[1][4]), yp.call(this._yaxis, this._yaxis.min)],
+ [xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, this._yaxis.min)]
+ ];
+ }
+ else {
+ var psd = plot.series[idx-1].data;
+ this.gridData = [
+ [xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
+ [xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
+ xp.call(this._xaxis, data[1][2]), yp.call(this._yaxis, data[1][3]),
+ xp.call(this._xaxis, data[1][4]), yp.call(this._yaxis, data[1][5])],
+ [xp.call(this._xaxis, psd[1][4]), yp.call(this._yaxis, psd[1][5])],
+ [xp.call(this._xaxis, psd[1][2]), yp.call(this._yaxis, psd[1][3]),
+ xp.call(this._xaxis, psd[1][0]), yp.call(this._yaxis, psd[1][1]),
+ xp.call(this._xaxis, psd[0][0]), yp.call(this._yaxis, psd[0][1])]
+ ];
+ }
+ }
+ else {
+ if (idx == 0) {
+ this.gridData = [
+ [xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
+ [xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
+ xp.call(this._xaxis, data[2][0]), yp.call(this._yaxis, data[2][1]),
+ xp.call(this._xaxis, data[3][0]), yp.call(this._yaxis, data[3][1])],
+ [xp.call(this._xaxis, data[3][1]), yp.call(this._yaxis, this._yaxis.min)],
+ [xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, this._yaxis.min)]
+ ];
+ }
+ else {
+ var psd = plot.series[idx-1].data;
+ this.gridData = [
+ [xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
+ [xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
+ xp.call(this._xaxis, data[2][0]), yp.call(this._yaxis, data[2][1]),
+ xp.call(this._xaxis, data[3][0]), yp.call(this._yaxis, data[3][1])],
+ [xp.call(this._xaxis, psd[3][0]), yp.call(this._yaxis, psd[3][1])],
+ [xp.call(this._xaxis, psd[2][0]), yp.call(this._yaxis, psd[2][1]),
+ xp.call(this._xaxis, psd[1][0]), yp.call(this._yaxis, psd[1][1]),
+ xp.call(this._xaxis, psd[0][0]), yp.call(this._yaxis, psd[0][1])]
+ ];
+ }
+ }
+ };
+
+ // Method: makeGridData
+ // converts any arbitrary data values to grid coordinates and
+ // returns them. This method exists so that plugins can use a series'
+ // linerenderer to generate grid data points without overwriting the
+ // grid data associated with that series.
+ // Called with scope of a series.
+ $.jqplot.BezierCurveRenderer.prototype.makeGridData = function(data, plot) {
+ // recalculate the grid data
+ var xp = this._xaxis.series_u2p;
+ var yp = this._yaxis.series_u2p;
+ var gd = [];
+ var pgd = [];
+ // if seriesIndex = 0, fill to x axis.
+ // if seriesIndex > 0, fill to previous series data.
+ var idx = this.index;
+ if (data.length == 2) {
+ if (idx == 0) {
+ gd = [
+ [xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
+ [xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
+ xp.call(this._xaxis, data[1][2]), yp.call(this._yaxis, data[1][3]),
+ xp.call(this._xaxis, data[1][4]), yp.call(this._yaxis, data[1][5])],
+ [xp.call(this._xaxis, data[1][4]), yp.call(this._yaxis, this._yaxis.min)],
+ [xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, this._yaxis.min)]
+ ];
+ }
+ else {
+ var psd = plot.series[idx-1].data;
+ gd = [
+ [xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
+ [xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
+ xp.call(this._xaxis, data[1][2]), yp.call(this._yaxis, data[1][3]),
+ xp.call(this._xaxis, data[1][4]), yp.call(this._yaxis, data[1][5])],
+ [xp.call(this._xaxis, psd[1][4]), yp.call(this._yaxis, psd[1][5])],
+ [xp.call(this._xaxis, psd[1][2]), yp.call(this._yaxis, psd[1][3]),
+ xp.call(this._xaxis, psd[1][0]), yp.call(this._yaxis, psd[1][1]),
+ xp.call(this._xaxis, psd[0][0]), yp.call(this._yaxis, psd[0][1])]
+ ];
+ }
+ }
+ else {
+ if (idx == 0) {
+ gd = [
+ [xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
+ [xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
+ xp.call(this._xaxis, data[2][0]), yp.call(this._yaxis, data[2][1]),
+ xp.call(this._xaxis, data[3][0]), yp.call(this._yaxis, data[3][1])],
+ [xp.call(this._xaxis, data[3][1]), yp.call(this._yaxis, this._yaxis.min)],
+ [xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, this._yaxis.min)]
+ ];
+ }
+ else {
+ var psd = plot.series[idx-1].data;
+ gd = [
+ [xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
+ [xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
+ xp.call(this._xaxis, data[2][0]), yp.call(this._yaxis, data[2][1]),
+ xp.call(this._xaxis, data[3][0]), yp.call(this._yaxis, data[3][1])],
+ [xp.call(this._xaxis, psd[3][0]), yp.call(this._yaxis, psd[3][1])],
+ [xp.call(this._xaxis, psd[2][0]), yp.call(this._yaxis, psd[2][1]),
+ xp.call(this._xaxis, psd[1][0]), yp.call(this._yaxis, psd[1][1]),
+ xp.call(this._xaxis, psd[0][0]), yp.call(this._yaxis, psd[0][1])]
+ ];
+ }
+ }
+ return gd;
+ };
+
+
+ // called within scope of series.
+ $.jqplot.BezierCurveRenderer.prototype.draw = function(ctx, gd, options) {
+ var i;
+ ctx.save();
+ if (gd.length) {
+ if (this.showLine) {
+ ctx.save();
+ var opts = (options != null) ? options : {};
+ ctx.fillStyle = opts.fillStyle || this.color;
+ ctx.beginPath();
+ ctx.moveTo(gd[0][0], gd[0][1]);
+ ctx.bezierCurveTo(gd[1][0], gd[1][1], gd[1][2], gd[1][3], gd[1][4], gd[1][5]);
+ ctx.lineTo(gd[2][0], gd[2][1]);
+ if (gd[3].length == 2) {
+ ctx.lineTo(gd[3][0], gd[3][1]);
+ }
+ else {
+ ctx.bezierCurveTo(gd[3][0], gd[3][1], gd[3][2], gd[3][3], gd[3][4], gd[3][5]);
+ }
+ ctx.closePath();
+ ctx.fill();
+ ctx.restore();
+ }
+ }
+
+ ctx.restore();
+ };
+
+ $.jqplot.BezierCurveRenderer.prototype.drawShadow = function(ctx, gd, options) {
+ // This is a no-op, shadows drawn with lines.
+ };
+
+ $.jqplot.BezierAxisRenderer = function() {
+ $.jqplot.LinearAxisRenderer.call(this);
+ };
+
+ $.jqplot.BezierAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer();
+ $.jqplot.BezierAxisRenderer.prototype.constructor = $.jqplot.BezierAxisRenderer;
+
+
+ // Axes on a plot with Bezier Curves
+ $.jqplot.BezierAxisRenderer.prototype.init = function(options){
+ $.extend(true, this, options);
+ var db = this._dataBounds;
+ // Go through all the series attached to this axis and find
+ // the min/max bounds for this axis.
+ for (var i=0; i<this._series.length; i++) {
+ var s = this._series[i];
+ var d = s.data;
+ if (d.length == 4) {
+ for (var j=0; j<d.length; j++) {
+ if (this.name == 'xaxis' || this.name == 'x2axis') {
+ if (d[j][0] < db.min || db.min == null) {
+ db.min = d[j][0];
+ }
+ if (d[j][0] > db.max || db.max == null) {
+ db.max = d[j][0];
+ }
+ }
+ else {
+ if (d[j][1] < db.min || db.min == null) {
+ db.min = d[j][1];
+ }
+ if (d[j][1] > db.max || db.max == null) {
+ db.max = d[j][1];
+ }
+ }
+ }
+ }
+ else {
+ if (this.name == 'xaxis' || this.name == 'x2axis') {
+ if (d[0][0] < db.min || db.min == null) {
+ db.min = d[0][0];
+ }
+ if (d[0][0] > db.max || db.max == null) {
+ db.max = d[0][0];
+ }
+ for (var j=0; j<5; j+=2) {
+ if (d[1][j] < db.min || db.min == null) {
+ db.min = d[1][j];
+ }
+ if (d[1][j] > db.max || db.max == null) {
+ db.max = d[1][j];
+ }
+ }
+ }
+ else {
+ if (d[0][1] < db.min || db.min == null) {
+ db.min = d[0][1];
+ }
+ if (d[0][1] > db.max || db.max == null) {
+ db.max = d[0][1];
+ }
+ for (var j=1; j<6; j+=2) {
+ if (d[1][j] < db.min || db.min == null) {
+ db.min = d[1][j];
+ }
+ if (d[1][j] > db.max || db.max == null) {
+ db.max = d[1][j];
+ }
+ }
+ }
+ }
+ }
+ };
+
+ // setup default renderers for axes and legend so user doesn't have to
+ // called with scope of plot
+ function preInit(target, data, options) {
+ options = options || {};
+ options.axesDefaults = $.extend(true, {pad:0}, options.axesDefaults);
+ options.legend = $.extend(true, {placement:'outside'}, options.legend);
+ // only set these if there is a pie series
+ var setopts = false;
+ if (options.seriesDefaults.renderer == $.jqplot.BezierCurveRenderer) {
+ setopts = true;
+ }
+ else if (options.series) {
+ for (var i=0; i < options.series.length; i++) {
+ if (options.series[i].renderer == $.jqplot.BezierCurveRenderer) {
+ setopts = true;
+ }
+ }
+ }
+
+ if (setopts) {
+ options.axesDefaults.renderer = $.jqplot.BezierAxisRenderer;
+ }
+ }
+
+ $.jqplot.preInitHooks.push(preInit);
+
+})(jQuery);
\ No newline at end of file
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.barRenderer.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.barRenderer.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.barRenderer.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,820 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ */
+(function($) {
+
+ // Class: $.jqplot.BarRenderer
+ // A plugin renderer for jqPlot to draw a bar plot.
+ // Draws series as a line.
+
+ $.jqplot.BarRenderer = function(){
+ $.jqplot.LineRenderer.call(this);
+ };
+
+ $.jqplot.BarRenderer.prototype = new $.jqplot.LineRenderer();
+ $.jqplot.BarRenderer.prototype.constructor = $.jqplot.BarRenderer;
+
+ // called with scope of series.
+ $.jqplot.BarRenderer.prototype.init = function(options, plot) {
+ // Group: Properties
+ //
+ // prop: barPadding
+ // Number of pixels between adjacent bars at the same axis value.
+ this.barPadding = 8;
+ // prop: barMargin
+ // Number of pixels between groups of bars at adjacent axis values.
+ this.barMargin = 10;
+ // prop: barDirection
+ // 'vertical' = up and down bars, 'horizontal' = side to side bars
+ this.barDirection = 'vertical';
+ // prop: barWidth
+ // Width of the bar in pixels (auto by devaul). null = calculated automatically.
+ this.barWidth = null;
+ // prop: shadowOffset
+ // offset of the shadow from the slice and offset of
+ // each succesive stroke of the shadow from the last.
+ this.shadowOffset = 2;
+ // prop: shadowDepth
+ // number of strokes to apply to the shadow,
+ // each stroke offset shadowOffset from the last.
+ this.shadowDepth = 5;
+ // prop: shadowAlpha
+ // transparency of the shadow (0 = transparent, 1 = opaque)
+ this.shadowAlpha = 0.08;
+ // prop: waterfall
+ // true to enable waterfall plot.
+ this.waterfall = false;
+ // prop: groups
+ // group bars into this many groups
+ this.groups = 1;
+ // prop: varyBarColor
+ // true to color each bar of a series separately rather than
+ // have every bar of a given series the same color.
+ // If used for non-stacked multiple series bar plots, user should
+ // specify a separate 'seriesColors' array for each series.
+ // Otherwise, each series will set their bars to the same color array.
+ // This option has no Effect for stacked bar charts and is disabled.
+ this.varyBarColor = false;
+ // prop: highlightMouseOver
+ // True to highlight slice when moused over.
+ // This must be false to enable highlightMouseDown to highlight when clicking on a slice.
+ this.highlightMouseOver = true;
+ // prop: highlightMouseDown
+ // True to highlight when a mouse button is pressed over a slice.
+ // This will be disabled if highlightMouseOver is true.
+ this.highlightMouseDown = false;
+ // prop: highlightColors
+ // an array of colors to use when highlighting a bar.
+ this.highlightColors = [];
+ // prop: transposedData
+ // NOT IMPLEMENTED YET. True if this is a horizontal bar plot and
+ // x and y values are "transposed". Tranposed, or "swapped", data is
+ // required prior to rev. 894 builds of jqPlot with horizontal bars.
+ // Allows backward compatability of bar renderer horizontal bars with
+ // old style data sets.
+ this.transposedData = true;
+ this.renderer.animation = {
+ show: false,
+ direction: 'down',
+ speed: 3000,
+ _supported: true
+ };
+ this._type = 'bar';
+
+ // if user has passed in highlightMouseDown option and not set highlightMouseOver, disable highlightMouseOver
+ if (options.highlightMouseDown && options.highlightMouseOver == null) {
+ options.highlightMouseOver = false;
+ }
+
+ //////
+ // This is probably wrong here.
+ // After going back and forth on wether renderer should be the thing
+ // or extend the thing, it seems that it it best if it is a property
+ // on the thing. This should be something that is commonized
+ // among series renderers in the future.
+ //////
+ $.extend(true, this, options);
+
+ // really should probably do this
+ $.extend(true, this.renderer, options);
+ // fill is still needed to properly draw the legend.
+ // bars have to be filled.
+ this.fill = true;
+
+ // if horizontal bar and animating, reset the default direction
+ if (this.barDirection === 'horizontal' && this.rendererOptions.animation && this.rendererOptions.animation.direction == null) {
+ this.renderer.animation.direction = 'left';
+ }
+
+ if (this.waterfall) {
+ this.fillToZero = false;
+ this.disableStack = true;
+ }
+
+ if (this.barDirection == 'vertical' ) {
+ this._primaryAxis = '_xaxis';
+ this._stackAxis = 'y';
+ this.fillAxis = 'y';
+ }
+ else {
+ this._primaryAxis = '_yaxis';
+ this._stackAxis = 'x';
+ this.fillAxis = 'x';
+ }
+ // index of the currenty highlighted point, if any
+ this._highlightedPoint = null;
+ // total number of values for all bar series, total number of bar series, and position of this series
+ this._plotSeriesInfo = null;
+ // Array of actual data colors used for each data point.
+ this._dataColors = [];
+ this._barPoints = [];
+
+ // set the shape renderer options
+ var opts = {lineJoin:'miter', lineCap:'round', fill:true, isarc:false, strokeStyle:this.color, fillStyle:this.color, closePath:this.fill};
+ this.renderer.shapeRenderer.init(opts);
+ // set the shadow renderer options
+ var sopts = {lineJoin:'miter', lineCap:'round', fill:true, isarc:false, angle:this.shadowAngle, offset:this.shadowOffset, alpha:this.shadowAlpha, depth:this.shadowDepth, closePath:this.fill};
+ this.renderer.shadowRenderer.init(sopts);
+
+ plot.postInitHooks.addOnce(postInit);
+ plot.postDrawHooks.addOnce(postPlotDraw);
+ plot.eventListenerHooks.addOnce('jqplotMouseMove', handleMove);
+ plot.eventListenerHooks.addOnce('jqplotMouseDown', handleMouseDown);
+ plot.eventListenerHooks.addOnce('jqplotMouseUp', handleMouseUp);
+ plot.eventListenerHooks.addOnce('jqplotClick', handleClick);
+ plot.eventListenerHooks.addOnce('jqplotRightClick', handleRightClick);
+ };
+
+ // called with scope of series
+ function barPreInit(target, data, seriesDefaults, options) {
+ if (this.rendererOptions.barDirection == 'horizontal') {
+ this._stackAxis = 'x';
+ this._primaryAxis = '_yaxis';
+ }
+ if (this.rendererOptions.waterfall == true) {
+ this._data = $.extend(true, [], this.data);
+ var sum = 0;
+ var pos = (!this.rendererOptions.barDirection || this.rendererOptions.barDirection === 'vertical' || this.transposedData === false) ? 1 : 0;
+ for(var i=0; i<this.data.length; i++) {
+ sum += this.data[i][pos];
+ if (i>0) {
+ this.data[i][pos] += this.data[i-1][pos];
+ }
+ }
+ this.data[this.data.length] = (pos == 1) ? [this.data.length+1, sum] : [sum, this.data.length+1];
+ this._data[this._data.length] = (pos == 1) ? [this._data.length+1, sum] : [sum, this._data.length+1];
+ }
+ if (this.rendererOptions.groups > 1) {
+ this.breakOnNull = true;
+ var l = this.data.length;
+ var skip = parseInt(l/this.rendererOptions.groups, 10);
+ var count = 0;
+ for (var i=skip; i<l; i+=skip) {
+ this.data.splice(i+count, 0, [null, null]);
+ this._plotData.splice(i+count, 0, [null, null]);
+ this._stackData.splice(i+count, 0, [null, null]);
+ count++;
+ }
+ for (i=0; i<this.data.length; i++) {
+ if (this._primaryAxis == '_xaxis') {
+ this.data[i][0] = i+1;
+ this._plotData[i][0] = i+1;
+ this._stackData[i][0] = i+1;
+ }
+ else {
+ this.data[i][1] = i+1;
+ this._plotData[i][1] = i+1;
+ this._stackData[i][1] = i+1;
+ }
+ }
+ }
+ }
+
+ $.jqplot.preSeriesInitHooks.push(barPreInit);
+
+ // needs to be called with scope of series, not renderer.
+ $.jqplot.BarRenderer.prototype.calcSeriesNumbers = function() {
+ var nvals = 0;
+ var nseries = 0;
+ var paxis = this[this._primaryAxis];
+ var s, series, pos;
+ // loop through all series on this axis
+ for (var i=0; i < paxis._series.length; i++) {
+ series = paxis._series[i];
+ if (series === this) {
+ pos = i;
+ }
+ // is the series rendered as a bar?
+ if (series.renderer.constructor == $.jqplot.BarRenderer) {
+ // gridData may not be computed yet, use data length insted
+ nvals += series.data.length;
+ nseries += 1;
+ }
+ }
+ // return total number of values for all bar series, total number of bar series, and position of this series
+ return [nvals, nseries, pos];
+ };
+
+ $.jqplot.BarRenderer.prototype.setBarWidth = function() {
+ // need to know how many data values we have on the approprate axis and figure it out.
+ var i;
+ var nvals = 0;
+ var nseries = 0;
+ var paxis = this[this._primaryAxis];
+ var s, series, pos;
+ var temp = this._plotSeriesInfo = this.renderer.calcSeriesNumbers.call(this);
+ nvals = temp[0];
+ nseries = temp[1];
+ var nticks = paxis.numberTicks;
+ var nbins = (nticks-1)/2;
+ // so, now we have total number of axis values.
+ if (paxis.name == 'xaxis' || paxis.name == 'x2axis') {
+ if (this._stack) {
+ this.barWidth = (paxis._offsets.max - paxis._offsets.min) / nvals * nseries - this.barMargin;
+ }
+ else {
+ this.barWidth = ((paxis._offsets.max - paxis._offsets.min)/nbins - this.barPadding * (nseries-1) - this.barMargin*2)/nseries;
+ // this.barWidth = (paxis._offsets.max - paxis._offsets.min) / nvals - this.barPadding - this.barMargin/nseries;
+ }
+ }
+ else {
+ if (this._stack) {
+ this.barWidth = (paxis._offsets.min - paxis._offsets.max) / nvals * nseries - this.barMargin;
+ }
+ else {
+ this.barWidth = ((paxis._offsets.min - paxis._offsets.max)/nbins - this.barPadding * (nseries-1) - this.barMargin*2)/nseries;
+ // this.barWidth = (paxis._offsets.min - paxis._offsets.max) / nvals - this.barPadding - this.barMargin/nseries;
+ }
+ }
+ return [nvals, nseries];
+ };
+
+ function computeHighlightColors (colors) {
+ var ret = [];
+ for (var i=0; i<colors.length; i++){
+ var rgba = $.jqplot.getColorComponents(colors[i]);
+ var newrgb = [rgba[0], rgba[1], rgba[2]];
+ var sum = newrgb[0] + newrgb[1] + newrgb[2];
+ for (var j=0; j<3; j++) {
+ // when darkening, lowest color component can be is 60.
+ newrgb[j] = (sum > 570) ? newrgb[j] * 0.8 : newrgb[j] + 0.3 * (255 - newrgb[j]);
+ newrgb[j] = parseInt(newrgb[j], 10);
+ }
+ ret.push('rgb('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+')');
+ }
+ return ret;
+ }
+
+ function getStart(sidx, didx, comp, plot, axis) {
+ // check if sign change
+ var seriesIndex = sidx,
+ prevSeriesIndex = sidx - 1,
+ start,
+ prevVal,
+ aidx = (axis === 'x') ? 0 : 1;
+
+ // is this not the first series?
+ if (seriesIndex > 0) {
+ prevVal = plot.series[prevSeriesIndex]._plotData[didx][aidx];
+
+ // is there a sign change
+ if ((comp * prevVal) < 0) {
+ start = getStart(prevSeriesIndex, didx, comp, plot, axis);
+ }
+
+ // no sign change.
+ else {
+ start = plot.series[prevSeriesIndex].gridData[didx][aidx];
+ }
+
+ }
+
+ // if first series, return value at 0
+ else {
+
+ start = (aidx === 0) ? plot.series[seriesIndex]._xaxis.series_u2p(0) : plot.series[seriesIndex]._yaxis.series_u2p(0);
+ }
+
+ return start;
+ }
+
+
+ $.jqplot.BarRenderer.prototype.draw = function(ctx, gridData, options, plot) {
+ var i;
+ // Ughhh, have to make a copy of options b/c it may be modified later.
+ var opts = $.extend({}, options);
+ var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
+ var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine;
+ var fill = (opts.fill != undefined) ? opts.fill : this.fill;
+ var xaxis = this.xaxis;
+ var yaxis = this.yaxis;
+ var xp = this._xaxis.series_u2p;
+ var yp = this._yaxis.series_u2p;
+ var pointx, pointy;
+ // clear out data colors.
+ this._dataColors = [];
+ this._barPoints = [];
+
+ if (this.barWidth == null) {
+ this.renderer.setBarWidth.call(this);
+ }
+
+ var temp = this._plotSeriesInfo = this.renderer.calcSeriesNumbers.call(this);
+ var nvals = temp[0];
+ var nseries = temp[1];
+ var pos = temp[2];
+ var points = [];
+
+ if (this._stack) {
+ this._barNudge = 0;
+ }
+ else {
+ this._barNudge = (-Math.abs(nseries/2 - 0.5) + pos) * (this.barWidth + this.barPadding);
+ }
+ if (showLine) {
+ var negativeColors = new $.jqplot.ColorGenerator(this.negativeSeriesColors);
+ var positiveColors = new $.jqplot.ColorGenerator(this.seriesColors);
+ var negativeColor = negativeColors.get(this.index);
+ if (! this.useNegativeColors) {
+ negativeColor = opts.fillStyle;
+ }
+ var positiveColor = opts.fillStyle;
+ var base;
+ var xstart;
+ var ystart;
+
+ if (this.barDirection == 'vertical') {
+ for (var i=0; i<gridData.length; i++) {
+ if (!this._stack && this.data[i][1] == null) {
+ continue;
+ }
+ points = [];
+ base = gridData[i][0] + this._barNudge;
+
+ // stacked
+ if (this._stack && this._prevGridData.length) {
+ ystart = getStart(this.index, i, this._plotData[i][1], plot, 'y');
+ }
+
+ // not stacked
+ else {
+ if (this.fillToZero) {
+ ystart = this._yaxis.series_u2p(0);
+ }
+ else if (this.waterfall && i > 0 && i < this.gridData.length-1) {
+ ystart = this.gridData[i-1][1];
+ }
+ else if (this.waterfall && i == 0 && i < this.gridData.length-1) {
+ if (this._yaxis.min <= 0 && this._yaxis.max >= 0) {
+ ystart = this._yaxis.series_u2p(0);
+ }
+ else if (this._yaxis.min > 0) {
+ ystart = ctx.canvas.height;
+ }
+ else {
+ ystart = 0;
+ }
+ }
+ else if (this.waterfall && i == this.gridData.length - 1) {
+ if (this._yaxis.min <= 0 && this._yaxis.max >= 0) {
+ ystart = this._yaxis.series_u2p(0);
+ }
+ else if (this._yaxis.min > 0) {
+ ystart = ctx.canvas.height;
+ }
+ else {
+ ystart = 0;
+ }
+ }
+ else {
+ ystart = ctx.canvas.height;
+ }
+ }
+ if ((this.fillToZero && this._plotData[i][1] < 0) || (this.waterfall && this._data[i][1] < 0)) {
+ if (this.varyBarColor && !this._stack) {
+ if (this.useNegativeColors) {
+ opts.fillStyle = negativeColors.next();
+ }
+ else {
+ opts.fillStyle = positiveColors.next();
+ }
+ }
+ else {
+ opts.fillStyle = negativeColor;
+ }
+ }
+ else {
+ if (this.varyBarColor && !this._stack) {
+ opts.fillStyle = positiveColors.next();
+ }
+ else {
+ opts.fillStyle = positiveColor;
+ }
+ }
+
+ if (!this.fillToZero || this._plotData[i][1] >= 0) {
+ points.push([base-this.barWidth/2, ystart]);
+ points.push([base-this.barWidth/2, gridData[i][1]]);
+ points.push([base+this.barWidth/2, gridData[i][1]]);
+ points.push([base+this.barWidth/2, ystart]);
+ }
+ // for negative bars make sure points are always ordered clockwise
+ else {
+ points.push([base-this.barWidth/2, gridData[i][1]]);
+ points.push([base-this.barWidth/2, ystart]);
+ points.push([base+this.barWidth/2, ystart]);
+ points.push([base+this.barWidth/2, gridData[i][1]]);
+ }
+ this._barPoints.push(points);
+ // now draw the shadows if not stacked.
+ // for stacked plots, they are predrawn by drawShadow
+ if (shadow && !this._stack) {
+ var sopts = $.extend(true, {}, opts);
+ // need to get rid of fillStyle on shadow.
+ delete sopts.fillStyle;
+ this.renderer.shadowRenderer.draw(ctx, points, sopts);
+ }
+ var clr = opts.fillStyle || this.color;
+ this._dataColors.push(clr);
+ this.renderer.shapeRenderer.draw(ctx, points, opts);
+ }
+ }
+
+ else if (this.barDirection == 'horizontal'){
+ for (var i=0; i<gridData.length; i++) {
+ if (!this._stack && this.data[i][0] == null) {
+ continue;
+ }
+ points = [];
+ base = gridData[i][1] - this._barNudge;
+ xstart;
+
+ if (this._stack && this._prevGridData.length) {
+ xstart = getStart(this.index, i, this._plotData[i][0], plot, 'x');
+ }
+ // not stacked
+ else {
+ if (this.fillToZero) {
+ xstart = this._xaxis.series_u2p(0);
+ }
+ else if (this.waterfall && i > 0 && i < this.gridData.length-1) {
+ xstart = this.gridData[i-1][0];
+ }
+ else if (this.waterfall && i == 0 && i < this.gridData.length-1) {
+ if (this._xaxis.min <= 0 && this._xaxis.max >= 0) {
+ xstart = this._xaxis.series_u2p(0);
+ }
+ else if (this._xaxis.min > 0) {
+ xstart = 0;
+ }
+ else {
+ xstart = 0;
+ }
+ }
+ else if (this.waterfall && i == this.gridData.length - 1) {
+ if (this._xaxis.min <= 0 && this._xaxis.max >= 0) {
+ xstart = this._xaxis.series_u2p(0);
+ }
+ else if (this._xaxis.min > 0) {
+ xstart = 0;
+ }
+ else {
+ xstart = ctx.canvas.width;
+ }
+ }
+ else {
+ xstart = 0;
+ }
+ }
+ if ((this.fillToZero && this._plotData[i][1] < 0) || (this.waterfall && this._data[i][1] < 0)) {
+ if (this.varyBarColor && !this._stack) {
+ if (this.useNegativeColors) {
+ opts.fillStyle = negativeColors.next();
+ }
+ else {
+ opts.fillStyle = positiveColors.next();
+ }
+ }
+ }
+ else {
+ if (this.varyBarColor && !this._stack) {
+ opts.fillStyle = positiveColors.next();
+ }
+ else {
+ opts.fillStyle = positiveColor;
+ }
+ }
+
+
+ if (!this.fillToZero || this._plotData[i][0] >= 0) {
+ points.push([xstart, base + this.barWidth / 2]);
+ points.push([xstart, base - this.barWidth / 2]);
+ points.push([gridData[i][0], base - this.barWidth / 2]);
+ points.push([gridData[i][0], base + this.barWidth / 2]);
+ }
+ else {
+ points.push([gridData[i][0], base + this.barWidth / 2]);
+ points.push([gridData[i][0], base - this.barWidth / 2]);
+ points.push([xstart, base - this.barWidth / 2]);
+ points.push([xstart, base + this.barWidth / 2]);
+ }
+
+ this._barPoints.push(points);
+ // now draw the shadows if not stacked.
+ // for stacked plots, they are predrawn by drawShadow
+ if (shadow && !this._stack) {
+ var sopts = $.extend(true, {}, opts);
+ delete sopts.fillStyle;
+ this.renderer.shadowRenderer.draw(ctx, points, sopts);
+ }
+ var clr = opts.fillStyle || this.color;
+ this._dataColors.push(clr);
+ this.renderer.shapeRenderer.draw(ctx, points, opts);
+ }
+ }
+ }
+
+ if (this.highlightColors.length == 0) {
+ this.highlightColors = $.jqplot.computeHighlightColors(this._dataColors);
+ }
+
+ else if (typeof(this.highlightColors) == 'string') {
+ var temp = this.highlightColors;
+ this.highlightColors = [];
+ for (var i=0; i<this._dataColors.length; i++) {
+ this.highlightColors.push(temp);
+ }
+ }
+
+ };
+
+
+ // for stacked plots, shadows will be pre drawn by drawShadow.
+ $.jqplot.BarRenderer.prototype.drawShadow = function(ctx, gridData, options, plot) {
+ var i;
+ var opts = (options != undefined) ? options : {};
+ var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
+ var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine;
+ var fill = (opts.fill != undefined) ? opts.fill : this.fill;
+ var xaxis = this.xaxis;
+ var yaxis = this.yaxis;
+ var xp = this._xaxis.series_u2p;
+ var yp = this._yaxis.series_u2p;
+ var pointx, points, pointy, nvals, nseries, pos;
+
+ if (this._stack && this.shadow) {
+ if (this.barWidth == null) {
+ this.renderer.setBarWidth.call(this);
+ }
+
+ var temp = this._plotSeriesInfo = this.renderer.calcSeriesNumbers.call(this);
+ nvals = temp[0];
+ nseries = temp[1];
+ pos = temp[2];
+
+ if (this._stack) {
+ this._barNudge = 0;
+ }
+ else {
+ this._barNudge = (-Math.abs(nseries/2 - 0.5) + pos) * (this.barWidth + this.barPadding);
+ }
+ if (showLine) {
+
+ if (this.barDirection == 'vertical') {
+ for (var i=0; i<gridData.length; i++) {
+ if (this.data[i][1] == null) {
+ continue;
+ }
+ points = [];
+ var base = gridData[i][0] + this._barNudge;
+ var ystart;
+
+ if (this._stack && this._prevGridData.length) {
+ ystart = getStart(this.index, i, this._plotData[i][1], plot, 'y');
+ }
+ else {
+ if (this.fillToZero) {
+ ystart = this._yaxis.series_u2p(0);
+ }
+ else {
+ ystart = ctx.canvas.height;
+ }
+ }
+
+ points.push([base-this.barWidth/2, ystart]);
+ points.push([base-this.barWidth/2, gridData[i][1]]);
+ points.push([base+this.barWidth/2, gridData[i][1]]);
+ points.push([base+this.barWidth/2, ystart]);
+ this.renderer.shadowRenderer.draw(ctx, points, opts);
+ }
+ }
+
+ else if (this.barDirection == 'horizontal'){
+ for (var i=0; i<gridData.length; i++) {
+ if (this.data[i][0] == null) {
+ continue;
+ }
+ points = [];
+ var base = gridData[i][1] - this._barNudge;
+ var xstart;
+
+ if (this._stack && this._prevGridData.length) {
+ xstart = getStart(this.index, i, this._plotData[i][0], plot, 'x');
+ }
+ else {
+ if (this.fillToZero) {
+ xstart = this._xaxis.series_u2p(0);
+ }
+ else {
+ xstart = 0;
+ }
+ }
+
+ points.push([xstart, base+this.barWidth/2]);
+ points.push([gridData[i][0], base+this.barWidth/2]);
+ points.push([gridData[i][0], base-this.barWidth/2]);
+ points.push([xstart, base-this.barWidth/2]);
+ this.renderer.shadowRenderer.draw(ctx, points, opts);
+ }
+ }
+ }
+
+ }
+ };
+
+ function postInit(target, data, options) {
+ for (var i=0; i<this.series.length; i++) {
+ if (this.series[i].renderer.constructor == $.jqplot.BarRenderer) {
+ // don't allow mouseover and mousedown at same time.
+ if (this.series[i].highlightMouseOver) {
+ this.series[i].highlightMouseDown = false;
+ }
+ }
+ }
+ }
+
+ // called within context of plot
+ // create a canvas which we can draw on.
+ // insert it before the eventCanvas, so eventCanvas will still capture events.
+ function postPlotDraw() {
+ // Memory Leaks patch
+ if (this.plugins.barRenderer && this.plugins.barRenderer.highlightCanvas) {
+
+ this.plugins.barRenderer.highlightCanvas.resetCanvas();
+ this.plugins.barRenderer.highlightCanvas = null;
+ }
+
+ this.plugins.barRenderer = {highlightedSeriesIndex:null};
+ this.plugins.barRenderer.highlightCanvas = new $.jqplot.GenericCanvas();
+
+ this.eventCanvas._elem.before(this.plugins.barRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-barRenderer-highlight-canvas', this._plotDimensions, this));
+ this.plugins.barRenderer.highlightCanvas.setContext();
+ this.eventCanvas._elem.bind('mouseleave', {plot:this}, function (ev) { unhighlight(ev.data.plot); });
+ }
+
+ function highlight (plot, sidx, pidx, points) {
+ var s = plot.series[sidx];
+ var canvas = plot.plugins.barRenderer.highlightCanvas;
+ canvas._ctx.clearRect(0,0,canvas._ctx.canvas.width, canvas._ctx.canvas.height);
+ s._highlightedPoint = pidx;
+ plot.plugins.barRenderer.highlightedSeriesIndex = sidx;
+ var opts = {fillStyle: s.highlightColors[pidx]};
+ s.renderer.shapeRenderer.draw(canvas._ctx, points, opts);
+ canvas = null;
+ }
+
+ function unhighlight (plot) {
+ var canvas = plot.plugins.barRenderer.highlightCanvas;
+ canvas._ctx.clearRect(0,0, canvas._ctx.canvas.width, canvas._ctx.canvas.height);
+ for (var i=0; i<plot.series.length; i++) {
+ plot.series[i]._highlightedPoint = null;
+ }
+ plot.plugins.barRenderer.highlightedSeriesIndex = null;
+ plot.target.trigger('jqplotDataUnhighlight');
+ canvas = null;
+ }
+
+
+ function handleMove(ev, gridpos, datapos, neighbor, plot) {
+ if (neighbor) {
+ var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
+ var evt1 = jQuery.Event('jqplotDataMouseOver');
+ evt1.pageX = ev.pageX;
+ evt1.pageY = ev.pageY;
+ plot.target.trigger(evt1, ins);
+ if (plot.series[ins[0]].highlightMouseOver && !(ins[0] == plot.plugins.barRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
+ var evt = jQuery.Event('jqplotDataHighlight');
+ evt.which = ev.which;
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ plot.target.trigger(evt, ins);
+ highlight (plot, neighbor.seriesIndex, neighbor.pointIndex, neighbor.points);
+ }
+ }
+ else if (neighbor == null) {
+ unhighlight (plot);
+ }
+ }
+
+ function handleMouseDown(ev, gridpos, datapos, neighbor, plot) {
+ if (neighbor) {
+ var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
+ if (plot.series[ins[0]].highlightMouseDown && !(ins[0] == plot.plugins.barRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
+ var evt = jQuery.Event('jqplotDataHighlight');
+ evt.which = ev.which;
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ plot.target.trigger(evt, ins);
+ highlight (plot, neighbor.seriesIndex, neighbor.pointIndex, neighbor.points);
+ }
+ }
+ else if (neighbor == null) {
+ unhighlight (plot);
+ }
+ }
+
+ function handleMouseUp(ev, gridpos, datapos, neighbor, plot) {
+ var idx = plot.plugins.barRenderer.highlightedSeriesIndex;
+ if (idx != null && plot.series[idx].highlightMouseDown) {
+ unhighlight(plot);
+ }
+ }
+
+ function handleClick(ev, gridpos, datapos, neighbor, plot) {
+ if (neighbor) {
+ var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
+ var evt = jQuery.Event('jqplotDataClick');
+ evt.which = ev.which;
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ plot.target.trigger(evt, ins);
+ }
+ }
+
+ function handleRightClick(ev, gridpos, datapos, neighbor, plot) {
+ if (neighbor) {
+ var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
+ var idx = plot.plugins.barRenderer.highlightedSeriesIndex;
+ if (idx != null && plot.series[idx].highlightMouseDown) {
+ unhighlight(plot);
+ }
+ var evt = jQuery.Event('jqplotDataRightClick');
+ evt.which = ev.which;
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ plot.target.trigger(evt, ins);
+ }
+ }
+
+
+})(jQuery);
\ No newline at end of file
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.blockRenderer.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.blockRenderer.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.blockRenderer.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,258 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ */
+(function($) {
+ /**
+ * Class: $.jqplot.BlockRenderer
+ * Plugin renderer to draw a x-y block chart. A Block chart has data points displayed as
+ * colored squares with a text label inside. Data must be supplied in the form:
+ *
+ * > [[x1, y1, "label 1", {css}], [x2, y2, "label 2", {css}], ...]
+ *
+ * The label and css object are optional. If the label is ommitted, the
+ * box will collapse unless a css height and/or width is specified.
+ *
+ * The css object is an object specifying css properties
+ * such as:
+ *
+ * > {background:'#4f98a5', border:'3px solid gray', padding:'1px'}
+ *
+ * Note that css properties specified with the data point override defaults
+ * specified with the series.
+ *
+ */
+ $.jqplot.BlockRenderer = function(){
+ $.jqplot.LineRenderer.call(this);
+ };
+
+ $.jqplot.BlockRenderer.prototype = new $.jqplot.LineRenderer();
+ $.jqplot.BlockRenderer.prototype.constructor = $.jqplot.BlockRenderer;
+
+ // called with scope of a series
+ $.jqplot.BlockRenderer.prototype.init = function(options) {
+ // Group: Properties
+ //
+ // prop: css
+ // default css styles that will be applied to all data blocks.
+ // these values will be overridden by css styles supplied with the
+ // individulal data points.
+ this.css = {padding:'2px', border:'1px solid #999', textAlign:'center'};
+ // prop: escapeHtml
+ // true to escape html in the box label.
+ this.escapeHtml = false;
+ // prop: insertBreaks
+ // true to turn spaces in data block label into html breaks <br />.
+ this.insertBreaks = true;
+ // prop: varyBlockColors
+ // true to vary the color of each block in this series according to
+ // the seriesColors array. False to set each block to the color
+ // specified on this series. This has no effect if a css background color
+ // option is specified in the renderer css options.
+ this.varyBlockColors = false;
+ $.extend(true, this, options);
+ if (this.css.backgroundColor) {
+ this.color = this.css.backgroundColor;
+ }
+ else if (this.css.background) {
+ this.color = this.css.background;
+ }
+ else if (!this.varyBlockColors) {
+ this.css.background = this.color;
+ }
+ this.canvas = new $.jqplot.BlockCanvas();
+ this.shadowCanvas = new $.jqplot.BlockCanvas();
+ this.canvas._plotDimensions = this._plotDimensions;
+ this.shadowCanvas._plotDimensions = this._plotDimensions;
+ this._type = 'block';
+
+ // group: Methods
+ //
+ // Method: moveBlock
+ // Moves an individual block. More efficient than redrawing
+ // the whole series by calling plot.drawSeries().
+ // Properties:
+ // idx - the 0 based index of the block or point in this series.
+ // x - the x coordinate in data units (value on x axis) to move the block to.
+ // y - the y coordinate in data units (value on the y axis) to move the block to.
+ // duration - optional parameter to create an animated movement. Can be a
+ // number (higher is slower animation) or 'fast', 'normal' or 'slow'. If not
+ // provided, the element is moved without any animation.
+ this.moveBlock = function (idx, x, y, duration) {
+ // update plotData, stackData, data and gridData
+ // x and y are in data coordinates.
+ var el = this.canvas._elem.children(':eq('+idx+')');
+ this.data[idx][0] = x;
+ this.data[idx][1] = y;
+ this._plotData[idx][0] = x;
+ this._plotData[idx][1] = y;
+ this._stackData[idx][0] = x;
+ this._stackData[idx][1] = y;
+ this.gridData[idx][0] = this._xaxis.series_u2p(x);
+ this.gridData[idx][1] = this._yaxis.series_u2p(y);
+ var w = el.outerWidth();
+ var h = el.outerHeight();
+ var left = this.gridData[idx][0] - w/2 + 'px';
+ var top = this.gridData[idx][1] - h/2 + 'px';
+ if (duration) {
+ if (parseInt(duration, 10)) {
+ duration = parseInt(duration, 10);
+ }
+ el.animate({left:left, top:top}, duration);
+ }
+ else {
+ el.css({left:left, top:top});
+ }
+ el = null;
+ };
+ };
+
+ // called with scope of series
+ $.jqplot.BlockRenderer.prototype.draw = function (ctx, gd, options) {
+ if (this.plugins.pointLabels) {
+ this.plugins.pointLabels.show = false;
+ }
+ var i, el, d, gd, t, css, w, h, left, top;
+ var opts = (options != undefined) ? options : {};
+ var colorGenerator = new $.jqplot.ColorGenerator(this.seriesColors);
+ this.canvas._elem.empty();
+ for (i=0; i<this.gridData.length; i++) {
+ d = this.data[i];
+ gd = this.gridData[i];
+ t = '';
+ css = {};
+ if (typeof d[2] == 'string') {
+ t = d[2];
+ }
+ else if (typeof d[2] == 'object') {
+ css = d[2];
+ }
+ if (typeof d[3] == 'object') {
+ css = d[3];
+ }
+ if (this.insertBreaks){
+ t = t.replace(/ /g, '<br />');
+ }
+ css = $.extend(true, {}, this.css, css);
+ // create a div
+ el = $('<div style="position:absolute;margin-left:auto;margin-right:auto;"></div>');
+ this.canvas._elem.append(el);
+ // set text
+ this.escapeHtml ? el.text(t) : el.html(t);
+ // style it
+ // remove styles we don't want overridden.
+ delete css.position;
+ delete css.marginRight;
+ delete css.marginLeft;
+ if (!css.background && !css.backgroundColor && !css.backgroundImage){
+ css.background = colorGenerator.next();
+ }
+ el.css(css);
+ w = el.outerWidth();
+ h = el.outerHeight();
+ left = gd[0] - w/2 + 'px';
+ top = gd[1] - h/2 + 'px';
+ el.css({left:left, top:top});
+ el = null;
+ }
+ };
+
+ $.jqplot.BlockCanvas = function() {
+ $.jqplot.ElemContainer.call(this);
+ this._ctx;
+ };
+
+ $.jqplot.BlockCanvas.prototype = new $.jqplot.ElemContainer();
+ $.jqplot.BlockCanvas.prototype.constructor = $.jqplot.BlockCanvas;
+
+ $.jqplot.BlockCanvas.prototype.createElement = function(offsets, clss, plotDimensions) {
+ this._offsets = offsets;
+ var klass = 'jqplot-blockCanvas';
+ if (clss != undefined) {
+ klass = clss;
+ }
+ var elem;
+ // if this canvas already has a dom element, don't make a new one.
+ if (this._elem) {
+ elem = this._elem.get(0);
+ }
+ else {
+ elem = document.createElement('div');
+ }
+ // if new plotDimensions supplied, use them.
+ if (plotDimensions != undefined) {
+ this._plotDimensions = plotDimensions;
+ }
+
+ var w = this._plotDimensions.width - this._offsets.left - this._offsets.right + 'px';
+ var h = this._plotDimensions.height - this._offsets.top - this._offsets.bottom + 'px';
+ this._elem = $(elem);
+ this._elem.css({ position: 'absolute', width:w, height:h, left: this._offsets.left, top: this._offsets.top });
+
+ this._elem.addClass(klass);
+ return this._elem;
+ };
+
+ $.jqplot.BlockCanvas.prototype.setContext = function() {
+ this._ctx = {
+ canvas:{
+ width:0,
+ height:0
+ },
+ clearRect:function(){return null;}
+ };
+ return this._ctx;
+ };
+
+})(jQuery);
+
+
\ No newline at end of file
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.bubbleRenderer.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.bubbleRenderer.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.bubbleRenderer.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,782 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ */
+(function($) {
+ var arrayMax = function( array ){
+ return Math.max.apply( Math, array );
+ };
+ var arrayMin = function( array ){
+ return Math.min.apply( Math, array );
+ };
+
+ /**
+ * Class: $.jqplot.BubbleRenderer
+ * Plugin renderer to draw a bubble chart. A Bubble chart has data points displayed as
+ * colored circles with an optional text label inside. To use
+ * the bubble renderer, you must include the bubble renderer like:
+ *
+ * > <script language="javascript" type="text/javascript" src="../src/plugins/jqplot.bubbleRenderer.js"></script>
+ *
+ * Data must be supplied in
+ * the form:
+ *
+ * > [[x1, y1, r1, <label or {label:'text', color:color}>], ...]
+ *
+ * where the label or options
+ * object is optional.
+ *
+ * Note that all bubble colors will be the same
+ * unless the "varyBubbleColors" option is set to true. Colors can be specified in the data array
+ * or in the seriesColors array option on the series. If no colors are defined, the default jqPlot
+ * series of 16 colors are used. Colors are automatically cycled around again if there are more
+ * bubbles than colors.
+ *
+ * Bubbles are autoscaled by default to fit within the chart area while maintaining
+ * relative sizes. If the "autoscaleBubbles" option is set to false, the r(adius) values
+ * in the data array a treated as literal pixel values for the radii of the bubbles.
+ *
+ * Properties are passed into the bubble renderer in the rendererOptions object of
+ * the series options like:
+ *
+ * > seriesDefaults: {
+ * > renderer: $.jqplot.BubbleRenderer,
+ * > rendererOptions: {
+ * > bubbleAlpha: 0.7,
+ * > varyBubbleColors: false
+ * > }
+ * > }
+ *
+ */
+ $.jqplot.BubbleRenderer = function(){
+ $.jqplot.LineRenderer.call(this);
+ };
+
+ $.jqplot.BubbleRenderer.prototype = new $.jqplot.LineRenderer();
+ $.jqplot.BubbleRenderer.prototype.constructor = $.jqplot.BubbleRenderer;
+
+ // called with scope of a series
+ $.jqplot.BubbleRenderer.prototype.init = function(options, plot) {
+ // Group: Properties
+ //
+ // prop: varyBubbleColors
+ // True to vary the color of each bubble in this series according to
+ // the seriesColors array. False to set each bubble to the color
+ // specified on this series. This has no effect if a css background color
+ // option is specified in the renderer css options.
+ this.varyBubbleColors = true;
+ // prop: autoscaleBubbles
+ // True to scale the bubble radius based on plot size.
+ // False will use the radius value as provided as a raw pixel value for
+ // bubble radius.
+ this.autoscaleBubbles = true;
+ // prop: autoscaleMultiplier
+ // Multiplier the bubble size if autoscaleBubbles is true.
+ this.autoscaleMultiplier = 1.0;
+ // prop: autoscalePointsFactor
+ // Factor which decreases bubble size based on how many bubbles on on the chart.
+ // 0 means no adjustment for number of bubbles. Negative values will decrease
+ // size of bubbles as more bubbles are added. Values between 0 and -0.2
+ // should work well.
+ this.autoscalePointsFactor = -0.07;
+ // prop: escapeHtml
+ // True to escape html in bubble label text.
+ this.escapeHtml = true;
+ // prop: highlightMouseOver
+ // True to highlight bubbles when moused over.
+ // This must be false to enable highlightMouseDown to highlight when clicking on a slice.
+ this.highlightMouseOver = true;
+ // prop: highlightMouseDown
+ // True to highlight when a mouse button is pressed over a bubble.
+ // This will be disabled if highlightMouseOver is true.
+ this.highlightMouseDown = false;
+ // prop: highlightColors
+ // An array of colors to use when highlighting a slice. Calculated automatically
+ // if not supplied.
+ this.highlightColors = [];
+ // prop: bubbleAlpha
+ // Alpha transparency to apply to all bubbles in this series.
+ this.bubbleAlpha = 1.0;
+ // prop: highlightAlpha
+ // Alpha transparency to apply when highlighting bubble.
+ // Set to value of bubbleAlpha by default.
+ this.highlightAlpha = null;
+ // prop: bubbleGradients
+ // True to color the bubbles with gradient fills instead of flat colors.
+ // NOT AVAILABLE IN IE due to lack of excanvas support for radial gradient fills.
+ // will be ignored in IE.
+ this.bubbleGradients = false;
+ // prop: showLabels
+ // True to show labels on bubbles (if any), false to not show.
+ this.showLabels = true;
+ // array of [point index, radius] which will be sorted in descending order to plot
+ // largest points below smaller points.
+ this.radii = [];
+ this.maxRadius = 0;
+ // index of the currenty highlighted point, if any
+ this._highlightedPoint = null;
+ // array of jQuery labels.
+ this.labels = [];
+ this.bubbleCanvases = [];
+ this._type = 'bubble';
+
+ // if user has passed in highlightMouseDown option and not set highlightMouseOver, disable highlightMouseOver
+ if (options.highlightMouseDown && options.highlightMouseOver == null) {
+ options.highlightMouseOver = false;
+ }
+
+ $.extend(true, this, options);
+
+ if (this.highlightAlpha == null) {
+ this.highlightAlpha = this.bubbleAlpha;
+ if (this.bubbleGradients) {
+ this.highlightAlpha = 0.35;
+ }
+ }
+
+ this.autoscaleMultiplier = this.autoscaleMultiplier * Math.pow(this.data.length, this.autoscalePointsFactor);
+
+ // index of the currenty highlighted point, if any
+ this._highlightedPoint = null;
+
+ // adjust the series colors for options colors passed in with data or for alpha.
+ // note, this can leave undefined holes in the seriesColors array.
+ var comps;
+ for (var i=0; i<this.data.length; i++) {
+ var color = null;
+ var d = this.data[i];
+ this.maxRadius = Math.max(this.maxRadius, d[2]);
+ if (d[3]) {
+ if (typeof(d[3]) == 'object') {
+ color = d[3]['color'];
+ }
+ }
+
+ if (color == null) {
+ if (this.seriesColors[i] != null) {
+ color = this.seriesColors[i];
+ }
+ }
+
+ if (color && this.bubbleAlpha < 1.0) {
+ comps = $.jqplot.getColorComponents(color);
+ color = 'rgba('+comps[0]+', '+comps[1]+', '+comps[2]+', '+this.bubbleAlpha+')';
+ }
+
+ if (color) {
+ this.seriesColors[i] = color;
+ }
+ }
+
+ if (!this.varyBubbleColors) {
+ this.seriesColors = [this.color];
+ }
+
+ this.colorGenerator = new $.jqplot.ColorGenerator(this.seriesColors);
+
+ // set highlight colors if none provided
+ if (this.highlightColors.length == 0) {
+ for (var i=0; i<this.seriesColors.length; i++){
+ var rgba = $.jqplot.getColorComponents(this.seriesColors[i]);
+ var newrgb = [rgba[0], rgba[1], rgba[2]];
+ var sum = newrgb[0] + newrgb[1] + newrgb[2];
+ for (var j=0; j<3; j++) {
+ // when darkening, lowest color component can be is 60.
+ newrgb[j] = (sum > 570) ? newrgb[j] * 0.8 : newrgb[j] + 0.3 * (255 - newrgb[j]);
+ newrgb[j] = parseInt(newrgb[j], 10);
+ }
+ this.highlightColors.push('rgba('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+', '+this.highlightAlpha+')');
+ }
+ }
+
+ this.highlightColorGenerator = new $.jqplot.ColorGenerator(this.highlightColors);
+
+ var sopts = {fill:true, isarc:true, angle:this.shadowAngle, alpha:this.shadowAlpha, closePath:true};
+
+ this.renderer.shadowRenderer.init(sopts);
+
+ this.canvas = new $.jqplot.DivCanvas();
+ this.canvas._plotDimensions = this._plotDimensions;
+
+ plot.eventListenerHooks.addOnce('jqplotMouseMove', handleMove);
+ plot.eventListenerHooks.addOnce('jqplotMouseDown', handleMouseDown);
+ plot.eventListenerHooks.addOnce('jqplotMouseUp', handleMouseUp);
+ plot.eventListenerHooks.addOnce('jqplotClick', handleClick);
+ plot.eventListenerHooks.addOnce('jqplotRightClick', handleRightClick);
+ plot.postDrawHooks.addOnce(postPlotDraw);
+
+ };
+
+
+ // converts the user data values to grid coordinates and stores them
+ // in the gridData array.
+ // Called with scope of a series.
+ $.jqplot.BubbleRenderer.prototype.setGridData = function(plot) {
+ // recalculate the grid data
+ var xp = this._xaxis.series_u2p;
+ var yp = this._yaxis.series_u2p;
+ var data = this._plotData;
+ this.gridData = [];
+ var radii = [];
+ this.radii = [];
+ var dim = Math.min(plot._height, plot._width);
+ for (var i=0; i<this.data.length; i++) {
+ if (data[i] != null) {
+ this.gridData.push([xp.call(this._xaxis, data[i][0]), yp.call(this._yaxis, data[i][1]), data[i][2]]);
+ this.radii.push([i, data[i][2]]);
+ radii.push(data[i][2]);
+ }
+ }
+ var r, val, maxr = this.maxRadius = arrayMax(radii);
+ var l = this.gridData.length;
+ if (this.autoscaleBubbles) {
+ for (var i=0; i<l; i++) {
+ val = radii[i]/maxr;
+ r = this.autoscaleMultiplier * dim / 6;
+ this.gridData[i][2] = r * val;
+ }
+ }
+
+ this.radii.sort(function(a, b) { return b[1] - a[1]; });
+ };
+
+ // converts any arbitrary data values to grid coordinates and
+ // returns them. This method exists so that plugins can use a series'
+ // linerenderer to generate grid data points without overwriting the
+ // grid data associated with that series.
+ // Called with scope of a series.
+ $.jqplot.BubbleRenderer.prototype.makeGridData = function(data, plot) {
+ // recalculate the grid data
+ var xp = this._xaxis.series_u2p;
+ var yp = this._yaxis.series_u2p;
+ var gd = [];
+ var radii = [];
+ this.radii = [];
+ var dim = Math.min(plot._height, plot._width);
+ for (var i=0; i<data.length; i++) {
+ if (data[i] != null) {
+ gd.push([xp.call(this._xaxis, data[i][0]), yp.call(this._yaxis, data[i][1]), data[i][2]]);
+ radii.push(data[i][2]);
+ this.radii.push([i, data[i][2]]);
+ }
+ }
+ var r, val, maxr = this.maxRadius = arrayMax(radii);
+ var l = this.gridData.length;
+ if (this.autoscaleBubbles) {
+ for (var i=0; i<l; i++) {
+ val = radii[i]/maxr;
+ r = this.autoscaleMultiplier * dim / 6;
+ gd[i][2] = r * val;
+ }
+ }
+ this.radii.sort(function(a, b) { return b[1] - a[1]; });
+ return gd;
+ };
+
+ // called with scope of series
+ $.jqplot.BubbleRenderer.prototype.draw = function (ctx, gd, options) {
+ if (this.plugins.pointLabels) {
+ this.plugins.pointLabels.show = false;
+ }
+ var opts = (options != undefined) ? options : {};
+ var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
+ this.canvas._elem.empty();
+ for (var i=0; i<this.radii.length; i++) {
+ var idx = this.radii[i][0];
+ var t=null;
+ var color = null;
+ var el = null;
+ var tel = null;
+ var d = this.data[idx];
+ var gd = this.gridData[idx];
+ if (d[3]) {
+ if (typeof(d[3]) == 'object') {
+ t = d[3]['label'];
+ }
+ else if (typeof(d[3]) == 'string') {
+ t = d[3];
+ }
+ }
+
+ // color = (this.varyBubbleColors) ? this.colorGenerator.get(idx) : this.color;
+ color = this.colorGenerator.get(idx);
+
+ // If we're drawing a shadow, expand the canvas dimensions to accomodate.
+ var canvasRadius = gd[2];
+ var offset, depth;
+ if (this.shadow) {
+ offset = (0.7 + gd[2]/40).toFixed(1);
+ depth = 1 + Math.ceil(gd[2]/15);
+ canvasRadius += offset*depth;
+ }
+ this.bubbleCanvases[idx] = new $.jqplot.BubbleCanvas();
+ this.canvas._elem.append(this.bubbleCanvases[idx].createElement(gd[0], gd[1], canvasRadius));
+ this.bubbleCanvases[idx].setContext();
+ var ctx = this.bubbleCanvases[idx]._ctx;
+ var x = ctx.canvas.width/2;
+ var y = ctx.canvas.height/2;
+ if (this.shadow) {
+ this.renderer.shadowRenderer.draw(ctx, [x, y, gd[2], 0, 2*Math.PI], {offset: offset, depth: depth});
+ }
+ this.bubbleCanvases[idx].draw(gd[2], color, this.bubbleGradients, this.shadowAngle/180*Math.PI);
+
+ // now draw label.
+ if (t && this.showLabels) {
+ tel = $('<div style="position:absolute;" class="jqplot-bubble-label"></div>');
+ if (this.escapeHtml) {
+ tel.text(t);
+ }
+ else {
+ tel.html(t);
+ }
+ this.canvas._elem.append(tel);
+ var h = $(tel).outerHeight();
+ var w = $(tel).outerWidth();
+ var top = gd[1] - 0.5*h;
+ var left = gd[0] - 0.5*w;
+ tel.css({top: top, left: left});
+ this.labels[idx] = $(tel);
+ }
+ }
+ };
+
+
+ $.jqplot.DivCanvas = function() {
+ $.jqplot.ElemContainer.call(this);
+ this._ctx;
+ };
+
+ $.jqplot.DivCanvas.prototype = new $.jqplot.ElemContainer();
+ $.jqplot.DivCanvas.prototype.constructor = $.jqplot.DivCanvas;
+
+ $.jqplot.DivCanvas.prototype.createElement = function(offsets, clss, plotDimensions) {
+ this._offsets = offsets;
+ var klass = 'jqplot-DivCanvas';
+ if (clss != undefined) {
+ klass = clss;
+ }
+ var elem;
+ // if this canvas already has a dom element, don't make a new one.
+ if (this._elem) {
+ elem = this._elem.get(0);
+ }
+ else {
+ elem = document.createElement('div');
+ }
+ // if new plotDimensions supplied, use them.
+ if (plotDimensions != undefined) {
+ this._plotDimensions = plotDimensions;
+ }
+
+ var w = this._plotDimensions.width - this._offsets.left - this._offsets.right + 'px';
+ var h = this._plotDimensions.height - this._offsets.top - this._offsets.bottom + 'px';
+ this._elem = $(elem);
+ this._elem.css({ position: 'absolute', width:w, height:h, left: this._offsets.left, top: this._offsets.top });
+
+ this._elem.addClass(klass);
+ return this._elem;
+ };
+
+ $.jqplot.DivCanvas.prototype.setContext = function() {
+ this._ctx = {
+ canvas:{
+ width:0,
+ height:0
+ },
+ clearRect:function(){return null;}
+ };
+ return this._ctx;
+ };
+
+ $.jqplot.BubbleCanvas = function() {
+ $.jqplot.ElemContainer.call(this);
+ this._ctx;
+ };
+
+ $.jqplot.BubbleCanvas.prototype = new $.jqplot.ElemContainer();
+ $.jqplot.BubbleCanvas.prototype.constructor = $.jqplot.BubbleCanvas;
+
+ // initialize with the x,y pont of bubble center and the bubble radius.
+ $.jqplot.BubbleCanvas.prototype.createElement = function(x, y, r) {
+ var klass = 'jqplot-bubble-point';
+
+ var elem;
+ // if this canvas already has a dom element, don't make a new one.
+ if (this._elem) {
+ elem = this._elem.get(0);
+ }
+ else {
+ elem = document.createElement('canvas');
+ }
+
+ elem.width = (r != null) ? 2*r : elem.width;
+ elem.height = (r != null) ? 2*r : elem.height;
+ this._elem = $(elem);
+ var l = (x != null && r != null) ? x - r : this._elem.css('left');
+ var t = (y != null && r != null) ? y - r : this._elem.css('top');
+ this._elem.css({ position: 'absolute', left: l, top: t });
+
+ this._elem.addClass(klass);
+ if ($.jqplot.use_excanvas) {
+ window.G_vmlCanvasManager.init_(document);
+ elem = window.G_vmlCanvasManager.initElement(elem);
+ }
+
+ return this._elem;
+ };
+
+ $.jqplot.BubbleCanvas.prototype.draw = function(r, color, gradients, angle) {
+ var ctx = this._ctx;
+ // r = Math.floor(r*1.04);
+ // var x = Math.round(ctx.canvas.width/2);
+ // var y = Math.round(ctx.canvas.height/2);
+ var x = ctx.canvas.width/2;
+ var y = ctx.canvas.height/2;
+ ctx.save();
+ if (gradients && !$.jqplot.use_excanvas) {
+ r = r*1.04;
+ var comps = $.jqplot.getColorComponents(color);
+ var colorinner = 'rgba('+Math.round(comps[0]+0.8*(255-comps[0]))+', '+Math.round(comps[1]+0.8*(255-comps[1]))+', '+Math.round(comps[2]+0.8*(255-comps[2]))+', '+comps[3]+')';
+ var colorend = 'rgba('+comps[0]+', '+comps[1]+', '+comps[2]+', 0)';
+ // var rinner = Math.round(0.35 * r);
+ // var xinner = Math.round(x - Math.cos(angle) * 0.33 * r);
+ // var yinner = Math.round(y - Math.sin(angle) * 0.33 * r);
+ var rinner = 0.35 * r;
+ var xinner = x - Math.cos(angle) * 0.33 * r;
+ var yinner = y - Math.sin(angle) * 0.33 * r;
+ var radgrad = ctx.createRadialGradient(xinner, yinner, rinner, x, y, r);
+ radgrad.addColorStop(0, colorinner);
+ radgrad.addColorStop(0.93, color);
+ radgrad.addColorStop(0.96, colorend);
+ radgrad.addColorStop(1, colorend);
+ // radgrad.addColorStop(.98, colorend);
+ ctx.fillStyle = radgrad;
+ ctx.fillRect(0,0, ctx.canvas.width, ctx.canvas.height);
+ }
+ else {
+ ctx.fillStyle = color;
+ ctx.strokeStyle = color;
+ ctx.lineWidth = 1;
+ ctx.beginPath();
+ var ang = 2*Math.PI;
+ ctx.arc(x, y, r, 0, ang, 0);
+ ctx.closePath();
+ ctx.fill();
+ }
+ ctx.restore();
+ };
+
+ $.jqplot.BubbleCanvas.prototype.setContext = function() {
+ this._ctx = this._elem.get(0).getContext("2d");
+ return this._ctx;
+ };
+
+ $.jqplot.BubbleAxisRenderer = function() {
+ $.jqplot.LinearAxisRenderer.call(this);
+ };
+
+ $.jqplot.BubbleAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer();
+ $.jqplot.BubbleAxisRenderer.prototype.constructor = $.jqplot.BubbleAxisRenderer;
+
+ // called with scope of axis object.
+ $.jqplot.BubbleAxisRenderer.prototype.init = function(options){
+ $.extend(true, this, options);
+ var db = this._dataBounds;
+ var minsidx = 0,
+ minpidx = 0,
+ maxsidx = 0,
+ maxpidx = 0,
+ maxr = 0,
+ minr = 0,
+ minMaxRadius = 0,
+ maxMaxRadius = 0,
+ maxMult = 0,
+ minMult = 0;
+ // Go through all the series attached to this axis and find
+ // the min/max bounds for this axis.
+ for (var i=0; i<this._series.length; i++) {
+ var s = this._series[i];
+ var d = s._plotData;
+
+ for (var j=0; j<d.length; j++) {
+ if (this.name == 'xaxis' || this.name == 'x2axis') {
+ if (d[j][0] < db.min || db.min == null) {
+ db.min = d[j][0];
+ minsidx=i;
+ minpidx=j;
+ minr = d[j][2];
+ minMaxRadius = s.maxRadius;
+ minMult = s.autoscaleMultiplier;
+ }
+ if (d[j][0] > db.max || db.max == null) {
+ db.max = d[j][0];
+ maxsidx=i;
+ maxpidx=j;
+ maxr = d[j][2];
+ maxMaxRadius = s.maxRadius;
+ maxMult = s.autoscaleMultiplier;
+ }
+ }
+ else {
+ if (d[j][1] < db.min || db.min == null) {
+ db.min = d[j][1];
+ minsidx=i;
+ minpidx=j;
+ minr = d[j][2];
+ minMaxRadius = s.maxRadius;
+ minMult = s.autoscaleMultiplier;
+ }
+ if (d[j][1] > db.max || db.max == null) {
+ db.max = d[j][1];
+ maxsidx=i;
+ maxpidx=j;
+ maxr = d[j][2];
+ maxMaxRadius = s.maxRadius;
+ maxMult = s.autoscaleMultiplier;
+ }
+ }
+ }
+ }
+
+ var minRatio = minr/minMaxRadius;
+ var maxRatio = maxr/maxMaxRadius;
+
+ // need to estimate the effect of the radius on total axis span and adjust axis accordingly.
+ var span = db.max - db.min;
+ // var dim = (this.name == 'xaxis' || this.name == 'x2axis') ? this._plotDimensions.width : this._plotDimensions.height;
+ var dim = Math.min(this._plotDimensions.width, this._plotDimensions.height);
+
+ var minfact = minRatio * minMult/3 * span;
+ var maxfact = maxRatio * maxMult/3 * span;
+ db.max += maxfact;
+ db.min -= minfact;
+ };
+
+ function highlight (plot, sidx, pidx) {
+ plot.plugins.bubbleRenderer.highlightLabelCanvas.empty();
+ var s = plot.series[sidx];
+ var canvas = plot.plugins.bubbleRenderer.highlightCanvas;
+ var ctx = canvas._ctx;
+ ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height);
+ s._highlightedPoint = pidx;
+ plot.plugins.bubbleRenderer.highlightedSeriesIndex = sidx;
+
+ var color = s.highlightColorGenerator.get(pidx);
+ var x = s.gridData[pidx][0],
+ y = s.gridData[pidx][1],
+ r = s.gridData[pidx][2];
+ ctx.save();
+ ctx.fillStyle = color;
+ ctx.strokeStyle = color;
+ ctx.lineWidth = 1;
+ ctx.beginPath();
+ ctx.arc(x, y, r, 0, 2*Math.PI, 0);
+ ctx.closePath();
+ ctx.fill();
+ ctx.restore();
+ // bring label to front
+ if (s.labels[pidx]) {
+ plot.plugins.bubbleRenderer.highlightLabel = s.labels[pidx].clone();
+ plot.plugins.bubbleRenderer.highlightLabel.appendTo(plot.plugins.bubbleRenderer.highlightLabelCanvas);
+ plot.plugins.bubbleRenderer.highlightLabel.addClass('jqplot-bubble-label-highlight');
+ }
+ }
+
+ function unhighlight (plot) {
+ var canvas = plot.plugins.bubbleRenderer.highlightCanvas;
+ var sidx = plot.plugins.bubbleRenderer.highlightedSeriesIndex;
+ plot.plugins.bubbleRenderer.highlightLabelCanvas.empty();
+ canvas._ctx.clearRect(0,0, canvas._ctx.canvas.width, canvas._ctx.canvas.height);
+ for (var i=0; i<plot.series.length; i++) {
+ plot.series[i]._highlightedPoint = null;
+ }
+ plot.plugins.bubbleRenderer.highlightedSeriesIndex = null;
+ plot.target.trigger('jqplotDataUnhighlight');
+ }
+
+
+ function handleMove(ev, gridpos, datapos, neighbor, plot) {
+ if (neighbor) {
+ var si = neighbor.seriesIndex;
+ var pi = neighbor.pointIndex;
+ var ins = [si, pi, neighbor.data, plot.series[si].gridData[pi][2]];
+ var evt1 = jQuery.Event('jqplotDataMouseOver');
+ evt1.pageX = ev.pageX;
+ evt1.pageY = ev.pageY;
+ plot.target.trigger(evt1, ins);
+ if (plot.series[ins[0]].highlightMouseOver && !(ins[0] == plot.plugins.bubbleRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
+ var evt = jQuery.Event('jqplotDataHighlight');
+ evt.which = ev.which;
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ plot.target.trigger(evt, ins);
+ highlight (plot, ins[0], ins[1]);
+ }
+ }
+ else if (neighbor == null) {
+ unhighlight (plot);
+ }
+ }
+
+ function handleMouseDown(ev, gridpos, datapos, neighbor, plot) {
+ if (neighbor) {
+ var si = neighbor.seriesIndex;
+ var pi = neighbor.pointIndex;
+ var ins = [si, pi, neighbor.data, plot.series[si].gridData[pi][2]];
+ if (plot.series[ins[0]].highlightMouseDown && !(ins[0] == plot.plugins.bubbleRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
+ var evt = jQuery.Event('jqplotDataHighlight');
+ evt.which = ev.which;
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ plot.target.trigger(evt, ins);
+ highlight (plot, ins[0], ins[1]);
+ }
+ }
+ else if (neighbor == null) {
+ unhighlight (plot);
+ }
+ }
+
+ function handleMouseUp(ev, gridpos, datapos, neighbor, plot) {
+ var idx = plot.plugins.bubbleRenderer.highlightedSeriesIndex;
+ if (idx != null && plot.series[idx].highlightMouseDown) {
+ unhighlight(plot);
+ }
+ }
+
+ function handleClick(ev, gridpos, datapos, neighbor, plot) {
+ if (neighbor) {
+ var si = neighbor.seriesIndex;
+ var pi = neighbor.pointIndex;
+ var ins = [si, pi, neighbor.data, plot.series[si].gridData[pi][2]];
+ var evt = jQuery.Event('jqplotDataClick');
+ evt.which = ev.which;
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ plot.target.trigger(evt, ins);
+ }
+ }
+
+ function handleRightClick(ev, gridpos, datapos, neighbor, plot) {
+ if (neighbor) {
+ var si = neighbor.seriesIndex;
+ var pi = neighbor.pointIndex;
+ var ins = [si, pi, neighbor.data, plot.series[si].gridData[pi][2]];
+ var idx = plot.plugins.bubbleRenderer.highlightedSeriesIndex;
+ if (idx != null && plot.series[idx].highlightMouseDown) {
+ unhighlight(plot);
+ }
+ var evt = jQuery.Event('jqplotDataRightClick');
+ evt.which = ev.which;
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ plot.target.trigger(evt, ins);
+ }
+ }
+
+ // called within context of plot
+ // create a canvas which we can draw on.
+ // insert it before the eventCanvas, so eventCanvas will still capture events.
+ function postPlotDraw() {
+ // Memory Leaks patch
+ if (this.plugins.bubbleRenderer && this.plugins.bubbleRenderer.highlightCanvas) {
+ this.plugins.bubbleRenderer.highlightCanvas.resetCanvas();
+ this.plugins.bubbleRenderer.highlightCanvas = null;
+ }
+
+ this.plugins.bubbleRenderer = {highlightedSeriesIndex:null};
+ this.plugins.bubbleRenderer.highlightCanvas = new $.jqplot.GenericCanvas();
+ this.plugins.bubbleRenderer.highlightLabel = null;
+ this.plugins.bubbleRenderer.highlightLabelCanvas = $('<div style="position:absolute;"></div>');
+ var top = this._gridPadding.top;
+ var left = this._gridPadding.left;
+ var width = this._plotDimensions.width - this._gridPadding.left - this._gridPadding.right;
+ var height = this._plotDimensions.height - this._gridPadding.top - this._gridPadding.bottom;
+ this.plugins.bubbleRenderer.highlightLabelCanvas.css({top:top, left:left, width:width+'px', height:height+'px'});
+
+ this.eventCanvas._elem.before(this.plugins.bubbleRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-bubbleRenderer-highlight-canvas', this._plotDimensions, this));
+ this.eventCanvas._elem.before(this.plugins.bubbleRenderer.highlightLabelCanvas);
+
+ var hctx = this.plugins.bubbleRenderer.highlightCanvas.setContext();
+ }
+
+
+ // setup default renderers for axes and legend so user doesn't have to
+ // called with scope of plot
+ function preInit(target, data, options) {
+ options = options || {};
+ options.axesDefaults = options.axesDefaults || {};
+ options.seriesDefaults = options.seriesDefaults || {};
+ // only set these if there is a Bubble series
+ var setopts = false;
+ if (options.seriesDefaults.renderer == $.jqplot.BubbleRenderer) {
+ setopts = true;
+ }
+ else if (options.series) {
+ for (var i=0; i < options.series.length; i++) {
+ if (options.series[i].renderer == $.jqplot.BubbleRenderer) {
+ setopts = true;
+ }
+ }
+ }
+
+ if (setopts) {
+ options.axesDefaults.renderer = $.jqplot.BubbleAxisRenderer;
+ options.sortData = false;
+ }
+ }
+
+ $.jqplot.preInitHooks.push(preInit);
+
+})(jQuery);
+
+
\ No newline at end of file
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasAxisLabelRenderer.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasAxisLabelRenderer.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasAxisLabelRenderer.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,226 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ */
+(function($) {
+ /**
+ * Class: $.jqplot.CanvasAxisLabelRenderer
+ * Renderer to draw axis labels with a canvas element to support advanced
+ * featrues such as rotated text. This renderer uses a separate rendering engine
+ * to draw the text on the canvas. Two modes of rendering the text are available.
+ * If the browser has native font support for canvas fonts (currently Mozila 3.5
+ * and Safari 4), you can enable text rendering with the canvas fillText method.
+ * You do so by setting the "enableFontSupport" option to true.
+ *
+ * Browsers lacking native font support will have the text drawn on the canvas
+ * using the Hershey font metrics. Even if the "enableFontSupport" option is true
+ * non-supporting browsers will still render with the Hershey font.
+ *
+ */
+ $.jqplot.CanvasAxisLabelRenderer = function(options) {
+ // Group: Properties
+
+ // prop: angle
+ // angle of text, measured clockwise from x axis.
+ this.angle = 0;
+ // name of the axis associated with this tick
+ this.axis;
+ // prop: show
+ // wether or not to show the tick (mark and label).
+ this.show = true;
+ // prop: showLabel
+ // wether or not to show the label.
+ this.showLabel = true;
+ // prop: label
+ // label for the axis.
+ this.label = '';
+ // prop: fontFamily
+ // CSS spec for the font-family css attribute.
+ // Applies only to browsers supporting native font rendering in the
+ // canvas tag. Currently Mozilla 3.5 and Safari 4.
+ this.fontFamily = '"Trebuchet MS", Arial, Helvetica, sans-serif';
+ // prop: fontSize
+ // CSS spec for font size.
+ this.fontSize = '11pt';
+ // prop: fontWeight
+ // CSS spec for fontWeight: normal, bold, bolder, lighter or a number 100 - 900
+ this.fontWeight = 'normal';
+ // prop: fontStretch
+ // Multiplier to condense or expand font width.
+ // Applies only to browsers which don't support canvas native font rendering.
+ this.fontStretch = 1.0;
+ // prop: textColor
+ // css spec for the color attribute.
+ this.textColor = '#666666';
+ // prop: enableFontSupport
+ // true to turn on native canvas font support in Mozilla 3.5+ and Safari 4+.
+ // If true, label will be drawn with canvas tag native support for fonts.
+ // If false, label will be drawn with Hershey font metrics.
+ this.enableFontSupport = true;
+ // prop: pt2px
+ // Point to pixel scaling factor, used for computing height of bounding box
+ // around a label. The labels text renderer has a default setting of 1.4, which
+ // should be suitable for most fonts. Leave as null to use default. If tops of
+ // letters appear clipped, increase this. If bounding box seems too big, decrease.
+ // This is an issue only with the native font renderering capabilities of Mozilla
+ // 3.5 and Safari 4 since they do not provide a method to determine the font height.
+ this.pt2px = null;
+
+ this._elem;
+ this._ctx;
+ this._plotWidth;
+ this._plotHeight;
+ this._plotDimensions = {height:null, width:null};
+
+ $.extend(true, this, options);
+
+ if (options.angle == null && this.axis != 'xaxis' && this.axis != 'x2axis') {
+ this.angle = -90;
+ }
+
+ var ropts = {fontSize:this.fontSize, fontWeight:this.fontWeight, fontStretch:this.fontStretch, fillStyle:this.textColor, angle:this.getAngleRad(), fontFamily:this.fontFamily};
+ if (this.pt2px) {
+ ropts.pt2px = this.pt2px;
+ }
+
+ if (this.enableFontSupport) {
+ if ($.jqplot.support_canvas_text()) {
+ this._textRenderer = new $.jqplot.CanvasFontRenderer(ropts);
+ }
+
+ else {
+ this._textRenderer = new $.jqplot.CanvasTextRenderer(ropts);
+ }
+ }
+ else {
+ this._textRenderer = new $.jqplot.CanvasTextRenderer(ropts);
+ }
+ };
+
+ $.jqplot.CanvasAxisLabelRenderer.prototype.init = function(options) {
+ $.extend(true, this, options);
+ this._textRenderer.init({fontSize:this.fontSize, fontWeight:this.fontWeight, fontStretch:this.fontStretch, fillStyle:this.textColor, angle:this.getAngleRad(), fontFamily:this.fontFamily});
+ };
+
+ // return width along the x axis
+ // will check first to see if an element exists.
+ // if not, will return the computed text box width.
+ $.jqplot.CanvasAxisLabelRenderer.prototype.getWidth = function(ctx) {
+ if (this._elem) {
+ return this._elem.outerWidth(true);
+ }
+ else {
+ var tr = this._textRenderer;
+ var l = tr.getWidth(ctx);
+ var h = tr.getHeight(ctx);
+ var w = Math.abs(Math.sin(tr.angle)*h) + Math.abs(Math.cos(tr.angle)*l);
+ return w;
+ }
+ };
+
+ // return height along the y axis.
+ $.jqplot.CanvasAxisLabelRenderer.prototype.getHeight = function(ctx) {
+ if (this._elem) {
+ return this._elem.outerHeight(true);
+ }
+ else {
+ var tr = this._textRenderer;
+ var l = tr.getWidth(ctx);
+ var h = tr.getHeight(ctx);
+ var w = Math.abs(Math.cos(tr.angle)*h) + Math.abs(Math.sin(tr.angle)*l);
+ return w;
+ }
+ };
+
+ $.jqplot.CanvasAxisLabelRenderer.prototype.getAngleRad = function() {
+ var a = this.angle * Math.PI/180;
+ return a;
+ };
+
+ $.jqplot.CanvasAxisLabelRenderer.prototype.draw = function(ctx, plot) {
+ // Memory Leaks patch
+ if (this._elem) {
+ if ($.jqplot.use_excanvas && window.G_vmlCanvasManager.uninitElement !== undefined) {
+ window.G_vmlCanvasManager.uninitElement(this._elem.get(0));
+ }
+
+ this._elem.emptyForce();
+ this._elem = null;
+ }
+
+ // create a canvas here, but can't draw on it untill it is appended
+ // to dom for IE compatability.
+ var elem = plot.canvasManager.getCanvas();
+
+ this._textRenderer.setText(this.label, ctx);
+ var w = this.getWidth(ctx);
+ var h = this.getHeight(ctx);
+ elem.width = w;
+ elem.height = h;
+ elem.style.width = w;
+ elem.style.height = h;
+
+ elem = plot.canvasManager.initCanvas(elem);
+
+ this._elem = $(elem);
+ this._elem.css({ position: 'absolute'});
+ this._elem.addClass('jqplot-'+this.axis+'-label');
+
+ elem = null;
+ return this._elem;
+ };
+
+ $.jqplot.CanvasAxisLabelRenderer.prototype.pack = function() {
+ this._textRenderer.draw(this._elem.get(0).getContext("2d"), this.label);
+ };
+
+})(jQuery);
\ No newline at end of file
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasAxisTickRenderer.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasAxisTickRenderer.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasAxisTickRenderer.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,266 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ */
+(function($) {
+ /**
+ * Class: $.jqplot.CanvasAxisTickRenderer
+ * Renderer to draw axis ticks with a canvas element to support advanced
+ * featrues such as rotated text. This renderer uses a separate rendering engine
+ * to draw the text on the canvas. Two modes of rendering the text are available.
+ * If the browser has native font support for canvas fonts (currently Mozila 3.5
+ * and Safari 4), you can enable text rendering with the canvas fillText method.
+ * You do so by setting the "enableFontSupport" option to true.
+ *
+ * Browsers lacking native font support will have the text drawn on the canvas
+ * using the Hershey font metrics. Even if the "enableFontSupport" option is true
+ * non-supporting browsers will still render with the Hershey font.
+ */
+ $.jqplot.CanvasAxisTickRenderer = function(options) {
+ // Group: Properties
+
+ // prop: mark
+ // tick mark on the axis. One of 'inside', 'outside', 'cross', '' or null.
+ this.mark = 'outside';
+ // prop: showMark
+ // wether or not to show the mark on the axis.
+ this.showMark = true;
+ // prop: showGridline
+ // wether or not to draw the gridline on the grid at this tick.
+ this.showGridline = true;
+ // prop: isMinorTick
+ // if this is a minor tick.
+ this.isMinorTick = false;
+ // prop: angle
+ // angle of text, measured clockwise from x axis.
+ this.angle = 0;
+ // prop: markSize
+ // Length of the tick marks in pixels. For 'cross' style, length
+ // will be stoked above and below axis, so total length will be twice this.
+ this.markSize = 4;
+ // prop: show
+ // wether or not to show the tick (mark and label).
+ this.show = true;
+ // prop: showLabel
+ // wether or not to show the label.
+ this.showLabel = true;
+ // prop: labelPosition
+ // 'auto', 'start', 'middle' or 'end'.
+ // Whether tick label should be positioned so the start, middle, or end
+ // of the tick mark.
+ this.labelPosition = 'auto';
+ this.label = '';
+ this.value = null;
+ this._styles = {};
+ // prop: formatter
+ // A class of a formatter for the tick text.
+ // The default $.jqplot.DefaultTickFormatter uses sprintf.
+ this.formatter = $.jqplot.DefaultTickFormatter;
+ // prop: formatString
+ // string passed to the formatter.
+ this.formatString = '';
+ // prop: prefix
+ // String to prepend to the tick label.
+ // Prefix is prepended to the formatted tick label.
+ this.prefix = '';
+ // prop: fontFamily
+ // css spec for the font-family css attribute.
+ this.fontFamily = '"Trebuchet MS", Arial, Helvetica, sans-serif';
+ // prop: fontSize
+ // CSS spec for font size.
+ this.fontSize = '10pt';
+ // prop: fontWeight
+ // CSS spec for fontWeight
+ this.fontWeight = 'normal';
+ // prop: fontStretch
+ // Multiplier to condense or expand font width.
+ // Applies only to browsers which don't support canvas native font rendering.
+ this.fontStretch = 1.0;
+ // prop: textColor
+ // css spec for the color attribute.
+ this.textColor = '#666666';
+ // prop: enableFontSupport
+ // true to turn on native canvas font support in Mozilla 3.5+ and Safari 4+.
+ // If true, tick label will be drawn with canvas tag native support for fonts.
+ // If false, tick label will be drawn with Hershey font metrics.
+ this.enableFontSupport = true;
+ // prop: pt2px
+ // Point to pixel scaling factor, used for computing height of bounding box
+ // around a label. The labels text renderer has a default setting of 1.4, which
+ // should be suitable for most fonts. Leave as null to use default. If tops of
+ // letters appear clipped, increase this. If bounding box seems too big, decrease.
+ // This is an issue only with the native font renderering capabilities of Mozilla
+ // 3.5 and Safari 4 since they do not provide a method to determine the font height.
+ this.pt2px = null;
+
+ this._elem;
+ this._ctx;
+ this._plotWidth;
+ this._plotHeight;
+ this._plotDimensions = {height:null, width:null};
+
+ $.extend(true, this, options);
+
+ var ropts = {fontSize:this.fontSize, fontWeight:this.fontWeight, fontStretch:this.fontStretch, fillStyle:this.textColor, angle:this.getAngleRad(), fontFamily:this.fontFamily};
+ if (this.pt2px) {
+ ropts.pt2px = this.pt2px;
+ }
+
+ if (this.enableFontSupport) {
+ if ($.jqplot.support_canvas_text()) {
+ this._textRenderer = new $.jqplot.CanvasFontRenderer(ropts);
+ }
+
+ else {
+ this._textRenderer = new $.jqplot.CanvasTextRenderer(ropts);
+ }
+ }
+ else {
+ this._textRenderer = new $.jqplot.CanvasTextRenderer(ropts);
+ }
+ };
+
+ $.jqplot.CanvasAxisTickRenderer.prototype.init = function(options) {
+ $.extend(true, this, options);
+ this._textRenderer.init({fontSize:this.fontSize, fontWeight:this.fontWeight, fontStretch:this.fontStretch, fillStyle:this.textColor, angle:this.getAngleRad(), fontFamily:this.fontFamily});
+ };
+
+ // return width along the x axis
+ // will check first to see if an element exists.
+ // if not, will return the computed text box width.
+ $.jqplot.CanvasAxisTickRenderer.prototype.getWidth = function(ctx) {
+ if (this._elem) {
+ return this._elem.outerWidth(true);
+ }
+ else {
+ var tr = this._textRenderer;
+ var l = tr.getWidth(ctx);
+ var h = tr.getHeight(ctx);
+ var w = Math.abs(Math.sin(tr.angle)*h) + Math.abs(Math.cos(tr.angle)*l);
+ return w;
+ }
+ };
+
+ // return height along the y axis.
+ $.jqplot.CanvasAxisTickRenderer.prototype.getHeight = function(ctx) {
+ if (this._elem) {
+ return this._elem.outerHeight(true);
+ }
+ else {
+ var tr = this._textRenderer;
+ var l = tr.getWidth(ctx);
+ var h = tr.getHeight(ctx);
+ var w = Math.abs(Math.cos(tr.angle)*h) + Math.abs(Math.sin(tr.angle)*l);
+ return w;
+ }
+ };
+
+ $.jqplot.CanvasAxisTickRenderer.prototype.getAngleRad = function() {
+ var a = this.angle * Math.PI/180;
+ return a;
+ };
+
+
+ $.jqplot.CanvasAxisTickRenderer.prototype.setTick = function(value, axisName, isMinor) {
+ this.value = value;
+ if (isMinor) {
+ this.isMinorTick = true;
+ }
+ return this;
+ };
+
+ $.jqplot.CanvasAxisTickRenderer.prototype.draw = function(ctx, plot) {
+ if (!this.label) {
+ this.label = this.prefix + this.formatter(this.formatString, this.value);
+ }
+
+ // Memory Leaks patch
+ if (this._elem) {
+ if ($.jqplot.use_excanvas && window.G_vmlCanvasManager.uninitElement !== undefined) {
+ window.G_vmlCanvasManager.uninitElement(this._elem.get(0));
+ }
+
+ this._elem.emptyForce();
+ this._elem = null;
+ }
+
+ // create a canvas here, but can't draw on it untill it is appended
+ // to dom for IE compatability.
+
+ var elem = plot.canvasManager.getCanvas();
+
+ this._textRenderer.setText(this.label, ctx);
+ var w = this.getWidth(ctx);
+ var h = this.getHeight(ctx);
+ // canvases seem to need to have width and heigh attributes directly set.
+ elem.width = w;
+ elem.height = h;
+ elem.style.width = w;
+ elem.style.height = h;
+ elem.style.textAlign = 'left';
+ elem.style.position = 'absolute';
+
+ elem = plot.canvasManager.initCanvas(elem);
+
+ this._elem = $(elem);
+ this._elem.css(this._styles);
+ this._elem.addClass('jqplot-'+this.axis+'-tick');
+
+ elem = null;
+ return this._elem;
+ };
+
+ $.jqplot.CanvasAxisTickRenderer.prototype.pack = function() {
+ this._textRenderer.draw(this._elem.get(0).getContext("2d"), this.label);
+ };
+
+})(jQuery);
\ No newline at end of file
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasOverlay.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasOverlay.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasOverlay.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,888 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ */
+(function($) {
+ var objCounter = 0;
+ // class: $.jqplot.CanvasOverlay
+ $.jqplot.CanvasOverlay = function(opts){
+ var options = opts || {};
+ this.options = {
+ show: $.jqplot.config.enablePlugins,
+ deferDraw: false
+ };
+ // prop: objects
+ this.objects = [];
+ this.objectNames = [];
+ this.canvas = null;
+ this.markerRenderer = new $.jqplot.MarkerRenderer({style:'line'});
+ this.markerRenderer.init();
+ this.highlightObjectIndex = null;
+ if (options.objects) {
+ var objs = options.objects,
+ obj;
+ for (var i=0; i<objs.length; i++) {
+ obj = objs[i];
+ for (var n in obj) {
+ switch (n) {
+ case 'line':
+ this.addLine(obj[n]);
+ break;
+ case 'horizontalLine':
+ this.addHorizontalLine(obj[n]);
+ break;
+ case 'dashedHorizontalLine':
+ this.addDashedHorizontalLine(obj[n]);
+ break;
+ case 'verticalLine':
+ this.addVerticalLine(obj[n]);
+ break;
+ case 'dashedVerticalLine':
+ this.addDashedVerticalLine(obj[n]);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ }
+ $.extend(true, this.options, options);
+ };
+
+ // called with scope of a plot object
+ $.jqplot.CanvasOverlay.postPlotInit = function (target, data, opts) {
+ var options = opts || {};
+ // add a canvasOverlay attribute to the plot
+ this.plugins.canvasOverlay = new $.jqplot.CanvasOverlay(options.canvasOverlay);
+ };
+
+
+ function LineBase() {
+ this.uid = null;
+ this.type = null;
+ this.gridStart = null;
+ this.gridStop = null;
+ this.tooltipWidthFactor = 0;
+ this.options = {
+ // prop: name
+ // Optional name for the overlay object.
+ // Can be later used to retrieve the object by name.
+ name: null,
+ // prop: show
+ // true to show (draw), false to not draw.
+ show: true,
+ // prop: lineWidth
+ // Width of the line.
+ lineWidth: 2,
+ // prop: lineCap
+ // Type of ending placed on the line ['round', 'butt', 'square']
+ lineCap: 'round',
+ // prop: color
+ // color of the line
+ color: '#666666',
+ // prop: shadow
+ // wether or not to draw a shadow on the line
+ shadow: true,
+ // prop: shadowAngle
+ // Shadow angle in degrees
+ shadowAngle: 45,
+ // prop: shadowOffset
+ // Shadow offset from line in pixels
+ shadowOffset: 1,
+ // prop: shadowDepth
+ // Number of times shadow is stroked, each stroke offset shadowOffset from the last.
+ shadowDepth: 3,
+ // prop: shadowAlpha
+ // Alpha channel transparency of shadow. 0 = transparent.
+ shadowAlpha: '0.07',
+ // prop: xaxis
+ // X axis to use for positioning/scaling the line.
+ xaxis: 'xaxis',
+ // prop: yaxis
+ // Y axis to use for positioning/scaling the line.
+ yaxis: 'yaxis',
+ // prop: showTooltip
+ // Show a tooltip with data point values.
+ showTooltip: false,
+ // prop: showTooltipPrecision
+ // Controls how close to line cursor must be to show tooltip.
+ // Higher number = closer to line, lower number = farther from line.
+ // 1.0 = cursor must be over line.
+ showTooltipPrecision: 0.6,
+ // prop: tooltipLocation
+ // Where to position tooltip, 'n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw'
+ tooltipLocation: 'nw',
+ // prop: fadeTooltip
+ // true = fade in/out tooltip, flase = show/hide tooltip
+ fadeTooltip: true,
+ // prop: tooltipFadeSpeed
+ // 'slow', 'def', 'fast', or number of milliseconds.
+ tooltipFadeSpeed: "fast",
+ // prop: tooltipOffset
+ // Pixel offset of tooltip from the highlight.
+ tooltipOffset: 4,
+ // prop: tooltipFormatString
+ // Format string passed the x and y values of the cursor on the line.
+ // e.g., 'Dogs: %.2f, Cats: %d'.
+ tooltipFormatString: '%d, %d'
+ };
+ }
+
+ /**
+ * Class: Line
+ * A straight line.
+ */
+ function Line(options) {
+ LineBase.call(this);
+ this.type = 'line';
+ var opts = {
+ // prop: start
+ // [x, y] coordinates for the start of the line.
+ start: [],
+ // prop: stop
+ // [x, y] coordinates for the end of the line.
+ stop: []
+ };
+ $.extend(true, this.options, opts, options);
+
+ if (this.options.showTooltipPrecision < 0.01) {
+ this.options.showTooltipPrecision = 0.01;
+ }
+ }
+
+ Line.prototype = new LineBase();
+ Line.prototype.constructor = Line;
+
+
+ /**
+ * Class: HorizontalLine
+ * A straight horizontal line.
+ */
+ function HorizontalLine(options) {
+ LineBase.call(this);
+ this.type = 'horizontalLine';
+ var opts = {
+ // prop: y
+ // y value to position the line
+ y: null,
+ // prop: xmin
+ // x value for the start of the line, null to scale to axis min.
+ xmin: null,
+ // prop: xmax
+ // x value for the end of the line, null to scale to axis max.
+ xmax: null,
+ // prop xOffset
+ // offset ends of the line inside the grid. Number
+ xOffset: '6px', // number or string. Number interpreted as units, string as pixels.
+ xminOffset: null,
+ xmaxOffset: null
+ };
+ $.extend(true, this.options, opts, options);
+
+ if (this.options.showTooltipPrecision < 0.01) {
+ this.options.showTooltipPrecision = 0.01;
+ }
+ }
+
+ HorizontalLine.prototype = new LineBase();
+ HorizontalLine.prototype.constructor = HorizontalLine;
+
+
+ /**
+ * Class: DashedHorizontalLine
+ * A straight dashed horizontal line.
+ */
+ function DashedHorizontalLine(options) {
+ LineBase.call(this);
+ this.type = 'dashedHorizontalLine';
+ var opts = {
+ y: null,
+ xmin: null,
+ xmax: null,
+ xOffset: '6px', // number or string. Number interpreted as units, string as pixels.
+ xminOffset: null,
+ xmaxOffset: null,
+ // prop: dashPattern
+ // Array of line, space settings in pixels.
+ // Default is 8 pixel of line, 8 pixel of space.
+ // Note, limit to a 2 element array b/c of bug with higher order arrays.
+ dashPattern: [8,8]
+ };
+ $.extend(true, this.options, opts, options);
+
+ if (this.options.showTooltipPrecision < 0.01) {
+ this.options.showTooltipPrecision = 0.01;
+ }
+ }
+
+ DashedHorizontalLine.prototype = new LineBase();
+ DashedHorizontalLine.prototype.constructor = DashedHorizontalLine;
+
+
+ /**
+ * Class: VerticalLine
+ * A straight vertical line.
+ */
+ function VerticalLine(options) {
+ LineBase.call(this);
+ this.type = 'verticalLine';
+ var opts = {
+ x: null,
+ ymin: null,
+ ymax: null,
+ yOffset: '6px', // number or string. Number interpreted as units, string as pixels.
+ yminOffset: null,
+ ymaxOffset: null
+ };
+ $.extend(true, this.options, opts, options);
+
+ if (this.options.showTooltipPrecision < 0.01) {
+ this.options.showTooltipPrecision = 0.01;
+ }
+ }
+
+ VerticalLine.prototype = new LineBase();
+ VerticalLine.prototype.constructor = VerticalLine;
+
+
+ /**
+ * Class: DashedVerticalLine
+ * A straight dashed vertical line.
+ */
+ function DashedVerticalLine(options) {
+ LineBase.call(this);
+ this.type = 'dashedVerticalLine';
+ this.start = null;
+ this.stop = null;
+ var opts = {
+ x: null,
+ ymin: null,
+ ymax: null,
+ yOffset: '6px', // number or string. Number interpreted as units, string as pixels.
+ yminOffset: null,
+ ymaxOffset: null,
+ // prop: dashPattern
+ // Array of line, space settings in pixels.
+ // Default is 8 pixel of line, 8 pixel of space.
+ // Note, limit to a 2 element array b/c of bug with higher order arrays.
+ dashPattern: [8,8]
+ };
+ $.extend(true, this.options, opts, options);
+
+ if (this.options.showTooltipPrecision < 0.01) {
+ this.options.showTooltipPrecision = 0.01;
+ }
+ }
+
+ DashedVerticalLine.prototype = new LineBase();
+ DashedVerticalLine.prototype.constructor = DashedVerticalLine;
+
+ $.jqplot.CanvasOverlay.prototype.addLine = function(opts) {
+ var line = new Line(opts);
+ line.uid = objCounter++;
+ this.objects.push(line);
+ this.objectNames.push(line.options.name);
+ };
+
+ $.jqplot.CanvasOverlay.prototype.addHorizontalLine = function(opts) {
+ var line = new HorizontalLine(opts);
+ line.uid = objCounter++;
+ this.objects.push(line);
+ this.objectNames.push(line.options.name);
+ };
+
+ $.jqplot.CanvasOverlay.prototype.addDashedHorizontalLine = function(opts) {
+ var line = new DashedHorizontalLine(opts);
+ line.uid = objCounter++;
+ this.objects.push(line);
+ this.objectNames.push(line.options.name);
+ };
+
+ $.jqplot.CanvasOverlay.prototype.addVerticalLine = function(opts) {
+ var line = new VerticalLine(opts);
+ line.uid = objCounter++;
+ this.objects.push(line);
+ this.objectNames.push(line.options.name);
+ };
+
+ $.jqplot.CanvasOverlay.prototype.addDashedVerticalLine = function(opts) {
+ var line = new DashedVerticalLine(opts);
+ line.uid = objCounter++;
+ this.objects.push(line);
+ this.objectNames.push(line.options.name);
+ };
+
+ $.jqplot.CanvasOverlay.prototype.removeObject = function(idx) {
+ // check if integer, remove by index
+ if ($.type(idx) == 'number') {
+ this.objects.splice(idx, 1);
+ this.objectNames.splice(idx, 1);
+ }
+ // if string, remove by name
+ else {
+ var id = $.inArray(idx, this.objectNames);
+ if (id != -1) {
+ this.objects.splice(id, 1);
+ this.objectNames.splice(id, 1);
+ }
+ }
+ };
+
+ $.jqplot.CanvasOverlay.prototype.getObject = function(idx) {
+ // check if integer, remove by index
+ if ($.type(idx) == 'number') {
+ return this.objects[idx];
+ }
+ // if string, remove by name
+ else {
+ var id = $.inArray(idx, this.objectNames);
+ if (id != -1) {
+ return this.objects[id];
+ }
+ }
+ };
+
+ // Set get as alias for getObject.
+ $.jqplot.CanvasOverlay.prototype.get = $.jqplot.CanvasOverlay.prototype.getObject;
+
+ $.jqplot.CanvasOverlay.prototype.clear = function(plot) {
+ this.canvas._ctx.clearRect(0,0,this.canvas.getWidth(), this.canvas.getHeight());
+ };
+
+ $.jqplot.CanvasOverlay.prototype.draw = function(plot) {
+ var obj,
+ objs = this.objects,
+ mr = this.markerRenderer,
+ start,
+ stop;
+ if (this.options.show) {
+ this.canvas._ctx.clearRect(0,0,this.canvas.getWidth(), this.canvas.getHeight());
+ for (var k=0; k<objs.length; k++) {
+ obj = objs[k];
+ var opts = $.extend(true, {}, obj.options);
+ if (obj.options.show) {
+ // style and shadow properties should be set before
+ // every draw of marker renderer.
+ mr.shadow = obj.options.shadow;
+ obj.tooltipWidthFactor = obj.options.lineWidth / obj.options.showTooltipPrecision;
+ switch (obj.type) {
+ case 'line':
+ // style and shadow properties should be set before
+ // every draw of marker renderer.
+ mr.style = 'line';
+ opts.closePath = false;
+ start = [plot.axes[obj.options.xaxis].series_u2p(obj.options.start[0]), plot.axes[obj.options.yaxis].series_u2p(obj.options.start[1])];
+ stop = [plot.axes[obj.options.xaxis].series_u2p(obj.options.stop[0]), plot.axes[obj.options.yaxis].series_u2p(obj.options.stop[1])];
+ obj.gridStart = start;
+ obj.gridStop = stop;
+ mr.draw(start, stop, this.canvas._ctx, opts);
+ break;
+ case 'horizontalLine':
+
+ // style and shadow properties should be set before
+ // every draw of marker renderer.
+ if (obj.options.y != null) {
+ mr.style = 'line';
+ opts.closePath = false;
+ var xaxis = plot.axes[obj.options.xaxis],
+ xstart,
+ xstop,
+ y = plot.axes[obj.options.yaxis].series_u2p(obj.options.y),
+ xminoff = obj.options.xminOffset || obj.options.xOffset,
+ xmaxoff = obj.options.xmaxOffset || obj.options.xOffset;
+ if (obj.options.xmin != null) {
+ xstart = xaxis.series_u2p(obj.options.xmin);
+ }
+ else if (xminoff != null) {
+ if ($.type(xminoff) == "number") {
+ xstart = xaxis.series_u2p(xaxis.min + xminoff);
+ }
+ else if ($.type(xminoff) == "string") {
+ xstart = xaxis.series_u2p(xaxis.min) + parseFloat(xminoff);
+ }
+ }
+ if (obj.options.xmax != null) {
+ xstop = xaxis.series_u2p(obj.options.xmax);
+ }
+ else if (xmaxoff != null) {
+ if ($.type(xmaxoff) == "number") {
+ xstop = xaxis.series_u2p(xaxis.max - xmaxoff);
+ }
+ else if ($.type(xmaxoff) == "string") {
+ xstop = xaxis.series_u2p(xaxis.max) - parseFloat(xmaxoff);
+ }
+ }
+ if (xstop != null && xstart != null) {
+ obj.gridStart = [xstart, y];
+ obj.gridStop = [xstop, y];
+ mr.draw([xstart, y], [xstop, y], this.canvas._ctx, opts);
+ }
+ }
+ break;
+
+ case 'dashedHorizontalLine':
+
+ var dashPat = obj.options.dashPattern;
+ var dashPatLen = 0;
+ for (var i=0; i<dashPat.length; i++) {
+ dashPatLen += dashPat[i];
+ }
+
+ // style and shadow properties should be set before
+ // every draw of marker renderer.
+ if (obj.options.y != null) {
+ mr.style = 'line';
+ opts.closePath = false;
+ var xaxis = plot.axes[obj.options.xaxis],
+ xstart,
+ xstop,
+ y = plot.axes[obj.options.yaxis].series_u2p(obj.options.y),
+ xminoff = obj.options.xminOffset || obj.options.xOffset,
+ xmaxoff = obj.options.xmaxOffset || obj.options.xOffset;
+ if (obj.options.xmin != null) {
+ xstart = xaxis.series_u2p(obj.options.xmin);
+ }
+ else if (xminoff != null) {
+ if ($.type(xminoff) == "number") {
+ xstart = xaxis.series_u2p(xaxis.min + xminoff);
+ }
+ else if ($.type(xminoff) == "string") {
+ xstart = xaxis.series_u2p(xaxis.min) + parseFloat(xminoff);
+ }
+ }
+ if (obj.options.xmax != null) {
+ xstop = xaxis.series_u2p(obj.options.xmax);
+ }
+ else if (xmaxoff != null) {
+ if ($.type(xmaxoff) == "number") {
+ xstop = xaxis.series_u2p(xaxis.max - xmaxoff);
+ }
+ else if ($.type(xmaxoff) == "string") {
+ xstop = xaxis.series_u2p(xaxis.max) - parseFloat(xmaxoff);
+ }
+ }
+ if (xstop != null && xstart != null) {
+ obj.gridStart = [xstart, y];
+ obj.gridStop = [xstop, y];
+ var numDash = Math.ceil((xstop - xstart)/dashPatLen);
+ var b=xstart, e;
+ for (var i=0; i<numDash; i++) {
+ for (var j=0; j<dashPat.length; j+=2) {
+ e = b+dashPat[j];
+ mr.draw([b, y], [e, y], this.canvas._ctx, opts);
+ b += dashPat[j];
+ if (j < dashPat.length-1) {
+ b += dashPat[j+1];
+ }
+ }
+ }
+ }
+ }
+ break;
+
+ case 'verticalLine':
+
+ // style and shadow properties should be set before
+ // every draw of marker renderer.
+ if (obj.options.x != null) {
+ mr.style = 'line';
+ opts.closePath = false;
+ var yaxis = plot.axes[obj.options.yaxis],
+ ystart,
+ ystop,
+ x = plot.axes[obj.options.xaxis].series_u2p(obj.options.x),
+ yminoff = obj.options.yminOffset || obj.options.yOffset,
+ ymaxoff = obj.options.ymaxOffset || obj.options.yOffset;
+ if (obj.options.ymin != null) {
+ ystart = yaxis.series_u2p(obj.options.ymin);
+ }
+ else if (yminoff != null) {
+ if ($.type(yminoff) == "number") {
+ ystart = yaxis.series_u2p(yaxis.min - yminoff);
+ }
+ else if ($.type(yminoff) == "string") {
+ ystart = yaxis.series_u2p(yaxis.min) - parseFloat(yminoff);
+ }
+ }
+ if (obj.options.ymax != null) {
+ ystop = yaxis.series_u2p(obj.options.ymax);
+ }
+ else if (ymaxoff != null) {
+ if ($.type(ymaxoff) == "number") {
+ ystop = yaxis.series_u2p(yaxis.max + ymaxoff);
+ }
+ else if ($.type(ymaxoff) == "string") {
+ ystop = yaxis.series_u2p(yaxis.max) + parseFloat(ymaxoff);
+ }
+ }
+ if (ystop != null && ystart != null) {
+ obj.gridStart = [x, ystart];
+ obj.gridStop = [x, ystop];
+ mr.draw([x, ystart], [x, ystop], this.canvas._ctx, opts);
+ }
+ }
+ break;
+
+ case 'dashedVerticalLine':
+
+ var dashPat = obj.options.dashPattern;
+ var dashPatLen = 0;
+ for (var i=0; i<dashPat.length; i++) {
+ dashPatLen += dashPat[i];
+ }
+
+ // style and shadow properties should be set before
+ // every draw of marker renderer.
+ if (obj.options.x != null) {
+ mr.style = 'line';
+ opts.closePath = false;
+ var yaxis = plot.axes[obj.options.yaxis],
+ ystart,
+ ystop,
+ x = plot.axes[obj.options.xaxis].series_u2p(obj.options.x),
+ yminoff = obj.options.yminOffset || obj.options.yOffset,
+ ymaxoff = obj.options.ymaxOffset || obj.options.yOffset;
+ if (obj.options.ymin != null) {
+ ystart = yaxis.series_u2p(obj.options.ymin);
+ }
+ else if (yminoff != null) {
+ if ($.type(yminoff) == "number") {
+ ystart = yaxis.series_u2p(yaxis.min - yminoff);
+ }
+ else if ($.type(yminoff) == "string") {
+ ystart = yaxis.series_u2p(yaxis.min) - parseFloat(yminoff);
+ }
+ }
+ if (obj.options.ymax != null) {
+ ystop = yaxis.series_u2p(obj.options.ymax);
+ }
+ else if (ymaxoff != null) {
+ if ($.type(ymaxoff) == "number") {
+ ystop = yaxis.series_u2p(yaxis.max + ymaxoff);
+ }
+ else if ($.type(ymaxoff) == "string") {
+ ystop = yaxis.series_u2p(yaxis.max) + parseFloat(ymaxoff);
+ }
+ }
+
+
+ if (ystop != null && ystart != null) {
+ obj.gridStart = [x, ystart];
+ obj.gridStop = [x, ystop];
+ var numDash = Math.ceil((ystart - ystop)/dashPatLen);
+ var firstDashAdjust = ((numDash * dashPatLen) - (ystart - ystop))/2.0;
+ var b=ystart, e, bs, es;
+ for (var i=0; i<numDash; i++) {
+ for (var j=0; j<dashPat.length; j+=2) {
+ e = b - dashPat[j];
+ if (e < ystop) {
+ e = ystop;
+ }
+ if (b < ystop) {
+ b = ystop;
+ }
+ // es = e;
+ // if (i == 0) {
+ // es += firstDashAdjust;
+ // }
+ mr.draw([x, b], [x, e], this.canvas._ctx, opts);
+ b -= dashPat[j];
+ if (j < dashPat.length-1) {
+ b -= dashPat[j+1];
+ }
+ }
+ }
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+ }
+ };
+
+ // called within context of plot
+ // create a canvas which we can draw on.
+ // insert it before the eventCanvas, so eventCanvas will still capture events.
+ $.jqplot.CanvasOverlay.postPlotDraw = function() {
+ var co = this.plugins.canvasOverlay;
+ // Memory Leaks patch
+ if (co && co.highlightCanvas) {
+ co.highlightCanvas.resetCanvas();
+ co.highlightCanvas = null;
+ }
+ co.canvas = new $.jqplot.GenericCanvas();
+
+ this.eventCanvas._elem.before(co.canvas.createElement(this._gridPadding, 'jqplot-overlayCanvas-canvas', this._plotDimensions, this));
+ co.canvas.setContext();
+ if (!co.deferDraw) {
+ co.draw(this);
+ }
+
+ var elem = document.createElement('div');
+ co._tooltipElem = $(elem);
+ elem = null;
+ co._tooltipElem.addClass('jqplot-canvasOverlay-tooltip');
+ co._tooltipElem.css({position:'absolute', display:'none'});
+
+ this.eventCanvas._elem.before(co._tooltipElem);
+ this.eventCanvas._elem.bind('mouseleave', { elem: co._tooltipElem }, function (ev) { ev.data.elem.hide(); });
+
+ var co = null;
+ };
+
+
+ function showTooltip(plot, obj, gridpos, datapos) {
+ var co = plot.plugins.canvasOverlay;
+ var elem = co._tooltipElem;
+
+ var opts = obj.options, x, y;
+
+ elem.html($.jqplot.sprintf(opts.tooltipFormatString, datapos[0], datapos[1]));
+
+ switch (opts.tooltipLocation) {
+ case 'nw':
+ x = gridpos[0] + plot._gridPadding.left - elem.outerWidth(true) - opts.tooltipOffset;
+ y = gridpos[1] + plot._gridPadding.top - opts.tooltipOffset - elem.outerHeight(true);
+ break;
+ case 'n':
+ x = gridpos[0] + plot._gridPadding.left - elem.outerWidth(true)/2;
+ y = gridpos[1] + plot._gridPadding.top - opts.tooltipOffset - elem.outerHeight(true);
+ break;
+ case 'ne':
+ x = gridpos[0] + plot._gridPadding.left + opts.tooltipOffset;
+ y = gridpos[1] + plot._gridPadding.top - opts.tooltipOffset - elem.outerHeight(true);
+ break;
+ case 'e':
+ x = gridpos[0] + plot._gridPadding.left + opts.tooltipOffset;
+ y = gridpos[1] + plot._gridPadding.top - elem.outerHeight(true)/2;
+ break;
+ case 'se':
+ x = gridpos[0] + plot._gridPadding.left + opts.tooltipOffset;
+ y = gridpos[1] + plot._gridPadding.top + opts.tooltipOffset;
+ break;
+ case 's':
+ x = gridpos[0] + plot._gridPadding.left - elem.outerWidth(true)/2;
+ y = gridpos[1] + plot._gridPadding.top + opts.tooltipOffset;
+ break;
+ case 'sw':
+ x = gridpos[0] + plot._gridPadding.left - elem.outerWidth(true) - opts.tooltipOffset;
+ y = gridpos[1] + plot._gridPadding.top + opts.tooltipOffset;
+ break;
+ case 'w':
+ x = gridpos[0] + plot._gridPadding.left - elem.outerWidth(true) - opts.tooltipOffset;
+ y = gridpos[1] + plot._gridPadding.top - elem.outerHeight(true)/2;
+ break;
+ default: // same as 'nw'
+ x = gridpos[0] + plot._gridPadding.left - elem.outerWidth(true) - opts.tooltipOffset;
+ y = gridpos[1] + plot._gridPadding.top - opts.tooltipOffset - elem.outerHeight(true);
+ break;
+ }
+
+ elem.css('left', x);
+ elem.css('top', y);
+ if (opts.fadeTooltip) {
+ // Fix for stacked up animations. Thnanks Trevor!
+ elem.stop(true,true).fadeIn(opts.tooltipFadeSpeed);
+ }
+ else {
+ elem.show();
+ }
+ elem = null;
+ }
+
+
+ function isNearLine(point, lstart, lstop, width) {
+ // r is point to test, p and q are end points.
+ var rx = point[0];
+ var ry = point[1];
+ var px = Math.round(lstop[0]);
+ var py = Math.round(lstop[1]);
+ var qx = Math.round(lstart[0]);
+ var qy = Math.round(lstart[1]);
+
+ var l = Math.sqrt(Math.pow(px-qx, 2) + Math.pow(py-qy, 2));
+
+ // scale error term by length of line.
+ var eps = width*l;
+ var res = Math.abs((qx-px) * (ry-py) - (qy-py) * (rx-px));
+ var ret = (res < eps) ? true : false;
+ return ret;
+ }
+
+
+ function handleMove(ev, gridpos, datapos, neighbor, plot) {
+ var co = plot.plugins.canvasOverlay;
+ var objs = co.objects;
+ var l = objs.length;
+ var obj, haveHighlight=false;
+ var elem;
+ for (var i=0; i<l; i++) {
+ obj = objs[i];
+ if (obj.options.showTooltip) {
+ var n = isNearLine([gridpos.x, gridpos.y], obj.gridStart, obj.gridStop, obj.tooltipWidthFactor);
+ datapos = [plot.axes[obj.options.xaxis].series_p2u(gridpos.x), plot.axes[obj.options.yaxis].series_p2u(gridpos.y)];
+
+ // cases:
+ // near line, no highlighting
+ // near line, highliting on this line
+ // near line, highlighting another line
+ // not near any line, highlighting
+ // not near any line, no highlighting
+
+ // near line, not currently highlighting
+ if (n && co.highlightObjectIndex == null) {
+ switch (obj.type) {
+ case 'line':
+ showTooltip(plot, obj, [gridpos.x, gridpos.y], datapos);
+ break;
+
+ case 'horizontalLine':
+ case 'dashedHorizontalLine':
+ showTooltip(plot, obj, [gridpos.x, obj.gridStart[1]], [datapos[0], obj.options.y]);
+ break;
+
+ case 'verticalLine':
+ case 'dashedVerticalLine':
+ showTooltip(plot, obj, [obj.gridStart[0], gridpos.y], [obj.options.x, datapos[1]]);
+ break;
+ default:
+ break;
+ }
+ co.highlightObjectIndex = i;
+ haveHighlight = true;
+ break;
+ }
+
+ // near line, highlighting another line.
+ else if (n && co.highlightObjectIndex !== i) {
+ // turn off tooltip.
+ elem = co._tooltipElem;
+ if (obj.fadeTooltip) {
+ elem.fadeOut(obj.tooltipFadeSpeed);
+ }
+ else {
+ elem.hide();
+ }
+
+ // turn on right tooltip.
+ switch (obj.type) {
+ case 'line':
+ showTooltip(plot, obj, [gridpos.x, gridpos.y], datapos);
+ break;
+
+ case 'horizontalLine':
+ case 'dashedHorizontalLine':
+ showTooltip(plot, obj, [gridpos.x, obj.gridStart[1]], [datapos[0], obj.options.y]);
+ break;
+
+ case 'verticalLine':
+ case 'dashedVerticalLine':
+ showTooltip(plot, obj, [obj.gridStart[0], gridpos.y], [obj.options.x, datapos[1]]);
+ break;
+ default:
+ break;
+ }
+
+ co.highlightObjectIndex = i;
+ haveHighlight = true;
+ break;
+ }
+
+ // near line, already highlighting this line, update
+ else if (n) {
+ switch (obj.type) {
+ case 'line':
+ showTooltip(plot, obj, [gridpos.x, gridpos.y], datapos);
+ break;
+
+ case 'horizontalLine':
+ case 'dashedHorizontalLine':
+ showTooltip(plot, obj, [gridpos.x, obj.gridStart[1]], [datapos[0], obj.options.y]);
+ break;
+
+ case 'verticalLine':
+ case 'dashedVerticalLine':
+ showTooltip(plot, obj, [obj.gridStart[0], gridpos.y], [obj.options.x, datapos[1]]);
+ break;
+ default:
+ break;
+ }
+
+ haveHighlight = true;
+ break;
+ }
+ }
+ }
+
+ // check if we are highlighting and not near a line, turn it off.
+ if (!haveHighlight && co.highlightObjectIndex !== null) {
+ elem = co._tooltipElem;
+ obj = co.getObject(co.highlightObjectIndex);
+ if (obj.fadeTooltip) {
+ elem.fadeOut(obj.tooltipFadeSpeed);
+ }
+ else {
+ elem.hide();
+ }
+ co.highlightObjectIndex = null;
+ }
+ }
+
+ $.jqplot.postInitHooks.push($.jqplot.CanvasOverlay.postPlotInit);
+ $.jqplot.postDrawHooks.push($.jqplot.CanvasOverlay.postPlotDraw);
+ $.jqplot.eventListenerHooks.push(['jqplotMouseMove', handleMove]);
+
+})(jQuery);
\ No newline at end of file
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasTextRenderer.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasTextRenderer.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.canvasTextRenderer.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,472 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ * included jsDate library by Chris Leonello:
+ *
+ * Copyright (c) 2010-2012 Chris Leonello
+ *
+ * jsDate is currently available for use in all personal or commercial projects
+ * under both the MIT and GPL version 2.0 licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * jsDate borrows many concepts and ideas from the Date Instance
+ * Methods by Ken Snyder along with some parts of Ken's actual code.
+ *
+ * Ken's origianl Date Instance Methods and copyright notice:
+ *
+ * Ken Snyder (ken d snyder at gmail dot com)
+ * 2008-09-10
+ * version 2.0.2 (http://kendsnyder.com/sandbox/date/)
+ * Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
+ *
+ * jqplotToImage function based on Larry Siden's export-jqplot-to-png.js.
+ * Larry has generously given permission to adapt his code for inclusion
+ * into jqPlot.
+ *
+ * Larry's original code can be found here:
+ *
+ * https://github.com/lsiden/export-jqplot-to-png
+ *
+ *
+ */
+
+(function($) {
+ // This code is a modified version of the canvastext.js code, copyright below:
+ //
+ // This code is released to the public domain by Jim Studt, 2007.
+ // He may keep some sort of up to date copy at http://www.federated.com/~jim/canvastext/
+ //
+ $.jqplot.CanvasTextRenderer = function(options){
+ this.fontStyle = 'normal'; // normal, italic, oblique [not implemented]
+ this.fontVariant = 'normal'; // normal, small caps [not implemented]
+ this.fontWeight = 'normal'; // normal, bold, bolder, lighter, 100 - 900
+ this.fontSize = '10px';
+ this.fontFamily = 'sans-serif';
+ this.fontStretch = 1.0;
+ this.fillStyle = '#666666';
+ this.angle = 0;
+ this.textAlign = 'start';
+ this.textBaseline = 'alphabetic';
+ this.text;
+ this.width;
+ this.height;
+ this.pt2px = 1.28;
+
+ $.extend(true, this, options);
+ this.normalizedFontSize = this.normalizeFontSize(this.fontSize);
+ this.setHeight();
+ };
+
+ $.jqplot.CanvasTextRenderer.prototype.init = function(options) {
+ $.extend(true, this, options);
+ this.normalizedFontSize = this.normalizeFontSize(this.fontSize);
+ this.setHeight();
+ };
+
+ // convert css spec into point size
+ // returns float
+ $.jqplot.CanvasTextRenderer.prototype.normalizeFontSize = function(sz) {
+ sz = String(sz);
+ var n = parseFloat(sz);
+ if (sz.indexOf('px') > -1) {
+ return n/this.pt2px;
+ }
+ else if (sz.indexOf('pt') > -1) {
+ return n;
+ }
+ else if (sz.indexOf('em') > -1) {
+ return n*12;
+ }
+ else if (sz.indexOf('%') > -1) {
+ return n*12/100;
+ }
+ // default to pixels;
+ else {
+ return n/this.pt2px;
+ }
+ };
+
+
+ $.jqplot.CanvasTextRenderer.prototype.fontWeight2Float = function(w) {
+ // w = normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
+ // return values adjusted for Hershey font.
+ if (Number(w)) {
+ return w/400;
+ }
+ else {
+ switch (w) {
+ case 'normal':
+ return 1;
+ break;
+ case 'bold':
+ return 1.75;
+ break;
+ case 'bolder':
+ return 2.25;
+ break;
+ case 'lighter':
+ return 0.75;
+ break;
+ default:
+ return 1;
+ break;
+ }
+ }
+ };
+
+ $.jqplot.CanvasTextRenderer.prototype.getText = function() {
+ return this.text;
+ };
+
+ $.jqplot.CanvasTextRenderer.prototype.setText = function(t, ctx) {
+ this.text = t;
+ this.setWidth(ctx);
+ return this;
+ };
+
+ $.jqplot.CanvasTextRenderer.prototype.getWidth = function(ctx) {
+ return this.width;
+ };
+
+ $.jqplot.CanvasTextRenderer.prototype.setWidth = function(ctx, w) {
+ if (!w) {
+ this.width = this.measure(ctx, this.text);
+ }
+ else {
+ this.width = w;
+ }
+ return this;
+ };
+
+ // return height in pixels.
+ $.jqplot.CanvasTextRenderer.prototype.getHeight = function(ctx) {
+ return this.height;
+ };
+
+ // w - height in pt
+ // set heigh in px
+ $.jqplot.CanvasTextRenderer.prototype.setHeight = function(w) {
+ if (!w) {
+ //height = this.fontSize /0.75;
+ this.height = this.normalizedFontSize * this.pt2px;
+ }
+ else {
+ this.height = w;
+ }
+ return this;
+ };
+
+ $.jqplot.CanvasTextRenderer.prototype.letter = function (ch)
+ {
+ return this.letters[ch];
+ };
+
+ $.jqplot.CanvasTextRenderer.prototype.ascent = function()
+ {
+ return this.normalizedFontSize;
+ };
+
+ $.jqplot.CanvasTextRenderer.prototype.descent = function()
+ {
+ return 7.0*this.normalizedFontSize/25.0;
+ };
+
+ $.jqplot.CanvasTextRenderer.prototype.measure = function(ctx, str)
+ {
+ var total = 0;
+ var len = str.length;
+
+ for (var i = 0; i < len; i++) {
+ var c = this.letter(str.charAt(i));
+ if (c) {
+ total += c.width * this.normalizedFontSize / 25.0 * this.fontStretch;
+ }
+ }
+ return total;
+ };
+
+ $.jqplot.CanvasTextRenderer.prototype.draw = function(ctx,str)
+ {
+ var x = 0;
+ // leave room at bottom for descenders.
+ var y = this.height*0.72;
+ var total = 0;
+ var len = str.length;
+ var mag = this.normalizedFontSize / 25.0;
+
+ ctx.save();
+ var tx, ty;
+
+ // 1st quadrant
+ if ((-Math.PI/2 <= this.angle && this.angle <= 0) || (Math.PI*3/2 <= this.angle && this.angle <= Math.PI*2)) {
+ tx = 0;
+ ty = -Math.sin(this.angle) * this.width;
+ }
+ // 4th quadrant
+ else if ((0 < this.angle && this.angle <= Math.PI/2) || (-Math.PI*2 <= this.angle && this.angle <= -Math.PI*3/2)) {
+ tx = Math.sin(this.angle) * this.height;
+ ty = 0;
+ }
+ // 2nd quadrant
+ else if ((-Math.PI < this.angle && this.angle < -Math.PI/2) || (Math.PI <= this.angle && this.angle <= Math.PI*3/2)) {
+ tx = -Math.cos(this.angle) * this.width;
+ ty = -Math.sin(this.angle) * this.width - Math.cos(this.angle) * this.height;
+ }
+ // 3rd quadrant
+ else if ((-Math.PI*3/2 < this.angle && this.angle < Math.PI) || (Math.PI/2 < this.angle && this.angle < Math.PI)) {
+ tx = Math.sin(this.angle) * this.height - Math.cos(this.angle)*this.width;
+ ty = -Math.cos(this.angle) * this.height;
+ }
+
+ ctx.strokeStyle = this.fillStyle;
+ ctx.fillStyle = this.fillStyle;
+ ctx.translate(tx, ty);
+ ctx.rotate(this.angle);
+ ctx.lineCap = "round";
+ // multiplier was 2.0
+ var fact = (this.normalizedFontSize > 30) ? 2.0 : 2 + (30 - this.normalizedFontSize)/20;
+ ctx.lineWidth = fact * mag * this.fontWeight2Float(this.fontWeight);
+
+ for ( var i = 0; i < len; i++) {
+ var c = this.letter( str.charAt(i));
+ if ( !c) {
+ continue;
+ }
+
+ ctx.beginPath();
+
+ var penUp = 1;
+ var needStroke = 0;
+ for ( var j = 0; j < c.points.length; j++) {
+ var a = c.points[j];
+ if ( a[0] == -1 && a[1] == -1) {
+ penUp = 1;
+ continue;
+ }
+ if ( penUp) {
+ ctx.moveTo( x + a[0]*mag*this.fontStretch, y - a[1]*mag);
+ penUp = false;
+ } else {
+ ctx.lineTo( x + a[0]*mag*this.fontStretch, y - a[1]*mag);
+ }
+ }
+ ctx.stroke();
+ x += c.width*mag*this.fontStretch;
+ }
+ ctx.restore();
+ return total;
+ };
+
+ $.jqplot.CanvasTextRenderer.prototype.letters = {
+ ' ': { width: 16, points: [] },
+ '!': { width: 10, points: [[5,21],[5,7],[-1,-1],[5,2],[4,1],[5,0],[6,1],[5,2]] },
+ '"': { width: 16, points: [[4,21],[4,14],[-1,-1],[12,21],[12,14]] },
+ '#': { width: 21, points: [[11,25],[4,-7],[-1,-1],[17,25],[10,-7],[-1,-1],[4,12],[18,12],[-1,-1],[3,6],[17,6]] },
+ '$': { width: 20, points: [[8,25],[8,-4],[-1,-1],[12,25],[12,-4],[-1,-1],[17,18],[15,20],[12,21],[8,21],[5,20],[3,18],[3,16],[4,14],[5,13],[7,12],[13,10],[15,9],[16,8],[17,6],[17,3],[15,1],[12,0],[8,0],[5,1],[3,3]] },
+ '%': { width: 24, points: [[21,21],[3,0],[-1,-1],[8,21],[10,19],[10,17],[9,15],[7,14],[5,14],[3,16],[3,18],[4,20],[6,21],[8,21],[10,20],[13,19],[16,19],[19,20],[21,21],[-1,-1],[17,7],[15,6],[14,4],[14,2],[16,0],[18,0],[20,1],[21,3],[21,5],[19,7],[17,7]] },
+ '&': { width: 26, points: [[23,12],[23,13],[22,14],[21,14],[20,13],[19,11],[17,6],[15,3],[13,1],[11,0],[7,0],[5,1],[4,2],[3,4],[3,6],[4,8],[5,9],[12,13],[13,14],[14,16],[14,18],[13,20],[11,21],[9,20],[8,18],[8,16],[9,13],[11,10],[16,3],[18,1],[20,0],[22,0],[23,1],[23,2]] },
+ '\'': { width: 10, points: [[5,19],[4,20],[5,21],[6,20],[6,18],[5,16],[4,15]] },
+ '(': { width: 14, points: [[11,25],[9,23],[7,20],[5,16],[4,11],[4,7],[5,2],[7,-2],[9,-5],[11,-7]] },
+ ')': { width: 14, points: [[3,25],[5,23],[7,20],[9,16],[10,11],[10,7],[9,2],[7,-2],[5,-5],[3,-7]] },
+ '*': { width: 16, points: [[8,21],[8,9],[-1,-1],[3,18],[13,12],[-1,-1],[13,18],[3,12]] },
+ '+': { width: 26, points: [[13,18],[13,0],[-1,-1],[4,9],[22,9]] },
+ ',': { width: 10, points: [[6,1],[5,0],[4,1],[5,2],[6,1],[6,-1],[5,-3],[4,-4]] },
+ '-': { width: 18, points: [[6,9],[12,9]] },
+ '.': { width: 10, points: [[5,2],[4,1],[5,0],[6,1],[5,2]] },
+ '/': { width: 22, points: [[20,25],[2,-7]] },
+ '0': { width: 20, points: [[9,21],[6,20],[4,17],[3,12],[3,9],[4,4],[6,1],[9,0],[11,0],[14,1],[16,4],[17,9],[17,12],[16,17],[14,20],[11,21],[9,21]] },
+ '1': { width: 20, points: [[6,17],[8,18],[11,21],[11,0]] },
+ '2': { width: 20, points: [[4,16],[4,17],[5,19],[6,20],[8,21],[12,21],[14,20],[15,19],[16,17],[16,15],[15,13],[13,10],[3,0],[17,0]] },
+ '3': { width: 20, points: [[5,21],[16,21],[10,13],[13,13],[15,12],[16,11],[17,8],[17,6],[16,3],[14,1],[11,0],[8,0],[5,1],[4,2],[3,4]] },
+ '4': { width: 20, points: [[13,21],[3,7],[18,7],[-1,-1],[13,21],[13,0]] },
+ '5': { width: 20, points: [[15,21],[5,21],[4,12],[5,13],[8,14],[11,14],[14,13],[16,11],[17,8],[17,6],[16,3],[14,1],[11,0],[8,0],[5,1],[4,2],[3,4]] },
+ '6': { width: 20, points: [[16,18],[15,20],[12,21],[10,21],[7,20],[5,17],[4,12],[4,7],[5,3],[7,1],[10,0],[11,0],[14,1],[16,3],[17,6],[17,7],[16,10],[14,12],[11,13],[10,13],[7,12],[5,10],[4,7]] },
+ '7': { width: 20, points: [[17,21],[7,0],[-1,-1],[3,21],[17,21]] },
+ '8': { width: 20, points: [[8,21],[5,20],[4,18],[4,16],[5,14],[7,13],[11,12],[14,11],[16,9],[17,7],[17,4],[16,2],[15,1],[12,0],[8,0],[5,1],[4,2],[3,4],[3,7],[4,9],[6,11],[9,12],[13,13],[15,14],[16,16],[16,18],[15,20],[12,21],[8,21]] },
+ '9': { width: 20, points: [[16,14],[15,11],[13,9],[10,8],[9,8],[6,9],[4,11],[3,14],[3,15],[4,18],[6,20],[9,21],[10,21],[13,20],[15,18],[16,14],[16,9],[15,4],[13,1],[10,0],[8,0],[5,1],[4,3]] },
+ ':': { width: 10, points: [[5,14],[4,13],[5,12],[6,13],[5,14],[-1,-1],[5,2],[4,1],[5,0],[6,1],[5,2]] },
+ ';': { width: 10, points: [[5,14],[4,13],[5,12],[6,13],[5,14],[-1,-1],[6,1],[5,0],[4,1],[5,2],[6,1],[6,-1],[5,-3],[4,-4]] },
+ '<': { width: 24, points: [[20,18],[4,9],[20,0]] },
+ '=': { width: 26, points: [[4,12],[22,12],[-1,-1],[4,6],[22,6]] },
+ '>': { width: 24, points: [[4,18],[20,9],[4,0]] },
+ '?': { width: 18, points: [[3,16],[3,17],[4,19],[5,20],[7,21],[11,21],[13,20],[14,19],[15,17],[15,15],[14,13],[13,12],[9,10],[9,7],[-1,-1],[9,2],[8,1],[9,0],[10,1],[9,2]] },
+ '@': { width: 27, points: [[18,13],[17,15],[15,16],[12,16],[10,15],[9,14],[8,11],[8,8],[9,6],[11,5],[14,5],[16,6],[17,8],[-1,-1],[12,16],[10,14],[9,11],[9,8],[10,6],[11,5],[-1,-1],[18,16],[17,8],[17,6],[19,5],[21,5],[23,7],[24,10],[24,12],[23,15],[22,17],[20,19],[18,20],[15,21],[12,21],[9,20],[7,19],[5,17],[4,15],[3,12],[3,9],[4,6],[5,4],[7,2],[9,1],[12,0],[15,0],[18,1],[20,2],[21,3],[-1,-1],[19,16],[18,8],[18,6],[19,5]] },
+ 'A': { width: 18, points: [[9,21],[1,0],[-1,-1],[9,21],[17,0],[-1,-1],[4,7],[14,7]] },
+ 'B': { width: 21, points: [[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,15],[17,13],[16,12],[13,11],[-1,-1],[4,11],[13,11],[16,10],[17,9],[18,7],[18,4],[17,2],[16,1],[13,0],[4,0]] },
+ 'C': { width: 21, points: [[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5]] },
+ 'D': { width: 21, points: [[4,21],[4,0],[-1,-1],[4,21],[11,21],[14,20],[16,18],[17,16],[18,13],[18,8],[17,5],[16,3],[14,1],[11,0],[4,0]] },
+ 'E': { width: 19, points: [[4,21],[4,0],[-1,-1],[4,21],[17,21],[-1,-1],[4,11],[12,11],[-1,-1],[4,0],[17,0]] },
+ 'F': { width: 18, points: [[4,21],[4,0],[-1,-1],[4,21],[17,21],[-1,-1],[4,11],[12,11]] },
+ 'G': { width: 21, points: [[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[18,8],[-1,-1],[13,8],[18,8]] },
+ 'H': { width: 22, points: [[4,21],[4,0],[-1,-1],[18,21],[18,0],[-1,-1],[4,11],[18,11]] },
+ 'I': { width: 8, points: [[4,21],[4,0]] },
+ 'J': { width: 16, points: [[12,21],[12,5],[11,2],[10,1],[8,0],[6,0],[4,1],[3,2],[2,5],[2,7]] },
+ 'K': { width: 21, points: [[4,21],[4,0],[-1,-1],[18,21],[4,7],[-1,-1],[9,12],[18,0]] },
+ 'L': { width: 17, points: [[4,21],[4,0],[-1,-1],[4,0],[16,0]] },
+ 'M': { width: 24, points: [[4,21],[4,0],[-1,-1],[4,21],[12,0],[-1,-1],[20,21],[12,0],[-1,-1],[20,21],[20,0]] },
+ 'N': { width: 22, points: [[4,21],[4,0],[-1,-1],[4,21],[18,0],[-1,-1],[18,21],[18,0]] },
+ 'O': { width: 22, points: [[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21]] },
+ 'P': { width: 21, points: [[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,14],[17,12],[16,11],[13,10],[4,10]] },
+ 'Q': { width: 22, points: [[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21],[-1,-1],[12,4],[18,-2]] },
+ 'R': { width: 21, points: [[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,15],[17,13],[16,12],[13,11],[4,11],[-1,-1],[11,11],[18,0]] },
+ 'S': { width: 20, points: [[17,18],[15,20],[12,21],[8,21],[5,20],[3,18],[3,16],[4,14],[5,13],[7,12],[13,10],[15,9],[16,8],[17,6],[17,3],[15,1],[12,0],[8,0],[5,1],[3,3]] },
+ 'T': { width: 16, points: [[8,21],[8,0],[-1,-1],[1,21],[15,21]] },
+ 'U': { width: 22, points: [[4,21],[4,6],[5,3],[7,1],[10,0],[12,0],[15,1],[17,3],[18,6],[18,21]] },
+ 'V': { width: 18, points: [[1,21],[9,0],[-1,-1],[17,21],[9,0]] },
+ 'W': { width: 24, points: [[2,21],[7,0],[-1,-1],[12,21],[7,0],[-1,-1],[12,21],[17,0],[-1,-1],[22,21],[17,0]] },
+ 'X': { width: 20, points: [[3,21],[17,0],[-1,-1],[17,21],[3,0]] },
+ 'Y': { width: 18, points: [[1,21],[9,11],[9,0],[-1,-1],[17,21],[9,11]] },
+ 'Z': { width: 20, points: [[17,21],[3,0],[-1,-1],[3,21],[17,21],[-1,-1],[3,0],[17,0]] },
+ '[': { width: 14, points: [[4,25],[4,-7],[-1,-1],[5,25],[5,-7],[-1,-1],[4,25],[11,25],[-1,-1],[4,-7],[11,-7]] },
+ '\\': { width: 14, points: [[0,21],[14,-3]] },
+ ']': { width: 14, points: [[9,25],[9,-7],[-1,-1],[10,25],[10,-7],[-1,-1],[3,25],[10,25],[-1,-1],[3,-7],[10,-7]] },
+ '^': { width: 16, points: [[6,15],[8,18],[10,15],[-1,-1],[3,12],[8,17],[13,12],[-1,-1],[8,17],[8,0]] },
+ '_': { width: 16, points: [[0,-2],[16,-2]] },
+ '`': { width: 10, points: [[6,21],[5,20],[4,18],[4,16],[5,15],[6,16],[5,17]] },
+ 'a': { width: 19, points: [[15,14],[15,0],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]] },
+ 'b': { width: 19, points: [[4,21],[4,0],[-1,-1],[4,11],[6,13],[8,14],[11,14],[13,13],[15,11],[16,8],[16,6],[15,3],[13,1],[11,0],[8,0],[6,1],[4,3]] },
+ 'c': { width: 18, points: [[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]] },
+ 'd': { width: 19, points: [[15,21],[15,0],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]] },
+ 'e': { width: 18, points: [[3,8],[15,8],[15,10],[14,12],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]] },
+ 'f': { width: 12, points: [[10,21],[8,21],[6,20],[5,17],[5,0],[-1,-1],[2,14],[9,14]] },
+ 'g': { width: 19, points: [[15,14],[15,-2],[14,-5],[13,-6],[11,-7],[8,-7],[6,-6],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]] },
+ 'h': { width: 19, points: [[4,21],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0]] },
+ 'i': { width: 8, points: [[3,21],[4,20],[5,21],[4,22],[3,21],[-1,-1],[4,14],[4,0]] },
+ 'j': { width: 10, points: [[5,21],[6,20],[7,21],[6,22],[5,21],[-1,-1],[6,14],[6,-3],[5,-6],[3,-7],[1,-7]] },
+ 'k': { width: 17, points: [[4,21],[4,0],[-1,-1],[14,14],[4,4],[-1,-1],[8,8],[15,0]] },
+ 'l': { width: 8, points: [[4,21],[4,0]] },
+ 'm': { width: 30, points: [[4,14],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0],[-1,-1],[15,10],[18,13],[20,14],[23,14],[25,13],[26,10],[26,0]] },
+ 'n': { width: 19, points: [[4,14],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0]] },
+ 'o': { width: 19, points: [[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3],[16,6],[16,8],[15,11],[13,13],[11,14],[8,14]] },
+ 'p': { width: 19, points: [[4,14],[4,-7],[-1,-1],[4,11],[6,13],[8,14],[11,14],[13,13],[15,11],[16,8],[16,6],[15,3],[13,1],[11,0],[8,0],[6,1],[4,3]] },
+ 'q': { width: 19, points: [[15,14],[15,-7],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]] },
+ 'r': { width: 13, points: [[4,14],[4,0],[-1,-1],[4,8],[5,11],[7,13],[9,14],[12,14]] },
+ 's': { width: 17, points: [[14,11],[13,13],[10,14],[7,14],[4,13],[3,11],[4,9],[6,8],[11,7],[13,6],[14,4],[14,3],[13,1],[10,0],[7,0],[4,1],[3,3]] },
+ 't': { width: 12, points: [[5,21],[5,4],[6,1],[8,0],[10,0],[-1,-1],[2,14],[9,14]] },
+ 'u': { width: 19, points: [[4,14],[4,4],[5,1],[7,0],[10,0],[12,1],[15,4],[-1,-1],[15,14],[15,0]] },
+ 'v': { width: 16, points: [[2,14],[8,0],[-1,-1],[14,14],[8,0]] },
+ 'w': { width: 22, points: [[3,14],[7,0],[-1,-1],[11,14],[7,0],[-1,-1],[11,14],[15,0],[-1,-1],[19,14],[15,0]] },
+ 'x': { width: 17, points: [[3,14],[14,0],[-1,-1],[14,14],[3,0]] },
+ 'y': { width: 16, points: [[2,14],[8,0],[-1,-1],[14,14],[8,0],[6,-4],[4,-6],[2,-7],[1,-7]] },
+ 'z': { width: 17, points: [[14,14],[3,0],[-1,-1],[3,14],[14,14],[-1,-1],[3,0],[14,0]] },
+ '{': { width: 14, points: [[9,25],[7,24],[6,23],[5,21],[5,19],[6,17],[7,16],[8,14],[8,12],[6,10],[-1,-1],[7,24],[6,22],[6,20],[7,18],[8,17],[9,15],[9,13],[8,11],[4,9],[8,7],[9,5],[9,3],[8,1],[7,0],[6,-2],[6,-4],[7,-6],[-1,-1],[6,8],[8,6],[8,4],[7,2],[6,1],[5,-1],[5,-3],[6,-5],[7,-6],[9,-7]] },
+ '|': { width: 8, points: [[4,25],[4,-7]] },
+ '}': { width: 14, points: [[5,25],[7,24],[8,23],[9,21],[9,19],[8,17],[7,16],[6,14],[6,12],[8,10],[-1,-1],[7,24],[8,22],[8,20],[7,18],[6,17],[5,15],[5,13],[6,11],[10,9],[6,7],[5,5],[5,3],[6,1],[7,0],[8,-2],[8,-4],[7,-6],[-1,-1],[8,8],[6,6],[6,4],[7,2],[8,1],[9,-1],[9,-3],[8,-5],[7,-6],[5,-7]] },
+ '~': { width: 24, points: [[3,6],[3,8],[4,11],[6,12],[8,12],[10,11],[14,8],[16,7],[18,7],[20,8],[21,10],[-1,-1],[3,8],[4,10],[6,11],[8,11],[10,10],[14,7],[16,6],[18,6],[20,7],[21,10],[21,12]] }
+ };
+
+ $.jqplot.CanvasFontRenderer = function(options) {
+ options = options || {};
+ if (!options.pt2px) {
+ options.pt2px = 1.5;
+ }
+ $.jqplot.CanvasTextRenderer.call(this, options);
+ };
+
+ $.jqplot.CanvasFontRenderer.prototype = new $.jqplot.CanvasTextRenderer({});
+ $.jqplot.CanvasFontRenderer.prototype.constructor = $.jqplot.CanvasFontRenderer;
+
+ $.jqplot.CanvasFontRenderer.prototype.measure = function(ctx, str)
+ {
+ // var fstyle = this.fontStyle+' '+this.fontVariant+' '+this.fontWeight+' '+this.fontSize+' '+this.fontFamily;
+ var fstyle = this.fontSize+' '+this.fontFamily;
+ ctx.save();
+ ctx.font = fstyle;
+ var w = ctx.measureText(str).width;
+ ctx.restore();
+ return w;
+ };
+
+ $.jqplot.CanvasFontRenderer.prototype.draw = function(ctx, str)
+ {
+ var x = 0;
+ // leave room at bottom for descenders.
+ var y = this.height*0.72;
+ //var y = 12;
+
+ ctx.save();
+ var tx, ty;
+
+ // 1st quadrant
+ if ((-Math.PI/2 <= this.angle && this.angle <= 0) || (Math.PI*3/2 <= this.angle && this.angle <= Math.PI*2)) {
+ tx = 0;
+ ty = -Math.sin(this.angle) * this.width;
+ }
+ // 4th quadrant
+ else if ((0 < this.angle && this.angle <= Math.PI/2) || (-Math.PI*2 <= this.angle && this.angle <= -Math.PI*3/2)) {
+ tx = Math.sin(this.angle) * this.height;
+ ty = 0;
+ }
+ // 2nd quadrant
+ else if ((-Math.PI < this.angle && this.angle < -Math.PI/2) || (Math.PI <= this.angle && this.angle <= Math.PI*3/2)) {
+ tx = -Math.cos(this.angle) * this.width;
+ ty = -Math.sin(this.angle) * this.width - Math.cos(this.angle) * this.height;
+ }
+ // 3rd quadrant
+ else if ((-Math.PI*3/2 < this.angle && this.angle < Math.PI) || (Math.PI/2 < this.angle && this.angle < Math.PI)) {
+ tx = Math.sin(this.angle) * this.height - Math.cos(this.angle)*this.width;
+ ty = -Math.cos(this.angle) * this.height;
+ }
+ ctx.strokeStyle = this.fillStyle;
+ ctx.fillStyle = this.fillStyle;
+ // var fstyle = this.fontStyle+' '+this.fontVariant+' '+this.fontWeight+' '+this.fontSize+' '+this.fontFamily;
+ var fstyle = this.fontSize+' '+this.fontFamily;
+ ctx.font = fstyle;
+ ctx.translate(tx, ty);
+ ctx.rotate(this.angle);
+ ctx.fillText(str, x, y);
+ // ctx.strokeText(str, x, y);
+
+ ctx.restore();
+ };
+
+})(jQuery);
\ No newline at end of file
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.categoryAxisRenderer.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.categoryAxisRenderer.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.categoryAxisRenderer.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,696 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ */
+(function($) {
+ /**
+ * class: $.jqplot.CategoryAxisRenderer
+ * A plugin for jqPlot to render a category style axis, with equal pixel spacing between y data values of a series.
+ *
+ * To use this renderer, include the plugin in your source
+ * > <script type="text/javascript" language="javascript" src="plugins/jqplot.categoryAxisRenderer.js"></script>
+ *
+ * and supply the appropriate options to your plot
+ *
+ * > {axes:{xaxis:{renderer:$.jqplot.CategoryAxisRenderer}}}
+ **/
+ $.jqplot.CategoryAxisRenderer = function(options) {
+ $.jqplot.LinearAxisRenderer.call(this);
+ // prop: sortMergedLabels
+ // True to sort tick labels when labels are created by merging
+ // x axis values from multiple series. That is, say you have
+ // two series like:
+ // > line1 = [[2006, 4], [2008, 9], [2009, 16]];
+ // > line2 = [[2006, 3], [2007, 7], [2008, 6]];
+ // If no label array is specified, tick labels will be collected
+ // from the x values of the series. With sortMergedLabels
+ // set to true, tick labels will be:
+ // > [2006, 2007, 2008, 2009]
+ // With sortMergedLabels set to false, tick labels will be:
+ // > [2006, 2008, 2009, 2007]
+ //
+ // Note, this property is specified on the renderOptions for the
+ // axes when creating a plot:
+ // > axes:{xaxis:{renderer:$.jqplot.CategoryAxisRenderer, rendererOptions:{sortMergedLabels:true}}}
+ this.sortMergedLabels = false;
+ };
+
+ $.jqplot.CategoryAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer();
+ $.jqplot.CategoryAxisRenderer.prototype.constructor = $.jqplot.CategoryAxisRenderer;
+
+ $.jqplot.CategoryAxisRenderer.prototype.init = function(options){
+ this.groups = 1;
+ this.groupLabels = [];
+ this._groupLabels = [];
+ this._grouped = false;
+ this._barsPerGroup = null;
+ this.reverse = false;
+ // prop: tickRenderer
+ // A class of a rendering engine for creating the ticks labels displayed on the plot,
+ // See <$.jqplot.AxisTickRenderer>.
+ // this.tickRenderer = $.jqplot.AxisTickRenderer;
+ // this.labelRenderer = $.jqplot.AxisLabelRenderer;
+ $.extend(true, this, {tickOptions:{formatString:'%d'}}, options);
+ var db = this._dataBounds;
+ // Go through all the series attached to this axis and find
+ // the min/max bounds for this axis.
+ for (var i=0; i<this._series.length; i++) {
+ var s = this._series[i];
+ if (s.groups) {
+ this.groups = s.groups;
+ }
+ var d = s.data;
+
+ for (var j=0; j<d.length; j++) {
+ if (this.name == 'xaxis' || this.name == 'x2axis') {
+ if (d[j][0] < db.min || db.min == null) {
+ db.min = d[j][0];
+ }
+ if (d[j][0] > db.max || db.max == null) {
+ db.max = d[j][0];
+ }
+ }
+ else {
+ if (d[j][1] < db.min || db.min == null) {
+ db.min = d[j][1];
+ }
+ if (d[j][1] > db.max || db.max == null) {
+ db.max = d[j][1];
+ }
+ }
+ }
+ }
+
+ if (this.groupLabels.length) {
+ this.groups = this.groupLabels.length;
+ }
+ };
+
+
+ $.jqplot.CategoryAxisRenderer.prototype.createTicks = function() {
+ // we're are operating on an axis here
+ var ticks = this._ticks;
+ var userTicks = this.ticks;
+ var name = this.name;
+ // databounds were set on axis initialization.
+ var db = this._dataBounds;
+ var dim, interval;
+ var min, max;
+ var pos1, pos2;
+ var tt, i;
+
+ // if we already have ticks, use them.
+ if (userTicks.length) {
+ // adjust with blanks if we have groups
+ if (this.groups > 1 && !this._grouped) {
+ var l = userTicks.length;
+ var skip = parseInt(l/this.groups, 10);
+ var count = 0;
+ for (var i=skip; i<l; i+=skip) {
+ userTicks.splice(i+count, 0, ' ');
+ count++;
+ }
+ this._grouped = true;
+ }
+ this.min = 0.5;
+ this.max = userTicks.length + 0.5;
+ var range = this.max - this.min;
+ this.numberTicks = 2*userTicks.length + 1;
+ for (i=0; i<userTicks.length; i++){
+ tt = this.min + 2 * i * range / (this.numberTicks-1);
+ // need a marker before and after the tick
+ var t = new this.tickRenderer(this.tickOptions);
+ t.showLabel = false;
+ // t.showMark = true;
+ t.setTick(tt, this.name);
+ this._ticks.push(t);
+ var t = new this.tickRenderer(this.tickOptions);
+ t.label = userTicks[i];
+ // t.showLabel = true;
+ t.showMark = false;
+ t.showGridline = false;
+ t.setTick(tt+0.5, this.name);
+ this._ticks.push(t);
+ }
+ // now add the last tick at the end
+ var t = new this.tickRenderer(this.tickOptions);
+ t.showLabel = false;
+ // t.showMark = true;
+ t.setTick(tt+1, this.name);
+ this._ticks.push(t);
+ }
+
+ // we don't have any ticks yet, let's make some!
+ else {
+ if (name == 'xaxis' || name == 'x2axis') {
+ dim = this._plotDimensions.width;
+ }
+ else {
+ dim = this._plotDimensions.height;
+ }
+
+ // if min, max and number of ticks specified, user can't specify interval.
+ if (this.min != null && this.max != null && this.numberTicks != null) {
+ this.tickInterval = null;
+ }
+
+ // if max, min, and interval specified and interval won't fit, ignore interval.
+ if (this.min != null && this.max != null && this.tickInterval != null) {
+ if (parseInt((this.max-this.min)/this.tickInterval, 10) != (this.max-this.min)/this.tickInterval) {
+ this.tickInterval = null;
+ }
+ }
+
+ // find out how many categories are in the lines and collect labels
+ var labels = [];
+ var numcats = 0;
+ var min = 0.5;
+ var max, val;
+ var isMerged = false;
+ for (var i=0; i<this._series.length; i++) {
+ var s = this._series[i];
+ for (var j=0; j<s.data.length; j++) {
+ if (this.name == 'xaxis' || this.name == 'x2axis') {
+ val = s.data[j][0];
+ }
+ else {
+ val = s.data[j][1];
+ }
+ if ($.inArray(val, labels) == -1) {
+ isMerged = true;
+ numcats += 1;
+ labels.push(val);
+ }
+ }
+ }
+
+ if (isMerged && this.sortMergedLabels) {
+ labels.sort(function(a,b) { return a - b; });
+ }
+
+ // keep a reference to these tick labels to use for redrawing plot (see bug #57)
+ this.ticks = labels;
+
+ // now bin the data values to the right lables.
+ for (var i=0; i<this._series.length; i++) {
+ var s = this._series[i];
+ for (var j=0; j<s.data.length; j++) {
+ if (this.name == 'xaxis' || this.name == 'x2axis') {
+ val = s.data[j][0];
+ }
+ else {
+ val = s.data[j][1];
+ }
+ // for category axis, force the values into category bins.
+ // we should have the value in the label array now.
+ var idx = $.inArray(val, labels)+1;
+ if (this.name == 'xaxis' || this.name == 'x2axis') {
+ s.data[j][0] = idx;
+ }
+ else {
+ s.data[j][1] = idx;
+ }
+ }
+ }
+
+ // adjust with blanks if we have groups
+ if (this.groups > 1 && !this._grouped) {
+ var l = labels.length;
+ var skip = parseInt(l/this.groups, 10);
+ var count = 0;
+ for (var i=skip; i<l; i+=skip+1) {
+ labels[i] = ' ';
+ }
+ this._grouped = true;
+ }
+
+ max = numcats + 0.5;
+ if (this.numberTicks == null) {
+ this.numberTicks = 2*numcats + 1;
+ }
+
+ var range = max - min;
+ this.min = min;
+ this.max = max;
+ var track = 0;
+
+ // todo: adjust this so more ticks displayed.
+ var maxVisibleTicks = parseInt(3+dim/10, 10);
+ var skip = parseInt(numcats/maxVisibleTicks, 10);
+
+ if (this.tickInterval == null) {
+
+ this.tickInterval = range / (this.numberTicks-1);
+
+ }
+ // if tickInterval is specified, we will ignore any computed maximum.
+ for (var i=0; i<this.numberTicks; i++){
+ tt = this.min + i * this.tickInterval;
+ var t = new this.tickRenderer(this.tickOptions);
+ // if even tick, it isn't a category, it's a divider
+ if (i/2 == parseInt(i/2, 10)) {
+ t.showLabel = false;
+ t.showMark = true;
+ }
+ else {
+ if (skip>0 && track<skip) {
+ t.showLabel = false;
+ track += 1;
+ }
+ else {
+ t.showLabel = true;
+ track = 0;
+ }
+ t.label = t.formatter(t.formatString, labels[(i-1)/2]);
+ t.showMark = false;
+ t.showGridline = false;
+ }
+ t.setTick(tt, this.name);
+ this._ticks.push(t);
+ }
+ }
+
+ };
+
+ // called with scope of axis
+ $.jqplot.CategoryAxisRenderer.prototype.draw = function(ctx, plot) {
+ if (this.show) {
+ // populate the axis label and value properties.
+ // createTicks is a method on the renderer, but
+ // call it within the scope of the axis.
+ this.renderer.createTicks.call(this);
+ // fill a div with axes labels in the right direction.
+ // Need to pregenerate each axis to get it's bounds and
+ // position it and the labels correctly on the plot.
+ var dim=0;
+ var temp;
+ // Added for theming.
+ if (this._elem) {
+ // this._elem.empty();
+ // Memory Leaks patch
+ this._elem.emptyForce();
+ }
+
+ this._elem = this._elem || $('<div class="jqplot-axis jqplot-'+this.name+'" style="position:absolute;"></div>');
+
+ if (this.name == 'xaxis' || this.name == 'x2axis') {
+ this._elem.width(this._plotDimensions.width);
+ }
+ else {
+ this._elem.height(this._plotDimensions.height);
+ }
+
+ // create a _label object.
+ this.labelOptions.axis = this.name;
+ this._label = new this.labelRenderer(this.labelOptions);
+ if (this._label.show) {
+ var elem = this._label.draw(ctx, plot);
+ elem.appendTo(this._elem);
+ }
+
+ var t = this._ticks;
+ for (var i=0; i<t.length; i++) {
+ var tick = t[i];
+ if (tick.showLabel && (!tick.isMinorTick || this.showMinorTicks)) {
+ var elem = tick.draw(ctx, plot);
+ elem.appendTo(this._elem);
+ }
+ }
+
+ this._groupLabels = [];
+ // now make group labels
+ for (var i=0; i<this.groupLabels.length; i++)
+ {
+ var elem = $('<div style="position:absolute;" class="jqplot-'+this.name+'-groupLabel"></div>');
+ elem.html(this.groupLabels[i]);
+ this._groupLabels.push(elem);
+ elem.appendTo(this._elem);
+ }
+ }
+ return this._elem;
+ };
+
+ // called with scope of axis
+ $.jqplot.CategoryAxisRenderer.prototype.set = function() {
+ var dim = 0;
+ var temp;
+ var w = 0;
+ var h = 0;
+ var lshow = (this._label == null) ? false : this._label.show;
+ if (this.show) {
+ var t = this._ticks;
+ for (var i=0; i<t.length; i++) {
+ var tick = t[i];
+ if (tick.showLabel && (!tick.isMinorTick || this.showMinorTicks)) {
+ if (this.name == 'xaxis' || this.name == 'x2axis') {
+ temp = tick._elem.outerHeight(true);
+ }
+ else {
+ temp = tick._elem.outerWidth(true);
+ }
+ if (temp > dim) {
+ dim = temp;
+ }
+ }
+ }
+
+ var dim2 = 0;
+ for (var i=0; i<this._groupLabels.length; i++) {
+ var l = this._groupLabels[i];
+ if (this.name == 'xaxis' || this.name == 'x2axis') {
+ temp = l.outerHeight(true);
+ }
+ else {
+ temp = l.outerWidth(true);
+ }
+ if (temp > dim2) {
+ dim2 = temp;
+ }
+ }
+
+ if (lshow) {
+ w = this._label._elem.outerWidth(true);
+ h = this._label._elem.outerHeight(true);
+ }
+ if (this.name == 'xaxis') {
+ dim += dim2 + h;
+ this._elem.css({'height':dim+'px', left:'0px', bottom:'0px'});
+ }
+ else if (this.name == 'x2axis') {
+ dim += dim2 + h;
+ this._elem.css({'height':dim+'px', left:'0px', top:'0px'});
+ }
+ else if (this.name == 'yaxis') {
+ dim += dim2 + w;
+ this._elem.css({'width':dim+'px', left:'0px', top:'0px'});
+ if (lshow && this._label.constructor == $.jqplot.AxisLabelRenderer) {
+ this._label._elem.css('width', w+'px');
+ }
+ }
+ else {
+ dim += dim2 + w;
+ this._elem.css({'width':dim+'px', right:'0px', top:'0px'});
+ if (lshow && this._label.constructor == $.jqplot.AxisLabelRenderer) {
+ this._label._elem.css('width', w+'px');
+ }
+ }
+ }
+ };
+
+ // called with scope of axis
+ $.jqplot.CategoryAxisRenderer.prototype.pack = function(pos, offsets) {
+ var ticks = this._ticks;
+ var max = this.max;
+ var min = this.min;
+ var offmax = offsets.max;
+ var offmin = offsets.min;
+ var lshow = (this._label == null) ? false : this._label.show;
+ var i;
+
+ for (var p in pos) {
+ this._elem.css(p, pos[p]);
+ }
+
+ this._offsets = offsets;
+ // pixellength will be + for x axes and - for y axes becasue pixels always measured from top left.
+ var pixellength = offmax - offmin;
+ var unitlength = max - min;
+
+ if (!this.reverse) {
+ // point to unit and unit to point conversions references to Plot DOM element top left corner.
+
+ this.u2p = function(u){
+ return (u - min) * pixellength / unitlength + offmin;
+ };
+
+ this.p2u = function(p){
+ return (p - offmin) * unitlength / pixellength + min;
+ };
+
+ if (this.name == 'xaxis' || this.name == 'x2axis'){
+ this.series_u2p = function(u){
+ return (u - min) * pixellength / unitlength;
+ };
+ this.series_p2u = function(p){
+ return p * unitlength / pixellength + min;
+ };
+ }
+
+ else {
+ this.series_u2p = function(u){
+ return (u - max) * pixellength / unitlength;
+ };
+ this.series_p2u = function(p){
+ return p * unitlength / pixellength + max;
+ };
+ }
+ }
+
+ else {
+ // point to unit and unit to point conversions references to Plot DOM element top left corner.
+
+ this.u2p = function(u){
+ return offmin + (max - u) * pixellength / unitlength;
+ };
+
+ this.p2u = function(p){
+ return min + (p - offmin) * unitlength / pixellength;
+ };
+
+ if (this.name == 'xaxis' || this.name == 'x2axis'){
+ this.series_u2p = function(u){
+ return (max - u) * pixellength / unitlength;
+ };
+ this.series_p2u = function(p){
+ return p * unitlength / pixellength + max;
+ };
+ }
+
+ else {
+ this.series_u2p = function(u){
+ return (min - u) * pixellength / unitlength;
+ };
+ this.series_p2u = function(p){
+ return p * unitlength / pixellength + min;
+ };
+ }
+
+ }
+
+
+ if (this.show) {
+ if (this.name == 'xaxis' || this.name == 'x2axis') {
+ for (i=0; i<ticks.length; i++) {
+ var t = ticks[i];
+ if (t.show && t.showLabel) {
+ var shim;
+
+ if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) {
+ // will need to adjust auto positioning based on which axis this is.
+ var temp = (this.name == 'xaxis') ? 1 : -1;
+ switch (t.labelPosition) {
+ case 'auto':
+ // position at end
+ if (temp * t.angle < 0) {
+ shim = -t.getWidth() + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
+ }
+ // position at start
+ else {
+ shim = -t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
+ }
+ break;
+ case 'end':
+ shim = -t.getWidth() + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
+ break;
+ case 'start':
+ shim = -t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
+ break;
+ case 'middle':
+ shim = -t.getWidth()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
+ break;
+ default:
+ shim = -t.getWidth()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
+ break;
+ }
+ }
+ else {
+ shim = -t.getWidth()/2;
+ }
+ var val = this.u2p(t.value) + shim + 'px';
+ t._elem.css('left', val);
+ t.pack();
+ }
+ }
+
+ var labeledge=['bottom', 0];
+ if (lshow) {
+ var w = this._label._elem.outerWidth(true);
+ this._label._elem.css('left', offmin + pixellength/2 - w/2 + 'px');
+ if (this.name == 'xaxis') {
+ this._label._elem.css('bottom', '0px');
+ labeledge = ['bottom', this._label._elem.outerHeight(true)];
+ }
+ else {
+ this._label._elem.css('top', '0px');
+ labeledge = ['top', this._label._elem.outerHeight(true)];
+ }
+ this._label.pack();
+ }
+
+ // draw the group labels
+ var step = parseInt(this._ticks.length/this.groups, 10);
+ for (i=0; i<this._groupLabels.length; i++) {
+ var mid = 0;
+ var count = 0;
+ for (var j=i*step; j<=(i+1)*step; j++) {
+ if (this._ticks[j]._elem && this._ticks[j].label != " ") {
+ var t = this._ticks[j]._elem;
+ var p = t.position();
+ mid += p.left + t.outerWidth(true)/2;
+ count++;
+ }
+ }
+ mid = mid/count;
+ this._groupLabels[i].css({'left':(mid - this._groupLabels[i].outerWidth(true)/2)});
+ this._groupLabels[i].css(labeledge[0], labeledge[1]);
+ }
+ }
+ else {
+ for (i=0; i<ticks.length; i++) {
+ var t = ticks[i];
+ if (t.show && t.showLabel) {
+ var shim;
+ if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) {
+ // will need to adjust auto positioning based on which axis this is.
+ var temp = (this.name == 'yaxis') ? 1 : -1;
+ switch (t.labelPosition) {
+ case 'auto':
+ // position at end
+ case 'end':
+ if (temp * t.angle < 0) {
+ shim = -t._textRenderer.height * Math.cos(-t._textRenderer.angle) / 2;
+ }
+ else {
+ shim = -t.getHeight() + t._textRenderer.height * Math.cos(t._textRenderer.angle) / 2;
+ }
+ break;
+ case 'start':
+ if (t.angle > 0) {
+ shim = -t._textRenderer.height * Math.cos(-t._textRenderer.angle) / 2;
+ }
+ else {
+ shim = -t.getHeight() + t._textRenderer.height * Math.cos(t._textRenderer.angle) / 2;
+ }
+ break;
+ case 'middle':
+ // if (t.angle > 0) {
+ // shim = -t.getHeight()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
+ // }
+ // else {
+ // shim = -t.getHeight()/2 - t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
+ // }
+ shim = -t.getHeight()/2;
+ break;
+ default:
+ shim = -t.getHeight()/2;
+ break;
+ }
+ }
+ else {
+ shim = -t.getHeight()/2;
+ }
+
+ var val = this.u2p(t.value) + shim + 'px';
+ t._elem.css('top', val);
+ t.pack();
+ }
+ }
+
+ var labeledge=['left', 0];
+ if (lshow) {
+ var h = this._label._elem.outerHeight(true);
+ this._label._elem.css('top', offmax - pixellength/2 - h/2 + 'px');
+ if (this.name == 'yaxis') {
+ this._label._elem.css('left', '0px');
+ labeledge = ['left', this._label._elem.outerWidth(true)];
+ }
+ else {
+ this._label._elem.css('right', '0px');
+ labeledge = ['right', this._label._elem.outerWidth(true)];
+ }
+ this._label.pack();
+ }
+
+ // draw the group labels, position top here, do left after label position.
+ var step = parseInt(this._ticks.length/this.groups, 10);
+ for (i=0; i<this._groupLabels.length; i++) {
+ var mid = 0;
+ var count = 0;
+ for (var j=i*step; j<=(i+1)*step; j++) {
+ if (this._ticks[j]._elem && this._ticks[j].label != " ") {
+ var t = this._ticks[j]._elem;
+ var p = t.position();
+ mid += p.top + t.outerHeight()/2;
+ count++;
+ }
+ }
+ mid = mid/count;
+ this._groupLabels[i].css({'top':mid - this._groupLabels[i].outerHeight()/2});
+ this._groupLabels[i].css(labeledge[0], labeledge[1]);
+
+ }
+ }
+ }
+ };
+
+
+})(jQuery);
\ No newline at end of file
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.ciParser.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.ciParser.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.ciParser.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,139 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ */
+(function($) {
+ /**
+ * Class: $.jqplot.ciParser
+ * Data Renderer function which converts a custom JSON data object into jqPlot data format.
+ * Set this as a callable on the jqplot dataRenderer plot option:
+ *
+ * > plot = $.jqplot('mychart', [data], { dataRenderer: $.jqplot.ciParser, ... });
+ *
+ * Where data is an object in JSON format or a JSON encoded string conforming to the
+ * City Index API spec.
+ *
+ * Note that calling the renderer function is handled internally by jqPlot. The
+ * user does not have to call the function. The parameters described below will
+ * automatically be passed to the ciParser function.
+ *
+ * Parameters:
+ * data - JSON encoded string or object.
+ * plot - reference to jqPlot Plot object.
+ *
+ * Returns:
+ * data array in jqPlot format.
+ *
+ */
+ $.jqplot.ciParser = function (data, plot) {
+ var ret = [],
+ line,
+ temp,
+ i, j, k, kk;
+
+ if (typeof(data) == "string") {
+ data = $.jqplot.JSON.parse(data, handleStrings);
+ }
+
+ else if (typeof(data) == "object") {
+ for (k in data) {
+ for (i=0; i<data[k].length; i++) {
+ for (kk in data[k][i]) {
+ data[k][i][kk] = handleStrings(kk, data[k][i][kk]);
+ }
+ }
+ }
+ }
+
+ else {
+ return null;
+ }
+
+ // function handleStrings
+ // Checks any JSON encoded strings to see if they are
+ // encoded dates. If so, pull out the timestamp.
+ // Expects dates to be represented by js timestamps.
+
+ function handleStrings(key, value) {
+ var a;
+ if (value != null) {
+ if (value.toString().indexOf('Date') >= 0) {
+ //here we will try to extract the ticks from the Date string in the "value" fields of JSON returned data
+ a = /^\/Date\((-?[0-9]+)\)\/$/.exec(value);
+ if (a) {
+ return parseInt(a[1], 10);
+ }
+ }
+ return value;
+ }
+ }
+
+ for (var prop in data) {
+ line = [];
+ temp = data[prop];
+ switch (prop) {
+ case "PriceTicks":
+ for (i=0; i<temp.length; i++) {
+ line.push([temp[i]['TickDate'], temp[i]['Price']]);
+ }
+ break;
+ case "PriceBars":
+ for (i=0; i<temp.length; i++) {
+ line.push([temp[i]['BarDate'], temp[i]['Open'], temp[i]['High'], temp[i]['Low'], temp[i]['Close']]);
+ }
+ break;
+ }
+ ret.push(line);
+ }
+ return ret;
+ };
+})(jQuery);
\ No newline at end of file
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.cursor.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.cursor.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.cursor.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,1131 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ */
+(function($) {
+
+ /**
+ * Class: $.jqplot.Cursor
+ * Plugin class representing the cursor as displayed on the plot.
+ */
+ $.jqplot.Cursor = function(options) {
+ // Group: Properties
+ //
+ // prop: style
+ // CSS spec for cursor style
+ this.style = 'crosshair';
+ this.previousCursor = 'auto';
+ // prop: show
+ // wether to show the cursor or not.
+ this.show = $.jqplot.config.enablePlugins;
+ // prop: showTooltip
+ // show a cursor position tooltip. Location of the tooltip
+ // will be controlled by followMouse and tooltipLocation.
+ this.showTooltip = true;
+ // prop: followMouse
+ // Tooltip follows the mouse, it is not at a fixed location.
+ // Tooltip will show on the grid at the location given by
+ // tooltipLocation, offset from the grid edge by tooltipOffset.
+ this.followMouse = false;
+ // prop: tooltipLocation
+ // Where to position tooltip. If followMouse is true, this is
+ // relative to the cursor, otherwise, it is relative to the grid.
+ // One of 'n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw'
+ this.tooltipLocation = 'se';
+ // prop: tooltipOffset
+ // Pixel offset of tooltip from the grid boudaries or cursor center.
+ this.tooltipOffset = 6;
+ // prop: showTooltipGridPosition
+ // show the grid pixel coordinates of the mouse.
+ this.showTooltipGridPosition = false;
+ // prop: showTooltipUnitPosition
+ // show the unit (data) coordinates of the mouse.
+ this.showTooltipUnitPosition = true;
+ // prop: showTooltipDataPosition
+ // Used with showVerticalLine to show intersecting data points in the tooltip.
+ this.showTooltipDataPosition = false;
+ // prop: tooltipFormatString
+ // sprintf format string for the tooltip.
+ // Uses Ash Searle's javascript sprintf implementation
+ // found here: http://hexmen.com/blog/2007/03/printf-sprintf/
+ // See http://perldoc.perl.org/functions/sprintf.html for reference
+ // Note, if showTooltipDataPosition is true, the default tooltipFormatString
+ // will be set to the cursorLegendFormatString, not the default given here.
+ this.tooltipFormatString = '%.4P, %.4P';
+ // prop: useAxesFormatters
+ // Use the x and y axes formatters to format the text in the tooltip.
+ this.useAxesFormatters = true;
+ // prop: tooltipAxisGroups
+ // Show position for the specified axes.
+ // This is an array like [['xaxis', 'yaxis'], ['xaxis', 'y2axis']]
+ // Default is to compute automatically for all visible axes.
+ this.tooltipAxisGroups = [];
+ // prop: zoom
+ // Enable plot zooming.
+ this.zoom = false;
+ // zoomProxy and zoomTarget properties are not directly set by user.
+ // They Will be set through call to zoomProxy method.
+ this.zoomProxy = false;
+ this.zoomTarget = false;
+ // prop: looseZoom
+ // Will expand zoom range to provide more rounded tick values.
+ // Works only with linear, log and date axes.
+ this.looseZoom = true;
+ // prop: clickReset
+ // Will reset plot zoom if single click on plot without drag.
+ this.clickReset = false;
+ // prop: dblClickReset
+ // Will reset plot zoom if double click on plot without drag.
+ this.dblClickReset = true;
+ // prop: showVerticalLine
+ // draw a vertical line across the plot which follows the cursor.
+ // When the line is near a data point, a special legend and/or tooltip can
+ // be updated with the data values.
+ this.showVerticalLine = false;
+ // prop: showHorizontalLine
+ // draw a horizontal line across the plot which follows the cursor.
+ this.showHorizontalLine = false;
+ // prop: constrainZoomTo
+ // 'none', 'x' or 'y'
+ this.constrainZoomTo = 'none';
+ // // prop: autoscaleConstraint
+ // // when a constrained axis is specified, true will
+ // // auatoscale the adjacent axis.
+ // this.autoscaleConstraint = true;
+ this.shapeRenderer = new $.jqplot.ShapeRenderer();
+ this._zoom = {start:[], end:[], started: false, zooming:false, isZoomed:false, axes:{start:{}, end:{}}, gridpos:{}, datapos:{}};
+ this._tooltipElem;
+ this.zoomCanvas;
+ this.cursorCanvas;
+ // prop: intersectionThreshold
+ // pixel distance from data point or marker to consider cursor lines intersecting with point.
+ // If data point markers are not shown, this should be >= 1 or will often miss point intersections.
+ this.intersectionThreshold = 2;
+ // prop: showCursorLegend
+ // Replace the plot legend with an enhanced legend displaying intersection information.
+ this.showCursorLegend = false;
+ // prop: cursorLegendFormatString
+ // Format string used in the cursor legend. If showTooltipDataPosition is true,
+ // this will also be the default format string used by tooltipFormatString.
+ this.cursorLegendFormatString = $.jqplot.Cursor.cursorLegendFormatString;
+ // whether the cursor is over the grid or not.
+ this._oldHandlers = {onselectstart: null, ondrag: null, onmousedown: null};
+ // prop: constrainOutsideZoom
+ // True to limit actual zoom area to edges of grid, even when zooming
+ // outside of plot area. That is, can't zoom out by mousing outside plot.
+ this.constrainOutsideZoom = true;
+ // prop: showTooltipOutsideZoom
+ // True will keep updating the tooltip when zooming of the grid.
+ this.showTooltipOutsideZoom = false;
+ // true if mouse is over grid, false if not.
+ this.onGrid = false;
+ $.extend(true, this, options);
+ };
+
+ $.jqplot.Cursor.cursorLegendFormatString = '%s x:%s, y:%s';
+
+ // called with scope of plot
+ $.jqplot.Cursor.init = function (target, data, opts){
+ // add a cursor attribute to the plot
+ var options = opts || {};
+ this.plugins.cursor = new $.jqplot.Cursor(options.cursor);
+ var c = this.plugins.cursor;
+
+ if (c.show) {
+ $.jqplot.eventListenerHooks.push(['jqplotMouseEnter', handleMouseEnter]);
+ $.jqplot.eventListenerHooks.push(['jqplotMouseLeave', handleMouseLeave]);
+ $.jqplot.eventListenerHooks.push(['jqplotMouseMove', handleMouseMove]);
+
+ if (c.showCursorLegend) {
+ opts.legend = opts.legend || {};
+ opts.legend.renderer = $.jqplot.CursorLegendRenderer;
+ opts.legend.formatString = this.plugins.cursor.cursorLegendFormatString;
+ opts.legend.show = true;
+ }
+
+ if (c.zoom) {
+ $.jqplot.eventListenerHooks.push(['jqplotMouseDown', handleMouseDown]);
+
+ if (c.clickReset) {
+ $.jqplot.eventListenerHooks.push(['jqplotClick', handleClick]);
+ }
+
+ if (c.dblClickReset) {
+ $.jqplot.eventListenerHooks.push(['jqplotDblClick', handleDblClick]);
+ }
+ }
+
+ this.resetZoom = function() {
+ var axes = this.axes;
+ if (!c.zoomProxy) {
+ for (var ax in axes) {
+ axes[ax].reset();
+ axes[ax]._ticks = [];
+ // fake out tick creation algorithm to make sure original auto
+ // computed format string is used if _overrideFormatString is true
+ if (c._zoom.axes[ax] !== undefined) {
+ axes[ax]._autoFormatString = c._zoom.axes[ax].tickFormatString;
+ }
+ }
+ this.redraw();
+ }
+ else {
+ var ctx = this.plugins.cursor.zoomCanvas._ctx;
+ ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height);
+ ctx = null;
+ }
+ this.plugins.cursor._zoom.isZoomed = false;
+ this.target.trigger('jqplotResetZoom', [this, this.plugins.cursor]);
+ };
+
+
+ if (c.showTooltipDataPosition) {
+ c.showTooltipUnitPosition = false;
+ c.showTooltipGridPosition = false;
+ if (options.cursor.tooltipFormatString == undefined) {
+ c.tooltipFormatString = $.jqplot.Cursor.cursorLegendFormatString;
+ }
+ }
+ }
+ };
+
+ // called with context of plot
+ $.jqplot.Cursor.postDraw = function() {
+ var c = this.plugins.cursor;
+
+ // Memory Leaks patch
+ if (c.zoomCanvas) {
+ c.zoomCanvas.resetCanvas();
+ c.zoomCanvas = null;
+ }
+
+ if (c.cursorCanvas) {
+ c.cursorCanvas.resetCanvas();
+ c.cursorCanvas = null;
+ }
+
+ if (c._tooltipElem) {
+ c._tooltipElem.emptyForce();
+ c._tooltipElem = null;
+ }
+
+
+ if (c.zoom) {
+ c.zoomCanvas = new $.jqplot.GenericCanvas();
+ this.eventCanvas._elem.before(c.zoomCanvas.createElement(this._gridPadding, 'jqplot-zoom-canvas', this._plotDimensions, this));
+ c.zoomCanvas.setContext();
+ }
+
+ var elem = document.createElement('div');
+ c._tooltipElem = $(elem);
+ elem = null;
+ c._tooltipElem.addClass('jqplot-cursor-tooltip');
+ c._tooltipElem.css({position:'absolute', display:'none'});
+
+
+ if (c.zoomCanvas) {
+ c.zoomCanvas._elem.before(c._tooltipElem);
+ }
+
+ else {
+ this.eventCanvas._elem.before(c._tooltipElem);
+ }
+
+ if (c.showVerticalLine || c.showHorizontalLine) {
+ c.cursorCanvas = new $.jqplot.GenericCanvas();
+ this.eventCanvas._elem.before(c.cursorCanvas.createElement(this._gridPadding, 'jqplot-cursor-canvas', this._plotDimensions, this));
+ c.cursorCanvas.setContext();
+ }
+
+ // if we are showing the positions in unit coordinates, and no axes groups
+ // were specified, create a default set.
+ if (c.showTooltipUnitPosition){
+ if (c.tooltipAxisGroups.length === 0) {
+ var series = this.series;
+ var s;
+ var temp = [];
+ for (var i=0; i<series.length; i++) {
+ s = series[i];
+ var ax = s.xaxis+','+s.yaxis;
+ if ($.inArray(ax, temp) == -1) {
+ temp.push(ax);
+ }
+ }
+ for (var i=0; i<temp.length; i++) {
+ c.tooltipAxisGroups.push(temp[i].split(','));
+ }
+ }
+ }
+ };
+
+ // Group: methods
+ //
+ // method: $.jqplot.Cursor.zoomProxy
+ // links targetPlot to controllerPlot so that plot zooming of
+ // targetPlot will be controlled by zooming on the controllerPlot.
+ // controllerPlot will not actually zoom, but acts as an
+ // overview plot. Note, the zoom options must be set to true for
+ // zoomProxy to work.
+ $.jqplot.Cursor.zoomProxy = function(targetPlot, controllerPlot) {
+ var tc = targetPlot.plugins.cursor;
+ var cc = controllerPlot.plugins.cursor;
+ tc.zoomTarget = true;
+ tc.zoom = true;
+ tc.style = 'auto';
+ tc.dblClickReset = false;
+ cc.zoom = true;
+ cc.zoomProxy = true;
+
+ controllerPlot.target.bind('jqplotZoom', plotZoom);
+ controllerPlot.target.bind('jqplotResetZoom', plotReset);
+
+ function plotZoom(ev, gridpos, datapos, plot, cursor) {
+ tc.doZoom(gridpos, datapos, targetPlot, cursor);
+ }
+
+ function plotReset(ev, plot, cursor) {
+ targetPlot.resetZoom();
+ }
+ };
+
+ $.jqplot.Cursor.prototype.resetZoom = function(plot, cursor) {
+ var axes = plot.axes;
+ var cax = cursor._zoom.axes;
+ if (!plot.plugins.cursor.zoomProxy && cursor._zoom.isZoomed) {
+ for (var ax in axes) {
+ // axes[ax]._ticks = [];
+ // axes[ax].min = cax[ax].min;
+ // axes[ax].max = cax[ax].max;
+ // axes[ax].numberTicks = cax[ax].numberTicks;
+ // axes[ax].tickInterval = cax[ax].tickInterval;
+ // // for date axes
+ // axes[ax].daTickInterval = cax[ax].daTickInterval;
+ axes[ax].reset();
+ axes[ax]._ticks = [];
+ // fake out tick creation algorithm to make sure original auto
+ // computed format string is used if _overrideFormatString is true
+ axes[ax]._autoFormatString = cax[ax].tickFormatString;
+ }
+ plot.redraw();
+ cursor._zoom.isZoomed = false;
+ }
+ else {
+ var ctx = cursor.zoomCanvas._ctx;
+ ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height);
+ ctx = null;
+ }
+ plot.target.trigger('jqplotResetZoom', [plot, cursor]);
+ };
+
+ $.jqplot.Cursor.resetZoom = function(plot) {
+ plot.resetZoom();
+ };
+
+ $.jqplot.Cursor.prototype.doZoom = function (gridpos, datapos, plot, cursor) {
+ var c = cursor;
+ var axes = plot.axes;
+ var zaxes = c._zoom.axes;
+ var start = zaxes.start;
+ var end = zaxes.end;
+ var min, max, dp, span,
+ newmin, newmax, curax, _numberTicks, ret;
+ var ctx = plot.plugins.cursor.zoomCanvas._ctx;
+ // don't zoom if zoom area is too small (in pixels)
+ if ((c.constrainZoomTo == 'none' && Math.abs(gridpos.x - c._zoom.start[0]) > 6 && Math.abs(gridpos.y - c._zoom.start[1]) > 6) || (c.constrainZoomTo == 'x' && Math.abs(gridpos.x - c._zoom.start[0]) > 6) || (c.constrainZoomTo == 'y' && Math.abs(gridpos.y - c._zoom.start[1]) > 6)) {
+ if (!plot.plugins.cursor.zoomProxy) {
+ for (var ax in datapos) {
+ // make a copy of the original axes to revert back.
+ if (c._zoom.axes[ax] == undefined) {
+ c._zoom.axes[ax] = {};
+ c._zoom.axes[ax].numberTicks = axes[ax].numberTicks;
+ c._zoom.axes[ax].tickInterval = axes[ax].tickInterval;
+ // for date axes...
+ c._zoom.axes[ax].daTickInterval = axes[ax].daTickInterval;
+ c._zoom.axes[ax].min = axes[ax].min;
+ c._zoom.axes[ax].max = axes[ax].max;
+ c._zoom.axes[ax].tickFormatString = (axes[ax].tickOptions != null) ? axes[ax].tickOptions.formatString : '';
+ }
+
+
+ if ((c.constrainZoomTo == 'none') || (c.constrainZoomTo == 'x' && ax.charAt(0) == 'x') || (c.constrainZoomTo == 'y' && ax.charAt(0) == 'y')) {
+ dp = datapos[ax];
+ if (dp != null) {
+ if (dp > start[ax]) {
+ newmin = start[ax];
+ newmax = dp;
+ }
+ else {
+ span = start[ax] - dp;
+ newmin = dp;
+ newmax = start[ax];
+ }
+
+ curax = axes[ax];
+
+ _numberTicks = null;
+
+ // if aligning this axis, use number of ticks from previous axis.
+ // Do I need to reset somehow if alignTicks is changed and then graph is replotted??
+ if (curax.alignTicks) {
+ if (curax.name === 'x2axis' && plot.axes.xaxis.show) {
+ _numberTicks = plot.axes.xaxis.numberTicks;
+ }
+ else if (curax.name.charAt(0) === 'y' && curax.name !== 'yaxis' && curax.name !== 'yMidAxis' && plot.axes.yaxis.show) {
+ _numberTicks = plot.axes.yaxis.numberTicks;
+ }
+ }
+
+ if (this.looseZoom && (axes[ax].renderer.constructor === $.jqplot.LinearAxisRenderer || axes[ax].renderer.constructor === $.jqplot.LogAxisRenderer )) { //} || axes[ax].renderer.constructor === $.jqplot.DateAxisRenderer)) {
+
+ ret = $.jqplot.LinearTickGenerator(newmin, newmax, curax._scalefact, _numberTicks);
+
+ // if new minimum is less than "true" minimum of axis display, adjust it
+ if (axes[ax].tickInset && ret[0] < axes[ax].min + axes[ax].tickInset * axes[ax].tickInterval) {
+ ret[0] += ret[4];
+ ret[2] -= 1;
+ }
+
+ // if new maximum is greater than "true" max of axis display, adjust it
+ if (axes[ax].tickInset && ret[1] > axes[ax].max - axes[ax].tickInset * axes[ax].tickInterval) {
+ ret[1] -= ret[4];
+ ret[2] -= 1;
+ }
+
+ // for log axes, don't fall below current minimum, this will look bad and can't have 0 in range anyway.
+ if (axes[ax].renderer.constructor === $.jqplot.LogAxisRenderer && ret[0] < axes[ax].min) {
+ // remove a tick and shift min up
+ ret[0] += ret[4];
+ ret[2] -= 1;
+ }
+
+ axes[ax].min = ret[0];
+ axes[ax].max = ret[1];
+ axes[ax]._autoFormatString = ret[3];
+ axes[ax].numberTicks = ret[2];
+ axes[ax].tickInterval = ret[4];
+ // for date axes...
+ axes[ax].daTickInterval = [ret[4]/1000, 'seconds'];
+ }
+ else {
+ axes[ax].min = newmin;
+ axes[ax].max = newmax;
+ axes[ax].tickInterval = null;
+ axes[ax].numberTicks = null;
+ // for date axes...
+ axes[ax].daTickInterval = null;
+ }
+
+ axes[ax]._ticks = [];
+ }
+ }
+
+ // if ((c.constrainZoomTo == 'x' && ax.charAt(0) == 'y' && c.autoscaleConstraint) || (c.constrainZoomTo == 'y' && ax.charAt(0) == 'x' && c.autoscaleConstraint)) {
+ // dp = datapos[ax];
+ // if (dp != null) {
+ // axes[ax].max == null;
+ // axes[ax].min = null;
+ // }
+ // }
+ }
+ ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height);
+ plot.redraw();
+ c._zoom.isZoomed = true;
+ ctx = null;
+ }
+ plot.target.trigger('jqplotZoom', [gridpos, datapos, plot, cursor]);
+ }
+ };
+
+ $.jqplot.preInitHooks.push($.jqplot.Cursor.init);
+ $.jqplot.postDrawHooks.push($.jqplot.Cursor.postDraw);
+
+ function updateTooltip(gridpos, datapos, plot) {
+ var c = plot.plugins.cursor;
+ var s = '';
+ var addbr = false;
+ if (c.showTooltipGridPosition) {
+ s = gridpos.x+', '+gridpos.y;
+ addbr = true;
+ }
+ if (c.showTooltipUnitPosition) {
+ var g;
+ for (var i=0; i<c.tooltipAxisGroups.length; i++) {
+ g = c.tooltipAxisGroups[i];
+ if (addbr) {
+ s += '<br />';
+ }
+ if (c.useAxesFormatters) {
+ for (var j=0; j<g.length; j++) {
+ if (j) {
+ s += ', ';
+ }
+ var af = plot.axes[g[j]]._ticks[0].formatter;
+ var afstr = plot.axes[g[j]]._ticks[0].formatString;
+ s += af(afstr, datapos[g[j]]);
+ }
+ }
+ else {
+ s += $.jqplot.sprintf(c.tooltipFormatString, datapos[g[0]], datapos[g[1]]);
+ }
+ addbr = true;
+ }
+ }
+
+ if (c.showTooltipDataPosition) {
+ var series = plot.series;
+ var ret = getIntersectingPoints(plot, gridpos.x, gridpos.y);
+ var addbr = false;
+
+ for (var i = 0; i< series.length; i++) {
+ if (series[i].show) {
+ var idx = series[i].index;
+ var label = series[i].label.toString();
+ var cellid = $.inArray(idx, ret.indices);
+ var sx = undefined;
+ var sy = undefined;
+ if (cellid != -1) {
+ var data = ret.data[cellid].data;
+ if (c.useAxesFormatters) {
+ var xf = series[i]._xaxis._ticks[0].formatter;
+ var yf = series[i]._yaxis._ticks[0].formatter;
+ var xfstr = series[i]._xaxis._ticks[0].formatString;
+ var yfstr = series[i]._yaxis._ticks[0].formatString;
+ sx = xf(xfstr, data[0]);
+ sy = yf(yfstr, data[1]);
+ }
+ else {
+ sx = data[0];
+ sy = data[1];
+ }
+ if (addbr) {
+ s += '<br />';
+ }
+ s += $.jqplot.sprintf(c.tooltipFormatString, label, sx, sy);
+ addbr = true;
+ }
+ }
+ }
+
+ }
+ c._tooltipElem.html(s);
+ }
+
+ function moveLine(gridpos, plot) {
+ var c = plot.plugins.cursor;
+ var ctx = c.cursorCanvas._ctx;
+ ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height);
+ if (c.showVerticalLine) {
+ c.shapeRenderer.draw(ctx, [[gridpos.x, 0], [gridpos.x, ctx.canvas.height]]);
+ }
+ if (c.showHorizontalLine) {
+ c.shapeRenderer.draw(ctx, [[0, gridpos.y], [ctx.canvas.width, gridpos.y]]);
+ }
+ var ret = getIntersectingPoints(plot, gridpos.x, gridpos.y);
+ if (c.showCursorLegend) {
+ var cells = $(plot.targetId + ' td.jqplot-cursor-legend-label');
+ for (var i=0; i<cells.length; i++) {
+ var idx = $(cells[i]).data('seriesIndex');
+ var series = plot.series[idx];
+ var label = series.label.toString();
+ var cellid = $.inArray(idx, ret.indices);
+ var sx = undefined;
+ var sy = undefined;
+ if (cellid != -1) {
+ var data = ret.data[cellid].data;
+ if (c.useAxesFormatters) {
+ var xf = series._xaxis._ticks[0].formatter;
+ var yf = series._yaxis._ticks[0].formatter;
+ var xfstr = series._xaxis._ticks[0].formatString;
+ var yfstr = series._yaxis._ticks[0].formatString;
+ sx = xf(xfstr, data[0]);
+ sy = yf(yfstr, data[1]);
+ }
+ else {
+ sx = data[0];
+ sy = data[1];
+ }
+ }
+ if (plot.legend.escapeHtml) {
+ $(cells[i]).text($.jqplot.sprintf(c.cursorLegendFormatString, label, sx, sy));
+ }
+ else {
+ $(cells[i]).html($.jqplot.sprintf(c.cursorLegendFormatString, label, sx, sy));
+ }
+ }
+ }
+ ctx = null;
+ }
+
+ function getIntersectingPoints(plot, x, y) {
+ var ret = {indices:[], data:[]};
+ var s, i, d0, d, j, r, p;
+ var threshold;
+ var c = plot.plugins.cursor;
+ for (var i=0; i<plot.series.length; i++) {
+ s = plot.series[i];
+ r = s.renderer;
+ if (s.show) {
+ threshold = c.intersectionThreshold;
+ if (s.showMarker) {
+ threshold += s.markerRenderer.size/2;
+ }
+ for (var j=0; j<s.gridData.length; j++) {
+ p = s.gridData[j];
+ // check vertical line
+ if (c.showVerticalLine) {
+ if (Math.abs(x-p[0]) <= threshold) {
+ ret.indices.push(i);
+ ret.data.push({seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]});
+ }
+ }
+ }
+ }
+ }
+ return ret;
+ }
+
+ function moveTooltip(gridpos, plot) {
+ var c = plot.plugins.cursor;
+ var elem = c._tooltipElem;
+ switch (c.tooltipLocation) {
+ case 'nw':
+ var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - c.tooltipOffset;
+ var y = gridpos.y + plot._gridPadding.top - c.tooltipOffset - elem.outerHeight(true);
+ break;
+ case 'n':
+ var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true)/2;
+ var y = gridpos.y + plot._gridPadding.top - c.tooltipOffset - elem.outerHeight(true);
+ break;
+ case 'ne':
+ var x = gridpos.x + plot._gridPadding.left + c.tooltipOffset;
+ var y = gridpos.y + plot._gridPadding.top - c.tooltipOffset - elem.outerHeight(true);
+ break;
+ case 'e':
+ var x = gridpos.x + plot._gridPadding.left + c.tooltipOffset;
+ var y = gridpos.y + plot._gridPadding.top - elem.outerHeight(true)/2;
+ break;
+ case 'se':
+ var x = gridpos.x + plot._gridPadding.left + c.tooltipOffset;
+ var y = gridpos.y + plot._gridPadding.top + c.tooltipOffset;
+ break;
+ case 's':
+ var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true)/2;
+ var y = gridpos.y + plot._gridPadding.top + c.tooltipOffset;
+ break;
+ case 'sw':
+ var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - c.tooltipOffset;
+ var y = gridpos.y + plot._gridPadding.top + c.tooltipOffset;
+ break;
+ case 'w':
+ var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - c.tooltipOffset;
+ var y = gridpos.y + plot._gridPadding.top - elem.outerHeight(true)/2;
+ break;
+ default:
+ var x = gridpos.x + plot._gridPadding.left + c.tooltipOffset;
+ var y = gridpos.y + plot._gridPadding.top + c.tooltipOffset;
+ break;
+ }
+
+ elem.css('left', x);
+ elem.css('top', y);
+ elem = null;
+ }
+
+ function positionTooltip(plot) {
+ // fake a grid for positioning
+ var grid = plot._gridPadding;
+ var c = plot.plugins.cursor;
+ var elem = c._tooltipElem;
+ switch (c.tooltipLocation) {
+ case 'nw':
+ var a = grid.left + c.tooltipOffset;
+ var b = grid.top + c.tooltipOffset;
+ elem.css('left', a);
+ elem.css('top', b);
+ break;
+ case 'n':
+ var a = (grid.left + (plot._plotDimensions.width - grid.right))/2 - elem.outerWidth(true)/2;
+ var b = grid.top + c.tooltipOffset;
+ elem.css('left', a);
+ elem.css('top', b);
+ break;
+ case 'ne':
+ var a = grid.right + c.tooltipOffset;
+ var b = grid.top + c.tooltipOffset;
+ elem.css({right:a, top:b});
+ break;
+ case 'e':
+ var a = grid.right + c.tooltipOffset;
+ var b = (grid.top + (plot._plotDimensions.height - grid.bottom))/2 - elem.outerHeight(true)/2;
+ elem.css({right:a, top:b});
+ break;
+ case 'se':
+ var a = grid.right + c.tooltipOffset;
+ var b = grid.bottom + c.tooltipOffset;
+ elem.css({right:a, bottom:b});
+ break;
+ case 's':
+ var a = (grid.left + (plot._plotDimensions.width - grid.right))/2 - elem.outerWidth(true)/2;
+ var b = grid.bottom + c.tooltipOffset;
+ elem.css({left:a, bottom:b});
+ break;
+ case 'sw':
+ var a = grid.left + c.tooltipOffset;
+ var b = grid.bottom + c.tooltipOffset;
+ elem.css({left:a, bottom:b});
+ break;
+ case 'w':
+ var a = grid.left + c.tooltipOffset;
+ var b = (grid.top + (plot._plotDimensions.height - grid.bottom))/2 - elem.outerHeight(true)/2;
+ elem.css({left:a, top:b});
+ break;
+ default: // same as 'se'
+ var a = grid.right - c.tooltipOffset;
+ var b = grid.bottom + c.tooltipOffset;
+ elem.css({right:a, bottom:b});
+ break;
+ }
+ elem = null;
+ }
+
+ function handleClick (ev, gridpos, datapos, neighbor, plot) {
+ ev.preventDefault();
+ ev.stopImmediatePropagation();
+ var c = plot.plugins.cursor;
+ if (c.clickReset) {
+ c.resetZoom(plot, c);
+ }
+ var sel = window.getSelection;
+ if (document.selection && document.selection.empty)
+ {
+ document.selection.empty();
+ }
+ else if (sel && !sel().isCollapsed) {
+ sel().collapse();
+ }
+ return false;
+ }
+
+ function handleDblClick (ev, gridpos, datapos, neighbor, plot) {
+ ev.preventDefault();
+ ev.stopImmediatePropagation();
+ var c = plot.plugins.cursor;
+ if (c.dblClickReset) {
+ c.resetZoom(plot, c);
+ }
+ var sel = window.getSelection;
+ if (document.selection && document.selection.empty)
+ {
+ document.selection.empty();
+ }
+ else if (sel && !sel().isCollapsed) {
+ sel().collapse();
+ }
+ return false;
+ }
+
+ function handleMouseLeave(ev, gridpos, datapos, neighbor, plot) {
+ var c = plot.plugins.cursor;
+ c.onGrid = false;
+ if (c.show) {
+ $(ev.target).css('cursor', c.previousCursor);
+ if (c.showTooltip && !(c._zoom.zooming && c.showTooltipOutsideZoom && !c.constrainOutsideZoom)) {
+ c._tooltipElem.empty();
+ c._tooltipElem.hide();
+ }
+ if (c.zoom) {
+ c._zoom.gridpos = gridpos;
+ c._zoom.datapos = datapos;
+ }
+ if (c.showVerticalLine || c.showHorizontalLine) {
+ var ctx = c.cursorCanvas._ctx;
+ ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height);
+ ctx = null;
+ }
+ if (c.showCursorLegend) {
+ var cells = $(plot.targetId + ' td.jqplot-cursor-legend-label');
+ for (var i=0; i<cells.length; i++) {
+ var idx = $(cells[i]).data('seriesIndex');
+ var series = plot.series[idx];
+ var label = series.label.toString();
+ if (plot.legend.escapeHtml) {
+ $(cells[i]).text($.jqplot.sprintf(c.cursorLegendFormatString, label, undefined, undefined));
+ }
+ else {
+ $(cells[i]).html($.jqplot.sprintf(c.cursorLegendFormatString, label, undefined, undefined));
+ }
+
+ }
+ }
+ }
+ }
+
+ function handleMouseEnter(ev, gridpos, datapos, neighbor, plot) {
+ var c = plot.plugins.cursor;
+ c.onGrid = true;
+ if (c.show) {
+ c.previousCursor = ev.target.style.cursor;
+ ev.target.style.cursor = c.style;
+ if (c.showTooltip) {
+ updateTooltip(gridpos, datapos, plot);
+ if (c.followMouse) {
+ moveTooltip(gridpos, plot);
+ }
+ else {
+ positionTooltip(plot);
+ }
+ c._tooltipElem.show();
+ }
+ if (c.showVerticalLine || c.showHorizontalLine) {
+ moveLine(gridpos, plot);
+ }
+ }
+
+ }
+
+ function handleMouseMove(ev, gridpos, datapos, neighbor, plot) {
+ var c = plot.plugins.cursor;
+ if (c.show) {
+ if (c.showTooltip) {
+ updateTooltip(gridpos, datapos, plot);
+ if (c.followMouse) {
+ moveTooltip(gridpos, plot);
+ }
+ }
+ if (c.showVerticalLine || c.showHorizontalLine) {
+ moveLine(gridpos, plot);
+ }
+ }
+ }
+
+ function getEventPosition(ev) {
+ var plot = ev.data.plot;
+ var go = plot.eventCanvas._elem.offset();
+ var gridPos = {x:ev.pageX - go.left, y:ev.pageY - go.top};
+ //////
+ // TO DO: handle yMidAxis
+ //////
+ var dataPos = {xaxis:null, yaxis:null, x2axis:null, y2axis:null, y3axis:null, y4axis:null, y5axis:null, y6axis:null, y7axis:null, y8axis:null, y9axis:null, yMidAxis:null};
+ var an = ['xaxis', 'yaxis', 'x2axis', 'y2axis', 'y3axis', 'y4axis', 'y5axis', 'y6axis', 'y7axis', 'y8axis', 'y9axis', 'yMidAxis'];
+ var ax = plot.axes;
+ var n, axis;
+ for (n=11; n>0; n--) {
+ axis = an[n-1];
+ if (ax[axis].show) {
+ dataPos[axis] = ax[axis].series_p2u(gridPos[axis.charAt(0)]);
+ }
+ }
+
+ return {offsets:go, gridPos:gridPos, dataPos:dataPos};
+ }
+
+ function handleZoomMove(ev) {
+ var plot = ev.data.plot;
+ var c = plot.plugins.cursor;
+ // don't do anything if not on grid.
+ if (c.show && c.zoom && c._zoom.started && !c.zoomTarget) {
+ ev.preventDefault();
+ var ctx = c.zoomCanvas._ctx;
+ var positions = getEventPosition(ev);
+ var gridpos = positions.gridPos;
+ var datapos = positions.dataPos;
+ c._zoom.gridpos = gridpos;
+ c._zoom.datapos = datapos;
+ c._zoom.zooming = true;
+ var xpos = gridpos.x;
+ var ypos = gridpos.y;
+ var height = ctx.canvas.height;
+ var width = ctx.canvas.width;
+ if (c.showTooltip && !c.onGrid && c.showTooltipOutsideZoom) {
+ updateTooltip(gridpos, datapos, plot);
+ if (c.followMouse) {
+ moveTooltip(gridpos, plot);
+ }
+ }
+ if (c.constrainZoomTo == 'x') {
+ c._zoom.end = [xpos, height];
+ }
+ else if (c.constrainZoomTo == 'y') {
+ c._zoom.end = [width, ypos];
+ }
+ else {
+ c._zoom.end = [xpos, ypos];
+ }
+ var sel = window.getSelection;
+ if (document.selection && document.selection.empty)
+ {
+ document.selection.empty();
+ }
+ else if (sel && !sel().isCollapsed) {
+ sel().collapse();
+ }
+ drawZoomBox.call(c);
+ ctx = null;
+ }
+ }
+
+ function handleMouseDown(ev, gridpos, datapos, neighbor, plot) {
+ var c = plot.plugins.cursor;
+ if(plot.plugins.mobile){
+ $(document).one('vmouseup.jqplot_cursor', {plot:plot}, handleMouseUp);
+ } else {
+ $(document).one('mouseup.jqplot_cursor', {plot:plot}, handleMouseUp);
+ }
+ var axes = plot.axes;
+ if (document.onselectstart != undefined) {
+ c._oldHandlers.onselectstart = document.onselectstart;
+ document.onselectstart = function () { return false; };
+ }
+ if (document.ondrag != undefined) {
+ c._oldHandlers.ondrag = document.ondrag;
+ document.ondrag = function () { return false; };
+ }
+ if (document.onmousedown != undefined) {
+ c._oldHandlers.onmousedown = document.onmousedown;
+ document.onmousedown = function () { return false; };
+ }
+ if (c.zoom) {
+ if (!c.zoomProxy) {
+ var ctx = c.zoomCanvas._ctx;
+ ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height);
+ ctx = null;
+ }
+ if (c.constrainZoomTo == 'x') {
+ c._zoom.start = [gridpos.x, 0];
+ }
+ else if (c.constrainZoomTo == 'y') {
+ c._zoom.start = [0, gridpos.y];
+ }
+ else {
+ c._zoom.start = [gridpos.x, gridpos.y];
+ }
+ c._zoom.started = true;
+ for (var ax in datapos) {
+ // get zoom starting position.
+ c._zoom.axes.start[ax] = datapos[ax];
+ }
+ if(plot.plugins.mobile){
+ $(document).bind('vmousemove.jqplotCursor', {plot:plot}, handleZoomMove);
+ } else {
+ $(document).bind('mousemove.jqplotCursor', {plot:plot}, handleZoomMove);
+ }
+
+ }
+ }
+
+ function handleMouseUp(ev) {
+ var plot = ev.data.plot;
+ var c = plot.plugins.cursor;
+ if (c.zoom && c._zoom.zooming && !c.zoomTarget) {
+ var xpos = c._zoom.gridpos.x;
+ var ypos = c._zoom.gridpos.y;
+ var datapos = c._zoom.datapos;
+ var height = c.zoomCanvas._ctx.canvas.height;
+ var width = c.zoomCanvas._ctx.canvas.width;
+ var axes = plot.axes;
+
+ if (c.constrainOutsideZoom && !c.onGrid) {
+ if (xpos < 0) { xpos = 0; }
+ else if (xpos > width) { xpos = width; }
+ if (ypos < 0) { ypos = 0; }
+ else if (ypos > height) { ypos = height; }
+
+ for (var axis in datapos) {
+ if (datapos[axis]) {
+ if (axis.charAt(0) == 'x') {
+ datapos[axis] = axes[axis].series_p2u(xpos);
+ }
+ else {
+ datapos[axis] = axes[axis].series_p2u(ypos);
+ }
+ }
+ }
+ }
+
+ if (c.constrainZoomTo == 'x') {
+ ypos = height;
+ }
+ else if (c.constrainZoomTo == 'y') {
+ xpos = width;
+ }
+ c._zoom.end = [xpos, ypos];
+ c._zoom.gridpos = {x:xpos, y:ypos};
+
+ c.doZoom(c._zoom.gridpos, datapos, plot, c);
+ }
+ c._zoom.started = false;
+ c._zoom.zooming = false;
+
+ $(document).unbind('mousemove.jqplotCursor', handleZoomMove);
+
+ if (document.onselectstart != undefined && c._oldHandlers.onselectstart != null){
+ document.onselectstart = c._oldHandlers.onselectstart;
+ c._oldHandlers.onselectstart = null;
+ }
+ if (document.ondrag != undefined && c._oldHandlers.ondrag != null){
+ document.ondrag = c._oldHandlers.ondrag;
+ c._oldHandlers.ondrag = null;
+ }
+ if (document.onmousedown != undefined && c._oldHandlers.onmousedown != null){
+ document.onmousedown = c._oldHandlers.onmousedown;
+ c._oldHandlers.onmousedown = null;
+ }
+
+ }
+
+ function drawZoomBox() {
+ var start = this._zoom.start;
+ var end = this._zoom.end;
+ var ctx = this.zoomCanvas._ctx;
+ var l, t, h, w;
+ if (end[0] > start[0]) {
+ l = start[0];
+ w = end[0] - start[0];
+ }
+ else {
+ l = end[0];
+ w = start[0] - end[0];
+ }
+ if (end[1] > start[1]) {
+ t = start[1];
+ h = end[1] - start[1];
+ }
+ else {
+ t = end[1];
+ h = start[1] - end[1];
+ }
+ ctx.fillStyle = 'rgba(0,0,0,0.2)';
+ ctx.strokeStyle = '#999999';
+ ctx.lineWidth = 1.0;
+ ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height);
+ ctx.fillRect(0,0,ctx.canvas.width, ctx.canvas.height);
+ ctx.clearRect(l, t, w, h);
+ // IE won't show transparent fill rect, so stroke a rect also.
+ ctx.strokeRect(l,t,w,h);
+ ctx = null;
+ }
+
+ $.jqplot.CursorLegendRenderer = function(options) {
+ $.jqplot.TableLegendRenderer.call(this, options);
+ this.formatString = '%s';
+ };
+
+ $.jqplot.CursorLegendRenderer.prototype = new $.jqplot.TableLegendRenderer();
+ $.jqplot.CursorLegendRenderer.prototype.constructor = $.jqplot.CursorLegendRenderer;
+
+ // called in context of a Legend
+ $.jqplot.CursorLegendRenderer.prototype.draw = function() {
+ if (this._elem) {
+ this._elem.emptyForce();
+ this._elem = null;
+ }
+ if (this.show) {
+ var series = this._series, s;
+ // make a table. one line label per row.
+ var elem = document.createElement('div');
+ this._elem = $(elem);
+ elem = null;
+ this._elem.addClass('jqplot-legend jqplot-cursor-legend');
+ this._elem.css('position', 'absolute');
+
+ var pad = false;
+ for (var i = 0; i< series.length; i++) {
+ s = series[i];
+ if (s.show && s.showLabel) {
+ var lt = $.jqplot.sprintf(this.formatString, s.label.toString());
+ if (lt) {
+ var color = s.color;
+ if (s._stack && !s.fill) {
+ color = '';
+ }
+ addrow.call(this, lt, color, pad, i);
+ pad = true;
+ }
+ // let plugins add more rows to legend. Used by trend line plugin.
+ for (var j=0; j<$.jqplot.addLegendRowHooks.length; j++) {
+ var item = $.jqplot.addLegendRowHooks[j].call(this, s);
+ if (item) {
+ addrow.call(this, item.label, item.color, pad);
+ pad = true;
+ }
+ }
+ }
+ }
+ series = s = null;
+ delete series;
+ delete s;
+ }
+
+ function addrow(label, color, pad, idx) {
+ var rs = (pad) ? this.rowSpacing : '0';
+ var tr = $('<tr class="jqplot-legend jqplot-cursor-legend"></tr>').appendTo(this._elem);
+ tr.data('seriesIndex', idx);
+ $('<td class="jqplot-legend jqplot-cursor-legend-swatch" style="padding-top:'+rs+';">'+
+ '<div style="border:1px solid #cccccc;padding:0.2em;">'+
+ '<div class="jqplot-cursor-legend-swatch" style="background-color:'+color+';"></div>'+
+ '</div></td>').appendTo(tr);
+ var td = $('<td class="jqplot-legend jqplot-cursor-legend-label" style="vertical-align:middle;padding-top:'+rs+';"></td>');
+ td.appendTo(tr);
+ td.data('seriesIndex', idx);
+ if (this.escapeHtml) {
+ td.text(label);
+ }
+ else {
+ td.html(label);
+ }
+ tr = null;
+ td = null;
+ }
+ return this._elem;
+ };
+
+})(jQuery);
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.dateAxisRenderer.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.dateAxisRenderer.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.dateAxisRenderer.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,760 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ */
+(function($) {
+ /**
+ * Class: $.jqplot.DateAxisRenderer
+ * A plugin for a jqPlot to render an axis as a series of date values.
+ * This renderer has no options beyond those supplied by the <Axis> class.
+ * It supplies it's own tick formatter, so the tickOptions.formatter option
+ * should not be overridden.
+ *
+ * Thanks to Ken Synder for his enhanced Date instance methods which are
+ * included with this code <http://kendsnyder.com/sandbox/date/>.
+ *
+ * To use this renderer, include the plugin in your source
+ * > <script type="text/javascript" language="javascript" src="plugins/jqplot.dateAxisRenderer.js"></script>
+ *
+ * and supply the appropriate options to your plot
+ *
+ * > {axes:{xaxis:{renderer:$.jqplot.DateAxisRenderer}}}
+ *
+ * Dates can be passed into the axis in almost any recognizable value and
+ * will be parsed. They will be rendered on the axis in the format
+ * specified by tickOptions.formatString. e.g. tickOptions.formatString = '%Y-%m-%d'.
+ *
+ * Accecptable format codes
+ * are:
+ *
+ * > Code Result Description
+ * > == Years ==
+ * > %Y 2008 Four-digit year
+ * > %y 08 Two-digit year
+ * > == Months ==
+ * > %m 09 Two-digit month
+ * > %#m 9 One or two-digit month
+ * > %B September Full month name
+ * > %b Sep Abbreviated month name
+ * > == Days ==
+ * > %d 05 Two-digit day of month
+ * > %#d 5 One or two-digit day of month
+ * > %e 5 One or two-digit day of month
+ * > %A Sunday Full name of the day of the week
+ * > %a Sun Abbreviated name of the day of the week
+ * > %w 0 Number of the day of the week (0 = Sunday, 6 = Saturday)
+ * > %o th The ordinal suffix string following the day of the month
+ * > == Hours ==
+ * > %H 23 Hours in 24-hour format (two digits)
+ * > %#H 3 Hours in 24-hour integer format (one or two digits)
+ * > %I 11 Hours in 12-hour format (two digits)
+ * > %#I 3 Hours in 12-hour integer format (one or two digits)
+ * > %p PM AM or PM
+ * > == Minutes ==
+ * > %M 09 Minutes (two digits)
+ * > %#M 9 Minutes (one or two digits)
+ * > == Seconds ==
+ * > %S 02 Seconds (two digits)
+ * > %#S 2 Seconds (one or two digits)
+ * > %s 1206567625723 Unix timestamp (Seconds past 1970-01-01 00:00:00)
+ * > == Milliseconds ==
+ * > %N 008 Milliseconds (three digits)
+ * > %#N 8 Milliseconds (one to three digits)
+ * > == Timezone ==
+ * > %O 360 difference in minutes between local time and GMT
+ * > %Z Mountain Standard Time Name of timezone as reported by browser
+ * > %G -06:00 Hours and minutes between GMT
+ * > == Shortcuts ==
+ * > %F 2008-03-26 %Y-%m-%d
+ * > %T 05:06:30 %H:%M:%S
+ * > %X 05:06:30 %H:%M:%S
+ * > %x 03/26/08 %m/%d/%y
+ * > %D 03/26/08 %m/%d/%y
+ * > %#c Wed Mar 26 15:31:00 2008 %a %b %e %H:%M:%S %Y
+ * > %v 3-Sep-2008 %e-%b-%Y
+ * > %R 15:31 %H:%M
+ * > %r 3:31:00 PM %I:%M:%S %p
+ * > == Characters ==
+ * > %n \n Newline
+ * > %t \t Tab
+ * > %% % Percent Symbol
+ */
+ $.jqplot.DateAxisRenderer = function() {
+ $.jqplot.LinearAxisRenderer.call(this);
+ this.date = new $.jsDate();
+ };
+
+ var second = 1000;
+ var minute = 60 * second;
+ var hour = 60 * minute;
+ var day = 24 * hour;
+ var week = 7 * day;
+
+ // these are less definitive
+ var month = 30.4368499 * day;
+ var year = 365.242199 * day;
+
+ var daysInMonths = [31,28,31,30,31,30,31,30,31,30,31,30];
+ // array of consistent nice intervals. Longer intervals
+ // will depend on days in month, days in year, etc.
+ var niceFormatStrings = ['%M:%S.%#N', '%M:%S.%#N', '%M:%S.%#N', '%M:%S', '%M:%S', '%M:%S', '%M:%S', '%H:%M:%S', '%H:%M:%S', '%H:%M', '%H:%M', '%H:%M', '%H:%M', '%H:%M', '%H:%M', '%a %H:%M', '%a %H:%M', '%b %e %H:%M', '%b %e %H:%M', '%b %e %H:%M', '%b %e %H:%M', '%v', '%v', '%v', '%v', '%v', '%v', '%v'];
+ var niceIntervals = [0.1*second, 0.2*second, 0.5*second, second, 2*second, 5*second, 10*second, 15*second, 30*second, minute, 2*minute, 5*minute, 10*minute, 15*minute, 30*minute, hour, 2*hour, 4*hour, 6*hour, 8*hour, 12*hour, day, 2*day, 3*day, 4*day, 5*day, week, 2*week];
+
+ var niceMonthlyIntervals = [];
+
+ function bestDateInterval(min, max, titarget) {
+ // iterate through niceIntervals to find one closest to titarget
+ var badness = Number.MAX_VALUE;
+ var temp, bestTi, bestfmt;
+ for (var i=0, l=niceIntervals.length; i < l; i++) {
+ temp = Math.abs(titarget - niceIntervals[i]);
+ if (temp < badness) {
+ badness = temp;
+ bestTi = niceIntervals[i];
+ bestfmt = niceFormatStrings[i];
+ }
+ }
+
+ return [bestTi, bestfmt];
+ }
+
+ $.jqplot.DateAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer();
+ $.jqplot.DateAxisRenderer.prototype.constructor = $.jqplot.DateAxisRenderer;
+
+ $.jqplot.DateTickFormatter = function(format, val) {
+ if (!format) {
+ format = '%Y/%m/%d';
+ }
+ return $.jsDate.strftime(val, format);
+ };
+
+ $.jqplot.DateAxisRenderer.prototype.init = function(options){
+ // prop: tickRenderer
+ // A class of a rendering engine for creating the ticks labels displayed on the plot,
+ // See <$.jqplot.AxisTickRenderer>.
+ // this.tickRenderer = $.jqplot.AxisTickRenderer;
+ // this.labelRenderer = $.jqplot.AxisLabelRenderer;
+ this.tickOptions.formatter = $.jqplot.DateTickFormatter;
+ // prop: tickInset
+ // Controls the amount to inset the first and last ticks from
+ // the edges of the grid, in multiples of the tick interval.
+ // 0 is no inset, 0.5 is one half a tick interval, 1 is a full
+ // tick interval, etc.
+ this.tickInset = 0;
+ // prop: drawBaseline
+ // True to draw the axis baseline.
+ this.drawBaseline = true;
+ // prop: baselineWidth
+ // width of the baseline in pixels.
+ this.baselineWidth = null;
+ // prop: baselineColor
+ // CSS color spec for the baseline.
+ this.baselineColor = null;
+ this.daTickInterval = null;
+ this._daTickInterval = null;
+
+ $.extend(true, this, options);
+
+ var db = this._dataBounds,
+ stats,
+ sum,
+ s,
+ d,
+ pd,
+ sd,
+ intv;
+
+ // Go through all the series attached to this axis and find
+ // the min/max bounds for this axis.
+ for (var i=0; i<this._series.length; i++) {
+ stats = {intervals:[], frequencies:{}, sortedIntervals:[], min:null, max:null, mean:null};
+ sum = 0;
+ s = this._series[i];
+ d = s.data;
+ pd = s._plotData;
+ sd = s._stackData;
+ intv = 0;
+
+ for (var j=0; j<d.length; j++) {
+ if (this.name == 'xaxis' || this.name == 'x2axis') {
+ d[j][0] = new $.jsDate(d[j][0]).getTime();
+ pd[j][0] = new $.jsDate(d[j][0]).getTime();
+ sd[j][0] = new $.jsDate(d[j][0]).getTime();
+ if ((d[j][0] != null && d[j][0] < db.min) || db.min == null) {
+ db.min = d[j][0];
+ }
+ if ((d[j][0] != null && d[j][0] > db.max) || db.max == null) {
+ db.max = d[j][0];
+ }
+ if (j>0) {
+ intv = Math.abs(d[j][0] - d[j-1][0]);
+ stats.intervals.push(intv);
+ if (stats.frequencies.hasOwnProperty(intv)) {
+ stats.frequencies[intv] += 1;
+ }
+ else {
+ stats.frequencies[intv] = 1;
+ }
+ }
+ sum += intv;
+
+ }
+ else {
+ d[j][1] = new $.jsDate(d[j][1]).getTime();
+ pd[j][1] = new $.jsDate(d[j][1]).getTime();
+ sd[j][1] = new $.jsDate(d[j][1]).getTime();
+ if ((d[j][1] != null && d[j][1] < db.min) || db.min == null) {
+ db.min = d[j][1];
+ }
+ if ((d[j][1] != null && d[j][1] > db.max) || db.max == null) {
+ db.max = d[j][1];
+ }
+ if (j>0) {
+ intv = Math.abs(d[j][1] - d[j-1][1]);
+ stats.intervals.push(intv);
+ if (stats.frequencies.hasOwnProperty(intv)) {
+ stats.frequencies[intv] += 1;
+ }
+ else {
+ stats.frequencies[intv] = 1;
+ }
+ }
+ }
+ sum += intv;
+ }
+
+ if (s.renderer.bands) {
+ if (s.renderer.bands.hiData.length) {
+ var bd = s.renderer.bands.hiData;
+ for (var j=0, l=bd.length; j < l; j++) {
+ if (this.name === 'xaxis' || this.name === 'x2axis') {
+ bd[j][0] = new $.jsDate(bd[j][0]).getTime();
+ if ((bd[j][0] != null && bd[j][0] > db.max) || db.max == null) {
+ db.max = bd[j][0];
+ }
+ }
+ else {
+ bd[j][1] = new $.jsDate(bd[j][1]).getTime();
+ if ((bd[j][1] != null && bd[j][1] > db.max) || db.max == null) {
+ db.max = bd[j][1];
+ }
+ }
+ }
+ }
+ if (s.renderer.bands.lowData.length) {
+ var bd = s.renderer.bands.lowData;
+ for (var j=0, l=bd.length; j < l; j++) {
+ if (this.name === 'xaxis' || this.name === 'x2axis') {
+ bd[j][0] = new $.jsDate(bd[j][0]).getTime();
+ if ((bd[j][0] != null && bd[j][0] < db.min) || db.min == null) {
+ db.min = bd[j][0];
+ }
+ }
+ else {
+ bd[j][1] = new $.jsDate(bd[j][1]).getTime();
+ if ((bd[j][1] != null && bd[j][1] < db.min) || db.min == null) {
+ db.min = bd[j][1];
+ }
+ }
+ }
+ }
+ }
+
+ var tempf = 0,
+ tempn=0;
+ for (var n in stats.frequencies) {
+ stats.sortedIntervals.push({interval:n, frequency:stats.frequencies[n]});
+ }
+ stats.sortedIntervals.sort(function(a, b){
+ return b.frequency - a.frequency;
+ });
+
+ stats.min = $.jqplot.arrayMin(stats.intervals);
+ stats.max = $.jqplot.arrayMax(stats.intervals);
+ stats.mean = sum/d.length;
+ this._intervalStats.push(stats);
+ stats = sum = s = d = pd = sd = null;
+ }
+ db = null;
+
+ };
+
+ // called with scope of an axis
+ $.jqplot.DateAxisRenderer.prototype.reset = function() {
+ this.min = this._options.min;
+ this.max = this._options.max;
+ this.tickInterval = this._options.tickInterval;
+ this.numberTicks = this._options.numberTicks;
+ this._autoFormatString = '';
+ if (this._overrideFormatString && this.tickOptions && this.tickOptions.formatString) {
+ this.tickOptions.formatString = '';
+ }
+ this.daTickInterval = this._daTickInterval;
+ // this._ticks = this.__ticks;
+ };
+
+ $.jqplot.DateAxisRenderer.prototype.createTicks = function(plot) {
+ // we're are operating on an axis here
+ var ticks = this._ticks;
+ var userTicks = this.ticks;
+ var name = this.name;
+ // databounds were set on axis initialization.
+ var db = this._dataBounds;
+ var iv = this._intervalStats;
+ var dim = (this.name.charAt(0) === 'x') ? this._plotDimensions.width : this._plotDimensions.height;
+ var interval;
+ var min, max;
+ var pos1, pos2;
+ var tt, i;
+ var threshold = 30;
+ var insetMult = 1;
+
+ var tickInterval = this.tickInterval;
+
+ // if we already have ticks, use them.
+ // ticks must be in order of increasing value.
+
+ min = ((this.min != null) ? new $.jsDate(this.min).getTime() : db.min);
+ max = ((this.max != null) ? new $.jsDate(this.max).getTime() : db.max);
+
+ // see if we're zooming. if we are, don't use the min and max we're given,
+ // but compute some nice ones. They will be reset later.
+
+ var cursor = plot.plugins.cursor;
+
+ if (cursor && cursor._zoom && cursor._zoom.zooming) {
+ this.min = null;
+ this.max = null;
+ }
+
+ var range = max - min;
+
+ if (this.tickOptions == null || !this.tickOptions.formatString) {
+ this._overrideFormatString = true;
+ }
+
+ if (userTicks.length) {
+ // ticks could be 1D or 2D array of [val, val, ,,,] or [[val, label], [val, label], ...] or mixed
+ for (i=0; i<userTicks.length; i++){
+ var ut = userTicks[i];
+ var t = new this.tickRenderer(this.tickOptions);
+ if (ut.constructor == Array) {
+ t.value = new $.jsDate(ut[0]).getTime();
+ t.label = ut[1];
+ if (!this.showTicks) {
+ t.showLabel = false;
+ t.showMark = false;
+ }
+ else if (!this.showTickMarks) {
+ t.showMark = false;
+ }
+ t.setTick(t.value, this.name);
+ this._ticks.push(t);
+ }
+
+ else {
+ t.value = new $.jsDate(ut).getTime();
+ if (!this.showTicks) {
+ t.showLabel = false;
+ t.showMark = false;
+ }
+ else if (!this.showTickMarks) {
+ t.showMark = false;
+ }
+ t.setTick(t.value, this.name);
+ this._ticks.push(t);
+ }
+ }
+ this.numberTicks = userTicks.length;
+ this.min = this._ticks[0].value;
+ this.max = this._ticks[this.numberTicks-1].value;
+ this.daTickInterval = [(this.max - this.min) / (this.numberTicks - 1)/1000, 'seconds'];
+ }
+
+ ////////
+ // We don't have any ticks yet, let's make some!
+ ////////
+
+ // special case when there is only one point, make three tick marks to center the point
+ else if (this.min == null && this.max == null && db.min == db.max)
+ {
+ var onePointOpts = $.extend(true, {}, this.tickOptions, {name: this.name, value: null});
+ var delta = 300000;
+ this.min = db.min - delta;
+ this.max = db.max + delta;
+ this.numberTicks = 3;
+
+ for(var i=this.min;i<=this.max;i+= delta)
+ {
+ onePointOpts.value = i;
+
+ var t = new this.tickRenderer(onePointOpts);
+
+ if (this._overrideFormatString && this._autoFormatString != '') {
+ t.formatString = this._autoFormatString;
+ }
+
+ t.showLabel = false;
+ t.showMark = false;
+
+ this._ticks.push(t);
+ }
+
+ if(this.showTicks) {
+ this._ticks[1].showLabel = true;
+ }
+ if(this.showTickMarks) {
+ this._ticks[1].showTickMarks = true;
+ }
+ }
+ // if user specified min and max are null, we set those to make best ticks.
+ else if (this.min == null && this.max == null) {
+
+ var opts = $.extend(true, {}, this.tickOptions, {name: this.name, value: null});
+
+ // want to find a nice interval
+ var nttarget,
+ titarget;
+
+ // if no tickInterval or numberTicks options specified, make a good guess.
+ if (!this.tickInterval && !this.numberTicks) {
+ var tdim = Math.max(dim, threshold+1);
+ // how many ticks to put on the axis?
+ // date labels tend to be long. If ticks not rotated,
+ // don't use too many and have a high spacing factor.
+ // If we are rotating ticks, use a lower factor.
+ var spacingFactor = 115;
+ if (this.tickRenderer === $.jqplot.CanvasAxisTickRenderer && this.tickOptions.angle) {
+ spacingFactor = 115 - 40 * Math.abs(Math.sin(this.tickOptions.angle/180*Math.PI));
+ }
+
+ nttarget = Math.ceil((tdim-threshold)/spacingFactor + 1);
+ titarget = (max - min) / (nttarget - 1);
+ }
+
+ // If tickInterval is specified, we'll try to honor it.
+ // Not gauranteed to get this interval, but we'll get as close as
+ // we can.
+ // tickInterval will be used before numberTicks, that is if
+ // both are specified, numberTicks will be ignored.
+ else if (this.tickInterval) {
+ titarget = this.tickInterval;
+ }
+
+ // if numberTicks specified, try to honor it.
+ // Not gauranteed, but will try to get close.
+ else if (this.numberTicks) {
+ nttarget = this.numberTicks;
+ titarget = (max - min) / (nttarget - 1);
+ }
+
+ // If we can use an interval of 2 weeks or less, pick best one
+ if (titarget <= 19*day) {
+ var ret = bestDateInterval(min, max, titarget);
+ var tempti = ret[0];
+ this._autoFormatString = ret[1];
+
+ min = Math.floor(min/tempti) * tempti;
+ min = new $.jsDate(min);
+ min = min.getTime() + min.getUtcOffset();
+
+ nttarget = Math.ceil((max - min) / tempti) + 1;
+ this.min = min;
+ this.max = min + (nttarget - 1) * tempti;
+
+ // if max is less than max, add an interval
+ if (this.max < max) {
+ this.max += tempti;
+ nttarget += 1;
+ }
+ this.tickInterval = tempti;
+ this.numberTicks = nttarget;
+
+ for (var i=0; i<nttarget; i++) {
+ opts.value = this.min + i * tempti;
+ t = new this.tickRenderer(opts);
+
+ if (this._overrideFormatString && this._autoFormatString != '') {
+ t.formatString = this._autoFormatString;
+ }
+ if (!this.showTicks) {
+ t.showLabel = false;
+ t.showMark = false;
+ }
+ else if (!this.showTickMarks) {
+ t.showMark = false;
+ }
+ this._ticks.push(t);
+ }
+
+ insetMult = this.tickInterval;
+ }
+
+ // should we use a monthly interval?
+ else if (titarget <= 9 * month) {
+
+ this._autoFormatString = '%v';
+
+ // how many months in an interval?
+ var intv = Math.round(titarget/month);
+ if (intv < 1) {
+ intv = 1;
+ }
+ else if (intv > 6) {
+ intv = 6;
+ }
+
+ // figure out the starting month and ending month.
+ var mstart = new $.jsDate(min).setDate(1).setHours(0,0,0,0);
+
+ // See if max ends exactly on a month
+ var tempmend = new $.jsDate(max);
+ var mend = new $.jsDate(max).setDate(1).setHours(0,0,0,0);
+
+ if (tempmend.getTime() !== mend.getTime()) {
+ mend = mend.add(1, 'month');
+ }
+
+ var nmonths = mend.diff(mstart, 'month');
+
+ nttarget = Math.ceil(nmonths/intv) + 1;
+
+ this.min = mstart.getTime();
+ this.max = mstart.clone().add((nttarget - 1) * intv, 'month').getTime();
+ this.numberTicks = nttarget;
+
+ for (var i=0; i<nttarget; i++) {
+ if (i === 0) {
+ opts.value = mstart.getTime();
+ }
+ else {
+ opts.value = mstart.add(intv, 'month').getTime();
+ }
+ t = new this.tickRenderer(opts);
+
+ if (this._overrideFormatString && this._autoFormatString != '') {
+ t.formatString = this._autoFormatString;
+ }
+ if (!this.showTicks) {
+ t.showLabel = false;
+ t.showMark = false;
+ }
+ else if (!this.showTickMarks) {
+ t.showMark = false;
+ }
+ this._ticks.push(t);
+ }
+
+ insetMult = intv * month;
+ }
+
+ // use yearly intervals
+ else {
+
+ this._autoFormatString = '%v';
+
+ // how many years in an interval?
+ var intv = Math.round(titarget/year);
+ if (intv < 1) {
+ intv = 1;
+ }
+
+ // figure out the starting and ending years.
+ var mstart = new $.jsDate(min).setMonth(0, 1).setHours(0,0,0,0);
+ var mend = new $.jsDate(max).add(1, 'year').setMonth(0, 1).setHours(0,0,0,0);
+
+ var nyears = mend.diff(mstart, 'year');
+
+ nttarget = Math.ceil(nyears/intv) + 1;
+
+ this.min = mstart.getTime();
+ this.max = mstart.clone().add((nttarget - 1) * intv, 'year').getTime();
+ this.numberTicks = nttarget;
+
+ for (var i=0; i<nttarget; i++) {
+ if (i === 0) {
+ opts.value = mstart.getTime();
+ }
+ else {
+ opts.value = mstart.add(intv, 'year').getTime();
+ }
+ t = new this.tickRenderer(opts);
+
+ if (this._overrideFormatString && this._autoFormatString != '') {
+ t.formatString = this._autoFormatString;
+ }
+ if (!this.showTicks) {
+ t.showLabel = false;
+ t.showMark = false;
+ }
+ else if (!this.showTickMarks) {
+ t.showMark = false;
+ }
+ this._ticks.push(t);
+ }
+
+ insetMult = intv * year;
+ }
+ }
+
+ ////////
+ // Some option(s) specified, work around that.
+ ////////
+
+ else {
+ if (name == 'xaxis' || name == 'x2axis') {
+ dim = this._plotDimensions.width;
+ }
+ else {
+ dim = this._plotDimensions.height;
+ }
+
+ // if min, max and number of ticks specified, user can't specify interval.
+ if (this.min != null && this.max != null && this.numberTicks != null) {
+ this.tickInterval = null;
+ }
+
+ // if user specified a tick interval, convert to usable.
+ if (this.tickInterval != null)
+ {
+ // if interval is a number or can be converted to one, use it.
+ // Assume it is in SECONDS!!!
+ if (Number(this.tickInterval)) {
+ this.daTickInterval = [Number(this.tickInterval), 'seconds'];
+ }
+ // else, parse out something we can build from.
+ else if (typeof this.tickInterval == "string") {
+ var parts = this.tickInterval.split(' ');
+ if (parts.length == 1) {
+ this.daTickInterval = [1, parts[0]];
+ }
+ else if (parts.length == 2) {
+ this.daTickInterval = [parts[0], parts[1]];
+ }
+ }
+ }
+
+ // if min and max are same, space them out a bit
+ if (min == max) {
+ var adj = 24*60*60*500; // 1/2 day
+ min -= adj;
+ max += adj;
+ }
+
+ range = max - min;
+
+ var optNumTicks = 2 + parseInt(Math.max(0, dim-100)/100, 10);
+
+
+ var rmin, rmax;
+
+ rmin = (this.min != null) ? new $.jsDate(this.min).getTime() : min - range/2*(this.padMin - 1);
+ rmax = (this.max != null) ? new $.jsDate(this.max).getTime() : max + range/2*(this.padMax - 1);
+ this.min = rmin;
+ this.max = rmax;
+ range = this.max - this.min;
+
+ if (this.numberTicks == null){
+ // if tickInterval is specified by user, we will ignore computed maximum.
+ // max will be equal or greater to fit even # of ticks.
+ if (this.daTickInterval != null) {
+ var nc = new $.jsDate(this.max).diff(this.min, this.daTickInterval[1], true);
+ this.numberTicks = Math.ceil(nc/this.daTickInterval[0]) +1;
+ // this.max = new $.jsDate(this.min).add(this.numberTicks-1, this.daTickInterval[1]).getTime();
+ this.max = new $.jsDate(this.min).add((this.numberTicks-1) * this.daTickInterval[0], this.daTickInterval[1]).getTime();
+ }
+ else if (dim > 200) {
+ this.numberTicks = parseInt(3+(dim-200)/100, 10);
+ }
+ else {
+ this.numberTicks = 2;
+ }
+ }
+
+ insetMult = range / (this.numberTicks-1)/1000;
+
+ if (this.daTickInterval == null) {
+ this.daTickInterval = [insetMult, 'seconds'];
+ }
+
+
+ for (var i=0; i<this.numberTicks; i++){
+ var min = new $.jsDate(this.min);
+ tt = min.add(i*this.daTickInterval[0], this.daTickInterval[1]).getTime();
+ var t = new this.tickRenderer(this.tickOptions);
+ // var t = new $.jqplot.AxisTickRenderer(this.tickOptions);
+ if (!this.showTicks) {
+ t.showLabel = false;
+ t.showMark = false;
+ }
+ else if (!this.showTickMarks) {
+ t.showMark = false;
+ }
+ t.setTick(tt, this.name);
+ this._ticks.push(t);
+ }
+ }
+
+ if (this.tickInset) {
+ this.min = this.min - this.tickInset * insetMult;
+ this.max = this.max + this.tickInset * insetMult;
+ }
+
+ if (this._daTickInterval == null) {
+ this._daTickInterval = this.daTickInterval;
+ }
+
+ ticks = null;
+ };
+
+})(jQuery);
+
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.donutRenderer.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.donutRenderer.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.donutRenderer.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,828 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ */
+(function($) {
+ /**
+ * Class: $.jqplot.DonutRenderer
+ * Plugin renderer to draw a donut chart.
+ * x values, if present, will be used as slice labels.
+ * y values give slice size.
+ *
+ * To use this renderer, you need to include the
+ * donut renderer plugin, for example:
+ *
+ * > <script type="text/javascript" src="plugins/jqplot.donutRenderer.js"></script>
+ *
+ * Properties described here are passed into the $.jqplot function
+ * as options on the series renderer. For example:
+ *
+ * > plot2 = $.jqplot('chart2', [s1, s2], {
+ * > seriesDefaults: {
+ * > renderer:$.jqplot.DonutRenderer,
+ * > rendererOptions:{
+ * > sliceMargin: 2,
+ * > innerDiameter: 110,
+ * > startAngle: -90
+ * > }
+ * > }
+ * > });
+ *
+ * A donut plot will trigger events on the plot target
+ * according to user interaction. All events return the event object,
+ * the series index, the point (slice) index, and the point data for
+ * the appropriate slice.
+ *
+ * 'jqplotDataMouseOver' - triggered when user mouseing over a slice.
+ * 'jqplotDataHighlight' - triggered the first time user mouses over a slice,
+ * if highlighting is enabled.
+ * 'jqplotDataUnhighlight' - triggered when a user moves the mouse out of
+ * a highlighted slice.
+ * 'jqplotDataClick' - triggered when the user clicks on a slice.
+ * 'jqplotDataRightClick' - tiggered when the user right clicks on a slice if
+ * the "captureRightClick" option is set to true on the plot.
+ */
+ $.jqplot.DonutRenderer = function(){
+ $.jqplot.LineRenderer.call(this);
+ };
+
+ $.jqplot.DonutRenderer.prototype = new $.jqplot.LineRenderer();
+ $.jqplot.DonutRenderer.prototype.constructor = $.jqplot.DonutRenderer;
+
+ // called with scope of a series
+ $.jqplot.DonutRenderer.prototype.init = function(options, plot) {
+ // Group: Properties
+ //
+ // prop: diameter
+ // Outer diameter of the donut, auto computed by default
+ this.diameter = null;
+ // prop: innerDiameter
+ // Inner diameter of the donut, auto calculated by default.
+ // If specified will override thickness value.
+ this.innerDiameter = null;
+ // prop: thickness
+ // thickness of the donut, auto computed by default
+ // Overridden by if innerDiameter is specified.
+ this.thickness = null;
+ // prop: padding
+ // padding between the donut and plot edges, legend, etc.
+ this.padding = 20;
+ // prop: sliceMargin
+ // angular spacing between donut slices in degrees.
+ this.sliceMargin = 0;
+ // prop: ringMargin
+ // pixel distance between rings, or multiple series in a donut plot.
+ // null will compute ringMargin based on sliceMargin.
+ this.ringMargin = null;
+ // prop: fill
+ // true or false, wether to fil the slices.
+ this.fill = true;
+ // prop: shadowOffset
+ // offset of the shadow from the slice and offset of
+ // each succesive stroke of the shadow from the last.
+ this.shadowOffset = 2;
+ // prop: shadowAlpha
+ // transparency of the shadow (0 = transparent, 1 = opaque)
+ this.shadowAlpha = 0.07;
+ // prop: shadowDepth
+ // number of strokes to apply to the shadow,
+ // each stroke offset shadowOffset from the last.
+ this.shadowDepth = 5;
+ // prop: highlightMouseOver
+ // True to highlight slice when moused over.
+ // This must be false to enable highlightMouseDown to highlight when clicking on a slice.
+ this.highlightMouseOver = true;
+ // prop: highlightMouseDown
+ // True to highlight when a mouse button is pressed over a slice.
+ // This will be disabled if highlightMouseOver is true.
+ this.highlightMouseDown = false;
+ // prop: highlightColors
+ // an array of colors to use when highlighting a slice.
+ this.highlightColors = [];
+ // prop: dataLabels
+ // Either 'label', 'value', 'percent' or an array of labels to place on the pie slices.
+ // Defaults to percentage of each pie slice.
+ this.dataLabels = 'percent';
+ // prop: showDataLabels
+ // true to show data labels on slices.
+ this.showDataLabels = false;
+ // prop: dataLabelFormatString
+ // Format string for data labels. If none, '%s' is used for "label" and for arrays, '%d' for value and '%d%%' for percentage.
+ this.dataLabelFormatString = null;
+ // prop: dataLabelThreshold
+ // Threshhold in percentage (0 - 100) of pie area, below which no label will be displayed.
+ // This applies to all label types, not just to percentage labels.
+ this.dataLabelThreshold = 3;
+ // prop: dataLabelPositionFactor
+ // A Multiplier (0-1) of the pie radius which controls position of label on slice.
+ // Increasing will slide label toward edge of pie, decreasing will slide label toward center of pie.
+ this.dataLabelPositionFactor = 0.4;
+ // prop: dataLabelNudge
+ // Number of pixels to slide the label away from (+) or toward (-) the center of the pie.
+ this.dataLabelNudge = 0;
+ // prop: startAngle
+ // Angle to start drawing donut in degrees.
+ // According to orientation of canvas coordinate system:
+ // 0 = on the positive x axis
+ // -90 = on the positive y axis.
+ // 90 = on the negaive y axis.
+ // 180 or - 180 = on the negative x axis.
+ this.startAngle = 0;
+ this.tickRenderer = $.jqplot.DonutTickRenderer;
+ // Used as check for conditions where donut shouldn't be drawn.
+ this._drawData = true;
+ this._type = 'donut';
+
+ // if user has passed in highlightMouseDown option and not set highlightMouseOver, disable highlightMouseOver
+ if (options.highlightMouseDown && options.highlightMouseOver == null) {
+ options.highlightMouseOver = false;
+ }
+
+ $.extend(true, this, options);
+ if (this.diameter != null) {
+ this.diameter = this.diameter - this.sliceMargin;
+ }
+ this._diameter = null;
+ this._innerDiameter = null;
+ this._radius = null;
+ this._innerRadius = null;
+ this._thickness = null;
+ // references to the previous series in the plot to properly calculate diameters
+ // and thicknesses of nested rings.
+ this._previousSeries = [];
+ this._numberSeries = 1;
+ // array of [start,end] angles arrays, one for each slice. In radians.
+ this._sliceAngles = [];
+ // index of the currenty highlighted point, if any
+ this._highlightedPoint = null;
+
+ // set highlight colors if none provided
+ if (this.highlightColors.length == 0) {
+ for (var i=0; i<this.seriesColors.length; i++){
+ var rgba = $.jqplot.getColorComponents(this.seriesColors[i]);
+ var newrgb = [rgba[0], rgba[1], rgba[2]];
+ var sum = newrgb[0] + newrgb[1] + newrgb[2];
+ for (var j=0; j<3; j++) {
+ // when darkening, lowest color component can be is 60.
+ newrgb[j] = (sum > 570) ? newrgb[j] * 0.8 : newrgb[j] + 0.3 * (255 - newrgb[j]);
+ newrgb[j] = parseInt(newrgb[j], 10);
+ }
+ this.highlightColors.push('rgb('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+')');
+ }
+ }
+
+ plot.postParseOptionsHooks.addOnce(postParseOptions);
+ plot.postInitHooks.addOnce(postInit);
+ plot.eventListenerHooks.addOnce('jqplotMouseMove', handleMove);
+ plot.eventListenerHooks.addOnce('jqplotMouseDown', handleMouseDown);
+ plot.eventListenerHooks.addOnce('jqplotMouseUp', handleMouseUp);
+ plot.eventListenerHooks.addOnce('jqplotClick', handleClick);
+ plot.eventListenerHooks.addOnce('jqplotRightClick', handleRightClick);
+ plot.postDrawHooks.addOnce(postPlotDraw);
+
+
+ };
+
+ $.jqplot.DonutRenderer.prototype.setGridData = function(plot) {
+ // set gridData property. This will hold angle in radians of each data point.
+ var stack = [];
+ var td = [];
+ var sa = this.startAngle/180*Math.PI;
+ var tot = 0;
+ // don't know if we have any valid data yet, so set plot to not draw.
+ this._drawData = false;
+ for (var i=0; i<this.data.length; i++){
+ if (this.data[i][1] != 0) {
+ // we have data, O.K. to draw.
+ this._drawData = true;
+ }
+ stack.push(this.data[i][1]);
+ td.push([this.data[i][0]]);
+ if (i>0) {
+ stack[i] += stack[i-1];
+ }
+ tot += this.data[i][1];
+ }
+ var fact = Math.PI*2/stack[stack.length - 1];
+
+ for (var i=0; i<stack.length; i++) {
+ td[i][1] = stack[i] * fact;
+ td[i][2] = this.data[i][1]/tot;
+ }
+ this.gridData = td;
+ };
+
+ $.jqplot.DonutRenderer.prototype.makeGridData = function(data, plot) {
+ var stack = [];
+ var td = [];
+ var tot = 0;
+ var sa = this.startAngle/180*Math.PI;
+ // don't know if we have any valid data yet, so set plot to not draw.
+ this._drawData = false;
+ for (var i=0; i<data.length; i++){
+ if (this.data[i][1] != 0) {
+ // we have data, O.K. to draw.
+ this._drawData = true;
+ }
+ stack.push(data[i][1]);
+ td.push([data[i][0]]);
+ if (i>0) {
+ stack[i] += stack[i-1];
+ }
+ tot += data[i][1];
+ }
+ var fact = Math.PI*2/stack[stack.length - 1];
+
+ for (var i=0; i<stack.length; i++) {
+ td[i][1] = stack[i] * fact;
+ td[i][2] = data[i][1]/tot;
+ }
+ return td;
+ };
+
+ $.jqplot.DonutRenderer.prototype.drawSlice = function (ctx, ang1, ang2, color, isShadow) {
+ var r = this._diameter / 2;
+ var ri = r - this._thickness;
+ var fill = this.fill;
+ // var lineWidth = this.lineWidth;
+ ctx.save();
+ ctx.translate(this._center[0], this._center[1]);
+ // ctx.translate(this.sliceMargin*Math.cos((ang1+ang2)/2), this.sliceMargin*Math.sin((ang1+ang2)/2));
+
+ if (isShadow) {
+ for (var i=0; i<this.shadowDepth; i++) {
+ ctx.save();
+ ctx.translate(this.shadowOffset*Math.cos(this.shadowAngle/180*Math.PI), this.shadowOffset*Math.sin(this.shadowAngle/180*Math.PI));
+ doDraw();
+ }
+ }
+
+ else {
+ doDraw();
+ }
+
+ function doDraw () {
+ // Fix for IE and Chrome that can't seem to draw circles correctly.
+ // ang2 should always be <= 2 pi since that is the way the data is converted.
+ if (ang2 > 6.282 + this.startAngle) {
+ ang2 = 6.282 + this.startAngle;
+ if (ang1 > ang2) {
+ ang1 = 6.281 + this.startAngle;
+ }
+ }
+ // Fix for IE, where it can't seem to handle 0 degree angles. Also avoids
+ // ugly line on unfilled donuts.
+ if (ang1 >= ang2) {
+ return;
+ }
+ ctx.beginPath();
+ ctx.fillStyle = color;
+ ctx.strokeStyle = color;
+ // ctx.lineWidth = lineWidth;
+ ctx.arc(0, 0, r, ang1, ang2, false);
+ ctx.lineTo(ri*Math.cos(ang2), ri*Math.sin(ang2));
+ ctx.arc(0,0, ri, ang2, ang1, true);
+ ctx.closePath();
+ if (fill) {
+ ctx.fill();
+ }
+ else {
+ ctx.stroke();
+ }
+ }
+
+ if (isShadow) {
+ for (var i=0; i<this.shadowDepth; i++) {
+ ctx.restore();
+ }
+ }
+
+ ctx.restore();
+ };
+
+ // called with scope of series
+ $.jqplot.DonutRenderer.prototype.draw = function (ctx, gd, options, plot) {
+ var i;
+ var opts = (options != undefined) ? options : {};
+ // offset and direction of offset due to legend placement
+ var offx = 0;
+ var offy = 0;
+ var trans = 1;
+ // var colorGenerator = new this.colorGenerator(this.seriesColors);
+ if (options.legendInfo && options.legendInfo.placement == 'insideGrid') {
+ var li = options.legendInfo;
+ switch (li.location) {
+ case 'nw':
+ offx = li.width + li.xoffset;
+ break;
+ case 'w':
+ offx = li.width + li.xoffset;
+ break;
+ case 'sw':
+ offx = li.width + li.xoffset;
+ break;
+ case 'ne':
+ offx = li.width + li.xoffset;
+ trans = -1;
+ break;
+ case 'e':
+ offx = li.width + li.xoffset;
+ trans = -1;
+ break;
+ case 'se':
+ offx = li.width + li.xoffset;
+ trans = -1;
+ break;
+ case 'n':
+ offy = li.height + li.yoffset;
+ break;
+ case 's':
+ offy = li.height + li.yoffset;
+ trans = -1;
+ break;
+ default:
+ break;
+ }
+ }
+
+ var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
+ var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine;
+ var fill = (opts.fill != undefined) ? opts.fill : this.fill;
+ var cw = ctx.canvas.width;
+ var ch = ctx.canvas.height;
+ var w = cw - offx - 2 * this.padding;
+ var h = ch - offy - 2 * this.padding;
+ var mindim = Math.min(w,h);
+ var d = mindim;
+ var ringmargin = (this.ringMargin == null) ? this.sliceMargin * 2.0 : this.ringMargin;
+
+ for (var i=0; i<this._previousSeries.length; i++) {
+ d -= 2.0 * this._previousSeries[i]._thickness + 2.0 * ringmargin;
+ }
+ this._diameter = this.diameter || d;
+ if (this.innerDiameter != null) {
+ var od = (this._numberSeries > 1 && this.index > 0) ? this._previousSeries[0]._diameter : this._diameter;
+ this._thickness = this.thickness || (od - this.innerDiameter - 2.0*ringmargin*this._numberSeries) / this._numberSeries/2.0;
+ }
+ else {
+ this._thickness = this.thickness || mindim / 2 / (this._numberSeries + 1) * 0.85;
+ }
+
+ var r = this._radius = this._diameter/2;
+ this._innerRadius = this._radius - this._thickness;
+ var sa = this.startAngle / 180 * Math.PI;
+ this._center = [(cw - trans * offx)/2 + trans * offx, (ch - trans*offy)/2 + trans * offy];
+
+ if (this.shadow) {
+ var shadowColor = 'rgba(0,0,0,'+this.shadowAlpha+')';
+ for (var i=0; i<gd.length; i++) {
+ var ang1 = (i == 0) ? sa : gd[i-1][1] + sa;
+ // Adjust ang1 and ang2 for sliceMargin
+ ang1 += this.sliceMargin/180*Math.PI;
+ this.renderer.drawSlice.call (this, ctx, ang1, gd[i][1]+sa, shadowColor, true);
+ }
+
+ }
+ for (var i=0; i<gd.length; i++) {
+ var ang1 = (i == 0) ? sa : gd[i-1][1] + sa;
+ // Adjust ang1 and ang2 for sliceMargin
+ ang1 += this.sliceMargin/180*Math.PI;
+ var ang2 = gd[i][1] + sa;
+ this._sliceAngles.push([ang1, ang2]);
+ this.renderer.drawSlice.call (this, ctx, ang1, ang2, this.seriesColors[i], false);
+
+ if (this.showDataLabels && gd[i][2]*100 >= this.dataLabelThreshold) {
+ var fstr, avgang = (ang1+ang2)/2, label;
+
+ if (this.dataLabels == 'label') {
+ fstr = this.dataLabelFormatString || '%s';
+ label = $.jqplot.sprintf(fstr, gd[i][0]);
+ }
+ else if (this.dataLabels == 'value') {
+ fstr = this.dataLabelFormatString || '%d';
+ label = $.jqplot.sprintf(fstr, this.data[i][1]);
+ }
+ else if (this.dataLabels == 'percent') {
+ fstr = this.dataLabelFormatString || '%d%%';
+ label = $.jqplot.sprintf(fstr, gd[i][2]*100);
+ }
+ else if (this.dataLabels.constructor == Array) {
+ fstr = this.dataLabelFormatString || '%s';
+ label = $.jqplot.sprintf(fstr, this.dataLabels[i]);
+ }
+
+ var fact = this._innerRadius + this._thickness * this.dataLabelPositionFactor + this.sliceMargin + this.dataLabelNudge;
+
+ var x = this._center[0] + Math.cos(avgang) * fact + this.canvas._offsets.left;
+ var y = this._center[1] + Math.sin(avgang) * fact + this.canvas._offsets.top;
+
+ var labelelem = $('<span class="jqplot-donut-series jqplot-data-label" style="position:absolute;">' + label + '</span>').insertBefore(plot.eventCanvas._elem);
+ x -= labelelem.width()/2;
+ y -= labelelem.height()/2;
+ x = Math.round(x);
+ y = Math.round(y);
+ labelelem.css({left: x, top: y});
+ }
+ }
+
+ };
+
+ $.jqplot.DonutAxisRenderer = function() {
+ $.jqplot.LinearAxisRenderer.call(this);
+ };
+
+ $.jqplot.DonutAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer();
+ $.jqplot.DonutAxisRenderer.prototype.constructor = $.jqplot.DonutAxisRenderer;
+
+
+ // There are no traditional axes on a donut chart. We just need to provide
+ // dummy objects with properties so the plot will render.
+ // called with scope of axis object.
+ $.jqplot.DonutAxisRenderer.prototype.init = function(options){
+ //
+ this.tickRenderer = $.jqplot.DonutTickRenderer;
+ $.extend(true, this, options);
+ // I don't think I'm going to need _dataBounds here.
+ // have to go Axis scaling in a way to fit chart onto plot area
+ // and provide u2p and p2u functionality for mouse cursor, etc.
+ // for convienence set _dataBounds to 0 and 100 and
+ // set min/max to 0 and 100.
+ this._dataBounds = {min:0, max:100};
+ this.min = 0;
+ this.max = 100;
+ this.showTicks = false;
+ this.ticks = [];
+ this.showMark = false;
+ this.show = false;
+ };
+
+
+
+
+ $.jqplot.DonutLegendRenderer = function(){
+ $.jqplot.TableLegendRenderer.call(this);
+ };
+
+ $.jqplot.DonutLegendRenderer.prototype = new $.jqplot.TableLegendRenderer();
+ $.jqplot.DonutLegendRenderer.prototype.constructor = $.jqplot.DonutLegendRenderer;
+
+ /**
+ * Class: $.jqplot.DonutLegendRenderer
+ * Legend Renderer specific to donut plots. Set by default
+ * when user creates a donut plot.
+ */
+ $.jqplot.DonutLegendRenderer.prototype.init = function(options) {
+ // Group: Properties
+ //
+ // prop: numberRows
+ // Maximum number of rows in the legend. 0 or null for unlimited.
+ this.numberRows = null;
+ // prop: numberColumns
+ // Maximum number of columns in the legend. 0 or null for unlimited.
+ this.numberColumns = null;
+ $.extend(true, this, options);
+ };
+
+ // called with context of legend
+ $.jqplot.DonutLegendRenderer.prototype.draw = function() {
+ var legend = this;
+ if (this.show) {
+ var series = this._series;
+ var ss = 'position:absolute;';
+ ss += (this.background) ? 'background:'+this.background+';' : '';
+ ss += (this.border) ? 'border:'+this.border+';' : '';
+ ss += (this.fontSize) ? 'font-size:'+this.fontSize+';' : '';
+ ss += (this.fontFamily) ? 'font-family:'+this.fontFamily+';' : '';
+ ss += (this.textColor) ? 'color:'+this.textColor+';' : '';
+ ss += (this.marginTop != null) ? 'margin-top:'+this.marginTop+';' : '';
+ ss += (this.marginBottom != null) ? 'margin-bottom:'+this.marginBottom+';' : '';
+ ss += (this.marginLeft != null) ? 'margin-left:'+this.marginLeft+';' : '';
+ ss += (this.marginRight != null) ? 'margin-right:'+this.marginRight+';' : '';
+ this._elem = $('<table class="jqplot-table-legend" style="'+ss+'"></table>');
+ // Donut charts legends don't go by number of series, but by number of data points
+ // in the series. Refactor things here for that.
+
+ var pad = false,
+ reverse = false,
+ nr, nc;
+ var s = series[0];
+ var colorGenerator = new $.jqplot.ColorGenerator(s.seriesColors);
+
+ if (s.show) {
+ var pd = s.data;
+ if (this.numberRows) {
+ nr = this.numberRows;
+ if (!this.numberColumns){
+ nc = Math.ceil(pd.length/nr);
+ }
+ else{
+ nc = this.numberColumns;
+ }
+ }
+ else if (this.numberColumns) {
+ nc = this.numberColumns;
+ nr = Math.ceil(pd.length/this.numberColumns);
+ }
+ else {
+ nr = pd.length;
+ nc = 1;
+ }
+
+ var i, j, tr, td1, td2, lt, rs, color;
+ var idx = 0;
+
+ for (i=0; i<nr; i++) {
+ if (reverse){
+ tr = $('<tr class="jqplot-table-legend"></tr>').prependTo(this._elem);
+ }
+ else{
+ tr = $('<tr class="jqplot-table-legend"></tr>').appendTo(this._elem);
+ }
+ for (j=0; j<nc; j++) {
+ if (idx < pd.length){
+ lt = this.labels[idx] || pd[idx][0].toString();
+ color = colorGenerator.next();
+ if (!reverse){
+ if (i>0){
+ pad = true;
+ }
+ else{
+ pad = false;
+ }
+ }
+ else{
+ if (i == nr -1){
+ pad = false;
+ }
+ else{
+ pad = true;
+ }
+ }
+ rs = (pad) ? this.rowSpacing : '0';
+
+ td1 = $('<td class="jqplot-table-legend" style="text-align:center;padding-top:'+rs+';">'+
+ '<div><div class="jqplot-table-legend-swatch" style="border-color:'+color+';"></div>'+
+ '</div></td>');
+ td2 = $('<td class="jqplot-table-legend" style="padding-top:'+rs+';"></td>');
+ if (this.escapeHtml){
+ td2.text(lt);
+ }
+ else {
+ td2.html(lt);
+ }
+ if (reverse) {
+ td2.prependTo(tr);
+ td1.prependTo(tr);
+ }
+ else {
+ td1.appendTo(tr);
+ td2.appendTo(tr);
+ }
+ pad = true;
+ }
+ idx++;
+ }
+ }
+ }
+ }
+ return this._elem;
+ };
+
+ // setup default renderers for axes and legend so user doesn't have to
+ // called with scope of plot
+ function preInit(target, data, options) {
+ options = options || {};
+ options.axesDefaults = options.axesDefaults || {};
+ options.legend = options.legend || {};
+ options.seriesDefaults = options.seriesDefaults || {};
+ // only set these if there is a donut series
+ var setopts = false;
+ if (options.seriesDefaults.renderer == $.jqplot.DonutRenderer) {
+ setopts = true;
+ }
+ else if (options.series) {
+ for (var i=0; i < options.series.length; i++) {
+ if (options.series[i].renderer == $.jqplot.DonutRenderer) {
+ setopts = true;
+ }
+ }
+ }
+
+ if (setopts) {
+ options.axesDefaults.renderer = $.jqplot.DonutAxisRenderer;
+ options.legend.renderer = $.jqplot.DonutLegendRenderer;
+ options.legend.preDraw = true;
+ options.seriesDefaults.pointLabels = {show: false};
+ }
+ }
+
+ // called with scope of plot.
+ function postInit(target, data, options) {
+ // if multiple series, add a reference to the previous one so that
+ // donut rings can nest.
+ for (var i=1; i<this.series.length; i++) {
+ if (!this.series[i]._previousSeries.length){
+ for (var j=0; j<i; j++) {
+ if (this.series[i].renderer.constructor == $.jqplot.DonutRenderer && this.series[j].renderer.constructor == $.jqplot.DonutRenderer) {
+ this.series[i]._previousSeries.push(this.series[j]);
+ }
+ }
+ }
+ }
+ for (i=0; i<this.series.length; i++) {
+ if (this.series[i].renderer.constructor == $.jqplot.DonutRenderer) {
+ this.series[i]._numberSeries = this.series.length;
+ // don't allow mouseover and mousedown at same time.
+ if (this.series[i].highlightMouseOver) {
+ this.series[i].highlightMouseDown = false;
+ }
+ }
+ }
+ }
+
+ var postParseOptionsRun = false;
+ // called with scope of plot
+ function postParseOptions(options) {
+ for (var i=0; i<this.series.length; i++) {
+ this.series[i].seriesColors = this.seriesColors;
+ this.series[i].colorGenerator = $.jqplot.colorGenerator;
+ }
+ }
+
+ function highlight (plot, sidx, pidx) {
+ var s = plot.series[sidx];
+ var canvas = plot.plugins.donutRenderer.highlightCanvas;
+ canvas._ctx.clearRect(0,0,canvas._ctx.canvas.width, canvas._ctx.canvas.height);
+ s._highlightedPoint = pidx;
+ plot.plugins.donutRenderer.highlightedSeriesIndex = sidx;
+ s.renderer.drawSlice.call(s, canvas._ctx, s._sliceAngles[pidx][0], s._sliceAngles[pidx][1], s.highlightColors[pidx], false);
+ }
+
+ function unhighlight (plot) {
+ var canvas = plot.plugins.donutRenderer.highlightCanvas;
+ canvas._ctx.clearRect(0,0, canvas._ctx.canvas.width, canvas._ctx.canvas.height);
+ for (var i=0; i<plot.series.length; i++) {
+ plot.series[i]._highlightedPoint = null;
+ }
+ plot.plugins.donutRenderer.highlightedSeriesIndex = null;
+ plot.target.trigger('jqplotDataUnhighlight');
+ }
+
+ function handleMove(ev, gridpos, datapos, neighbor, plot) {
+ if (neighbor) {
+ var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
+ var evt1 = jQuery.Event('jqplotDataMouseOver');
+ evt1.pageX = ev.pageX;
+ evt1.pageY = ev.pageY;
+ plot.target.trigger(evt1, ins);
+ if (plot.series[ins[0]].highlightMouseOver && !(ins[0] == plot.plugins.donutRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
+ var evt = jQuery.Event('jqplotDataHighlight');
+ evt.which = ev.which;
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ plot.target.trigger(evt, ins);
+ highlight (plot, ins[0], ins[1]);
+ }
+ }
+ else if (neighbor == null) {
+ unhighlight (plot);
+ }
+ }
+
+ function handleMouseDown(ev, gridpos, datapos, neighbor, plot) {
+ if (neighbor) {
+ var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
+ if (plot.series[ins[0]].highlightMouseDown && !(ins[0] == plot.plugins.donutRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
+ var evt = jQuery.Event('jqplotDataHighlight');
+ evt.which = ev.which;
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ plot.target.trigger(evt, ins);
+ highlight (plot, ins[0], ins[1]);
+ }
+ }
+ else if (neighbor == null) {
+ unhighlight (plot);
+ }
+ }
+
+ function handleMouseUp(ev, gridpos, datapos, neighbor, plot) {
+ var idx = plot.plugins.donutRenderer.highlightedSeriesIndex;
+ if (idx != null && plot.series[idx].highlightMouseDown) {
+ unhighlight(plot);
+ }
+ }
+
+ function handleClick(ev, gridpos, datapos, neighbor, plot) {
+ if (neighbor) {
+ var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
+ var evt = jQuery.Event('jqplotDataClick');
+ evt.which = ev.which;
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ plot.target.trigger(evt, ins);
+ }
+ }
+
+ function handleRightClick(ev, gridpos, datapos, neighbor, plot) {
+ if (neighbor) {
+ var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
+ var idx = plot.plugins.donutRenderer.highlightedSeriesIndex;
+ if (idx != null && plot.series[idx].highlightMouseDown) {
+ unhighlight(plot);
+ }
+ var evt = jQuery.Event('jqplotDataRightClick');
+ evt.which = ev.which;
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ plot.target.trigger(evt, ins);
+ }
+ }
+
+ // called within context of plot
+ // create a canvas which we can draw on.
+ // insert it before the eventCanvas, so eventCanvas will still capture events.
+ function postPlotDraw() {
+ // Memory Leaks patch
+ if (this.plugins.donutRenderer && this.plugins.donutRenderer.highlightCanvas) {
+ this.plugins.donutRenderer.highlightCanvas.resetCanvas();
+ this.plugins.donutRenderer.highlightCanvas = null;
+ }
+
+ this.plugins.donutRenderer = {highlightedSeriesIndex:null};
+ this.plugins.donutRenderer.highlightCanvas = new $.jqplot.GenericCanvas();
+ // do we have any data labels? if so, put highlight canvas before those
+ // Fix for broken jquery :first selector with canvas (VML) elements.
+ var labels = $(this.targetId+' .jqplot-data-label');
+ if (labels.length) {
+ $(labels[0]).before(this.plugins.donutRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-donutRenderer-highlight-canvas', this._plotDimensions, this));
+ }
+ // else put highlight canvas before event canvas.
+ else {
+ this.eventCanvas._elem.before(this.plugins.donutRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-donutRenderer-highlight-canvas', this._plotDimensions, this));
+ }
+ var hctx = this.plugins.donutRenderer.highlightCanvas.setContext();
+ this.eventCanvas._elem.bind('mouseleave', {plot:this}, function (ev) { unhighlight(ev.data.plot); });
+ }
+
+ $.jqplot.preInitHooks.push(preInit);
+
+ $.jqplot.DonutTickRenderer = function() {
+ $.jqplot.AxisTickRenderer.call(this);
+ };
+
+ $.jqplot.DonutTickRenderer.prototype = new $.jqplot.AxisTickRenderer();
+ $.jqplot.DonutTickRenderer.prototype.constructor = $.jqplot.DonutTickRenderer;
+
+})(jQuery);
+
+
\ No newline at end of file
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.dragable.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.dragable.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.dragable.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,248 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ */
+(function($) {
+
+ /**
+ * Class: $.jqplot.Dragable
+ * Plugin to make plotted points dragable by the user.
+ */
+ $.jqplot.Dragable = function(options) {
+ // Group: Properties
+ this.markerRenderer = new $.jqplot.MarkerRenderer({shadow:false});
+ this.shapeRenderer = new $.jqplot.ShapeRenderer();
+ this.isDragging = false;
+ this.isOver = false;
+ this._ctx;
+ this._elem;
+ this._point;
+ this._gridData;
+ // prop: color
+ // CSS color spec for the dragged point (and adjacent line segment or bar).
+ this.color;
+ // prop: constrainTo
+ // Constrain dragging motion to an axis or to none.
+ // Allowable values are 'none', 'x', 'y'
+ this.constrainTo = 'none'; // 'x', 'y', or 'none';
+ $.extend(true, this, options);
+ };
+
+ function DragCanvas() {
+ $.jqplot.GenericCanvas.call(this);
+ this.isDragging = false;
+ this.isOver = false;
+ this._neighbor;
+ this._cursors = [];
+ }
+
+ DragCanvas.prototype = new $.jqplot.GenericCanvas();
+ DragCanvas.prototype.constructor = DragCanvas;
+
+
+ // called within scope of series
+ $.jqplot.Dragable.parseOptions = function (defaults, opts) {
+ var options = opts || {};
+ this.plugins.dragable = new $.jqplot.Dragable(options.dragable);
+ // since this function is called before series options are parsed,
+ // we can set this here and it will be overridden if needed.
+ this.isDragable = $.jqplot.config.enablePlugins;
+ };
+
+ // called within context of plot
+ // create a canvas which we can draw on.
+ // insert it before the eventCanvas, so eventCanvas will still capture events.
+ // add a new DragCanvas object to the plot plugins to handle drawing on this new canvas.
+ $.jqplot.Dragable.postPlotDraw = function() {
+ // Memory Leaks patch
+ if (this.plugins.dragable && this.plugins.dragable.highlightCanvas) {
+ this.plugins.dragable.highlightCanvas.resetCanvas();
+ this.plugins.dragable.highlightCanvas = null;
+ }
+
+ this.plugins.dragable = {previousCursor:'auto', isOver:false};
+ this.plugins.dragable.dragCanvas = new DragCanvas();
+
+ this.eventCanvas._elem.before(this.plugins.dragable.dragCanvas.createElement(this._gridPadding, 'jqplot-dragable-canvas', this._plotDimensions, this));
+ var dctx = this.plugins.dragable.dragCanvas.setContext();
+ };
+
+ //$.jqplot.preInitHooks.push($.jqplot.Dragable.init);
+ $.jqplot.preParseSeriesOptionsHooks.push($.jqplot.Dragable.parseOptions);
+ $.jqplot.postDrawHooks.push($.jqplot.Dragable.postPlotDraw);
+ $.jqplot.eventListenerHooks.push(['jqplotMouseMove', handleMove]);
+ $.jqplot.eventListenerHooks.push(['jqplotMouseDown', handleDown]);
+ $.jqplot.eventListenerHooks.push(['jqplotMouseUp', handleUp]);
+
+
+ function initDragPoint(plot, neighbor) {
+ var s = plot.series[neighbor.seriesIndex];
+ var drag = s.plugins.dragable;
+
+ // first, init the mark renderer for the dragged point
+ var smr = s.markerRenderer;
+ var mr = drag.markerRenderer;
+ mr.style = smr.style;
+ mr.lineWidth = smr.lineWidth + 2.5;
+ mr.size = smr.size + 5;
+ if (!drag.color) {
+ var rgba = $.jqplot.getColorComponents(smr.color);
+ var newrgb = [rgba[0], rgba[1], rgba[2]];
+ var alpha = (rgba[3] >= 0.6) ? rgba[3]*0.6 : rgba[3]*(2-rgba[3]);
+ drag.color = 'rgba('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+','+alpha+')';
+ }
+ mr.color = drag.color;
+ mr.init();
+
+ var start = (neighbor.pointIndex > 0) ? neighbor.pointIndex - 1 : 0;
+ var end = neighbor.pointIndex+2;
+ drag._gridData = s.gridData.slice(start, end);
+ }
+
+ function handleMove(ev, gridpos, datapos, neighbor, plot) {
+ if (plot.plugins.dragable.dragCanvas.isDragging) {
+ var dc = plot.plugins.dragable.dragCanvas;
+ var dp = dc._neighbor;
+ var s = plot.series[dp.seriesIndex];
+ var drag = s.plugins.dragable;
+ var gd = s.gridData;
+
+ // compute the new grid position with any constraints.
+ var x = (drag.constrainTo == 'y') ? dp.gridData[0] : gridpos.x;
+ var y = (drag.constrainTo == 'x') ? dp.gridData[1] : gridpos.y;
+
+ // compute data values for any listeners.
+ var xu = s._xaxis.series_p2u(x);
+ var yu = s._yaxis.series_p2u(y);
+
+ // clear the canvas then redraw effect at new position.
+ var ctx = dc._ctx;
+ ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
+
+ // adjust our gridData for the new mouse position
+ if (dp.pointIndex > 0) {
+ drag._gridData[1] = [x, y];
+ }
+ else {
+ drag._gridData[0] = [x, y];
+ }
+ plot.series[dp.seriesIndex].draw(dc._ctx, {gridData:drag._gridData, shadow:false, preventJqPlotSeriesDrawTrigger:true, color:drag.color, markerOptions:{color:drag.color, shadow:false}, trendline:{show:false}});
+ plot.target.trigger('jqplotSeriesPointChange', [dp.seriesIndex, dp.pointIndex, [xu,yu], [x,y]]);
+ }
+ else if (neighbor != null) {
+ var series = plot.series[neighbor.seriesIndex];
+ if (series.isDragable) {
+ var dc = plot.plugins.dragable.dragCanvas;
+ if (!dc.isOver) {
+ dc._cursors.push(ev.target.style.cursor);
+ ev.target.style.cursor = "pointer";
+ }
+ dc.isOver = true;
+ }
+ }
+ else if (neighbor == null) {
+ var dc = plot.plugins.dragable.dragCanvas;
+ if (dc.isOver) {
+ ev.target.style.cursor = dc._cursors.pop();
+ dc.isOver = false;
+ }
+ }
+ }
+
+ function handleDown(ev, gridpos, datapos, neighbor, plot) {
+ var dc = plot.plugins.dragable.dragCanvas;
+ dc._cursors.push(ev.target.style.cursor);
+ if (neighbor != null) {
+ var s = plot.series[neighbor.seriesIndex];
+ var drag = s.plugins.dragable;
+ if (s.isDragable && !dc.isDragging) {
+ dc._neighbor = neighbor;
+ dc.isDragging = true;
+ initDragPoint(plot, neighbor);
+ drag.markerRenderer.draw(s.gridData[neighbor.pointIndex][0], s.gridData[neighbor.pointIndex][1], dc._ctx);
+ ev.target.style.cursor = "move";
+ plot.target.trigger('jqplotDragStart', [neighbor.seriesIndex, neighbor.pointIndex, gridpos, datapos]);
+ }
+ }
+ // Just in case of a hickup, we'll clear the drag canvas and reset.
+ else {
+ var ctx = dc._ctx;
+ ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
+ dc.isDragging = false;
+ }
+ }
+
+ function handleUp(ev, gridpos, datapos, neighbor, plot) {
+ if (plot.plugins.dragable.dragCanvas.isDragging) {
+ var dc = plot.plugins.dragable.dragCanvas;
+ // clear the canvas
+ var ctx = dc._ctx;
+ ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
+ dc.isDragging = false;
+ // redraw the series canvas at the new point.
+ var dp = dc._neighbor;
+ var s = plot.series[dp.seriesIndex];
+ var drag = s.plugins.dragable;
+ // compute the new grid position with any constraints.
+ var x = (drag.constrainTo == 'y') ? dp.data[0] : datapos[s.xaxis];
+ var y = (drag.constrainTo == 'x') ? dp.data[1] : datapos[s.yaxis];
+ // var x = datapos[s.xaxis];
+ // var y = datapos[s.yaxis];
+ s.data[dp.pointIndex][0] = x;
+ s.data[dp.pointIndex][1] = y;
+ plot.drawSeries({preventJqPlotSeriesDrawTrigger:true}, dp.seriesIndex);
+ dc._neighbor = null;
+ ev.target.style.cursor = dc._cursors.pop();
+ plot.target.trigger('jqplotDragStop', [gridpos, datapos]);
+ }
+ }
+})(jQuery);
\ No newline at end of file
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.enhancedLegendRenderer.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.enhancedLegendRenderer.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.enhancedLegendRenderer.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,328 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ */
+(function($) {
+ // class $.jqplot.EnhancedLegendRenderer
+ // Legend renderer which can specify the number of rows and/or columns in the legend.
+ $.jqplot.EnhancedLegendRenderer = function(){
+ $.jqplot.TableLegendRenderer.call(this);
+ };
+
+ $.jqplot.EnhancedLegendRenderer.prototype = new $.jqplot.TableLegendRenderer();
+ $.jqplot.EnhancedLegendRenderer.prototype.constructor = $.jqplot.EnhancedLegendRenderer;
+
+ // called with scope of legend.
+ $.jqplot.EnhancedLegendRenderer.prototype.init = function(options) {
+ // prop: numberRows
+ // Maximum number of rows in the legend. 0 or null for unlimited.
+ this.numberRows = null;
+ // prop: numberColumns
+ // Maximum number of columns in the legend. 0 or null for unlimited.
+ this.numberColumns = null;
+ // prop: seriesToggle
+ // false to not enable series on/off toggling on the legend.
+ // true or a fadein/fadeout speed (number of milliseconds or 'fast', 'normal', 'slow')
+ // to enable show/hide of series on click of legend item.
+ this.seriesToggle = 'normal';
+ // prop: seriesToggleReplot
+ // True to replot the chart after toggling series on/off.
+ // This will set the series show property to false.
+ // This allows for rescaling or other maniplation of chart.
+ // Set to an options object (e.g. {resetAxes: true}) for replot options.
+ this.seriesToggleReplot = false;
+ // prop: disableIEFading
+ // true to toggle series with a show/hide method only and not allow fading in/out.
+ // This is to overcome poor performance of fade in some versions of IE.
+ this.disableIEFading = true;
+ $.extend(true, this, options);
+
+ if (this.seriesToggle) {
+ $.jqplot.postDrawHooks.push(postDraw);
+ }
+ };
+
+ // called with scope of legend
+ $.jqplot.EnhancedLegendRenderer.prototype.draw = function(offsets, plot) {
+ var legend = this;
+ if (this.show) {
+ var series = this._series;
+ var s;
+ var ss = 'position:absolute;';
+ ss += (this.background) ? 'background:'+this.background+';' : '';
+ ss += (this.border) ? 'border:'+this.border+';' : '';
+ ss += (this.fontSize) ? 'font-size:'+this.fontSize+';' : '';
+ ss += (this.fontFamily) ? 'font-family:'+this.fontFamily+';' : '';
+ ss += (this.textColor) ? 'color:'+this.textColor+';' : '';
+ ss += (this.marginTop != null) ? 'margin-top:'+this.marginTop+';' : '';
+ ss += (this.marginBottom != null) ? 'margin-bottom:'+this.marginBottom+';' : '';
+ ss += (this.marginLeft != null) ? 'margin-left:'+this.marginLeft+';' : '';
+ ss += (this.marginRight != null) ? 'margin-right:'+this.marginRight+';' : '';
+ this._elem = $('<table class="jqplot-table-legend" style="'+ss+'"></table>');
+ if (this.seriesToggle) {
+ this._elem.css('z-index', '3');
+ }
+
+ var pad = false,
+ reverse = false,
+ nr, nc;
+ if (this.numberRows) {
+ nr = this.numberRows;
+ if (!this.numberColumns){
+ nc = Math.ceil(series.length/nr);
+ }
+ else{
+ nc = this.numberColumns;
+ }
+ }
+ else if (this.numberColumns) {
+ nc = this.numberColumns;
+ nr = Math.ceil(series.length/this.numberColumns);
+ }
+ else {
+ nr = series.length;
+ nc = 1;
+ }
+
+ var i, j, tr, td1, td2, lt, rs, div, div0, div1;
+ var idx = 0;
+ // check to see if we need to reverse
+ for (i=series.length-1; i>=0; i--) {
+ if (nc == 1 && series[i]._stack || series[i].renderer.constructor == $.jqplot.BezierCurveRenderer){
+ reverse = true;
+ }
+ }
+
+ for (i=0; i<nr; i++) {
+ tr = $(document.createElement('tr'));
+ tr.addClass('jqplot-table-legend');
+ if (reverse){
+ tr.prependTo(this._elem);
+ }
+ else{
+ tr.appendTo(this._elem);
+ }
+ for (j=0; j<nc; j++) {
+ if (idx < series.length && (series[idx].show || series[idx].showLabel)){
+ s = series[idx];
+ lt = this.labels[idx] || s.label.toString();
+ if (lt) {
+ var color = s.color;
+ if (!reverse){
+ if (i>0){
+ pad = true;
+ }
+ else{
+ pad = false;
+ }
+ }
+ else{
+ if (i == nr -1){
+ pad = false;
+ }
+ else{
+ pad = true;
+ }
+ }
+ rs = (pad) ? this.rowSpacing : '0';
+
+ td1 = $(document.createElement('td'));
+ td1.addClass('jqplot-table-legend jqplot-table-legend-swatch');
+ td1.css({textAlign: 'center', paddingTop: rs});
+
+ div0 = $(document.createElement('div'));
+ div0.addClass('jqplot-table-legend-swatch-outline');
+ div1 = $(document.createElement('div'));
+ div1.addClass('jqplot-table-legend-swatch');
+ div1.css({backgroundColor: color, borderColor: color});
+
+ td1.append(div0.append(div1));
+
+ td2 = $(document.createElement('td'));
+ td2.addClass('jqplot-table-legend jqplot-table-legend-label');
+ td2.css('paddingTop', rs);
+
+ // td1 = $('<td class="jqplot-table-legend" style="text-align:center;padding-top:'+rs+';">'+
+ // '<div><div class="jqplot-table-legend-swatch" style="background-color:'+color+';border-color:'+color+';"></div>'+
+ // '</div></td>');
+ // td2 = $('<td class="jqplot-table-legend" style="padding-top:'+rs+';"></td>');
+ if (this.escapeHtml){
+ td2.text(lt);
+ }
+ else {
+ td2.html(lt);
+ }
+ if (reverse) {
+ if (this.showLabels) {td2.prependTo(tr);}
+ if (this.showSwatches) {td1.prependTo(tr);}
+ }
+ else {
+ if (this.showSwatches) {td1.appendTo(tr);}
+ if (this.showLabels) {td2.appendTo(tr);}
+ }
+
+ if (this.seriesToggle) {
+
+ // add an overlay for clicking series on/off
+ // div0 = $(document.createElement('div'));
+ // div0.addClass('jqplot-table-legend-overlay');
+ // div0.css({position:'relative', left:0, top:0, height:'100%', width:'100%'});
+ // tr.append(div0);
+
+ var speed;
+ if (typeof(this.seriesToggle) === 'string' || typeof(this.seriesToggle) === 'number') {
+ if (!$.jqplot.use_excanvas || !this.disableIEFading) {
+ speed = this.seriesToggle;
+ }
+ }
+ if (this.showSwatches) {
+ td1.bind('click', {series:s, speed:speed, plot: plot, replot:this.seriesToggleReplot}, handleToggle);
+ td1.addClass('jqplot-seriesToggle');
+ }
+ if (this.showLabels) {
+ td2.bind('click', {series:s, speed:speed, plot: plot, replot:this.seriesToggleReplot}, handleToggle);
+ td2.addClass('jqplot-seriesToggle');
+ }
+
+ // for series that are already hidden, add the hidden class
+ if (!s.show && s.showLabel) {
+ td1.addClass('jqplot-series-hidden');
+ td2.addClass('jqplot-series-hidden');
+ }
+ }
+
+ pad = true;
+ }
+ }
+ idx++;
+ }
+
+ td1 = td2 = div0 = div1 = null;
+ }
+ }
+ return this._elem;
+ };
+
+ var handleToggle = function (ev) {
+ var d = ev.data,
+ s = d.series,
+ replot = d.replot,
+ plot = d.plot,
+ speed = d.speed,
+ sidx = s.index,
+ showing = false;
+
+ if (s.canvas._elem.is(':hidden') || !s.show) {
+ showing = true;
+ }
+
+ var doLegendToggle = function() {
+
+ if (replot) {
+ var opts = {};
+
+ if ($.isPlainObject(replot)) {
+ $.extend(true, opts, replot);
+ }
+
+ plot.replot(opts);
+ // if showing, there was no canvas element to fade in, so hide here
+ // and then do a fade in.
+ if (showing && speed) {
+ var s = plot.series[sidx];
+
+ if (s.shadowCanvas._elem) {
+ s.shadowCanvas._elem.hide().fadeIn(speed);
+ }
+ s.canvas._elem.hide().fadeIn(speed);
+ s.canvas._elem.nextAll('.jqplot-point-label.jqplot-series-'+s.index).hide().fadeIn(speed);
+ }
+
+ }
+
+ else {
+ var s = plot.series[sidx];
+
+ if (s.canvas._elem.is(':hidden') || !s.show) {
+ // Not sure if there is a better way to check for showSwatches and showLabels === true.
+ // Test for "undefined" since default values for both showSwatches and showLables is true.
+ if (typeof plot.options.legend.showSwatches === 'undefined' || plot.options.legend.showSwatches === true) {
+ plot.legend._elem.find('td').eq(sidx * 2).addClass('jqplot-series-hidden');
+ }
+ if (typeof plot.options.legend.showLabels === 'undefined' || plot.options.legend.showLabels === true) {
+ plot.legend._elem.find('td').eq((sidx * 2) + 1).addClass('jqplot-series-hidden');
+ }
+ }
+ else {
+ if (typeof plot.options.legend.showSwatches === 'undefined' || plot.options.legend.showSwatches === true) {
+ plot.legend._elem.find('td').eq(sidx * 2).removeClass('jqplot-series-hidden');
+ }
+ if (typeof plot.options.legend.showLabels === 'undefined' || plot.options.legend.showLabels === true) {
+ plot.legend._elem.find('td').eq((sidx * 2) + 1).removeClass('jqplot-series-hidden');
+ }
+ }
+
+ }
+
+ };
+
+ s.toggleDisplay(ev, doLegendToggle);
+ };
+
+ // called with scope of plot.
+ var postDraw = function () {
+ if (this.legend.renderer.constructor == $.jqplot.EnhancedLegendRenderer && this.legend.seriesToggle){
+ var e = this.legend._elem.detach();
+ this.eventCanvas._elem.after(e);
+ }
+ };
+})(jQuery);
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.funnelRenderer.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.funnelRenderer.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.funnelRenderer.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,966 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ */
+(function($) {
+ /**
+ * Class: $.jqplot.FunnelRenderer
+ * Plugin renderer to draw a funnel chart.
+ * x values, if present, will be used as labels.
+ * y values give area size.
+ *
+ * Funnel charts will draw a single series
+ * only.
+ *
+ * To use this renderer, you need to include the
+ * funnel renderer plugin, for example:
+ *
+ * > <script type="text/javascript" src="plugins/jqplot.funnelRenderer.js"></script>
+ *
+ * Properties described here are passed into the $.jqplot function
+ * as options on the series renderer. For example:
+ *
+ * > plot2 = $.jqplot('chart2', [s1, s2], {
+ * > seriesDefaults: {
+ * > renderer:$.jqplot.FunnelRenderer,
+ * > rendererOptions:{
+ * > sectionMargin: 12,
+ * > widthRatio: 0.3
+ * > }
+ * > }
+ * > });
+ *
+ * IMPORTANT
+ *
+ * *The funnel renderer will reorder data in descending order* so the largest value in
+ * the data set is first and displayed on top of the funnel. Data will then
+ * be displayed in descending order down the funnel. The area of each funnel
+ * section will correspond to the value of each data point relative to the sum
+ * of all values. That is section area is proportional to section value divided by
+ * sum of all section values.
+ *
+ * If your data is not in descending order when passed into the plot, *it will be
+ * reordered* when stored in the series.data property. A copy of the unordered
+ * data is kept in the series._unorderedData property.
+ *
+ * A funnel plot will trigger events on the plot target
+ * according to user interaction. All events return the event object,
+ * the series index, the point (section) index, and the point data for
+ * the appropriate section. *Note* the point index will referr to the ordered
+ * data, not the original unordered data.
+ *
+ * 'jqplotDataMouseOver' - triggered when mousing over a section.
+ * 'jqplotDataHighlight' - triggered the first time user mouses over a section,
+ * if highlighting is enabled.
+ * 'jqplotDataUnhighlight' - triggered when a user moves the mouse out of
+ * a highlighted section.
+ * 'jqplotDataClick' - triggered when the user clicks on a section.
+ * 'jqplotDataRightClick' - tiggered when the user right clicks on a section if
+ * the "captureRightClick" option is set to true on the plot.
+ */
+ $.jqplot.FunnelRenderer = function(){
+ $.jqplot.LineRenderer.call(this);
+ };
+
+ $.jqplot.FunnelRenderer.prototype = new $.jqplot.LineRenderer();
+ $.jqplot.FunnelRenderer.prototype.constructor = $.jqplot.FunnelRenderer;
+
+ // called with scope of a series
+ $.jqplot.FunnelRenderer.prototype.init = function(options, plot) {
+ // Group: Properties
+ //
+ // prop: padding
+ // padding between the funnel and plot edges, legend, etc.
+ this.padding = {top: 20, right: 20, bottom: 20, left: 20};
+ // prop: sectionMargin
+ // spacing between funnel sections in pixels.
+ this.sectionMargin = 6;
+ // prop: fill
+ // true or false, wether to fill the areas.
+ this.fill = true;
+ // prop: shadowOffset
+ // offset of the shadow from the area and offset of
+ // each succesive stroke of the shadow from the last.
+ this.shadowOffset = 2;
+ // prop: shadowAlpha
+ // transparency of the shadow (0 = transparent, 1 = opaque)
+ this.shadowAlpha = 0.07;
+ // prop: shadowDepth
+ // number of strokes to apply to the shadow,
+ // each stroke offset shadowOffset from the last.
+ this.shadowDepth = 5;
+ // prop: highlightMouseOver
+ // True to highlight area when moused over.
+ // This must be false to enable highlightMouseDown to highlight when clicking on a area.
+ this.highlightMouseOver = true;
+ // prop: highlightMouseDown
+ // True to highlight when a mouse button is pressed over a area.
+ // This will be disabled if highlightMouseOver is true.
+ this.highlightMouseDown = false;
+ // prop: highlightColors
+ // array of colors to use when highlighting an area.
+ this.highlightColors = [];
+ // prop: widthRatio
+ // The ratio of the width of the top of the funnel to the bottom.
+ // a ratio of 0 will make an upside down pyramid.
+ this.widthRatio = 0.2;
+ // prop: lineWidth
+ // width of line if areas are stroked and not filled.
+ this.lineWidth = 2;
+ // prop: dataLabels
+ // Either 'label', 'value', 'percent' or an array of labels to place on the pie slices.
+ // Defaults to percentage of each pie slice.
+ this.dataLabels = 'percent';
+ // prop: showDataLabels
+ // true to show data labels on slices.
+ this.showDataLabels = false;
+ // prop: dataLabelFormatString
+ // Format string for data labels. If none, '%s' is used for "label" and for arrays, '%d' for value and '%d%%' for percentage.
+ this.dataLabelFormatString = null;
+ // prop: dataLabelThreshold
+ // Threshhold in percentage (0 - 100) of pie area, below which no label will be displayed.
+ // This applies to all label types, not just to percentage labels.
+ this.dataLabelThreshold = 3;
+ this._type = 'funnel';
+
+ this.tickRenderer = $.jqplot.FunnelTickRenderer;
+
+ // if user has passed in highlightMouseDown option and not set highlightMouseOver, disable highlightMouseOver
+ if (options.highlightMouseDown && options.highlightMouseOver == null) {
+ options.highlightMouseOver = false;
+ }
+
+ $.extend(true, this, options);
+
+ // index of the currenty highlighted point, if any
+ this._highlightedPoint = null;
+
+ // lengths of bases, or horizontal sides of areas of trapezoid.
+ this._bases = [];
+ // total area
+ this._atot;
+ // areas of segments.
+ this._areas = [];
+ // vertical lengths of segments.
+ this._lengths = [];
+ // angle of the funnel to vertical.
+ this._angle;
+ this._dataIndices = [];
+
+ // sort data
+ this._unorderedData = $.extend(true, [], this.data);
+ var idxs = $.extend(true, [], this.data);
+ for (var i=0; i<idxs.length; i++) {
+ idxs[i].push(i);
+ }
+ this.data.sort( function (a, b) { return b[1] - a[1]; } );
+ idxs.sort( function (a, b) { return b[1] - a[1]; });
+ for (var i=0; i<idxs.length; i++) {
+ this._dataIndices.push(idxs[i][2]);
+ }
+
+ // set highlight colors if none provided
+ if (this.highlightColors.length == 0) {
+ for (var i=0; i<this.seriesColors.length; i++){
+ var rgba = $.jqplot.getColorComponents(this.seriesColors[i]);
+ var newrgb = [rgba[0], rgba[1], rgba[2]];
+ var sum = newrgb[0] + newrgb[1] + newrgb[2];
+ for (var j=0; j<3; j++) {
+ // when darkening, lowest color component can be is 60.
+ newrgb[j] = (sum > 570) ? newrgb[j] * 0.8 : newrgb[j] + 0.4 * (255 - newrgb[j]);
+ newrgb[j] = parseInt(newrgb[j], 10);
+ }
+ this.highlightColors.push('rgb('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+')');
+ }
+ }
+
+ plot.postParseOptionsHooks.addOnce(postParseOptions);
+ plot.postInitHooks.addOnce(postInit);
+ plot.eventListenerHooks.addOnce('jqplotMouseMove', handleMove);
+ plot.eventListenerHooks.addOnce('jqplotMouseDown', handleMouseDown);
+ plot.eventListenerHooks.addOnce('jqplotMouseUp', handleMouseUp);
+ plot.eventListenerHooks.addOnce('jqplotClick', handleClick);
+ plot.eventListenerHooks.addOnce('jqplotRightClick', handleRightClick);
+ plot.postDrawHooks.addOnce(postPlotDraw);
+
+ };
+
+ // gridData will be of form [label, percentage of total]
+ $.jqplot.FunnelRenderer.prototype.setGridData = function(plot) {
+ // set gridData property. This will hold angle in radians of each data point.
+ var sum = 0;
+ var td = [];
+ for (var i=0; i<this.data.length; i++){
+ sum += this.data[i][1];
+ td.push([this.data[i][0], this.data[i][1]]);
+ }
+
+ // normalize y values, so areas are proportional.
+ for (var i=0; i<td.length; i++) {
+ td[i][1] = td[i][1]/sum;
+ }
+
+ this._bases = new Array(td.length + 1);
+ this._lengths = new Array(td.length);
+
+ this.gridData = td;
+ };
+
+ $.jqplot.FunnelRenderer.prototype.makeGridData = function(data, plot) {
+ // set gridData property. This will hold angle in radians of each data point.
+ var sum = 0;
+ var td = [];
+ for (var i=0; i<this.data.length; i++){
+ sum += this.data[i][1];
+ td.push([this.data[i][0], this.data[i][1]]);
+ }
+
+ // normalize y values, so areas are proportional.
+ for (var i=0; i<td.length; i++) {
+ td[i][1] = td[i][1]/sum;
+ }
+
+ this._bases = new Array(td.length + 1);
+ this._lengths = new Array(td.length);
+
+ return td;
+ };
+
+ $.jqplot.FunnelRenderer.prototype.drawSection = function (ctx, vertices, color, isShadow) {
+ var fill = this.fill;
+ var lineWidth = this.lineWidth;
+ ctx.save();
+
+ if (isShadow) {
+ for (var i=0; i<this.shadowDepth; i++) {
+ ctx.save();
+ ctx.translate(this.shadowOffset*Math.cos(this.shadowAngle/180*Math.PI), this.shadowOffset*Math.sin(this.shadowAngle/180*Math.PI));
+ doDraw();
+ }
+ }
+
+ else {
+ doDraw();
+ }
+
+ function doDraw () {
+ ctx.beginPath();
+ ctx.fillStyle = color;
+ ctx.strokeStyle = color;
+ ctx.lineWidth = lineWidth;
+ ctx.moveTo(vertices[0][0], vertices[0][1]);
+ for (var i=1; i<4; i++) {
+ ctx.lineTo(vertices[i][0], vertices[i][1]);
+ }
+ ctx.closePath();
+ if (fill) {
+ ctx.fill();
+ }
+ else {
+ ctx.stroke();
+ }
+ }
+
+ if (isShadow) {
+ for (var i=0; i<this.shadowDepth; i++) {
+ ctx.restore();
+ }
+ }
+
+ ctx.restore();
+ };
+
+ // called with scope of series
+ $.jqplot.FunnelRenderer.prototype.draw = function (ctx, gd, options, plot) {
+ var i;
+ var opts = (options != undefined) ? options : {};
+ // offset and direction of offset due to legend placement
+ var offx = 0;
+ var offy = 0;
+ var trans = 1;
+ this._areas = [];
+ // var colorGenerator = new this.colorGenerator(this.seriesColors);
+ if (options.legendInfo && options.legendInfo.placement == 'insideGrid') {
+ var li = options.legendInfo;
+ switch (li.location) {
+ case 'nw':
+ offx = li.width + li.xoffset;
+ break;
+ case 'w':
+ offx = li.width + li.xoffset;
+ break;
+ case 'sw':
+ offx = li.width + li.xoffset;
+ break;
+ case 'ne':
+ offx = li.width + li.xoffset;
+ trans = -1;
+ break;
+ case 'e':
+ offx = li.width + li.xoffset;
+ trans = -1;
+ break;
+ case 'se':
+ offx = li.width + li.xoffset;
+ trans = -1;
+ break;
+ case 'n':
+ offy = li.height + li.yoffset;
+ break;
+ case 's':
+ offy = li.height + li.yoffset;
+ trans = -1;
+ break;
+ default:
+ break;
+ }
+ }
+
+ var loff = (trans==1) ? this.padding.left + offx : this.padding.left;
+ var toff = (trans==1) ? this.padding.top + offy : this.padding.top;
+ var roff = (trans==-1) ? this.padding.right + offx : this.padding.right;
+ var boff = (trans==-1) ? this.padding.bottom + offy : this.padding.bottom;
+
+ var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
+ var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine;
+ var fill = (opts.fill != undefined) ? opts.fill : this.fill;
+ var cw = ctx.canvas.width;
+ var ch = ctx.canvas.height;
+ this._bases[0] = cw - loff - roff;
+ var ltot = this._length = ch - toff - boff;
+
+ var hend = this._bases[0]*this.widthRatio;
+ this._atot = ltot/2 * (this._bases[0] + this._bases[0]*this.widthRatio);
+
+ this._angle = Math.atan((this._bases[0] - hend)/2/ltot);
+
+ for (i=0; i<gd.length; i++) {
+ this._areas.push(gd[i][1] * this._atot);
+ }
+
+
+ var guess, err, count, lsum=0;
+ var tolerance = 0.0001;
+
+ for (i=0; i<this._areas.length; i++) {
+ guess = this._areas[i]/this._bases[i];
+ err = 999999;
+ this._lengths[i] = guess;
+ count = 0;
+ while (err > this._lengths[i]*tolerance && count < 100) {
+ this._lengths[i] = this._areas[i]/(this._bases[i] - this._lengths[i] * Math.tan(this._angle));
+ err = Math.abs(this._lengths[i] - guess);
+ this._bases[i+1] = this._bases[i] - (2*this._lengths[i]*Math.tan(this._angle));
+ guess = this._lengths[i];
+ count++;
+ }
+ lsum += this._lengths[i];
+ }
+
+ // figure out vertices of each section
+ this._vertices = new Array(gd.length);
+
+ // these are 4 coners of entire trapezoid
+ var p0 = [loff, toff],
+ p1 = [loff+this._bases[0], toff],
+ p2 = [loff + (this._bases[0] - this._bases[this._bases.length-1])/2, toff + this._length],
+ p3 = [p2[0] + this._bases[this._bases.length-1], p2[1]];
+
+ // equations of right and left sides, returns x, y values given height of section (y value)
+ function findleft (l) {
+ var m = (p0[1] - p2[1])/(p0[0] - p2[0]);
+ var b = p0[1] - m*p0[0];
+ var y = l + p0[1];
+
+ return [(y - b)/m, y];
+ }
+
+ function findright (l) {
+ var m = (p1[1] - p3[1])/(p1[0] - p3[0]);
+ var b = p1[1] - m*p1[0];
+ var y = l + p1[1];
+
+ return [(y - b)/m, y];
+ }
+
+ var x = offx, y = offy;
+ var h=0, adj=0;
+
+ for (i=0; i<gd.length; i++) {
+ this._vertices[i] = new Array();
+ var v = this._vertices[i];
+ var sm = this.sectionMargin;
+ if (i == 0) {
+ adj = 0;
+ }
+ if (i == 1) {
+ adj = sm/3;
+ }
+ else if (i > 0 && i < gd.length-1) {
+ adj = sm/2;
+ }
+ else if (i == gd.length -1) {
+ adj = 2*sm/3;
+ }
+ v.push(findleft(h+adj));
+ v.push(findright(h+adj));
+ h += this._lengths[i];
+ if (i == 0) {
+ adj = -2*sm/3;
+ }
+ else if (i > 0 && i < gd.length-1) {
+ adj = -sm/2;
+ }
+ else if (i == gd.length - 1) {
+ adj = 0;
+ }
+ v.push(findright(h+adj));
+ v.push(findleft(h+adj));
+
+ }
+
+ if (this.shadow) {
+ var shadowColor = 'rgba(0,0,0,'+this.shadowAlpha+')';
+ for (var i=0; i<gd.length; i++) {
+ this.renderer.drawSection.call (this, ctx, this._vertices[i], shadowColor, true);
+ }
+
+ }
+ for (var i=0; i<gd.length; i++) {
+ var v = this._vertices[i];
+ this.renderer.drawSection.call (this, ctx, v, this.seriesColors[i]);
+
+ if (this.showDataLabels && gd[i][1]*100 >= this.dataLabelThreshold) {
+ var fstr, label;
+
+ if (this.dataLabels == 'label') {
+ fstr = this.dataLabelFormatString || '%s';
+ label = $.jqplot.sprintf(fstr, gd[i][0]);
+ }
+ else if (this.dataLabels == 'value') {
+ fstr = this.dataLabelFormatString || '%d';
+ label = $.jqplot.sprintf(fstr, this.data[i][1]);
+ }
+ else if (this.dataLabels == 'percent') {
+ fstr = this.dataLabelFormatString || '%d%%';
+ label = $.jqplot.sprintf(fstr, gd[i][1]*100);
+ }
+ else if (this.dataLabels.constructor == Array) {
+ fstr = this.dataLabelFormatString || '%s';
+ label = $.jqplot.sprintf(fstr, this.dataLabels[this._dataIndices[i]]);
+ }
+
+ var fact = (this._radius ) * this.dataLabelPositionFactor + this.sliceMargin + this.dataLabelNudge;
+
+ var x = (v[0][0] + v[1][0])/2 + this.canvas._offsets.left;
+ var y = (v[1][1] + v[2][1])/2 + this.canvas._offsets.top;
+
+ var labelelem = $('<span class="jqplot-funnel-series jqplot-data-label" style="position:absolute;">' + label + '</span>').insertBefore(plot.eventCanvas._elem);
+ x -= labelelem.width()/2;
+ y -= labelelem.height()/2;
+ x = Math.round(x);
+ y = Math.round(y);
+ labelelem.css({left: x, top: y});
+ }
+
+ }
+
+ };
+
+ $.jqplot.FunnelAxisRenderer = function() {
+ $.jqplot.LinearAxisRenderer.call(this);
+ };
+
+ $.jqplot.FunnelAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer();
+ $.jqplot.FunnelAxisRenderer.prototype.constructor = $.jqplot.FunnelAxisRenderer;
+
+
+ // There are no traditional axes on a funnel chart. We just need to provide
+ // dummy objects with properties so the plot will render.
+ // called with scope of axis object.
+ $.jqplot.FunnelAxisRenderer.prototype.init = function(options){
+ //
+ this.tickRenderer = $.jqplot.FunnelTickRenderer;
+ $.extend(true, this, options);
+ // I don't think I'm going to need _dataBounds here.
+ // have to go Axis scaling in a way to fit chart onto plot area
+ // and provide u2p and p2u functionality for mouse cursor, etc.
+ // for convienence set _dataBounds to 0 and 100 and
+ // set min/max to 0 and 100.
+ this._dataBounds = {min:0, max:100};
+ this.min = 0;
+ this.max = 100;
+ this.showTicks = false;
+ this.ticks = [];
+ this.showMark = false;
+ this.show = false;
+ };
+
+
+
+ /**
+ * Class: $.jqplot.FunnelLegendRenderer
+ * Legend Renderer specific to funnel plots. Set by default
+ * when the user creates a funnel plot.
+ */
+ $.jqplot.FunnelLegendRenderer = function(){
+ $.jqplot.TableLegendRenderer.call(this);
+ };
+
+ $.jqplot.FunnelLegendRenderer.prototype = new $.jqplot.TableLegendRenderer();
+ $.jqplot.FunnelLegendRenderer.prototype.constructor = $.jqplot.FunnelLegendRenderer;
+
+ $.jqplot.FunnelLegendRenderer.prototype.init = function(options) {
+ // Group: Properties
+ //
+ // prop: numberRows
+ // Maximum number of rows in the legend. 0 or null for unlimited.
+ this.numberRows = null;
+ // prop: numberColumns
+ // Maximum number of columns in the legend. 0 or null for unlimited.
+ this.numberColumns = null;
+ $.extend(true, this, options);
+ };
+
+ // called with context of legend
+ $.jqplot.FunnelLegendRenderer.prototype.draw = function() {
+ var legend = this;
+ if (this.show) {
+ var series = this._series;
+ var ss = 'position:absolute;';
+ ss += (this.background) ? 'background:'+this.background+';' : '';
+ ss += (this.border) ? 'border:'+this.border+';' : '';
+ ss += (this.fontSize) ? 'font-size:'+this.fontSize+';' : '';
+ ss += (this.fontFamily) ? 'font-family:'+this.fontFamily+';' : '';
+ ss += (this.textColor) ? 'color:'+this.textColor+';' : '';
+ ss += (this.marginTop != null) ? 'margin-top:'+this.marginTop+';' : '';
+ ss += (this.marginBottom != null) ? 'margin-bottom:'+this.marginBottom+';' : '';
+ ss += (this.marginLeft != null) ? 'margin-left:'+this.marginLeft+';' : '';
+ ss += (this.marginRight != null) ? 'margin-right:'+this.marginRight+';' : '';
+ this._elem = $('<table class="jqplot-table-legend" style="'+ss+'"></table>');
+ // Funnel charts legends don't go by number of series, but by number of data points
+ // in the series. Refactor things here for that.
+
+ var pad = false,
+ reverse = false,
+ nr, nc;
+ var s = series[0];
+ var colorGenerator = new $.jqplot.ColorGenerator(s.seriesColors);
+
+ if (s.show) {
+ var pd = s.data;
+ if (this.numberRows) {
+ nr = this.numberRows;
+ if (!this.numberColumns){
+ nc = Math.ceil(pd.length/nr);
+ }
+ else{
+ nc = this.numberColumns;
+ }
+ }
+ else if (this.numberColumns) {
+ nc = this.numberColumns;
+ nr = Math.ceil(pd.length/this.numberColumns);
+ }
+ else {
+ nr = pd.length;
+ nc = 1;
+ }
+
+ var i, j, tr, td1, td2, lt, rs, color;
+ var idx = 0;
+
+ for (i=0; i<nr; i++) {
+ if (reverse){
+ tr = $('<tr class="jqplot-table-legend"></tr>').prependTo(this._elem);
+ }
+ else{
+ tr = $('<tr class="jqplot-table-legend"></tr>').appendTo(this._elem);
+ }
+ for (j=0; j<nc; j++) {
+ if (idx < pd.length){
+ lt = this.labels[idx] || pd[idx][0].toString();
+ color = colorGenerator.next();
+ if (!reverse){
+ if (i>0){
+ pad = true;
+ }
+ else{
+ pad = false;
+ }
+ }
+ else{
+ if (i == nr -1){
+ pad = false;
+ }
+ else{
+ pad = true;
+ }
+ }
+ rs = (pad) ? this.rowSpacing : '0';
+
+ td1 = $('<td class="jqplot-table-legend" style="text-align:center;padding-top:'+rs+';">'+
+ '<div><div class="jqplot-table-legend-swatch" style="border-color:'+color+';"></div>'+
+ '</div></td>');
+ td2 = $('<td class="jqplot-table-legend" style="padding-top:'+rs+';"></td>');
+ if (this.escapeHtml){
+ td2.text(lt);
+ }
+ else {
+ td2.html(lt);
+ }
+ if (reverse) {
+ td2.prependTo(tr);
+ td1.prependTo(tr);
+ }
+ else {
+ td1.appendTo(tr);
+ td2.appendTo(tr);
+ }
+ pad = true;
+ }
+ idx++;
+ }
+ }
+ }
+ }
+ return this._elem;
+ };
+
+ // $.jqplot.FunnelLegendRenderer.prototype.pack = function(offsets) {
+ // if (this.show) {
+ // // fake a grid for positioning
+ // var grid = {_top:offsets.top, _left:offsets.left, _right:offsets.right, _bottom:this._plotDimensions.height - offsets.bottom};
+ // if (this.placement == 'insideGrid') {
+ // switch (this.location) {
+ // case 'nw':
+ // var a = grid._left + this.xoffset;
+ // var b = grid._top + this.yoffset;
+ // this._elem.css('left', a);
+ // this._elem.css('top', b);
+ // break;
+ // case 'n':
+ // var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
+ // var b = grid._top + this.yoffset;
+ // this._elem.css('left', a);
+ // this._elem.css('top', b);
+ // break;
+ // case 'ne':
+ // var a = offsets.right + this.xoffset;
+ // var b = grid._top + this.yoffset;
+ // this._elem.css({right:a, top:b});
+ // break;
+ // case 'e':
+ // var a = offsets.right + this.xoffset;
+ // var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
+ // this._elem.css({right:a, top:b});
+ // break;
+ // case 'se':
+ // var a = offsets.right + this.xoffset;
+ // var b = offsets.bottom + this.yoffset;
+ // this._elem.css({right:a, bottom:b});
+ // break;
+ // case 's':
+ // var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
+ // var b = offsets.bottom + this.yoffset;
+ // this._elem.css({left:a, bottom:b});
+ // break;
+ // case 'sw':
+ // var a = grid._left + this.xoffset;
+ // var b = offsets.bottom + this.yoffset;
+ // this._elem.css({left:a, bottom:b});
+ // break;
+ // case 'w':
+ // var a = grid._left + this.xoffset;
+ // var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
+ // this._elem.css({left:a, top:b});
+ // break;
+ // default: // same as 'se'
+ // var a = grid._right - this.xoffset;
+ // var b = grid._bottom + this.yoffset;
+ // this._elem.css({right:a, bottom:b});
+ // break;
+ // }
+ //
+ // }
+ // else {
+ // switch (this.location) {
+ // case 'nw':
+ // var a = this._plotDimensions.width - grid._left + this.xoffset;
+ // var b = grid._top + this.yoffset;
+ // this._elem.css('right', a);
+ // this._elem.css('top', b);
+ // break;
+ // case 'n':
+ // var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
+ // var b = this._plotDimensions.height - grid._top + this.yoffset;
+ // this._elem.css('left', a);
+ // this._elem.css('bottom', b);
+ // break;
+ // case 'ne':
+ // var a = this._plotDimensions.width - offsets.right + this.xoffset;
+ // var b = grid._top + this.yoffset;
+ // this._elem.css({left:a, top:b});
+ // break;
+ // case 'e':
+ // var a = this._plotDimensions.width - offsets.right + this.xoffset;
+ // var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
+ // this._elem.css({left:a, top:b});
+ // break;
+ // case 'se':
+ // var a = this._plotDimensions.width - offsets.right + this.xoffset;
+ // var b = offsets.bottom + this.yoffset;
+ // this._elem.css({left:a, bottom:b});
+ // break;
+ // case 's':
+ // var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
+ // var b = this._plotDimensions.height - offsets.bottom + this.yoffset;
+ // this._elem.css({left:a, top:b});
+ // break;
+ // case 'sw':
+ // var a = this._plotDimensions.width - grid._left + this.xoffset;
+ // var b = offsets.bottom + this.yoffset;
+ // this._elem.css({right:a, bottom:b});
+ // break;
+ // case 'w':
+ // var a = this._plotDimensions.width - grid._left + this.xoffset;
+ // var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
+ // this._elem.css({right:a, top:b});
+ // break;
+ // default: // same as 'se'
+ // var a = grid._right - this.xoffset;
+ // var b = grid._bottom + this.yoffset;
+ // this._elem.css({right:a, bottom:b});
+ // break;
+ // }
+ // }
+ // }
+ // };
+
+ // setup default renderers for axes and legend so user doesn't have to
+ // called with scope of plot
+ function preInit(target, data, options) {
+ options = options || {};
+ options.axesDefaults = options.axesDefaults || {};
+ options.legend = options.legend || {};
+ options.seriesDefaults = options.seriesDefaults || {};
+ // only set these if there is a funnel series
+ var setopts = false;
+ if (options.seriesDefaults.renderer == $.jqplot.FunnelRenderer) {
+ setopts = true;
+ }
+ else if (options.series) {
+ for (var i=0; i < options.series.length; i++) {
+ if (options.series[i].renderer == $.jqplot.FunnelRenderer) {
+ setopts = true;
+ }
+ }
+ }
+
+ if (setopts) {
+ options.axesDefaults.renderer = $.jqplot.FunnelAxisRenderer;
+ options.legend.renderer = $.jqplot.FunnelLegendRenderer;
+ options.legend.preDraw = true;
+ options.sortData = false;
+ options.seriesDefaults.pointLabels = {show: false};
+ }
+ }
+
+ function postInit(target, data, options) {
+ // if multiple series, add a reference to the previous one so that
+ // funnel rings can nest.
+ for (var i=0; i<this.series.length; i++) {
+ if (this.series[i].renderer.constructor == $.jqplot.FunnelRenderer) {
+ // don't allow mouseover and mousedown at same time.
+ if (this.series[i].highlightMouseOver) {
+ this.series[i].highlightMouseDown = false;
+ }
+ }
+ }
+ }
+
+ // called with scope of plot
+ function postParseOptions(options) {
+ for (var i=0; i<this.series.length; i++) {
+ this.series[i].seriesColors = this.seriesColors;
+ this.series[i].colorGenerator = $.jqplot.colorGenerator;
+ }
+ }
+
+ function highlight (plot, sidx, pidx) {
+ var s = plot.series[sidx];
+ var canvas = plot.plugins.funnelRenderer.highlightCanvas;
+ canvas._ctx.clearRect(0,0,canvas._ctx.canvas.width, canvas._ctx.canvas.height);
+ s._highlightedPoint = pidx;
+ plot.plugins.funnelRenderer.highlightedSeriesIndex = sidx;
+ s.renderer.drawSection.call(s, canvas._ctx, s._vertices[pidx], s.highlightColors[pidx], false);
+ }
+
+ function unhighlight (plot) {
+ var canvas = plot.plugins.funnelRenderer.highlightCanvas;
+ canvas._ctx.clearRect(0,0, canvas._ctx.canvas.width, canvas._ctx.canvas.height);
+ for (var i=0; i<plot.series.length; i++) {
+ plot.series[i]._highlightedPoint = null;
+ }
+ plot.plugins.funnelRenderer.highlightedSeriesIndex = null;
+ plot.target.trigger('jqplotDataUnhighlight');
+ }
+
+ function handleMove(ev, gridpos, datapos, neighbor, plot) {
+ if (neighbor) {
+ var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
+ var evt1 = jQuery.Event('jqplotDataMouseOver');
+ evt1.pageX = ev.pageX;
+ evt1.pageY = ev.pageY;
+ plot.target.trigger(evt1, ins);
+ if (plot.series[ins[0]].highlightMouseOver && !(ins[0] == plot.plugins.funnelRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
+ var evt = jQuery.Event('jqplotDataHighlight');
+ evt.which = ev.which;
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ plot.target.trigger(evt, ins);
+ highlight (plot, ins[0], ins[1]);
+ }
+ }
+ else if (neighbor == null) {
+ unhighlight (plot);
+ }
+ }
+
+ function handleMouseDown(ev, gridpos, datapos, neighbor, plot) {
+ if (neighbor) {
+ var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
+ if (plot.series[ins[0]].highlightMouseDown && !(ins[0] == plot.plugins.funnelRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
+ var evt = jQuery.Event('jqplotDataHighlight');
+ evt.which = ev.which;
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ plot.target.trigger(evt, ins);
+ highlight (plot, ins[0], ins[1]);
+ }
+ }
+ else if (neighbor == null) {
+ unhighlight (plot);
+ }
+ }
+
+ function handleMouseUp(ev, gridpos, datapos, neighbor, plot) {
+ var idx = plot.plugins.funnelRenderer.highlightedSeriesIndex;
+ if (idx != null && plot.series[idx].highlightMouseDown) {
+ unhighlight(plot);
+ }
+ }
+
+ function handleClick(ev, gridpos, datapos, neighbor, plot) {
+ if (neighbor) {
+ var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
+ var evt = jQuery.Event('jqplotDataClick');
+ evt.which = ev.which;
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ plot.target.trigger(evt, ins);
+ }
+ }
+
+ function handleRightClick(ev, gridpos, datapos, neighbor, plot) {
+ if (neighbor) {
+ var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
+ var idx = plot.plugins.funnelRenderer.highlightedSeriesIndex;
+ if (idx != null && plot.series[idx].highlightMouseDown) {
+ unhighlight(plot);
+ }
+ var evt = jQuery.Event('jqplotDataRightClick');
+ evt.which = ev.which;
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ plot.target.trigger(evt, ins);
+ }
+ }
+
+ // called within context of plot
+ // create a canvas which we can draw on.
+ // insert it before the eventCanvas, so eventCanvas will still capture events.
+ function postPlotDraw() {
+ // Memory Leaks patch
+ if (this.plugins.funnelRenderer && this.plugins.funnelRenderer.highlightCanvas) {
+ this.plugins.funnelRenderer.highlightCanvas.resetCanvas();
+ this.plugins.funnelRenderer.highlightCanvas = null;
+ }
+
+ this.plugins.funnelRenderer = {};
+ this.plugins.funnelRenderer.highlightCanvas = new $.jqplot.GenericCanvas();
+
+ // do we have any data labels? if so, put highlight canvas before those
+ var labels = $(this.targetId+' .jqplot-data-label');
+ if (labels.length) {
+ $(labels[0]).before(this.plugins.funnelRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-funnelRenderer-highlight-canvas', this._plotDimensions, this));
+ }
+ // else put highlight canvas before event canvas.
+ else {
+ this.eventCanvas._elem.before(this.plugins.funnelRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-funnelRenderer-highlight-canvas', this._plotDimensions, this));
+ }
+ var hctx = this.plugins.funnelRenderer.highlightCanvas.setContext();
+ this.eventCanvas._elem.bind('mouseleave', {plot:this}, function (ev) { unhighlight(ev.data.plot); });
+ }
+
+ $.jqplot.preInitHooks.push(preInit);
+
+ $.jqplot.FunnelTickRenderer = function() {
+ $.jqplot.AxisTickRenderer.call(this);
+ };
+
+ $.jqplot.FunnelTickRenderer.prototype = new $.jqplot.AxisTickRenderer();
+ $.jqplot.FunnelTickRenderer.prototype.constructor = $.jqplot.FunnelTickRenderer;
+
+})(jQuery);
+
+
\ No newline at end of file
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.highlighter.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.highlighter.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.highlighter.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,488 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ */
+(function($) {
+ $.jqplot.eventListenerHooks.push(['jqplotMouseMove', handleMove]);
+
+ /**
+ * Class: $.jqplot.Highlighter
+ * Plugin which will highlight data points when they are moused over.
+ *
+ * To use this plugin, include the js
+ * file in your source:
+ *
+ * > <script type="text/javascript" src="plugins/jqplot.highlighter.js"></script>
+ *
+ * A tooltip providing information about the data point is enabled by default.
+ * To disable the tooltip, set "showTooltip" to false.
+ *
+ * You can control what data is displayed in the tooltip with various
+ * options. The "tooltipAxes" option controls wether the x, y or both
+ * data values are displayed.
+ *
+ * Some chart types (e.g. hi-low-close) have more than one y value per
+ * data point. To display the additional values in the tooltip, set the
+ * "yvalues" option to the desired number of y values present (3 for a hlc chart).
+ *
+ * By default, data values will be formatted with the same formatting
+ * specifiers as used to format the axis ticks. A custom format code
+ * can be supplied with the tooltipFormatString option. This will apply
+ * to all values in the tooltip.
+ *
+ * For more complete control, the "formatString" option can be set. This
+ * Allows conplete control over tooltip formatting. Values are passed to
+ * the format string in an order determined by the "tooltipAxes" and "yvalues"
+ * options. So, if you have a hi-low-close chart and you just want to display
+ * the hi-low-close values in the tooltip, you could set a formatString like:
+ *
+ * > highlighter: {
+ * > tooltipAxes: 'y',
+ * > yvalues: 3,
+ * > formatString:'<table class="jqplot-highlighter">
+ * > <tr><td>hi:</td><td>%s</td></tr>
+ * > <tr><td>low:</td><td>%s</td></tr>
+ * > <tr><td>close:</td><td>%s</td></tr></table>'
+ * > }
+ *
+ */
+ $.jqplot.Highlighter = function(options) {
+ // Group: Properties
+ //
+ //prop: show
+ // true to show the highlight.
+ this.show = $.jqplot.config.enablePlugins;
+ // prop: markerRenderer
+ // Renderer used to draw the marker of the highlighted point.
+ // Renderer will assimilate attributes from the data point being highlighted,
+ // so no attributes need set on the renderer directly.
+ // Default is to turn off shadow drawing on the highlighted point.
+ this.markerRenderer = new $.jqplot.MarkerRenderer({shadow:false});
+ // prop: showMarker
+ // true to show the marker
+ this.showMarker = true;
+ // prop: lineWidthAdjust
+ // Pixels to add to the lineWidth of the highlight.
+ this.lineWidthAdjust = 2.5;
+ // prop: sizeAdjust
+ // Pixels to add to the overall size of the highlight.
+ this.sizeAdjust = 5;
+ // prop: showTooltip
+ // Show a tooltip with data point values.
+ this.showTooltip = true;
+ // prop: tooltipLocation
+ // Where to position tooltip, 'n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw'
+ this.tooltipLocation = 'nw';
+ // prop: fadeTooltip
+ // true = fade in/out tooltip, flase = show/hide tooltip
+ this.fadeTooltip = true;
+ // prop: tooltipFadeSpeed
+ // 'slow', 'def', 'fast', or number of milliseconds.
+ this.tooltipFadeSpeed = "fast";
+ // prop: tooltipOffset
+ // Pixel offset of tooltip from the highlight.
+ this.tooltipOffset = 2;
+ // prop: tooltipAxes
+ // Which axes to display in tooltip, 'x', 'y' or 'both', 'xy' or 'yx'
+ // 'both' and 'xy' are equivalent, 'yx' reverses order of labels.
+ this.tooltipAxes = 'both';
+ // prop; tooltipSeparator
+ // String to use to separate x and y axes in tooltip.
+ this.tooltipSeparator = ', ';
+ // prop; tooltipContentEditor
+ // Function used to edit/augment/replace the formatted tooltip contents.
+ // Called as str = tooltipContentEditor(str, seriesIndex, pointIndex)
+ // where str is the generated tooltip html and seriesIndex and pointIndex identify
+ // the data point being highlighted. Should return the html for the tooltip contents.
+ this.tooltipContentEditor = null;
+ // prop: useAxesFormatters
+ // Use the x and y axes formatters to format the text in the tooltip.
+ this.useAxesFormatters = true;
+ // prop: tooltipFormatString
+ // sprintf format string for the tooltip.
+ // Uses Ash Searle's javascript sprintf implementation
+ // found here: http://hexmen.com/blog/2007/03/printf-sprintf/
+ // See http://perldoc.perl.org/functions/sprintf.html for reference.
+ // Additional "p" and "P" format specifiers added by Chris Leonello.
+ this.tooltipFormatString = '%.5P';
+ // prop: formatString
+ // alternative to tooltipFormatString
+ // will format the whole tooltip text, populating with x, y values as
+ // indicated by tooltipAxes option. So, you could have a tooltip like:
+ // 'Date: %s, number of cats: %d' to format the whole tooltip at one go.
+ // If useAxesFormatters is true, values will be formatted according to
+ // Axes formatters and you can populate your tooltip string with
+ // %s placeholders.
+ this.formatString = null;
+ // prop: yvalues
+ // Number of y values to expect in the data point array.
+ // Typically this is 1. Certain plots, like OHLC, will
+ // have more y values in each data point array.
+ this.yvalues = 1;
+ // prop: bringSeriesToFront
+ // This option requires jQuery 1.4+
+ // True to bring the series of the highlighted point to the front
+ // of other series.
+ this.bringSeriesToFront = false;
+ this._tooltipElem;
+ this.isHighlighting = false;
+ this.currentNeighbor = null;
+
+ $.extend(true, this, options);
+ };
+
+ var locations = ['nw', 'n', 'ne', 'e', 'se', 's', 'sw', 'w'];
+ var locationIndicies = {'nw':0, 'n':1, 'ne':2, 'e':3, 'se':4, 's':5, 'sw':6, 'w':7};
+ var oppositeLocations = ['se', 's', 'sw', 'w', 'nw', 'n', 'ne', 'e'];
+
+ // axis.renderer.tickrenderer.formatter
+
+ // called with scope of plot
+ $.jqplot.Highlighter.init = function (target, data, opts){
+ var options = opts || {};
+ // add a highlighter attribute to the plot
+ this.plugins.highlighter = new $.jqplot.Highlighter(options.highlighter);
+ };
+
+ // called within scope of series
+ $.jqplot.Highlighter.parseOptions = function (defaults, options) {
+ // Add a showHighlight option to the series
+ // and set it to true by default.
+ this.showHighlight = true;
+ };
+
+ // called within context of plot
+ // create a canvas which we can draw on.
+ // insert it before the eventCanvas, so eventCanvas will still capture events.
+ $.jqplot.Highlighter.postPlotDraw = function() {
+ // Memory Leaks patch
+ if (this.plugins.highlighter && this.plugins.highlighter.highlightCanvas) {
+ this.plugins.highlighter.highlightCanvas.resetCanvas();
+ this.plugins.highlighter.highlightCanvas = null;
+ }
+
+ if (this.plugins.highlighter && this.plugins.highlighter._tooltipElem) {
+ this.plugins.highlighter._tooltipElem.emptyForce();
+ this.plugins.highlighter._tooltipElem = null;
+ }
+
+ this.plugins.highlighter.highlightCanvas = new $.jqplot.GenericCanvas();
+
+ this.eventCanvas._elem.before(this.plugins.highlighter.highlightCanvas.createElement(this._gridPadding, 'jqplot-highlight-canvas', this._plotDimensions, this));
+ this.plugins.highlighter.highlightCanvas.setContext();
+
+ var elem = document.createElement('div');
+ this.plugins.highlighter._tooltipElem = $(elem);
+ elem = null;
+ this.plugins.highlighter._tooltipElem.addClass('jqplot-highlighter-tooltip');
+ this.plugins.highlighter._tooltipElem.css({position:'absolute', display:'none'});
+
+ this.eventCanvas._elem.before(this.plugins.highlighter._tooltipElem);
+ };
+
+ $.jqplot.preInitHooks.push($.jqplot.Highlighter.init);
+ $.jqplot.preParseSeriesOptionsHooks.push($.jqplot.Highlighter.parseOptions);
+ $.jqplot.postDrawHooks.push($.jqplot.Highlighter.postPlotDraw);
+
+ function draw(plot, neighbor) {
+ var hl = plot.plugins.highlighter;
+ var s = plot.series[neighbor.seriesIndex];
+ var smr = s.markerRenderer;
+ var mr = hl.markerRenderer;
+ mr.style = smr.style;
+ mr.lineWidth = smr.lineWidth + hl.lineWidthAdjust;
+ mr.size = smr.size + hl.sizeAdjust;
+ var rgba = $.jqplot.getColorComponents(smr.color);
+ var newrgb = [rgba[0], rgba[1], rgba[2]];
+ var alpha = (rgba[3] >= 0.6) ? rgba[3]*0.6 : rgba[3]*(2-rgba[3]);
+ mr.color = 'rgba('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+','+alpha+')';
+ mr.init();
+ mr.draw(s.gridData[neighbor.pointIndex][0], s.gridData[neighbor.pointIndex][1], hl.highlightCanvas._ctx);
+ }
+
+ function showTooltip(plot, series, neighbor) {
+ // neighbor looks like: {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]}
+ // gridData should be x,y pixel coords on the grid.
+ // add the plot._gridPadding to that to get x,y in the target.
+ var hl = plot.plugins.highlighter;
+ var elem = hl._tooltipElem;
+ var serieshl = series.highlighter || {};
+
+ var opts = $.extend(true, {}, hl, serieshl);
+
+ if (opts.useAxesFormatters) {
+ var xf = series._xaxis._ticks[0].formatter;
+ var yf = series._yaxis._ticks[0].formatter;
+ var xfstr = series._xaxis._ticks[0].formatString;
+ var yfstr = series._yaxis._ticks[0].formatString;
+ var str;
+ var xstr = xf(xfstr, neighbor.data[0]);
+ var ystrs = [];
+ for (var i=1; i<opts.yvalues+1; i++) {
+ ystrs.push(yf(yfstr, neighbor.data[i]));
+ }
+ if (typeof opts.formatString === 'string') {
+ switch (opts.tooltipAxes) {
+ case 'both':
+ case 'xy':
+ ystrs.unshift(xstr);
+ ystrs.unshift(opts.formatString);
+ str = $.jqplot.sprintf.apply($.jqplot.sprintf, ystrs);
+ break;
+ case 'yx':
+ ystrs.push(xstr);
+ ystrs.unshift(opts.formatString);
+ str = $.jqplot.sprintf.apply($.jqplot.sprintf, ystrs);
+ break;
+ case 'x':
+ str = $.jqplot.sprintf.apply($.jqplot.sprintf, [opts.formatString, xstr]);
+ break;
+ case 'y':
+ ystrs.unshift(opts.formatString);
+ str = $.jqplot.sprintf.apply($.jqplot.sprintf, ystrs);
+ break;
+ default: // same as xy
+ ystrs.unshift(xstr);
+ ystrs.unshift(opts.formatString);
+ str = $.jqplot.sprintf.apply($.jqplot.sprintf, ystrs);
+ break;
+ }
+ }
+ else {
+ switch (opts.tooltipAxes) {
+ case 'both':
+ case 'xy':
+ str = xstr;
+ for (var i=0; i<ystrs.length; i++) {
+ str += opts.tooltipSeparator + ystrs[i];
+ }
+ break;
+ case 'yx':
+ str = '';
+ for (var i=0; i<ystrs.length; i++) {
+ str += ystrs[i] + opts.tooltipSeparator;
+ }
+ str += xstr;
+ break;
+ case 'x':
+ str = xstr;
+ break;
+ case 'y':
+ str = ystrs.join(opts.tooltipSeparator);
+ break;
+ default: // same as 'xy'
+ str = xstr;
+ for (var i=0; i<ystrs.length; i++) {
+ str += opts.tooltipSeparator + ystrs[i];
+ }
+ break;
+
+ }
+ }
+ }
+ else {
+ var str;
+ if (typeof opts.formatString === 'string') {
+ str = $.jqplot.sprintf.apply($.jqplot.sprintf, [opts.formatString].concat(neighbor.data));
+ }
+
+ else {
+ if (opts.tooltipAxes == 'both' || opts.tooltipAxes == 'xy') {
+ str = $.jqplot.sprintf(opts.tooltipFormatString, neighbor.data[0]) + opts.tooltipSeparator + $.jqplot.sprintf(opts.tooltipFormatString, neighbor.data[1]);
+ }
+ else if (opts.tooltipAxes == 'yx') {
+ str = $.jqplot.sprintf(opts.tooltipFormatString, neighbor.data[1]) + opts.tooltipSeparator + $.jqplot.sprintf(opts.tooltipFormatString, neighbor.data[0]);
+ }
+ else if (opts.tooltipAxes == 'x') {
+ str = $.jqplot.sprintf(opts.tooltipFormatString, neighbor.data[0]);
+ }
+ else if (opts.tooltipAxes == 'y') {
+ str = $.jqplot.sprintf(opts.tooltipFormatString, neighbor.data[1]);
+ }
+ }
+ }
+ if ($.isFunction(opts.tooltipContentEditor)) {
+ // args str, seriesIndex, pointIndex are essential so the hook can look up
+ // extra data for the point.
+ str = opts.tooltipContentEditor(str, neighbor.seriesIndex, neighbor.pointIndex, plot);
+ }
+ elem.html(str);
+ var gridpos = {x:neighbor.gridData[0], y:neighbor.gridData[1]};
+ var ms = 0;
+ var fact = 0.707;
+ if (series.markerRenderer.show == true) {
+ ms = (series.markerRenderer.size + opts.sizeAdjust)/2;
+ }
+
+ var loc = locations;
+ if (series.fillToZero && series.fill && neighbor.data[1] < 0) {
+ loc = oppositeLocations;
+ }
+
+ switch (loc[locationIndicies[opts.tooltipLocation]]) {
+ case 'nw':
+ var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - opts.tooltipOffset - fact * ms;
+ var y = gridpos.y + plot._gridPadding.top - opts.tooltipOffset - elem.outerHeight(true) - fact * ms;
+ break;
+ case 'n':
+ var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true)/2;
+ var y = gridpos.y + plot._gridPadding.top - opts.tooltipOffset - elem.outerHeight(true) - ms;
+ break;
+ case 'ne':
+ var x = gridpos.x + plot._gridPadding.left + opts.tooltipOffset + fact * ms;
+ var y = gridpos.y + plot._gridPadding.top - opts.tooltipOffset - elem.outerHeight(true) - fact * ms;
+ break;
+ case 'e':
+ var x = gridpos.x + plot._gridPadding.left + opts.tooltipOffset + ms;
+ var y = gridpos.y + plot._gridPadding.top - elem.outerHeight(true)/2;
+ break;
+ case 'se':
+ var x = gridpos.x + plot._gridPadding.left + opts.tooltipOffset + fact * ms;
+ var y = gridpos.y + plot._gridPadding.top + opts.tooltipOffset + fact * ms;
+ break;
+ case 's':
+ var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true)/2;
+ var y = gridpos.y + plot._gridPadding.top + opts.tooltipOffset + ms;
+ break;
+ case 'sw':
+ var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - opts.tooltipOffset - fact * ms;
+ var y = gridpos.y + plot._gridPadding.top + opts.tooltipOffset + fact * ms;
+ break;
+ case 'w':
+ var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - opts.tooltipOffset - ms;
+ var y = gridpos.y + plot._gridPadding.top - elem.outerHeight(true)/2;
+ break;
+ default: // same as 'nw'
+ var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - opts.tooltipOffset - fact * ms;
+ var y = gridpos.y + plot._gridPadding.top - opts.tooltipOffset - elem.outerHeight(true) - fact * ms;
+ break;
+ }
+ elem.css('left', x);
+ elem.css('top', y);
+ if (opts.fadeTooltip) {
+ // Fix for stacked up animations. Thnanks Trevor!
+ elem.stop(true,true).fadeIn(opts.tooltipFadeSpeed);
+ }
+ else {
+ elem.show();
+ }
+ elem = null;
+
+ }
+
+ function handleMove(ev, gridpos, datapos, neighbor, plot) {
+ var hl = plot.plugins.highlighter;
+ var c = plot.plugins.cursor;
+ if (hl.show) {
+ if (neighbor == null && hl.isHighlighting) {
+ var evt = jQuery.Event('jqplotHighlighterUnhighlight');
+ plot.target.trigger(evt);
+
+ var ctx = hl.highlightCanvas._ctx;
+ ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
+ if (hl.fadeTooltip) {
+ hl._tooltipElem.fadeOut(hl.tooltipFadeSpeed);
+ }
+ else {
+ hl._tooltipElem.hide();
+ }
+ if (hl.bringSeriesToFront) {
+ plot.restorePreviousSeriesOrder();
+ }
+ hl.isHighlighting = false;
+ hl.currentNeighbor = null;
+ ctx = null;
+ }
+ else if (neighbor != null && plot.series[neighbor.seriesIndex].showHighlight && !hl.isHighlighting) {
+ var evt = jQuery.Event('jqplotHighlighterHighlight');
+ evt.which = ev.which;
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data, plot];
+ plot.target.trigger(evt, ins);
+
+ hl.isHighlighting = true;
+ hl.currentNeighbor = neighbor;
+ if (hl.showMarker) {
+ draw(plot, neighbor);
+ }
+ if (hl.showTooltip && (!c || !c._zoom.started)) {
+ showTooltip(plot, plot.series[neighbor.seriesIndex], neighbor);
+ }
+ if (hl.bringSeriesToFront) {
+ plot.moveSeriesToFront(neighbor.seriesIndex);
+ }
+ }
+ // check to see if we're highlighting the wrong point.
+ else if (neighbor != null && hl.isHighlighting && hl.currentNeighbor != neighbor) {
+ // highlighting the wrong point.
+
+ // if new series allows highlighting, highlight new point.
+ if (plot.series[neighbor.seriesIndex].showHighlight) {
+ var ctx = hl.highlightCanvas._ctx;
+ ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
+ hl.isHighlighting = true;
+ hl.currentNeighbor = neighbor;
+ if (hl.showMarker) {
+ draw(plot, neighbor);
+ }
+ if (hl.showTooltip && (!c || !c._zoom.started)) {
+ showTooltip(plot, plot.series[neighbor.seriesIndex], neighbor);
+ }
+ if (hl.bringSeriesToFront) {
+ plot.moveSeriesToFront(neighbor.seriesIndex);
+ }
+ }
+ }
+ }
+ }
+})(jQuery);
\ No newline at end of file
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.json2.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.json2.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.json2.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,498 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/*
+ 2010-11-01 Chris Leonello
+
+ Slightly modified version of the original json2.js to put JSON
+ functions under the $.jqplot namespace.
+
+ licensing and orignal comments follow:
+
+ http://www.JSON.org/json2.js
+ 2010-08-25
+
+ Public Domain.
+
+ NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
+
+ See http://www.JSON.org/js.html
+
+
+ This code should be minified before deployment.
+ See http://javascript.crockford.com/jsmin.html
+
+ USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
+ NOT CONTROL.
+
+
+ This file creates a global JSON object containing two methods: stringify
+ and parse.
+
+ $.jqplot.JSON.stringify(value, replacer, space)
+ value any JavaScript value, usually an object or array.
+
+ replacer an optional parameter that determines how object
+ values are stringified for objects. It can be a
+ function or an array of strings.
+
+ space an optional parameter that specifies the indentation
+ of nested structures. If it is omitted, the text will
+ be packed without extra whitespace. If it is a number,
+ it will specify the number of spaces to indent at each
+ level. If it is a string (such as '\t' or ' '),
+ it contains the characters used to indent at each level.
+
+ This method produces a JSON text from a JavaScript value.
+
+ When an object value is found, if the object contains a toJSON
+ method, its toJSON method will be called and the result will be
+ stringified. A toJSON method does not serialize: it returns the
+ value represented by the name/value pair that should be serialized,
+ or undefined if nothing should be serialized. The toJSON method
+ will be passed the key associated with the value, and this will be
+ bound to the value
+
+ For example, this would serialize Dates as ISO strings.
+
+ Date.prototype.toJSON = function (key) {
+ function f(n) {
+ // Format integers to have at least two digits.
+ return n < 10 ? '0' + n : n;
+ }
+
+ return this.getUTCFullYear() + '-' +
+ f(this.getUTCMonth() + 1) + '-' +
+ f(this.getUTCDate()) + 'T' +
+ f(this.getUTCHours()) + ':' +
+ f(this.getUTCMinutes()) + ':' +
+ f(this.getUTCSeconds()) + 'Z';
+ };
+
+ You can provide an optional replacer method. It will be passed the
+ key and value of each member, with this bound to the containing
+ object. The value that is returned from your method will be
+ serialized. If your method returns undefined, then the member will
+ be excluded from the serialization.
+
+ If the replacer parameter is an array of strings, then it will be
+ used to select the members to be serialized. It filters the results
+ such that only members with keys listed in the replacer array are
+ stringified.
+
+ Values that do not have JSON representations, such as undefined or
+ functions, will not be serialized. Such values in objects will be
+ dropped; in arrays they will be replaced with null. You can use
+ a replacer function to replace those with JSON values.
+ $.jqplot.JSON.stringify(undefined) returns undefined.
+
+ The optional space parameter produces a stringification of the
+ value that is filled with line breaks and indentation to make it
+ easier to read.
+
+ If the space parameter is a non-empty string, then that string will
+ be used for indentation. If the space parameter is a number, then
+ the indentation will be that many spaces.
+
+ Example:
+
+ text = $.jqplot.JSON.stringify(['e', {pluribus: 'unum'}]);
+ // text is '["e",{"pluribus":"unum"}]'
+
+
+ text = $.jqplot.JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
+ // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
+
+ text = $.jqplot.JSON.stringify([new Date()], function (key, value) {
+ return this[key] instanceof Date ?
+ 'Date(' + this[key] + ')' : value;
+ });
+ // text is '["Date(---current time---)"]'
+
+
+ $.jqplot.JSON.parse(text, reviver)
+ This method parses a JSON text to produce an object or array.
+ It can throw a SyntaxError exception.
+
+ The optional reviver parameter is a function that can filter and
+ transform the results. It receives each of the keys and values,
+ and its return value is used instead of the original value.
+ If it returns what it received, then the structure is not modified.
+ If it returns undefined then the member is deleted.
+
+ Example:
+
+ // Parse the text. Values that look like ISO date strings will
+ // be converted to Date objects.
+
+ myData = $.jqplot.JSON.parse(text, function (key, value) {
+ var a;
+ if (typeof value === 'string') {
+ a =
+/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
+ if (a) {
+ return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
+ +a[5], +a[6]));
+ }
+ }
+ return value;
+ });
+
+ myData = $.jqplot.JSON.parse('["Date(09/09/2001)"]', function (key, value) {
+ var d;
+ if (typeof value === 'string' &&
+ value.slice(0, 5) === 'Date(' &&
+ value.slice(-1) === ')') {
+ d = new Date(value.slice(5, -1));
+ if (d) {
+ return d;
+ }
+ }
+ return value;
+ });
+
+
+ This is a reference implementation. You are free to copy, modify, or
+ redistribute.
+*/
+
+(function($) {
+
+ $.jqplot.JSON = window.JSON;
+
+ if (!window.JSON) {
+ $.jqplot.JSON = {};
+ }
+
+ function f(n) {
+ // Format integers to have at least two digits.
+ return n < 10 ? '0' + n : n;
+ }
+
+ if (typeof Date.prototype.toJSON !== 'function') {
+
+ Date.prototype.toJSON = function (key) {
+
+ return isFinite(this.valueOf()) ?
+ this.getUTCFullYear() + '-' +
+ f(this.getUTCMonth() + 1) + '-' +
+ f(this.getUTCDate()) + 'T' +
+ f(this.getUTCHours()) + ':' +
+ f(this.getUTCMinutes()) + ':' +
+ f(this.getUTCSeconds()) + 'Z' : null;
+ };
+
+ String.prototype.toJSON =
+ Number.prototype.toJSON =
+ Boolean.prototype.toJSON = function (key) {
+ return this.valueOf();
+ };
+ }
+
+ var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
+ escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
+ gap,
+ indent,
+ meta = { // table of character substitutions
+ '\b': '\\b',
+ '\t': '\\t',
+ '\n': '\\n',
+ '\f': '\\f',
+ '\r': '\\r',
+ '"' : '\\"',
+ '\\': '\\\\'
+ },
+ rep;
+
+
+ function quote(string) {
+
+// If the string contains no control characters, no quote characters, and no
+// backslash characters, then we can safely slap some quotes around it.
+// Otherwise we must also replace the offending characters with safe escape
+// sequences.
+
+ escapable.lastIndex = 0;
+ return escapable.test(string) ?
+ '"' + string.replace(escapable, function (a) {
+ var c = meta[a];
+ return typeof c === 'string' ? c :
+ '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
+ }) + '"' :
+ '"' + string + '"';
+ }
+
+
+ function str(key, holder) {
+
+// Produce a string from holder[key].
+
+ var i, // The loop counter.
+ k, // The member key.
+ v, // The member value.
+ length,
+ mind = gap,
+ partial,
+ value = holder[key];
+
+// If the value has a toJSON method, call it to obtain a replacement value.
+
+ if (value && typeof value === 'object' &&
+ typeof value.toJSON === 'function') {
+ value = value.toJSON(key);
+ }
+
+// If we were called with a replacer function, then call the replacer to
+// obtain a replacement value.
+
+ if (typeof rep === 'function') {
+ value = rep.call(holder, key, value);
+ }
+
+// What happens next depends on the value's type.
+
+ switch (typeof value) {
+ case 'string':
+ return quote(value);
+
+ case 'number':
+
+// JSON numbers must be finite. Encode non-finite numbers as null.
+
+ return isFinite(value) ? String(value) : 'null';
+
+ case 'boolean':
+ case 'null':
+
+// If the value is a boolean or null, convert it to a string. Note:
+// typeof null does not produce 'null'. The case is included here in
+// the remote chance that this gets fixed someday.
+
+ return String(value);
+
+// If the type is 'object', we might be dealing with an object or an array or
+// null.
+
+ case 'object':
+
+// Due to a specification blunder in ECMAScript, typeof null is 'object',
+// so watch out for that case.
+
+ if (!value) {
+ return 'null';
+ }
+
+// Make an array to hold the partial results of stringifying this object value.
+
+ gap += indent;
+ partial = [];
+
+// Is the value an array?
+
+ if (Object.prototype.toString.apply(value) === '[object Array]') {
+
+// The value is an array. Stringify every element. Use null as a placeholder
+// for non-JSON values.
+
+ length = value.length;
+ for (i = 0; i < length; i += 1) {
+ partial[i] = str(i, value) || 'null';
+ }
+
+// Join all of the elements together, separated with commas, and wrap them in
+// brackets.
+
+ v = partial.length === 0 ? '[]' :
+ gap ? '[\n' + gap +
+ partial.join(',\n' + gap) + '\n' +
+ mind + ']' :
+ '[' + partial.join(',') + ']';
+ gap = mind;
+ return v;
+ }
+
+// If the replacer is an array, use it to select the members to be stringified.
+
+ if (rep && typeof rep === 'object') {
+ length = rep.length;
+ for (i = 0; i < length; i += 1) {
+ k = rep[i];
+ if (typeof k === 'string') {
+ v = str(k, value);
+ if (v) {
+ partial.push(quote(k) + (gap ? ': ' : ':') + v);
+ }
+ }
+ }
+ } else {
+
+// Otherwise, iterate through all of the keys in the object.
+
+ for (k in value) {
+ if (Object.hasOwnProperty.call(value, k)) {
+ v = str(k, value);
+ if (v) {
+ partial.push(quote(k) + (gap ? ': ' : ':') + v);
+ }
+ }
+ }
+ }
+
+// Join all of the member texts together, separated with commas,
+// and wrap them in braces.
+
+ v = partial.length === 0 ? '{}' :
+ gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +
+ mind + '}' : '{' + partial.join(',') + '}';
+ gap = mind;
+ return v;
+ }
+ }
+
+// If the JSON object does not yet have a stringify method, give it one.
+
+ if (typeof $.jqplot.JSON.stringify !== 'function') {
+ $.jqplot.JSON.stringify = function (value, replacer, space) {
+
+// The stringify method takes a value and an optional replacer, and an optional
+// space parameter, and returns a JSON text. The replacer can be a function
+// that can replace values, or an array of strings that will select the keys.
+// A default replacer method can be provided. Use of the space parameter can
+// produce text that is more easily readable.
+
+ var i;
+ gap = '';
+ indent = '';
+
+// If the space parameter is a number, make an indent string containing that
+// many spaces.
+
+ if (typeof space === 'number') {
+ for (i = 0; i < space; i += 1) {
+ indent += ' ';
+ }
+
+// If the space parameter is a string, it will be used as the indent string.
+
+ } else if (typeof space === 'string') {
+ indent = space;
+ }
+
+// If there is a replacer, it must be a function or an array.
+// Otherwise, throw an error.
+
+ rep = replacer;
+ if (replacer && typeof replacer !== 'function' &&
+ (typeof replacer !== 'object' ||
+ typeof replacer.length !== 'number')) {
+ throw new Error('$.jqplot.JSON.stringify');
+ }
+
+// Make a fake root object containing our value under the key of ''.
+// Return the result of stringifying the value.
+
+ return str('', {'': value});
+ };
+ }
+
+
+// If the JSON object does not yet have a parse method, give it one.
+
+ if (typeof $.jqplot.JSON.parse !== 'function') {
+ $.jqplot.JSON.parse = function (text, reviver) {
+
+// The parse method takes a text and an optional reviver function, and returns
+// a JavaScript value if the text is a valid JSON text.
+
+ var j;
+
+ function walk(holder, key) {
+
+// The walk method is used to recursively walk the resulting structure so
+// that modifications can be made.
+
+ var k, v, value = holder[key];
+ if (value && typeof value === 'object') {
+ for (k in value) {
+ if (Object.hasOwnProperty.call(value, k)) {
+ v = walk(value, k);
+ if (v !== undefined) {
+ value[k] = v;
+ } else {
+ delete value[k];
+ }
+ }
+ }
+ }
+ return reviver.call(holder, key, value);
+ }
+
+
+// Parsing happens in four stages. In the first stage, we replace certain
+// Unicode characters with escape sequences. JavaScript handles many characters
+// incorrectly, either silently deleting them, or treating them as line endings.
+
+ text = String(text);
+ cx.lastIndex = 0;
+ if (cx.test(text)) {
+ text = text.replace(cx, function (a) {
+ return '\\u' +
+ ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
+ });
+ }
+
+// In the second stage, we run the text against regular expressions that look
+// for non-JSON patterns. We are especially concerned with '()' and 'new'
+// because they can cause invocation, and '=' because it can cause mutation.
+// But just to be safe, we want to reject all unexpected forms.
+
+// We split the second stage into 4 regexp operations in order to work around
+// crippling inefficiencies in IE's and Safari's regexp engines. First we
+// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
+// replace all simple value tokens with ']' characters. Third, we delete all
+// open brackets that follow a colon or comma or that begin the text. Finally,
+// we look to see that the remaining characters are only whitespace or ']' or
+// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
+
+ if (/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
+
+// In the third stage we use the eval function to compile the text into a
+// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
+// in JavaScript: it can begin a block or an object literal. We wrap the text
+// in parens to eliminate the ambiguity.
+
+ j = eval('(' + text + ')');
+
+// In the optional fourth stage, we recursively walk the new structure, passing
+// each name/value pair to a reviver function for possible transformation.
+
+ return typeof reviver === 'function' ?
+ walk({'': j}, '') : j;
+ }
+
+// If the text is not JSON parseable, then a SyntaxError is thrown.
+
+ throw new SyntaxError('$.jqplot.JSON.parse');
+ };
+ }
+})(jQuery);
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.logAxisRenderer.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.logAxisRenderer.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.logAxisRenderer.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,552 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ */
+(function($) {
+ /**
+ * class: $.jqplot.LogAxisRenderer
+ * A plugin for a jqPlot to render a logarithmic axis.
+ *
+ * To use this renderer, include the plugin in your source
+ * > <script type="text/javascript" language="javascript" src="plugins/jqplot.logAxisRenderer.js"></script>
+ *
+ * and supply the appropriate options to your plot
+ *
+ * > {axes:{xaxis:{renderer:$.jqplot.LogAxisRenderer}}}
+ **/
+ $.jqplot.LogAxisRenderer = function() {
+ $.jqplot.LinearAxisRenderer.call(this);
+ // prop: axisDefaults
+ // Default properties which will be applied directly to the series.
+ //
+ // Group: Properties
+ //
+ // Properties
+ //
+ // base - the logarithmic base, commonly 2, 10 or Math.E
+ // tickDistribution - Deprecated. "power" distribution of ticks
+ // always used. Option has no effect.
+ this.axisDefaults = {
+ base : 10,
+ tickDistribution :'power'
+ };
+ };
+
+ $.jqplot.LogAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer();
+ $.jqplot.LogAxisRenderer.prototype.constructor = $.jqplot.LogAxisRenderer;
+
+ $.jqplot.LogAxisRenderer.prototype.init = function(options) {
+ // prop: drawBaseline
+ // True to draw the axis baseline.
+ this.drawBaseline = true;
+ // prop: minorTicks
+ // Number of ticks to add between "major" ticks.
+ // Major ticks are ticks supplied by user or auto computed.
+ // Minor ticks cannot be created by user.
+ this.minorTicks = 'auto';
+ this._scalefact = 1.0;
+
+ $.extend(true, this, options);
+
+ this._autoFormatString = '%d';
+ this._overrideFormatString = false;
+
+ for (var d in this.renderer.axisDefaults) {
+ if (this[d] == null) {
+ this[d] = this.renderer.axisDefaults[d];
+ }
+ }
+
+ this.resetDataBounds();
+ };
+
+ $.jqplot.LogAxisRenderer.prototype.createTicks = function(plot) {
+ // we're are operating on an axis here
+ var ticks = this._ticks;
+ var userTicks = this.ticks;
+ var name = this.name;
+ var db = this._dataBounds;
+ var dim = (this.name.charAt(0) === 'x') ? this._plotDimensions.width : this._plotDimensions.height;
+ var interval;
+ var min, max;
+ var pos1, pos2;
+ var tt, i;
+
+ var threshold = 30;
+ // For some reason scalefactor is screwing up ticks.
+ this._scalefact = (Math.max(dim, threshold+1) - threshold)/300;
+
+ // if we already have ticks, use them.
+ // ticks must be in order of increasing value.
+ if (userTicks.length) {
+ // ticks could be 1D or 2D array of [val, val, ,,,] or [[val, label], [val, label], ...] or mixed
+ for (i=0; i<userTicks.length; i++){
+ var ut = userTicks[i];
+ var t = new this.tickRenderer(this.tickOptions);
+ if (ut.constructor == Array) {
+ t.value = ut[0];
+ t.label = ut[1];
+ if (!this.showTicks) {
+ t.showLabel = false;
+ t.showMark = false;
+ }
+ else if (!this.showTickMarks) {
+ t.showMark = false;
+ }
+ t.setTick(ut[0], this.name);
+ this._ticks.push(t);
+ }
+
+ else if ($.isPlainObject(ut)) {
+ $.extend(true, t, ut);
+ t.axis = this.name;
+ this._ticks.push(t);
+ }
+
+ else {
+ t.value = ut;
+ if (!this.showTicks) {
+ t.showLabel = false;
+ t.showMark = false;
+ }
+ else if (!this.showTickMarks) {
+ t.showMark = false;
+ }
+ t.setTick(ut, this.name);
+ this._ticks.push(t);
+ }
+ }
+ this.numberTicks = userTicks.length;
+ this.min = this._ticks[0].value;
+ this.max = this._ticks[this.numberTicks-1].value;
+ }
+
+ // we don't have any ticks yet, let's make some!
+ else if (this.min == null && this.max == null) {
+ min = db.min * (2 - this.padMin);
+ max = db.max * this.padMax;
+
+ // if min and max are same, space them out a bit
+ if (min == max) {
+ var adj = 0.05;
+ min = min*(1-adj);
+ max = max*(1+adj);
+ }
+
+ // perform some checks
+ if (this.min != null && this.min <= 0) {
+ throw('log axis minimum must be greater than 0');
+ }
+ if (this.max != null && this.max <= 0) {
+ throw('log axis maximum must be greater than 0');
+ }
+
+ function findCeil (val) {
+ var order = Math.pow(10, Math.floor(Math.log(val)/Math.LN10));
+ return Math.ceil(val/order) * order;
+ }
+
+ function findFloor(val) {
+ var order = Math.pow(10, Math.floor(Math.log(val)/Math.LN10));
+ return Math.floor(val/order) * order;
+ }
+
+ // var range = max - min;
+ var rmin, rmax;
+
+ // for power distribution, open up range to get a nice power of axis.renderer.base.
+ // power distribution won't respect the user's min/max settings.
+ rmin = Math.pow(this.base, Math.floor(Math.log(min)/Math.log(this.base)));
+ rmax = Math.pow(this.base, Math.ceil(Math.log(max)/Math.log(this.base)));
+
+ // // if min and max are same, space them out a bit
+ // if (rmin === rmax) {
+ // var adj = 0.05;
+ // rmin = rmin*(1-adj);
+ // rmax = rmax*(1+adj);
+ // }
+
+ var order = Math.round(Math.log(rmin)/Math.LN10);
+
+ if (this.tickOptions == null || !this.tickOptions.formatString) {
+ this._overrideFormatString = true;
+ }
+
+ this.min = rmin;
+ this.max = rmax;
+ var range = this.max - this.min;
+
+ var minorTicks = (this.minorTicks === 'auto') ? 0 : this.minorTicks;
+ var numberTicks;
+ if (this.numberTicks == null){
+ if (dim > 140) {
+ numberTicks = Math.round(Math.log(this.max/this.min)/Math.log(this.base) + 1);
+ if (numberTicks < 2) {
+ numberTicks = 2;
+ }
+ if (minorTicks === 0) {
+ var temp = dim/(numberTicks - 1);
+ if (temp < 100) {
+ minorTicks = 0;
+ }
+ else if (temp < 190) {
+ minorTicks = 1;
+ }
+ else if (temp < 250) {
+ minorTicks = 3;
+ }
+ else if (temp < 600) {
+ minorTicks = 4;
+ }
+ else {
+ minorTicks = 9;
+ }
+ }
+ }
+ else {
+ numberTicks = 2;
+ if (minorTicks === 0) {
+ minorTicks = 1;
+ }
+ minorTicks = 0;
+ }
+ }
+ else {
+ numberTicks = this.numberTicks;
+ }
+
+ if (order >= 0 && minorTicks !== 3) {
+ this._autoFormatString = '%d';
+ }
+ // Adjust format string for case with 3 ticks where we'll have like 1, 2.5, 5, 7.5, 10
+ else if (order <= 0 && minorTicks === 3) {
+ var temp = -(order - 1);
+ this._autoFormatString = '%.'+ Math.abs(order-1) + 'f';
+ }
+
+ // Adjust format string for values less than 1.
+ else if (order < 0) {
+ var temp = -order;
+ this._autoFormatString = '%.'+ Math.abs(order) + 'f';
+ }
+
+ else {
+ this._autoFormatString = '%d';
+ }
+
+ var to, t, val, tt1, spread, interval;
+ for (var i=0; i<numberTicks; i++){
+ tt = Math.pow(this.base, i - numberTicks + 1) * this.max;
+
+ t = new this.tickRenderer(this.tickOptions);
+
+ if (this._overrideFormatString) {
+ t.formatString = this._autoFormatString;
+ }
+
+ if (!this.showTicks) {
+ t.showLabel = false;
+ t.showMark = false;
+ }
+ else if (!this.showTickMarks) {
+ t.showMark = false;
+ }
+ t.setTick(tt, this.name);
+ this._ticks.push(t);
+
+ if (minorTicks && i<numberTicks-1) {
+ tt1 = Math.pow(this.base, i - numberTicks + 2) * this.max;
+ spread = tt1 - tt;
+ interval = tt1 / (minorTicks+1);
+ for (var j=minorTicks-1; j>=0; j--) {
+ val = tt1-interval*(j+1);
+ t = new this.tickRenderer(this.tickOptions);
+
+ if (this._overrideFormatString && this._autoFormatString != '') {
+ t.formatString = this._autoFormatString;
+ }
+ if (!this.showTicks) {
+ t.showLabel = false;
+ t.showMark = false;
+ }
+ else if (!this.showTickMarks) {
+ t.showMark = false;
+ }
+ t.setTick(val, this.name);
+ this._ticks.push(t);
+ }
+ }
+ }
+ }
+
+ // min and max are set as would be the case with zooming
+ else if (this.min != null && this.max != null) {
+ var opts = $.extend(true, {}, this.tickOptions, {name: this.name, value: null});
+ var nt, ti;
+ // don't have an interval yet, pick one that gives the most
+ // "round" ticks we can get.
+ if (this.numberTicks == null && this.tickInterval == null) {
+ // var threshold = 30;
+ var tdim = Math.max(dim, threshold+1);
+ var nttarget = Math.ceil((tdim-threshold)/35 + 1);
+
+ var ret = $.jqplot.LinearTickGenerator.bestConstrainedInterval(this.min, this.max, nttarget);
+
+ this._autoFormatString = ret[3];
+ nt = ret[2];
+ ti = ret[4];
+
+ for (var i=0; i<nt; i++) {
+ opts.value = this.min + i * ti;
+ t = new this.tickRenderer(opts);
+
+ if (this._overrideFormatString && this._autoFormatString != '') {
+ t.formatString = this._autoFormatString;
+ }
+ if (!this.showTicks) {
+ t.showLabel = false;
+ t.showMark = false;
+ }
+ else if (!this.showTickMarks) {
+ t.showMark = false;
+ }
+ this._ticks.push(t);
+ }
+ }
+
+ // for loose zoom, number ticks and interval are also set.
+ else if (this.numberTicks != null && this.tickInterval != null) {
+ nt = this.numberTicks;
+ for (var i=0; i<nt; i++) {
+ opts.value = this.min + i * this.tickInterval;
+ t = new this.tickRenderer(opts);
+
+ if (this._overrideFormatString && this._autoFormatString != '') {
+ t.formatString = this._autoFormatString;
+ }
+ if (!this.showTicks) {
+ t.showLabel = false;
+ t.showMark = false;
+ }
+ else if (!this.showTickMarks) {
+ t.showMark = false;
+ }
+ this._ticks.push(t);
+ }
+ }
+ }
+ };
+
+ $.jqplot.LogAxisRenderer.prototype.pack = function(pos, offsets) {
+ var lb = parseInt(this.base, 10);
+ var ticks = this._ticks;
+ var trans = function (v) { return Math.log(v)/Math.log(lb); };
+ var invtrans = function (v) { return Math.pow(Math.E, (Math.log(lb)*v)); };
+ var max = trans(this.max);
+ var min = trans(this.min);
+ var offmax = offsets.max;
+ var offmin = offsets.min;
+ var lshow = (this._label == null) ? false : this._label.show;
+
+ for (var p in pos) {
+ this._elem.css(p, pos[p]);
+ }
+
+ this._offsets = offsets;
+ // pixellength will be + for x axes and - for y axes becasue pixels always measured from top left.
+ var pixellength = offmax - offmin;
+ var unitlength = max - min;
+
+ // point to unit and unit to point conversions references to Plot DOM element top left corner.
+ this.p2u = function(p){
+ return invtrans((p - offmin) * unitlength / pixellength + min);
+ };
+
+ this.u2p = function(u){
+ return (trans(u) - min) * pixellength / unitlength + offmin;
+ };
+
+ if (this.name == 'xaxis' || this.name == 'x2axis'){
+ this.series_u2p = function(u){
+ return (trans(u) - min) * pixellength / unitlength;
+ };
+ this.series_p2u = function(p){
+ return invtrans(p * unitlength / pixellength + min);
+ };
+ }
+ // yaxis is max at top of canvas.
+ else {
+ this.series_u2p = function(u){
+ return (trans(u) - max) * pixellength / unitlength;
+ };
+ this.series_p2u = function(p){
+ return invtrans(p * unitlength / pixellength + max);
+ };
+ }
+
+ if (this.show) {
+ if (this.name == 'xaxis' || this.name == 'x2axis') {
+ for (var i=0; i<ticks.length; i++) {
+ var t = ticks[i];
+ if (t.show && t.showLabel) {
+ var shim;
+
+ if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) {
+ switch (t.labelPosition) {
+ case 'auto':
+ // position at end
+ if (t.angle < 0) {
+ shim = -t.getWidth() + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
+ }
+ // position at start
+ else {
+ shim = -t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
+ }
+ break;
+ case 'end':
+ shim = -t.getWidth() + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
+ break;
+ case 'start':
+ shim = -t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
+ break;
+ case 'middle':
+ shim = -t.getWidth()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
+ break;
+ default:
+ shim = -t.getWidth()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
+ break;
+ }
+ }
+ else {
+ shim = -t.getWidth()/2;
+ }
+ // var shim = t.getWidth()/2;
+ var val = this.u2p(t.value) + shim + 'px';
+ t._elem.css('left', val);
+ t.pack();
+ }
+ }
+ if (lshow) {
+ var w = this._label._elem.outerWidth(true);
+ this._label._elem.css('left', offmin + pixellength/2 - w/2 + 'px');
+ if (this.name == 'xaxis') {
+ this._label._elem.css('bottom', '0px');
+ }
+ else {
+ this._label._elem.css('top', '0px');
+ }
+ this._label.pack();
+ }
+ }
+ else {
+ for (var i=0; i<ticks.length; i++) {
+ var t = ticks[i];
+ if (t.show && t.showLabel) {
+ var shim;
+ if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) {
+ switch (t.labelPosition) {
+ case 'auto':
+ // position at end
+ case 'end':
+ if (t.angle < 0) {
+ shim = -t._textRenderer.height * Math.cos(-t._textRenderer.angle) / 2;
+ }
+ else {
+ shim = -t.getHeight() + t._textRenderer.height * Math.cos(t._textRenderer.angle) / 2;
+ }
+ break;
+ case 'start':
+ if (t.angle > 0) {
+ shim = -t._textRenderer.height * Math.cos(-t._textRenderer.angle) / 2;
+ }
+ else {
+ shim = -t.getHeight() + t._textRenderer.height * Math.cos(t._textRenderer.angle) / 2;
+ }
+ break;
+ case 'middle':
+ // if (t.angle > 0) {
+ // shim = -t.getHeight()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
+ // }
+ // else {
+ // shim = -t.getHeight()/2 - t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
+ // }
+ shim = -t.getHeight()/2;
+ break;
+ default:
+ shim = -t.getHeight()/2;
+ break;
+ }
+ }
+ else {
+ shim = -t.getHeight()/2;
+ }
+
+ var val = this.u2p(t.value) + shim + 'px';
+ t._elem.css('top', val);
+ t.pack();
+ }
+ }
+ if (lshow) {
+ var h = this._label._elem.outerHeight(true);
+ this._label._elem.css('top', offmax - pixellength/2 - h/2 + 'px');
+ if (this.name == 'yaxis') {
+ this._label._elem.css('left', '0px');
+ }
+ else {
+ this._label._elem.css('right', '0px');
+ }
+ this._label.pack();
+ }
+ }
+ }
+ };
+})(jQuery);
\ No newline at end of file
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.mekkoAxisRenderer.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.mekkoAxisRenderer.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.mekkoAxisRenderer.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,634 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ */
+(function($) {
+ // class: $.jqplot.MekkoAxisRenderer
+ // An axis renderer for a Mekko chart.
+ // Should be used with a Mekko chart where the mekkoRenderer is used on the series.
+ // Displays the Y axis as a range from 0 to 1 (0 to 100%) and the x axis with a tick
+ // for each series scaled to the sum of all the y values.
+ $.jqplot.MekkoAxisRenderer = function() {
+ };
+
+ // called with scope of axis object.
+ $.jqplot.MekkoAxisRenderer.prototype.init = function(options){
+ // prop: tickMode
+ // How to space the ticks on the axis.
+ // 'bar' will place a tick at the width of each bar.
+ // This is the default for the x axis.
+ // 'even' will place ticks at even intervals. This is
+ // the default for x2 axis and y axis. y axis cannot be changed.
+ this.tickMode;
+ // prop: barLabelRenderer
+ // renderer to use to draw labels under each bar.
+ this.barLabelRenderer = $.jqplot.AxisLabelRenderer;
+ // prop: barLabels
+ // array of labels to put under each bar.
+ this.barLabels = this.barLabels || [];
+ // prop: barLabelOptions
+ // options object to pass to the bar label renderer.
+ this.barLabelOptions = {};
+ this.tickOptions = $.extend(true, {showGridline:false}, this.tickOptions);
+ this._barLabels = [];
+ $.extend(true, this, options);
+ if (this.name == 'yaxis') {
+ this.tickOptions.formatString = this.tickOptions.formatString || "%d\%";
+ }
+ var db = this._dataBounds;
+ db.min = 0;
+ // for y axes, scale always go from 0 to 1 (0 to 100%)
+ if (this.name == 'yaxis' || this.name == 'y2axis') {
+ db.max = 100;
+ this.tickMode = 'even';
+ }
+ // For x axes, scale goes from 0 to sum of all y values.
+ else if (this.name == 'xaxis'){
+ this.tickMode = (this.tickMode == null) ? 'bar' : this.tickMode;
+ for (var i=0; i<this._series.length; i++) {
+ db.max += this._series[i]._sumy;
+ }
+ }
+ else if (this.name == 'x2axis'){
+ this.tickMode = (this.tickMode == null) ? 'even' : this.tickMode;
+ for (var i=0; i<this._series.length; i++) {
+ db.max += this._series[i]._sumy;
+ }
+ }
+ };
+
+ // called with scope of axis
+ $.jqplot.MekkoAxisRenderer.prototype.draw = function(ctx, plot) {
+ if (this.show) {
+ // populate the axis label and value properties.
+ // createTicks is a method on the renderer, but
+ // call it within the scope of the axis.
+ this.renderer.createTicks.call(this);
+ // fill a div with axes labels in the right direction.
+ // Need to pregenerate each axis to get it's bounds and
+ // position it and the labels correctly on the plot.
+ var dim=0;
+ var temp;
+
+ var elem = document.createElement('div');
+ this._elem = $(elem);
+ this._elem.addClass('jqplot-axis jqplot-'+this.name);
+ this._elem.css('position', 'absolute');
+ elem = null;
+
+ if (this.name == 'xaxis' || this.name == 'x2axis') {
+ this._elem.width(this._plotDimensions.width);
+ }
+ else {
+ this._elem.height(this._plotDimensions.height);
+ }
+
+ // draw the axis label
+ // create a _label object.
+ this.labelOptions.axis = this.name;
+ this._label = new this.labelRenderer(this.labelOptions);
+ if (this._label.show) {
+ this._elem.append(this._label.draw(ctx));
+ }
+
+ var t, tick, elem;
+ if (this.showTicks) {
+ t = this._ticks;
+ for (var i=0; i<t.length; i++) {
+ tick = t[i];
+ if (tick.showLabel && (!tick.isMinorTick || this.showMinorTicks)) {
+ this._elem.append(tick.draw(ctx));
+ }
+ }
+ }
+
+ // draw the series labels
+ for (i=0; i<this.barLabels.length; i++) {
+ this.barLabelOptions.axis = this.name;
+ this.barLabelOptions.label = this.barLabels[i];
+ this._barLabels.push(new this.barLabelRenderer(this.barLabelOptions));
+ if (this.tickMode != 'bar') {
+ this._barLabels[i].show = false;
+ }
+ if (this._barLabels[i].show) {
+ var elem = this._barLabels[i].draw(ctx, plot);
+ elem.removeClass('jqplot-'+this.name+'-label');
+ elem.addClass('jqplot-'+this.name+'-tick');
+ elem.addClass('jqplot-mekko-barLabel');
+ elem.appendTo(this._elem);
+ elem = null;
+ }
+ }
+
+ }
+ return this._elem;
+ };
+
+ // called with scope of an axis
+ $.jqplot.MekkoAxisRenderer.prototype.reset = function() {
+ this.min = this._min;
+ this.max = this._max;
+ this.tickInterval = this._tickInterval;
+ this.numberTicks = this._numberTicks;
+ // this._ticks = this.__ticks;
+ };
+
+ // called with scope of axis
+ $.jqplot.MekkoAxisRenderer.prototype.set = function() {
+ var dim = 0;
+ var temp;
+ var w = 0;
+ var h = 0;
+ var lshow = (this._label == null) ? false : this._label.show;
+ if (this.show && this.showTicks) {
+ var t = this._ticks;
+ for (var i=0; i<t.length; i++) {
+ var tick = t[i];
+ if (tick.showLabel && (!tick.isMinorTick || this.showMinorTicks)) {
+ if (this.name == 'xaxis' || this.name == 'x2axis') {
+ temp = tick._elem.outerHeight(true);
+ }
+ else {
+ temp = tick._elem.outerWidth(true);
+ }
+ if (temp > dim) {
+ dim = temp;
+ }
+ }
+ }
+
+ if (lshow) {
+ w = this._label._elem.outerWidth(true);
+ h = this._label._elem.outerHeight(true);
+ }
+ if (this.name == 'xaxis') {
+ dim = dim + h;
+ this._elem.css({'height':dim+'px', left:'0px', bottom:'0px'});
+ }
+ else if (this.name == 'x2axis') {
+ dim = dim + h;
+ this._elem.css({'height':dim+'px', left:'0px', top:'0px'});
+ }
+ else if (this.name == 'yaxis') {
+ dim = dim + w;
+ this._elem.css({'width':dim+'px', left:'0px', top:'0px'});
+ if (lshow && this._label.constructor == $.jqplot.AxisLabelRenderer) {
+ this._label._elem.css('width', w+'px');
+ }
+ }
+ else {
+ dim = dim + w;
+ this._elem.css({'width':dim+'px', right:'0px', top:'0px'});
+ if (lshow && this._label.constructor == $.jqplot.AxisLabelRenderer) {
+ this._label._elem.css('width', w+'px');
+ }
+ }
+ }
+ };
+
+ // called with scope of axis
+ $.jqplot.MekkoAxisRenderer.prototype.createTicks = function() {
+ // we're are operating on an axis here
+ var ticks = this._ticks;
+ var userTicks = this.ticks;
+ var name = this.name;
+ // databounds were set on axis initialization.
+ var db = this._dataBounds;
+ var dim, interval;
+ var min, max;
+ var pos1, pos2;
+ var t, tt, i, j;
+
+ // if we already have ticks, use them.
+ // ticks must be in order of increasing value.
+
+ if (userTicks.length) {
+ // ticks could be 1D or 2D array of [val, val, ,,,] or [[val, label], [val, label], ...] or mixed
+ for (i=0; i<userTicks.length; i++){
+ var ut = userTicks[i];
+ var t = new this.tickRenderer(this.tickOptions);
+ if (ut.constructor == Array) {
+ t.value = ut[0];
+ t.label = ut[1];
+ if (!this.showTicks) {
+ t.showLabel = false;
+ t.showMark = false;
+ }
+ else if (!this.showTickMarks) {
+ t.showMark = false;
+ }
+ t.setTick(ut[0], this.name);
+ this._ticks.push(t);
+ }
+
+ else {
+ t.value = ut;
+ if (!this.showTicks) {
+ t.showLabel = false;
+ t.showMark = false;
+ }
+ else if (!this.showTickMarks) {
+ t.showMark = false;
+ }
+ t.setTick(ut, this.name);
+ this._ticks.push(t);
+ }
+ }
+ this.numberTicks = userTicks.length;
+ this.min = this._ticks[0].value;
+ this.max = this._ticks[this.numberTicks-1].value;
+ this.tickInterval = (this.max - this.min) / (this.numberTicks - 1);
+ }
+
+ // we don't have any ticks yet, let's make some!
+ else {
+ if (name == 'xaxis' || name == 'x2axis') {
+ dim = this._plotDimensions.width;
+ }
+ else {
+ dim = this._plotDimensions.height;
+ }
+
+ // if min, max and number of ticks specified, user can't specify interval.
+ if (this.min != null && this.max != null && this.numberTicks != null) {
+ this.tickInterval = null;
+ }
+
+ min = (this.min != null) ? this.min : db.min;
+ max = (this.max != null) ? this.max : db.max;
+
+ // if min and max are same, space them out a bit.+
+ if (min == max) {
+ var adj = 0.05;
+ if (min > 0) {
+ adj = Math.max(Math.log(min)/Math.LN10, 0.05);
+ }
+ min -= adj;
+ max += adj;
+ }
+
+ var range = max - min;
+ var rmin, rmax;
+ var temp, prev, curr;
+ var ynumticks = [3,5,6,11,21];
+
+ // yaxis divide ticks in nice intervals from 0 to 1.
+ if (this.name == 'yaxis' || this.name == 'y2axis') {
+ this.min = 0;
+ this.max = 100;
+ // user didn't specify number of ticks.
+ if (!this.numberTicks){
+ if (this.tickInterval) {
+ this.numberTicks = 3 + Math.ceil(range / this.tickInterval);
+ }
+ else {
+ temp = 2 + Math.ceil((dim-(this.tickSpacing-1))/this.tickSpacing);
+ for (i=0; i<ynumticks.length; i++) {
+ curr = temp/ynumticks[i];
+ if (curr == 1) {
+ this.numberTicks = ynumticks[i];
+ break;
+ }
+ else if (curr > 1) {
+ prev = curr;
+ continue;
+ }
+ else if (curr < 1) {
+ // was prev or is curr closer to one?
+ if (Math.abs(prev - 1) < Math.abs(curr - 1)) {
+ this.numberTicks = ynumticks[i-1];
+ break;
+ }
+ else {
+ this.numberTicks = ynumticks[i];
+ break;
+ }
+ }
+ else if (i == ynumticks.length -1) {
+ this.numberTicks = ynumticks[i];
+ }
+ }
+ this.tickInterval = range / (this.numberTicks - 1);
+ }
+ }
+
+ // user did specify number of ticks.
+ else {
+ this.tickInterval = range / (this.numberTicks - 1);
+ }
+
+ for (var i=0; i<this.numberTicks; i++){
+ tt = this.min + i * this.tickInterval;
+ t = new this.tickRenderer(this.tickOptions);
+ // var t = new $.jqplot.AxisTickRenderer(this.tickOptions);
+ if (!this.showTicks) {
+ t.showLabel = false;
+ t.showMark = false;
+ }
+ else if (!this.showTickMarks) {
+ t.showMark = false;
+ }
+ t.setTick(tt, this.name);
+ this._ticks.push(t);
+ }
+ }
+
+ // for x axes, have number ot ticks equal to number of series and ticks placed
+ // at sum of y values for each series.
+ else if (this.tickMode == 'bar') {
+ this.min = 0;
+ this.numberTicks = this._series.length + 1;
+ t = new this.tickRenderer(this.tickOptions);
+ if (!this.showTicks) {
+ t.showLabel = false;
+ t.showMark = false;
+ }
+ else if (!this.showTickMarks) {
+ t.showMark = false;
+ }
+ t.setTick(0, this.name);
+ this._ticks.push(t);
+
+ temp = 0;
+
+ for (i=1; i<this.numberTicks; i++){
+ temp += this._series[i-1]._sumy;
+ t = new this.tickRenderer(this.tickOptions);
+ if (!this.showTicks) {
+ t.showLabel = false;
+ t.showMark = false;
+ }
+ else if (!this.showTickMarks) {
+ t.showMark = false;
+ }
+ t.setTick(temp, this.name);
+ this._ticks.push(t);
+ }
+ this.max = this.max || temp;
+
+ // if user specified a max and it is greater than sum, add a tick
+ if (this.max > temp) {
+ t = new this.tickRenderer(this.tickOptions);
+ if (!this.showTicks) {
+ t.showLabel = false;
+ t.showMark = false;
+ }
+ else if (!this.showTickMarks) {
+ t.showMark = false;
+ }
+ t.setTick(this.max, this.name);
+ this._ticks.push(t);
+
+ }
+ }
+
+ else if (this.tickMode == 'even') {
+ this.min = 0;
+ this.max = this.max || db.max;
+ // get a desired number of ticks
+ var nt = 2 + Math.ceil((dim-(this.tickSpacing-1))/this.tickSpacing);
+ range = this.max - this.min;
+ this.numberTicks = nt;
+ this.tickInterval = range / (this.numberTicks - 1);
+
+ for (i=0; i<this.numberTicks; i++){
+ tt = this.min + i * this.tickInterval;
+ t = new this.tickRenderer(this.tickOptions);
+ // var t = new $.jqplot.AxisTickRenderer(this.tickOptions);
+ if (!this.showTicks) {
+ t.showLabel = false;
+ t.showMark = false;
+ }
+ else if (!this.showTickMarks) {
+ t.showMark = false;
+ }
+ t.setTick(tt, this.name);
+ this._ticks.push(t);
+ }
+
+ }
+ }
+ };
+
+ // called with scope of axis
+ $.jqplot.MekkoAxisRenderer.prototype.pack = function(pos, offsets) {
+ var ticks = this._ticks;
+ var max = this.max;
+ var min = this.min;
+ var offmax = offsets.max;
+ var offmin = offsets.min;
+ var lshow = (this._label == null) ? false : this._label.show;
+
+ for (var p in pos) {
+ this._elem.css(p, pos[p]);
+ }
+
+ this._offsets = offsets;
+ // pixellength will be + for x axes and - for y axes becasue pixels always measured from top left.
+ var pixellength = offmax - offmin;
+ var unitlength = max - min;
+
+ // point to unit and unit to point conversions references to Plot DOM element top left corner.
+ this.p2u = function(p){
+ return (p - offmin) * unitlength / pixellength + min;
+ };
+
+ this.u2p = function(u){
+ return (u - min) * pixellength / unitlength + offmin;
+ };
+
+ if (this.name == 'xaxis' || this.name == 'x2axis'){
+ this.series_u2p = function(u){
+ return (u - min) * pixellength / unitlength;
+ };
+ this.series_p2u = function(p){
+ return p * unitlength / pixellength + min;
+ };
+ }
+
+ else {
+ this.series_u2p = function(u){
+ return (u - max) * pixellength / unitlength;
+ };
+ this.series_p2u = function(p){
+ return p * unitlength / pixellength + max;
+ };
+ }
+
+ if (this.show) {
+ if (this.name == 'xaxis' || this.name == 'x2axis') {
+ for (var i=0; i<ticks.length; i++) {
+ var t = ticks[i];
+ if (t.show && t.showLabel) {
+ var shim;
+
+ if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) {
+ // will need to adjust auto positioning based on which axis this is.
+ var temp = (this.name == 'xaxis') ? 1 : -1;
+ switch (t.labelPosition) {
+ case 'auto':
+ // position at end
+ if (temp * t.angle < 0) {
+ shim = -t.getWidth() + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
+ }
+ // position at start
+ else {
+ shim = -t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
+ }
+ break;
+ case 'end':
+ shim = -t.getWidth() + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
+ break;
+ case 'start':
+ shim = -t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
+ break;
+ case 'middle':
+ shim = -t.getWidth()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
+ break;
+ default:
+ shim = -t.getWidth()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
+ break;
+ }
+ }
+ else {
+ shim = -t.getWidth()/2;
+ }
+ var val = this.u2p(t.value) + shim + 'px';
+ t._elem.css('left', val);
+ t.pack();
+ }
+ }
+ var w;
+ if (lshow) {
+ w = this._label._elem.outerWidth(true);
+ this._label._elem.css('left', offmin + pixellength/2 - w/2 + 'px');
+ if (this.name == 'xaxis') {
+ this._label._elem.css('bottom', '0px');
+ }
+ else {
+ this._label._elem.css('top', '0px');
+ }
+ this._label.pack();
+ }
+ // now show the labels under the bars.
+ var b, l, r;
+ for (var i=0; i<this.barLabels.length; i++) {
+ b = this._barLabels[i];
+ if (b.show) {
+ w = b.getWidth();
+ l = this._ticks[i].getLeft() + this._ticks[i].getWidth();
+ r = this._ticks[i+1].getLeft();
+ b._elem.css('left', (r+l-w)/2+'px');
+ b._elem.css('top', this._ticks[i]._elem.css('top'));
+ b.pack();
+ }
+ }
+ }
+ else {
+ for (var i=0; i<ticks.length; i++) {
+ var t = ticks[i];
+ if (t.show && t.showLabel) {
+ var shim;
+ if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) {
+ // will need to adjust auto positioning based on which axis this is.
+ var temp = (this.name == 'yaxis') ? 1 : -1;
+ switch (t.labelPosition) {
+ case 'auto':
+ // position at end
+ case 'end':
+ if (temp * t.angle < 0) {
+ shim = -t._textRenderer.height * Math.cos(-t._textRenderer.angle) / 2;
+ }
+ else {
+ shim = -t.getHeight() + t._textRenderer.height * Math.cos(t._textRenderer.angle) / 2;
+ }
+ break;
+ case 'start':
+ if (t.angle > 0) {
+ shim = -t._textRenderer.height * Math.cos(-t._textRenderer.angle) / 2;
+ }
+ else {
+ shim = -t.getHeight() + t._textRenderer.height * Math.cos(t._textRenderer.angle) / 2;
+ }
+ break;
+ case 'middle':
+ shim = -t.getHeight()/2;
+ break;
+ default:
+ shim = -t.getHeight()/2;
+ break;
+ }
+ }
+ else {
+ shim = -t.getHeight()/2;
+ }
+
+ var val = this.u2p(t.value) + shim + 'px';
+ t._elem.css('top', val);
+ t.pack();
+ }
+ }
+ if (lshow) {
+ var h = this._label._elem.outerHeight(true);
+ this._label._elem.css('top', offmax - pixellength/2 - h/2 + 'px');
+ if (this.name == 'yaxis') {
+ this._label._elem.css('left', '0px');
+ }
+ else {
+ this._label._elem.css('right', '0px');
+ }
+ this._label.pack();
+ }
+ }
+ }
+ };
+})(jQuery);
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.mekkoRenderer.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.mekkoRenderer.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.mekkoRenderer.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,460 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ */
+(function($) {
+ /**
+ * Class: $.jqplot.MekkoRenderer
+ * Draws a Mekko style chart which shows 3 dimensional data on a 2 dimensional graph.
+ * the <$.jqplot.MekkoAxisRenderer> should be used with mekko charts. The mekko renderer
+ * overrides the default legend renderer with it's own $.jqplot.MekkoLegendRenderer
+ * which allows more flexibility to specify number of rows and columns in the legend.
+ *
+ * Data is specified per bar in the chart. You can specify data as an array of y values, or as
+ * an array of [label, value] pairs. Note that labels are used only on the first series.
+ * Labels on subsequent series are ignored:
+ *
+ * > bar1 = [['shirts', 8],['hats', 14],['shoes', 6],['gloves', 16],['dolls', 12]];
+ * > bar2 = [15,6,9,13,6];
+ * > bar3 = [['grumpy',4],['sneezy',2],['happy',7],['sleepy',9],['doc',7]];
+ *
+ * If you want to place labels for each bar under the axis, you use the barLabels option on
+ * the axes. The bar labels can be styled with the ".jqplot-mekko-barLabel" css class.
+ *
+ * > barLabels = ['Mickey Mouse', 'Donald Duck', 'Goofy'];
+ * > axes:{xaxis:{barLabels:barLabels}}
+ *
+ */
+
+
+ $.jqplot.MekkoRenderer = function(){
+ this.shapeRenderer = new $.jqplot.ShapeRenderer();
+ // prop: borderColor
+ // color of the borders between areas on the chart
+ this.borderColor = null;
+ // prop: showBorders
+ // True to draw borders lines between areas on the chart.
+ // False will draw borders lines with the same color as the area.
+ this.showBorders = true;
+ };
+
+ // called with scope of series.
+ $.jqplot.MekkoRenderer.prototype.init = function(options, plot) {
+ this.fill = false;
+ this.fillRect = true;
+ this.strokeRect = true;
+ this.shadow = false;
+ // width of bar on x axis.
+ this._xwidth = 0;
+ this._xstart = 0;
+ $.extend(true, this.renderer, options);
+ // set the shape renderer options
+ var opts = {lineJoin:'miter', lineCap:'butt', isarc:false, fillRect:this.fillRect, strokeRect:this.strokeRect};
+ this.renderer.shapeRenderer.init(opts);
+ plot.axes.x2axis._series.push(this);
+ this._type = 'mekko';
+ };
+
+ // Method: setGridData
+ // converts the user data values to grid coordinates and stores them
+ // in the gridData array. Will convert user data into appropriate
+ // rectangles.
+ // Called with scope of a series.
+ $.jqplot.MekkoRenderer.prototype.setGridData = function(plot) {
+ // recalculate the grid data
+ var xp = this._xaxis.series_u2p;
+ var yp = this._yaxis.series_u2p;
+ var data = this._plotData;
+ this.gridData = [];
+ // figure out width on x axis.
+ // this._xwidth = this._sumy / plot._sumy * this.canvas.getWidth();
+ this._xwidth = xp(this._sumy) - xp(0);
+ if (this.index>0) {
+ this._xstart = plot.series[this.index-1]._xstart + plot.series[this.index-1]._xwidth;
+ }
+ var totheight = this.canvas.getHeight();
+ var sumy = 0;
+ var cury;
+ var curheight;
+ for (var i=0; i<data.length; i++) {
+ if (data[i] != null) {
+ sumy += data[i][1];
+ cury = totheight - (sumy / this._sumy * totheight);
+ curheight = data[i][1] / this._sumy * totheight;
+ this.gridData.push([this._xstart, cury, this._xwidth, curheight]);
+ }
+ }
+ };
+
+ // Method: makeGridData
+ // converts any arbitrary data values to grid coordinates and
+ // returns them. This method exists so that plugins can use a series'
+ // linerenderer to generate grid data points without overwriting the
+ // grid data associated with that series.
+ // Called with scope of a series.
+ $.jqplot.MekkoRenderer.prototype.makeGridData = function(data, plot) {
+ // recalculate the grid data
+ // figure out width on x axis.
+ var xp = this._xaxis.series_u2p;
+ var totheight = this.canvas.getHeight();
+ var sumy = 0;
+ var cury;
+ var curheight;
+ var gd = [];
+ for (var i=0; i<data.length; i++) {
+ if (data[i] != null) {
+ sumy += data[i][1];
+ cury = totheight - (sumy / this._sumy * totheight);
+ curheight = data[i][1] / this._sumy * totheight;
+ gd.push([this._xstart, cury, this._xwidth, curheight]);
+ }
+ }
+ return gd;
+ };
+
+
+ // called within scope of series.
+ $.jqplot.MekkoRenderer.prototype.draw = function(ctx, gd, options) {
+ var i;
+ var opts = (options != undefined) ? options : {};
+ var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine;
+ var colorGenerator = new $.jqplot.ColorGenerator(this.seriesColors);
+ ctx.save();
+ if (gd.length) {
+ if (showLine) {
+ for (i=0; i<gd.length; i++){
+ opts.fillStyle = colorGenerator.next();
+ if (this.renderer.showBorders) {
+ opts.strokeStyle = this.renderer.borderColor;
+ }
+ else {
+ opts.strokeStyle = opts.fillStyle;
+ }
+ this.renderer.shapeRenderer.draw(ctx, gd[i], opts);
+ }
+ }
+ }
+
+ ctx.restore();
+ };
+
+ $.jqplot.MekkoRenderer.prototype.drawShadow = function(ctx, gd, options) {
+ // This is a no-op, no shadows on mekko charts.
+ };
+
+ /**
+ * Class: $.jqplot.MekkoLegendRenderer
+ * Legend renderer used by mekko charts with options for
+ * controlling number or rows and columns as well as placement
+ * outside of plot area.
+ *
+ */
+ $.jqplot.MekkoLegendRenderer = function(){
+ //
+ };
+
+ $.jqplot.MekkoLegendRenderer.prototype.init = function(options) {
+ // prop: numberRows
+ // Maximum number of rows in the legend. 0 or null for unlimited.
+ this.numberRows = null;
+ // prop: numberColumns
+ // Maximum number of columns in the legend. 0 or null for unlimited.
+ this.numberColumns = null;
+ // this will override the placement option on the Legend object
+ this.placement = "outside";
+ $.extend(true, this, options);
+ };
+
+ // called with scope of legend
+ $.jqplot.MekkoLegendRenderer.prototype.draw = function() {
+ var legend = this;
+ if (this.show) {
+ var series = this._series;
+ var ss = 'position:absolute;';
+ ss += (this.background) ? 'background:'+this.background+';' : '';
+ ss += (this.border) ? 'border:'+this.border+';' : '';
+ ss += (this.fontSize) ? 'font-size:'+this.fontSize+';' : '';
+ ss += (this.fontFamily) ? 'font-family:'+this.fontFamily+';' : '';
+ ss += (this.textColor) ? 'color:'+this.textColor+';' : '';
+ this._elem = $('<table class="jqplot-table-legend" style="'+ss+'"></table>');
+ // Mekko charts legends don't go by number of series, but by number of data points
+ // in the series. Refactor things here for that.
+
+ var pad = false,
+ reverse = true, // mekko charts are always stacked, so reverse
+ nr, nc;
+ var s = series[0];
+ var colorGenerator = new $.jqplot.ColorGenerator(s.seriesColors);
+
+ if (s.show) {
+ var pd = s.data;
+ if (this.numberRows) {
+ nr = this.numberRows;
+ if (!this.numberColumns){
+ nc = Math.ceil(pd.length/nr);
+ }
+ else{
+ nc = this.numberColumns;
+ }
+ }
+ else if (this.numberColumns) {
+ nc = this.numberColumns;
+ nr = Math.ceil(pd.length/this.numberColumns);
+ }
+ else {
+ nr = pd.length;
+ nc = 1;
+ }
+
+ var i, j, tr, td1, td2, lt, rs, color;
+ var idx = 0;
+
+ for (i=0; i<nr; i++) {
+ if (reverse){
+ tr = $('<tr class="jqplot-table-legend"></tr>').prependTo(this._elem);
+ }
+ else{
+ tr = $('<tr class="jqplot-table-legend"></tr>').appendTo(this._elem);
+ }
+ for (j=0; j<nc; j++) {
+ if (idx < pd.length) {
+ lt = this.labels[idx] || pd[idx][0].toString();
+ color = colorGenerator.next();
+ if (!reverse){
+ if (i>0){
+ pad = true;
+ }
+ else{
+ pad = false;
+ }
+ }
+ else{
+ if (i == nr -1){
+ pad = false;
+ }
+ else{
+ pad = true;
+ }
+ }
+ rs = (pad) ? this.rowSpacing : '0';
+
+ td1 = $('<td class="jqplot-table-legend" style="text-align:center;padding-top:'+rs+';">'+
+ '<div><div class="jqplot-table-legend-swatch" style="border-color:'+color+';"></div>'+
+ '</div></td>');
+ td2 = $('<td class="jqplot-table-legend" style="padding-top:'+rs+';"></td>');
+ if (this.escapeHtml){
+ td2.text(lt);
+ }
+ else {
+ td2.html(lt);
+ }
+ if (reverse) {
+ td2.prependTo(tr);
+ td1.prependTo(tr);
+ }
+ else {
+ td1.appendTo(tr);
+ td2.appendTo(tr);
+ }
+ pad = true;
+ }
+ idx++;
+ }
+ }
+
+ tr = null;
+ td1 = null;
+ td2 = null;
+ }
+ }
+ return this._elem;
+ };
+
+ $.jqplot.MekkoLegendRenderer.prototype.pack = function(offsets) {
+ if (this.show) {
+ // fake a grid for positioning
+ var grid = {_top:offsets.top, _left:offsets.left, _right:offsets.right, _bottom:this._plotDimensions.height - offsets.bottom};
+ if (this.placement == 'insideGrid') {
+ switch (this.location) {
+ case 'nw':
+ var a = grid._left + this.xoffset;
+ var b = grid._top + this.yoffset;
+ this._elem.css('left', a);
+ this._elem.css('top', b);
+ break;
+ case 'n':
+ var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
+ var b = grid._top + this.yoffset;
+ this._elem.css('left', a);
+ this._elem.css('top', b);
+ break;
+ case 'ne':
+ var a = offsets.right + this.xoffset;
+ var b = grid._top + this.yoffset;
+ this._elem.css({right:a, top:b});
+ break;
+ case 'e':
+ var a = offsets.right + this.xoffset;
+ var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
+ this._elem.css({right:a, top:b});
+ break;
+ case 'se':
+ var a = offsets.right + this.xoffset;
+ var b = offsets.bottom + this.yoffset;
+ this._elem.css({right:a, bottom:b});
+ break;
+ case 's':
+ var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
+ var b = offsets.bottom + this.yoffset;
+ this._elem.css({left:a, bottom:b});
+ break;
+ case 'sw':
+ var a = grid._left + this.xoffset;
+ var b = offsets.bottom + this.yoffset;
+ this._elem.css({left:a, bottom:b});
+ break;
+ case 'w':
+ var a = grid._left + this.xoffset;
+ var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
+ this._elem.css({left:a, top:b});
+ break;
+ default: // same as 'se'
+ var a = grid._right - this.xoffset;
+ var b = grid._bottom + this.yoffset;
+ this._elem.css({right:a, bottom:b});
+ break;
+ }
+
+ }
+ else {
+ switch (this.location) {
+ case 'nw':
+ var a = this._plotDimensions.width - grid._left + this.xoffset;
+ var b = grid._top + this.yoffset;
+ this._elem.css('right', a);
+ this._elem.css('top', b);
+ break;
+ case 'n':
+ var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
+ var b = this._plotDimensions.height - grid._top + this.yoffset;
+ this._elem.css('left', a);
+ this._elem.css('bottom', b);
+ break;
+ case 'ne':
+ var a = this._plotDimensions.width - offsets.right + this.xoffset;
+ var b = grid._top + this.yoffset;
+ this._elem.css({left:a, top:b});
+ break;
+ case 'e':
+ var a = this._plotDimensions.width - offsets.right + this.xoffset;
+ var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
+ this._elem.css({left:a, top:b});
+ break;
+ case 'se':
+ var a = this._plotDimensions.width - offsets.right + this.xoffset;
+ var b = offsets.bottom + this.yoffset;
+ this._elem.css({left:a, bottom:b});
+ break;
+ case 's':
+ var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
+ var b = this._plotDimensions.height - offsets.bottom + this.yoffset;
+ this._elem.css({left:a, top:b});
+ break;
+ case 'sw':
+ var a = this._plotDimensions.width - grid._left + this.xoffset;
+ var b = offsets.bottom + this.yoffset;
+ this._elem.css({right:a, bottom:b});
+ break;
+ case 'w':
+ var a = this._plotDimensions.width - grid._left + this.xoffset;
+ var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
+ this._elem.css({right:a, top:b});
+ break;
+ default: // same as 'se'
+ var a = grid._right - this.xoffset;
+ var b = grid._bottom + this.yoffset;
+ this._elem.css({right:a, bottom:b});
+ break;
+ }
+ }
+ }
+ };
+
+ // setup default renderers for axes and legend so user doesn't have to
+ // called with scope of plot
+ function preInit(target, data, options) {
+ options = options || {};
+ options.axesDefaults = options.axesDefaults || {};
+ options.legend = options.legend || {};
+ options.seriesDefaults = options.seriesDefaults || {};
+ var setopts = false;
+ if (options.seriesDefaults.renderer == $.jqplot.MekkoRenderer) {
+ setopts = true;
+ }
+ else if (options.series) {
+ for (var i=0; i < options.series.length; i++) {
+ if (options.series[i].renderer == $.jqplot.MekkoRenderer) {
+ setopts = true;
+ }
+ }
+ }
+
+ if (setopts) {
+ options.axesDefaults.renderer = $.jqplot.MekkoAxisRenderer;
+ options.legend.renderer = $.jqplot.MekkoLegendRenderer;
+ options.legend.preDraw = true;
+ }
+ }
+
+ $.jqplot.preInitHooks.push(preInit);
+
+})(jQuery);
\ No newline at end of file
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.meterGaugeRenderer.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.meterGaugeRenderer.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.meterGaugeRenderer.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,1053 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ */
+(function($) {
+ /**
+ * Class: $.jqplot.MeterGaugeRenderer
+ * Plugin renderer to draw a meter gauge chart.
+ *
+ * Data consists of a single series with 1 data point to position the gauge needle.
+ *
+ * To use this renderer, you need to include the
+ * meter gauge renderer plugin, for example:
+ *
+ * > <script type="text/javascript" src="plugins/jqplot.meterGaugeRenderer.js"></script>
+ *
+ * Properties described here are passed into the $.jqplot function
+ * as options on the series renderer. For example:
+ *
+ * > plot0 = $.jqplot('chart0',[[18]],{
+ * > title: 'Network Speed',
+ * > seriesDefaults: {
+ * > renderer: $.jqplot.MeterGaugeRenderer,
+ * > rendererOptions: {
+ * > label: 'MB/s'
+ * > }
+ * > }
+ * > });
+ *
+ * A meterGauge plot does not support events.
+ */
+ $.jqplot.MeterGaugeRenderer = function(){
+ $.jqplot.LineRenderer.call(this);
+ };
+
+ $.jqplot.MeterGaugeRenderer.prototype = new $.jqplot.LineRenderer();
+ $.jqplot.MeterGaugeRenderer.prototype.constructor = $.jqplot.MeterGaugeRenderer;
+
+ // called with scope of a series
+ $.jqplot.MeterGaugeRenderer.prototype.init = function(options) {
+ // Group: Properties
+ //
+ // prop: diameter
+ // Outer diameter of the meterGauge, auto computed by default
+ this.diameter = null;
+ // prop: padding
+ // padding between the meterGauge and plot edges, auto
+ // calculated by default.
+ this.padding = null;
+ // prop: shadowOffset
+ // offset of the shadow from the gauge ring and offset of
+ // each succesive stroke of the shadow from the last.
+ this.shadowOffset = 2;
+ // prop: shadowAlpha
+ // transparency of the shadow (0 = transparent, 1 = opaque)
+ this.shadowAlpha = 0.07;
+ // prop: shadowDepth
+ // number of strokes to apply to the shadow,
+ // each stroke offset shadowOffset from the last.
+ this.shadowDepth = 4;
+ // prop: background
+ // background color of the inside of the gauge.
+ this.background = "#efefef";
+ // prop: ringColor
+ // color of the outer ring, hub, and needle of the gauge.
+ this.ringColor = "#BBC6D0";
+ // needle color not implemented yet.
+ this.needleColor = "#C3D3E5";
+ // prop: tickColor
+ // color of the tick marks around the gauge.
+ this.tickColor = "989898";
+ // prop: ringWidth
+ // width of the ring around the gauge. Auto computed by default.
+ this.ringWidth = null;
+ // prop: min
+ // Minimum value on the gauge. Auto computed by default
+ this.min;
+ // prop: max
+ // Maximum value on the gauge. Auto computed by default
+ this.max;
+ // prop: ticks
+ // Array of tick values. Auto computed by default.
+ this.ticks = [];
+ // prop: showTicks
+ // true to show ticks around gauge.
+ this.showTicks = true;
+ // prop: showTickLabels
+ // true to show tick labels next to ticks.
+ this.showTickLabels = true;
+ // prop: label
+ // A gauge label like 'kph' or 'Volts'
+ this.label = null;
+ // prop: labelHeightAdjust
+ // Number of Pixels to offset the label up (-) or down (+) from its default position.
+ this.labelHeightAdjust = 0;
+ // prop: labelPosition
+ // Where to position the label, either 'inside' or 'bottom'.
+ this.labelPosition = 'inside';
+ // prop: intervals
+ // Array of ranges to be drawn around the gauge.
+ // Array of form:
+ // > [value1, value2, ...]
+ // indicating the values for the first, second, ... intervals.
+ this.intervals = [];
+ // prop: intervalColors
+ // Array of colors to use for the intervals.
+ this.intervalColors = [ "#4bb2c5", "#EAA228", "#c5b47f", "#579575", "#839557", "#958c12", "#953579", "#4b5de4", "#d8b83f", "#ff5800", "#0085cc", "#c747a3", "#cddf54", "#FBD178", "#26B4E3", "#bd70c7"];
+ // prop: intervalInnerRadius
+ // Radius of the inner circle of the interval ring.
+ this.intervalInnerRadius = null;
+ // prop: intervalOuterRadius
+ // Radius of the outer circle of the interval ring.
+ this.intervalOuterRadius = null;
+ this.tickRenderer = $.jqplot.MeterGaugeTickRenderer;
+ // ticks spaced every 1, 2, 2.5, 5, 10, 20, .1, .2, .25, .5, etc.
+ this.tickPositions = [1, 2, 2.5, 5, 10];
+ // prop: tickSpacing
+ // Degrees between ticks. This is a target number, if
+ // incompatible span and ticks are supplied, a suitable
+ // spacing close to this value will be computed.
+ this.tickSpacing = 30;
+ this.numberMinorTicks = null;
+ // prop: hubRadius
+ // Radius of the hub at the bottom center of gauge which the needle attaches to.
+ // Auto computed by default
+ this.hubRadius = null;
+ // prop: tickPadding
+ // padding of the tick marks to the outer ring and the tick labels to marks.
+ // Auto computed by default.
+ this.tickPadding = null;
+ // prop: needleThickness
+ // Maximum thickness the needle. Auto computed by default.
+ this.needleThickness = null;
+ // prop: needlePad
+ // Padding between needle and inner edge of the ring when the needle is at the min or max gauge value.
+ this.needlePad = 6;
+ // prop: pegNeedle
+ // True will stop needle just below/above the min/max values if data is below/above min/max,
+ // as if the meter is "pegged".
+ this.pegNeedle = true;
+ this._type = 'meterGauge';
+
+ $.extend(true, this, options);
+ this.type = null;
+ this.numberTicks = null;
+ this.tickInterval = null;
+ // span, the sweep (in degrees) from min to max. This gauge is
+ // a semi-circle.
+ this.span = 180;
+ // get rid of this nonsense
+ // this.innerSpan = this.span;
+ if (this.type == 'circular') {
+ this.semiCircular = false;
+ }
+ else if (this.type != 'circular') {
+ this.semiCircular = true;
+ }
+ else {
+ this.semiCircular = (this.span <= 180) ? true : false;
+ }
+ this._tickPoints = [];
+ // reference to label element.
+ this._labelElem = null;
+
+ // start the gauge at the beginning of the span
+ this.startAngle = (90 + (360 - this.span)/2) * Math.PI/180;
+ this.endAngle = (90 - (360 - this.span)/2) * Math.PI/180;
+
+ this.setmin = !!(this.min == null);
+ this.setmax = !!(this.max == null);
+
+ // if given intervals and is an array of values, create labels and colors.
+ if (this.intervals.length) {
+ if (this.intervals[0].length == null || this.intervals.length == 1) {
+ for (var i=0; i<this.intervals.length; i++) {
+ this.intervals[i] = [this.intervals[i], this.intervals[i], this.intervalColors[i]];
+ }
+ }
+ else if (this.intervals[0].length == 2) {
+ for (i=0; i<this.intervals.length; i++) {
+ this.intervals[i] = [this.intervals[i][0], this.intervals[i][1], this.intervalColors[i]];
+ }
+ }
+ }
+
+ // compute min, max and ticks if not supplied:
+ if (this.ticks.length) {
+ if (this.ticks[0].length == null || this.ticks[0].length == 1) {
+ for (var i=0; i<this.ticks.length; i++) {
+ this.ticks[i] = [this.ticks[i], this.ticks[i]];
+ }
+ }
+ this.min = (this.min == null) ? this.ticks[0][0] : this.min;
+ this.max = (this.max == null) ? this.ticks[this.ticks.length-1][0] : this.max;
+ this.setmin = false;
+ this.setmax = false;
+ this.numberTicks = this.ticks.length;
+ this.tickInterval = this.ticks[1][0] - this.ticks[0][0];
+ this.tickFactor = Math.floor(parseFloat((Math.log(this.tickInterval)/Math.log(10)).toFixed(11)));
+ // use the first interal to calculate minor ticks;
+ this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor);
+ if (!this.numberMinorTicks) {
+ this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor-1);
+ }
+ if (!this.numberMinorTicks) {
+ this.numberMinorTicks = 1;
+ }
+ }
+
+ else if (this.intervals.length) {
+ this.min = (this.min == null) ? 0 : this.min;
+ this.setmin = false;
+ if (this.max == null) {
+ if (this.intervals[this.intervals.length-1][0] >= this.data[0][1]) {
+ this.max = this.intervals[this.intervals.length-1][0];
+ this.setmax = false;
+ }
+ }
+ else {
+ this.setmax = false;
+ }
+ }
+
+ else {
+ // no ticks and no intervals supplied, put needle in middle
+ this.min = (this.min == null) ? 0 : this.min;
+ this.setmin = false;
+ if (this.max == null) {
+ this.max = this.data[0][1] * 1.25;
+ this.setmax = true;
+ }
+ else {
+ this.setmax = false;
+ }
+ }
+ };
+
+ $.jqplot.MeterGaugeRenderer.prototype.setGridData = function(plot) {
+ // set gridData property. This will hold angle in radians of each data point.
+ var stack = [];
+ var td = [];
+ var sa = this.startAngle;
+ for (var i=0; i<this.data.length; i++){
+ stack.push(this.data[i][1]);
+ td.push([this.data[i][0]]);
+ if (i>0) {
+ stack[i] += stack[i-1];
+ }
+ }
+ var fact = Math.PI*2/stack[stack.length - 1];
+
+ for (var i=0; i<stack.length; i++) {
+ td[i][1] = stack[i] * fact;
+ }
+ this.gridData = td;
+ };
+
+ $.jqplot.MeterGaugeRenderer.prototype.makeGridData = function(data, plot) {
+ var stack = [];
+ var td = [];
+ var sa = this.startAngle;
+ for (var i=0; i<data.length; i++){
+ stack.push(data[i][1]);
+ td.push([data[i][0]]);
+ if (i>0) {
+ stack[i] += stack[i-1];
+ }
+ }
+ var fact = Math.PI*2/stack[stack.length - 1];
+
+ for (var i=0; i<stack.length; i++) {
+ td[i][1] = stack[i] * fact;
+ }
+ return td;
+ };
+
+
+ function getnmt(pos, interval, fact) {
+ var temp;
+ for (var i=pos.length-1; i>=0; i--) {
+ temp = interval/(pos[i] * Math.pow(10, fact));
+ if (temp == 4 || temp == 5) {
+ return temp - 1;
+ }
+ }
+ return null;
+ }
+
+ // called with scope of series
+ $.jqplot.MeterGaugeRenderer.prototype.draw = function (ctx, gd, options) {
+ var i;
+ var opts = (options != undefined) ? options : {};
+ // offset and direction of offset due to legend placement
+ var offx = 0;
+ var offy = 0;
+ var trans = 1;
+ if (options.legendInfo && options.legendInfo.placement == 'inside') {
+ var li = options.legendInfo;
+ switch (li.location) {
+ case 'nw':
+ offx = li.width + li.xoffset;
+ break;
+ case 'w':
+ offx = li.width + li.xoffset;
+ break;
+ case 'sw':
+ offx = li.width + li.xoffset;
+ break;
+ case 'ne':
+ offx = li.width + li.xoffset;
+ trans = -1;
+ break;
+ case 'e':
+ offx = li.width + li.xoffset;
+ trans = -1;
+ break;
+ case 'se':
+ offx = li.width + li.xoffset;
+ trans = -1;
+ break;
+ case 'n':
+ offy = li.height + li.yoffset;
+ break;
+ case 's':
+ offy = li.height + li.yoffset;
+ trans = -1;
+ break;
+ default:
+ break;
+ }
+ }
+
+
+
+ // pre-draw so can get it's dimensions.
+ if (this.label) {
+ this._labelElem = $('<div class="jqplot-meterGauge-label" style="position:absolute;">'+this.label+'</div>');
+ this.canvas._elem.after(this._labelElem);
+ }
+
+ var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
+ var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine;
+ var fill = (opts.fill != undefined) ? opts.fill : this.fill;
+ var cw = ctx.canvas.width;
+ var ch = ctx.canvas.height;
+ if (this.padding == null) {
+ this.padding = Math.round(Math.min(cw, ch)/30);
+ }
+ var w = cw - offx - 2 * this.padding;
+ var h = ch - offy - 2 * this.padding;
+ if (this.labelPosition == 'bottom' && this.label) {
+ h -= this._labelElem.outerHeight(true);
+ }
+ var mindim = Math.min(w,h);
+ var d = mindim;
+
+ if (!this.diameter) {
+ if (this.semiCircular) {
+ if ( w >= 2*h) {
+ if (!this.ringWidth) {
+ this.ringWidth = 2*h/35;
+ }
+ this.needleThickness = this.needleThickness || 2+Math.pow(this.ringWidth, 0.8);
+ this.innerPad = this.ringWidth/2 + this.needleThickness/2 + this.needlePad;
+ this.diameter = 2 * (h - 2*this.innerPad);
+ }
+ else {
+ if (!this.ringWidth) {
+ this.ringWidth = w/35;
+ }
+ this.needleThickness = this.needleThickness || 2+Math.pow(this.ringWidth, 0.8);
+ this.innerPad = this.ringWidth/2 + this.needleThickness/2 + this.needlePad;
+ this.diameter = w - 2*this.innerPad - this.ringWidth - this.padding;
+ }
+ // center taking into account legend and over draw for gauge bottom below hub.
+ // this will be center of hub.
+ this._center = [(cw - trans * offx)/2 + trans * offx, (ch + trans*offy - this.padding - this.ringWidth - this.innerPad)];
+ }
+ else {
+ if (!this.ringWidth) {
+ this.ringWidth = d/35;
+ }
+ this.needleThickness = this.needleThickness || 2+Math.pow(this.ringWidth, 0.8);
+ this.innerPad = 0;
+ this.diameter = d - this.ringWidth;
+ // center in middle of canvas taking into account legend.
+ // will be center of hub.
+ this._center = [(cw-trans*offx)/2 + trans * offx, (ch-trans*offy)/2 + trans * offy];
+ }
+ }
+
+
+ if (this._labelElem && this.labelPosition == 'bottom') {
+ this._center[1] -= this._labelElem.outerHeight(true);
+ }
+
+ this._radius = this.diameter/2;
+
+ this.tickSpacing = 6000/this.diameter;
+
+ if (!this.hubRadius) {
+ this.hubRadius = this.diameter/18;
+ }
+
+ this.shadowOffset = 0.5 + this.ringWidth/9;
+ this.shadowWidth = this.ringWidth*1;
+
+ this.tickPadding = 3 + Math.pow(this.diameter/20, 0.7);
+ this.tickOuterRadius = this._radius - this.ringWidth/2 - this.tickPadding;
+ this.tickLength = (this.showTicks) ? this._radius/13 : 0;
+
+ if (this.ticks.length == 0) {
+ // no ticks, lets make some.
+ var max = this.max,
+ min = this.min,
+ setmax = this.setmax,
+ setmin = this.setmin,
+ ti = (max - min) * this.tickSpacing / this.span;
+ var tf = Math.floor(parseFloat((Math.log(ti)/Math.log(10)).toFixed(11)));
+ var tp = (ti/Math.pow(10, tf));
+ (tp > 2 && tp <= 2.5) ? tp = 2.5 : tp = Math.ceil(tp);
+ var t = this.tickPositions;
+ var tpindex, nt;
+
+ for (i=0; i<t.length; i++) {
+ if (tp == t[i] || i && t[i-1] < tp && tp < t[i]) {
+ ti = t[i]*Math.pow(10, tf);
+ tpindex = i;
+ }
+ }
+
+ for (i=0; i<t.length; i++) {
+ if (tp == t[i] || i && t[i-1] < tp && tp < t[i]) {
+ ti = t[i]*Math.pow(10, tf);
+ nt = Math.ceil((max - min) / ti);
+ }
+ }
+
+ // both max and min are free
+ if (setmax && setmin) {
+ var tmin = (min > 0) ? min - min % ti : min - min % ti - ti;
+ if (!this.forceZero) {
+ var diff = Math.min(min - tmin, 0.8*ti);
+ var ntp = Math.floor(diff/t[tpindex]);
+ if (ntp > 1) {
+ tmin = tmin + t[tpindex] * (ntp-1);
+ if (parseInt(tmin, 10) != tmin && parseInt(tmin-t[tpindex], 10) == tmin-t[tpindex]) {
+ tmin = tmin - t[tpindex];
+ }
+ }
+ }
+ if (min == tmin) {
+ min -= ti;
+ }
+ else {
+ // tmin should always be lower than dataMin
+ if (min - tmin > 0.23*ti) {
+ min = tmin;
+ }
+ else {
+ min = tmin -ti;
+ nt += 1;
+ }
+ }
+ nt += 1;
+ var tmax = min + (nt - 1) * ti;
+ if (max >= tmax) {
+ tmax += ti;
+ nt += 1;
+ }
+ // now tmax should always be mroe than dataMax
+ if (tmax - max < 0.23*ti) {
+ tmax += ti;
+ nt += 1;
+ }
+ this.max = max = tmax;
+ this.min = min;
+
+ this.tickInterval = ti;
+ this.numberTicks = nt;
+ var it;
+ for (i=0; i<nt; i++) {
+ it = parseFloat((min+i*ti).toFixed(11));
+ this.ticks.push([it, it]);
+ }
+ this.max = this.ticks[nt-1][1];
+
+ this.tickFactor = tf;
+ // determine number of minor ticks
+
+ this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor);
+
+ if (!this.numberMinorTicks) {
+ this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor-1);
+ }
+ }
+ // max is free, min is fixed
+ else if (setmax) {
+ var tmax = min + (nt - 1) * ti;
+ if (max >= tmax) {
+ max = tmax + ti;
+ nt += 1;
+ }
+ else {
+ max = tmax;
+ }
+
+ this.tickInterval = this.tickInterval || ti;
+ this.numberTicks = this.numberTicks || nt;
+ var it;
+ for (i=0; i<this.numberTicks; i++) {
+ it = parseFloat((min+i*this.tickInterval).toFixed(11));
+ this.ticks.push([it, it]);
+ }
+ this.max = this.ticks[this.numberTicks-1][1];
+
+ this.tickFactor = tf;
+ // determine number of minor ticks
+ this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor);
+
+ if (!this.numberMinorTicks) {
+ this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor-1);
+ }
+ }
+
+ // not setting max or min
+ if (!setmax && !setmin) {
+ var range = this.max - this.min;
+ tf = Math.floor(parseFloat((Math.log(range)/Math.log(10)).toFixed(11))) - 1;
+ var nticks = [5,6,4,7,3,8,9,10,2], res, numticks, nonSigDigits=0, sigRange;
+ // check to see how many zeros are at the end of the range
+ if (range > 1) {
+ var rstr = String(range);
+ if (rstr.search(/\./) == -1) {
+ var pos = rstr.search(/0+$/);
+ nonSigDigits = (pos > 0) ? rstr.length - pos - 1 : 0;
+ }
+ }
+ sigRange = range/Math.pow(10, nonSigDigits);
+ for (i=0; i<nticks.length; i++) {
+ res = sigRange/(nticks[i]-1);
+ if (res == parseInt(res, 10)) {
+ this.numberTicks = nticks[i];
+ this.tickInterval = range/(this.numberTicks-1);
+ this.tickFactor = tf+1;
+ break;
+ }
+ }
+ var it;
+ for (i=0; i<this.numberTicks; i++) {
+ it = parseFloat((this.min+i*this.tickInterval).toFixed(11));
+ this.ticks.push([it, it]);
+ }
+ // determine number of minor ticks
+ this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor);
+
+ if (!this.numberMinorTicks) {
+ this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor-1);
+ }
+
+ if (!this.numberMinorTicks) {
+ this.numberMinorTicks = 1;
+ var nums = [4, 5, 3, 6, 2];
+ for (i=0; i<5; i++) {
+ var temp = this.tickInterval/nums[i];
+ if (temp == parseInt(temp, 10)) {
+ this.numberMinorTicks = nums[i]-1;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+
+ var r = this._radius,
+ sa = this.startAngle,
+ ea = this.endAngle,
+ pi = Math.PI,
+ hpi = Math.PI/2;
+
+ if (this.semiCircular) {
+ var overAngle = Math.atan(this.innerPad/r),
+ outersa = this.outerStartAngle = sa - overAngle,
+ outerea = this.outerEndAngle = ea + overAngle,
+ hubsa = this.hubStartAngle = sa - Math.atan(this.innerPad/this.hubRadius*2),
+ hubea = this.hubEndAngle = ea + Math.atan(this.innerPad/this.hubRadius*2);
+
+ ctx.save();
+
+ ctx.translate(this._center[0], this._center[1]);
+ ctx.lineJoin = "round";
+ ctx.lineCap = "round";
+
+ // draw the innerbackground
+ ctx.save();
+ ctx.beginPath();
+ ctx.fillStyle = this.background;
+ ctx.arc(0, 0, r, outersa, outerea, false);
+ ctx.closePath();
+ ctx.fill();
+ ctx.restore();
+
+ // draw the shadow
+ // the outer ring.
+ var shadowColor = 'rgba(0,0,0,'+this.shadowAlpha+')';
+ ctx.save();
+ for (var i=0; i<this.shadowDepth; i++) {
+ ctx.translate(this.shadowOffset*Math.cos(this.shadowAngle/180*Math.PI), this.shadowOffset*Math.sin(this.shadowAngle/180*Math.PI));
+ ctx.beginPath();
+ ctx.strokeStyle = shadowColor;
+ ctx.lineWidth = this.shadowWidth;
+ ctx.arc(0 ,0, r, outersa, outerea, false);
+ ctx.closePath();
+ ctx.stroke();
+ }
+ ctx.restore();
+
+ // the inner hub.
+ ctx.save();
+ var tempd = parseInt((this.shadowDepth+1)/2, 10);
+ for (var i=0; i<tempd; i++) {
+ ctx.translate(this.shadowOffset*Math.cos(this.shadowAngle/180*Math.PI), this.shadowOffset*Math.sin(this.shadowAngle/180*Math.PI));
+ ctx.beginPath();
+ ctx.fillStyle = shadowColor;
+ ctx.arc(0 ,0, this.hubRadius, hubsa, hubea, false);
+ ctx.closePath();
+ ctx.fill();
+ }
+ ctx.restore();
+
+ // draw the outer ring.
+ ctx.save();
+ ctx.beginPath();
+ ctx.strokeStyle = this.ringColor;
+ ctx.lineWidth = this.ringWidth;
+ ctx.arc(0 ,0, r, outersa, outerea, false);
+ ctx.closePath();
+ ctx.stroke();
+ ctx.restore();
+
+ // draw the hub
+
+ ctx.save();
+ ctx.beginPath();
+ ctx.fillStyle = this.ringColor;
+ ctx.arc(0 ,0, this.hubRadius,hubsa, hubea, false);
+ ctx.closePath();
+ ctx.fill();
+ ctx.restore();
+
+ // draw the ticks
+ if (this.showTicks) {
+ ctx.save();
+ var orad = this.tickOuterRadius,
+ tl = this.tickLength,
+ mtl = tl/2,
+ nmt = this.numberMinorTicks,
+ ts = this.span * Math.PI / 180 / (this.ticks.length-1),
+ mts = ts/(nmt + 1);
+
+ for (i = 0; i<this.ticks.length; i++) {
+ ctx.beginPath();
+ ctx.lineWidth = 1.5 + this.diameter/360;
+ ctx.strokeStyle = this.ringColor;
+ var wps = ts*i+sa;
+ ctx.moveTo(-orad * Math.cos(ts*i+sa), orad * Math.sin(ts*i+sa));
+ ctx.lineTo(-(orad-tl) * Math.cos(ts*i+sa), (orad - tl) * Math.sin(ts*i+sa));
+ this._tickPoints.push([(orad-tl) * Math.cos(ts*i+sa) + this._center[0] + this.canvas._offsets.left, (orad - tl) * Math.sin(ts*i+sa) + this._center[1] + this.canvas._offsets.top, ts*i+sa]);
+ ctx.stroke();
+ ctx.lineWidth = 1.0 + this.diameter/440;
+ if (i<this.ticks.length-1) {
+ for (var j=1; j<=nmt; j++) {
+ ctx.beginPath();
+ ctx.moveTo(-orad * Math.cos(ts*i+mts*j+sa), orad * Math.sin(ts*i+mts*j+sa));
+ ctx.lineTo(-(orad-mtl) * Math.cos(ts*i+mts*j+sa), (orad-mtl) * Math.sin(ts*i+mts*j+sa));
+ ctx.stroke();
+ }
+ }
+ }
+ ctx.restore();
+ }
+
+ // draw the tick labels
+ if (this.showTickLabels) {
+ var elem, l, t, ew, eh, dim, maxdim=0;
+ var tp = this.tickPadding * (1 - 1/(this.diameter/80+1));
+ for (i=0; i<this.ticks.length; i++) {
+ elem = $('<div class="jqplot-meterGauge-tick" style="position:absolute;">'+this.ticks[i][1]+'</div>');
+ this.canvas._elem.after(elem);
+ ew = elem.outerWidth(true);
+ eh = elem.outerHeight(true);
+ l = this._tickPoints[i][0] - ew * (this._tickPoints[i][2]-Math.PI)/Math.PI - tp * Math.cos(this._tickPoints[i][2]);
+ t = this._tickPoints[i][1] - eh/2 + eh/2 * Math.pow(Math.abs((Math.sin(this._tickPoints[i][2]))), 0.5) + tp/3 * Math.pow(Math.abs((Math.sin(this._tickPoints[i][2]))), 0.5) ;
+ // t = this._tickPoints[i][1] - eh/2 - eh/2 * Math.sin(this._tickPoints[i][2]) - tp/2 * Math.sin(this._tickPoints[i][2]);
+ elem.css({left:l, top:t});
+ dim = ew*Math.cos(this._tickPoints[i][2]) + eh*Math.sin(Math.PI/2+this._tickPoints[i][2]/2);
+ maxdim = (dim > maxdim) ? dim : maxdim;
+ }
+ }
+
+ // draw the gauge label
+ if (this.label && this.labelPosition == 'inside') {
+ var l = this._center[0] + this.canvas._offsets.left;
+ var tp = this.tickPadding * (1 - 1/(this.diameter/80+1));
+ var t = 0.5*(this._center[1] + this.canvas._offsets.top - this.hubRadius) + 0.5*(this._center[1] + this.canvas._offsets.top - this.tickOuterRadius + this.tickLength + tp) + this.labelHeightAdjust;
+ // this._labelElem = $('<div class="jqplot-meterGauge-label" style="position:absolute;">'+this.label+'</div>');
+ // this.canvas._elem.after(this._labelElem);
+ l -= this._labelElem.outerWidth(true)/2;
+ t -= this._labelElem.outerHeight(true)/2;
+ this._labelElem.css({left:l, top:t});
+ }
+
+ else if (this.label && this.labelPosition == 'bottom') {
+ var l = this._center[0] + this.canvas._offsets.left - this._labelElem.outerWidth(true)/2;
+ var t = this._center[1] + this.canvas._offsets.top + this.innerPad + + this.ringWidth + this.padding + this.labelHeightAdjust;
+ this._labelElem.css({left:l, top:t});
+
+ }
+
+ // draw the intervals
+
+ ctx.save();
+ var inner = this.intervalInnerRadius || this.hubRadius * 1.5;
+ if (this.intervalOuterRadius == null) {
+ if (this.showTickLabels) {
+ var outer = (this.tickOuterRadius - this.tickLength - this.tickPadding - this.diameter/8);
+ }
+ else {
+ var outer = (this.tickOuterRadius - this.tickLength - this.diameter/16);
+ }
+ }
+ else {
+ var outer = this.intervalOuterRadius;
+ }
+ var range = this.max - this.min;
+ var intrange = this.intervals[this.intervals.length-1] - this.min;
+ var start, end, span = this.span*Math.PI/180;
+ for (i=0; i<this.intervals.length; i++) {
+ start = (i == 0) ? sa : sa + (this.intervals[i-1][0] - this.min)*span/range;
+ if (start < 0) {
+ start = 0;
+ }
+ end = sa + (this.intervals[i][0] - this.min)*span/range;
+ if (end < 0) {
+ end = 0;
+ }
+ ctx.beginPath();
+ ctx.fillStyle = this.intervals[i][2];
+ ctx.arc(0, 0, inner, start, end, false);
+ ctx.lineTo(outer*Math.cos(end), outer*Math.sin(end));
+ ctx.arc(0, 0, outer, end, start, true);
+ ctx.lineTo(inner*Math.cos(start), inner*Math.sin(start));
+ ctx.closePath();
+ ctx.fill();
+ }
+ ctx.restore();
+
+ // draw the needle
+ var datapoint = this.data[0][1];
+ var dataspan = this.max - this.min;
+ if (this.pegNeedle) {
+ if (this.data[0][1] > this.max + dataspan*3/this.span) {
+ datapoint = this.max + dataspan*3/this.span;
+ }
+ if (this.data[0][1] < this.min - dataspan*3/this.span) {
+ datapoint = this.min - dataspan*3/this.span;
+ }
+ }
+ var dataang = (datapoint - this.min)/dataspan * this.span * Math.PI/180 + this.startAngle;
+
+
+ ctx.save();
+ ctx.beginPath();
+ ctx.fillStyle = this.ringColor;
+ ctx.strokeStyle = this.ringColor;
+ this.needleLength = (this.tickOuterRadius - this.tickLength) * 0.85;
+ this.needleThickness = (this.needleThickness < 2) ? 2 : this.needleThickness;
+ var endwidth = this.needleThickness * 0.4;
+
+
+ var dl = this.needleLength/10;
+ var dt = (this.needleThickness - endwidth)/10;
+ var templ;
+ for (var i=0; i<10; i++) {
+ templ = this.needleThickness - i*dt;
+ ctx.moveTo(dl*i*Math.cos(dataang), dl*i*Math.sin(dataang));
+ ctx.lineWidth = templ;
+ ctx.lineTo(dl*(i+1)*Math.cos(dataang), dl*(i+1)*Math.sin(dataang));
+ ctx.stroke();
+ }
+
+ ctx.restore();
+ }
+ else {
+ this._center = [(cw - trans * offx)/2 + trans * offx, (ch - trans*offy)/2 + trans * offy];
+ }
+ };
+
+ $.jqplot.MeterGaugeAxisRenderer = function() {
+ $.jqplot.LinearAxisRenderer.call(this);
+ };
+
+ $.jqplot.MeterGaugeAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer();
+ $.jqplot.MeterGaugeAxisRenderer.prototype.constructor = $.jqplot.MeterGaugeAxisRenderer;
+
+
+ // There are no traditional axes on a gauge chart. We just need to provide
+ // dummy objects with properties so the plot will render.
+ // called with scope of axis object.
+ $.jqplot.MeterGaugeAxisRenderer.prototype.init = function(options){
+ //
+ this.tickRenderer = $.jqplot.MeterGaugeTickRenderer;
+ $.extend(true, this, options);
+ // I don't think I'm going to need _dataBounds here.
+ // have to go Axis scaling in a way to fit chart onto plot area
+ // and provide u2p and p2u functionality for mouse cursor, etc.
+ // for convienence set _dataBounds to 0 and 100 and
+ // set min/max to 0 and 100.
+ this._dataBounds = {min:0, max:100};
+ this.min = 0;
+ this.max = 100;
+ this.showTicks = false;
+ this.ticks = [];
+ this.showMark = false;
+ this.show = false;
+ };
+
+ $.jqplot.MeterGaugeLegendRenderer = function(){
+ $.jqplot.TableLegendRenderer.call(this);
+ };
+
+ $.jqplot.MeterGaugeLegendRenderer.prototype = new $.jqplot.TableLegendRenderer();
+ $.jqplot.MeterGaugeLegendRenderer.prototype.constructor = $.jqplot.MeterGaugeLegendRenderer;
+
+ /**
+ * Class: $.jqplot.MeterGaugeLegendRenderer
+ *Meter gauges don't typically have a legend, this overrides the default legend renderer.
+ */
+ $.jqplot.MeterGaugeLegendRenderer.prototype.init = function(options) {
+ // Maximum number of rows in the legend. 0 or null for unlimited.
+ this.numberRows = null;
+ // Maximum number of columns in the legend. 0 or null for unlimited.
+ this.numberColumns = null;
+ $.extend(true, this, options);
+ };
+
+ // called with context of legend
+ $.jqplot.MeterGaugeLegendRenderer.prototype.draw = function() {
+ if (this.show) {
+ var series = this._series;
+ var ss = 'position:absolute;';
+ ss += (this.background) ? 'background:'+this.background+';' : '';
+ ss += (this.border) ? 'border:'+this.border+';' : '';
+ ss += (this.fontSize) ? 'font-size:'+this.fontSize+';' : '';
+ ss += (this.fontFamily) ? 'font-family:'+this.fontFamily+';' : '';
+ ss += (this.textColor) ? 'color:'+this.textColor+';' : '';
+ ss += (this.marginTop != null) ? 'margin-top:'+this.marginTop+';' : '';
+ ss += (this.marginBottom != null) ? 'margin-bottom:'+this.marginBottom+';' : '';
+ ss += (this.marginLeft != null) ? 'margin-left:'+this.marginLeft+';' : '';
+ ss += (this.marginRight != null) ? 'margin-right:'+this.marginRight+';' : '';
+ this._elem = $('<table class="jqplot-table-legend" style="'+ss+'"></table>');
+ // MeterGauge charts legends don't go by number of series, but by number of data points
+ // in the series. Refactor things here for that.
+
+ var pad = false,
+ reverse = false,
+ nr, nc;
+ var s = series[0];
+
+ if (s.show) {
+ var pd = s.data;
+ if (this.numberRows) {
+ nr = this.numberRows;
+ if (!this.numberColumns){
+ nc = Math.ceil(pd.length/nr);
+ }
+ else{
+ nc = this.numberColumns;
+ }
+ }
+ else if (this.numberColumns) {
+ nc = this.numberColumns;
+ nr = Math.ceil(pd.length/this.numberColumns);
+ }
+ else {
+ nr = pd.length;
+ nc = 1;
+ }
+
+ var i, j, tr, td1, td2, lt, rs, color;
+ var idx = 0;
+
+ for (i=0; i<nr; i++) {
+ if (reverse){
+ tr = $('<tr class="jqplot-table-legend"></tr>').prependTo(this._elem);
+ }
+ else{
+ tr = $('<tr class="jqplot-table-legend"></tr>').appendTo(this._elem);
+ }
+ for (j=0; j<nc; j++) {
+ if (idx < pd.length){
+ // debugger
+ lt = this.labels[idx] || pd[idx][0].toString();
+ color = s.color;
+ if (!reverse){
+ if (i>0){
+ pad = true;
+ }
+ else{
+ pad = false;
+ }
+ }
+ else{
+ if (i == nr -1){
+ pad = false;
+ }
+ else{
+ pad = true;
+ }
+ }
+ rs = (pad) ? this.rowSpacing : '0';
+
+ td1 = $('<td class="jqplot-table-legend" style="text-align:center;padding-top:'+rs+';">'+
+ '<div><div class="jqplot-table-legend-swatch" style="border-color:'+color+';"></div>'+
+ '</div></td>');
+ td2 = $('<td class="jqplot-table-legend" style="padding-top:'+rs+';"></td>');
+ if (this.escapeHtml){
+ td2.text(lt);
+ }
+ else {
+ td2.html(lt);
+ }
+ if (reverse) {
+ td2.prependTo(tr);
+ td1.prependTo(tr);
+ }
+ else {
+ td1.appendTo(tr);
+ td2.appendTo(tr);
+ }
+ pad = true;
+ }
+ idx++;
+ }
+ }
+ }
+ }
+ return this._elem;
+ };
+
+
+ // setup default renderers for axes and legend so user doesn't have to
+ // called with scope of plot
+ function preInit(target, data, options) {
+ // debugger
+ options = options || {};
+ options.axesDefaults = options.axesDefaults || {};
+ options.legend = options.legend || {};
+ options.seriesDefaults = options.seriesDefaults || {};
+ options.grid = options.grid || {};
+
+ // only set these if there is a gauge series
+ var setopts = false;
+ if (options.seriesDefaults.renderer == $.jqplot.MeterGaugeRenderer) {
+ setopts = true;
+ }
+ else if (options.series) {
+ for (var i=0; i < options.series.length; i++) {
+ if (options.series[i].renderer == $.jqplot.MeterGaugeRenderer) {
+ setopts = true;
+ }
+ }
+ }
+
+ if (setopts) {
+ options.axesDefaults.renderer = $.jqplot.MeterGaugeAxisRenderer;
+ options.legend.renderer = $.jqplot.MeterGaugeLegendRenderer;
+ options.legend.preDraw = true;
+ options.grid.background = options.grid.background || 'white';
+ options.grid.drawGridlines = false;
+ options.grid.borderWidth = (options.grid.borderWidth != null) ? options.grid.borderWidth : 0;
+ options.grid.shadow = (options.grid.shadow != null) ? options.grid.shadow : false;
+ }
+ }
+
+ // called with scope of plot
+ function postParseOptions(options) {
+ //
+ }
+
+ $.jqplot.preInitHooks.push(preInit);
+ $.jqplot.postParseOptionsHooks.push(postParseOptions);
+
+ $.jqplot.MeterGaugeTickRenderer = function() {
+ $.jqplot.AxisTickRenderer.call(this);
+ };
+
+ $.jqplot.MeterGaugeTickRenderer.prototype = new $.jqplot.AxisTickRenderer();
+ $.jqplot.MeterGaugeTickRenderer.prototype.constructor = $.jqplot.MeterGaugeTickRenderer;
+
+})(jQuery);
+
+
\ No newline at end of file
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.mobile.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.mobile.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.mobile.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,68 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqplot.jquerymobile plugin
+ * jQuery Mobile virtual event support.
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2011 Takashi Okamoto
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ */
+(function($) {
+ function postInit(target, data, options){
+ this.bindCustomEvents = function() {
+ this.eventCanvas._elem.bind('vclick', {plot:this}, this.onClick);
+ this.eventCanvas._elem.bind('dblclick', {plot:this}, this.onDblClick);
+ this.eventCanvas._elem.bind('taphold', {plot:this}, this.onDblClick);
+ this.eventCanvas._elem.bind('vmousedown', {plot:this}, this.onMouseDown);
+ this.eventCanvas._elem.bind('vmousemove', {plot:this}, this.onMouseMove);
+ this.eventCanvas._elem.bind('mouseenter', {plot:this}, this.onMouseEnter);
+ this.eventCanvas._elem.bind('mouseleave', {plot:this}, this.onMouseLeave);
+ if (this.captureRightClick) {
+ this.eventCanvas._elem.bind('vmouseup', {plot:this}, this.onRightClick);
+ this.eventCanvas._elem.get(0).oncontextmenu = function() {
+ return false;
+ };
+ }
+ else {
+ this.eventCanvas._elem.bind('vmouseup', {plot:this}, this.onMouseUp);
+ }
+ };
+ this.plugins.mobile = true;
+ }
+ $.jqplot.postInitHooks.push(postInit);
+})(jQuery);
\ No newline at end of file
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.ohlcRenderer.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.ohlcRenderer.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.ohlcRenderer.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,396 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ */
+(function($) {
+ /**
+ * Class: $.jqplot.OHLCRenderer
+ * jqPlot Plugin to draw Open Hi Low Close, Candlestick and Hi Low Close charts.
+ *
+ * To use this plugin, include the renderer js file in
+ * your source:
+ *
+ * > <script type="text/javascript" src="plugins/jqplot.ohlcRenderer.js"></script>
+ *
+ * You will most likely want to use a date axis renderer
+ * for the x axis also, so include the date axis render js file also:
+ *
+ * > <script type="text/javascript" src="plugins/jqplot.dateAxisRenderer.js"></script>
+ *
+ * Then you set the renderer in the series options on your plot:
+ *
+ * > series: [{renderer:$.jqplot.OHLCRenderer}]
+ *
+ * For OHLC and candlestick charts, data should be specified
+ * like so:
+ *
+ * > dat = [['07/06/2009',138.7,139.68,135.18,135.4], ['06/29/2009',143.46,144.66,139.79,140.02], ...]
+ *
+ * If the data array has only 4 values per point instead of 5,
+ * the renderer will create a Hi Low Close chart instead. In that case,
+ * data should be supplied like:
+ *
+ * > dat = [['07/06/2009',139.68,135.18,135.4], ['06/29/2009',144.66,139.79,140.02], ...]
+ *
+ * To generate a candlestick chart instead of an OHLC chart,
+ * set the "candlestick" option to true:
+ *
+ * > series: [{renderer:$.jqplot.OHLCRenderer, rendererOptions:{candleStick:true}}],
+ *
+ */
+ $.jqplot.OHLCRenderer = function(){
+ // subclass line renderer to make use of some of it's methods.
+ $.jqplot.LineRenderer.call(this);
+ // prop: candleStick
+ // true to render chart as candleStick.
+ // Must have an open price, cannot be a hlc chart.
+ this.candleStick = false;
+ // prop: tickLength
+ // length of the line in pixels indicating open and close price.
+ // Default will auto calculate based on plot width and
+ // number of points displayed.
+ this.tickLength = 'auto';
+ // prop: bodyWidth
+ // width of the candlestick body in pixels. Default will auto calculate
+ // based on plot width and number of candlesticks displayed.
+ this.bodyWidth = 'auto';
+ // prop: openColor
+ // color of the open price tick mark. Default is series color.
+ this.openColor = null;
+ // prop: closeColor
+ // color of the close price tick mark. Default is series color.
+ this.closeColor = null;
+ // prop: wickColor
+ // color of the hi-lo line thorugh the candlestick body.
+ // Default is the series color.
+ this.wickColor = null;
+ // prop: fillUpBody
+ // true to render an "up" day (close price greater than open price)
+ // with a filled candlestick body.
+ this.fillUpBody = false;
+ // prop: fillDownBody
+ // true to render a "down" day (close price lower than open price)
+ // with a filled candlestick body.
+ this.fillDownBody = true;
+ // prop: upBodyColor
+ // Color of candlestick body of an "up" day. Default is series color.
+ this.upBodyColor = null;
+ // prop: downBodyColor
+ // Color of candlestick body on a "down" day. Default is series color.
+ this.downBodyColor = null;
+ // prop: hlc
+ // true if is a hi-low-close chart (no open price).
+ // This is determined automatically from the series data.
+ this.hlc = false;
+ // prop: lineWidth
+ // Width of the hi-low line and open/close ticks.
+ // Must be set in the rendererOptions for the series.
+ this.lineWidth = 1.5;
+ this._tickLength;
+ this._bodyWidth;
+ };
+
+ $.jqplot.OHLCRenderer.prototype = new $.jqplot.LineRenderer();
+ $.jqplot.OHLCRenderer.prototype.constructor = $.jqplot.OHLCRenderer;
+
+ // called with scope of series.
+ $.jqplot.OHLCRenderer.prototype.init = function(options) {
+ options = options || {};
+ // lineWidth has to be set on the series, changes in renderer
+ // constructor have no effect. set the default here
+ // if no renderer option for lineWidth is specified.
+ this.lineWidth = options.lineWidth || 1.5;
+ $.jqplot.LineRenderer.prototype.init.call(this, options);
+ this._type = 'ohlc';
+ // set the yaxis data bounds here to account for hi and low values
+ var db = this._yaxis._dataBounds;
+ var d = this._plotData;
+ // if data points have less than 5 values, force a hlc chart.
+ if (d[0].length < 5) {
+ this.renderer.hlc = true;
+
+ for (var j=0; j<d.length; j++) {
+ if (d[j][2] < db.min || db.min == null) {
+ db.min = d[j][2];
+ }
+ if (d[j][1] > db.max || db.max == null) {
+ db.max = d[j][1];
+ }
+ }
+ }
+ else {
+ for (var j=0; j<d.length; j++) {
+ if (d[j][3] < db.min || db.min == null) {
+ db.min = d[j][3];
+ }
+ if (d[j][2] > db.max || db.max == null) {
+ db.max = d[j][2];
+ }
+ }
+ }
+
+ };
+
+ // called within scope of series.
+ $.jqplot.OHLCRenderer.prototype.draw = function(ctx, gd, options) {
+ var d = this.data;
+ var xmin = this._xaxis.min;
+ var xmax = this._xaxis.max;
+ // index of last value below range of plot.
+ var xminidx = 0;
+ // index of first value above range of plot.
+ var xmaxidx = d.length;
+ var xp = this._xaxis.series_u2p;
+ var yp = this._yaxis.series_u2p;
+ var i, prevColor, ops, b, h, w, a, points;
+ var o;
+ var r = this.renderer;
+ var opts = (options != undefined) ? options : {};
+ var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
+ var fill = (opts.fill != undefined) ? opts.fill : this.fill;
+ var fillAndStroke = (opts.fillAndStroke != undefined) ? opts.fillAndStroke : this.fillAndStroke;
+ r.bodyWidth = (opts.bodyWidth != undefined) ? opts.bodyWidth : r.bodyWidth;
+ r.tickLength = (opts.tickLength != undefined) ? opts.tickLength : r.tickLength;
+ ctx.save();
+ if (this.show) {
+ var x, open, hi, low, close;
+ // need to get widths based on number of points shown,
+ // not on total number of points. Use the results
+ // to speed up drawing in next step.
+ for (var i=0; i<d.length; i++) {
+ if (d[i][0] < xmin) {
+ xminidx = i;
+ }
+ else if (d[i][0] < xmax) {
+ xmaxidx = i+1;
+ }
+ }
+
+ var dwidth = this.gridData[xmaxidx-1][0] - this.gridData[xminidx][0];
+ var nvisiblePoints = xmaxidx - xminidx;
+ try {
+ var dinterval = Math.abs(this._xaxis.series_u2p(parseInt(this._xaxis._intervalStats[0].sortedIntervals[0].interval, 10)) - this._xaxis.series_u2p(0));
+ }
+
+ catch (e) {
+ var dinterval = dwidth / nvisiblePoints;
+ }
+
+ if (r.candleStick) {
+ if (typeof(r.bodyWidth) == 'number') {
+ r._bodyWidth = r.bodyWidth;
+ }
+ else {
+ r._bodyWidth = Math.min(20, dinterval/1.65);
+ }
+ }
+ else {
+ if (typeof(r.tickLength) == 'number') {
+ r._tickLength = r.tickLength;
+ }
+ else {
+ r._tickLength = Math.min(10, dinterval/3.5);
+ }
+ }
+
+ for (var i=xminidx; i<xmaxidx; i++) {
+ x = xp(d[i][0]);
+ if (r.hlc) {
+ open = null;
+ hi = yp(d[i][1]);
+ low = yp(d[i][2]);
+ close = yp(d[i][3]);
+ }
+ else {
+ open = yp(d[i][1]);
+ hi = yp(d[i][2]);
+ low = yp(d[i][3]);
+ close = yp(d[i][4]);
+ }
+ o = {};
+ if (r.candleStick && !r.hlc) {
+ w = r._bodyWidth;
+ a = x - w/2;
+ // draw candle
+ // determine if candle up or down
+ // up, remember grid coordinates increase downward
+ if (close < open) {
+ // draw wick
+ if (r.wickColor) {
+ o.color = r.wickColor;
+ }
+ else if (r.downBodyColor) {
+ o.color = r.upBodyColor;
+ }
+ ops = $.extend(true, {}, opts, o);
+ r.shapeRenderer.draw(ctx, [[x, hi], [x, close]], ops);
+ r.shapeRenderer.draw(ctx, [[x, open], [x, low]], ops);
+ o = {};
+ b = close;
+ h = open - close;
+ // if color specified, use it
+ if (r.fillUpBody) {
+ o.fillRect = true;
+ }
+ else {
+ o.strokeRect = true;
+ w = w - this.lineWidth;
+ a = x - w/2;
+ }
+ if (r.upBodyColor) {
+ o.color = r.upBodyColor;
+ o.fillStyle = r.upBodyColor;
+ }
+ points = [a, b, w, h];
+ }
+ // down
+ else if (close > open) {
+ // draw wick
+ if (r.wickColor) {
+ o.color = r.wickColor;
+ }
+ else if (r.downBodyColor) {
+ o.color = r.downBodyColor;
+ }
+ ops = $.extend(true, {}, opts, o);
+ r.shapeRenderer.draw(ctx, [[x, hi], [x, open]], ops);
+ r.shapeRenderer.draw(ctx, [[x, close], [x, low]], ops);
+
+ o = {};
+
+ b = open;
+ h = close - open;
+ // if color specified, use it
+ if (r.fillDownBody) {
+ o.fillRect = true;
+ }
+ else {
+ o.strokeRect = true;
+ w = w - this.lineWidth;
+ a = x - w/2;
+ }
+ if (r.downBodyColor) {
+ o.color = r.downBodyColor;
+ o.fillStyle = r.downBodyColor;
+ }
+ points = [a, b, w, h];
+ }
+ // even, open = close
+ else {
+ // draw wick
+ if (r.wickColor) {
+ o.color = r.wickColor;
+ }
+ ops = $.extend(true, {}, opts, o);
+ r.shapeRenderer.draw(ctx, [[x, hi], [x, low]], ops);
+ o = {};
+ o.fillRect = false;
+ o.strokeRect = false;
+ a = [x - w/2, open];
+ b = [x + w/2, close];
+ w = null;
+ h = null;
+ points = [a, b];
+ }
+ ops = $.extend(true, {}, opts, o);
+ r.shapeRenderer.draw(ctx, points, ops);
+ }
+ else {
+ prevColor = opts.color;
+ if (r.openColor) {
+ opts.color = r.openColor;
+ }
+ // draw open tick
+ if (!r.hlc) {
+ r.shapeRenderer.draw(ctx, [[x-r._tickLength, open], [x, open]], opts);
+ }
+ opts.color = prevColor;
+ // draw wick
+ if (r.wickColor) {
+ opts.color = r.wickColor;
+ }
+ r.shapeRenderer.draw(ctx, [[x, hi], [x, low]], opts);
+ opts.color = prevColor;
+ // draw close tick
+ if (r.closeColor) {
+ opts.color = r.closeColor;
+ }
+ r.shapeRenderer.draw(ctx, [[x, close], [x+r._tickLength, close]], opts);
+ opts.color = prevColor;
+ }
+ }
+ }
+
+ ctx.restore();
+ };
+
+ $.jqplot.OHLCRenderer.prototype.drawShadow = function(ctx, gd, options) {
+ // This is a no-op, shadows drawn with lines.
+ };
+
+ // called with scope of plot.
+ $.jqplot.OHLCRenderer.checkOptions = function(target, data, options) {
+ // provide some sensible highlighter options by default
+ // These aren't good for hlc, only for ohlc or candlestick
+ if (!options.highlighter) {
+ options.highlighter = {
+ showMarker:false,
+ tooltipAxes: 'y',
+ yvalues: 4,
+ formatString:'<table class="jqplot-highlighter"><tr><td>date:</td><td>%s</td></tr><tr><td>open:</td><td>%s</td></tr><tr><td>hi:</td><td>%s</td></tr><tr><td>low:</td><td>%s</td></tr><tr><td>close:</td><td>%s</td></tr></table>'
+ };
+ }
+ };
+
+ //$.jqplot.preInitHooks.push($.jqplot.OHLCRenderer.checkOptions);
+
+})(jQuery);
\ No newline at end of file
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pieRenderer.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pieRenderer.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pieRenderer.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,927 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ */
+(function($) {
+ /**
+ * Class: $.jqplot.PieRenderer
+ * Plugin renderer to draw a pie chart.
+ * x values, if present, will be used as slice labels.
+ * y values give slice size.
+ *
+ * To use this renderer, you need to include the
+ * pie renderer plugin, for example:
+ *
+ * > <script type="text/javascript" src="plugins/jqplot.pieRenderer.js"></script>
+ *
+ * Properties described here are passed into the $.jqplot function
+ * as options on the series renderer. For example:
+ *
+ * > plot2 = $.jqplot('chart2', [s1, s2], {
+ * > seriesDefaults: {
+ * > renderer:$.jqplot.PieRenderer,
+ * > rendererOptions:{
+ * > sliceMargin: 2,
+ * > startAngle: -90
+ * > }
+ * > }
+ * > });
+ *
+ * A pie plot will trigger events on the plot target
+ * according to user interaction. All events return the event object,
+ * the series index, the point (slice) index, and the point data for
+ * the appropriate slice.
+ *
+ * 'jqplotDataMouseOver' - triggered when user mouseing over a slice.
+ * 'jqplotDataHighlight' - triggered the first time user mouses over a slice,
+ * if highlighting is enabled.
+ * 'jqplotDataUnhighlight' - triggered when a user moves the mouse out of
+ * a highlighted slice.
+ * 'jqplotDataClick' - triggered when the user clicks on a slice.
+ * 'jqplotDataRightClick' - tiggered when the user right clicks on a slice if
+ * the "captureRightClick" option is set to true on the plot.
+ */
+ $.jqplot.PieRenderer = function(){
+ $.jqplot.LineRenderer.call(this);
+ };
+
+ $.jqplot.PieRenderer.prototype = new $.jqplot.LineRenderer();
+ $.jqplot.PieRenderer.prototype.constructor = $.jqplot.PieRenderer;
+
+ // called with scope of a series
+ $.jqplot.PieRenderer.prototype.init = function(options, plot) {
+ // Group: Properties
+ //
+ // prop: diameter
+ // Outer diameter of the pie, auto computed by default
+ this.diameter = null;
+ // prop: padding
+ // padding between the pie and plot edges, legend, etc.
+ this.padding = 20;
+ // prop: sliceMargin
+ // angular spacing between pie slices in degrees.
+ this.sliceMargin = 0;
+ // prop: fill
+ // true or false, wether to fil the slices.
+ this.fill = true;
+ // prop: shadowOffset
+ // offset of the shadow from the slice and offset of
+ // each succesive stroke of the shadow from the last.
+ this.shadowOffset = 2;
+ // prop: shadowAlpha
+ // transparency of the shadow (0 = transparent, 1 = opaque)
+ this.shadowAlpha = 0.07;
+ // prop: shadowDepth
+ // number of strokes to apply to the shadow,
+ // each stroke offset shadowOffset from the last.
+ this.shadowDepth = 5;
+ // prop: highlightMouseOver
+ // True to highlight slice when moused over.
+ // This must be false to enable highlightMouseDown to highlight when clicking on a slice.
+ this.highlightMouseOver = true;
+ // prop: highlightMouseDown
+ // True to highlight when a mouse button is pressed over a slice.
+ // This will be disabled if highlightMouseOver is true.
+ this.highlightMouseDown = false;
+ // prop: highlightColors
+ // an array of colors to use when highlighting a slice.
+ this.highlightColors = [];
+ // prop: dataLabels
+ // Either 'label', 'value', 'percent' or an array of labels to place on the pie slices.
+ // Defaults to percentage of each pie slice.
+ this.dataLabels = 'percent';
+ // prop: showDataLabels
+ // true to show data labels on slices.
+ this.showDataLabels = false;
+ // prop: dataLabelFormatString
+ // Format string for data labels. If none, '%s' is used for "label" and for arrays, '%d' for value and '%d%%' for percentage.
+ this.dataLabelFormatString = null;
+ // prop: dataLabelThreshold
+ // Threshhold in percentage (0-100) of pie area, below which no label will be displayed.
+ // This applies to all label types, not just to percentage labels.
+ this.dataLabelThreshold = 3;
+ // prop: dataLabelPositionFactor
+ // A Multiplier (0-1) of the pie radius which controls position of label on slice.
+ // Increasing will slide label toward edge of pie, decreasing will slide label toward center of pie.
+ this.dataLabelPositionFactor = 0.52;
+ // prop: dataLabelNudge
+ // Number of pixels to slide the label away from (+) or toward (-) the center of the pie.
+ this.dataLabelNudge = 2;
+ // prop: dataLabelCenterOn
+ // True to center the data label at its position.
+ // False to set the inside facing edge of the label at its position.
+ this.dataLabelCenterOn = true;
+ // prop: startAngle
+ // Angle to start drawing pie in degrees.
+ // According to orientation of canvas coordinate system:
+ // 0 = on the positive x axis
+ // -90 = on the positive y axis.
+ // 90 = on the negaive y axis.
+ // 180 or - 180 = on the negative x axis.
+ this.startAngle = 0;
+ this.tickRenderer = $.jqplot.PieTickRenderer;
+ // Used as check for conditions where pie shouldn't be drawn.
+ this._drawData = true;
+ this._type = 'pie';
+
+ // if user has passed in highlightMouseDown option and not set highlightMouseOver, disable highlightMouseOver
+ if (options.highlightMouseDown && options.highlightMouseOver == null) {
+ options.highlightMouseOver = false;
+ }
+
+ $.extend(true, this, options);
+
+ if (this.sliceMargin < 0) {
+ this.sliceMargin = 0;
+ }
+
+ this._diameter = null;
+ this._radius = null;
+ // array of [start,end] angles arrays, one for each slice. In radians.
+ this._sliceAngles = [];
+ // index of the currenty highlighted point, if any
+ this._highlightedPoint = null;
+
+ // set highlight colors if none provided
+ if (this.highlightColors.length == 0) {
+ for (var i=0; i<this.seriesColors.length; i++){
+ var rgba = $.jqplot.getColorComponents(this.seriesColors[i]);
+ var newrgb = [rgba[0], rgba[1], rgba[2]];
+ var sum = newrgb[0] + newrgb[1] + newrgb[2];
+ for (var j=0; j<3; j++) {
+ // when darkening, lowest color component can be is 60.
+ newrgb[j] = (sum > 570) ? newrgb[j] * 0.8 : newrgb[j] + 0.3 * (255 - newrgb[j]);
+ newrgb[j] = parseInt(newrgb[j], 10);
+ }
+ this.highlightColors.push('rgb('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+')');
+ }
+ }
+
+ this.highlightColorGenerator = new $.jqplot.ColorGenerator(this.highlightColors);
+
+ plot.postParseOptionsHooks.addOnce(postParseOptions);
+ plot.postInitHooks.addOnce(postInit);
+ plot.eventListenerHooks.addOnce('jqplotMouseMove', handleMove);
+ plot.eventListenerHooks.addOnce('jqplotMouseDown', handleMouseDown);
+ plot.eventListenerHooks.addOnce('jqplotMouseUp', handleMouseUp);
+ plot.eventListenerHooks.addOnce('jqplotClick', handleClick);
+ plot.eventListenerHooks.addOnce('jqplotRightClick', handleRightClick);
+ plot.postDrawHooks.addOnce(postPlotDraw);
+ };
+
+ $.jqplot.PieRenderer.prototype.setGridData = function(plot) {
+ // set gridData property. This will hold angle in radians of each data point.
+ var stack = [];
+ var td = [];
+ var sa = this.startAngle/180*Math.PI;
+ var tot = 0;
+ // don't know if we have any valid data yet, so set plot to not draw.
+ this._drawData = false;
+ for (var i=0; i<this.data.length; i++){
+ if (this.data[i][1] != 0) {
+ // we have data, O.K. to draw.
+ this._drawData = true;
+ }
+ stack.push(this.data[i][1]);
+ td.push([this.data[i][0]]);
+ if (i>0) {
+ stack[i] += stack[i-1];
+ }
+ tot += this.data[i][1];
+ }
+ var fact = Math.PI*2/stack[stack.length - 1];
+
+ for (var i=0; i<stack.length; i++) {
+ td[i][1] = stack[i] * fact;
+ td[i][2] = this.data[i][1]/tot;
+ }
+ this.gridData = td;
+ };
+
+ $.jqplot.PieRenderer.prototype.makeGridData = function(data, plot) {
+ var stack = [];
+ var td = [];
+ var tot = 0;
+ var sa = this.startAngle/180*Math.PI;
+ // don't know if we have any valid data yet, so set plot to not draw.
+ this._drawData = false;
+ for (var i=0; i<data.length; i++){
+ if (this.data[i][1] != 0) {
+ // we have data, O.K. to draw.
+ this._drawData = true;
+ }
+ stack.push(data[i][1]);
+ td.push([data[i][0]]);
+ if (i>0) {
+ stack[i] += stack[i-1];
+ }
+ tot += data[i][1];
+ }
+ var fact = Math.PI*2/stack[stack.length - 1];
+
+ for (var i=0; i<stack.length; i++) {
+ td[i][1] = stack[i] * fact;
+ td[i][2] = data[i][1]/tot;
+ }
+ return td;
+ };
+
+ function calcRadiusAdjustment(ang) {
+ return Math.sin((ang - (ang-Math.PI) / 8 / Math.PI )/2.0);
+ }
+
+ function calcRPrime(ang1, ang2, sliceMargin, fill, lineWidth) {
+ var rprime = 0;
+ var ang = ang2 - ang1;
+ var absang = Math.abs(ang);
+ var sm = sliceMargin;
+ if (fill == false) {
+ sm += lineWidth;
+ }
+
+ if (sm > 0 && absang > 0.01 && absang < 6.282) {
+ rprime = parseFloat(sm) / 2.0 / calcRadiusAdjustment(ang);
+ }
+
+ return rprime;
+ }
+
+ $.jqplot.PieRenderer.prototype.drawSlice = function (ctx, ang1, ang2, color, isShadow) {
+ if (this._drawData) {
+ var r = this._radius;
+ var fill = this.fill;
+ var lineWidth = this.lineWidth;
+ var sm = this.sliceMargin;
+ if (this.fill == false) {
+ sm += this.lineWidth;
+ }
+ ctx.save();
+ ctx.translate(this._center[0], this._center[1]);
+
+ var rprime = calcRPrime(ang1, ang2, this.sliceMargin, this.fill, this.lineWidth);
+
+ var transx = rprime * Math.cos((ang1 + ang2) / 2.0);
+ var transy = rprime * Math.sin((ang1 + ang2) / 2.0);
+
+ if ((ang2 - ang1) <= Math.PI) {
+ r -= rprime;
+ }
+ else {
+ r += rprime;
+ }
+
+ ctx.translate(transx, transy);
+
+ if (isShadow) {
+ for (var i=0, l=this.shadowDepth; i<l; i++) {
+ ctx.save();
+ ctx.translate(this.shadowOffset*Math.cos(this.shadowAngle/180*Math.PI), this.shadowOffset*Math.sin(this.shadowAngle/180*Math.PI));
+ doDraw(r);
+ }
+ for (var i=0, l=this.shadowDepth; i<l; i++) {
+ ctx.restore();
+ }
+ }
+
+ else {
+ doDraw(r);
+ }
+ ctx.restore();
+ }
+
+ function doDraw (rad) {
+ // Fix for IE and Chrome that can't seem to draw circles correctly.
+ // ang2 should always be <= 2 pi since that is the way the data is converted.
+ // 2Pi = 6.2831853, Pi = 3.1415927
+ if (ang2 > 6.282 + this.startAngle) {
+ ang2 = 6.282 + this.startAngle;
+ if (ang1 > ang2) {
+ ang1 = 6.281 + this.startAngle;
+ }
+ }
+ // Fix for IE, where it can't seem to handle 0 degree angles. Also avoids
+ // ugly line on unfilled pies.
+ if (ang1 >= ang2) {
+ return;
+ }
+
+ ctx.beginPath();
+ ctx.fillStyle = color;
+ ctx.strokeStyle = color;
+ ctx.lineWidth = lineWidth;
+ ctx.arc(0, 0, rad, ang1, ang2, false);
+ ctx.lineTo(0,0);
+ ctx.closePath();
+
+ if (fill) {
+ ctx.fill();
+ }
+ else {
+ ctx.stroke();
+ }
+ }
+ };
+
+ // called with scope of series
+ $.jqplot.PieRenderer.prototype.draw = function (ctx, gd, options, plot) {
+ var i;
+ var opts = (options != undefined) ? options : {};
+ // offset and direction of offset due to legend placement
+ var offx = 0;
+ var offy = 0;
+ var trans = 1;
+ var colorGenerator = new $.jqplot.ColorGenerator(this.seriesColors);
+ if (options.legendInfo && options.legendInfo.placement == 'insideGrid') {
+ var li = options.legendInfo;
+ switch (li.location) {
+ case 'nw':
+ offx = li.width + li.xoffset;
+ break;
+ case 'w':
+ offx = li.width + li.xoffset;
+ break;
+ case 'sw':
+ offx = li.width + li.xoffset;
+ break;
+ case 'ne':
+ offx = li.width + li.xoffset;
+ trans = -1;
+ break;
+ case 'e':
+ offx = li.width + li.xoffset;
+ trans = -1;
+ break;
+ case 'se':
+ offx = li.width + li.xoffset;
+ trans = -1;
+ break;
+ case 'n':
+ offy = li.height + li.yoffset;
+ break;
+ case 's':
+ offy = li.height + li.yoffset;
+ trans = -1;
+ break;
+ default:
+ break;
+ }
+ }
+
+ var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
+ var fill = (opts.fill != undefined) ? opts.fill : this.fill;
+ var cw = ctx.canvas.width;
+ var ch = ctx.canvas.height;
+ var w = cw - offx - 2 * this.padding;
+ var h = ch - offy - 2 * this.padding;
+ var mindim = Math.min(w,h);
+ var d = mindim;
+
+ // Fixes issue #272. Thanks hugwijst!
+ // reset slice angles array.
+ this._sliceAngles = [];
+
+ var sm = this.sliceMargin;
+ if (this.fill == false) {
+ sm += this.lineWidth;
+ }
+
+ var rprime;
+ var maxrprime = 0;
+
+ var ang, ang1, ang2, shadowColor;
+ var sa = this.startAngle / 180 * Math.PI;
+
+ // have to pre-draw shadows, so loop throgh here and calculate some values also.
+ for (var i=0, l=gd.length; i<l; i++) {
+ ang1 = (i == 0) ? sa : gd[i-1][1] + sa;
+ ang2 = gd[i][1] + sa;
+
+ this._sliceAngles.push([ang1, ang2]);
+
+ rprime = calcRPrime(ang1, ang2, this.sliceMargin, this.fill, this.lineWidth);
+
+ if (Math.abs(ang2-ang1) > Math.PI) {
+ maxrprime = Math.max(rprime, maxrprime);
+ }
+ }
+
+ if (this.diameter != null && this.diameter > 0) {
+ this._diameter = this.diameter - 2*maxrprime;
+ }
+ else {
+ this._diameter = d - 2*maxrprime;
+ }
+
+ // Need to check for undersized pie. This can happen if
+ // plot area too small and legend is too big.
+ if (this._diameter < 6) {
+ $.jqplot.log('Diameter of pie too small, not rendering.');
+ return;
+ }
+
+ var r = this._radius = this._diameter/2;
+
+ this._center = [(cw - trans * offx)/2 + trans * offx + maxrprime * Math.cos(sa), (ch - trans*offy)/2 + trans * offy + maxrprime * Math.sin(sa)];
+
+ if (this.shadow) {
+ for (var i=0, l=gd.length; i<l; i++) {
+ shadowColor = 'rgba(0,0,0,'+this.shadowAlpha+')';
+ this.renderer.drawSlice.call (this, ctx, this._sliceAngles[i][0], this._sliceAngles[i][1], shadowColor, true);
+ }
+ }
+
+ for (var i=0; i<gd.length; i++) {
+
+ this.renderer.drawSlice.call (this, ctx, this._sliceAngles[i][0], this._sliceAngles[i][1], colorGenerator.next(), false);
+
+ if (this.showDataLabels && gd[i][2]*100 >= this.dataLabelThreshold) {
+ var fstr, avgang = (this._sliceAngles[i][0] + this._sliceAngles[i][1])/2, label;
+
+ if (this.dataLabels == 'label') {
+ fstr = this.dataLabelFormatString || '%s';
+ label = $.jqplot.sprintf(fstr, gd[i][0]);
+ }
+ else if (this.dataLabels == 'value') {
+ fstr = this.dataLabelFormatString || '%d';
+ label = $.jqplot.sprintf(fstr, this.data[i][1]);
+ }
+ else if (this.dataLabels == 'percent') {
+ fstr = this.dataLabelFormatString || '%d%%';
+ label = $.jqplot.sprintf(fstr, gd[i][2]*100);
+ }
+ else if (this.dataLabels.constructor == Array) {
+ fstr = this.dataLabelFormatString || '%s';
+ label = $.jqplot.sprintf(fstr, this.dataLabels[i]);
+ }
+
+ var fact = (this._radius ) * this.dataLabelPositionFactor + this.sliceMargin + this.dataLabelNudge;
+
+ var x = this._center[0] + Math.cos(avgang) * fact + this.canvas._offsets.left;
+ var y = this._center[1] + Math.sin(avgang) * fact + this.canvas._offsets.top;
+
+ var labelelem = $('<div class="jqplot-pie-series jqplot-data-label" style="position:absolute;">' + label + '</div>').insertBefore(plot.eventCanvas._elem);
+ if (this.dataLabelCenterOn) {
+ x -= labelelem.width()/2;
+ y -= labelelem.height()/2;
+ }
+ else {
+ x -= labelelem.width() * Math.sin(avgang/2);
+ y -= labelelem.height()/2;
+ }
+ x = Math.round(x);
+ y = Math.round(y);
+ labelelem.css({left: x, top: y});
+ }
+ }
+ };
+
+ $.jqplot.PieAxisRenderer = function() {
+ $.jqplot.LinearAxisRenderer.call(this);
+ };
+
+ $.jqplot.PieAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer();
+ $.jqplot.PieAxisRenderer.prototype.constructor = $.jqplot.PieAxisRenderer;
+
+
+ // There are no traditional axes on a pie chart. We just need to provide
+ // dummy objects with properties so the plot will render.
+ // called with scope of axis object.
+ $.jqplot.PieAxisRenderer.prototype.init = function(options){
+ //
+ this.tickRenderer = $.jqplot.PieTickRenderer;
+ $.extend(true, this, options);
+ // I don't think I'm going to need _dataBounds here.
+ // have to go Axis scaling in a way to fit chart onto plot area
+ // and provide u2p and p2u functionality for mouse cursor, etc.
+ // for convienence set _dataBounds to 0 and 100 and
+ // set min/max to 0 and 100.
+ this._dataBounds = {min:0, max:100};
+ this.min = 0;
+ this.max = 100;
+ this.showTicks = false;
+ this.ticks = [];
+ this.showMark = false;
+ this.show = false;
+ };
+
+
+
+
+ $.jqplot.PieLegendRenderer = function(){
+ $.jqplot.TableLegendRenderer.call(this);
+ };
+
+ $.jqplot.PieLegendRenderer.prototype = new $.jqplot.TableLegendRenderer();
+ $.jqplot.PieLegendRenderer.prototype.constructor = $.jqplot.PieLegendRenderer;
+
+ /**
+ * Class: $.jqplot.PieLegendRenderer
+ * Legend Renderer specific to pie plots. Set by default
+ * when user creates a pie plot.
+ */
+ $.jqplot.PieLegendRenderer.prototype.init = function(options) {
+ // Group: Properties
+ //
+ // prop: numberRows
+ // Maximum number of rows in the legend. 0 or null for unlimited.
+ this.numberRows = null;
+ // prop: numberColumns
+ // Maximum number of columns in the legend. 0 or null for unlimited.
+ this.numberColumns = null;
+ $.extend(true, this, options);
+ };
+
+ // called with context of legend
+ $.jqplot.PieLegendRenderer.prototype.draw = function() {
+ var legend = this;
+ if (this.show) {
+ var series = this._series;
+
+
+ this._elem = $(document.createElement('table'));
+ this._elem.addClass('jqplot-table-legend');
+
+ var ss = {position:'absolute'};
+ if (this.background) {
+ ss['background'] = this.background;
+ }
+ if (this.border) {
+ ss['border'] = this.border;
+ }
+ if (this.fontSize) {
+ ss['fontSize'] = this.fontSize;
+ }
+ if (this.fontFamily) {
+ ss['fontFamily'] = this.fontFamily;
+ }
+ if (this.textColor) {
+ ss['textColor'] = this.textColor;
+ }
+ if (this.marginTop != null) {
+ ss['marginTop'] = this.marginTop;
+ }
+ if (this.marginBottom != null) {
+ ss['marginBottom'] = this.marginBottom;
+ }
+ if (this.marginLeft != null) {
+ ss['marginLeft'] = this.marginLeft;
+ }
+ if (this.marginRight != null) {
+ ss['marginRight'] = this.marginRight;
+ }
+
+ this._elem.css(ss);
+
+ // Pie charts legends don't go by number of series, but by number of data points
+ // in the series. Refactor things here for that.
+
+ var pad = false,
+ reverse = false,
+ nr,
+ nc;
+ var s = series[0];
+ var colorGenerator = new $.jqplot.ColorGenerator(s.seriesColors);
+
+ if (s.show) {
+ var pd = s.data;
+ if (this.numberRows) {
+ nr = this.numberRows;
+ if (!this.numberColumns){
+ nc = Math.ceil(pd.length/nr);
+ }
+ else{
+ nc = this.numberColumns;
+ }
+ }
+ else if (this.numberColumns) {
+ nc = this.numberColumns;
+ nr = Math.ceil(pd.length/this.numberColumns);
+ }
+ else {
+ nr = pd.length;
+ nc = 1;
+ }
+
+ var i, j;
+ var tr, td1, td2;
+ var lt, rs, color;
+ var idx = 0;
+ var div0, div1;
+
+ for (i=0; i<nr; i++) {
+ tr = $(document.createElement('tr'));
+ tr.addClass('jqplot-table-legend');
+
+ if (reverse){
+ tr.prependTo(this._elem);
+ }
+
+ else{
+ tr.appendTo(this._elem);
+ }
+
+ for (j=0; j<nc; j++) {
+ if (idx < pd.length){
+ lt = this.labels[idx] || pd[idx][0].toString();
+ color = colorGenerator.next();
+ if (!reverse){
+ if (i>0){
+ pad = true;
+ }
+ else{
+ pad = false;
+ }
+ }
+ else{
+ if (i == nr -1){
+ pad = false;
+ }
+ else{
+ pad = true;
+ }
+ }
+ rs = (pad) ? this.rowSpacing : '0';
+
+
+
+ td1 = $(document.createElement('td'));
+ td1.addClass('jqplot-table-legend jqplot-table-legend-swatch');
+ td1.css({textAlign: 'center', paddingTop: rs});
+
+ div0 = $(document.createElement('div'));
+ div0.addClass('jqplot-table-legend-swatch-outline');
+ div1 = $(document.createElement('div'));
+ div1.addClass('jqplot-table-legend-swatch');
+ div1.css({backgroundColor: color, borderColor: color});
+ td1.append(div0.append(div1));
+
+ td2 = $(document.createElement('td'));
+ td2.addClass('jqplot-table-legend jqplot-table-legend-label');
+ td2.css('paddingTop', rs);
+
+ if (this.escapeHtml){
+ td2.text(lt);
+ }
+ else {
+ td2.html(lt);
+ }
+ if (reverse) {
+ td2.prependTo(tr);
+ td1.prependTo(tr);
+ }
+ else {
+ td1.appendTo(tr);
+ td2.appendTo(tr);
+ }
+ pad = true;
+ }
+ idx++;
+ }
+ }
+ }
+ }
+ return this._elem;
+ };
+
+ $.jqplot.PieRenderer.prototype.handleMove = function(ev, gridpos, datapos, neighbor, plot) {
+ if (neighbor) {
+ var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
+ plot.target.trigger('jqplotDataMouseOver', ins);
+ if (plot.series[ins[0]].highlightMouseOver && !(ins[0] == plot.plugins.pieRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
+ plot.target.trigger('jqplotDataHighlight', ins);
+ highlight (plot, ins[0], ins[1]);
+ }
+ }
+ else if (neighbor == null) {
+ unhighlight (plot);
+ }
+ };
+
+
+ // this.eventCanvas._elem.bind($.jqplot.eventListenerHooks[i][0], {plot:this}, $.jqplot.eventListenerHooks[i][1]);
+
+ // setup default renderers for axes and legend so user doesn't have to
+ // called with scope of plot
+ function preInit(target, data, options) {
+ options = options || {};
+ options.axesDefaults = options.axesDefaults || {};
+ options.legend = options.legend || {};
+ options.seriesDefaults = options.seriesDefaults || {};
+ // only set these if there is a pie series
+ var setopts = false;
+ if (options.seriesDefaults.renderer == $.jqplot.PieRenderer) {
+ setopts = true;
+ }
+ else if (options.series) {
+ for (var i=0; i < options.series.length; i++) {
+ if (options.series[i].renderer == $.jqplot.PieRenderer) {
+ setopts = true;
+ }
+ }
+ }
+
+ if (setopts) {
+ options.axesDefaults.renderer = $.jqplot.PieAxisRenderer;
+ options.legend.renderer = $.jqplot.PieLegendRenderer;
+ options.legend.preDraw = true;
+ options.seriesDefaults.pointLabels = {show: false};
+ }
+ }
+
+ function postInit(target, data, options) {
+ for (var i=0; i<this.series.length; i++) {
+ if (this.series[i].renderer.constructor == $.jqplot.PieRenderer) {
+ // don't allow mouseover and mousedown at same time.
+ if (this.series[i].highlightMouseOver) {
+ this.series[i].highlightMouseDown = false;
+ }
+ }
+ }
+ }
+
+ // called with scope of plot
+ function postParseOptions(options) {
+ for (var i=0; i<this.series.length; i++) {
+ this.series[i].seriesColors = this.seriesColors;
+ this.series[i].colorGenerator = $.jqplot.colorGenerator;
+ }
+ }
+
+ function highlight (plot, sidx, pidx) {
+ var s = plot.series[sidx];
+ var canvas = plot.plugins.pieRenderer.highlightCanvas;
+ canvas._ctx.clearRect(0,0,canvas._ctx.canvas.width, canvas._ctx.canvas.height);
+ s._highlightedPoint = pidx;
+ plot.plugins.pieRenderer.highlightedSeriesIndex = sidx;
+ s.renderer.drawSlice.call(s, canvas._ctx, s._sliceAngles[pidx][0], s._sliceAngles[pidx][1], s.highlightColorGenerator.get(pidx), false);
+ }
+
+ function unhighlight (plot) {
+ var canvas = plot.plugins.pieRenderer.highlightCanvas;
+ canvas._ctx.clearRect(0,0, canvas._ctx.canvas.width, canvas._ctx.canvas.height);
+ for (var i=0; i<plot.series.length; i++) {
+ plot.series[i]._highlightedPoint = null;
+ }
+ plot.plugins.pieRenderer.highlightedSeriesIndex = null;
+ plot.target.trigger('jqplotDataUnhighlight');
+ }
+
+ function handleMove(ev, gridpos, datapos, neighbor, plot) {
+ if (neighbor) {
+ var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
+ var evt1 = jQuery.Event('jqplotDataMouseOver');
+ evt1.pageX = ev.pageX;
+ evt1.pageY = ev.pageY;
+ plot.target.trigger(evt1, ins);
+ if (plot.series[ins[0]].highlightMouseOver && !(ins[0] == plot.plugins.pieRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
+ var evt = jQuery.Event('jqplotDataHighlight');
+ evt.which = ev.which;
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ plot.target.trigger(evt, ins);
+ highlight (plot, ins[0], ins[1]);
+ }
+ }
+ else if (neighbor == null) {
+ unhighlight (plot);
+ }
+ }
+
+ function handleMouseDown(ev, gridpos, datapos, neighbor, plot) {
+ if (neighbor) {
+ var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
+ if (plot.series[ins[0]].highlightMouseDown && !(ins[0] == plot.plugins.pieRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
+ var evt = jQuery.Event('jqplotDataHighlight');
+ evt.which = ev.which;
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ plot.target.trigger(evt, ins);
+ highlight (plot, ins[0], ins[1]);
+ }
+ }
+ else if (neighbor == null) {
+ unhighlight (plot);
+ }
+ }
+
+ function handleMouseUp(ev, gridpos, datapos, neighbor, plot) {
+ var idx = plot.plugins.pieRenderer.highlightedSeriesIndex;
+ if (idx != null && plot.series[idx].highlightMouseDown) {
+ unhighlight(plot);
+ }
+ }
+
+ function handleClick(ev, gridpos, datapos, neighbor, plot) {
+ if (neighbor) {
+ var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
+ var evt = jQuery.Event('jqplotDataClick');
+ evt.which = ev.which;
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ plot.target.trigger(evt, ins);
+ }
+ }
+
+ function handleRightClick(ev, gridpos, datapos, neighbor, plot) {
+ if (neighbor) {
+ var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
+ var idx = plot.plugins.pieRenderer.highlightedSeriesIndex;
+ if (idx != null && plot.series[idx].highlightMouseDown) {
+ unhighlight(plot);
+ }
+ var evt = jQuery.Event('jqplotDataRightClick');
+ evt.which = ev.which;
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ plot.target.trigger(evt, ins);
+ }
+ }
+
+ // called within context of plot
+ // create a canvas which we can draw on.
+ // insert it before the eventCanvas, so eventCanvas will still capture events.
+ function postPlotDraw() {
+ // Memory Leaks patch
+ if (this.plugins.pieRenderer && this.plugins.pieRenderer.highlightCanvas) {
+ this.plugins.pieRenderer.highlightCanvas.resetCanvas();
+ this.plugins.pieRenderer.highlightCanvas = null;
+ }
+
+ this.plugins.pieRenderer = {highlightedSeriesIndex:null};
+ this.plugins.pieRenderer.highlightCanvas = new $.jqplot.GenericCanvas();
+
+ // do we have any data labels? if so, put highlight canvas before those
+ var labels = $(this.targetId+' .jqplot-data-label');
+ if (labels.length) {
+ $(labels[0]).before(this.plugins.pieRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-pieRenderer-highlight-canvas', this._plotDimensions, this));
+ }
+ // else put highlight canvas before event canvas.
+ else {
+ this.eventCanvas._elem.before(this.plugins.pieRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-pieRenderer-highlight-canvas', this._plotDimensions, this));
+ }
+
+ var hctx = this.plugins.pieRenderer.highlightCanvas.setContext();
+ this.eventCanvas._elem.bind('mouseleave', {plot:this}, function (ev) { unhighlight(ev.data.plot); });
+ }
+
+ $.jqplot.preInitHooks.push(preInit);
+
+ $.jqplot.PieTickRenderer = function() {
+ $.jqplot.AxisTickRenderer.call(this);
+ };
+
+ $.jqplot.PieTickRenderer.prototype = new $.jqplot.AxisTickRenderer();
+ $.jqplot.PieTickRenderer.prototype.constructor = $.jqplot.PieTickRenderer;
+
+})(jQuery);
+
+
\ No newline at end of file
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pointLabels.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pointLabels.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pointLabels.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,402 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ */
+(function($) {
+
+ /**
+ * Class: $.jqplot.PointLabels
+ * Plugin for putting labels at the data points.
+ *
+ * To use this plugin, include the js
+ * file in your source:
+ *
+ * > <script type="text/javascript" src="plugins/jqplot.pointLabels.js"></script>
+ *
+ * By default, the last value in the data ponit array in the data series is used
+ * for the label. For most series renderers, extra data can be added to the
+ * data point arrays and the last value will be used as the label.
+ *
+ * For instance,
+ * this series:
+ *
+ * > [[1,4], [3,5], [7,2]]
+ *
+ * Would, by default, use the y values in the labels.
+ * Extra data can be added to the series like so:
+ *
+ * > [[1,4,'mid'], [3 5,'hi'], [7,2,'low']]
+ *
+ * And now the point labels would be 'mid', 'low', and 'hi'.
+ *
+ * Options to the point labels and a custom labels array can be passed into the
+ * "pointLabels" option on the series option like so:
+ *
+ * > series:[{pointLabels:{
+ * > labels:['mid', 'hi', 'low'],
+ * > location:'se',
+ * > ypadding: 12
+ * > }
+ * > }]
+ *
+ * A custom labels array in the options takes precendence over any labels
+ * in the series data. If you have a custom labels array in the options,
+ * but still want to use values from the series array as labels, set the
+ * "labelsFromSeries" option to true.
+ *
+ * By default, html entities (<, >, etc.) are escaped in point labels.
+ * If you want to include actual html markup in the labels,
+ * set the "escapeHTML" option to false.
+ *
+ */
+ $.jqplot.PointLabels = function(options) {
+ // Group: Properties
+ //
+ // prop: show
+ // show the labels or not.
+ this.show = $.jqplot.config.enablePlugins;
+ // prop: location
+ // compass location where to position the label around the point.
+ // 'n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw'
+ this.location = 'n';
+ // prop: labelsFromSeries
+ // true to use labels within data point arrays.
+ this.labelsFromSeries = false;
+ // prop: seriesLabelIndex
+ // array index for location of labels within data point arrays.
+ // if null, will use the last element of the data point array.
+ this.seriesLabelIndex = null;
+ // prop: labels
+ // array of arrays of labels, one array for each series.
+ this.labels = [];
+ // actual labels that will get displayed.
+ // needed to preserve user specified labels in labels array.
+ this._labels = [];
+ // prop: stackedValue
+ // true to display value as stacked in a stacked plot.
+ // no effect if labels is specified.
+ this.stackedValue = false;
+ // prop: ypadding
+ // vertical padding in pixels between point and label
+ this.ypadding = 6;
+ // prop: xpadding
+ // horizontal padding in pixels between point and label
+ this.xpadding = 6;
+ // prop: escapeHTML
+ // true to escape html entities in the labels.
+ // If you want to include markup in the labels, set to false.
+ this.escapeHTML = true;
+ // prop: edgeTolerance
+ // Number of pixels that the label must be away from an axis
+ // boundary in order to be drawn. Negative values will allow overlap
+ // with the grid boundaries.
+ this.edgeTolerance = -5;
+ // prop: formatter
+ // A class of a formatter for the tick text. sprintf by default.
+ this.formatter = $.jqplot.DefaultTickFormatter;
+ // prop: formatString
+ // string passed to the formatter.
+ this.formatString = '';
+ // prop: hideZeros
+ // true to not show a label for a value which is 0.
+ this.hideZeros = false;
+ this._elems = [];
+
+ $.extend(true, this, options);
+ };
+
+ var locations = ['nw', 'n', 'ne', 'e', 'se', 's', 'sw', 'w'];
+ var locationIndicies = {'nw':0, 'n':1, 'ne':2, 'e':3, 'se':4, 's':5, 'sw':6, 'w':7};
+ var oppositeLocations = ['se', 's', 'sw', 'w', 'nw', 'n', 'ne', 'e'];
+
+ // called with scope of a series
+ $.jqplot.PointLabels.init = function (target, data, seriesDefaults, opts, plot){
+ var options = $.extend(true, {}, seriesDefaults, opts);
+ options.pointLabels = options.pointLabels || {};
+ if (this.renderer.constructor === $.jqplot.BarRenderer && this.barDirection === 'horizontal' && !options.pointLabels.location) {
+ options.pointLabels.location = 'e';
+ }
+ // add a pointLabels attribute to the series plugins
+ this.plugins.pointLabels = new $.jqplot.PointLabels(options.pointLabels);
+ this.plugins.pointLabels.setLabels.call(this);
+ };
+
+ // called with scope of series
+ $.jqplot.PointLabels.prototype.setLabels = function() {
+ var p = this.plugins.pointLabels;
+ var labelIdx;
+ if (p.seriesLabelIndex != null) {
+ labelIdx = p.seriesLabelIndex;
+ }
+ else if (this.renderer.constructor === $.jqplot.BarRenderer && this.barDirection === 'horizontal') {
+ labelIdx = 0;
+ }
+ else {
+ labelIdx = (this._plotData.length === 0) ? 0 : this._plotData[0].length -1;
+ }
+ p._labels = [];
+ if (p.labels.length === 0 || p.labelsFromSeries) {
+ if (p.stackedValue) {
+ if (this._plotData.length && this._plotData[0].length){
+ // var idx = p.seriesLabelIndex || this._plotData[0].length -1;
+ for (var i=0; i<this._plotData.length; i++) {
+ p._labels.push(this._plotData[i][labelIdx]);
+ }
+ }
+ }
+ else {
+ // var d = this._plotData;
+ var d = this.data;
+ if (this.renderer.constructor === $.jqplot.BarRenderer && this.waterfall) {
+ d = this._data;
+ }
+ if (d.length && d[0].length) {
+ // var idx = p.seriesLabelIndex || d[0].length -1;
+ for (var i=0; i<d.length; i++) {
+ p._labels.push(d[i][labelIdx]);
+ }
+ }
+ d = null;
+ }
+ }
+ else if (p.labels.length){
+ p._labels = p.labels;
+ }
+ };
+
+ $.jqplot.PointLabels.prototype.xOffset = function(elem, location, padding) {
+ location = location || this.location;
+ padding = padding || this.xpadding;
+ var offset;
+
+ switch (location) {
+ case 'nw':
+ offset = -elem.outerWidth(true) - this.xpadding;
+ break;
+ case 'n':
+ offset = -elem.outerWidth(true)/2;
+ break;
+ case 'ne':
+ offset = this.xpadding;
+ break;
+ case 'e':
+ offset = this.xpadding;
+ break;
+ case 'se':
+ offset = this.xpadding;
+ break;
+ case 's':
+ offset = -elem.outerWidth(true)/2;
+ break;
+ case 'sw':
+ offset = -elem.outerWidth(true) - this.xpadding;
+ break;
+ case 'w':
+ offset = -elem.outerWidth(true) - this.xpadding;
+ break;
+ default: // same as 'nw'
+ offset = -elem.outerWidth(true) - this.xpadding;
+ break;
+ }
+ return offset;
+ };
+
+ $.jqplot.PointLabels.prototype.yOffset = function(elem, location, padding) {
+ location = location || this.location;
+ padding = padding || this.xpadding;
+ var offset;
+
+ switch (location) {
+ case 'nw':
+ offset = -elem.outerHeight(true) - this.ypadding;
+ break;
+ case 'n':
+ offset = -elem.outerHeight(true) - this.ypadding;
+ break;
+ case 'ne':
+ offset = -elem.outerHeight(true) - this.ypadding;
+ break;
+ case 'e':
+ offset = -elem.outerHeight(true)/2;
+ break;
+ case 'se':
+ offset = this.ypadding;
+ break;
+ case 's':
+ offset = this.ypadding;
+ break;
+ case 'sw':
+ offset = this.ypadding;
+ break;
+ case 'w':
+ offset = -elem.outerHeight(true)/2;
+ break;
+ default: // same as 'nw'
+ offset = -elem.outerHeight(true) - this.ypadding;
+ break;
+ }
+ return offset;
+ };
+
+ // called with scope of series
+ $.jqplot.PointLabels.draw = function (sctx, options, plot) {
+ var p = this.plugins.pointLabels;
+ // set labels again in case they have changed.
+ p.setLabels.call(this);
+ // remove any previous labels
+ for (var i=0; i<p._elems.length; i++) {
+ // Memory Leaks patch
+ // p._elems[i].remove();
+ p._elems[i].emptyForce();
+ }
+ p._elems.splice(0, p._elems.length);
+
+ if (p.show) {
+ var ax = '_'+this._stackAxis+'axis';
+
+ if (!p.formatString) {
+ p.formatString = this[ax]._ticks[0].formatString;
+ p.formatter = this[ax]._ticks[0].formatter;
+ }
+
+ var pd = this._plotData;
+ var ppd = this._prevPlotData;
+ var xax = this._xaxis;
+ var yax = this._yaxis;
+ var elem, helem;
+
+ for (var i=0, l=p._labels.length; i < l; i++) {
+ var label = p._labels[i];
+
+ if (p.hideZeros && parseInt(p._labels[i], 10) == 0) {
+ label = '';
+ }
+
+ if (label != null) {
+ label = p.formatter(p.formatString, label);
+ }
+
+ helem = document.createElement('div');
+ p._elems[i] = $(helem);
+
+ elem = p._elems[i];
+
+
+ elem.addClass('jqplot-point-label jqplot-series-'+this.index+' jqplot-point-'+i);
+ elem.css('position', 'absolute');
+ elem.insertAfter(sctx.canvas);
+
+ if (p.escapeHTML) {
+ elem.text(label);
+ }
+ else {
+ elem.html(label);
+ }
+ var location = p.location;
+ if ((this.fillToZero && pd[i][1] < 0) || (this.fillToZero && this._type === 'bar' && this.barDirection === 'horizontal' && pd[i][0] < 0) || (this.waterfall && parseInt(label, 10)) < 0) {
+ location = oppositeLocations[locationIndicies[location]];
+ }
+
+
+ var ell = xax.u2p(pd[i][0]) + p.xOffset(elem, location);
+ var elt = yax.u2p(pd[i][1]) + p.yOffset(elem, location);
+
+ // we have stacked chart but are not showing stacked values,
+ // place labels in center.
+ if (this._stack && !p.stackedValue) {
+ if (this.barDirection === "vertical") {
+ elt = (this._barPoints[i][0][1] + this._barPoints[i][1][1]) / 2 + plot._gridPadding.top - 0.5 * elem.outerHeight(true);
+ }
+ else {
+ ell = (this._barPoints[i][2][0] + this._barPoints[i][0][0]) / 2 + plot._gridPadding.left - 0.5 * elem.outerWidth(true);
+ }
+ }
+
+ if (this.renderer.constructor == $.jqplot.BarRenderer) {
+ if (this.barDirection == "vertical") {
+ ell += this._barNudge;
+ }
+ else {
+ elt -= this._barNudge;
+ }
+ }
+ elem.css('left', ell);
+ elem.css('top', elt);
+ var elr = ell + elem.width();
+ var elb = elt + elem.height();
+ var et = p.edgeTolerance;
+ var scl = $(sctx.canvas).position().left;
+ var sct = $(sctx.canvas).position().top;
+ var scr = sctx.canvas.width + scl;
+ var scb = sctx.canvas.height + sct;
+ // if label is outside of allowed area, remove it
+ if (ell - et < scl || elt - et < sct || elr + et > scr || elb + et > scb) {
+ elem.remove();
+ }
+
+ elem = null;
+ helem = null;
+ }
+
+ // finally, animate them if the series is animated
+ // if (this.renderer.animation && this.renderer.animation._supported && this.renderer.animation.show && plot._drawCount < 2) {
+ // var sel = '.jqplot-point-label.jqplot-series-'+this.index;
+ // $(sel).hide();
+ // $(sel).fadeIn(1000);
+ // }
+
+ }
+ };
+
+ $.jqplot.postSeriesInitHooks.push($.jqplot.PointLabels.init);
+ $.jqplot.postDrawSeriesHooks.push($.jqplot.PointLabels.draw);
+})(jQuery);
\ No newline at end of file
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pyramidAxisRenderer.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pyramidAxisRenderer.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pyramidAxisRenderer.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,751 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ */
+(function($) {
+ $.jqplot.PyramidAxisRenderer = function() {
+ $.jqplot.LinearAxisRenderer.call(this);
+ };
+
+ $.jqplot.PyramidAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer();
+ $.jqplot.PyramidAxisRenderer.prototype.constructor = $.jqplot.PyramidAxisRenderer;
+
+ // called with scope of axis
+ $.jqplot.PyramidAxisRenderer.prototype.init = function(options){
+ // Group: Properties
+ //
+ // prop: position
+ // Position of axis. Values are: top, bottom , left, center, right.
+ // By default, x and x2 axes are bottom, y axis is center.
+ this.position = null;
+ // prop: drawBaseline
+ // True to draw the axis baseline.
+ this.drawBaseline = true;
+ // prop: baselineWidth
+ // width of the baseline in pixels.
+ this.baselineWidth = null;
+ // prop: baselineColor
+ // CSS color spec for the baseline.
+ this.baselineColor = null;
+ this.tickSpacingFactor = 25;
+ this._type = 'pyramid';
+ this._splitAxis = false;
+ this._splitLength = null;
+ this.category = false;
+ this._autoFormatString = '';
+ this._overrideFormatString = false;
+
+ $.extend(true, this, options);
+ this.renderer.options = options;
+
+ this.resetDataBounds = this.renderer.resetDataBounds;
+ this.resetDataBounds();
+
+ };
+
+ $.jqplot.PyramidAxisRenderer.prototype.resetDataBounds = function() {
+ // Go through all the series attached to this axis and find
+ // the min/max bounds for this axis.
+ var db = this._dataBounds;
+ db.min = null;
+ db.max = null;
+ var temp;
+ for (var i=0; i<this._series.length; i++) {
+ var s = this._series[i];
+ var d = s._plotData;
+
+ for (var j=0, l=d.length; j<l; j++) {
+ if (this.name.charAt(0) === 'x') {
+ temp = d[j][1];
+ if ((temp !== null && temp < db.min) || db.min === null) {
+ db.min = temp;
+ }
+ if ((temp !== null && temp > db.max) || db.max === null) {
+ db.max = temp;
+ }
+ }
+ else {
+ temp = d[j][0];
+ if ((temp !== null && temp < db.min) || db.min === null) {
+ db.min = temp;
+ }
+ if ((temp !== null && temp > db.max) || db.max === null) {
+ db.max = temp;
+ }
+ }
+ }
+ }
+ };
+
+ // called with scope of axis
+ $.jqplot.PyramidAxisRenderer.prototype.draw = function(ctx, plot) {
+ if (this.show) {
+ // populate the axis label and value properties.
+ // createTicks is a method on the renderer, but
+ // call it within the scope of the axis.
+ this.renderer.createTicks.call(this, plot);
+ // fill a div with axes labels in the right direction.
+ // Need to pregenerate each axis to get it's bounds and
+ // position it and the labels correctly on the plot.
+ var dim=0;
+ var temp;
+ // Added for theming.
+ if (this._elem) {
+ // Memory Leaks patch
+ //this._elem.empty();
+ this._elem.emptyForce();
+ this._elem = null;
+ }
+
+ this._elem = $(document.createElement('div'));
+ this._elem.addClass('jqplot-axis jqplot-'+this.name);
+ this._elem.css('position', 'absolute');
+
+
+ if (this.name == 'xaxis' || this.name == 'x2axis') {
+ this._elem.width(this._plotDimensions.width);
+ }
+ else {
+ this._elem.height(this._plotDimensions.height);
+ }
+
+ // create a _label object.
+ this.labelOptions.axis = this.name;
+ this._label = new this.labelRenderer(this.labelOptions);
+ if (this._label.show) {
+ var elem = this._label.draw(ctx, plot);
+ elem.appendTo(this._elem);
+ elem = null;
+ }
+
+ var t = this._ticks;
+ var tick;
+ for (var i=0; i<t.length; i++) {
+ tick = t[i];
+ if (tick.show && tick.showLabel && (!tick.isMinorTick)) {
+ this._elem.append(tick.draw(ctx, plot));
+ }
+ }
+ tick = null;
+ t = null;
+ }
+ return this._elem;
+ };
+
+ // Note, primes can be found on http://primes.utm.edu/
+ var _primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997];
+
+
+ var _primesHash = {};
+
+ for (var i =0, l = _primes.length; i < l; i++) {
+ _primesHash[_primes[i]] = _primes[i];
+ }
+
+ // called with scope of axis
+ $.jqplot.PyramidAxisRenderer.prototype.createTicks = function(plot) {
+ // we're are operating on an axis here
+ var userTicks = this.ticks;
+ // databounds were set on axis initialization.
+ var db = this._dataBounds;
+ var dim;
+ var interval;
+ var min;
+ var max;
+ var range;
+ var pos1;
+ var pos2;
+ var tt;
+ var i;
+ var l;
+ var s;
+ // get a copy of user's settings for min/max.
+ var userMin = this.min;
+ var userMax = this.max;
+ var ut;
+ var t;
+ var threshold;
+ var tdim;
+ var scalefact;
+ var ret;
+ var tumin;
+ var tumax;
+ var maxVisibleTicks;
+ var val;
+ var skip = null;
+ var temp;
+
+ // if we already have ticks, use them.
+ // ticks must be in order of increasing value.
+
+ if (userTicks.length) {
+ // ticks could be 1D or 2D array of [val, val, ,,,] or [[val, label], [val, label], ...] or mixed
+ for (i=0, l=userTicks.length; i<l; i++){
+ ut = userTicks[i];
+ t = new this.tickRenderer(this.tickOptions);
+ if ($.isArray(ut)) {
+ t.value = ut[0];
+ t.label = ut[1];
+ t.setTick(ut[0], this.name);
+ this._ticks.push(t);
+ }
+
+ else if ($.isPlainObject(ut)) {
+ $.extend(true, t, ut);
+ t.axis = this.name;
+ this._ticks.push(t);
+ }
+
+ else {
+ if (typeof ut === 'string') {
+ val = i + plot.defaultAxisStart;
+ }
+ else {
+ val = ut;
+ }
+ t.value = val;
+ t.label = ut;
+ t.axis = this.name;
+ this._ticks.push(t);
+ }
+ }
+ this.numberTicks = userTicks.length;
+ this.min = this._ticks[0].value;
+ this.max = this._ticks[this.numberTicks-1].value;
+ this.tickInterval = (this.max - this.min) / (this.numberTicks - 1);
+
+ // use user specified tickInterval if there is one
+ if (this._options.tickInterval) {
+ // hide every tick except for ticks on interval
+ var ti = this._options.tickInterval;
+ for (i=0; i<this.numberTicks; i++) {
+ if (i%ti !== 0) {
+ // this._ticks[i].show = false;
+ this._ticks[i].isMinorTick = true;
+ }
+ }
+ }
+
+ else {
+ // check if we have too many ticks
+ dim = (this.name.charAt(0) === 'x') ? this._plotDimensions.width : this._plotDimensions.height;
+ maxVisibleTicks = Math.round(2.0 + dim/this.tickSpacingFactor);
+
+ if (this.numberTicks > maxVisibleTicks) {
+ // check for number of ticks we can skip
+ temp = this.numberTicks - 1;
+ for (i=2; i<temp; i++) {
+ if (temp % i === 0 && temp/i < maxVisibleTicks) {
+ skip = i-1;
+ break;
+ }
+ }
+
+ if (skip !== null) {
+ var count = 1;
+ for (i=1, l=this._ticks.length; i<l; i++) {
+ if (count <= skip) {
+ this._ticks[i].show = false;
+ count += 1;
+ }
+ else {
+ count = 1;
+ }
+ }
+ }
+ }
+ }
+
+ // if category style, add minor ticks in between
+ temp = [];
+ if (this.category) {
+ // turn off gridline and mark on first tick
+ this._ticks[0].showGridline = false;
+ this._ticks[0].showMark = false;
+
+ for (i=this._ticks.length-1; i>0; i--) {
+ t = new this.tickRenderer(this.tickOptions);
+ t.value = this._ticks[i-1].value + this.tickInterval/2.0;
+ t.label = '';
+ t.showLabel = false;
+ t.axis = this.name;
+ this._ticks[i].showGridline = false;
+ this._ticks[i].showMark = false;
+ this._ticks.splice(i, 0, t);
+ // temp.push(t);
+ }
+
+ // merge in the new ticks
+ // for (i=1, l=temp.length; i<l; i++) {
+ // this._ticks.splice(i, 0, temp[i]);
+ // }
+
+ // now add a tick at beginning and end
+ t = new this.tickRenderer(this.tickOptions);
+ t.value = this._ticks[0].value - this.tickInterval/2.0;
+ t.label = '';
+ t.showLabel = false;
+ t.axis = this.name;
+ this._ticks.unshift(t);
+
+ t = new this.tickRenderer(this.tickOptions);
+ t.value = this._ticks[this._ticks.length-1].value + this.tickInterval/2.0;
+ t.label = '';
+ t.showLabel = false;
+ t.axis = this.name;
+ this._ticks.push(t);
+
+ this.tickInterval = this.tickInterval / 2.0;
+ this.numberTicks = this._ticks.length;
+ this.min = this._ticks[0].value;
+ this.max = this._ticks[this._ticks.length-1].value;
+ }
+ }
+
+ // we don't have any ticks yet, let's make some!
+ else {
+ if (this.name.charAt(0) === 'x') {
+ dim = this._plotDimensions.width;
+ // make sure x axis is symetric about 0.
+ var tempmax = Math.max(db.max, Math.abs(db.min));
+ var tempmin = Math.min(db.min, -tempmax);
+ // min = ((this.min != null) ? this.min : tempmin);
+ // max = ((this.max != null) ? this.max : tempmax);
+ min = tempmin;
+ max = tempmax;
+ range = max - min;
+
+ if (this.tickOptions == null || !this.tickOptions.formatString) {
+ this._overrideFormatString = true;
+ }
+
+ threshold = 30;
+ tdim = Math.max(dim, threshold+1);
+ scalefact = (tdim-threshold)/300.0;
+ ret = $.jqplot.LinearTickGenerator(min, max, scalefact);
+ // calculate a padded max and min, points should be less than these
+ // so that they aren't too close to the edges of the plot.
+ // User can adjust how much padding is allowed with pad, padMin and PadMax options.
+ tumin = min + range*(this.padMin - 1);
+ tumax = max - range*(this.padMax - 1);
+
+ if (min < tumin || max > tumax) {
+ tumin = min - range*(this.padMin - 1);
+ tumax = max + range*(this.padMax - 1);
+ ret = $.jqplot.LinearTickGenerator(tumin, tumax, scalefact);
+ }
+
+ this.min = ret[0];
+ this.max = ret[1];
+ this.numberTicks = ret[2];
+ this._autoFormatString = ret[3];
+ this.tickInterval = ret[4];
+ }
+ else {
+ dim = this._plotDimensions.height;
+
+ // ticks will be on whole integers like 1, 2, 3, ... or 1, 4, 7, ...
+ min = db.min;
+ max = db.max;
+ s = this._series[0];
+ this._ticks = [];
+
+ range = max - min;
+
+ // if range is a prime, will get only 2 ticks, expand range in that case.
+ if (_primesHash[range]) {
+ range += 1;
+ max += 1;
+ }
+
+ this.max = max;
+ this.min = min;
+
+ maxVisibleTicks = Math.round(2.0 + dim/this.tickSpacingFactor);
+
+ if (range + 1 <= maxVisibleTicks) {
+ this.numberTicks = range + 1;
+ this.tickInterval = 1.0;
+ }
+
+ else {
+ // figure out a round number of ticks to skip in every interval
+ // range / ti + 1 = nt
+ // ti = range / (nt - 1)
+ for (var i=maxVisibleTicks; i>1; i--) {
+ if (range/(i - 1) === Math.round(range/(i - 1))) {
+ this.numberTicks = i;
+ this.tickInterval = range/(i - 1);
+ break;
+ }
+
+ }
+ }
+ }
+
+ if (this._overrideFormatString && this._autoFormatString != '') {
+ this.tickOptions = this.tickOptions || {};
+ this.tickOptions.formatString = this._autoFormatString;
+ }
+
+ var labelval;
+ for (i=0; i<this.numberTicks; i++) {
+ this.tickOptions.axis = this.name;
+ labelval = this.min + this.tickInterval * i;
+ if (this.name.charAt(0) === 'x') {
+ labelval = Math.abs(labelval);
+ }
+ // this.tickOptions.label = String (labelval);
+ this.tickOptions.value = this.min + this.tickInterval * i;
+ t = new this.tickRenderer(this.tickOptions);
+
+ t.label = t.prefix + t.formatter(t.formatString, labelval);
+
+ this._ticks.push(t);
+ // for x axis, if y axis is in middle, add a symetrical 0 tick
+ if (this.name.charAt(0) === 'x' && plot.axes.yMidAxis.show && this.tickOptions.value === 0) {
+ this._splitAxis = true;
+ this._splitLength = plot.axes.yMidAxis.getWidth();
+ // t.value = -this.max/2000.0;
+ t = new this.tickRenderer(this.tickOptions);
+ this._ticks.push(t);
+ t.value = this.max/2000.0;
+ }
+ }
+ t = null;
+ }
+ };
+
+ // called with scope of axis
+ $.jqplot.PyramidAxisRenderer.prototype.set = function() {
+ var dim = 0;
+ var temp;
+ var w = 0;
+ var h = 0;
+ var i;
+ var t;
+ var tick;
+ var lshow = (this._label == null) ? false : this._label.show;
+ if (this.show) {
+ t = this._ticks;
+ l = t.length;
+ for (i=0; i<l; i++) {
+ tick = t[i];
+ if (!tick._breakTick && tick.show && tick.showLabel && !tick.isMinorTick) {
+ if (this.name.charAt(0) === 'x') {
+ temp = tick._elem.outerHeight(true);
+ }
+ else {
+ temp = tick._elem.outerWidth(true);
+ }
+ if (temp > dim) {
+ dim = temp;
+ }
+ }
+ }
+
+ if (this.name === 'yMidAxis') {
+ for (i=0; i<l; i++) {
+ tick = t[i];
+ if (tick._elem) {
+ temp = (dim - tick._elem.outerWidth(true))/2.0;
+ tick._elem.css('left', temp);
+ }
+ }
+ }
+ tick = null;
+ t = null;
+
+ if (lshow) {
+ w = this._label._elem.outerWidth(true);
+ h = this._label._elem.outerHeight(true);
+ }
+ if (this.name === 'xaxis') {
+ dim = dim + h;
+ this._elem.css({'height':dim+'px', left:'0px', bottom:'0px'});
+ }
+ else if (this.name === 'x2axis') {
+ dim = dim + h;
+ this._elem.css({'height':dim+'px', left:'0px', top:'0px'});
+ }
+ else if (this.name === 'yaxis') {
+ dim = dim + w;
+ this._elem.css({'width':dim+'px', left:'0px', top:'0px'});
+ if (lshow && this._label.constructor == $.jqplot.AxisLabelRenderer) {
+ this._label._elem.css('width', w+'px');
+ }
+ }
+ else if (this.name === 'yMidAxis') {
+ // don't include width of label at all in width of axis?
+ // dim = (dim > w) ? dim : w;
+ var temp = dim/2.0 - w/2.0;
+ this._elem.css({'width':dim+'px', top:'0px'});
+ if (lshow && this._label.constructor == $.jqplot.AxisLabelRenderer) {
+ this._label._elem.css({width: w, left: temp, top: 0});
+ }
+ }
+ else {
+ dim = dim + w;
+ this._elem.css({'width':dim+'px', right:'0px', top:'0px'});
+ if (lshow && this._label.constructor == $.jqplot.AxisLabelRenderer) {
+ this._label._elem.css('width', w+'px');
+ }
+ }
+ }
+ };
+
+ $.jqplot.PyramidAxisRenderer.prototype.pack = function(pos, offsets) {
+ // Add defaults for repacking from resetTickValues function.
+ pos = pos || {};
+ offsets = offsets || this._offsets;
+
+ var ticks = this._ticks;
+ var max = this.max;
+ var min = this.min;
+ var offmax = offsets.max;
+ var offmin = offsets.min;
+ var lshow = (this._label == null) ? false : this._label.show;
+
+ for (var p in pos) {
+ this._elem.css(p, pos[p]);
+ }
+
+ this._offsets = offsets;
+ // pixellength will be + for x axes and - for y axes becasue pixels always measured from top left.
+ var pixellength = offmax - offmin;
+ var unitlength = max - min;
+ var sl = this._splitLength;
+
+ // point to unit and unit to point conversions references to Plot DOM element top left corner.
+ if (this._splitAxis) {
+ pixellength -= this._splitLength;
+
+ // don't know that this one is correct.
+ this.p2u = function(p){
+ return (p - offmin) * unitlength / pixellength + min;
+ };
+
+ this.u2p = function(u){
+ if (u <= 0) {
+ return (u - min) * pixellength / unitlength + offmin;
+ }
+ else {
+ return (u - min) * pixellength / unitlength + offmin + sl;
+ }
+ };
+
+ this.series_u2p = function(u){
+ if (u <= 0) {
+ return (u - min) * pixellength / unitlength;
+ }
+ else {
+ return (u - min) * pixellength / unitlength + sl;
+ }
+ };
+
+ // don't know that this one is correct.
+ this.series_p2u = function(p){
+ return p * unitlength / pixellength + min;
+ };
+ }
+ else {
+ this.p2u = function(p){
+ return (p - offmin) * unitlength / pixellength + min;
+ };
+
+ this.u2p = function(u){
+ return (u - min) * pixellength / unitlength + offmin;
+ };
+
+ if (this.name.charAt(0) === 'x'){
+ this.series_u2p = function(u){
+ return (u - min) * pixellength / unitlength;
+ };
+ this.series_p2u = function(p){
+ return p * unitlength / pixellength + min;
+ };
+ }
+
+ else {
+ this.series_u2p = function(u){
+ return (u - max) * pixellength / unitlength;
+ };
+ this.series_p2u = function(p){
+ return p * unitlength / pixellength + max;
+ };
+ }
+ }
+
+ if (this.show) {
+ if (this.name.charAt(0) === 'x') {
+ for (var i=0; i<ticks.length; i++) {
+ var t = ticks[i];
+ if (t.show && t.showLabel) {
+ var shim;
+
+ if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) {
+ // will need to adjust auto positioning based on which axis this is.
+ var temp = (this.name == 'xaxis') ? 1 : -1;
+ switch (t.labelPosition) {
+ case 'auto':
+ // position at end
+ if (temp * t.angle < 0) {
+ shim = -t.getWidth() + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
+ }
+ // position at start
+ else {
+ shim = -t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
+ }
+ break;
+ case 'end':
+ shim = -t.getWidth() + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
+ break;
+ case 'start':
+ shim = -t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
+ break;
+ case 'middle':
+ shim = -t.getWidth()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
+ break;
+ default:
+ shim = -t.getWidth()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
+ break;
+ }
+ }
+ else {
+ shim = -t.getWidth()/2;
+ }
+ var val = this.u2p(t.value) + shim + 'px';
+ t._elem.css('left', val);
+ t.pack();
+ }
+ }
+ if (lshow) {
+ var w = this._label._elem.outerWidth(true);
+ this._label._elem.css('left', offmin + pixellength/2 - w/2 + 'px');
+ if (this.name == 'xaxis') {
+ this._label._elem.css('bottom', '0px');
+ }
+ else {
+ this._label._elem.css('top', '0px');
+ }
+ this._label.pack();
+ }
+ }
+ else {
+ for (var i=0; i<ticks.length; i++) {
+ var t = ticks[i];
+ if (t.show && t.showLabel && !t.isMinorTick) {
+ var shim;
+ if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) {
+ // will need to adjust auto positioning based on which axis this is.
+ var temp = (this.name == 'yaxis') ? 1 : -1;
+ switch (t.labelPosition) {
+ case 'auto':
+ // position at end
+ case 'end':
+ if (temp * t.angle < 0) {
+ shim = -t._textRenderer.height * Math.cos(-t._textRenderer.angle) / 2;
+ }
+ else {
+ shim = -t.getHeight() + t._textRenderer.height * Math.cos(t._textRenderer.angle) / 2;
+ }
+ break;
+ case 'start':
+ if (t.angle > 0) {
+ shim = -t._textRenderer.height * Math.cos(-t._textRenderer.angle) / 2;
+ }
+ else {
+ shim = -t.getHeight() + t._textRenderer.height * Math.cos(t._textRenderer.angle) / 2;
+ }
+ break;
+ case 'middle':
+ // if (t.angle > 0) {
+ // shim = -t.getHeight()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
+ // }
+ // else {
+ // shim = -t.getHeight()/2 - t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
+ // }
+ shim = -t.getHeight()/2;
+ break;
+ default:
+ shim = -t.getHeight()/2;
+ break;
+ }
+ }
+ else {
+ shim = -t.getHeight()/2;
+ }
+
+ var val = this.u2p(t.value) + shim + 'px';
+ t._elem.css('top', val);
+ t.pack();
+ }
+ }
+ if (lshow) {
+ var h = this._label._elem.outerHeight(true);
+ if (this.name !== 'yMidAxis') {
+ this._label._elem.css('top', offmax - pixellength/2 - h/2 + 'px');
+ }
+ if (this.name == 'yaxis') {
+ this._label._elem.css('left', '0px');
+ }
+ else if (this.name !== 'yMidAxis') {
+ this._label._elem.css('right', '0px');
+ }
+ this._label.pack();
+ }
+ }
+ }
+
+ ticks = null;
+ };
+})(jQuery);
\ No newline at end of file
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pyramidGridRenderer.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pyramidGridRenderer.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pyramidGridRenderer.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,452 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ */
+(function($) {
+ // Class: $.jqplot.CanvasGridRenderer
+ // The default jqPlot grid renderer, creating a grid on a canvas element.
+ // The renderer has no additional options beyond the <Grid> class.
+ $.jqplot.PyramidGridRenderer = function(){
+ $.jqplot.CanvasGridRenderer.call(this);
+ };
+
+ $.jqplot.PyramidGridRenderer.prototype = new $.jqplot.CanvasGridRenderer();
+ $.jqplot.PyramidGridRenderer.prototype.constructor = $.jqplot.PyramidGridRenderer;
+
+ // called with context of Grid object
+ $.jqplot.CanvasGridRenderer.prototype.init = function(options) {
+ this._ctx;
+ this.plotBands = {
+ show: false,
+ color: 'rgb(230, 219, 179)',
+ axis: 'y',
+ start: null,
+ interval: 10
+ };
+ $.extend(true, this, options);
+ // set the shadow renderer options
+ var sopts = {lineJoin:'miter', lineCap:'round', fill:false, isarc:false, angle:this.shadowAngle, offset:this.shadowOffset, alpha:this.shadowAlpha, depth:this.shadowDepth, lineWidth:this.shadowWidth, closePath:false, strokeStyle:this.shadowColor};
+ this.renderer.shadowRenderer.init(sopts);
+ };
+
+ $.jqplot.PyramidGridRenderer.prototype.draw = function() {
+ this._ctx = this._elem.get(0).getContext("2d");
+ var ctx = this._ctx;
+ var axes = this._axes;
+ var xp = axes.xaxis.u2p;
+ var yp = axes.yMidAxis.u2p;
+ var xnudge = axes.xaxis.max/1000.0;
+ var xp0 = xp(0);
+ var xpn = xp(xnudge);
+ var ax = ['xaxis', 'yaxis', 'x2axis', 'y2axis','yMidAxis'];
+ // Add the grid onto the grid canvas. This is the bottom most layer.
+ ctx.save();
+ ctx.clearRect(0, 0, this._plotDimensions.width, this._plotDimensions.height);
+ ctx.fillStyle = this.backgroundColor || this.background;
+
+ ctx.fillRect(this._left, this._top, this._width, this._height);
+
+ if (this.plotBands.show) {
+ ctx.save();
+ var pb = this.plotBands;
+ ctx.fillStyle = pb.color;
+ var axis;
+ var x, y, w, h;
+ // find axis to work with
+ if (pb.axis.charAt(0) === 'x') {
+ if (axes.xaxis.show) {
+ axis = axes.xaxis;
+ }
+ }
+ else if (pb.axis.charAt(0) === 'y') {
+ if (axes.yaxis.show) {
+ axis = axes.yaxis;
+ }
+ else if (axes.y2axis.show) {
+ axis = axes.y2axis;
+ }
+ else if (axes.yMidAxis.show) {
+ axis = axes.yMidAxis;
+ }
+ }
+
+ if (axis !== undefined) {
+ // draw some rectangles
+ var start = pb.start;
+ if (start === null) {
+ start = axis.min;
+ }
+ for (var i = start; i < axis.max; i += 2 * pb.interval) {
+ if (axis.name.charAt(0) === 'y') {
+ x = this._left;
+ if ((i + pb.interval) < axis.max) {
+ y = axis.series_u2p(i + pb.interval) + this._top;
+ }
+ else {
+ y = axis.series_u2p(axis.max) + this._top;
+ }
+ w = this._right - this._left;
+ h = axis.series_u2p(start) - axis.series_u2p(start + pb.interval);
+ ctx.fillRect(x, y, w, h);
+ }
+ // else {
+ // y = 0;
+ // x = axis.series_u2p(i);
+ // h = this._height;
+ // w = axis.series_u2p(start + pb.interval) - axis.series_u2p(start);
+ // }
+
+ }
+ }
+ ctx.restore();
+ }
+
+ ctx.save();
+ ctx.lineJoin = 'miter';
+ ctx.lineCap = 'butt';
+ ctx.lineWidth = this.gridLineWidth;
+ ctx.strokeStyle = this.gridLineColor;
+ var b, e, s, m;
+ for (var i=5; i>0; i--) {
+ var name = ax[i-1];
+ var axis = axes[name];
+ var ticks = axis._ticks;
+ var numticks = ticks.length;
+ if (axis.show) {
+ if (axis.drawBaseline) {
+ var bopts = {};
+ if (axis.baselineWidth !== null) {
+ bopts.lineWidth = axis.baselineWidth;
+ }
+ if (axis.baselineColor !== null) {
+ bopts.strokeStyle = axis.baselineColor;
+ }
+ switch (name) {
+ case 'xaxis':
+ if (axes.yMidAxis.show) {
+ drawLine (this._left, this._bottom, xp0, this._bottom, bopts);
+ drawLine (xpn, this._bottom, this._right, this._bottom, bopts);
+ }
+ else {
+ drawLine (this._left, this._bottom, this._right, this._bottom, bopts);
+ }
+ break;
+ case 'yaxis':
+ drawLine (this._left, this._bottom, this._left, this._top, bopts);
+ break;
+ case 'yMidAxis':
+ drawLine(xp0, this._bottom, xp0, this._top, bopts);
+ drawLine(xpn, this._bottom, xpn, this._top, bopts);
+ break;
+ case 'x2axis':
+ if (axes.yMidAxis.show) {
+ drawLine (this._left, this._top, xp0, this._top, bopts);
+ drawLine (xpn, this._top, this._right, this._top, bopts);
+ }
+ else {
+ drawLine (this._left, this._bottom, this._right, this._bottom, bopts);
+ }
+ break;
+ case 'y2axis':
+ drawLine (this._right, this._bottom, this._right, this._top, bopts);
+ break;
+
+ }
+ }
+ for (var j=numticks; j>0; j--) {
+ var t = ticks[j-1];
+ if (t.show) {
+ var pos = Math.round(axis.u2p(t.value)) + 0.5;
+ switch (name) {
+ case 'xaxis':
+ // draw the grid line if we should
+ if (t.showGridline && this.drawGridlines && (!t.isMinorTick || axis.showMinorTicks)) {
+ drawLine(pos, this._top, pos, this._bottom);
+ }
+
+ // draw the mark
+ if (t.showMark && t.mark && (!t.isMinorTick || axis.showMinorTicks)) {
+ s = t.markSize;
+ m = t.mark;
+ var pos = Math.round(axis.u2p(t.value)) + 0.5;
+ switch (m) {
+ case 'outside':
+ b = this._bottom;
+ e = this._bottom+s;
+ break;
+ case 'inside':
+ b = this._bottom-s;
+ e = this._bottom;
+ break;
+ case 'cross':
+ b = this._bottom-s;
+ e = this._bottom+s;
+ break;
+ default:
+ b = this._bottom;
+ e = this._bottom+s;
+ break;
+ }
+ // draw the shadow
+ if (this.shadow) {
+ this.renderer.shadowRenderer.draw(ctx, [[pos,b],[pos,e]], {lineCap:'butt', lineWidth:this.gridLineWidth, offset:this.gridLineWidth*0.75, depth:2, fill:false, closePath:false});
+ }
+ // draw the line
+ drawLine(pos, b, pos, e);
+ }
+ break;
+ case 'yaxis':
+ // draw the grid line
+ if (t.showGridline && this.drawGridlines && (!t.isMinorTick || axis.showMinorTicks)) {
+ drawLine(this._right, pos, this._left, pos);
+ }
+
+ // draw the mark
+ if (t.showMark && t.mark && (!t.isMinorTick || axis.showMinorTicks)) {
+ s = t.markSize;
+ m = t.mark;
+ var pos = Math.round(axis.u2p(t.value)) + 0.5;
+ switch (m) {
+ case 'outside':
+ b = this._left-s;
+ e = this._left;
+ break;
+ case 'inside':
+ b = this._left;
+ e = this._left+s;
+ break;
+ case 'cross':
+ b = this._left-s;
+ e = this._left+s;
+ break;
+ default:
+ b = this._left-s;
+ e = this._left;
+ break;
+ }
+ // draw the shadow
+ if (this.shadow) {
+ this.renderer.shadowRenderer.draw(ctx, [[b, pos], [e, pos]], {lineCap:'butt', lineWidth:this.gridLineWidth*1.5, offset:this.gridLineWidth*0.75, fill:false, closePath:false});
+ }
+ drawLine(b, pos, e, pos, {strokeStyle:axis.borderColor});
+ }
+ break;
+ case 'yMidAxis':
+ // draw the grid line
+ if (t.showGridline && this.drawGridlines && (!t.isMinorTick || axis.showMinorTicks)) {
+ drawLine(this._left, pos, xp0, pos);
+ drawLine(xpn, pos, this._right, pos);
+ }
+ // draw the mark
+ if (t.showMark && t.mark && (!t.isMinorTick || axis.showMinorTicks)) {
+ s = t.markSize;
+ m = t.mark;
+ var pos = Math.round(axis.u2p(t.value)) + 0.5;
+
+ b = xp0;
+ e = xp0 + s;
+ // draw the shadow
+ if (this.shadow) {
+ this.renderer.shadowRenderer.draw(ctx, [[b, pos], [e, pos]], {lineCap:'butt', lineWidth:this.gridLineWidth*1.5, offset:this.gridLineWidth*0.75, fill:false, closePath:false});
+ }
+ drawLine(b, pos, e, pos, {strokeStyle:axis.borderColor});
+
+ b = xpn - s;
+ e = xpn;
+ // draw the shadow
+ if (this.shadow) {
+ this.renderer.shadowRenderer.draw(ctx, [[b, pos], [e, pos]], {lineCap:'butt', lineWidth:this.gridLineWidth*1.5, offset:this.gridLineWidth*0.75, fill:false, closePath:false});
+ }
+ drawLine(b, pos, e, pos, {strokeStyle:axis.borderColor});
+ }
+ break;
+ case 'x2axis':
+ // draw the grid line
+ if (t.showGridline && this.drawGridlines && (!t.isMinorTick || axis.showMinorTicks)) {
+ drawLine(pos, this._bottom, pos, this._top);
+ }
+
+ // draw the mark
+ if (t.showMark && t.mark && (!t.isMinorTick || axis.showMinorTicks)) {
+ s = t.markSize;
+ m = t.mark;
+ var pos = Math.round(axis.u2p(t.value)) + 0.5;
+ switch (m) {
+ case 'outside':
+ b = this._top-s;
+ e = this._top;
+ break;
+ case 'inside':
+ b = this._top;
+ e = this._top+s;
+ break;
+ case 'cross':
+ b = this._top-s;
+ e = this._top+s;
+ break;
+ default:
+ b = this._top-s;
+ e = this._top;
+ break;
+ }
+ // draw the shadow
+ if (this.shadow) {
+ this.renderer.shadowRenderer.draw(ctx, [[pos,b],[pos,e]], {lineCap:'butt', lineWidth:this.gridLineWidth, offset:this.gridLineWidth*0.75, depth:2, fill:false, closePath:false});
+ }
+ drawLine(pos, b, pos, e);
+ }
+ break;
+ case 'y2axis':
+ // draw the grid line
+ if (t.showGridline && this.drawGridlines && (!t.isMinorTick || axis.showMinorTicks)) {
+ drawLine(this._left, pos, this._right, pos);
+ }
+
+ // draw the mark
+ if (t.showMark && t.mark && (!t.isMinorTick || axis.showMinorTicks)) {
+ s = t.markSize;
+ m = t.mark;
+ var pos = Math.round(axis.u2p(t.value)) + 0.5;
+ switch (m) {
+ case 'outside':
+ b = this._right;
+ e = this._right+s;
+ break;
+ case 'inside':
+ b = this._right-s;
+ e = this._right;
+ break;
+ case 'cross':
+ b = this._right-s;
+ e = this._right+s;
+ break;
+ default:
+ b = this._right;
+ e = this._right+s;
+ break;
+ }
+ // draw the shadow
+ if (this.shadow) {
+ this.renderer.shadowRenderer.draw(ctx, [[b, pos], [e, pos]], {lineCap:'butt', lineWidth:this.gridLineWidth*1.5, offset:this.gridLineWidth*0.75, fill:false, closePath:false});
+ }
+ drawLine(b, pos, e, pos, {strokeStyle:axis.borderColor});
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ t = null;
+ }
+ axis = null;
+ ticks = null;
+ }
+
+ ctx.restore();
+
+ function drawLine(bx, by, ex, ey, opts) {
+ ctx.save();
+ opts = opts || {};
+ if (opts.lineWidth == null || opts.lineWidth != 0){
+ $.extend(true, ctx, opts);
+ ctx.beginPath();
+ ctx.moveTo(bx, by);
+ ctx.lineTo(ex, ey);
+ ctx.stroke();
+ }
+ ctx.restore();
+ }
+
+ if (this.shadow) {
+ if (axes.yMidAxis.show) {
+ var points = [[this._left, this._bottom], [xp0, this._bottom]];
+ this.renderer.shadowRenderer.draw(ctx, points);
+ var points = [[xpn, this._bottom], [this._right, this._bottom], [this._right, this._top]];
+ this.renderer.shadowRenderer.draw(ctx, points);
+ var points = [[xp0, this._bottom], [xp0, this._top]];
+ this.renderer.shadowRenderer.draw(ctx, points);
+ }
+ else {
+ var points = [[this._left, this._bottom], [this._right, this._bottom], [this._right, this._top]];
+ this.renderer.shadowRenderer.draw(ctx, points);
+ }
+ }
+ // Now draw border around grid. Use axis border definitions. start at
+ // upper left and go clockwise.
+ if (this.borderWidth != 0 && this.drawBorder) {
+ if (axes.yMidAxis.show) {
+ drawLine (this._left, this._top, xp0, this._top, {lineCap:'round', strokeStyle:axes.x2axis.borderColor, lineWidth:axes.x2axis.borderWidth});
+ drawLine (xpn, this._top, this._right, this._top, {lineCap:'round', strokeStyle:axes.x2axis.borderColor, lineWidth:axes.x2axis.borderWidth});
+ drawLine (this._right, this._top, this._right, this._bottom, {lineCap:'round', strokeStyle:axes.y2axis.borderColor, lineWidth:axes.y2axis.borderWidth});
+ drawLine (this._right, this._bottom, xpn, this._bottom, {lineCap:'round', strokeStyle:axes.xaxis.borderColor, lineWidth:axes.xaxis.borderWidth});
+ drawLine (xp0, this._bottom, this._left, this._bottom, {lineCap:'round', strokeStyle:axes.xaxis.borderColor, lineWidth:axes.xaxis.borderWidth});
+ drawLine (this._left, this._bottom, this._left, this._top, {lineCap:'round', strokeStyle:axes.yaxis.borderColor, lineWidth:axes.yaxis.borderWidth});
+ drawLine (xp0, this._bottom, xp0, this._top, {lineCap:'round', strokeStyle:axes.yaxis.borderColor, lineWidth:axes.yaxis.borderWidth});
+ drawLine (xpn, this._bottom, xpn, this._top, {lineCap:'round', strokeStyle:axes.yaxis.borderColor, lineWidth:axes.yaxis.borderWidth});
+ }
+ else {
+ drawLine (this._left, this._top, this._right, this._top, {lineCap:'round', strokeStyle:axes.x2axis.borderColor, lineWidth:axes.x2axis.borderWidth});
+ drawLine (this._right, this._top, this._right, this._bottom, {lineCap:'round', strokeStyle:axes.y2axis.borderColor, lineWidth:axes.y2axis.borderWidth});
+ drawLine (this._right, this._bottom, this._left, this._bottom, {lineCap:'round', strokeStyle:axes.xaxis.borderColor, lineWidth:axes.xaxis.borderWidth});
+ drawLine (this._left, this._bottom, this._left, this._top, {lineCap:'round', strokeStyle:axes.yaxis.borderColor, lineWidth:axes.yaxis.borderWidth});
+ }
+ }
+ // ctx.lineWidth = this.borderWidth;
+ // ctx.strokeStyle = this.borderColor;
+ // ctx.strokeRect(this._left, this._top, this._width, this._height);
+
+ ctx.restore();
+ ctx = null;
+ axes = null;
+ };
+})(jQuery);
\ No newline at end of file
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pyramidRenderer.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pyramidRenderer.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.pyramidRenderer.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,537 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ */
+(function($) {
+
+ // Need to ensure pyramid axis and grid renderers are loaded.
+ // You should load these with script tags in the html head, that is more efficient
+ // as the browser will cache the request.
+ // Note, have to block with synchronous request in order to execute bar renderer code.
+ if ($.jqplot.PyramidAxisRenderer === undefined) {
+ $.ajax({
+ url: $.jqplot.pluginLocation + 'jqplot.pyramidAxisRenderer.js',
+ dataType: "script",
+ async: false
+ });
+ }
+
+ if ($.jqplot.PyramidGridRenderer === undefined) {
+ $.ajax({
+ url: $.jqplot.pluginLocation + 'jqplot.pyramidGridRenderer.js',
+ dataType: "script",
+ async: false
+ });
+ }
+
+ $.jqplot.PyramidRenderer = function(){
+ $.jqplot.LineRenderer.call(this);
+ };
+
+ $.jqplot.PyramidRenderer.prototype = new $.jqplot.LineRenderer();
+ $.jqplot.PyramidRenderer.prototype.constructor = $.jqplot.PyramidRenderer;
+
+ // called with scope of a series
+ $.jqplot.PyramidRenderer.prototype.init = function(options, plot) {
+ options = options || {};
+ this._type = 'pyramid';
+ // Group: Properties
+ //
+ // prop: barPadding
+ this.barPadding = 10;
+ this.barWidth = null;
+ // prop: fill
+ // True to fill the bars.
+ this.fill = true;
+ // prop: highlightMouseOver
+ // True to highlight slice when moused over.
+ // This must be false to enable highlightMouseDown to highlight when clicking on a slice.
+ this.highlightMouseOver = true;
+ // prop: highlightMouseDown
+ // True to highlight when a mouse button is pressed over a slice.
+ // This will be disabled if highlightMouseOver is true.
+ this.highlightMouseDown = false;
+ // prop: highlightColors
+ // an array of colors to use when highlighting a slice.
+ this.highlightColors = [];
+ // prop highlightThreshold
+ // Expand the highlightable region in the x direction.
+ // E.g. a value of 3 will highlight a bar when the mouse is
+ // within 3 pixels of the bar in the x direction.
+ this.highlightThreshold = 2;
+ // prop: synchronizeHighlight
+ // Index of another series to highlight when this series is highlighted.
+ // null or false to not synchronize.
+ this.synchronizeHighlight = false;
+ // prop: offsetBars
+ // False will center bars on their y value.
+ // True will push bars up by 1/2 bar width to fill between their y values.
+ // If true, there needs to be 1 more tick than there are bars.
+ this.offsetBars = false;
+
+ // if user has passed in highlightMouseDown option and not set highlightMouseOver, disable highlightMouseOver
+ if (options.highlightMouseDown && options.highlightMouseOver == null) {
+ options.highlightMouseOver = false;
+ }
+
+ this.side = 'right';
+
+ $.extend(true, this, options);
+
+ // if (this.fill === false) {
+ // this.shadow = false;
+ // }
+
+ if (this.side === 'left') {
+ this._highlightThreshold = [[-this.highlightThreshold, 0], [-this.highlightThreshold, 0], [0,0], [0,0]];
+ }
+
+ else {
+ this._highlightThreshold = [[0,0], [0,0], [this.highlightThreshold, 0], [this.highlightThreshold, 0]];
+ }
+
+ this.renderer.options = options;
+ // index of the currenty highlighted point, if any
+ this._highlightedPoint = null;
+ // Array of actual data colors used for each data point.
+ this._dataColors = [];
+ this._barPoints = [];
+ this.fillAxis = 'y';
+ this._primaryAxis = '_yaxis';
+ this._xnudge = 0;
+
+ // set the shape renderer options
+ var opts = {lineJoin:'miter', lineCap:'butt', fill:this.fill, fillRect:this.fill, isarc:false, strokeStyle:this.color, fillStyle:this.color, closePath:this.fill, lineWidth: this.lineWidth};
+ this.renderer.shapeRenderer.init(opts);
+ // set the shadow renderer options
+ var shadow_offset = options.shadowOffset;
+ // set the shadow renderer options
+ if (shadow_offset == null) {
+ // scale the shadowOffset to the width of the line.
+ if (this.lineWidth > 2.5) {
+ shadow_offset = 1.25 * (1 + (Math.atan((this.lineWidth/2.5))/0.785398163 - 1)*0.6);
+ // var shadow_offset = this.shadowOffset;
+ }
+ // for skinny lines, don't make such a big shadow.
+ else {
+ shadow_offset = 1.25 * Math.atan((this.lineWidth/2.5))/0.785398163;
+ }
+ }
+ var sopts = {lineJoin:'miter', lineCap:'butt', fill:this.fill, fillRect:this.fill, isarc:false, angle:this.shadowAngle, offset:shadow_offset, alpha:this.shadowAlpha, depth:this.shadowDepth, closePath:this.fill, lineWidth: this.lineWidth};
+ this.renderer.shadowRenderer.init(sopts);
+
+ plot.postDrawHooks.addOnce(postPlotDraw);
+ plot.eventListenerHooks.addOnce('jqplotMouseMove', handleMove);
+
+ // if this is the left side of pyramid, set y values to negative.
+ if (this.side === 'left') {
+ for (var i=0, l=this.data.length; i<l; i++) {
+ this.data[i][1] = -Math.abs(this.data[i][1]);
+ }
+ }
+ };
+
+ // setGridData
+ // converts the user data values to grid coordinates and stores them
+ // in the gridData array.
+ // Called with scope of a series.
+ $.jqplot.PyramidRenderer.prototype.setGridData = function(plot) {
+ // recalculate the grid data
+ var xp = this._xaxis.series_u2p;
+ var yp = this._yaxis.series_u2p;
+ var data = this._plotData;
+ var pdata = this._prevPlotData;
+ this.gridData = [];
+ this._prevGridData = [];
+ var l = data.length;
+ var adjust = false;
+ var i;
+
+ // if any data values are < 0, consider this a negative series
+ for (i = 0; i < l; i++) {
+ if (data[i][1] < 0) {
+ this.side = 'left';
+ }
+ }
+
+ if (this._yaxis.name === 'yMidAxis' && this.side === 'right') {
+ this._xnudge = this._xaxis.max/2000.0;
+ adjust = true;
+ }
+
+ for (i = 0; i < l; i++) {
+ // if not a line series or if no nulls in data, push the converted point onto the array.
+ if (data[i][0] != null && data[i][1] != null) {
+ this.gridData.push([xp(data[i][1]), yp(data[i][0])]);
+ }
+ // else if there is a null, preserve it.
+ else if (data[i][0] == null) {
+ this.gridData.push([xp(data[i][1]), null]);
+ }
+ else if (data[i][1] == null) {
+ this.gridData.push(null, [yp(data[i][0])]);
+ }
+ // finally, adjust x grid data if have to
+ if (data[i][1] === 0 && adjust) {
+ this.gridData[i][0] = xp(this._xnudge);
+ }
+ }
+ };
+
+ // makeGridData
+ // converts any arbitrary data values to grid coordinates and
+ // returns them. This method exists so that plugins can use a series'
+ // linerenderer to generate grid data points without overwriting the
+ // grid data associated with that series.
+ // Called with scope of a series.
+ $.jqplot.PyramidRenderer.prototype.makeGridData = function(data, plot) {
+ // recalculate the grid data
+ var xp = this._xaxis.series_u2p;
+ var yp = this._yaxis.series_u2p;
+ var gd = [];
+ var l = data.length;
+ var adjust = false;
+ var i;
+
+ // if any data values are < 0, consider this a negative series
+ for (i = 0; i < l; i++) {
+ if (data[i][1] < 0) {
+ this.side = 'left';
+ }
+ }
+
+ if (this._yaxis.name === 'yMidAxis' && this.side === 'right') {
+ this._xnudge = this._xaxis.max/2000.0;
+ adjust = true;
+ }
+
+ for (i = 0; i < l; i++) {
+ // if not a line series or if no nulls in data, push the converted point onto the array.
+ if (data[i][0] != null && data[i][1] != null) {
+ gd.push([xp(data[i][1]), yp(data[i][0])]);
+ }
+ // else if there is a null, preserve it.
+ else if (data[i][0] == null) {
+ gd.push([xp(data[i][1]), null]);
+ }
+ else if (data[i][1] == null) {
+ gd.push([null, yp(data[i][0])]);
+ }
+ // finally, adjust x grid data if have to
+ if (data[i][1] === 0 && adjust) {
+ gd[i][0] = xp(this._xnudge);
+ }
+ }
+
+ return gd;
+ };
+
+ $.jqplot.PyramidRenderer.prototype.setBarWidth = function() {
+ // need to know how many data values we have on the approprate axis and figure it out.
+ var i;
+ var nvals = 0;
+ var nseries = 0;
+ var paxis = this[this._primaryAxis];
+ var s, series, pos;
+ nvals = paxis.max - paxis.min;
+ var nticks = paxis.numberTicks;
+ var nbins = (nticks-1)/2;
+ // so, now we have total number of axis values.
+ var temp = (this.barPadding === 0) ? 1.0 : 0;
+ if (paxis.name == 'xaxis' || paxis.name == 'x2axis') {
+ this.barWidth = (paxis._offsets.max - paxis._offsets.min) / nvals - this.barPadding + temp;
+ }
+ else {
+ if (this.fill) {
+ this.barWidth = (paxis._offsets.min - paxis._offsets.max) / nvals - this.barPadding + temp;
+ }
+ else {
+ this.barWidth = (paxis._offsets.min - paxis._offsets.max) / nvals;
+ }
+ }
+ };
+
+ $.jqplot.PyramidRenderer.prototype.draw = function(ctx, gridData, options) {
+ var i;
+ // Ughhh, have to make a copy of options b/c it may be modified later.
+ var opts = $.extend({}, options);
+ var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
+ var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine;
+ var fill = (opts.fill != undefined) ? opts.fill : this.fill;
+ var xp = this._xaxis.series_u2p;
+ var yp = this._yaxis.series_u2p;
+ var pointx, pointy;
+ // clear out data colors.
+ this._dataColors = [];
+ this._barPoints = [];
+
+ if (this.renderer.options.barWidth == null) {
+ this.renderer.setBarWidth.call(this);
+ }
+
+ // var temp = this._plotSeriesInfo = this.renderer.calcSeriesNumbers.call(this);
+ // var nvals = temp[0];
+ // var nseries = temp[1];
+ // var pos = temp[2];
+ var points = [],
+ w,
+ h;
+
+ // this._barNudge = 0;
+
+ if (showLine) {
+ var negativeColors = new $.jqplot.ColorGenerator(this.negativeSeriesColors);
+ var positiveColors = new $.jqplot.ColorGenerator(this.seriesColors);
+ var negativeColor = negativeColors.get(this.index);
+ if (! this.useNegativeColors) {
+ negativeColor = opts.fillStyle;
+ }
+ var positiveColor = opts.fillStyle;
+ var base;
+ var xstart = this._xaxis.series_u2p(this._xnudge);
+ var ystart = this._yaxis.series_u2p(this._yaxis.min);
+ var yend = this._yaxis.series_u2p(this._yaxis.max);
+ var bw = this.barWidth;
+ var bw2 = bw/2.0;
+ var points = [];
+ var yadj = this.offsetBars ? bw2 : 0;
+
+ for (var i=0, l=gridData.length; i<l; i++) {
+ if (this.data[i][0] == null) {
+ continue;
+ }
+ base = gridData[i][1];
+ // not stacked and first series in stack
+
+ if (this._plotData[i][1] < 0) {
+ if (this.varyBarColor && !this._stack) {
+ if (this.useNegativeColors) {
+ opts.fillStyle = negativeColors.next();
+ }
+ else {
+ opts.fillStyle = positiveColors.next();
+ }
+ }
+ }
+ else {
+ if (this.varyBarColor && !this._stack) {
+ opts.fillStyle = positiveColors.next();
+ }
+ else {
+ opts.fillStyle = positiveColor;
+ }
+ }
+
+ if (this.fill) {
+
+ if (this._plotData[i][1] >= 0) {
+ // xstart = this._xaxis.series_u2p(this._xnudge);
+ w = gridData[i][0] - xstart;
+ h = this.barWidth;
+ points = [xstart, base - bw2 - yadj, w, h];
+ }
+ else {
+ // xstart = this._xaxis.series_u2p(0);
+ w = xstart - gridData[i][0];
+ h = this.barWidth;
+ points = [gridData[i][0], base - bw2 - yadj, w, h];
+ }
+
+ this._barPoints.push([[points[0], points[1] + h], [points[0], points[1]], [points[0] + w, points[1]], [points[0] + w, points[1] + h]]);
+
+ if (shadow) {
+ this.renderer.shadowRenderer.draw(ctx, points);
+ }
+ var clr = opts.fillStyle || this.color;
+ this._dataColors.push(clr);
+ this.renderer.shapeRenderer.draw(ctx, points, opts);
+ }
+
+ else {
+ if (i === 0) {
+ points =[[xstart, ystart], [gridData[i][0], ystart], [gridData[i][0], gridData[i][1] - bw2 - yadj]];
+ }
+
+ else if (i < l-1) {
+ points = points.concat([[gridData[i-1][0], gridData[i-1][1] - bw2 - yadj], [gridData[i][0], gridData[i][1] + bw2 - yadj], [gridData[i][0], gridData[i][1] - bw2 - yadj]]);
+ }
+
+ // finally, draw the line
+ else {
+ points = points.concat([[gridData[i-1][0], gridData[i-1][1] - bw2 - yadj], [gridData[i][0], gridData[i][1] + bw2 - yadj], [gridData[i][0], yend], [xstart, yend]]);
+
+ if (shadow) {
+ this.renderer.shadowRenderer.draw(ctx, points);
+ }
+ var clr = opts.fillStyle || this.color;
+ this._dataColors.push(clr);
+ this.renderer.shapeRenderer.draw(ctx, points, opts);
+ }
+ }
+ }
+ }
+
+ if (this.highlightColors.length == 0) {
+ this.highlightColors = $.jqplot.computeHighlightColors(this._dataColors);
+ }
+
+ else if (typeof(this.highlightColors) == 'string') {
+ this.highlightColors = [];
+ for (var i=0; i<this._dataColors.length; i++) {
+ this.highlightColors.push(this.highlightColors);
+ }
+ }
+
+ };
+
+
+ // setup default renderers for axes and legend so user doesn't have to
+ // called with scope of plot
+ function preInit(target, data, options) {
+ options = options || {};
+ options.axesDefaults = options.axesDefaults || {};
+ options.grid = options.grid || {};
+ options.legend = options.legend || {};
+ options.seriesDefaults = options.seriesDefaults || {};
+ // only set these if there is a pie series
+ var setopts = false;
+ if (options.seriesDefaults.renderer === $.jqplot.PyramidRenderer) {
+ setopts = true;
+ }
+ else if (options.series) {
+ for (var i=0; i < options.series.length; i++) {
+ if (options.series[i].renderer === $.jqplot.PyramidRenderer) {
+ setopts = true;
+ }
+ }
+ }
+
+ if (setopts) {
+ options.axesDefaults.renderer = $.jqplot.PyramidAxisRenderer;
+ options.grid.renderer = $.jqplot.PyramidGridRenderer;
+ options.seriesDefaults.pointLabels = {show: false};
+ }
+ }
+
+ // called within context of plot
+ // create a canvas which we can draw on.
+ // insert it before the eventCanvas, so eventCanvas will still capture events.
+ function postPlotDraw() {
+ // Memory Leaks patch
+ if (this.plugins.pyramidRenderer && this.plugins.pyramidRenderer.highlightCanvas) {
+
+ this.plugins.pyramidRenderer.highlightCanvas.resetCanvas();
+ this.plugins.pyramidRenderer.highlightCanvas = null;
+ }
+
+ this.plugins.pyramidRenderer = {highlightedSeriesIndex:null};
+ this.plugins.pyramidRenderer.highlightCanvas = new $.jqplot.GenericCanvas();
+
+ this.eventCanvas._elem.before(this.plugins.pyramidRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-pyramidRenderer-highlight-canvas', this._plotDimensions, this));
+ this.plugins.pyramidRenderer.highlightCanvas.setContext();
+ this.eventCanvas._elem.bind('mouseleave', {plot:this}, function (ev) { unhighlight(ev.data.plot); });
+ }
+
+ function highlight (plot, sidx, pidx, points) {
+ var s = plot.series[sidx];
+ var canvas = plot.plugins.pyramidRenderer.highlightCanvas;
+ canvas._ctx.clearRect(0,0,canvas._ctx.canvas.width, canvas._ctx.canvas.height);
+ s._highlightedPoint = pidx;
+ plot.plugins.pyramidRenderer.highlightedSeriesIndex = sidx;
+ var opts = {fillStyle: s.highlightColors[pidx], fillRect: false};
+ s.renderer.shapeRenderer.draw(canvas._ctx, points, opts);
+ if (s.synchronizeHighlight !== false && plot.series.length >= s.synchronizeHighlight && s.synchronizeHighlight !== sidx) {
+ s = plot.series[s.synchronizeHighlight];
+ opts = {fillStyle: s.highlightColors[pidx], fillRect: false};
+ s.renderer.shapeRenderer.draw(canvas._ctx, s._barPoints[pidx], opts);
+ }
+ canvas = null;
+ }
+
+ function unhighlight (plot) {
+ var canvas = plot.plugins.pyramidRenderer.highlightCanvas;
+ canvas._ctx.clearRect(0,0, canvas._ctx.canvas.width, canvas._ctx.canvas.height);
+ for (var i=0; i<plot.series.length; i++) {
+ plot.series[i]._highlightedPoint = null;
+ }
+ plot.plugins.pyramidRenderer.highlightedSeriesIndex = null;
+ plot.target.trigger('jqplotDataUnhighlight');
+ canvas = null;
+ }
+
+
+ function handleMove(ev, gridpos, datapos, neighbor, plot) {
+ if (neighbor) {
+ var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
+ var evt1 = jQuery.Event('jqplotDataMouseOver');
+ evt1.pageX = ev.pageX;
+ evt1.pageY = ev.pageY;
+ plot.target.trigger(evt1, ins);
+ if (plot.series[ins[0]].highlightMouseOver && !(ins[0] == plot.plugins.pyramidRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
+ var evt = jQuery.Event('jqplotDataHighlight');
+ evt.which = ev.which;
+ evt.pageX = ev.pageX;
+ evt.pageY = ev.pageY;
+ plot.target.trigger(evt, ins);
+ highlight (plot, neighbor.seriesIndex, neighbor.pointIndex, neighbor.points);
+ }
+ }
+ else if (neighbor == null) {
+ unhighlight (plot);
+ }
+ }
+
+ // Have to add hook here, becuase it needs called before series is inited.
+ $.jqplot.preInitHooks.push(preInit);
+
+
+})(jQuery);
\ No newline at end of file
Added: trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.trendline.js
===================================================================
--- trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.trendline.js (rev 0)
+++ trunk/nuiton-js-lib/src/main/resources/nuiton-js-jqplot/plugins/jqplot.trendline.js 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,246 @@
+/*
+ * #%L
+ * Nuiton JS :: Libraries
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.4
+ * Revision: 1121
+ *
+ * Copyright (c) 2009-2012 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
+ * choose the license that best suits your project and use it accordingly.
+ *
+ * Although not required, the author would appreciate an email letting him
+ * know of any substantial use of jqPlot. You can reach the author at:
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ * version 2007.04.27
+ * author Ash Searle
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
+ * http://hexmen.com/js/sprintf.js
+ * The author (Ash Searle) has placed this code in the public domain:
+ * "This code is unrestricted: you are free to use it however you like."
+ *
+ */
+(function($) {
+
+ /**
+ * Class: $.jqplot.Trendline
+ * Plugin which will automatically compute and draw trendlines for plotted data.
+ */
+ $.jqplot.Trendline = function() {
+ // Group: Properties
+
+ // prop: show
+ // Wether or not to show the trend line.
+ this.show = $.jqplot.config.enablePlugins;
+ // prop: color
+ // CSS color spec for the trend line.
+ // By default this wil be the same color as the primary line.
+ this.color = '#666666';
+ // prop: renderer
+ // Renderer to use to draw the trend line.
+ // The data series that is plotted may not be rendered as a line.
+ // Therefore, we use our own line renderer here to draw a trend line.
+ this.renderer = new $.jqplot.LineRenderer();
+ // prop: rendererOptions
+ // Options to pass to the line renderer.
+ // By default, markers are not shown on trend lines.
+ this.rendererOptions = {marker:{show:false}};
+ // prop: label
+ // Label for the trend line to use in the legend.
+ this.label = '';
+ // prop: type
+ // Either 'exponential', 'exp', or 'linear'.
+ this.type = 'linear';
+ // prop: shadow
+ // true or false, wether or not to show the shadow.
+ this.shadow = true;
+ // prop: markerRenderer
+ // Renderer to use to draw markers on the line.
+ // I think this is wrong.
+ this.markerRenderer = {show:false};
+ // prop: lineWidth
+ // Width of the trend line.
+ this.lineWidth = 1.5;
+ // prop: shadowAngle
+ // Angle of the shadow on the trend line.
+ this.shadowAngle = 45;
+ // prop: shadowOffset
+ // pixel offset for each stroke of the shadow.
+ this.shadowOffset = 1.0;
+ // prop: shadowAlpha
+ // Alpha transparency of the shadow.
+ this.shadowAlpha = 0.07;
+ // prop: shadowDepth
+ // number of strokes to make of the shadow.
+ this.shadowDepth = 3;
+ this.isTrendline = true;
+
+ };
+
+ $.jqplot.postSeriesInitHooks.push(parseTrendLineOptions);
+ $.jqplot.postDrawSeriesHooks.push(drawTrendline);
+ $.jqplot.addLegendRowHooks.push(addTrendlineLegend);
+
+ // called witin scope of the legend object
+ // current series passed in
+ // must return null or an object {label:label, color:color}
+ function addTrendlineLegend(series) {
+ var ret = null;
+ if (series.trendline && series.trendline.show) {
+ var lt = series.trendline.label.toString();
+ if (lt) {
+ ret = {label:lt, color:series.trendline.color};
+ }
+ }
+ return ret;
+ }
+
+ // called within scope of a series
+ function parseTrendLineOptions (target, data, seriesDefaults, options, plot) {
+ if (this._type && (this._type === 'line' || this._type == 'bar')) {
+ this.trendline = new $.jqplot.Trendline();
+ options = options || {};
+ $.extend(true, this.trendline, {color:this.color}, seriesDefaults.trendline, options.trendline);
+ this.trendline.renderer.init.call(this.trendline, null);
+ }
+ }
+
+ // called within scope of series object
+ function drawTrendline(sctx, options) {
+ // if we have options, merge trendline options in with precedence
+ options = $.extend(true, {}, this.trendline, options);
+
+ if (this.trendline && options.show) {
+ var fit;
+ // this.renderer.setGridData.call(this);
+ var data = options.data || this.data;
+ fit = fitData(data, this.trendline.type);
+ var gridData = options.gridData || this.renderer.makeGridData.call(this, fit.data);
+ this.trendline.renderer.draw.call(this.trendline, sctx, gridData, {showLine:true, shadow:this.trendline.shadow});
+ }
+ }
+
+ function regression(x, y, typ) {
+ var type = (typ == null) ? 'linear' : typ;
+ var N = x.length;
+ var slope;
+ var intercept;
+ var SX = 0;
+ var SY = 0;
+ var SXX = 0;
+ var SXY = 0;
+ var SYY = 0;
+ var Y = [];
+ var X = [];
+
+ if (type == 'linear') {
+ X = x;
+ Y = y;
+ }
+ else if (type == 'exp' || type == 'exponential') {
+ for ( var i=0; i<y.length; i++) {
+ // ignore points <= 0, log undefined.
+ if (y[i] <= 0) {
+ N--;
+ }
+ else {
+ X.push(x[i]);
+ Y.push(Math.log(y[i]));
+ }
+ }
+ }
+
+ for ( var i = 0; i < N; i++) {
+ SX = SX + X[i];
+ SY = SY + Y[i];
+ SXY = SXY + X[i]* Y[i];
+ SXX = SXX + X[i]* X[i];
+ SYY = SYY + Y[i]* Y[i];
+ }
+
+ slope = (N*SXY - SX*SY)/(N*SXX - SX*SX);
+ intercept = (SY - slope*SX)/N;
+
+ return [slope, intercept];
+ }
+
+ function linearRegression(X,Y) {
+ var ret;
+ ret = regression(X,Y,'linear');
+ return [ret[0],ret[1]];
+ }
+
+ function expRegression(X,Y) {
+ var ret;
+ var x = X;
+ var y = Y;
+ ret = regression(x, y,'exp');
+ var base = Math.exp(ret[0]);
+ var coeff = Math.exp(ret[1]);
+ return [base, coeff];
+ }
+
+ function fitData(data, typ) {
+ var type = (typ == null) ? 'linear' : typ;
+ var ret;
+ var res;
+ var x = [];
+ var y = [];
+ var ypred = [];
+
+ for (i=0; i<data.length; i++){
+ if (data[i] != null && data[i][0] != null && data[i][1] != null) {
+ x.push(data[i][0]);
+ y.push(data[i][1]);
+ }
+ }
+
+ if (type == 'linear') {
+ ret = linearRegression(x,y);
+ for ( var i=0; i<x.length; i++){
+ res = ret[0]*x[i] + ret[1];
+ ypred.push([x[i], res]);
+ }
+ }
+ else if (type == 'exp' || type == 'exponential') {
+ ret = expRegression(x,y);
+ for ( var i=0; i<x.length; i++){
+ res = ret[1]*Math.pow(ret[0],x[i]);
+ ypred.push([x[i], res]);
+ }
+ }
+ return {data: ypred, slope: ret[0], intercept: ret[1]};
+ }
+
+})(jQuery);
\ No newline at end of file
Added: trunk/nuiton-js-lib/src/site/rst/index.rst
===================================================================
--- trunk/nuiton-js-lib/src/site/rst/index.rst (rev 0)
+++ trunk/nuiton-js-lib/src/site/rst/index.rst 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,80 @@
+.. -
+.. * #%L
+.. * Nuiton JS :: Libraries
+.. * $Id:$
+.. * $HeadURL:$
+.. * %%
+.. * Copyright (C) 2012 - 2013 CodeLutin
+.. * %%
+.. * This program is free software: you can redistribute it and/or modify
+.. * it under the terms of the GNU Lesser General Public License as
+.. * published by the Free Software Foundation, either version 3 of the
+.. * License, or (at your option) any later version.
+.. *
+.. * This program is distributed in the hope that it will be useful,
+.. * but WITHOUT ANY WARRANTY; without even the implied warranty of
+.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+.. * GNU General Lesser Public License for more details.
+.. *
+.. * You should have received a copy of the GNU General Lesser Public
+.. * License along with this program. If not, see
+.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+.. * #L%
+.. -
+Utilisation
+===========
+
+::
+
+ <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+
+ <link rel="stylesheet" type="text/css" href="<c:url value="/nuiton-js/jqplot.css"/>" />
+ <!--[if lt IE 9]><script language="javascript" type="text/javascript" src="<c:url value="/nuiton-js/jqplot-excanvas.js"/>"></script><![endif]-->
+ <script language="javascript" type="text/javascript" src="<c:url value="/nuiton-js/jqplot.js"/>"></script>
+ <script language="javascript" type="text/javascript" src="<c:url value="/nuiton-js/jqplot-all-plugins.js"/>"></script>
+
+JS disponible
+-------------
+
+- jqplot-only : jplot
+- jqplot.js : jquery et jplot
+- jqplot-excanvas.js : excanvas pour le support IE
+- jqplot-all-plugins.js : tous les plugins
+
+Ou pour importer un plugin particulier au lieu de tous les plugins:
+
+- jqplot.BezierCurveRenderer.js
+- jqplot.barRenderer.js
+- jqplot.blockRenderer.js
+- jqplot.bubbleRenderer.js
+- jqplot.canvasAxisLabelRenderer.js
+- jqplot.canvasAxisTickRenderer.js
+- jqplot.canvasOverlay.js
+- jqplot.canvasTextRenderer.js
+- jqplot.categoryAxisRenderer.js
+- jqplot.ciParser.js
+- jqplot.cursor.js
+- jqplot.dateAxisRenderer.js
+- jqplot.donutRenderer.js
+- jqplot.dragable.js
+- jqplot.enhancedLegendRenderer.js
+- jqplot.funnelRenderer.js
+- jqplot.highlighter.js
+- jqplot.json2.js
+- jqplot.logAxisRenderer.js
+- jqplot.mekkoAxisRenderer.js
+- jqplot.mekkoRenderer.js
+- jqplot.meterGaugeRenderer.js
+- jqplot.mobile.js
+- jqplot.ohlcRenderer.js
+- jqplot.pieRenderer.js
+- jqplot.pointLabels.js
+- jqplot.pyramidAxisRenderer.js
+- jqplot.pyramidGridRenderer.js
+- jqplot.pyramidRenderer.js
+- jqplot.trendline.js
+
+CSS disponible
+--------------
+
+- jqplot.css
Added: trunk/nuiton-js-lib/src/site/site_fr.xml
===================================================================
--- trunk/nuiton-js-lib/src/site/site_fr.xml (rev 0)
+++ trunk/nuiton-js-lib/src/site/site_fr.xml 2013-03-13 10:34:53 UTC (rev 32)
@@ -0,0 +1,72 @@
+<!--
+ #%L
+ Nuiton JS :: Libraries
+ $Id:$
+ $HeadURL:$
+ %%
+ Copyright (C) 2012 - 2013 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
+<project name="${project.name}">
+
+ <bannerLeft>
+ <src alt="NuitonJS">logo.jpg</src>
+ <name>${project.name}</name>
+ <href>index.html</href>
+ </bannerLeft>
+
+ <body>
+
+ <head>
+ <script type="text/javascript"
+ src="http://maven-site.nuiton.org/public/js/mavenpom-site.js">
+ </script>
+
+ <link rel="stylesheet" type="text/css"
+ href="http://maven-site.nuiton.org/public/css/mavenpom-site.css"/>
+ </head>
+
+ <breadcrumbs>
+ <item name="${project.name}" href="${project.url}"/>
+ </breadcrumbs>
+
+ <menu ref="parent"/>
+
+ <menu name="Utilisateurs">
+ <item name="Accueil" href="index.html"/>
+ </menu>
+
+ <menu ref="reports"/>
+
+ <footer>
+
+ <div id='projectMetas'
+ projectversion='${project.version}'
+ platform='${project.platform}'
+ projectid='${project.projectId}'
+ scm='${project.scm.connection}'
+ scmwebeditorenabled='${project.scmwebeditorEnabled}'
+ scmwebeditorurl='${project.scmwebeditorUrl}'
+ siteSourcesType='${project.siteSourcesType}'
+ piwikEnabled='${project.piwikEnabled}'
+ piwikId='${project.piwikId}'>
+ </div>
+ </footer>
+
+ </body>
+
+</project>
Modified: trunk/nuiton-js-wro/pom.xml
===================================================================
--- trunk/nuiton-js-wro/pom.xml 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-wro/pom.xml 2013-03-13 10:34:53 UTC (rev 32)
@@ -9,7 +9,7 @@
<parent>
<groupId>org.nuiton.js</groupId>
- <artifactId>nuiton-js-parent</artifactId>
+ <artifactId>nuiton-js</artifactId>
<version>0.1-SNAPSHOT</version>
</parent>
Modified: trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/ForceCssDataUriPreProcessor.java
===================================================================
--- trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/ForceCssDataUriPreProcessor.java 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/ForceCssDataUriPreProcessor.java 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,5 +1,29 @@
package org.nuiton.js.wro;
+/*
+ * #%L
+ * Nuiton JS :: WRO
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
import ro.isdc.wro.model.resource.processor.impl.css.CssDataUriPreProcessor;
/**
Modified: trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/ImportWildcardXmlModelFactory.java
===================================================================
--- trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/ImportWildcardXmlModelFactory.java 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/ImportWildcardXmlModelFactory.java 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,5 +1,29 @@
package org.nuiton.js.wro;
+/*
+ * #%L
+ * Nuiton JS :: WRO
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
import java.io.File;
import java.io.IOException;
import java.net.URL;
@@ -10,6 +34,7 @@
import java.util.List;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
+
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.filefilter.TrueFileFilter;
@@ -21,6 +46,7 @@
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
+
import ro.isdc.wro.model.group.RecursiveGroupDefinitionException;
import ro.isdc.wro.model.resource.locator.ClasspathUriLocator;
import ro.isdc.wro.model.resource.locator.UriLocator;
Modified: trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsFilter.java
===================================================================
--- trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsFilter.java 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsFilter.java 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,5 +1,29 @@
package org.nuiton.js.wro;
+/*
+ * #%L
+ * Nuiton JS :: WRO
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
import javax.servlet.FilterConfig;
import ro.isdc.wro.config.jmx.WroConfiguration;
import ro.isdc.wro.http.WroFilter;
Modified: trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsMavenWroManagerFactory.java
===================================================================
--- trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsMavenWroManagerFactory.java 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsMavenWroManagerFactory.java 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,5 +1,29 @@
package org.nuiton.js.wro;
+/*
+ * #%L
+ * Nuiton JS :: WRO
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
Modified: trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsWroConfigurationFactory.java
===================================================================
--- trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsWroConfigurationFactory.java 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsWroConfigurationFactory.java 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,5 +1,29 @@
package org.nuiton.js.wro;
+/*
+ * #%L
+ * Nuiton JS :: WRO
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
Modified: trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsWroManagerFactory.java
===================================================================
--- trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsWroManagerFactory.java 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsWroManagerFactory.java 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,5 +1,29 @@
package org.nuiton.js.wro;
+/*
+ * #%L
+ * Nuiton JS :: WRO
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
import java.util.Map;
import java.util.Properties;
import ro.isdc.wro.manager.factory.ConfigurableWroManagerFactory;
Modified: trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsXmlModelFactory.java
===================================================================
--- trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsXmlModelFactory.java 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsXmlModelFactory.java 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,5 +1,29 @@
package org.nuiton.js.wro;
+/*
+ * #%L
+ * Nuiton JS :: WRO
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
import java.util.List;
import org.apache.commons.lang3.Validate;
import org.slf4j.Logger;
Modified: trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/ProtectedXmlModelFactory.java
===================================================================
--- trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/ProtectedXmlModelFactory.java 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/ProtectedXmlModelFactory.java 2013-03-13 10:34:53 UTC (rev 32)
@@ -6,7 +6,31 @@
package org.nuiton.js.wro;
+/*
+ * #%L
+ * Nuiton JS :: WRO
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
/*
* Copyright (c) 2008. All rights reserved.
*/
Modified: trunk/nuiton-js-wro/src/main/resources/META-INF/web-fragment.xml
===================================================================
--- trunk/nuiton-js-wro/src/main/resources/META-INF/web-fragment.xml 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/nuiton-js-wro/src/main/resources/META-INF/web-fragment.xml 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,3 +1,26 @@
+<!--
+ #%L
+ Nuiton JS :: WRO
+ $Id:$
+ $HeadURL:$
+ %%
+ Copyright (C) 2012 - 2013 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
<web-fragment version="3.0" metadata-complete="true"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/pom.xml 2013-03-13 10:34:53 UTC (rev 32)
@@ -14,18 +14,12 @@
</parent>
<groupId>org.nuiton.js</groupId>
- <artifactId>nuiton-js-parent</artifactId>
+ <artifactId>nuiton-js</artifactId>
<version>0.1-SNAPSHOT</version>
<modules>
<module>nuiton-js-wro</module>
- <module>nuiton-js-jquery</module>
- <module>nuiton-js-jquery-ui</module>
- <module>nuiton-js-jqplot</module>
- <module>nuiton-js-bootstrap</module>
- <module>nuiton-js-font-awesome</module>
- <module>nuiton-js-jstree</module>
- <module>nuiton-js-jqgrid</module>
+ <module>nuiton-js-lib</module>
</modules>
<dependencyManagement>
@@ -55,6 +49,7 @@
<groupId>ro.isdc.wro4j</groupId>
<artifactId>wro4j-maven-plugin</artifactId>
<version>${wroVersion}</version>
+ <scope>provided</scope>
</dependency>
<dependency>
@@ -227,6 +222,25 @@
</profile>
+ <profile>
+ <id>extraModules</id>
+ <activation>
+ <property>
+ <name>performRelease</name>
+ <value>true</value>
+ </property>
+ </activation>
+
+ <modules>
+ <module>nuiton-js-jquery</module>
+ <module>nuiton-js-jquery-ui</module>
+ <module>nuiton-js-jqplot</module>
+ <module>nuiton-js-bootstrap</module>
+ <module>nuiton-js-font-awesome</module>
+ <module>nuiton-js-jstree</module>
+ <module>nuiton-js-jqgrid</module>
+ </modules>
+ </profile>
</profiles>
</project>
Modified: trunk/src/site/rst/index.rst
===================================================================
--- trunk/src/site/rst/index.rst 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/src/site/rst/index.rst 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,3 +1,26 @@
+.. -
+.. * #%L
+.. * Nuiton JS
+.. * $Id:$
+.. * $HeadURL:$
+.. * %%
+.. * Copyright (C) 2012 - 2013 CodeLutin
+.. * %%
+.. * This program is free software: you can redistribute it and/or modify
+.. * it under the terms of the GNU Lesser General Public License as
+.. * published by the Free Software Foundation, either version 3 of the
+.. * License, or (at your option) any later version.
+.. *
+.. * This program is distributed in the hope that it will be useful,
+.. * but WITHOUT ANY WARRANTY; without even the implied warranty of
+.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+.. * GNU General Lesser Public License for more details.
+.. *
+.. * You should have received a copy of the GNU General Lesser Public
+.. * License along with this program. If not, see
+.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+.. * #L%
+.. -
Utilisation
===========
Modified: trunk/src/site/site_fr.xml
===================================================================
--- trunk/src/site/site_fr.xml 2013-03-12 09:43:11 UTC (rev 31)
+++ trunk/src/site/site_fr.xml 2013-03-13 10:34:53 UTC (rev 32)
@@ -1,3 +1,26 @@
+<!--
+ #%L
+ Nuiton JS
+ $Id:$
+ $HeadURL:$
+ %%
+ Copyright (C) 2012 - 2013 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
<project name="${project.name}">
<skin>
1
0
Author: echatellier
Date: 2013-03-12 10:43:11 +0100 (Tue, 12 Mar 2013)
New Revision: 31
Url: http://nuiton.org/projects/nuiton-js/repository/revisions/31
Log:
Update wro4j
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-02-18 16:05:50 UTC (rev 30)
+++ trunk/pom.xml 2013-03-12 09:43:11 UTC (rev 31)
@@ -118,7 +118,7 @@
<properties>
- <wroVersion>1.6.2</wroVersion>
+ <wroVersion>1.6.3</wroVersion>
<slf4jVersion>1.7.2</slf4jVersion>
<servletApiVersion>2.5</servletApiVersion>
1
0
r30 - in trunk/nuiton-js-jstree: . src/main/resources/nuiton-js-jstree/js src/main/resources/nuiton-js-jstree/themes src/main/resources/nuiton-js-jstree/themes/default
by echatellier@users.nuiton.org Feb. 18, 2013
by echatellier@users.nuiton.org Feb. 18, 2013
Feb. 18, 2013
Author: echatellier
Date: 2013-02-18 17:05:50 +0100 (Mon, 18 Feb 2013)
New Revision: 30
Url: http://nuiton.org/projects/nuiton-js/repository/revisions/30
Log:
Update jstree to tagged version
Added:
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/js/jstree.js
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default/dots_rtl.gif
Removed:
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/js/jquery.jstree.js
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/apple/
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/classic/
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default-rtl/
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default/d.gif
Modified:
trunk/nuiton-js-jstree/pom.xml
trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default/style.css
Modified: trunk/nuiton-js-jstree/pom.xml
===================================================================
(Binary files differ)
Deleted: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/js/jquery.jstree.js
===================================================================
--- trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/js/jquery.jstree.js 2013-01-26 15:51:02 UTC (rev 29)
+++ trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/js/jquery.jstree.js 2013-02-18 16:05:50 UTC (rev 30)
@@ -1,4561 +0,0 @@
-/*
- * jsTree 1.0-rc3
- * http://jstree.com/
- *
- * Copyright (c) 2010 Ivan Bozhanov (vakata.com)
- *
- * Licensed same as jquery - under the terms of either the MIT License or the GPL Version 2 License
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.gnu.org/licenses/gpl.html
- *
- * $Date: 2011-02-09 01:17:14 +0200 (ср, 09 февр 2011) $
- * $Revision: 236 $
- */
-
-/*jslint browser: true, onevar: true, undef: true, bitwise: true, strict: true */
-/*global window : false, clearInterval: false, clearTimeout: false, document: false, setInterval: false, setTimeout: false, jQuery: false, navigator: false, XSLTProcessor: false, DOMParser: false, XMLSerializer: false, ActiveXObject: false */
-
-"use strict";
-
-// top wrapper to prevent multiple inclusion (is this OK?)
-(function () { if(jQuery && jQuery.jstree) { return; }
- var is_ie6 = false, is_ie7 = false, is_ff2 = false;
-
-/*
- * jsTree core
- */
-(function ($) {
- // Common functions not related to jsTree
- // decided to move them to a `vakata` "namespace"
- $.vakata = {};
- // CSS related functions
- $.vakata.css = {
- get_css : function(rule_name, delete_flag, sheet) {
- rule_name = rule_name.toLowerCase();
- var css_rules = sheet.cssRules || sheet.rules,
- j = 0;
- do {
- if(css_rules.length && j > css_rules.length + 5) { return false; }
- if(css_rules[j].selectorText && css_rules[j].selectorText.toLowerCase() == rule_name) {
- if(delete_flag === true) {
- if(sheet.removeRule) { sheet.removeRule(j); }
- if(sheet.deleteRule) { sheet.deleteRule(j); }
- return true;
- }
- else { return css_rules[j]; }
- }
- }
- while (css_rules[++j]);
- return false;
- },
- add_css : function(rule_name, sheet) {
- if($.jstree.css.get_css(rule_name, false, sheet)) { return false; }
- if(sheet.insertRule) { sheet.insertRule(rule_name + ' { }', 0); } else { sheet.addRule(rule_name, null, 0); }
- return $.vakata.css.get_css(rule_name);
- },
- remove_css : function(rule_name, sheet) {
- return $.vakata.css.get_css(rule_name, true, sheet);
- },
- add_sheet : function(opts) {
- var tmp = false, is_new = true;
- if(opts.str) {
- if(opts.title) { tmp = $("style[id='" + opts.title + "-stylesheet']")[0]; }
- if(tmp) { is_new = false; }
- else {
- tmp = document.createElement("style");
- tmp.setAttribute('type',"text/css");
- if(opts.title) { tmp.setAttribute("id", opts.title + "-stylesheet"); }
- }
- if(tmp.styleSheet) {
- if(is_new) {
- document.getElementsByTagName("head")[0].appendChild(tmp);
- tmp.styleSheet.cssText = opts.str;
- }
- else {
- tmp.styleSheet.cssText = tmp.styleSheet.cssText + " " + opts.str;
- }
- }
- else {
- tmp.appendChild(document.createTextNode(opts.str));
- document.getElementsByTagName("head")[0].appendChild(tmp);
- }
- return tmp.sheet || tmp.styleSheet;
- }
- if(opts.url) {
- if(document.createStyleSheet) {
- try { tmp = document.createStyleSheet(opts.url); } catch (e) { }
- }
- else {
- tmp = document.createElement('link');
- tmp.rel = 'stylesheet';
- tmp.type = 'text/css';
- tmp.media = "all";
- tmp.href = opts.url;
- document.getElementsByTagName("head")[0].appendChild(tmp);
- return tmp.styleSheet;
- }
- }
- }
- };
-
- // private variables
- var instances = [], // instance array (used by $.jstree.reference/create/focused)
- focused_instance = -1, // the index in the instance array of the currently focused instance
- plugins = {}, // list of included plugins
- prepared_move = {}; // for the move_node function
-
- // jQuery plugin wrapper (thanks to jquery UI widget function)
- $.fn.jstree = function (settings) {
- var isMethodCall = (typeof settings == 'string'), // is this a method call like $().jstree("open_node")
- args = Array.prototype.slice.call(arguments, 1),
- returnValue = this;
-
- // if a method call execute the method on all selected instances
- if(isMethodCall) {
- if(settings.substring(0, 1) == '_') { return returnValue; }
- this.each(function() {
- var instance = instances[$.data(this, "jstree_instance_id")],
- methodValue = (instance && $.isFunction(instance[settings])) ? instance[settings].apply(instance, args) : instance;
- if(typeof methodValue !== "undefined" && (settings.indexOf("is_") === 0 || (methodValue !== true && methodValue !== false))) { returnValue = methodValue; return false; }
- });
- }
- else {
- this.each(function() {
- // extend settings and allow for multiple hashes and $.data
- var instance_id = $.data(this, "jstree_instance_id"),
- a = [],
- b = settings ? $.extend({}, true, settings) : {},
- c = $(this),
- s = false,
- t = [];
- a = a.concat(args);
- if(c.data("jstree")) { a.push(c.data("jstree")); }
- b = a.length ? $.extend.apply(null, [true, b].concat(a)) : b;
-
- // if an instance already exists, destroy it first
- if(typeof instance_id !== "undefined" && instances[instance_id]) { instances[instance_id].destroy(); }
- // push a new empty object to the instances array
- instance_id = parseInt(instances.push({}),10) - 1;
- // store the jstree instance id to the container element
- $.data(this, "jstree_instance_id", instance_id);
- // clean up all plugins
- b.plugins = $.isArray(b.plugins) ? b.plugins : $.jstree.defaults.plugins.slice();
- b.plugins.unshift("core");
- // only unique plugins
- b.plugins = b.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");
-
- // extend defaults with passed data
- s = $.extend(true, {}, $.jstree.defaults, b);
- s.plugins = b.plugins;
- $.each(plugins, function (i, val) {
- if($.inArray(i, s.plugins) === -1) { s[i] = null; delete s[i]; }
- else { t.push(i); }
- });
- s.plugins = t;
-
- // push the new object to the instances array (at the same time set the default classes to the container) and init
- instances[instance_id] = new $.jstree._instance(instance_id, $(this).addClass("jstree jstree-" + instance_id), s);
- // init all activated plugins for this instance
- $.each(instances[instance_id]._get_settings().plugins, function (i, val) { instances[instance_id].data[val] = {}; });
- $.each(instances[instance_id]._get_settings().plugins, function (i, val) { if(plugins[val]) { plugins[val].__init.apply(instances[instance_id]); } });
- // initialize the instance
- setTimeout(function() { if(instances[instance_id]) { instances[instance_id].init(); } }, 0);
- });
- }
- // return the jquery selection (or if it was a method call that returned a value - the returned value)
- return returnValue;
- };
- // object to store exposed functions and objects
- $.jstree = {
- defaults : {
- plugins : []
- },
- _focused : function () { return instances[focused_instance] || null; },
- _reference : function (needle) {
- // get by instance id
- if(instances[needle]) { return instances[needle]; }
- // get by DOM (if still no luck - return null
- var o = $(needle);
- if(!o.length && typeof needle === "string") { o = $("#" + needle); }
- if(!o.length) { return null; }
- return instances[o.closest(".jstree").data("jstree_instance_id")] || null;
- },
- _instance : function (index, container, settings) {
- // for plugins to store data in
- this.data = { core : {} };
- this.get_settings = function () { return $.extend(true, {}, settings); };
- this._get_settings = function () { return settings; };
- this.get_index = function () { return index; };
- this.get_container = function () { return container; };
- this.get_container_ul = function () { return container.children("ul:eq(0)"); };
- this._set_settings = function (s) {
- settings = $.extend(true, {}, settings, s);
- };
- },
- _fn : { },
- plugin : function (pname, pdata) {
- pdata = $.extend({}, {
- __init : $.noop,
- __destroy : $.noop,
- _fn : {},
- defaults : false
- }, pdata);
- plugins[pname] = pdata;
-
- $.jstree.defaults[pname] = pdata.defaults;
- $.each(pdata._fn, function (i, val) {
- val.plugin = pname;
- val.old = $.jstree._fn[i];
- $.jstree._fn[i] = function () {
- var rslt,
- func = val,
- args = Array.prototype.slice.call(arguments),
- evnt = new $.Event("before.jstree"),
- rlbk = false;
-
- if(this.data.core.locked === true && i !== "unlock" && i !== "is_locked") { return; }
-
- // Check if function belongs to the included plugins of this instance
- do {
- if(func && func.plugin && $.inArray(func.plugin, this._get_settings().plugins) !== -1) { break; }
- func = func.old;
- } while(func);
- if(!func) { return; }
-
- // context and function to trigger events, then finally call the function
- if(i.indexOf("_") === 0) {
- rslt = func.apply(this, args);
- }
- else {
- rslt = this.get_container().triggerHandler(evnt, { "func" : i, "inst" : this, "args" : args, "plugin" : func.plugin });
- if(rslt === false) { return; }
- if(typeof rslt !== "undefined") { args = rslt; }
-
- rslt = func.apply(
- $.extend({}, this, {
- __callback : function (data) {
- this.get_container().triggerHandler( i + '.jstree', { "inst" : this, "args" : args, "rslt" : data, "rlbk" : rlbk });
- },
- __rollback : function () {
- rlbk = this.get_rollback();
- return rlbk;
- },
- __call_old : function (replace_arguments) {
- return func.old.apply(this, (replace_arguments ? Array.prototype.slice.call(arguments, 1) : args ) );
- }
- }), args);
- }
-
- // return the result
- return rslt;
- };
- $.jstree._fn[i].old = val.old;
- $.jstree._fn[i].plugin = pname;
- });
- },
- rollback : function (rb) {
- if(rb) {
- if(!$.isArray(rb)) { rb = [ rb ]; }
- $.each(rb, function (i, val) {
- instances[val.i].set_rollback(val.h, val.d);
- });
- }
- }
- };
- // set the prototype for all instances
- $.jstree._fn = $.jstree._instance.prototype = {};
-
- // load the css when DOM is ready
- $(function() {
- // code is copied from jQuery ($.browser is deprecated + there is a bug in IE)
- var u = navigator.userAgent.toLowerCase(),
- v = (u.match( /.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
- css_string = '' +
- '.jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } ' +
- '.jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; min-width:18px; } ' +
- '.jstree-rtl li { margin-left:0; margin-right:18px; } ' +
- '.jstree > ul > li { margin-left:0px; } ' +
- '.jstree-rtl > ul > li { margin-right:0px; } ' +
- '.jstree ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } ' +
- '.jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } ' +
- '.jstree a:focus { outline: none; } ' +
- '.jstree a > ins { height:16px; width:16px; } ' +
- '.jstree a > .jstree-icon { margin-right:3px; } ' +
- '.jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } ' +
- 'li.jstree-open > ul { display:block; } ' +
- 'li.jstree-closed > ul { display:none; } ';
- // Correct IE 6 (does not support the > CSS selector)
- if(/msie/.test(u) && parseInt(v, 10) == 6) {
- is_ie6 = true;
-
- // fix image flicker and lack of caching
- try {
- document.execCommand("BackgroundImageCache", false, true);
- } catch (err) { }
-
- css_string += '' +
- '.jstree li { height:18px; margin-left:0; margin-right:0; } ' +
- '.jstree li li { margin-left:18px; } ' +
- '.jstree-rtl li li { margin-left:0px; margin-right:18px; } ' +
- 'li.jstree-open ul { display:block; } ' +
- 'li.jstree-closed ul { display:none !important; } ' +
- '.jstree li a { display:inline; border-width:0 !important; padding:0px 2px !important; } ' +
- '.jstree li a ins { height:16px; width:16px; margin-right:3px; } ' +
- '.jstree-rtl li a ins { margin-right:0px; margin-left:3px; } ';
- }
- // Correct IE 7 (shifts anchor nodes onhover)
- if(/msie/.test(u) && parseInt(v, 10) == 7) {
- is_ie7 = true;
- css_string += '.jstree li a { border-width:0 !important; padding:0px 2px !important; } ';
- }
- // correct ff2 lack of display:inline-block
- if(!/compatible/.test(u) && /mozilla/.test(u) && parseFloat(v, 10) < 1.9) {
- is_ff2 = true;
- css_string += '' +
- '.jstree ins { display:-moz-inline-box; } ' +
- '.jstree li { line-height:12px; } ' + // WHY??
- '.jstree a { display:-moz-inline-box; } ' +
- '.jstree .jstree-no-icons .jstree-checkbox { display:-moz-inline-stack !important; } ';
- /* this shouldn't be here as it is theme specific */
- }
- // the default stylesheet
- $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
- });
-
- // core functions (open, close, create, update, delete)
- $.jstree.plugin("core", {
- __init : function () {
- this.data.core.locked = false;
- this.data.core.to_open = this.get_settings().core.initially_open;
- this.data.core.to_load = this.get_settings().core.initially_load;
- },
- defaults : {
- html_titles : false,
- animation : 500,
- initially_open : [],
- initially_load : [],
- open_parents : true,
- notify_plugins : true,
- rtl : false,
- load_open : false,
- strings : {
- loading : "Loading ...",
- new_node : "New node",
- multiple_selection : "Multiple selection"
- }
- },
- _fn : {
- init : function () {
- this.set_focus();
- if(this._get_settings().core.rtl) {
- this.get_container().addClass("jstree-rtl").css("direction", "rtl");
- }
- this.get_container().html("<ul><li class='jstree-last jstree-leaf'><ins> </ins><a class='jstree-loading' href='#'><ins class='jstree-icon'> </ins>" + this._get_string("loading") + "</a></li></ul>");
- this.data.core.li_height = this.get_container_ul().find("li.jstree-closed, li.jstree-leaf").eq(0).height() || 18;
-
- this.get_container()
- .delegate("li > ins", "click.jstree", $.proxy(function (event) {
- var trgt = $(event.target);
- // if(trgt.is("ins") && event.pageY - trgt.offset().top < this.data.core.li_height) { this.toggle_node(trgt); }
- this.toggle_node(trgt);
- }, this))
- .bind("mousedown.jstree", $.proxy(function () {
- this.set_focus(); // This used to be setTimeout(set_focus,0) - why?
- }, this))
- .bind("dblclick.jstree", function (event) {
- var sel;
- if(document.selection && document.selection.empty) { document.selection.empty(); }
- else {
- if(window.getSelection) {
- sel = window.getSelection();
- try {
- sel.removeAllRanges();
- sel.collapse();
- } catch (err) { }
- }
- }
- });
- if(this._get_settings().core.notify_plugins) {
- this.get_container()
- .bind("load_node.jstree", $.proxy(function (e, data) {
- var o = this._get_node(data.rslt.obj),
- t = this;
- if(o === -1) { o = this.get_container_ul(); }
- if(!o.length) { return; }
- o.find("li").each(function () {
- var th = $(this);
- if(th.data("jstree")) {
- $.each(th.data("jstree"), function (plugin, values) {
- if(t.data[plugin] && $.isFunction(t["_" + plugin + "_notify"])) {
- t["_" + plugin + "_notify"].call(t, th, values);
- }
- });
- }
- });
- }, this));
- }
- if(this._get_settings().core.load_open) {
- this.get_container()
- .bind("load_node.jstree", $.proxy(function (e, data) {
- var o = this._get_node(data.rslt.obj),
- t = this;
- if(o === -1) { o = this.get_container_ul(); }
- if(!o.length) { return; }
- o.find("li.jstree-open:not(:has(ul))").each(function () {
- t.load_node(this, $.noop, $.noop);
- });
- }, this));
- }
- this.__callback();
- this.load_node(-1, function () { this.loaded(); this.reload_nodes(); });
- },
- destroy : function () {
- var i,
- n = this.get_index(),
- s = this._get_settings(),
- _this = this;
-
- $.each(s.plugins, function (i, val) {
- try { plugins[val].__destroy.apply(_this); } catch(err) { }
- });
- this.__callback();
- // set focus to another instance if this one is focused
- if(this.is_focused()) {
- for(i in instances) {
- if(instances.hasOwnProperty(i) && i != n) {
- instances[i].set_focus();
- break;
- }
- }
- }
- // if no other instance found
- if(n === focused_instance) { focused_instance = -1; }
- // remove all traces of jstree in the DOM (only the ones set using jstree*) and cleans all events
- this.get_container()
- .unbind(".jstree")
- .undelegate(".jstree")
- .removeData("jstree_instance_id")
- .find("[class^='jstree']")
- .andSelf()
- .attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); });
- $(document)
- .unbind(".jstree-" + n)
- .undelegate(".jstree-" + n);
- // remove the actual data
- instances[n] = null;
- delete instances[n];
- },
-
- _core_notify : function (n, data) {
- if(data.opened) {
- this.open_node(n, false, true);
- }
- },
-
- lock : function () {
- this.data.core.locked = true;
- this.get_container().children("ul").addClass("jstree-locked").css("opacity","0.7");
- this.__callback({});
- },
- unlock : function () {
- this.data.core.locked = false;
- this.get_container().children("ul").removeClass("jstree-locked").css("opacity","1");
- this.__callback({});
- },
- is_locked : function () { return this.data.core.locked; },
- save_opened : function () {
- var _this = this;
- this.data.core.to_open = [];
- this.get_container_ul().find("li.jstree-open").each(function () {
- if(this.id) { _this.data.core.to_open.push("#" + this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")); }
- });
- this.__callback(_this.data.core.to_open);
- },
- save_loaded : function () { },
- reload_nodes : function (is_callback) {
- var _this = this,
- done = true,
- current = [],
- remaining = [];
- if(!is_callback) {
- this.data.core.reopen = false;
- this.data.core.refreshing = true;
- this.data.core.to_open = $.map($.makeArray(this.data.core.to_open), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
- this.data.core.to_load = $.map($.makeArray(this.data.core.to_load), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
- if(this.data.core.to_open.length) {
- this.data.core.to_load = this.data.core.to_load.concat(this.data.core.to_open);
- }
- }
- if(this.data.core.to_load.length) {
- $.each(this.data.core.to_load, function (i, val) {
- if(val == "#") { return true; }
- if($(val).length) { current.push(val); }
- else { remaining.push(val); }
- });
- if(current.length) {
- this.data.core.to_load = remaining;
- $.each(current, function (i, val) {
- if(!_this._is_loaded(val)) {
- _this.load_node(val, function () { _this.reload_nodes(true); }, function () { _this.reload_nodes(true); });
- done = false;
- }
- });
- }
- }
- if(this.data.core.to_open.length) {
- $.each(this.data.core.to_open, function (i, val) {
- _this.open_node(val, false, true);
- });
- }
- if(done) {
- // TODO: find a more elegant approach to syncronizing returning requests
- if(this.data.core.reopen) { clearTimeout(this.data.core.reopen); }
- this.data.core.reopen = setTimeout(function () { _this.__callback({}, _this); }, 50);
- this.data.core.refreshing = false;
- this.reopen();
- }
- },
- reopen : function () {
- var _this = this;
- if(this.data.core.to_open.length) {
- $.each(this.data.core.to_open, function (i, val) {
- _this.open_node(val, false, true);
- });
- }
- this.__callback({});
- },
- refresh : function (obj) {
- var _this = this;
- this.save_opened();
- if(!obj) { obj = -1; }
- obj = this._get_node(obj);
- if(!obj) { obj = -1; }
- if(obj !== -1) { obj.children("UL").remove(); }
- else { this.get_container_ul().empty(); }
- this.load_node(obj, function () { _this.__callback({ "obj" : obj}); _this.reload_nodes(); });
- },
- // Dummy function to fire after the first load (so that there is a jstree.loaded event)
- loaded : function () {
- this.__callback();
- },
- // deal with focus
- set_focus : function () {
- if(this.is_focused()) { return; }
- var f = $.jstree._focused();
- if(f) { f.unset_focus(); }
-
- this.get_container().addClass("jstree-focused");
- focused_instance = this.get_index();
- this.__callback();
- },
- is_focused : function () {
- return focused_instance == this.get_index();
- },
- unset_focus : function () {
- if(this.is_focused()) {
- this.get_container().removeClass("jstree-focused");
- focused_instance = -1;
- }
- this.__callback();
- },
-
- // traverse
- _get_node : function (obj) {
- var $obj = $(obj, this.get_container());
- if($obj.is(".jstree") || obj == -1) { return -1; }
- $obj = $obj.closest("li", this.get_container());
- return $obj.length ? $obj : false;
- },
- _get_next : function (obj, strict) {
- obj = this._get_node(obj);
- if(obj === -1) { return this.get_container().find("> ul > li:first-child"); }
- if(!obj.length) { return false; }
- if(strict) { return (obj.nextAll("li").size() > 0) ? obj.nextAll("li:eq(0)") : false; }
-
- if(obj.hasClass("jstree-open")) { return obj.find("li:eq(0)"); }
- else if(obj.nextAll("li").size() > 0) { return obj.nextAll("li:eq(0)"); }
- else { return obj.parentsUntil(".jstree","li").next("li").eq(0); }
- },
- _get_prev : function (obj, strict) {
- obj = this._get_node(obj);
- if(obj === -1) { return this.get_container().find("> ul > li:last-child"); }
- if(!obj.length) { return false; }
- if(strict) { return (obj.prevAll("li").length > 0) ? obj.prevAll("li:eq(0)") : false; }
-
- if(obj.prev("li").length) {
- obj = obj.prev("li").eq(0);
- while(obj.hasClass("jstree-open")) { obj = obj.children("ul:eq(0)").children("li:last"); }
- return obj;
- }
- else { var o = obj.parentsUntil(".jstree","li:eq(0)"); return o.length ? o : false; }
- },
- _get_parent : function (obj) {
- obj = this._get_node(obj);
- if(obj == -1 || !obj.length) { return false; }
- var o = obj.parentsUntil(".jstree", "li:eq(0)");
- return o.length ? o : -1;
- },
- _get_children : function (obj) {
- obj = this._get_node(obj);
- if(obj === -1) { return this.get_container().children("ul:eq(0)").children("li"); }
- if(!obj.length) { return false; }
- return obj.children("ul:eq(0)").children("li");
- },
- get_path : function (obj, id_mode) {
- var p = [],
- _this = this;
- obj = this._get_node(obj);
- if(obj === -1 || !obj || !obj.length) { return false; }
- obj.parentsUntil(".jstree", "li").each(function () {
- p.push( id_mode ? this.id : _this.get_text(this) );
- });
- p.reverse();
- p.push( id_mode ? obj.attr("id") : this.get_text(obj) );
- return p;
- },
-
- // string functions
- _get_string : function (key) {
- return this._get_settings().core.strings[key] || key;
- },
-
- is_open : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-open"); },
- is_closed : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-closed"); },
- is_leaf : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-leaf"); },
- correct_state : function (obj) {
- obj = this._get_node(obj);
- if(!obj || obj === -1) { return false; }
- obj.removeClass("jstree-closed jstree-open").addClass("jstree-leaf").children("ul").remove();
- this.__callback({ "obj" : obj });
- },
- // open/close
- open_node : function (obj, callback, skip_animation) {
- obj = this._get_node(obj);
- if(!obj.length) { return false; }
- if(!obj.hasClass("jstree-closed")) { if(callback) { callback.call(); } return false; }
- var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation,
- t = this;
- if(!this._is_loaded(obj)) {
- obj.children("a").addClass("jstree-loading");
- this.load_node(obj, function () { t.open_node(obj, callback, skip_animation); }, callback);
- }
- else {
- if(this._get_settings().core.open_parents) {
- obj.parentsUntil(".jstree",".jstree-closed").each(function () {
- t.open_node(this, false, true);
- });
- }
- if(s) { obj.children("ul").css("display","none"); }
- obj.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading");
- if(s) { obj.children("ul").stop(true, true).slideDown(s, function () { this.style.display = ""; t.after_open(obj); }); }
- else { t.after_open(obj); }
- this.__callback({ "obj" : obj });
- if(callback) { callback.call(); }
- }
- },
- after_open : function (obj) { this.__callback({ "obj" : obj }); },
- close_node : function (obj, skip_animation) {
- obj = this._get_node(obj);
- var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation,
- t = this;
- if(!obj.length || !obj.hasClass("jstree-open")) { return false; }
- if(s) { obj.children("ul").attr("style","display:block !important"); }
- obj.removeClass("jstree-open").addClass("jstree-closed");
- if(s) { obj.children("ul").stop(true, true).slideUp(s, function () { this.style.display = ""; t.after_close(obj); }); }
- else { t.after_close(obj); }
- this.__callback({ "obj" : obj });
- },
- after_close : function (obj) { this.__callback({ "obj" : obj }); },
- toggle_node : function (obj) {
- obj = this._get_node(obj);
- if(obj.hasClass("jstree-closed")) { return this.open_node(obj); }
- if(obj.hasClass("jstree-open")) { return this.close_node(obj); }
- },
- open_all : function (obj, do_animation, original_obj) {
- obj = obj ? this._get_node(obj) : -1;
- if(!obj || obj === -1) { obj = this.get_container_ul(); }
- if(original_obj) {
- obj = obj.find("li.jstree-closed");
- }
- else {
- original_obj = obj;
- if(obj.is(".jstree-closed")) { obj = obj.find("li.jstree-closed").andSelf(); }
- else { obj = obj.find("li.jstree-closed"); }
- }
- var _this = this;
- obj.each(function () {
- var __this = this;
- if(!_this._is_loaded(this)) { _this.open_node(this, function() { _this.open_all(__this, do_animation, original_obj); }, !do_animation); }
- else { _this.open_node(this, false, !do_animation); }
- });
- // so that callback is fired AFTER all nodes are open
- if(original_obj.find('li.jstree-closed').length === 0) { this.__callback({ "obj" : original_obj }); }
- },
- close_all : function (obj, do_animation) {
- var _this = this;
- obj = obj ? this._get_node(obj) : this.get_container();
- if(!obj || obj === -1) { obj = this.get_container_ul(); }
- obj.find("li.jstree-open").andSelf().each(function () { _this.close_node(this, !do_animation); });
- this.__callback({ "obj" : obj });
- },
- clean_node : function (obj) {
- obj = obj && obj != -1 ? $(obj) : this.get_container_ul();
- obj = obj.is("li") ? obj.find("li").andSelf() : obj.find("li");
- obj.removeClass("jstree-last")
- .filter("li:last-child").addClass("jstree-last").end()
- .filter(":has(li)")
- .not(".jstree-open").removeClass("jstree-leaf").addClass("jstree-closed");
- obj.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove();
- this.__callback({ "obj" : obj });
- },
- // rollback
- get_rollback : function () {
- this.__callback();
- return { i : this.get_index(), h : this.get_container().children("ul").clone(true), d : this.data };
- },
- set_rollback : function (html, data) {
- this.get_container().empty().append(html);
- this.data = data;
- this.__callback();
- },
- // Dummy functions to be overwritten by any datastore plugin included
- load_node : function (obj, s_call, e_call) { this.__callback({ "obj" : obj }); },
- _is_loaded : function (obj) { return true; },
-
- // Basic operations: create
- create_node : function (obj, position, js, callback, is_loaded) {
- obj = this._get_node(obj);
- position = typeof position === "undefined" ? "last" : position;
- var d = $("<li />"),
- s = this._get_settings().core,
- tmp;
-
- if(obj !== -1 && !obj.length) { return false; }
- if(!is_loaded && !this._is_loaded(obj)) { this.load_node(obj, function () { this.create_node(obj, position, js, callback, true); }); return false; }
-
- this.__rollback();
-
- if(typeof js === "string") { js = { "data" : js }; }
- if(!js) { js = {}; }
- if(js.attr) { d.attr(js.attr); }
- if(js.metadata) { d.data(js.metadata); }
- if(js.state) { d.addClass("jstree-" + js.state); }
- if(!js.data) { js.data = this._get_string("new_node"); }
- if(!$.isArray(js.data)) { tmp = js.data; js.data = []; js.data.push(tmp); }
- $.each(js.data, function (i, m) {
- tmp = $("<a />");
- if($.isFunction(m)) { m = m.call(this, js); }
- if(typeof m == "string") { tmp.attr('href','#')[ s.html_titles ? "html" : "text" ](m); }
- else {
- if(!m.attr) { m.attr = {}; }
- if(!m.attr.href) { m.attr.href = '#'; }
- tmp.attr(m.attr)[ s.html_titles ? "html" : "text" ](m.title);
- if(m.language) { tmp.addClass(m.language); }
- }
- tmp.prepend("<ins class='jstree-icon'> </ins>");
- if(!m.icon && js.icon) { m.icon = js.icon; }
- if(m.icon) {
- if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); }
- else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); }
- }
- d.append(tmp);
- });
- d.prepend("<ins class='jstree-icon'> </ins>");
- if(obj === -1) {
- obj = this.get_container();
- if(position === "before") { position = "first"; }
- if(position === "after") { position = "last"; }
- }
- switch(position) {
- case "before": obj.before(d); tmp = this._get_parent(obj); break;
- case "after" : obj.after(d); tmp = this._get_parent(obj); break;
- case "inside":
- case "first" :
- if(!obj.children("ul").length) { obj.append("<ul />"); }
- obj.children("ul").prepend(d);
- tmp = obj;
- break;
- case "last":
- if(!obj.children("ul").length) { obj.append("<ul />"); }
- obj.children("ul").append(d);
- tmp = obj;
- break;
- default:
- if(!obj.children("ul").length) { obj.append("<ul />"); }
- if(!position) { position = 0; }
- tmp = obj.children("ul").children("li").eq(position);
- if(tmp.length) { tmp.before(d); }
- else { obj.children("ul").append(d); }
- tmp = obj;
- break;
- }
- if(tmp === -1 || tmp.get(0) === this.get_container().get(0)) { tmp = -1; }
- this.clean_node(tmp);
- this.__callback({ "obj" : d, "parent" : tmp });
- if(callback) { callback.call(this, d); }
- return d;
- },
- // Basic operations: rename (deal with text)
- get_text : function (obj) {
- obj = this._get_node(obj);
- if(!obj.length) { return false; }
- var s = this._get_settings().core.html_titles;
- obj = obj.children("a:eq(0)");
- if(s) {
- obj = obj.clone();
- obj.children("INS").remove();
- return obj.html();
- }
- else {
- obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
- return obj.nodeValue;
- }
- },
- set_text : function (obj, val) {
- obj = this._get_node(obj);
- if(!obj.length) { return false; }
- obj = obj.children("a:eq(0)");
- if(this._get_settings().core.html_titles) {
- var tmp = obj.children("INS").clone();
- obj.html(val).prepend(tmp);
- this.__callback({ "obj" : obj, "name" : val });
- return true;
- }
- else {
- obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
- this.__callback({ "obj" : obj, "name" : val });
- return (obj.nodeValue = val);
- }
- },
- rename_node : function (obj, val) {
- obj = this._get_node(obj);
- this.__rollback();
- if(obj && obj.length && this.set_text.apply(this, Array.prototype.slice.call(arguments))) { this.__callback({ "obj" : obj, "name" : val }); }
- },
- // Basic operations: deleting nodes
- delete_node : function (obj) {
- obj = this._get_node(obj);
- if(!obj.length) { return false; }
- this.__rollback();
- var p = this._get_parent(obj), prev = $([]), t = this;
- obj.each(function () {
- prev = prev.add(t._get_prev(this));
- });
- obj = obj.detach();
- if(p !== -1 && p.find("> ul > li").length === 0) {
- p.removeClass("jstree-open jstree-closed").addClass("jstree-leaf");
- }
- this.clean_node(p);
- this.__callback({ "obj" : obj, "prev" : prev, "parent" : p });
- return obj;
- },
- prepare_move : function (o, r, pos, cb, is_cb) {
- var p = {};
-
- p.ot = $.jstree._reference(o) || this;
- p.o = p.ot._get_node(o);
- p.r = r === - 1 ? -1 : this._get_node(r);
- p.p = (typeof pos === "undefined" || pos === false) ? "last" : pos; // TODO: move to a setting
- if(!is_cb && prepared_move.o && prepared_move.o[0] === p.o[0] && prepared_move.r[0] === p.r[0] && prepared_move.p === p.p) {
- this.__callback(prepared_move);
- if(cb) { cb.call(this, prepared_move); }
- return;
- }
- p.ot = $.jstree._reference(p.o) || this;
- p.rt = $.jstree._reference(p.r) || this; // r === -1 ? p.ot : $.jstree._reference(p.r) || this
- if(p.r === -1 || !p.r) {
- p.cr = -1;
- switch(p.p) {
- case "first":
- case "before":
- case "inside":
- p.cp = 0;
- break;
- case "after":
- case "last":
- p.cp = p.rt.get_container().find(" > ul > li").length;
- break;
- default:
- p.cp = p.p;
- break;
- }
- }
- else {
- if(!/^(before|after)$/.test(p.p) && !this._is_loaded(p.r)) {
- return this.load_node(p.r, function () { this.prepare_move(o, r, pos, cb, true); });
- }
- switch(p.p) {
- case "before":
- p.cp = p.r.index();
- p.cr = p.rt._get_parent(p.r);
- break;
- case "after":
- p.cp = p.r.index() + 1;
- p.cr = p.rt._get_parent(p.r);
- break;
- case "inside":
- case "first":
- p.cp = 0;
- p.cr = p.r;
- break;
- case "last":
- p.cp = p.r.find(" > ul > li").length;
- p.cr = p.r;
- break;
- default:
- p.cp = p.p;
- p.cr = p.r;
- break;
- }
- }
- p.np = p.cr == -1 ? p.rt.get_container() : p.cr;
- p.op = p.ot._get_parent(p.o);
- p.cop = p.o.index();
- if(p.op === -1) { p.op = p.ot ? p.ot.get_container() : this.get_container(); }
- if(!/^(before|after)$/.test(p.p) && p.op && p.np && p.op[0] === p.np[0] && p.o.index() < p.cp) { p.cp++; }
- //if(p.p === "before" && p.op && p.np && p.op[0] === p.np[0] && p.o.index() < p.cp) { p.cp--; }
- p.or = p.np.find(" > ul > li:nth-child(" + (p.cp + 1) + ")");
- prepared_move = p;
- this.__callback(prepared_move);
- if(cb) { cb.call(this, prepared_move); }
- },
- check_move : function () {
- var obj = prepared_move, ret = true, r = obj.r === -1 ? this.get_container() : obj.r;
- if(!obj || !obj.o || obj.or[0] === obj.o[0]) { return false; }
- if(!obj.cy) {
- if(obj.op && obj.np && obj.op[0] === obj.np[0] && obj.cp - 1 === obj.o.index()) { return false; }
- obj.o.each(function () {
- if(r.parentsUntil(".jstree", "li").andSelf().index(this) !== -1) { ret = false; return false; }
- });
- }
- return ret;
- },
- move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) {
- if(!is_prepared) {
- return this.prepare_move(obj, ref, position, function (p) {
- this.move_node(p, false, false, is_copy, true, skip_check);
- });
- }
- if(is_copy) {
- prepared_move.cy = true;
- }
- if(!skip_check && !this.check_move()) { return false; }
-
- this.__rollback();
- var o = false;
- if(is_copy) {
- o = obj.o.clone(true);
- o.find("*[id]").andSelf().each(function () {
- if(this.id) { this.id = "copy_" + this.id; }
- });
- }
- else { o = obj.o; }
-
- if(obj.or.length) { obj.or.before(o); }
- else {
- if(!obj.np.children("ul").length) { $("<ul />").appendTo(obj.np); }
- obj.np.children("ul:eq(0)").append(o);
- }
-
- try {
- obj.ot.clean_node(obj.op);
- obj.rt.clean_node(obj.np);
- if(!obj.op.find("> ul > li").length) {
- obj.op.removeClass("jstree-open jstree-closed").addClass("jstree-leaf").children("ul").remove();
- }
- } catch (e) { }
-
- if(is_copy) {
- prepared_move.cy = true;
- prepared_move.oc = o;
- }
- this.__callback(prepared_move);
- return prepared_move;
- },
- _get_move : function () { return prepared_move; }
- }
- });
-})(jQuery);
-//*/
-
-/*
- * jsTree ui plugin
- * This plugins handles selecting/deselecting/hovering/dehovering nodes
- */
-(function ($) {
- var scrollbar_width, e1, e2;
- $(function() {
- if (/msie/.test(navigator.userAgent.toLowerCase())) {
- e1 = $('<textarea cols="10" rows="2"></textarea>').css({ position: 'absolute', top: -1000, left: 0 }).appendTo('body');
- e2 = $('<textarea cols="10" rows="2" style="overflow: hidden;"></textarea>').css({ position: 'absolute', top: -1000, left: 0 }).appendTo('body');
- scrollbar_width = e1.width() - e2.width();
- e1.add(e2).remove();
- }
- else {
- e1 = $('<div />').css({ width: 100, height: 100, overflow: 'auto', position: 'absolute', top: -1000, left: 0 })
- .prependTo('body').append('<div />').find('div').css({ width: '100%', height: 200 });
- scrollbar_width = 100 - e1.width();
- e1.parent().remove();
- }
- });
- $.jstree.plugin("ui", {
- __init : function () {
- this.data.ui.selected = $();
- this.data.ui.last_selected = false;
- this.data.ui.hovered = null;
- this.data.ui.to_select = this.get_settings().ui.initially_select;
-
- this.get_container()
- .delegate("a", "click.jstree", $.proxy(function (event) {
- event.preventDefault();
- event.currentTarget.blur();
- if(!$(event.currentTarget).hasClass("jstree-loading")) {
- this.select_node(event.currentTarget, true, event);
- }
- }, this))
- .delegate("a", "mouseenter.jstree", $.proxy(function (event) {
- if(!$(event.currentTarget).hasClass("jstree-loading")) {
- this.hover_node(event.target);
- }
- }, this))
- .delegate("a", "mouseleave.jstree", $.proxy(function (event) {
- if(!$(event.currentTarget).hasClass("jstree-loading")) {
- this.dehover_node(event.target);
- }
- }, this))
- .bind("reopen.jstree", $.proxy(function () {
- this.reselect();
- }, this))
- .bind("get_rollback.jstree", $.proxy(function () {
- this.dehover_node();
- this.save_selected();
- }, this))
- .bind("set_rollback.jstree", $.proxy(function () {
- this.reselect();
- }, this))
- .bind("close_node.jstree", $.proxy(function (event, data) {
- var s = this._get_settings().ui,
- obj = this._get_node(data.rslt.obj),
- clk = (obj && obj.length) ? obj.children("ul").find("a.jstree-clicked") : $(),
- _this = this;
- if(s.selected_parent_close === false || !clk.length) { return; }
- clk.each(function () {
- _this.deselect_node(this);
- if(s.selected_parent_close === "select_parent") { _this.select_node(obj); }
- });
- }, this))
- .bind("delete_node.jstree", $.proxy(function (event, data) {
- var s = this._get_settings().ui.select_prev_on_delete,
- obj = this._get_node(data.rslt.obj),
- clk = (obj && obj.length) ? obj.find("a.jstree-clicked") : [],
- _this = this;
- clk.each(function () { _this.deselect_node(this); });
- if(s && clk.length) {
- data.rslt.prev.each(function () {
- if(this.parentNode) { _this.select_node(this); return false; /* if return false is removed all prev nodes will be selected */}
- });
- }
- }, this))
- .bind("move_node.jstree", $.proxy(function (event, data) {
- if(data.rslt.cy) {
- data.rslt.oc.find("a.jstree-clicked").removeClass("jstree-clicked");
- }
- }, this));
- },
- defaults : {
- select_limit : -1, // 0, 1, 2 ... or -1 for unlimited
- select_multiple_modifier : "ctrl", // on, or ctrl, shift, alt
- select_range_modifier : "shift",
- selected_parent_close : "select_parent", // false, "deselect", "select_parent"
- selected_parent_open : true,
- select_prev_on_delete : true,
- disable_selecting_children : false,
- initially_select : []
- },
- _fn : {
- _get_node : function (obj, allow_multiple) {
- if(typeof obj === "undefined" || obj === null) { return allow_multiple ? this.data.ui.selected : this.data.ui.last_selected; }
- var $obj = $(obj, this.get_container());
- if($obj.is(".jstree") || obj == -1) { return -1; }
- $obj = $obj.closest("li", this.get_container());
- return $obj.length ? $obj : false;
- },
- _ui_notify : function (n, data) {
- if(data.selected) {
- this.select_node(n, false);
- }
- },
- save_selected : function () {
- var _this = this;
- this.data.ui.to_select = [];
- this.data.ui.selected.each(function () { if(this.id) { _this.data.ui.to_select.push("#" + this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")); } });
- this.__callback(this.data.ui.to_select);
- },
- reselect : function () {
- var _this = this,
- s = this.data.ui.to_select;
- s = $.map($.makeArray(s), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
- // this.deselect_all(); WHY deselect, breaks plugin state notifier?
- $.each(s, function (i, val) { if(val && val !== "#") { _this.select_node(val); } });
- this.data.ui.selected = this.data.ui.selected.filter(function () { return this.parentNode; });
- this.__callback();
- },
- refresh : function (obj) {
- this.save_selected();
- return this.__call_old();
- },
- hover_node : function (obj) {
- obj = this._get_node(obj);
- if(!obj.length) { return false; }
- //if(this.data.ui.hovered && obj.get(0) === this.data.ui.hovered.get(0)) { return; }
- if(!obj.hasClass("jstree-hovered")) { this.dehover_node(); }
- this.data.ui.hovered = obj.children("a").addClass("jstree-hovered").parent();
- this._fix_scroll(obj);
- this.__callback({ "obj" : obj });
- },
- dehover_node : function () {
- var obj = this.data.ui.hovered, p;
- if(!obj || !obj.length) { return false; }
- p = obj.children("a").removeClass("jstree-hovered").parent();
- if(this.data.ui.hovered[0] === p[0]) { this.data.ui.hovered = null; }
- this.__callback({ "obj" : obj });
- },
- select_node : function (obj, check, e) {
- obj = this._get_node(obj);
- if(obj == -1 || !obj || !obj.length) { return false; }
- var s = this._get_settings().ui,
- is_multiple = (s.select_multiple_modifier == "on" || (s.select_multiple_modifier !== false && e && e[s.select_multiple_modifier + "Key"])),
- is_range = (s.select_range_modifier !== false && e && e[s.select_range_modifier + "Key"] && this.data.ui.last_selected && this.data.ui.last_selected[0] !== obj[0] && this.data.ui.last_selected.parent()[0] === obj.parent()[0]),
- is_selected = this.is_selected(obj),
- proceed = true,
- t = this;
- if(check) {
- if(s.disable_selecting_children && is_multiple &&
- (
- (obj.parentsUntil(".jstree","li").children("a.jstree-clicked").length) ||
- (obj.children("ul").find("a.jstree-clicked:eq(0)").length)
- )
- ) {
- return false;
- }
- proceed = false;
- switch(!0) {
- case (is_range):
- this.data.ui.last_selected.addClass("jstree-last-selected");
- obj = obj[ obj.index() < this.data.ui.last_selected.index() ? "nextUntil" : "prevUntil" ](".jstree-last-selected").andSelf();
- if(s.select_limit == -1 || obj.length < s.select_limit) {
- this.data.ui.last_selected.removeClass("jstree-last-selected");
- this.data.ui.selected.each(function () {
- if(this !== t.data.ui.last_selected[0]) { t.deselect_node(this); }
- });
- is_selected = false;
- proceed = true;
- }
- else {
- proceed = false;
- }
- break;
- case (is_selected && !is_multiple):
- this.deselect_all();
- is_selected = false;
- proceed = true;
- break;
- case (!is_selected && !is_multiple):
- if(s.select_limit == -1 || s.select_limit > 0) {
- this.deselect_all();
- proceed = true;
- }
- break;
- case (is_selected && is_multiple):
- this.deselect_node(obj);
- break;
- case (!is_selected && is_multiple):
- if(s.select_limit == -1 || this.data.ui.selected.length + 1 <= s.select_limit) {
- proceed = true;
- }
- break;
- }
- }
- if(proceed && !is_selected) {
- if(!is_range) { this.data.ui.last_selected = obj; }
- obj.children("a").addClass("jstree-clicked");
- if(s.selected_parent_open) {
- obj.parents(".jstree-closed").each(function () { t.open_node(this, false, true); });
- }
- this.data.ui.selected = this.data.ui.selected.add(obj);
- this._fix_scroll(obj.eq(0));
- this.__callback({ "obj" : obj, "e" : e });
- }
- },
- _fix_scroll : function (obj) {
- var c = this.get_container()[0], t;
- if(c.scrollHeight > c.offsetHeight) {
- obj = this._get_node(obj);
- if(!obj || obj === -1 || !obj.length || !obj.is(":visible")) { return; }
- t = obj.offset().top - this.get_container().offset().top;
- if(t < 0) {
- c.scrollTop = c.scrollTop + t - 1;
- }
- if(t + this.data.core.li_height + (c.scrollWidth > c.offsetWidth ? scrollbar_width : 0) > c.offsetHeight) {
- c.scrollTop = c.scrollTop + (t - c.offsetHeight + this.data.core.li_height + 1 + (c.scrollWidth > c.offsetWidth ? scrollbar_width : 0));
- }
- }
- },
- deselect_node : function (obj) {
- obj = this._get_node(obj);
- if(!obj.length) { return false; }
- if(this.is_selected(obj)) {
- obj.children("a").removeClass("jstree-clicked");
- this.data.ui.selected = this.data.ui.selected.not(obj);
- if(this.data.ui.last_selected.get(0) === obj.get(0)) { this.data.ui.last_selected = this.data.ui.selected.eq(0); }
- this.__callback({ "obj" : obj });
- }
- },
- toggle_select : function (obj) {
- obj = this._get_node(obj);
- if(!obj.length) { return false; }
- if(this.is_selected(obj)) { this.deselect_node(obj); }
- else { this.select_node(obj); }
- },
- is_selected : function (obj) { return this.data.ui.selected.index(this._get_node(obj)) >= 0; },
- get_selected : function (context) {
- return context ? $(context).find("a.jstree-clicked").parent() : this.data.ui.selected;
- },
- deselect_all : function (context) {
- var ret = context ? $(context).find("a.jstree-clicked").parent() : this.get_container().find("a.jstree-clicked").parent();
- ret.children("a.jstree-clicked").removeClass("jstree-clicked");
- this.data.ui.selected = $([]);
- this.data.ui.last_selected = false;
- this.__callback({ "obj" : ret });
- }
- }
- });
- // include the selection plugin by default
- $.jstree.defaults.plugins.push("ui");
-})(jQuery);
-//*/
-
-/*
- * jsTree CRRM plugin
- * Handles creating/renaming/removing/moving nodes by user interaction.
- */
-(function ($) {
- $.jstree.plugin("crrm", {
- __init : function () {
- this.get_container()
- .bind("move_node.jstree", $.proxy(function (e, data) {
- if(this._get_settings().crrm.move.open_onmove) {
- var t = this;
- data.rslt.np.parentsUntil(".jstree").andSelf().filter(".jstree-closed").each(function () {
- t.open_node(this, false, true);
- });
- }
- }, this));
- },
- defaults : {
- input_width_limit : 200,
- move : {
- always_copy : false, // false, true or "multitree"
- open_onmove : true,
- default_position : "last",
- check_move : function (m) { return true; }
- }
- },
- _fn : {
- _show_input : function (obj, callback) {
- obj = this._get_node(obj);
- var rtl = this._get_settings().core.rtl,
- w = this._get_settings().crrm.input_width_limit,
- w1 = obj.children("ins").width(),
- w2 = obj.find("> a:visible > ins").width() * obj.find("> a:visible > ins").length,
- t = this.get_text(obj),
- h1 = $("<div />", { css : { "position" : "absolute", "top" : "-200px", "left" : (rtl ? "0px" : "-1000px"), "visibility" : "hidden" } }).appendTo("body"),
- h2 = obj.css("position","relative").append(
- $("<input />", {
- "value" : t,
- "class" : "jstree-rename-input",
- // "size" : t.length,
- "css" : {
- "padding" : "0",
- "border" : "1px solid silver",
- "position" : "absolute",
- "left" : (rtl ? "auto" : (w1 + w2 + 4) + "px"),
- "right" : (rtl ? (w1 + w2 + 4) + "px" : "auto"),
- "top" : "0px",
- "height" : (this.data.core.li_height - 2) + "px",
- "lineHeight" : (this.data.core.li_height - 2) + "px",
- "width" : "150px" // will be set a bit further down
- },
- "blur" : $.proxy(function () {
- var i = obj.children(".jstree-rename-input"),
- v = i.val();
- if(v === "") { v = t; }
- h1.remove();
- i.remove(); // rollback purposes
- this.set_text(obj,t); // rollback purposes
- this.rename_node(obj, v);
- callback.call(this, obj, v, t);
- obj.css("position","");
- }, this),
- "keyup" : function (event) {
- var key = event.keyCode || event.which;
- if(key == 27) { this.value = t; this.blur(); return; }
- else if(key == 13) { this.blur(); return; }
- else {
- h2.width(Math.min(h1.text("pW" + this.value).width(),w));
- }
- },
- "keypress" : function(event) {
- var key = event.keyCode || event.which;
- if(key == 13) { return false; }
- }
- })
- ).children(".jstree-rename-input");
- this.set_text(obj, "");
- h1.css({
- fontFamily : h2.css('fontFamily') || '',
- fontSize : h2.css('fontSize') || '',
- fontWeight : h2.css('fontWeight') || '',
- fontStyle : h2.css('fontStyle') || '',
- fontStretch : h2.css('fontStretch') || '',
- fontVariant : h2.css('fontVariant') || '',
- letterSpacing : h2.css('letterSpacing') || '',
- wordSpacing : h2.css('wordSpacing') || ''
- });
- h2.width(Math.min(h1.text("pW" + h2[0].value).width(),w))[0].select();
- },
- rename : function (obj) {
- obj = this._get_node(obj);
- this.__rollback();
- var f = this.__callback;
- this._show_input(obj, function (obj, new_name, old_name) {
- f.call(this, { "obj" : obj, "new_name" : new_name, "old_name" : old_name });
- });
- },
- create : function (obj, position, js, callback, skip_rename) {
- var t, _this = this;
- obj = this._get_node(obj);
- if(!obj) { obj = -1; }
- this.__rollback();
- t = this.create_node(obj, position, js, function (t) {
- var p = this._get_parent(t),
- pos = $(t).index();
- if(callback) { callback.call(this, t); }
- if(p.length && p.hasClass("jstree-closed")) { this.open_node(p, false, true); }
- if(!skip_rename) {
- this._show_input(t, function (obj, new_name, old_name) {
- _this.__callback({ "obj" : obj, "name" : new_name, "parent" : p, "position" : pos });
- });
- }
- else { _this.__callback({ "obj" : t, "name" : this.get_text(t), "parent" : p, "position" : pos }); }
- });
- return t;
- },
- remove : function (obj) {
- obj = this._get_node(obj, true);
- var p = this._get_parent(obj), prev = this._get_prev(obj);
- this.__rollback();
- obj = this.delete_node(obj);
- if(obj !== false) { this.__callback({ "obj" : obj, "prev" : prev, "parent" : p }); }
- },
- check_move : function () {
- if(!this.__call_old()) { return false; }
- var s = this._get_settings().crrm.move;
- if(!s.check_move.call(this, this._get_move())) { return false; }
- return true;
- },
- move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) {
- var s = this._get_settings().crrm.move;
- if(!is_prepared) {
- if(typeof position === "undefined") { position = s.default_position; }
- if(position === "inside" && !s.default_position.match(/^(before|after)$/)) { position = s.default_position; }
- return this.__call_old(true, obj, ref, position, is_copy, false, skip_check);
- }
- // if the move is already prepared
- if(s.always_copy === true || (s.always_copy === "multitree" && obj.rt.get_index() !== obj.ot.get_index() )) {
- is_copy = true;
- }
- this.__call_old(true, obj, ref, position, is_copy, true, skip_check);
- },
-
- cut : function (obj) {
- obj = this._get_node(obj, true);
- if(!obj || !obj.length) { return false; }
- this.data.crrm.cp_nodes = false;
- this.data.crrm.ct_nodes = obj;
- this.__callback({ "obj" : obj });
- },
- copy : function (obj) {
- obj = this._get_node(obj, true);
- if(!obj || !obj.length) { return false; }
- this.data.crrm.ct_nodes = false;
- this.data.crrm.cp_nodes = obj;
- this.__callback({ "obj" : obj });
- },
- paste : function (obj) {
- obj = this._get_node(obj);
- if(!obj || !obj.length) { return false; }
- var nodes = this.data.crrm.ct_nodes ? this.data.crrm.ct_nodes : this.data.crrm.cp_nodes;
- if(!this.data.crrm.ct_nodes && !this.data.crrm.cp_nodes) { return false; }
- if(this.data.crrm.ct_nodes) { this.move_node(this.data.crrm.ct_nodes, obj); this.data.crrm.ct_nodes = false; }
- if(this.data.crrm.cp_nodes) { this.move_node(this.data.crrm.cp_nodes, obj, false, true); }
- this.__callback({ "obj" : obj, "nodes" : nodes });
- }
- }
- });
- // include the crr plugin by default
- // $.jstree.defaults.plugins.push("crrm");
-})(jQuery);
-//*/
-
-/*
- * jsTree themes plugin
- * Handles loading and setting themes, as well as detecting path to themes, etc.
- */
-(function ($) {
- var themes_loaded = [];
- // this variable stores the path to the themes folder - if left as false - it will be autodetected
- $.jstree._themes = false;
- $.jstree.plugin("themes", {
- __init : function () {
- this.get_container()
- .bind("init.jstree", $.proxy(function () {
- var s = this._get_settings().themes;
- this.data.themes.dots = s.dots;
- this.data.themes.icons = s.icons;
- this.set_theme(s.theme, s.url);
- }, this))
- .bind("loaded.jstree", $.proxy(function () {
- // bound here too, as simple HTML tree's won't honor dots & icons otherwise
- if(!this.data.themes.dots) { this.hide_dots(); }
- else { this.show_dots(); }
- if(!this.data.themes.icons) { this.hide_icons(); }
- else { this.show_icons(); }
- }, this));
- },
- defaults : {
- theme : "default",
- url : false,
- dots : true,
- icons : true
- },
- _fn : {
- set_theme : function (theme_name, theme_url) {
- if(!theme_name) { return false; }
- if(!theme_url) { theme_url = $.jstree._themes + theme_name + '/style.css'; }
- if($.inArray(theme_url, themes_loaded) == -1) {
- $.vakata.css.add_sheet({ "url" : theme_url });
- themes_loaded.push(theme_url);
- }
- if(this.data.themes.theme != theme_name) {
- this.get_container().removeClass('jstree-' + this.data.themes.theme);
- this.data.themes.theme = theme_name;
- }
- this.get_container().addClass('jstree-' + theme_name);
- if(!this.data.themes.dots) { this.hide_dots(); }
- else { this.show_dots(); }
- if(!this.data.themes.icons) { this.hide_icons(); }
- else { this.show_icons(); }
- this.__callback();
- },
- get_theme : function () { return this.data.themes.theme; },
-
- show_dots : function () { this.data.themes.dots = true; this.get_container().children("ul").removeClass("jstree-no-dots"); },
- hide_dots : function () { this.data.themes.dots = false; this.get_container().children("ul").addClass("jstree-no-dots"); },
- toggle_dots : function () { if(this.data.themes.dots) { this.hide_dots(); } else { this.show_dots(); } },
-
- show_icons : function () { this.data.themes.icons = true; this.get_container().children("ul").removeClass("jstree-no-icons"); },
- hide_icons : function () { this.data.themes.icons = false; this.get_container().children("ul").addClass("jstree-no-icons"); },
- toggle_icons: function () { if(this.data.themes.icons) { this.hide_icons(); } else { this.show_icons(); } }
- }
- });
- // autodetect themes path
- $(function () {
- if($.jstree._themes === false) {
- $("script").each(function () {
- if(this.src.toString().match(/jquery\.jstree[^\/]*?\.js(\?.*)?$/)) {
- $.jstree._themes = this.src.toString().replace(/jquery\.jstree[^\/]*?\.js(\?.*)?$/, "") + 'themes/';
- return false;
- }
- });
- }
- if($.jstree._themes === false) { $.jstree._themes = "themes/"; }
- });
- // include the themes plugin by default
- $.jstree.defaults.plugins.push("themes");
-})(jQuery);
-//*/
-
-/*
- * jsTree hotkeys plugin
- * Enables keyboard navigation for all tree instances
- * Depends on the jstree ui & jquery hotkeys plugins
- */
-(function ($) {
- var bound = [];
- function exec(i, event) {
- var f = $.jstree._focused(), tmp;
- if(f && f.data && f.data.hotkeys && f.data.hotkeys.enabled) {
- tmp = f._get_settings().hotkeys[i];
- if(tmp) { return tmp.call(f, event); }
- }
- }
- $.jstree.plugin("hotkeys", {
- __init : function () {
- if(typeof $.hotkeys === "undefined") { throw "jsTree hotkeys: jQuery hotkeys plugin not included."; }
- if(!this.data.ui) { throw "jsTree hotkeys: jsTree UI plugin not included."; }
- $.each(this._get_settings().hotkeys, function (i, v) {
- if(v !== false && $.inArray(i, bound) == -1) {
- $(document).bind("keydown", i, function (event) { return exec(i, event); });
- bound.push(i);
- }
- });
- this.get_container()
- .bind("lock.jstree", $.proxy(function () {
- if(this.data.hotkeys.enabled) { this.data.hotkeys.enabled = false; this.data.hotkeys.revert = true; }
- }, this))
- .bind("unlock.jstree", $.proxy(function () {
- if(this.data.hotkeys.revert) { this.data.hotkeys.enabled = true; }
- }, this));
- this.enable_hotkeys();
- },
- defaults : {
- "up" : function () {
- var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
- this.hover_node(this._get_prev(o));
- return false;
- },
- "ctrl+up" : function () {
- var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
- this.hover_node(this._get_prev(o));
- return false;
- },
- "shift+up" : function () {
- var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
- this.hover_node(this._get_prev(o));
- return false;
- },
- "down" : function () {
- var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
- this.hover_node(this._get_next(o));
- return false;
- },
- "ctrl+down" : function () {
- var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
- this.hover_node(this._get_next(o));
- return false;
- },
- "shift+down" : function () {
- var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
- this.hover_node(this._get_next(o));
- return false;
- },
- "left" : function () {
- var o = this.data.ui.hovered || this.data.ui.last_selected;
- if(o) {
- if(o.hasClass("jstree-open")) { this.close_node(o); }
- else { this.hover_node(this._get_prev(o)); }
- }
- return false;
- },
- "ctrl+left" : function () {
- var o = this.data.ui.hovered || this.data.ui.last_selected;
- if(o) {
- if(o.hasClass("jstree-open")) { this.close_node(o); }
- else { this.hover_node(this._get_prev(o)); }
- }
- return false;
- },
- "shift+left" : function () {
- var o = this.data.ui.hovered || this.data.ui.last_selected;
- if(o) {
- if(o.hasClass("jstree-open")) { this.close_node(o); }
- else { this.hover_node(this._get_prev(o)); }
- }
- return false;
- },
- "right" : function () {
- var o = this.data.ui.hovered || this.data.ui.last_selected;
- if(o && o.length) {
- if(o.hasClass("jstree-closed")) { this.open_node(o); }
- else { this.hover_node(this._get_next(o)); }
- }
- return false;
- },
- "ctrl+right" : function () {
- var o = this.data.ui.hovered || this.data.ui.last_selected;
- if(o && o.length) {
- if(o.hasClass("jstree-closed")) { this.open_node(o); }
- else { this.hover_node(this._get_next(o)); }
- }
- return false;
- },
- "shift+right" : function () {
- var o = this.data.ui.hovered || this.data.ui.last_selected;
- if(o && o.length) {
- if(o.hasClass("jstree-closed")) { this.open_node(o); }
- else { this.hover_node(this._get_next(o)); }
- }
- return false;
- },
- "space" : function () {
- if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").click(); }
- return false;
- },
- "ctrl+space" : function (event) {
- event.type = "click";
- if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").trigger(event); }
- return false;
- },
- "shift+space" : function (event) {
- event.type = "click";
- if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").trigger(event); }
- return false;
- },
- "f2" : function () { this.rename(this.data.ui.hovered || this.data.ui.last_selected); },
- "del" : function () { this.remove(this.data.ui.hovered || this._get_node(null)); }
- },
- _fn : {
- enable_hotkeys : function () {
- this.data.hotkeys.enabled = true;
- },
- disable_hotkeys : function () {
- this.data.hotkeys.enabled = false;
- }
- }
- });
-})(jQuery);
-//*/
-
-/*
- * jsTree JSON plugin
- * The JSON data store. Datastores are build by overriding the `load_node` and `_is_loaded` functions.
- */
-(function ($) {
- $.jstree.plugin("json_data", {
- __init : function() {
- var s = this._get_settings().json_data;
- if(s.progressive_unload) {
- this.get_container().bind("after_close.jstree", function (e, data) {
- data.rslt.obj.children("ul").remove();
- });
- }
- },
- defaults : {
- // `data` can be a function:
- // * accepts two arguments - node being loaded and a callback to pass the result to
- // * will be executed in the current tree's scope & ajax won't be supported
- data : false,
- ajax : false,
- correct_state : true,
- progressive_render : false,
- progressive_unload : false
- },
- _fn : {
- load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_json(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); },
- _is_loaded : function (obj) {
- var s = this._get_settings().json_data;
- obj = this._get_node(obj);
- return obj == -1 || !obj || (!s.ajax && !s.progressive_render && !$.isFunction(s.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").length > 0;
- },
- refresh : function (obj) {
- obj = this._get_node(obj);
- var s = this._get_settings().json_data;
- if(obj && obj !== -1 && s.progressive_unload && ($.isFunction(s.data) || !!s.ajax)) {
- obj.removeData("jstree_children");
- }
- return this.__call_old();
- },
- load_node_json : function (obj, s_call, e_call) {
- var s = this.get_settings().json_data, d,
- error_func = function () {},
- success_func = function () {};
- obj = this._get_node(obj);
-
- if(obj && obj !== -1 && (s.progressive_render || s.progressive_unload) && !obj.is(".jstree-open, .jstree-leaf") && obj.children("ul").children("li").length === 0 && obj.data("jstree_children")) {
- d = this._parse_json(obj.data("jstree_children"), obj);
- if(d) {
- obj.append(d);
- if(!s.progressive_unload) { obj.removeData("jstree_children"); }
- }
- this.clean_node(obj);
- if(s_call) { s_call.call(this); }
- return;
- }
-
- if(obj && obj !== -1) {
- if(obj.data("jstree_is_loading")) { return; }
- else { obj.data("jstree_is_loading",true); }
- }
- switch(!0) {
- case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
- // function option added here for easier model integration (also supporting async - see callback)
- case ($.isFunction(s.data)):
- s.data.call(this, obj, $.proxy(function (d) {
- d = this._parse_json(d, obj);
- if(!d) {
- if(obj === -1 || !obj) {
- if(s.correct_state) { this.get_container().children("ul").empty(); }
- }
- else {
- obj.children("a.jstree-loading").removeClass("jstree-loading");
- obj.removeData("jstree_is_loading");
- if(s.correct_state) { this.correct_state(obj); }
- }
- if(e_call) { e_call.call(this); }
- }
- else {
- if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
- else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree_is_loading"); }
- this.clean_node(obj);
- if(s_call) { s_call.call(this); }
- }
- }, this));
- break;
- case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
- if(!obj || obj == -1) {
- d = this._parse_json(s.data, obj);
- if(d) {
- this.get_container().children("ul").empty().append(d.children());
- this.clean_node();
- }
- else {
- if(s.correct_state) { this.get_container().children("ul").empty(); }
- }
- }
- if(s_call) { s_call.call(this); }
- break;
- case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
- error_func = function (x, t, e) {
- var ef = this.get_settings().json_data.ajax.error;
- if(ef) { ef.call(this, x, t, e); }
- if(obj != -1 && obj.length) {
- obj.children("a.jstree-loading").removeClass("jstree-loading");
- obj.removeData("jstree_is_loading");
- if(t === "success" && s.correct_state) { this.correct_state(obj); }
- }
- else {
- if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
- }
- if(e_call) { e_call.call(this); }
- };
- success_func = function (d, t, x) {
- var sf = this.get_settings().json_data.ajax.success;
- if(sf) { d = sf.call(this,d,t,x) || d; }
- if(d === "" || (d && d.toString && d.toString().replace(/^[\s\n]+$/,"") === "") || (!$.isArray(d) && !$.isPlainObject(d))) {
- return error_func.call(this, x, t, "");
- }
- d = this._parse_json(d, obj);
- if(d) {
- if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
- else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree_is_loading"); }
- this.clean_node(obj);
- if(s_call) { s_call.call(this); }
- }
- else {
- if(obj === -1 || !obj) {
- if(s.correct_state) {
- this.get_container().children("ul").empty();
- if(s_call) { s_call.call(this); }
- }
- }
- else {
- obj.children("a.jstree-loading").removeClass("jstree-loading");
- obj.removeData("jstree_is_loading");
- if(s.correct_state) {
- this.correct_state(obj);
- if(s_call) { s_call.call(this); }
- }
- }
- }
- };
- s.ajax.context = this;
- s.ajax.error = error_func;
- s.ajax.success = success_func;
- if(!s.ajax.dataType) { s.ajax.dataType = "json"; }
- if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
- if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
- $.ajax(s.ajax);
- break;
- }
- },
- _parse_json : function (js, obj, is_callback) {
- var d = false,
- p = this._get_settings(),
- s = p.json_data,
- t = p.core.html_titles,
- tmp, i, j, ul1, ul2;
-
- if(!js) { return d; }
- if(s.progressive_unload && obj && obj !== -1) {
- obj.data("jstree_children", d);
- }
- if($.isArray(js)) {
- d = $();
- if(!js.length) { return false; }
- for(i = 0, j = js.length; i < j; i++) {
- tmp = this._parse_json(js[i], obj, true);
- if(tmp.length) { d = d.add(tmp); }
- }
- }
- else {
- if(typeof js == "string") { js = { data : js }; }
- if(!js.data && js.data !== "") { return d; }
- d = $("<li />");
- if(js.attr) { d.attr(js.attr); }
- if(js.metadata) { d.data(js.metadata); }
- if(js.state) { d.addClass("jstree-" + js.state); }
- if(!$.isArray(js.data)) { tmp = js.data; js.data = []; js.data.push(tmp); }
- $.each(js.data, function (i, m) {
- tmp = $("<a />");
- if($.isFunction(m)) { m = m.call(this, js); }
- if(typeof m == "string") { tmp.attr('href','#')[ t ? "html" : "text" ](m); }
- else {
- if(!m.attr) { m.attr = {}; }
- if(!m.attr.href) { m.attr.href = '#'; }
- tmp.attr(m.attr)[ t ? "html" : "text" ](m.title);
- if(m.language) { tmp.addClass(m.language); }
- }
- tmp.prepend("<ins class='jstree-icon'> </ins>");
- if(!m.icon && js.icon) { m.icon = js.icon; }
- if(m.icon) {
- if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); }
- else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); }
- }
- d.append(tmp);
- });
- d.prepend("<ins class='jstree-icon'> </ins>");
- if(js.children) {
- if(s.progressive_render && js.state !== "open") {
- d.addClass("jstree-closed").data("jstree_children", js.children);
- }
- else {
- if(s.progressive_unload) { d.data("jstree_children", js.children); }
- if($.isArray(js.children) && js.children.length) {
- tmp = this._parse_json(js.children, obj, true);
- if(tmp.length) {
- ul2 = $("<ul />");
- ul2.append(tmp);
- d.append(ul2);
- }
- }
- }
- }
- }
- if(!is_callback) {
- ul1 = $("<ul />");
- ul1.append(d);
- d = ul1;
- }
- return d;
- },
- get_json : function (obj, li_attr, a_attr, is_callback) {
- var result = [],
- s = this._get_settings(),
- _this = this,
- tmp1, tmp2, li, a, t, lang;
- obj = this._get_node(obj);
- if(!obj || obj === -1) { obj = this.get_container().find("> ul > li"); }
- li_attr = $.isArray(li_attr) ? li_attr : [ "id", "class" ];
- if(!is_callback && this.data.types) { li_attr.push(s.types.type_attr); }
- a_attr = $.isArray(a_attr) ? a_attr : [ ];
-
- obj.each(function () {
- li = $(this);
- tmp1 = { data : [] };
- if(li_attr.length) { tmp1.attr = { }; }
- $.each(li_attr, function (i, v) {
- tmp2 = li.attr(v);
- if(tmp2 && tmp2.length && tmp2.replace(/jstree[^ ]*/ig,'').length) {
- tmp1.attr[v] = (" " + tmp2).replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");
- }
- });
- if(li.hasClass("jstree-open")) { tmp1.state = "open"; }
- if(li.hasClass("jstree-closed")) { tmp1.state = "closed"; }
- if(li.data()) { tmp1.metadata = li.data(); }
- a = li.children("a");
- a.each(function () {
- t = $(this);
- if(
- a_attr.length ||
- $.inArray("languages", s.plugins) !== -1 ||
- t.children("ins").get(0).style.backgroundImage.length ||
- (t.children("ins").get(0).className && t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').length)
- ) {
- lang = false;
- if($.inArray("languages", s.plugins) !== -1 && $.isArray(s.languages) && s.languages.length) {
- $.each(s.languages, function (l, lv) {
- if(t.hasClass(lv)) {
- lang = lv;
- return false;
- }
- });
- }
- tmp2 = { attr : { }, title : _this.get_text(t, lang) };
- $.each(a_attr, function (k, z) {
- tmp2.attr[z] = (" " + (t.attr(z) || "")).replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");
- });
- if($.inArray("languages", s.plugins) !== -1 && $.isArray(s.languages) && s.languages.length) {
- $.each(s.languages, function (k, z) {
- if(t.hasClass(z)) { tmp2.language = z; return true; }
- });
- }
- if(t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/^\s+$/ig,"").length) {
- tmp2.icon = t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");
- }
- if(t.children("ins").get(0).style.backgroundImage.length) {
- tmp2.icon = t.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","");
- }
- }
- else {
- tmp2 = _this.get_text(t);
- }
- if(a.length > 1) { tmp1.data.push(tmp2); }
- else { tmp1.data = tmp2; }
- });
- li = li.find("> ul > li");
- if(li.length) { tmp1.children = _this.get_json(li, li_attr, a_attr, true); }
- result.push(tmp1);
- });
- return result;
- }
- }
- });
-})(jQuery);
-//*/
-
-/*
- * jsTree languages plugin
- * Adds support for multiple language versions in one tree
- * This basically allows for many titles coexisting in one node, but only one of them being visible at any given time
- * This is useful for maintaining the same structure in many languages (hence the name of the plugin)
- */
-(function ($) {
- var sh = false;
- $.jstree.plugin("languages", {
- __init : function () { this._load_css(); },
- defaults : [],
- _fn : {
- set_lang : function (i) {
- var langs = this._get_settings().languages,
- st = false,
- selector = ".jstree-" + this.get_index() + ' a';
- if(!$.isArray(langs) || langs.length === 0) { return false; }
- if($.inArray(i,langs) == -1) {
- if(!!langs[i]) { i = langs[i]; }
- else { return false; }
- }
- if(i == this.data.languages.current_language) { return true; }
- st = $.vakata.css.get_css(selector + "." + this.data.languages.current_language, false, sh);
- if(st !== false) { st.style.display = "none"; }
- st = $.vakata.css.get_css(selector + "." + i, false, sh);
- if(st !== false) { st.style.display = ""; }
- this.data.languages.current_language = i;
- this.__callback(i);
- return true;
- },
- get_lang : function () {
- return this.data.languages.current_language;
- },
- _get_string : function (key, lang) {
- var langs = this._get_settings().languages,
- s = this._get_settings().core.strings;
- if($.isArray(langs) && langs.length) {
- lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
- }
- if(s[lang] && s[lang][key]) { return s[lang][key]; }
- if(s[key]) { return s[key]; }
- return key;
- },
- get_text : function (obj, lang) {
- obj = this._get_node(obj) || this.data.ui.last_selected;
- if(!obj.size()) { return false; }
- var langs = this._get_settings().languages,
- s = this._get_settings().core.html_titles;
- if($.isArray(langs) && langs.length) {
- lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
- obj = obj.children("a." + lang);
- }
- else { obj = obj.children("a:eq(0)"); }
- if(s) {
- obj = obj.clone();
- obj.children("INS").remove();
- return obj.html();
- }
- else {
- obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
- return obj.nodeValue;
- }
- },
- set_text : function (obj, val, lang) {
- obj = this._get_node(obj) || this.data.ui.last_selected;
- if(!obj.size()) { return false; }
- var langs = this._get_settings().languages,
- s = this._get_settings().core.html_titles,
- tmp;
- if($.isArray(langs) && langs.length) {
- lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
- obj = obj.children("a." + lang);
- }
- else { obj = obj.children("a:eq(0)"); }
- if(s) {
- tmp = obj.children("INS").clone();
- obj.html(val).prepend(tmp);
- this.__callback({ "obj" : obj, "name" : val, "lang" : lang });
- return true;
- }
- else {
- obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
- this.__callback({ "obj" : obj, "name" : val, "lang" : lang });
- return (obj.nodeValue = val);
- }
- },
- _load_css : function () {
- var langs = this._get_settings().languages,
- str = "/* languages css */",
- selector = ".jstree-" + this.get_index() + ' a',
- ln;
- if($.isArray(langs) && langs.length) {
- this.data.languages.current_language = langs[0];
- for(ln = 0; ln < langs.length; ln++) {
- str += selector + "." + langs[ln] + " {";
- if(langs[ln] != this.data.languages.current_language) { str += " display:none; "; }
- str += " } ";
- }
- sh = $.vakata.css.add_sheet({ 'str' : str, 'title' : "jstree-languages" });
- }
- },
- create_node : function (obj, position, js, callback) {
- var t = this.__call_old(true, obj, position, js, function (t) {
- var langs = this._get_settings().languages,
- a = t.children("a"),
- ln;
- if($.isArray(langs) && langs.length) {
- for(ln = 0; ln < langs.length; ln++) {
- if(!a.is("." + langs[ln])) {
- t.append(a.eq(0).clone().removeClass(langs.join(" ")).addClass(langs[ln]));
- }
- }
- a.not("." + langs.join(", .")).remove();
- }
- if(callback) { callback.call(this, t); }
- });
- return t;
- }
- }
- });
-})(jQuery);
-//*/
-
-/*
- * jsTree cookies plugin
- * Stores the currently opened/selected nodes in a cookie and then restores them
- * Depends on the jquery.cookie plugin
- */
-(function ($) {
- $.jstree.plugin("cookies", {
- __init : function () {
- if(typeof $.cookie === "undefined") { throw "jsTree cookie: jQuery cookie plugin not included."; }
-
- var s = this._get_settings().cookies,
- tmp;
- if(!!s.save_loaded) {
- tmp = $.cookie(s.save_loaded);
- if(tmp && tmp.length) { this.data.core.to_load = tmp.split(","); }
- }
- if(!!s.save_opened) {
- tmp = $.cookie(s.save_opened);
- if(tmp && tmp.length) { this.data.core.to_open = tmp.split(","); }
- }
- if(!!s.save_selected) {
- tmp = $.cookie(s.save_selected);
- if(tmp && tmp.length && this.data.ui) { this.data.ui.to_select = tmp.split(","); }
- }
- this.get_container()
- .one( ( this.data.ui ? "reselect" : "reopen" ) + ".jstree", $.proxy(function () {
- this.get_container()
- .bind("open_node.jstree close_node.jstree select_node.jstree deselect_node.jstree", $.proxy(function (e) {
- if(this._get_settings().cookies.auto_save) { this.save_cookie((e.handleObj.namespace + e.handleObj.type).replace("jstree","")); }
- }, this));
- }, this));
- },
- defaults : {
- save_loaded : "jstree_load",
- save_opened : "jstree_open",
- save_selected : "jstree_select",
- auto_save : true,
- cookie_options : {}
- },
- _fn : {
- save_cookie : function (c) {
- if(this.data.core.refreshing) { return; }
- var s = this._get_settings().cookies;
- if(!c) { // if called manually and not by event
- if(s.save_loaded) {
- this.save_loaded();
- $.cookie(s.save_loaded, this.data.core.to_load.join(","), s.cookie_options);
- }
- if(s.save_opened) {
- this.save_opened();
- $.cookie(s.save_opened, this.data.core.to_open.join(","), s.cookie_options);
- }
- if(s.save_selected && this.data.ui) {
- this.save_selected();
- $.cookie(s.save_selected, this.data.ui.to_select.join(","), s.cookie_options);
- }
- return;
- }
- switch(c) {
- case "open_node":
- case "close_node":
- if(!!s.save_opened) {
- this.save_opened();
- $.cookie(s.save_opened, this.data.core.to_open.join(","), s.cookie_options);
- }
- if(!!s.save_loaded) {
- this.save_loaded();
- $.cookie(s.save_loaded, this.data.core.to_load.join(","), s.cookie_options);
- }
- break;
- case "select_node":
- case "deselect_node":
- if(!!s.save_selected && this.data.ui) {
- this.save_selected();
- $.cookie(s.save_selected, this.data.ui.to_select.join(","), s.cookie_options);
- }
- break;
- }
- }
- }
- });
- // include cookies by default
- // $.jstree.defaults.plugins.push("cookies");
-})(jQuery);
-//*/
-
-/*
- * jsTree sort plugin
- * Sorts items alphabetically (or using any other function)
- */
-(function ($) {
- $.jstree.plugin("sort", {
- __init : function () {
- this.get_container()
- .bind("load_node.jstree", $.proxy(function (e, data) {
- var obj = this._get_node(data.rslt.obj);
- obj = obj === -1 ? this.get_container().children("ul") : obj.children("ul");
- this.sort(obj);
- }, this))
- .bind("rename_node.jstree create_node.jstree create.jstree", $.proxy(function (e, data) {
- this.sort(data.rslt.obj.parent());
- }, this))
- .bind("move_node.jstree", $.proxy(function (e, data) {
- var m = data.rslt.np == -1 ? this.get_container() : data.rslt.np;
- this.sort(m.children("ul"));
- }, this));
- },
- defaults : function (a, b) { return this.get_text(a) > this.get_text(b) ? 1 : -1; },
- _fn : {
- sort : function (obj) {
- var s = this._get_settings().sort,
- t = this;
- obj.append($.makeArray(obj.children("li")).sort($.proxy(s, t)));
- obj.find("> li > ul").each(function() { t.sort($(this)); });
- this.clean_node(obj);
- }
- }
- });
-})(jQuery);
-//*/
-
-/*
- * jsTree DND plugin
- * Drag and drop plugin for moving/copying nodes
- */
-(function ($) {
- var o = false,
- r = false,
- m = false,
- ml = false,
- sli = false,
- sti = false,
- dir1 = false,
- dir2 = false,
- last_pos = false;
- $.vakata.dnd = {
- is_down : false,
- is_drag : false,
- helper : false,
- scroll_spd : 10,
- init_x : 0,
- init_y : 0,
- threshold : 5,
- helper_left : 5,
- helper_top : 10,
- user_data : {},
-
- drag_start : function (e, data, html) {
- if($.vakata.dnd.is_drag) { $.vakata.drag_stop({}); }
- try {
- e.currentTarget.unselectable = "on";
- e.currentTarget.onselectstart = function() { return false; };
- if(e.currentTarget.style) { e.currentTarget.style.MozUserSelect = "none"; }
- } catch(err) { }
- $.vakata.dnd.init_x = e.pageX;
- $.vakata.dnd.init_y = e.pageY;
- $.vakata.dnd.user_data = data;
- $.vakata.dnd.is_down = true;
- $.vakata.dnd.helper = $("<div id='vakata-dragged' />").html(html); //.fadeTo(10,0.25);
- $(document).bind("mousemove", $.vakata.dnd.drag);
- $(document).bind("mouseup", $.vakata.dnd.drag_stop);
- return false;
- },
- drag : function (e) {
- if(!$.vakata.dnd.is_down) { return; }
- if(!$.vakata.dnd.is_drag) {
- if(Math.abs(e.pageX - $.vakata.dnd.init_x) > 5 || Math.abs(e.pageY - $.vakata.dnd.init_y) > 5) {
- $.vakata.dnd.helper.appendTo("body");
- $.vakata.dnd.is_drag = true;
- $(document).triggerHandler("drag_start.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
- }
- else { return; }
- }
-
- // maybe use a scrolling parent element instead of document?
- if(e.type === "mousemove") { // thought of adding scroll in order to move the helper, but mouse poisition is n/a
- var d = $(document), t = d.scrollTop(), l = d.scrollLeft();
- if(e.pageY - t < 20) {
- if(sti && dir1 === "down") { clearInterval(sti); sti = false; }
- if(!sti) { dir1 = "up"; sti = setInterval(function () { $(document).scrollTop($(document).scrollTop() - $.vakata.dnd.scroll_spd); }, 150); }
- }
- else {
- if(sti && dir1 === "up") { clearInterval(sti); sti = false; }
- }
- if($(window).height() - (e.pageY - t) < 20) {
- if(sti && dir1 === "up") { clearInterval(sti); sti = false; }
- if(!sti) { dir1 = "down"; sti = setInterval(function () { $(document).scrollTop($(document).scrollTop() + $.vakata.dnd.scroll_spd); }, 150); }
- }
- else {
- if(sti && dir1 === "down") { clearInterval(sti); sti = false; }
- }
-
- if(e.pageX - l < 20) {
- if(sli && dir2 === "right") { clearInterval(sli); sli = false; }
- if(!sli) { dir2 = "left"; sli = setInterval(function () { $(document).scrollLeft($(document).scrollLeft() - $.vakata.dnd.scroll_spd); }, 150); }
- }
- else {
- if(sli && dir2 === "left") { clearInterval(sli); sli = false; }
- }
- if($(window).width() - (e.pageX - l) < 20) {
- if(sli && dir2 === "left") { clearInterval(sli); sli = false; }
- if(!sli) { dir2 = "right"; sli = setInterval(function () { $(document).scrollLeft($(document).scrollLeft() + $.vakata.dnd.scroll_spd); }, 150); }
- }
- else {
- if(sli && dir2 === "right") { clearInterval(sli); sli = false; }
- }
- }
-
- $.vakata.dnd.helper.css({ left : (e.pageX + $.vakata.dnd.helper_left) + "px", top : (e.pageY + $.vakata.dnd.helper_top) + "px" });
- $(document).triggerHandler("drag.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
- },
- drag_stop : function (e) {
- if(sli) { clearInterval(sli); }
- if(sti) { clearInterval(sti); }
- $(document).unbind("mousemove", $.vakata.dnd.drag);
- $(document).unbind("mouseup", $.vakata.dnd.drag_stop);
- $(document).triggerHandler("drag_stop.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
- $.vakata.dnd.helper.remove();
- $.vakata.dnd.init_x = 0;
- $.vakata.dnd.init_y = 0;
- $.vakata.dnd.user_data = {};
- $.vakata.dnd.is_down = false;
- $.vakata.dnd.is_drag = false;
- }
- };
- $(function() {
- var css_string = '#vakata-dragged { display:block; margin:0 0 0 0; padding:4px 4px 4px 24px; position:absolute; top:-2000px; line-height:16px; z-index:10000; } ';
- $.vakata.css.add_sheet({ str : css_string, title : "vakata" });
- });
-
- $.jstree.plugin("dnd", {
- __init : function () {
- this.data.dnd = {
- active : false,
- after : false,
- inside : false,
- before : false,
- off : false,
- prepared : false,
- w : 0,
- to1 : false,
- to2 : false,
- cof : false,
- cw : false,
- ch : false,
- i1 : false,
- i2 : false,
- mto : false
- };
- this.get_container()
- .bind("mouseenter.jstree", $.proxy(function (e) {
- if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
- if(this.data.themes) {
- m.attr("class", "jstree-" + this.data.themes.theme);
- if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
- $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);
- }
- //if($(e.currentTarget).find("> ul > li").length === 0) {
- if(e.currentTarget === e.target && $.vakata.dnd.user_data.obj && $($.vakata.dnd.user_data.obj).length && $($.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0] !== e.target) { // node should not be from the same tree
- var tr = $.jstree._reference(e.target), dc;
- if(tr.data.dnd.foreign) {
- dc = tr._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : tr.get_container(), is_root : true });
- if(dc === true || dc.inside === true || dc.before === true || dc.after === true) {
- $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
- }
- }
- else {
- tr.prepare_move(o, tr.get_container(), "last");
- if(tr.check_move()) {
- $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
- }
- }
- }
- }
- }, this))
- .bind("mouseup.jstree", $.proxy(function (e) {
- //if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && $(e.currentTarget).find("> ul > li").length === 0) {
- if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && e.currentTarget === e.target && $.vakata.dnd.user_data.obj && $($.vakata.dnd.user_data.obj).length && $($.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0] !== e.target) { // node should not be from the same tree
- var tr = $.jstree._reference(e.currentTarget), dc;
- if(tr.data.dnd.foreign) {
- dc = tr._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : tr.get_container(), is_root : true });
- if(dc === true || dc.inside === true || dc.before === true || dc.after === true) {
- tr._get_settings().dnd.drag_finish.call(this, { "o" : o, "r" : tr.get_container(), is_root : true });
- }
- }
- else {
- tr.move_node(o, tr.get_container(), "last", e[tr._get_settings().dnd.copy_modifier + "Key"]);
- }
- }
- }, this))
- .bind("mouseleave.jstree", $.proxy(function (e) {
- if(e.relatedTarget && e.relatedTarget.id && e.relatedTarget.id === "jstree-marker-line") {
- return false;
- }
- if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
- if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
- if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
- if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }
- if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }
- if($.vakata.dnd.helper.children("ins").hasClass("jstree-ok")) {
- $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
- }
- }
- }, this))
- .bind("mousemove.jstree", $.proxy(function (e) {
- if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
- var cnt = this.get_container()[0];
-
- // Horizontal scroll
- if(e.pageX + 24 > this.data.dnd.cof.left + this.data.dnd.cw) {
- if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
- this.data.dnd.i1 = setInterval($.proxy(function () { this.scrollLeft += $.vakata.dnd.scroll_spd; }, cnt), 100);
- }
- else if(e.pageX - 24 < this.data.dnd.cof.left) {
- if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
- this.data.dnd.i1 = setInterval($.proxy(function () { this.scrollLeft -= $.vakata.dnd.scroll_spd; }, cnt), 100);
- }
- else {
- if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
- }
-
- // Vertical scroll
- if(e.pageY + 24 > this.data.dnd.cof.top + this.data.dnd.ch) {
- if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
- this.data.dnd.i2 = setInterval($.proxy(function () { this.scrollTop += $.vakata.dnd.scroll_spd; }, cnt), 100);
- }
- else if(e.pageY - 24 < this.data.dnd.cof.top) {
- if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
- this.data.dnd.i2 = setInterval($.proxy(function () { this.scrollTop -= $.vakata.dnd.scroll_spd; }, cnt), 100);
- }
- else {
- if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
- }
-
- }
- }, this))
- .bind("scroll.jstree", $.proxy(function (e) {
- if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && m && ml) {
- m.hide();
- ml.hide();
- }
- }, this))
- .delegate("a", "mousedown.jstree", $.proxy(function (e) {
- if(e.which === 1) {
- this.start_drag(e.currentTarget, e);
- return false;
- }
- }, this))
- .delegate("a", "mouseenter.jstree", $.proxy(function (e) {
- if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
- this.dnd_enter(e.currentTarget);
- }
- }, this))
- .delegate("a", "mousemove.jstree", $.proxy(function (e) {
- if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
- if(!r || !r.length || r.children("a")[0] !== e.currentTarget) {
- this.dnd_enter(e.currentTarget);
- }
- if(typeof this.data.dnd.off.top === "undefined") { this.data.dnd.off = $(e.target).offset(); }
- this.data.dnd.w = (e.pageY - (this.data.dnd.off.top || 0)) % this.data.core.li_height;
- if(this.data.dnd.w < 0) { this.data.dnd.w += this.data.core.li_height; }
- this.dnd_show();
- }
- }, this))
- .delegate("a", "mouseleave.jstree", $.proxy(function (e) {
- if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
- if(e.relatedTarget && e.relatedTarget.id && e.relatedTarget.id === "jstree-marker-line") {
- return false;
- }
- if(m) { m.hide(); }
- if(ml) { ml.hide(); }
- /*
- var ec = $(e.currentTarget).closest("li"),
- er = $(e.relatedTarget).closest("li");
- if(er[0] !== ec.prev()[0] && er[0] !== ec.next()[0]) {
- if(m) { m.hide(); }
- if(ml) { ml.hide(); }
- }
- */
- this.data.dnd.mto = setTimeout(
- (function (t) { return function () { t.dnd_leave(e); }; })(this),
- 0);
- }
- }, this))
- .delegate("a", "mouseup.jstree", $.proxy(function (e) {
- if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
- this.dnd_finish(e);
- }
- }, this));
-
- $(document)
- .bind("drag_stop.vakata", $.proxy(function () {
- if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }
- if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }
- if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
- if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
- this.data.dnd.after = false;
- this.data.dnd.before = false;
- this.data.dnd.inside = false;
- this.data.dnd.off = false;
- this.data.dnd.prepared = false;
- this.data.dnd.w = false;
- this.data.dnd.to1 = false;
- this.data.dnd.to2 = false;
- this.data.dnd.i1 = false;
- this.data.dnd.i2 = false;
- this.data.dnd.active = false;
- this.data.dnd.foreign = false;
- if(m) { m.css({ "top" : "-2000px" }); }
- if(ml) { ml.css({ "top" : "-2000px" }); }
- }, this))
- .bind("drag_start.vakata", $.proxy(function (e, data) {
- if(data.data.jstree) {
- var et = $(data.event.target);
- if(et.closest(".jstree").hasClass("jstree-" + this.get_index())) {
- this.dnd_enter(et);
- }
- }
- }, this));
- /*
- .bind("keydown.jstree-" + this.get_index() + " keyup.jstree-" + this.get_index(), $.proxy(function(e) {
- if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && !this.data.dnd.foreign) {
- var h = $.vakata.dnd.helper.children("ins");
- if(e[this._get_settings().dnd.copy_modifier + "Key"] && h.hasClass("jstree-ok")) {
- h.parent().html(h.parent().html().replace(/ \(Copy\)$/, "") + " (Copy)");
- }
- else {
- h.parent().html(h.parent().html().replace(/ \(Copy\)$/, ""));
- }
- }
- }, this)); */
-
-
-
- var s = this._get_settings().dnd;
- if(s.drag_target) {
- $(document)
- .delegate(s.drag_target, "mousedown.jstree-" + this.get_index(), $.proxy(function (e) {
- o = e.target;
- $.vakata.dnd.drag_start(e, { jstree : true, obj : e.target }, "<ins class='jstree-icon'></ins>" + $(e.target).text() );
- if(this.data.themes) {
- if(m) { m.attr("class", "jstree-" + this.data.themes.theme); }
- if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
- $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);
- }
- $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
- var cnt = this.get_container();
- this.data.dnd.cof = cnt.offset();
- this.data.dnd.cw = parseInt(cnt.width(),10);
- this.data.dnd.ch = parseInt(cnt.height(),10);
- this.data.dnd.foreign = true;
- e.preventDefault();
- }, this));
- }
- if(s.drop_target) {
- $(document)
- .delegate(s.drop_target, "mouseenter.jstree-" + this.get_index(), $.proxy(function (e) {
- if(this.data.dnd.active && this._get_settings().dnd.drop_check.call(this, { "o" : o, "r" : $(e.target), "e" : e })) {
- $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
- }
- }, this))
- .delegate(s.drop_target, "mouseleave.jstree-" + this.get_index(), $.proxy(function (e) {
- if(this.data.dnd.active) {
- $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
- }
- }, this))
- .delegate(s.drop_target, "mouseup.jstree-" + this.get_index(), $.proxy(function (e) {
- if(this.data.dnd.active && $.vakata.dnd.helper.children("ins").hasClass("jstree-ok")) {
- this._get_settings().dnd.drop_finish.call(this, { "o" : o, "r" : $(e.target), "e" : e });
- }
- }, this));
- }
- },
- defaults : {
- copy_modifier : "ctrl",
- check_timeout : 100,
- open_timeout : 500,
- drop_target : ".jstree-drop",
- drop_check : function (data) { return true; },
- drop_finish : $.noop,
- drag_target : ".jstree-draggable",
- drag_finish : $.noop,
- drag_check : function (data) { return { after : false, before : false, inside : true }; }
- },
- _fn : {
- dnd_prepare : function () {
- if(!r || !r.length) { return; }
- this.data.dnd.off = r.offset();
- if(this._get_settings().core.rtl) {
- this.data.dnd.off.right = this.data.dnd.off.left + r.width();
- }
- if(this.data.dnd.foreign) {
- var a = this._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : r });
- this.data.dnd.after = a.after;
- this.data.dnd.before = a.before;
- this.data.dnd.inside = a.inside;
- this.data.dnd.prepared = true;
- return this.dnd_show();
- }
- this.prepare_move(o, r, "before");
- this.data.dnd.before = this.check_move();
- this.prepare_move(o, r, "after");
- this.data.dnd.after = this.check_move();
- if(this._is_loaded(r)) {
- this.prepare_move(o, r, "inside");
- this.data.dnd.inside = this.check_move();
- }
- else {
- this.data.dnd.inside = false;
- }
- this.data.dnd.prepared = true;
- return this.dnd_show();
- },
- dnd_show : function () {
- if(!this.data.dnd.prepared) { return; }
- var o = ["before","inside","after"],
- r = false,
- rtl = this._get_settings().core.rtl,
- pos;
- if(this.data.dnd.w < this.data.core.li_height/3) { o = ["before","inside","after"]; }
- else if(this.data.dnd.w <= this.data.core.li_height*2/3) {
- o = this.data.dnd.w < this.data.core.li_height/2 ? ["inside","before","after"] : ["inside","after","before"];
- }
- else { o = ["after","inside","before"]; }
- $.each(o, $.proxy(function (i, val) {
- if(this.data.dnd[val]) {
- $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
- r = val;
- return false;
- }
- }, this));
- if(r === false) { $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid"); }
-
- pos = rtl ? (this.data.dnd.off.right - 18) : (this.data.dnd.off.left + 10);
- switch(r) {
- case "before":
- m.css({ "left" : pos + "px", "top" : (this.data.dnd.off.top - 6) + "px" }).show();
- if(ml) { ml.css({ "left" : (pos + 8) + "px", "top" : (this.data.dnd.off.top - 1) + "px" }).show(); }
- break;
- case "after":
- m.css({ "left" : pos + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height - 6) + "px" }).show();
- if(ml) { ml.css({ "left" : (pos + 8) + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height - 1) + "px" }).show(); }
- break;
- case "inside":
- m.css({ "left" : pos + ( rtl ? -4 : 4) + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height/2 - 5) + "px" }).show();
- if(ml) { ml.hide(); }
- break;
- default:
- m.hide();
- if(ml) { ml.hide(); }
- break;
- }
- last_pos = r;
- return r;
- },
- dnd_open : function () {
- this.data.dnd.to2 = false;
- this.open_node(r, $.proxy(this.dnd_prepare,this), true);
- },
- dnd_finish : function (e) {
- if(this.data.dnd.foreign) {
- if(this.data.dnd.after || this.data.dnd.before || this.data.dnd.inside) {
- this._get_settings().dnd.drag_finish.call(this, { "o" : o, "r" : r, "p" : last_pos });
- }
- }
- else {
- this.dnd_prepare();
- this.move_node(o, r, last_pos, e[this._get_settings().dnd.copy_modifier + "Key"]);
- }
- o = false;
- r = false;
- m.hide();
- if(ml) { ml.hide(); }
- },
- dnd_enter : function (obj) {
- if(this.data.dnd.mto) {
- clearTimeout(this.data.dnd.mto);
- this.data.dnd.mto = false;
- }
- var s = this._get_settings().dnd;
- this.data.dnd.prepared = false;
- r = this._get_node(obj);
- if(s.check_timeout) {
- // do the calculations after a minimal timeout (users tend to drag quickly to the desired location)
- if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }
- this.data.dnd.to1 = setTimeout($.proxy(this.dnd_prepare, this), s.check_timeout);
- }
- else {
- this.dnd_prepare();
- }
- if(s.open_timeout) {
- if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }
- if(r && r.length && r.hasClass("jstree-closed")) {
- // if the node is closed - open it, then recalculate
- this.data.dnd.to2 = setTimeout($.proxy(this.dnd_open, this), s.open_timeout);
- }
- }
- else {
- if(r && r.length && r.hasClass("jstree-closed")) {
- this.dnd_open();
- }
- }
- },
- dnd_leave : function (e) {
- this.data.dnd.after = false;
- this.data.dnd.before = false;
- this.data.dnd.inside = false;
- $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
- m.hide();
- if(ml) { ml.hide(); }
- if(r && r[0] === e.target.parentNode) {
- if(this.data.dnd.to1) {
- clearTimeout(this.data.dnd.to1);
- this.data.dnd.to1 = false;
- }
- if(this.data.dnd.to2) {
- clearTimeout(this.data.dnd.to2);
- this.data.dnd.to2 = false;
- }
- }
- },
- start_drag : function (obj, e) {
- o = this._get_node(obj);
- if(this.data.ui && this.is_selected(o)) { o = this._get_node(null, true); }
- var dt = o.length > 1 ? this._get_string("multiple_selection") : this.get_text(o),
- cnt = this.get_container();
- if(!this._get_settings().core.html_titles) { dt = dt.replace(/</ig,"<").replace(/>/ig,">"); }
- $.vakata.dnd.drag_start(e, { jstree : true, obj : o }, "<ins class='jstree-icon'></ins>" + dt );
- if(this.data.themes) {
- if(m) { m.attr("class", "jstree-" + this.data.themes.theme); }
- if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
- $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);
- }
- this.data.dnd.cof = cnt.offset();
- this.data.dnd.cw = parseInt(cnt.width(),10);
- this.data.dnd.ch = parseInt(cnt.height(),10);
- this.data.dnd.active = true;
- }
- }
- });
- $(function() {
- var css_string = '' +
- '#vakata-dragged ins { display:block; text-decoration:none; width:16px; height:16px; margin:0 0 0 0; padding:0; position:absolute; top:4px; left:4px; ' +
- ' -moz-border-radius:4px; border-radius:4px; -webkit-border-radius:4px; ' +
- '} ' +
- '#vakata-dragged .jstree-ok { background:green; } ' +
- '#vakata-dragged .jstree-invalid { background:red; } ' +
- '#jstree-marker { padding:0; margin:0; font-size:12px; overflow:hidden; height:12px; width:8px; position:absolute; top:-30px; z-index:10001; background-repeat:no-repeat; display:none; background-color:transparent; text-shadow:1px 1px 1px white; color:black; line-height:10px; } ' +
- '#jstree-marker-line { padding:0; margin:0; line-height:0%; font-size:1px; overflow:hidden; height:1px; width:100px; position:absolute; top:-30px; z-index:10000; background-repeat:no-repeat; display:none; background-color:#456c43; ' +
- ' cursor:pointer; border:1px solid #eeeeee; border-left:0; -moz-box-shadow: 0px 0px 2px #666; -webkit-box-shadow: 0px 0px 2px #666; box-shadow: 0px 0px 2px #666; ' +
- ' -moz-border-radius:1px; border-radius:1px; -webkit-border-radius:1px; ' +
- '}' +
- '';
- $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
- m = $("<div />").attr({ id : "jstree-marker" }).hide().html("»")
- .bind("mouseleave mouseenter", function (e) {
- m.hide();
- ml.hide();
- e.preventDefault();
- e.stopImmediatePropagation();
- return false;
- })
- .appendTo("body");
- ml = $("<div />").attr({ id : "jstree-marker-line" }).hide()
- .bind("mouseup", function (e) {
- if(r && r.length) {
- r.children("a").trigger(e);
- e.preventDefault();
- e.stopImmediatePropagation();
- return false;
- }
- })
- .bind("mouseleave", function (e) {
- var rt = $(e.relatedTarget);
- if(rt.is(".jstree") || rt.closest(".jstree").length === 0) {
- if(r && r.length) {
- r.children("a").trigger(e);
- m.hide();
- ml.hide();
- e.preventDefault();
- e.stopImmediatePropagation();
- return false;
- }
- }
- })
- .appendTo("body");
- $(document).bind("drag_start.vakata", function (e, data) {
- if(data.data.jstree) { m.show(); if(ml) { ml.show(); } }
- });
- $(document).bind("drag_stop.vakata", function (e, data) {
- if(data.data.jstree) { m.hide(); if(ml) { ml.hide(); } }
- });
- });
-})(jQuery);
-//*/
-
-/*
- * jsTree checkbox plugin
- * Inserts checkboxes in front of every node
- * Depends on the ui plugin
- * DOES NOT WORK NICELY WITH MULTITREE DRAG'N'DROP
- */
-(function ($) {
- $.jstree.plugin("checkbox", {
- __init : function () {
- this.data.checkbox.noui = this._get_settings().checkbox.override_ui;
- if(this.data.ui && this.data.checkbox.noui) {
- this.select_node = this.deselect_node = this.deselect_all = $.noop;
- this.get_selected = this.get_checked;
- }
-
- this.get_container()
- .bind("open_node.jstree create_node.jstree clean_node.jstree refresh.jstree", $.proxy(function (e, data) {
- this._prepare_checkboxes(data.rslt.obj);
- }, this))
- .bind("loaded.jstree", $.proxy(function (e) {
- this._prepare_checkboxes();
- }, this))
- .delegate( (this.data.ui && this.data.checkbox.noui ? "a" : "ins.jstree-checkbox") , "click.jstree", $.proxy(function (e) {
- e.preventDefault();
- if(this._get_node(e.target).hasClass("jstree-checked")) { this.uncheck_node(e.target); }
- else { this.check_node(e.target); }
- if(this.data.ui && this.data.checkbox.noui) {
- this.save_selected();
- if(this.data.cookies) { this.save_cookie("select_node"); }
- }
- else {
- e.stopImmediatePropagation();
- return false;
- }
- }, this));
- },
- defaults : {
- override_ui : false,
- two_state : false,
- real_checkboxes : false,
- checked_parent_open : true,
- real_checkboxes_names : function (n) { return [ ("check_" + (n[0].id || Math.ceil(Math.random() * 10000))) , 1]; }
- },
- __destroy : function () {
- this.get_container()
- .find("input.jstree-real-checkbox").removeClass("jstree-real-checkbox").end()
- .find("ins.jstree-checkbox").remove();
- },
- _fn : {
- _checkbox_notify : function (n, data) {
- if(data.checked) {
- this.check_node(n, false);
- }
- },
- _prepare_checkboxes : function (obj) {
- obj = !obj || obj == -1 ? this.get_container().find("> ul > li") : this._get_node(obj);
- if(obj === false) { return; } // added for removing root nodes
- var c, _this = this, t, ts = this._get_settings().checkbox.two_state, rc = this._get_settings().checkbox.real_checkboxes, rcn = this._get_settings().checkbox.real_checkboxes_names;
- obj.each(function () {
- t = $(this);
- c = t.is("li") && (t.hasClass("jstree-checked") || (rc && t.children(":checked").length)) ? "jstree-checked" : "jstree-unchecked";
- t.find("li").andSelf().each(function () {
- var $t = $(this), nm;
- $t.children("a" + (_this.data.languages ? "" : ":eq(0)") ).not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'> </ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass( ts ? "jstree-unchecked" : c );
- if(rc) {
- if(!$t.children(":checkbox").length) {
- nm = rcn.call(_this, $t);
- $t.prepend("<input type='checkbox' class='jstree-real-checkbox' id='" + nm[0] + "' name='" + nm[0] + "' value='" + nm[1] + "' />");
- }
- else {
- $t.children(":checkbox").addClass("jstree-real-checkbox");
- }
- }
- if(!ts) {
- if(c === "jstree-checked" || $t.hasClass("jstree-checked") || $t.children(':checked').length) {
- $t.find("li").andSelf().addClass("jstree-checked").children(":checkbox").prop("checked", true);
- }
- }
- else {
- if($t.hasClass("jstree-checked") || $t.children(':checked').length) {
- $t.addClass("jstree-checked").children(":checkbox").prop("checked", true);
- }
- }
- });
- });
- if(!ts) {
- obj.find(".jstree-checked").parent().parent().each(function () { _this._repair_state(this); });
- }
- },
- change_state : function (obj, state) {
- obj = this._get_node(obj);
- var coll = false, rc = this._get_settings().checkbox.real_checkboxes;
- if(!obj || obj === -1) { return false; }
- state = (state === false || state === true) ? state : obj.hasClass("jstree-checked");
- if(this._get_settings().checkbox.two_state) {
- if(state) {
- obj.removeClass("jstree-checked").addClass("jstree-unchecked");
- if(rc) { obj.children(":checkbox").prop("checked", false); }
- }
- else {
- obj.removeClass("jstree-unchecked").addClass("jstree-checked");
- if(rc) { obj.children(":checkbox").prop("checked", true); }
- }
- }
- else {
- if(state) {
- coll = obj.find("li").andSelf();
- if(!coll.filter(".jstree-checked, .jstree-undetermined").length) { return false; }
- coll.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
- if(rc) { coll.children(":checkbox").prop("checked", false); }
- }
- else {
- coll = obj.find("li").andSelf();
- if(!coll.filter(".jstree-unchecked, .jstree-undetermined").length) { return false; }
- coll.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
- if(rc) { coll.children(":checkbox").prop("checked", true); }
- if(this.data.ui) { this.data.ui.last_selected = obj; }
- this.data.checkbox.last_selected = obj;
- }
- obj.parentsUntil(".jstree", "li").each(function () {
- var $this = $(this);
- if(state) {
- if($this.children("ul").children("li.jstree-checked, li.jstree-undetermined").length) {
- $this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
- if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); }
- return false;
- }
- else {
- $this.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
- if(rc) { $this.children(":checkbox").prop("checked", false); }
- }
- }
- else {
- if($this.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length) {
- $this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
- if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); }
- return false;
- }
- else {
- $this.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
- if(rc) { $this.children(":checkbox").prop("checked", true); }
- }
- }
- });
- }
- if(this.data.ui && this.data.checkbox.noui) { this.data.ui.selected = this.get_checked(); }
- this.__callback(obj);
- return true;
- },
- check_node : function (obj) {
- if(this.change_state(obj, false)) {
- obj = this._get_node(obj);
- if(this._get_settings().checkbox.checked_parent_open) {
- var t = this;
- obj.parents(".jstree-closed").each(function () { t.open_node(this, false, true); });
- }
- this.__callback({ "obj" : obj });
- }
- },
- uncheck_node : function (obj) {
- if(this.change_state(obj, true)) { this.__callback({ "obj" : this._get_node(obj) }); }
- },
- check_all : function () {
- var _this = this,
- coll = this._get_settings().checkbox.two_state ? this.get_container_ul().find("li") : this.get_container_ul().children("li");
- coll.each(function () {
- _this.change_state(this, false);
- });
- this.__callback();
- },
- uncheck_all : function () {
- var _this = this,
- coll = this._get_settings().checkbox.two_state ? this.get_container_ul().find("li") : this.get_container_ul().children("li");
- coll.each(function () {
- _this.change_state(this, true);
- });
- this.__callback();
- },
-
- is_checked : function(obj) {
- obj = this._get_node(obj);
- return obj.length ? obj.is(".jstree-checked") : false;
- },
- get_checked : function (obj, get_all) {
- obj = !obj || obj === -1 ? this.get_container() : this._get_node(obj);
- return get_all || this._get_settings().checkbox.two_state ? obj.find(".jstree-checked") : obj.find("> ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked");
- },
- get_unchecked : function (obj, get_all) {
- obj = !obj || obj === -1 ? this.get_container() : this._get_node(obj);
- return get_all || this._get_settings().checkbox.two_state ? obj.find(".jstree-unchecked") : obj.find("> ul > .jstree-unchecked, .jstree-undetermined > ul > .jstree-unchecked");
- },
-
- show_checkboxes : function () { this.get_container().children("ul").removeClass("jstree-no-checkboxes"); },
- hide_checkboxes : function () { this.get_container().children("ul").addClass("jstree-no-checkboxes"); },
-
- _repair_state : function (obj) {
- obj = this._get_node(obj);
- if(!obj.length) { return; }
- if(this._get_settings().checkbox.two_state) {
- obj.find('li').andSelf().not('.jstree-checked').removeClass('jstree-undetermined').addClass('jstree-unchecked').children(':checkbox').prop('checked', true);
- return;
- }
- var rc = this._get_settings().checkbox.real_checkboxes,
- a = obj.find("> ul > .jstree-checked").length,
- b = obj.find("> ul > .jstree-undetermined").length,
- c = obj.find("> ul > li").length;
- if(c === 0) { if(obj.hasClass("jstree-undetermined")) { this.change_state(obj, false); } }
- else if(a === 0 && b === 0) { this.change_state(obj, true); }
- else if(a === c) { this.change_state(obj, false); }
- else {
- obj.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
- if(rc) { obj.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); }
- }
- },
- reselect : function () {
- if(this.data.ui && this.data.checkbox.noui) {
- var _this = this,
- s = this.data.ui.to_select;
- s = $.map($.makeArray(s), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
- this.deselect_all();
- $.each(s, function (i, val) { _this.check_node(val); });
- this.__callback();
- }
- else {
- this.__call_old();
- }
- },
- save_loaded : function () {
- var _this = this;
- this.data.core.to_load = [];
- this.get_container_ul().find("li.jstree-closed.jstree-undetermined").each(function () {
- if(this.id) { _this.data.core.to_load.push("#" + this.id); }
- });
- }
- }
- });
- $(function() {
- var css_string = '.jstree .jstree-real-checkbox { display:none; } ';
- $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
- });
-})(jQuery);
-//*/
-
-/*
- * jsTree XML plugin
- * The XML data store. Datastores are build by overriding the `load_node` and `_is_loaded` functions.
- */
-(function ($) {
- $.vakata.xslt = function (xml, xsl, callback) {
- var r = false, p, q, s;
- // IE9
- if(r === false && window.ActiveXObject) {
- try {
- r = new ActiveXObject("Msxml2.XSLTemplate");
- q = new ActiveXObject("Msxml2.DOMDocument");
- q.loadXML(xml);
- s = new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
- s.loadXML(xsl);
- r.stylesheet = s;
- p = r.createProcessor();
- p.input = q;
- p.transform();
- r = p.output;
- }
- catch (e) { }
- }
- xml = $.parseXML(xml);
- xsl = $.parseXML(xsl);
- // FF, Chrome
- if(r === false && typeof (XSLTProcessor) !== "undefined") {
- p = new XSLTProcessor();
- p.importStylesheet(xsl);
- r = p.transformToFragment(xml, document);
- r = $('<div />').append(r).html();
- }
- // OLD IE
- if(r === false && typeof (xml.transformNode) !== "undefined") {
- r = xml.transformNode(xsl);
- }
- callback.call(null, r);
- };
- var xsl = {
- 'nest' : '<' + '?xml version="1.0" encoding="utf-8" ?>' +
- '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >' +
- '<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/html" />' +
- '<xsl:template match="/">' +
- ' <xsl:call-template name="nodes">' +
- ' <xsl:with-param name="node" select="/root" />' +
- ' </xsl:call-template>' +
- '</xsl:template>' +
- '<xsl:template name="nodes">' +
- ' <xsl:param name="node" />' +
- ' <ul>' +
- ' <xsl:for-each select="$node/item">' +
- ' <xsl:variable name="children" select="count(./item) > 0" />' +
- ' <li>' +
- ' <xsl:attribute name="class">' +
- ' <xsl:if test="position() = last()">jstree-last </xsl:if>' +
- ' <xsl:choose>' +
- ' <xsl:when test="@state = \'open\'">jstree-open </xsl:when>' +
- ' <xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>' +
- ' <xsl:otherwise>jstree-leaf </xsl:otherwise>' +
- ' </xsl:choose>' +
- ' <xsl:value-of select="@class" />' +
- ' </xsl:attribute>' +
- ' <xsl:for-each select="@*">' +
- ' <xsl:if test="name() != \'class\' and name() != \'state\' and name() != \'hasChildren\'">' +
- ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
- ' </xsl:if>' +
- ' </xsl:for-each>' +
- ' <ins class="jstree-icon"><xsl:text> </xsl:text></ins>' +
- ' <xsl:for-each select="content/name">' +
- ' <a>' +
- ' <xsl:attribute name="href">' +
- ' <xsl:choose>' +
- ' <xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>' +
- ' <xsl:otherwise>#</xsl:otherwise>' +
- ' </xsl:choose>' +
- ' </xsl:attribute>' +
- ' <xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>' +
- ' <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>' +
- ' <xsl:for-each select="@*">' +
- ' <xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">' +
- ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
- ' </xsl:if>' +
- ' </xsl:for-each>' +
- ' <ins>' +
- ' <xsl:attribute name="class">jstree-icon ' +
- ' <xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>' +
- ' </xsl:attribute>' +
- ' <xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>' +
- ' <xsl:text> </xsl:text>' +
- ' </ins>' +
- ' <xsl:copy-of select="./child::node()" />' +
- ' </a>' +
- ' </xsl:for-each>' +
- ' <xsl:if test="$children or @hasChildren"><xsl:call-template name="nodes"><xsl:with-param name="node" select="current()" /></xsl:call-template></xsl:if>' +
- ' </li>' +
- ' </xsl:for-each>' +
- ' </ul>' +
- '</xsl:template>' +
- '</xsl:stylesheet>',
-
- 'flat' : '<' + '?xml version="1.0" encoding="utf-8" ?>' +
- '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >' +
- '<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/xml" />' +
- '<xsl:template match="/">' +
- ' <ul>' +
- ' <xsl:for-each select="//item[not(@parent_id) or @parent_id=0 or not(@parent_id = //item/@id)]">' + /* the last `or` may be removed */
- ' <xsl:call-template name="nodes">' +
- ' <xsl:with-param name="node" select="." />' +
- ' <xsl:with-param name="is_last" select="number(position() = last())" />' +
- ' </xsl:call-template>' +
- ' </xsl:for-each>' +
- ' </ul>' +
- '</xsl:template>' +
- '<xsl:template name="nodes">' +
- ' <xsl:param name="node" />' +
- ' <xsl:param name="is_last" />' +
- ' <xsl:variable name="children" select="count(//item[@parent_id=$node/attribute::id]) > 0" />' +
- ' <li>' +
- ' <xsl:attribute name="class">' +
- ' <xsl:if test="$is_last = true()">jstree-last </xsl:if>' +
- ' <xsl:choose>' +
- ' <xsl:when test="@state = \'open\'">jstree-open </xsl:when>' +
- ' <xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>' +
- ' <xsl:otherwise>jstree-leaf </xsl:otherwise>' +
- ' </xsl:choose>' +
- ' <xsl:value-of select="@class" />' +
- ' </xsl:attribute>' +
- ' <xsl:for-each select="@*">' +
- ' <xsl:if test="name() != \'parent_id\' and name() != \'hasChildren\' and name() != \'class\' and name() != \'state\'">' +
- ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
- ' </xsl:if>' +
- ' </xsl:for-each>' +
- ' <ins class="jstree-icon"><xsl:text> </xsl:text></ins>' +
- ' <xsl:for-each select="content/name">' +
- ' <a>' +
- ' <xsl:attribute name="href">' +
- ' <xsl:choose>' +
- ' <xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>' +
- ' <xsl:otherwise>#</xsl:otherwise>' +
- ' </xsl:choose>' +
- ' </xsl:attribute>' +
- ' <xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>' +
- ' <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>' +
- ' <xsl:for-each select="@*">' +
- ' <xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">' +
- ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
- ' </xsl:if>' +
- ' </xsl:for-each>' +
- ' <ins>' +
- ' <xsl:attribute name="class">jstree-icon ' +
- ' <xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>' +
- ' </xsl:attribute>' +
- ' <xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>' +
- ' <xsl:text> </xsl:text>' +
- ' </ins>' +
- ' <xsl:copy-of select="./child::node()" />' +
- ' </a>' +
- ' </xsl:for-each>' +
- ' <xsl:if test="$children">' +
- ' <ul>' +
- ' <xsl:for-each select="//item[@parent_id=$node/attribute::id]">' +
- ' <xsl:call-template name="nodes">' +
- ' <xsl:with-param name="node" select="." />' +
- ' <xsl:with-param name="is_last" select="number(position() = last())" />' +
- ' </xsl:call-template>' +
- ' </xsl:for-each>' +
- ' </ul>' +
- ' </xsl:if>' +
- ' </li>' +
- '</xsl:template>' +
- '</xsl:stylesheet>'
- },
- escape_xml = function(string) {
- return string
- .toString()
- .replace(/&/g, '&')
- .replace(/</g, '<')
- .replace(/>/g, '>')
- .replace(/"/g, '"')
- .replace(/'/g, ''');
- };
- $.jstree.plugin("xml_data", {
- defaults : {
- data : false,
- ajax : false,
- xsl : "flat",
- clean_node : false,
- correct_state : true,
- get_skip_empty : false,
- get_include_preamble : true
- },
- _fn : {
- load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_xml(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); },
- _is_loaded : function (obj) {
- var s = this._get_settings().xml_data;
- obj = this._get_node(obj);
- return obj == -1 || !obj || (!s.ajax && !$.isFunction(s.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").size() > 0;
- },
- load_node_xml : function (obj, s_call, e_call) {
- var s = this.get_settings().xml_data,
- error_func = function () {},
- success_func = function () {};
-
- obj = this._get_node(obj);
- if(obj && obj !== -1) {
- if(obj.data("jstree_is_loading")) { return; }
- else { obj.data("jstree_is_loading",true); }
- }
- switch(!0) {
- case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
- case ($.isFunction(s.data)):
- s.data.call(this, obj, $.proxy(function (d) {
- this.parse_xml(d, $.proxy(function (d) {
- if(d) {
- d = d.replace(/ ?xmlns="[^"]*"/ig, "");
- if(d.length > 10) {
- d = $(d);
- if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
- else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree_is_loading"); }
- if(s.clean_node) { this.clean_node(obj); }
- if(s_call) { s_call.call(this); }
- }
- else {
- if(obj && obj !== -1) {
- obj.children("a.jstree-loading").removeClass("jstree-loading");
- obj.removeData("jstree_is_loading");
- if(s.correct_state) {
- this.correct_state(obj);
- if(s_call) { s_call.call(this); }
- }
- }
- else {
- if(s.correct_state) {
- this.get_container().children("ul").empty();
- if(s_call) { s_call.call(this); }
- }
- }
- }
- }
- }, this));
- }, this));
- break;
- case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
- if(!obj || obj == -1) {
- this.parse_xml(s.data, $.proxy(function (d) {
- if(d) {
- d = d.replace(/ ?xmlns="[^"]*"/ig, "");
- if(d.length > 10) {
- d = $(d);
- this.get_container().children("ul").empty().append(d.children());
- if(s.clean_node) { this.clean_node(obj); }
- if(s_call) { s_call.call(this); }
- }
- }
- else {
- if(s.correct_state) {
- this.get_container().children("ul").empty();
- if(s_call) { s_call.call(this); }
- }
- }
- }, this));
- }
- break;
- case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
- error_func = function (x, t, e) {
- var ef = this.get_settings().xml_data.ajax.error;
- if(ef) { ef.call(this, x, t, e); }
- if(obj !== -1 && obj.length) {
- obj.children("a.jstree-loading").removeClass("jstree-loading");
- obj.removeData("jstree_is_loading");
- if(t === "success" && s.correct_state) { this.correct_state(obj); }
- }
- else {
- if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
- }
- if(e_call) { e_call.call(this); }
- };
- success_func = function (d, t, x) {
- d = x.responseText;
- var sf = this.get_settings().xml_data.ajax.success;
- if(sf) { d = sf.call(this,d,t,x) || d; }
- if(d === "" || (d && d.toString && d.toString().replace(/^[\s\n]+$/,"") === "")) {
- return error_func.call(this, x, t, "");
- }
- this.parse_xml(d, $.proxy(function (d) {
- if(d) {
- d = d.replace(/ ?xmlns="[^"]*"/ig, "");
- if(d.length > 10) {
- d = $(d);
- if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
- else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree_is_loading"); }
- if(s.clean_node) { this.clean_node(obj); }
- if(s_call) { s_call.call(this); }
- }
- else {
- if(obj && obj !== -1) {
- obj.children("a.jstree-loading").removeClass("jstree-loading");
- obj.removeData("jstree_is_loading");
- if(s.correct_state) {
- this.correct_state(obj);
- if(s_call) { s_call.call(this); }
- }
- }
- else {
- if(s.correct_state) {
- this.get_container().children("ul").empty();
- if(s_call) { s_call.call(this); }
- }
- }
- }
- }
- }, this));
- };
- s.ajax.context = this;
- s.ajax.error = error_func;
- s.ajax.success = success_func;
- if(!s.ajax.dataType) { s.ajax.dataType = "xml"; }
- if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
- if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
- $.ajax(s.ajax);
- break;
- }
- },
- parse_xml : function (xml, callback) {
- var s = this._get_settings().xml_data;
- $.vakata.xslt(xml, xsl[s.xsl], callback);
- },
- get_xml : function (tp, obj, li_attr, a_attr, is_callback) {
- var result = "",
- s = this._get_settings(),
- _this = this,
- tmp1, tmp2, li, a, lang;
- if(!tp) { tp = "flat"; }
- if(!is_callback) { is_callback = 0; }
- obj = this._get_node(obj);
- if(!obj || obj === -1) { obj = this.get_container().find("> ul > li"); }
- li_attr = $.isArray(li_attr) ? li_attr : [ "id", "class" ];
- if(!is_callback && this.data.types && $.inArray(s.types.type_attr, li_attr) === -1) { li_attr.push(s.types.type_attr); }
-
- a_attr = $.isArray(a_attr) ? a_attr : [ ];
-
- if(!is_callback) {
- if(s.xml_data.get_include_preamble) {
- result += '<' + '?xml version="1.0" encoding="UTF-8"?' + '>';
- }
- result += "<root>";
- }
- obj.each(function () {
- result += "<item";
- li = $(this);
- $.each(li_attr, function (i, v) {
- var t = li.attr(v);
- if(!s.xml_data.get_skip_empty || typeof t !== "undefined") {
- result += " " + v + "=\"" + escape_xml((" " + (t || "")).replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")) + "\"";
- }
- });
- if(li.hasClass("jstree-open")) { result += " state=\"open\""; }
- if(li.hasClass("jstree-closed")) { result += " state=\"closed\""; }
- if(tp === "flat") { result += " parent_id=\"" + escape_xml(is_callback) + "\""; }
- result += ">";
- result += "<content>";
- a = li.children("a");
- a.each(function () {
- tmp1 = $(this);
- lang = false;
- result += "<name";
- if($.inArray("languages", s.plugins) !== -1) {
- $.each(s.languages, function (k, z) {
- if(tmp1.hasClass(z)) { result += " lang=\"" + escape_xml(z) + "\""; lang = z; return false; }
- });
- }
- if(a_attr.length) {
- $.each(a_attr, function (k, z) {
- var t = tmp1.attr(z);
- if(!s.xml_data.get_skip_empty || typeof t !== "undefined") {
- result += " " + z + "=\"" + escape_xml((" " + t || "").replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")) + "\"";
- }
- });
- }
- if(tmp1.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/^\s+$/ig,"").length) {
- result += ' icon="' + escape_xml(tmp1.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")) + '"';
- }
- if(tmp1.children("ins").get(0).style.backgroundImage.length) {
- result += ' icon="' + escape_xml(tmp1.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","").replace(/'/ig,"").replace(/"/ig,"")) + '"';
- }
- result += ">";
- result += "<![CDATA[" + _this.get_text(tmp1, lang) + "]]>";
- result += "</name>";
- });
- result += "</content>";
- tmp2 = li[0].id || true;
- li = li.find("> ul > li");
- if(li.length) { tmp2 = _this.get_xml(tp, li, li_attr, a_attr, tmp2); }
- else { tmp2 = ""; }
- if(tp == "nest") { result += tmp2; }
- result += "</item>";
- if(tp == "flat") { result += tmp2; }
- });
- if(!is_callback) { result += "</root>"; }
- return result;
- }
- }
- });
-})(jQuery);
-//*/
-
-/*
- * jsTree search plugin
- * Enables both sync and async search on the tree
- * DOES NOT WORK WITH JSON PROGRESSIVE RENDER
- */
-(function ($) {
- if($().jquery.split('.')[1] >= 8) {
- $.expr[':'].jstree_contains = $.expr.createPseudo(function(search) {
- return function(a) {
- return (a.textContent || a.innerText || "").toLowerCase().indexOf(search.toLowerCase())>=0;
- };
- });
- $.expr[':'].jstree_title_contains = $.expr.createPseudo(function(search) {
- return function(a) {
- return (a.getAttribute("title") || "").toLowerCase().indexOf(search.toLowerCase())>=0;
- };
- });
- }
- else {
- $.expr[':'].jstree_contains = function(a,i,m){
- return (a.textContent || a.innerText || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
- };
- $.expr[':'].jstree_title_contains = function(a,i,m) {
- return (a.getAttribute("title") || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
- };
- }
- $.jstree.plugin("search", {
- __init : function () {
- this.data.search.str = "";
- this.data.search.result = $();
- if(this._get_settings().search.show_only_matches) {
- this.get_container()
- .bind("search.jstree", function (e, data) {
- $(this).children("ul").find("li").hide().removeClass("jstree-last");
- data.rslt.nodes.parentsUntil(".jstree").andSelf().show()
- .filter("ul").each(function () { $(this).children("li:visible").eq(-1).addClass("jstree-last"); });
- })
- .bind("clear_search.jstree", function () {
- $(this).children("ul").find("li").css("display","").end().end().jstree("clean_node", -1);
- });
- }
- },
- defaults : {
- ajax : false,
- search_method : "jstree_contains", // for case insensitive - jstree_contains
- show_only_matches : false
- },
- _fn : {
- search : function (str, skip_async) {
- if($.trim(str) === "") { this.clear_search(); return; }
- var s = this.get_settings().search,
- t = this,
- error_func = function () { },
- success_func = function () { };
- this.data.search.str = str;
-
- if(!skip_async && s.ajax !== false && this.get_container_ul().find("li.jstree-closed:not(:has(ul)):eq(0)").length > 0) {
- this.search.supress_callback = true;
- error_func = function () { };
- success_func = function (d, t, x) {
- var sf = this.get_settings().search.ajax.success;
- if(sf) { d = sf.call(this,d,t,x) || d; }
- this.data.search.to_open = d;
- this._search_open();
- };
- s.ajax.context = this;
- s.ajax.error = error_func;
- s.ajax.success = success_func;
- if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, str); }
- if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, str); }
- if(!s.ajax.data) { s.ajax.data = { "search_string" : str }; }
- if(!s.ajax.dataType || /^json/.exec(s.ajax.dataType)) { s.ajax.dataType = "json"; }
- $.ajax(s.ajax);
- return;
- }
- if(this.data.search.result.length) { this.clear_search(); }
- this.data.search.result = this.get_container().find("a" + (this.data.languages ? "." + this.get_lang() : "" ) + ":" + (s.search_method) + "(" + this.data.search.str + ")");
- this.data.search.result.addClass("jstree-search").parent().parents(".jstree-closed").each(function () {
- t.open_node(this, false, true);
- });
- this.__callback({ nodes : this.data.search.result, str : str });
- },
- clear_search : function (str) {
- this.data.search.result.removeClass("jstree-search");
- this.__callback(this.data.search.result);
- this.data.search.result = $();
- },
- _search_open : function (is_callback) {
- var _this = this,
- done = true,
- current = [],
- remaining = [];
- if(this.data.search.to_open.length) {
- $.each(this.data.search.to_open, function (i, val) {
- if(val == "#") { return true; }
- if($(val).length && $(val).is(".jstree-closed")) { current.push(val); }
- else { remaining.push(val); }
- });
- if(current.length) {
- this.data.search.to_open = remaining;
- $.each(current, function (i, val) {
- _this.open_node(val, function () { _this._search_open(true); });
- });
- done = false;
- }
- }
- if(done) { this.search(this.data.search.str, true); }
- }
- }
- });
-})(jQuery);
-//*/
-
-/*
- * jsTree contextmenu plugin
- */
-(function ($) {
- $.vakata.context = {
- hide_on_mouseleave : false,
-
- cnt : $("<div id='vakata-contextmenu' />"),
- vis : false,
- tgt : false,
- par : false,
- func : false,
- data : false,
- rtl : false,
- show : function (s, t, x, y, d, p, rtl) {
- $.vakata.context.rtl = !!rtl;
- var html = $.vakata.context.parse(s), h, w;
- if(!html) { return; }
- $.vakata.context.vis = true;
- $.vakata.context.tgt = t;
- $.vakata.context.par = p || t || null;
- $.vakata.context.data = d || null;
- $.vakata.context.cnt
- .html(html)
- .css({ "visibility" : "hidden", "display" : "block", "left" : 0, "top" : 0 });
-
- if($.vakata.context.hide_on_mouseleave) {
- $.vakata.context.cnt
- .one("mouseleave", function(e) { $.vakata.context.hide(); });
- }
-
- h = $.vakata.context.cnt.height();
- w = $.vakata.context.cnt.width();
- if(x + w > $(document).width()) {
- x = $(document).width() - (w + 5);
- $.vakata.context.cnt.find("li > ul").addClass("right");
- }
- if(y + h > $(document).height()) {
- y = y - (h + t[0].offsetHeight);
- $.vakata.context.cnt.find("li > ul").addClass("bottom");
- }
-
- $.vakata.context.cnt
- .css({ "left" : x, "top" : y })
- .find("li:has(ul)")
- .bind("mouseenter", function (e) {
- var w = $(document).width(),
- h = $(document).height(),
- ul = $(this).children("ul").show();
- if(w !== $(document).width()) { ul.toggleClass("right"); }
- if(h !== $(document).height()) { ul.toggleClass("bottom"); }
- })
- .bind("mouseleave", function (e) {
- $(this).children("ul").hide();
- })
- .end()
- .css({ "visibility" : "visible" })
- .show();
- $(document).triggerHandler("context_show.vakata");
- },
- hide : function () {
- $.vakata.context.vis = false;
- $.vakata.context.cnt.attr("class","").css({ "visibility" : "hidden" });
- $(document).triggerHandler("context_hide.vakata");
- },
- parse : function (s, is_callback) {
- if(!s) { return false; }
- var str = "",
- tmp = false,
- was_sep = true;
- if(!is_callback) { $.vakata.context.func = {}; }
- str += "<ul>";
- $.each(s, function (i, val) {
- if(!val) { return true; }
- $.vakata.context.func[i] = val.action;
- if(!was_sep && val.separator_before) {
- str += "<li class='vakata-separator vakata-separator-before'></li>";
- }
- was_sep = false;
- str += "<li class='" + (val._class || "") + (val._disabled ? " jstree-contextmenu-disabled " : "") + "'><ins ";
- if(val.icon && val.icon.indexOf("/") === -1) { str += " class='" + val.icon + "' "; }
- if(val.icon && val.icon.indexOf("/") !== -1) { str += " style='background:url(" + val.icon + ") center center no-repeat;' "; }
- str += "> </ins><a href='#' rel='" + i + "'>";
- if(val.submenu) {
- str += "<span style='float:" + ($.vakata.context.rtl ? "left" : "right") + ";'>»</span>";
- }
- str += val.label + "</a>";
- if(val.submenu) {
- tmp = $.vakata.context.parse(val.submenu, true);
- if(tmp) { str += tmp; }
- }
- str += "</li>";
- if(val.separator_after) {
- str += "<li class='vakata-separator vakata-separator-after'></li>";
- was_sep = true;
- }
- });
- str = str.replace(/<li class\='vakata-separator vakata-separator-after'\><\/li\>$/,"");
- str += "</ul>";
- $(document).triggerHandler("context_parse.vakata");
- return str.length > 10 ? str : false;
- },
- exec : function (i) {
- if($.isFunction($.vakata.context.func[i])) {
- // if is string - eval and call it!
- $.vakata.context.func[i].call($.vakata.context.data, $.vakata.context.par);
- return true;
- }
- else { return false; }
- }
- };
- $(function () {
- var css_string = '' +
- '#vakata-contextmenu { display:block; visibility:hidden; left:0; top:-200px; position:absolute; margin:0; padding:0; min-width:180px; background:#ebebeb; border:1px solid silver; z-index:10000; *width:180px; } ' +
- '#vakata-contextmenu ul { min-width:180px; *width:180px; } ' +
- '#vakata-contextmenu ul, #vakata-contextmenu li { margin:0; padding:0; list-style-type:none; display:block; } ' +
- '#vakata-contextmenu li { line-height:20px; min-height:20px; position:relative; padding:0px; } ' +
- '#vakata-contextmenu li a { padding:1px 6px; line-height:17px; display:block; text-decoration:none; margin:1px 1px 0 1px; } ' +
- '#vakata-contextmenu li ins { float:left; width:16px; height:16px; text-decoration:none; margin-right:2px; } ' +
- '#vakata-contextmenu li a:hover, #vakata-contextmenu li.vakata-hover > a { background:gray; color:white; } ' +
- '#vakata-contextmenu li ul { display:none; position:absolute; top:-2px; left:100%; background:#ebebeb; border:1px solid gray; } ' +
- '#vakata-contextmenu .right { right:100%; left:auto; } ' +
- '#vakata-contextmenu .bottom { bottom:-1px; top:auto; } ' +
- '#vakata-contextmenu li.vakata-separator { min-height:0; height:1px; line-height:1px; font-size:1px; overflow:hidden; margin:0 2px; background:silver; /* border-top:1px solid #fefefe; */ padding:0; } ';
- $.vakata.css.add_sheet({ str : css_string, title : "vakata" });
- $.vakata.context.cnt
- .delegate("a","click", function (e) { e.preventDefault(); })
- .delegate("a","mouseup", function (e) {
- if(!$(this).parent().hasClass("jstree-contextmenu-disabled") && $.vakata.context.exec($(this).attr("rel"))) {
- $.vakata.context.hide();
- }
- else { $(this).blur(); }
- })
- .delegate("a","mouseover", function () {
- $.vakata.context.cnt.find(".vakata-hover").removeClass("vakata-hover");
- })
- .appendTo("body");
- $(document).bind("mousedown", function (e) { if($.vakata.context.vis && !$.contains($.vakata.context.cnt[0], e.target)) { $.vakata.context.hide(); } });
- if(typeof $.hotkeys !== "undefined") {
- $(document)
- .bind("keydown", "up", function (e) {
- if($.vakata.context.vis) {
- var o = $.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").prevAll("li:not(.vakata-separator)").first();
- if(!o.length) { o = $.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").last(); }
- o.addClass("vakata-hover");
- e.stopImmediatePropagation();
- e.preventDefault();
- }
- })
- .bind("keydown", "down", function (e) {
- if($.vakata.context.vis) {
- var o = $.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").nextAll("li:not(.vakata-separator)").first();
- if(!o.length) { o = $.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").first(); }
- o.addClass("vakata-hover");
- e.stopImmediatePropagation();
- e.preventDefault();
- }
- })
- .bind("keydown", "right", function (e) {
- if($.vakata.context.vis) {
- $.vakata.context.cnt.find(".vakata-hover").children("ul").show().children("li:not(.vakata-separator)").removeClass("vakata-hover").first().addClass("vakata-hover");
- e.stopImmediatePropagation();
- e.preventDefault();
- }
- })
- .bind("keydown", "left", function (e) {
- if($.vakata.context.vis) {
- $.vakata.context.cnt.find(".vakata-hover").children("ul").hide().children(".vakata-separator").removeClass("vakata-hover");
- e.stopImmediatePropagation();
- e.preventDefault();
- }
- })
- .bind("keydown", "esc", function (e) {
- $.vakata.context.hide();
- e.preventDefault();
- })
- .bind("keydown", "space", function (e) {
- $.vakata.context.cnt.find(".vakata-hover").last().children("a").click();
- e.preventDefault();
- });
- }
- });
-
- $.jstree.plugin("contextmenu", {
- __init : function () {
- this.get_container()
- .delegate("a", "contextmenu.jstree", $.proxy(function (e) {
- e.preventDefault();
- if(!$(e.currentTarget).hasClass("jstree-loading")) {
- this.show_contextmenu(e.currentTarget, e.pageX, e.pageY);
- }
- }, this))
- .delegate("a", "click.jstree", $.proxy(function (e) {
- if(this.data.contextmenu) {
- $.vakata.context.hide();
- }
- }, this))
- .bind("destroy.jstree", $.proxy(function () {
- // TODO: move this to descruct method
- if(this.data.contextmenu) {
- $.vakata.context.hide();
- }
- }, this));
- $(document).bind("context_hide.vakata", $.proxy(function () { this.data.contextmenu = false; }, this));
- },
- defaults : {
- select_node : false, // requires UI plugin
- show_at_node : true,
- items : { // Could be a function that should return an object like this one
- "create" : {
- "separator_before" : false,
- "separator_after" : true,
- "label" : "Create",
- "action" : function (obj) { this.create(obj); }
- },
- "rename" : {
- "separator_before" : false,
- "separator_after" : false,
- "label" : "Rename",
- "action" : function (obj) { this.rename(obj); }
- },
- "remove" : {
- "separator_before" : false,
- "icon" : false,
- "separator_after" : false,
- "label" : "Delete",
- "action" : function (obj) { if(this.is_selected(obj)) { this.remove(); } else { this.remove(obj); } }
- },
- "ccp" : {
- "separator_before" : true,
- "icon" : false,
- "separator_after" : false,
- "label" : "Edit",
- "action" : false,
- "submenu" : {
- "cut" : {
- "separator_before" : false,
- "separator_after" : false,
- "label" : "Cut",
- "action" : function (obj) { this.cut(obj); }
- },
- "copy" : {
- "separator_before" : false,
- "icon" : false,
- "separator_after" : false,
- "label" : "Copy",
- "action" : function (obj) { this.copy(obj); }
- },
- "paste" : {
- "separator_before" : false,
- "icon" : false,
- "separator_after" : false,
- "label" : "Paste",
- "action" : function (obj) { this.paste(obj); }
- }
- }
- }
- }
- },
- _fn : {
- show_contextmenu : function (obj, x, y) {
- obj = this._get_node(obj);
- var s = this.get_settings().contextmenu,
- a = obj.children("a:visible:eq(0)"),
- o = false,
- i = false;
- if(s.select_node && this.data.ui && !this.is_selected(obj)) {
- this.deselect_all();
- this.select_node(obj, true);
- }
- if(s.show_at_node || typeof x === "undefined" || typeof y === "undefined") {
- o = a.offset();
- x = o.left;
- y = o.top + this.data.core.li_height;
- }
- i = obj.data("jstree") && obj.data("jstree").contextmenu ? obj.data("jstree").contextmenu : s.items;
- if($.isFunction(i)) { i = i.call(this, obj); }
- this.data.contextmenu = true;
- $.vakata.context.show(i, a, x, y, this, obj, this._get_settings().core.rtl);
- if(this.data.themes) { $.vakata.context.cnt.attr("class", "jstree-" + this.data.themes.theme + "-context"); }
- }
- }
- });
-})(jQuery);
-//*/
-
-/*
- * jsTree types plugin
- * Adds support types of nodes
- * You can set an attribute on each li node, that represents its type.
- * According to the type setting the node may get custom icon/validation rules
- */
-(function ($) {
- $.jstree.plugin("types", {
- __init : function () {
- var s = this._get_settings().types;
- this.data.types.attach_to = [];
- this.get_container()
- .bind("init.jstree", $.proxy(function () {
- var types = s.types,
- attr = s.type_attr,
- icons_css = "",
- _this = this;
-
- $.each(types, function (i, tp) {
- $.each(tp, function (k, v) {
- if(!/^(max_depth|max_children|icon|valid_children)$/.test(k)) { _this.data.types.attach_to.push(k); }
- });
- if(!tp.icon) { return true; }
- if( tp.icon.image || tp.icon.position) {
- if(i == "default") { icons_css += '.jstree-' + _this.get_index() + ' a > .jstree-icon { '; }
- else { icons_css += '.jstree-' + _this.get_index() + ' li[' + attr + '="' + i + '"] > a > .jstree-icon { '; }
- if(tp.icon.image) { icons_css += ' background-image:url(' + tp.icon.image + '); '; }
- if(tp.icon.position){ icons_css += ' background-position:' + tp.icon.position + '; '; }
- else { icons_css += ' background-position:0 0; '; }
- icons_css += '} ';
- }
- });
- if(icons_css !== "") { $.vakata.css.add_sheet({ 'str' : icons_css, title : "jstree-types" }); }
- }, this))
- .bind("before.jstree", $.proxy(function (e, data) {
- var s, t,
- o = this._get_settings().types.use_data ? this._get_node(data.args[0]) : false,
- d = o && o !== -1 && o.length ? o.data("jstree") : false;
- if(d && d.types && d.types[data.func] === false) { e.stopImmediatePropagation(); return false; }
- if($.inArray(data.func, this.data.types.attach_to) !== -1) {
- if(!data.args[0] || (!data.args[0].tagName && !data.args[0].jquery)) { return; }
- s = this._get_settings().types.types;
- t = this._get_type(data.args[0]);
- if(
- (
- (s[t] && typeof s[t][data.func] !== "undefined") ||
- (s["default"] && typeof s["default"][data.func] !== "undefined")
- ) && this._check(data.func, data.args[0]) === false
- ) {
- e.stopImmediatePropagation();
- return false;
- }
- }
- }, this));
- if(is_ie6) {
- this.get_container()
- .bind("load_node.jstree set_type.jstree", $.proxy(function (e, data) {
- var r = data && data.rslt && data.rslt.obj && data.rslt.obj !== -1 ? this._get_node(data.rslt.obj).parent() : this.get_container_ul(),
- c = false,
- s = this._get_settings().types;
- $.each(s.types, function (i, tp) {
- if(tp.icon && (tp.icon.image || tp.icon.position)) {
- c = i === "default" ? r.find("li > a > .jstree-icon") : r.find("li[" + s.type_attr + "='" + i + "'] > a > .jstree-icon");
- if(tp.icon.image) { c.css("backgroundImage","url(" + tp.icon.image + ")"); }
- c.css("backgroundPosition", tp.icon.position || "0 0");
- }
- });
- }, this));
- }
- },
- defaults : {
- // defines maximum number of root nodes (-1 means unlimited, -2 means disable max_children checking)
- max_children : -1,
- // defines the maximum depth of the tree (-1 means unlimited, -2 means disable max_depth checking)
- max_depth : -1,
- // defines valid node types for the root nodes
- valid_children : "all",
-
- // whether to use $.data
- use_data : false,
- // where is the type stores (the rel attribute of the LI element)
- type_attr : "rel",
- // a list of types
- types : {
- // the default type
- "default" : {
- "max_children" : -1,
- "max_depth" : -1,
- "valid_children": "all"
-
- // Bound functions - you can bind any other function here (using boolean or function)
- //"select_node" : true
- }
- }
- },
- _fn : {
- _types_notify : function (n, data) {
- if(data.type && this._get_settings().types.use_data) {
- this.set_type(data.type, n);
- }
- },
- _get_type : function (obj) {
- obj = this._get_node(obj);
- return (!obj || !obj.length) ? false : obj.attr(this._get_settings().types.type_attr) || "default";
- },
- set_type : function (str, obj) {
- obj = this._get_node(obj);
- var ret = (!obj.length || !str) ? false : obj.attr(this._get_settings().types.type_attr, str);
- if(ret) { this.__callback({ obj : obj, type : str}); }
- return ret;
- },
- _check : function (rule, obj, opts) {
- obj = this._get_node(obj);
- var v = false, t = this._get_type(obj), d = 0, _this = this, s = this._get_settings().types, data = false;
- if(obj === -1) {
- if(!!s[rule]) { v = s[rule]; }
- else { return; }
- }
- else {
- if(t === false) { return; }
- data = s.use_data ? obj.data("jstree") : false;
- if(data && data.types && typeof data.types[rule] !== "undefined") { v = data.types[rule]; }
- else if(!!s.types[t] && typeof s.types[t][rule] !== "undefined") { v = s.types[t][rule]; }
- else if(!!s.types["default"] && typeof s.types["default"][rule] !== "undefined") { v = s.types["default"][rule]; }
- }
- if($.isFunction(v)) { v = v.call(this, obj); }
- if(rule === "max_depth" && obj !== -1 && opts !== false && s.max_depth !== -2 && v !== 0) {
- // also include the node itself - otherwise if root node it is not checked
- obj.children("a:eq(0)").parentsUntil(".jstree","li").each(function (i) {
- // check if current depth already exceeds global tree depth
- if(s.max_depth !== -1 && s.max_depth - (i + 1) <= 0) { v = 0; return false; }
- d = (i === 0) ? v : _this._check(rule, this, false);
- // check if current node max depth is already matched or exceeded
- if(d !== -1 && d - (i + 1) <= 0) { v = 0; return false; }
- // otherwise - set the max depth to the current value minus current depth
- if(d >= 0 && (d - (i + 1) < v || v < 0) ) { v = d - (i + 1); }
- // if the global tree depth exists and it minus the nodes calculated so far is less than `v` or `v` is unlimited
- if(s.max_depth >= 0 && (s.max_depth - (i + 1) < v || v < 0) ) { v = s.max_depth - (i + 1); }
- });
- }
- return v;
- },
- check_move : function () {
- if(!this.__call_old()) { return false; }
- var m = this._get_move(),
- s = m.rt._get_settings().types,
- mc = m.rt._check("max_children", m.cr),
- md = m.rt._check("max_depth", m.cr),
- vc = m.rt._check("valid_children", m.cr),
- ch = 0, d = 1, t;
-
- if(vc === "none") { return false; }
- if($.isArray(vc) && m.ot && m.ot._get_type) {
- m.o.each(function () {
- if($.inArray(m.ot._get_type(this), vc) === -1) { d = false; return false; }
- });
- if(d === false) { return false; }
- }
- if(s.max_children !== -2 && mc !== -1) {
- ch = m.cr === -1 ? this.get_container().find("> ul > li").not(m.o).length : m.cr.find("> ul > li").not(m.o).length;
- if(ch + m.o.length > mc) { return false; }
- }
- if(s.max_depth !== -2 && md !== -1) {
- d = 0;
- if(md === 0) { return false; }
- if(typeof m.o.d === "undefined") {
- // TODO: deal with progressive rendering and async when checking max_depth (how to know the depth of the moved node)
- t = m.o;
- while(t.length > 0) {
- t = t.find("> ul > li");
- d ++;
- }
- m.o.d = d;
- }
- if(md - m.o.d < 0) { return false; }
- }
- return true;
- },
- create_node : function (obj, position, js, callback, is_loaded, skip_check) {
- if(!skip_check && (is_loaded || this._is_loaded(obj))) {
- var p = (typeof position == "string" && position.match(/^before|after$/i) && obj !== -1) ? this._get_parent(obj) : this._get_node(obj),
- s = this._get_settings().types,
- mc = this._check("max_children", p),
- md = this._check("max_depth", p),
- vc = this._check("valid_children", p),
- ch;
- if(typeof js === "string") { js = { data : js }; }
- if(!js) { js = {}; }
- if(vc === "none") { return false; }
- if($.isArray(vc)) {
- if(!js.attr || !js.attr[s.type_attr]) {
- if(!js.attr) { js.attr = {}; }
- js.attr[s.type_attr] = vc[0];
- }
- else {
- if($.inArray(js.attr[s.type_attr], vc) === -1) { return false; }
- }
- }
- if(s.max_children !== -2 && mc !== -1) {
- ch = p === -1 ? this.get_container().find("> ul > li").length : p.find("> ul > li").length;
- if(ch + 1 > mc) { return false; }
- }
- if(s.max_depth !== -2 && md !== -1 && (md - 1) < 0) { return false; }
- }
- return this.__call_old(true, obj, position, js, callback, is_loaded, skip_check);
- }
- }
- });
-})(jQuery);
-//*/
-
-/*
- * jsTree HTML plugin
- * The HTML data store. Datastores are build by replacing the `load_node` and `_is_loaded` functions.
- */
-(function ($) {
- $.jstree.plugin("html_data", {
- __init : function () {
- // this used to use html() and clean the whitespace, but this way any attached data was lost
- this.data.html_data.original_container_html = this.get_container().find(" > ul > li").clone(true);
- // remove white space from LI node - otherwise nodes appear a bit to the right
- this.data.html_data.original_container_html.find("li").andSelf().contents().filter(function() { return this.nodeType == 3; }).remove();
- },
- defaults : {
- data : false,
- ajax : false,
- correct_state : true
- },
- _fn : {
- load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_html(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); },
- _is_loaded : function (obj) {
- obj = this._get_node(obj);
- return obj == -1 || !obj || (!this._get_settings().html_data.ajax && !$.isFunction(this._get_settings().html_data.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").size() > 0;
- },
- load_node_html : function (obj, s_call, e_call) {
- var d,
- s = this.get_settings().html_data,
- error_func = function () {},
- success_func = function () {};
- obj = this._get_node(obj);
- if(obj && obj !== -1) {
- if(obj.data("jstree_is_loading")) { return; }
- else { obj.data("jstree_is_loading",true); }
- }
- switch(!0) {
- case ($.isFunction(s.data)):
- s.data.call(this, obj, $.proxy(function (d) {
- if(d && d !== "" && d.toString && d.toString().replace(/^[\s\n]+$/,"") !== "") {
- d = $(d);
- if(!d.is("ul")) { d = $("<ul />").append(d); }
- if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
- else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree_is_loading"); }
- this.clean_node(obj);
- if(s_call) { s_call.call(this); }
- }
- else {
- if(obj && obj !== -1) {
- obj.children("a.jstree-loading").removeClass("jstree-loading");
- obj.removeData("jstree_is_loading");
- if(s.correct_state) {
- this.correct_state(obj);
- if(s_call) { s_call.call(this); }
- }
- }
- else {
- if(s.correct_state) {
- this.get_container().children("ul").empty();
- if(s_call) { s_call.call(this); }
- }
- }
- }
- }, this));
- break;
- case (!s.data && !s.ajax):
- if(!obj || obj == -1) {
- this.get_container()
- .children("ul").empty()
- .append(this.data.html_data.original_container_html)
- .find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end()
- .filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");
- this.clean_node();
- }
- if(s_call) { s_call.call(this); }
- break;
- case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
- if(!obj || obj == -1) {
- d = $(s.data);
- if(!d.is("ul")) { d = $("<ul />").append(d); }
- this.get_container()
- .children("ul").empty().append(d.children())
- .find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end()
- .filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");
- this.clean_node();
- }
- if(s_call) { s_call.call(this); }
- break;
- case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
- obj = this._get_node(obj);
- error_func = function (x, t, e) {
- var ef = this.get_settings().html_data.ajax.error;
- if(ef) { ef.call(this, x, t, e); }
- if(obj != -1 && obj.length) {
- obj.children("a.jstree-loading").removeClass("jstree-loading");
- obj.removeData("jstree_is_loading");
- if(t === "success" && s.correct_state) { this.correct_state(obj); }
- }
- else {
- if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
- }
- if(e_call) { e_call.call(this); }
- };
- success_func = function (d, t, x) {
- var sf = this.get_settings().html_data.ajax.success;
- if(sf) { d = sf.call(this,d,t,x) || d; }
- if(d === "" || (d && d.toString && d.toString().replace(/^[\s\n]+$/,"") === "")) {
- return error_func.call(this, x, t, "");
- }
- if(d) {
- d = $(d);
- if(!d.is("ul")) { d = $("<ul />").append(d); }
- if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
- else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree_is_loading"); }
- this.clean_node(obj);
- if(s_call) { s_call.call(this); }
- }
- else {
- if(obj && obj !== -1) {
- obj.children("a.jstree-loading").removeClass("jstree-loading");
- obj.removeData("jstree_is_loading");
- if(s.correct_state) {
- this.correct_state(obj);
- if(s_call) { s_call.call(this); }
- }
- }
- else {
- if(s.correct_state) {
- this.get_container().children("ul").empty();
- if(s_call) { s_call.call(this); }
- }
- }
- }
- };
- s.ajax.context = this;
- s.ajax.error = error_func;
- s.ajax.success = success_func;
- if(!s.ajax.dataType) { s.ajax.dataType = "html"; }
- if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
- if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
- $.ajax(s.ajax);
- break;
- }
- }
- }
- });
- // include the HTML data plugin by default
- $.jstree.defaults.plugins.push("html_data");
-})(jQuery);
-//*/
-
-/*
- * jsTree themeroller plugin
- * Adds support for jQuery UI themes. Include this at the end of your plugins list, also make sure "themes" is not included.
- */
-(function ($) {
- $.jstree.plugin("themeroller", {
- __init : function () {
- var s = this._get_settings().themeroller;
- this.get_container()
- .addClass("ui-widget-content")
- .addClass("jstree-themeroller")
- .delegate("a","mouseenter.jstree", function (e) {
- if(!$(e.currentTarget).hasClass("jstree-loading")) {
- $(this).addClass(s.item_h);
- }
- })
- .delegate("a","mouseleave.jstree", function () {
- $(this).removeClass(s.item_h);
- })
- .bind("init.jstree", $.proxy(function (e, data) {
- data.inst.get_container().find("> ul > li > .jstree-loading > ins").addClass("ui-icon-refresh");
- this._themeroller(data.inst.get_container().find("> ul > li"));
- }, this))
- .bind("open_node.jstree create_node.jstree", $.proxy(function (e, data) {
- this._themeroller(data.rslt.obj);
- }, this))
- .bind("loaded.jstree refresh.jstree", $.proxy(function (e) {
- this._themeroller();
- }, this))
- .bind("close_node.jstree", $.proxy(function (e, data) {
- this._themeroller(data.rslt.obj);
- }, this))
- .bind("delete_node.jstree", $.proxy(function (e, data) {
- this._themeroller(data.rslt.parent);
- }, this))
- .bind("correct_state.jstree", $.proxy(function (e, data) {
- data.rslt.obj
- .children("ins.jstree-icon").removeClass(s.opened + " " + s.closed + " ui-icon").end()
- .find("> a > ins.ui-icon")
- .filter(function() {
- return this.className.toString()
- .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
- .indexOf("ui-icon-") === -1;
- }).removeClass(s.item_open + " " + s.item_clsd).addClass(s.item_leaf || "jstree-no-icon");
- }, this))
- .bind("select_node.jstree", $.proxy(function (e, data) {
- data.rslt.obj.children("a").addClass(s.item_a);
- }, this))
- .bind("deselect_node.jstree deselect_all.jstree", $.proxy(function (e, data) {
- this.get_container()
- .find("a." + s.item_a).removeClass(s.item_a).end()
- .find("a.jstree-clicked").addClass(s.item_a);
- }, this))
- .bind("dehover_node.jstree", $.proxy(function (e, data) {
- data.rslt.obj.children("a").removeClass(s.item_h);
- }, this))
- .bind("hover_node.jstree", $.proxy(function (e, data) {
- this.get_container()
- .find("a." + s.item_h).not(data.rslt.obj).removeClass(s.item_h);
- data.rslt.obj.children("a").addClass(s.item_h);
- }, this))
- .bind("move_node.jstree", $.proxy(function (e, data) {
- this._themeroller(data.rslt.o);
- this._themeroller(data.rslt.op);
- }, this));
- },
- __destroy : function () {
- var s = this._get_settings().themeroller,
- c = [ "ui-icon" ];
- $.each(s, function (i, v) {
- v = v.split(" ");
- if(v.length) { c = c.concat(v); }
- });
- this.get_container()
- .removeClass("ui-widget-content")
- .find("." + c.join(", .")).removeClass(c.join(" "));
- },
- _fn : {
- _themeroller : function (obj) {
- var s = this._get_settings().themeroller;
- obj = (!obj || obj == -1) ? this.get_container_ul() : this._get_node(obj);
- obj = (!obj || obj == -1) ? this.get_container_ul() : obj.parent();
- obj
- .find("li.jstree-closed")
- .children("ins.jstree-icon").removeClass(s.opened).addClass("ui-icon " + s.closed).end()
- .children("a").addClass(s.item)
- .children("ins.jstree-icon").addClass("ui-icon")
- .filter(function() {
- return this.className.toString()
- .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
- .indexOf("ui-icon-") === -1;
- }).removeClass(s.item_leaf + " " + s.item_open).addClass(s.item_clsd || "jstree-no-icon")
- .end()
- .end()
- .end()
- .end()
- .find("li.jstree-open")
- .children("ins.jstree-icon").removeClass(s.closed).addClass("ui-icon " + s.opened).end()
- .children("a").addClass(s.item)
- .children("ins.jstree-icon").addClass("ui-icon")
- .filter(function() {
- return this.className.toString()
- .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
- .indexOf("ui-icon-") === -1;
- }).removeClass(s.item_leaf + " " + s.item_clsd).addClass(s.item_open || "jstree-no-icon")
- .end()
- .end()
- .end()
- .end()
- .find("li.jstree-leaf")
- .children("ins.jstree-icon").removeClass(s.closed + " ui-icon " + s.opened).end()
- .children("a").addClass(s.item)
- .children("ins.jstree-icon").addClass("ui-icon")
- .filter(function() {
- return this.className.toString()
- .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
- .indexOf("ui-icon-") === -1;
- }).removeClass(s.item_clsd + " " + s.item_open).addClass(s.item_leaf || "jstree-no-icon");
- }
- },
- defaults : {
- "opened" : "ui-icon-triangle-1-se",
- "closed" : "ui-icon-triangle-1-e",
- "item" : "ui-state-default",
- "item_h" : "ui-state-hover",
- "item_a" : "ui-state-active",
- "item_open" : "ui-icon-folder-open",
- "item_clsd" : "ui-icon-folder-collapsed",
- "item_leaf" : "ui-icon-document"
- }
- });
- $(function() {
- var css_string = '' +
- '.jstree-themeroller .ui-icon { overflow:visible; } ' +
- '.jstree-themeroller a { padding:0 2px; } ' +
- '.jstree-themeroller .jstree-no-icon { display:none; }';
- $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
- });
-})(jQuery);
-//*/
-
-/*
- * jsTree unique plugin
- * Forces different names amongst siblings (still a bit experimental)
- * NOTE: does not check language versions (it will not be possible to have nodes with the same title, even in different languages)
- */
-(function ($) {
- $.jstree.plugin("unique", {
- __init : function () {
- this.get_container()
- .bind("before.jstree", $.proxy(function (e, data) {
- var nms = [], res = true, p, t;
- if(data.func == "move_node") {
- // obj, ref, position, is_copy, is_prepared, skip_check
- if(data.args[4] === true) {
- if(data.args[0].o && data.args[0].o.length) {
- data.args[0].o.children("a").each(function () { nms.push($(this).text().replace(/^\s+/g,"")); });
- res = this._check_unique(nms, data.args[0].np.find("> ul > li").not(data.args[0].o), "move_node");
- }
- }
- }
- if(data.func == "create_node") {
- // obj, position, js, callback, is_loaded
- if(data.args[4] || this._is_loaded(data.args[0])) {
- p = this._get_node(data.args[0]);
- if(data.args[1] && (data.args[1] === "before" || data.args[1] === "after")) {
- p = this._get_parent(data.args[0]);
- if(!p || p === -1) { p = this.get_container(); }
- }
- if(typeof data.args[2] === "string") { nms.push(data.args[2]); }
- else if(!data.args[2] || !data.args[2].data) { nms.push(this._get_string("new_node")); }
- else { nms.push(data.args[2].data); }
- res = this._check_unique(nms, p.find("> ul > li"), "create_node");
- }
- }
- if(data.func == "rename_node") {
- // obj, val
- nms.push(data.args[1]);
- t = this._get_node(data.args[0]);
- p = this._get_parent(t);
- if(!p || p === -1) { p = this.get_container(); }
- res = this._check_unique(nms, p.find("> ul > li").not(t), "rename_node");
- }
- if(!res) {
- e.stopPropagation();
- return false;
- }
- }, this));
- },
- defaults : {
- error_callback : $.noop
- },
- _fn : {
- _check_unique : function (nms, p, func) {
- var cnms = [], ok = true;
- p.children("a").each(function () { cnms.push($(this).text().replace(/^\s+/g,"")); });
- if(!cnms.length || !nms.length) { return true; }
- $.each(nms, function (i, v) {
- if($.inArray(v, cnms) !== -1) {
- ok = false;
- return false;
- }
- });
- if(!ok) {
- this._get_settings().unique.error_callback.call(null, nms, p, func);
- }
- return ok;
- },
- check_move : function () {
- if(!this.__call_old()) { return false; }
- var p = this._get_move(), nms = [];
- if(p.o && p.o.length) {
- p.o.children("a").each(function () { nms.push($(this).text().replace(/^\s+/g,"")); });
- return this._check_unique(nms, p.np.find("> ul > li").not(p.o), "check_move");
- }
- return true;
- }
- }
- });
-})(jQuery);
-//*/
-
-/*
- * jsTree wholerow plugin
- * Makes select and hover work on the entire width of the node
- * MAY BE HEAVY IN LARGE DOM
- */
-(function ($) {
- $.jstree.plugin("wholerow", {
- __init : function () {
- if(!this.data.ui) { throw "jsTree wholerow: jsTree UI plugin not included."; }
- this.data.wholerow.html = false;
- this.data.wholerow.to = false;
- this.get_container()
- .bind("init.jstree", $.proxy(function (e, data) {
- this._get_settings().core.animation = 0;
- }, this))
- .bind("open_node.jstree create_node.jstree clean_node.jstree loaded.jstree", $.proxy(function (e, data) {
- this._prepare_wholerow_span( data && data.rslt && data.rslt.obj ? data.rslt.obj : -1 );
- }, this))
- .bind("search.jstree clear_search.jstree reopen.jstree after_open.jstree after_close.jstree create_node.jstree delete_node.jstree clean_node.jstree", $.proxy(function (e, data) {
- if(this.data.to) { clearTimeout(this.data.to); }
- this.data.to = setTimeout( (function (t, o) { return function() { t._prepare_wholerow_ul(o); }; })(this, data && data.rslt && data.rslt.obj ? data.rslt.obj : -1), 0);
- }, this))
- .bind("deselect_all.jstree", $.proxy(function (e, data) {
- this.get_container().find(" > .jstree-wholerow .jstree-clicked").removeClass("jstree-clicked " + (this.data.themeroller ? this._get_settings().themeroller.item_a : "" ));
- }, this))
- .bind("select_node.jstree deselect_node.jstree ", $.proxy(function (e, data) {
- data.rslt.obj.each(function () {
- var ref = data.inst.get_container().find(" > .jstree-wholerow li:visible:eq(" + ( parseInt((($(this).offset().top - data.inst.get_container().offset().top + data.inst.get_container()[0].scrollTop) / data.inst.data.core.li_height),10)) + ")");
- // ref.children("a")[e.type === "select_node" ? "addClass" : "removeClass"]("jstree-clicked");
- ref.children("a").attr("class",data.rslt.obj.children("a").attr("class"));
- });
- }, this))
- .bind("hover_node.jstree dehover_node.jstree", $.proxy(function (e, data) {
- this.get_container().find(" > .jstree-wholerow .jstree-hovered").removeClass("jstree-hovered " + (this.data.themeroller ? this._get_settings().themeroller.item_h : "" ));
- if(e.type === "hover_node") {
- var ref = this.get_container().find(" > .jstree-wholerow li:visible:eq(" + ( parseInt(((data.rslt.obj.offset().top - this.get_container().offset().top + this.get_container()[0].scrollTop) / this.data.core.li_height),10)) + ")");
- // ref.children("a").addClass("jstree-hovered");
- ref.children("a").attr("class",data.rslt.obj.children(".jstree-hovered").attr("class"));
- }
- }, this))
- .delegate(".jstree-wholerow-span, ins.jstree-icon, li", "click.jstree", function (e) {
- var n = $(e.currentTarget);
- if(e.target.tagName === "A" || (e.target.tagName === "INS" && n.closest("li").is(".jstree-open, .jstree-closed"))) { return; }
- n.closest("li").children("a:visible:eq(0)").click();
- e.stopImmediatePropagation();
- })
- .delegate("li", "mouseover.jstree", $.proxy(function (e) {
- e.stopImmediatePropagation();
- if($(e.currentTarget).children(".jstree-hovered, .jstree-clicked").length) { return false; }
- this.hover_node(e.currentTarget);
- return false;
- }, this))
- .delegate("li", "mouseleave.jstree", $.proxy(function (e) {
- if($(e.currentTarget).children("a").hasClass("jstree-hovered").length) { return; }
- this.dehover_node(e.currentTarget);
- }, this));
- if(is_ie7 || is_ie6) {
- $.vakata.css.add_sheet({ str : ".jstree-" + this.get_index() + " { position:relative; } ", title : "jstree" });
- }
- },
- defaults : {
- },
- __destroy : function () {
- this.get_container().children(".jstree-wholerow").remove();
- this.get_container().find(".jstree-wholerow-span").remove();
- },
- _fn : {
- _prepare_wholerow_span : function (obj) {
- obj = !obj || obj == -1 ? this.get_container().find("> ul > li") : this._get_node(obj);
- if(obj === false) { return; } // added for removing root nodes
- obj.each(function () {
- $(this).find("li").andSelf().each(function () {
- var $t = $(this);
- if($t.children(".jstree-wholerow-span").length) { return true; }
- $t.prepend("<span class='jstree-wholerow-span' style='width:" + ($t.parentsUntil(".jstree","li").length * 18) + "px;'> </span>");
- });
- });
- },
- _prepare_wholerow_ul : function () {
- var o = this.get_container().children("ul").eq(0), h = o.html();
- o.addClass("jstree-wholerow-real");
- if(this.data.wholerow.last_html !== h) {
- this.data.wholerow.last_html = h;
- this.get_container().children(".jstree-wholerow").remove();
- this.get_container().append(
- o.clone().removeClass("jstree-wholerow-real")
- .wrapAll("<div class='jstree-wholerow' />").parent()
- .width(o.parent()[0].scrollWidth)
- .css("top", (o.height() + ( is_ie7 ? 5 : 0)) * -1 )
- .find("li[id]").each(function () { this.removeAttribute("id"); }).end()
- );
- }
- }
- }
- });
- $(function() {
- var css_string = '' +
- '.jstree .jstree-wholerow-real { position:relative; z-index:1; } ' +
- '.jstree .jstree-wholerow-real li { cursor:pointer; } ' +
- '.jstree .jstree-wholerow-real a { border-left-color:transparent !important; border-right-color:transparent !important; } ' +
- '.jstree .jstree-wholerow { position:relative; z-index:0; height:0; } ' +
- '.jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { width:100%; } ' +
- '.jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li, .jstree .jstree-wholerow a { margin:0 !important; padding:0 !important; } ' +
- '.jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { background:transparent !important; }' +
- '.jstree .jstree-wholerow ins, .jstree .jstree-wholerow span, .jstree .jstree-wholerow input { display:none !important; }' +
- '.jstree .jstree-wholerow a, .jstree .jstree-wholerow a:hover { text-indent:-9999px; !important; width:100%; padding:0 !important; border-right-width:0px !important; border-left-width:0px !important; } ' +
- '.jstree .jstree-wholerow-span { position:absolute; left:0; margin:0px; padding:0; height:18px; border-width:0; padding:0; z-index:0; }';
- if(is_ff2) {
- css_string += '' +
- '.jstree .jstree-wholerow a { display:block; height:18px; margin:0; padding:0; border:0; } ' +
- '.jstree .jstree-wholerow-real a { border-color:transparent !important; } ';
- }
- if(is_ie7 || is_ie6) {
- css_string += '' +
- '.jstree .jstree-wholerow, .jstree .jstree-wholerow li, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow a { margin:0; padding:0; line-height:18px; } ' +
- '.jstree .jstree-wholerow a { display:block; height:18px; line-height:18px; overflow:hidden; } ';
- }
- $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
- });
-})(jQuery);
-//*/
-
-/*
-* jsTree model plugin
-* This plugin gets jstree to use a class model to retrieve data, creating great dynamism
-*/
-(function ($) {
- var nodeInterface = ["getChildren","getChildrenCount","getAttr","getName","getProps"],
- validateInterface = function(obj, inter) {
- var valid = true;
- obj = obj || {};
- inter = [].concat(inter);
- $.each(inter, function (i, v) {
- if(!$.isFunction(obj[v])) { valid = false; return false; }
- });
- return valid;
- };
- $.jstree.plugin("model", {
- __init : function () {
- if(!this.data.json_data) { throw "jsTree model: jsTree json_data plugin not included."; }
- this._get_settings().json_data.data = function (n, b) {
- var obj = (n == -1) ? this._get_settings().model.object : n.data("jstree_model");
- if(!validateInterface(obj, nodeInterface)) { return b.call(null, false); }
- if(this._get_settings().model.async) {
- obj.getChildren($.proxy(function (data) {
- this.model_done(data, b);
- }, this));
- }
- else {
- this.model_done(obj.getChildren(), b);
- }
- };
- },
- defaults : {
- object : false,
- id_prefix : false,
- async : false
- },
- _fn : {
- model_done : function (data, callback) {
- var ret = [],
- s = this._get_settings(),
- _this = this;
-
- if(!$.isArray(data)) { data = [data]; }
- $.each(data, function (i, nd) {
- var r = nd.getProps() || {};
- r.attr = nd.getAttr() || {};
- if(nd.getChildrenCount()) { r.state = "closed"; }
- r.data = nd.getName();
- if(!$.isArray(r.data)) { r.data = [r.data]; }
- if(_this.data.types && $.isFunction(nd.getType)) {
- r.attr[s.types.type_attr] = nd.getType();
- }
- if(r.attr.id && s.model.id_prefix) { r.attr.id = s.model.id_prefix + r.attr.id; }
- if(!r.metadata) { r.metadata = { }; }
- r.metadata.jstree_model = nd;
- ret.push(r);
- });
- callback.call(null, ret);
- }
- }
- });
-})(jQuery);
-//*/
-
-})();
\ No newline at end of file
Added: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/js/jstree.js
===================================================================
--- trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/js/jstree.js (rev 0)
+++ trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/js/jstree.js 2013-02-18 16:05:50 UTC (rev 30)
@@ -0,0 +1,3784 @@
+/*
+ * jsTree 2.0.0
+ * http://jstree.com/
+ *
+ * Copyright (c) 2013 Ivan Bozhanov (vakata.com)
+ *
+ * Licensed same as jquery - under the terms of either the MIT License or the GPL Version 2 License
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ */
+
+/*global jQuery, window, document, setTimeout, setInterval, clearTimeout, clearInterval, console */
+(function ($) {
+ "use strict";
+
+ // prevent another load? maybe there is a better way?
+ if($.jstree) {
+ return;
+ }
+
+ // internal variables
+ var instance_counter = 0,
+ ccp_node = false,
+ ccp_mode = false,
+ themes_loaded = [];
+
+ // jquery object / function / selector
+ $.jstree = {
+ version : '2.0.0-alpha',
+ defaults : {
+ plugins : []
+ },
+ plugins : {},
+ create : function (el, options) {
+ // create the new core
+ var tmp = new $.jstree.core(++instance_counter);
+ // extend options with the defaults
+ options = $.extend(true, {}, $.jstree.defaults, options);
+ // each option key except 'core' represents a plugin to be loaded
+ $.each(options.plugins, function (i, k) {
+ if(i !== 'core') {
+ // decorate the object with the plugin
+ tmp = tmp.plugin(k, options[k]);
+ }
+ });
+ // initialize the tree
+ tmp.init(el, options);
+ // return the instance
+ return tmp;
+ },
+ core : function (id) {
+ this._id = id;
+ this._data = {
+ 'core' : {
+ 'themes' : {}
+ }
+ };
+ },
+ reference : function (needle) {
+ return $(needle).closest('.jstree').data('jstree');
+ }
+ };
+ $.fn.jstree = function (arg) {
+ // check for string argument
+ var is_method = (typeof arg === 'string'),
+ args = Array.prototype.slice.call(arguments, 1),
+ result = null;
+ this.each(function () {
+ // get the instance (if there is one) and method (if it exists)
+ var instance = $(this).data('jstree'),
+ method = is_method && instance ? instance[arg] : null;
+ // if calling a method, and method is available - execute on the instance
+ result = is_method && method ? method.apply(instance, args) : null;
+ // if there is no instance - create one
+ if(!instance) { $(this).data('jstree', new $.jstree.create(this, arg)); }
+ // if there was a method call which returned a result - break and return the value
+ if(result !== null && typeof result !== 'undefined') { return false; }
+ });
+ // if there was a method call with a valid return value - return that, otherwise continue the chain
+ return result !== null && typeof result !== 'undefined' ? result : this;
+ };
+ // :jstree pseudo selector to find all elements with instances
+ $.expr[':'].jstree = $.expr.createPseudo(function(search) {
+ return function(a) {
+ return $(a).hasClass('jstree') && typeof ($(a).data('jstree')) !== 'undefined';
+ };
+ });
+
+ // CORE
+ $.jstree.defaults.core = {
+ strings : false,
+ check_callback : true,
+ animation : 100,
+ aria_roles : true,
+ multiple : true,
+ themes : {
+ name : false,
+ url : true,
+ dots : true,
+ icons : true,
+ dir : false
+ },
+ base_height : false
+ };
+ $.jstree.core.prototype = {
+ plugin : function (deco, opts) {
+ var Child = $.jstree.plugins[deco];
+ if(Child) {
+ this._data[deco] = {};
+ Child.prototype = this;
+ return new Child(opts, this);
+ }
+ return this;
+ },
+
+ init : function (el, options) {
+ this.element = $(el).addClass('jstree jstree-' + this._id);
+ this.settings = options;
+ this.element.bind("destroyed", $.proxy(this.teardown, this));
+
+ this._data.core.ready = false;
+ this._data.core.rtl = (this.element.css("direction") === "rtl");
+ this.element[this._data.core.rtl ? 'addClass' : 'removeClass']("jstree-rtl");
+ if(this.settings.core.aria_roles) {
+ this.element.attr('role','tree');
+ }
+ this._data.core.selected = $();
+
+ this.bind();
+
+ this._data.core.original_container_html = this.element.find(" > ul > li").clone(true);
+ this._data.core.original_container_html.find("li").addBack().contents().filter(function() { return this.nodeType === 3 && (!this.nodeValue || /^\s+$/.test(this.nodeValue)); }).remove();
+ this.element.html("<ul><li class='jstree-loading'><a href='#'>" + this.get_string("Loading ...") + "</a></li></ul>");
+ this.clean_node(-1);
+ this._data.core.li_height = this.settings.base_height || this.get_container_ul().children("li:eq(0)").height() || 18;
+ this.load_node(-1, function () {
+ this.trigger("loaded");
+ });
+ },
+ destroy : function () {
+ this.element.unbind("destroyed", this.teardown);
+ this.teardown();
+ },
+ teardown : function () {
+ this.unbind();
+ this.element
+ .removeClass('jstree')
+ .removeData('jstree')
+ .find("[class^='jstree']")
+ .addBack()
+ .attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); });
+ this.element = null;
+ },
+ bind : function () {
+ if($.support.touch) {
+ this.element.addTouch();
+ }
+ this.element
+ .on("dblclick.jstree", function () {
+ if(document.selection && document.selection.empty) {
+ document.selection.empty();
+ }
+ else {
+ if(window.getSelection) {
+ var sel = window.getSelection();
+ try {
+ sel.removeAllRanges();
+ sel.collapse();
+ } catch (er) { }
+ }
+ }
+ })
+ .on("click.jstree", ".jstree-ocl", $.proxy(function (e) {
+ this.toggle_node(e.target);
+ }, this))
+ .on("click.jstree", "a", $.proxy(function (e) {
+ e.preventDefault();
+ this.activate_node(e.currentTarget, e);
+ }, this))
+ .on('keydown.jstree', 'a', $.proxy(function (e) {
+ var o = null;
+ switch(e.which) {
+ case 13:
+ case 32:
+ e.type = "click";
+ $(e.currentTarget).trigger(e);
+ break;
+ case 37:
+ e.preventDefault();
+ if(this.is_open(e.currentTarget)) {
+ this.close_node(e.currentTarget);
+ }
+ else {
+ o = this.get_prev(e.currentTarget);
+ if(o && o.length) { o.children('a').focus(); }
+ }
+ break;
+ case 38:
+ e.preventDefault();
+ o = this.get_prev(e.currentTarget);
+ if(o && o.length) { o.children('a').focus(); }
+ break;
+ case 39:
+ e.preventDefault();
+ if(this.is_closed(e.currentTarget)) {
+ this.open_node(e.currentTarget);
+ }
+ else {
+ o = this.get_next(e.currentTarget);
+ if(o && o.length) { o.children('a').focus(); }
+ }
+ break;
+ case 40:
+ e.preventDefault();
+ o = this.get_next(e.currentTarget);
+ if(o && o.length) { o.children('a').focus(); }
+ break;
+ default:
+ //console.log(e.which);
+ break;
+ }
+ }, this))
+ .on("create_node.jstree", $.proxy(function (e, data) {
+ this.clean_node(data.node);
+ }, this))
+ .on("load_node.jstree", $.proxy(function (e, data) {
+ if(data.status) {
+ if(data.node === -1) {
+ // only detach for root (checkbox three-state will not work otherwise)
+ // also - if you could use async clean_node won't be such an issue
+ var ul = this.get_container_ul().detach();
+ if(ul.children('li').length) {
+ this.clean_node(ul.children('li'));
+ }
+ this.element.prepend(ul);
+ if(this.settings.core.aria_roles) {
+ this.element.find('ul').attr('role','group');
+ this.element.find('li').attr('role','treeitem');
+ }
+ }
+ else {
+ if(data.node.find('> ul > li').length) {
+ this.clean_node(data.node.find('> ul > li'));
+ }
+ }
+ if(!this._data.core.ready && !this.get_container_ul().find('.jstree-loading:eq(0)').length) {
+ this._data.core.ready = true;
+ this.trigger("ready.jstree");
+ }
+ }
+ }, this))
+ .on("loaded.jstree", $.proxy(function (e, data) {
+ data.instance.get_container_ul().children('li').each(function () {
+ data.instance.correct_node(this);
+ });
+ }, this))
+ .on("open_node.jstree", $.proxy(function (e, data) {
+ data.node.find('> ul > li').each(function () {
+ data.instance.correct_node(this);
+ });
+ }, this))
+ // THEME RELATED
+ .on("ready.jstree", $.proxy(function () {
+ var s = this.settings.core.themes;
+ this._data.core.themes.dots = s.dots;
+ this._data.core.themes.icons = s.icons;
+
+ if(s.name === false) {
+ s.name = 'default';
+ }
+ this.set_theme(s.name, s.url);
+ }, this))
+ .on('construct.jstree ready.jstree loaded.jstree', $.proxy(function () {
+ this[ this._data.core.themes.dots ? "show_dots" : "hide_dots" ]();
+ this[ this._data.core.themes.icons ? "show_icons" : "hide_icons" ]();
+ }, this))
+ .on('changed.jstree', $.proxy(function (e, data) {
+ this.element.find('.jstree-clicked').removeClass('jstree-clicked');
+ data.selected.children('a').addClass('jstree-clicked');
+ }, this))
+ .on('focus.jstree', 'a', $.proxy(function (e) {
+ $(e.currentTarget).mouseenter();
+ }, this))
+ .on('blur.jstree', 'a', $.proxy(function (e) {
+ $(e.currentTarget).mouseleave();
+ }, this))
+ .on('mouseenter.jstree', 'a', $.proxy(function (e) {
+ var o = this.element.find('a:focus').not('.jstree-clicked');
+ if(o && o.length && o[0] !== e.currentTarget) {
+ o.blur();
+ }
+ this.hover_node(e.currentTarget);
+ }, this))
+ .on('mouseleave.jstree', 'a', $.proxy(function (e) {
+ this.dehover_node(e.currentTarget);
+ }, this));
+ },
+ unbind : function () {
+ this.element.off('.jstree');
+ $(document).off('.jstree-' + this._id);
+ },
+ trigger : function (ev, data) {
+ if(!data) {
+ data = {};
+ }
+ data.instance = this;
+ this.element.triggerHandler(ev.replace('.jstree','') + '.jstree', data);
+ },
+ get_container : function () {
+ return this.element;
+ },
+ get_container_ul : function () {
+ return this.element.children("ul:eq(0)");
+ },
+ get_string : function (key) {
+ var a = this.settings.core.strings;
+ if($.isFunction(a)) { return a.call(this, key); }
+ if(a && a[key]) { return a[key]; }
+ return key;
+ },
+ get_node : function (obj) {
+ if(obj === -1) {
+ return -1;
+ }
+ obj = $(obj, this.element);
+ if(obj.hasClass(".jstree")) {
+ return -1;
+ }
+ obj = obj.closest("li", this.element);
+ return obj.length ? obj : false;
+ },
+ get_next : function (obj, strict) {
+ obj = this.get_node(obj);
+ if(obj === -1) {
+ return this.get_container_ul().children("li:eq(0)");
+ }
+ if(!obj || !obj.length) {
+ return false;
+ }
+ if(strict) {
+ return (obj.nextAll("li").length > 0) ? obj.nextAll("li:eq(0)") : false;
+ }
+ if(obj.hasClass("jstree-open")) {
+ return obj.find("li:eq(0)");
+ }
+ else if(obj.nextAll("li").length > 0) {
+ return obj.nextAll("li:eq(0)");
+ }
+ else {
+ return obj.parentsUntil(".jstree","li").next("li").eq(0);
+ }
+ },
+ get_prev : function (obj, strict) {
+ obj = this.get_node(obj);
+ if(obj === -1) {
+ return this.element.find("> ul > li:last-child");
+ }
+ if(!obj || !obj.length) {
+ return false;
+ }
+ if(strict) {
+ return (obj.prevAll("li").length > 0) ? obj.prevAll("li:eq(0)") : false;
+ }
+ if(obj.prev("li").length) {
+ obj = obj.prev("li").eq(0);
+ while(obj.hasClass("jstree-open")) {
+ obj = obj.children("ul:eq(0)").children("li:last");
+ }
+ return obj;
+ }
+ else {
+ var o = obj.parentsUntil(".jstree","li:eq(0)");
+ return o.length ? o : false;
+ }
+ },
+ get_parent : function (obj) {
+ obj = this.get_node(obj);
+ if(obj === -1 || !obj || !obj.length) {
+ return false;
+ }
+ var o = obj.parentsUntil(".jstree", "li:eq(0)");
+ return o.length ? o : -1;
+ },
+ get_children : function (obj) {
+ obj = this.get_node(obj);
+ if(obj === -1) {
+ return this.get_container_ul().children("li");
+ }
+ if(!obj || !obj.length) {
+ return false;
+ }
+ return obj.find("> ul > li");
+ },
+ is_parent : function (obj) {
+ obj = this.get_node(obj);
+ return obj && obj !== -1 && (obj.find("> ul > li:eq(0)").length || obj.hasClass("jstree-closed"));
+ },
+ is_loaded : function (obj) {
+ obj = this.get_node(obj);
+ return obj && ( (obj === -1 && !this.element.find("> ul > li.jstree-loading").length) || ( obj !== -1 && !obj.hasClass('jstree-loading') && (obj.find('> ul > li').length || obj.hasClass('jstree-leaf')) ) );
+ },
+ is_loading : function (obj) {
+ obj = this.get_node(obj);
+ return obj && ( (obj === -1 && this.element.find("> ul > li.jstree-loading").length) || (obj !== -1 && obj.hasClass("jstree-loading")) );
+ },
+ is_open : function (obj) {
+ obj = this.get_node(obj);
+ return obj && obj !== -1 && obj.hasClass("jstree-open");
+ },
+ is_closed : function (obj) {
+ obj = this.get_node(obj);
+ return obj && obj !== -1 && obj.hasClass("jstree-closed");
+ },
+ is_leaf : function (obj) {
+ obj = this.get_node(obj);
+ return obj && obj !== -1 && obj.hasClass("jstree-leaf");
+ },
+ load_node : function (obj, callback) {
+ obj = this.get_node(obj);
+ if(!obj) {
+ callback.call(this, obj, false);
+ return false;
+ }
+ // if(this.is_loading(obj)) { return true; }
+ if(obj !== -1) {
+ obj.addClass("jstree-loading");
+ }
+ this._load_node(obj, $.proxy(function (status) {
+ if(obj !== -1) {
+ obj.removeClass("jstree-loading");
+ }
+ this.trigger('load_node', { "node" : obj, "status" : status });
+ if(callback) {
+ callback.call(this, obj, status);
+ }
+ }, this));
+ return true;
+ },
+ _load_node : function (obj, callback) {
+ if(obj === -1) {
+ this.get_container_ul().empty().append(this._data.core.original_container_html.clone(true));
+ }
+ callback.call(null, true);
+ },
+ open_node : function (obj, callback, animation) {
+ obj = this.get_node(obj);
+ if(obj === -1 || !obj || !obj.length) {
+ return false;
+ }
+ animation = (typeof animation).toLowerCase() === "undefined" ? this.settings.core.animation : animation;
+ if(!this.is_closed(obj)) {
+ if(callback) {
+ callback.call(this, obj, false);
+ }
+ return false;
+ }
+ if(!this.is_loaded(obj)) { // TODO: is_loading?
+ this.load_node(obj, function (o, ok) {
+ return ok ? this.open_node(o, callback, animation) : (callback ? callback.call(this, o, false) : false);
+ });
+ }
+ else {
+ var t = this;
+ obj
+ .children("ul").css("display","none").end()
+ .removeClass("jstree-closed").addClass("jstree-open")
+ .children("ul").stop(true, true)
+ .slideDown(animation, function () {
+ this.style.display = "";
+ t.trigger("after_open", { "node" : obj });
+ });
+ if(callback) {
+ callback.call(this, obj, true);
+ }
+ this.trigger('open_node', { "node" : obj });
+ }
+ },
+ close_node : function (obj, animation) {
+ obj = this.get_node(obj);
+ if(!obj || !obj.length || !this.is_open(obj)) {
+ return false;
+ }
+ animation = (typeof animation).toLowerCase() === "undefined" ? this.settings.core.animation : animation;
+ var t = this;
+ obj
+ .children("ul").attr("style","display:block !important").end()
+ .removeClass("jstree-open").addClass("jstree-closed")
+ .children("ul").stop(true, true).slideUp(animation, function () {
+ this.style.display = "";
+ t.trigger("after_close", { "node" : obj });
+ });
+ this.trigger('close_node',{ "node" : obj });
+ },
+ toggle_node : function (obj) {
+ if(this.is_closed(obj)) {
+ return this.open_node(obj);
+ }
+ if(this.is_open(obj)) {
+ return this.close_node(obj);
+ }
+ },
+ open_all : function (obj, animation, original_obj) {
+ obj = obj ? this.get_node(obj) : -1;
+ obj = !obj || obj === -1 ? this.get_container_ul() : obj;
+ original_obj = original_obj || obj;
+ var _this = this;
+ obj = this.is_closed(obj) ? obj.find('li.jstree-closed').addBack() : obj.find('li.jstree-closed');
+ obj.each(function () {
+ _this.open_node(
+ this,
+ _this.is_loaded(this) ?
+ false :
+ function(obj) { this.open_all(obj, animation, original_obj); },
+ animation || 0
+ );
+ });
+ if(original_obj.find('li.jstree-closed').length === 0) {
+ this.trigger('open_all', { "node" : original_obj });
+ }
+ },
+ close_all : function (obj, animation) {
+ obj = obj ? this.get_node(obj) : -1;
+ var $obj = !obj || obj === -1 ? this.get_container_ul() : obj,
+ _this = this;
+ $obj = this.is_open($obj) ? $obj.find('li.jstree-open').addBack() : $obj.find('li.jstree-open');
+ $obj.each(function () { _this.close_node(this, animation || 0); });
+ this.trigger('close_all', { "node" : obj });
+ },
+ activate_node : function (obj, e) {
+ if(!this.settings.core.multiple || (!e.metaKey && !e.ctrlKey)) {
+ this.deselect_all(true);
+ this.select_node(obj);
+ }
+ else {
+ if(!this.is_selected(obj)) {
+ this.select_node(obj);
+ }
+ else {
+ this.deselect_node(obj);
+ }
+ }
+ this.trigger('activate_node', { 'node' : obj });
+ },
+ hover_node : function (obj) {
+ obj = this.get_node(obj);
+ if(!obj || !obj.length) {
+ return false;
+ }
+ obj.children('a').addClass('jstree-hovered');
+ this.trigger('hover_node', { 'node' : obj });
+ },
+ dehover_node : function (obj) {
+ obj = this.get_node(obj);
+ if(!obj || !obj.length) {
+ return false;
+ }
+ obj.children('a').removeClass('jstree-hovered');
+ this.trigger('dehover_node', { 'node' : obj });
+ },
+ select_node : function (obj, supress_event) {
+ obj = this.get_node(obj);
+ if(!obj || !obj.length) {
+ return false;
+ }
+ this._data.core.selected = this._data.core.selected.add(obj);
+ var t = this;
+ obj.parents(".jstree-closed").each(function () { t.open_node(this, false, 0); });
+ this.trigger('select_node', { 'node' : obj, 'selected' : this._data.core.selected });
+ if(!supress_event) {
+ this.trigger('changed', { 'action' : 'select_node', 'node' : obj, 'selected' : this._data.core.selected });
+ }
+ },
+ deselect_node : function (obj, supress_event) {
+ obj = this.get_node(obj);
+ if(!obj || !obj.length) {
+ return false;
+ }
+ this._data.core.selected = this._data.core.selected.not(obj);
+ this.trigger('deselect_node', { 'node' : obj, 'selected' : this._data.core.selected });
+ if(!supress_event) {
+ this.trigger('changed', { 'action' : 'deselect_node', 'node' : obj, 'selected' : this._data.core.selected });
+ }
+ },
+ deselect_all : function (supress_event) {
+ this._data.core.selected = $();
+ this.trigger('deselect_all', { 'selected' : this._data.core.selected });
+ if(!supress_event) {
+ this.trigger('changed', { 'action' : 'deselect_all', 'selected' : this._data.core.selected });
+ }
+ },
+ is_selected : function (obj) {
+ obj = this.get_node(obj);
+ if(!obj || !obj.length) {
+ return false;
+ }
+ return this._data.core.selected.index(obj) >= 0;
+ },
+ get_selected : function (obj) {
+ return this._data.core.selected;
+ },
+ clean_node : function (obj) {
+ // DETACH maybe inside the "load_node" function? But what about animations, etc?
+ obj = this.get_node(obj);
+ obj = !obj || obj === -1 ? this.element.find("li") : obj.find("li").addBack();
+ var _this = this;
+ return obj.each(function () {
+ var t = $(this),
+ d = t.data("jstree"),
+ // is_ajax -> return this.settings.core.is_ajax || this._data.ajax;
+ s = (d && d.opened) || t.hasClass("jstree-open") ? "open" : (d && d.closed) || t.children("ul").length || (d && d.children) ? "closed" : "leaf"; // replace with t.find('>ul>li').length || (this.is_ajax() && !t.children('ul').length)
+ if(d && d.opened) { delete d.opened; }
+ if(d && d.closed) { delete d.closed; }
+ t.removeClass("jstree-open jstree-closed jstree-leaf jstree-last");
+ if(!t.children("a").length) {
+ // allow for text and HTML markup inside the nodes
+ t.contents().filter(function() { return this.nodeType === 3 || this.tagName !== 'UL'; }).wrapAll('<a href="#"></a>');
+ // TODO: make this faster
+ t.children('a').html(t.children('a').html().replace(/[\s\t\n]+$/,''));
+ }
+ else {
+ if(!$.trim(t.children('a').attr('href'))) { t.children('a').attr("href","#"); }
+ }
+ t.children('a').addClass('jstree-anchor');
+ if(!t.children("i.jstree-ocl").length) {
+ t.prepend("<i class='jstree-icon jstree-ocl'> </i>");
+ }
+ if(t.is(":last-child")) {
+ t.addClass("jstree-last");
+ }
+ switch(s) {
+ case 'leaf':
+ t.addClass('jstree-leaf');
+ break;
+ case 'closed':
+ t.addClass('jstree-open');
+ _this.close_node(t, 0);
+ break;
+ case 'open':
+ t.addClass('jstree-closed');
+ _this.open_node(t, false, 0);
+ break;
+ }
+ // theme part
+ if(!t.find("> a > i.jstree-themeicon").length) {
+ t.children("a").prepend("<i class='jstree-icon jstree-themeicon'> </i>");
+ }
+ if(d && typeof d.icon !== 'undefined') {
+ _this.set_icon(t, d.icon);
+ delete d.icon;
+ }
+ // selected part
+ t.find('.jstree-clicked').removeClass('jstree-clicked');
+ if(d && d.selected) {
+ setTimeout(function () { _this.select_node(t); }, 0);
+ delete d.selected;
+ }
+ });
+ },
+ correct_node : function (obj, deep) {
+ obj = this.get_node(obj);
+ if(!obj || (obj === -1 && !deep)) { return false; }
+ if(obj === -1) { obj = this.element.find('li'); }
+ else { obj = deep ? obj.find('li').addBack() : obj; }
+ obj.each(function () {
+ var obj = $(this);
+ switch(!0) {
+ case obj.hasClass("jstree-open") && !obj.find("> ul > li").length:
+ obj.removeClass("jstree-open").addClass("jstree-leaf").children("ul").remove(); // children("ins").html(" ").end()
+ break;
+ case obj.hasClass("jstree-leaf") && !!obj.find("> ul > li").length:
+ obj.removeClass("jstree-leaf").addClass("jstree-closed"); //.children("ins").html("+");
+ break;
+ }
+ obj[obj.is(":last-child") ? 'addClass' : 'removeClass']("jstree-last");
+ });
+ return obj;
+ },
+ get_state : function () {
+ var state = {
+ 'core' : {
+ 'open' : [],
+ 'scroll' : {
+ 'left' : this.element.scrollLeft(),
+ 'top' : this.element.scrollTop()
+ },
+ 'themes' : {
+ 'name' : this.get_theme(),
+ 'icons' : this._data.core.themes.icons,
+ 'dots' : this._data.core.themes.dots
+ },
+ 'selected' : []
+ }
+ };
+ this.get_container_ul().find('.jstree-open').each(function () { if(this.id) { state.core.open.push(this.id); } });
+ this._data.core.selected.each(function () { if(this.id) { state.core.selected.push(this.id); } });
+ return state;
+ },
+ set_state : function (state, callback) {
+ if(state) {
+ if(state.core) {
+ if($.isArray(state.core.open)) {
+ var res = true,
+ t = this;
+ //this.close_all();
+ $.each(state.core.open.concat([]), function (i, v) {
+ v = document.getElementById(v);
+ if(v) {
+ if(t.is_loaded(v)) {
+ if(t.is_closed(v)) {
+ t.open_node(v, false, 0);
+ }
+ $.vakata.array_remove(state.core.open, i);
+ }
+ else {
+ if(!t.is_loading(v)) {
+ t.open_node(v, $.proxy(function () { this.set_state(state); }, t), 0);
+ }
+ // there will be some async activity - so wait for it
+ res = false;
+ }
+ }
+ });
+ if(res) {
+ delete state.core.open;
+ this.set_state(state, callback);
+ }
+ return false;
+ }
+ if(state.core.scroll) {
+ if(state.core.scroll && typeof state.core.scroll.left !== 'undefined') {
+ this.element.scrollLeft(state.core.scroll.left);
+ }
+ if(state.core.scroll && typeof state.core.scroll.top !== 'undefined') {
+ this.element.scrollTop(state.core.scroll.top);
+ }
+ delete state.core.scroll;
+ delete state.core.open;
+ this.set_state(state, callback);
+ return false;
+ }
+ if(state.core.themes) {
+ if(state.core.themes.name) {
+ this.set_theme(state.core.themes.name);
+ }
+ if(typeof state.core.themes.dots !== 'undefined') {
+ this[ state.core.themes.dots ? "show_dots" : "hide_dots" ]();
+ }
+ if(typeof state.core.themes.icons !== 'undefined') {
+ this[ state.core.themes.icons ? "show_icons" : "hide_icons" ]();
+ }
+ delete state.core.themes;
+ delete state.core.open;
+ this.set_state(state, callback);
+ return false;
+ }
+ if(state.core.selected) {
+ var _this = this;
+ this.deselect_all();
+ $.each(state.core.selected, function (i, v) {
+ _this.select_node(document.getElementById(v));
+ });
+ delete state.core.selected;
+ this.set_state(state, callback);
+ return false;
+ }
+ if($.isEmptyObject(state)) {
+ if(callback) { callback.call(this); }
+ this.trigger('set_state');
+ return false;
+ }
+ return true;
+ }
+ return true;
+ }
+ return false;
+ },
+ refresh : function () {
+ this._data.core.state = this.get_state();
+ this.load_node(-1, function (o, s) {
+ if(s) {
+ this.set_state($.extend(true, {}, this._data.core.state), function () {
+ this.trigger('refresh');
+ });
+ }
+ this._data.core.state = null;
+ });
+ },
+ get_text : function (obj, remove_html) {
+ obj = this.get_node(obj);
+ if(!obj || obj === -1 || !obj.length) { return false; }
+ obj = obj.children("a:eq(0)").clone();
+ obj.children(".jstree-icon").remove();
+ obj = obj[ remove_html ? 'text' : 'html' ]();
+ obj = $('<div />')[ remove_html ? 'text' : 'html' ](obj);
+ return obj.html();
+ },
+ set_text : function (obj, val) {
+ obj = this.get_node(obj);
+ if(!obj || obj === -1 || !obj.length) { return false; }
+ obj = obj.children("a:eq(0)");
+ var tmp = obj.children("I").clone();
+ obj.html(val).prepend(tmp);
+ this.trigger('set_text',{ "obj" : obj, "text" : val });
+ return true;
+ },
+ parse_json : function (node) {
+ var li, a, ul, t;
+ if(node === null || ($.isArray(node) && node.length === 0)) {
+ return false;
+ }
+ if($.isArray(node)) {
+ ul = $("<ul />");
+ t = this;
+ $.each(node, function (i, v) {
+ ul.append(t.parse_json(v));
+ });
+ return ul;
+ }
+ if(typeof node === "undefined") { node = {}; }
+ if(typeof node === "string") { node = { "title" : node }; }
+ if(!node.li_attr) { node.li_attr = {}; }
+ if(!node.a_attr) { node.a_attr = {}; }
+ if(!node.a_attr.href) { node.a_attr.href = '#'; }
+ if(!node.title) { node.title = this.get_string("New node"); }
+
+ li = $("<li />").attr(node.li_attr);
+ a = $("<a />").attr(node.a_attr).html(node.title);
+ ul = $("<ul />");
+ if(node.data && !$.isEmptyObject(node.data)) { li.data(node.data); }
+ if(
+ node.children === true ||
+ $.isArray(node.children) ||
+ (li.data('jstree') && $.isArray(li.data('jstree').children))
+ ) {
+ if(!li.data('jstree')) {
+ li.data('jstree', {});
+ }
+ li.data('jstree').closed = true;
+ }
+ li.append(a);
+ if($.isArray(node.children)) {
+ $.each(node.children, $.proxy(function (i, n) {
+ ul.append(this.parse_json(n));
+ }, this));
+ li.append(ul);
+ }
+ return li;
+ },
+ get_json : function (obj, is_callback) {
+ obj = typeof obj !== 'undefined' ? this.get_node(obj) : false;
+ if(!is_callback) {
+ if(!obj || obj === -1) { obj = this.get_container_ul().children("li"); }
+ }
+ var r, t, li_attr = {}, a_attr = {}, tmp = {}, i;
+ if(!obj || !obj.length) { return false; }
+ if(obj.length > 1 || !is_callback) {
+ r = [];
+ t = this;
+ obj.each(function () {
+ r.push(t.get_json($(this), true));
+ });
+ return r;
+ }
+ tmp = $.vakata.attributes(obj, true);
+ $.each(tmp, function (i, v) {
+ if(i === 'id') { li_attr[i] = v; return true; }
+ v = $.trim(v.replace(/\bjstree[^ ]*/ig,'').replace(/\s+$/ig," "));
+ if(v.length) { li_attr[i] = v; }
+ });
+ tmp = $.vakata.attributes(obj.children('a'), true);
+ $.each(tmp, function (i, v) {
+ if(i === 'id') { a_attr[i] = v; return true; }
+ v = $.trim(v.replace(/\bjstree[^ ]*/ig,'').replace(/\s+$/ig," "));
+ if(v.length) { a_attr[i] = v; }
+ });
+ r = {
+ 'title' : this.get_text(obj),
+ 'data' : $.extend(true, {}, obj.data() || {}),
+ 'children' : false,
+ 'li_attr' : li_attr,
+ 'a_attr' : a_attr
+ };
+
+ if(!r.data.jstree) { r.data.jstree = {}; }
+ if(this.is_open(obj)) { r.data.jstree.opened = true; }
+ if(this.is_closed(obj)) { r.data.jstree.closed = true; }
+ i = this.get_icon(obj);
+ if(typeof i !== 'undefined' && i !== null) { r.data.jstree.icon = i; }
+ if(this.is_selected(obj)) { r.data.jstree.selected = true; }
+
+ obj = obj.find('> ul > li');
+ if(obj.length) {
+ r.children = [];
+ t = this;
+ obj.each(function () {
+ r.children.push(t.get_json($(this), true));
+ });
+ }
+ return r;
+ },
+ create_node : function (par, node, pos, callback, is_loaded) {
+ par = this.get_node(par);
+ pos = typeof pos === "undefined" ? "last" : pos;
+
+ if(par !== -1 && !par.length) { return false; }
+ if(!pos.match(/^(before|after)$/) && !is_loaded && !this.is_loaded(par)) {
+ return this.load_node(par, function () { this.create_node(par, node, pos, callback, true); });
+ }
+
+ var li = this.parse_json(node),
+ tmp = par === -1 ? this.element : par;
+
+ if(par === -1) {
+ if(pos === "before") { pos = "first"; }
+ if(pos === "after") { pos = "last"; }
+ }
+ switch(pos) {
+ case "before":
+ pos = par.index();
+ par = this.get_parent(par);
+ break;
+ case "after" :
+ pos = par.index() + 1;
+ par = this.get_parent(par);
+ break;
+ case "inside":
+ case "first":
+ pos = 0;
+ break;
+ case "last":
+ pos = tmp.children('ul').children('li').length;
+ break;
+ default:
+ if(!pos) { pos = 0; }
+ break;
+ }
+ if(!this.check("create_node", li, par, pos)) { return false; }
+
+ tmp = par === -1 ? this.element : par;
+ if(!tmp.children("ul").length) { tmp.append("<ul />"); }
+ if(tmp.children("ul").children("li").eq(pos).length) {
+ tmp.children("ul").children("li").eq(pos).before(li);
+ }
+ else {
+ tmp.children("ul").append(li);
+ }
+ this.correct_node(par, true);
+ if(callback) { callback.call(this, li); }
+ this.trigger('create_node', { "node" : li, "parent" : par, "position" : li.index() });
+ return li;
+ },
+ rename_node : function (obj, val) {
+ obj = this.get_node(obj);
+ var old = this.get_text(obj);
+ if(!this.check("rename_node", obj, this.get_parent(obj), val)) { return false; }
+ if(obj && obj.length) {
+ this.set_text(obj, val); // .apply(this, Array.prototype.slice.call(arguments))
+ this.trigger('rename_node', { "node" : obj, "title" : val, "old" : old });
+ }
+ },
+ delete_node : function (obj) {
+ obj = this.get_node(obj);
+ if(!obj || obj === -1 || !obj.length) { return false; }
+ var par = this.get_parent(obj),
+ pre = this.get_prev(obj);
+ if(!this.check("delete_node", obj, par, obj.index())) { return false; }
+ obj = obj.detach();
+ this.correct_node(par);
+ this.correct_node(pre);
+ this.trigger('delete_node', { "node" : obj, "prev" : pre, "parent" : par });
+
+ var n = obj.find(".jstree-clicked"),
+ t = this;
+ if(n.length) {
+ n.each(function () { t.deselect_node(this, true); });
+ this.trigger('changed', { 'action' : 'delete_node', 'node' : obj, 'selected' : this._data.core.selected, 'parent' : par });
+ }
+ return obj;
+ },
+ check : function (chk, obj, par, pos) {
+ var tmp = chk.match(/^move_node|copy_node|create_node$/i) ? par : obj,
+ chc = this.settings.core.check_callback;
+ if(chc === false || ($.isFunction(chc) && chc.call(this, chk, obj, par, pos) === false)) {
+ return false;
+ }
+ tmp = tmp === -1 ? this.element.data('jstree') : tmp.data('jstree');
+ if(tmp && tmp.functions && tmp.functions[chk]) {
+ tmp = tmp.functions[chk];
+ if($.isFunction(tmp)) {
+ tmp = tmp.call(this, chk, obj, par, pos);
+ }
+ if(tmp === false) {
+ return false;
+ }
+ }
+ switch(chk) {
+ case "create_node":
+ break;
+ case "rename_node":
+ break;
+ case "move_node":
+ tmp = par === -1 ? this.element : par;
+ tmp = tmp.children('ul').children('li');
+ if(tmp.length && tmp.index(obj) !== -1 && (pos === obj.index() || pos === obj.index() + 1)) {
+ return false;
+ }
+ if(par !== -1 && par.parentsUntil('.jstree', 'li').addBack().index(obj) !== -1) {
+ return false;
+ }
+ break;
+ case "copy_node":
+ break;
+ case "delete_node":
+ break;
+ }
+ return true;
+ },
+ move_node : function (obj, par, pos, callback, is_loaded) {
+ obj = this.get_node(obj);
+ par = this.get_node(par);
+ pos = typeof pos === "undefined" ? 0 : pos;
+
+ if(!obj || obj === -1 || !obj.length) { return false; }
+ if(par !== -1 && !par.length) { return false; }
+ if(!pos.toString().match(/^(before|after)$/) && !is_loaded && !this.is_loaded(par)) {
+ return this.load_node(par, function () { this.move_node(obj, par, pos, callback, true); });
+ }
+
+ var old_par = this.get_parent(obj),
+ new_par = (!pos.toString().match(/^(before|after)$/) || par === -1) ? par : this.get_parent(par),
+ old_ins = $.jstree.reference(obj),
+ new_ins = par === -1 ? this : $.jstree.reference(par),
+ is_multi = (old_ins._id !== new_ins._id);
+ if(new_par === -1) {
+ par = new_ins.get_container();
+ if(pos === "before") { pos = "first"; }
+ if(pos === "after") { pos = "last"; }
+ }
+ switch(pos) {
+ case "before":
+ pos = par.index();
+ break;
+ case "after" :
+ pos = par.index() + 1;
+ break;
+ case "inside":
+ case "first":
+ pos = 0;
+ break;
+ case "last":
+ pos = par.children('ul').children('li').length;
+ break;
+ default:
+ if(!pos) { pos = 0; }
+ break;
+ }
+ if(!this.check("move_node", obj, new_par, pos)) { return false; }
+
+ if(!par.children("ul").length) { par.append("<ul />"); }
+ if(par.children("ul").children("li").eq(pos).length) {
+ par.children("ul").children("li").eq(pos).before(obj);
+ }
+ else {
+ par.children("ul").append(obj);
+ }
+
+ if(is_multi) { // if multitree - clean the node recursively - remove all icons, and call deep clean_node
+ obj.find('.jstree-icon, .jstree-ocl').remove();
+ this.clean_node(obj);
+ }
+ old_ins.correct_node(old_par, true);
+ new_ins.correct_node(new_par, true);
+ if(callback) { callback.call(this, obj, new_par, obj.index()); }
+ this.trigger('move_node', { "node" : obj, "parent" : new_par, "position" : obj.index(), "old_parent" : old_par, "is_multi" : is_multi, 'old_instance' : old_ins, 'new_instance' : new_ins });
+ return true;
+ },
+ copy_node : function (obj, par, pos, callback, is_loaded) {
+ obj = this.get_node(obj);
+ par = this.get_node(par);
+ pos = typeof pos === "undefined" ? "last" : pos;
+
+ if(!obj || obj === -1 || !obj.length) { return false; }
+ if(par !== -1 && !par.length) { return false; }
+ if(!pos.toString().match(/^(before|after)$/) && !is_loaded && !this.is_loaded(par)) {
+ return this.load_node(par, function () { this.copy_node(obj, par, pos, callback, true); });
+ }
+ var org_obj = obj,
+ old_par = this.get_parent(obj),
+ new_par = (!pos.toString().match(/^(before|after)$/) || par === -1) ? par : this.get_parent(par),
+ old_ins = $.jstree.reference(obj),
+ new_ins = par === -1 ? this : $.jstree.reference(par),
+ is_multi = (old_ins._id !== new_ins._id);
+
+ obj = obj.clone(true);
+ obj.find("*[id]").addBack().each(function () {
+ if(this.id) { this.id = "copy_" + this.id; }
+ });
+ if(new_par === -1) {
+ par = new_ins.get_container();
+ if(pos === "before") { pos = "first"; }
+ if(pos === "after") { pos = "last"; }
+ }
+ switch(pos) {
+ case "before":
+ pos = par.index();
+ break;
+ case "after" :
+ pos = par.index() + 1;
+ break;
+ case "inside":
+ case "first":
+ pos = 0;
+ break;
+ case "last":
+ pos = par.children('ul').children('li').length;
+ break;
+ default:
+ if(!pos) { pos = 0; }
+ break;
+ }
+
+ if(!this.check("copy_node", org_obj, new_par, pos)) { return false; }
+
+ if(!par.children("ul").length) { par.append("<ul />"); }
+ if(par.children("ul").children("li").eq(pos).length) {
+ par.children("ul").children("li").eq(pos).before(obj);
+ }
+ else {
+ par.children("ul").append(obj);
+ }
+ if(is_multi) { // if multitree - clean the node recursively - remove all icons, and call deep clean_node
+ obj.find('.jstree-icon, .jstree-ocl').remove();
+ }
+ new_ins.clean_node(obj); // always clean so that selected states, etc. are removed
+ new_ins.correct_node(new_par, true); // no need to correct the old parent, as nothing has changed there
+ if(callback) { callback.call(this, obj, new_par, obj.index(), org_obj); }
+ this.trigger('copy_node', { "node" : obj, "parent" : new_par, "old_parent" : old_par, "position" : obj.index(), "original" : org_obj, "is_multi" : is_multi, 'old_instance' : old_ins, 'new_instance' : new_ins });
+ return true;
+ },
+ cut : function (obj) {
+ obj = this.get_node(obj);
+ if(!obj || obj === -1 || !obj.length) { return false; }
+ ccp_node = obj;
+ ccp_mode = 'move_node';
+ this.trigger('cut', { "node" : obj });
+ },
+ copy : function (obj) {
+ obj = this.get_node(obj);
+ if(!obj || obj === -1 || !obj.length) { return false; }
+ ccp_node = obj;
+ ccp_mode = 'copy_node';
+ this.trigger('copy', { "node" : obj });
+ },
+ get_buffer : function () {
+ return { 'mode' : ccp_mode, 'node' : ccp_node };
+ },
+ can_paste : function () {
+ return ccp_mode !== false && ccp_node !== false;
+ },
+ paste : function (obj) {
+ obj = this.get_node(obj);
+ if(!obj || !ccp_mode || !ccp_mode.match(/^(copy_node|move_node)$/) || !ccp_node) { return false; }
+ this[ccp_mode](ccp_node, obj);
+ this.trigger('paste', { "obj" : obj, "nodes" : ccp_node, "mode" : ccp_mode });
+ ccp_node = false;
+ ccp_mode = false;
+ },
+ edit : function (obj, default_text) {
+ obj = this.get_node(obj);
+ if(!obj || obj === -1 || !obj.length) { return false; }
+ obj.parentsUntil(".jstree",".jstree-closed").each($.proxy(function (i, v) {
+ this.open_node(v, false, 0);
+ }, this));
+ var rtl = this._data.core.rtl,
+ w = this.element.width(),
+ a = obj.children('a:eq(0)'),
+ oi = obj.children("i"),
+ ai = a.children("i"),
+ w1 = oi.width() * oi.length,
+ w2 = ai.width() * ai.length,
+ t = typeof default_text === 'string' ? default_text : this.get_text(obj),
+ h1 = $("<div />", { css : { "position" : "absolute", "top" : "-200px", "left" : (rtl ? "0px" : "-1000px"), "visibility" : "hidden" } }).appendTo("body"),
+ h2 = obj.css("position","relative").append(
+ $("<input />", {
+ "value" : t,
+ "class" : "jstree-rename-input",
+ // "size" : t.length,
+ "css" : {
+ "padding" : "0",
+ "border" : "1px solid silver",
+ "position" : "absolute",
+ "left" : (rtl ? "auto" : (w1 + w2 + 4) + "px"),
+ "right" : (rtl ? (w1 + w2 + 4) + "px" : "auto"),
+ "top" : "0px",
+ "height" : (this._data.core.li_height - 2) + "px",
+ "lineHeight" : (this._data.core.li_height - 2) + "px",
+ "width" : "150px" // will be set a bit further down
+ },
+ "blur" : $.proxy(function () {
+ var i = obj.children(".jstree-rename-input"),
+ v = i.val();
+ if(v === "") { v = t; }
+ h1.remove();
+ i.remove();
+ if(this.rename_node(obj, v) === false) {
+ this.rename_node(obj, t);
+ }
+ obj.css("position", "");
+ }, this),
+ "keydown" : function (event) {
+ var key = event.keyCode || event.which;
+ if(key === 27) {
+ this.value = t;
+ }
+ if(key === 27 || key === 13 || key === 37 || key === 38 || key === 39 || key === 40) {
+ event.stopImmediatePropagation();
+ }
+ if(key === 27 || key === 13) {
+ event.preventDefault();
+ this.blur();
+ }
+ },
+ "keyup" : function (event) {
+ var key = event.keyCode || event.which;
+ h2.width(Math.min(h1.text("pW" + this.value).width(),w));
+ },
+ "keypress" : function(event) {
+ var key = event.keyCode || event.which;
+ if(key === 13) { return false; }
+ }
+ })
+ ).children(".jstree-rename-input"),
+ fn = {
+ fontFamily : a.css('fontFamily') || '',
+ fontSize : a.css('fontSize') || '',
+ fontWeight : a.css('fontWeight') || '',
+ fontStyle : a.css('fontStyle') || '',
+ fontStretch : a.css('fontStretch') || '',
+ fontVariant : a.css('fontVariant') || '',
+ letterSpacing : a.css('letterSpacing') || '',
+ wordSpacing : a.css('wordSpacing') || ''
+ };
+ this.set_text(obj, "");
+ h1.css(fn);
+ h2.css(fn).width(Math.min(h1.text("pW" + h2[0].value).width(),w))[0].select();
+ },
+
+ // theme related functions
+ set_theme : function (theme_name, theme_url) {
+ if(!theme_name) { return false; }
+ if(theme_url === true) {
+ var dir = this.settings.core.themes.dir;
+ if(!dir) { dir = $.jstree.path + '/themes'; }
+ theme_url = dir + '/' + theme_name + '/style.css';
+ }
+ if(theme_url && $.inArray(theme_url, themes_loaded) === -1) {
+ $('head').append('<link rel="stylesheet" href="' + theme_url + '" type="text/css" />');
+ themes_loaded.push(theme_url);
+ }
+ if(this._data.core.themes.name) {
+ this.element.removeClass('jstree-' + this._data.core.themes.name);
+ }
+ this._data.core.themes.name = theme_name;
+ this.element.addClass('jstree-' + theme_name);
+ this.trigger('set_theme', { 'theme' : theme_name });
+ },
+ get_theme : function () { return this._data.core.themes.name; },
+ show_dots : function () { this._data.core.themes.dots = true; this.get_container().children("ul").removeClass("jstree-no-dots"); },
+ hide_dots : function () { this._data.core.themes.dots = false; this.get_container().children("ul").addClass("jstree-no-dots"); },
+ toggle_dots : function () { if(this._data.core.themes.dots) { this.hide_dots(); } else { this.show_dots(); } },
+ show_icons : function () { this._data.core.themes.icons = true; this.get_container().children("ul").removeClass("jstree-no-icons"); },
+ hide_icons : function () { this._data.core.themes.icons = false; this.get_container().children("ul").addClass("jstree-no-icons"); },
+ toggle_icons : function () { if(this._data.core.themes.icons) { this.hide_icons(); } else { this.show_icons(); } },
+ set_icon : function (obj, icon) {
+ obj = this.get_node(obj);
+ if(!obj || obj === -1 || !obj.length) { return false; }
+ obj = obj.find("> a > .jstree-themeicon");
+ if(icon === false) {
+ this.hide_icon(obj);
+ }
+ else if(icon.indexOf("/") === -1) {
+ obj.addClass(icon).attr("rel",icon);
+ }
+ else {
+ obj.css("background", "url('" + icon + "') center center no-repeat").attr("rel",icon);
+ }
+ return true;
+ },
+ get_icon : function (obj) {
+ obj = this.get_node(obj);
+ if(!obj || obj === -1 || !obj.length) { return null; }
+ obj = obj.find("> a > .jstree-themeicon");
+ if(obj.hasClass('jstree-themeicon-hidden')) { return false; }
+ obj = obj.attr("rel");
+ return (obj && obj.length) ? obj : null;
+ },
+ hide_icon : function (obj) {
+ obj = this.get_node(obj);
+ if(!obj || obj === -1 || !obj.length) { return false; }
+ obj.find('> a > .jstree-themeicon').addClass('jstree-themeicon-hidden');
+ return true;
+ },
+ show_icon : function (obj) {
+ obj = this.get_node(obj);
+ if(!obj || obj === -1 || !obj.length) { return false; }
+ obj.find('> a > .jstree-themeicon').removeClass('jstree-themeicon-hidden');
+ return true;
+ }
+ };
+
+ var src = $('script:last').attr('src');
+ $.jstree.path = src ? src.replace(/\/[^\/]+$/,'') : '';
+ $.jstree.no_css = src && src.indexOf('?no_css') !== -1;
+
+ if($.jstree.no_css) {
+ $.jstree.defaults.core.themes.url = false;
+ }
+
+ /* base CSS */
+ $(function() {
+ var css_string = '' +
+ //'.jstree * { -webkit-box-sizing:content-box; -moz-box-sizing:content-box; box-sizing:content-box; }' +
+ '.jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; list-style-image:none; } ' +
+ '.jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; min-width:18px; } ' +
+ '.jstree-rtl li { margin-left:0; margin-right:18px; } ' +
+ '.jstree > ul > li { margin-left:0px; } ' +
+ '.jstree-rtl > ul > li { margin-right:0px; } ' +
+ '.jstree .jstree-icon { display:inline-block; text-decoration:none; margin:0; padding:0; vertical-align:top; } ' +
+ '.jstree .jstree-ocl { width:18px; height:18px; text-align:center; line-height:18px; cursor:pointer; vertical-align:top; } ' +
+ '.jstree li.jstree-open > ul { display:block; } ' +
+ '.jstree li.jstree-closed > ul { display:none; } ' +
+ '.jstree-anchor { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; padding:1px 2px; margin:0; text-decoration:none; outline:0; } ' +
+ '.jstree-anchor > .jstree-themeicon { height:16px; width:16px; margin-right:3px; } ' +
+ '.jstree-rtl .jstree-anchor > .jstree-themeicon { margin-left:3px; margin-right:0; } ' +
+ '.jstree-no-icons .jstree-themeicon, .jstree-anchor > .jstree-themeicon-hidden { display:none; } ';
+ if(!$.jstree.no_css) {
+ $('head').append('<style type="text/css">' + css_string + '</style>');
+ }
+ });
+
+ // helpers
+ $.vakata = {};
+ // collect attributes
+ $.vakata.attributes = function(node, with_values) {
+ node = $(node)[0];
+ var attr = with_values ? {} : [];
+ $.each(node.attributes, function (i, v) {
+ if($.inArray(v.nodeName.toLowerCase(),['style','contenteditable','hasfocus','tabindex']) !== -1) { return; }
+ if(v.nodeValue !== null && $.trim(v.nodeValue) !== '') {
+ if(with_values) { attr[v.nodeName] = v.nodeValue; }
+ else { attr.push(v.nodeName); }
+ }
+ });
+ return attr;
+ };
+ // remove item from array
+ $.vakata.array_remove = function(array, from, to) {
+ var rest = array.slice((to || from) + 1 || array.length);
+ array.length = from < 0 ? array.length + from : from;
+ array.push.apply(array, rest);
+ return array;
+ };
+ // private function for json quoting strings
+ var _quote = function (str) {
+ var escapeable = /["\\\x00-\x1f\x7f-\x9f]/g,
+ meta = { '\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"' :'\\"','\\':'\\\\' };
+ if(str.match(escapeable)) {
+ return '"' + str.replace(escapeable, function (a) {
+ var c = meta[a];
+ if(typeof c === 'string') { return c; }
+ c = a.charCodeAt();
+ return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
+ }) + '"';
+ }
+ return '"' + str + '"';
+ };
+ $.vakata.json = {
+ encode : function (o) {
+ if (o === null) { return "null"; }
+
+ var tmp = [], i;
+ switch(typeof(o)) {
+ case "undefined":
+ return undefined;
+ case "number":
+ case "boolean":
+ return o + "";
+ case "string":
+ return _quote(o);
+ case "object":
+ if($.isFunction(o.toJSON)) {
+ return $.vakata.json.encode(o.toJSON());
+ }
+ if(o.constructor === Date) {
+ return '"' +
+ o.getUTCFullYear() + '-' +
+ String("0" + (o.getUTCMonth() + 1)).slice(-2) + '-' +
+ String("0" + o.getUTCDate()).slice(-2) + 'T' +
+ String("0" + o.getUTCHours()).slice(-2) + ':' +
+ String("0" + o.getUTCMinutes()).slice(-2) + ':' +
+ String("0" + o.getUTCSeconds()).slice(-2) + '.' +
+ String("00" + o.getUTCMilliseconds()).slice(-3) + 'Z"';
+ }
+ if(o.constructor === Array) {
+ for(i = 0; i < o.length; i++) {
+ tmp.push( $.vakata.json.encode(o[i]) || "null" );
+ }
+ return "[" + tmp.join(",") + "]";
+ }
+
+ $.each(o, function (i, v) {
+ if($.isFunction(v)) { return true; }
+ i = typeof i === "number" ? '"' + i + '"' : _quote(i);
+ v = $.vakata.json.encode(v);
+ tmp.push(i + ":" + v);
+ });
+ return "{" + tmp.join(", ") + "}";
+ }
+ },
+ decode : function (json) {
+ return $.parseJSON(json);
+ }
+ };
+
+})(jQuery);
+
+
+/*
+ * jstree sample plugin
+
+// wrap in IIFE and pass jQuery as $
+(function ($) {
+ // some private plugin stuff if needed
+ var private_var = null;
+
+ // extending the defaults
+ $.jstree.defaults.sample = {
+ sample_option : 'sample_val'
+ };
+
+ // the actual plugin code
+ $.jstree.plugins.sample = function (options, parent) {
+ // own function
+ this.sample_function = function (arg) {
+ // you can chain this method if needed and available
+ if(parent.sample_function) { parent.sample_function.call(this, arg); }
+ };
+
+ // *SPECIAL* FUNCTIONS
+ this.init = function () {
+ // do not forget parent
+ parent.init.call(this);
+ };
+ // bind events if needed
+ this.bind = function () {
+ // call parent function first
+ parent.bind.call(this);
+ // do(stuff);
+ };
+ // unbind events if needed (all in jquery namespace are taken care of by the core)
+ this.unbind = function () {
+ // do(stuff);
+ // call parent function last
+ parent.unbind.call(this);
+ };
+ this.teardown = function () {
+ // do not forget parent
+ parent.teardown.call(this);
+ };
+ // very heavy - use only if needed and be careful
+ this.clean_node = function(obj) {
+ // always get the cleaned node from the parent
+ obj = parent.clean_node.call(this, obj);
+ return obj.each(function () {
+ // process nodes
+ });
+ };
+ // state management - get and restore
+ this.get_state = function () {
+ // always get state from parent first
+ var state = parent.get_state.call(this);
+ // add own stuff to state
+ state.sample = { 'var' : 'val' };
+ return state;
+ };
+ this.set_state = function (state, callback) {
+ // only process your part if parent returns true
+ // there will be multiple times with false
+ if(parent.set_state.call(state, callback)) {
+ // check the key you set above
+ if(state.sample) {
+ // do(stuff); // like calling this.sample_function(state.sample.var);
+ // remove your part of the state and RETURN FALSE, the next cycle will be TRUE
+ delete state.sample;
+ return false;
+ }
+ // return true if your state is gone (cleared in the previous step)
+ return true;
+ }
+ // parent was false - return false too
+ return false;
+ };
+ // node transportation
+ this.get_json = function (obj, is_callback) {
+ // get the node from the parent
+ var r = parent.get_json.call(this, obj, is_callback);
+ // only modify the node if is_callback is true
+ if(is_callback) {
+ r.data.sample = 'value';
+ }
+ // return the original / modified node
+ return r;
+ };
+ };
+
+ // attach to document ready if needed
+ $(function () {
+ // do(stuff);
+ });
+
+ // you can include the sample plugin in all instances by default
+ $.jstree.defaults.plugins.push("sample");
+})(jQuery);
+//*/
+
+/* File: jstree.checkbox.js
+Adds checkboxes to the tree.
+*/
+(function ($) {
+ $.jstree.defaults.checkbox = {
+ three_state : true,
+ whole_node : false,
+ keep_selected_style : true
+ };
+
+ $.jstree.plugins.checkbox = function (options, parent) {
+ this.bind = function () {
+ parent.bind.call(this);
+
+ if(!this.settings.checkbox.keep_selected_style) {
+ this.element.addClass('jstree-checkbox-no-clicked');
+ }
+
+ if(this.settings.checkbox.three_state) {
+ this.element
+ .on('changed.jstree', $.proxy(function (e, data) {
+ var action = data.action || '',
+ node = false,
+ change = false;
+ switch(action) {
+ case 'select_node':
+ node = data.node.parent();
+ data.node.find('.jstree-anchor:not(.jstree-clicked)').each($.proxy(function (i,v) {
+ change = true;
+ this.select_node(v, true);
+ }, this)).end().find('.jstree-undetermined').removeClass('jstree-undetermined');
+ break;
+ case 'deselect_node':
+ node = data.node.parent();
+ data.node.find('.jstree-clicked').each($.proxy(function (i,v) {
+ change = true;
+ this.deselect_node(v, true);
+ }, this)).end().find('.jstree-undetermined').removeClass('jstree-undetermined');
+ break;
+ case 'deselect_all':
+ this.element.find('.jstree-undetermined').removeClass('jstree-undetermined');
+ break;
+ case 'delete_node':
+ node = data.parent;
+ break;
+ default:
+ break;
+ }
+ if(node && this.check_up(node)) {
+ change = true;
+ }
+ if(change) {
+ this.trigger('changed', { 'action' : 'checkbox_three_state', 'selected' : this._data.core.selected });
+ }
+ }, this))
+ .on('move_node.jstree copy_node.jstree', $.proxy(function (e, data) {
+ if(data.old_instance && data.old_instance.check_up && data.old_instance.check_up(data.old_parent)) {
+ data.old_instance.trigger('changed', { 'action' : 'checkbox_three_state', 'selected' : data.old_instance._data.core.selected });
+ }
+ if(data.new_instance && data.new_instance.check_up && data.new_instance.check_up(data.parent)) {
+ data.new_instance.trigger('changed', { 'action' : 'checkbox_three_state', 'selected' : data.new_instance._data.core.selected });
+ }
+ }, this));
+ }
+ };
+ this.clean_node = function(obj) {
+ obj = parent.clean_node.call(this, obj);
+ var t = this;
+ obj = obj.each(function () {
+ var o = $(this).children('a');
+ if(!o.children(".jstree-checkbox").length) {
+ o.prepend("<i class='jstree-icon jstree-checkbox'></i>");
+ }
+ });
+ return obj;
+ };
+ this.activate_node = function (obj, e) {
+ if(this.settings.checkbox.whole_node || $(e.target).hasClass('jstree-checkbox')) {
+ e.ctrlKey = true;
+ }
+ parent.activate_node.call(this, obj, e);
+ };
+ this.check_up = function (obj) {
+ if(!this.settings.checkbox.three_state) { return false; }
+ obj = this.get_node(obj);
+ if(obj === -1 || !obj || !obj.length) { return false; }
+
+ var state = 0,
+ has_children = obj.find('> ul > li').length > 0,
+ all_checked = has_children && obj.find('> ul > li').not(this._data.core.selected).length === 0,
+ none_checked = has_children && obj.find('.jstree-clicked').length === 0;
+
+ if(!state && this.is_selected(obj)) { state = 1; }
+ if(!state && obj.find('> a > .jstree-undetermined').length) { state = 2; }
+
+ // if no children
+ if(!has_children) {
+ if(state === 2) {
+ obj.find('.jstree-undetermined').removeClass('jstree-undetermined');
+ }
+ return false;
+ }
+ // if all checked children
+ if(all_checked) {
+ if(state !== 1) {
+ obj.find('.jstree-undetermined').removeClass('jstree-undetermined');
+ this.select_node(obj, true);
+ this.check_up(obj.parent());
+ }
+ return true;
+ }
+ // if none children checked
+ if(none_checked) {
+ if(state === 2) {
+ obj.find('.jstree-undetermined').removeClass('jstree-undetermined');
+ this.check_up(obj.parent());
+ return false;
+ }
+ if(state === 1) {
+ this.deselect_node(obj, true);
+ this.check_up(obj.parent());
+ return true;
+ }
+ return false;
+ }
+ // some children are checked and state is checked
+ if(state === 1) {
+ obj.find('> a > .jstree-checkbox').addClass('jstree-undetermined');
+ this.deselect_node(obj, true);
+ this.check_up(obj.parent());
+ return true;
+ }
+ // some children are checked and state is unchecked
+ if(state === 0) {
+ obj.find('> a > .jstree-checkbox').addClass('jstree-undetermined');
+ }
+ return false;
+ };
+ };
+
+ $(function () {
+ // add checkbox specific CSS
+ var css_string = '' +
+ '.jstree-anchor > .jstree-checkbox { height:16px; width:16px; margin-right:1px; } ' +
+ '.jstree-rtl .jstree-anchor > .jstree-checkbox { margin-right:0; margin-left:1px; } ';
+ // the default stylesheet
+ if(!$.jstree.no_css) {
+ $('head').append('<style type="text/css">' + css_string + '</style>');
+ }
+
+ });
+
+ // include the checkbox plugin by default
+ $.jstree.defaults.plugins.push("checkbox");
+})(jQuery);
+
+/* File: jstree.contextmenu.js
+Enables a rightclick contextmenu.
+*/
+/* Group: jstree sort plugin */
+(function ($) {
+ $.jstree.defaults.contextmenu = {
+ select_node : true,
+ show_at_node : true,
+ items : function (o) { // Could be an object directly
+ // TODO: in "_disabled" call this._check()
+ return {
+ "create" : {
+ "separator_before" : false,
+ "separator_after" : true,
+ "label" : "Create",
+ "action" : function (data) {
+ var inst = $.jstree.reference(data.reference),
+ obj = inst.get_node(data.reference);
+ inst.create_node(obj, {}, "last", function (new_node) {
+ setTimeout(function () { inst.edit(new_node); },0);
+ });
+ }
+ },
+ "rename" : {
+ "separator_before" : false,
+ "separator_after" : false,
+ "label" : "Rename",
+ "action" : function (data) {
+ var inst = $.jstree.reference(data.reference),
+ obj = inst.get_node(data.reference);
+ inst.edit(obj);
+ }
+ },
+ "remove" : {
+ "separator_before" : false,
+ "icon" : false,
+ "separator_after" : false,
+ "label" : "Delete",
+ "action" : function (data) {
+ var inst = $.jstree.reference(data.reference),
+ obj = inst.get_node(data.reference);
+ inst.delete_node(obj);
+ }
+ },
+ "ccp" : {
+ "separator_before" : true,
+ "icon" : false,
+ "separator_after" : false,
+ "label" : "Edit",
+ "action" : false,
+ "submenu" : {
+ "cut" : {
+ "separator_before" : false,
+ "separator_after" : false,
+ "label" : "Cut",
+ "action" : function (data) {
+ var inst = $.jstree.reference(data.reference),
+ obj = inst.get_node(data.reference);
+ inst.cut(obj);
+ }
+ },
+ "copy" : {
+ "separator_before" : false,
+ "icon" : false,
+ "separator_after" : false,
+ "label" : "Copy",
+ "action" : function (data) {
+ var inst = $.jstree.reference(data.reference),
+ obj = inst.get_node(data.reference);
+ inst.copy(obj);
+ }
+ },
+ "paste" : {
+ "separator_before" : false,
+ "icon" : false,
+ "_disabled" : !(this.can_paste()),
+ "separator_after" : false,
+ "label" : "Paste",
+ "action" : function (data) {
+ var inst = $.jstree.reference(data.reference),
+ obj = inst.get_node(data.reference);
+ inst.paste(obj);
+ }
+ }
+ }
+ }
+ };
+ }
+ };
+
+ $.jstree.plugins.contextmenu = function (options, parent) {
+ this.bind = function () {
+ parent.bind.call(this);
+
+ this.element
+ .on("contextmenu.jstree", "a", $.proxy(function (e) {
+ e.preventDefault();
+ if(!this.is_loading(e.currentTarget)) {
+ this.show_contextmenu(e.currentTarget, e.pageX, e.pageY);
+ }
+ }, this))
+ .on("click.jstree", "a", $.proxy(function (e) {
+ if(this._data.contextmenu.visible) {
+ $.vakata.contextmenu.hide();
+ }
+ }, this));
+ $(document).on("context_hide.vakata", $.proxy(function () { this._data.contextmenu.visible = false; }, this));
+ };
+ this.teardown = function () {
+ if(this._data.contextmenu.visible) {
+ $.vakata.contextmenu.hide();
+ }
+ parent.teardown.call(this);
+ };
+
+ this.show_contextmenu = function (obj, x, y) {
+ obj = this.get_node(obj);
+ var s = this.settings.contextmenu,
+ a = obj.children("a:visible:eq(0)"),
+ o = false,
+ i = false;
+ if(s.show_at_node || typeof x === "undefined" || typeof y === "undefined") {
+ o = a.offset();
+ x = o.left;
+ y = o.top + this._data.core.li_height;
+ }
+ if(!this.is_selected(obj)) {
+ this.deselect_all();
+ this.select_node(obj);
+ }
+
+ i = obj.data("jstree") && obj.data("jstree").contextmenu ? obj.data("jstree").contextmenu : s.items;
+ if($.isFunction(i)) { i = i.call(this, obj); }
+
+ $(document).one("context_show.vakata", $.proxy(function (e, data) {
+ var cls = 'jstree-contextmenu jstree-' + this.get_theme() + '-contextmenu';
+ $(data.element).addClass(cls);
+ }, this));
+ this._data.contextmenu.visible = true;
+ $.vakata.context.show(a, { 'x' : x, 'y' : y }, i);
+ this.trigger('show_contextmenu', { "node" : obj, "x" : x, "y" : y });
+ };
+ };
+
+ // contextmenu helper
+ (function ($) {
+ var right_to_left = false,
+ vakata_context = {
+ element : false,
+ reference : false,
+ position_x : 0,
+ position_y : 0,
+ items : [],
+ html : "",
+ is_visible : false
+ };
+
+ $.vakata.context = {
+ settings : {
+ hide_onmouseleave : 0,
+ icons : true
+ },
+ _trigger : function (event_name) {
+ $(document).triggerHandler("context_" + event_name + ".vakata", {
+ "reference" : vakata_context.reference,
+ "element" : vakata_context.element,
+ "position" : {
+ "x" : vakata_context.position_x,
+ "y" : vakata_context.position_y
+ }
+ });
+ },
+ _execute : function (i) {
+ i = vakata_context.items[i];
+ return i && !i._disabled && i.action ? i.action.call(null, {
+ "item" : i,
+ "reference" : vakata_context.reference,
+ "element" : vakata_context.element,
+ "position" : {
+ "x" : vakata_context.position_x,
+ "y" : vakata_context.position_y
+ }
+ }) : false;
+ },
+ _parse : function (o, is_callback) {
+ if(!o) { return false; }
+ if(!is_callback) {
+ vakata_context.html = "";
+ vakata_context.items = [];
+ }
+ var str = "",
+ sep = false,
+ tmp;
+
+ if(is_callback) { str += "<ul>"; }
+ $.each(o, function (i, val) {
+ if(!val) { return true; }
+ vakata_context.items.push(val);
+ if(!sep && val.separator_before) {
+ str += "<li class='vakata-context-separator'><a href='#' " + ($.vakata.context.settings.icons ? '' : 'style="margin-left:0px;"') + "> </a></li>";
+ }
+ sep = false;
+ str += "<li class='" + (val._class || "") + (val._disabled ? " vakata-contextmenu-disabled " : "") + "'>";
+ str += "<a href='#' rel='" + (vakata_context.items.length - 1) + "'>";
+ if($.vakata.context.settings.icons) {
+ str += "<ins ";
+ if(val.icon) {
+ if(val.icon.indexOf("/") !== -1) { str += " style='background:url(\"" + val.icon + "\") center center no-repeat' "; }
+ else { str += " class='" + val.icon + "' "; }
+ }
+ str += "> </ins><span> </span>";
+ }
+ str += val.label + "</a>";
+ if(val.submenu) {
+ tmp = $.vakata.context._parse(val.submenu, true);
+ if(tmp) { str += tmp; }
+ }
+ str += "</li>";
+ if(val.separator_after) {
+ str += "<li class='vakata-context-separator'><a href='#' " + ($.vakata.context.settings.icons ? '' : 'style="margin-left:0px;"') + "> </a></li>";
+ sep = true;
+ }
+ });
+ str = str.replace(/<li class\='vakata-context-separator'\><\/li\>$/,"");
+ if(is_callback) { str += "</ul>"; }
+ if(!is_callback) { vakata_context.html = str; $.vakata.context._trigger("parse"); }
+ return str.length > 10 ? str : false;
+ },
+ _show_submenu : function (o) {
+ o = $(o);
+ if(!o.length || !o.children("ul").length) { return; }
+ var e = o.children("ul"),
+ x = o.offset().left + o.outerWidth(),
+ y = o.offset().top,
+ w = e.width(),
+ h = e.height(),
+ dw = $(window).width() + $(window).scrollLeft(),
+ dh = $(window).height() + $(window).scrollTop();
+ // може да се спести е една проверка - дали няма някой от класовете вече нагоре
+ if(right_to_left) {
+ o[x - (w + 10 + o.outerWidth()) < 0 ? "addClass" : "removeClass"]("vakata-context-left");
+ }
+ else {
+ o[x + w + 10 > dw ? "addClass" : "removeClass"]("vakata-context-right");
+ }
+ if(y + h + 10 > dh) {
+ e.css("bottom","-1px");
+ }
+ e.show();
+ },
+ show : function (reference, position, data) {
+ if(vakata_context.element && vakata_context.element.length) {
+ vakata_context.element.width('');
+ }
+ switch(!0) {
+ case (!position && !reference):
+ return false;
+ case (!!position && !!reference):
+ vakata_context.reference = reference;
+ vakata_context.position_x = position.x;
+ vakata_context.position_y = position.y;
+ break;
+ case (!position && !!reference):
+ vakata_context.reference = reference;
+ var o = reference.offset();
+ vakata_context.position_x = o.left + reference.outerHeight();
+ vakata_context.position_y = o.top;
+ break;
+ case (!!position && !reference):
+ vakata_context.position_x = position.x;
+ vakata_context.position_y = position.y;
+ break;
+ }
+ if(!!reference && !data && $(reference).data('vakata_contextmenu')) {
+ data = $(reference).data('vakata_contextmenu');
+ }
+ if($.vakata.context._parse(data)) {
+ vakata_context.element.html(vakata_context.html);
+ }
+ if(vakata_context.items.length) {
+ var e = vakata_context.element,
+ x = vakata_context.position_x,
+ y = vakata_context.position_y,
+ w = e.width(),
+ h = e.height(),
+ dw = $(window).width() + $(window).scrollLeft(),
+ dh = $(window).height() + $(window).scrollTop();
+ if(right_to_left) {
+ x -= e.outerWidth();
+ if(x < $(window).scrollLeft() + 20) {
+ x = $(window).scrollLeft() + 20;
+ }
+ }
+ if(x + w + 20 > dw) {
+ x = dw - (w + 20);
+ }
+ if(y + h + 20 > dh) {
+ y = dh - (h + 20);
+ }
+
+ vakata_context.element
+ .css({ "left" : x, "top" : y })
+ .show()
+ .find('a:eq(0)').focus().parent().addClass("vakata-context-hover");
+ vakata_context.is_visible = true;
+ $.vakata.context._trigger("show");
+ }
+ },
+ hide : function () {
+ if(vakata_context.is_visible) {
+ vakata_context.element.hide().find("ul").hide().end().find(':focus').blur();
+ vakata_context.is_visible = false;
+ $.vakata.context._trigger("hide");
+ }
+ }
+ };
+ $(function () {
+ right_to_left = $("body").css("direction") === "rtl";
+ var to = false,
+ css_string = '' +
+ '.vakata-context { display:none; _width:1px; } ' +
+ '.vakata-context, ' +
+ '.vakata-context ul { margin:0; padding:2px; position:absolute; background:#f5f5f5; border:1px solid #979797; ' +
+ ' -moz-box-shadow:5px 5px 4px -4px #666666; -webkit-box-shadow:2px 2px 2px #999999; box-shadow:2px 2px 2px #999999; }' +
+ '.vakata-context ul { list-style:none; left:100%; margin-top:-2.7em; margin-left:-4px; } ' +
+ '.vakata-context li.vakata-context-right ul { left:auto; right:100%; margin-left:auto; margin-right:-4px; } ' +
+ '.vakata-context li { list-style:none; display:inline; }' +
+ '.vakata-context li a { display:block; padding:0 2em 0 2em; text-decoration:none; width:auto; color:black; white-space:nowrap; line-height:2.4em; ' +
+ ' -moz-text-shadow:1px 1px 0px white; -webkit-text-shadow:1px 1px 0px white; text-shadow:1px 1px 0px white; ' +
+ ' -moz-border-radius:1px; -webkit-border-radius:1px; border-radius:1px; }' +
+ '.vakata-context li a:hover { position:relative; background-color:#e8eff7; ' +
+ ' -moz-box-shadow:0px 0px 2px #0a6aa1; -webkit-box-shadow:0px 0px 2px #0a6aa1; box-shadow:0px 0px 2px #0a6aa1; }' +
+ '.vakata-context li.vakata-context-hover > a { position:relative; background-color:#e8eff7; ' +
+ ' -moz-box-shadow:0px 0px 2px #0a6aa1; -webkit-box-shadow:0px 0px 2px #0a6aa1; box-shadow:0px 0px 2px #0a6aa1; }' +
+ '.vakata-context li a.vakata-context-parent { background-image:url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAIORI4JlrqN1oMSnmmZDQUAOw=="); background-position:right center; background-repeat:no-repeat; } ' +
+ '.vakata-context li.vakata-context-separator a, ' +
+ '.vakata-context li.vakata-context-separator a:hover { background:white; border:0; border-top:1px solid #e2e3e3; height:1px; min-height:1px; max-height:1px; padding:0; margin:0 0 0 2.4em; border-left:1px solid #e0e0e0; _overflow:hidden; ' +
+ ' -moz-text-shadow:0 0 0 transparent; -webkit-text-shadow:0 0 0 transparent; text-shadow:0 0 0 transparent; ' +
+ ' -moz-box-shadow:0 0 0 transparent; -webkit-box-shadow:0 0 0 transparent; box-shadow:0 0 0 transparent; ' +
+ ' -moz-border-radius:0; -webkit-border-radius:0; border-radius:0; }' +
+ '.vakata-context li.vakata-contextmenu-disabled a, .vakata-context li.vakata-contextmenu-disabled a:hover { color:silver; background-color:transparent; border:0; box-shadow:0 0 0; }' +
+ '' +
+ '.vakata-context li a ins { text-decoration:none; display:inline-block; width:2.4em; height:2.4em; background:transparent; margin:0 0 0 -2em; } ' +
+ '.vakata-context li a span { display:inline-block; width:1px; height:2.4em; background:white; margin:0 0.5em 0 0; border-left:1px solid #e2e3e3; _overflow:hidden; } ' +
+ '' +
+ '.vakata-context-rtl ul { left:auto; right:100%; margin-left:auto; margin-right:-4px; } ' +
+ '.vakata-context-rtl li a.vakata-context-parent { background-image:url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAINjI+AC7rWHIsPtmoxLAA7"); background-position:left center; background-repeat:no-repeat; } ' +
+ '.vakata-context-rtl li.vakata-context-separator a { margin:0 2.4em 0 0; border-left:0; border-right:1px solid #e2e3e3;} ' +
+ '.vakata-context-rtl li.vakata-context-left ul { right:auto; left:100%; margin-left:-4px; margin-right:auto; } ' +
+ '.vakata-context-rtl li a ins { margin:0 -2em 0 0; } ' +
+ '.vakata-context-rtl li a span { margin:0 0 0 0.5em; border-left-color:white; background:#e2e3e3; } ' +
+ '';
+ if(!$.jstree.no_css) {
+ $('head').append('<style type="text/css">' + css_string + '</style>');
+ }
+
+ vakata_context.element = $("<ul class='vakata-context'></ul>");
+ vakata_context.element
+ .on("mouseenter", "li", function (e) {
+ e.stopImmediatePropagation();
+
+ if($.contains(this, e.relatedTarget)) {
+ // премахнато заради delegate mouseleave по-долу
+ // $(this).find(".vakata-context-hover").removeClass("vakata-context-hover");
+ return;
+ }
+
+ if(to) { clearTimeout(to); }
+ vakata_context.element.find(".vakata-context-hover").removeClass("vakata-context-hover").end();
+
+ $(this)
+ .siblings().find("ul").hide().end().end()
+ .parentsUntil(".vakata-context", "li").addBack().addClass("vakata-context-hover");
+ $.vakata.context._show_submenu(this);
+ })
+ // тестово - дали не натоварва?
+ .on("mouseleave", "li", function (e) {
+ if($.contains(this, e.relatedTarget)) { return; }
+ $(this).find(".vakata-context-hover").addBack().removeClass("vakata-context-hover");
+ })
+ .on("mouseleave", function (e) {
+ $(this).find(".vakata-context-hover").removeClass("vakata-context-hover");
+ if($.vakata.context.settings.hide_onmouseleave) {
+ to = setTimeout(
+ (function (t) {
+ return function () { $.vakata.context.hide(); };
+ })(this), $.vakata.context.settings.hide_onmouseleave);
+ }
+ })
+ .on("click", "a", function (e) {
+ e.preventDefault();
+ })
+ .on("mouseup", "a", function (e) {
+ if(!$(this).blur().parent().hasClass("vakata-context-disabled") && $.vakata.context._execute($(this).attr("rel")) !== false) {
+ $.vakata.context.hide();
+ }
+ })
+ .on('keydown', 'a', function (e) {
+ var o = null;
+ switch(e.which) {
+ case 13:
+ case 32:
+ e.type = "mouseup";
+ e.preventDefault();
+ $(e.currentTarget).trigger(e);
+ break;
+ case 37:
+ if(vakata_context.is_visible) {
+ vakata_context.element.find(".vakata-context-hover").last().parents("li:eq(0)").find("ul").hide().find(".vakata-context-hover").removeClass("vakata-context-hover").end().end().children('a').focus();
+ e.stopImmediatePropagation();
+ e.preventDefault();
+ }
+ break;
+ case 38:
+ if(vakata_context.is_visible) {
+ o = vakata_context.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").prevAll("li:not(.vakata-context-separator)").first();
+ if(!o.length) { o = vakata_context.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").last(); }
+ o.addClass("vakata-context-hover").children('a').focus();
+ e.stopImmediatePropagation();
+ e.preventDefault();
+ }
+ break;
+ case 39:
+ if(vakata_context.is_visible) {
+ vakata_context.element.find(".vakata-context-hover").last().children("ul").show().children("li:not(.vakata-context-separator)").removeClass("vakata-context-hover").first().addClass("vakata-context-hover").children('a').focus();
+ e.stopImmediatePropagation();
+ e.preventDefault();
+ }
+ break;
+ case 40:
+ if(vakata_context.is_visible) {
+ o = vakata_context.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").nextAll("li:not(.vakata-context-separator)").first();
+ if(!o.length) { o = vakata_context.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").first(); }
+ o.addClass("vakata-context-hover").children('a').focus();
+ e.stopImmediatePropagation();
+ e.preventDefault();
+ }
+ break;
+ case 27:
+ $.vakata.context.hide();
+ e.preventDefault();
+ break;
+ default:
+ //console.log(e.which);
+ break;
+ }
+ })
+ .appendTo("body");
+
+ $(document)
+ .on("mousedown", function (e) {
+ if(vakata_context.is_visible && !$.contains(vakata_context.element[0], e.target)) { $.vakata.context.hide(); }
+ })
+ .on("context_show.vakata", function (e, data) {
+ vakata_context.element.find("li:has(ul)").children("a").addClass("vakata-context-parent");
+ if(right_to_left) {
+ vakata_context.element.addClass("vakata-context-rtl").css("direction", "rtl");
+ }
+ // also apply a RTL class?
+ vakata_context.element.find("ul").hide().end();
+ });
+ });
+ })($);
+
+ $.jstree.defaults.plugins.push("contextmenu");
+})(jQuery);
+/* File: jstree.dnd.js
+Enables drag'n'drop.
+*/
+/* Group: jstree drag'n'drop plugin */
+
+(function ($) {
+ $.jstree.defaults.dnd = {
+ copy_modifier : 'ctrl',
+ open_timeout : 500
+ };
+ $.jstree.plugins.dnd = function (options, parent) {
+ this.bind = function () {
+ parent.bind.call(this);
+
+ this.element
+ .on('mousedown', 'a', $.proxy(function (e) {
+ var obj = this.get_node(e.target); // TODO: how about multiple
+ if(obj && obj !== -1 && obj.length && e.which === 1) { // TODO: think about e.which
+ this.element.trigger('mousedown.jstree');
+ return $.vakata.dnd.start(e, { 'jstree' : true, 'origin' : this, 'obj' : obj }, '<div id="jstree-dnd" class="jstree-' + this.get_theme() + '"><i class="jstree-icon jstree-er"></i>' + this.get_text(e.currentTarget, true) + '<ins class="jstree-copy" style="display:none;">+</ins></div>');
+ }
+ }, this));
+ };
+ };
+
+ $(function() {
+ // bind only once for all instances
+ var lastmv = false,
+ opento = false,
+ marker = $('<div id="jstree-marker"> </div>').hide().appendTo('body');
+
+ $(document)
+ .bind('dnd_start.vakata', function (e, data) {
+ lastmv = false;
+ })
+ .bind('dnd_move.vakata', function (e, data) {
+ if(opento) { clearTimeout(opento); }
+ if(!data.data.jstree) { return; }
+
+ // if we are hovering the marker image do nothing (can happen on "inside" drags)
+ if(data.event.target.id && data.event.target.id === 'jstree-marker') {
+ return;
+ }
+
+ var ins = $.jstree.reference(data.event.target),
+ ref = false,
+ off = false,
+ rel = false,
+ l, t, h, p, i, o;
+ // if we are over an instance
+ if(ins && ins._data && ins._data.dnd) {
+ marker.attr('class', 'jstree-' + ins.get_theme());
+ data.helper
+ .children().attr('class', 'jstree-' + ins.get_theme())
+ .find('.jstree-copy:eq(0)')[ data.event[data.data.origin.settings.dnd.copy_modifier + "Key"] ? 'show' : 'hide' ]();
+
+
+ // if are hovering the container itself add a new root node
+ if(data.event.target === ins.element[0] || data.event.target === ins.get_container_ul()[0]) {
+ if(ins.check( (data.event[data.data.origin.settings.dnd.copy_modifier + "Key"] ? "copy_node" : "move_node"), data.data.obj, -1, 'last')) {
+ lastmv = { 'ins' : ins, 'par' : -1, 'pos' : 'last' };
+ marker.hide();
+ data.helper.find('.jstree-icon:eq(0)').removeClass('jstree-er').addClass('jstree-ok');
+ return;
+ }
+ }
+ else {
+ // if we are hovering a tree node
+ ref = $(data.event.target).closest('a');
+ if(ref && ref.length && ref.parent().is('.jstree-closed, .jstree-open, .jstree-leaf')) {
+ off = ref.offset();
+ rel = data.event.pageY - off.top;
+ h = ref.height();
+ if(rel < h / 3) {
+ o = ['b', 'i', 'a'];
+ }
+ else if(rel > h - h / 3) {
+ o = ['a', 'i', 'b'];
+ }
+ else {
+ o = rel > h / 2 ? ['i', 'a', 'b'] : ['i', 'b', 'a'];
+ }
+ $.each(o, function (j, v) {
+ switch(v) {
+ case 'b':
+ l = off.left - 6;
+ t = off.top - 5;
+ p = ins.get_parent(ref);
+ i = ref.parent().index();
+ break;
+ case 'i':
+ l = off.left - 2;
+ t = off.top - 5 + h / 2 + 1;
+ p = ref.parent();
+ i = 0;
+ break;
+ case 'a':
+ l = off.left - 6;
+ t = off.top - 5 + h + 2;
+ p = ins.get_parent(ref);
+ i = ref.parent().index() + 1;
+ break;
+ }
+ /*
+ // TODO: moving inside, but the node is not yet loaded?
+ // the check will work anyway, as when moving the node will be loaded first and checked again
+ if(v === 'i' && !ins.is_loaded(p)) { }
+ */
+ if(ins.check((data.event[data.data.origin.settings.dnd.copy_modifier + "Key"] ? "copy_node" : "move_node"),data.data.obj, p, i)) {
+ if(v === 'i' && ref.parent().is('.jstree-closed') && ins.settings.dnd.open_timeout) {
+ opento = setTimeout((function (x, z) { return function () { x.open_node(z); }; })(ins, ref), ins.settings.dnd.open_timeout);
+ }
+ lastmv = { 'ins' : ins, 'par' : p, 'pos' : i };
+ marker.css({ 'left' : l + 'px', 'top' : t + 'px' }).show();
+ data.helper.find('.jstree-icon:eq(0)').removeClass('jstree-er').addClass('jstree-ok');
+ o = true;
+ return false;
+ }
+ });
+ if(o === true) { return; }
+ }
+ }
+ }
+ lastmv = false;
+ data.helper.find('.jstree-icon').removeClass('jstree-ok').addClass('jstree-er');
+ marker.hide();
+ })
+ .bind('dnd_scroll.vakata', function (e, data) {
+ if(!data.data.jstree) { return; }
+ marker.hide();
+ lastmv = false;
+ data.helper.find('.jstree-icon:eq(0)').removeClass('jstree-ok').addClass('jstree-er');
+ })
+ .bind('dnd_stop.vakata', function (e, data) {
+ if(opento) { clearTimeout(opento); }
+ if(!data.data.jstree) { return; }
+ marker.hide();
+ if(lastmv) {
+ lastmv.ins[ data.event[data.data.origin.settings.dnd.copy_modifier + "Key"] ? 'copy_node' : 'move_node' ]
+ (data.data.obj, lastmv.par, lastmv.pos);
+ }
+ })
+ .bind('keyup keydown', function (e, data) {
+ data = $.vakata.dnd._get();
+ if(data.data && data.data.jstree) {
+ data.helper.find('.jstree-copy:eq(0)')[ e[data.data.origin.settings.dnd.copy_modifier + "Key"] ? 'show' : 'hide' ]();
+ }
+ });
+
+ // add DND CSS
+ var css_string = '' +
+ '#jstree-marker { position: absolute; top:0; left:0; margin:0; padding:0; border-right:0; border-top:5px solid transparent; border-bottom:5px solid transparent; border-left:5px solid; width:0; height:0; font-size:0; line-height:0; _border-top-color:pink; _border-botton-color:pink; _filter:chroma(color=pink); } ' +
+ '#jstree-dnd { line-height:16px; margin:0; padding:4px; } ' +
+ '#jstree-dnd .jstree-icon, #jstree-dnd .jstree-copy { display:inline-block; text-decoration:none; margin:0 2px 0 0; padding:0; width:16px; height:16px; } ' +
+ '#jstree-dnd .jstree-ok { background:green; } ' +
+ '#jstree-dnd .jstree-er { background:red; } ' +
+ '#jstree-dnd .jstree-copy { margin:0 2px 0 2px; }';
+ if(!$.jstree.no_css) {
+ $('head').append('<style type="text/css">' + css_string + '</style>');
+ }
+ });
+
+ // include the dnd plugin by default
+ $.jstree.defaults.plugins.push("dnd");
+})(jQuery);
+
+// helpers
+(function ($) {
+ $.fn.vakata_reverse = [].reverse;
+ // private variable
+ var vakata_dnd = {
+ element : false,
+ is_down : false,
+ is_drag : false,
+ helper : false,
+ helper_w: 0,
+ data : false,
+ init_x : 0,
+ init_y : 0,
+ scroll_l: 0,
+ scroll_t: 0,
+ scroll_e: false,
+ scroll_i: false
+ };
+ $.vakata.dnd = {
+ settings : {
+ scroll_speed : 10,
+ scroll_proximity : 20,
+ helper_left : 5,
+ helper_top : 10,
+ threshold : 5
+ },
+ _trigger : function (event_name, e) {
+ var data = $.vakata.dnd._get();
+ data.event = e;
+ $(document).triggerHandler("dnd_" + event_name + ".vakata", data);
+ },
+ _get : function () {
+ return {
+ "data" : vakata_dnd.data,
+ "element" : vakata_dnd.element,
+ "helper" : vakata_dnd.helper
+ };
+ },
+ _clean : function () {
+ if(vakata_dnd.helper) { vakata_dnd.helper.remove(); }
+ if(vakata_dnd.scroll_i) { clearInterval(vakata_dnd.scroll_i); vakata_dnd.scroll_i = false; }
+ vakata_dnd = {
+ element : false,
+ is_down : false,
+ is_drag : false,
+ helper : false,
+ helper_w: 0,
+ data : false,
+ init_x : 0,
+ init_y : 0,
+ scroll_l: 0,
+ scroll_t: 0,
+ scroll_e: false,
+ scroll_i: false
+ };
+ $(document).unbind("mousemove", $.vakata.dnd.drag);
+ $(document).unbind("mouseup", $.vakata.dnd.stop);
+ },
+ _scroll : function (init_only) {
+ if(!vakata_dnd.scroll_e || (!vakata_dnd.scroll_l && !vakata_dnd.scroll_t)) {
+ if(vakata_dnd.scroll_i) { clearInterval(vakata_dnd.scroll_i); vakata_dnd.scroll_i = false; }
+ return false;
+ }
+ if(!vakata_dnd.scroll_i) {
+ vakata_dnd.scroll_i = setInterval($.vakata.dnd._scroll, 100);
+ return false;
+ }
+ if(init_only === true) { return false; }
+
+ var i = vakata_dnd.scroll_e.scrollTop(),
+ j = vakata_dnd.scroll_e.scrollLeft();
+ vakata_dnd.scroll_e.scrollTop(i + vakata_dnd.scroll_t * $.vakata.dnd.settings.scroll_speed);
+ vakata_dnd.scroll_e.scrollLeft(j + vakata_dnd.scroll_l * $.vakata.dnd.settings.scroll_speed);
+ if(i !== vakata_dnd.scroll_e.scrollTop() || j !== vakata_dnd.scroll_e.scrollLeft()) {
+ $.vakata.dnd._trigger("scroll", vakata_dnd.scroll_e);
+ }
+ },
+ start : function (e, data, html) {
+ if(vakata_dnd.is_drag) { $.vakata.dnd.stop({}); }
+ try {
+ e.currentTarget.unselectable = "on";
+ e.currentTarget.onselectstart = function() { return false; };
+ if(e.currentTarget.style) { e.currentTarget.style.MozUserSelect = "none"; }
+ } catch(err) { }
+ vakata_dnd.init_x = e.pageX;
+ vakata_dnd.init_y = e.pageY;
+ vakata_dnd.data = data;
+ vakata_dnd.is_down = true;
+ vakata_dnd.element = e.currentTarget;
+ if(html !== false) {
+ vakata_dnd.helper = $("<div id='vakata-dnd'></div>").html(html).css({
+ "display" : "block",
+ "margin" : "0",
+ "padding" : "0",
+ "position" : "absolute",
+ "top" : "-2000px",
+ "lineHeight" : "16px",
+ "zIndex" : "10000"
+ });
+ }
+ $(document).bind("mousemove", $.vakata.dnd.drag);
+ $(document).bind("mouseup", $.vakata.dnd.stop);
+ return false;
+ },
+ drag : function (e) {
+ if(!vakata_dnd.is_down) { return; }
+ if(!vakata_dnd.is_drag) {
+ if(
+ Math.abs(e.pageX - vakata_dnd.init_x) > $.vakata.dnd.settings.threshold ||
+ Math.abs(e.pageY - vakata_dnd.init_y) > $.vakata.dnd.settings.threshold
+ ) {
+ if(vakata_dnd.helper) {
+ vakata_dnd.helper.appendTo("body");
+ vakata_dnd.helper_w = vakata_dnd.helper.outerWidth();
+ }
+ vakata_dnd.is_drag = true;
+ $.vakata.dnd._trigger("start", e);
+ }
+ else { return; }
+ }
+
+ var d = false, w = false,
+ dh = false, wh = false,
+ dw = false, ww = false,
+ dt = false, dl = false,
+ ht = false, hl = false;
+
+ vakata_dnd.scroll_t = 0;
+ vakata_dnd.scroll_l = 0;
+ vakata_dnd.scroll_e = false;
+ var p = $(e.target)
+ .parentsUntil("body").addBack().vakata_reverse()
+ .filter(function () {
+ return (/^auto|scroll$/).test($(this).css("overflow")) &&
+ (this.scrollHeight > this.offsetHeight || this.scrollWidth > this.offsetWidth);
+ })
+ .each(function () {
+ var t = $(this), o = t.offset();
+ if(this.scrollHeight > this.offsetHeight) {
+ if(o.top + t.height() - e.pageY < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_t = 1; }
+ if(e.pageY - o.top < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_t = -1; }
+ }
+ if(this.scrollWidth > this.offsetWidth) {
+ if(o.left + t.width() - e.pageX < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_l = 1; }
+ if(e.pageX - o.left < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_l = -1; }
+ }
+ if(vakata_dnd.scroll_t || vakata_dnd.scroll_l) {
+ vakata_dnd.scroll_e = $(this);
+ return false;
+ }
+ });
+
+ if(!vakata_dnd.scroll_e) {
+ d = $(document); w = $(window);
+ dh = d.height(); wh = w.height();
+ dw = d.width(); ww = w.width();
+ dt = d.scrollTop(); dl = d.scrollLeft();
+ if(dh > wh && e.pageY - dt < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_t = -1; }
+ if(dh > wh && wh - (e.pageY - dt) < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_t = 1; }
+ if(dw > ww && e.pageX - dl < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_l = -1; }
+ if(dw > ww && ww - (e.pageX - dl) < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_l = 1; }
+ if(vakata_dnd.scroll_t || vakata_dnd.scroll_l) {
+ vakata_dnd.scroll_e = d;
+ }
+ }
+ if(vakata_dnd.scroll_e) { $.vakata.dnd._scroll(true); }
+
+ if(vakata_dnd.helper) {
+ ht = parseInt(e.pageY + $.vakata.dnd.settings.helper_top, 10);
+ hl = parseInt(e.pageX + $.vakata.dnd.settings.helper_left, 10);
+ if(dh && ht + 25 > dh) { ht = dh - 50; }
+ if(dw && hl + vakata_dnd.helper_w > dw) { hl = dw - (vakata_dnd.helper_w + 2); }
+ vakata_dnd.helper.css({
+ left : hl + "px",
+ top : ht + "px"
+ });
+ }
+ $.vakata.dnd._trigger("move", e);
+ },
+ stop : function (e) {
+ if(vakata_dnd.is_drag) {
+ $.vakata.dnd._trigger("stop", e);
+ }
+ $.vakata.dnd._clean();
+ }
+ };
+})(jQuery);
+
+/* File: jstree.html.js
+This plugin makes it possible for jstree to use HTML data sources (other than the container's initial HTML).
+*/
+/* Group: jstree html plugin */
+(function ($) {
+ $.jstree.defaults.html = {
+ data : false,
+ ajax : false
+ };
+
+ $.jstree.plugins.html = function (options, parent) {
+ this.append_html_data = function (dom, data) {
+ data = $(data);
+ dom = this.get_node(dom);
+ if(!data || !data.length || !data.is('ul, li')) {
+ if(dom && dom !== -1 && dom.is('li')) {
+ dom.removeClass('jstree-closed').addClass('jstree-leaf').children('ul').remove();
+ }
+ return true;
+ }
+ if(dom === -1) { dom = this.element; }
+ if(!dom.length) { return false; }
+ if(!dom.children('ul').length) { dom.append('<ul />'); }
+ dom.children('ul').empty().append(data.is('ul') ? data.children('li') : data);
+ return true;
+ };
+ this._load_node = function (obj, callback) {
+ var d = false,
+ s = $.extend(true, {}, this.settings.html);
+ obj = this.get_node(obj);
+ if(!obj) { return false; }
+
+ switch(!0) {
+ // no settings - use parent
+ case (!s.data && !s.ajax):
+ return parent._load_node.call(this, obj, callback);
+ // data is function
+ case ($.isFunction(s.data)):
+ return s.data.call(this, obj, $.proxy(function (d) {
+ return callback.call(this, this._append_html_data(obj, d));
+ }, this));
+ // data is set, ajax is not set, or both are set, but we are dealing with root node
+ case ((!!s.data && !s.ajax) || (!!s.data && !!s.ajax && obj === -1)):
+ return callback.call(this, this._append_html_data(obj, s.data));
+ // data is not set, ajax is set, or both are set, but we are dealing with a normal node
+ case ((!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj !== -1)):
+ s.ajax.success = $.proxy(function (d, t, x) {
+ var s = this.settings.html.ajax;
+ if($.isFunction(s.success)) {
+ d = s.success.call(this, d, t, x) || d;
+ }
+ callback.call(this, this._append_html_data(obj, d));
+ }, this);
+ s.ajax.error = $.proxy(function (x, t, e) {
+ var s = this.settings.html.ajax;
+ if($.isFunction(s.error)) {
+ s.error.call(this, x, t, e);
+ }
+ callback.call(this, false);
+ }, this);
+ if(!s.ajax.dataType) { s.ajax.dataType = "html"; }
+ if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
+ if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
+ return $.ajax(s.ajax);
+ }
+ };
+ };
+ // include the html plugin by default
+ $.jstree.defaults.plugins.push("html");
+})(jQuery);
+/* File: jstree.json.js
+This plugin makes it possible for jstree to use JSON data sources.
+*/
+/* Group: jstree json plugin */
+(function ($) {
+ $.jstree.defaults.json = {
+ data : false,
+ ajax : false,
+ progressive_render : false, // get_json, data on each node
+ progressive_unload : false
+ };
+
+ $.jstree.plugins.json = function (options, parent) {
+ this.bind = function () {
+ parent.bind.call(this);
+ this.element
+ .bind("ready.jstree", $.proxy(function () {
+ this.element
+ .bind("after_close.jstree", $.proxy(function (e, data) {
+ var t = $(data.node);
+ if(this.settings.json.progressive_unload) {
+ t.data('jstree').children = this.get_json(t)[0].children;
+ t.children("ul").remove();
+ }
+ }, this));
+ }, this));
+ };
+ this.parse_json = function (node) {
+ var s = this.settings.json;
+ if($.isArray(node.children)) {
+ if(s.progressive_render) {
+ if(!node.data) { node.data = {}; }
+ if(!node.data.jstree) { node.data.jstree = {}; }
+ node.data.jstree.children = node.children;
+ node.children = true;
+ }
+ }
+ return parent.parse_json.call(this, node);
+ };
+ this._append_json_data = function (dom, data) {
+ dom = this.get_node(dom);
+ if(dom === -1) { dom = this.element; }
+ data = this.parse_json(data);
+ if(!dom.length) { return false; }
+ if(!data) {
+ if(dom && dom.is('li')) {
+ dom.removeClass('jstree-closed').addClass('jstree-leaf').children('ul').remove();
+ }
+ return true;
+ }
+ if(!dom.children('ul').length) { dom.append('<ul />'); }
+ dom.children('ul').empty().append(data.is('li') ? data : data.children('li'));
+ return true;
+ };
+ this._load_node = function (obj, callback) {
+ var d = false,
+ s = $.extend(true, {}, this.settings.json);
+ obj = this.get_node(obj);
+ if(!obj) { return false; }
+
+ switch(!0) {
+ // root node with data
+ case (obj === -1 && this.get_container().data('jstree') && $.isArray(this.get_container().data('jstree').children)):
+ d = this.element.data('jstree').children;
+ this.get_container().data('jstree').children = null;
+ return callback.call(this, this._append_json_data(obj, d));
+ // normal node with data
+ case (obj !== -1 && obj.length && obj.data('jstree') && $.isArray(obj.data('jstree').children)):
+ d = obj.data('jstree').children;
+ obj.data('jstree').children = null;
+ return callback.call(this, this._append_json_data(obj, d));
+ // no settings - use parent
+ case (!s.data && !s.ajax):
+ return parent._load_node.call(this, obj, callback);
+ // data is function
+ case ($.isFunction(s.data)):
+ return s.data.call(this, obj, $.proxy(function (d) {
+ return callback.call(this, this._append_json_data(obj, d));
+ }, this));
+ // data is set, ajax is not set, or both are set, but we are dealing with root node
+ case ((!!s.data && !s.ajax) || (!!s.data && !!s.ajax && obj === -1)):
+ return callback.call(this, this._append_json_data(obj, s.data));
+ // data is not set, ajax is set, or both are set, but we are dealing with a normal node
+ case ((!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj !== -1)):
+ s.ajax.success = $.proxy(function (d, t, x) {
+ var s = this.settings.json.ajax;
+ if($.isFunction(s.success)) {
+ d = s.success.call(this, d, t, x) || d;
+ }
+ callback.call(this, this._append_json_data(obj, d));
+ }, this);
+ s.ajax.error = $.proxy(function (x, t, e) {
+ var s = this.settings.json.ajax;
+ if($.isFunction(s.error)) {
+ s.error.call(this, x, t, e);
+ }
+ callback.call(this, false);
+ }, this);
+ if(!s.ajax.dataType) { s.ajax.dataType = "json"; }
+ if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
+ if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
+ return $.ajax(s.ajax);
+ }
+ };
+ };
+ // include the json plugin by default
+ $.jstree.defaults.plugins.push("json");
+})(jQuery);
+/* File: jstree.rules.js
+Limits the children count, valid children and depth of nodes by using types or embedded data.
+*/
+/* Group: jstree rules plugin */
+(function ($) {
+ var last_depth_node = false,
+ last_depth_value = 0;
+
+ $.jstree.defaults.rules = {
+ 'check_max_depth' : true,
+ 'check_max_children' : true,
+ 'check_valid_children' : true,
+ 'types' : { }
+ };
+
+ $.jstree.plugins.rules = function (options, parent) {
+ this.bind = function () {
+ parent.bind.call(this);
+
+ this.element.on('load_node.jstree', $.proxy(function (e, data) {
+ if(this.settings.rules.check_max_depth) {
+ var o = data.node === -1 ? this.element : data.node,
+ t = this,
+ f = function () {
+ if(t.apply_max_depth(this)) {
+ o = o.not(this);
+ }
+ };
+ if(!this.apply_max_depth(o)) {
+ while(o.length) {
+ o = o.find("> ul > li");
+ o.each(f);
+ }
+ }
+ }
+ }, this));
+ };
+ this.apply_max_depth = function (obj) {
+ obj = this.get_node(obj);
+ if(!obj || !obj.length) {
+ return false;
+ }
+ obj = obj === -1 ? this.element : obj;
+ var d = obj.data('jstree'),
+ t = {},
+ f1 = function () {
+ t = $(this).data('jstree') || {};
+ t.max_depth = 0;
+ $(this).data('jstree', t);
+ },
+ f2 = function () {
+ t = $(this).data('jstree') || {};
+ t.max_depth = t.max_depth && t.max_depth !== -1 ? Math.min(t.max_depth, d) : d;
+ $(this).data('jstree', t);
+ };
+ if(d && typeof d.max_depth !== 'undefined' && d.max_depth !== -1) {
+ d = d.max_depth;
+ while(obj.length > 0) {
+ obj = obj.find("> ul > li");
+ d = Math.max(d - 1, 0);
+ if(d === 0) {
+ obj.find('li').addBack().each(f1);
+ break;
+ }
+ obj.each(f2);
+ }
+ return true;
+ }
+ return false;
+ };
+ this.get_rules = function (obj) {
+ obj = this.get_node(obj);
+ if(obj === -1) {
+ obj = this.element;
+ obj = obj.data('jstree');
+ return {
+ 'type' : false,
+ 'max_depth' : obj && obj.max_depth ? obj.max_depth : -1,
+ 'max_children' : obj && obj.max_children ? obj.max_children : -1,
+ 'valid_children' : obj && obj.valid_children ? obj.valid_children : -1
+ };
+ }
+ if(!obj || !obj.length) { return false; }
+
+ var s = this.settings.rules,
+ t = this.get_type(obj),
+ r = {
+ 'type' : t,
+ 'max_depth' : -1,
+ 'max_children' : -1,
+ 'valid_children' : -1
+ };
+ obj = obj.data('jstree');
+ if(t && s[t]) {
+ if(s[t].max_depth) { r.max_depth = s[t].max_depth; }
+ if(s[t].max_children) { r.max_children = s[t].max_children; }
+ if(s[t].valid_children) { r.valid_children = s[t].valid_children; }
+ }
+ if(obj && typeof obj.max_children !== 'undefined') { r.max_children = obj.max_children; }
+ if(obj && typeof obj.valid_children !== 'undefined') { r.valid_children = obj.valid_children; }
+ if(obj && typeof obj.max_depth !== 'undefined' && (r.max_depth === -1 || (obj.max_depth !== -1 && obj.max_depth < r.max_depth) ) ) {
+ r.max_depth = obj.max_depth;
+ }
+
+ return r;
+ };
+ this.get_type = function (obj) {
+ obj = this.get_node(obj);
+ if(obj === -1) { obj = this.element; }
+ if(!obj || !obj.length) { return false; }
+ obj = obj.data('jstree');
+ return obj && obj.type ? obj.type : false;
+ };
+ this.set_type = function (obj, type) {
+ obj = this.get_node(obj);
+ if(obj === -1) { obj = this.element; }
+ if(!obj || !obj.length) { return false; }
+ var d = obj.data('jstree');
+ if(!d) { d = {}; }
+ d.type = type;
+ obj.data('jstree', d);
+ return true;
+ };
+ this.check = function (chk, obj, par, pos) {
+ if(parent.check.call(this, chk, obj, par, pos) === false) { return false; }
+ var r = false,
+ s = this.settings.rules,
+ t = this,
+ o = false,
+ d = 0;
+
+ switch(chk) {
+ case "create_node":
+ case "move_node":
+ case "copy_node":
+ if(s.check_max_children || s.check_valid_children || s.check_max_depth) {
+ r = this.get_rules(par);
+ }
+ else {
+ return true;
+ }
+ if(s.check_max_children) {
+ if(typeof r.max_children !== 'undefined' && r.max_children !== -1) {
+ if(par.find('> ul > li').not( chk === 'move_node' ? obj : null ).length + obj.length > r.max_children) {
+ return false;
+ }
+ }
+ }
+ if(s.check_valid_children) {
+ if(typeof r.valid_children !== 'undefined' && r.valid_children !== -1) {
+ if(!$.isArray(r.valid_children)) { return false; }
+ obj.each(function () {
+ if($.inArray(t.get_type(this), r.valid_children) === -1) {
+ t = false;
+ return false;
+ }
+ });
+ if(t === false) {
+ return false;
+ }
+ }
+ }
+ if(s.check_max_depth && r.max_depth !== -1) {
+ d = 0;
+ do {
+ d ++;
+ obj = obj.find('> ul > li');
+ } while(obj.length && chk !== 'create_node');
+ if(r.max_depth - d < 0) { return false; }
+ }
+ break;
+ }
+ return true;
+ };
+ };
+
+ // include the rules plugin by default
+ $.jstree.defaults.plugins.push("rules");
+})(jQuery);
+(function ($) {
+ $.jstree.defaults.search = {
+ ajax : false,
+ search_method : "vakata_icontains",
+ show_only_matches : true
+ };
+
+ $.jstree.plugins.search = function (options, parent) {
+ this.init = function (el, options) {
+ if(options.json) {
+ options.json.progressive_unload = false;
+ options.json.progressive_render = false;
+ }
+ parent.init.call(this, el, options);
+ };
+ this.bind = function () {
+ parent.bind.call(this);
+
+ this._data.search.str = "";
+ this._data.search.res = $();
+
+ if(this.settings.search.show_only_matches) {
+ this.element
+ .on("search.jstree", function (e, data) {
+ $(this).children("ul").find("li").hide().removeClass("jstree-last");
+ data.nodes.parentsUntil(".jstree").addBack().show()
+ .filter("ul").each(function () { $(this).children("li:visible").eq(-1).addClass("jstree-last"); });
+ })
+ .on("clear_search.jstree", function () {
+ $(this).children("ul").find("li").css("display","").end().end().jstree("correct_node", -1, true);
+ });
+ }
+ };
+ this.search = function (str, skip_async) {
+ if(str === false || $.trim(str) === "") {
+ return this.clear_search();
+ }
+ var s = this.settings.search,
+ t = this;
+
+ // progressive render?
+ if(!skip_async && s.ajax !== false && this.get_container_ul().find("li.jstree-closed:not(:has(ul)):eq(0)").length > 0) {
+ s.ajax.success = $.proxy(function (d, t, x) {
+ var s = this.settings.search.ajax;
+ if($.isFunction(s.success)) {
+ d = s.success.call(this, d, t, x) || d;
+ }
+ this._search_open(d, str);
+ }, this);
+ s.ajax.error = $.proxy(function (x, t, e) {
+ var s = this.settings.search.ajax;
+ if($.isFunction(s.error)) {
+ s.error.call(this, x, t, e);
+ }
+ // do stuff
+ }, this);
+ if(!s.ajax.dataType) {
+ s.ajax.dataType = "json";
+ }
+ if($.isFunction(s.ajax.url)) {
+ s.ajax.url = s.ajax.url.call(this, str);
+ }
+ if($.isFunction(s.ajax.data)) {
+ s.ajax.data = s.ajax.data.call(this, str);
+ }
+ else {
+ if(!s.ajax.data) { s.ajax.data = {}; }
+ s.ajax.data.str = str;
+ }
+ $.ajax(s.ajax);
+ return;
+ }
+ if(this._data.search.res.length) {
+ this.clear_search();
+ }
+ this._data.search.str = str;
+ this._data.search.res = this.element.find("a:" + (s.search_method) + "(" + str + ")");
+
+ this._data.search.res.addClass("jstree-search").parent().parents(".jstree-closed").each(function () {
+ t.open_node(this, false, 0);
+ });
+ this.trigger('search', { nodes : this._data.search.res, str : str });
+ };
+ this.clear_search = function (str) {
+ this._data.search.res.removeClass("jstree-search");
+ this.trigger('clear_search', { 'nodes' : this._data.search.res, str : this._data.search.str });
+ this._data.search.str = "";
+ this._data.search.res = $();
+ };
+ this._search_open = function (d, str) {
+ var res = true,
+ t = this;
+ $.each(d.concat([]), function (i, v) {
+ v = document.getElementById(v);
+ if(v) {
+ if(t.is_loaded(v)) {
+ if(t.is_closed(v)) {
+ t.open_node(v, false, 0);
+ }
+ $.vakata.array_remove(d, i);
+ }
+ else {
+ if(!t.is_loading(v)) {
+ t.open_node(v, $.proxy(function () { this._search_open(d, str); }, t), 0);
+ }
+ res = false;
+ }
+ }
+ });
+ if(res) {
+ this.search(str, true);
+ }
+ };
+ };
+
+ // helper for case-insensitive search
+ $.expr[':'].vakata_icontains = $.expr.createPseudo(function(search) {
+ return function(a) {
+ return (a.textContent || a.innerText || "").toLowerCase().indexOf(search.toLowerCase())>=0;
+ };
+ });
+
+ // include the json plugin by default
+ $.jstree.defaults.plugins.push("search");
+})(jQuery);
+
+/* File: jstree.sort.js
+Sorts items alphabetically (or using any other function)
+*/
+/* Group: jstree sort plugin */
+(function ($) {
+ $.jstree.defaults.sort = function (a, b) {
+ return this.get_text(a, true) > this.get_text(b, true) ? 1 : -1;
+ };
+ $.jstree.plugins.sort = function (options, parent) {
+ this.bind = function () {
+ parent.bind.call(this);
+
+ this.element
+ .on("load_node.jstree", $.proxy(function (e, data) {
+ var obj = this.get_node(data.node);
+ obj = obj === -1 ? this.get_container_ul() : obj.children("ul");
+ this.sort(obj, true);
+ }, this))
+ .on("rename_node.jstree create_node.jstree", $.proxy(function (e, data) {
+ this.sort(data.node.parent(), false);
+ }, this))
+ .on("move_node.jstree copy_node.jstree", $.proxy(function (e, data) {
+ var m = data.parent === -1 ? this.get_container_ul() : data.parent.children('ul');
+ this.sort(m, false);
+ }, this));
+ };
+ this.sort = function (obj, deep) {
+ var s = this.settings.sort,
+ t = this;
+ obj.append($.makeArray(obj.children("li")).sort($.proxy(s, t)));
+ obj.children('li').each(function () { t.correct_node(this, false); });
+ if(deep) {
+ obj.find("> li > ul").each(function() { t.sort($(this)); });
+ t.correct_node(obj.children('li'), true);
+ }
+ };
+ };
+
+ // include the sort plugin by default
+ $.jstree.defaults.plugins.push("sort");
+})(jQuery);
+/* File: jstree.state.js
+This plugin enables state saving between reloads.
+*/
+/* Group: jstree state plugin */
+(function ($) {
+ var to = false;
+
+ $.jstree.defaults.state = {
+ key : 'jstree',
+ events : 'changed.jstree open_node.jstree close_node.jstree'
+ };
+ $.jstree.plugins.state = function (options, parent) {
+ this.bind = function () {
+ parent.bind.call(this);
+
+ this.element
+ .on("ready.jstree", $.proxy(function (e, data) {
+ this.element.one("restore_state.jstree set_state.jstree", $.proxy(function () {
+ this.element.on(this.settings.state.events, $.proxy(function () {
+ if(to) { clearTimeout(to); }
+ to = setTimeout($.proxy(function () { this.save_state(); }, this), 100);
+ }, this));
+ }, this));
+ this.restore_state();
+ }, this));
+ };
+ this.save_state = function () {
+ $.vakata.storage.set(this.settings.state.key, this.get_state());
+ };
+ this.restore_state = function () {
+ var k = $.vakata.storage.get(this.settings.state.key);
+
+ if(!!k) { this.set_state(k); }
+ this.trigger('restore_state', { 'state' : k });
+ };
+ };
+
+ // include the state plugin by default
+ $.jstree.defaults.plugins.push("state");
+})(jQuery);
+
+(function ($, document, undefined) {
+ var raw = function (s) { return s; },
+ decoded = function (s) { return decodeURIComponent(s.replace(/\+/g, ' ')); };
+ var config = $.vakata.cookie = function (key, value, options) {
+ // write
+ if (value !== undefined) {
+ options = $.extend({}, config.defaults, options);
+
+ if (value === null) {
+ options.expires = -1;
+ }
+
+ if (typeof options.expires === 'number') {
+ var days = options.expires, t = options.expires = new Date();
+ t.setDate(t.getDate() + days);
+ }
+
+ value = config.json ? $.vakata.json.encode(value) : String(value);
+
+ return (document.cookie = [
+ encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value),
+ options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
+ options.path ? '; path=' + options.path : '',
+ options.domain ? '; domain=' + options.domain : '',
+ options.secure ? '; secure' : ''
+ ].join(''));
+ }
+ // read
+ var decode = config.raw ? raw : decoded;
+ var cookies = document.cookie.split('; ');
+ for (var i = 0, l = cookies.length; i < l; i++) {
+ var parts = cookies[i].split('=');
+ if (decode(parts.shift()) === key) {
+ var cookie = decode(parts.join('='));
+ return config.json ? $.vakata.json.decode(cookie) : cookie;
+ }
+ }
+ return null;
+ };
+ config.defaults = {};
+ $.vakata.removeCookie = function (key, options) {
+ if ($.cookie(key) !== null) {
+ $.cookie(key, null, options);
+ return true;
+ }
+ return false;
+ };
+})(jQuery, document);
+
+(function ($) {
+ var _storage = {},
+ _storage_service = {jStorage:"{}"},
+ _storage_elm = null,
+ _storage_size = 0,
+ json_encode = $.vakata.json.encode,
+ json_decode = $.vakata.json.decode,
+ _backend = false,
+ _ttl_timeout = false;
+
+ function _init() {
+ var localStorageReallyWorks = false;
+ if("localStorage" in window){
+ try {
+ window.localStorage.setItem('_tmptest', 'tmpval');
+ localStorageReallyWorks = true;
+ window.localStorage.removeItem('_tmptest');
+ } catch(BogusQuotaExceededErrorOnIos5) {
+ // Thanks be to iOS5 Private Browsing mode which throws
+ // QUOTA_EXCEEDED_ERRROR DOM Exception 22.
+ }
+ }
+
+ if(localStorageReallyWorks){
+ try {
+ if(window.localStorage) {
+ _storage_service = window.localStorage;
+ _backend = "localStorage";
+ }
+ } catch(E3) {/* Firefox fails when touching localStorage and cookies are disabled */}
+ }
+ else if("globalStorage" in window) {
+ try {
+ if(window.globalStorage) {
+ _storage_service = window.globalStorage[window.location.hostname];
+ _backend = "globalStorage";
+ }
+ } catch(E4) {/* Firefox fails when touching localStorage and cookies are disabled */}
+ }
+ else {
+ _storage_elm = document.createElement('link');
+ if(_storage_elm.addBehavior) {
+ _storage_elm.style.behavior = 'url(#default#userData)';
+ document.getElementsByTagName('head')[0].appendChild(_storage_elm);
+ try {
+ _storage_elm.load("jStorage");
+ var data = "{}";
+ data = _storage_elm.getAttribute("jStorage");
+ _storage_service.jStorage = data;
+ _backend = "userDataBehavior";
+ } catch(E5) {}
+ }
+ if(
+ !_backend && (
+ !!$.vakata.cookie('__vjstorage') ||
+ ($.vakata.cookie('__vjstorage', '{}', { 'expires' : 365 }) && $.vakata.cookie('__vjstorage') === '{}')
+ )
+ ) {
+ _storage_elm = null;
+ _storage_service.jStorage = $.vakata.cookie('__vjstorage');
+ _backend = "cookie";
+ }
+
+ if(!_backend) {
+ _storage_elm = null;
+ return;
+ }
+ }
+ _load_storage();
+ _handleTTL();
+ }
+
+ function _load_storage() {
+ if(_storage_service.jStorage) {
+ try {
+ _storage = json_decode(String(_storage_service.jStorage));
+ } catch(E6) { _storage_service.jStorage = "{}"; }
+ } else {
+ _storage_service.jStorage = "{}";
+ }
+ _storage_size = _storage_service.jStorage ? String(_storage_service.jStorage).length : 0;
+ }
+
+ function _save() {
+ try {
+ _storage_service.jStorage = json_encode(_storage);
+ if(_backend === 'userDataBehavior') {
+ _storage_elm.setAttribute("jStorage", _storage_service.jStorage);
+ _storage_elm.save("jStorage");
+ }
+ if(_backend === 'cookie') {
+ $.vakata.cookie('__vjstorage', _storage_service.jStorage, { 'expires' : 365 });
+ }
+ _storage_size = _storage_service.jStorage?String(_storage_service.jStorage).length:0;
+ } catch(E7) { /* probably cache is full, nothing is saved this way*/ }
+ }
+
+ function _checkKey(key) {
+ if(!key || (typeof key !== "string" && typeof key !== "number")){
+ throw new TypeError('Key name must be string or numeric');
+ }
+ if(key === "__jstorage_meta") {
+ throw new TypeError('Reserved key name');
+ }
+ return true;
+ }
+
+ function _handleTTL() {
+ var curtime = +new Date(),
+ i,
+ TTL,
+ nextExpire = Infinity,
+ changed = false;
+
+ if(_ttl_timeout !== false) {
+ clearTimeout(_ttl_timeout);
+ }
+ if(!_storage.__jstorage_meta || typeof _storage.__jstorage_meta.TTL !== "object"){
+ return;
+ }
+ TTL = _storage.__jstorage_meta.TTL;
+ for(i in TTL) {
+ if(TTL.hasOwnProperty(i)) {
+ if(TTL[i] <= curtime) {
+ delete TTL[i];
+ delete _storage[i];
+ changed = true;
+ }
+ else if(TTL[i] < nextExpire) {
+ nextExpire = TTL[i];
+ }
+ }
+ }
+
+ // set next check
+ if(nextExpire !== Infinity) {
+ _ttl_timeout = setTimeout(_handleTTL, nextExpire - curtime);
+ }
+ // save changes
+ if(changed) {
+ _save();
+ }
+ }
+
+ /*
+ Variable: $.vakata.storage
+ *object* holds all storage related functions and properties.
+ */
+ $.vakata.storage = {
+ /*
+ Variable: $.vakata.storage.version
+ *string* the version of jstorage used HEAVILY MODIFIED
+ */
+ version: "0.3.0",
+ /*
+ Function: $.vakata.storage.set
+ Set a key to a value
+
+ Parameters:
+ key - the key
+ value - the value
+
+ Returns:
+ _value_
+ */
+ set : function (key, value, ttl) {
+ _checkKey(key);
+ if(typeof value === "object") {
+ value = json_decode(json_encode(value));
+ }
+ _storage[key] = value;
+ _save();
+ if(ttl && parseInt(ttl, 10)) {
+ $.vakata.storage.setTTL(key, parseInt(ttl, 10));
+ }
+ return value;
+ },
+ /*
+ Function: $.vakata.storage.get
+ Get a value by key.
+
+ Parameters:
+ key - the key
+ def - the value to return if _key_ is not found
+
+ Returns:
+ The found value, _def_ if key not found or _null_ if _def_ is not supplied.
+ */
+ get : function (key, def) {
+ _checkKey(key);
+ if(key in _storage){
+ return _storage[key];
+ }
+ return typeof(def) === 'undefined' ? null : def;
+ },
+ /*
+ Function: $.vakata.storage.del
+ Remove a key.
+
+ Parameters:
+ key - the key
+
+ Returns:
+ *boolean*
+ */
+ del : function (key) {
+ _checkKey(key);
+ if(key in _storage) {
+ delete _storage[key];
+
+ if(_storage.__jstorage_meta && typeof _storage.__jstorage_meta.TTL === "object" && key in _storage.__jstorage_meta.TTL) {
+ delete _storage.__jstorage_meta.TTL[key];
+ }
+ _save();
+ return true;
+ }
+ return false;
+ },
+
+ setTTL: function(key, ttl){
+ var curtime = +new Date();
+
+ _checkKey(key);
+ ttl = Number(ttl) || 0;
+ if(key in _storage){
+ if(!_storage.__jstorage_meta){
+ _storage.__jstorage_meta = {};
+ }
+ if(!_storage.__jstorage_meta.TTL) {
+ _storage.__jstorage_meta.TTL = {};
+ }
+ if(ttl > 0) {
+ _storage.__jstorage_meta.TTL[key] = curtime + ttl;
+ }
+ else {
+ delete _storage.__jstorage_meta.TTL[key];
+ }
+ _save();
+ _handleTTL();
+ return true;
+ }
+ return false;
+ },
+ getTTL: function(key){
+ var curtime = +new Date(), ttl;
+ _checkKey(key);
+ if(key in _storage && _storage.__jstorage_meta.TTL && _storage.__jstorage_meta.TTL[key]) {
+ ttl = _storage.__jstorage_meta.TTL[key] - curtime;
+ return ttl || 0;
+ }
+ return 0;
+ },
+
+ /*
+ Function: $.vakata.storage.flush
+ Empty the storage.
+
+ Returns:
+ _true_
+ */
+ flush : function(){
+ _storage = {};
+ _save();
+ // try{ window.localStorage.clear(); } catch(E8) { }
+ return true;
+ },
+ /*
+ Function: $.vakata.storage.storageObj
+ Get a read only copy of the whole storage.
+
+ Returns:
+ *object*
+ */
+ storageObj : function(){
+ return $.extend(true, {}, _storage);
+ },
+ /*
+ Function: $.vakata.storage.index
+ Get an array of all the set keys in the storage.
+
+ Returns:
+ *array*
+ */
+ index : function(){
+ var index = [], i;
+ $.each(_storage, function (i, v) { if(i !== "__jstorage_meta") { index.push(i); } });
+ return index;
+ },
+ /*
+ Function: $.vakata.storage.storageSize
+ Get the size of all items in the storage in bytes.
+
+ Returns:
+ *number*
+ */
+ storageSize : function(){
+ return _storage_size;
+ },
+ /*
+ Function: $.vakata.storage.currentBackend
+ Get the current backend used.
+
+ Returns:
+ *string*
+ */
+ currentBackend : function(){
+ return _backend;
+ },
+ /*
+ Function: $.vakata.storage.storageAvailable
+ See if storage functionality is available.
+
+ Returns:
+ *boolean*
+ */
+ storageAvailable : function(){
+ return !!_backend;
+ }
+ };
+ _init();
+})(jQuery);
+
+/* File: jstree.unique.js
+Does not allow the same name amongst siblings (still a bit experimental).
+*/
+/* Group: jstree drag'n'drop plugin */
+(function ($) {
+ $.jstree.plugins.unique = function (options, parent) {
+ // TODO: think about an option to work with HTML or not?
+ // TODO: add callback - to handle errors and for example types
+ this.check = function (chk, obj, par, pos) {
+ if(parent.check.call(this, chk, obj, par, pos) === false) { return false; }
+
+ par = par === -1 ? this.element : par;
+ var n = chk === "rename_node" ? $('<div />').html(pos).text() : this.get_text(obj, true),
+ c = [],
+ t = this;
+ par.children('ul').children('li').each(function () { c.push(t.get_text(this, true)); });
+ switch(chk) {
+ case "delete_node":
+ return true;
+ case "rename_node":
+ case "copy_node":
+ return ($.inArray(n, c) === -1);
+ case "move_node":
+ return (par.children('ul').children('li').index(obj) !== -1 || $.inArray(n, c) === -1);
+ }
+ return true;
+ };
+ };
+
+ // include the unique plugin by default
+ $.jstree.defaults.plugins.push("unique");
+})(jQuery);
+
+/*
+ * jsTree wholerow plugin
+ * Makes select and hover work on the entire width of the node
+ */
+(function ($) {
+ $.jstree.plugins.wholerow = function (options, parent) {
+ this.bind = function () {
+ parent.bind.call(this);
+
+ this.element
+ .on('ready.jstree set_state.jstree', $.proxy(function () {
+ this.hide_dots();
+ }, this))
+ .on("ready.jstree", $.proxy(function () {
+ this.get_container_ul().addClass('jstree-wholerow-ul');
+ }, this))
+ .on("deselect_all.jstree", $.proxy(function (e, data) {
+ this.element.find('.jstree-wholerow-clicked').removeClass('jstree-wholerow-clicked');
+ }, this))
+ .on("changed.jstree ", $.proxy(function (e, data) {
+ this.element.find('.jstree-wholerow-clicked').removeClass('jstree-wholerow-clicked');
+ data.selected.children('.jstree-wholerow').addClass('jstree-wholerow-clicked');
+ }, this))
+ .on("hover_node.jstree dehover_node.jstree", $.proxy(function (e, data) {
+ this.element.find('.jstree-wholerow-hovered').removeClass('jstree-wholerow-hovered');
+ if(e.type === "hover_node") {
+ data.node.each(function () {
+ $(this).children('.jstree-wholerow').addClass('jstree-wholerow-hovered');
+ });
+ }
+ }, this))
+ .on("contextmenu.jstree", ".jstree-wholerow", $.proxy(function (e) {
+ if(typeof this._data.contextmenu !== 'undefined') {
+ e.preventDefault();
+ $(e.currentTarget).closest("li").children("a:eq(0)").trigger('contextmenu',e);
+ }
+ }, this))
+ .on("click.jstree", ".jstree-wholerow", function (e) {
+ e.stopImmediatePropagation();
+ $(e.currentTarget).closest("li").children("a:eq(0)").trigger('click',e);
+ })
+ .on("click.jstree", ".jstree-leaf > .jstree-ocl", $.proxy(function (e) {
+ e.stopImmediatePropagation();
+ $(e.currentTarget).closest("li").children("a:eq(0)").trigger('click',e);
+ }, this))
+ .on("mouseover.jstree", "li", $.proxy(function (e) {
+ e.stopImmediatePropagation();
+ if($(e.currentTarget).closest('li').children(".jstree-hovered, .jstree-clicked").length) {
+ return false;
+ }
+ this.hover_node(e.currentTarget);
+ return false;
+ }, this))
+ .on("mouseleave.jstree", "li", $.proxy(function (e) {
+ this.dehover_node(e.currentTarget);
+ }, this));
+ };
+ this.teardown = function () {
+ this.element.find(".jstree-wholerow").remove();
+ parent.teardown.call(this);
+ },
+ this.clean_node = function(obj) {
+ obj = parent.clean_node.call(this, obj);
+ var t = this;
+ return obj.each(function () {
+ var o = $(this);
+ if(!o.find("> .jstree-wholerow").length) {
+ o.prepend("<div class='jstree-wholerow' style='position:absolute; height:"+t._data.core.li_height+"px;' unselectable='on'> </div>");
+ }
+ });
+ };
+ };
+
+ $(function () {
+ var css_string = '' +
+ '.jstree .jstree-wholerow-ul { position:relative; display:inline-block; min-width:100%; }' +
+ '.jstree-wholerow-ul li > a, .jstree-wholerow-ul li > i { position:relative; }' +
+ '.jstree-wholerow-ul .jstree-wholerow { width:100%; cursor:pointer; position:absolute; left:0; user-select:none;-webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; }';
+ if(!$.jstree.no_css) {
+ $('head').append('<style type="text/css">' + css_string + '</style>');
+ }
+ });
+
+ // include the wholerow plugin by default
+ // $.jstree.defaults.plugins.push("wholerow");
+})(jQuery);
+
+/* File: jstree.xml.js
+This plugin makes it possible for jstree to use XML data sources.
+*/
+/* Group: jstree xml plugin */
+/*global ActiveXObject, XSLTProcessor */
+(function ($) {
+ var xsl = {
+ 'nest' : '' +
+ '<' + '?xml version="1.0" encoding="utf-8" ?>' +
+ '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >' +
+ '<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/html" />' +
+ '<xsl:template match="/">' +
+ ' <xsl:call-template name="nodes">' +
+ ' <xsl:with-param name="node" select="/root" />' +
+ ' </xsl:call-template>' +
+ '</xsl:template>' +
+ '<xsl:template name="nodes">' +
+ ' <xsl:param name="node" />' +
+ ' <ul>' +
+ ' <xsl:for-each select="$node/item">' +
+ ' <xsl:variable name="children" select="count(./item) > 0" />' +
+ ' <li>' +
+ ' <xsl:for-each select="@*"><xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute></xsl:for-each>' +
+ ' <a>' +
+ ' <xsl:for-each select="./content/@*"><xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute></xsl:for-each>' +
+ ' <xsl:copy-of select="./content/child::node()" />' +
+ ' </a>' +
+ ' <xsl:if test="$children"><xsl:call-template name="nodes"><xsl:with-param name="node" select="current()" /></xsl:call-template></xsl:if>' +
+ ' </li>' +
+ ' </xsl:for-each>' +
+ ' </ul>' +
+ '</xsl:template>' +
+ '</xsl:stylesheet>',
+ 'flat' : '' +
+ '<' + '?xml version="1.0" encoding="utf-8" ?>' +
+ '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >' +
+ '<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/xml" />' +
+ '<xsl:template match="/">' +
+ ' <ul>' +
+ ' <xsl:for-each select="//item[not(@parent_id) or @parent_id=0 or not(@parent_id = //item/@id)]">' + /* the last `or` may be removed */
+ ' <xsl:call-template name="nodes">' +
+ ' <xsl:with-param name="node" select="." />' +
+ ' </xsl:call-template>' +
+ ' </xsl:for-each>' +
+ ' </ul>' +
+ '</xsl:template>' +
+ '<xsl:template name="nodes">' +
+ ' <xsl:param name="node" />' +
+ ' <xsl:variable name="children" select="count(//item[@parent_id=$node/attribute::id]) > 0" />' +
+ ' <li>' +
+ ' <xsl:for-each select="@*">' +
+ ' <xsl:if test="name() != \'parent_id\'">' +
+ ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
+ ' </xsl:if>' +
+ ' </xsl:for-each>' +
+ ' <a>' +
+ ' <xsl:for-each select="./content/@*"><xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute></xsl:for-each>' +
+ ' <xsl:copy-of select="./content/child::node()" />' +
+ ' </a>' +
+ ' <xsl:if test="$children">' +
+ ' <ul>' +
+ ' <xsl:for-each select="//item[@parent_id=$node/attribute::id]">' +
+ ' <xsl:call-template name="nodes">' +
+ ' <xsl:with-param name="node" select="." />' +
+ ' </xsl:call-template>' +
+ ' </xsl:for-each>' +
+ ' </ul>' +
+ ' </xsl:if>' +
+ ' </li>' +
+ '</xsl:template>' +
+ '</xsl:stylesheet>'
+ },
+ escape_xml = function(string) {
+ return string
+ .toString()
+ .replace(/&/g, '&')
+ .replace(/</g, '<')
+ .replace(/>/g, '>')
+ .replace(/"/g, '"')
+ .replace(/'/g, ''');
+ };
+
+ $.jstree.defaults.xml = {
+ xsl : "flat",
+ data : false,
+ ajax : false
+ };
+
+ $.jstree.plugins.xml = function (options, parent) {
+ this._append_xml_data = function (dom, data) {
+ data = $.vakata.xslt(data, xsl[this.settings.xml.xsl]);
+ if(data === false) { return false; }
+ data = $(data);
+ dom = this.get_node(dom);
+ if(!data || !data.length || !data.is('ul, li')) {
+ if(dom && dom !== -1 && dom.is('li')) {
+ dom.removeClass('jstree-closed').addClass('jstree-leaf').children('ul').remove();
+ }
+ return true;
+ }
+ if(dom === -1) { dom = this.element; }
+ if(!dom.length) { return false; }
+ if(!dom.children('ul').length) { dom.append('<ul />'); }
+ dom.children('ul').empty().append(data.is('ul') ? data.children('li') : data);
+ return true;
+ };
+ this._load_node = function (obj, callback) {
+ var d = false,
+ s = $.extend(true, {}, this.settings.xml);
+ obj = this.get_node(obj);
+ if(!obj) { return false; }
+ switch(!0) {
+ // no settings - use parent
+ case (!s.data && !s.ajax):
+ return parent._load_node.call(this, obj, callback);
+ // data is function
+ case ($.isFunction(s.data)):
+ return s.data.call(this, obj, $.proxy(function (d) {
+ return callback.call(this, this._append_xml_data(obj, d));
+ }, this));
+ // data is set, ajax is not set, or both are set, but we are dealing with root node
+ case ((!!s.data && !s.ajax) || (!!s.data && !!s.ajax && obj === -1)):
+ return callback.call(this, this._append_xml_data(obj, s.data));
+ // data is not set, ajax is set, or both are set, but we are dealing with a normal node
+ case ((!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj !== -1)):
+ s.ajax.success = $.proxy(function (d, t, x) {
+ var s = this.settings.xml.ajax;
+ if($.isFunction(s.success)) {
+ d = s.success.call(this, d, t, x) || d;
+ }
+ callback.call(this, this._append_xml_data(obj, d));
+ }, this);
+ s.ajax.error = $.proxy(function (x, t, e) {
+ var s = this.settings.xml.ajax;
+ if($.isFunction(s.error)) {
+ s.error.call(this, x, t, e);
+ }
+ callback.call(this, false);
+ }, this);
+ if(!s.ajax.dataType) { s.ajax.dataType = "xml"; }
+ if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
+ if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
+ return $.ajax(s.ajax);
+ }
+ };
+ this.get_xml = function (mode, obj, is_callback) {
+ var r = '';
+ if(!mode) { mode = 'flat'; }
+ if(typeof is_callback === 'undefined') {
+ obj = this.get_json(obj);
+ $.each(obj, $.proxy(function (i, v) {
+ r += this.get_xml(mode, v, true);
+ }, this));
+ return '' +
+ '<' + '?xml version="1.0" encoding="utf-8" ?>' +
+ '<root>' + r + '</root>';
+ }
+ r += '<item';
+ if(mode === 'flat' && is_callback !== true) {
+ r += ' parent_id="' + escape_xml(is_callback) + '"';
+ }
+ if(obj.data && !$.isEmptyObject(obj.data)) {
+ $.each(obj.data, function (i, v) {
+ if(!$.isEmptyObject(v)) {
+ r += ' data-' + i + '="' + escape_xml($.vakata.json.encode(v)) + '"';
+ }
+ });
+ }
+ $.each(obj.li_attr, function (i, v) {
+ r += ' ' + i + '="' + escape_xml(v) + '"';
+ });
+ r += '>';
+ r += '<content';
+ $.each(obj.a_attr, function (i, v) {
+ r += ' ' + i + '="' + escape_xml(v) + '"';
+ });
+ r += '><![CDATA[' + obj.title + ']]></content>';
+
+ if(mode === 'flat') { r += '</item>'; }
+ if(obj.children) {
+ $.each(obj.children, $.proxy(function (i, v) {
+ r += this.get_xml(mode, v, obj.li_attr && obj.li_attr.id ? obj.li_attr.id : true);
+ }, this));
+ }
+ if(mode === 'nest') { r += '</item>'; }
+ return r;
+ };
+ };
+
+ // include the html plugin by default
+ $.jstree.defaults.plugins.push("xml");
+
+ // helpers
+ $.vakata.xslt = function (xml, xsl) {
+ var r = false, p, q, s, xm = $.parseXML(xml), xs = $.parseXML(xsl);
+
+ // FF, Chrome, IE10
+ if(typeof (XSLTProcessor) !== "undefined") {
+ p = new XSLTProcessor();
+ p.importStylesheet(xs);
+ r = p.transformToFragment(xm, document);
+ return $('<div />').append(r).html();
+ }
+ // OLD IE
+ if(typeof (xm.transformNode) !== "undefined") {
+ return xm.transformNode(xs);
+ }
+ // IE9, IE10
+ if(window.ActiveXObject) {
+ try {
+ r = new ActiveXObject("Msxml2.XSLTemplate");
+ q = new ActiveXObject("Msxml2.DOMDocument");
+ q.loadXML(xml);
+ s = new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
+ s.loadXML(xsl);
+ r.stylesheet = s;
+ p = r.createProcessor();
+ p.input = q;
+ p.transform();
+ r = p.output;
+ }
+ catch (e) { }
+ }
+ return r;
+ };
+})(jQuery);
\ No newline at end of file
Deleted: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default/d.gif
===================================================================
(Binary files differ)
Added: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default/dots_rtl.gif
===================================================================
(Binary files differ)
Property changes on: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default/dots_rtl.gif
___________________________________________________________________
Added: svn:mime-type
+ image/gif
Modified: trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default/style.css
===================================================================
--- trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default/style.css 2013-01-26 15:51:02 UTC (rev 29)
+++ trunk/nuiton-js-jstree/src/main/resources/nuiton-js-jstree/themes/default/style.css 2013-02-18 16:05:50 UTC (rev 30)
@@ -1,74 +1,66 @@
/*
- * jsTree default theme 1.0
- * Supported features: dots/no-dots, icons/no-icons, focused, loading
- * Supported plugins: ui (hovered, clicked), checkbox, contextmenu, search
- */
+ * jsTree default theme 2.0.0
+ * Supported features: dots/no-dots, icons/no-icons, loading, clicked, hovered, checkbox, search
+ */
.jstree-default li,
-.jstree-default ins { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; }
+.jstree-default i { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; }
.jstree-default li { background-position:-90px 0; background-repeat:repeat-y; }
.jstree-default li.jstree-last { background:transparent; }
-.jstree-default .jstree-open > ins { background-position:-72px 0; }
-.jstree-default .jstree-closed > ins { background-position:-54px 0; }
-.jstree-default .jstree-leaf > ins { background-position:-36px 0; }
+.jstree-default .jstree-open > .jstree-ocl { background-position:-72px 0; }
+.jstree-default .jstree-closed > .jstree-ocl { background-position:-54px 0; }
+.jstree-default .jstree-leaf > .jstree-ocl { background-position:-36px 0; }
+.jstree-default .jstree-loading > .jstree-ocl { background:url("throbber.gif") center center no-repeat !important; }
-.jstree-default .jstree-hovered { background:#e7f4f9; border:1px solid #d8f0fa; padding:0 2px 0 1px; }
-.jstree-default .jstree-clicked { background:#beebff; border:1px solid #99defd; padding:0 2px 0 1px; }
-.jstree-default a .jstree-icon { background-position:-56px -19px; }
-.jstree-default a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; }
+.jstree-default .jstree-hovered { background:#e7f4f9; border:1px solid #d8f0fa; padding:0 2px 0 1px; border-radius:2px; }
+.jstree-default .jstree-clicked { background:#beebff; border:1px solid #99defd; padding:0 2px 0 1px; border-radius:2px; }
-.jstree-default.jstree-focused { background:#ffffee; }
+.jstree-default .jstree-anchor > .jstree-themeicon { background-position:-56px -19px; }
.jstree-default .jstree-no-dots li,
-.jstree-default .jstree-no-dots .jstree-leaf > ins { background:transparent; }
-.jstree-default .jstree-no-dots .jstree-open > ins { background-position:-18px 0; }
-.jstree-default .jstree-no-dots .jstree-closed > ins { background-position:0 0; }
+.jstree-default .jstree-no-dots .jstree-leaf > .jstree-ocl { background:transparent; }
+.jstree-default .jstree-no-dots .jstree-open > .jstree-ocl { background-position:-18px 0; }
+.jstree-default .jstree-no-dots .jstree-closed > .jstree-ocl { background-position:0 0; }
-.jstree-default .jstree-no-icons a .jstree-icon { display:none; }
+.jstree-default > .jstree-wholerow-ul .jstree-hovered,
+.jstree-default > .jstree-wholerow-ul .jstree-clicked { background:transparent; border:0; padding:1px 2px; border-radius:0; }
-.jstree-default .jstree-search { font-style:italic; }
+.jstree-default > .jstree-wholerow-ul .jstree-wholerow-hovered { background:#e7f4f9; }
+.jstree-default > .jstree-wholerow-ul .jstree-wholerow-clicked { background:#beebff; }
-.jstree-default .jstree-no-icons .jstree-checkbox { display:inline-block; }
+.jstree-default .jstree-no-icons .jstree-anchor > .jstree-themeicon { display:none; }
+
+.jstree-default .jstree-search { font-style:italic; color:aqua; }
+
.jstree-default .jstree-no-checkboxes .jstree-checkbox { display:none !important; }
-.jstree-default .jstree-checked > a > .jstree-checkbox { background-position:-38px -19px; }
-.jstree-default .jstree-unchecked > a > .jstree-checkbox { background-position:-2px -19px; }
-.jstree-default .jstree-undetermined > a > .jstree-checkbox { background-position:-20px -19px; }
-.jstree-default .jstree-checked > a > .jstree-checkbox:hover { background-position:-38px -37px; }
-.jstree-default .jstree-unchecked > a > .jstree-checkbox:hover { background-position:-2px -37px; }
-.jstree-default .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; }
-#vakata-dragged.jstree-default ins { background:transparent !important; }
-#vakata-dragged.jstree-default .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; }
-#vakata-dragged.jstree-default .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; }
+.jstree-default .jstree-checkbox { background-position:-2px -19px; }
+.jstree-default .jstree-checkbox:hover { background-position:-2px -37px; }
+.jstree-default .jstree-clicked > .jstree-checkbox { background-position:-38px -19px; }
+.jstree-default .jstree-clicked > .jstree-checkbox:hover { background-position:-38px -37px; }
+.jstree-default.jstree-checkbox-no-clicked .jstree-clicked { background:transparent; border:0; padding:1px 2px; }
+.jstree-default.jstree-checkbox-no-clicked .jstree-clicked.jstree-hovered { background:#e7f4f9; border:1px solid #d8f0fa; padding:0 2px 0 1px; border-radius:2px; }
+.jstree-default.jstree-checkbox-no-clicked > .jstree-wholerow-ul .jstree-wholerow-clicked { background:transparent; }
+.jstree-default.jstree-checkbox-no-clicked > .jstree-wholerow-ul .jstree-wholerow-clicked.jstree-wholerow-hovered { background:#e7f4f9; }
+
+.jstree-default .jstree-anchor .jstree-undetermined { background-position:-20px -19px; }
+.jstree-default .jstree-anchor .jstree-undetermined:hover { background-position:-20px -37px; }
+
+#jstree-dnd.jstree-default i { background:transparent; }
+#jstree-dnd.jstree-default .jstree-ok { background:url("d.png") -2px -53px no-repeat; }
+#jstree-dnd.jstree-default .jstree-er { background:url("d.png") -18px -53px no-repeat; }
+
#jstree-marker.jstree-default { background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px; }
-.jstree-default a.jstree-search { color:aqua; }
-.jstree-default .jstree-locked a { color:silver; cursor:default; }
+/* RTL PART */
+.jstree-rtl.jstree-default .jstree-hovered,
+.jstree-rtl.jstree-default .jstree-clicked { padding:0 1px 0 2px; }
+.jstree-rtl.jstree-default li { background-image:url("dots_rtl.gif"); background-position: 100% 0px; }
-#vakata-contextmenu.jstree-default-context,
-#vakata-contextmenu.jstree-default-context li ul { background:#f0f0f0; border:1px solid #979797; -moz-box-shadow: 1px 1px 2px #999; -webkit-box-shadow: 1px 1px 2px #999; box-shadow: 1px 1px 2px #999; }
-#vakata-contextmenu.jstree-default-context li { }
-#vakata-contextmenu.jstree-default-context a { color:black; }
-#vakata-contextmenu.jstree-default-context a:hover,
-#vakata-contextmenu.jstree-default-context .vakata-hover > a { padding:0 5px; background:#e8eff7; border:1px solid #aecff7; color:black; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; }
-#vakata-contextmenu.jstree-default-context li.jstree-contextmenu-disabled a,
-#vakata-contextmenu.jstree-default-context li.jstree-contextmenu-disabled a:hover { color:silver; background:transparent; border:0; padding:1px 4px; }
-#vakata-contextmenu.jstree-default-context li.vakata-separator { background:white; border-top:1px solid #e0e0e0; margin:0; }
-#vakata-contextmenu.jstree-default-context li ul { margin-left:-4px; }
+.jstree-rtl.jstree-default .jstree-checkbox { background-position:0px -19px; margin-left:2px; }
+.jstree-rtl.jstree-default .jstree-checkbox:hover { background-position:0px -37px; }
+.jstree-rtl.jstree-default .jstree-clicked > .jstree-checkbox { background-position:-36px -19px; }
+.jstree-rtl.jstree-default .jstree-clicked > .jstree-checkbox:hover { background-position:-36px -37px; }
-/* IE6 BEGIN */
-.jstree-default li,
-.jstree-default ins,
-#vakata-dragged.jstree-default .jstree-invalid,
-#vakata-dragged.jstree-default .jstree-ok,
-#jstree-marker.jstree-default { _background-image:url("d.gif"); }
-.jstree-default .jstree-open ins { _background-position:-72px 0; }
-.jstree-default .jstree-closed ins { _background-position:-54px 0; }
-.jstree-default .jstree-leaf ins { _background-position:-36px 0; }
-.jstree-default a ins.jstree-icon { _background-position:-56px -19px; }
-#vakata-contextmenu.jstree-default-context ins { _display:none; }
-#vakata-contextmenu.jstree-default-context li { _zoom:1; }
-.jstree-default .jstree-undetermined a .jstree-checkbox { _background-position:-20px -19px; }
-.jstree-default .jstree-checked a .jstree-checkbox { _background-position:-38px -19px; }
-.jstree-default .jstree-unchecked a .jstree-checkbox { _background-position:-2px -19px; }
-/* IE6 END */
\ No newline at end of file
+.jstree-rtl.jstree-default .jstree-anchor .jstree-undetermined { background-position:-18px -19px; }
+.jstree-rtl.jstree-default .jstree-anchor .jstree-undetermined:hover { background-position:-18px -37px; }
\ No newline at end of file
1
0
r29 - trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro
by bpoussin@users.nuiton.org Jan. 26, 2013
by bpoussin@users.nuiton.org Jan. 26, 2013
Jan. 26, 2013
Author: bpoussin
Date: 2013-01-26 16:51:02 +0100 (Sat, 26 Jan 2013)
New Revision: 29
Url: http://nuiton.org/projects/nuiton-js/repository/revisions/29
Log:
ajout d'un nouveau processor qui permet de convertir en dataUri
les fichiers > 32ko (donc incompatible <=IE8)
Added:
trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/ForceCssDataUriPreProcessor.java
Modified:
trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsMavenWroManagerFactory.java
trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsWroManagerFactory.java
Added: trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/ForceCssDataUriPreProcessor.java
===================================================================
--- trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/ForceCssDataUriPreProcessor.java (rev 0)
+++ trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/ForceCssDataUriPreProcessor.java 2013-01-26 15:51:02 UTC (rev 29)
@@ -0,0 +1,26 @@
+package org.nuiton.js.wro;
+
+import ro.isdc.wro.model.resource.processor.impl.css.CssDataUriPreProcessor;
+
+/**
+ * Processor qui force l'utilisation des dataUri meme pour les grosses ressource
+ * Ceci est utile lorsque l'on souhaite deployer les CSS sans avoir le filtre WRO
+ * (par exemple suite a la creation via le plugin maven)
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class ForceCssDataUriPreProcessor extends CssDataUriPreProcessor {
+
+ public static final String ALIAS = "forceCssDataUri";
+
+ @Override
+ protected boolean isReplaceAccepted(String dataUri) {
+ return true;
+ }
+
+
+}
Modified: trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsMavenWroManagerFactory.java
===================================================================
--- trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsMavenWroManagerFactory.java 2013-01-26 15:48:39 UTC (rev 28)
+++ trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsMavenWroManagerFactory.java 2013-01-26 15:51:02 UTC (rev 29)
@@ -5,30 +5,75 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.util.Map;
import java.util.Properties;
+import ro.isdc.wro.manager.factory.standalone.ConfigurableStandaloneContextAwareManagerFactory;
+import ro.isdc.wro.manager.factory.standalone.DefaultStandaloneContextAwareManagerFactory;
import ro.isdc.wro.manager.factory.standalone.StandaloneContext;
-import ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory;
+import ro.isdc.wro.maven.plugin.support.ExtraConfigFileAware;
import ro.isdc.wro.model.factory.WroModelFactory;
+import ro.isdc.wro.model.resource.processor.ResourcePreProcessor;
+import ro.isdc.wro.model.resource.processor.factory.ConfigurableProcessorsFactory;
+import ro.isdc.wro.model.resource.processor.factory.ProcessorsFactory;
+import ro.isdc.wro.model.resource.support.hash.ConfigurableHashStrategy;
+import ro.isdc.wro.model.resource.support.hash.HashStrategy;
+import ro.isdc.wro.model.resource.support.naming.ConfigurableNamingStrategy;
+import ro.isdc.wro.model.resource.support.naming.NamingStrategy;
/**
+ * ManagerFactory a utiliser pour le plugin maven.
*
+ * Cette classe pourrait heriter de ConfigurableWroManagerFactory, mais
+ * a cause de methode final :( dans
+ * {@link ConfigurableStandaloneContextAwareManagerFactory#newProcessorsFactory},
+ * on doit directement heriter de DefaultStandaloneContextAwareManagerFactory
+ *
+ * Mais comme au final vu qu'on surchargeait beaucoup de chose, il n'y a que
+ * deux methodes en plus {@ #newNamingStrategy} et {@link #newHashStrategy}
+ *
* @author poussin
* @version $Revision$
*
* Last update: $Date$
* by : $Author$
*/
-public class NuitonJsMavenWroManagerFactory extends ConfigurableWroManagerFactory {
+public class NuitonJsMavenWroManagerFactory extends DefaultStandaloneContextAwareManagerFactory
+ implements ExtraConfigFileAware {
protected StandaloneContext standaloneContext;
protected File configProperties;
+ /**
+ * Surcharge pour ajouter les preprocessors
+ * <li> {@link ForceCssDataUriPreProcessor}
+ * @return
+ */
+ @Override
+ protected ProcessorsFactory newProcessorsFactory() {
+ return new ConfigurableProcessorsFactory(){
+ @Override
+ protected Map<String, ResourcePreProcessor> newPreProcessorsMap() {
+ Map<String, ResourcePreProcessor> result = super.newPreProcessorsMap();
+ result.put(ForceCssDataUriPreProcessor.ALIAS, new ForceCssDataUriPreProcessor());
+ return result;
+ }
+ }.setProperties(createProperties());
+ }
+
+ /**
+ * Surcharge pour garde le {@link StandaloneContext}
+ * @param standaloneContext
+ */
@Override
public void initialize(final StandaloneContext standaloneContext) {
super.initialize(standaloneContext);
this.standaloneContext = standaloneContext;
}
+ /**
+ * Surcharge pour utilise le {@link NuitonJsXmlModelFactory}
+ * @return
+ */
@Override
protected WroModelFactory newModelFactory() {
return new NuitonJsXmlModelFactory() {
@@ -41,13 +86,26 @@
};
}
- @Override
+ /**
+ * Utiliser pour initialiser les fichiers de config avec les choix fait
+ * par Nuiton-js et permettre la surcharge via le fichier definit dans la
+ * configuration maven
+ * @return
+ */
protected Properties createProperties() {
Properties result = new NuitonJsWroConfigurationFactory(){
+ /**
+ * On utilise le fichier indique dans la configuration maven
+ * au lieu du fichier par defaut
+ */
@Override
protected String getUserConfigPath() {
return configProperties.getAbsolutePath();
}
+ /**
+ * Surcharge pour recherche les fichiers sur le filesystem ou lieu
+ * d'utiliser le context servlet dans lequel on est pas
+ */
@Override
protected InputStream loadAsStream(String file) throws Exception {
return new BufferedInputStream(new FileInputStream(file));
@@ -56,10 +114,40 @@
return result;
}
+ /**
+ * Recupere le fichier indique dans la configuration maven
+ * @param extraProperties
+ */
@Override
public void setExtraConfigFile(final File extraProperties) {
- super.setExtraConfigFile(extraProperties);
this.configProperties = extraProperties;
}
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected NamingStrategy newNamingStrategy() {
+ return new ConfigurableNamingStrategy() {
+ @Override
+ protected Properties newProperties() {
+ return createProperties();
+ }
+ };
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected HashStrategy newHashStrategy() {
+ return new ConfigurableHashStrategy() {
+ @Override
+ protected Properties newProperties() {
+ return createProperties();
+ }
+ };
+ }
+
+
}
Modified: trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsWroManagerFactory.java
===================================================================
--- trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsWroManagerFactory.java 2013-01-26 15:48:39 UTC (rev 28)
+++ trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsWroManagerFactory.java 2013-01-26 15:51:02 UTC (rev 29)
@@ -1,8 +1,10 @@
package org.nuiton.js.wro;
+import java.util.Map;
import java.util.Properties;
import ro.isdc.wro.manager.factory.ConfigurableWroManagerFactory;
import ro.isdc.wro.model.factory.WroModelFactory;
+import ro.isdc.wro.model.resource.processor.ResourcePreProcessor;
/**
* Surcharge pour force la recherche du fichier /WEB-INF/nuiton-js.properties
@@ -28,4 +30,10 @@
return result;
}
+ @Override
+ protected void contributePreProcessors(Map<String, ResourcePreProcessor> map) {
+ super.contributePreProcessors(map);
+ map.put(ForceCssDataUriPreProcessor.ALIAS, new ForceCssDataUriPreProcessor());
+ }
+
}
1
0
Jan. 26, 2013
Author: bpoussin
Date: 2013-01-26 16:48:39 +0100 (Sat, 26 Jan 2013)
New Revision: 28
Url: http://nuiton.org/projects/nuiton-js/repository/revisions/28
Log:
ajout de font-awesome pour avoir plein de petits icones
Added:
trunk/nuiton-js-font-awesome/
trunk/nuiton-js-font-awesome/LICENSE.txt
trunk/nuiton-js-font-awesome/README.txt
trunk/nuiton-js-font-awesome/changelog.txt
trunk/nuiton-js-font-awesome/pom.xml
trunk/nuiton-js-font-awesome/src/
trunk/nuiton-js-font-awesome/src/main/
trunk/nuiton-js-font-awesome/src/main/resources/
trunk/nuiton-js-font-awesome/src/main/resources/META-INF/
trunk/nuiton-js-font-awesome/src/main/resources/META-INF/nuiton-js/
trunk/nuiton-js-font-awesome/src/main/resources/META-INF/nuiton-js/wro-font-awesome.xml
trunk/nuiton-js-font-awesome/src/main/resources/nuiton-js-font-awesome/
trunk/nuiton-js-font-awesome/src/main/resources/nuiton-js-font-awesome/css/
trunk/nuiton-js-font-awesome/src/main/resources/nuiton-js-font-awesome/css/font-awesome.css
trunk/nuiton-js-font-awesome/src/main/resources/nuiton-js-font-awesome/font/
trunk/nuiton-js-font-awesome/src/main/resources/nuiton-js-font-awesome/font/FontAwesome.otf
trunk/nuiton-js-font-awesome/src/main/resources/nuiton-js-font-awesome/font/fontawesome-webfont.eot
trunk/nuiton-js-font-awesome/src/main/resources/nuiton-js-font-awesome/font/fontawesome-webfont.svg
trunk/nuiton-js-font-awesome/src/main/resources/nuiton-js-font-awesome/font/fontawesome-webfont.ttf
trunk/nuiton-js-font-awesome/src/main/resources/nuiton-js-font-awesome/font/fontawesome-webfont.woff
trunk/nuiton-js-font-awesome/src/site/
trunk/nuiton-js-font-awesome/src/site/rst/
trunk/nuiton-js-font-awesome/src/site/rst/index.rst
trunk/nuiton-js-font-awesome/src/site/site_fr.xml
Modified:
trunk/pom.xml
Added: trunk/nuiton-js-font-awesome/LICENSE.txt
===================================================================
--- trunk/nuiton-js-font-awesome/LICENSE.txt (rev 0)
+++ trunk/nuiton-js-font-awesome/LICENSE.txt 2013-01-26 15:48:39 UTC (rev 28)
@@ -0,0 +1,166 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
+
Added: trunk/nuiton-js-font-awesome/README.txt
===================================================================
(Binary files differ)
Property changes on: trunk/nuiton-js-font-awesome/README.txt
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/nuiton-js-font-awesome/changelog.txt
===================================================================
--- trunk/nuiton-js-font-awesome/changelog.txt (rev 0)
+++ trunk/nuiton-js-font-awesome/changelog.txt 2013-01-26 15:48:39 UTC (rev 28)
@@ -0,0 +1,2 @@
+Please refer to the release note :
+ http://maven-site.nuiton.org/nuiton-js/changes-report.html
Added: trunk/nuiton-js-font-awesome/pom.xml
===================================================================
(Binary files differ)
Property changes on: trunk/nuiton-js-font-awesome/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: trunk/nuiton-js-font-awesome/src/main/resources/META-INF/nuiton-js/wro-font-awesome.xml
===================================================================
--- trunk/nuiton-js-font-awesome/src/main/resources/META-INF/nuiton-js/wro-font-awesome.xml (rev 0)
+++ trunk/nuiton-js-font-awesome/src/main/resources/META-INF/nuiton-js/wro-font-awesome.xml 2013-01-26 15:48:39 UTC (rev 28)
@@ -0,0 +1,7 @@
+<groups xmlns="http://www.isdc.ro/wro">
+
+ <group name='font-awesome'>
+ <css>classpath:nuiton-js-font-awesome/css/font-awesome.css</css>
+ </group>
+
+</groups>
Added: trunk/nuiton-js-font-awesome/src/main/resources/nuiton-js-font-awesome/css/font-awesome.css
===================================================================
--- trunk/nuiton-js-font-awesome/src/main/resources/nuiton-js-font-awesome/css/font-awesome.css (rev 0)
+++ trunk/nuiton-js-font-awesome/src/main/resources/nuiton-js-font-awesome/css/font-awesome.css 2013-01-26 15:48:39 UTC (rev 28)
@@ -0,0 +1,540 @@
+/*!
+ * Font Awesome 3.0.2
+ * the iconic font designed for use with Twitter Bootstrap
+ * -------------------------------------------------------
+ * The full suite of pictographic icons, examples, and documentation
+ * can be found at: http://fortawesome.github.com/Font-Awesome/
+ *
+ * License
+ * -------------------------------------------------------
+ * - The Font Awesome font is licensed under the SIL Open Font License - http://scripts.sil.org/OFL
+ * - Font Awesome CSS, LESS, and SASS files are licensed under the MIT License -
+ * http://opensource.org/licenses/mit-license.html
+ * - The Font Awesome pictograms are licensed under the CC BY 3.0 License - http://creativecommons.org/licenses/by/3.0/
+ * - Attribution is no longer required in Font Awesome 3.0, but much appreciated:
+ * "Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome"
+
+ * Contact
+ * -------------------------------------------------------
+ * Email: dave(a)davegandy.com
+ * Twitter: http://twitter.com/fortaweso_me
+ * Work: Lead Product Designer @ http://kyruus.com
+ */
+@font-face {
+ font-family: 'FontAwesome';
+ src: url('../font/fontawesome-webfont.eot?v=3.0.1');
+ src: url('../font/fontawesome-webfont.eot?#iefix&v=3.0.1') format('embedded-opentype'),
+ url('../font/fontawesome-webfont.woff?v=3.0.1') format('woff'),
+ url('../font/fontawesome-webfont.ttf?v=3.0.1') format('truetype');
+ font-weight: normal;
+ font-style: normal;
+}
+/* Font Awesome styles
+ ------------------------------------------------------- */
+[class^="icon-"],
+[class*=" icon-"] {
+ font-family: FontAwesome;
+ font-weight: normal;
+ font-style: normal;
+ text-decoration: inherit;
+ -webkit-font-smoothing: antialiased;
+
+ /* sprites.less reset */
+ display: inline;
+ width: auto;
+ height: auto;
+ line-height: normal;
+ vertical-align: baseline;
+ background-image: none;
+ background-position: 0% 0%;
+ background-repeat: repeat;
+ margin-top: 0;
+}
+/* more sprites.less reset */
+.icon-white,
+.nav-pills > .active > a > [class^="icon-"],
+.nav-pills > .active > a > [class*=" icon-"],
+.nav-list > .active > a > [class^="icon-"],
+.nav-list > .active > a > [class*=" icon-"],
+.navbar-inverse .nav > .active > a > [class^="icon-"],
+.navbar-inverse .nav > .active > a > [class*=" icon-"],
+.dropdown-menu > li > a:hover > [class^="icon-"],
+.dropdown-menu > li > a:hover > [class*=" icon-"],
+.dropdown-menu > .active > a > [class^="icon-"],
+.dropdown-menu > .active > a > [class*=" icon-"],
+.dropdown-submenu:hover > a > [class^="icon-"],
+.dropdown-submenu:hover > a > [class*=" icon-"] {
+ background-image: none;
+}
+[class^="icon-"]:before,
+[class*=" icon-"]:before {
+ text-decoration: inherit;
+ display: inline-block;
+ speak: none;
+}
+/* makes sure icons active on rollover in links */
+a [class^="icon-"],
+a [class*=" icon-"] {
+ display: inline-block;
+}
+/* makes the font 33% larger relative to the icon container */
+.icon-large:before {
+ vertical-align: -10%;
+ font-size: 1.3333333333333333em;
+}
+.btn [class^="icon-"],
+.nav [class^="icon-"],
+.btn [class*=" icon-"],
+.nav [class*=" icon-"] {
+ display: inline;
+ /* keeps button heights with and without icons the same */
+
+}
+.btn [class^="icon-"].icon-large,
+.nav [class^="icon-"].icon-large,
+.btn [class*=" icon-"].icon-large,
+.nav [class*=" icon-"].icon-large {
+ line-height: .9em;
+}
+.btn [class^="icon-"].icon-spin,
+.nav [class^="icon-"].icon-spin,
+.btn [class*=" icon-"].icon-spin,
+.nav [class*=" icon-"].icon-spin {
+ display: inline-block;
+}
+.nav-tabs [class^="icon-"],
+.nav-pills [class^="icon-"],
+.nav-tabs [class*=" icon-"],
+.nav-pills [class*=" icon-"] {
+ /* keeps button heights with and without icons the same */
+
+}
+.nav-tabs [class^="icon-"],
+.nav-pills [class^="icon-"],
+.nav-tabs [class*=" icon-"],
+.nav-pills [class*=" icon-"],
+.nav-tabs [class^="icon-"].icon-large,
+.nav-pills [class^="icon-"].icon-large,
+.nav-tabs [class*=" icon-"].icon-large,
+.nav-pills [class*=" icon-"].icon-large {
+ line-height: .9em;
+}
+li [class^="icon-"],
+.nav li [class^="icon-"],
+li [class*=" icon-"],
+.nav li [class*=" icon-"] {
+ display: inline-block;
+ width: 1.25em;
+ text-align: center;
+}
+li [class^="icon-"].icon-large,
+.nav li [class^="icon-"].icon-large,
+li [class*=" icon-"].icon-large,
+.nav li [class*=" icon-"].icon-large {
+ /* increased font size for icon-large */
+
+ width: 1.5625em;
+}
+ul.icons {
+ list-style-type: none;
+ text-indent: -0.75em;
+}
+ul.icons li [class^="icon-"],
+ul.icons li [class*=" icon-"] {
+ width: .75em;
+}
+.icon-muted {
+ color: #eeeeee;
+}
+.icon-border {
+ border: solid 1px #eeeeee;
+ padding: .2em .25em .15em;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+}
+.icon-2x {
+ font-size: 2em;
+}
+.icon-2x.icon-border {
+ border-width: 2px;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+}
+.icon-3x {
+ font-size: 3em;
+}
+.icon-3x.icon-border {
+ border-width: 3px;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
+}
+.icon-4x {
+ font-size: 4em;
+}
+.icon-4x.icon-border {
+ border-width: 4px;
+ -webkit-border-radius: 6px;
+ -moz-border-radius: 6px;
+ border-radius: 6px;
+}
+.pull-right {
+ float: right;
+}
+.pull-left {
+ float: left;
+}
+[class^="icon-"].pull-left,
+[class*=" icon-"].pull-left {
+ margin-right: .3em;
+}
+[class^="icon-"].pull-right,
+[class*=" icon-"].pull-right {
+ margin-left: .3em;
+}
+.btn [class^="icon-"].pull-left.icon-2x,
+.btn [class*=" icon-"].pull-left.icon-2x,
+.btn [class^="icon-"].pull-right.icon-2x,
+.btn [class*=" icon-"].pull-right.icon-2x {
+ margin-top: .18em;
+}
+.btn [class^="icon-"].icon-spin.icon-large,
+.btn [class*=" icon-"].icon-spin.icon-large {
+ line-height: .8em;
+}
+.btn.btn-small [class^="icon-"].pull-left.icon-2x,
+.btn.btn-small [class*=" icon-"].pull-left.icon-2x,
+.btn.btn-small [class^="icon-"].pull-right.icon-2x,
+.btn.btn-small [class*=" icon-"].pull-right.icon-2x {
+ margin-top: .25em;
+}
+.btn.btn-large [class^="icon-"],
+.btn.btn-large [class*=" icon-"] {
+ margin-top: 0;
+}
+.btn.btn-large [class^="icon-"].pull-left.icon-2x,
+.btn.btn-large [class*=" icon-"].pull-left.icon-2x,
+.btn.btn-large [class^="icon-"].pull-right.icon-2x,
+.btn.btn-large [class*=" icon-"].pull-right.icon-2x {
+ margin-top: .05em;
+}
+.btn.btn-large [class^="icon-"].pull-left.icon-2x,
+.btn.btn-large [class*=" icon-"].pull-left.icon-2x {
+ margin-right: .2em;
+}
+.btn.btn-large [class^="icon-"].pull-right.icon-2x,
+.btn.btn-large [class*=" icon-"].pull-right.icon-2x {
+ margin-left: .2em;
+}
+.icon-spin {
+ display: inline-block;
+ -moz-animation: spin 2s infinite linear;
+ -o-animation: spin 2s infinite linear;
+ -webkit-animation: spin 2s infinite linear;
+ animation: spin 2s infinite linear;
+}
+@-moz-keyframes spin {
+ 0% { -moz-transform: rotate(0deg); }
+ 100% { -moz-transform: rotate(359deg); }
+}
+@-webkit-keyframes spin {
+ 0% { -webkit-transform: rotate(0deg); }
+ 100% { -webkit-transform: rotate(359deg); }
+}
+@-o-keyframes spin {
+ 0% { -o-transform: rotate(0deg); }
+ 100% { -o-transform: rotate(359deg); }
+}
+@-ms-keyframes spin {
+ 0% { -ms-transform: rotate(0deg); }
+ 100% { -ms-transform: rotate(359deg); }
+}
+@keyframes spin {
+ 0% { transform: rotate(0deg); }
+ 100% { transform: rotate(359deg); }
+}
+@-moz-document url-prefix() {
+ .icon-spin {
+ height: .9em;
+ }
+ .btn .icon-spin {
+ height: auto;
+ }
+ .icon-spin.icon-large {
+ height: 1.25em;
+ }
+ .btn .icon-spin.icon-large {
+ height: .75em;
+ }
+}
+/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen
+ readers do not read off random characters that represent icons */
+.icon-glass:before { content: "\f000"; }
+.icon-music:before { content: "\f001"; }
+.icon-search:before { content: "\f002"; }
+.icon-envelope:before { content: "\f003"; }
+.icon-heart:before { content: "\f004"; }
+.icon-star:before { content: "\f005"; }
+.icon-star-empty:before { content: "\f006"; }
+.icon-user:before { content: "\f007"; }
+.icon-film:before { content: "\f008"; }
+.icon-th-large:before { content: "\f009"; }
+.icon-th:before { content: "\f00a"; }
+.icon-th-list:before { content: "\f00b"; }
+.icon-ok:before { content: "\f00c"; }
+.icon-remove:before { content: "\f00d"; }
+.icon-zoom-in:before { content: "\f00e"; }
+
+.icon-zoom-out:before { content: "\f010"; }
+.icon-off:before { content: "\f011"; }
+.icon-signal:before { content: "\f012"; }
+.icon-cog:before { content: "\f013"; }
+.icon-trash:before { content: "\f014"; }
+.icon-home:before { content: "\f015"; }
+.icon-file:before { content: "\f016"; }
+.icon-time:before { content: "\f017"; }
+.icon-road:before { content: "\f018"; }
+.icon-download-alt:before { content: "\f019"; }
+.icon-download:before { content: "\f01a"; }
+.icon-upload:before { content: "\f01b"; }
+.icon-inbox:before { content: "\f01c"; }
+.icon-play-circle:before { content: "\f01d"; }
+.icon-repeat:before { content: "\f01e"; }
+
+/* \f020 doesn't work in Safari. all shifted one down */
+.icon-refresh:before { content: "\f021"; }
+.icon-list-alt:before { content: "\f022"; }
+.icon-lock:before { content: "\f023"; }
+.icon-flag:before { content: "\f024"; }
+.icon-headphones:before { content: "\f025"; }
+.icon-volume-off:before { content: "\f026"; }
+.icon-volume-down:before { content: "\f027"; }
+.icon-volume-up:before { content: "\f028"; }
+.icon-qrcode:before { content: "\f029"; }
+.icon-barcode:before { content: "\f02a"; }
+.icon-tag:before { content: "\f02b"; }
+.icon-tags:before { content: "\f02c"; }
+.icon-book:before { content: "\f02d"; }
+.icon-bookmark:before { content: "\f02e"; }
+.icon-print:before { content: "\f02f"; }
+
+.icon-camera:before { content: "\f030"; }
+.icon-font:before { content: "\f031"; }
+.icon-bold:before { content: "\f032"; }
+.icon-italic:before { content: "\f033"; }
+.icon-text-height:before { content: "\f034"; }
+.icon-text-width:before { content: "\f035"; }
+.icon-align-left:before { content: "\f036"; }
+.icon-align-center:before { content: "\f037"; }
+.icon-align-right:before { content: "\f038"; }
+.icon-align-justify:before { content: "\f039"; }
+.icon-list:before { content: "\f03a"; }
+.icon-indent-left:before { content: "\f03b"; }
+.icon-indent-right:before { content: "\f03c"; }
+.icon-facetime-video:before { content: "\f03d"; }
+.icon-picture:before { content: "\f03e"; }
+
+.icon-pencil:before { content: "\f040"; }
+.icon-map-marker:before { content: "\f041"; }
+.icon-adjust:before { content: "\f042"; }
+.icon-tint:before { content: "\f043"; }
+.icon-edit:before { content: "\f044"; }
+.icon-share:before { content: "\f045"; }
+.icon-check:before { content: "\f046"; }
+.icon-move:before { content: "\f047"; }
+.icon-step-backward:before { content: "\f048"; }
+.icon-fast-backward:before { content: "\f049"; }
+.icon-backward:before { content: "\f04a"; }
+.icon-play:before { content: "\f04b"; }
+.icon-pause:before { content: "\f04c"; }
+.icon-stop:before { content: "\f04d"; }
+.icon-forward:before { content: "\f04e"; }
+
+.icon-fast-forward:before { content: "\f050"; }
+.icon-step-forward:before { content: "\f051"; }
+.icon-eject:before { content: "\f052"; }
+.icon-chevron-left:before { content: "\f053"; }
+.icon-chevron-right:before { content: "\f054"; }
+.icon-plus-sign:before { content: "\f055"; }
+.icon-minus-sign:before { content: "\f056"; }
+.icon-remove-sign:before { content: "\f057"; }
+.icon-ok-sign:before { content: "\f058"; }
+.icon-question-sign:before { content: "\f059"; }
+.icon-info-sign:before { content: "\f05a"; }
+.icon-screenshot:before { content: "\f05b"; }
+.icon-remove-circle:before { content: "\f05c"; }
+.icon-ok-circle:before { content: "\f05d"; }
+.icon-ban-circle:before { content: "\f05e"; }
+
+.icon-arrow-left:before { content: "\f060"; }
+.icon-arrow-right:before { content: "\f061"; }
+.icon-arrow-up:before { content: "\f062"; }
+.icon-arrow-down:before { content: "\f063"; }
+.icon-share-alt:before { content: "\f064"; }
+.icon-resize-full:before { content: "\f065"; }
+.icon-resize-small:before { content: "\f066"; }
+.icon-plus:before { content: "\f067"; }
+.icon-minus:before { content: "\f068"; }
+.icon-asterisk:before { content: "\f069"; }
+.icon-exclamation-sign:before { content: "\f06a"; }
+.icon-gift:before { content: "\f06b"; }
+.icon-leaf:before { content: "\f06c"; }
+.icon-fire:before { content: "\f06d"; }
+.icon-eye-open:before { content: "\f06e"; }
+
+.icon-eye-close:before { content: "\f070"; }
+.icon-warning-sign:before { content: "\f071"; }
+.icon-plane:before { content: "\f072"; }
+.icon-calendar:before { content: "\f073"; }
+.icon-random:before { content: "\f074"; }
+.icon-comment:before { content: "\f075"; }
+.icon-magnet:before { content: "\f076"; }
+.icon-chevron-up:before { content: "\f077"; }
+.icon-chevron-down:before { content: "\f078"; }
+.icon-retweet:before { content: "\f079"; }
+.icon-shopping-cart:before { content: "\f07a"; }
+.icon-folder-close:before { content: "\f07b"; }
+.icon-folder-open:before { content: "\f07c"; }
+.icon-resize-vertical:before { content: "\f07d"; }
+.icon-resize-horizontal:before { content: "\f07e"; }
+
+.icon-bar-chart:before { content: "\f080"; }
+.icon-twitter-sign:before { content: "\f081"; }
+.icon-facebook-sign:before { content: "\f082"; }
+.icon-camera-retro:before { content: "\f083"; }
+.icon-key:before { content: "\f084"; }
+.icon-cogs:before { content: "\f085"; }
+.icon-comments:before { content: "\f086"; }
+.icon-thumbs-up:before { content: "\f087"; }
+.icon-thumbs-down:before { content: "\f088"; }
+.icon-star-half:before { content: "\f089"; }
+.icon-heart-empty:before { content: "\f08a"; }
+.icon-signout:before { content: "\f08b"; }
+.icon-linkedin-sign:before { content: "\f08c"; }
+.icon-pushpin:before { content: "\f08d"; }
+.icon-external-link:before { content: "\f08e"; }
+
+.icon-signin:before { content: "\f090"; }
+.icon-trophy:before { content: "\f091"; }
+.icon-github-sign:before { content: "\f092"; }
+.icon-upload-alt:before { content: "\f093"; }
+.icon-lemon:before { content: "\f094"; }
+.icon-phone:before { content: "\f095"; }
+.icon-check-empty:before { content: "\f096"; }
+.icon-bookmark-empty:before { content: "\f097"; }
+.icon-phone-sign:before { content: "\f098"; }
+.icon-twitter:before { content: "\f099"; }
+.icon-facebook:before { content: "\f09a"; }
+.icon-github:before { content: "\f09b"; }
+.icon-unlock:before { content: "\f09c"; }
+.icon-credit-card:before { content: "\f09d"; }
+.icon-rss:before { content: "\f09e"; }
+
+.icon-hdd:before { content: "\f0a0"; }
+.icon-bullhorn:before { content: "\f0a1"; }
+.icon-bell:before { content: "\f0a2"; }
+.icon-certificate:before { content: "\f0a3"; }
+.icon-hand-right:before { content: "\f0a4"; }
+.icon-hand-left:before { content: "\f0a5"; }
+.icon-hand-up:before { content: "\f0a6"; }
+.icon-hand-down:before { content: "\f0a7"; }
+.icon-circle-arrow-left:before { content: "\f0a8"; }
+.icon-circle-arrow-right:before { content: "\f0a9"; }
+.icon-circle-arrow-up:before { content: "\f0aa"; }
+.icon-circle-arrow-down:before { content: "\f0ab"; }
+.icon-globe:before { content: "\f0ac"; }
+.icon-wrench:before { content: "\f0ad"; }
+.icon-tasks:before { content: "\f0ae"; }
+
+.icon-filter:before { content: "\f0b0"; }
+.icon-briefcase:before { content: "\f0b1"; }
+.icon-fullscreen:before { content: "\f0b2"; }
+
+.icon-group:before { content: "\f0c0"; }
+.icon-link:before { content: "\f0c1"; }
+.icon-cloud:before { content: "\f0c2"; }
+.icon-beaker:before { content: "\f0c3"; }
+.icon-cut:before { content: "\f0c4"; }
+.icon-copy:before { content: "\f0c5"; }
+.icon-paper-clip:before { content: "\f0c6"; }
+.icon-save:before { content: "\f0c7"; }
+.icon-sign-blank:before { content: "\f0c8"; }
+.icon-reorder:before { content: "\f0c9"; }
+.icon-list-ul:before { content: "\f0ca"; }
+.icon-list-ol:before { content: "\f0cb"; }
+.icon-strikethrough:before { content: "\f0cc"; }
+.icon-underline:before { content: "\f0cd"; }
+.icon-table:before { content: "\f0ce"; }
+
+.icon-magic:before { content: "\f0d0"; }
+.icon-truck:before { content: "\f0d1"; }
+.icon-pinterest:before { content: "\f0d2"; }
+.icon-pinterest-sign:before { content: "\f0d3"; }
+.icon-google-plus-sign:before { content: "\f0d4"; }
+.icon-google-plus:before { content: "\f0d5"; }
+.icon-money:before { content: "\f0d6"; }
+.icon-caret-down:before { content: "\f0d7"; }
+.icon-caret-up:before { content: "\f0d8"; }
+.icon-caret-left:before { content: "\f0d9"; }
+.icon-caret-right:before { content: "\f0da"; }
+.icon-columns:before { content: "\f0db"; }
+.icon-sort:before { content: "\f0dc"; }
+.icon-sort-down:before { content: "\f0dd"; }
+.icon-sort-up:before { content: "\f0de"; }
+
+.icon-envelope-alt:before { content: "\f0e0"; }
+.icon-linkedin:before { content: "\f0e1"; }
+.icon-undo:before { content: "\f0e2"; }
+.icon-legal:before { content: "\f0e3"; }
+.icon-dashboard:before { content: "\f0e4"; }
+.icon-comment-alt:before { content: "\f0e5"; }
+.icon-comments-alt:before { content: "\f0e6"; }
+.icon-bolt:before { content: "\f0e7"; }
+.icon-sitemap:before { content: "\f0e8"; }
+.icon-umbrella:before { content: "\f0e9"; }
+.icon-paste:before { content: "\f0ea"; }
+.icon-lightbulb:before { content: "\f0eb"; }
+.icon-exchange:before { content: "\f0ec"; }
+.icon-cloud-download:before { content: "\f0ed"; }
+.icon-cloud-upload:before { content: "\f0ee"; }
+
+.icon-user-md:before { content: "\f0f0"; }
+.icon-stethoscope:before { content: "\f0f1"; }
+.icon-suitcase:before { content: "\f0f2"; }
+.icon-bell-alt:before { content: "\f0f3"; }
+.icon-coffee:before { content: "\f0f4"; }
+.icon-food:before { content: "\f0f5"; }
+.icon-file-alt:before { content: "\f0f6"; }
+.icon-building:before { content: "\f0f7"; }
+.icon-hospital:before { content: "\f0f8"; }
+.icon-ambulance:before { content: "\f0f9"; }
+.icon-medkit:before { content: "\f0fa"; }
+.icon-fighter-jet:before { content: "\f0fb"; }
+.icon-beer:before { content: "\f0fc"; }
+.icon-h-sign:before { content: "\f0fd"; }
+.icon-plus-sign-alt:before { content: "\f0fe"; }
+
+.icon-double-angle-left:before { content: "\f100"; }
+.icon-double-angle-right:before { content: "\f101"; }
+.icon-double-angle-up:before { content: "\f102"; }
+.icon-double-angle-down:before { content: "\f103"; }
+.icon-angle-left:before { content: "\f104"; }
+.icon-angle-right:before { content: "\f105"; }
+.icon-angle-up:before { content: "\f106"; }
+.icon-angle-down:before { content: "\f107"; }
+.icon-desktop:before { content: "\f108"; }
+.icon-laptop:before { content: "\f109"; }
+.icon-tablet:before { content: "\f10a"; }
+.icon-mobile-phone:before { content: "\f10b"; }
+.icon-circle-blank:before { content: "\f10c"; }
+.icon-quote-left:before { content: "\f10d"; }
+.icon-quote-right:before { content: "\f10e"; }
+
+.icon-spinner:before { content: "\f110"; }
+.icon-circle:before { content: "\f111"; }
+.icon-reply:before { content: "\f112"; }
+.icon-github-alt:before { content: "\f113"; }
+.icon-folder-close-alt:before { content: "\f114"; }
+.icon-folder-open-alt:before { content: "\f115"; }
Added: trunk/nuiton-js-font-awesome/src/main/resources/nuiton-js-font-awesome/font/FontAwesome.otf
===================================================================
(Binary files differ)
Property changes on: trunk/nuiton-js-font-awesome/src/main/resources/nuiton-js-font-awesome/font/FontAwesome.otf
___________________________________________________________________
Added: svn:mime-type
+ application/vnd.ms-opentype
Added: trunk/nuiton-js-font-awesome/src/main/resources/nuiton-js-font-awesome/font/fontawesome-webfont.eot
===================================================================
(Binary files differ)
Property changes on: trunk/nuiton-js-font-awesome/src/main/resources/nuiton-js-font-awesome/font/fontawesome-webfont.eot
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/vnd.ms-fontobject
Added: trunk/nuiton-js-font-awesome/src/main/resources/nuiton-js-font-awesome/font/fontawesome-webfont.svg
===================================================================
(Binary files differ)
Property changes on: trunk/nuiton-js-font-awesome/src/main/resources/nuiton-js-font-awesome/font/fontawesome-webfont.svg
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ image/svg+xml
Added: trunk/nuiton-js-font-awesome/src/main/resources/nuiton-js-font-awesome/font/fontawesome-webfont.ttf
===================================================================
(Binary files differ)
Property changes on: trunk/nuiton-js-font-awesome/src/main/resources/nuiton-js-font-awesome/font/fontawesome-webfont.ttf
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/x-font-ttf
Added: trunk/nuiton-js-font-awesome/src/main/resources/nuiton-js-font-awesome/font/fontawesome-webfont.woff
===================================================================
(Binary files differ)
Property changes on: trunk/nuiton-js-font-awesome/src/main/resources/nuiton-js-font-awesome/font/fontawesome-webfont.woff
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/nuiton-js-font-awesome/src/site/rst/index.rst
===================================================================
--- trunk/nuiton-js-font-awesome/src/site/rst/index.rst (rev 0)
+++ trunk/nuiton-js-font-awesome/src/site/rst/index.rst 2013-01-26 15:48:39 UTC (rev 28)
@@ -0,0 +1,32 @@
+Source
+======
+
+- Font Awesome by Dave Gandy http://fortawesome.github.com/Font-Awesome/
+- The Font Awesome font is licensed under the SIL Open Font License - http://scripts.sil.org/OFL.
+- Font Awesome CSS, LESS, and SASS files are licensed under the MIT License - http://opensource.org/licenses/mit-license.html.
+- The Font Awesome pictograms are licensed under the CC BY 3.0 License - http://creativecommons.org/licenses/by/3.0/
+
+Utilisation
+===========
+
+::
+
+ <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+
+ <link rel="stylesheet" type="text/css" href="<c:url value="/nuiton-js/font-awesome.css"/>" />
+
+JS disponible
+-------------
+
+aucun
+
+CSS disponible
+--------------
+
+- font-awesome
+
+Remarque
+========
+
+Les fonts ne semble pas fonctionner en dataUri (même en modifiant les urls
+pour que wro reconnaisse les chemins des fichiers fonts)
Added: trunk/nuiton-js-font-awesome/src/site/site_fr.xml
===================================================================
--- trunk/nuiton-js-font-awesome/src/site/site_fr.xml (rev 0)
+++ trunk/nuiton-js-font-awesome/src/site/site_fr.xml 2013-01-26 15:48:39 UTC (rev 28)
@@ -0,0 +1,49 @@
+<project name="${project.name}">
+
+ <bannerLeft>
+ <src alt="NuitonJS">logo.jpg</src>
+ <name>${project.name}</name>
+ <href>index.html</href>
+ </bannerLeft>
+
+ <body>
+
+ <head>
+ <script type="text/javascript"
+ src="http://maven-site.nuiton.org/public/js/mavenpom-site.js">
+ </script>
+
+ <link rel="stylesheet" type="text/css"
+ href="http://maven-site.nuiton.org/public/css/mavenpom-site.css"/>
+ </head>
+
+ <breadcrumbs>
+ <item name="${project.name}" href="${project.url}"/>
+ </breadcrumbs>
+
+ <menu ref="parent"/>
+
+ <menu name="Utilisateurs">
+ <item name="Accueil" href="index.html"/>
+ </menu>
+
+ <menu ref="reports"/>
+
+ <footer>
+
+ <div id='projectMetas'
+ projectversion='${project.version}'
+ platform='${project.platform}'
+ projectid='${project.projectId}'
+ scm='${project.scm.connection}'
+ scmwebeditorenabled='${project.scmwebeditorEnabled}'
+ scmwebeditorurl='${project.scmwebeditorUrl}'
+ siteSourcesType='${project.siteSourcesType}'
+ piwikEnabled='${project.piwikEnabled}'
+ piwikId='${project.piwikId}'>
+ </div>
+ </footer>
+
+ </body>
+
+</project>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-01-25 23:19:50 UTC (rev 27)
+++ trunk/pom.xml 2013-01-26 15:48:39 UTC (rev 28)
@@ -23,6 +23,7 @@
<module>nuiton-js-jquery-ui</module>
<module>nuiton-js-jqplot</module>
<module>nuiton-js-bootstrap</module>
+ <module>nuiton-js-font-awesome</module>
<module>nuiton-js-jstree</module>
<module>nuiton-js-jqgrid</module>
</modules>
1
0
Author: bpoussin
Date: 2013-01-26 00:19:50 +0100 (Sat, 26 Jan 2013)
New Revision: 27
Url: http://nuiton.org/projects/nuiton-js/repository/revisions/27
Log:
ajout de la dependance manquante a jquery dans le pom.xml
Modified:
trunk/nuiton-js-jqplot/pom.xml
Modified: trunk/nuiton-js-jqplot/pom.xml
===================================================================
(Binary files differ)
1
0
r26 - in trunk: nuiton-js-jqgrid/src/main/resources/META-INF/nuiton-js src/site/rst
by bpoussin@users.nuiton.org Jan. 25, 2013
by bpoussin@users.nuiton.org Jan. 25, 2013
Jan. 25, 2013
Author: bpoussin
Date: 2013-01-25 22:32:25 +0100 (Fri, 25 Jan 2013)
New Revision: 26
Url: http://nuiton.org/projects/nuiton-js/repository/revisions/26
Log:
modif pour mieux cible le js charge (car sinon, il chargeait aussi toutes
les langues et il y a un bug dans le DK :(
Modified:
trunk/nuiton-js-jqgrid/src/main/resources/META-INF/nuiton-js/wro-jqgrid.xml
trunk/src/site/rst/index.rst
Modified: trunk/nuiton-js-jqgrid/src/main/resources/META-INF/nuiton-js/wro-jqgrid.xml
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/META-INF/nuiton-js/wro-jqgrid.xml 2013-01-22 19:13:28 UTC (rev 25)
+++ trunk/nuiton-js-jqgrid/src/main/resources/META-INF/nuiton-js/wro-jqgrid.xml 2013-01-25 21:32:25 UTC (rev 26)
@@ -8,8 +8,8 @@
</group>
<group name='jqgrid-only'>
- <css>classpath:nuiton-js-jqgrid/css/*.css</css>
- <js>classpath:nuiton-js-jqgrid/js/*.js</js>
+ <css>classpath:nuiton-js-jqgrid/css/ui.jqgrid.css</css>
+ <js>classpath:nuiton-js-jqgrid/js/jquery.jqGrid.src.js</js>
</group>
<!--
Modified: trunk/src/site/rst/index.rst
===================================================================
--- trunk/src/site/rst/index.rst 2013-01-22 19:13:28 UTC (rev 25)
+++ trunk/src/site/rst/index.rst 2013-01-25 21:32:25 UTC (rev 26)
@@ -23,12 +23,12 @@
<filter-name>WebResourceOptimizer</filter-name>
<filter-class>org.nuiton.js.wro.NuitonJsFilter</filter-class>
</filter>
-
<filter-mapping>
<filter-name>WebResourceOptimizer</filter-name>
<url-pattern>/nuiton-js/*</url-pattern>
</filter-mapping>
+
Déclaration commune à toutes les versions de Servlets
-----------------------------------------------------
1
0
Author: bpoussin
Date: 2013-01-22 20:13:28 +0100 (Tue, 22 Jan 2013)
New Revision: 25
Url: http://nuiton.org/projects/nuiton-js/repository/revisions/25
Log:
small mistake :) (duplicate distributionManagement)
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-01-22 19:12:03 UTC (rev 24)
+++ trunk/pom.xml 2013-01-22 19:13:28 UTC (rev 25)
@@ -132,13 +132,6 @@
</properties>
- <distributionManagement>
- <site>
- <id>${site.server}</id>
- <url>${our.site.repository}/${projectId}</url>
- </site>
- </distributionManagement>
-
<build>
<pluginManagement>
1
0
Author: bpoussin
Date: 2013-01-22 20:12:03 +0100 (Tue, 22 Jan 2013)
New Revision: 24
Url: http://nuiton.org/projects/nuiton-js/repository/revisions/24
Log:
add some information in pom.xml (perhaps this help to deploy site ?)
Modified:
trunk/pom.xml
trunk/src/site/rst/index.rst
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-01-22 17:19:02 UTC (rev 23)
+++ trunk/pom.xml 2013-01-22 19:12:03 UTC (rev 24)
@@ -183,4 +183,56 @@
<url>http://www.nuiton.org/repositories/browse/nuiton-js/trunk</url>
</scm>
+ <distributionManagement>
+ <site>
+ <id>${platform}</id>
+ <url>${our.site.repository}/${projectId}</url>
+ </site>
+ </distributionManagement>
+
+ <profiles>
+
+ <profile>
+ <id>reporting</id>
+ <activation>
+ <property>
+ <name>performRelease</name>
+ <value>true</value>
+ </property>
+ </activation>
+
+ <reporting>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <version>${projectInfoReportsPluginVersion}</version>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>project-team</report>
+ <report>mailing-list</report>
+ <report>cim</report>
+ <report>issue-tracking</report>
+ <report>license</report>
+ <report>scm</report>
+ <report>dependency-info</report>
+ <report>dependencies</report>
+ <report>dependency-convergence</report>
+ <report>plugin-management</report>
+ <report>plugins</report>
+ <report>dependency-management</report>
+ <report>summary</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+
+ </plugins>
+ </reporting>
+
+ </profile>
+
+ </profiles>
+
</project>
Modified: trunk/src/site/rst/index.rst
===================================================================
--- trunk/src/site/rst/index.rst 2013-01-22 17:19:02 UTC (rev 23)
+++ trunk/src/site/rst/index.rst 2013-01-22 19:12:03 UTC (rev 24)
@@ -23,7 +23,7 @@
<filter-name>WebResourceOptimizer</filter-name>
<filter-class>org.nuiton.js.wro.NuitonJsFilter</filter-class>
</filter>
-
+
<filter-mapping>
<filter-name>WebResourceOptimizer</filter-name>
<url-pattern>/nuiton-js/*</url-pattern>
1
0
Author: bpoussin
Date: 2013-01-22 18:19:02 +0100 (Tue, 22 Jan 2013)
New Revision: 23
Url: http://nuiton.org/projects/nuiton-js/repository/revisions/23
Log:
update license file
Modified:
trunk/nuiton-js-wro/src/license/THIRD-PARTY.properties
Modified: trunk/nuiton-js-wro/src/license/THIRD-PARTY.properties
===================================================================
--- trunk/nuiton-js-wro/src/license/THIRD-PARTY.properties 2013-01-22 13:56:16 UTC (rev 22)
+++ trunk/nuiton-js-wro/src/license/THIRD-PARTY.properties 2013-01-22 17:19:02 UTC (rev 23)
@@ -1,16 +1,34 @@
# Generated by org.codehaus.mojo.license.AddThirdPartyMojo
#-------------------------------------------------------------------------------
# Already used licenses in project :
+# - Academic Free License v2.1
+# - Apache License version 2.0
# - BSD License
+# - BSD licence
+# - BSD style
# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+# - Common Public License - v 1.0
+# - Common Public License Version 1.0
+# - Eclipse Public License, Version 1.0
+# - GNU General Public License Version 2
+# - GNU General Public License, Version 2
+# - GNU Lesser General Public License Version 2.1
# - Indiana University Extreme! Lab Software License, vesion 1.1.1
# - Lesser General Public License (LPGL)
# - Lesser General Public License (LPGL) v 2.1
# - MIT License
+# - Mozilla Public License, Version 1.1
+# - New BSD license
# - The Apache Software License, Version 2.0
+# - The MIT License
+# - provided without support or warranty
#-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies :
#
#
-#Sat Dec 29 15:24:22 CET 2012
+#Tue Jan 22 18:16:42 CET 2013
+args4j--args4j--2.0.16=MIT License
javax.servlet--servlet-api--2.5=COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+org.antlr--antlr--3.4=BSD License
+org.antlr--antlr-runtime--3.4=BSD License
+org.codehaus.groovy--groovy-all--1.7.4=Apache License version 2.0
1
0
Author: bpoussin
Date: 2013-01-22 14:56:16 +0100 (Tue, 22 Jan 2013)
New Revision: 22
Url: http://nuiton.org/projects/nuiton-js/repository/revisions/22
Log:
ajout de la documentation du plugin maven
Modified:
trunk/src/site/rst/index.rst
Modified: trunk/src/site/rst/index.rst
===================================================================
--- trunk/src/site/rst/index.rst 2013-01-22 13:44:59 UTC (rev 21)
+++ trunk/src/site/rst/index.rst 2013-01-22 13:56:16 UTC (rev 22)
@@ -131,7 +131,61 @@
postProcessors=cssVariables,jsMin
uriLocators=servletContext,uri,classpath
+Utilisation du plugin Maven pour générer les ressources
+=======================================================
+Voici un exemple d'utilisation. La différence avec la configuraiton standard
+est la déclaration de **org.nuiton.js.wro.NuitonJsMavenWroManagerFactory** comme
+wroManagerFactory et la déclation des dépendances vers les ressources js et css::
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>ro.isdc.wro4j</groupId>
+ <artifactId>wro4j-maven-plugin</artifactId>
+ <version>1.6.2</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.nuiton.js</groupId>
+ <artifactId>nuiton-js-jquery</artifactId>
+ <version>1.8.3-1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.nuiton.js</groupId>
+ <artifactId>nuiton-js-jqgrid</artifactId>
+ <version>4.4.1-1</version>
+ </dependency>
+ </dependencies>
+
+ <executions>
+ <execution>
+ <phase>compile</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+
+ <configuration>
+ <targetGroups>MonApp</targetGroups>
+ <minimize>true</minimize>
+ <destinationFolder>${basedir}/src/main/webapp/wro/</destinationFolder>
+ <contextFolder>${basedir}/src/main/webapp/</contextFolder>
+ <wroFile>${basedir}/src/main/webapp/WEB-INF/wro.xml</wroFile>
+ <wroManagerFactory>org.nuiton.js.wro.NuitonJsMavenWroManagerFactory</wroManagerFactory>
+ <extraConfigFile>${basedir}/src/main/webapp/WEB-INF/wro.properties</extraConfigFile>
+ </configuration>
+ </plugin>
+ </plugin>
+ </build>
+
+Vous pouvez alors dans vos pages utiliser::
+
+ <link href="<c:url value='/wro/MonApp.css'/>" rel="stylesheet" type="text/css"/>
+ <script type="text/javascript" src="<c:url value='/wro/MonApp.js'/>"></script>
+
+
Création d'un nouveau module
============================
1
0
r21 - in trunk: . nuiton-js-jqgrid nuiton-js-jquery/src/main/resources/META-INF/nuiton-js nuiton-js-wro nuiton-js-wro/src/main/java/org/nuiton/js/wro
by bpoussin@users.nuiton.org Jan. 22, 2013
by bpoussin@users.nuiton.org Jan. 22, 2013
Jan. 22, 2013
Author: bpoussin
Date: 2013-01-22 14:44:59 +0100 (Tue, 22 Jan 2013)
New Revision: 21
Url: http://nuiton.org/projects/nuiton-js/repository/revisions/21
Log:
ajout du WroManagerFactory a utiliser pour le plugin maven
Added:
trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsMavenWroManagerFactory.java
Modified:
trunk/nuiton-js-jqgrid/
trunk/nuiton-js-jquery/src/main/resources/META-INF/nuiton-js/wro-jquery.xml
trunk/nuiton-js-wro/pom.xml
trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsWroConfigurationFactory.java
trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsXmlModelFactory.java
trunk/pom.xml
Property changes on: trunk/nuiton-js-jqgrid
___________________________________________________________________
Added: svn:ignore
+ target
Modified: trunk/nuiton-js-jquery/src/main/resources/META-INF/nuiton-js/wro-jquery.xml
===================================================================
--- trunk/nuiton-js-jquery/src/main/resources/META-INF/nuiton-js/wro-jquery.xml 2013-01-19 11:25:15 UTC (rev 20)
+++ trunk/nuiton-js-jquery/src/main/resources/META-INF/nuiton-js/wro-jquery.xml 2013-01-22 13:44:59 UTC (rev 21)
@@ -1,5 +1,5 @@
<groups xmlns="http://www.isdc.ro/wro">
<group name='jquery'>
- <js>classpath:nuiton-js-jquery/**.js</js>
+ <js>classpath:nuiton-js-jquery/*.js</js>
</group>
</groups>
Modified: trunk/nuiton-js-wro/pom.xml
===================================================================
(Binary files differ)
Property changes on: trunk/nuiton-js-wro/pom.xml
___________________________________________________________________
Deleted: svn:mime-type
- application/xml
Added: trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsMavenWroManagerFactory.java
===================================================================
--- trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsMavenWroManagerFactory.java (rev 0)
+++ trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsMavenWroManagerFactory.java 2013-01-22 13:44:59 UTC (rev 21)
@@ -0,0 +1,65 @@
+package org.nuiton.js.wro;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+import ro.isdc.wro.manager.factory.standalone.StandaloneContext;
+import ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory;
+import ro.isdc.wro.model.factory.WroModelFactory;
+
+/**
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class NuitonJsMavenWroManagerFactory extends ConfigurableWroManagerFactory {
+ protected StandaloneContext standaloneContext;
+ protected File configProperties;
+
+
+ @Override
+ public void initialize(final StandaloneContext standaloneContext) {
+ super.initialize(standaloneContext);
+ this.standaloneContext = standaloneContext;
+ }
+
+ @Override
+ protected WroModelFactory newModelFactory() {
+ return new NuitonJsXmlModelFactory() {
+ @Override
+ protected InputStream getModelResourceAsStream() throws IOException {
+ InputStream stream = new BufferedInputStream(
+ new FileInputStream(standaloneContext.getWroFile()));
+ return stream;
+ }
+ };
+ }
+
+ @Override
+ protected Properties createProperties() {
+ Properties result = new NuitonJsWroConfigurationFactory(){
+ @Override
+ protected String getUserConfigPath() {
+ return configProperties.getAbsolutePath();
+ }
+ @Override
+ protected InputStream loadAsStream(String file) throws Exception {
+ return new BufferedInputStream(new FileInputStream(file));
+ }
+ }.initProperties();
+ return result;
+ }
+
+ @Override
+ public void setExtraConfigFile(final File extraProperties) {
+ super.setExtraConfigFile(extraProperties);
+ this.configProperties = extraProperties;
+ }
+
+}
Modified: trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsWroConfigurationFactory.java
===================================================================
--- trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsWroConfigurationFactory.java 2013-01-19 11:25:15 UTC (rev 20)
+++ trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsWroConfigurationFactory.java 2013-01-22 13:44:59 UTC (rev 21)
@@ -1,5 +1,6 @@
package org.nuiton.js.wro;
+import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import javax.servlet.FilterConfig;
@@ -18,7 +19,7 @@
* dans la config:
* <li> managerFactoryClassName=org.nuiton.js.wro.NuitonJsWroManagerFactory
* <li> debug=true
- * <li> preProcessors=fallbackCssDataUri,cssUrlRewriting,cssImport,semicolonAppender,cssMin
+ * <li> preProcessors=fallbackCssDataUri,cssUrlRewriting,cssImport,semicolonAppender,cssMinJawr
* <li> postProcessors=cssVariables,jsMin
* <li> uriLocators=servletContext,uri,classpath
*
@@ -72,7 +73,7 @@
String file = getUserConfigPath();
try {
LOG.debug("loading config resource from: {}", file);
- propertyStream = getServletContext().getResourceAsStream(file);
+ propertyStream = loadAsStream(file);
Validate.notNull(propertyStream);
Properties props = new Properties();
props.load(propertyStream);
@@ -86,6 +87,11 @@
return result;
}
+ protected InputStream loadAsStream(String file) throws Exception {
+ InputStream result = getServletContext().getResourceAsStream(file);
+ return result;
+ }
+
protected ServletContext getServletContext() {
ServletContext result;
if (filterConfig != null) {
Modified: trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsXmlModelFactory.java
===================================================================
--- trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsXmlModelFactory.java 2013-01-19 11:25:15 UTC (rev 20)
+++ trunk/nuiton-js-wro/src/main/java/org/nuiton/js/wro/NuitonJsXmlModelFactory.java 2013-01-22 13:44:59 UTC (rev 21)
@@ -48,7 +48,7 @@
}
}
- // on continue avec le fichier par defaut /WEB-INF/wro.properties
+ // on continue avec le fichier par defaut /WEB-INF/wro.xml
try {
// on ne reutilise pas create du super car la methode commence
// par un new model :(. Or on veut conserve les imports qui viennent
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-01-19 11:25:15 UTC (rev 20)
+++ trunk/pom.xml 2013-01-22 13:44:59 UTC (rev 21)
@@ -51,6 +51,12 @@
</dependency>
<dependency>
+ <groupId>ro.isdc.wro4j</groupId>
+ <artifactId>wro4j-maven-plugin</artifactId>
+ <version>${wroVersion}</version>
+ </dependency>
+
+ <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>${servletApiVersion}</version>
@@ -111,7 +117,7 @@
<properties>
- <wroVersion>1.5.0</wroVersion>
+ <wroVersion>1.6.2</wroVersion>
<slf4jVersion>1.7.2</slf4jVersion>
<servletApiVersion>2.5</servletApiVersion>
1
0
Jan. 19, 2013
Author: bpoussin
Date: 2013-01-19 12:25:15 +0100 (Sat, 19 Jan 2013)
New Revision: 20
Url: http://nuiton.org/projects/nuiton-js/repository/revisions/20
Log:
ajout de la lib jqgrid 4.4.1
Added:
trunk/nuiton-js-jqgrid/
trunk/nuiton-js-jqgrid/LICENSE.txt
trunk/nuiton-js-jqgrid/README.txt
trunk/nuiton-js-jqgrid/changelog.txt
trunk/nuiton-js-jqgrid/generate-i18n-group.sh
trunk/nuiton-js-jqgrid/pom.xml
trunk/nuiton-js-jqgrid/src/
trunk/nuiton-js-jqgrid/src/main/
trunk/nuiton-js-jqgrid/src/main/resources/
trunk/nuiton-js-jqgrid/src/main/resources/META-INF/
trunk/nuiton-js-jqgrid/src/main/resources/META-INF/nuiton-js/
trunk/nuiton-js-jqgrid/src/main/resources/META-INF/nuiton-js/wro-jqgrid.xml
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/css/
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/css/ellipsis-xbl.xml
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/css/ui.jqgrid.css
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ar.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-bg.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-bg1251.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-cat.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-cn.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-cs.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-da.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-de.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-dk.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-el.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-en.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-es.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-fa.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-fi.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-fr.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-gl.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-he.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-hr.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-hr1250.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-hu.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-is.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-it.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ja.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-kr.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-lt.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-mne.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-nl.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-no.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-pl.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-pt-br.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-pt.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ro.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ru.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sk.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sr-latin.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sr.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sv.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-th.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-tr.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-tw.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ua.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/jquery.jqGrid.src.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/grid.addons.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/grid.postext.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/grid.setcolumns.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/jquery.contextmenu.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/jquery.searchFilter.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/jquery.tablednd.js
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/searchFilter.css
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/ui.multiselect.css
trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/ui.multiselect.js
trunk/nuiton-js-jqgrid/src/site/
trunk/nuiton-js-jqgrid/src/site/rst/
trunk/nuiton-js-jqgrid/src/site/rst/index.rst
trunk/nuiton-js-jqgrid/src/site/site_fr.xml
Modified:
trunk/pom.xml
Added: trunk/nuiton-js-jqgrid/LICENSE.txt
===================================================================
--- trunk/nuiton-js-jqgrid/LICENSE.txt (rev 0)
+++ trunk/nuiton-js-jqgrid/LICENSE.txt 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,166 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
+
Added: trunk/nuiton-js-jqgrid/README.txt
===================================================================
--- trunk/nuiton-js-jqgrid/README.txt (rev 0)
+++ trunk/nuiton-js-jqgrid/README.txt 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1 @@
+
Added: trunk/nuiton-js-jqgrid/changelog.txt
===================================================================
--- trunk/nuiton-js-jqgrid/changelog.txt (rev 0)
+++ trunk/nuiton-js-jqgrid/changelog.txt 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,2 @@
+Please refer to the release note :
+ http://maven-site.nuiton.org/nuiton-js/changes-report.html
Added: trunk/nuiton-js-jqgrid/generate-i18n-group.sh
===================================================================
--- trunk/nuiton-js-jqgrid/generate-i18n-group.sh (rev 0)
+++ trunk/nuiton-js-jqgrid/generate-i18n-group.sh 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,10 @@
+#!/bin/sh
+#
+# Permet de genere le code XML necessaire pour la declaration des themes
+# il faut ensuite mettre ce qui est genere dans le fichier META-INF/nuiton-js/nuiton-js-jquery-ui.xml
+#
+for t in src/main/resources/nuiton-js-jqgrid/js/i18n/*; do
+ f=$(basename $t)
+ n=$(basename $t .js | sed 's/grid.locale-//g')
+ echo -e " <group name='jqgrid-$n'>\n <css>classpath:nuiton-js-jqgrid/js/i18n/$f</css>\n </group>\n"
+done
Property changes on: trunk/nuiton-js-jqgrid/generate-i18n-group.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/nuiton-js-jqgrid/pom.xml
===================================================================
--- trunk/nuiton-js-jqgrid/pom.xml (rev 0)
+++ trunk/nuiton-js-jqgrid/pom.xml 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <!-- ************************************************************* -->
+ <!-- *** POM Relationships *************************************** -->
+ <!-- ************************************************************* -->
+
+ <parent>
+ <groupId>org.nuiton.js</groupId>
+ <artifactId>nuiton-js-parent</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>nuiton-js-jqgrid</artifactId>
+ <version>4.4.1-1-SNAPSHOT</version>
+
+ <name>Nuiton JS :: jqGrid</name>
+ <description>jqGrid jar packaging</description>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.nuiton.js</groupId>
+ <artifactId>nuiton-js-jquery</artifactId>
+ <version>[1.7.2,)</version> <!-- jqgrid compatible avec jquery >= 1.8 -->
+ <scope>runtime</scope>
+ </dependency>
+
+ </dependencies>
+
+</project>
Added: trunk/nuiton-js-jqgrid/src/main/resources/META-INF/nuiton-js/wro-jqgrid.xml
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/META-INF/nuiton-js/wro-jqgrid.xml (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/META-INF/nuiton-js/wro-jqgrid.xml 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,219 @@
+<groups xmlns="http://www.isdc.ro/wro">
+
+ <import>classpath:META-INF/nuiton-js/wro-jquery.xml</import>
+
+ <group name='jqgrid'>
+ <group-ref>jquery</group-ref>
+ <group-ref>jqgrid-only</group-ref>
+ </group>
+
+ <group name='jqgrid-only'>
+ <css>classpath:nuiton-js-jqgrid/css/*.css</css>
+ <js>classpath:nuiton-js-jqgrid/js/*.js</js>
+ </group>
+
+ <!--
+ | plugin
+ +-->
+
+ <group name='jqgrid-addons'>
+ <js>classpath:nuiton-js-jqgrid/plugins/grid.addons.js</js>
+ </group>
+
+ <group name='jqgrid-postext'>
+ <js>classpath:nuiton-js-jqgrid/plugins/grid.postext.js</js>
+ </group>
+
+ <group name='jqgrid-setcolumns'>
+ <js>classpath:nuiton-js-jqgrid/plugins/grid.setcolumns.js</js>
+ </group>
+
+ <group name='jqgrid-contextmenu'>
+ <js>classpath:nuiton-js-jqgrid/plugins/jquery.contextmenu.js</js>
+ </group>
+
+ <group name='jqgrid-searchFilter'>
+ <css>classpath:nuiton-js-jqgrid/plugins/searchFilter.css</css>
+ <js>classpath:nuiton-js-jqgrid/plugins/jquery.searchFilter.js</js>
+ </group>
+
+ <group name='jqgrid-tablednd'>
+ <js>classpath:nuiton-js-jqgrid/plugins/jquery.tablednd.js</js>
+ </group>
+
+ <group name='jqgrid-multiselect'>
+ <css>classpath:nuiton-js-jqgrid/plugins/ui.multiselect.css</css>
+ <js>classpath:nuiton-js-jqgrid/plugins/ui.multiselect.js</js>
+ </group>
+
+
+ <!--
+ | le reste du fichier est genere par
+ | generate-i18n-group.sh a la racine du module
+ +-->
+
+ <group name='jqgrid-ar'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-ar.js</css>
+ </group>
+
+ <group name='jqgrid-bg'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-bg.js</css>
+ </group>
+
+ <group name='jqgrid-bg1251'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-bg1251.js</css>
+ </group>
+
+ <group name='jqgrid-cat'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-cat.js</css>
+ </group>
+
+ <group name='jqgrid-cn'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-cn.js</css>
+ </group>
+
+ <group name='jqgrid-cs'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-cs.js</css>
+ </group>
+
+ <group name='jqgrid-da'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-da.js</css>
+ </group>
+
+ <group name='jqgrid-de'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-de.js</css>
+ </group>
+
+ <group name='jqgrid-dk'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-dk.js</css>
+ </group>
+
+ <group name='jqgrid-el'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-el.js</css>
+ </group>
+
+ <group name='jqgrid-en'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-en.js</css>
+ </group>
+
+ <group name='jqgrid-es'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-es.js</css>
+ </group>
+
+ <group name='jqgrid-fa'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-fa.js</css>
+ </group>
+
+ <group name='jqgrid-fi'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-fi.js</css>
+ </group>
+
+ <group name='jqgrid-fr'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-fr.js</css>
+ </group>
+
+ <group name='jqgrid-gl'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-gl.js</css>
+ </group>
+
+ <group name='jqgrid-he'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-he.js</css>
+ </group>
+
+ <group name='jqgrid-hr'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-hr.js</css>
+ </group>
+
+ <group name='jqgrid-hr1250'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-hr1250.js</css>
+ </group>
+
+ <group name='jqgrid-hu'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-hu.js</css>
+ </group>
+
+ <group name='jqgrid-is'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-is.js</css>
+ </group>
+
+ <group name='jqgrid-it'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-it.js</css>
+ </group>
+
+ <group name='jqgrid-ja'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-ja.js</css>
+ </group>
+
+ <group name='jqgrid-kr'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-kr.js</css>
+ </group>
+
+ <group name='jqgrid-lt'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-lt.js</css>
+ </group>
+
+ <group name='jqgrid-mne'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-mne.js</css>
+ </group>
+
+ <group name='jqgrid-nl'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-nl.js</css>
+ </group>
+
+ <group name='jqgrid-no'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-no.js</css>
+ </group>
+
+ <group name='jqgrid-pl'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-pl.js</css>
+ </group>
+
+ <group name='jqgrid-pt-br'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-pt-br.js</css>
+ </group>
+
+ <group name='jqgrid-pt'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-pt.js</css>
+ </group>
+
+ <group name='jqgrid-ro'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-ro.js</css>
+ </group>
+
+ <group name='jqgrid-ru'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-ru.js</css>
+ </group>
+
+ <group name='jqgrid-sk'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-sk.js</css>
+ </group>
+
+ <group name='jqgrid-sr-latin'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-sr-latin.js</css>
+ </group>
+
+ <group name='jqgrid-sr'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-sr.js</css>
+ </group>
+
+ <group name='jqgrid-sv'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-sv.js</css>
+ </group>
+
+ <group name='jqgrid-th'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-th.js</css>
+ </group>
+
+ <group name='jqgrid-tr'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-tr.js</css>
+ </group>
+
+ <group name='jqgrid-tw'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-tw.js</css>
+ </group>
+
+ <group name='jqgrid-ua'>
+ <css>classpath:nuiton-js-jqgrid/js/i18n/grid.locale-ua.js</css>
+ </group>
+
+</groups>
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/css/ellipsis-xbl.xml
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/css/ellipsis-xbl.xml (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/css/ellipsis-xbl.xml 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<bindings
+ xmlns="http://www.mozilla.org/xbl"
+ xmlns:xbl="http://www.mozilla.org/xbl"
+ xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+ <binding id="ellipsis">
+ <content>
+ <xul:window><!-- xul:window tag required for FF2 -->
+ <xul:description crop="end" xbl:inherits="value=xbl:text"><children/></xul:description>
+ </xul:window>
+ </content>
+ </binding>
+</bindings>
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/css/ui.jqgrid.css
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/css/ui.jqgrid.css (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/css/ui.jqgrid.css 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,144 @@
+/*Grid*/
+.ui-jqgrid {position: relative;}
+.ui-jqgrid .ui-jqgrid-view {position: relative;left:0px; top: 0px; padding: .0em; font-size:11px;}
+/* caption*/
+.ui-jqgrid .ui-jqgrid-titlebar {padding: .3em .2em .2em .3em; position: relative; border-left: 0px none;border-right: 0px none; border-top: 0px none;}
+.ui-jqgrid .ui-jqgrid-title { float: left; margin: .1em 0 .2em; }
+.ui-jqgrid .ui-jqgrid-titlebar-close { position: absolute;top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height:18px;}.ui-jqgrid .ui-jqgrid-titlebar-close span { display: block; margin: 1px; }
+.ui-jqgrid .ui-jqgrid-titlebar-close:hover { padding: 0; }
+/* header*/
+.ui-jqgrid .ui-jqgrid-hdiv {position: relative; margin: 0em;padding: 0em; overflow-x: hidden; border-left: 0px none !important; border-top : 0px none !important; border-right : 0px none !important;}
+.ui-jqgrid .ui-jqgrid-hbox {float: left; padding-right: 20px;}
+.ui-jqgrid .ui-jqgrid-htable {table-layout:fixed;margin:0em;}
+.ui-jqgrid .ui-jqgrid-htable th {height:22px;padding: 0 2px 0 2px;}
+.ui-jqgrid .ui-jqgrid-htable th div {overflow: hidden; position:relative; height:17px;}
+.ui-th-column, .ui-jqgrid .ui-jqgrid-htable th.ui-th-column {overflow: hidden;white-space: nowrap;text-align:center;border-top : 0px none;border-bottom : 0px none;}
+.ui-th-ltr, .ui-jqgrid .ui-jqgrid-htable th.ui-th-ltr {border-left : 0px none;}
+.ui-th-rtl, .ui-jqgrid .ui-jqgrid-htable th.ui-th-rtl {border-right : 0px none;}
+.ui-first-th-ltr {border-right: 1px solid; }
+.ui-first-th-rtl {border-left: 1px solid; }
+.ui-jqgrid .ui-th-div-ie {white-space: nowrap; zoom :1; height:17px;}
+.ui-jqgrid .ui-jqgrid-resize {height:20px !important;position: relative; cursor :e-resize;display: inline;overflow: hidden;}
+.ui-jqgrid .ui-grid-ico-sort {overflow:hidden;position:absolute;display:inline; cursor: pointer !important;}
+.ui-jqgrid .ui-icon-asc {margin-top:-3px; height:12px;}
+.ui-jqgrid .ui-icon-desc {margin-top:3px;height:12px;}
+.ui-jqgrid .ui-i-asc {margin-top:0px;height:16px;}
+.ui-jqgrid .ui-i-desc {margin-top:0px;margin-left:13px;height:16px;}
+.ui-jqgrid .ui-jqgrid-sortable {cursor:pointer;}
+.ui-jqgrid tr.ui-search-toolbar th { border-top-width: 1px !important; border-top-color: inherit !important; border-top-style: ridge !important }
+tr.ui-search-toolbar input {margin: 1px 0px 0px 0px}
+tr.ui-search-toolbar select {margin: 1px 0px 0px 0px}
+/* body */
+.ui-jqgrid .ui-jqgrid-bdiv {position: relative; margin: 0em; padding:0; overflow: auto; text-align:left;}
+.ui-jqgrid .ui-jqgrid-btable {table-layout:fixed; margin:0em; outline-style: none; }
+.ui-jqgrid tr.jqgrow { outline-style: none; }
+.ui-jqgrid tr.jqgroup { outline-style: none; }
+.ui-jqgrid tr.jqgrow td {font-weight: normal; overflow: hidden; white-space: pre; height: 22px;padding: 0 2px 0 2px;border-bottom-width: 1px; border-bottom-color: inherit; border-bottom-style: solid;}
+.ui-jqgrid tr.jqgfirstrow td {padding: 0 2px 0 2px;border-right-width: 1px; border-right-style: solid;}
+.ui-jqgrid tr.jqgroup td {font-weight: normal; overflow: hidden; white-space: pre; height: 22px;padding: 0 2px 0 2px;border-bottom-width: 1px; border-bottom-color: inherit; border-bottom-style: solid;}
+.ui-jqgrid tr.jqfoot td {font-weight: bold; overflow: hidden; white-space: pre; height: 22px;padding: 0 2px 0 2px;border-bottom-width: 1px; border-bottom-color: inherit; border-bottom-style: solid;}
+.ui-jqgrid tr.ui-row-ltr td {text-align:left;border-right-width: 1px; border-right-color: inherit; border-right-style: solid;}
+.ui-jqgrid tr.ui-row-rtl td {text-align:right;border-left-width: 1px; border-left-color: inherit; border-left-style: solid;}
+.ui-jqgrid td.jqgrid-rownum { padding: 0 2px 0 2px; margin: 0px; border: 0px none;}
+.ui-jqgrid .ui-jqgrid-resize-mark { width:2px; left:0; background-color:#777; cursor: e-resize; cursor: col-resize; position:absolute; top:0; height:100px; overflow:hidden; display:none; border:0 none; z-index: 99999;}
+/* footer */
+.ui-jqgrid .ui-jqgrid-sdiv {position: relative; margin: 0em;padding: 0em; overflow: hidden; border-left: 0px none !important; border-top : 0px none !important; border-right : 0px none !important;}
+.ui-jqgrid .ui-jqgrid-ftable {table-layout:fixed; margin-bottom:0em;}
+.ui-jqgrid tr.footrow td {font-weight: bold; overflow: hidden; white-space:nowrap; height: 21px;padding: 0 2px 0 2px;border-top-width: 1px; border-top-color: inherit; border-top-style: solid;}
+.ui-jqgrid tr.footrow-ltr td {text-align:left;border-right-width: 1px; border-right-color: inherit; border-right-style: solid;}
+.ui-jqgrid tr.footrow-rtl td {text-align:right;border-left-width: 1px; border-left-color: inherit; border-left-style: solid;}
+/* Pager*/
+.ui-jqgrid .ui-jqgrid-pager { border-left: 0px none !important;border-right: 0px none !important; border-bottom: 0px none !important; margin: 0px !important; padding: 0px !important; position: relative; height: 25px;white-space: nowrap;overflow: hidden;font-size:11px;}
+.ui-jqgrid .ui-pager-control {position: relative;}
+.ui-jqgrid .ui-pg-table {position: relative; padding-bottom:2px; width:auto; margin: 0em;}
+.ui-jqgrid .ui-pg-table td {font-weight:normal; vertical-align:middle; padding:1px;}
+.ui-jqgrid .ui-pg-button { height:19px !important;}
+.ui-jqgrid .ui-pg-button span { display: block; margin: 1px; float:left;}
+.ui-jqgrid .ui-pg-button:hover { padding: 0px; }
+.ui-jqgrid .ui-state-disabled:hover {padding:1px;}
+.ui-jqgrid .ui-pg-input { height:13px;font-size:.8em; margin: 0em;}
+.ui-jqgrid .ui-pg-selbox {font-size:.8em; line-height:18px; display:block; height:18px; margin: 0em;}
+.ui-jqgrid .ui-separator {height: 18px; border-left: 1px solid #ccc ; border-right: 1px solid #ccc ; margin: 1px; float: right;}
+.ui-jqgrid .ui-paging-info {font-weight: normal;height:19px; margin-top:3px;margin-right:4px;}
+.ui-jqgrid .ui-jqgrid-pager .ui-pg-div {padding:1px 0;float:left;position:relative;}
+.ui-jqgrid .ui-jqgrid-pager .ui-pg-button { cursor:pointer; }
+.ui-jqgrid .ui-jqgrid-pager .ui-pg-div span.ui-icon {float:left;margin:0 2px;}
+.ui-jqgrid td input, .ui-jqgrid td select .ui-jqgrid td textarea { margin: 0em;}
+.ui-jqgrid td textarea {width:auto;height:auto;}
+.ui-jqgrid .ui-jqgrid-toppager {border-left: 0px none !important;border-right: 0px none !important; border-top: 0px none !important; margin: 0px !important; padding: 0px !important; position: relative; height: 25px !important;white-space: nowrap;overflow: hidden;}
+.ui-jqgrid .ui-jqgrid-toppager .ui-pg-div {padding:1px 0;float:left;position:relative;}
+.ui-jqgrid .ui-jqgrid-toppager .ui-pg-button { cursor:pointer; }
+.ui-jqgrid .ui-jqgrid-toppager .ui-pg-div span.ui-icon {float:left;margin:0 2px;}
+/*subgrid*/
+.ui-jqgrid .ui-jqgrid-btable .ui-sgcollapsed span {display: block;}
+.ui-jqgrid .ui-subgrid {margin:0em;padding:0em; width:100%;}
+.ui-jqgrid .ui-subgrid table {table-layout: fixed;}
+.ui-jqgrid .ui-subgrid tr.ui-subtblcell td {height:18px;border-right-width: 1px; border-right-color: inherit; border-right-style: solid;border-bottom-width: 1px; border-bottom-color: inherit; border-bottom-style: solid;}
+.ui-jqgrid .ui-subgrid td.subgrid-data {border-top: 0px none !important;}
+.ui-jqgrid .ui-subgrid td.subgrid-cell {border-width: 0px 0px 1px 0px;}
+.ui-jqgrid .ui-th-subgrid {height:20px;}
+/* loading */
+.ui-jqgrid .loading {position: absolute; top: 45%;left: 45%;width: auto;z-index:101;padding: 6px; margin: 5px;text-align: center;font-weight: bold;display: none;border-width: 2px !important; font-size:11px;}
+.ui-jqgrid .jqgrid-overlay {display:none;z-index:100;}
+* html .jqgrid-overlay {width: expression(this.parentNode.offsetWidth+'px');height: expression(this.parentNode.offsetHeight+'px');}
+* .jqgrid-overlay iframe {position:absolute;top:0;left:0;z-index:-1;width: expression(this.parentNode.offsetWidth+'px');height: expression(this.parentNode.offsetHeight+'px');}
+/* end loading div */
+/* toolbar */
+.ui-jqgrid .ui-userdata {border-left: 0px none; border-right: 0px none; height : 21px;overflow: hidden; }
+/*Modal Window */
+.ui-jqdialog { display: none; width: 300px; position: absolute; padding: .2em; font-size:11px; overflow:visible;}
+.ui-jqdialog .ui-jqdialog-titlebar { padding: .3em .2em; position: relative; }
+.ui-jqdialog .ui-jqdialog-title { margin: .1em 0 .2em; }
+.ui-jqdialog .ui-jqdialog-titlebar-close { position: absolute; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
+
+.ui-jqdialog .ui-jqdialog-titlebar-close span { display: block; margin: 1px; }
+.ui-jqdialog .ui-jqdialog-titlebar-close:hover, .ui-jqdialog .ui-jqdialog-titlebar-close:focus { padding: 0; }
+.ui-jqdialog-content, .ui-jqdialog .ui-jqdialog-content { border: 0; padding: .3em .2em; background: none; height:auto;}
+.ui-jqdialog .ui-jqconfirm {padding: .4em 1em; border-width:3px;position:absolute;bottom:10px;right:10px;overflow:visible;display:none;height:80px;width:220px;text-align:center;}
+/* end Modal window*/
+/* Form edit */
+.ui-jqdialog-content .FormGrid {margin: 0px;}
+.ui-jqdialog-content .EditTable { width: 100%; margin-bottom:0em;}
+.ui-jqdialog-content .DelTable { width: 100%; margin-bottom:0em;}
+.EditTable td input, .EditTable td select, .EditTable td textarea {margin: 0em;}
+.EditTable td textarea { width:auto; height:auto;}
+.ui-jqdialog-content td.EditButton {text-align: right;border-top: 0px none;border-left: 0px none;border-right: 0px none; padding-bottom:5px; padding-top:5px;}
+.ui-jqdialog-content td.navButton {text-align: center; border-left: 0px none;border-top: 0px none;border-right: 0px none; padding-bottom:5px; padding-top:5px;}
+.ui-jqdialog-content input.FormElement {padding:.3em}
+.ui-jqdialog-content .data-line {padding-top:.1em;border: 0px none;}
+
+.ui-jqdialog-content .CaptionTD {vertical-align: middle;border: 0px none; padding: 2px;white-space: nowrap;}
+.ui-jqdialog-content .DataTD {padding: 2px; border: 0px none; vertical-align: top;}
+.ui-jqdialog-content .form-view-data {white-space:pre}
+.fm-button { display: inline-block; margin:0 4px 0 0; padding: .4em .5em; text-decoration:none !important; cursor:pointer; position: relative; text-align: center; zoom: 1; }
+.fm-button-icon-left { padding-left: 1.9em; }
+.fm-button-icon-right { padding-right: 1.9em; }
+.fm-button-icon-left .ui-icon { right: auto; left: .2em; margin-left: 0; position: absolute; top: 50%; margin-top: -8px; }
+.fm-button-icon-right .ui-icon { left: auto; right: .2em; margin-left: 0; position: absolute; top: 50%; margin-top: -8px;}
+#nData, #pData { float: left; margin:3px;padding: 0; width: 15px; }
+/* End Eorm edit */
+/*.ui-jqgrid .edit-cell {}*/
+.ui-jqgrid .selected-row, div.ui-jqgrid .selected-row td {font-style : normal;border-left: 0px none;}
+/* inline edit actions button*/
+.ui-inline-del.ui-state-hover span, .ui-inline-edit.ui-state-hover span,
+.ui-inline-save.ui-state-hover span, .ui-inline-cancel.ui-state-hover span {
+ margin: -1px;
+}
+/* Tree Grid */
+.ui-jqgrid .tree-wrap {float: left; position: relative;height: 18px;white-space: nowrap;overflow: hidden;}
+.ui-jqgrid .tree-minus {position: absolute; height: 18px; width: 18px; overflow: hidden;}
+.ui-jqgrid .tree-plus {position: absolute; height: 18px; width: 18px; overflow: hidden;}
+.ui-jqgrid .tree-leaf {position: absolute; height: 18px; width: 18px;overflow: hidden;}
+.ui-jqgrid .treeclick {cursor: pointer;}
+/* moda dialog */
+* iframe.jqm {position:absolute;top:0;left:0;z-index:-1;width: expression(this.parentNode.offsetWidth+'px');height: expression(this.parentNode.offsetHeight+'px');}
+.ui-jqgrid-dnd tr td {border-right-width: 1px; border-right-color: inherit; border-right-style: solid; height:20px}
+/* RTL Support */
+.ui-jqgrid .ui-jqgrid-title-rtl {float:right;margin: .1em 0 .2em; }
+.ui-jqgrid .ui-jqgrid-hbox-rtl {float: right; padding-left: 20px;}
+.ui-jqgrid .ui-jqgrid-resize-ltr {float: right;margin: -2px -2px -2px 0px;}
+.ui-jqgrid .ui-jqgrid-resize-rtl {float: left;margin: -2px 0px -1px -3px;}
+.ui-jqgrid .ui-sort-rtl {left:0px;}
+.ui-jqgrid .tree-wrap-ltr {float: left;}
+.ui-jqgrid .tree-wrap-rtl {float: right;}
+.ui-jqgrid .ui-ellipsis {text-overflow:ellipsis;}
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ar.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ar.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ar.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,127 @@
+;(function($){
+/**
+ * jqGrid Arabic Translation
+ *
+ * http://trirand.com/blog/
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "تسجيل {0} - {1} على {2}",
+ emptyrecords: "لا يوجد تسجيل",
+ loadtext: "تحميل...",
+ pgtext : "صفحة {0} على {1}"
+ },
+ search : {
+ caption: "بحث...",
+ Find: "بحث",
+ Reset: "إلغاء",
+ odata : ['يساوي', 'يختلف', 'أقل', 'أقل أو يساوي','أكبر','أكبر أو يساوي', 'يبدأ بـ','لا يبدأ بـ','est dans',"n'est pas dans",'ينته بـ','لا ينته بـ','يحتوي','لا يحتوي'],
+ groupOps: [ { op: "مع", text: "الكل" }, { op: "أو", text: "لا أحد" } ],
+ matchText: " توافق",
+ rulesText: " قواعد"
+ },
+ edit : {
+ addCaption: "اضافة",
+ editCaption: "تحديث",
+ bSubmit: "تثبيث",
+ bCancel: "إلغاء",
+ bClose: "غلق",
+ saveData: "تغيرت المعطيات هل تريد التسجيل ?",
+ bYes: "نعم",
+ bNo: "لا",
+ bExit: "إلغاء",
+ msg: {
+ required: "خانة إجبارية",
+ number: "سجل رقم صحيح",
+ minValue: "يجب أن تكون القيمة أكبر أو تساوي 0",
+ maxValue: "يجب أن تكون القيمة أقل أو تساوي 0",
+ email: "بريد غير صحيح",
+ integer: "سجل عدد طبييعي صحيح",
+ url: "ليس عنوانا صحيحا. البداية الصحيحة ('http://' أو 'https://')",
+ nodefined : " ليس محدد!",
+ novalue : " قيمة الرجوع مطلوبة!",
+ customarray : "يجب على الدالة الشخصية أن تنتج جدولا",
+ customfcheck : "الدالة الشخصية مطلوبة في حالة التحقق الشخصي"
+ }
+ },
+ view : {
+ caption: "رأيت التسجيلات",
+ bClose: "غلق"
+ },
+ del : {
+ caption: "حذف",
+ msg: "حذف التسجيلات المختارة ?",
+ bSubmit: "حذف",
+ bCancel: "إلغاء"
+ },
+ nav : {
+ edittext: " ",
+ edittitle: "تغيير التسجيل المختار",
+ addtext:" ",
+ addtitle: "إضافة تسجيل",
+ deltext: " ",
+ deltitle: "حذف التسجيل المختار",
+ searchtext: " ",
+ searchtitle: "بحث عن تسجيل",
+ refreshtext: "",
+ refreshtitle: "تحديث الجدول",
+ alertcap: "تحذير",
+ alerttext: "يرجى إختيار السطر",
+ viewtext: "",
+ viewtitle: "إظهار السطر المختار"
+ },
+ col : {
+ caption: "إظهار/إخفاء الأعمدة",
+ bSubmit: "تثبيث",
+ bCancel: "إلغاء"
+ },
+ errors : {
+ errcap : "خطأ",
+ nourl : "لا يوجد عنوان محدد",
+ norecords: "لا يوجد تسجيل للمعالجة",
+ model : "عدد العناوين (colNames) <> عدد التسجيلات (colModel)!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0,00'},
+ currency : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0,00'},
+ date : {
+ dayNames: [
+ "الأحد", "الإثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت",
+ "الأحد", "الإثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"
+ ],
+ monthNames: [
+ "جانفي", "فيفري", "مارس", "أفريل", "ماي", "جوان", "جويلية", "أوت", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر",
+ "جانفي", "فيفري", "مارس", "أفريل", "ماي", "جوان", "جويلية", "أوت", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"
+ ],
+ AmPm : ["صباحا","مساءا","صباحا","مساءا"],
+ S: function (j) {return j == 1 ? 'er' : 'e';},
+ srcformat: 'Y-m-d',
+ newformat: 'd/m/Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "n/j/Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-bg.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-bg.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-bg.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,133 @@
+;(function($){
+/**
+ * jqGrid Bulgarian Translation
+ * Tony Tomov tony(a)trirand.com
+ * http://trirand.com/blog/
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "{0} - {1} от {2}",
+ emptyrecords: "Няма запис(и)",
+ loadtext: "Зареждам...",
+ pgtext : "Стр. {0} от {1}"
+ },
+ search : {
+ caption: "Търсене...",
+ Find: "Намери",
+ Reset: "Изчисти",
+ odata : ['равно', 'различно', 'по-малко', 'по-малко или=','по-голямо','по-голямо или =', 'започва с','не започва с','се намира в','не се намира в','завършва с','не завършава с','съдържа', 'не съдържа' ],
+ groupOps: [ { op: "AND", text: " И " }, { op: "OR", text: "ИЛИ" } ],
+ matchText: " включи",
+ rulesText: " клауза"
+ },
+ edit : {
+ addCaption: "Нов Запис",
+ editCaption: "Редакция Запис",
+ bSubmit: "Запиши",
+ bCancel: "Изход",
+ bClose: "Затвори",
+ saveData: "Данните са променени! Да съхраня ли промените?",
+ bYes : "Да",
+ bNo : "Не",
+ bExit : "Отказ",
+ msg: {
+ required:"Полето е задължително",
+ number:"Въведете валидно число!",
+ minValue:"стойността трябва да е по-голяма или равна от",
+ maxValue:"стойността трябва да е по-малка или равна от",
+ email: "не е валиден ел. адрес",
+ integer: "Въведете валидно цяло число",
+ date: "Въведете валидна дата",
+ url: "e невалиден URL. Изискава се префикс('http://' или 'https://')",
+ nodefined : " е недефинирана!",
+ novalue : " изисква връщане на стойност!",
+ customarray : "Потреб. Функция трябва да върне масив!",
+ customfcheck : "Потребителска функция е задължителна при този тип елемент!"
+ }
+ },
+ view : {
+ caption: "Преглед запис",
+ bClose: "Затвори"
+ },
+ del : {
+ caption: "Изтриване",
+ msg: "Да изтрия ли избраният запис?",
+ bSubmit: "Изтрий",
+ bCancel: "Отказ"
+ },
+ nav : {
+ edittext: " ",
+ edittitle: "Редакция избран запис",
+ addtext:" ",
+ addtitle: "Добавяне нов запис",
+ deltext: " ",
+ deltitle: "Изтриване избран запис",
+ searchtext: " ",
+ searchtitle: "Търсене запис(и)",
+ refreshtext: "",
+ refreshtitle: "Обнови таблица",
+ alertcap: "Предупреждение",
+ alerttext: "Моля, изберете запис",
+ viewtext: "",
+ viewtitle: "Преглед избран запис"
+ },
+ col : {
+ caption: "Избери колони",
+ bSubmit: "Ок",
+ bCancel: "Изход"
+ },
+ errors : {
+ errcap : "Грешка",
+ nourl : "Няма посочен url адрес",
+ norecords: "Няма запис за обработка",
+ model : "Модела не съответства на имената!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
+ currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:" лв.", defaultValue: '0.00'},
+ date : {
+ dayNames: [
+ "Нед", "Пон", "Вт", "Ср", "Чет", "Пет", "Съб",
+ "Неделя", "Понеделник", "Вторник", "Сряда", "Четвъртък", "Петък", "Събота"
+ ],
+ monthNames: [
+ "Яну", "Фев", "Мар", "Апр", "Май", "Юни", "Юли", "Авг", "Сеп", "Окт", "Нов", "Дек",
+ "Януари", "Февруари", "Март", "Април", "Май", "Юни", "Юли", "Август", "Септември", "Октомври", "Ноември", "Декември"
+ ],
+ AmPm : ["","","",""],
+ S: function (j) {
+ if(j==7 || j==8 || j== 27 || j== 28) {
+ return 'ми';
+ }
+ return ['ви', 'ри', 'ти'][Math.min((j - 1) % 10, 2)];
+ },
+ srcformat: 'Y-m-d',
+ newformat: 'd/m/Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "n/j/Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-bg1251.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-bg1251.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-bg1251.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,133 @@
+;(function($){
+/**
+ * jqGrid Bulgarian Translation
+ * Tony Tomov tony(a)trirand.com
+ * http://trirand.com/blog/
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "{0} - {1} �� {2}",
+ emptyrecords: "���� �����(�)",
+ loadtext: "��������...",
+ pgtext : "���. {0} �� {1}"
+ },
+ search : {
+ caption: "�������...",
+ Find: "������",
+ Reset: "�������",
+ odata : ['�����', '��������', '��-�����', '��-����� ���=','��-������','��-������ ��� =', '������� �','�� ������� �','�� ������ �','�� �� ������ �','�������� �','�� ��������� �','�������', '�� �������' ],
+ groupOps: [ { op: "AND", text: " � " }, { op: "OR", text: "���" } ],
+ matchText: " ������",
+ rulesText: " ������"
+ },
+ edit : {
+ addCaption: "��� �����",
+ editCaption: "�������� �����",
+ bSubmit: "������",
+ bCancel: "�����",
+ bClose: "�������",
+ saveData: "������� �� ���������! �� ������� �� ���������?",
+ bYes : "��",
+ bNo : "��",
+ bExit : "�����",
+ msg: {
+ required:"������ � ������������",
+ number:"�������� ������� �����!",
+ minValue:"���������� ������ �� � ��-������ ��� ����� ��",
+ maxValue:"���������� ������ �� � ��-����� ��� ����� ��",
+ email: "�� � ������� ��. �����",
+ integer: "�������� ������� ���� �����",
+ date: "�������� ������� ����",
+ url: "e ��������� URL. �������� �� �������('http://' ��� 'https://')",
+ nodefined : " � ������������!",
+ novalue : " ������� ������� �� ��������!",
+ customarray : "������. ������� ������ �� ����� �����!",
+ customfcheck : "������������� ������� � ������������ ��� ���� ��� �������!"
+ }
+ },
+ view : {
+ caption: "������� �����",
+ bClose: "�������"
+ },
+ del : {
+ caption: "���������",
+ msg: "�� ������ �� ��������� �����?",
+ bSubmit: "������",
+ bCancel: "�����"
+ },
+ nav : {
+ edittext: " ",
+ edittitle: "�������� ������ �����",
+ addtext:" ",
+ addtitle: "�������� ��� �����",
+ deltext: " ",
+ deltitle: "��������� ������ �����",
+ searchtext: " ",
+ searchtitle: "������� �����(�)",
+ refreshtext: "",
+ refreshtitle: "������ �������",
+ alertcap: "��������������",
+ alerttext: "����, �������� �����",
+ viewtext: "",
+ viewtitle: "������� ������ �����"
+ },
+ col : {
+ caption: "����� ������",
+ bSubmit: "��",
+ bCancel: "�����"
+ },
+ errors : {
+ errcap : "������",
+ nourl : "���� ������� url �����",
+ norecords: "���� ����� �� ���������",
+ model : "������ �� ����������� �� �������!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
+ currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:" ��.", defaultValue: '0.00'},
+ date : {
+ dayNames: [
+ "���", "���", "��", "��", "���", "���", "���",
+ "������", "����������", "�������", "�����", "���������", "�����", "������"
+ ],
+ monthNames: [
+ "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���", "���",
+ "������", "��������", "����", "�����", "���", "���", "���", "������", "���������", "��������", "�������", "��������"
+ ],
+ AmPm : ["","","",""],
+ S: function (j) {
+ if(j==7 || j==8 || j== 27 || j== 28) {
+ return '��';
+ }
+ return ['��', '��', '��'][Math.min((j - 1) % 10, 2)];
+ },
+ srcformat: 'Y-m-d',
+ newformat: 'd/m/Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "n/j/Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-cat.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-cat.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-cat.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,129 @@
+;(function($){
+/**
+ * jqGrid Catalan Translation
+ * Traducció jqGrid en Catatà per Faserline, S.L.
+ * http://www.faserline.com
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "Mostrant {0} - {1} de {2}",
+ emptyrecords: "Sense registres que mostrar",
+ loadtext: "Carregant...",
+ pgtext : "Pàgina {0} de {1}"
+ },
+ search : {
+ caption: "Cerca...",
+ Find: "Cercar",
+ Reset: "Buidar",
+ odata : ['equal', 'not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain'],
+ groupOps: [ { op: "AND", text: "tot" }, { op: "OR", text: "qualsevol" } ],
+ matchText: " match",
+ rulesText: " rules"
+ },
+ edit : {
+ addCaption: "Afegir registre",
+ editCaption: "Modificar registre",
+ bSubmit: "Guardar",
+ bCancel: "Cancelar",
+ bClose: "Tancar",
+ saveData: "Les dades han canviat. Guardar canvis?",
+ bYes : "Yes",
+ bNo : "No",
+ bExit : "Cancel",
+ msg: {
+ required:"Camp obligatori",
+ number:"Introdueixi un nombre",
+ minValue:"El valor ha de ser major o igual que ",
+ maxValue:"El valor ha de ser menor o igual a ",
+ email: "no és una direcció de correu vàlida",
+ integer: "Introdueixi un valor enter",
+ date: "Introdueixi una data correcta ",
+ url: "no és una URL vàlida. Prefix requerit ('http://' or 'https://')",
+ nodefined : " is not defined!",
+ novalue : " return value is required!",
+ customarray : "Custom function should return array!",
+ customfcheck : "Custom function should be present in case of custom checking!"
+ }
+ },
+ view : {
+ caption: "Veure registre",
+ bClose: "Tancar"
+ },
+ del : {
+ caption: "Eliminar",
+ msg: "¿Desitja eliminar els registres seleccionats?",
+ bSubmit: "Eliminar",
+ bCancel: "Cancelar"
+ },
+ nav : {
+ edittext: " ",
+ edittitle: "Modificar fila seleccionada",
+ addtext:" ",
+ addtitle: "Agregar nova fila",
+ deltext: " ",
+ deltitle: "Eliminar fila seleccionada",
+ searchtext: " ",
+ searchtitle: "Cercar informació",
+ refreshtext: "",
+ refreshtitle: "Refrescar taula",
+ alertcap: "Avís",
+ alerttext: "Seleccioni una fila",
+ viewtext: " ",
+ viewtitle: "Veure fila seleccionada"
+ },
+// setcolumns module
+ col : {
+ caption: "Mostrar/ocultar columnes",
+ bSubmit: "Enviar",
+ bCancel: "Cancelar"
+ },
+ errors : {
+ errcap : "Error",
+ nourl : "No s'ha especificat una URL",
+ norecords: "No hi ha dades per processar",
+ model : "Les columnes de noms són diferents de les columnes del model"
+ },
+ formatter : {
+ integer : {thousandsSeparator: ".", defaultValue: '0'},
+ number : {decimalSeparator:",", thousandsSeparator: ".", decimalPlaces: 2, defaultValue: '0,00'},
+ currency : {decimalSeparator:",", thousandsSeparator: ".", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0,00'},
+ date : {
+ dayNames: [
+ "Dg", "Dl", "Dt", "Dc", "Dj", "Dv", "Ds",
+ "Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"
+ ],
+ monthNames: [
+ "Gen", "Febr", "Març", "Abr", "Maig", "Juny", "Jul", "Ag", "Set", "Oct", "Nov", "Des",
+ "Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"
+ ],
+ AmPm : ["am","pm","AM","PM"],
+ S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
+ srcformat: 'Y-m-d',
+ newformat: 'd-m-Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "n/j/Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: 'show',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-cn.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-cn.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-cn.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,133 @@
+;(function($){
+/**
+ * jqGrid Chinese Translation for v4.2
+ * henryyan 2011.11.30
+ * http://www.wsria.com
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * update 2011.11.30
+ * add double u3000 SPACE for search:odata to fix SEARCH box display err when narrow width from only use of eq/ne/cn/in/lt/gt operator under IE6/7
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "{0} - {1}\u3000共 {2} 条", // 共字前是全角空格
+ emptyrecords: "无数据显示",
+ loadtext: "读取中...",
+ pgtext : " {0} 共 {1} 页"
+ },
+ search : {
+ caption: "搜索...",
+ Find: "查找",
+ Reset: "重置",
+ odata : ['等于\u3000\u3000', '不等\u3000\u3000', '小于\u3000\u3000', '小于等于','大于\u3000\u3000','大于等于',
+ '开始于','不开始于','属于\u3000\u3000','不属于','结束于','不结束于','包含\u3000\u3000','不包含','空值于\u3000\u3000','非空值'],
+ groupOps: [ { op: "AND", text: "所有" }, { op: "OR", text: "任一" } ],
+ matchText: " 匹配",
+ rulesText: " 规则"
+ },
+ edit : {
+ addCaption: "添加记录",
+ editCaption: "编辑记录",
+ bSubmit: "提交",
+ bCancel: "取消",
+ bClose: "关闭",
+ saveData: "数据已改变,是否保存?",
+ bYes : "是",
+ bNo : "否",
+ bExit : "取消",
+ msg: {
+ required:"此字段必需",
+ number:"请输入有效数字",
+ minValue:"输值必须大于等于 ",
+ maxValue:"输值必须小于等于 ",
+ email: "这不是有效的e-mail地址",
+ integer: "请输入有效整数",
+ date: "请输入有效时间",
+ url: "无效网址。前缀必须为 ('http://' 或 'https://')",
+ nodefined : " 未定义!",
+ novalue : " 需要返回值!",
+ customarray : "自定义函数需要返回数组!",
+ customfcheck : "Custom function should be present in case of custom checking!"
+
+ }
+ },
+ view : {
+ caption: "查看记录",
+ bClose: "关闭"
+ },
+ del : {
+ caption: "删除",
+ msg: "删除所选记录?",
+ bSubmit: "删除",
+ bCancel: "取消"
+ },
+ nav : {
+ edittext: "",
+ edittitle: "编辑所选记录",
+ addtext:"",
+ addtitle: "添加新记录",
+ deltext: "",
+ deltitle: "删除所选记录",
+ searchtext: "",
+ searchtitle: "查找",
+ refreshtext: "",
+ refreshtitle: "刷新表格",
+ alertcap: "注意",
+ alerttext: "请选择记录",
+ viewtext: "",
+ viewtitle: "查看所选记录"
+ },
+ col : {
+ caption: "选择列",
+ bSubmit: "确定",
+ bCancel: "取消"
+ },
+ errors : {
+ errcap : "错误",
+ nourl : "没有设置url",
+ norecords: "没有要处理的记录",
+ model : "colNames 和 colModel 长度不等!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
+ currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
+ date : {
+ dayNames: [
+ "Sun", "Mon", "Tue", "Wed", "Thr", "Fri", "Sat",
+ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
+ ],
+ monthNames: [
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
+ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
+ ],
+ AmPm : ["am","pm","AM","PM"],
+ S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
+ srcformat: 'Y-m-d',
+ newformat: 'm-d-Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "Y/j/n",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-cs.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-cs.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-cs.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,129 @@
+;(function($){
+/**
+ * jqGrid Czech Translation
+ * Pavel Jirak pavel.jirak(a)jipas.cz
+ * doplnil Thomas Wagner xwagne01(a)stud.fit.vutbr.cz
+ * http://trirand.com/blog/
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "Zobrazeno {0} - {1} z {2} záznamů",
+ emptyrecords: "Nenalezeny žádné záznamy",
+ loadtext: "Načítám...",
+ pgtext : "Strana {0} z {1}"
+ },
+ search : {
+ caption: "Vyhledávám...",
+ Find: "Hledat",
+ Reset: "Reset",
+ odata : ['rovno', 'nerovono', 'menší', 'menší nebo rovno','větší', 'větší nebo rovno', 'začíná s', 'nezačíná s', 'je v', 'není v', 'končí s', 'nekončí s', 'obahuje', 'neobsahuje'],
+ groupOps: [ { op: "AND", text: "všech" }, { op: "OR", text: "některého z" } ],
+ matchText: " hledat podle",
+ rulesText: " pravidel"
+ },
+ edit : {
+ addCaption: "Přidat záznam",
+ editCaption: "Editace záznamu",
+ bSubmit: "Uložit",
+ bCancel: "Storno",
+ bClose: "Zavřít",
+ saveData: "Data byla změněna! Uložit změny?",
+ bYes : "Ano",
+ bNo : "Ne",
+ bExit : "Zrušit",
+ msg: {
+ required:"Pole je vyžadováno",
+ number:"Prosím, vložte validní číslo",
+ minValue:"hodnota musí být větší než nebo rovná ",
+ maxValue:"hodnota musí být menší než nebo rovná ",
+ email: "není validní e-mail",
+ integer: "Prosím, vložte celé číslo",
+ date: "Prosím, vložte validní datum",
+ url: "není platnou URL. Vyžadován prefix ('http://' or 'https://')",
+ nodefined : " není definován!",
+ novalue : " je vyžadována návratová hodnota!",
+ customarray : "Custom function mělá vrátit pole!",
+ customfcheck : "Custom function by měla být přítomna v případě custom checking!"
+ }
+ },
+ view : {
+ caption: "Zobrazit záznam",
+ bClose: "Zavřít"
+ },
+ del : {
+ caption: "Smazat",
+ msg: "Smazat vybraný(é) záznam(y)?",
+ bSubmit: "Smazat",
+ bCancel: "Storno"
+ },
+ nav : {
+ edittext: " ",
+ edittitle: "Editovat vybraný řádek",
+ addtext:" ",
+ addtitle: "Přidat nový řádek",
+ deltext: " ",
+ deltitle: "Smazat vybraný záznam ",
+ searchtext: " ",
+ searchtitle: "Najít záznamy",
+ refreshtext: "",
+ refreshtitle: "Obnovit tabulku",
+ alertcap: "Varování",
+ alerttext: "Prosím, vyberte řádek",
+ viewtext: "",
+ viewtitle: "Zobrazit vybraný řádek"
+ },
+ col : {
+ caption: "Zobrazit/Skrýt sloupce",
+ bSubmit: "Uložit",
+ bCancel: "Storno"
+ },
+ errors : {
+ errcap : "Chyba",
+ nourl : "Není nastavena url",
+ norecords: "Žádné záznamy ke zpracování",
+ model : "Délka colNames <> colModel!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
+ currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
+ date : {
+ dayNames: [
+ "Ne", "Po", "Út", "St", "Čt", "Pá", "So",
+ "Neděle", "Pondělí", "Úterý", "Středa", "Čtvrtek", "Pátek", "Sobota"
+ ],
+ monthNames: [
+ "Led", "Úno", "Bře", "Dub", "Kvě", "Čer", "Čvc", "Srp", "Zář", "Říj", "Lis", "Pro",
+ "Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"
+ ],
+ AmPm : ["do","od","DO","OD"],
+ S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
+ srcformat: 'Y-m-d',
+ newformat: 'd/m/Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "n/j/Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-da.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-da.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-da.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,129 @@
+;(function($){
+/**
+ * jqGrid Danish Translation
+ * Aesiras A/S
+ * http://www.aesiras.dk
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "Vis {0} - {1} of {2}",
+ emptyrecords: "Ingen linjer fundet",
+ loadtext: "Henter...",
+ pgtext : "Side {0} af {1}"
+ },
+ search : {
+ caption: "Søg...",
+ Find: "Find",
+ Reset: "Nulstil",
+ odata : ['lig', 'forskellige fra', 'mindre', 'mindre eller lig','større','større eller lig', 'begynder med','begynder ikke med','findes i','findes ikke i','ender med','ender ikke med','indeholder','indeholder ikke'],
+ groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" } ],
+ matchText: " lig",
+ rulesText: " regler"
+ },
+ edit : {
+ addCaption: "Tilføj",
+ editCaption: "Ret",
+ bSubmit: "Send",
+ bCancel: "Annuller",
+ bClose: "Luk",
+ saveData: "Data er ændret. Gem data?",
+ bYes : "Ja",
+ bNo : "Nej",
+ bExit : "Fortryd",
+ msg: {
+ required:"Felt er nødvendigt",
+ number:"Indtast venligst et validt tal",
+ minValue:"værdi skal være større end eller lig med",
+ maxValue:"værdi skal være mindre end eller lig med",
+ email: "er ikke en gyldig email",
+ integer: "Indtast venligst et gyldigt heltal",
+ date: "Indtast venligst en gyldig datoværdi",
+ url: "er ugyldig URL. Prefix mangler ('http://' or 'https://')",
+ nodefined : " er ikke defineret!",
+ novalue : " returværdi kræves!",
+ customarray : "Custom function should return array!",
+ customfcheck : "Custom function should be present in case of custom checking!"
+ }
+ },
+ view : {
+ caption: "Vis linje",
+ bClose: "Luk"
+ },
+ del : {
+ caption: "Slet",
+ msg: "Slet valgte linje(r)?",
+ bSubmit: "Slet",
+ bCancel: "Fortryd"
+ },
+ nav : {
+ edittext: " ",
+ edittitle: "Rediger valgte linje",
+ addtext:" ",
+ addtitle: "Tilføj ny linje",
+ deltext: " ",
+ deltitle: "Slet valgte linje",
+ searchtext: " ",
+ searchtitle: "Find linjer",
+ refreshtext: "",
+ refreshtitle: "Indlæs igen",
+ alertcap: "Advarsel",
+ alerttext: "Vælg venligst linje",
+ viewtext: "",
+ viewtitle: "Vis valgte linje"
+ },
+ col : {
+ caption: "Vis/skjul kolonner",
+ bSubmit: "Opdatere",
+ bCancel: "Fortryd"
+ },
+ errors : {
+ errcap : "Fejl",
+ nourl : "Ingen url valgt",
+ norecords: "Ingen linjer at behandle",
+ model : "colNames og colModel har ikke samme længde!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0,00'},
+ currency : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0,00'},
+ date : {
+ dayNames: [
+ "Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør",
+ "Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"
+ ],
+ monthNames: [
+ "Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec",
+ "Januar", "Februar", "Marts", "April", "Maj", "Juni", "Juli", "August", "September", "Oktober", "November", "December"
+ ],
+ AmPm : ["","","",""],
+ S: function (j) {return '.'},
+ srcformat: 'Y-m-d',
+ newformat: 'd/m/Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "j/n/Y",
+ LongDate: "l d. F Y",
+ FullDateTime: "l d F Y G:i:s",
+ MonthDay: "d. F",
+ ShortTime: "G:i",
+ LongTime: "G:i:s",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+// DA
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-de.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-de.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-de.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,172 @@
+;(function($){
+/**
+ * jqGrid German Translation
+ * Version 1.0.0 (developed for jQuery Grid 3.3.1)
+ * Olaf Klöppel opensource(a)blue-hit.de
+ * http://blue-hit.de/
+ *
+ * Updated for jqGrid 3.8
+ * Andreas Flack
+ * http://www.contentcontrol-berlin.de
+ *
+ * Updated for jQuery 4.4
+ * Oleg Kiriljuk oleg.kiriljuk(a)ok-soft-gmbh.com
+ * the format corresponds now the format from
+ * https://github.com/jquery/globalize/blob/master/lib/cultures/globalize.cult…
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "Zeige {0} - {1} von {2}",
+ emptyrecords: "Keine Datensätze vorhanden",
+ loadtext: "Lädt...",
+ pgtext : "Seite {0} von {1}"
+ },
+ search : {
+ caption: "Suche...",
+ Find: "Suchen",
+ Reset: "Zurücksetzen",
+ odata : ['gleich', 'ungleich', 'kleiner', 'kleiner gleich','größer','größer gleich', 'beginnt mit','beginnt nicht mit','ist in','ist nicht in','endet mit','endet nicht mit','enthält','enthält nicht'],
+ groupOps: [ { op: "AND", text: "alle" }, { op: "OR", text: "mindestens eine" } ],
+ matchText: " erfülle",
+ rulesText: " Bedingung(en)"
+ },
+ edit : {
+ addCaption: "Datensatz hinzufügen",
+ editCaption: "Datensatz bearbeiten",
+ bSubmit: "Speichern",
+ bCancel: "Abbrechen",
+ bClose: "Schließen",
+ saveData: "Daten wurden geändert! Änderungen speichern?",
+ bYes : "ja",
+ bNo : "nein",
+ bExit : "abbrechen",
+ msg: {
+ required:"Feld ist erforderlich",
+ number: "Bitte geben Sie eine Zahl ein",
+ minValue:"Wert muss größer oder gleich sein, als ",
+ maxValue:"Wert muss kleiner oder gleich sein, als ",
+ email: "ist keine gültige E-Mail-Adresse",
+ integer: "Bitte geben Sie eine Ganzzahl ein",
+ date: "Bitte geben Sie ein gültiges Datum ein",
+ url: "ist keine gültige URL. Präfix muss eingegeben werden ('http://' oder 'https://')",
+ nodefined : " ist nicht definiert!",
+ novalue : " Rückgabewert ist erforderlich!",
+ customarray : "Benutzerdefinierte Funktion sollte ein Array zurückgeben!",
+ customfcheck : "Benutzerdefinierte Funktion sollte im Falle der benutzerdefinierten Überprüfung vorhanden sein!"
+ }
+ },
+ view : {
+ caption: "Datensatz anzeigen",
+ bClose: "Schließen"
+ },
+ del : {
+ caption: "Löschen",
+ msg: "Ausgewählte Datensätze löschen?",
+ bSubmit: "Löschen",
+ bCancel: "Abbrechen"
+ },
+ nav : {
+ edittext: " ",
+ edittitle: "Ausgewählte Zeile editieren",
+ addtext:" ",
+ addtitle: "Neue Zeile einfügen",
+ deltext: " ",
+ deltitle: "Ausgewählte Zeile löschen",
+ searchtext: " ",
+ searchtitle: "Datensatz suchen",
+ refreshtext: "",
+ refreshtitle: "Tabelle neu laden",
+ alertcap: "Warnung",
+ alerttext: "Bitte Zeile auswählen",
+ viewtext: "",
+ viewtitle: "Ausgewählte Zeile anzeigen"
+ },
+ col : {
+ caption: "Spalten auswählen",
+ bSubmit: "Speichern",
+ bCancel: "Abbrechen"
+ },
+ errors : {
+ errcap : "Fehler",
+ nourl : "Keine URL angegeben",
+ norecords: "Keine Datensätze zu bearbeiten",
+ model : "colNames und colModel sind unterschiedlich lang!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: ".", defaultValue: '0'},
+ number : {decimalSeparator:",", thousandsSeparator: ".", decimalPlaces: 2, defaultValue: '0,00'},
+ currency : {decimalSeparator:",", thousandsSeparator: ".", decimalPlaces: 2, prefix: "", suffix:" €", defaultValue: '0,00'},
+ date : {
+ dayNames: [
+ "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa",
+ "Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"
+ ],
+ monthNames: [
+ "Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez",
+ "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"
+ ],
+ AmPm : ["","","",""],
+ S: function (j) {return '.';}, // one can also use 'er' instead of '.' but one have to use additional word like 'der' or 'den' before
+ srcformat: 'Y-m-d',
+ newformat: 'd.m.Y',
+ masks : {
+ // see http://php.net/manual/en/function.date.php for PHP format used in jqGrid
+ // and see http://docs.jquery.com/UI/Datepicker/formatDate
+ // and https://github.com/jquery/globalize#dates for alternative formats used frequently
+ ISO8601Long: "Y-m-d H:i:s",
+ ISO8601Short: "Y-m-d",
+ // short date:
+ // d - Day of the month, 2 digits with leading zeros
+ // m - Numeric representation of a month, with leading zeros
+ // Y - A full numeric representation of a year, 4 digits
+ ShortDate: "d.m.Y", // in jQuery UI Datepicker: "dd.MM.yyyy"
+ // long date:
+ // l - A full textual representation of the day of the week
+ // j - Day of the month without leading zeros
+ // F - A full textual representation of a month
+ // Y - A full numeric representation of a year, 4 digits
+ LongDate: "l, j. F Y", // in jQuery UI Datepicker: "dddd, d. MMMM yyyy"
+ // long date with long time:
+ // l - A full textual representation of the day of the week
+ // j - Day of the month without leading zeros
+ // F - A full textual representation of a month
+ // Y - A full numeric representation of a year, 4 digits
+ // H - 24-hour format of an hour with leading zeros
+ // i - Minutes with leading zeros
+ // s - Seconds, with leading zeros
+ FullDateTime: "l, j. F Y H:i:s", // in jQuery UI Datepicker: "dddd, d. MMMM yyyy HH:mm:ss"
+ // month day:
+ // d - Day of the month, 2 digits with leading zeros
+ // F - A full textual representation of a month
+ MonthDay: "d F", // in jQuery UI Datepicker: "dd MMMM"
+ // short time (without seconds)
+ // H - 24-hour format of an hour with leading zeros
+ // i - Minutes with leading zeros
+ ShortTime: "H:i", // in jQuery UI Datepicker: "HH:mm"
+ // long time (with seconds)
+ // H - 24-hour format of an hour with leading zeros
+ // i - Minutes with leading zeros
+ // s - Seconds, with leading zeros
+ LongTime: "H:i:s", // in jQuery UI Datepicker: "HH:mm:ss"
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ // month with year
+ // F - A full textual representation of a month
+ // Y - A full numeric representation of a year, 4 digits
+ YearMonth: "F Y" // in jQuery UI Datepicker: "MMMM yyyy"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
\ No newline at end of file
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-dk.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-dk.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-dk.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,128 @@
+;(function($){
+/**
+ * jqGrid Danish Translation
+ * Kaare Rasmussen kjs(a)jasonic.dk
+ * http://jasonic.dk/blog
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = {
+ defaults : {
+ recordtext: "View {0} - {1} of {2}",
+ emptyrecords: "No records to view",
+ loadtext: "Loading...",
+ pgtext : "Page {0} of {1}"
+ },
+ search : {
+ caption: "Søg...",
+ Find: "Find",
+ Reset: "Nulstil",
+ odata : ['equal', 'not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain'],
+ groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" } ],
+ matchText: " match",
+ rulesText: " rules"
+ },
+ edit : {
+ addCaption: "Tilføj",
+ editCaption: "Ret",
+ bSubmit: "Send",
+ bCancel: "Annuller",
+ bClose: "Luk",
+ saveData: "Data has been changed! Save changes?",
+ bYes : "Yes",
+ bNo : "No",
+ bExit : "Cancel",
+ msg: {
+ required:"Felt er nødvendigt",
+ number:"Indtast venligst et validt tal",
+ minValue:"værdi skal være større end eller lig med",
+ maxValue:"værdi skal være mindre end eller lig med",
+ email: "er ikke en valid email",
+ integer: "Indtast venligst et validt heltalt",
+ date: "Indtast venligst en valid datoværdi",
+ url: "is not a valid URL. Prefix required ('http://' or 'https://')",
+ nodefined : " is not defined!",
+ novalue : " return value is required!",
+ customarray : "Custom function should return array!",
+ customfcheck : "Custom function should be present in case of custom checking!"
+ }
+ },
+ view : {
+ caption: "View Record",
+ bClose: "Close"
+ },
+ del : {
+ caption: "Slet",
+ msg: "Slet valgte række(r)?",
+ bSubmit: "Slet",
+ bCancel: "Annuller"
+ },
+ nav : {
+ edittext: " ",
+ edittitle: "Rediger valgte række",
+ addtext:" ",
+ addtitle: "Tilføj ny række",
+ deltext: " ",
+ deltitle: "Slet valgte række",
+ searchtext: " ",
+ searchtitle: "Find poster",
+ refreshtext: "",
+ refreshtitle: "Indlæs igen",
+ alertcap: "Advarsel",
+ alerttext: "Vælg venligst række",
+ viewtext: "",
+ viewtitle: "View selected row"
+ },
+ col : {
+ caption: "Vis/skjul kolonner",
+ bSubmit: "Send",
+ bCancel: "Annuller"
+ },
+ errors : {
+ errcap : "Fejl",
+ nourl : "Ingel url valgt",
+ norecords: "Ingen poster at behandle",
+ model : "colNames og colModel har ikke samme længde!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0,00'},
+ currency : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0,00'},
+ date : {
+ dayNames: [
+ "Søn", "Man", "Tirs", "Ons", "Tors", "Fre", "Lør",
+ "Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"
+ ],
+ monthNames: [
+ "Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec",
+ "Januar", "Februar", "Marts", "April", "Maj", "Juni", "Juli", "August", "September", "Oktober", "November", "December"
+ ],
+ AmPm : ["","","",""],
+ S: function (j) {return '.'},
+ srcformat: 'Y-m-d',
+ newformat: 'd/m/Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "j/n/Y",
+ LongDate: "l d. F Y",
+ FullDateTime: "l d F Y G:i:s",
+ MonthDay: "d. F",
+ ShortTime: "G:i",
+ LongTime: "G:i:s",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+};
+// DK
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-el.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-el.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-el.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,127 @@
+;(function($){
+/**
+ * jqGrid Greek (el) Translation
+ * Alex Cicovic
+ * http://www.alexcicovic.com
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "View {0} - {1} of {2}",
+ emptyrecords: "No records to view",
+ loadtext: "Φόρτωση...",
+ pgtext : "Page {0} of {1}"
+ },
+ search : {
+ caption: "Αναζήτηση...",
+ Find: "Εύρεση",
+ Reset: "Επαναφορά",
+ odata : ['equal', 'not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain'],
+ groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" } ],
+ matchText: " match",
+ rulesText: " rules"
+ },
+ edit : {
+ addCaption: "Εισαγωγή Εγγραφής",
+ editCaption: "Επεξεργασία Εγγραφής",
+ bSubmit: "Καταχώρηση",
+ bCancel: "Άκυρο",
+ bClose: "Κλείσιμο",
+ saveData: "Data has been changed! Save changes?",
+ bYes : "Yes",
+ bNo : "No",
+ bExit : "Cancel",
+ msg: {
+ required:"Το πεδίο είναι απαραίτητο",
+ number:"Το πεδίο δέχεται μόνο αριθμούς",
+ minValue:"Η τιμή πρέπει να είναι μεγαλύτερη ή ίση του ",
+ maxValue:"Η τιμή πρέπει να είναι μικρότερη ή ίση του ",
+ email: "Η διεύθυνση e-mail δεν είναι έγκυρη",
+ integer: "Το πεδίο δέχεται μόνο ακέραιους αριθμούς",
+ url: "is not a valid URL. Prefix required ('http://' or 'https://')",
+ nodefined : " is not defined!",
+ novalue : " return value is required!",
+ customarray : "Custom function should return array!",
+ customfcheck : "Custom function should be present in case of custom checking!"
+ }
+ },
+ view : {
+ caption: "View Record",
+ bClose: "Close"
+ },
+ del : {
+ caption: "Διαγραφή",
+ msg: "Διαγραφή των επιλεγμένων εγγραφών;",
+ bSubmit: "Ναι",
+ bCancel: "Άκυρο"
+ },
+ nav : {
+ edittext: " ",
+ edittitle: "Επεξεργασία επιλεγμένης εγγραφής",
+ addtext:" ",
+ addtitle: "Εισαγωγή νέας εγγραφής",
+ deltext: " ",
+ deltitle: "Διαγραφή επιλεγμένης εγγραφής",
+ searchtext: " ",
+ searchtitle: "Εύρεση Εγγραφών",
+ refreshtext: "",
+ refreshtitle: "Ανανέωση Πίνακα",
+ alertcap: "Προσοχή",
+ alerttext: "Δεν έχετε επιλέξει εγγραφή",
+ viewtext: "",
+ viewtitle: "View selected row"
+ },
+ col : {
+ caption: "Εμφάνιση / Απόκρυψη Στηλών",
+ bSubmit: "ΟΚ",
+ bCancel: "Άκυρο"
+ },
+ errors : {
+ errcap : "Σφάλμα",
+ nourl : "Δεν έχει δοθεί διεύθυνση χειρισμού για τη συγκεκριμένη ενέργεια",
+ norecords: "Δεν υπάρχουν εγγραφές προς επεξεργασία",
+ model : "Άνισος αριθμός πεδίων colNames/colModel!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
+ currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
+ date : {
+ dayNames: [
+ "Κυρ", "Δευ", "Τρι", "Τετ", "Πεμ", "Παρ", "Σαβ",
+ "Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο"
+ ],
+ monthNames: [
+ "Ιαν", "Φεβ", "Μαρ", "Απρ", "Μαι", "Ιουν", "Ιουλ", "Αυγ", "Σεπ", "Οκτ", "Νοε", "Δεκ",
+ "Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάιος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"
+ ],
+ AmPm : ["πμ","μμ","ΠΜ","ΜΜ"],
+ S: function (j) {return j == 1 || j > 1 ? ['η'][Math.min((j - 1) % 10, 3)] : ''},
+ srcformat: 'Y-m-d',
+ newformat: 'd/m/Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "n/j/Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-en.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-en.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-en.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,169 @@
+;(function($){
+/**
+ * jqGrid English Translation
+ * Tony Tomov tony(a)trirand.com
+ * http://trirand.com/blog/
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "View {0} - {1} of {2}",
+ emptyrecords: "No records to view",
+ loadtext: "Loading...",
+ pgtext : "Page {0} of {1}"
+ },
+ search : {
+ caption: "Search...",
+ Find: "Find",
+ Reset: "Reset",
+ odata : ['equal', 'not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain'],
+ groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" } ],
+ matchText: " match",
+ rulesText: " rules"
+ },
+ edit : {
+ addCaption: "Add Record",
+ editCaption: "Edit Record",
+ bSubmit: "Submit",
+ bCancel: "Cancel",
+ bClose: "Close",
+ saveData: "Data has been changed! Save changes?",
+ bYes : "Yes",
+ bNo : "No",
+ bExit : "Cancel",
+ msg: {
+ required:"Field is required",
+ number:"Please, enter valid number",
+ minValue:"value must be greater than or equal to ",
+ maxValue:"value must be less than or equal to",
+ email: "is not a valid e-mail",
+ integer: "Please, enter valid integer value",
+ date: "Please, enter valid date value",
+ url: "is not a valid URL. Prefix required ('http://' or 'https://')",
+ nodefined : " is not defined!",
+ novalue : " return value is required!",
+ customarray : "Custom function should return array!",
+ customfcheck : "Custom function should be present in case of custom checking!"
+
+ }
+ },
+ view : {
+ caption: "View Record",
+ bClose: "Close"
+ },
+ del : {
+ caption: "Delete",
+ msg: "Delete selected record(s)?",
+ bSubmit: "Delete",
+ bCancel: "Cancel"
+ },
+ nav : {
+ edittext: "",
+ edittitle: "Edit selected row",
+ addtext:"",
+ addtitle: "Add new row",
+ deltext: "",
+ deltitle: "Delete selected row",
+ searchtext: "",
+ searchtitle: "Find records",
+ refreshtext: "",
+ refreshtitle: "Reload Grid",
+ alertcap: "Warning",
+ alerttext: "Please, select row",
+ viewtext: "",
+ viewtitle: "View selected row"
+ },
+ col : {
+ caption: "Select columns",
+ bSubmit: "Ok",
+ bCancel: "Cancel"
+ },
+ errors : {
+ errcap : "Error",
+ nourl : "No url is set",
+ norecords: "No records to process",
+ model : "Length of colNames <> colModel!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: ",", defaultValue: '0'},
+ number : {decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 2, defaultValue: '0.00'},
+ currency : {decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
+ date : {
+ dayNames: [
+ "Sun", "Mon", "Tue", "Wed", "Thr", "Fri", "Sat",
+ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
+ ],
+ monthNames: [
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
+ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
+ ],
+ AmPm : ["am","pm","AM","PM"],
+ S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th';},
+ srcformat: 'Y-m-d',
+ newformat: 'n/j/Y',
+ masks : {
+ // see http://php.net/manual/en/function.date.php for PHP format used in jqGrid
+ // and see http://docs.jquery.com/UI/Datepicker/formatDate
+ // and https://github.com/jquery/globalize#dates for alternative formats used frequently
+ // one can find on https://github.com/jquery/globalize/tree/master/lib/cultures many
+ // information about date, time, numbers and currency formats used in different countries
+ // one should just convert the information in PHP format
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ // short date:
+ // n - Numeric representation of a month, without leading zeros
+ // j - Day of the month without leading zeros
+ // Y - A full numeric representation of a year, 4 digits
+ // example: 3/1/2012 which means 1 March 2012
+ ShortDate: "n/j/Y", // in jQuery UI Datepicker: "M/d/yyyy"
+ // long date:
+ // l - A full textual representation of the day of the week
+ // F - A full textual representation of a month
+ // d - Day of the month, 2 digits with leading zeros
+ // Y - A full numeric representation of a year, 4 digits
+ LongDate: "l, F d, Y", // in jQuery UI Datepicker: "dddd, MMMM dd, yyyy"
+ // long date with long time:
+ // l - A full textual representation of the day of the week
+ // F - A full textual representation of a month
+ // d - Day of the month, 2 digits with leading zeros
+ // Y - A full numeric representation of a year, 4 digits
+ // g - 12-hour format of an hour without leading zeros
+ // i - Minutes with leading zeros
+ // s - Seconds, with leading zeros
+ // A - Uppercase Ante meridiem and Post meridiem (AM or PM)
+ FullDateTime: "l, F d, Y g:i:s A", // in jQuery UI Datepicker: "dddd, MMMM dd, yyyy h:mm:ss tt"
+ // month day:
+ // F - A full textual representation of a month
+ // d - Day of the month, 2 digits with leading zeros
+ MonthDay: "F d", // in jQuery UI Datepicker: "MMMM dd"
+ // short time (without seconds)
+ // g - 12-hour format of an hour without leading zeros
+ // i - Minutes with leading zeros
+ // A - Uppercase Ante meridiem and Post meridiem (AM or PM)
+ ShortTime: "g:i A", // in jQuery UI Datepicker: "h:mm tt"
+ // long time (with seconds)
+ // g - 12-hour format of an hour without leading zeros
+ // i - Minutes with leading zeros
+ // s - Seconds, with leading zeros
+ // A - Uppercase Ante meridiem and Post meridiem (AM or PM)
+ LongTime: "g:i:s A", // in jQuery UI Datepicker: "h:mm:ss tt"
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ // month with year
+ // Y - A full numeric representation of a year, 4 digits
+ // F - A full textual representation of a month
+ YearMonth: "F, Y" // in jQuery UI Datepicker: "MMMM, yyyy"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-es.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-es.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-es.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,129 @@
+;(function($){
+/**
+ * jqGrid Spanish Translation
+ * Traduccion jqGrid en Español por Yamil Bracho
+ * Traduccion corregida y ampliada por Faserline, S.L.
+ * http://www.faserline.com
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "Mostrando {0} - {1} de {2}",
+ emptyrecords: "Sin registros que mostrar",
+ loadtext: "Cargando...",
+ pgtext : "Página {0} de {1}"
+ },
+ search : {
+ caption: "Búsqueda...",
+ Find: "Buscar",
+ Reset: "Limpiar",
+ odata : ['igual ', 'no igual a', 'menor que', 'menor o igual que','mayor que','mayor o igual a', 'empiece por','no empiece por','está en','no está en','termina por','no termina por','contiene','no contiene'],
+ groupOps: [ { op: "AND", text: "todo" }, { op: "OR", text: "cualquier" } ],
+ matchText: " match",
+ rulesText: " reglas"
+ },
+ edit : {
+ addCaption: "Agregar registro",
+ editCaption: "Modificar registro",
+ bSubmit: "Guardar",
+ bCancel: "Cancelar",
+ bClose: "Cerrar",
+ saveData: "Se han modificado los datos, ¿guardar cambios?",
+ bYes : "Si",
+ bNo : "No",
+ bExit : "Cancelar",
+ msg: {
+ required:"Campo obligatorio",
+ number:"Introduzca un número",
+ minValue:"El valor debe ser mayor o igual a ",
+ maxValue:"El valor debe ser menor o igual a ",
+ email: "no es una dirección de correo válida",
+ integer: "Introduzca un valor entero",
+ date: "Introduza una fecha correcta ",
+ url: "no es una URL válida. Prefijo requerido ('http://' or 'https://')",
+ nodefined : " no está definido.",
+ novalue : " valor de retorno es requerido.",
+ customarray : "La función personalizada debe devolver un array.",
+ customfcheck : "La función personalizada debe estar presente en el caso de validación personalizada."
+ }
+ },
+ view : {
+ caption: "Consultar registro",
+ bClose: "Cerrar"
+ },
+ del : {
+ caption: "Eliminar",
+ msg: "¿Desea eliminar los registros seleccionados?",
+ bSubmit: "Eliminar",
+ bCancel: "Cancelar"
+ },
+ nav : {
+ edittext: " ",
+ edittitle: "Modificar fila seleccionada",
+ addtext:" ",
+ addtitle: "Agregar nueva fila",
+ deltext: " ",
+ deltitle: "Eliminar fila seleccionada",
+ searchtext: " ",
+ searchtitle: "Buscar información",
+ refreshtext: "",
+ refreshtitle: "Recargar datos",
+ alertcap: "Aviso",
+ alerttext: "Seleccione una fila",
+ viewtext: "",
+ viewtitle: "Ver fila seleccionada"
+ },
+ col : {
+ caption: "Mostrar/ocultar columnas",
+ bSubmit: "Enviar",
+ bCancel: "Cancelar"
+ },
+ errors : {
+ errcap : "Error",
+ nourl : "No se ha especificado una URL",
+ norecords: "No hay datos para procesar",
+ model : "Las columnas de nombres son diferentes de las columnas de modelo"
+ },
+ formatter : {
+ integer : {thousandsSeparator: ".", defaultValue: '0'},
+ number : {decimalSeparator:",", thousandsSeparator: ".", decimalPlaces: 2, defaultValue: '0,00'},
+ currency : {decimalSeparator:",", thousandsSeparator: ".", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0,00'},
+ date : {
+ dayNames: [
+ "Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa",
+ "Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sabado"
+ ],
+ monthNames: [
+ "Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic",
+ "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"
+ ],
+ AmPm : ["am","pm","AM","PM"],
+ S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
+ srcformat: 'Y-m-d',
+ newformat: 'd-m-Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "n/j/Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-fa.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-fa.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-fa.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,146 @@
+;(function ($) {
+/**
+ * jqGrid Persian Translation
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+ $.jgrid = $.jgrid || {};
+ $.extend($.jgrid,{
+ defaults: {
+ recordtext: "نمابش {0} - {1} از {2}",
+ emptyrecords: "رکوردی یافت نشد",
+ loadtext: "بارگزاري...",
+ pgtext: "صفحه {0} از {1}"
+ },
+ search: {
+ caption: "جستجو...",
+ Find: "يافته ها",
+ Reset: "از نو",
+ odata: ['برابر', 'نا برابر', 'به', 'کوچکتر', 'از', 'بزرگتر', 'شروع با', 'شروع نشود با', 'نباشد', 'عضو این نباشد', 'اتمام با', 'تمام نشود با', 'حاوی', 'نباشد حاوی'],
+ groupOps: [{
+ op: "AND",
+ text: "کل"
+ },
+ {
+ op: "OR",
+ text: "مجموع"
+ }],
+ matchText: " حاوی",
+ rulesText: " اطلاعات"
+ },
+ edit: {
+ addCaption: "اضافه کردن رکورد",
+ editCaption: "ويرايش رکورد",
+ bSubmit: "ثبت",
+ bCancel: "انصراف",
+ bClose: "بستن",
+ saveData: "دیتا تعییر کرد! ذخیره شود؟",
+ bYes: "بله",
+ bNo: "خیر",
+ bExit: "انصراف",
+ msg: {
+ required: "فيلدها بايد ختما پر شوند",
+ number: "لطفا عدد وعتبر وارد کنيد",
+ minValue: "مقدار وارد شده بايد بزرگتر يا مساوي با",
+ maxValue: "مقدار وارد شده بايد کوچکتر يا مساوي",
+ email: "پست الکترونيک وارد شده معتبر نيست",
+ integer: "لطفا يک عدد صحيح وارد کنيد",
+ date: "لطفا يک تاريخ معتبر وارد کنيد",
+ url: "این آدرس صحیح نمی باشد. پیشوند نیاز است ('http://' یا 'https://')",
+ nodefined: " تعریف نشده!",
+ novalue: " مقدار برگشتی اجباری است!",
+ customarray: "تابع شما باید مقدار آرایه داشته باشد!",
+ customfcheck: "برای داشتن متد دلخواه شما باید سطون با چکینگ دلخواه داشته باشید!"
+ }
+ },
+ view: {
+ caption: "نمایش رکورد",
+ bClose: "بستن"
+ },
+ del: {
+ caption: "حذف",
+ msg: "از حذف گزينه هاي انتخاب شده مطمئن هستيد؟",
+ bSubmit: "حذف",
+ bCancel: "ابطال"
+ },
+ nav: {
+ edittext: " ",
+ edittitle: "ويرايش رديف هاي انتخاب شده",
+ addtext: " ",
+ addtitle: "افزودن رديف جديد",
+ deltext: " ",
+ deltitle: "حذف ردبف هاي انتخاب شده",
+ searchtext: " ",
+ searchtitle: "جستجوي رديف",
+ refreshtext: "",
+ refreshtitle: "بازيابي مجدد صفحه",
+ alertcap: "اخطار",
+ alerttext: "لطفا يک رديف انتخاب کنيد",
+ viewtext: "",
+ viewtitle: "نمایش رکورد های انتخاب شده"
+ },
+ col: {
+ caption: "نمايش/عدم نمايش ستون",
+ bSubmit: "ثبت",
+ bCancel: "انصراف"
+ },
+ errors: {
+ errcap: "خطا",
+ nourl: "هيچ آدرسي تنظيم نشده است",
+ norecords: "هيچ رکوردي براي پردازش موجود نيست",
+ model: "طول نام ستون ها محالف ستون هاي مدل مي باشد!"
+ },
+ formatter: {
+ integer: {
+ thousandsSeparator: " ",
+ defaultValue: "0"
+ },
+ number: {
+ decimalSeparator: ".",
+ thousandsSeparator: " ",
+ decimalPlaces: 2,
+ defaultValue: "0.00"
+ },
+ currency: {
+ decimalSeparator: ".",
+ thousandsSeparator: " ",
+ decimalPlaces: 2,
+ prefix: "",
+ suffix: "",
+ defaultValue: "0"
+ },
+ date: {
+ dayNames: ["يک", "دو", "سه", "چهار", "پنج", "جمع", "شنب", "يکشنبه", "دوشنبه", "سه شنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه"],
+ monthNames: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "ژانويه", "فوريه", "مارس", "آوريل", "مه", "ژوئن", "ژوئيه", "اوت", "سپتامبر", "اکتبر", "نوامبر", "December"],
+ AmPm: ["ب.ظ", "ب.ظ", "ق.ظ", "ق.ظ"],
+ S: function (b) {
+ return b < 11 || b > 13 ? ["st", "nd", "rd", "th"][Math.min((b - 1) % 10, 3)] : "th"
+ },
+ srcformat: "Y-m-d",
+ newformat: "d/m/Y",
+ masks: {
+ ISO8601Long: "Y-m-d H:i:s",
+ ISO8601Short: "Y-m-d",
+ ShortDate: "n/j/Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit: false
+ },
+ baseLinkUrl: "",
+ showAction: "نمايش",
+ target: "",
+ checkbox: {
+ disabled: true
+ },
+ idName: "id"
+ }
+ });
+})(jQuery);
\ No newline at end of file
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-fi.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-fi.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-fi.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,130 @@
+;(function($){
+/**
+ * jqGrid (fi) Finnish Translation
+ * Jukka Inkeri awot.fi 2010-05-19
+ * Alex Grönholm alex.gronholm(a)nextday.fi 2011-05-18
+ * http://awot.fi
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults: {
+ recordtext: "Rivit {0} - {1} / {2}",
+ emptyrecords: "Ei näytettäviä",
+ loadtext: "Haetaan...",
+ pgtext: "Sivu {0} / {1}"
+ },
+ search: {
+ caption: "Etsi...",
+ Find: "Etsi",
+ Reset: "Tyhjennä",
+ odata: ['on', 'ei ole', 'pienempi', 'pienempi tai yhtäsuuri','suurempi','suurempi tai yhtäsuuri', 'alkaa','ei ala','joukossa','ei joukossa','loppuu','ei lopu','sisältää','ei sisällä','on tyhjä','ei ole tyhjä'],
+ groupOps: [ { op: "AND", text: "kaikki" }, { op: "OR", text: "mikä tahansa" } ],
+ matchText: " täytä ehdot:",
+ rulesText: ""
+ },
+ edit: {
+ addCaption: "Uusi rivi",
+ editCaption: "Muokkaa riviä",
+ bSubmit: "OK",
+ bCancel: "Peru",
+ bClose: "Sulje",
+ saveData: "Tietoja muutettu! Tallennetaanko?",
+ bYes: "Kyllä",
+ bNo: "Ei",
+ bExit: "Peru",
+ msg: {
+ required: "pakollinen",
+ number: "Anna kelvollinen nro",
+ minValue: "arvon oltava suurempi tai yhtäsuuri kuin ",
+ maxValue: "arvon oltava pienempi tai yhtäsuuri kuin ",
+ email: "ei ole kelvollinen säpostiosoite",
+ integer: "Anna kelvollinen kokonaisluku",
+ date: "Anna kelvollinen pvm",
+ url: "Ei ole kelvollinen linkki(URL). Alku oltava ('http://' tai 'https://')",
+ nodefined: " ei ole määritelty!",
+ novalue: " paluuarvo vaaditaan!",
+ customarray: "Oman funktion tulee palauttaa jono!",
+ customfcheck: "Oma funktio on määriteltävä räätälöityä tarkastusta varten!"
+ }
+ },
+ view: {
+ caption: "Näytä rivi",
+ bClose: "Sulje"
+ },
+ del: {
+ caption: "Poista",
+ msg: "Poista valitut rivit?",
+ bSubmit: "Poista",
+ bCancel: "Peru"
+ },
+ nav: {
+ edittext: "",
+ edittitle: "Muokkaa valittua riviä",
+ addtext: "",
+ addtitle: "Uusi rivi",
+ deltext: "",
+ deltitle: "Poista valittu rivi",
+ searchtext: "",
+ searchtitle: "Etsi tietoja",
+ refreshtext: "",
+ refreshtitle: "Lataa uudelleen",
+ alertcap: "Varoitus",
+ alerttext: "Valitse rivi",
+ viewtext: "",
+ viewtitle: "Näyta valitut rivit"
+ },
+ col: {
+ caption: "Valitse sarakkeet",
+ bSubmit: "OK",
+ bCancel: "Peru"
+ },
+ errors : {
+ errcap: "Virhe",
+ nourl: "URL on asettamatta",
+ norecords: "Ei muokattavia tietoja",
+ model: "Pituus colNames <> colModel!"
+ },
+ formatter: {
+ integer: {thousandsSeparator: "", defaultValue: '0'},
+ number: {decimalSeparator:",", thousandsSeparator: "", decimalPlaces: 2, defaultValue: '0,00'},
+ currency: {decimalSeparator:",", thousandsSeparator: "", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0,00'},
+ date: {
+ dayNames: [
+ "Su", "Ma", "Ti", "Ke", "To", "Pe", "La",
+ "Sunnuntai", "Maanantai", "Tiistai", "Keskiviikko", "Torstai", "Perjantai", "Lauantai"
+ ],
+ monthNames: [
+ "Tam", "Hel", "Maa", "Huh", "Tou", "Kes", "Hei", "Elo", "Syy", "Lok", "Mar", "Jou",
+ "Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"
+ ],
+ AmPm: ["am","pm","AM","PM"],
+ S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
+ srcformat: 'Y-m-d',
+ newformat: 'd.m.Y',
+ masks: {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "d.m.Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox: {disabled:true},
+ idName: 'id'
+ }
+});
+// FI
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-fr.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-fr.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-fr.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,127 @@
+;(function($){
+/**
+ * jqGrid French Translation
+ * Tony Tomov tony(a)trirand.com
+ * http://trirand.com/blog/
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "Enregistrements {0} - {1} sur {2}",
+ emptyrecords: "Aucun enregistrement à afficher",
+ loadtext: "Chargement...",
+ pgtext : "Page {0} sur {1}"
+ },
+ search : {
+ caption: "Recherche...",
+ Find: "Chercher",
+ Reset: "Réinitialiser",
+ odata : ['égal', 'différent', 'inférieur', 'inférieur ou égal','supérieur','supérieur ou égal', 'commence par','ne commence pas par','est dans',"n'est pas dans",'finit par','ne finit pas par','contient','ne contient pas'],
+ groupOps: [ { op: "AND", text: "tous" }, { op: "OR", text: "au moins un" } ],
+ matchText: " correspondance",
+ rulesText: " règles"
+ },
+ edit : {
+ addCaption: "Ajouter",
+ editCaption: "Editer",
+ bSubmit: "Valider",
+ bCancel: "Annuler",
+ bClose: "Fermer",
+ saveData: "Les données ont changé ! Enregistrer les modifications ?",
+ bYes: "Oui",
+ bNo: "Non",
+ bExit: "Annuler",
+ msg: {
+ required: "Champ obligatoire",
+ number: "Saisissez un nombre correct",
+ minValue: "La valeur doit être supérieure ou égale à",
+ maxValue: "La valeur doit être inférieure ou égale à",
+ email: "n'est pas un email correct",
+ integer: "Saisissez un entier correct",
+ url: "n'est pas une adresse correcte. Préfixe requis ('http://' or 'https://')",
+ nodefined : " n'est pas défini!",
+ novalue : " la valeur de retour est requise!",
+ customarray : "Une fonction personnalisée devrait retourner un tableau (array)!",
+ customfcheck : "Une fonction personnalisée devrait être présente dans le cas d'une vérification personnalisée!"
+ }
+ },
+ view : {
+ caption: "Voir les enregistrement",
+ bClose: "Fermer"
+ },
+ del : {
+ caption: "Supprimer",
+ msg: "Supprimer les enregistrements sélectionnés ?",
+ bSubmit: "Supprimer",
+ bCancel: "Annuler"
+ },
+ nav : {
+ edittext: " ",
+ edittitle: "Editer la ligne sélectionnée",
+ addtext:" ",
+ addtitle: "Ajouter une ligne",
+ deltext: " ",
+ deltitle: "Supprimer la ligne sélectionnée",
+ searchtext: " ",
+ searchtitle: "Chercher un enregistrement",
+ refreshtext: "",
+ refreshtitle: "Recharger le tableau",
+ alertcap: "Avertissement",
+ alerttext: "Veuillez sélectionner une ligne",
+ viewtext: "",
+ viewtitle: "Afficher la ligne sélectionnée"
+ },
+ col : {
+ caption: "Afficher/Masquer les colonnes",
+ bSubmit: "Valider",
+ bCancel: "Annuler"
+ },
+ errors : {
+ errcap : "Erreur",
+ nourl : "Aucune adresse n'est paramétrée",
+ norecords: "Aucun enregistrement à traiter",
+ model : "Nombre de titres (colNames) <> Nombre de données (colModel)!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0,00'},
+ currency : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0,00'},
+ date : {
+ dayNames: [
+ "Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam",
+ "Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"
+ ],
+ monthNames: [
+ "Jan", "Fév", "Mar", "Avr", "Mai", "Jui", "Jul", "Aou", "Sep", "Oct", "Nov", "Déc",
+ "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Aout", "Septembre", "Octobre", "Novembre", "Décembre"
+ ],
+ AmPm : ["am","pm","AM","PM"],
+ S: function (j) {return j == 1 ? 'er' : 'e';},
+ srcformat: 'Y-m-d',
+ newformat: 'd/m/Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "n/j/Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-gl.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-gl.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-gl.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,127 @@
+;(function($){
+/**
+ * jqGrid Galician Translation
+ * Translated by Jorge Barreiro <yortx.barry(a)gmail.com>
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "Amosando {0} - {1} de {2}",
+ emptyrecords: "Sen rexistros que amosar",
+ loadtext: "Cargando...",
+ pgtext : "Páxina {0} de {1}"
+ },
+ search : {
+ caption: "Búsqueda...",
+ Find: "Buscar",
+ Reset: "Limpar",
+ odata : ['igual ', 'diferente a', 'menor que', 'menor ou igual que','maior que','maior ou igual a', 'empece por','non empece por','está en','non está en','termina por','non termina por','contén','non contén'],
+ groupOps: [ { op: "AND", text: "todo" }, { op: "OR", text: "calquera" } ],
+ matchText: " match",
+ rulesText: " regras"
+ },
+ edit : {
+ addCaption: "Engadir rexistro",
+ editCaption: "Modificar rexistro",
+ bSubmit: "Gardar",
+ bCancel: "Cancelar",
+ bClose: "Pechar",
+ saveData: "Modificáronse os datos, quere gardar os cambios?",
+ bYes : "Si",
+ bNo : "Non",
+ bExit : "Cancelar",
+ msg: {
+ required:"Campo obrigatorio",
+ number:"Introduza un número",
+ minValue:"O valor debe ser maior ou igual a ",
+ maxValue:"O valor debe ser menor ou igual a ",
+ email: "non é un enderezo de correo válido",
+ integer: "Introduza un valor enteiro",
+ date: "Introduza unha data correcta ",
+ url: "non é unha URL válida. Prefixo requerido ('http://' ou 'https://')",
+ nodefined : " non está definido.",
+ novalue : " o valor de retorno é obrigatorio.",
+ customarray : "A función persoalizada debe devolver un array.",
+ customfcheck : "A función persoalizada debe estar presente no caso de ter validación persoalizada."
+ }
+ },
+ view : {
+ caption: "Consultar rexistro",
+ bClose: "Pechar"
+ },
+ del : {
+ caption: "Eliminar",
+ msg: "Desexa eliminar os rexistros seleccionados?",
+ bSubmit: "Eliminar",
+ bCancel: "Cancelar"
+ },
+ nav : {
+ edittext: " ",
+ edittitle: "Modificar a fila seleccionada",
+ addtext:" ",
+ addtitle: "Engadir unha nova fila",
+ deltext: " ",
+ deltitle: "Eliminar a fila seleccionada",
+ searchtext: " ",
+ searchtitle: "Buscar información",
+ refreshtext: "",
+ refreshtitle: "Recargar datos",
+ alertcap: "Aviso",
+ alerttext: "Seleccione unha fila",
+ viewtext: "",
+ viewtitle: "Ver fila seleccionada"
+ },
+ col : {
+ caption: "Mostrar/ocultar columnas",
+ bSubmit: "Enviar",
+ bCancel: "Cancelar"
+ },
+ errors : {
+ errcap : "Erro",
+ nourl : "Non especificou unha URL",
+ norecords: "Non hai datos para procesar",
+ model : "As columnas de nomes son diferentes das columnas de modelo"
+ },
+ formatter : {
+ integer : {thousandsSeparator: ".", defaultValue: '0'},
+ number : {decimalSeparator:",", thousandsSeparator: ".", decimalPlaces: 2, defaultValue: '0,00'},
+ currency : {decimalSeparator:",", thousandsSeparator: ".", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0,00'},
+ date : {
+ dayNames: [
+ "Do", "Lu", "Ma", "Me", "Xo", "Ve", "Sa",
+ "Domingo", "Luns", "Martes", "Mércoles", "Xoves", "Vernes", "Sábado"
+ ],
+ monthNames: [
+ "Xan", "Feb", "Mar", "Abr", "Mai", "Xuñ", "Xul", "Ago", "Set", "Out", "Nov", "Dec",
+ "Xaneiro", "Febreiro", "Marzo", "Abril", "Maio", "Xuño", "Xullo", "Agosto", "Setembro", "Outubro", "Novembro", "Decembro"
+ ],
+ AmPm : ["am","pm","AM","PM"],
+ S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
+ srcformat: 'Y-m-d',
+ newformat: 'd-m-Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "n/j/Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-he.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-he.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-he.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,128 @@
+;(function($){
+/**
+ * jqGrid Hebrew Translation
+ * Shuki Shukrun shukrun.shuki(a)gmail.com
+ * http://trirand.com/blog/
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "מציג {0} - {1} מתוך {2}",
+ emptyrecords: "אין רשומות להציג",
+ loadtext: "טוען...",
+ pgtext : "דף {0} מתוך {1}"
+ },
+ search : {
+ caption: "מחפש...",
+ Find: "חפש",
+ Reset: "התחל",
+ odata : ['שווה', 'לא שווה', 'קטן', 'קטן או שווה','גדול','גדול או שווה', 'מתחיל ב','לא מתחיל ב','נמצא ב','לא נמצא ב','מסתיים ב','לא מסתיים ב','מכיל','לא מכיל'],
+ groupOps: [ { op: "AND", text: "הכל" }, { op: "OR", text: "אחד מ" } ],
+ matchText: " תואם",
+ rulesText: " חוקים"
+ },
+ edit : {
+ addCaption: "הוסף רשומה",
+ editCaption: "ערוך רשומה",
+ bSubmit: "שלח",
+ bCancel: "בטל",
+ bClose: "סגור",
+ saveData: "נתונים השתנו! לשמור?",
+ bYes : "כן",
+ bNo : "לא",
+ bExit : "בטל",
+ msg: {
+ required:"שדה חובה",
+ number:"אנא, הכנס מספר תקין",
+ minValue:"ערך צריך להיות גדול או שווה ל ",
+ maxValue:"ערך צריך להיות קטן או שווה ל ",
+ email: "היא לא כתובת איימל תקינה",
+ integer: "אנא, הכנס מספר שלם",
+ date: "אנא, הכנס תאריך תקין",
+ url: "הכתובת אינה תקינה. דרושה תחילית ('http://' או 'https://')",
+ nodefined : " is not defined!",
+ novalue : " return value is required!",
+ customarray : "Custom function should return array!",
+ customfcheck : "Custom function should be present in case of custom checking!"
+ }
+ },
+ view : {
+ caption: "הצג רשומה",
+ bClose: "סגור"
+ },
+ del : {
+ caption: "מחק",
+ msg: "האם למחוק את הרשומה/ות המסומנות?",
+ bSubmit: "מחק",
+ bCancel: "בטל"
+ },
+ nav : {
+ edittext: "",
+ edittitle: "ערוך שורה מסומנת",
+ addtext:"",
+ addtitle: "הוסף שורה חדשה",
+ deltext: "",
+ deltitle: "מחק שורה מסומנת",
+ searchtext: "",
+ searchtitle: "חפש רשומות",
+ refreshtext: "",
+ refreshtitle: "טען גריד מחדש",
+ alertcap: "אזהרה",
+ alerttext: "אנא, בחר שורה",
+ viewtext: "",
+ viewtitle: "הצג שורה מסומנת"
+ },
+ col : {
+ caption: "הצג/הסתר עמודות",
+ bSubmit: "שלח",
+ bCancel: "בטל"
+ },
+ errors : {
+ errcap : "שגיאה",
+ nourl : "לא הוגדרה כתובת url",
+ norecords: "אין רשומות לעבד",
+ model : "אורך של colNames <> colModel!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
+ currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
+ date : {
+ dayNames: [
+ "א", "ב", "ג", "ד", "ה", "ו", "ש",
+ "ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת"
+ ],
+ monthNames: [
+ "ינו", "פבר", "מרץ", "אפר", "מאי", "יונ", "יול", "אוג", "ספט", "אוק", "נוב", "דצמ",
+ "ינואר", "פברואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר"
+ ],
+ AmPm : ["לפני הצהרים","אחר הצהרים","לפני הצהרים","אחר הצהרים"],
+ S: function (j) {return j < 11 || j > 13 ? ['', '', '', ''][Math.min((j - 1) % 10, 3)] : ''},
+ srcformat: 'Y-m-d',
+ newformat: 'd/m/Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "n/j/Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-hr.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-hr.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-hr.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,129 @@
+;(function($){
+/**
+ * jqGrid Translation
+ * Tony Tomov tony(a)trirand.com
+ * http://trirand.com/blog/
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "Pregled {0} - {1} od {2}",
+ emptyrecords: "Nema zapisa",
+ loadtext: "Učitavam...",
+ pgtext : "Stranica {0} od {1}"
+ },
+ search : {
+ caption: "pretraživanje...",
+ Find: "Traži",
+ Reset: "Poništi",
+ odata : ['jednak', 'nije identičan', 'manje', 'manje ili identično','veće','veše ili identično', 'počinje sa','ne počinje sa ','je u','nije u','završava sa','ne završava sa','sadrži','ne sadrži'],
+ groupOps: [ { op: "U", text: "sve" }, { op: "ILI", text: "bilo koji" } ],
+ matchText: " podudata se",
+ rulesText: " pravila"
+ },
+ edit : {
+ addCaption: "Dodaj zapis",
+ editCaption: "Promijeni zapis",
+ bSubmit: "Preuzmi",
+ bCancel: "Odustani",
+ bClose: "Zatvri",
+ saveData: "Podaci su promijenjeni! Preuzmi promijene?",
+ bYes : "Da",
+ bNo : "Ne",
+ bExit : "Odustani",
+ msg: {
+ required:"Polje je obavezno",
+ number:"Molim, unesite ispravan broj",
+ minValue:"vrijednost mora biti veća ili identična ",
+ maxValue:"vrijednost mora biti manja ili identična",
+ email: "neispravan e-mail",
+ integer: "Molim, unjeti ispravan cijeli broj (integer)",
+ date: "Molim, unjeti ispravan datum ",
+ url: "neispravan URL. Prefiks je obavezan ('http://' or 'https://')",
+ nodefined : " nije definiran!",
+ novalue : " zahtjevan podatak je obavezan!",
+ customarray : "Opcionalna funkcija trebala bi bili polje (array)!",
+ customfcheck : "Custom function should be present in case of custom checking!"
+
+ }
+ },
+ view : {
+ caption: "Otvori zapis",
+ bClose: "Zatvori"
+ },
+ del : {
+ caption: "Obriši",
+ msg: "Obriši označen zapis ili više njih?",
+ bSubmit: "Obriši",
+ bCancel: "Odustani"
+ },
+ nav : {
+ edittext: "",
+ edittitle: "Promijeni obilježeni red",
+ addtext:"",
+ addtitle: "Dodaj novi red",
+ deltext: "",
+ deltitle: "Obriši obilježeni red",
+ searchtext: "",
+ searchtitle: "Potraži zapise",
+ refreshtext: "",
+ refreshtitle: "Ponovo preuzmi podatke",
+ alertcap: "Upozorenje",
+ alerttext: "Molim, odaberi red",
+ viewtext: "",
+ viewtitle: "Pregled obilježenog reda"
+ },
+ col : {
+ caption: "Obilježi kolonu",
+ bSubmit: "Uredu",
+ bCancel: "Odustani"
+ },
+ errors : {
+ errcap : "Greška",
+ nourl : "Nedostaje URL",
+ norecords: "Bez zapisa za obradu",
+ model : "Duljina colNames <> colModel!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
+ currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
+ date : {
+ dayNames: [
+ "Ned", "Pon", "Uto", "Sri", "Čet", "Pet", "Sub",
+ "Nedjelja", "Ponedjeljak", "Utorak", "Srijeda", "Četvrtak", "Petak", "Subota"
+ ],
+ monthNames: [
+ "Sij", "Vel", "Ožu", "Tra", "Svi", "Lip", "Srp", "Kol", "Ruj", "Lis", "Stu", "Pro",
+ "Siječanj", "Veljača", "Ožujak", "Travanj", "Svibanj", "Lipanj", "Srpanj", "Kolovoz", "Rujan", "Listopad", "Studeni", "Prosinac"
+ ],
+ AmPm : ["am","pm","AM","PM"],
+ S: function (j) {return ''},
+ srcformat: 'Y-m-d',
+ newformat: 'd.m.Y.',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "j.n.Y.",
+ LongDate: "l, j. F Y",
+ FullDateTime: "l, d. F Y G:i:s",
+ MonthDay: "d. F",
+ ShortTime: "G:i",
+ LongTime: "G:i:s",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-hr1250.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-hr1250.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-hr1250.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,129 @@
+;(function($){
+/**
+ * jqGrid Translation
+ * Tony Tomov tony(a)trirand.com
+ * http://trirand.com/blog/
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "Pregled {0} - {1} od {2}",
+ emptyrecords: "Nema zapisa",
+ loadtext: "U�itavam...",
+ pgtext : "Stranica {0} od {1}"
+ },
+ search : {
+ caption: "pretra�ivanje...",
+ Find: "Tra�i",
+ Reset: "Poni�ti",
+ odata : ['jednak', 'nije identi�an', 'manje', 'manje ili identi�no','ve�e','ve�e ili identi�no', 'po�inje sa','ne po�inje sa ','je u','nije u','zavr�ava sa','ne zavr�ava sa','sadr�i','ne sadr�i'],
+ groupOps: [ { op: "U", text: "sve" }, { op: "ILI", text: "bilo koji" } ],
+ matchText: " podudata se",
+ rulesText: " pravila"
+ },
+ edit : {
+ addCaption: "Dodaj zapis",
+ editCaption: "Promijeni zapis",
+ bSubmit: "Preuzmi",
+ bCancel: "Odustani",
+ bClose: "Zatvri",
+ saveData: "Podaci su promijenjeni! Preuzmi promijene?",
+ bYes : "Da",
+ bNo : "Ne",
+ bExit : "Odustani",
+ msg: {
+ required:"Polje je obavezno",
+ number:"Molim, unesite ispravan broj",
+ minValue:"vrijednost mora biti ve�a ili identi�na ",
+ maxValue:"vrijednost mora biti manja ili identi�na",
+ email: "neispravan e-mail",
+ integer: "Molim, unjeti ispravan cijeli broj (integer)",
+ date: "Molim, unjeti ispravan datum ",
+ url: "neispravan URL. Prefiks je obavezan ('http://' or 'https://')",
+ nodefined : " nije definiran!",
+ novalue : " zahtjevan podatak je obavezan!",
+ customarray : "Opcionalna funkcija trebala bi bili polje (array)!",
+ customfcheck : "Custom function should be present in case of custom checking!"
+
+ }
+ },
+ view : {
+ caption: "Otvori zapis",
+ bClose: "Zatvori"
+ },
+ del : {
+ caption: "Obri�i",
+ msg: "Obri�i ozna�en zapis ili vi�e njih?",
+ bSubmit: "Obri�i",
+ bCancel: "Odustani"
+ },
+ nav : {
+ edittext: "",
+ edittitle: "Promijeni obilje�eni red",
+ addtext:"",
+ addtitle: "Dodaj novi red",
+ deltext: "",
+ deltitle: "Obri�i obilje�eni red",
+ searchtext: "",
+ searchtitle: "Potra�i zapise",
+ refreshtext: "",
+ refreshtitle: "Ponovo preuzmi podatke",
+ alertcap: "Upozorenje",
+ alerttext: "Molim, odaberi red",
+ viewtext: "",
+ viewtitle: "Pregled obilje�enog reda"
+ },
+ col : {
+ caption: "Obilje�i kolonu",
+ bSubmit: "Uredu",
+ bCancel: "Odustani"
+ },
+ errors : {
+ errcap : "Gre�ka",
+ nourl : "Nedostaje URL",
+ norecords: "Bez zapisa za obradu",
+ model : "Duljina colNames <> colModel!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
+ currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
+ date : {
+ dayNames: [
+ "Ned", "Pon", "Uto", "Sri", "�et", "Pet", "Sub",
+ "Nedjelja", "Ponedjeljak", "Utorak", "Srijeda", "�etvrtak", "Petak", "Subota"
+ ],
+ monthNames: [
+ "Sij", "Vel", "O�u", "Tra", "Svi", "Lip", "Srp", "Kol", "Ruj", "Lis", "Stu", "Pro",
+ "Sije�anj", "Velja�a", "O�ujak", "Travanj", "Svibanj", "Lipanj", "Srpanj", "Kolovoz", "Rujan", "Listopad", "Studeni", "Prosinac"
+ ],
+ AmPm : ["am","pm","AM","PM"],
+ S: function (j) {return ''},
+ srcformat: 'Y-m-d',
+ newformat: 'd.m.Y.',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "j.n.Y.",
+ LongDate: "l, j. F Y",
+ FullDateTime: "l, d. F Y G:i:s",
+ MonthDay: "d. F",
+ ShortTime: "G:i",
+ LongTime: "G:i:s",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-hu.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-hu.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-hu.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,130 @@
+;(function($){
+/**
+ * jqGrid Hungarian Translation
+ * Őrszigety Ádám udx6bs(a)freemail.hu
+ * http://trirand.com/blog/
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "Oldal {0} - {1} / {2}",
+ emptyrecords: "Nincs találat",
+ loadtext: "Betöltés...",
+ pgtext : "Oldal {0} / {1}"
+ },
+ search : {
+ caption: "Keresés...",
+ Find: "Keres",
+ Reset: "Alapértelmezett",
+ odata : ['egyenlő', 'nem egyenlő', 'kevesebb', 'kevesebb vagy egyenlő','nagyobb','nagyobb vagy egyenlő', 'ezzel kezdődik','nem ezzel kezdődik','tartalmaz','nem tartalmaz','végződik','nem végződik','tartalmaz','nem tartalmaz'],
+ groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" } ],
+ matchText: " match",
+ rulesText: " rules"
+ },
+ edit : {
+ addCaption: "Új tétel",
+ editCaption: "Tétel szerkesztése",
+ bSubmit: "Mentés",
+ bCancel: "Mégse",
+ bClose: "Bezárás",
+ saveData: "A tétel megváltozott! Tétel mentése?",
+ bYes : "Igen",
+ bNo : "Nem",
+ bExit : "Mégse",
+ msg: {
+ required:"Kötelező mező",
+ number:"Kérjük, adjon meg egy helyes számot",
+ minValue:"Nagyobb vagy egyenlőnek kell lenni mint ",
+ maxValue:"Kisebb vagy egyenlőnek kell lennie mint",
+ email: "hibás emailcím",
+ integer: "Kérjük adjon meg egy helyes egész számot",
+ date: "Kérjük adjon meg egy helyes dátumot",
+ url: "nem helyes cím. Előtag kötelező ('http://' vagy 'https://')",
+ nodefined : " nem definiált!",
+ novalue : " visszatérési érték kötelező!!",
+ customarray : "Custom function should return array!",
+ customfcheck : "Custom function should be present in case of custom checking!"
+
+ }
+ },
+ view : {
+ caption: "Tétel megtekintése",
+ bClose: "Bezárás"
+ },
+ del : {
+ caption: "Törlés",
+ msg: "Kiválaztott tétel(ek) törlése?",
+ bSubmit: "Törlés",
+ bCancel: "Mégse"
+ },
+ nav : {
+ edittext: "",
+ edittitle: "Tétel szerkesztése",
+ addtext:"",
+ addtitle: "Új tétel hozzáadása",
+ deltext: "",
+ deltitle: "Tétel törlése",
+ searchtext: "",
+ searchtitle: "Keresés",
+ refreshtext: "",
+ refreshtitle: "Frissítés",
+ alertcap: "Figyelmeztetés",
+ alerttext: "Kérem válasszon tételt.",
+ viewtext: "",
+ viewtitle: "Tétel megtekintése"
+ },
+ col : {
+ caption: "Oszlopok kiválasztása",
+ bSubmit: "Ok",
+ bCancel: "Mégse"
+ },
+ errors : {
+ errcap : "Hiba",
+ nourl : "Nincs URL beállítva",
+ norecords: "Nincs feldolgozásra váró tétel",
+ model : "colNames és colModel hossza nem egyenlő!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0,00'},
+ currency : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0,00'},
+ date : {
+ dayNames: [
+ "Va", "Hé", "Ke", "Sze", "Csü", "Pé", "Szo",
+ "Vasárnap", "Hétfő", "Kedd", "Szerda", "Csütörtök", "Péntek", "Szombat"
+ ],
+ monthNames: [
+ "Jan", "Feb", "Már", "Ápr", "Máj", "Jún", "Júl", "Aug", "Szep", "Okt", "Nov", "Dec",
+ "Január", "Február", "Március", "Áprili", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December"
+ ],
+ AmPm : ["de","du","DE","DU"],
+ S: function (j) {return '.-ik';},
+ srcformat: 'Y-m-d',
+ newformat: 'Y/m/d',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "Y/j/n",
+ LongDate: "Y. F hó d., l",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "a g:i",
+ LongTime: "a g:i:s",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "Y, F"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-is.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-is.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-is.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,127 @@
+;(function($){
+/**
+ * jqGrid Icelandic Translation
+ * jtm(a)hi.is Univercity of Iceland
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "Skoða {0} - {1} af {2}",
+ emptyrecords: "Engar færslur",
+ loadtext: "Hleður...",
+ pgtext : "Síða {0} af {1}"
+ },
+ search : {
+ caption: "Leita...",
+ Find: "Leita",
+ Reset: "Endursetja",
+ odata : ['sama og', 'ekki sama og', 'minna en', 'minna eða jafnt og','stærra en','stærra eða jafnt og', 'byrjar á','byrjar ekki á','er í','er ekki í','endar á','endar ekki á','inniheldur','inniheldur ekki'],
+ groupOps: [ { op: "AND", text: "allt" }, { op: "OR", text: "eða" } ],
+ matchText: " passar",
+ rulesText: " reglur"
+ },
+ edit : {
+ addCaption: "Bæta við færslu",
+ editCaption: "Breyta færslu",
+ bSubmit: "Vista",
+ bCancel: "Hætta við",
+ bClose: "Loka",
+ saveData: "Gögn hafa breyst! Vista breytingar?",
+ bYes : "Já",
+ bNo : "Nei",
+ bExit : "Hætta við",
+ msg: {
+ required:"Reitur er nauðsynlegur",
+ number:"Vinsamlega settu inn tölu",
+ minValue:"gildi verður að vera meira en eða jafnt og ",
+ maxValue:"gildi verður að vera minna en eða jafnt og ",
+ email: "er ekki löglegt email",
+ integer: "Vinsamlega settu inn tölu",
+ date: "Vinsamlega setti inn dagsetningu",
+ url: "er ekki löglegt URL. Vantar ('http://' eða 'https://')",
+ nodefined : " er ekki skilgreint!",
+ novalue : " skilagildi nauðsynlegt!",
+ customarray : "Fall skal skila fylki!",
+ customfcheck : "Fall skal vera skilgreint!"
+ }
+ },
+ view : {
+ caption: "Skoða færslu",
+ bClose: "Loka"
+ },
+ del : {
+ caption: "Eyða",
+ msg: "Eyða völdum færslum ?",
+ bSubmit: "Eyða",
+ bCancel: "Hætta við"
+ },
+ nav : {
+ edittext: " ",
+ edittitle: "Breyta færslu",
+ addtext:" ",
+ addtitle: "Ný færsla",
+ deltext: " ",
+ deltitle: "Eyða færslu",
+ searchtext: " ",
+ searchtitle: "Leita",
+ refreshtext: "",
+ refreshtitle: "Endurhlaða",
+ alertcap: "Viðvörun",
+ alerttext: "Vinsamlega veldu færslu",
+ viewtext: "",
+ viewtitle: "Skoða valda færslu"
+ },
+ col : {
+ caption: "Sýna / fela dálka",
+ bSubmit: "Vista",
+ bCancel: "Hætta við"
+ },
+ errors : {
+ errcap : "Villa",
+ nourl : "Vantar slóð",
+ norecords: "Engar færslur valdar",
+ model : "Lengd colNames <> colModel!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
+ currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
+ date : {
+ dayNames: [
+ "Sun", "Mán", "Þri", "Mið", "Fim", "Fös", "Lau",
+ "Sunnudagur", "Mánudagur", "Þriðjudagur", "Miðvikudagur", "Fimmtudagur", "Föstudagur", "Laugardagur"
+ ],
+ monthNames: [
+ "Jan", "Feb", "Mar", "Apr", "Maí", "Jún", "Júl", "Ágú", "Sep", "Oct", "Nóv", "Des",
+ "Janúar", "Febrúar", "Mars", "Apríl", "Maí", "Júný", "Júlý", "Ágúst", "September", "Október", "Nóvember", "Desember"
+ ],
+ AmPm : ["am","pm","AM","PM"],
+ S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
+ srcformat: 'Y-m-d',
+ newformat: 'd/m/Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "n/j/Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-it.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-it.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-it.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1 @@
+(function(a){a.jgrid = a.jgrid || {};a.extend(a.jgrid,{ defaults:{recordtext:"Visualizzati {0} - {1} di {2}",emptyrecords:"Nessun record da visualizzare",loadtext:"Caricamento...",pgtext:"Pagina {0} di {1}"},search:{caption:"Ricerca...",Find:"Cerca",Reset:"Pulisci",odata:["uguale","diverso","minore","minore o uguale","maggiore","maggiore o uguale","inizia con","non inizia con","in","non in","termina con","non termina con","contiene","non contiene"],groupOps:[{op:"AND",text:"tutto"},{op:"OR",text:"almeno uno"}],matchText:" corrisponde",rulesText:" regole"},edit:{addCaption:"Aggiungi Record",editCaption:"Modifica Record",bSubmit:"Invia",bCancel:"Chiudi",bClose:"Chiudi",saveData:"Alcuni dati modificati! Salvare i cambiamenti?",bYes:"Si",bNo:"No",bExit:"Esci",msg:{required:"Campo richiesto",number:"Per favore, inserisci un valore valido",minValue:"il valore deve essere maggiore o uguale a ",maxValue:"il valore deve essere minore o uguale a",email:"e-mail non corretta",integer:"Per favore, inserisci un numero intero valido",date:"Per favore, inserisci una data valida",url:"URL non valido. Prefisso richiesto ('http://' or 'https://')",nodefined:" non � definito!",novalue:" valore di ritorno richiesto!",customarray:"La function custon deve tornare un array!",customfcheck:"La function custom deve esistere per il custom checking!"}},view:{caption:"Visualizzazione Record",bClose:"Chiudi"},del:{caption:"Cancella",msg:"Cancellare record selezionato/i?",bSubmit:"Cancella",bCancel:"Annulla"},nav:{edittext:" ",edittitle:"Modifica record selezionato",addtext:" ",addtitle:"Aggiungi nuovo record",deltext:" ",deltitle:"Cancella record selezionato",searchtext:" ",searchtitle:"Ricerca record",refreshtext:"",refreshtitle:"Aggiorna griglia",alertcap:"Attenzione",alerttext:"Per favore, seleziona un record",viewtext:"",viewtitle:"Visualizza riga selezionata"},col:{caption:"Mostra/Nascondi Colonne",bSubmit:"Invia",bCancel:"Annulla"},errors:{errcap:"Errore",nourl:"Url non settata",norecords:"Nessun record da elaborare",model:"Lunghezza di colNames <> colModel!"},formatter:{integer:{thousandsSeparator:" ",defaultValue:"0"},number:{decimalSeparator:",",thousandsSeparator:" ",decimalPlaces:2,defaultValue:"0,00"},currency:{decimalSeparator:",",thousandsSeparator:" ",decimalPlaces:2,prefix:"",suffix:"",defaultValue:"0,00"},date:{dayNames:["Dom","Lun","Mar","Mer","Gio","Ven","Sab","Domenica","Luned�","Marted�","Mercoled�","Gioved�","Venerd�","Sabato"],monthNames:["Gen","Feb","Mar","Apr","Mag","Gui","Lug","Ago","Set","Ott","Nov","Dic","Genneio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Movembre","Dicembre"],AmPm:["am","pm","AM","PM"],S:function(b){return b<11||b>13?["st","nd","rd","th"][Math.min((b-1)%10,3)]:"th"},srcformat:"Y-m-d",newformat:"d/m/Y",masks:{ISO8601Long:"Y-m-d H:i:s",ISO8601Short:"Y-m-d",ShortDate:"n/j/Y",LongDate:"l, F d, Y",FullDateTime:"l, F d, Y g:i:s A",MonthDay:"F d",ShortTime:"g:i A",LongTime:"g:i:s A",SortableDateTime:"Y-m-d\\TH:i:s",UniversalSortableDateTime:"Y-m-d H:i:sO",YearMonth:"F, Y"},reformatAfterEdit:false},baseLinkUrl:"",showAction:"",target:"",checkbox:{disabled:true},idName:"id"}});})(jQuery);
\ No newline at end of file
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ja.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ja.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ja.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,156 @@
+;(function($){
+/**
+ * jqGrid Japanese Translation
+ * OKADA Yoshitada okada.dev(a)sth.jp
+ * http://trirand.com/blog/
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "{2} \u4EF6\u4E2D {0} - {1} \u3092\u8868\u793A ",
+ emptyrecords: "\u8868\u793A\u3059\u308B\u30EC\u30B3\u30FC\u30C9\u304C\u3042\u308A\u307E\u305B\u3093",
+ loadtext: "\u8aad\u307f\u8fbc\u307f\u4e2d...",
+ pgtext : "{1} \u30DA\u30FC\u30B8\u4E2D {0} \u30DA\u30FC\u30B8\u76EE "
+ },
+ search : {
+ caption: "\u691c\u7d22...",
+ Find: "\u691c\u7d22",
+ Reset: "\u30ea\u30bb\u30c3\u30c8",
+ odata: ["\u6B21\u306B\u7B49\u3057\u3044", "\u6B21\u306B\u7B49\u3057\u304F\u306A\u3044",
+ "\u6B21\u3088\u308A\u5C0F\u3055\u3044", "\u6B21\u306B\u7B49\u3057\u3044\u304B\u5C0F\u3055\u3044",
+ "\u6B21\u3088\u308A\u5927\u304D\u3044", "\u6B21\u306B\u7B49\u3057\u3044\u304B\u5927\u304D\u3044",
+ "\u6B21\u3067\u59CB\u307E\u308B", "\u6B21\u3067\u59CB\u307E\u3089\u306A\u3044",
+ "\u6B21\u306B\u542B\u307E\u308C\u308B", "\u6B21\u306B\u542B\u307E\u308C\u306A\u3044",
+ "\u6B21\u3067\u7D42\u308F\u308B", "\u6B21\u3067\u7D42\u308F\u3089\u306A\u3044",
+ "\u6B21\u3092\u542B\u3080", "\u6B21\u3092\u542B\u307E\u306A\u3044"],
+ groupOps: [{
+ op: "AND",
+ text: "\u3059\u3079\u3066\u306E"
+ },
+ {
+ op: "OR",
+ text: "\u3044\u305A\u308C\u304B\u306E"
+ }],
+ matchText: " \u6B21\u306E",
+ rulesText: " \u6761\u4EF6\u3092\u6E80\u305F\u3059"
+ },
+ edit : {
+ addCaption: "\u30ec\u30b3\u30fc\u30c9\u8ffd\u52a0",
+ editCaption: "\u30ec\u30b3\u30fc\u30c9\u7de8\u96c6",
+ bSubmit: "\u9001\u4fe1",
+ bCancel: "\u30ad\u30e3\u30f3\u30bb\u30eb",
+ bClose: "\u9589\u3058\u308b",
+ saveData: "\u30C7\u30FC\u30BF\u304C\u5909\u66F4\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u4FDD\u5B58\u3057\u307E\u3059\u304B\uFF1F",
+ bYes: "\u306F\u3044",
+ bNo: "\u3044\u3044\u3048",
+ bExit: "\u30AD\u30E3\u30F3\u30BB\u30EB",
+ msg: {
+ required:"\u3053\u306e\u9805\u76ee\u306f\u5fc5\u9808\u3067\u3059\u3002",
+ number:"\u6b63\u3057\u3044\u6570\u5024\u3092\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002",
+ minValue:"\u6b21\u306e\u5024\u4ee5\u4e0a\u3067\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002",
+ maxValue:"\u6b21\u306e\u5024\u4ee5\u4e0b\u3067\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002",
+ email: "e-mail\u304c\u6b63\u3057\u304f\u3042\u308a\u307e\u305b\u3093\u3002",
+ integer: "\u6b63\u3057\u3044\u6574\u6570\u5024\u3092\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002",
+ date: "\u6b63\u3057\u3044\u5024\u3092\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002",
+ url: "\u306F\u6709\u52B9\u306AURL\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\20\u30D7\u30EC\u30D5\u30A3\u30C3\u30AF\u30B9\u304C\u5FC5\u8981\u3067\u3059\u3002 ('http://' \u307E\u305F\u306F 'https://')",
+ nodefined: " \u304C\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u305B\u3093",
+ novalue: " \u623B\u308A\u5024\u304C\u5FC5\u8981\u3067\u3059",
+ customarray: "\u30AB\u30B9\u30BF\u30E0\u95A2\u6570\u306F\u914D\u5217\u3092\u8FD4\u3059\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059",
+ customfcheck: "\u30AB\u30B9\u30BF\u30E0\u691C\u8A3C\u306B\u306F\u30AB\u30B9\u30BF\u30E0\u95A2\u6570\u304C\u5FC5\u8981\u3067\u3059"
+ }
+ },
+ view : {
+ caption: "\u30EC\u30B3\u30FC\u30C9\u3092\u8868\u793A",
+ bClose: "\u9589\u3058\u308B"
+ },
+ del : {
+ caption: "\u524a\u9664",
+ msg: "\u9078\u629e\u3057\u305f\u30ec\u30b3\u30fc\u30c9\u3092\u524a\u9664\u3057\u307e\u3059\u304b\uff1f",
+ bSubmit: "\u524a\u9664",
+ bCancel: "\u30ad\u30e3\u30f3\u30bb\u30eb"
+ },
+ nav : {
+ edittext: " ",
+ edittitle: "\u9078\u629e\u3057\u305f\u884c\u3092\u7de8\u96c6",
+ addtext:" ",
+ addtitle: "\u884c\u3092\u65b0\u898f\u8ffd\u52a0",
+ deltext: " ",
+ deltitle: "\u9078\u629e\u3057\u305f\u884c\u3092\u524a\u9664",
+ searchtext: " ",
+ searchtitle: "\u30ec\u30b3\u30fc\u30c9\u691c\u7d22",
+ refreshtext: "",
+ refreshtitle: "\u30b0\u30ea\u30c3\u30c9\u3092\u30ea\u30ed\u30fc\u30c9",
+ alertcap: "\u8b66\u544a",
+ alerttext: "\u884c\u3092\u9078\u629e\u3057\u3066\u4e0b\u3055\u3044\u3002",
+ viewtext: "",
+ viewtitle: "\u9078\u629E\u3057\u305F\u884C\u3092\u8868\u793A"
+ },
+ col : {
+ caption: "\u5217\u3092\u8868\u793a\uff0f\u96a0\u3059",
+ bSubmit: "\u9001\u4fe1",
+ bCancel: "\u30ad\u30e3\u30f3\u30bb\u30eb"
+ },
+ errors : {
+ errcap : "\u30a8\u30e9\u30fc",
+ nourl : "URL\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002",
+ norecords: "\u51e6\u7406\u5bfe\u8c61\u306e\u30ec\u30b3\u30fc\u30c9\u304c\u3042\u308a\u307e\u305b\u3093\u3002",
+ model : "colNames\u306e\u9577\u3055\u304ccolModel\u3068\u4e00\u81f4\u3057\u307e\u305b\u3093\u3002"
+ },
+ formatter : {
+ integer: {
+ thousandsSeparator: ",",
+ defaultValue: '0'
+ },
+ number: {
+ decimalSeparator: ".",
+ thousandsSeparator: ",",
+ decimalPlaces: 2,
+ defaultValue: '0.00'
+ },
+ currency: {
+ decimalSeparator: ".",
+ thousandsSeparator: ",",
+ decimalPlaces: 0,
+ prefix: "",
+ suffix: "",
+ defaultValue: '0'
+ },
+ date : {
+ dayNames: [
+ "\u65e5", "\u6708", "\u706b", "\u6c34", "\u6728", "\u91d1", "\u571f",
+ "\u65e5", "\u6708", "\u706b", "\u6c34", "\u6728", "\u91d1", "\u571f"
+ ],
+ monthNames: [
+ "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12",
+ "1\u6708", "2\u6708", "3\u6708", "4\u6708", "5\u6708", "6\u6708", "7\u6708", "8\u6708", "9\u6708", "10\u6708", "11\u6708", "12\u6708"
+ ],
+ AmPm : ["am","pm","AM","PM"],
+ S: function (j) { return "\u756a\u76ee"; },
+ srcformat: 'Y-m-d',
+ newformat: 'd/m/Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "n/j/Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-kr.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-kr.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-kr.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,129 @@
+;(function($){
+/**
+ * jqGrid English Translation
+ * Tony Tomov tony(a)trirand.com
+ * http://trirand.com/blog/
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "보기 {0} - {1} / {2}",
+ emptyrecords: "표시할 행이 없습니다",
+ loadtext: "조회중...",
+ pgtext : "페이지 {0} / {1}"
+ },
+ search : {
+ caption: "검색...",
+ Find: "찾기",
+ Reset: "초기화",
+ odata : ['같다', '같지 않다', '작다', '작거나 같다','크다','크거나 같다', '로 시작한다','로 시작하지 않는다','내에 있다','내에 있지 않다','로 끝난다','로 끝나지 않는다','내에 존재한다','내에 존재하지 않는다'],
+ groupOps: [ { op: "AND", text: "전부" }, { op: "OR", text: "임의" } ],
+ matchText: " 일치하다",
+ rulesText: " 적용하다"
+ },
+ edit : {
+ addCaption: "행 추가",
+ editCaption: "행 수정",
+ bSubmit: "전송",
+ bCancel: "취소",
+ bClose: "닫기",
+ saveData: "자료가 변경되었습니다! 저장하시겠습니까?",
+ bYes : "예",
+ bNo : "아니오",
+ bExit : "취소",
+ msg: {
+ required:"필수항목입니다",
+ number:"유효한 번호를 입력해 주세요",
+ minValue:"입력값은 크거나 같아야 합니다",
+ maxValue:"입력값은 작거나 같아야 합니다",
+ email: "유효하지 않은 이메일주소입니다",
+ integer: "유효한 숫자를 입력하세요",
+ date: "유효한 날짜를 입력하세요",
+ url: "은 유효하지 않은 URL입니다. 문장앞에 다음단어가 필요합니다('http://' or 'https://')",
+ nodefined : " 은 정의도지 않았습니다!",
+ novalue : " 반환값이 필요합니다!",
+ customarray : "사용자정의 함수는 배열을 반환해야 합니다!",
+ customfcheck : "Custom function should be present in case of custom checking!"
+
+ }
+ },
+ view : {
+ caption: "행 조회",
+ bClose: "닫기"
+ },
+ del : {
+ caption: "삭제",
+ msg: "선택된 행을 삭제하시겠습니까?",
+ bSubmit: "삭제",
+ bCancel: "취소"
+ },
+ nav : {
+ edittext: "",
+ edittitle: "선택된 행 편집",
+ addtext:"",
+ addtitle: "행 삽입",
+ deltext: "",
+ deltitle: "선택된 행 삭제",
+ searchtext: "",
+ searchtitle: "행 찾기",
+ refreshtext: "",
+ refreshtitle: "그리드 갱신",
+ alertcap: "경고",
+ alerttext: "행을 선택하세요",
+ viewtext: "",
+ viewtitle: "선택된 행 조회"
+ },
+ col : {
+ caption: "열을 선택하세요",
+ bSubmit: "확인",
+ bCancel: "취소"
+ },
+ errors : {
+ errcap : "오류",
+ nourl : "설정된 url이 없습니다",
+ norecords: "처리할 행이 없습니다",
+ model : "colNames의 길이가 colModel과 일치하지 않습니다!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: ",", defaultValue: '0'},
+ number : {decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 2, defaultValue: '0.00'},
+ currency : {decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
+ date : {
+ dayNames: [
+ "Sun", "Mon", "Tue", "Wed", "Thr", "Fri", "Sat",
+ "일", "월", "화", "수", "목", "금", "토"
+ ],
+ monthNames: [
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
+ "1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"
+ ],
+ AmPm : ["am","pm","AM","PM"],
+ S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
+ srcformat: 'Y-m-d',
+ newformat: 'm-d-Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "Y/j/n",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-lt.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-lt.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-lt.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,129 @@
+;(function($){
+/**
+ * jqGrid Lithuanian Translation
+ * aur1mas aur1mas(a)devnet.lt
+ * http://aur1mas.devnet.lt
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "Peržiūrima {0} - {1} iš {2}",
+ emptyrecords: "Įrašų nėra",
+ loadtext: "Kraunama...",
+ pgtext : "Puslapis {0} iš {1}"
+ },
+ search : {
+ caption: "Paieška...",
+ Find: "Ieškoti",
+ Reset: "Atstatyti",
+ odata : ['lygu', 'nelygu', 'mažiau', 'mažiau arba lygu','daugiau','daugiau arba lygu', 'prasideda','neprasideda','reikšmė yra','reikšmės nėra','baigiasi','nesibaigia','yra sudarytas','nėra sudarytas'],
+ groupOps: [ { op: "AND", text: "visi" }, { op: "OR", text: "bet kuris" } ],
+ matchText: " match",
+ rulesText: " rules"
+ },
+ edit : {
+ addCaption: "Sukurti įrašą",
+ editCaption: "Redaguoti įrašą",
+ bSubmit: "Išsaugoti",
+ bCancel: "Atšaukti",
+ bClose: "Uždaryti",
+ saveData: "Duomenys buvo pakeisti! Išsaugoti pakeitimus?",
+ bYes : "Taip",
+ bNo : "Ne",
+ bExit : "Atšaukti",
+ msg: {
+ required:"Privalomas laukas",
+ number:"Įveskite tinkamą numerį",
+ minValue:"reikšmė turi būti didesnė arba lygi ",
+ maxValue:"reikšmė turi būti mažesnė arba lygi",
+ email: "neteisingas el. pašto adresas",
+ integer: "Įveskite teisingą sveikąjį skaičių",
+ date: "Įveskite teisingą datą",
+ url: "blogas adresas. Nepamirškite pridėti ('http://' arba 'https://')",
+ nodefined : " nėra apibrėžta!",
+ novalue : " turi būti gražinama kokia nors reikšmė!",
+ customarray : "Custom f-ja turi grąžinti masyvą!",
+ customfcheck : "Custom f-ja tūrėtų būti sukurta, prieš bandant ją naudoti!"
+
+ }
+ },
+ view : {
+ caption: "Peržiūrėti įrašus",
+ bClose: "Uždaryti"
+ },
+ del : {
+ caption: "Ištrinti",
+ msg: "Ištrinti pažymėtus įrašus(-ą)?",
+ bSubmit: "Ištrinti",
+ bCancel: "Atšaukti"
+ },
+ nav : {
+ edittext: "",
+ edittitle: "Redaguoti pažymėtą eilutę",
+ addtext:"",
+ addtitle: "Pridėti naują eilutę",
+ deltext: "",
+ deltitle: "Ištrinti pažymėtą eilutę",
+ searchtext: "",
+ searchtitle: "Rasti įrašus",
+ refreshtext: "",
+ refreshtitle: "Perkrauti lentelę",
+ alertcap: "Įspėjimas",
+ alerttext: "Pasirinkite eilutę",
+ viewtext: "",
+ viewtitle: "Peržiūrėti pasirinktą eilutę"
+ },
+ col : {
+ caption: "Pasirinkti stulpelius",
+ bSubmit: "Gerai",
+ bCancel: "Atšaukti"
+ },
+ errors : {
+ errcap : "Klaida",
+ nourl : "Url reikšmė turi būti perduota",
+ norecords: "Nėra įrašų, kuriuos būtų galima apdoroti",
+ model : "colNames skaičius <> colModel skaičiui!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: "", defaultValue: '0'},
+ number : {decimalSeparator:",", thousandsSeparator: "", decimalPlaces: 2, defaultValue: '0.00'},
+ currency : {decimalSeparator:",", thousandsSeparator: "", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
+ date : {
+ dayNames: [
+ "Sek", "Pir", "Ant", "Tre", "Ket", "Pen", "Šeš",
+ "Sekmadienis", "Pirmadienis", "Antradienis", "Trečiadienis", "Ketvirtadienis", "Penktadienis", "Šeštadienis"
+ ],
+ monthNames: [
+ "Sau", "Vas", "Kov", "Bal", "Geg", "Bir", "Lie", "Rugj", "Rugs", "Spa", "Lap", "Gru",
+ "Sausis", "Vasaris", "Kovas", "Balandis", "Gegužė", "Birželis", "Liepa", "Rugpjūtis", "Rugsėjis", "Spalis", "Lapkritis", "Gruodis"
+ ],
+ AmPm : ["am","pm","AM","PM"],
+ S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
+ srcformat: 'Y-m-d',
+ newformat: 'd/m/Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "n/j/Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-mne.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-mne.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-mne.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,129 @@
+;(function($){
+/**
+ * jqGrid Montenegrian Translation
+ * Bild Studio info(a)bild-studio.net
+ * http://www.bild-studio.com
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "Pregled {0} - {1} od {2}",
+ emptyrecords: "Ne postoji nijedan zapis",
+ loadtext: "Učitivanje...",
+ pgtext : "Strana {0} od {1}"
+ },
+ search : {
+ caption: "Traženje...",
+ Find: "Traži",
+ Reset: "Resetuj",
+ odata : ['jednako', 'nije jednako', 'manje', 'manje ili jednako','veće','veće ili jednako', 'počinje sa','ne počinje sa','je u','nije u','završava sa','ne završava sa','sadrži','ne sadrži'],
+ groupOps: [ { op: "AND", text: "sva" }, { op: "OR", text: "bilo koje" } ],
+ matchText: " primjeni",
+ rulesText: " pravila"
+ },
+ edit : {
+ addCaption: "Dodaj zapis",
+ editCaption: "Izmjeni zapis",
+ bSubmit: "Pošalji",
+ bCancel: "Odustani",
+ bClose: "Zatvori",
+ saveData: "Podatak je izmjenjen! Sačuvaj izmjene?",
+ bYes : "Da",
+ bNo : "Ne",
+ bExit : "Odustani",
+ msg: {
+ required:"Polje je obavezno",
+ number:"Unesite ispravan broj",
+ minValue:"vrijednost mora biti veća od ili jednaka sa ",
+ maxValue:"vrijednost mora biti manja ili jednaka sa",
+ email: "nije ispravna email adresa, nije valjda da ne umiješ ukucati mail!?",
+ integer: "Ne zajebaji se unesi cjelobrojnu vrijednost ",
+ date: "Unesite ispravan datum",
+ url: "nije ispravan URL. Potreban je prefiks ('http://' or 'https://')",
+ nodefined : " nije definisan!",
+ novalue : " zahtjevana je povratna vrijednost!",
+ customarray : "Prilagođena funkcija treba da vrati niz!",
+ customfcheck : "Prilagođena funkcija treba da bude prisutana u slučaju prilagođene provjere!"
+
+ }
+ },
+ view : {
+ caption: "Pogledaj zapis",
+ bClose: "Zatvori"
+ },
+ del : {
+ caption: "Izbrisi",
+ msg: "Izbrisi izabran(e) zapise(e)?",
+ bSubmit: "Izbriši",
+ bCancel: "Odbaci"
+ },
+ nav : {
+ edittext: "",
+ edittitle: "Izmjeni izabrani red",
+ addtext:"",
+ addtitle: "Dodaj novi red",
+ deltext: "",
+ deltitle: "Izbriši izabran red",
+ searchtext: "",
+ searchtitle: "Nađi zapise",
+ refreshtext: "",
+ refreshtitle: "Ponovo učitaj podatke",
+ alertcap: "Upozorenje",
+ alerttext: "Izaberite red",
+ viewtext: "",
+ viewtitle: "Pogledaj izabrani red"
+ },
+ col : {
+ caption: "Izaberi kolone",
+ bSubmit: "OK",
+ bCancel: "Odbaci"
+ },
+ errors : {
+ errcap : "Greška",
+ nourl : "Nije postavljen URL",
+ norecords: "Nema zapisa za obradu",
+ model : "Dužina modela colNames <> colModel!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
+ currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
+ date : {
+ dayNames: [
+ "Ned", "Pon", "Uto", "Sre", "Čet", "Pet", "Sub",
+ "Nedelja", "Ponedeljak", "Utorak", "Srijeda", "Četvrtak", "Petak", "Subota"
+ ],
+ monthNames: [
+ "Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Avg", "Sep", "Okt", "Nov", "Dec",
+ "Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar"
+ ],
+ AmPm : ["am","pm","AM","PM"],
+ S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
+ srcformat: 'Y-m-d',
+ newformat: 'd/m/Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "n/j/Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-nl.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-nl.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-nl.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,149 @@
+(function(a) {
+a.jgrid = a.jgrid || {};
+a.extend(a.jgrid,{
+ defaults:
+ {
+ recordtext: "regels {0} - {1} van {2}",
+ emptyrecords: "Geen data gevonden.",
+ loadtext: "laden...",
+ pgtext: "pagina {0} van {1}"
+ },
+ search:
+ {
+ caption: "Zoeken...",
+ Find: "Zoek",
+ Reset: "Herstellen",
+ odata: ["gelijk aan", "niet gelijk aan", "kleiner dan", "kleiner dan of gelijk aan", "groter dan", "groter dan of gelijk aan", "begint met", "begint niet met", "is in", "is niet in", "eindigd met", "eindigd niet met", "bevat", "bevat niet"],
+ groupOps: [{ op: "AND", text: "alle" }, { op: "OR", text: "een van de"}],
+ matchText: " match",
+ rulesText: " regels"
+ },
+ edit:
+ {
+ addCaption: "Nieuw",
+ editCaption: "Bewerken",
+ bSubmit: "Opslaan",
+ bCancel: "Annuleren",
+ bClose: "Sluiten",
+ saveData: "Er is data aangepast! Wijzigingen opslaan?",
+ bYes: "Ja",
+ bNo: "Nee",
+ bExit: "Sluiten",
+ msg:
+ {
+ required: "Veld is verplicht",
+ number: "Voer a.u.b. geldig nummer in",
+ minValue: "Waarde moet groter of gelijk zijn aan ",
+ maxValue: "Waarde moet kleiner of gelijks zijn aan",
+ email: "is geen geldig e-mailadres",
+ integer: "Voer a.u.b. een geldig getal in",
+ date: "Voer a.u.b. een geldige waarde in",
+ url: "is geen geldige URL. Prefix is verplicht ('http://' or 'https://')",
+ nodefined : " is not defined!",
+ novalue : " return value is required!",
+ customarray : "Custom function should return array!",
+ customfcheck : "Custom function should be present in case of custom checking!"
+ }
+ },
+ view:
+ {
+ caption: "Tonen",
+ bClose: "Sluiten"
+ },
+ del:
+ {
+ caption: "Verwijderen",
+ msg: "Verwijder geselecteerde regel(s)?",
+ bSubmit: "Verwijderen",
+ bCancel: "Annuleren"
+ },
+ nav:
+ {
+ edittext: "",
+ edittitle: "Bewerken",
+ addtext: "",
+ addtitle: "Nieuw",
+ deltext: "",
+ deltitle: "Verwijderen",
+ searchtext: "",
+ searchtitle: "Zoeken",
+ refreshtext: "",
+ refreshtitle: "Vernieuwen",
+ alertcap: "Waarschuwing",
+ alerttext: "Selecteer a.u.b. een regel",
+ viewtext: "",
+ viewtitle: "Openen"
+ },
+ col:
+ {
+ caption: "Tonen/verbergen kolommen",
+ bSubmit: "OK",
+ bCancel: "Annuleren"
+ },
+ errors:
+ {
+ errcap: "Fout",
+ nourl: "Er is geen URL gedefinieerd",
+ norecords: "Geen data om te verwerken",
+ model: "Lengte van 'colNames' is niet gelijk aan 'colModel'!"
+ },
+ formatter:
+ {
+ integer:
+ {
+ thousandsSeparator: ".",
+ defaultValue: "0"
+ },
+ number:
+ {
+ decimalSeparator: ",",
+ thousandsSeparator: ".",
+ decimalPlaces: 2,
+ defaultValue: "0.00"
+ },
+ currency:
+ {
+ decimalSeparator: ",",
+ thousandsSeparator: ".",
+ decimalPlaces: 2,
+ prefix: "EUR ",
+ suffix: "",
+ defaultValue: "0.00"
+ },
+ date:
+ {
+ dayNames: ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za", "Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag"],
+ monthNames: ["Jan", "Feb", "Maa", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "October", "November", "December"],
+ AmPm: ["am", "pm", "AM", "PM"],
+ S: function(b) {
+ return b < 11 || b > 13 ? ["st", "nd", "rd", "th"][Math.min((b - 1) % 10, 3)] : "th"
+ },
+ srcformat: "Y-m-d",
+ newformat: "d/m/Y",
+ masks:
+ {
+ ISO8601Long: "Y-m-d H:i:s",
+ ISO8601Short: "Y-m-d",
+ ShortDate: "n/j/Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l d F Y G:i:s",
+ MonthDay: "d F",
+ ShortTime: "G:i",
+ LongTime: "G:i:s",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit: false
+ },
+ baseLinkUrl: "",
+ showAction: "",
+ target: "",
+ checkbox:
+ {
+ disabled: true
+ },
+ idName: "id"
+ }
+ });
+})(jQuery);
\ No newline at end of file
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-no.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-no.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-no.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1 @@
+(function(a){a.jgrid= a.jgrid || {};a.jgrid.defaults={recordtext:"Rad {0} - {1}, totalt {2}",loadtext:"Laster...",pgtext:"Side {0} av {1}"};a.jgrid.search={caption:"S�k...",Find:"Finn",Reset:"Nullstill",odata:["lik","forskjellig fra","mindre enn","mindre eller lik","st�rre enn"," st�rre eller lik","starter med","slutter med","inneholder"]};a.jgrid.edit={addCaption:"Ny rad",editCaption:"Rediger",bSubmit:"Send",bCancel:"Avbryt",bClose:"Lukk",processData:"Laster...",msg:{required:"Felt er obligatorisk",number:"Legg inn et gyldig tall",minValue:"verdi m� v�re st�rre enn eller lik",maxValue:"verdi m� v�re mindre enn eller lik",email:"er ikke en gyldig e-post adresse",integer:"Legg inn et gyldig heltall",date:"Legg inn en gyldig dato",url:"er ikke en gyldig URL. Prefiks p�krevd ('http://' eller 'https://')",nodefined:" er ikke definert!",novalue:" returverdi er p�krevd!",customarray:"Tilpasset funksjon m� returnere en tabell!",customfcheck:"Tilpasset funksjon m� eksistere!"}};a.jgrid.view={caption:"�pne post",bClose:"Lukk"};a.jgrid.del={caption:"Slett",msg:"Slett valgte rad(er)?",bSubmit:"Slett",bCancel:"Avbryt",processData:"Behandler..."};a.jgrid.nav={edittext:" ",edittitle:"Rediger valgte rad(er)",addtext:" ",addtitle:"Legg til ny rad",deltext:" ",deltitle:"Slett valgte rad(er)",searchtext:" ",searchtitle:"S�k",refreshtext:"",refreshtitle:"Oppdater tabell",alertcap:"Advarsel",alerttext:"Velg rad",viewtext:" ",viewtitle:"�pne valgt rad"};a.jgrid.col={caption:"Vis/skjul kolonner",bSubmit:"Utf�r",bCancel:"Avbryt"};a.jgrid.errors={errcap:"Feil",nourl:"Ingen url er satt",norecords:"Ingen poster � behandle",model:"colNames og colModel har forskjellig lengde!"};a.jgrid.formatter={integer:{thousandsSeparator:" ",defaulValue:0},number:{decimalSeparator:",",thousandsSeparator:" ",decimalPlaces:2,defaulValue:0},currency:{decimalSeparator:",",thousandsSeparator:" ",decimalPlaces:2,prefix:"",suffix:"",defaulValue:0},date:{dayNames:["s�.","ma.","ti.","on.","to.","fr.","l�.","S�ndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","L�rdag"],monthNames:["jan.","feb.","mars","april","mai","juni","juli","aug.","sep.","okt.","nov.","des.","januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"],AmPm:["","","",""],S:function(b){return"."},srcformat:"Y-m-d H:i:s",newformat:"Y-m-d H:i:s",masks:{ISO8601Long:"Y-m-d H:i:s",ISO8601Short:"Y-m-d",ShortDate:"j.n.Y",LongDate:"l j. F Y",FullDateTime:"l j. F Y kl. G.i.s",MonthDay:"j. F",ShortTime:"H:i",LongTime:"H:i:s",SortableDateTime:"Y-m-d\\TH:i:s",UniversalSortableDateTime:"Y-m-d H:i:sO",YearMonth:"F Y"},reformatAfterEdit:false},baseLinkUrl:"",showAction:"show",addParam:"",checkbox:{disabled:true}}})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-pl.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-pl.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-pl.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,133 @@
+;(function($){
+/**
+ * jqGrid Polish Translation
+ * Łukasz Schab lukasz(a)freetree.pl
+ * http://FreeTree.pl
+ *
+ * Updated names, abbreviations, currency and date/time formats for Polish norms (also corresponding with CLDR v21.0.1 --> http://cldr.unicode.org/index)
+ * Tomasz Pęczek tpeczek(a)gmail.com
+ * http://tpeczek.blogspot.com; http://tpeczek.codeplex.com
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "Pokaż {0} - {1} z {2}",
+ emptyrecords: "Brak rekordów do pokazania",
+ loadtext: "Ładowanie...",
+ pgtext : "Strona {0} z {1}"
+ },
+ search : {
+ caption: "Wyszukiwanie...",
+ Find: "Szukaj",
+ Reset: "Czyść",
+ odata : ['dokładnie', 'różne od', 'mniejsze od', 'mniejsze lub równe', 'większe od', 'większe lub równe', 'zaczyna się od', 'nie zaczyna się od', 'jest w', 'nie jest w', 'kończy się na', 'nie kończy się na', 'zawiera', 'nie zawiera'],
+ groupOps: [ { op: "AND", text: "oraz" }, { op: "OR", text: "lub" } ],
+ matchText: " pasuje",
+ rulesText: " reguły"
+ },
+ edit : {
+ addCaption: "Dodaj rekord",
+ editCaption: "Edytuj rekord",
+ bSubmit: "Zapisz",
+ bCancel: "Anuluj",
+ bClose: "Zamknij",
+ saveData: "Dane zostały zmienione! Zapisać zmiany?",
+ bYes: "Tak",
+ bNo: "Nie",
+ bExit: "Anuluj",
+ msg: {
+ required: "Pole jest wymagane",
+ number: "Proszę wpisać poprawną liczbę",
+ minValue: "wartość musi być większa lub równa od",
+ maxValue: "wartość musi być mniejsza lub równa od",
+ email: "nie jest poprawnym adresem e-mail",
+ integer: "Proszę wpisać poprawną liczbę",
+ date: "Proszę podaj poprawną datę",
+ url: "jest niewłaściwym adresem URL. Pamiętaj o prefiksie ('http://' lub 'https://')",
+ nodefined: " niezdefiniowane!",
+ novalue: " wymagana jest wartość zwracana!",
+ customarray: "Funkcja niestandardowa powinna zwracać tablicę!",
+ customfcheck: "Funkcja niestandardowa powinna być obecna w przypadku niestandardowego sprawdzania!"
+ }
+ },
+ view : {
+ caption: "Pokaż rekord",
+ bClose: "Zamknij"
+ },
+ del : {
+ caption: "Usuń",
+ msg: "Czy usunąć wybrany rekord(y)?",
+ bSubmit: "Usuń",
+ bCancel: "Anuluj"
+ },
+ nav : {
+ edittext: "",
+ edittitle: "Edytuj wybrany wiersz",
+ addtext: "",
+ addtitle: "Dodaj nowy wiersz",
+ deltext: "",
+ deltitle: "Usuń wybrany wiersz",
+ searchtext: "",
+ searchtitle: "Wyszukaj rekord",
+ refreshtext: "",
+ refreshtitle: "Przeładuj",
+ alertcap: "Uwaga",
+ alerttext: "Proszę wybrać wiersz",
+ viewtext: "",
+ viewtitle: "Pokaż wybrany wiersz"
+ },
+ col : {
+ caption: "Pokaż/Ukryj kolumny",
+ bSubmit: "Zatwierdź",
+ bCancel: "Anuluj"
+ },
+ errors : {
+ errcap: "Błąd",
+ nourl: "Brak adresu url",
+ norecords: "Brak danych",
+ model : "Długość colNames <> colModel!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0,00'},
+ currency : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:" zł", defaultValue: '0,00'},
+ date : {
+ dayNames: [
+ "niedz.", "pon.", "wt.", "śr.", "czw.", "pt.", "sob.",
+ "niedziela", "poniedziałek", "wtorek", "środa", "czwartek", "piątek", "sobota"
+ ],
+ monthNames: [
+ "sty", "lut", "mar", "kwi", "maj", "cze", "lip", "sie", "wrz", "paź", "lis", "gru",
+ "styczeń", "luty", "marzec", "kwiecień", "maj", "czerwiec", "lipiec", "sierpień", "wrzesień", "październik", "listopad", "grudzień"
+ ],
+ AmPm : ["","","",""],
+ S: function (j) {return '';},
+ srcformat: 'Y-m-d',
+ newformat: 'd.m.Y',
+ masks : {
+ ISO8601Long: "Y-m-d H:i:s",
+ ISO8601Short: "Y-m-d",
+ ShortDate: "d.m.y",
+ LongDate: "l, j F Y",
+ FullDateTime: "l, j F Y H:i:s",
+ MonthDay: "j F",
+ ShortTime: "H:i",
+ LongTime: "H:i:s",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
\ No newline at end of file
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-pt-br.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-pt-br.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-pt-br.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,131 @@
+;(function($){
+/**
+ * jqGrid Brazilian-Portuguese Translation
+ * Sergio Righi sergio.righi(a)gmail.com
+ * http://curve.com.br
+ *
+ * Updated by Jonnas Fonini
+ * http://fonini.net
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "Ver {0} - {1} de {2}",
+ emptyrecords: "Nenhum registro para visualizar",
+ loadtext: "Carregando...",
+ pgtext : "Página {0} de {1}"
+ },
+ search : {
+ caption: "Procurar...",
+ Find: "Procurar",
+ Reset: "Resetar",
+ odata : ['igual', 'diferente', 'menor', 'menor ou igual','maior','maior ou igual', 'inicia com','não inicia com','está em','não está em','termina com','não termina com','contém','não contém','nulo','não nulo'],
+ groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" } ],
+ matchText: " igual a",
+ rulesText: " regras"
+ },
+ edit : {
+ addCaption: "Incluir",
+ editCaption: "Alterar",
+ bSubmit: "Enviar",
+ bCancel: "Cancelar",
+ bClose: "Fechar",
+ saveData: "Os dados foram alterados! Salvar alterações?",
+ bYes : "Sim",
+ bNo : "Não",
+ bExit : "Cancelar",
+ msg: {
+ required:"Campo obrigatório",
+ number:"Por favor, informe um número válido",
+ minValue:"valor deve ser igual ou maior que ",
+ maxValue:"valor deve ser menor ou igual a",
+ email: "este e-mail não é válido",
+ integer: "Por favor, informe um valor inteiro",
+ date: "Por favor, informe uma data válida",
+ url: "não é uma URL válida. Prefixo obrigatório ('http://' or 'https://')",
+ nodefined : " não está definido!",
+ novalue : " um valor de retorno é obrigatório!",
+ customarray : "Função customizada deve retornar um array!",
+ customfcheck : "Função customizada deve estar presente em caso de validação customizada!"
+ }
+ },
+ view : {
+ caption: "Ver Registro",
+ bClose: "Fechar"
+ },
+ del : {
+ caption: "Apagar",
+ msg: "Apagar registro(s) selecionado(s)?",
+ bSubmit: "Apagar",
+ bCancel: "Cancelar"
+ },
+ nav : {
+ edittext: " ",
+ edittitle: "Alterar registro selecionado",
+ addtext:" ",
+ addtitle: "Incluir novo registro",
+ deltext: " ",
+ deltitle: "Apagar registro selecionado",
+ searchtext: " ",
+ searchtitle: "Procurar registros",
+ refreshtext: "",
+ refreshtitle: "Recarregando tabela",
+ alertcap: "Aviso",
+ alerttext: "Por favor, selecione um registro",
+ viewtext: "",
+ viewtitle: "Ver linha selecionada"
+ },
+ col : {
+ caption: "Mostrar/Esconder Colunas",
+ bSubmit: "Enviar",
+ bCancel: "Cancelar"
+ },
+ errors : {
+ errcap : "Erro",
+ nourl : "Nenhuma URL definida",
+ norecords: "Sem registros para exibir",
+ model : "Comprimento de colNames <> colModel!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0,00'},
+ currency : {decimalSeparator:",", thousandsSeparator: ".", decimalPlaces: 2, prefix: "R$ ", suffix:"", defaultValue: '0,00'},
+ date : {
+ dayNames: [
+ "Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb",
+ "Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"
+ ],
+ monthNames: [
+ "Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez",
+ "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"
+ ],
+ AmPm : ["am","pm","AM","PM"],
+ S: function (j) {return j < 11 || j > 13 ? ['º', 'º', 'º', 'º'][Math.min((j - 1) % 10, 3)] : 'º'},
+ srcformat: 'Y-m-d',
+ newformat: 'd/m/Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "n/j/Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-pt.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-pt.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-pt.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,126 @@
+;(function($){
+/**
+ * jqGrid Portuguese Translation
+* Tradu��o da jqGrid em Portugues por Frederico Carvalho, http://www.eyeviewdesign.pt
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "View {0} - {1} of {2}",
+ emptyrecords: "No records to view",
+ loadtext: "A carregar...",
+ pgtext : "Page {0} of {1}"
+ },
+ search : {
+ caption: "Busca...",
+ Find: "Procurar",
+ Reset: "Limpar",
+ odata : ['equal', 'not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain'],
+ groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" } ],
+ matchText: " match",
+ rulesText: " rules"
+ },
+ edit : {
+ addCaption: "Adicionar Registo",
+ editCaption: "Modificar Registo",
+ bSubmit: "Submeter",
+ bCancel: "Cancelar",
+ bClose: "Fechar",
+ saveData: "Data has been changed! Save changes?",
+ bYes : "Yes",
+ bNo : "No",
+ bExit : "Cancel",
+ msg: {
+ required:"Campo obrigat�rio",
+ number:"Por favor, introduza um numero",
+ minValue:"O valor deve ser maior ou igual que",
+ maxValue:"O valor deve ser menor ou igual a",
+ email: "N�o � um endere�o de email v�lido",
+ integer: "Por favor, introduza um numero inteiro",
+ url: "is not a valid URL. Prefix required ('http://' or 'https://')",
+ nodefined : " is not defined!",
+ novalue : " return value is required!",
+ customarray : "Custom function should return array!",
+ customfcheck : "Custom function should be present in case of custom checking!"
+ }
+ },
+ view : {
+ caption: "View Record",
+ bClose: "Close"
+ },
+ del : {
+ caption: "Eliminar",
+ msg: "Deseja eliminar o(s) registo(s) seleccionado(s)?",
+ bSubmit: "Eliminar",
+ bCancel: "Cancelar"
+ },
+ nav : {
+ edittext: " ",
+ edittitle: "Modificar registo seleccionado",
+ addtext:" ",
+ addtitle: "Adicionar novo registo",
+ deltext: " ",
+ deltitle: "Eliminar registo seleccionado",
+ searchtext: " ",
+ searchtitle: "Procurar",
+ refreshtext: "",
+ refreshtitle: "Actualizar",
+ alertcap: "Aviso",
+ alerttext: "Por favor, seleccione um registo",
+ viewtext: "",
+ viewtitle: "View selected row"
+ },
+ col : {
+ caption: "Mostrar/Ocultar Colunas",
+ bSubmit: "Enviar",
+ bCancel: "Cancelar"
+ },
+ errors : {
+ errcap : "Erro",
+ nourl : "N�o especificou um url",
+ norecords: "N�o existem dados para processar",
+ model : "Tamanho do colNames <> colModel!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
+ currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
+ date : {
+ dayNames: [
+ "Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab",
+ "Domingo", "Segunda-Feira", "Ter�a-Feira", "Quarta-Feira", "Quinta-Feira", "Sexta-Feira", "S�bado"
+ ],
+ monthNames: [
+ "Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez",
+ "Janeiro", "Fevereiro", "Mar�o", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"
+ ],
+ AmPm : ["am","pm","AM","PM"],
+ S: function (j) {return j < 11 || j > 13 ? ['�', '�', '�', '�'][Math.min((j - 1) % 10, 3)] : '�'},
+ srcformat: 'Y-m-d',
+ newformat: 'd/m/Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "n/j/Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ro.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ro.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ro.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,140 @@
+;(function($){
+/**
+ * jqGrid Romanian Translation
+ * Alexandru Emil Lupu contact(a)alecslupu.ro
+ * http://www.alecslupu.ro/
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "Vizualizare {0} - {1} din {2}",
+ emptyrecords: "Nu există înregistrări de vizualizat",
+ loadtext: "Încărcare...",
+ pgtext : "Pagina {0} din {1}"
+ },
+ search : {
+ caption: "Caută...",
+ Find: "Caută",
+ Reset: "Resetare",
+ odata : ['egal', 'diferit', 'mai mic', 'mai mic sau egal','mai mare','mai mare sau egal', 'începe cu','nu începe cu','se găsește în','nu se găsește în','se termină cu','nu se termină cu','conține',''],
+ groupOps: [ { op: "AND", text: "toate" }, { op: "OR", text: "oricare" } ],
+ matchText: " găsite",
+ rulesText: " reguli"
+ },
+ edit : {
+ addCaption: "Adăugare înregistrare",
+ editCaption: "Modificare înregistrare",
+ bSubmit: "Salvează",
+ bCancel: "Anulare",
+ bClose: "Închide",
+ saveData: "Informațiile au fost modificate! Salvați modificările?",
+ bYes : "Da",
+ bNo : "Nu",
+ bExit : "Anulare",
+ msg: {
+ required:"Câmpul este obligatoriu",
+ number:"Vă rugăm introduceți un număr valid",
+ minValue:"valoarea trebuie sa fie mai mare sau egală cu",
+ maxValue:"valoarea trebuie sa fie mai mică sau egală cu",
+ email: "nu este o adresă de e-mail validă",
+ integer: "Vă rugăm introduceți un număr valid",
+ date: "Vă rugăm să introduceți o dată validă",
+ url: "Nu este un URL valid. Prefixul este necesar('http://' or 'https://')",
+ nodefined : " is not defined!",
+ novalue : " return value is required!",
+ customarray : "Custom function should return array!",
+ customfcheck : "Custom function should be present in case of custom checking!"
+ }
+ },
+ view : {
+ caption: "Vizualizare înregistrare",
+ bClose: "Închidere"
+ },
+ del : {
+ caption: "Ștegere",
+ msg: "Ștergeți înregistrarea (înregistrările) selectate?",
+ bSubmit: "Șterge",
+ bCancel: "Anulare"
+ },
+ nav : {
+ edittext: "",
+ edittitle: "Modifică rândul selectat",
+ addtext:"",
+ addtitle: "Adaugă rând nou",
+ deltext: "",
+ deltitle: "Șterge rândul selectat",
+ searchtext: "",
+ searchtitle: "Căutare înregistrări",
+ refreshtext: "",
+ refreshtitle: "Reîncarcare Grid",
+ alertcap: "Avertisment",
+ alerttext: "Vă rugăm să selectați un rând",
+ viewtext: "",
+ viewtitle: "Vizualizează rândul selectat"
+ },
+ col : {
+ caption: "Arată/Ascunde coloanele",
+ bSubmit: "Salvează",
+ bCancel: "Anulare"
+ },
+ errors : {
+ errcap : "Eroare",
+ nourl : "Niciun url nu este setat",
+ norecords: "Nu sunt înregistrări de procesat",
+ model : "Lungimea colNames <> colModel!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0,00'},
+ currency : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0,00'},
+ date : {
+ dayNames: [
+ "Dum", "Lun", "Mar", "Mie", "Joi", "Vin", "Sâm",
+ "Duminică", "Luni", "Marți", "Miercuri", "Joi", "Vineri", "Sâmbătă"
+ ],
+ monthNames: [
+ "Ian", "Feb", "Mar", "Apr", "Mai", "Iun", "Iul", "Aug", "Sep", "Oct", "Noi", "Dec",
+ "Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie"
+ ],
+ AmPm : ["am","pm","AM","PM"],
+ /*
+ Here is a problem in romanian:
+ M / F
+ 1st = primul / prima
+ 2nd = Al doilea / A doua
+ 3rd = Al treilea / A treia
+ 4th = Al patrulea/ A patra
+ 5th = Al cincilea / A cincea
+ 6th = Al șaselea / A șasea
+ 7th = Al șaptelea / A șaptea
+ ....
+ */
+ S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
+ srcformat: 'Y-m-d',
+ newformat: 'd/m/Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "n/j/Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ru.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ru.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ru.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,128 @@
+;(function($){
+/**
+ * jqGrid Russian Translation v1.0 02.07.2009 (based on translation by Alexey Kanaev v1.1 21.01.2009, http://softcore.com.ru)
+ * Sergey Dyagovchenko
+ * http://d.sumy.ua
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "Просмотр {0} - {1} из {2}",
+ emptyrecords: "Нет записей для просмотра",
+ loadtext: "Загрузка...",
+ pgtext : "Стр. {0} из {1}"
+ },
+ search : {
+ caption: "Поиск...",
+ Find: "Найти",
+ Reset: "Сброс",
+ odata : ['равно', 'не равно', 'меньше', 'меньше или равно','больше','больше или равно', 'начинается с','не начинается с','находится в','не находится в','заканчивается на','не заканчивается на','содержит','не содержит'],
+ groupOps: [ { op: "AND", text: "все" }, { op: "OR", text: "любой" } ],
+ matchText: " совпадает",
+ rulesText: " правила"
+ },
+ edit : {
+ addCaption: "Добавить запись",
+ editCaption: "Редактировать запись",
+ bSubmit: "Сохранить",
+ bCancel: "Отмена",
+ bClose: "Закрыть",
+ saveData: "Данные были измененны! Сохранить изменения?",
+ bYes : "Да",
+ bNo : "Нет",
+ bExit : "Отмена",
+ msg: {
+ required:"Поле является обязательным",
+ number:"Пожалуйста, введите правильное число",
+ minValue:"значение должно быть больше либо равно",
+ maxValue:"значение должно быть меньше либо равно",
+ email: "некорректное значение e-mail",
+ integer: "Пожалуйста, введите целое число",
+ date: "Пожалуйста, введите правильную дату",
+ url: "неверная ссылка. Необходимо ввести префикс ('http://' or 'https://')",
+ nodefined : " is not defined!",
+ novalue : " return value is required!",
+ customarray : "Custom function should return array!",
+ customfcheck : "Custom function should be present in case of custom checking!"
+ }
+ },
+ view : {
+ caption: "Просмотр записи",
+ bClose: "Закрыть"
+ },
+ del : {
+ caption: "Удалить",
+ msg: "Удалить выбранную запись(и)?",
+ bSubmit: "Удалить",
+ bCancel: "Отмена"
+ },
+ nav : {
+ edittext: " ",
+ edittitle: "Редактировать выбранную запись",
+ addtext:" ",
+ addtitle: "Добавить новую запись",
+ deltext: " ",
+ deltitle: "Удалить выбранную запись",
+ searchtext: " ",
+ searchtitle: "Найти записи",
+ refreshtext: "",
+ refreshtitle: "Обновить таблицу",
+ alertcap: "Внимание",
+ alerttext: "Пожалуйста, выберите запись",
+ viewtext: "",
+ viewtitle: "Просмотреть выбранную запись"
+ },
+ col : {
+ caption: "Показать/скрыть столбцы",
+ bSubmit: "Сохранить",
+ bCancel: "Отмена"
+ },
+ errors : {
+ errcap : "Ошибка",
+ nourl : "URL не установлен",
+ norecords: "Нет записей для обработки",
+ model : "Число полей не соответствует числу столбцов таблицы!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0,00'},
+ currency : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0,00'},
+ date : {
+ dayNames: [
+ "Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб",
+ "Воскресение", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота"
+ ],
+ monthNames: [
+ "Янв", "Фев", "Мар", "Апр", "Май", "Июн", "Июл", "Авг", "Сен", "Окт", "Ноя", "Дек",
+ "Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"
+ ],
+ AmPm : ["am","pm","AM","PM"],
+ S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
+ srcformat: 'Y-m-d',
+ newformat: 'd.m.Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "n.j.Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y G:i:s",
+ MonthDay: "F d",
+ ShortTime: "G:i",
+ LongTime: "G:i:s",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sk.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sk.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sk.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,128 @@
+;(function($){
+/**
+ * jqGrid Slovak Translation
+ * Milan Cibulka
+ * http://trirand.com/blog/
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "Zobrazených {0} - {1} z {2} záznamov",
+ emptyrecords: "Neboli nájdené žiadne záznamy",
+ loadtext: "Načítám...",
+ pgtext : "Strana {0} z {1}"
+ },
+ search : {
+ caption: "Vyhľadávam...",
+ Find: "Hľadať",
+ Reset: "Reset",
+ odata : ['rovná sa', 'nerovná sa', 'menšie', 'menšie alebo rovnajúce sa','väčšie', 'väčšie alebo rovnajúce sa', 'začína s', 'nezačína s', 'je v', 'nie je v', 'končí s', 'nekončí s', 'obahuje', 'neobsahuje'],
+ groupOps: [ { op: "AND", text: "všetkých" }, { op: "OR", text: "niektorého z" } ],
+ matchText: " hľadať podla",
+ rulesText: " pravidiel"
+ },
+ edit : {
+ addCaption: "Pridať záznam",
+ editCaption: "Editácia záznamov",
+ bSubmit: "Uložiť",
+ bCancel: "Storno",
+ bClose: "Zavrieť",
+ saveData: "Údaje boli zmenené! Uložiť zmeny?",
+ bYes : "Ano",
+ bNo : "Nie",
+ bExit : "Zrušiť",
+ msg: {
+ required:"Pole je požadované",
+ number:"Prosím, vložte valídne číslo",
+ minValue:"hodnota musí býť väčšia ako alebo rovná ",
+ maxValue:"hodnota musí býť menšia ako alebo rovná ",
+ email: "nie je valídny e-mail",
+ integer: "Prosím, vložte celé číslo",
+ date: "Prosím, vložte valídny dátum",
+ url: "nie je platnou URL. Požadovaný prefix ('http://' alebo 'https://')",
+ nodefined : " nie je definovaný!",
+ novalue : " je vyžadovaná návratová hodnota!",
+ customarray : "Custom function mala vrátiť pole!",
+ customfcheck : "Custom function by mala byť prítomná v prípade custom checking!"
+ }
+ },
+ view : {
+ caption: "Zobraziť záznam",
+ bClose: "Zavrieť"
+ },
+ del : {
+ caption: "Zmazať",
+ msg: "Zmazať vybraný(é) záznam(y)?",
+ bSubmit: "Zmazať",
+ bCancel: "Storno"
+ },
+ nav : {
+ edittext: " ",
+ edittitle: "Editovať vybraný riadok",
+ addtext:" ",
+ addtitle: "Pridať nový riadek",
+ deltext: " ",
+ deltitle: "Zmazať vybraný záznam ",
+ searchtext: " ",
+ searchtitle: "Nájsť záznamy",
+ refreshtext: "",
+ refreshtitle: "Obnoviť tabuľku",
+ alertcap: "Varovanie",
+ alerttext: "Prosím, vyberte riadok",
+ viewtext: "",
+ viewtitle: "Zobraziť vybraný riadok"
+ },
+ col : {
+ caption: "Zobrazit/Skrýť stĺpce",
+ bSubmit: "Uložiť",
+ bCancel: "Storno"
+ },
+ errors : {
+ errcap : "Chyba",
+ nourl : "Nie je nastavená url",
+ norecords: "Žiadne záznamy k spracovaniu",
+ model : "Dĺžka colNames <> colModel!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
+ currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
+ date : {
+ dayNames: [
+ "Ne", "Po", "Ut", "St", "Št", "Pi", "So",
+ "Nedela", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatek", "Sobota"
+ ],
+ monthNames: [
+ "Jan", "Feb", "Mar", "Apr", "Máj", "Jún", "Júl", "Aug", "Sep", "Okt", "Nov", "Dec",
+ "Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"
+ ],
+ AmPm : ["do","od","DO","OD"],
+ S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
+ srcformat: 'Y-m-d',
+ newformat: 'd/m/Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "n/j/Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sr-latin.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sr-latin.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sr-latin.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,129 @@
+;(function($){
+/**
+ * jqGrid Serbian latin Translation
+ * Bild Studio info(a)bild-studio.net
+ * http://www.bild-studio.com
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "Pregled {0} - {1} od {2}",
+ emptyrecords: "Ne postoji nijedan zapis",
+ loadtext: "Učitivanje...",
+ pgtext : "Strana {0} od {1}"
+ },
+ search : {
+ caption: "Traženje...",
+ Find: "Traži",
+ Reset: "Resetuj",
+ odata : ['jednako', 'nije jednako', 'manje', 'manje ili jednako','veće','veće ili jednako', 'počinje sa','ne počinje sa','je u','nije u','završava sa','ne završava sa','sadrži','ne sadrži'],
+ groupOps: [ { op: "AND", text: "sva" }, { op: "OR", text: "bilo koje" } ],
+ matchText: " primeni",
+ rulesText: " pravila"
+ },
+ edit : {
+ addCaption: "Dodaj zapis",
+ editCaption: "Izmeni zapis",
+ bSubmit: "Pošalji",
+ bCancel: "Odustani",
+ bClose: "Zatvori",
+ saveData: "Podatak je izmenjen! Sačuvaj izmene?",
+ bYes : "Da",
+ bNo : "Ne",
+ bExit : "Odustani",
+ msg: {
+ required: "Polje je obavezno",
+ number: "Unesite ispravan broj",
+ minValue: "vrednost mora biti veća od ili jednaka sa ",
+ maxValue: "vrednost mora biti manja ili jednaka sa",
+ email: "nije ispravna email adresa, nije valjda da ne umeš ukucati mail!?",
+ integer: "Unesi celobrojnu vrednost ",
+ date: "Unesite ispravan datum",
+ url: "nije ispravan URL. Potreban je prefiks ('http://' or 'https://')",
+ nodefined : " nije definisan!",
+ novalue : " zahtevana je povratna vrednost!",
+ customarray : "Prilagođena funkcija treba da vrati niz!",
+ customfcheck : "Prilagođena funkcija treba da bude prisutana u slučaju prilagođene provere!"
+
+ }
+ },
+ view : {
+ caption: "Pogledaj zapis",
+ bClose: "Zatvori"
+ },
+ del : {
+ caption: "Izbrisi",
+ msg: "Izbrisi izabran(e) zapise(e)?",
+ bSubmit: "Izbriši",
+ bCancel: "Odbaci"
+ },
+ nav : {
+ edittext: "",
+ edittitle: "Izmeni izabrani red",
+ addtext:"",
+ addtitle: "Dodaj novi red",
+ deltext: "",
+ deltitle: "Izbriši izabran red",
+ searchtext: "",
+ searchtitle: "Nađi zapise",
+ refreshtext: "",
+ refreshtitle: "Ponovo učitaj podatke",
+ alertcap: "Upozorenje",
+ alerttext: "Izaberite red",
+ viewtext: "",
+ viewtitle: "Pogledaj izabrani red"
+ },
+ col : {
+ caption: "Izaberi kolone",
+ bSubmit: "OK",
+ bCancel: "Odbaci"
+ },
+ errors : {
+ errcap : "Greška",
+ nourl : "Nije postavljen URL",
+ norecords: "Nema zapisa za obradu",
+ model : "Dužina modela colNames <> colModel!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
+ currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
+ date : {
+ dayNames: [
+ "Ned", "Pon", "Uto", "Sre", "Čet", "Pet", "Sub",
+ "Nedelja", "Ponedeljak", "Utorak", "Srijeda", "Četvrtak", "Petak", "Subota"
+ ],
+ monthNames: [
+ "Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Avg", "Sep", "Okt", "Nov", "Dec",
+ "Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar"
+ ],
+ AmPm : ["am","pm","AM","PM"],
+ S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
+ srcformat: 'Y-m-d',
+ newformat: 'd/m/Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "n/j/Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sr.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sr.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sr.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,129 @@
+;(function($){
+/**
+ * jqGrid Serbian Translation
+ * Александар Миловац(Aleksandar Milovac) aleksandar.milovac(a)gmail.com
+ * http://trirand.com/blog/
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "Преглед {0} - {1} од {2}",
+ emptyrecords: "Не постоји ниједан запис",
+ loadtext: "Учитавање...",
+ pgtext : "Страна {0} од {1}"
+ },
+ search : {
+ caption: "Тражење...",
+ Find: "Тражи",
+ Reset: "Ресетуј",
+ odata : ['једнако', 'није једнако', 'мање', 'мање или једнако','веће','веће или једнако', 'почиње са','не почиње са','је у','није у','завршава са','не завршава са','садржи','не садржи'],
+ groupOps: [ { op: "И", text: "сви" }, { op: "ИЛИ", text: "сваки" } ],
+ matchText: " match",
+ rulesText: " правила"
+ },
+ edit : {
+ addCaption: "Додај запис",
+ editCaption: "Измени запис",
+ bSubmit: "Пошаљи",
+ bCancel: "Одустани",
+ bClose: "Затвори",
+ saveData: "Податак је измењен! Сачувај измене?",
+ bYes : "Да",
+ bNo : "Не",
+ bExit : "Одустани",
+ msg: {
+ required:"Поље је обавезно",
+ number:"Молим, унесите исправан број",
+ minValue:"вредност мора бити већа од или једнака са ",
+ maxValue:"вредност мора бити мања од или једнака са",
+ email: "није исправна имејл адреса",
+ integer: "Молим, унесите исправну целобројну вредност ",
+ date: "Молим, унесите исправан датум",
+ url: "није исправан УРЛ. Потребан је префикс ('http://' or 'https://')",
+ nodefined : " није дефинисан!",
+ novalue : " захтевана је повратна вредност!",
+ customarray : "Custom function should return array!",
+ customfcheck : "Custom function should be present in case of custom checking!"
+
+ }
+ },
+ view : {
+ caption: "Погледај запис",
+ bClose: "Затвори"
+ },
+ del : {
+ caption: "Избриши",
+ msg: "Избриши изабран(е) запис(е)?",
+ bSubmit: "Ибриши",
+ bCancel: "Одбаци"
+ },
+ nav : {
+ edittext: "",
+ edittitle: "Измени изабрани ред",
+ addtext:"",
+ addtitle: "Додај нови ред",
+ deltext: "",
+ deltitle: "Избриши изабран ред",
+ searchtext: "",
+ searchtitle: "Нађи записе",
+ refreshtext: "",
+ refreshtitle: "Поново учитај податке",
+ alertcap: "Упозорење",
+ alerttext: "Молим, изаберите ред",
+ viewtext: "",
+ viewtitle: "Погледај изабрани ред"
+ },
+ col : {
+ caption: "Изабери колоне",
+ bSubmit: "ОК",
+ bCancel: "Одбаци"
+ },
+ errors : {
+ errcap : "Грешка",
+ nourl : "Није постављен URL",
+ norecords: "Нема записа за обраду",
+ model : "Дужина модела colNames <> colModel!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
+ currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
+ date : {
+ dayNames: [
+ "Нед", "Пон", "Уто", "Сре", "Чет", "Пет", "Суб",
+ "Недеља", "Понедељак", "Уторак", "Среда", "Четвртак", "Петак", "Субота"
+ ],
+ monthNames: [
+ "Јан", "Феб", "Мар", "Апр", "Мај", "Јун", "Јул", "Авг", "Сеп", "Окт", "Нов", "Дец",
+ "Јануар", "Фебруар", "Март", "Април", "Мај", "Јун", "Јул", "Август", "Септембар", "Октобар", "Новембар", "Децембар"
+ ],
+ AmPm : ["am","pm","AM","PM"],
+ S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
+ srcformat: 'Y-m-d',
+ newformat: 'd/m/Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "n/j/Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sv.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sv.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-sv.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,128 @@
+;(function($){
+/**
+ * jqGrid Swedish Translation
+ * Harald Normann harald.normann(a)wts.se, harald.normann(a)gmail.com
+ * http://www.worldteamsoftware.com
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "Visar {0} - {1} av {2}",
+ emptyrecords: "Det finns inga poster att visa",
+ loadtext: "Laddar...",
+ pgtext : "Sida {0} av {1}"
+ },
+ search : {
+ caption: "Sök Poster - Ange sökvillkor",
+ Find: "Sök",
+ Reset: "Nollställ Villkor",
+ odata : ['lika', 'ej lika', 'mindre', 'mindre eller lika','större','större eller lika', 'börjar med','börjar inte med','tillhör','tillhör inte','slutar med','slutar inte med','innehåller','innehåller inte'],
+ groupOps: [ { op: "AND", text: "alla" }, { op: "OR", text: "eller" } ],
+ matchText: " träff",
+ rulesText: " regler"
+ },
+ edit : {
+ addCaption: "Ny Post",
+ editCaption: "Redigera Post",
+ bSubmit: "Spara",
+ bCancel: "Avbryt",
+ bClose: "Stäng",
+ saveData: "Data har ändrats! Spara förändringar?",
+ bYes : "Ja",
+ bNo : "Nej",
+ bExit : "Avbryt",
+ msg: {
+ required:"Fältet är obligatoriskt",
+ number:"Välj korrekt nummer",
+ minValue:"värdet måste vara större än eller lika med",
+ maxValue:"värdet måste vara mindre än eller lika med",
+ email: "är inte korrekt e-post adress",
+ integer: "Var god ange korrekt heltal",
+ date: "Var god ange korrekt datum",
+ url: "är inte en korrekt URL. Prefix måste anges ('http://' or 'https://')",
+ nodefined : " är inte definierad!",
+ novalue : " returvärde måste anges!",
+ customarray : "Custom funktion måste returnera en vektor!",
+ customfcheck : "Custom funktion måste finnas om Custom kontroll sker!"
+ }
+ },
+ view : {
+ caption: "Visa Post",
+ bClose: "Stäng"
+ },
+ del : {
+ caption: "Radera",
+ msg: "Radera markerad(e) post(er)?",
+ bSubmit: "Radera",
+ bCancel: "Avbryt"
+ },
+ nav : {
+ edittext: "",
+ edittitle: "Redigera markerad rad",
+ addtext:"",
+ addtitle: "Skapa ny post",
+ deltext: "",
+ deltitle: "Radera markerad rad",
+ searchtext: "",
+ searchtitle: "Sök poster",
+ refreshtext: "",
+ refreshtitle: "Uppdatera data",
+ alertcap: "Varning",
+ alerttext: "Ingen rad är markerad",
+ viewtext: "",
+ viewtitle: "Visa markerad rad"
+ },
+ col : {
+ caption: "Välj Kolumner",
+ bSubmit: "OK",
+ bCancel: "Avbryt"
+ },
+ errors : {
+ errcap : "Fel",
+ nourl : "URL saknas",
+ norecords: "Det finns inga poster att bearbeta",
+ model : "Antal colNames <> colModel!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0,00'},
+ currency : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"Kr", defaultValue: '0,00'},
+ date : {
+ dayNames: [
+ "Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör",
+ "Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"
+ ],
+ monthNames: [
+ "Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec",
+ "Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"
+ ],
+ AmPm : ["fm","em","FM","EM"],
+ S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
+ srcformat: 'Y-m-d',
+ newformat: 'Y-m-d',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "n/j/Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-th.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-th.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-th.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,129 @@
+;(function($){
+/**
+ * jqGrid Thai Translation
+ * Kittituch Manakul m.kittituch(a)Gmail.com
+ * http://trirand.com/blog/
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "แสดง {0} - {1} จาก {2}",
+ emptyrecords: "ไม่พบข้อมูล",
+ loadtext: "กำลังร้องขอข้อมูล...",
+ pgtext : "หน้า {0} จาก {1}"
+ },
+ search : {
+ caption: "กำลังค้นหา...",
+ Find: "ค้นหา",
+ Reset: "คืนค่ากลับ",
+ odata : ['เท่ากับ', 'ไม่เท่ากับ', 'น้อยกว่า', 'ไม่มากกว่า','มากกกว่า','ไม่น้อยกว่า', 'ขึ้นต้นด้วย','ไม่ขึ้นต้นด้วย','มีคำใดคำหนึ่งใน','ไม่มีคำใดคำหนึ่งใน','ลงท้ายด้วย','ไม่ลงท้ายด้วย','มีคำว่า','ไม่มีคำว่า'],
+ groupOps: [ { op: "และ", text: "ทั้งหมด" }, { op: "หรือ", text: "ใดๆ" } ],
+ matchText: " ตรงกันกับ",
+ rulesText: " ตามกฏ"
+ },
+ edit : {
+ addCaption: "เพิ่มข้อมูล",
+ editCaption: "แก้ไขข้อมูล",
+ bSubmit: "บันทึก",
+ bCancel: "ยกเลิก",
+ bClose: "ปิด",
+ saveData: "คุณต้องการบันทึการแก้ไข ใช่หรือไม่?",
+ bYes : "บันทึก",
+ bNo : "ละทิ้งการแก้ไข",
+ bExit : "ยกเลิก",
+ msg: {
+ required:"ข้อมูลนี้จำเป็น",
+ number:"กรุณากรอกหมายเลขให้ถูกต้อง",
+ minValue:"ค่าของข้อมูลนี้ต้องไม่น้อยกว่า",
+ maxValue:"ค่าของข้อมูลนี้ต้องไม่มากกว่า",
+ email: "อีเมลล์นี้ไม่ถูกต้อง",
+ integer: "กรุณากรอกเป็นจำนวนเต็ม",
+ date: "กรุณากรอกวันที่ให้ถูกต้อง",
+ url: "URL ไม่ถูกต้อง URL จำเป็นต้องขึ้นต้นด้วย 'http://' หรือ 'https://'",
+ nodefined : "ไม่ได้ถูกกำหนดค่า!",
+ novalue : "ต้องการการคืนค่า!",
+ customarray : "ฟังก์ชันที่สร้างขึ้นต้องส่งค่ากลับเป็นแบบแอเรย์",
+ customfcheck : "ระบบต้องการฟังก์ชันที่สร้างขึ้นสำหรับการตรวจสอบ!"
+
+ }
+ },
+ view : {
+ caption: "เรียกดูข้อมูล",
+ bClose: "ปิด"
+ },
+ del : {
+ caption: "ลบข้อมูล",
+ msg: "คุณต้องการลบข้อมูลที่ถูกเลือก ใช่หรือไม่?",
+ bSubmit: "ต้องการลบ",
+ bCancel: "ยกเลิก"
+ },
+ nav : {
+ edittext: "",
+ edittitle: "แก้ไขข้อมูล",
+ addtext:"",
+ addtitle: "เพิ่มข้อมูล",
+ deltext: "",
+ deltitle: "ลบข้อมูล",
+ searchtext: "",
+ searchtitle: "ค้นหาข้อมูล",
+ refreshtext: "",
+ refreshtitle: "รีเฟรช",
+ alertcap: "คำเตือน",
+ alerttext: "กรุณาเลือกข้อมูล",
+ viewtext: "",
+ viewtitle: "ดูรายละเอียดข้อมูล"
+ },
+ col : {
+ caption: "กรุณาเลือกคอลัมน์",
+ bSubmit: "ตกลง",
+ bCancel: "ยกเลิก"
+ },
+ errors : {
+ errcap : "เกิดความผิดพลาด",
+ nourl : "ไม่ได้กำหนด URL",
+ norecords: "ไม่มีข้อมูลให้ดำเนินการ",
+ model : "จำนวนคอลัมน์ไม่เท่ากับจำนวนคอลัมน์โมเดล!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
+ currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
+ date : {
+ dayNames: [
+ "อา", "จ", "อ", "พ", "พฤ", "ศ", "ส",
+ "อาทิตย์", "จันทร์", "อังคาร", "พุธ", "พฤหัสบดี", "ศูกร์", "เสาร์"
+ ],
+ monthNames: [
+ "ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค.",
+ "มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฏาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม"
+ ],
+ AmPm : ["am","pm","AM","PM"],
+ S: function (j) {return ''},
+ srcformat: 'Y-m-d',
+ newformat: 'd/m/Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "n/j/Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-tr.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-tr.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-tr.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,127 @@
+;(function($){
+/**
+ * jqGrid Turkish Translation
+ * Erhan Gündoğan (erhan(a)trposta.net)
+ * http://blog.zakkum.com
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "{0}-{1} listeleniyor. Toplam:{2}",
+ emptyrecords: "Kayıt bulunamadı",
+ loadtext: "Yükleniyor...",
+ pgtext : "{0}/{1}. Sayfa"
+ },
+ search : {
+ caption: "Arama...",
+ Find: "Bul",
+ Reset: "Temizle",
+ odata : ['eşit', 'eşit değil', 'daha az', 'daha az veya eşit', 'daha fazla', 'daha fazla veya eşit', 'ile başlayan', 'ile başlamayan', 'içinde', 'içinde değil', 'ile biten', 'ile bitmeyen', 'içeren', 'içermeyen'],
+ groupOps: [ { op: "VE", text: "tüm" }, { op: "VEYA", text: "herhangi" } ],
+ matchText: " uyan",
+ rulesText: " kurallar"
+ },
+ edit : {
+ addCaption: "Kayıt Ekle",
+ editCaption: "Kayıt Düzenle",
+ bSubmit: "Gönder",
+ bCancel: "İptal",
+ bClose: "Kapat",
+ saveData: "Veriler değişti! Kayıt edilsin mi?",
+ bYes : "Evet",
+ bNo : "Hayıt",
+ bExit : "İptal",
+ msg: {
+ required:"Alan gerekli",
+ number:"Lütfen bir numara giriniz",
+ minValue:"girilen değer daha büyük ya da buna eşit olmalıdır",
+ maxValue:"girilen değer daha küçük ya da buna eşit olmalıdır",
+ email: "geçerli bir e-posta adresi değildir",
+ integer: "Lütfen bir tamsayı giriniz",
+ url: "Geçerli bir URL değil. ('http://' or 'https://') ön eki gerekli.",
+ nodefined : " is not defined!",
+ novalue : " return value is required!",
+ customarray : "Custom function should return array!",
+ customfcheck : "Custom function should be present in case of custom checking!"
+ }
+ },
+ view : {
+ caption: "Kayıt Görüntüle",
+ bClose: "Kapat"
+ },
+ del : {
+ caption: "Sil",
+ msg: "Seçilen kayıtlar silinsin mi?",
+ bSubmit: "Sil",
+ bCancel: "İptal"
+ },
+ nav : {
+ edittext: " ",
+ edittitle: "Seçili satırı düzenle",
+ addtext:" ",
+ addtitle: "Yeni satır ekle",
+ deltext: " ",
+ deltitle: "Seçili satırı sil",
+ searchtext: " ",
+ searchtitle: "Kayıtları bul",
+ refreshtext: "",
+ refreshtitle: "Tabloyu yenile",
+ alertcap: "Uyarı",
+ alerttext: "Lütfen bir satır seçiniz",
+ viewtext: "",
+ viewtitle: "Seçilen satırı görüntüle"
+ },
+ col : {
+ caption: "Sütunları göster/gizle",
+ bSubmit: "Gönder",
+ bCancel: "İptal"
+ },
+ errors : {
+ errcap : "Hata",
+ nourl : "Bir url yapılandırılmamış",
+ norecords: "İşlem yapılacak bir kayıt yok",
+ model : "colNames uzunluğu <> colModel!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
+ currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
+ date : {
+ dayNames: [
+ "Paz", "Pts", "Sal", "Çar", "Per", "Cum", "Cts",
+ "Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi"
+ ],
+ monthNames: [
+ "Oca", "Şub", "Mar", "Nis", "May", "Haz", "Tem", "Ağu", "Eyl", "Eki", "Kas", "Ara",
+ "Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"
+ ],
+ AmPm : ["am","pm","AM","PM"],
+ S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
+ srcformat: 'Y-m-d',
+ newformat: 'd/m/Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "n/j/Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-tw.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-tw.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-tw.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,130 @@
+;(function($){
+/**
+ * jqGrid Chinese (Taiwan) Translation for v4.2
+ * linquize
+ * https://github.com/linquize/jqGrid
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "{0} - {1} 共 {2} 條",
+ emptyrecords: "沒有記錄",
+ loadtext: "載入中...",
+ pgtext : " {0} 共 {1} 頁"
+ },
+ search : {
+ caption: "搜尋...",
+ Find: "搜尋",
+ Reset: "重設",
+ odata : ['等於 ', '不等於 ', '小於 ', '小於等於 ','大於 ','大於等於 ', '開始於 ','不開始於 ','在其中 ','不在其中 ','結束於 ','不結束於 ','包含 ','不包含 '],
+ groupOps: [ { op: "AND", text: "所有" }, { op: "OR", text: "任一" } ],
+ matchText: " 匹配",
+ rulesText: " 規則"
+ },
+ edit : {
+ addCaption: "新增記錄",
+ editCaption: "編輯記錄",
+ bSubmit: "提交",
+ bCancel: "取消",
+ bClose: "關閉",
+ saveData: "資料已改變,是否儲存?",
+ bYes : "是",
+ bNo : "否",
+ bExit : "取消",
+ msg: {
+ required:"此欄必要",
+ number:"請輸入有效的數字",
+ minValue:"值必須大於等於 ",
+ maxValue:"值必須小於等於 ",
+ email: "不是有效的e-mail地址",
+ integer: "請輸入有效整数",
+ date: "請輸入有效時間",
+ url: "網址無效。前綴必須為 ('http://' 或 'https://')",
+ nodefined : " 未定義!",
+ novalue : " 需要傳回值!",
+ customarray : "自訂函數應傳回陣列!",
+ customfcheck : "自訂檢查應有自訂函數!"
+
+ }
+ },
+ view : {
+ caption: "查看記錄",
+ bClose: "關閉"
+ },
+ del : {
+ caption: "刪除",
+ msg: "刪除已選記錄?",
+ bSubmit: "刪除",
+ bCancel: "取消"
+ },
+ nav : {
+ edittext: "",
+ edittitle: "編輯已選列",
+ addtext:"",
+ addtitle: "新增列",
+ deltext: "",
+ deltitle: "刪除已選列",
+ searchtext: "",
+ searchtitle: "搜尋記錄",
+ refreshtext: "",
+ refreshtitle: "重新整理表格",
+ alertcap: "警告",
+ alerttext: "請選擇列",
+ viewtext: "",
+ viewtitle: "檢視已選列"
+ },
+ col : {
+ caption: "選擇欄",
+ bSubmit: "確定",
+ bCancel: "取消"
+ },
+ errors : {
+ errcap : "錯誤",
+ nourl : "未設定URL",
+ norecords: "無需要處理的記錄",
+ model : "colNames 和 colModel 長度不同!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
+ currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
+ date : {
+ dayNames: [
+ "日", "一", "二", "三", "四", "五", "六",
+ "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"
+ ],
+ monthNames: [
+ "一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二",
+ "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"
+ ],
+ AmPm : ["上午","下午","上午","下午"],
+ S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
+ srcformat: 'Y-m-d',
+ newformat: 'm-d-Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "Y/j/n",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y g:i:s A",
+ MonthDay: "F d",
+ ShortTime: "g:i A",
+ LongTime: "g:i:s A",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ua.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ua.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/i18n/grid.locale-ua.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,128 @@
+;(function($){
+/**
+ * jqGrid Ukrainian Translation v1.0 02.07.2009
+ * Sergey Dyagovchenko
+ * http://d.sumy.ua
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ defaults : {
+ recordtext: "Перегляд {0} - {1} з {2}",
+ emptyrecords: "Немає записів для перегляду",
+ loadtext: "Завантаження...",
+ pgtext : "Стор. {0} з {1}"
+ },
+ search : {
+ caption: "Пошук...",
+ Find: "Знайти",
+ Reset: "Скидання",
+ odata : ['рівно', 'не рівно', 'менше', 'менше або рівне','більше','більше або рівне', 'починається з','не починається з','знаходиться в','не знаходиться в','закінчується на','не закінчується на','містить','не містить'],
+ groupOps: [ { op: "AND", text: "все" }, { op: "OR", text: "будь-який" } ],
+ matchText: " збігається",
+ rulesText: " правила"
+ },
+ edit : {
+ addCaption: "Додати запис",
+ editCaption: "Змінити запис",
+ bSubmit: "Зберегти",
+ bCancel: "Відміна",
+ bClose: "Закрити",
+ saveData: "До данних були внесені зміни! Зберегти зміни?",
+ bYes : "Так",
+ bNo : "Ні",
+ bExit : "Відміна",
+ msg: {
+ required:"Поле є обов'язковим",
+ number:"Будь ласка, введіть правильне число",
+ minValue:"значення повинне бути більше або дорівнює",
+ maxValue:"значення повинно бути менше або дорівнює",
+ email: "некоректна адреса електронної пошти",
+ integer: "Будь ласка, введення дійсне ціле значення",
+ date: "Будь ласка, введення дійсне значення дати",
+ url: "не дійсний URL. Необхідна приставка ('http://' or 'https://')",
+ nodefined : " is not defined!",
+ novalue : " return value is required!",
+ customarray : "Custom function should return array!",
+ customfcheck : "Custom function should be present in case of custom checking!"
+ }
+ },
+ view : {
+ caption: "Переглянути запис",
+ bClose: "Закрити"
+ },
+ del : {
+ caption: "Видалити",
+ msg: "Видалити обраний запис(и)?",
+ bSubmit: "Видалити",
+ bCancel: "Відміна"
+ },
+ nav : {
+ edittext: " ",
+ edittitle: "Змінити вибраний запис",
+ addtext:" ",
+ addtitle: "Додати новий запис",
+ deltext: " ",
+ deltitle: "Видалити вибраний запис",
+ searchtext: " ",
+ searchtitle: "Знайти записи",
+ refreshtext: "",
+ refreshtitle: "Оновити таблицю",
+ alertcap: "Попередження",
+ alerttext: "Будь ласка, виберіть запис",
+ viewtext: "",
+ viewtitle: "Переглянути обраний запис"
+ },
+ col : {
+ caption: "Показати/Приховати стовпці",
+ bSubmit: "Зберегти",
+ bCancel: "Відміна"
+ },
+ errors : {
+ errcap : "Помилка",
+ nourl : "URL не задан",
+ norecords: "Немає записів для обробки",
+ model : "Число полів не відповідає числу стовпців таблиці!"
+ },
+ formatter : {
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
+ number : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0,00'},
+ currency : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0,00'},
+ date : {
+ dayNames: [
+ "Нд", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб",
+ "Неділя", "Понеділок", "Вівторок", "Середа", "Четвер", "П'ятниця", "Субота"
+ ],
+ monthNames: [
+ "Січ", "Лют", "Бер", "Кві", "Тра", "Чер", "Лип", "Сер", "Вер", "Жов", "Лис", "Гру",
+ "Січень", "Лютий", "Березень", "Квітень", "Травень", "Червень", "Липень", "Серпень", "Вересень", "Жовтень", "Листопад", "Грудень"
+ ],
+ AmPm : ["am","pm","AM","PM"],
+ S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
+ srcformat: 'Y-m-d',
+ newformat: 'd.m.Y',
+ masks : {
+ ISO8601Long:"Y-m-d H:i:s",
+ ISO8601Short:"Y-m-d",
+ ShortDate: "n.j.Y",
+ LongDate: "l, F d, Y",
+ FullDateTime: "l, F d, Y G:i:s",
+ MonthDay: "F d",
+ ShortTime: "G:i",
+ LongTime: "G:i:s",
+ SortableDateTime: "Y-m-d\\TH:i:s",
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
+ YearMonth: "F, Y"
+ },
+ reformatAfterEdit : false
+ },
+ baseLinkUrl: '',
+ showAction: '',
+ target: '',
+ checkbox : {disabled:true},
+ idName : 'id'
+ }
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/jquery.jqGrid.src.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/jquery.jqGrid.src.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/js/jquery.jqGrid.src.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,12248 @@
+// ==ClosureCompiler==
+// @compilation_level SIMPLE_OPTIMIZATIONS
+
+/**
+ * @license jqGrid 4.4.1 - jQuery Grid
+ * Copyright (c) 2008, Tony Tomov, tony(a)trirand.com
+ * Dual licensed under the MIT and GPL licenses
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl-2.0.html
+ * Date: 2012-08-28
+ */
+//jsHint options
+/*global document, window, jQuery, DOMParser, ActiveXObject, $, alert */
+
+(function ($) {
+"use strict";
+$.jgrid = $.jgrid || {};
+$.extend($.jgrid,{
+ version : "4.4.1",
+ htmlDecode : function(value){
+ if(value && (value==' ' || value==' ' || (value.length===1 && value.charCodeAt(0)===160))) { return "";}
+ return !value ? value : String(value).replace(/>/g, ">").replace(/</g, "<").replace(/"/g, '"').replace(/&/g, "&");
+ },
+ htmlEncode : function (value){
+ return !value ? value : String(value).replace(/&/g, "&").replace(/\"/g, """).replace(/</g, "<").replace(/>/g, ">");
+ },
+ format : function(format){ //jqgformat
+ var args = $.makeArray(arguments).slice(1);
+ if(format===undefined) { format = ""; }
+ return format.replace(/\{(\d+)\}/g, function(m, i){
+ return args[i];
+ });
+ },
+ getCellIndex : function (cell) {
+ var c = $(cell);
+ if (c.is('tr')) { return -1; }
+ c = (!c.is('td') && !c.is('th') ? c.closest("td,th") : c)[0];
+ if ($.browser.msie) { return $.inArray(c, c.parentNode.cells); }
+ return c.cellIndex;
+ },
+ stripHtml : function(v) {
+ v = v+"";
+ var regexp = /<("[^"]*"|'[^']*'|[^'">])*>/gi;
+ if (v) {
+ v = v.replace(regexp,"");
+ return (v && v !== ' ' && v !== ' ') ? v.replace(/\"/g,"'") : "";
+ } else {
+ return v;
+ }
+ },
+ stripPref : function (pref, id) {
+ var obj = $.type( pref );
+ if( obj == "string" || obj =="number") {
+ pref = String(pref);
+ id = pref !== "" ? String(id).replace(String(pref), "") : id;
+ }
+ return id;
+ },
+ stringToDoc : function (xmlString) {
+ var xmlDoc;
+ if(typeof xmlString !== 'string') { return xmlString; }
+ try {
+ var parser = new DOMParser();
+ xmlDoc = parser.parseFromString(xmlString,"text/xml");
+ }
+ catch(e) {
+ xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
+ xmlDoc.async=false;
+ xmlDoc.loadXML(xmlString);
+ }
+ return (xmlDoc && xmlDoc.documentElement && xmlDoc.documentElement.tagName != 'parsererror') ? xmlDoc : null;
+ },
+ parse : function(jsonString) {
+ var js = jsonString;
+ if (js.substr(0,9) == "while(1);") { js = js.substr(9); }
+ if (js.substr(0,2) == "/*") { js = js.substr(2,js.length-4); }
+ if(!js) { js = "{}"; }
+ return ($.jgrid.useJSON===true && typeof (JSON) === 'object' && typeof (JSON.parse) === 'function') ?
+ JSON.parse(js) :
+ eval('(' + js + ')');
+ },
+ parseDate : function(format, date) {
+ var tsp = {m : 1, d : 1, y : 1970, h : 0, i : 0, s : 0, u:0},k,hl,dM, regdate = /[\\\/:_;.,\t\T\s-]/;
+ if(date && date !== null && date !== undefined){
+ date = $.trim(date);
+ date = date.split(regdate);
+ if ($.jgrid.formatter.date.masks[format] !== undefined) {
+ format = $.jgrid.formatter.date.masks[format];
+ }
+ format = format.split(regdate);
+ var dfmt = $.jgrid.formatter.date.monthNames;
+ var afmt = $.jgrid.formatter.date.AmPm;
+ var h12to24 = function(ampm, h){
+ if (ampm === 0){ if (h === 12) { h = 0;} }
+ else { if (h !== 12) { h += 12; } }
+ return h;
+ };
+ for(k=0,hl=format.length;k<hl;k++){
+ if(format[k] == 'M') {
+ dM = $.inArray(date[k],dfmt);
+ if(dM !== -1 && dM < 12){
+ date[k] = dM+1;
+ tsp.m = date[k];
+ }
+ }
+ if(format[k] == 'F') {
+ dM = $.inArray(date[k],dfmt);
+ if(dM !== -1 && dM > 11){
+ date[k] = dM+1-12;
+ tsp.m = date[k];
+ }
+ }
+ if(format[k] == 'a') {
+ dM = $.inArray(date[k],afmt);
+ if(dM !== -1 && dM < 2 && date[k] == afmt[dM]){
+ date[k] = dM;
+ tsp.h = h12to24(date[k], tsp.h);
+ }
+ }
+ if(format[k] == 'A') {
+ dM = $.inArray(date[k],afmt);
+ if(dM !== -1 && dM > 1 && date[k] == afmt[dM]){
+ date[k] = dM-2;
+ tsp.h = h12to24(date[k], tsp.h);
+ }
+ }
+ if (format[k] === 'g') {
+ tsp.h = parseInt(date[k], 10);
+ }
+ if(date[k] !== undefined) {
+ tsp[format[k].toLowerCase()] = parseInt(date[k],10);
+ }
+ }
+ tsp.m = parseInt(tsp.m,10)-1;
+ var ty = tsp.y;
+ if (ty >= 70 && ty <= 99) {tsp.y = 1900+tsp.y;}
+ else if (ty >=0 && ty <=69) {tsp.y= 2000+tsp.y;}
+ if(tsp.j !== undefined) { tsp.d = tsp.j; }
+ if(tsp.n !== undefined) { tsp.m = parseInt(tsp.n,10)-1; }
+ }
+ return new Date(tsp.y, tsp.m, tsp.d, tsp.h, tsp.i, tsp.s, tsp.u);
+ },
+ jqID : function(sid){
+ return String(sid).replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g,"\\$&");
+ },
+ guid : 1,
+ uidPref: 'jqg',
+ randId : function( prefix ) {
+ return (prefix? prefix: $.jgrid.uidPref) + ($.jgrid.guid++);
+ },
+ getAccessor : function(obj, expr) {
+ var ret,p,prm = [], i;
+ if( typeof expr === 'function') { return expr(obj); }
+ ret = obj[expr];
+ if(ret===undefined) {
+ try {
+ if ( typeof expr === 'string' ) {
+ prm = expr.split('.');
+ }
+ i = prm.length;
+ if( i ) {
+ ret = obj;
+ while (ret && i--) {
+ p = prm.shift();
+ ret = ret[p];
+ }
+ }
+ } catch (e) {}
+ }
+ return ret;
+ },
+ getXmlData: function (obj, expr, returnObj) {
+ var ret, m = typeof (expr) === 'string' ? expr.match(/^(.*)\[(\w+)\]$/) : null;
+ if (typeof (expr) === 'function') { return expr(obj); }
+ if (m && m[2]) {
+ // m[2] is the attribute selector
+ // m[1] is an optional element selector
+ // examples: "[id]", "rows[page]"
+ return m[1] ? $(m[1], obj).attr(m[2]) : $(obj).attr(m[2]);
+ } else {
+ ret = $(expr, obj);
+ if (returnObj) { return ret; }
+ //$(expr, obj).filter(':last'); // we use ':last' to be more compatible with old version of jqGrid
+ return ret.length > 0 ? $(ret).text() : undefined;
+ }
+ },
+ cellWidth : function () {
+ var $testDiv = $("<div class='ui-jqgrid' style='left:10000px'><table class='ui-jqgrid-btable' style='width:5px;'><tr class='jqgrow'><td style='width:5px;'></td></tr></table></div>"),
+ testCell = $testDiv.appendTo("body")
+ .find("td")
+ .width();
+ $testDiv.remove();
+ return testCell !== 5;
+ },
+ ajaxOptions: {},
+ from : function(source){
+ // Original Author Hugo Bonacci
+ // License MIT http://jlinq.codeplex.com/license
+ var QueryObject=function(d,q){
+ if(typeof(d)=="string"){
+ d=$.data(d);
+ }
+ var self=this,
+ _data=d,
+ _usecase=true,
+ _trim=false,
+ _query=q,
+ _stripNum = /[\$,%]/g,
+ _lastCommand=null,
+ _lastField=null,
+ _orDepth=0,
+ _negate=false,
+ _queuedOperator="",
+ _sorting=[],
+ _useProperties=true;
+ if(typeof(d)=="object"&&d.push) {
+ if(d.length>0){
+ if(typeof(d[0])!="object"){
+ _useProperties=false;
+ }else{
+ _useProperties=true;
+ }
+ }
+ }else{
+ throw "data provides is not an array";
+ }
+ this._hasData=function(){
+ return _data===null?false:_data.length===0?false:true;
+ };
+ this._getStr=function(s){
+ var phrase=[];
+ if(_trim){
+ phrase.push("jQuery.trim(");
+ }
+ phrase.push("String("+s+")");
+ if(_trim){
+ phrase.push(")");
+ }
+ if(!_usecase){
+ phrase.push(".toLowerCase()");
+ }
+ return phrase.join("");
+ };
+ this._strComp=function(val){
+ if(typeof(val)=="string"){
+ return".toString()";
+ }else{
+ return"";
+ }
+ };
+ this._group=function(f,u){
+ return({field:f.toString(),unique:u,items:[]});
+ };
+ this._toStr=function(phrase){
+ if(_trim){
+ phrase=$.trim(phrase);
+ }
+ phrase=phrase.toString().replace(/\\/g,'\\\\').replace(/\"/g,'\\"');
+ return _usecase ? phrase : phrase.toLowerCase();
+ };
+ this._funcLoop=function(func){
+ var results=[];
+ $.each(_data,function(i,v){
+ results.push(func(v));
+ });
+ return results;
+ };
+ this._append=function(s){
+ var i;
+ if(_query===null){
+ _query="";
+ } else {
+ _query+=_queuedOperator === "" ? " && " :_queuedOperator;
+ }
+ for (i=0;i<_orDepth;i++){
+ _query+="(";
+ }
+ if(_negate){
+ _query+="!";
+ }
+ _query+="("+s+")";
+ _negate=false;
+ _queuedOperator="";
+ _orDepth=0;
+ };
+ this._setCommand=function(f,c){
+ _lastCommand=f;
+ _lastField=c;
+ };
+ this._resetNegate=function(){
+ _negate=false;
+ };
+ this._repeatCommand=function(f,v){
+ if(_lastCommand===null){
+ return self;
+ }
+ if(f!==null&&v!==null){
+ return _lastCommand(f,v);
+ }
+ if(_lastField===null){
+ return _lastCommand(f);
+ }
+ if(!_useProperties){
+ return _lastCommand(f);
+ }
+ return _lastCommand(_lastField,f);
+ };
+ this._equals=function(a,b){
+ return(self._compare(a,b,1)===0);
+ };
+ this._compare=function(a,b,d){
+ var toString = Object.prototype.toString;
+ if( d === undefined) { d = 1; }
+ if(a===undefined) { a = null; }
+ if(b===undefined) { b = null; }
+ if(a===null && b===null){
+ return 0;
+ }
+ if(a===null&&b!==null){
+ return 1;
+ }
+ if(a!==null&&b===null){
+ return -1;
+ }
+ if (toString.call(a) === '[object Date]' && toString.call(b) === '[object Date]') {
+ if (a < b) { return -d; }
+ if (a > b) { return d; }
+ return 0;
+ }
+ if(!_usecase && typeof(a) !== "number" && typeof(b) !== "number" ) {
+ a=String(a).toLowerCase();
+ b=String(b).toLowerCase();
+ }
+ if(a<b){return -d;}
+ if(a>b){return d;}
+ return 0;
+ };
+ this._performSort=function(){
+ if(_sorting.length===0){return;}
+ _data=self._doSort(_data,0);
+ };
+ this._doSort=function(d,q){
+ var by=_sorting[q].by,
+ dir=_sorting[q].dir,
+ type = _sorting[q].type,
+ dfmt = _sorting[q].datefmt;
+ if(q==_sorting.length-1){
+ return self._getOrder(d, by, dir, type, dfmt);
+ }
+ q++;
+ var values=self._getGroup(d,by,dir,type,dfmt);
+ var results=[];
+ for(var i=0;i<values.length;i++){
+ var sorted=self._doSort(values[i].items,q);
+ for(var j=0;j<sorted.length;j++){
+ results.push(sorted[j]);
+ }
+ }
+ return results;
+ };
+ this._getOrder=function(data,by,dir,type, dfmt){
+ var sortData=[],_sortData=[], newDir = dir=="a" ? 1 : -1, i,ab,j,
+ findSortKey;
+
+ if(type === undefined ) { type = "text"; }
+ if (type == 'float' || type== 'number' || type== 'currency' || type== 'numeric') {
+ findSortKey = function($cell) {
+ var key = parseFloat( String($cell).replace(_stripNum, ''));
+ return isNaN(key) ? 0.00 : key;
+ };
+ } else if (type=='int' || type=='integer') {
+ findSortKey = function($cell) {
+ return $cell ? parseFloat(String($cell).replace(_stripNum, '')) : 0;
+ };
+ } else if(type == 'date' || type == 'datetime') {
+ findSortKey = function($cell) {
+ return $.jgrid.parseDate(dfmt,$cell).getTime();
+ };
+ } else if($.isFunction(type)) {
+ findSortKey = type;
+ } else {
+ findSortKey = function($cell) {
+ if(!$cell) {$cell ="";}
+ return $.trim(String($cell).toUpperCase());
+ };
+ }
+ $.each(data,function(i,v){
+ ab = by!=="" ? $.jgrid.getAccessor(v,by) : v;
+ if(ab === undefined) { ab = ""; }
+ ab = findSortKey(ab, v);
+ _sortData.push({ 'vSort': ab,'index':i});
+ });
+
+ _sortData.sort(function(a,b){
+ a = a.vSort;
+ b = b.vSort;
+ return self._compare(a,b,newDir);
+ });
+ j=0;
+ var nrec= data.length;
+ // overhead, but we do not change the original data.
+ while(j<nrec) {
+ i = _sortData[j].index;
+ sortData.push(data[i]);
+ j++;
+ }
+ return sortData;
+ };
+ this._getGroup=function(data,by,dir,type, dfmt){
+ var results=[],
+ group=null,
+ last=null, val;
+ $.each(self._getOrder(data,by,dir,type, dfmt),function(i,v){
+ val = $.jgrid.getAccessor(v, by);
+ if(val === undefined) { val = ""; }
+ if(!self._equals(last,val)){
+ last=val;
+ if(group !== null){
+ results.push(group);
+ }
+ group=self._group(by,val);
+ }
+ group.items.push(v);
+ });
+ if(group !== null){
+ results.push(group);
+ }
+ return results;
+ };
+ this.ignoreCase=function(){
+ _usecase=false;
+ return self;
+ };
+ this.useCase=function(){
+ _usecase=true;
+ return self;
+ };
+ this.trim=function(){
+ _trim=true;
+ return self;
+ };
+ this.noTrim=function(){
+ _trim=false;
+ return self;
+ };
+ this.execute=function(){
+ var match=_query, results=[];
+ if(match === null){
+ return self;
+ }
+ $.each(_data,function(){
+ if(eval(match)){results.push(this);}
+ });
+ _data=results;
+ return self;
+ };
+ this.data=function(){
+ return _data;
+ };
+ this.select=function(f){
+ self._performSort();
+ if(!self._hasData()){ return[]; }
+ self.execute();
+ if($.isFunction(f)){
+ var results=[];
+ $.each(_data,function(i,v){
+ results.push(f(v));
+ });
+ return results;
+ }
+ return _data;
+ };
+ this.hasMatch=function(){
+ if(!self._hasData()) { return false; }
+ self.execute();
+ return _data.length>0;
+ };
+ this.andNot=function(f,v,x){
+ _negate=!_negate;
+ return self.and(f,v,x);
+ };
+ this.orNot=function(f,v,x){
+ _negate=!_negate;
+ return self.or(f,v,x);
+ };
+ this.not=function(f,v,x){
+ return self.andNot(f,v,x);
+ };
+ this.and=function(f,v,x){
+ _queuedOperator=" && ";
+ if(f===undefined){
+ return self;
+ }
+ return self._repeatCommand(f,v,x);
+ };
+ this.or=function(f,v,x){
+ _queuedOperator=" || ";
+ if(f===undefined) { return self; }
+ return self._repeatCommand(f,v,x);
+ };
+ this.orBegin=function(){
+ _orDepth++;
+ return self;
+ };
+ this.orEnd=function(){
+ if (_query !== null){
+ _query+=")";
+ }
+ return self;
+ };
+ this.isNot=function(f){
+ _negate=!_negate;
+ return self.is(f);
+ };
+ this.is=function(f){
+ self._append('this.'+f);
+ self._resetNegate();
+ return self;
+ };
+ this._compareValues=function(func,f,v,how,t){
+ var fld;
+ if(_useProperties){
+ fld='jQuery.jgrid.getAccessor(this,\''+f+'\')';
+ }else{
+ fld='this';
+ }
+ if(v===undefined) { v = null; }
+ //var val=v===null?f:v,
+ var val =v,
+ swst = t.stype === undefined ? "text" : t.stype;
+ if(v !== null) {
+ switch(swst) {
+ case 'int':
+ case 'integer':
+ val = (isNaN(Number(val)) || val==="") ? '0' : val; // To be fixed with more inteligent code
+ fld = 'parseInt('+fld+',10)';
+ val = 'parseInt('+val+',10)';
+ break;
+ case 'float':
+ case 'number':
+ case 'numeric':
+ val = String(val).replace(_stripNum, '');
+ val = (isNaN(Number(val)) || val==="") ? '0' : val; // To be fixed with more inteligent code
+ fld = 'parseFloat('+fld+')';
+ val = 'parseFloat('+val+')';
+ break;
+ case 'date':
+ case 'datetime':
+ val = String($.jgrid.parseDate(t.newfmt || 'Y-m-d',val).getTime());
+ fld = 'jQuery.jgrid.parseDate("'+t.srcfmt+'",'+fld+').getTime()';
+ break;
+ default :
+ fld=self._getStr(fld);
+ val=self._getStr('"'+self._toStr(val)+'"');
+ }
+ }
+ self._append(fld+' '+how+' '+val);
+ self._setCommand(func,f);
+ self._resetNegate();
+ return self;
+ };
+ this.equals=function(f,v,t){
+ return self._compareValues(self.equals,f,v,"==",t);
+ };
+ this.notEquals=function(f,v,t){
+ return self._compareValues(self.equals,f,v,"!==",t);
+ };
+ this.isNull = function(f,v,t){
+ return self._compareValues(self.equals,f,null,"===",t);
+ };
+ this.greater=function(f,v,t){
+ return self._compareValues(self.greater,f,v,">",t);
+ };
+ this.less=function(f,v,t){
+ return self._compareValues(self.less,f,v,"<",t);
+ };
+ this.greaterOrEquals=function(f,v,t){
+ return self._compareValues(self.greaterOrEquals,f,v,">=",t);
+ };
+ this.lessOrEquals=function(f,v,t){
+ return self._compareValues(self.lessOrEquals,f,v,"<=",t);
+ };
+ this.startsWith=function(f,v){
+ var val = (v===undefined || v===null) ? f: v,
+ length=_trim ? $.trim(val.toString()).length : val.toString().length;
+ if(_useProperties){
+ self._append(self._getStr('jQuery.jgrid.getAccessor(this,\''+f+'\')')+'.substr(0,'+length+') == '+self._getStr('"'+self._toStr(v)+'"'));
+ }else{
+ length=_trim?$.trim(v.toString()).length:v.toString().length;
+ self._append(self._getStr('this')+'.substr(0,'+length+') == '+self._getStr('"'+self._toStr(f)+'"'));
+ }
+ self._setCommand(self.startsWith,f);
+ self._resetNegate();
+ return self;
+ };
+ this.endsWith=function(f,v){
+ var val = (v===undefined || v===null) ? f: v,
+ length=_trim ? $.trim(val.toString()).length:val.toString().length;
+ if(_useProperties){
+ self._append(self._getStr('jQuery.jgrid.getAccessor(this,\''+f+'\')')+'.substr('+self._getStr('jQuery.jgrid.getAccessor(this,\''+f+'\')')+'.length-'+length+','+length+') == "'+self._toStr(v)+'"');
+ } else {
+ self._append(self._getStr('this')+'.substr('+self._getStr('this')+'.length-"'+self._toStr(f)+'".length,"'+self._toStr(f)+'".length) == "'+self._toStr(f)+'"');
+ }
+ self._setCommand(self.endsWith,f);self._resetNegate();
+ return self;
+ };
+ this.contains=function(f,v){
+ if(_useProperties){
+ self._append(self._getStr('jQuery.jgrid.getAccessor(this,\''+f+'\')')+'.indexOf("'+self._toStr(v)+'",0) > -1');
+ }else{
+ self._append(self._getStr('this')+'.indexOf("'+self._toStr(f)+'",0) > -1');
+ }
+ self._setCommand(self.contains,f);
+ self._resetNegate();
+ return self;
+ };
+ this.groupBy=function(by,dir,type, datefmt){
+ if(!self._hasData()){
+ return null;
+ }
+ return self._getGroup(_data,by,dir,type, datefmt);
+ };
+ this.orderBy=function(by,dir,stype, dfmt){
+ dir = dir === undefined || dir === null ? "a" :$.trim(dir.toString().toLowerCase());
+ if(stype === null || stype === undefined) { stype = "text"; }
+ if(dfmt === null || dfmt === undefined) { dfmt = "Y-m-d"; }
+ if(dir=="desc"||dir=="descending"){dir="d";}
+ if(dir=="asc"||dir=="ascending"){dir="a";}
+ _sorting.push({by:by,dir:dir,type:stype, datefmt: dfmt});
+ return self;
+ };
+ return self;
+ };
+ return new QueryObject(source,null);
+ },
+ extend : function(methods) {
+ $.extend($.fn.jqGrid,methods);
+ if (!this.no_legacy_api) {
+ $.fn.extend(methods);
+ }
+ }
+});
+
+$.fn.jqGrid = function( pin ) {
+ if (typeof pin == 'string') {
+ //var fn = $.fn.jqGrid[pin];
+ var fn = $.jgrid.getAccessor($.fn.jqGrid,pin);
+ if (!fn) {
+ throw ("jqGrid - No such method: " + pin);
+ }
+ var args = $.makeArray(arguments).slice(1);
+ return fn.apply(this,args);
+ }
+ return this.each( function() {
+ if(this.grid) {return;}
+
+ var p = $.extend(true,{
+ url: "",
+ height: 150,
+ page: 1,
+ rowNum: 20,
+ rowTotal : null,
+ records: 0,
+ pager: "",
+ pgbuttons: true,
+ pginput: true,
+ colModel: [],
+ rowList: [],
+ colNames: [],
+ sortorder: "asc",
+ sortname: "",
+ datatype: "xml",
+ mtype: "GET",
+ altRows: false,
+ selarrrow: [],
+ savedRow: [],
+ shrinkToFit: true,
+ xmlReader: {},
+ jsonReader: {},
+ subGrid: false,
+ subGridModel :[],
+ reccount: 0,
+ lastpage: 0,
+ lastsort: 0,
+ selrow: null,
+ beforeSelectRow: null,
+ onSelectRow: null,
+ onSortCol: null,
+ ondblClickRow: null,
+ onRightClickRow: null,
+ onPaging: null,
+ onSelectAll: null,
+ loadComplete: null,
+ gridComplete: null,
+ loadError: null,
+ loadBeforeSend: null,
+ afterInsertRow: null,
+ beforeRequest: null,
+ beforeProcessing : null,
+ onHeaderClick: null,
+ viewrecords: false,
+ loadonce: false,
+ multiselect: false,
+ multikey: false,
+ editurl: null,
+ search: false,
+ caption: "",
+ hidegrid: true,
+ hiddengrid: false,
+ postData: {},
+ userData: {},
+ treeGrid : false,
+ treeGridModel : 'nested',
+ treeReader : {},
+ treeANode : -1,
+ ExpandColumn: null,
+ tree_root_level : 0,
+ prmNames: {page:"page",rows:"rows", sort: "sidx",order: "sord", search:"_search", nd:"nd", id:"id",oper:"oper",editoper:"edit",addoper:"add",deloper:"del", subgridid:"id", npage: null, totalrows:"totalrows"},
+ forceFit : false,
+ gridstate : "visible",
+ cellEdit: false,
+ cellsubmit: "remote",
+ nv:0,
+ loadui: "enable",
+ toolbar: [false,""],
+ scroll: false,
+ multiboxonly : false,
+ deselectAfterSort : true,
+ scrollrows : false,
+ autowidth: false,
+ scrollOffset :18,
+ cellLayout: 5,
+ subGridWidth: 20,
+ multiselectWidth: 20,
+ gridview: false,
+ rownumWidth: 25,
+ rownumbers : false,
+ pagerpos: 'center',
+ recordpos: 'right',
+ footerrow : false,
+ userDataOnFooter : false,
+ hoverrows : true,
+ altclass : 'ui-priority-secondary',
+ viewsortcols : [false,'vertical',true],
+ resizeclass : '',
+ autoencode : false,
+ remapColumns : [],
+ ajaxGridOptions :{},
+ direction : "ltr",
+ toppager: false,
+ headertitles: false,
+ scrollTimeout: 40,
+ data : [],
+ _index : {},
+ grouping : false,
+ groupingView : {groupField:[],groupOrder:[], groupText:[],groupColumnShow:[],groupSummary:[], showSummaryOnHide: false, sortitems:[], sortnames:[], summary:[],summaryval:[], plusicon: 'ui-icon-circlesmall-plus', minusicon: 'ui-icon-circlesmall-minus'},
+ ignoreCase : false,
+ cmTemplate : {},
+ idPrefix : ""
+ }, $.jgrid.defaults, pin || {});
+ var ts= this, grid={
+ headers:[],
+ cols:[],
+ footers: [],
+ dragStart: function(i,x,y) {
+ this.resizing = { idx: i, startX: x.clientX, sOL : y[0]};
+ this.hDiv.style.cursor = "col-resize";
+ this.curGbox = $("#rs_m"+$.jgrid.jqID(p.id),"#gbox_"+$.jgrid.jqID(p.id));
+ this.curGbox.css({display:"block",left:y[0],top:y[1],height:y[2]});
+ $(ts).triggerHandler("jqGridResizeStart", [x, i]);
+ if($.isFunction(p.resizeStart)) { p.resizeStart.call(this,x,i); }
+ document.onselectstart=function(){return false;};
+ },
+ dragMove: function(x) {
+ if(this.resizing) {
+ var diff = x.clientX-this.resizing.startX,
+ h = this.headers[this.resizing.idx],
+ newWidth = p.direction === "ltr" ? h.width + diff : h.width - diff, hn, nWn;
+ if(newWidth > 33) {
+ this.curGbox.css({left:this.resizing.sOL+diff});
+ if(p.forceFit===true ){
+ hn = this.headers[this.resizing.idx+p.nv];
+ nWn = p.direction === "ltr" ? hn.width - diff : hn.width + diff;
+ if(nWn >33) {
+ h.newWidth = newWidth;
+ hn.newWidth = nWn;
+ }
+ } else {
+ this.newWidth = p.direction === "ltr" ? p.tblwidth+diff : p.tblwidth-diff;
+ h.newWidth = newWidth;
+ }
+ }
+ }
+ },
+ dragEnd: function() {
+ this.hDiv.style.cursor = "default";
+ if(this.resizing) {
+ var idx = this.resizing.idx,
+ nw = this.headers[idx].newWidth || this.headers[idx].width;
+ nw = parseInt(nw,10);
+ this.resizing = false;
+ $("#rs_m"+$.jgrid.jqID(p.id)).css("display","none");
+ p.colModel[idx].width = nw;
+ this.headers[idx].width = nw;
+ this.headers[idx].el.style.width = nw + "px";
+ this.cols[idx].style.width = nw+"px";
+ if(this.footers.length>0) {this.footers[idx].style.width = nw+"px";}
+ if(p.forceFit===true){
+ nw = this.headers[idx+p.nv].newWidth || this.headers[idx+p.nv].width;
+ this.headers[idx+p.nv].width = nw;
+ this.headers[idx+p.nv].el.style.width = nw + "px";
+ this.cols[idx+p.nv].style.width = nw+"px";
+ if(this.footers.length>0) {this.footers[idx+p.nv].style.width = nw+"px";}
+ p.colModel[idx+p.nv].width = nw;
+ } else {
+ p.tblwidth = this.newWidth || p.tblwidth;
+ $('table:first',this.bDiv).css("width",p.tblwidth+"px");
+ $('table:first',this.hDiv).css("width",p.tblwidth+"px");
+ this.hDiv.scrollLeft = this.bDiv.scrollLeft;
+ if(p.footerrow) {
+ $('table:first',this.sDiv).css("width",p.tblwidth+"px");
+ this.sDiv.scrollLeft = this.bDiv.scrollLeft;
+ }
+ }
+ $(ts).triggerHandler("jqGridResizeStop", [nw, idx]);
+ if($.isFunction(p.resizeStop)) { p.resizeStop.call(this,nw,idx); }
+ }
+ this.curGbox = null;
+ document.onselectstart=function(){return true;};
+ },
+ populateVisible: function() {
+ if (grid.timer) { clearTimeout(grid.timer); }
+ grid.timer = null;
+ var dh = $(grid.bDiv).height();
+ if (!dh) { return; }
+ var table = $("table:first", grid.bDiv);
+ var rows, rh;
+ if(table[0].rows.length) {
+ try {
+ rows = table[0].rows[1];
+ rh = rows ? $(rows).outerHeight() || grid.prevRowHeight : grid.prevRowHeight;
+ } catch (pv) {
+ rh = grid.prevRowHeight;
+ }
+ }
+ if (!rh) { return; }
+ grid.prevRowHeight = rh;
+ var rn = p.rowNum;
+ var scrollTop = grid.scrollTop = grid.bDiv.scrollTop;
+ var ttop = Math.round(table.position().top) - scrollTop;
+ var tbot = ttop + table.height();
+ var div = rh * rn;
+ var page, npage, empty;
+ if ( tbot < dh && ttop <= 0 &&
+ (p.lastpage===undefined||parseInt((tbot + scrollTop + div - 1) / div,10) <= p.lastpage))
+ {
+ npage = parseInt((dh - tbot + div - 1) / div,10);
+ if (tbot >= 0 || npage < 2 || p.scroll === true) {
+ page = Math.round((tbot + scrollTop) / div) + 1;
+ ttop = -1;
+ } else {
+ ttop = 1;
+ }
+ }
+ if (ttop > 0) {
+ page = parseInt(scrollTop / div,10) + 1;
+ npage = parseInt((scrollTop + dh) / div,10) + 2 - page;
+ empty = true;
+ }
+ if (npage) {
+ if (p.lastpage && page > p.lastpage || p.lastpage==1 || (page === p.page && page===p.lastpage) ) {
+ return;
+ }
+ if (grid.hDiv.loading) {
+ grid.timer = setTimeout(grid.populateVisible, p.scrollTimeout);
+ } else {
+ p.page = page;
+ if (empty) {
+ grid.selectionPreserver(table[0]);
+ grid.emptyRows.call(table[0], false, false);
+ }
+ grid.populate(npage);
+ }
+ }
+ },
+ scrollGrid: function( e ) {
+ if(p.scroll) {
+ var scrollTop = grid.bDiv.scrollTop;
+ if(grid.scrollTop === undefined) { grid.scrollTop = 0; }
+ if (scrollTop != grid.scrollTop) {
+ grid.scrollTop = scrollTop;
+ if (grid.timer) { clearTimeout(grid.timer); }
+ grid.timer = setTimeout(grid.populateVisible, p.scrollTimeout);
+ }
+ }
+ grid.hDiv.scrollLeft = grid.bDiv.scrollLeft;
+ if(p.footerrow) {
+ grid.sDiv.scrollLeft = grid.bDiv.scrollLeft;
+ }
+ if( e ) { e.stopPropagation(); }
+ },
+ selectionPreserver : function(ts) {
+ var p = ts.p,
+ sr = p.selrow, sra = p.selarrrow ? $.makeArray(p.selarrrow) : null,
+ left = ts.grid.bDiv.scrollLeft,
+ restoreSelection = function() {
+ var i;
+ p.selrow = null;
+ p.selarrrow = [];
+ if(p.multiselect && sra && sra.length>0) {
+ for(i=0;i<sra.length;i++){
+ if (sra[i] != sr) {
+ $(ts).jqGrid("setSelection",sra[i],false, null);
+ }
+ }
+ }
+ if (sr) {
+ $(ts).jqGrid("setSelection",sr,false,null);
+ }
+ ts.grid.bDiv.scrollLeft = left;
+ $(ts).unbind('.selectionPreserver', restoreSelection);
+ };
+ $(ts).bind('jqGridGridComplete.selectionPreserver', restoreSelection);
+ }
+ };
+ if(this.tagName.toUpperCase()!='TABLE') {
+ alert("Element is not a table");
+ return;
+ }
+ if(document.documentMode !== undefined ) { // IE only
+ if(document.documentMode <= 5) {
+ alert("Grid can not be used in this ('quirks') mode!");
+ return;
+ }
+ }
+ $(this).empty().attr("tabindex","1");
+ this.p = p ;
+ this.p.useProp = !!$.fn.prop;
+ var i, dir;
+ if(this.p.colNames.length === 0) {
+ for (i=0;i<this.p.colModel.length;i++){
+ this.p.colNames[i] = this.p.colModel[i].label || this.p.colModel[i].name;
+ }
+ }
+ if( this.p.colNames.length !== this.p.colModel.length ) {
+ alert($.jgrid.errors.model);
+ return;
+ }
+ var gv = $("<div class='ui-jqgrid-view'></div>"), ii,
+ isMSIE = $.browser.msie ? true:false;
+ ts.p.direction = $.trim(ts.p.direction.toLowerCase());
+ if($.inArray(ts.p.direction,["ltr","rtl"]) == -1) { ts.p.direction = "ltr"; }
+ dir = ts.p.direction;
+
+ $(gv).insertBefore(this);
+ $(this).appendTo(gv).removeClass("scroll");
+ var eg = $("<div class='ui-jqgrid ui-widget ui-widget-content ui-corner-all'></div>");
+ $(eg).insertBefore(gv).attr({"id" : "gbox_"+this.id,"dir":dir});
+ $(gv).appendTo(eg).attr("id","gview_"+this.id);
+ if (isMSIE && $.browser.version <= 6) {
+ ii = '<iframe style="display:block;position:absolute;z-index:-1;filter:Alpha(Opacity=\'0\');" src="javascript:false;"></iframe>';
+ } else { ii="";}
+ $("<div class='ui-widget-overlay jqgrid-overlay' id='lui_"+this.id+"'></div>").append(ii).insertBefore(gv);
+ $("<div class='loading ui-state-default ui-state-active' id='load_"+this.id+"'>"+this.p.loadtext+"</div>").insertBefore(gv);
+ $(this).attr({cellspacing:"0",cellpadding:"0",border:"0","role":"grid","aria-multiselectable":!!this.p.multiselect,"aria-labelledby":"gbox_"+this.id});
+ var sortkeys = ["shiftKey","altKey","ctrlKey"],
+ intNum = function(val,defval) {
+ val = parseInt(val,10);
+ if (isNaN(val)) { return defval ? defval : 0;}
+ else {return val;}
+ },
+ formatCol = function (pos, rowInd, tv, rawObject, rowId, rdata){
+ var cm = ts.p.colModel[pos],
+ ral = cm.align, result="style=\"", clas = cm.classes, nm = cm.name, celp, acp=[];
+ if(ral) { result += "text-align:"+ral+";"; }
+ if(cm.hidden===true) { result += "display:none;"; }
+ if(rowInd===0) {
+ result += "width: "+grid.headers[pos].width+"px;";
+ } else if (cm.cellattr && $.isFunction(cm.cellattr))
+ {
+ celp = cm.cellattr.call(ts, rowId, tv, rawObject, cm, rdata);
+ if(celp && typeof(celp) === "string") {
+ celp = celp.replace(/style/i,'style').replace(/title/i,'title');
+ if(celp.indexOf('title') > -1) { cm.title=false;}
+ if(celp.indexOf('class') > -1) { clas = undefined;}
+ acp = celp.split("style");
+ if(acp.length === 2 ) {
+ acp[1] = $.trim(acp[1].replace("=",""));
+ if(acp[1].indexOf("'") === 0 || acp[1].indexOf('"') === 0) {
+ acp[1] = acp[1].substring(1);
+ }
+ result += acp[1].replace(/'/gi,'"');
+ } else {
+ result += "\"";
+ }
+ }
+ }
+ if(!acp.length) { acp[0] = ""; result += "\"";}
+ result += (clas !== undefined ? (" class=\""+clas+"\"") :"") + ((cm.title && tv) ? (" title=\""+$.jgrid.stripHtml(tv)+"\"") :"");
+ result += " aria-describedby=\""+ts.p.id+"_"+nm+"\"";
+ return result + acp[0];
+ },
+ cellVal = function (val) {
+ return val === undefined || val === null || val === "" ? " " : (ts.p.autoencode ? $.jgrid.htmlEncode(val) : val+"");
+ },
+ formatter = function (rowId, cellval , colpos, rwdat, _act){
+ var cm = ts.p.colModel[colpos],v;
+ if(typeof cm.formatter !== 'undefined') {
+ var opts= {rowId: rowId, colModel:cm, gid:ts.p.id, pos:colpos };
+ if($.isFunction( cm.formatter ) ) {
+ v = cm.formatter.call(ts,cellval,opts,rwdat,_act);
+ } else if($.fmatter){
+ v = $.fn.fmatter.call(ts,cm.formatter,cellval,opts,rwdat,_act);
+ } else {
+ v = cellVal(cellval);
+ }
+ } else {
+ v = cellVal(cellval);
+ }
+ return v;
+ },
+ addCell = function(rowId,cell,pos,irow, srvr) {
+ var v,prp;
+ v = formatter(rowId,cell,pos,srvr,'add');
+ prp = formatCol( pos,irow, v, srvr, rowId, true);
+ return "<td role=\"gridcell\" "+prp+">"+v+"</td>";
+ },
+ addMulti = function(rowid,pos,irow,checked){
+ var v = "<input role=\"checkbox\" type=\"checkbox\""+" id=\"jqg_"+ts.p.id+"_"+rowid+"\" class=\"cbox\" name=\"jqg_"+ts.p.id+"_"+rowid+"\"" + ((checked) ? "checked=\"checked\"" : "")+"/>",
+ prp = formatCol( pos,irow,'',null, rowid, true);
+ return "<td role=\"gridcell\" "+prp+">"+v+"</td>";
+ },
+ addRowNum = function (pos,irow,pG,rN) {
+ var v = (parseInt(pG,10)-1)*parseInt(rN,10)+1+irow,
+ prp = formatCol( pos,irow,v, null, irow, true);
+ return "<td role=\"gridcell\" class=\"ui-state-default jqgrid-rownum\" "+prp+">"+v+"</td>";
+ },
+ reader = function (datatype) {
+ var field, f=[], j=0, i;
+ for(i =0; i<ts.p.colModel.length; i++){
+ field = ts.p.colModel[i];
+ if (field.name !== 'cb' && field.name !=='subgrid' && field.name !=='rn') {
+ f[j]= datatype == "local" ?
+ field.name :
+ ( (datatype=="xml" || datatype === "xmlstring") ? field.xmlmap || field.name : field.jsonmap || field.name );
+ j++;
+ }
+ }
+ return f;
+ },
+ orderedCols = function (offset) {
+ var order = ts.p.remapColumns;
+ if (!order || !order.length) {
+ order = $.map(ts.p.colModel, function(v,i) { return i; });
+ }
+ if (offset) {
+ order = $.map(order, function(v) { return v<offset?null:v-offset; });
+ }
+ return order;
+ },
+ emptyRows = function (scroll, locdata) {
+ var firstrow;
+ if (this.p.deepempty) {
+ $(this.rows).slice(1).remove();
+ } else {
+ firstrow = this.rows.length > 0 ? this.rows[0] : null;
+ $(this.firstChild).empty().append(firstrow);
+ }
+ if (scroll && this.p.scroll) {
+ $(this.grid.bDiv.firstChild).css({height: "auto"});
+ $(this.grid.bDiv.firstChild.firstChild).css({height: 0, display: "none"});
+ if (this.grid.bDiv.scrollTop !== 0) {
+ this.grid.bDiv.scrollTop = 0;
+ }
+ }
+ if(locdata === true && this.p.treeGrid) {
+ this.p.data = []; this.p._index = {};
+ }
+ },
+ refreshIndex = function() {
+ var datalen = ts.p.data.length, idname, i, val,
+ ni = ts.p.rownumbers===true ? 1 :0,
+ gi = ts.p.multiselect ===true ? 1 :0,
+ si = ts.p.subGrid===true ? 1 :0;
+
+ if(ts.p.keyIndex === false || ts.p.loadonce === true) {
+ idname = ts.p.localReader.id;
+ } else {
+ idname = ts.p.colModel[ts.p.keyIndex+gi+si+ni].name;
+ }
+ for(i =0;i < datalen; i++) {
+ val = $.jgrid.getAccessor(ts.p.data[i],idname);
+ ts.p._index[val] = i;
+ }
+ },
+ constructTr = function(id, hide, altClass, rd, cur, selected) {
+ var tabindex = '-1', restAttr = '', attrName, style = hide ? 'display:none;' : '',
+ classes = 'ui-widget-content jqgrow ui-row-' + ts.p.direction + altClass + ((selected) ? ' ui-state-highlight' : ''),
+ rowAttrObj = $.isFunction(ts.p.rowattr) ? ts.p.rowattr.call(ts, rd, cur) : {};
+ if(!$.isEmptyObject( rowAttrObj )) {
+ if (rowAttrObj.hasOwnProperty("id")) {
+ id = rowAttrObj.id;
+ delete rowAttrObj.id;
+ }
+ if (rowAttrObj.hasOwnProperty("tabindex")) {
+ tabindex = rowAttrObj.tabindex;
+ delete rowAttrObj.tabindex;
+ }
+ if (rowAttrObj.hasOwnProperty("style")) {
+ style += rowAttrObj.style;
+ delete rowAttrObj.style;
+ }
+ if (rowAttrObj.hasOwnProperty("class")) {
+ classes += ' ' + rowAttrObj['class'];
+ delete rowAttrObj['class'];
+ }
+ // dot't allow to change role attribute
+ try { delete rowAttrObj.role; } catch(ra){}
+ for (attrName in rowAttrObj) {
+ if (rowAttrObj.hasOwnProperty(attrName)) {
+ restAttr += ' ' + attrName + '=' + rowAttrObj[attrName];
+ }
+ }
+ }
+ return '<tr role="row" id="' + id + '" tabindex="' + tabindex + '" class="' + classes + '"' +
+ (style === '' ? '' : ' style="' + style + '"') + restAttr + '>';
+ },
+ addXmlData = function (xml,t, rcnt, more, adjust) {
+ var startReq = new Date(),
+ locdata = (ts.p.datatype != "local" && ts.p.loadonce) || ts.p.datatype == "xmlstring",
+ xmlid = "_id_", xmlRd = ts.p.xmlReader,
+ frd = ts.p.datatype == "local" ? "local" : "xml";
+ if(locdata) {
+ ts.p.data = [];
+ ts.p._index = {};
+ ts.p.localReader.id = xmlid;
+ }
+ ts.p.reccount = 0;
+ if($.isXMLDoc(xml)) {
+ if(ts.p.treeANode===-1 && !ts.p.scroll) {
+ emptyRows.call(ts, false, true);
+ rcnt=1;
+ } else { rcnt = rcnt > 1 ? rcnt :1; }
+ } else { return; }
+ var i,fpos,ir=0,v,gi=ts.p.multiselect===true?1:0,si=ts.p.subGrid===true?1:0,ni=ts.p.rownumbers===true?1:0,idn, getId,f=[],F,rd ={}, xmlr,rid, rowData=[], cn=(ts.p.altRows === true) ? " "+ts.p.altclass:"",cn1;
+ if(!xmlRd.repeatitems) {f = reader(frd);}
+ if( ts.p.keyIndex===false) {
+ idn = $.isFunction( xmlRd.id ) ? xmlRd.id.call(ts, xml) : xmlRd.id;
+ } else {
+ idn = ts.p.keyIndex;
+ }
+ if(f.length>0 && !isNaN(idn)) {
+ if (ts.p.remapColumns && ts.p.remapColumns.length) {
+ idn = $.inArray(idn, ts.p.remapColumns);
+ }
+ idn=f[idn];
+ }
+ if( (idn+"").indexOf("[") === -1 ) {
+ if (f.length) {
+ getId = function( trow, k) {return $(idn,trow).text() || k;};
+ } else {
+ getId = function( trow, k) {return $(xmlRd.cell,trow).eq(idn).text() || k;};
+ }
+ }
+ else {
+ getId = function( trow, k) {return trow.getAttribute(idn.replace(/[\[\]]/g,"")) || k;};
+ }
+ ts.p.userData = {};
+ ts.p.page = $.jgrid.getXmlData( xml,xmlRd.page ) || ts.p.page || 0;
+ ts.p.lastpage = $.jgrid.getXmlData( xml,xmlRd.total );
+ if(ts.p.lastpage===undefined) { ts.p.lastpage=1; }
+ ts.p.records = $.jgrid.getXmlData( xml,xmlRd.records ) || 0;
+ if($.isFunction(xmlRd.userdata)) {
+ ts.p.userData = xmlRd.userdata.call(ts, xml) || {};
+ } else {
+ $.jgrid.getXmlData(xml, xmlRd.userdata, true).each(function() {ts.p.userData[this.getAttribute("name")]= $(this).text();});
+ }
+ var gxml = $.jgrid.getXmlData( xml, xmlRd.root, true);
+ gxml = $.jgrid.getXmlData( gxml, xmlRd.row, true);
+ if (!gxml) { gxml = []; }
+ var gl = gxml.length, j=0, grpdata=[], rn = parseInt(ts.p.rowNum,10);
+ if (gl > 0 && ts.p.page <= 0) { ts.p.page = 1; }
+ if(gxml && gl){
+ var br=ts.p.scroll?$.jgrid.randId():1,altr;
+ if (adjust) { rn *= adjust+1; }
+ var afterInsRow = $.isFunction(ts.p.afterInsertRow), hiderow=ts.p.grouping && ts.p.groupingView.groupCollapse === true;
+ while (j<gl) {
+ xmlr = gxml[j];
+ rid = getId(xmlr,br+j);
+ rid = ts.p.idPrefix + rid;
+ altr = rcnt === 0 ? 0 : rcnt+1;
+ cn1 = (altr+j)%2 == 1 ? cn : '';
+ var iStartTrTag = rowData.length;
+ rowData.push("");
+ if( ni ) {
+ rowData.push( addRowNum(0,j,ts.p.page,ts.p.rowNum) );
+ }
+ if( gi ) {
+ rowData.push( addMulti(rid,ni,j, false) );
+ }
+ if( si ) {
+ rowData.push( $(ts).jqGrid("addSubGridCell",gi+ni,j+rcnt) );
+ }
+ if(xmlRd.repeatitems){
+ if (!F) { F=orderedCols(gi+si+ni); }
+ var cells = $.jgrid.getXmlData( xmlr, xmlRd.cell, true);
+ $.each(F, function (k) {
+ var cell = cells[this];
+ if (!cell) { return false; }
+ v = cell.textContent || cell.text;
+ rd[ts.p.colModel[k+gi+si+ni].name] = v;
+ rowData.push( addCell(rid,v,k+gi+si+ni,j+rcnt,xmlr) );
+ });
+ } else {
+ for(i = 0; i < f.length;i++) {
+ v = $.jgrid.getXmlData( xmlr, f[i]);
+ rd[ts.p.colModel[i+gi+si+ni].name] = v;
+ rowData.push( addCell(rid, v, i+gi+si+ni, j+rcnt, xmlr) );
+ }
+ }
+ rowData[iStartTrTag] = constructTr(rid, hiderow, cn1, rd, xmlr, false);
+ rowData.push("</tr>");
+ if(ts.p.grouping) {
+ grpdata = $(ts).jqGrid('groupingPrepare',rowData, grpdata, rd, j);
+ rowData = [];
+ }
+ if(locdata || ts.p.treeGrid === true) {
+ rd[xmlid] = rid;
+ ts.p.data.push(rd);
+ ts.p._index[rid] = ts.p.data.length-1;
+ }
+ if(ts.p.gridview === false ) {
+ $("tbody:first",t).append(rowData.join(''));
+ $(ts).triggerHandler("jqGridAfterInsertRow", [rid, rd, xmlr]);
+ if(afterInsRow) {ts.p.afterInsertRow.call(ts,rid,rd,xmlr);}
+ rowData=[];
+ }
+ rd={};
+ ir++;
+ j++;
+ if(ir==rn) {break;}
+ }
+ }
+ if(ts.p.gridview === true) {
+ fpos = ts.p.treeANode > -1 ? ts.p.treeANode: 0;
+ if(ts.p.grouping) {
+ $(ts).jqGrid('groupingRender',grpdata,ts.p.colModel.length);
+ grpdata = null;
+ } else if(ts.p.treeGrid === true && fpos > 0) {
+ $(ts.rows[fpos]).after(rowData.join(''));
+ } else {
+ $("tbody:first",t).append(rowData.join(''));
+ }
+ }
+ if(ts.p.subGrid === true ) {
+ try {$(ts).jqGrid("addSubGrid",gi+ni);} catch (_){}
+ }
+ ts.p.totaltime = new Date() - startReq;
+ if(ir>0) { if(ts.p.records===0) { ts.p.records=gl;} }
+ rowData =null;
+ if( ts.p.treeGrid === true) {
+ try {$(ts).jqGrid("setTreeNode", fpos+1, ir+fpos+1);} catch (e) {}
+ }
+ if(!ts.p.treeGrid && !ts.p.scroll) {ts.grid.bDiv.scrollTop = 0;}
+ ts.p.reccount=ir;
+ ts.p.treeANode = -1;
+ if(ts.p.userDataOnFooter) { $(ts).jqGrid("footerData","set",ts.p.userData,true); }
+ if(locdata) {
+ ts.p.records = gl;
+ ts.p.lastpage = Math.ceil(gl/ rn);
+ }
+ if (!more) { ts.updatepager(false,true); }
+ if(locdata) {
+ while (ir<gl) {
+ xmlr = gxml[ir];
+ rid = getId(xmlr,ir+br);
+ rid = ts.p.idPrefix + rid;
+ if(xmlRd.repeatitems){
+ if (!F) { F=orderedCols(gi+si+ni); }
+ var cells2 = $.jgrid.getXmlData( xmlr, xmlRd.cell, true);
+ $.each(F, function (k) {
+ var cell = cells2[this];
+ if (!cell) { return false; }
+ v = cell.textContent || cell.text;
+ rd[ts.p.colModel[k+gi+si+ni].name] = v;
+ });
+ } else {
+ for(i = 0; i < f.length;i++) {
+ v = $.jgrid.getXmlData( xmlr, f[i]);
+ rd[ts.p.colModel[i+gi+si+ni].name] = v;
+ }
+ }
+ rd[xmlid] = rid;
+ ts.p.data.push(rd);
+ ts.p._index[rid] = ts.p.data.length-1;
+ rd = {};
+ ir++;
+ }
+ }
+ },
+ addJSONData = function(data,t, rcnt, more, adjust) {
+ var startReq = new Date();
+ if(data) {
+ if(ts.p.treeANode === -1 && !ts.p.scroll) {
+ emptyRows.call(ts, false, true);
+ rcnt=1;
+ } else { rcnt = rcnt > 1 ? rcnt :1; }
+ } else { return; }
+
+ var dReader, locid = "_id_", frd,
+ locdata = (ts.p.datatype != "local" && ts.p.loadonce) || ts.p.datatype == "jsonstring";
+ if(locdata) { ts.p.data = []; ts.p._index = {}; ts.p.localReader.id = locid;}
+ ts.p.reccount = 0;
+ if(ts.p.datatype == "local") {
+ dReader = ts.p.localReader;
+ frd= 'local';
+ } else {
+ dReader = ts.p.jsonReader;
+ frd='json';
+ }
+ var ir=0,v,i,j,f=[],F,cur,gi=ts.p.multiselect?1:0,si=ts.p.subGrid?1:0,ni=ts.p.rownumbers===true?1:0,len,drows,idn,rd={}, fpos, idr,rowData=[],cn=(ts.p.altRows === true) ? " "+ts.p.altclass:"",cn1,lp;
+ ts.p.page = $.jgrid.getAccessor(data,dReader.page) || ts.p.page || 0;
+ lp = $.jgrid.getAccessor(data,dReader.total);
+ ts.p.lastpage = lp === undefined ? 1 : lp;
+ ts.p.records = $.jgrid.getAccessor(data,dReader.records) || 0;
+ ts.p.userData = $.jgrid.getAccessor(data,dReader.userdata) || {};
+ if(!dReader.repeatitems) {
+ F = f = reader(frd);
+ }
+ if( ts.p.keyIndex===false ) {
+ idn = $.isFunction(dReader.id) ? dReader.id.call(ts, data) : dReader.id;
+ } else {
+ idn = ts.p.keyIndex;
+ }
+ if(f.length>0 && !isNaN(idn)) {
+ if (ts.p.remapColumns && ts.p.remapColumns.length) {
+ idn = $.inArray(idn, ts.p.remapColumns);
+ }
+ idn=f[idn];
+ }
+ drows = $.jgrid.getAccessor(data,dReader.root);
+ if (!drows) { drows = []; }
+ len = drows.length; i=0;
+ if (len > 0 && ts.p.page <= 0) { ts.p.page = 1; }
+ var rn = parseInt(ts.p.rowNum,10),br=ts.p.scroll?$.jgrid.randId():1, altr, selected=false, selr;
+ if (adjust) { rn *= adjust+1; }
+ if(ts.p.datatype === "local" && !ts.p.deselectAfterSort) {
+ selected = true;
+ }
+ var afterInsRow = $.isFunction(ts.p.afterInsertRow), grpdata=[], hiderow=ts.p.grouping && ts.p.groupingView.groupCollapse === true;
+ while (i<len) {
+ cur = drows[i];
+ idr = $.jgrid.getAccessor(cur,idn);
+ if(idr === undefined) {
+ idr = br+i;
+ if(f.length===0){
+ if(dReader.cell){
+ var ccur = $.jgrid.getAccessor(cur,dReader.cell);
+ idr = ccur !== undefined ? ccur[idn] || idr : idr;
+ ccur=null;
+ }
+ }
+ }
+ idr = ts.p.idPrefix + idr;
+ altr = rcnt === 1 ? 0 : rcnt;
+ cn1 = (altr+i)%2 == 1 ? cn : '';
+ if( selected) {
+ if( ts.p.multiselect) {
+ selr = ($.inArray(idr, ts.p.selarrrow) !== -1);
+ } else {
+ selr = (idr === ts.p.selrow);
+ }
+ }
+ var iStartTrTag = rowData.length;
+ rowData.push("");
+ if( ni ) {
+ rowData.push( addRowNum(0,i,ts.p.page,ts.p.rowNum) );
+ }
+ if( gi ){
+ rowData.push( addMulti(idr,ni,i,selr) );
+ }
+ if( si ) {
+ rowData.push( $(ts).jqGrid("addSubGridCell",gi+ni,i+rcnt) );
+ }
+ if (dReader.repeatitems) {
+ if(dReader.cell) {cur = $.jgrid.getAccessor(cur,dReader.cell);}
+ if (!F) { F=orderedCols(gi+si+ni); }
+ }
+ for (j=0;j<F.length;j++) {
+ v = $.jgrid.getAccessor(cur,F[j]);
+ rowData.push( addCell(idr,v,j+gi+si+ni,i+rcnt,cur) );
+ rd[ts.p.colModel[j+gi+si+ni].name] = v;
+ }
+ rowData[iStartTrTag] = constructTr(idr, hiderow, cn1, rd, cur, selr);
+ rowData.push( "</tr>" );
+ if(ts.p.grouping) {
+ grpdata = $(ts).jqGrid('groupingPrepare',rowData, grpdata, rd, i);
+ rowData = [];
+ }
+ if(locdata || ts.p.treeGrid===true) {
+ rd[locid] = idr;
+ ts.p.data.push(rd);
+ ts.p._index[idr] = ts.p.data.length-1;
+ }
+ if(ts.p.gridview === false ) {
+ $("#"+$.jgrid.jqID(ts.p.id)+" tbody:first").append(rowData.join(''));
+ $(ts).triggerHandler("jqGridAfterInsertRow", [idr, rd, cur]);
+ if(afterInsRow) {ts.p.afterInsertRow.call(ts,idr,rd,cur);}
+ rowData=[];//ari=0;
+ }
+ rd={};
+ ir++;
+ i++;
+ if(ir==rn) { break; }
+ }
+ if(ts.p.gridview === true ) {
+ fpos = ts.p.treeANode > -1 ? ts.p.treeANode: 0;
+ if(ts.p.grouping) {
+ $(ts).jqGrid('groupingRender',grpdata,ts.p.colModel.length);
+ grpdata = null;
+ } else if(ts.p.treeGrid === true && fpos > 0) {
+ $(ts.rows[fpos]).after(rowData.join(''));
+ } else {
+ $("#"+$.jgrid.jqID(ts.p.id)+" tbody:first").append(rowData.join(''));
+ }
+ }
+ if(ts.p.subGrid === true ) {
+ try { $(ts).jqGrid("addSubGrid",gi+ni);} catch (_){}
+ }
+ ts.p.totaltime = new Date() - startReq;
+ if(ir>0) {
+ if(ts.p.records===0) { ts.p.records=len; }
+ }
+ rowData = null;
+ if( ts.p.treeGrid === true) {
+ try {$(ts).jqGrid("setTreeNode", fpos+1, ir+fpos+1);} catch (e) {}
+ }
+ if(!ts.p.treeGrid && !ts.p.scroll) {ts.grid.bDiv.scrollTop = 0;}
+ ts.p.reccount=ir;
+ ts.p.treeANode = -1;
+ if(ts.p.userDataOnFooter) { $(ts).jqGrid("footerData","set",ts.p.userData,true); }
+ if(locdata) {
+ ts.p.records = len;
+ ts.p.lastpage = Math.ceil(len/ rn);
+ }
+ if (!more) { ts.updatepager(false,true); }
+ if(locdata) {
+ while (ir<len && drows[ir]) {
+ cur = drows[ir];
+ idr = $.jgrid.getAccessor(cur,idn);
+ if(idr === undefined) {
+ idr = br+ir;
+ if(f.length===0){
+ if(dReader.cell){
+ var ccur2 = $.jgrid.getAccessor(cur,dReader.cell);
+ idr = ccur2[idn] || idr;
+ ccur2=null;
+ }
+ }
+ }
+ if(cur) {
+ idr = ts.p.idPrefix + idr;
+ if (dReader.repeatitems) {
+ if(dReader.cell) {cur = $.jgrid.getAccessor(cur,dReader.cell);}
+ if (!F) { F=orderedCols(gi+si+ni); }
+ }
+
+ for (j=0;j<F.length;j++) {
+ v = $.jgrid.getAccessor(cur,F[j]);
+ rd[ts.p.colModel[j+gi+si+ni].name] = v;
+ }
+ rd[locid] = idr;
+ ts.p.data.push(rd);
+ ts.p._index[idr] = ts.p.data.length-1;
+ rd = {};
+ }
+ ir++;
+ }
+ }
+ },
+ addLocalData = function() {
+ var st, fndsort=false, cmtypes={}, grtypes=[], grindexes=[], srcformat, sorttype, newformat;
+ if(!$.isArray(ts.p.data)) {
+ return;
+ }
+ var grpview = ts.p.grouping ? ts.p.groupingView : false, lengrp, gin;
+ $.each(ts.p.colModel,function(){
+ sorttype = this.sorttype || "text";
+ if(sorttype == "date" || sorttype == "datetime") {
+ if(this.formatter && typeof(this.formatter) === 'string' && this.formatter == 'date') {
+ if(this.formatoptions && this.formatoptions.srcformat) {
+ srcformat = this.formatoptions.srcformat;
+ } else {
+ srcformat = $.jgrid.formatter.date.srcformat;
+ }
+ if(this.formatoptions && this.formatoptions.newformat) {
+ newformat = this.formatoptions.newformat;
+ } else {
+ newformat = $.jgrid.formatter.date.newformat;
+ }
+ } else {
+ srcformat = newformat = this.datefmt || "Y-m-d";
+ }
+ cmtypes[this.name] = {"stype": sorttype, "srcfmt": srcformat,"newfmt":newformat};
+ } else {
+ cmtypes[this.name] = {"stype": sorttype, "srcfmt":'',"newfmt":''};
+ }
+ if(ts.p.grouping ) {
+ for(gin =0, lengrp = grpview.groupField.length; gin< lengrp; gin++) {
+ if( this.name == grpview.groupField[gin]) {
+ var grindex = this.name;
+ if (typeof this.index != 'undefined') {
+ grindex = this.index;
+ }
+ grtypes[gin] = cmtypes[grindex];
+ grindexes[gin]= grindex;
+ }
+ }
+ }
+ if(!fndsort && (this.index == ts.p.sortname || this.name == ts.p.sortname)){
+ st = this.name; // ???
+ fndsort = true;
+ }
+ });
+ if(ts.p.treeGrid) {
+ $(ts).jqGrid("SortTree", st, ts.p.sortorder, cmtypes[st].stype, cmtypes[st].srcfmt);
+ return;
+ }
+ var compareFnMap = {
+ 'eq':function(queryObj) {return queryObj.equals;},
+ 'ne':function(queryObj) {return queryObj.notEquals;},
+ 'lt':function(queryObj) {return queryObj.less;},
+ 'le':function(queryObj) {return queryObj.lessOrEquals;},
+ 'gt':function(queryObj) {return queryObj.greater;},
+ 'ge':function(queryObj) {return queryObj.greaterOrEquals;},
+ 'cn':function(queryObj) {return queryObj.contains;},
+ 'nc':function(queryObj,op) {return op === "OR" ? queryObj.orNot().contains : queryObj.andNot().contains;},
+ 'bw':function(queryObj) {return queryObj.startsWith;},
+ 'bn':function(queryObj,op) {return op === "OR" ? queryObj.orNot().startsWith : queryObj.andNot().startsWith;},
+ 'en':function(queryObj,op) {return op === "OR" ? queryObj.orNot().endsWith : queryObj.andNot().endsWith;},
+ 'ew':function(queryObj) {return queryObj.endsWith;},
+ 'ni':function(queryObj,op) {return op === "OR" ? queryObj.orNot().equals : queryObj.andNot().equals;},
+ 'in':function(queryObj) {return queryObj.equals;},
+ 'nu':function(queryObj) {return queryObj.isNull;},
+ 'nn':function(queryObj,op) {return op === "OR" ? queryObj.orNot().isNull : queryObj.andNot().isNull;}
+
+ },
+ query = $.jgrid.from(ts.p.data);
+ if (ts.p.ignoreCase) { query = query.ignoreCase(); }
+ function tojLinq ( group ) {
+ var s = 0, index, gor, ror, opr, rule;
+ if (group.groups !== undefined) {
+ gor = group.groups.length && group.groupOp.toString().toUpperCase() === "OR";
+ if (gor) {
+ query.orBegin();
+ }
+ for (index = 0; index < group.groups.length; index++) {
+ if (s > 0 && gor) {
+ query.or();
+ }
+ try {
+ tojLinq(group.groups[index]);
+ } catch (e) {alert(e);}
+ s++;
+ }
+ if (gor) {
+ query.orEnd();
+ }
+ }
+ if (group.rules !== undefined) {
+ if(s>0) {
+ var result = query.select();
+ query = $.jgrid.from( result);
+ if (ts.p.ignoreCase) { query = query.ignoreCase(); }
+ }
+ try{
+ ror = group.rules.length && group.groupOp.toString().toUpperCase() === "OR";
+ if (ror) {
+ query.orBegin();
+ }
+ for (index = 0; index < group.rules.length; index++) {
+ rule = group.rules[index];
+ opr = group.groupOp.toString().toUpperCase();
+ if (compareFnMap[rule.op] && rule.field ) {
+ if(s > 0 && opr && opr === "OR") {
+ query = query.or();
+ }
+ query = compareFnMap[rule.op](query, opr)(rule.field, rule.data, cmtypes[rule.field]);
+ }
+ s++;
+ }
+ if (ror) {
+ query.orEnd();
+ }
+ } catch (g) {alert(g);}
+ }
+ }
+
+ if (ts.p.search === true) {
+ var srules = ts.p.postData.filters;
+ if(srules) {
+ if(typeof srules == "string") { srules = $.jgrid.parse(srules);}
+ tojLinq( srules );
+ } else {
+ try {
+ query = compareFnMap[ts.p.postData.searchOper](query)(ts.p.postData.searchField, ts.p.postData.searchString,cmtypes[ts.p.postData.searchField]);
+ } catch (se){}
+ }
+ }
+ if(ts.p.grouping) {
+ for(gin=0; gin<lengrp;gin++) {
+ query.orderBy(grindexes[gin],grpview.groupOrder[gin],grtypes[gin].stype, grtypes[gin].srcfmt);
+ }
+ }
+ if (st && ts.p.sortorder && fndsort) {
+ if(ts.p.sortorder.toUpperCase() == "DESC") {
+ query.orderBy(ts.p.sortname, "d", cmtypes[st].stype, cmtypes[st].srcfmt);
+ } else {
+ query.orderBy(ts.p.sortname, "a", cmtypes[st].stype, cmtypes[st].srcfmt);
+ }
+ }
+ var queryResults = query.select(),
+ recordsperpage = parseInt(ts.p.rowNum,10),
+ total = queryResults.length,
+ page = parseInt(ts.p.page,10),
+ totalpages = Math.ceil(total / recordsperpage),
+ retresult = {};
+ queryResults = queryResults.slice( (page-1)*recordsperpage , page*recordsperpage );
+ query = null;
+ cmtypes = null;
+ retresult[ts.p.localReader.total] = totalpages;
+ retresult[ts.p.localReader.page] = page;
+ retresult[ts.p.localReader.records] = total;
+ retresult[ts.p.localReader.root] = queryResults;
+ retresult[ts.p.localReader.userdata] = ts.p.userData;
+ queryResults = null;
+ return retresult;
+ },
+ updatepager = function(rn, dnd) {
+ var cp, last, base, from,to,tot,fmt, pgboxes = "", sppg,
+ tspg = ts.p.pager ? "_"+$.jgrid.jqID(ts.p.pager.substr(1)) : "",
+ tspg_t = ts.p.toppager ? "_"+ts.p.toppager.substr(1) : "";
+ base = parseInt(ts.p.page,10)-1;
+ if(base < 0) { base = 0; }
+ base = base*parseInt(ts.p.rowNum,10);
+ to = base + ts.p.reccount;
+ if (ts.p.scroll) {
+ var rows = $("tbody:first > tr:gt(0)", ts.grid.bDiv);
+ base = to - rows.length;
+ ts.p.reccount = rows.length;
+ var rh = rows.outerHeight() || ts.grid.prevRowHeight;
+ if (rh) {
+ var top = base * rh;
+ var height = parseInt(ts.p.records,10) * rh;
+ $(">div:first",ts.grid.bDiv).css({height : height}).children("div:first").css({height:top,display:top?"":"none"});
+ }
+ ts.grid.bDiv.scrollLeft = ts.grid.hDiv.scrollLeft;
+ }
+ pgboxes = ts.p.pager ? ts.p.pager : "";
+ pgboxes += ts.p.toppager ? (pgboxes ? "," + ts.p.toppager : ts.p.toppager) : "";
+ if(pgboxes) {
+ fmt = $.jgrid.formatter.integer || {};
+ cp = intNum(ts.p.page);
+ last = intNum(ts.p.lastpage);
+ $(".selbox",pgboxes)[ this.p.useProp ? 'prop' : 'attr' ]("disabled",false);
+ if(ts.p.pginput===true) {
+ $('.ui-pg-input',pgboxes).val(ts.p.page);
+ sppg = ts.p.toppager ? '#sp_1'+tspg+",#sp_1"+tspg_t : '#sp_1'+tspg;
+ $(sppg).html($.fmatter ? $.fmatter.util.NumberFormat(ts.p.lastpage,fmt):ts.p.lastpage);
+
+ }
+ if (ts.p.viewrecords){
+ if(ts.p.reccount === 0) {
+ $(".ui-paging-info",pgboxes).html(ts.p.emptyrecords);
+ } else {
+ from = base+1;
+ tot=ts.p.records;
+ if($.fmatter) {
+ from = $.fmatter.util.NumberFormat(from,fmt);
+ to = $.fmatter.util.NumberFormat(to,fmt);
+ tot = $.fmatter.util.NumberFormat(tot,fmt);
+ }
+ $(".ui-paging-info",pgboxes).html($.jgrid.format(ts.p.recordtext,from,to,tot));
+ }
+ }
+ if(ts.p.pgbuttons===true) {
+ if(cp<=0) {cp = last = 0;}
+ if(cp==1 || cp === 0) {
+ $("#first"+tspg+", #prev"+tspg).addClass('ui-state-disabled').removeClass('ui-state-hover');
+ if(ts.p.toppager) { $("#first_t"+tspg_t+", #prev_t"+tspg_t).addClass('ui-state-disabled').removeClass('ui-state-hover'); }
+ } else {
+ $("#first"+tspg+", #prev"+tspg).removeClass('ui-state-disabled');
+ if(ts.p.toppager) { $("#first_t"+tspg_t+", #prev_t"+tspg_t).removeClass('ui-state-disabled'); }
+ }
+ if(cp==last || cp === 0) {
+ $("#next"+tspg+", #last"+tspg).addClass('ui-state-disabled').removeClass('ui-state-hover');
+ if(ts.p.toppager) { $("#next_t"+tspg_t+", #last_t"+tspg_t).addClass('ui-state-disabled').removeClass('ui-state-hover'); }
+ } else {
+ $("#next"+tspg+", #last"+tspg).removeClass('ui-state-disabled');
+ if(ts.p.toppager) { $("#next_t"+tspg_t+", #last_t"+tspg_t).removeClass('ui-state-disabled'); }
+ }
+ }
+ }
+ if(rn===true && ts.p.rownumbers === true) {
+ $("td.jqgrid-rownum",ts.rows).each(function(i){
+ $(this).html(base+1+i);
+ });
+ }
+ if(dnd && ts.p.jqgdnd) { $(ts).jqGrid('gridDnD','updateDnD');}
+ $(ts).triggerHandler("jqGridGridComplete");
+ if($.isFunction(ts.p.gridComplete)) {ts.p.gridComplete.call(ts);}
+ $(ts).triggerHandler("jqGridAfterGridComplete");
+ },
+ beginReq = function() {
+ ts.grid.hDiv.loading = true;
+ if(ts.p.hiddengrid) { return;}
+ switch(ts.p.loadui) {
+ case "disable":
+ break;
+ case "enable":
+ $("#load_"+$.jgrid.jqID(ts.p.id)).show();
+ break;
+ case "block":
+ $("#lui_"+$.jgrid.jqID(ts.p.id)).show();
+ $("#load_"+$.jgrid.jqID(ts.p.id)).show();
+ break;
+ }
+ },
+ endReq = function() {
+ ts.grid.hDiv.loading = false;
+ switch(ts.p.loadui) {
+ case "disable":
+ break;
+ case "enable":
+ $("#load_"+$.jgrid.jqID(ts.p.id)).hide();
+ break;
+ case "block":
+ $("#lui_"+$.jgrid.jqID(ts.p.id)).hide();
+ $("#load_"+$.jgrid.jqID(ts.p.id)).hide();
+ break;
+ }
+ },
+ populate = function (npage) {
+ if(!ts.grid.hDiv.loading) {
+ var pvis = ts.p.scroll && npage === false,
+ prm = {}, dt, dstr, pN=ts.p.prmNames;
+ if(ts.p.page <=0) { ts.p.page = 1; }
+ if(pN.search !== null) {prm[pN.search] = ts.p.search;} if(pN.nd !== null) {prm[pN.nd] = new Date().getTime();}
+ if(pN.rows !== null) {prm[pN.rows]= ts.p.rowNum;} if(pN.page !== null) {prm[pN.page]= ts.p.page;}
+ if(pN.sort !== null) {prm[pN.sort]= ts.p.sortname;} if(pN.order !== null) {prm[pN.order]= ts.p.sortorder;}
+ if(ts.p.rowTotal !== null && pN.totalrows !== null) { prm[pN.totalrows]= ts.p.rowTotal; }
+ var lcf = $.isFunction(ts.p.loadComplete), lc = lcf ? ts.p.loadComplete : null;
+ var adjust = 0;
+ npage = npage || 1;
+ if (npage > 1) {
+ if(pN.npage !== null) {
+ prm[pN.npage] = npage;
+ adjust = npage - 1;
+ npage = 1;
+ } else {
+ lc = function(req) {
+ ts.p.page++;
+ ts.grid.hDiv.loading = false;
+ if (lcf) {
+ ts.p.loadComplete.call(ts,req);
+ }
+ populate(npage-1);
+ };
+ }
+ } else if (pN.npage !== null) {
+ delete ts.p.postData[pN.npage];
+ }
+ if(ts.p.grouping) {
+ $(ts).jqGrid('groupingSetup');
+ var grp = ts.p.groupingView, gi, gs="";
+ for(gi=0;gi<grp.groupField.length;gi++) {
+ var index = grp.groupField[gi];
+ $.each(ts.p.colModel, function(cmIndex, cmValue) {
+ if (cmValue.name == index && cmValue.index){
+ index = cmValue.index;
+ }
+ } );
+ gs += index +" "+grp.groupOrder[gi]+", ";
+ }
+ prm[pN.sort] = gs + prm[pN.sort];
+ }
+ $.extend(ts.p.postData,prm);
+ var rcnt = !ts.p.scroll ? 1 : ts.rows.length-1;
+ var bfr = $(ts).triggerHandler("jqGridBeforeRequest");
+ if (bfr === false || bfr === 'stop') { return; }
+ if ($.isFunction(ts.p.datatype)) { ts.p.datatype.call(ts,ts.p.postData,"load_"+ts.p.id); return;}
+ else if($.isFunction(ts.p.beforeRequest)) {
+ bfr = ts.p.beforeRequest.call(ts);
+ if(bfr === undefined) { bfr = true; }
+ if ( bfr === false ) { return; }
+ }
+ dt = ts.p.datatype.toLowerCase();
+ switch(dt)
+ {
+ case "json":
+ case "jsonp":
+ case "xml":
+ case "script":
+ $.ajax($.extend({
+ url:ts.p.url,
+ type:ts.p.mtype,
+ dataType: dt ,
+ data: $.isFunction(ts.p.serializeGridData)? ts.p.serializeGridData.call(ts,ts.p.postData) : ts.p.postData,
+ success:function(data,st, xhr) {
+ if ($.isFunction(ts.p.beforeProcessing)) {
+ if (ts.p.beforeProcessing.call(ts, data, st, xhr) === false) {
+ endReq();
+ return;
+ }
+ }
+ if(dt === "xml") { addXmlData(data,ts.grid.bDiv,rcnt,npage>1,adjust); }
+ else { addJSONData(data,ts.grid.bDiv,rcnt,npage>1,adjust); }
+ $(ts).triggerHandler("jqGridLoadComplete", [data]);
+ if(lc) { lc.call(ts,data); }
+ $(ts).triggerHandler("jqGridAfterLoadComplete", [data]);
+ if (pvis) { ts.grid.populateVisible(); }
+ if( ts.p.loadonce || ts.p.treeGrid) {ts.p.datatype = "local";}
+ data=null;
+ if (npage === 1) { endReq(); }
+ },
+ error:function(xhr,st,err){
+ if($.isFunction(ts.p.loadError)) { ts.p.loadError.call(ts,xhr,st,err); }
+ if (npage === 1) { endReq(); }
+ xhr=null;
+ },
+ beforeSend: function(xhr, settings ){
+ var gotoreq = true;
+ if($.isFunction(ts.p.loadBeforeSend)) {
+ gotoreq = ts.p.loadBeforeSend.call(ts,xhr, settings);
+ }
+ if(gotoreq === undefined) { gotoreq = true; }
+ if(gotoreq === false) {
+ return false;
+ } else {
+ beginReq();
+ }
+ }
+ },$.jgrid.ajaxOptions, ts.p.ajaxGridOptions));
+ break;
+ case "xmlstring":
+ beginReq();
+ dstr = $.jgrid.stringToDoc(ts.p.datastr);
+ addXmlData(dstr,ts.grid.bDiv);
+ $(ts).triggerHandler("jqGridLoadComplete", [dstr]);
+ if(lcf) {ts.p.loadComplete.call(ts,dstr);}
+ $(ts).triggerHandler("jqGridAfterLoadComplete", [dstr]);
+ ts.p.datatype = "local";
+ ts.p.datastr = null;
+ endReq();
+ break;
+ case "jsonstring":
+ beginReq();
+ if(typeof ts.p.datastr == 'string') { dstr = $.jgrid.parse(ts.p.datastr); }
+ else { dstr = ts.p.datastr; }
+ addJSONData(dstr,ts.grid.bDiv);
+ $(ts).triggerHandler("jqGridLoadComplete", [dstr]);
+ if(lcf) {ts.p.loadComplete.call(ts,dstr);}
+ $(ts).triggerHandler("jqGridAfterLoadComplete", [dstr]);
+ ts.p.datatype = "local";
+ ts.p.datastr = null;
+ endReq();
+ break;
+ case "local":
+ case "clientside":
+ beginReq();
+ ts.p.datatype = "local";
+ var req = addLocalData();
+ addJSONData(req,ts.grid.bDiv,rcnt,npage>1,adjust);
+ $(ts).triggerHandler("jqGridLoadComplete", [req]);
+ if(lc) { lc.call(ts,req); }
+ $(ts).triggerHandler("jqGridAfterLoadComplete", [req]);
+ if (pvis) { ts.grid.populateVisible(); }
+ endReq();
+ break;
+ }
+ }
+ },
+ setHeadCheckBox = function ( checked ) {
+ $('#cb_'+$.jgrid.jqID(ts.p.id),ts.grid.hDiv)[ts.p.useProp ? 'prop': 'attr']("checked", checked);
+ var fid = ts.p.frozenColumns ? ts.p.id+"_frozen" : "";
+ if(fid) {
+ $('#cb_'+$.jgrid.jqID(ts.p.id),ts.grid.fhDiv)[ts.p.useProp ? 'prop': 'attr']("checked", checked);
+ }
+ },
+ setPager = function (pgid, tp){
+ // TBD - consider escaping pgid with pgid = $.jgrid.jqID(pgid);
+ var sep = "<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>",
+ pginp = "",
+ pgl="<table cellspacing='0' cellpadding='0' border='0' style='table-layout:auto;' class='ui-pg-table'><tbody><tr>",
+ str="", pgcnt, lft, cent, rgt, twd, tdw, i,
+ clearVals = function(onpaging){
+ var ret;
+ if ($.isFunction(ts.p.onPaging) ) { ret = ts.p.onPaging.call(ts,onpaging); }
+ ts.p.selrow = null;
+ if(ts.p.multiselect) {ts.p.selarrrow =[]; setHeadCheckBox( false );}
+ ts.p.savedRow = [];
+ if(ret=='stop') {return false;}
+ return true;
+ };
+ pgid = pgid.substr(1);
+ tp += "_" + pgid;
+ pgcnt = "pg_"+pgid;
+ lft = pgid+"_left"; cent = pgid+"_center"; rgt = pgid+"_right";
+ $("#"+$.jgrid.jqID(pgid) )
+ .append("<div id='"+pgcnt+"' class='ui-pager-control' role='group'><table cellspacing='0' cellpadding='0' border='0' class='ui-pg-table' style='width:100%;table-layout:fixed;height:100%;' role='row'><tbody><tr><td id='"+lft+"' align='left'></td><td id='"+cent+"' align='center' style='white-space:pre;'></td><td id='"+rgt+"' align='right'></td></tr></tbody></table></div>")
+ .attr("dir","ltr"); //explicit setting
+ if(ts.p.rowList.length >0){
+ str = "<td dir='"+dir+"'>";
+ str +="<select class='ui-pg-selbox' role='listbox'>";
+ for(i=0;i<ts.p.rowList.length;i++){
+ str +="<option role=\"option\" value=\""+ts.p.rowList[i]+"\""+((ts.p.rowNum == ts.p.rowList[i])?" selected=\"selected\"":"")+">"+ts.p.rowList[i]+"</option>";
+ }
+ str +="</select></td>";
+ }
+ if(dir=="rtl") { pgl += str; }
+ if(ts.p.pginput===true) { pginp= "<td dir='"+dir+"'>"+$.jgrid.format(ts.p.pgtext || "","<input class='ui-pg-input' type='text' size='2' maxlength='7' value='0' role='textbox'/>","<span id='sp_1_"+$.jgrid.jqID(pgid)+"'></span>")+"</td>";}
+ if(ts.p.pgbuttons===true) {
+ var po=["first"+tp,"prev"+tp, "next"+tp,"last"+tp]; if(dir=="rtl") { po.reverse(); }
+ pgl += "<td id='"+po[0]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-first'></span></td>";
+ pgl += "<td id='"+po[1]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-prev'></span></td>";
+ pgl += pginp !== "" ? sep+pginp+sep:"";
+ pgl += "<td id='"+po[2]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-next'></span></td>";
+ pgl += "<td id='"+po[3]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-end'></span></td>";
+ } else if (pginp !== "") { pgl += pginp; }
+ if(dir=="ltr") { pgl += str; }
+ pgl += "</tr></tbody></table>";
+ if(ts.p.viewrecords===true) {$("td#"+pgid+"_"+ts.p.recordpos,"#"+pgcnt).append("<div dir='"+dir+"' style='text-align:"+ts.p.recordpos+"' class='ui-paging-info'></div>");}
+ $("td#"+pgid+"_"+ts.p.pagerpos,"#"+pgcnt).append(pgl);
+ tdw = $(".ui-jqgrid").css("font-size") || "11px";
+ $(document.body).append("<div id='testpg' class='ui-jqgrid ui-widget ui-widget-content' style='font-size:"+tdw+";visibility:hidden;' ></div>");
+ twd = $(pgl).clone().appendTo("#testpg").width();
+ $("#testpg").remove();
+ if(twd > 0) {
+ if(pginp !== "") { twd += 50; } //should be param
+ $("td#"+pgid+"_"+ts.p.pagerpos,"#"+pgcnt).width(twd);
+ }
+ ts.p._nvtd = [];
+ ts.p._nvtd[0] = twd ? Math.floor((ts.p.width - twd)/2) : Math.floor(ts.p.width/3);
+ ts.p._nvtd[1] = 0;
+ pgl=null;
+ $('.ui-pg-selbox',"#"+pgcnt).bind('change',function() {
+ ts.p.page = Math.round(ts.p.rowNum*(ts.p.page-1)/this.value-0.5)+1;
+ ts.p.rowNum = this.value;
+ if(ts.p.pager) { $('.ui-pg-selbox',ts.p.pager).val(this.value); }
+ if(ts.p.toppager) { $('.ui-pg-selbox',ts.p.toppager).val(this.value); }
+ if(!clearVals('records')) { return false; }
+ populate();
+ return false;
+ });
+ if(ts.p.pgbuttons===true) {
+ $(".ui-pg-button","#"+pgcnt).hover(function(){
+ if($(this).hasClass('ui-state-disabled')) {
+ this.style.cursor='default';
+ } else {
+ $(this).addClass('ui-state-hover');
+ this.style.cursor='pointer';
+ }
+ },function() {
+ if(!$(this).hasClass('ui-state-disabled')) {
+ $(this).removeClass('ui-state-hover');
+ this.style.cursor= "default";
+ }
+ });
+ $("#first"+$.jgrid.jqID(tp)+", #prev"+$.jgrid.jqID(tp)+", #next"+$.jgrid.jqID(tp)+", #last"+$.jgrid.jqID(tp)).click( function() {
+ var cp = intNum(ts.p.page,1),
+ last = intNum(ts.p.lastpage,1), selclick = false,
+ fp=true, pp=true, np=true,lp=true;
+ if(last ===0 || last===1) {fp=false;pp=false;np=false;lp=false; }
+ else if( last>1 && cp >=1) {
+ if( cp === 1) { fp=false; pp=false; }
+ //else if( cp>1 && cp <last){ }
+ else if( cp===last){ np=false;lp=false; }
+ } else if( last>1 && cp===0 ) { np=false;lp=false; cp=last-1;}
+ if( this.id === 'first'+tp && fp ) { ts.p.page=1; selclick=true;}
+ if( this.id === 'prev'+tp && pp) { ts.p.page=(cp-1); selclick=true;}
+ if( this.id === 'next'+tp && np) { ts.p.page=(cp+1); selclick=true;}
+ if( this.id === 'last'+tp && lp) { ts.p.page=last; selclick=true;}
+ if(selclick) {
+ if(!clearVals(this.id)) { return false; }
+ populate();
+ }
+ return false;
+ });
+ }
+ if(ts.p.pginput===true) {
+ $('input.ui-pg-input',"#"+pgcnt).keypress( function(e) {
+ var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
+ if(key == 13) {
+ ts.p.page = ($(this).val()>0) ? $(this).val():ts.p.page;
+ if(!clearVals('user')) { return false; }
+ populate();
+ return false;
+ }
+ return this;
+ });
+ }
+ },
+ sortData = function (index, idxcol,reload,sor){
+ if(!ts.p.colModel[idxcol].sortable) { return; }
+ var so;
+ if(ts.p.savedRow.length > 0) {return;}
+ if(!reload) {
+ if( ts.p.lastsort == idxcol ) {
+ if( ts.p.sortorder == 'asc') {
+ ts.p.sortorder = 'desc';
+ } else if(ts.p.sortorder == 'desc') { ts.p.sortorder = 'asc';}
+ } else { ts.p.sortorder = ts.p.colModel[idxcol].firstsortorder || 'asc'; }
+ ts.p.page = 1;
+ }
+ if(sor) {
+ if(ts.p.lastsort == idxcol && ts.p.sortorder == sor && !reload) { return; }
+ else { ts.p.sortorder = sor; }
+ }
+ var previousSelectedTh = ts.grid.headers[ts.p.lastsort].el, newSelectedTh = ts.grid.headers[idxcol].el;
+
+ $("span.ui-grid-ico-sort",previousSelectedTh).addClass('ui-state-disabled');
+ $(previousSelectedTh).attr("aria-selected","false");
+ $("span.ui-icon-"+ts.p.sortorder,newSelectedTh).removeClass('ui-state-disabled');
+ $(newSelectedTh).attr("aria-selected","true");
+ if(!ts.p.viewsortcols[0]) {
+ if(ts.p.lastsort != idxcol) {
+ $("span.s-ico",previousSelectedTh).hide();
+ $("span.s-ico",newSelectedTh).show();
+ }
+ }
+ index = index.substring(5 + ts.p.id.length + 1); // bad to be changed!?!
+ ts.p.sortname = ts.p.colModel[idxcol].index || index;
+ so = ts.p.sortorder;
+ if ($(ts).triggerHandler("jqGridSortCol", [index, idxcol, so]) === 'stop') {
+ ts.p.lastsort = idxcol;
+ return;
+ }
+ if($.isFunction(ts.p.onSortCol)) {if (ts.p.onSortCol.call(ts,index,idxcol,so)=='stop') {ts.p.lastsort = idxcol; return;}}
+ if(ts.p.datatype == "local") {
+ if(ts.p.deselectAfterSort) {$(ts).jqGrid("resetSelection");}
+ } else {
+ ts.p.selrow = null;
+ if(ts.p.multiselect){setHeadCheckBox( false );}
+ ts.p.selarrrow =[];
+ ts.p.savedRow =[];
+ }
+ if(ts.p.scroll) {
+ var sscroll = ts.grid.bDiv.scrollLeft;
+ emptyRows.call(ts, true, false);
+ ts.grid.hDiv.scrollLeft = sscroll;
+ }
+ if(ts.p.subGrid && ts.p.datatype=='local') {
+ $("td.sgexpanded","#"+$.jgrid.jqID(ts.p.id)).each(function(){
+ $(this).trigger("click");
+ });
+ }
+ populate();
+ ts.p.lastsort = idxcol;
+ if(ts.p.sortname != index && idxcol) {ts.p.lastsort = idxcol;}
+ },
+ setColWidth = function () {
+ var initwidth = 0, brd=$.jgrid.cellWidth()? 0: intNum(ts.p.cellLayout,0), vc=0, lvc, scw=intNum(ts.p.scrollOffset,0),cw,hs=false,aw,gw=0,
+ cl = 0, cr;
+ $.each(ts.p.colModel, function() {
+ if(typeof this.hidden === 'undefined') {this.hidden=false;}
+ this.widthOrg = cw = intNum(this.width,0);
+ if(this.hidden===false){
+ initwidth += cw+brd;
+ if(this.fixed) {
+ gw += cw+brd;
+ } else {
+ vc++;
+ }
+ cl++;
+ }
+ });
+ if(isNaN(ts.p.width)) {
+ ts.p.width = initwidth + ((ts.p.shrinkToFit ===false && !isNaN(ts.p.height)) ? scw : 0);
+ }
+ grid.width = ts.p.width;
+ ts.p.tblwidth = initwidth;
+ if(ts.p.shrinkToFit ===false && ts.p.forceFit === true) {ts.p.forceFit=false;}
+ if(ts.p.shrinkToFit===true && vc > 0) {
+ aw = grid.width-brd*vc-gw;
+ if(!isNaN(ts.p.height)) {
+ aw -= scw;
+ hs = true;
+ }
+ initwidth =0;
+ $.each(ts.p.colModel, function(i) {
+ if(this.hidden === false && !this.fixed){
+ cw = Math.round(aw*this.width/(ts.p.tblwidth-brd*vc-gw));
+ this.width =cw;
+ initwidth += cw;
+ lvc = i;
+ }
+ });
+ cr =0;
+ if (hs) {
+ if(grid.width-gw-(initwidth+brd*vc) !== scw){
+ cr = grid.width-gw-(initwidth+brd*vc)-scw;
+ }
+ } else if(!hs && Math.abs(grid.width-gw-(initwidth+brd*vc)) !== 1) {
+ cr = grid.width-gw-(initwidth+brd*vc);
+ }
+ ts.p.colModel[lvc].width += cr;
+ ts.p.tblwidth = initwidth+cr+brd*vc+gw;
+ if(ts.p.tblwidth > ts.p.width) {
+ ts.p.colModel[lvc].width -= (ts.p.tblwidth - parseInt(ts.p.width,10));
+ ts.p.tblwidth = ts.p.width;
+ }
+ }
+ },
+ nextVisible= function(iCol) {
+ var ret = iCol, j=iCol, i;
+ for (i = iCol+1;i<ts.p.colModel.length;i++){
+ if(ts.p.colModel[i].hidden !== true ) {
+ j=i; break;
+ }
+ }
+ return j-ret;
+ },
+ getOffset = function (iCol) {
+ var i, ret = {}, brd1 = $.jgrid.cellWidth() ? 0 : ts.p.cellLayout;
+ ret[0] = ret[1] = ret[2] = 0;
+ for(i=0;i<=iCol;i++){
+ if(ts.p.colModel[i].hidden === false ) {
+ ret[0] += ts.p.colModel[i].width+brd1;
+ }
+ }
+ if(ts.p.direction=="rtl") { ret[0] = ts.p.width - ret[0]; }
+ ret[0] = ret[0] - ts.grid.bDiv.scrollLeft;
+ if($(ts.grid.cDiv).is(":visible")) {ret[1] += $(ts.grid.cDiv).height() +parseInt($(ts.grid.cDiv).css("padding-top"),10)+parseInt($(ts.grid.cDiv).css("padding-bottom"),10);}
+ if(ts.p.toolbar[0]===true && (ts.p.toolbar[1]=='top' || ts.p.toolbar[1]=='both')) {ret[1] += $(ts.grid.uDiv).height()+parseInt($(ts.grid.uDiv).css("border-top-width"),10)+parseInt($(ts.grid.uDiv).css("border-bottom-width"),10);}
+ if(ts.p.toppager) {ret[1] += $(ts.grid.topDiv).height()+parseInt($(ts.grid.topDiv).css("border-bottom-width"),10);}
+ ret[2] += $(ts.grid.bDiv).height() + $(ts.grid.hDiv).height();
+ return ret;
+ },
+ getColumnHeaderIndex = function (th) {
+ var i, headers = ts.grid.headers, ci = $.jgrid.getCellIndex(th);
+ for (i = 0; i < headers.length; i++) {
+ if (th === headers[i].el) {
+ ci = i;
+ break;
+ }
+ }
+ return ci;
+ };
+ this.p.id = this.id;
+ if ($.inArray(ts.p.multikey,sortkeys) == -1 ) {ts.p.multikey = false;}
+ ts.p.keyIndex=false;
+ for (i=0; i<ts.p.colModel.length;i++) {
+ ts.p.colModel[i] = $.extend(true, {}, ts.p.cmTemplate, ts.p.colModel[i].template || {}, ts.p.colModel[i]);
+ if (ts.p.keyIndex === false && ts.p.colModel[i].key===true) {
+ ts.p.keyIndex = i;
+ }
+ }
+ ts.p.sortorder = ts.p.sortorder.toLowerCase();
+ if(ts.p.grouping===true) {
+ ts.p.scroll = false;
+ ts.p.rownumbers = false;
+ //ts.p.subGrid = false; expiremental
+ ts.p.treeGrid = false;
+ ts.p.gridview = true;
+ }
+ if(this.p.treeGrid === true) {
+ try { $(this).jqGrid("setTreeGrid");} catch (_) {}
+ if(ts.p.datatype != "local") { ts.p.localReader = {id: "_id_"}; }
+ }
+ if(this.p.subGrid) {
+ try { $(ts).jqGrid("setSubGrid");} catch (s){}
+ }
+ if(this.p.multiselect) {
+ this.p.colNames.unshift("<input role='checkbox' id='cb_"+this.p.id+"' class='cbox' type='checkbox'/>");
+ this.p.colModel.unshift({name:'cb',width:$.jgrid.cellWidth() ? ts.p.multiselectWidth+ts.p.cellLayout : ts.p.multiselectWidth,sortable:false,resizable:false,hidedlg:true,search:false,align:'center',fixed:true});
+ }
+ if(this.p.rownumbers) {
+ this.p.colNames.unshift("");
+ this.p.colModel.unshift({name:'rn',width:ts.p.rownumWidth,sortable:false,resizable:false,hidedlg:true,search:false,align:'center',fixed:true});
+ }
+ ts.p.xmlReader = $.extend(true,{
+ root: "rows",
+ row: "row",
+ page: "rows>page",
+ total: "rows>total",
+ records : "rows>records",
+ repeatitems: true,
+ cell: "cell",
+ id: "[id]",
+ userdata: "userdata",
+ subgrid: {root:"rows", row: "row", repeatitems: true, cell:"cell"}
+ }, ts.p.xmlReader);
+ ts.p.jsonReader = $.extend(true,{
+ root: "rows",
+ page: "page",
+ total: "total",
+ records: "records",
+ repeatitems: true,
+ cell: "cell",
+ id: "id",
+ userdata: "userdata",
+ subgrid: {root:"rows", repeatitems: true, cell:"cell"}
+ },ts.p.jsonReader);
+ ts.p.localReader = $.extend(true,{
+ root: "rows",
+ page: "page",
+ total: "total",
+ records: "records",
+ repeatitems: false,
+ cell: "cell",
+ id: "id",
+ userdata: "userdata",
+ subgrid: {root:"rows", repeatitems: true, cell:"cell"}
+ },ts.p.localReader);
+ if(ts.p.scroll){
+ ts.p.pgbuttons = false; ts.p.pginput=false; ts.p.rowList=[];
+ }
+ if(ts.p.data.length) { refreshIndex(); }
+ var thead = "<thead><tr class='ui-jqgrid-labels' role='rowheader'>",
+ tdc, idn, w, res, sort,
+ td, ptr, tbody, imgs,iac="",idc="";
+ if(ts.p.shrinkToFit===true && ts.p.forceFit===true) {
+ for (i=ts.p.colModel.length-1;i>=0;i--){
+ if(!ts.p.colModel[i].hidden) {
+ ts.p.colModel[i].resizable=false;
+ break;
+ }
+ }
+ }
+ if(ts.p.viewsortcols[1] == 'horizontal') {iac=" ui-i-asc";idc=" ui-i-desc";}
+ tdc = isMSIE ? "class='ui-th-div-ie'" :"";
+ imgs = "<span class='s-ico' style='display:none'><span sort='asc' class='ui-grid-ico-sort ui-icon-asc"+iac+" ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-"+dir+"'></span>";
+ imgs += "<span sort='desc' class='ui-grid-ico-sort ui-icon-desc"+idc+" ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-"+dir+"'></span></span>";
+ for(i=0;i<this.p.colNames.length;i++){
+ var tooltip = ts.p.headertitles ? (" title=\""+$.jgrid.stripHtml(ts.p.colNames[i])+"\"") :"";
+ thead += "<th id='"+ts.p.id+"_"+ts.p.colModel[i].name+"' role='columnheader' class='ui-state-default ui-th-column ui-th-"+dir+"'"+ tooltip+">";
+ idn = ts.p.colModel[i].index || ts.p.colModel[i].name;
+ thead += "<div id='jqgh_"+ts.p.id+"_"+ts.p.colModel[i].name+"' "+tdc+">"+ts.p.colNames[i];
+ if(!ts.p.colModel[i].width) { ts.p.colModel[i].width = 150; }
+ else { ts.p.colModel[i].width = parseInt(ts.p.colModel[i].width,10); }
+ if(typeof(ts.p.colModel[i].title) !== "boolean") { ts.p.colModel[i].title = true; }
+ if (idn == ts.p.sortname) {
+ ts.p.lastsort = i;
+ }
+ thead += imgs+"</div></th>";
+ }
+ thead += "</tr></thead>";
+ imgs = null;
+ $(this).append(thead);
+ $("thead tr:first th",this).hover(function(){$(this).addClass('ui-state-hover');},function(){$(this).removeClass('ui-state-hover');});
+ if(this.p.multiselect) {
+ var emp=[], chk;
+ $('#cb_'+$.jgrid.jqID(ts.p.id),this).bind('click',function(){
+ ts.p.selarrrow = [];
+ var froz = ts.p.frozenColumns === true ? ts.p.id + "_frozen" : "";
+ if (this.checked) {
+ $(ts.rows).each(function(i) {
+ if (i>0) {
+ if(!$(this).hasClass("ui-subgrid") && !$(this).hasClass("jqgroup") && !$(this).hasClass('ui-state-disabled')){
+ $("#jqg_"+$.jgrid.jqID(ts.p.id)+"_"+$.jgrid.jqID(this.id) )[ts.p.useProp ? 'prop': 'attr']("checked",true);
+ $(this).addClass("ui-state-highlight").attr("aria-selected","true");
+ ts.p.selarrrow.push(this.id);
+ ts.p.selrow = this.id;
+ if(froz) {
+ $("#jqg_"+$.jgrid.jqID(ts.p.id)+"_"+$.jgrid.jqID(this.id), ts.grid.fbDiv )[ts.p.useProp ? 'prop': 'attr']("checked",true);
+ $("#"+$.jgrid.jqID(this.id), ts.grid.fbDiv).addClass("ui-state-highlight");
+ }
+ }
+ }
+ });
+ chk=true;
+ emp=[];
+ }
+ else {
+ $(ts.rows).each(function(i) {
+ if(i>0) {
+ if(!$(this).hasClass("ui-subgrid") && !$(this).hasClass('ui-state-disabled')){
+ $("#jqg_"+$.jgrid.jqID(ts.p.id)+"_"+$.jgrid.jqID(this.id) )[ts.p.useProp ? 'prop': 'attr']("checked", false);
+ $(this).removeClass("ui-state-highlight").attr("aria-selected","false");
+ emp.push(this.id);
+ if(froz) {
+ $("#jqg_"+$.jgrid.jqID(ts.p.id)+"_"+$.jgrid.jqID(this.id), ts.grid.fbDiv )[ts.p.useProp ? 'prop': 'attr']("checked",false);
+ $("#"+$.jgrid.jqID(this.id), ts.grid.fbDiv).removeClass("ui-state-highlight");
+ }
+ }
+ }
+ });
+ ts.p.selrow = null;
+ chk=false;
+ }
+ $(ts).triggerHandler("jqGridSelectAll", [chk ? ts.p.selarrrow : emp, chk]);
+ if($.isFunction(ts.p.onSelectAll)) {ts.p.onSelectAll.call(ts, chk ? ts.p.selarrrow : emp,chk);}
+ });
+ }
+
+ if(ts.p.autowidth===true) {
+ var pw = $(eg).innerWidth();
+ ts.p.width = pw > 0? pw: 'nw';
+ }
+ setColWidth();
+ $(eg).css("width",grid.width+"px").append("<div class='ui-jqgrid-resize-mark' id='rs_m"+ts.p.id+"'> </div>");
+ $(gv).css("width",grid.width+"px");
+ thead = $("thead:first",ts).get(0);
+ var tfoot = "";
+ if(ts.p.footerrow) { tfoot += "<table role='grid' style='width:"+ts.p.tblwidth+"px' class='ui-jqgrid-ftable' cellspacing='0' cellpadding='0' border='0'><tbody><tr role='row' class='ui-widget-content footrow footrow-"+dir+"'>"; }
+ var thr = $("tr:first",thead),
+ firstr = "<tr class='jqgfirstrow' role='row' style='height:auto'>";
+ ts.p.disableClick=false;
+ $("th",thr).each(function ( j ) {
+ w = ts.p.colModel[j].width;
+ if(typeof ts.p.colModel[j].resizable === 'undefined') {ts.p.colModel[j].resizable = true;}
+ if(ts.p.colModel[j].resizable){
+ res = document.createElement("span");
+ $(res).html(" ").addClass('ui-jqgrid-resize ui-jqgrid-resize-'+dir);
+ if(!$.browser.opera) { $(res).css("cursor","col-resize"); }
+ $(this).addClass(ts.p.resizeclass);
+ } else {
+ res = "";
+ }
+ $(this).css("width",w+"px").prepend(res);
+ var hdcol = "";
+ if( ts.p.colModel[j].hidden ) {
+ $(this).css("display","none");
+ hdcol = "display:none;";
+ }
+ firstr += "<td role='gridcell' style='height:0px;width:"+w+"px;"+hdcol+"'></td>";
+ grid.headers[j] = { width: w, el: this };
+ sort = ts.p.colModel[j].sortable;
+ if( typeof sort !== 'boolean') {ts.p.colModel[j].sortable = true; sort=true;}
+ var nm = ts.p.colModel[j].name;
+ if( !(nm == 'cb' || nm=='subgrid' || nm=='rn') ) {
+ if(ts.p.viewsortcols[2]){
+ $(">div",this).addClass('ui-jqgrid-sortable');
+ }
+ }
+ if(sort) {
+ if(ts.p.viewsortcols[0]) {$("div span.s-ico",this).show(); if(j==ts.p.lastsort){ $("div span.ui-icon-"+ts.p.sortorder,this).removeClass("ui-state-disabled");}}
+ else if( j == ts.p.lastsort) {$("div span.s-ico",this).show();$("div span.ui-icon-"+ts.p.sortorder,this).removeClass("ui-state-disabled");}
+ }
+ if(ts.p.footerrow) { tfoot += "<td role='gridcell' "+formatCol(j,0,'', null, '', false)+"> </td>"; }
+ }).mousedown(function(e) {
+ if ($(e.target).closest("th>span.ui-jqgrid-resize").length != 1) { return; }
+ var ci = getColumnHeaderIndex(this);
+ if(ts.p.forceFit===true) {ts.p.nv= nextVisible(ci);}
+ grid.dragStart(ci, e, getOffset(ci));
+ return false;
+ }).click(function(e) {
+ if (ts.p.disableClick) {
+ ts.p.disableClick = false;
+ return false;
+ }
+ var s = "th>div.ui-jqgrid-sortable",r,d;
+ if (!ts.p.viewsortcols[2]) { s = "th>div>span>span.ui-grid-ico-sort"; }
+ var t = $(e.target).closest(s);
+ if (t.length != 1) { return; }
+ var ci = getColumnHeaderIndex(this);
+ if (!ts.p.viewsortcols[2]) { r=true;d=t.attr("sort"); }
+ sortData( $('div',this)[0].id, ci, r, d);
+ return false;
+ });
+ if (ts.p.sortable && $.fn.sortable) {
+ try {
+ $(ts).jqGrid("sortableColumns", thr);
+ } catch (e){}
+ }
+ if(ts.p.footerrow) { tfoot += "</tr></tbody></table>"; }
+ firstr += "</tr>";
+ tbody = document.createElement("tbody");
+ this.appendChild(tbody);
+ $(this).addClass('ui-jqgrid-btable').append(firstr);
+ firstr = null;
+ var hTable = $("<table class='ui-jqgrid-htable' style='width:"+ts.p.tblwidth+"px' role='grid' aria-labelledby='gbox_"+this.id+"' cellspacing='0' cellpadding='0' border='0'></table>").append(thead),
+ hg = (ts.p.caption && ts.p.hiddengrid===true) ? true : false,
+ hb = $("<div class='ui-jqgrid-hbox" + (dir=="rtl" ? "-rtl" : "" )+"'></div>");
+ thead = null;
+ grid.hDiv = document.createElement("div");
+ $(grid.hDiv)
+ .css({ width: grid.width+"px"})
+ .addClass("ui-state-default ui-jqgrid-hdiv")
+ .append(hb);
+ $(hb).append(hTable);
+ hTable = null;
+ if(hg) { $(grid.hDiv).hide(); }
+ if(ts.p.pager){
+ // TBD -- escape ts.p.pager here?
+ if(typeof ts.p.pager == "string") {if(ts.p.pager.substr(0,1) !="#") { ts.p.pager = "#"+ts.p.pager;} }
+ else { ts.p.pager = "#"+ $(ts.p.pager).attr("id");}
+ $(ts.p.pager).css({width: grid.width+"px"}).appendTo(eg).addClass('ui-state-default ui-jqgrid-pager ui-corner-bottom');
+ if(hg) {$(ts.p.pager).hide();}
+ setPager(ts.p.pager,'');
+ }
+ if( ts.p.cellEdit === false && ts.p.hoverrows === true) {
+ $(ts).bind('mouseover',function(e) {
+ ptr = $(e.target).closest("tr.jqgrow");
+ if($(ptr).attr("class") !== "ui-subgrid") {
+ $(ptr).addClass("ui-state-hover");
+ }
+ }).bind('mouseout',function(e) {
+ ptr = $(e.target).closest("tr.jqgrow");
+ $(ptr).removeClass("ui-state-hover");
+ });
+ }
+ var ri,ci, tdHtml;
+ $(ts).before(grid.hDiv).click(function(e) {
+ td = e.target;
+ ptr = $(td,ts.rows).closest("tr.jqgrow");
+ if($(ptr).length === 0 || ptr[0].className.indexOf( 'ui-state-disabled' ) > -1 || ($(td,ts).closest("table.ui-jqgrid-btable").attr('id') || '').replace("_frozen","") !== ts.id ) {
+ return this;
+ }
+ var scb = $(td).hasClass("cbox"),
+ cSel = $(ts).triggerHandler("jqGridBeforeSelectRow", [ptr[0].id, e]);
+ cSel = (cSel === false || cSel === 'stop') ? false : true;
+ if(cSel && $.isFunction(ts.p.beforeSelectRow)) { cSel = ts.p.beforeSelectRow.call(ts,ptr[0].id, e); }
+ if (td.tagName == 'A' || ((td.tagName == 'INPUT' || td.tagName == 'TEXTAREA' || td.tagName == 'OPTION' || td.tagName == 'SELECT' ) && !scb) ) { return; }
+ if(cSel === true) {
+ ri = ptr[0].id;
+ ci = $.jgrid.getCellIndex(td);
+ tdHtml = $(td).closest("td,th").html();
+ $(ts).triggerHandler("jqGridCellSelect", [ri,ci,tdHtml,e]);
+ if($.isFunction(ts.p.onCellSelect)) {
+ ts.p.onCellSelect.call(ts,ri,ci,tdHtml,e);
+ }
+ if(ts.p.cellEdit === true) {
+ if(ts.p.multiselect && scb){
+ $(ts).jqGrid("setSelection", ri ,true,e);
+ } else {
+ ri = ptr[0].rowIndex;
+ try {$(ts).jqGrid("editCell",ri,ci,true);} catch (_) {}
+ }
+ } else if ( !ts.p.multikey ) {
+ if(ts.p.multiselect && ts.p.multiboxonly) {
+ if(scb){$(ts).jqGrid("setSelection",ri,true,e);}
+ else {
+ var frz = ts.p.frozenColumns ? ts.p.id+"_frozen" : "";
+ $(ts.p.selarrrow).each(function(i,n){
+ var ind = ts.rows.namedItem(n);
+ $(ind).removeClass("ui-state-highlight");
+ $("#jqg_"+$.jgrid.jqID(ts.p.id)+"_"+$.jgrid.jqID(n))[ts.p.useProp ? 'prop': 'attr']("checked", false);
+ if(frz) {
+ $("#"+$.jgrid.jqID(n), "#"+$.jgrid.jqID(frz)).removeClass("ui-state-highlight");
+ $("#jqg_"+$.jgrid.jqID(ts.p.id)+"_"+$.jgrid.jqID(n), "#"+$.jgrid.jqID(frz))[ts.p.useProp ? 'prop': 'attr']("checked", false);
+ }
+ });
+ ts.p.selarrrow = [];
+ $(ts).jqGrid("setSelection",ri,true,e);
+ }
+ } else {
+ $(ts).jqGrid("setSelection",ri,true,e);
+ }
+ } else {
+ if(e[ts.p.multikey]) {
+ $(ts).jqGrid("setSelection",ri,true,e);
+ } else if(ts.p.multiselect && scb) {
+ scb = $("#jqg_"+$.jgrid.jqID(ts.p.id)+"_"+ri).is(":checked");
+ $("#jqg_"+$.jgrid.jqID(ts.p.id)+"_"+ri)[ts.p.useProp ? 'prop' : 'attr']("checked", scb);
+ }
+ }
+ }
+ }).bind('reloadGrid', function(e,opts) {
+ if(ts.p.treeGrid ===true) { ts.p.datatype = ts.p.treedatatype;}
+ if (opts && opts.current) {
+ ts.grid.selectionPreserver(ts);
+ }
+ if(ts.p.datatype=="local"){ $(ts).jqGrid("resetSelection"); if(ts.p.data.length) { refreshIndex();} }
+ else if(!ts.p.treeGrid) {
+ ts.p.selrow=null;
+ if(ts.p.multiselect) {ts.p.selarrrow =[];setHeadCheckBox(false);}
+ ts.p.savedRow = [];
+ }
+ if(ts.p.scroll) {emptyRows.call(ts, true, false);}
+ if (opts && opts.page) {
+ var page = opts.page;
+ if (page > ts.p.lastpage) { page = ts.p.lastpage; }
+ if (page < 1) { page = 1; }
+ ts.p.page = page;
+ if (ts.grid.prevRowHeight) {
+ ts.grid.bDiv.scrollTop = (page - 1) * ts.grid.prevRowHeight * ts.p.rowNum;
+ } else {
+ ts.grid.bDiv.scrollTop = 0;
+ }
+ }
+ if (ts.grid.prevRowHeight && ts.p.scroll) {
+ delete ts.p.lastpage;
+ ts.grid.populateVisible();
+ } else {
+ ts.grid.populate();
+ }
+ if(ts.p._inlinenav===true) {$(ts).jqGrid('showAddEditButtons');}
+ return false;
+ })
+ .dblclick(function(e) {
+ td = e.target;
+ ptr = $(td,ts.rows).closest("tr.jqgrow");
+ if($(ptr).length === 0 ){return;}
+ ri = ptr[0].rowIndex;
+ ci = $.jgrid.getCellIndex(td);
+ $(ts).triggerHandler("jqGridDblClickRow", [$(ptr).attr("id"),ri,ci,e]);
+ if ($.isFunction(this.p.ondblClickRow)) { ts.p.ondblClickRow.call(ts,$(ptr).attr("id"),ri,ci, e); }
+ })
+ .bind('contextmenu', function(e) {
+ td = e.target;
+ ptr = $(td,ts.rows).closest("tr.jqgrow");
+ if($(ptr).length === 0 ){return;}
+ if(!ts.p.multiselect) { $(ts).jqGrid("setSelection",ptr[0].id,true,e); }
+ ri = ptr[0].rowIndex;
+ ci = $.jgrid.getCellIndex(td);
+ $(ts).triggerHandler("jqGridRightClickRow", [$(ptr).attr("id"),ri,ci,e]);
+ if ($.isFunction(this.p.onRightClickRow)) { ts.p.onRightClickRow.call(ts,$(ptr).attr("id"),ri,ci, e); }
+ });
+ grid.bDiv = document.createElement("div");
+ if(isMSIE) { if(String(ts.p.height).toLowerCase() === "auto") { ts.p.height = "100%"; } }
+ $(grid.bDiv)
+ .append($('<div style="position:relative;'+(isMSIE && $.browser.version < 8 ? "height:0.01%;" : "")+'"></div>').append('<div></div>').append(this))
+ .addClass("ui-jqgrid-bdiv")
+ .css({ height: ts.p.height+(isNaN(ts.p.height)?"":"px"), width: (grid.width)+"px"})
+ .scroll(grid.scrollGrid);
+ $("table:first",grid.bDiv).css({width:ts.p.tblwidth+"px"});
+ if( isMSIE ) {
+ if( $("tbody",this).length == 2 ) { $("tbody:gt(0)",this).remove();}
+ if( ts.p.multikey) {$(grid.bDiv).bind("selectstart",function(){return false;});}
+ } else {
+ if( ts.p.multikey) {$(grid.bDiv).bind("mousedown",function(){return false;});}
+ }
+ if(hg) {$(grid.bDiv).hide();}
+ grid.cDiv = document.createElement("div");
+ var arf = ts.p.hidegrid===true ? $("<a role='link' href='javascript:void(0)'/>").addClass('ui-jqgrid-titlebar-close HeaderButton').hover(
+ function(){ arf.addClass('ui-state-hover');},
+ function() {arf.removeClass('ui-state-hover');})
+ .append("<span class='ui-icon ui-icon-circle-triangle-n'></span>").css((dir=="rtl"?"left":"right"),"0px") : "";
+ $(grid.cDiv).append(arf).append("<span class='ui-jqgrid-title"+(dir=="rtl" ? "-rtl" :"" )+"'>"+ts.p.caption+"</span>")
+ .addClass("ui-jqgrid-titlebar ui-widget-header ui-corner-top ui-helper-clearfix");
+ $(grid.cDiv).insertBefore(grid.hDiv);
+ if( ts.p.toolbar[0] ) {
+ grid.uDiv = document.createElement("div");
+ if(ts.p.toolbar[1] == "top") {$(grid.uDiv).insertBefore(grid.hDiv);}
+ else if (ts.p.toolbar[1]=="bottom" ) {$(grid.uDiv).insertAfter(grid.hDiv);}
+ if(ts.p.toolbar[1]=="both") {
+ grid.ubDiv = document.createElement("div");
+ $(grid.uDiv).insertBefore(grid.hDiv).addClass("ui-userdata ui-state-default").attr("id","t_"+this.id);
+ $(grid.ubDiv).insertAfter(grid.hDiv).addClass("ui-userdata ui-state-default").attr("id","tb_"+this.id);
+ if(hg) {$(grid.ubDiv).hide();}
+ } else {
+ $(grid.uDiv).width(grid.width).addClass("ui-userdata ui-state-default").attr("id","t_"+this.id);
+ }
+ if(hg) {$(grid.uDiv).hide();}
+ }
+ if(ts.p.toppager) {
+ ts.p.toppager = $.jgrid.jqID(ts.p.id)+"_toppager";
+ grid.topDiv = $("<div id='"+ts.p.toppager+"'></div>")[0];
+ ts.p.toppager = "#"+ts.p.toppager;
+ $(grid.topDiv).insertBefore(grid.hDiv).addClass('ui-state-default ui-jqgrid-toppager').width(grid.width);
+ setPager(ts.p.toppager,'_t');
+ }
+ if(ts.p.footerrow) {
+ grid.sDiv = $("<div class='ui-jqgrid-sdiv'></div>")[0];
+ hb = $("<div class='ui-jqgrid-hbox"+(dir=="rtl"?"-rtl":"")+"'></div>");
+ $(grid.sDiv).append(hb).insertAfter(grid.hDiv).width(grid.width);
+ $(hb).append(tfoot);
+ grid.footers = $(".ui-jqgrid-ftable",grid.sDiv)[0].rows[0].cells;
+ if(ts.p.rownumbers) { grid.footers[0].className = 'ui-state-default jqgrid-rownum'; }
+ if(hg) {$(grid.sDiv).hide();}
+ }
+ hb = null;
+ if(ts.p.caption) {
+ var tdt = ts.p.datatype;
+ if(ts.p.hidegrid===true) {
+ $(".ui-jqgrid-titlebar-close",grid.cDiv).click( function(e){
+ var onHdCl = $.isFunction(ts.p.onHeaderClick),
+ elems = ".ui-jqgrid-bdiv, .ui-jqgrid-hdiv, .ui-jqgrid-pager, .ui-jqgrid-sdiv",
+ counter, self = this;
+ if(ts.p.toolbar[0]===true) {
+ if( ts.p.toolbar[1]=='both') {
+ elems += ', #' + $(grid.ubDiv).attr('id');
+ }
+ elems += ', #' + $(grid.uDiv).attr('id');
+ }
+ counter = $(elems,"#gview_"+$.jgrid.jqID(ts.p.id)).length;
+
+ if(ts.p.gridstate == 'visible') {
+ $(elems,"#gbox_"+$.jgrid.jqID(ts.p.id)).slideUp("fast", function() {
+ counter--;
+ if (counter === 0) {
+ $("span",self).removeClass("ui-icon-circle-triangle-n").addClass("ui-icon-circle-triangle-s");
+ ts.p.gridstate = 'hidden';
+ if($("#gbox_"+$.jgrid.jqID(ts.p.id)).hasClass("ui-resizable")) { $(".ui-resizable-handle","#gbox_"+$.jgrid.jqID(ts.p.id)).hide(); }
+ $(ts).triggerHandler("jqGridHeaderClick", [ts.p.gridstate,e]);
+ if(onHdCl) {if(!hg) {ts.p.onHeaderClick.call(ts,ts.p.gridstate,e);}}
+ }
+ });
+ } else if(ts.p.gridstate == 'hidden'){
+ $(elems,"#gbox_"+$.jgrid.jqID(ts.p.id)).slideDown("fast", function() {
+ counter--;
+ if (counter === 0) {
+ $("span",self).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n");
+ if(hg) {ts.p.datatype = tdt;populate();hg=false;}
+ ts.p.gridstate = 'visible';
+ if($("#gbox_"+$.jgrid.jqID(ts.p.id)).hasClass("ui-resizable")) { $(".ui-resizable-handle","#gbox_"+$.jgrid.jqID(ts.p.id)).show(); }
+ $(ts).triggerHandler("jqGridHeaderClick", [ts.p.gridstate,e]);
+ if(onHdCl) {if(!hg) {ts.p.onHeaderClick.call(ts,ts.p.gridstate,e);}}
+ }
+ });
+ }
+ return false;
+ });
+ if(hg) {ts.p.datatype="local"; $(".ui-jqgrid-titlebar-close",grid.cDiv).trigger("click");}
+ }
+ } else {$(grid.cDiv).hide();}
+ $(grid.hDiv).after(grid.bDiv)
+ .mousemove(function (e) {
+ if(grid.resizing){grid.dragMove(e);return false;}
+ });
+ $(".ui-jqgrid-labels",grid.hDiv).bind("selectstart", function () { return false; });
+ $(document).mouseup(function () {
+ if(grid.resizing) { grid.dragEnd(); return false;}
+ return true;
+ });
+ ts.formatCol = formatCol;
+ ts.sortData = sortData;
+ ts.updatepager = updatepager;
+ ts.refreshIndex = refreshIndex;
+ ts.setHeadCheckBox = setHeadCheckBox;
+ ts.constructTr = constructTr;
+ ts.formatter = function ( rowId, cellval , colpos, rwdat, act){return formatter(rowId, cellval , colpos, rwdat, act);};
+ $.extend(grid,{populate : populate, emptyRows: emptyRows});
+ this.grid = grid;
+ ts.addXmlData = function(d) {addXmlData(d,ts.grid.bDiv);};
+ ts.addJSONData = function(d) {addJSONData(d,ts.grid.bDiv);};
+ this.grid.cols = this.rows[0].cells;
+
+ populate();ts.p.hiddengrid=false;
+ });
+};
+$.jgrid.extend({
+ getGridParam : function(pName) {
+ var $t = this[0];
+ if (!$t || !$t.grid) {return;}
+ if (!pName) { return $t.p; }
+ else {return typeof($t.p[pName]) != "undefined" ? $t.p[pName] : null;}
+ },
+ setGridParam : function (newParams){
+ return this.each(function(){
+ if (this.grid && typeof(newParams) === 'object') {$.extend(true,this.p,newParams);}
+ });
+ },
+ getDataIDs : function () {
+ var ids=[], i=0, len, j=0;
+ this.each(function(){
+ len = this.rows.length;
+ if(len && len>0){
+ while(i<len) {
+ if($(this.rows[i]).hasClass('jqgrow')) {
+ ids[j] = this.rows[i].id;
+ j++;
+ }
+ i++;
+ }
+ }
+ });
+ return ids;
+ },
+ setSelection : function(selection,onsr, e) {
+ return this.each(function(){
+ var $t = this, stat,pt, ner, ia, tpsr, fid;
+ if(selection === undefined) { return; }
+ onsr = onsr === false ? false : true;
+ pt=$t.rows.namedItem(selection+"");
+ if(!pt || !pt.className || pt.className.indexOf( 'ui-state-disabled' ) > -1 ) { return; }
+ function scrGrid(iR){
+ var ch = $($t.grid.bDiv)[0].clientHeight,
+ st = $($t.grid.bDiv)[0].scrollTop,
+ rpos = $($t.rows[iR]).position().top,
+ rh = $t.rows[iR].clientHeight;
+ if(rpos+rh >= ch+st) { $($t.grid.bDiv)[0].scrollTop = rpos-(ch+st)+rh+st; }
+ else if(rpos < ch+st) {
+ if(rpos < st) {
+ $($t.grid.bDiv)[0].scrollTop = rpos;
+ }
+ }
+ }
+ if($t.p.scrollrows===true) {
+ ner = $t.rows.namedItem(selection).rowIndex;
+ if(ner >=0 ){
+ scrGrid(ner);
+ }
+ }
+ if($t.p.frozenColumns === true ) {
+ fid = $t.p.id+"_frozen";
+ }
+ if(!$t.p.multiselect) {
+ if(pt.className !== "ui-subgrid") {
+ if( $t.p.selrow != pt.id) {
+ $($t.rows.namedItem($t.p.selrow)).removeClass("ui-state-highlight").attr({"aria-selected":"false", "tabindex" : "-1"});
+ $(pt).addClass("ui-state-highlight").attr({"aria-selected":"true", "tabindex" : "0"});//.focus();
+ if(fid) {
+ $("#"+$.jgrid.jqID($t.p.selrow), "#"+$.jgrid.jqID(fid)).removeClass("ui-state-highlight");
+ $("#"+$.jgrid.jqID(selection), "#"+$.jgrid.jqID(fid)).addClass("ui-state-highlight");
+ }
+ stat = true;
+ } else {
+ stat = false;
+ }
+ $t.p.selrow = pt.id;
+ $($t).triggerHandler("jqGridSelectRow", [pt.id, stat, e]);
+ if( $t.p.onSelectRow && onsr) { $t.p.onSelectRow.call($t, pt.id, stat, e); }
+ }
+ } else {
+ //unselect selectall checkbox when deselecting a specific row
+ $t.setHeadCheckBox( false );
+ $t.p.selrow = pt.id;
+ ia = $.inArray($t.p.selrow,$t.p.selarrrow);
+ if ( ia === -1 ){
+ if(pt.className !== "ui-subgrid") { $(pt).addClass("ui-state-highlight").attr("aria-selected","true");}
+ stat = true;
+ $t.p.selarrrow.push($t.p.selrow);
+ } else {
+ if(pt.className !== "ui-subgrid") { $(pt).removeClass("ui-state-highlight").attr("aria-selected","false");}
+ stat = false;
+ $t.p.selarrrow.splice(ia,1);
+ tpsr = $t.p.selarrrow[0];
+ $t.p.selrow = (tpsr === undefined) ? null : tpsr;
+ }
+ $("#jqg_"+$.jgrid.jqID($t.p.id)+"_"+$.jgrid.jqID(pt.id))[$t.p.useProp ? 'prop': 'attr']("checked",stat);
+ if(fid) {
+ if(ia === -1) {
+ $("#"+$.jgrid.jqID(selection), "#"+$.jgrid.jqID(fid)).addClass("ui-state-highlight");
+ } else {
+ $("#"+$.jgrid.jqID(selection), "#"+$.jgrid.jqID(fid)).removeClass("ui-state-highlight");
+ }
+ $("#jqg_"+$.jgrid.jqID($t.p.id)+"_"+$.jgrid.jqID(selection), "#"+$.jgrid.jqID(fid))[$t.p.useProp ? 'prop': 'attr']("checked",stat);
+ }
+ $($t).triggerHandler("jqGridSelectRow", [pt.id, stat, e]);
+ if( $t.p.onSelectRow && onsr) { $t.p.onSelectRow.call($t, pt.id , stat, e); }
+ }
+ });
+ },
+ resetSelection : function( rowid ){
+ return this.each(function(){
+ var t = this, ind, sr, fid;
+ if( t.p.frozenColumns === true ) {
+ fid = t.p.id+"_frozen";
+ }
+ if(typeof(rowid) !== "undefined" ) {
+ sr = rowid === t.p.selrow ? t.p.selrow : rowid;
+ $("#"+$.jgrid.jqID(t.p.id)+" tbody:first tr#"+$.jgrid.jqID(sr)).removeClass("ui-state-highlight").attr("aria-selected","false");
+ if (fid) { $("#"+$.jgrid.jqID(sr), "#"+$.jgrid.jqID(fid)).removeClass("ui-state-highlight"); }
+ if(t.p.multiselect) {
+ $("#jqg_"+$.jgrid.jqID(t.p.id)+"_"+$.jgrid.jqID(sr), "#"+$.jgrid.jqID(t.p.id))[t.p.useProp ? 'prop': 'attr']("checked",false);
+ if(fid) { $("#jqg_"+$.jgrid.jqID(t.p.id)+"_"+$.jgrid.jqID(sr), "#"+$.jgrid.jqID(fid))[t.p.useProp ? 'prop': 'attr']("checked",false); }
+ t.setHeadCheckBox( false);
+ }
+ sr = null;
+ } else if(!t.p.multiselect) {
+ if(t.p.selrow) {
+ $("#"+$.jgrid.jqID(t.p.id)+" tbody:first tr#"+$.jgrid.jqID(t.p.selrow)).removeClass("ui-state-highlight").attr("aria-selected","false");
+ if(fid) { $("#"+$.jgrid.jqID(t.p.selrow), "#"+$.jgrid.jqID(fid)).removeClass("ui-state-highlight"); }
+ t.p.selrow = null;
+ }
+ } else {
+ $(t.p.selarrrow).each(function(i,n){
+ ind = t.rows.namedItem(n);
+ $(ind).removeClass("ui-state-highlight").attr("aria-selected","false");
+ $("#jqg_"+$.jgrid.jqID(t.p.id)+"_"+$.jgrid.jqID(n))[t.p.useProp ? 'prop': 'attr']("checked",false);
+ if(fid) {
+ $("#"+$.jgrid.jqID(n), "#"+$.jgrid.jqID(fid)).removeClass("ui-state-highlight");
+ $("#jqg_"+$.jgrid.jqID(t.p.id)+"_"+$.jgrid.jqID(n), "#"+$.jgrid.jqID(fid))[t.p.useProp ? 'prop': 'attr']("checked",false);
+ }
+ });
+ t.setHeadCheckBox( false );
+ t.p.selarrrow = [];
+ }
+ if(t.p.cellEdit === true) {
+ if(parseInt(t.p.iCol,10)>=0 && parseInt(t.p.iRow,10)>=0) {
+ $("td:eq("+t.p.iCol+")",t.rows[t.p.iRow]).removeClass("edit-cell ui-state-highlight");
+ $(t.rows[t.p.iRow]).removeClass("selected-row ui-state-hover");
+ }
+ }
+ t.p.savedRow = [];
+ });
+ },
+ getRowData : function( rowid ) {
+ var res = {}, resall, getall=false, len, j=0;
+ this.each(function(){
+ var $t = this,nm,ind;
+ if(typeof(rowid) == 'undefined') {
+ getall = true;
+ resall = [];
+ len = $t.rows.length;
+ } else {
+ ind = $t.rows.namedItem(rowid);
+ if(!ind) { return res; }
+ len = 2;
+ }
+ while(j<len){
+ if(getall) { ind = $t.rows[j]; }
+ if( $(ind).hasClass('jqgrow') ) {
+ $('td[role="gridcell"]',ind).each( function(i) {
+ nm = $t.p.colModel[i].name;
+ if ( nm !== 'cb' && nm !== 'subgrid' && nm !== 'rn') {
+ if($t.p.treeGrid===true && nm == $t.p.ExpandColumn) {
+ res[nm] = $.jgrid.htmlDecode($("span:first",this).html());
+ } else {
+ try {
+ res[nm] = $.unformat.call($t,this,{rowId:ind.id, colModel:$t.p.colModel[i]},i);
+ } catch (e){
+ res[nm] = $.jgrid.htmlDecode($(this).html());
+ }
+ }
+ }
+ });
+ if(getall) { resall.push(res); res={}; }
+ }
+ j++;
+ }
+ });
+ return resall ? resall: res;
+ },
+ delRowData : function(rowid) {
+ var success = false, rowInd, ia, ri;
+ this.each(function() {
+ var $t = this;
+ rowInd = $t.rows.namedItem(rowid);
+ if(!rowInd) {return false;}
+ else {
+ ri = rowInd.rowIndex;
+ $(rowInd).remove();
+ $t.p.records--;
+ $t.p.reccount--;
+ $t.updatepager(true,false);
+ success=true;
+ if($t.p.multiselect) {
+ ia = $.inArray(rowid,$t.p.selarrrow);
+ if(ia != -1) { $t.p.selarrrow.splice(ia,1);}
+ }
+ if(rowid == $t.p.selrow) {$t.p.selrow=null;}
+ }
+ if($t.p.datatype == 'local') {
+ var id = $.jgrid.stripPref($t.p.idPrefix, rowid),
+ pos = $t.p._index[id];
+ if(typeof(pos) != 'undefined') {
+ $t.p.data.splice(pos,1);
+ $t.refreshIndex();
+ }
+ }
+ if( $t.p.altRows === true && success ) {
+ var cn = $t.p.altclass;
+ $($t.rows).each(function(i){
+ if(i % 2 ==1) { $(this).addClass(cn); }
+ else { $(this).removeClass(cn); }
+ });
+ }
+ });
+ return success;
+ },
+ setRowData : function(rowid, data, cssp) {
+ var nm, success=true, title;
+ this.each(function(){
+ if(!this.grid) {return false;}
+ var t = this, vl, ind, cp = typeof cssp, lcdata={};
+ ind = t.rows.namedItem(rowid);
+ if(!ind) { return false; }
+ if( data ) {
+ try {
+ $(this.p.colModel).each(function(i){
+ nm = this.name;
+ if( data[nm] !== undefined) {
+ lcdata[nm] = this.formatter && typeof(this.formatter) === 'string' && this.formatter == 'date' ? $.unformat.date.call(t,data[nm],this) : data[nm];
+ vl = t.formatter( rowid, data[nm], i, data, 'edit');
+ title = this.title ? {"title":$.jgrid.stripHtml(vl)} : {};
+ if(t.p.treeGrid===true && nm == t.p.ExpandColumn) {
+ $("td:eq("+i+") > span:first",ind).html(vl).attr(title);
+ } else {
+ $("td:eq("+i+")",ind).html(vl).attr(title);
+ }
+ }
+ });
+ if(t.p.datatype == 'local') {
+ var id = $.jgrid.stripPref(t.p.idPrefix, rowid),
+ pos = t.p._index[id];
+ if(t.p.treeGrid) {
+ for(var key in t.p.treeReader ){
+ if(lcdata.hasOwnProperty(t.p.treeReader[key])) {
+ delete lcdata[t.p.treeReader[key]];
+ }
+ }
+ }
+ if(typeof(pos) != 'undefined') {
+ t.p.data[pos] = $.extend(true, t.p.data[pos], lcdata);
+ }
+ lcdata = null;
+ }
+ } catch (e) {
+ success = false;
+ }
+ }
+ if(success) {
+ if(cp === 'string') {$(ind).addClass(cssp);} else if(cp === 'object') {$(ind).css(cssp);}
+ $(t).triggerHandler("jqGridAfterGridComplete");
+ }
+ });
+ return success;
+ },
+ addRowData : function(rowid,rdata,pos,src) {
+ if(!pos) {pos = "last";}
+ var success = false, nm, row, gi, si, ni,sind, i, v, prp="", aradd, cnm, cn, data, cm, id;
+ if(rdata) {
+ if($.isArray(rdata)) {
+ aradd=true;
+ pos = "last";
+ cnm = rowid;
+ } else {
+ rdata = [rdata];
+ aradd = false;
+ }
+ this.each(function() {
+ var t = this, datalen = rdata.length;
+ ni = t.p.rownumbers===true ? 1 :0;
+ gi = t.p.multiselect ===true ? 1 :0;
+ si = t.p.subGrid===true ? 1 :0;
+ if(!aradd) {
+ if(typeof(rowid) != 'undefined') { rowid = rowid+"";}
+ else {
+ rowid = $.jgrid.randId();
+ if(t.p.keyIndex !== false) {
+ cnm = t.p.colModel[t.p.keyIndex+gi+si+ni].name;
+ if(typeof rdata[0][cnm] != "undefined") { rowid = rdata[0][cnm]; }
+ }
+ }
+ }
+ cn = t.p.altclass;
+ var k = 0, cna ="", lcdata = {},
+ air = $.isFunction(t.p.afterInsertRow) ? true : false;
+ while(k < datalen) {
+ data = rdata[k];
+ row=[];
+ if(aradd) {
+ try {rowid = data[cnm];}
+ catch (e) {rowid = $.jgrid.randId();}
+ cna = t.p.altRows === true ? (t.rows.length-1)%2 === 0 ? cn : "" : "";
+ }
+ id = rowid;
+ rowid = t.p.idPrefix + rowid;
+ if(ni){
+ prp = t.formatCol(0,1,'',null,rowid, true);
+ row[row.length] = "<td role=\"gridcell\" class=\"ui-state-default jqgrid-rownum\" "+prp+">0</td>";
+ }
+ if(gi) {
+ v = "<input role=\"checkbox\" type=\"checkbox\""+" id=\"jqg_"+t.p.id+"_"+rowid+"\" class=\"cbox\"/>";
+ prp = t.formatCol(ni,1,'', null, rowid, true);
+ row[row.length] = "<td role=\"gridcell\" "+prp+">"+v+"</td>";
+ }
+ if(si) {
+ row[row.length] = $(t).jqGrid("addSubGridCell",gi+ni,1);
+ }
+ for(i = gi+si+ni; i < t.p.colModel.length;i++){
+ cm = t.p.colModel[i];
+ nm = cm.name;
+ lcdata[nm] = data[nm];
+ v = t.formatter( rowid, $.jgrid.getAccessor(data,nm), i, data );
+ prp = t.formatCol(i,1,v, data, rowid, true);
+ row[row.length] = "<td role=\"gridcell\" "+prp+">"+v+"</td>";
+ }
+ row.unshift( t.constructTr(rowid, false, cna, lcdata, data, false ) );
+ row[row.length] = "</tr>";
+ if(t.rows.length === 0){
+ $("table:first",t.grid.bDiv).append(row.join(''));
+ } else {
+ switch (pos) {
+ case 'last':
+ $(t.rows[t.rows.length-1]).after(row.join(''));
+ sind = t.rows.length-1;
+ break;
+ case 'first':
+ $(t.rows[0]).after(row.join(''));
+ sind = 1;
+ break;
+ case 'after':
+ sind = t.rows.namedItem(src);
+ if (sind) {
+ if($(t.rows[sind.rowIndex+1]).hasClass("ui-subgrid")) { $(t.rows[sind.rowIndex+1]).after(row); }
+ else { $(sind).after(row.join('')); }
+ }
+ sind++;
+ break;
+ case 'before':
+ sind = t.rows.namedItem(src);
+ if(sind) {$(sind).before(row.join(''));sind=sind.rowIndex;}
+ sind--;
+ break;
+ }
+ }
+ if(t.p.subGrid===true) {
+ $(t).jqGrid("addSubGrid",gi+ni, sind);
+ }
+ t.p.records++;
+ t.p.reccount++;
+ $(t).triggerHandler("jqGridAfterInsertRow", [rowid,data,data]);
+ if(air) { t.p.afterInsertRow.call(t,rowid,data,data); }
+ k++;
+ if(t.p.datatype == 'local') {
+ lcdata[t.p.localReader.id] = id;
+ t.p._index[id] = t.p.data.length;
+ t.p.data.push(lcdata);
+ lcdata = {};
+ }
+ }
+ if( t.p.altRows === true && !aradd) {
+ if (pos == "last") {
+ if ((t.rows.length-1)%2 == 1) {$(t.rows[t.rows.length-1]).addClass(cn);}
+ } else {
+ $(t.rows).each(function(i){
+ if(i % 2 ==1) { $(this).addClass(cn); }
+ else { $(this).removeClass(cn); }
+ });
+ }
+ }
+ t.updatepager(true,true);
+ success = true;
+ });
+ }
+ return success;
+ },
+ footerData : function(action,data, format) {
+ var nm, success=false, res={}, title;
+ function isEmpty(obj) {
+ for(var i in obj) {
+ if (obj.hasOwnProperty(i)) { return false; }
+ }
+ return true;
+ }
+ if(typeof(action) == "undefined") { action = "get"; }
+ if(typeof(format) != "boolean") { format = true; }
+ action = action.toLowerCase();
+ this.each(function(){
+ var t = this, vl;
+ if(!t.grid || !t.p.footerrow) {return false;}
+ if(action == "set") { if(isEmpty(data)) { return false; } }
+ success=true;
+ $(this.p.colModel).each(function(i){
+ nm = this.name;
+ if(action == "set") {
+ if( data[nm] !== undefined) {
+ vl = format ? t.formatter( "", data[nm], i, data, 'edit') : data[nm];
+ title = this.title ? {"title":$.jgrid.stripHtml(vl)} : {};
+ $("tr.footrow td:eq("+i+")",t.grid.sDiv).html(vl).attr(title);
+ success = true;
+ }
+ } else if(action == "get") {
+ res[nm] = $("tr.footrow td:eq("+i+")",t.grid.sDiv).html();
+ }
+ });
+ });
+ return action == "get" ? res : success;
+ },
+ showHideCol : function(colname,show) {
+ return this.each(function() {
+ var $t = this, fndh=false, brd=$.jgrid.cellWidth()? 0: $t.p.cellLayout, cw;
+ if (!$t.grid ) {return;}
+ if( typeof colname === 'string') {colname=[colname];}
+ show = show != "none" ? "" : "none";
+ var sw = show === "" ? true :false,
+ gh = $t.p.groupHeader && (typeof $t.p.groupHeader === 'object' || $.isFunction($t.p.groupHeader) );
+ if(gh) { $($t).jqGrid('destroyGroupHeader', false); }
+ $(this.p.colModel).each(function(i) {
+ if ($.inArray(this.name,colname) !== -1 && this.hidden === sw) {
+ if($t.p.frozenColumns === true && this.frozen === true) {
+ return true;
+ }
+ $("tr",$t.grid.hDiv).each(function(){
+ $(this.cells[i]).css("display", show);
+ });
+ $($t.rows).each(function(){
+ if (!$(this).hasClass("jqgroup")) {
+ $(this.cells[i]).css("display", show);
+ }
+ });
+ if($t.p.footerrow) { $("tr.footrow td:eq("+i+")", $t.grid.sDiv).css("display", show); }
+ cw = parseInt(this.width,10);
+ if(show === "none") {
+ $t.p.tblwidth -= cw+brd;
+ } else {
+ $t.p.tblwidth += cw+brd;
+ }
+ this.hidden = !sw;
+ fndh=true;
+ $($t).triggerHandler("jqGridShowHideCol", [sw,this.name,i]);
+ }
+ });
+ if(fndh===true) {
+ if($t.p.shrinkToFit === true && !isNaN($t.p.height)) { $t.p.tblwidth += parseInt($t.p.scrollOffset,10);}
+ $($t).jqGrid("setGridWidth",$t.p.shrinkToFit === true ? $t.p.tblwidth : $t.p.width );
+ }
+ if( gh ) {
+ $($t).jqGrid('setGroupHeaders',$t.p.groupHeader);
+ }
+ });
+ },
+ hideCol : function (colname) {
+ return this.each(function(){$(this).jqGrid("showHideCol",colname,"none");});
+ },
+ showCol : function(colname) {
+ return this.each(function(){$(this).jqGrid("showHideCol",colname,"");});
+ },
+ remapColumns : function(permutation, updateCells, keepHeader)
+ {
+ function resortArray(a) {
+ var ac;
+ if (a.length) {
+ ac = $.makeArray(a);
+ } else {
+ ac = $.extend({}, a);
+ }
+ $.each(permutation, function(i) {
+ a[i] = ac[this];
+ });
+ }
+ var ts = this.get(0);
+ function resortRows(parent, clobj) {
+ $(">tr"+(clobj||""), parent).each(function() {
+ var row = this;
+ var elems = $.makeArray(row.cells);
+ $.each(permutation, function() {
+ var e = elems[this];
+ if (e) {
+ row.appendChild(e);
+ }
+ });
+ });
+ }
+ resortArray(ts.p.colModel);
+ resortArray(ts.p.colNames);
+ resortArray(ts.grid.headers);
+ resortRows($("thead:first", ts.grid.hDiv), keepHeader && ":not(.ui-jqgrid-labels)");
+ if (updateCells) {
+ resortRows($("#"+$.jgrid.jqID(ts.p.id)+" tbody:first"), ".jqgfirstrow, tr.jqgrow, tr.jqfoot");
+ }
+ if (ts.p.footerrow) {
+ resortRows($("tbody:first", ts.grid.sDiv));
+ }
+ if (ts.p.remapColumns) {
+ if (!ts.p.remapColumns.length){
+ ts.p.remapColumns = $.makeArray(permutation);
+ } else {
+ resortArray(ts.p.remapColumns);
+ }
+ }
+ ts.p.lastsort = $.inArray(ts.p.lastsort, permutation);
+ if(ts.p.treeGrid) { ts.p.expColInd = $.inArray(ts.p.expColInd, permutation); }
+ $(ts).triggerHandler("jqGridRemapColumns", [permutation, updateCells, keepHeader]);
+ },
+ setGridWidth : function(nwidth, shrink) {
+ return this.each(function(){
+ if (!this.grid ) {return;}
+ var $t = this, cw,
+ initwidth = 0, brd=$.jgrid.cellWidth() ? 0: $t.p.cellLayout, lvc, vc=0, hs=false, scw=$t.p.scrollOffset, aw, gw=0,
+ cl = 0,cr;
+ if(typeof shrink != 'boolean') {
+ shrink=$t.p.shrinkToFit;
+ }
+ if(isNaN(nwidth)) {return;}
+ nwidth = parseInt(nwidth,10);
+ $t.grid.width = $t.p.width = nwidth;
+ $("#gbox_"+$.jgrid.jqID($t.p.id)).css("width",nwidth+"px");
+ $("#gview_"+$.jgrid.jqID($t.p.id)).css("width",nwidth+"px");
+ $($t.grid.bDiv).css("width",nwidth+"px");
+ $($t.grid.hDiv).css("width",nwidth+"px");
+ if($t.p.pager ) {$($t.p.pager).css("width",nwidth+"px");}
+ if($t.p.toppager ) {$($t.p.toppager).css("width",nwidth+"px");}
+ if($t.p.toolbar[0] === true){
+ $($t.grid.uDiv).css("width",nwidth+"px");
+ if($t.p.toolbar[1]=="both") {$($t.grid.ubDiv).css("width",nwidth+"px");}
+ }
+ if($t.p.footerrow) { $($t.grid.sDiv).css("width",nwidth+"px"); }
+ if(shrink ===false && $t.p.forceFit === true) {$t.p.forceFit=false;}
+ if(shrink===true) {
+ $.each($t.p.colModel, function() {
+ if(this.hidden===false){
+ cw = this.widthOrg;
+ initwidth += cw+brd;
+ if(this.fixed) {
+ gw += cw+brd;
+ } else {
+ vc++;
+ }
+ cl++;
+ }
+ });
+ if(vc === 0) { return; }
+ $t.p.tblwidth = initwidth;
+ aw = nwidth-brd*vc-gw;
+ if(!isNaN($t.p.height)) {
+ if($($t.grid.bDiv)[0].clientHeight < $($t.grid.bDiv)[0].scrollHeight || $t.rows.length === 1){
+ hs = true;
+ aw -= scw;
+ }
+ }
+ initwidth =0;
+ var cle = $t.grid.cols.length >0;
+ $.each($t.p.colModel, function(i) {
+ if(this.hidden === false && !this.fixed){
+ cw = this.widthOrg;
+ cw = Math.round(aw*cw/($t.p.tblwidth-brd*vc-gw));
+ if (cw < 0) { return; }
+ this.width =cw;
+ initwidth += cw;
+ $t.grid.headers[i].width=cw;
+ $t.grid.headers[i].el.style.width=cw+"px";
+ if($t.p.footerrow) { $t.grid.footers[i].style.width = cw+"px"; }
+ if(cle) { $t.grid.cols[i].style.width = cw+"px"; }
+ lvc = i;
+ }
+ });
+
+ if (!lvc) { return; }
+
+ cr =0;
+ if (hs) {
+ if(nwidth-gw-(initwidth+brd*vc) !== scw){
+ cr = nwidth-gw-(initwidth+brd*vc)-scw;
+ }
+ } else if( Math.abs(nwidth-gw-(initwidth+brd*vc)) !== 1) {
+ cr = nwidth-gw-(initwidth+brd*vc);
+ }
+ $t.p.colModel[lvc].width += cr;
+ $t.p.tblwidth = initwidth+cr+brd*vc+gw;
+ if($t.p.tblwidth > nwidth) {
+ var delta = $t.p.tblwidth - parseInt(nwidth,10);
+ $t.p.tblwidth = nwidth;
+ cw = $t.p.colModel[lvc].width = $t.p.colModel[lvc].width-delta;
+ } else {
+ cw= $t.p.colModel[lvc].width;
+ }
+ $t.grid.headers[lvc].width = cw;
+ $t.grid.headers[lvc].el.style.width=cw+"px";
+ if(cle) { $t.grid.cols[lvc].style.width = cw+"px"; }
+ if($t.p.footerrow) {
+ $t.grid.footers[lvc].style.width = cw+"px";
+ }
+ }
+ if($t.p.tblwidth) {
+ $('table:first',$t.grid.bDiv).css("width",$t.p.tblwidth+"px");
+ $('table:first',$t.grid.hDiv).css("width",$t.p.tblwidth+"px");
+ $t.grid.hDiv.scrollLeft = $t.grid.bDiv.scrollLeft;
+ if($t.p.footerrow) {
+ $('table:first',$t.grid.sDiv).css("width",$t.p.tblwidth+"px");
+ }
+ }
+ });
+ },
+ setGridHeight : function (nh) {
+ return this.each(function (){
+ var $t = this;
+ if(!$t.grid) {return;}
+ var bDiv = $($t.grid.bDiv);
+ bDiv.css({height: nh+(isNaN(nh)?"":"px")});
+ if($t.p.frozenColumns === true){
+ //follow the original set height to use 16, better scrollbar width detection
+ $('#'+$.jgrid.jqID($t.p.id)+"_frozen").parent().height(bDiv.height() - 16);
+ }
+ $t.p.height = nh;
+ if ($t.p.scroll) { $t.grid.populateVisible(); }
+ });
+ },
+ setCaption : function (newcap){
+ return this.each(function(){
+ this.p.caption=newcap;
+ $("span.ui-jqgrid-title, span.ui-jqgrid-title-rtl",this.grid.cDiv).html(newcap);
+ $(this.grid.cDiv).show();
+ });
+ },
+ setLabel : function(colname, nData, prop, attrp ){
+ return this.each(function(){
+ var $t = this, pos=-1;
+ if(!$t.grid) {return;}
+ if(typeof(colname) != "undefined") {
+ $($t.p.colModel).each(function(i){
+ if (this.name == colname) {
+ pos = i;return false;
+ }
+ });
+ } else { return; }
+ if(pos>=0) {
+ var thecol = $("tr.ui-jqgrid-labels th:eq("+pos+")",$t.grid.hDiv);
+ if (nData){
+ var ico = $(".s-ico",thecol);
+ $("[id^=jqgh_]",thecol).empty().html(nData).append(ico);
+ $t.p.colNames[pos] = nData;
+ }
+ if (prop) {
+ if(typeof prop === 'string') {$(thecol).addClass(prop);} else {$(thecol).css(prop);}
+ }
+ if(typeof attrp === 'object') {$(thecol).attr(attrp);}
+ }
+ });
+ },
+ setCell : function(rowid,colname,nData,cssp,attrp, forceupd) {
+ return this.each(function(){
+ var $t = this, pos =-1,v, title;
+ if(!$t.grid) {return;}
+ if(isNaN(colname)) {
+ $($t.p.colModel).each(function(i){
+ if (this.name == colname) {
+ pos = i;return false;
+ }
+ });
+ } else {pos = parseInt(colname,10);}
+ if(pos>=0) {
+ var ind = $t.rows.namedItem(rowid);
+ if (ind){
+ var tcell = $("td:eq("+pos+")",ind);
+ if(nData !== "" || forceupd === true) {
+ v = $t.formatter(rowid, nData, pos,ind,'edit');
+ title = $t.p.colModel[pos].title ? {"title":$.jgrid.stripHtml(v)} : {};
+ if($t.p.treeGrid && $(".tree-wrap",$(tcell)).length>0) {
+ $("span",$(tcell)).html(v).attr(title);
+ } else {
+ $(tcell).html(v).attr(title);
+ }
+ if($t.p.datatype == "local") {
+ var cm = $t.p.colModel[pos], index;
+ nData = cm.formatter && typeof(cm.formatter) === 'string' && cm.formatter == 'date' ? $.unformat.date.call($t,nData,cm) : nData;
+ index = $t.p._index[rowid];
+ if(typeof index != "undefined") {
+ $t.p.data[index][cm.name] = nData;
+ }
+ }
+ }
+ if(typeof cssp === 'string'){
+ $(tcell).addClass(cssp);
+ } else if(cssp) {
+ $(tcell).css(cssp);
+ }
+ if(typeof attrp === 'object') {$(tcell).attr(attrp);}
+ }
+ }
+ });
+ },
+ getCell : function(rowid,col) {
+ var ret = false;
+ this.each(function(){
+ var $t=this, pos=-1;
+ if(!$t.grid) {return;}
+ if(isNaN(col)) {
+ $($t.p.colModel).each(function(i){
+ if (this.name === col) {
+ pos = i;return false;
+ }
+ });
+ } else {pos = parseInt(col,10);}
+ if(pos>=0) {
+ var ind = $t.rows.namedItem(rowid);
+ if(ind) {
+ try {
+ ret = $.unformat.call($t,$("td:eq("+pos+")",ind),{rowId:ind.id, colModel:$t.p.colModel[pos]},pos);
+ } catch (e){
+ ret = $.jgrid.htmlDecode($("td:eq("+pos+")",ind).html());
+ }
+ }
+ }
+ });
+ return ret;
+ },
+ getCol : function (col, obj, mathopr) {
+ var ret = [], val, sum=0, min, max, v;
+ obj = typeof (obj) != 'boolean' ? false : obj;
+ if(typeof mathopr == 'undefined') { mathopr = false; }
+ this.each(function(){
+ var $t=this, pos=-1;
+ if(!$t.grid) {return;}
+ if(isNaN(col)) {
+ $($t.p.colModel).each(function(i){
+ if (this.name === col) {
+ pos = i;return false;
+ }
+ });
+ } else {pos = parseInt(col,10);}
+ if(pos>=0) {
+ var ln = $t.rows.length, i =0;
+ if (ln && ln>0){
+ while(i<ln){
+ if($($t.rows[i]).hasClass('jqgrow')) {
+ try {
+ val = $.unformat.call($t,$($t.rows[i].cells[pos]),{rowId:$t.rows[i].id, colModel:$t.p.colModel[pos]},pos);
+ } catch (e) {
+ val = $.jgrid.htmlDecode($t.rows[i].cells[pos].innerHTML);
+ }
+ if(mathopr) {
+ v = parseFloat(val);
+ sum += v;
+ if (max === undefined) {max = min = v}
+ min = Math.min(min, v);
+ max = Math.max(max, v);
+ }
+ else if(obj) { ret.push( {id:$t.rows[i].id,value:val} ); }
+ else { ret.push( val ); }
+ }
+ i++;
+ }
+ if(mathopr) {
+ switch(mathopr.toLowerCase()){
+ case 'sum': ret =sum; break;
+ case 'avg': ret = sum/ln; break;
+ case 'count': ret = ln; break;
+ case 'min': ret = min; break;
+ case 'max': ret = max; break;
+ }
+ }
+ }
+ }
+ });
+ return ret;
+ },
+ clearGridData : function(clearfooter) {
+ return this.each(function(){
+ var $t = this;
+ if(!$t.grid) {return;}
+ if(typeof clearfooter != 'boolean') { clearfooter = false; }
+ if($t.p.deepempty) {$("#"+$.jgrid.jqID($t.p.id)+" tbody:first tr:gt(0)").remove();}
+ else {
+ var trf = $("#"+$.jgrid.jqID($t.p.id)+" tbody:first tr:first")[0];
+ $("#"+$.jgrid.jqID($t.p.id)+" tbody:first").empty().append(trf);
+ }
+ if($t.p.footerrow && clearfooter) { $(".ui-jqgrid-ftable td",$t.grid.sDiv).html(" "); }
+ $t.p.selrow = null; $t.p.selarrrow= []; $t.p.savedRow = [];
+ $t.p.records = 0;$t.p.page=1;$t.p.lastpage=0;$t.p.reccount=0;
+ $t.p.data = []; $t.p._index = {};
+ $t.updatepager(true,false);
+ });
+ },
+ getInd : function(rowid,rc){
+ var ret =false,rw;
+ this.each(function(){
+ rw = this.rows.namedItem(rowid);
+ if(rw) {
+ ret = rc===true ? rw: rw.rowIndex;
+ }
+ });
+ return ret;
+ },
+ bindKeys : function( settings ){
+ var o = $.extend({
+ onEnter: null,
+ onSpace: null,
+ onLeftKey: null,
+ onRightKey: null,
+ scrollingRows : true
+ },settings || {});
+ return this.each(function(){
+ var $t = this;
+ if( !$('body').is('[role]') ){$('body').attr('role','application');}
+ $t.p.scrollrows = o.scrollingRows;
+ $($t).keydown(function(event){
+ var target = $($t).find('tr[tabindex=0]')[0], id, r, mind,
+ expanded = $t.p.treeReader.expanded_field;
+ //check for arrow keys
+ if(target) {
+ mind = $t.p._index[target.id];
+ if(event.keyCode === 37 || event.keyCode === 38 || event.keyCode === 39 || event.keyCode === 40){
+ // up key
+ if(event.keyCode === 38 ){
+ r = target.previousSibling;
+ id = "";
+ if(r) {
+ if($(r).is(":hidden")) {
+ while(r) {
+ r = r.previousSibling;
+ if(!$(r).is(":hidden") && $(r).hasClass('jqgrow')) {id = r.id;break;}
+ }
+ } else {
+ id = r.id;
+ }
+ }
+ $($t).jqGrid('setSelection', id, true, event);
+ event.preventDefault();
+ }
+ //if key is down arrow
+ if(event.keyCode === 40){
+ r = target.nextSibling;
+ id ="";
+ if(r) {
+ if($(r).is(":hidden")) {
+ while(r) {
+ r = r.nextSibling;
+ if(!$(r).is(":hidden") && $(r).hasClass('jqgrow') ) {id = r.id;break;}
+ }
+ } else {
+ id = r.id;
+ }
+ }
+ $($t).jqGrid('setSelection', id, true, event);
+ event.preventDefault();
+ }
+ // left
+ if(event.keyCode === 37 ){
+ if($t.p.treeGrid && $t.p.data[mind][expanded]) {
+ $(target).find("div.treeclick").trigger('click');
+ }
+ $($t).triggerHandler("jqGridKeyLeft", [$t.p.selrow]);
+ if($.isFunction(o.onLeftKey)) {
+ o.onLeftKey.call($t, $t.p.selrow);
+ }
+ }
+ // right
+ if(event.keyCode === 39 ){
+ if($t.p.treeGrid && !$t.p.data[mind][expanded]) {
+ $(target).find("div.treeclick").trigger('click');
+ }
+ $($t).triggerHandler("jqGridKeyRight", [$t.p.selrow]);
+ if($.isFunction(o.onRightKey)) {
+ o.onRightKey.call($t, $t.p.selrow);
+ }
+ }
+ }
+ //check if enter was pressed on a grid or treegrid node
+ else if( event.keyCode === 13 ){
+ $($t).triggerHandler("jqGridKeyEnter", [$t.p.selrow]);
+ if($.isFunction(o.onEnter)) {
+ o.onEnter.call($t, $t.p.selrow);
+ }
+ } else if(event.keyCode === 32) {
+ $($t).triggerHandler("jqGridKeySpace", [$t.p.selrow]);
+ if($.isFunction(o.onSpace)) {
+ o.onSpace.call($t, $t.p.selrow);
+ }
+ }
+ }
+ });
+ });
+ },
+ unbindKeys : function(){
+ return this.each(function(){
+ $(this).unbind('keydown');
+ });
+ },
+ getLocalRow : function (rowid) {
+ var ret = false, ind;
+ this.each(function(){
+ if(typeof(rowid) !== "undefined") {
+ ind = this.p._index[rowid];
+ if(ind >= 0 ) {
+ ret = this.p.data[ind];
+ }
+ }
+ });
+ return ret;
+ }
+});
+})(jQuery);
+(function($){
+/**
+ * jqGrid extension for custom methods
+ * Tony Tomov tony(a)trirand.com
+ * http://trirand.com/blog/
+ *
+ * Wildraid wildraid(a)mail.ru
+ * Oleg Kiriljuk oleg.kiriljuk(a)ok-soft-gmbh.com
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl-2.0.html
+**/
+/*global jQuery, $ */
+"use strict";
+$.jgrid.extend({
+ getColProp : function(colname){
+ var ret ={}, $t = this[0];
+ if ( !$t.grid ) { return false; }
+ var cM = $t.p.colModel;
+ for ( var i =0;i<cM.length;i++ ) {
+ if ( cM[i].name == colname ) {
+ ret = cM[i];
+ break;
+ }
+ }
+ return ret;
+ },
+ setColProp : function(colname, obj){
+ //do not set width will not work
+ return this.each(function(){
+ if ( this.grid ) {
+ if ( obj ) {
+ var cM = this.p.colModel;
+ for ( var i =0;i<cM.length;i++ ) {
+ if ( cM[i].name == colname ) {
+ $.extend(this.p.colModel[i],obj);
+ break;
+ }
+ }
+ }
+ }
+ });
+ },
+ sortGrid : function(colname,reload, sor){
+ return this.each(function(){
+ var $t=this,idx=-1;
+ if ( !$t.grid ) { return;}
+ if ( !colname ) { colname = $t.p.sortname; }
+ for ( var i=0;i<$t.p.colModel.length;i++ ) {
+ if ( $t.p.colModel[i].index == colname || $t.p.colModel[i].name==colname ) {
+ idx = i;
+ break;
+ }
+ }
+ if ( idx!=-1 ){
+ var sort = $t.p.colModel[idx].sortable;
+ if ( typeof sort !== 'boolean' ) { sort = true; }
+ if ( typeof reload !=='boolean' ) { reload = false; }
+ if ( sort ) { $t.sortData("jqgh_"+$t.p.id+"_" + colname, idx, reload, sor); }
+ }
+ });
+ },
+ clearBeforeUnload : function () {
+ return this.each(function(){
+ var grid = this.grid;
+ grid.emptyRows.call(this, true, true); // this work quick enough and reduce the size of memory leaks if we have someone
+
+ //$(document).unbind("mouseup"); // TODO add namespace
+ $(grid.hDiv).unbind("mousemove"); // TODO add namespace
+ $(this).unbind();
+
+ grid.dragEnd = null;
+ grid.dragMove = null;
+ grid.dragStart = null;
+ grid.emptyRows = null;
+ grid.populate = null;
+ grid.populateVisible = null;
+ grid.scrollGrid = null;
+ grid.selectionPreserver = null;
+
+ grid.bDiv = null;
+ grid.cDiv = null;
+ grid.hDiv = null;
+ grid.cols = null;
+ var i, l = grid.headers.length;
+ for (i = 0; i < l; i++) {
+ grid.headers[i].el = null;
+ }
+
+ this.formatCol = null;
+ this.sortData = null;
+ this.updatepager = null;
+ this.refreshIndex = null;
+ this.setHeadCheckBox = null;
+ this.constructTr = null;
+ this.formatter = null;
+ this.addXmlData = null;
+ this.addJSONData = null;
+ });
+ },
+ GridDestroy : function () {
+ return this.each(function(){
+ if ( this.grid ) {
+ if ( this.p.pager ) { // if not part of grid
+ $(this.p.pager).remove();
+ }
+ try {
+ $(this).jqGrid('clearBeforeUnload');
+ $("#gbox_"+$.jgrid.jqID(this.id)).remove();
+ } catch (_) {}
+ }
+ });
+ },
+ GridUnload : function(){
+ return this.each(function(){
+ if ( !this.grid ) {return;}
+ var defgrid = {id: $(this).attr('id'),cl: $(this).attr('class')};
+ if (this.p.pager) {
+ $(this.p.pager).empty().removeClass("ui-state-default ui-jqgrid-pager corner-bottom");
+ }
+ var newtable = document.createElement('table');
+ $(newtable).attr({id:defgrid.id});
+ newtable.className = defgrid.cl;
+ var gid = $.jgrid.jqID(this.id);
+ $(newtable).removeClass("ui-jqgrid-btable");
+ if( $(this.p.pager).parents("#gbox_"+gid).length === 1 ) {
+ $(newtable).insertBefore("#gbox_"+gid).show();
+ $(this.p.pager).insertBefore("#gbox_"+gid);
+ } else {
+ $(newtable).insertBefore("#gbox_"+gid).show();
+ }
+ $(this).jqGrid('clearBeforeUnload');
+ $("#gbox_"+gid).remove();
+ });
+ },
+ setGridState : function(state) {
+ return this.each(function(){
+ if ( !this.grid ) {return;}
+ var $t = this;
+ if(state == 'hidden'){
+ $(".ui-jqgrid-bdiv, .ui-jqgrid-hdiv","#gview_"+$.jgrid.jqID($t.p.id)).slideUp("fast");
+ if($t.p.pager) {$($t.p.pager).slideUp("fast");}
+ if($t.p.toppager) {$($t.p.toppager).slideUp("fast");}
+ if($t.p.toolbar[0]===true) {
+ if( $t.p.toolbar[1]=='both') {
+ $($t.grid.ubDiv).slideUp("fast");
+ }
+ $($t.grid.uDiv).slideUp("fast");
+ }
+ if($t.p.footerrow) { $(".ui-jqgrid-sdiv","#gbox_"+$.jgrid.jqID($t.p.id)).slideUp("fast"); }
+ $(".ui-jqgrid-titlebar-close span",$t.grid.cDiv).removeClass("ui-icon-circle-triangle-n").addClass("ui-icon-circle-triangle-s");
+ $t.p.gridstate = 'hidden';
+ } else if(state=='visible') {
+ $(".ui-jqgrid-hdiv, .ui-jqgrid-bdiv","#gview_"+$.jgrid.jqID($t.p.id)).slideDown("fast");
+ if($t.p.pager) {$($t.p.pager).slideDown("fast");}
+ if($t.p.toppager) {$($t.p.toppager).slideDown("fast");}
+ if($t.p.toolbar[0]===true) {
+ if( $t.p.toolbar[1]=='both') {
+ $($t.grid.ubDiv).slideDown("fast");
+ }
+ $($t.grid.uDiv).slideDown("fast");
+ }
+ if($t.p.footerrow) { $(".ui-jqgrid-sdiv","#gbox_"+$.jgrid.jqID($t.p.id)).slideDown("fast"); }
+ $(".ui-jqgrid-titlebar-close span",$t.grid.cDiv).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n");
+ $t.p.gridstate = 'visible';
+ }
+
+ });
+ },
+ filterToolbar : function(p){
+ p = $.extend({
+ autosearch: true,
+ searchOnEnter : true,
+ beforeSearch: null,
+ afterSearch: null,
+ beforeClear: null,
+ afterClear: null,
+ searchurl : '',
+ stringResult: false,
+ groupOp: 'AND',
+ defaultSearch : "bw"
+ },p || {});
+ return this.each(function(){
+ var $t = this;
+ if(this.ftoolbar) { return; }
+ var triggerToolbar = function() {
+ var sdata={}, j=0, v, nm, sopt={},so;
+ $.each($t.p.colModel,function(){
+ nm = this.index || this.name;
+ so = (this.searchoptions && this.searchoptions.sopt) ? this.searchoptions.sopt[0] : this.stype=='select'? 'eq' : p.defaultSearch;
+ v = $("#gs_"+$.jgrid.jqID(this.name), (this.frozen===true && $t.p.frozenColumns === true) ? $t.grid.fhDiv : $t.grid.hDiv).val();
+ if(v) {
+ sdata[nm] = v;
+ sopt[nm] = so;
+ j++;
+ } else {
+ try {
+ delete $t.p.postData[nm];
+ } catch (z) {}
+ }
+ });
+ var sd = j>0 ? true : false;
+ if(p.stringResult === true || $t.p.datatype == "local") {
+ var ruleGroup = "{\"groupOp\":\"" + p.groupOp + "\",\"rules\":[";
+ var gi=0;
+ $.each(sdata,function(i,n){
+ if (gi > 0) {ruleGroup += ",";}
+ ruleGroup += "{\"field\":\"" + i + "\",";
+ ruleGroup += "\"op\":\"" + sopt[i] + "\",";
+ n+="";
+ ruleGroup += "\"data\":\"" + n.replace(/\\/g,'\\\\').replace(/\"/g,'\\"') + "\"}";
+ gi++;
+ });
+ ruleGroup += "]}";
+ $.extend($t.p.postData,{filters:ruleGroup});
+ $.each(['searchField', 'searchString', 'searchOper'], function(i, n){
+ if($t.p.postData.hasOwnProperty(n)) { delete $t.p.postData[n];}
+ });
+ } else {
+ $.extend($t.p.postData,sdata);
+ }
+ var saveurl;
+ if($t.p.searchurl) {
+ saveurl = $t.p.url;
+ $($t).jqGrid("setGridParam",{url:$t.p.searchurl});
+ }
+ var bsr = $($t).triggerHandler("jqGridToolbarBeforeSearch") === 'stop' ? true : false;
+ if(!bsr && $.isFunction(p.beforeSearch)){bsr = p.beforeSearch.call($t);}
+ if(!bsr) { $($t).jqGrid("setGridParam",{search:sd}).trigger("reloadGrid",[{page:1}]); }
+ if(saveurl) {$($t).jqGrid("setGridParam",{url:saveurl});}
+ $($t).triggerHandler("jqGridToolbarAfterSearch");
+ if($.isFunction(p.afterSearch)){p.afterSearch.call($t);}
+ };
+ var clearToolbar = function(trigger){
+ var sdata={}, j=0, nm;
+ trigger = (typeof trigger != 'boolean') ? true : trigger;
+ $.each($t.p.colModel,function(){
+ var v;
+ if(this.searchoptions && this.searchoptions.defaultValue !== undefined) { v = this.searchoptions.defaultValue; }
+ nm = this.index || this.name;
+ switch (this.stype) {
+ case 'select' :
+ $("#gs_"+$.jgrid.jqID(this.name)+" option",(this.frozen===true && $t.p.frozenColumns === true) ? $t.grid.fhDiv : $t.grid.hDiv).each(function (i){
+ if(i===0) { this.selected = true; }
+ if ($(this).val() == v) {
+ this.selected = true;
+ return false;
+ }
+ });
+ if ( v !== undefined ) {
+ // post the key and not the text
+ sdata[nm] = v;
+ j++;
+ } else {
+ try {
+ delete $t.p.postData[nm];
+ } catch(e) {}
+ }
+ break;
+ case 'text':
+ $("#gs_"+$.jgrid.jqID(this.name),(this.frozen===true && $t.p.frozenColumns === true) ? $t.grid.fhDiv : $t.grid.hDiv).val(v);
+ if(v !== undefined) {
+ sdata[nm] = v;
+ j++;
+ } else {
+ try {
+ delete $t.p.postData[nm];
+ } catch (y){}
+ }
+ break;
+ }
+ });
+ var sd = j>0 ? true : false;
+ if(p.stringResult === true || $t.p.datatype == "local") {
+ var ruleGroup = "{\"groupOp\":\"" + p.groupOp + "\",\"rules\":[";
+ var gi=0;
+ $.each(sdata,function(i,n){
+ if (gi > 0) {ruleGroup += ",";}
+ ruleGroup += "{\"field\":\"" + i + "\",";
+ ruleGroup += "\"op\":\"" + "eq" + "\",";
+ n+="";
+ ruleGroup += "\"data\":\"" + n.replace(/\\/g,'\\\\').replace(/\"/g,'\\"') + "\"}";
+ gi++;
+ });
+ ruleGroup += "]}";
+ $.extend($t.p.postData,{filters:ruleGroup});
+ $.each(['searchField', 'searchString', 'searchOper'], function(i, n){
+ if($t.p.postData.hasOwnProperty(n)) { delete $t.p.postData[n];}
+ });
+ } else {
+ $.extend($t.p.postData,sdata);
+ }
+ var saveurl;
+ if($t.p.searchurl) {
+ saveurl = $t.p.url;
+ $($t).jqGrid("setGridParam",{url:$t.p.searchurl});
+ }
+ var bcv = $($t).triggerHandler("jqGridToolbarBeforeClear") === 'stop' ? true : false;
+ if(!bcv && $.isFunction(p.beforeClear)){bcv = p.beforeClear.call($t);}
+ if(!bcv) {
+ if(trigger) {
+ $($t).jqGrid("setGridParam",{search:sd}).trigger("reloadGrid",[{page:1}]);
+ }
+ }
+ if(saveurl) {$($t).jqGrid("setGridParam",{url:saveurl});}
+ $($t).triggerHandler("jqGridToolbarAfterClear");
+ if($.isFunction(p.afterClear)){p.afterClear();}
+ };
+ var toggleToolbar = function(){
+ var trow = $("tr.ui-search-toolbar",$t.grid.hDiv),
+ trow2 = $t.p.frozenColumns === true ? $("tr.ui-search-toolbar",$t.grid.fhDiv) : false;
+ if(trow.css("display")=='none') {
+ trow.show();
+ if(trow2) {
+ trow2.show();
+ }
+ } else {
+ trow.hide();
+ if(trow2) {
+ trow2.hide();
+ }
+ }
+ };
+ // create the row
+ function bindEvents(selector, events) {
+ var jElem = $(selector);
+ if (jElem[0]) {
+ jQuery.each(events, function() {
+ if (this.data !== undefined) {
+ jElem.bind(this.type, this.data, this.fn);
+ } else {
+ jElem.bind(this.type, this.fn);
+ }
+ });
+ }
+ }
+ var tr = $("<tr class='ui-search-toolbar' role='rowheader'></tr>");
+ var timeoutHnd;
+ $.each($t.p.colModel,function(){
+ var cm=this, thd , th, soptions,surl,self;
+ th = $("<th role='columnheader' class='ui-state-default ui-th-column ui-th-"+$t.p.direction+"'></th>");
+ thd = $("<div style='width:100%;position:relative;height:100%;padding-right:0.3em;'></div>");
+ if(this.hidden===true) { $(th).css("display","none");}
+ this.search = this.search === false ? false : true;
+ if(typeof this.stype == 'undefined' ) {this.stype='text';}
+ soptions = $.extend({},this.searchoptions || {});
+ if(this.search){
+ switch (this.stype)
+ {
+ case "select":
+ surl = this.surl || soptions.dataUrl;
+ if(surl) {
+ // data returned should have already constructed html select
+ // primitive jQuery load
+ self = thd;
+ $.ajax($.extend({
+ url: surl,
+ dataType: "html",
+ success: function(res) {
+ if(soptions.buildSelect !== undefined) {
+ var d = soptions.buildSelect(res);
+ if (d) { $(self).append(d); }
+ } else {
+ $(self).append(res);
+ }
+ if(soptions.defaultValue !== undefined) { $("select",self).val(soptions.defaultValue); }
+ $("select",self).attr({name:cm.index || cm.name, id: "gs_"+cm.name});
+ if(soptions.attr) {$("select",self).attr(soptions.attr);}
+ $("select",self).css({width: "100%"});
+ // preserve autoserch
+ if(soptions.dataInit !== undefined) { soptions.dataInit($("select",self)[0]); }
+ if(soptions.dataEvents !== undefined) { bindEvents($("select",self)[0],soptions.dataEvents); }
+ if(p.autosearch===true){
+ $("select",self).change(function(){
+ triggerToolbar();
+ return false;
+ });
+ }
+ res=null;
+ }
+ }, $.jgrid.ajaxOptions, $t.p.ajaxSelectOptions || {} ));
+ } else {
+ var oSv, sep, delim;
+ if(cm.searchoptions) {
+ oSv = cm.searchoptions.value === undefined ? "" : cm.searchoptions.value;
+ sep = cm.searchoptions.separator === undefined ? ":" : cm.searchoptions.separator;
+ delim = cm.searchoptions.delimiter === undefined ? ";" : cm.searchoptions.delimiter;
+ } else if(cm.editoptions) {
+ oSv = cm.editoptions.value === undefined ? "" : cm.editoptions.value;
+ sep = cm.editoptions.separator === undefined ? ":" : cm.editoptions.separator;
+ delim = cm.editoptions.delimiter === undefined ? ";" : cm.editoptions.delimiter;
+ }
+ if (oSv) {
+ var elem = document.createElement("select");
+ elem.style.width = "100%";
+ $(elem).attr({name:cm.index || cm.name, id: "gs_"+cm.name});
+ var so, sv, ov;
+ if(typeof oSv === "string") {
+ so = oSv.split(delim);
+ for(var k=0; k<so.length;k++){
+ sv = so[k].split(sep);
+ ov = document.createElement("option");
+ ov.value = sv[0]; ov.innerHTML = sv[1];
+ elem.appendChild(ov);
+ }
+ } else if(typeof oSv === "object" ) {
+ for ( var key in oSv) {
+ if(oSv.hasOwnProperty(key)) {
+ ov = document.createElement("option");
+ ov.value = key; ov.innerHTML = oSv[key];
+ elem.appendChild(ov);
+ }
+ }
+ }
+ if(soptions.defaultValue !== undefined) { $(elem).val(soptions.defaultValue); }
+ if(soptions.attr) {$(elem).attr(soptions.attr);}
+ if(soptions.dataInit !== undefined) { soptions.dataInit(elem); }
+ if(soptions.dataEvents !== undefined) { bindEvents(elem, soptions.dataEvents); }
+ $(thd).append(elem);
+ if(p.autosearch===true){
+ $(elem).change(function(){
+ triggerToolbar();
+ return false;
+ });
+ }
+ }
+ }
+ break;
+ case 'text':
+ var df = soptions.defaultValue !== undefined ? soptions.defaultValue: "";
+ $(thd).append("<input type='text' style='width:95%;padding:0px;' name='"+(cm.index || cm.name)+"' id='gs_"+cm.name+"' value='"+df+"'/>");
+ if(soptions.attr) {$("input",thd).attr(soptions.attr);}
+ if(soptions.dataInit !== undefined) { soptions.dataInit($("input",thd)[0]); }
+ if(soptions.dataEvents !== undefined) { bindEvents($("input",thd)[0], soptions.dataEvents); }
+ if(p.autosearch===true){
+ if(p.searchOnEnter) {
+ $("input",thd).keypress(function(e){
+ var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
+ if(key == 13){
+ triggerToolbar();
+ return false;
+ }
+ return this;
+ });
+ } else {
+ $("input",thd).keydown(function(e){
+ var key = e.which;
+ switch (key) {
+ case 13:
+ return false;
+ case 9 :
+ case 16:
+ case 37:
+ case 38:
+ case 39:
+ case 40:
+ case 27:
+ break;
+ default :
+ if(timeoutHnd) { clearTimeout(timeoutHnd); }
+ timeoutHnd = setTimeout(function(){triggerToolbar();},500);
+ }
+ });
+ }
+ }
+ break;
+ }
+ }
+ $(th).append(thd);
+ $(tr).append(th);
+ });
+ $("table thead",$t.grid.hDiv).append(tr);
+ this.ftoolbar = true;
+ this.triggerToolbar = triggerToolbar;
+ this.clearToolbar = clearToolbar;
+ this.toggleToolbar = toggleToolbar;
+ });
+ },
+
+ destroyGroupHeader : function(nullHeader)
+ {
+ if(typeof(nullHeader) == 'undefined') {
+ nullHeader = true;
+ }
+ return this.each(function()
+ {
+ var $t = this, $tr, i, l, headers, $th, $resizing, grid = $t.grid,
+ thead = $("table.ui-jqgrid-htable thead", grid.hDiv), cm = $t.p.colModel, hc;
+ if(!grid) { return; }
+
+ $(this).unbind('.setGroupHeaders');
+ $tr = $("<tr>", {role: "rowheader"}).addClass("ui-jqgrid-labels");
+ headers = grid.headers;
+ for (i = 0, l = headers.length; i < l; i++) {
+ hc = cm[i].hidden ? "none" : "";
+ $th = $(headers[i].el)
+ .width(headers[i].width)
+ .css('display',hc);
+ try {
+ $th.removeAttr("rowSpan");
+ } catch (rs) {
+ //IE 6/7
+ $th.attr("rowSpan",1);
+ }
+ $tr.append($th);
+ $resizing = $th.children("span.ui-jqgrid-resize");
+ if ($resizing.length>0) {// resizable column
+ $resizing[0].style.height = "";
+ }
+ $th.children("div")[0].style.top = "";
+ }
+ $(thead).children('tr.ui-jqgrid-labels').remove();
+ $(thead).prepend($tr);
+
+ if(nullHeader === true) {
+ $($t).jqGrid('setGridParam',{ 'groupHeader': null});
+ }
+ });
+ },
+
+ setGroupHeaders : function ( o ) {
+ o = $.extend({
+ useColSpanStyle : false,
+ groupHeaders: []
+ },o || {});
+ return this.each(function(){
+ this.p.groupHeader = o;
+ var ts = this,
+ i, cmi, skip = 0, $tr, $colHeader, th, $th, thStyle,
+ iCol,
+ cghi,
+ //startColumnName,
+ numberOfColumns,
+ titleText,
+ cVisibleColumns,
+ colModel = ts.p.colModel,
+ cml = colModel.length,
+ ths = ts.grid.headers,
+ $htable = $("table.ui-jqgrid-htable", ts.grid.hDiv),
+ $trLabels = $htable.children("thead").children("tr.ui-jqgrid-labels:last").addClass("jqg-second-row-header"),
+ $thead = $htable.children("thead"),
+ $theadInTable,
+ $firstHeaderRow = $htable.find(".jqg-first-row-header");
+ if($firstHeaderRow[0] === undefined) {
+ $firstHeaderRow = $('<tr>', {role: "row", "aria-hidden": "true"}).addClass("jqg-first-row-header").css("height", "auto");
+ } else {
+ $firstHeaderRow.empty();
+ }
+ var $firstRow,
+ inColumnHeader = function (text, columnHeaders) {
+ var i = 0, length = columnHeaders.length;
+ for (; i < length; i++) {
+ if (columnHeaders[i].startColumnName === text) {
+ return i;
+ }
+ }
+ return -1;
+ };
+
+ $(ts).prepend($thead);
+ $tr = $('<tr>', {role: "rowheader"}).addClass("ui-jqgrid-labels jqg-third-row-header");
+ for (i = 0; i < cml; i++) {
+ th = ths[i].el;
+ $th = $(th);
+ cmi = colModel[i];
+ // build the next cell for the first header row
+ thStyle = { height: '0px', width: ths[i].width + 'px', display: (cmi.hidden ? 'none' : '')};
+ $("<th>", {role: 'gridcell'}).css(thStyle).addClass("ui-first-th-"+ts.p.direction).appendTo($firstHeaderRow);
+
+ th.style.width = ""; // remove unneeded style
+ iCol = inColumnHeader(cmi.name, o.groupHeaders);
+ if (iCol >= 0) {
+ cghi = o.groupHeaders[iCol];
+ numberOfColumns = cghi.numberOfColumns;
+ titleText = cghi.titleText;
+
+ // caclulate the number of visible columns from the next numberOfColumns columns
+ for (cVisibleColumns = 0, iCol = 0; iCol < numberOfColumns && (i + iCol < cml); iCol++) {
+ if (!colModel[i + iCol].hidden) {
+ cVisibleColumns++;
+ }
+ }
+
+ // The next numberOfColumns headers will be moved in the next row
+ // in the current row will be placed the new column header with the titleText.
+ // The text will be over the cVisibleColumns columns
+ $colHeader = $('<th>').attr({role: "columnheader"})
+ .addClass("ui-state-default ui-th-column-header ui-th-"+ts.p.direction)
+ .css({'height':'22px', 'border-top': '0px none'})
+ .html(titleText);
+ if(cVisibleColumns > 0) {
+ $colHeader.attr("colspan", String(cVisibleColumns));
+ }
+ if (ts.p.headertitles) {
+ $colHeader.attr("title", $colHeader.text());
+ }
+ // hide if not a visible cols
+ if( cVisibleColumns === 0) {
+ $colHeader.hide();
+ }
+
+ $th.before($colHeader); // insert new column header before the current
+ $tr.append(th); // move the current header in the next row
+
+ // set the coumter of headers which will be moved in the next row
+ skip = numberOfColumns - 1;
+ } else {
+ if (skip === 0) {
+ if (o.useColSpanStyle) {
+ // expand the header height to two rows
+ $th.attr("rowspan", "2");
+ } else {
+ $('<th>', {role: "columnheader"})
+ .addClass("ui-state-default ui-th-column-header ui-th-"+ts.p.direction)
+ .css({"display": cmi.hidden ? 'none' : '', 'border-top': '0px none'})
+ .insertBefore($th);
+ $tr.append(th);
+ }
+ } else {
+ // move the header to the next row
+ //$th.css({"padding-top": "2px", height: "19px"});
+ $tr.append(th);
+ skip--;
+ }
+ }
+ }
+ $theadInTable = $(ts).children("thead");
+ $theadInTable.prepend($firstHeaderRow);
+ $tr.insertAfter($trLabels);
+ $htable.append($theadInTable);
+
+ if (o.useColSpanStyle) {
+ // Increase the height of resizing span of visible headers
+ $htable.find("span.ui-jqgrid-resize").each(function () {
+ var $parent = $(this).parent();
+ if ($parent.is(":visible")) {
+ this.style.cssText = 'height: ' + $parent.height() + 'px !important; cursor: col-resize;';
+ }
+ });
+
+ // Set position of the sortable div (the main lable)
+ // with the column header text to the middle of the cell.
+ // One should not do this for hidden headers.
+ $htable.find("div.ui-jqgrid-sortable").each(function () {
+ var $ts = $(this), $parent = $ts.parent();
+ if ($parent.is(":visible") && $parent.is(":has(span.ui-jqgrid-resize)")) {
+ $ts.css('top', ($parent.height() - $ts.outerHeight()) / 2 + 'px');
+ }
+ });
+ }
+
+ $firstRow = $theadInTable.find("tr.jqg-first-row-header");
+ $(ts).bind('jqGridResizeStop.setGroupHeaders', function (e, nw, idx) {
+ $firstRow.find('th').eq(idx).width(nw);
+ });
+ });
+ },
+ setFrozenColumns : function () {
+ return this.each(function() {
+ if ( !this.grid ) {return;}
+ var $t = this, cm = $t.p.colModel,i=0, len = cm.length, maxfrozen = -1, frozen= false;
+ // TODO treeGrid and grouping Support
+ if($t.p.subGrid === true || $t.p.treeGrid === true || $t.p.cellEdit === true || $t.p.sortable || $t.p.scroll || $t.p.grouping )
+ {
+ return;
+ }
+ if($t.p.rownumbers) { i++; }
+ if($t.p.multiselect) { i++; }
+
+ // get the max index of frozen col
+ while(i<len)
+ {
+ // from left, no breaking frozen
+ if(cm[i].frozen === true)
+ {
+ frozen = true;
+ maxfrozen = i;
+ } else {
+ break;
+ }
+ i++;
+ }
+ if( maxfrozen>=0 && frozen) {
+ var top = $t.p.caption ? $($t.grid.cDiv).outerHeight() : 0,
+ hth = $(".ui-jqgrid-htable","#gview_"+$.jgrid.jqID($t.p.id)).height();
+ //headers
+ if($t.p.toppager) {
+ top = top + $($t.grid.topDiv).outerHeight();
+ }
+ if($t.p.toolbar[0] === true) {
+ if($t.p.toolbar[1] != "bottom") {
+ top = top + $($t.grid.uDiv).outerHeight();
+ }
+ }
+ $t.grid.fhDiv = $('<div style="position:absolute;left:0px;top:'+top+'px;height:'+hth+'px;" class="frozen-div ui-state-default ui-jqgrid-hdiv"></div>');
+ $t.grid.fbDiv = $('<div style="position:absolute;left:0px;top:'+(parseInt(top,10)+parseInt(hth,10) + 1)+'px;overflow-y:hidden" class="frozen-bdiv ui-jqgrid-bdiv"></div>');
+ $("#gview_"+$.jgrid.jqID($t.p.id)).append($t.grid.fhDiv);
+ var htbl = $(".ui-jqgrid-htable","#gview_"+$.jgrid.jqID($t.p.id)).clone(true);
+ // groupheader support - only if useColSpanstyle is false
+ if($t.p.groupHeader) {
+ $("tr.jqg-first-row-header, tr.jqg-third-row-header", htbl).each(function(){
+ $("th:gt("+maxfrozen+")",this).remove();
+ });
+ var swapfroz = -1, fdel = -1;
+ $("tr.jqg-second-row-header th", htbl).each(function(){
+ var cs= parseInt($(this).attr("colspan"),10);
+ if(cs) {
+ swapfroz = swapfroz+cs;
+ fdel++;
+ }
+ if(swapfroz === maxfrozen) {
+ return false;
+ }
+ });
+ if(swapfroz !== maxfrozen) {
+ fdel = maxfrozen;
+ }
+ $("tr.jqg-second-row-header", htbl).each(function(){
+ $("th:gt("+fdel+")",this).remove();
+ });
+ } else {
+ $("tr",htbl).each(function(){
+ $("th:gt("+maxfrozen+")",this).remove();
+ });
+ }
+ $(htbl).width(1);
+ // resizing stuff
+ $($t.grid.fhDiv).append(htbl)
+ .mousemove(function (e) {
+ if($t.grid.resizing){ $t.grid.dragMove(e);return false; }
+ });
+ $($t).bind('jqGridResizeStop.setFrozenColumns', function (e, w, index) {
+ var rhth = $(".ui-jqgrid-htable",$t.grid.fhDiv);
+ $("th:eq("+index+")",rhth).width( w );
+ var btd = $(".ui-jqgrid-btable",$t.grid.fbDiv);
+ $("tr:first td:eq("+index+")",btd).width( w );
+ });
+ // sorting stuff
+ $($t).bind('jqGridOnSortCol.setFrozenColumns', function (index, idxcol) {
+
+ var previousSelectedTh = $("tr.ui-jqgrid-labels:last th:eq("+$t.p.lastsort+")",$t.grid.fhDiv), newSelectedTh = $("tr.ui-jqgrid-labels:last th:eq("+idxcol+")",$t.grid.fhDiv);
+
+ $("span.ui-grid-ico-sort",previousSelectedTh).addClass('ui-state-disabled');
+ $(previousSelectedTh).attr("aria-selected","false");
+ $("span.ui-icon-"+$t.p.sortorder,newSelectedTh).removeClass('ui-state-disabled');
+ $(newSelectedTh).attr("aria-selected","true");
+ if(!$t.p.viewsortcols[0]) {
+ if($t.p.lastsort != idxcol) {
+ $("span.s-ico",previousSelectedTh).hide();
+ $("span.s-ico",newSelectedTh).show();
+ }
+ }
+ });
+
+ // data stuff
+ //TODO support for setRowData
+ $("#gview_"+$.jgrid.jqID($t.p.id)).append($t.grid.fbDiv);
+ jQuery($t.grid.bDiv).scroll(function () {
+ jQuery($t.grid.fbDiv).scrollTop(jQuery(this).scrollTop());
+ });
+ if($t.p.hoverrows === true) {
+ $("#"+$.jgrid.jqID($t.p.id)).unbind('mouseover').unbind('mouseout');
+ }
+ $($t).bind('jqGridAfterGridComplete.setFrozenColumns', function () {
+ $("#"+$.jgrid.jqID($t.p.id)+"_frozen").remove();
+ jQuery($t.grid.fbDiv).height( jQuery($t.grid.bDiv).height()-16);
+ var btbl = $("#"+$.jgrid.jqID($t.p.id)).clone(true);
+ $("tr",btbl).each(function(){
+ $("td:gt("+maxfrozen+")",this).remove();
+ });
+
+ $(btbl).width(1).attr("id",$t.p.id+"_frozen");
+ $($t.grid.fbDiv).append(btbl);
+ if($t.p.hoverrows === true) {
+ $("tr.jqgrow", btbl).hover(
+ function(){ $(this).addClass("ui-state-hover"); $("#"+$.jgrid.jqID(this.id), "#"+$.jgrid.jqID($t.p.id)).addClass("ui-state-hover"); },
+ function(){ $(this).removeClass("ui-state-hover"); $("#"+$.jgrid.jqID(this.id), "#"+$.jgrid.jqID($t.p.id)).removeClass("ui-state-hover"); }
+ );
+ $("tr.jqgrow", "#"+$.jgrid.jqID($t.p.id)).hover(
+ function(){ $(this).addClass("ui-state-hover"); $("#"+$.jgrid.jqID(this.id), "#"+$.jgrid.jqID($t.p.id)+"_frozen").addClass("ui-state-hover");},
+ function(){ $(this).removeClass("ui-state-hover"); $("#"+$.jgrid.jqID(this.id), "#"+$.jgrid.jqID($t.p.id)+"_frozen").removeClass("ui-state-hover"); }
+ );
+ }
+ btbl=null;
+ });
+ $t.p.frozenColumns = true;
+ }
+ });
+ },
+ destroyFrozenColumns : function() {
+ return this.each(function() {
+ if ( !this.grid ) {return;}
+ if(this.p.frozenColumns === true) {
+ var $t = this;
+ $($t.grid.fhDiv).remove();
+ $($t.grid.fbDiv).remove();
+ $t.grid.fhDiv = null; $t.grid.fbDiv=null;
+ $(this).unbind('.setFrozenColumns');
+ if($t.p.hoverrows === true) {
+ var ptr;
+ $("#"+$.jgrid.jqID($t.p.id)).bind('mouseover',function(e) {
+ ptr = $(e.target).closest("tr.jqgrow");
+ if($(ptr).attr("class") !== "ui-subgrid") {
+ $(ptr).addClass("ui-state-hover");
+ }
+ }).bind('mouseout',function(e) {
+ ptr = $(e.target).closest("tr.jqgrow");
+ $(ptr).removeClass("ui-state-hover");
+ });
+ }
+ this.p.frozenColumns = false;
+ }
+ });
+ }
+});
+})(jQuery);/*
+ * jqModal - Minimalist Modaling with jQuery
+ * (http://dev.iceburg.net/jquery/jqmodal/)
+ *
+ * Copyright (c) 2007,2008 Brice Burgess <bhb(a)iceburg.net>
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * $Version: 07/06/2008 +r13
+ */
+(function($) {
+$.fn.jqm=function(o){
+var p={
+overlay: 50,
+closeoverlay : true,
+overlayClass: 'jqmOverlay',
+closeClass: 'jqmClose',
+trigger: '.jqModal',
+ajax: F,
+ajaxText: '',
+target: F,
+modal: F,
+toTop: F,
+onShow: F,
+onHide: F,
+onLoad: F
+};
+return this.each(function(){if(this._jqm)return H[this._jqm].c=$.extend({},H[this._jqm].c,o);s++;this._jqm=s;
+H[s]={c:$.extend(p,$.jqm.params,o),a:F,w:$(this).addClass('jqmID'+s),s:s};
+if(p.trigger)$(this).jqmAddTrigger(p.trigger);
+});};
+
+$.fn.jqmAddClose=function(e){return hs(this,e,'jqmHide');};
+$.fn.jqmAddTrigger=function(e){return hs(this,e,'jqmShow');};
+$.fn.jqmShow=function(t){return this.each(function(){$.jqm.open(this._jqm,t);});};
+$.fn.jqmHide=function(t){return this.each(function(){$.jqm.close(this._jqm,t)});};
+
+$.jqm = {
+hash:{},
+open:function(s,t){var h=H[s],c=h.c,cc='.'+c.closeClass,z=(parseInt(h.w.css('z-index')));z=(z>0)?z:3000;var o=$('<div></div>').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z-1,opacity:c.overlay/100});if(h.a)return F;h.t=t;h.a=true;h.w.css('z-index',z);
+ if(c.modal) {if(!A[0])setTimeout(function(){L('bind');},1);A.push(s);}
+ else if(c.overlay > 0) {if(c.closeoverlay) h.w.jqmAddClose(o);}
+ else o=F;
+
+ h.o=(o)?o.addClass(c.overlayClass).prependTo('body'):F;
+ if(ie6){$('html,body').css({height:'100%',width:'100%'});if(o){o=o.css({position:'absolute'})[0];for(var y in {Top:1,Left:1})o.style.setExpression(y.toLowerCase(),"(_=(document.documentElement.scroll"+y+" || document.body.scroll"+y+"))+'px'");}}
+
+ if(c.ajax) {var r=c.target||h.w,u=c.ajax;r=(typeof r == 'string')?$(r,h.w):$(r);u=(u.substr(0,1) == '@')?$(t).attr(u.substring(1)):u;
+ r.html(c.ajaxText).load(u,function(){if(c.onLoad)c.onLoad.call(this,h);if(cc)h.w.jqmAddClose($(cc,h.w));e(h);});}
+ else if(cc)h.w.jqmAddClose($(cc,h.w));
+
+ if(c.toTop&&h.o)h.w.before('<span id="jqmP'+h.w[0]._jqm+'"></span>').insertAfter(h.o);
+ (c.onShow)?c.onShow(h):h.w.show();e(h);return F;
+},
+close:function(s){var h=H[s];if(!h.a)return F;h.a=F;
+ if(A[0]){A.pop();if(!A[0])L('unbind');}
+ if(h.c.toTop&&h.o)$('#jqmP'+h.w[0]._jqm).after(h.w).remove();
+ if(h.c.onHide)h.c.onHide(h);else{h.w.hide();if(h.o)h.o.remove();} return F;
+},
+params:{}};
+var s=0,H=$.jqm.hash,A=[],ie6=$.browser.msie&&($.browser.version == "6.0"),F=false,
+e=function(h){var i=$('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0});if(ie6)if(h.o)h.o.html('<p style="width:100%;height:100%"/>').prepend(i);else if(!$('iframe.jqm',h.w)[0])h.w.prepend(i); f(h);},
+f=function(h){try{$(':input:visible',h.w)[0].focus();}catch(_){}},
+L=function(t){$(document)[t]("keypress",m)[t]("keydown",m)[t]("mousedown",m);},
+m=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.jqmID'+h.s)[0]);if(r)f(h);return !r;},
+hs=function(w,t,c){return w.each(function(){var s=this._jqm;$(t).each(function() {
+ if(!this[c]){this[c]=[];$(this).click(function(){for(var i in {jqmShow:1,jqmHide:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return F;});}this[c].push(s);});});};
+})(jQuery);/*
+ * jqDnR - Minimalistic Drag'n'Resize for jQuery.
+ *
+ * Copyright (c) 2007 Brice Burgess <bhb(a)iceburg.net>, http://www.iceburg.net
+ * Licensed under the MIT License:
+ * http://www.opensource.org/licenses/mit-license.php
+ *
+ * $Version: 2007.08.19 +r2
+ */
+
+(function($){
+$.fn.jqDrag=function(h){return i(this,h,'d');};
+$.fn.jqResize=function(h,ar){return i(this,h,'r',ar);};
+$.jqDnR={
+ dnr:{},
+ e:0,
+ drag:function(v){
+ if(M.k == 'd'){E.css({left:M.X+v.pageX-M.pX,top:M.Y+v.pageY-M.pY});}
+ else {
+ E.css({width:Math.max(v.pageX-M.pX+M.W,0),height:Math.max(v.pageY-M.pY+M.H,0)});
+ if(M1){E1.css({width:Math.max(v.pageX-M1.pX+M1.W,0),height:Math.max(v.pageY-M1.pY+M1.H,0)});}
+ }
+ return false;
+ },
+ stop:function(){
+ //E.css('opacity',M.o);
+ $(document).unbind('mousemove',J.drag).unbind('mouseup',J.stop);
+ }
+};
+var J=$.jqDnR,M=J.dnr,E=J.e,E1,M1,
+i=function(e,h,k,aR){
+ return e.each(function(){
+ h=(h)?$(h,e):e;
+ h.bind('mousedown',{e:e,k:k},function(v){
+ var d=v.data,p={};E=d.e;E1 = aR ? $(aR) : false;
+ // attempt utilization of dimensions plugin to fix IE issues
+ if(E.css('position') != 'relative'){try{E.position(p);}catch(e){}}
+ M={
+ X:p.left||f('left')||0,
+ Y:p.top||f('top')||0,
+ W:f('width')||E[0].scrollWidth||0,
+ H:f('height')||E[0].scrollHeight||0,
+ pX:v.pageX,
+ pY:v.pageY,
+ k:d.k
+ //o:E.css('opacity')
+ };
+ // also resize
+ if(E1 && d.k != 'd'){
+ M1={
+ X:p.left||f1('left')||0,
+ Y:p.top||f1('top')||0,
+ W:E1[0].offsetWidth||f1('width')||0,
+ H:E1[0].offsetHeight||f1('height')||0,
+ pX:v.pageX,
+ pY:v.pageY,
+ k:d.k
+ };
+ } else {M1 = false;}
+ //E.css({opacity:0.8});
+ if($("input.hasDatepicker",E[0])[0]) {
+ try {$("input.hasDatepicker",E[0]).datepicker('hide');}catch (dpe){}
+ }
+ $(document).mousemove($.jqDnR.drag).mouseup($.jqDnR.stop);
+ return false;
+ });
+ });
+},
+f=function(k){return parseInt(E.css(k),10)||false;},
+f1=function(k){return parseInt(E1.css(k),10)||false;};
+})(jQuery);/*
+ The below work is licensed under Creative Commons GNU LGPL License.
+
+ Original work:
+
+ License: http://creativecommons.org/licenses/LGPL/2.1/
+ Author: Stefan Goessner/2006
+ Web: http://goessner.net/
+
+ Modifications made:
+
+ Version: 0.9-p5
+ Description: Restructured code, JSLint validated (no strict whitespaces),
+ added handling of empty arrays, empty strings, and int/floats values.
+ Author: Michael Schøler/2008-01-29
+ Web: http://michael.hinnerup.net/blog/2008/01/26/converting-json-to-xml-and-xml-…
+
+ Description: json2xml added support to convert functions as CDATA
+ so it will be easy to write characters that cause some problems when convert
+ Author: Tony Tomov
+*/
+
+/*global alert */
+var xmlJsonClass = {
+ // Param "xml": Element or document DOM node.
+ // Param "tab": Tab or indent string for pretty output formatting omit or use empty string "" to supress.
+ // Returns: JSON string
+ xml2json: function(xml, tab) {
+ if (xml.nodeType === 9) {
+ // document node
+ xml = xml.documentElement;
+ }
+ var nws = this.removeWhite(xml);
+ var obj = this.toObj(nws);
+ var json = this.toJson(obj, xml.nodeName, "\t");
+ return "{\n" + tab + (tab ? json.replace(/\t/g, tab) : json.replace(/\t|\n/g, "")) + "\n}";
+ },
+
+ // Param "o": JavaScript object
+ // Param "tab": tab or indent string for pretty output formatting omit or use empty string "" to supress.
+ // Returns: XML string
+ json2xml: function(o, tab) {
+ var toXml = function(v, name, ind) {
+ var xml = "";
+ var i, n;
+ if (v instanceof Array) {
+ if (v.length === 0) {
+ xml += ind + "<"+name+">__EMPTY_ARRAY_</"+name+">\n";
+ }
+ else {
+ for (i = 0, n = v.length; i < n; i += 1) {
+ var sXml = ind + toXml(v[i], name, ind+"\t") + "\n";
+ xml += sXml;
+ }
+ }
+ }
+ else if (typeof(v) === "object") {
+ var hasChild = false;
+ xml += ind + "<" + name;
+ var m;
+ for (m in v) if (v.hasOwnProperty(m)) {
+ if (m.charAt(0) === "@") {
+ xml += " " + m.substr(1) + "=\"" + v[m].toString() + "\"";
+ }
+ else {
+ hasChild = true;
+ }
+ }
+ xml += hasChild ? ">" : "/>";
+ if (hasChild) {
+ for (m in v) if (v.hasOwnProperty(m)) {
+ if (m === "#text") {
+ xml += v[m];
+ }
+ else if (m === "#cdata") {
+ xml += "<![CDATA[" + v[m] + "]]>";
+ }
+ else if (m.charAt(0) !== "@") {
+ xml += toXml(v[m], m, ind+"\t");
+ }
+ }
+ xml += (xml.charAt(xml.length - 1) === "\n" ? ind : "") + "</" + name + ">";
+ }
+ }
+ else if (typeof(v) === "function") {
+ xml += ind + "<" + name + ">" + "<![CDATA[" + v + "]]>" + "</" + name + ">";
+ }
+ else {
+ if (v === undefined ) { v = ""; }
+ if (v.toString() === "\"\"" || v.toString().length === 0) {
+ xml += ind + "<" + name + ">__EMPTY_STRING_</" + name + ">";
+ }
+ else {
+ xml += ind + "<" + name + ">" + v.toString() + "</" + name + ">";
+ }
+ }
+ return xml;
+ };
+ var xml = "";
+ var m;
+ for (m in o) if (o.hasOwnProperty(m)) {
+ xml += toXml(o[m], m, "");
+ }
+ return tab ? xml.replace(/\t/g, tab) : xml.replace(/\t|\n/g, "");
+ },
+ // Internal methods
+ toObj: function(xml) {
+ var o = {};
+ var FuncTest = /function/i;
+ if (xml.nodeType === 1) {
+ // element node ..
+ if (xml.attributes.length) {
+ // element with attributes ..
+ var i;
+ for (i = 0; i < xml.attributes.length; i += 1) {
+ o["@" + xml.attributes[i].nodeName] = (xml.attributes[i].nodeValue || "").toString();
+ }
+ }
+ if (xml.firstChild) {
+ // element has child nodes ..
+ var textChild = 0, cdataChild = 0, hasElementChild = false;
+ var n;
+ for (n = xml.firstChild; n; n = n.nextSibling) {
+ if (n.nodeType === 1) {
+ hasElementChild = true;
+ }
+ else if (n.nodeType === 3 && n.nodeValue.match(/[^ \f\n\r\t\v]/)) {
+ // non-whitespace text
+ textChild += 1;
+ }
+ else if (n.nodeType === 4) {
+ // cdata section node
+ cdataChild += 1;
+ }
+ }
+ if (hasElementChild) {
+ if (textChild < 2 && cdataChild < 2) {
+ // structured element with evtl. a single text or/and cdata node ..
+ this.removeWhite(xml);
+ for (n = xml.firstChild; n; n = n.nextSibling) {
+ if (n.nodeType === 3) {
+ // text node
+ o["#text"] = this.escape(n.nodeValue);
+ }
+ else if (n.nodeType === 4) {
+ // cdata node
+ if (FuncTest.test(n.nodeValue)) {
+ o[n.nodeName] = [o[n.nodeName], n.nodeValue];
+ } else {
+ o["#cdata"] = this.escape(n.nodeValue);
+ }
+ }
+ else if (o[n.nodeName]) {
+ // multiple occurence of element ..
+ if (o[n.nodeName] instanceof Array) {
+ o[n.nodeName][o[n.nodeName].length] = this.toObj(n);
+ }
+ else {
+ o[n.nodeName] = [o[n.nodeName], this.toObj(n)];
+ }
+ }
+ else {
+ // first occurence of element ..
+ o[n.nodeName] = this.toObj(n);
+ }
+ }
+ }
+ else {
+ // mixed content
+ if (!xml.attributes.length) {
+ o = this.escape(this.innerXml(xml));
+ }
+ else {
+ o["#text"] = this.escape(this.innerXml(xml));
+ }
+ }
+ }
+ else if (textChild) {
+ // pure text
+ if (!xml.attributes.length) {
+ o = this.escape(this.innerXml(xml));
+ if (o === "__EMPTY_ARRAY_") {
+ o = "[]";
+ } else if (o === "__EMPTY_STRING_") {
+ o = "";
+ }
+ }
+ else {
+ o["#text"] = this.escape(this.innerXml(xml));
+ }
+ }
+ else if (cdataChild) {
+ // cdata
+ if (cdataChild > 1) {
+ o = this.escape(this.innerXml(xml));
+ }
+ else {
+ for (n = xml.firstChild; n; n = n.nextSibling) {
+ if(FuncTest.test(xml.firstChild.nodeValue)) {
+ o = xml.firstChild.nodeValue;
+ break;
+ } else {
+ o["#cdata"] = this.escape(n.nodeValue);
+ }
+ }
+ }
+ }
+ }
+ if (!xml.attributes.length && !xml.firstChild) {
+ o = null;
+ }
+ }
+ else if (xml.nodeType === 9) {
+ // document.node
+ o = this.toObj(xml.documentElement);
+ }
+ else {
+ alert("unhandled node type: " + xml.nodeType);
+ }
+ return o;
+ },
+ toJson: function(o, name, ind, wellform) {
+ if(wellform === undefined) wellform = true;
+ var json = name ? ("\"" + name + "\"") : "", tab = "\t", newline = "\n";
+ if(!wellform) {
+ tab= ""; newline= "";
+ }
+
+ if (o === "[]") {
+ json += (name ? ":[]" : "[]");
+ }
+ else if (o instanceof Array) {
+ var n, i, ar=[];
+ for (i = 0, n = o.length; i < n; i += 1) {
+ ar[i] = this.toJson(o[i], "", ind + tab, wellform);
+ }
+ json += (name ? ":[" : "[") + (ar.length > 1 ? (newline + ind + tab + ar.join(","+newline + ind + tab) + newline + ind) : ar.join("")) + "]";
+ }
+ else if (o === null) {
+ json += (name && ":") + "null";
+ }
+ else if (typeof(o) === "object") {
+ var arr = [], m;
+ for (m in o) {
+ if (o.hasOwnProperty(m)) {
+ arr[arr.length] = this.toJson(o[m], m, ind + tab, wellform);
+ }
+ }
+ json += (name ? ":{" : "{") + (arr.length > 1 ? (newline + ind + tab + arr.join(","+newline + ind + tab) + newline + ind) : arr.join("")) + "}";
+ }
+ else if (typeof(o) === "string") {
+ /*
+ var objRegExp = /(^-?\d+\.?\d*$)/;
+ var FuncTest = /function/i;
+ var os = o.toString();
+ if (objRegExp.test(os) || FuncTest.test(os) || os==="false" || os==="true") {
+ // int or float
+ json += (name && ":") + "\"" +os + "\"";
+ }
+ else {
+ */
+ json += (name && ":") + "\"" + o.replace(/\\/g,'\\\\').replace(/\"/g,'\\"') + "\"";
+ //}
+ }
+ else {
+ json += (name && ":") + o.toString();
+ }
+ return json;
+ },
+ innerXml: function(node) {
+ var s = "";
+ if ("innerHTML" in node) {
+ s = node.innerHTML;
+ }
+ else {
+ var asXml = function(n) {
+ var s = "", i;
+ if (n.nodeType === 1) {
+ s += "<" + n.nodeName;
+ for (i = 0; i < n.attributes.length; i += 1) {
+ s += " " + n.attributes[i].nodeName + "=\"" + (n.attributes[i].nodeValue || "").toString() + "\"";
+ }
+ if (n.firstChild) {
+ s += ">";
+ for (var c = n.firstChild; c; c = c.nextSibling) {
+ s += asXml(c);
+ }
+ s += "</" + n.nodeName + ">";
+ }
+ else {
+ s += "/>";
+ }
+ }
+ else if (n.nodeType === 3) {
+ s += n.nodeValue;
+ }
+ else if (n.nodeType === 4) {
+ s += "<![CDATA[" + n.nodeValue + "]]>";
+ }
+ return s;
+ };
+ for (var c = node.firstChild; c; c = c.nextSibling) {
+ s += asXml(c);
+ }
+ }
+ return s;
+ },
+ escape: function(txt) {
+ return txt.replace(/[\\]/g, "\\\\").replace(/[\"]/g, '\\"').replace(/[\n]/g, '\\n').replace(/[\r]/g, '\\r');
+ },
+ removeWhite: function(e) {
+ e.normalize();
+ var n;
+ for (n = e.firstChild; n; ) {
+ if (n.nodeType === 3) {
+ // text node
+ if (!n.nodeValue.match(/[^ \f\n\r\t\v]/)) {
+ // pure whitespace text node
+ var nxt = n.nextSibling;
+ e.removeChild(n);
+ n = nxt;
+ }
+ else {
+ n = n.nextSibling;
+ }
+ }
+ else if (n.nodeType === 1) {
+ // element node
+ this.removeWhite(n);
+ n = n.nextSibling;
+ }
+ else {
+ // any other node
+ n = n.nextSibling;
+ }
+ }
+ return e;
+ }
+};/*
+**
+ * formatter for values but most of the values if for jqGrid
+ * Some of this was inspired and based on how YUI does the table datagrid but in jQuery fashion
+ * we are trying to keep it as light as possible
+ * Joshua Burnett josh(a)9ci.com
+ * http://www.greenbill.com
+ *
+ * Changes from Tony Tomov tony(a)trirand.com
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl-2.0.html
+ *
+**/
+
+;(function($) {
+"use strict";
+ $.fmatter = {};
+ //opts can be id:row id for the row, rowdata:the data for the row, colmodel:the column model for this column
+ //example {id:1234,}
+ $.extend($.fmatter,{
+ isBoolean : function(o) {
+ return typeof o === 'boolean';
+ },
+ isObject : function(o) {
+ return (o && (typeof o === 'object' || $.isFunction(o))) || false;
+ },
+ isString : function(o) {
+ return typeof o === 'string';
+ },
+ isNumber : function(o) {
+ return typeof o === 'number' && isFinite(o);
+ },
+ isNull : function(o) {
+ return o === null;
+ },
+ isUndefined : function(o) {
+ return typeof o === 'undefined';
+ },
+ isValue : function (o) {
+ return (this.isObject(o) || this.isString(o) || this.isNumber(o) || this.isBoolean(o));
+ },
+ isEmpty : function(o) {
+ if(!this.isString(o) && this.isValue(o)) {
+ return false;
+ }else if (!this.isValue(o)){
+ return true;
+ }
+ o = $.trim(o).replace(/\ \;/ig,'').replace(/\ \;/ig,'');
+ return o==="";
+ }
+ });
+ $.fn.fmatter = function(formatType, cellval, opts, rwd, act) {
+ // build main options before element iteration
+ var v=cellval;
+ opts = $.extend({}, $.jgrid.formatter, opts);
+
+ try {
+ v = $.fn.fmatter[formatType].call(this, cellval, opts, rwd, act);
+ } catch(fe){}
+ return v;
+ };
+ $.fmatter.util = {
+ // Taken from YAHOO utils
+ NumberFormat : function(nData,opts) {
+ if(!$.fmatter.isNumber(nData)) {
+ nData *= 1;
+ }
+ if($.fmatter.isNumber(nData)) {
+ var bNegative = (nData < 0);
+ var sOutput = nData + "";
+ var sDecimalSeparator = (opts.decimalSeparator) ? opts.decimalSeparator : ".";
+ var nDotIndex;
+ if($.fmatter.isNumber(opts.decimalPlaces)) {
+ // Round to the correct decimal place
+ var nDecimalPlaces = opts.decimalPlaces;
+ var nDecimal = Math.pow(10, nDecimalPlaces);
+ sOutput = Math.round(nData*nDecimal)/nDecimal + "";
+ nDotIndex = sOutput.lastIndexOf(".");
+ if(nDecimalPlaces > 0) {
+ // Add the decimal separator
+ if(nDotIndex < 0) {
+ sOutput += sDecimalSeparator;
+ nDotIndex = sOutput.length-1;
+ }
+ // Replace the "."
+ else if(sDecimalSeparator !== "."){
+ sOutput = sOutput.replace(".",sDecimalSeparator);
+ }
+ // Add missing zeros
+ while((sOutput.length - 1 - nDotIndex) < nDecimalPlaces) {
+ sOutput += "0";
+ }
+ }
+ }
+ if(opts.thousandsSeparator) {
+ var sThousandsSeparator = opts.thousandsSeparator;
+ nDotIndex = sOutput.lastIndexOf(sDecimalSeparator);
+ nDotIndex = (nDotIndex > -1) ? nDotIndex : sOutput.length;
+ var sNewOutput = sOutput.substring(nDotIndex);
+ var nCount = -1;
+ for (var i=nDotIndex; i>0; i--) {
+ nCount++;
+ if ((nCount%3 === 0) && (i !== nDotIndex) && (!bNegative || (i > 1))) {
+ sNewOutput = sThousandsSeparator + sNewOutput;
+ }
+ sNewOutput = sOutput.charAt(i-1) + sNewOutput;
+ }
+ sOutput = sNewOutput;
+ }
+ // Prepend prefix
+ sOutput = (opts.prefix) ? opts.prefix + sOutput : sOutput;
+ // Append suffix
+ sOutput = (opts.suffix) ? sOutput + opts.suffix : sOutput;
+ return sOutput;
+
+ } else {
+ return nData;
+ }
+ },
+ // Tony Tomov
+ // PHP implementation. Sorry not all options are supported.
+ // Feel free to add them if you want
+ DateFormat : function (format, date, newformat, opts) {
+ var token = /\\.|[dDjlNSwzWFmMntLoYyaABgGhHisueIOPTZcrU]/g,
+ timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
+ timezoneClip = /[^-+\dA-Z]/g,
+ msDateRegExp = new RegExp("^\/Date\\((([-+])?[0-9]+)(([-+])([0-9]{2})([0-9]{2}))?\\)\/$"),
+ msMatch = ((typeof date === 'string') ? date.match(msDateRegExp): null),
+ pad = function (value, length) {
+ value = String(value);
+ length = parseInt(length,10) || 2;
+ while (value.length < length) { value = '0' + value; }
+ return value;
+ },
+ ts = {m : 1, d : 1, y : 1970, h : 0, i : 0, s : 0, u:0},
+ timestamp=0, dM, k,hl,
+ dateFormat=["i18n"];
+ // Internationalization strings
+ dateFormat.i18n = {
+ dayNames: opts.dayNames,
+ monthNames: opts.monthNames
+ };
+ if( format in opts.masks ) { format = opts.masks[format]; }
+ if( !isNaN( date - 0 ) && String(format).toLowerCase() == "u") {
+ //Unix timestamp
+ timestamp = new Date( parseFloat(date)*1000 );
+ } else if(date.constructor === Date) {
+ timestamp = date;
+ // Microsoft date format support
+ } else if( msMatch !== null ) {
+ timestamp = new Date(parseInt(msMatch[1], 10));
+ if (msMatch[3]) {
+ var offset = Number(msMatch[5]) * 60 + Number(msMatch[6]);
+ offset *= ((msMatch[4] == '-') ? 1 : -1);
+ offset -= timestamp.getTimezoneOffset();
+ timestamp.setTime(Number(Number(timestamp) + (offset * 60 * 1000)));
+ }
+ } else {
+ date = String(date).split(/[\\\/:_;.,\t\T\s-]/);
+ format = format.split(/[\\\/:_;.,\t\T\s-]/);
+ // parsing for month names
+ for(k=0,hl=format.length;k<hl;k++){
+ if(format[k] == 'M') {
+ dM = $.inArray(date[k],dateFormat.i18n.monthNames);
+ if(dM !== -1 && dM < 12){date[k] = dM+1;}
+ }
+ if(format[k] == 'F') {
+ dM = $.inArray(date[k],dateFormat.i18n.monthNames);
+ if(dM !== -1 && dM > 11){date[k] = dM+1-12;}
+ }
+ if(date[k]) {
+ ts[format[k].toLowerCase()] = parseInt(date[k],10);
+ }
+ }
+ if(ts.f) {ts.m = ts.f;}
+ if( ts.m === 0 && ts.y === 0 && ts.d === 0) {
+ return " " ;
+ }
+ ts.m = parseInt(ts.m,10)-1;
+ var ty = ts.y;
+ if (ty >= 70 && ty <= 99) {ts.y = 1900+ts.y;}
+ else if (ty >=0 && ty <=69) {ts.y= 2000+ts.y;}
+ timestamp = new Date(ts.y, ts.m, ts.d, ts.h, ts.i, ts.s, ts.u);
+ }
+
+ if( newformat in opts.masks ) {
+ newformat = opts.masks[newformat];
+ } else if ( !newformat ) {
+ newformat = 'Y-m-d';
+ }
+ var
+ G = timestamp.getHours(),
+ i = timestamp.getMinutes(),
+ j = timestamp.getDate(),
+ n = timestamp.getMonth() + 1,
+ o = timestamp.getTimezoneOffset(),
+ s = timestamp.getSeconds(),
+ u = timestamp.getMilliseconds(),
+ w = timestamp.getDay(),
+ Y = timestamp.getFullYear(),
+ N = (w + 6) % 7 + 1,
+ z = (new Date(Y, n - 1, j) - new Date(Y, 0, 1)) / 86400000,
+ flags = {
+ // Day
+ d: pad(j),
+ D: dateFormat.i18n.dayNames[w],
+ j: j,
+ l: dateFormat.i18n.dayNames[w + 7],
+ N: N,
+ S: opts.S(j),
+ //j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th',
+ w: w,
+ z: z,
+ // Week
+ W: N < 5 ? Math.floor((z + N - 1) / 7) + 1 : Math.floor((z + N - 1) / 7) || ((new Date(Y - 1, 0, 1).getDay() + 6) % 7 < 4 ? 53 : 52),
+ // Month
+ F: dateFormat.i18n.monthNames[n - 1 + 12],
+ m: pad(n),
+ M: dateFormat.i18n.monthNames[n - 1],
+ n: n,
+ t: '?',
+ // Year
+ L: '?',
+ o: '?',
+ Y: Y,
+ y: String(Y).substring(2),
+ // Time
+ a: G < 12 ? opts.AmPm[0] : opts.AmPm[1],
+ A: G < 12 ? opts.AmPm[2] : opts.AmPm[3],
+ B: '?',
+ g: G % 12 || 12,
+ G: G,
+ h: pad(G % 12 || 12),
+ H: pad(G),
+ i: pad(i),
+ s: pad(s),
+ u: u,
+ // Timezone
+ e: '?',
+ I: '?',
+ O: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
+ P: '?',
+ T: (String(timestamp).match(timezone) || [""]).pop().replace(timezoneClip, ""),
+ Z: '?',
+ // Full Date/Time
+ c: '?',
+ r: '?',
+ U: Math.floor(timestamp / 1000)
+ };
+ return newformat.replace(token, function ($0) {
+ return $0 in flags ? flags[$0] : $0.substring(1);
+ });
+ }
+ };
+ $.fn.fmatter.defaultFormat = function(cellval, opts) {
+ return ($.fmatter.isValue(cellval) && cellval!=="" ) ? cellval : opts.defaultValue ? opts.defaultValue : " ";
+ };
+ $.fn.fmatter.email = function(cellval, opts) {
+ if(!$.fmatter.isEmpty(cellval)) {
+ return "<a href=\"mailto:" + cellval + "\">" + cellval + "</a>";
+ }else {
+ return $.fn.fmatter.defaultFormat(cellval,opts );
+ }
+ };
+ $.fn.fmatter.checkbox =function(cval, opts) {
+ var op = $.extend({},opts.checkbox), ds;
+ if(opts.colModel !== undefined && !$.fmatter.isUndefined(opts.colModel.formatoptions)) {
+ op = $.extend({},op,opts.colModel.formatoptions);
+ }
+ if(op.disabled===true) {ds = "disabled=\"disabled\"";} else {ds="";}
+ if($.fmatter.isEmpty(cval) || $.fmatter.isUndefined(cval) ) {cval = $.fn.fmatter.defaultFormat(cval,op);}
+ cval=cval+"";cval=cval.toLowerCase();
+ var bchk = cval.search(/(false|0|no|off)/i)<0 ? " checked='checked' " : "";
+ return "<input type=\"checkbox\" " + bchk + " value=\""+ cval+"\" offval=\"no\" "+ds+ "/>";
+ };
+ $.fn.fmatter.link = function(cellval, opts) {
+ var op = {target:opts.target};
+ var target = "";
+ if(opts.colModel !== undefined && !$.fmatter.isUndefined(opts.colModel.formatoptions)) {
+ op = $.extend({},op,opts.colModel.formatoptions);
+ }
+ if(op.target) {target = 'target=' + op.target;}
+ if(!$.fmatter.isEmpty(cellval)) {
+ return "<a "+target+" href=\"" + cellval + "\">" + cellval + "</a>";
+ }else {
+ return $.fn.fmatter.defaultFormat(cellval,opts);
+ }
+ };
+ $.fn.fmatter.showlink = function(cellval, opts) {
+ var op = {baseLinkUrl: opts.baseLinkUrl,showAction:opts.showAction, addParam: opts.addParam || "", target: opts.target, idName: opts.idName},
+ target = "", idUrl;
+ if(opts.colModel !== undefined && !$.fmatter.isUndefined(opts.colModel.formatoptions)) {
+ op = $.extend({},op,opts.colModel.formatoptions);
+ }
+ if(op.target) {target = 'target=' + op.target;}
+ idUrl = op.baseLinkUrl+op.showAction + '?'+ op.idName+'='+opts.rowId+op.addParam;
+ if($.fmatter.isString(cellval) || $.fmatter.isNumber(cellval)) { //add this one even if its blank string
+ return "<a "+target+" href=\"" + idUrl + "\">" + cellval + "</a>";
+ }else {
+ return $.fn.fmatter.defaultFormat(cellval,opts);
+ }
+ };
+ $.fn.fmatter.integer = function(cellval, opts) {
+ var op = $.extend({},opts.integer);
+ if(opts.colModel !== undefined && !$.fmatter.isUndefined(opts.colModel.formatoptions)) {
+ op = $.extend({},op,opts.colModel.formatoptions);
+ }
+ if($.fmatter.isEmpty(cellval)) {
+ return op.defaultValue;
+ }
+ return $.fmatter.util.NumberFormat(cellval,op);
+ };
+ $.fn.fmatter.number = function (cellval, opts) {
+ var op = $.extend({},opts.number);
+ if(opts.colModel !== undefined && !$.fmatter.isUndefined(opts.colModel.formatoptions)) {
+ op = $.extend({},op,opts.colModel.formatoptions);
+ }
+ if($.fmatter.isEmpty(cellval)) {
+ return op.defaultValue;
+ }
+ return $.fmatter.util.NumberFormat(cellval,op);
+ };
+ $.fn.fmatter.currency = function (cellval, opts) {
+ var op = $.extend({},opts.currency);
+ if(opts.colModel !== undefined && !$.fmatter.isUndefined(opts.colModel.formatoptions)) {
+ op = $.extend({},op,opts.colModel.formatoptions);
+ }
+ if($.fmatter.isEmpty(cellval)) {
+ return op.defaultValue;
+ }
+ return $.fmatter.util.NumberFormat(cellval,op);
+ };
+ $.fn.fmatter.date = function (cellval, opts, rwd, act) {
+ var op = $.extend({},opts.date);
+ if(opts.colModel !== undefined && !$.fmatter.isUndefined(opts.colModel.formatoptions)) {
+ op = $.extend({},op,opts.colModel.formatoptions);
+ }
+ if(!op.reformatAfterEdit && act=='edit'){
+ return $.fn.fmatter.defaultFormat(cellval, opts);
+ } else if(!$.fmatter.isEmpty(cellval)) {
+ return $.fmatter.util.DateFormat(op.srcformat,cellval,op.newformat,op);
+ } else {
+ return $.fn.fmatter.defaultFormat(cellval, opts);
+ }
+ };
+ $.fn.fmatter.select = function (cellval,opts) {
+ // jqGrid specific
+ cellval = cellval + "";
+ var oSelect = false, ret=[], sep, delim;
+ if(!$.fmatter.isUndefined(opts.colModel.formatoptions)){
+ oSelect= opts.colModel.formatoptions.value;
+ sep = opts.colModel.formatoptions.separator === undefined ? ":" : opts.colModel.formatoptions.separator;
+ delim = opts.colModel.formatoptions.delimiter === undefined ? ";" : opts.colModel.formatoptions.delimiter;
+ } else if(!$.fmatter.isUndefined(opts.colModel.editoptions)){
+ oSelect= opts.colModel.editoptions.value;
+ sep = opts.colModel.editoptions.separator === undefined ? ":" : opts.colModel.editoptions.separator;
+ delim = opts.colModel.editoptions.delimiter === undefined ? ";" : opts.colModel.editoptions.delimiter;
+ }
+ if (oSelect) {
+ var msl = opts.colModel.editoptions.multiple === true ? true : false,
+ scell = [], sv;
+ if(msl) {scell = cellval.split(",");scell = $.map(scell,function(n){return $.trim(n);});}
+ if ($.fmatter.isString(oSelect)) {
+ // mybe here we can use some caching with care ????
+ var so = oSelect.split(delim), j=0;
+ for(var i=0; i<so.length;i++){
+ sv = so[i].split(sep);
+ if(sv.length > 2 ) {
+ sv[1] = $.map(sv,function(n,i){if(i>0) {return n;}}).join(sep);
+ }
+ if(msl) {
+ if($.inArray(sv[0],scell)>-1) {
+ ret[j] = sv[1];
+ j++;
+ }
+ } else if($.trim(sv[0])==$.trim(cellval)) {
+ ret[0] = sv[1];
+ break;
+ }
+ }
+ } else if($.fmatter.isObject(oSelect)) {
+ // this is quicker
+ if(msl) {
+ ret = $.map(scell, function(n){
+ return oSelect[n];
+ });
+ } else {
+ ret[0] = oSelect[cellval] || "";
+ }
+ }
+ }
+ cellval = ret.join(", ");
+ return cellval === "" ? $.fn.fmatter.defaultFormat(cellval,opts) : cellval;
+ };
+ $.fn.fmatter.rowactions = function(rid,gid,act,pos) {
+ var op ={
+ keys:false,
+ onEdit : null,
+ onSuccess: null,
+ afterSave:null,
+ onError: null,
+ afterRestore: null,
+ extraparam: {},
+ url: null,
+ restoreAfterError: true,
+ mtype: "POST",
+ delOptions: {},
+ editOptions : {}
+ };
+ rid = $.jgrid.jqID( rid );
+ gid = $.jgrid.jqID( gid );
+ var cm = $('#'+gid)[0].p.colModel[pos];
+ if(!$.fmatter.isUndefined(cm.formatoptions)) {
+ op = $.extend(op,cm.formatoptions);
+ }
+ if( !$.fmatter.isUndefined($('#'+gid)[0].p.editOptions) ) {
+ op.editOptions = $('#'+gid)[0].p.editOptions;
+ }
+ if( !$.fmatter.isUndefined($('#'+gid)[0].p.delOptions) ) {
+ op.delOptions = $('#'+gid)[0].p.delOptions;
+ }
+ var $t = $("#"+gid)[0];
+ var saverow = function( rowid, res) {
+ if($.isFunction(op.afterSave)) { op.afterSave.call($t, rowid, res); }
+ $("tr#"+rid+" div.ui-inline-edit, "+"tr#"+rid+" div.ui-inline-del","#"+gid + ".ui-jqgrid-btable:first").show();
+ $("tr#"+rid+" div.ui-inline-save, "+"tr#"+rid+" div.ui-inline-cancel","#"+gid+ ".ui-jqgrid-btable:first").hide();
+ },
+ restorerow = function( rowid) {
+ if($.isFunction(op.afterRestore) ) { op.afterRestore.call($t, rowid); }
+ $("tr#"+rid+" div.ui-inline-edit, "+"tr#"+rid+" div.ui-inline-del","#"+gid+ ".ui-jqgrid-btable:first").show();
+ $("tr#"+rid+" div.ui-inline-save, "+"tr#"+rid+" div.ui-inline-cancel","#"+gid+ ".ui-jqgrid-btable:first").hide();
+ };
+ if( $("#"+rid,"#"+gid).hasClass("jqgrid-new-row") ){
+ var opers = $t.p.prmNames,
+ oper = opers.oper;
+ op.extraparam[oper] = opers.addoper;
+ }
+ var actop = {
+ keys : op.keys,
+ oneditfunc: op.onEdit,
+ successfunc: op.onSuccess,
+ url: op.url,
+ extraparam: op.extraparam,
+ aftersavefunc: saverow,
+ errorfunc: op.onError,
+ afterrestorefunc: restorerow,
+ restoreAfterError: op.restoreAfterError,
+ mtype: op.mtype
+ };
+ switch(act)
+ {
+ case 'edit':
+ $('#'+gid).jqGrid('editRow', rid, actop);
+ $("tr#"+rid+" div.ui-inline-edit, "+"tr#"+rid+" div.ui-inline-del","#"+gid+ ".ui-jqgrid-btable:first").hide();
+ $("tr#"+rid+" div.ui-inline-save, "+"tr#"+rid+" div.ui-inline-cancel","#"+gid+ ".ui-jqgrid-btable:first").show();
+ $($t).triggerHandler("jqGridAfterGridComplete");
+ break;
+ case 'save':
+ if ( $('#'+gid).jqGrid('saveRow', rid, actop) ) {
+ $("tr#"+rid+" div.ui-inline-edit, "+"tr#"+rid+" div.ui-inline-del","#"+gid+ ".ui-jqgrid-btable:first").show();
+ $("tr#"+rid+" div.ui-inline-save, "+"tr#"+rid+" div.ui-inline-cancel","#"+gid+ ".ui-jqgrid-btable:first").hide();
+ $($t).triggerHandler("jqGridAfterGridComplete");
+ }
+ break;
+ case 'cancel' :
+ $('#'+gid).jqGrid('restoreRow',rid, restorerow);
+ $("tr#"+rid+" div.ui-inline-edit, "+"tr#"+rid+" div.ui-inline-del","#"+gid+ ".ui-jqgrid-btable:first").show();
+ $("tr#"+rid+" div.ui-inline-save, "+"tr#"+rid+" div.ui-inline-cancel","#"+gid+ ".ui-jqgrid-btable:first").hide();
+ $($t).triggerHandler("jqGridAfterGridComplete");
+ break;
+ case 'del':
+ $('#'+gid).jqGrid('delGridRow',rid, op.delOptions);
+ break;
+ case 'formedit':
+ $('#'+gid).jqGrid('setSelection',rid);
+ $('#'+gid).jqGrid('editGridRow',rid, op.editOptions);
+ break;
+ }
+ };
+ $.fn.fmatter.actions = function(cellval,opts) {
+ var op ={keys:false, editbutton:true, delbutton:true, editformbutton: false};
+ if(!$.fmatter.isUndefined(opts.colModel.formatoptions)) {
+ op = $.extend(op,opts.colModel.formatoptions);
+ }
+ var rowid = opts.rowId, str="",ocl;
+ if(typeof(rowid) =='undefined' || $.fmatter.isEmpty(rowid)) {return "";}
+ if(op.editformbutton){
+ ocl = "onclick=jQuery.fn.fmatter.rowactions('"+rowid+"','"+opts.gid+"','formedit',"+opts.pos+"); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); ";
+ str =str+ "<div title='"+$.jgrid.nav.edittitle+"' style='float:left;cursor:pointer;' class='ui-pg-div ui-inline-edit' "+ocl+"><span class='ui-icon ui-icon-pencil'></span></div>";
+ } else if(op.editbutton){
+ ocl = "onclick=jQuery.fn.fmatter.rowactions('"+rowid+"','"+opts.gid+"','edit',"+opts.pos+"); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover') ";
+ str =str+ "<div title='"+$.jgrid.nav.edittitle+"' style='float:left;cursor:pointer;' class='ui-pg-div ui-inline-edit' "+ocl+"><span class='ui-icon ui-icon-pencil'></span></div>";
+ }
+ if(op.delbutton) {
+ ocl = "onclick=jQuery.fn.fmatter.rowactions('"+rowid+"','"+opts.gid+"','del',"+opts.pos+"); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); ";
+ str = str+"<div title='"+$.jgrid.nav.deltitle+"' style='float:left;margin-left:5px;' class='ui-pg-div ui-inline-del' "+ocl+"><span class='ui-icon ui-icon-trash'></span></div>";
+ }
+ ocl = "onclick=jQuery.fn.fmatter.rowactions('"+rowid+"','"+opts.gid+"','save',"+opts.pos+"); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); ";
+ str = str+"<div title='"+$.jgrid.edit.bSubmit+"' style='float:left;display:none' class='ui-pg-div ui-inline-save' "+ocl+"><span class='ui-icon ui-icon-disk'></span></div>";
+ ocl = "onclick=jQuery.fn.fmatter.rowactions('"+rowid+"','"+opts.gid+"','cancel',"+opts.pos+"); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); ";
+ str = str+"<div title='"+$.jgrid.edit.bCancel+"' style='float:left;display:none;margin-left:5px;' class='ui-pg-div ui-inline-cancel' "+ocl+"><span class='ui-icon ui-icon-cancel'></span></div>";
+ return "<div style='margin-left:8px;'>" + str + "</div>";
+ };
+ $.unformat = function (cellval,options,pos,cnt) {
+ // specific for jqGrid only
+ var ret, formatType = options.colModel.formatter,
+ op =options.colModel.formatoptions || {}, sep,
+ re = /([\.\*\_\'\(\)\{\}\+\?\\])/g,
+ unformatFunc = options.colModel.unformat||($.fn.fmatter[formatType] && $.fn.fmatter[formatType].unformat);
+ if(typeof unformatFunc !== 'undefined' && $.isFunction(unformatFunc) ) {
+ ret = unformatFunc.call(this, $(cellval).text(), options, cellval);
+ } else if(!$.fmatter.isUndefined(formatType) && $.fmatter.isString(formatType) ) {
+ var opts = $.jgrid.formatter || {}, stripTag;
+ switch(formatType) {
+ case 'integer' :
+ op = $.extend({},opts.integer,op);
+ sep = op.thousandsSeparator.replace(re,"\\$1");
+ stripTag = new RegExp(sep, "g");
+ ret = $(cellval).text().replace(stripTag,'');
+ break;
+ case 'number' :
+ op = $.extend({},opts.number,op);
+ sep = op.thousandsSeparator.replace(re,"\\$1");
+ stripTag = new RegExp(sep, "g");
+ ret = $(cellval).text().replace(stripTag,"").replace(op.decimalSeparator,'.');
+ break;
+ case 'currency':
+ op = $.extend({},opts.currency,op);
+ sep = op.thousandsSeparator.replace(re,"\\$1");
+ stripTag = new RegExp(sep, "g");
+ ret = $(cellval).text();
+ if (op.prefix && op.prefix.length) {
+ ret = ret.substr(op.prefix.length);
+ }
+ if (op.suffix && op.suffix.length) {
+ ret = ret.substr(0, ret.length - op.suffix.length);
+ }
+ ret = ret.replace(stripTag,'').replace(op.decimalSeparator,'.');
+ break;
+ case 'checkbox':
+ var cbv = (options.colModel.editoptions) ? options.colModel.editoptions.value.split(":") : ["Yes","No"];
+ ret = $('input',cellval).is(":checked") ? cbv[0] : cbv[1];
+ break;
+ case 'select' :
+ ret = $.unformat.select(cellval,options,pos,cnt);
+ break;
+ case 'actions':
+ return "";
+ default:
+ ret= $(cellval).text();
+ }
+ }
+ return ret !== undefined ? ret : cnt===true ? $(cellval).text() : $.jgrid.htmlDecode($(cellval).html());
+ };
+ $.unformat.select = function (cellval,options,pos,cnt) {
+ // Spacial case when we have local data and perform a sort
+ // cnt is set to true only in sortDataArray
+ var ret = [];
+ var cell = $(cellval).text();
+ if(cnt===true) {return cell;}
+ var op = $.extend({}, !$.fmatter.isUndefined(options.colModel.formatoptions) ? options.colModel.formatoptions: options.colModel.editoptions),
+ sep = op.separator === undefined ? ":" : op.separator,
+ delim = op.delimiter === undefined ? ";" : op.delimiter;
+
+ if(op.value){
+ var oSelect = op.value,
+ msl = op.multiple === true ? true : false,
+ scell = [], sv;
+ if(msl) {scell = cell.split(",");scell = $.map(scell,function(n){return $.trim(n);});}
+ if ($.fmatter.isString(oSelect)) {
+ var so = oSelect.split(delim), j=0;
+ for(var i=0; i<so.length;i++){
+ sv = so[i].split(sep);
+ if(sv.length > 2 ) {
+ sv[1] = $.map(sv,function(n,i){if(i>0) {return n;}}).join(sep);
+ }
+ if(msl) {
+ if($.inArray(sv[1],scell)>-1) {
+ ret[j] = sv[0];
+ j++;
+ }
+ } else if($.trim(sv[1])==$.trim(cell)) {
+ ret[0] = sv[0];
+ break;
+ }
+ }
+ } else if($.fmatter.isObject(oSelect) || $.isArray(oSelect) ){
+ if(!msl) {scell[0] = cell;}
+ ret = $.map(scell, function(n){
+ var rv;
+ $.each(oSelect, function(i,val){
+ if (val == n) {
+ rv = i;
+ return false;
+ }
+ });
+ if( typeof(rv) != 'undefined' ) {return rv;}
+ });
+ }
+ return ret.join(", ");
+ } else {
+ return cell || "";
+ }
+ };
+ $.unformat.date = function (cellval, opts) {
+ var op = $.jgrid.formatter.date || {};
+ if(!$.fmatter.isUndefined(opts.formatoptions)) {
+ op = $.extend({},op,opts.formatoptions);
+ }
+ if(!$.fmatter.isEmpty(cellval)) {
+ return $.fmatter.util.DateFormat(op.newformat,cellval,op.srcformat,op);
+ } else {
+ return $.fn.fmatter.defaultFormat(cellval, opts);
+ }
+ };
+})(jQuery);
+;(function($){
+/*
+ * jqGrid common function
+ * Tony Tomov tony(a)trirand.com
+ * http://trirand.com/blog/
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl-2.0.html
+*/
+/*global jQuery, $ */
+
+$.extend($.jgrid,{
+// Modal functions
+ showModal : function(h) {
+ h.w.show();
+ },
+ closeModal : function(h) {
+ h.w.hide().attr("aria-hidden","true");
+ if(h.o) {h.o.remove();}
+ },
+ hideModal : function (selector,o) {
+ o = $.extend({jqm : true, gb :''}, o || {});
+ if(o.onClose) {
+ var oncret = o.onClose(selector);
+ if (typeof oncret == 'boolean' && !oncret ) { return; }
+ }
+ if ($.fn.jqm && o.jqm === true) {
+ $(selector).attr("aria-hidden","true").jqmHide();
+ } else {
+ if(o.gb !== '') {
+ try {$(".jqgrid-overlay:first",o.gb).hide();} catch (e){}
+ }
+ $(selector).hide().attr("aria-hidden","true");
+ }
+ },
+//Helper functions
+ findPos : function(obj) {
+ var curleft = 0, curtop = 0;
+ if (obj.offsetParent) {
+ do {
+ curleft += obj.offsetLeft;
+ curtop += obj.offsetTop;
+ } while (obj = obj.offsetParent);
+ //do not change obj == obj.offsetParent
+ }
+ return [curleft,curtop];
+ },
+ createModal : function(aIDs, content, p, insertSelector, posSelector, appendsel, css) {
+ p = $.extend(true, $.jgrid.jqModal || {}, p);
+ var mw = document.createElement('div'), rtlsup, self = this;
+ css = $.extend({}, css || {});
+ rtlsup = $(p.gbox).attr("dir") == "rtl" ? true : false;
+ mw.className= "ui-widget ui-widget-content ui-corner-all ui-jqdialog";
+ mw.id = aIDs.themodal;
+ var mh = document.createElement('div');
+ mh.className = "ui-jqdialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix";
+ mh.id = aIDs.modalhead;
+ $(mh).append("<span class='ui-jqdialog-title'>"+p.caption+"</span>");
+ var ahr= $("<a href='javascript:void(0)' class='ui-jqdialog-titlebar-close ui-corner-all'></a>")
+ .hover(function(){ahr.addClass('ui-state-hover');},
+ function(){ahr.removeClass('ui-state-hover');})
+ .append("<span class='ui-icon ui-icon-closethick'></span>");
+ $(mh).append(ahr);
+ if(rtlsup) {
+ mw.dir = "rtl";
+ $(".ui-jqdialog-title",mh).css("float","right");
+ $(".ui-jqdialog-titlebar-close",mh).css("left",0.3+"em");
+ } else {
+ mw.dir = "ltr";
+ $(".ui-jqdialog-title",mh).css("float","left");
+ $(".ui-jqdialog-titlebar-close",mh).css("right",0.3+"em");
+ }
+ var mc = document.createElement('div');
+ $(mc).addClass("ui-jqdialog-content ui-widget-content").attr("id",aIDs.modalcontent);
+ $(mc).append(content);
+ mw.appendChild(mc);
+ $(mw).prepend(mh);
+ if(appendsel===true) { $('body').append(mw); } //append as first child in body -for alert dialog
+ else if (typeof appendsel == "string")
+ $(appendsel).append(mw);
+ else {$(mw).insertBefore(insertSelector);}
+ $(mw).css(css);
+ if(typeof p.jqModal === 'undefined') {p.jqModal = true;} // internal use
+ var coord = {};
+ if ( $.fn.jqm && p.jqModal === true) {
+ if(p.left ===0 && p.top===0 && p.overlay) {
+ var pos = [];
+ pos = $.jgrid.findPos(posSelector);
+ p.left = pos[0] + 4;
+ p.top = pos[1] + 4;
+ }
+ coord.top = p.top+"px";
+ coord.left = p.left;
+ } else if(p.left !==0 || p.top!==0) {
+ coord.left = p.left;
+ coord.top = p.top+"px";
+ }
+ $("a.ui-jqdialog-titlebar-close",mh).click(function(){
+ var oncm = $("#"+$.jgrid.jqID(aIDs.themodal)).data("onClose") || p.onClose;
+ var gboxclose = $("#"+$.jgrid.jqID(aIDs.themodal)).data("gbox") || p.gbox;
+ self.hideModal("#"+$.jgrid.jqID(aIDs.themodal),{gb:gboxclose,jqm:p.jqModal,onClose:oncm});
+ return false;
+ });
+ if (p.width === 0 || !p.width) {p.width = 300;}
+ if(p.height === 0 || !p.height) {p.height =200;}
+ if(!p.zIndex) {
+ var parentZ = $(insertSelector).parents("*[role=dialog]").filter(':first').css("z-index");
+ if(parentZ) {
+ p.zIndex = parseInt(parentZ,10)+2;
+ } else {
+ p.zIndex = 950;
+ }
+ }
+ var rtlt = 0;
+ if( rtlsup && coord.left && !appendsel) {
+ rtlt = $(p.gbox).width()- (!isNaN(p.width) ? parseInt(p.width,10) :0) - 8; // to do
+ // just in case
+ coord.left = parseInt(coord.left,10) + parseInt(rtlt,10);
+ }
+ if(coord.left) { coord.left += "px"; }
+ $(mw).css($.extend({
+ width: isNaN(p.width) ? "auto": p.width+"px",
+ height:isNaN(p.height) ? "auto" : p.height + "px",
+ zIndex:p.zIndex,
+ overflow: 'hidden'
+ },coord))
+ .attr({tabIndex: "-1","role":"dialog","aria-labelledby":aIDs.modalhead,"aria-hidden":"true"});
+ if(typeof p.drag == 'undefined') { p.drag=true;}
+ if(typeof p.resize == 'undefined') {p.resize=true;}
+ if (p.drag) {
+ $(mh).css('cursor','move');
+ if($.fn.jqDrag) {
+ $(mw).jqDrag(mh);
+ } else {
+ try {
+ $(mw).draggable({handle: $("#"+$.jgrid.jqID(mh.id))});
+ } catch (e) {}
+ }
+ }
+ if(p.resize) {
+ if($.fn.jqResize) {
+ $(mw).append("<div class='jqResize ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se ui-icon-grip-diagonal-se'></div>");
+ $("#"+$.jgrid.jqID(aIDs.themodal)).jqResize(".jqResize",aIDs.scrollelm ? "#"+$.jgrid.jqID(aIDs.scrollelm) : false);
+ } else {
+ try {
+ $(mw).resizable({handles: 'se, sw',alsoResize: aIDs.scrollelm ? "#"+$.jgrid.jqID(aIDs.scrollelm) : false});
+ } catch (r) {}
+ }
+ }
+ if(p.closeOnEscape === true){
+ $(mw).keydown( function( e ) {
+ if( e.which == 27 ) {
+ var cone = $("#"+$.jgrid.jqID(aIDs.themodal)).data("onClose") || p.onClose;
+ self.hideModal(this,{gb:p.gbox,jqm:p.jqModal,onClose: cone});
+ }
+ });
+ }
+ },
+ viewModal : function (selector,o){
+ o = $.extend({
+ toTop: true,
+ overlay: 10,
+ modal: false,
+ overlayClass : 'ui-widget-overlay',
+ onShow: $.jgrid.showModal,
+ onHide: $.jgrid.closeModal,
+ gbox: '',
+ jqm : true,
+ jqM : true
+ }, o || {});
+ if ($.fn.jqm && o.jqm === true) {
+ if(o.jqM) { $(selector).attr("aria-hidden","false").jqm(o).jqmShow(); }
+ else {$(selector).attr("aria-hidden","false").jqmShow();}
+ } else {
+ if(o.gbox !== '') {
+ $(".jqgrid-overlay:first",o.gbox).show();
+ $(selector).data("gbox",o.gbox);
+ }
+ $(selector).show().attr("aria-hidden","false");
+ try{$(':input:visible',selector)[0].focus();}catch(_){}
+ }
+ },
+
+ info_dialog : function(caption, content,c_b, modalopt) {
+ var mopt = {
+ width:290,
+ height:'auto',
+ dataheight: 'auto',
+ drag: true,
+ resize: false,
+ caption:"<b>"+caption+"</b>",
+ left:250,
+ top:170,
+ zIndex : 1000,
+ jqModal : true,
+ modal : false,
+ closeOnEscape : true,
+ align: 'center',
+ buttonalign : 'center',
+ buttons : []
+ // {text:'textbutt', id:"buttid", onClick : function(){...}}
+ // if the id is not provided we set it like info_button_+ the index in the array - i.e info_button_0,info_button_1...
+ };
+ $.extend(mopt,modalopt || {});
+ var jm = mopt.jqModal, self = this;
+ if($.fn.jqm && !jm) { jm = false; }
+ // in case there is no jqModal
+ var buttstr ="";
+ if(mopt.buttons.length > 0) {
+ for(var i=0;i<mopt.buttons.length;i++) {
+ if(typeof mopt.buttons[i].id == "undefined") { mopt.buttons[i].id = "info_button_"+i; }
+ buttstr += "<a href='javascript:void(0)' id='"+mopt.buttons[i].id+"' class='fm-button ui-state-default ui-corner-all'>"+mopt.buttons[i].text+"</a>";
+ }
+ }
+ var dh = isNaN(mopt.dataheight) ? mopt.dataheight : mopt.dataheight+"px",
+ cn = "text-align:"+mopt.align+";";
+ var cnt = "<div id='info_id'>";
+ cnt += "<div id='infocnt' style='margin:0px;padding-bottom:1em;width:100%;overflow:auto;position:relative;height:"+dh+";"+cn+"'>"+content+"</div>";
+ cnt += c_b ? "<div class='ui-widget-content ui-helper-clearfix' style='text-align:"+mopt.buttonalign+";padding-bottom:0.8em;padding-top:0.5em;background-image: none;border-width: 1px 0 0 0;'><a href='javascript:void(0)' id='closedialog' class='fm-button ui-state-default ui-corner-all'>"+c_b+"</a>"+buttstr+"</div>" :
+ buttstr !== "" ? "<div class='ui-widget-content ui-helper-clearfix' style='text-align:"+mopt.buttonalign+";padding-bottom:0.8em;padding-top:0.5em;background-image: none;border-width: 1px 0 0 0;'>"+buttstr+"</div>" : "";
+ cnt += "</div>";
+
+ try {
+ if($("#info_dialog").attr("aria-hidden") == "false") {
+ $.jgrid.hideModal("#info_dialog",{jqm:jm});
+ }
+ $("#info_dialog").remove();
+ } catch (e){}
+ $.jgrid.createModal({
+ themodal:'info_dialog',
+ modalhead:'info_head',
+ modalcontent:'info_content',
+ scrollelm: 'infocnt'},
+ cnt,
+ mopt,
+ '','',true
+ );
+ // attach onclick after inserting into the dom
+ if(buttstr) {
+ $.each(mopt.buttons,function(i){
+ $("#"+$.jgrid.jqID(this.id),"#info_id").bind('click',function(){mopt.buttons[i].onClick.call($("#info_dialog")); return false;});
+ });
+ }
+ $("#closedialog", "#info_id").click(function(){
+ self.hideModal("#info_dialog",{jqm:jm});
+ return false;
+ });
+ $(".fm-button","#info_dialog").hover(
+ function(){$(this).addClass('ui-state-hover');},
+ function(){$(this).removeClass('ui-state-hover');}
+ );
+ if($.isFunction(mopt.beforeOpen) ) { mopt.beforeOpen(); }
+ $.jgrid.viewModal("#info_dialog",{
+ onHide: function(h) {
+ h.w.hide().remove();
+ if(h.o) { h.o.remove(); }
+ },
+ modal :mopt.modal,
+ jqm:jm
+ });
+ if($.isFunction(mopt.afterOpen) ) { mopt.afterOpen(); }
+ try{ $("#info_dialog").focus();} catch (m){}
+ },
+// Form Functions
+ createEl : function(eltype,options,vl,autowidth, ajaxso) {
+ var elem = "", $t = this;
+ function bindEv (el, opt) {
+ if($.isFunction(opt.dataInit)) {
+ opt.dataInit.call($t,el);
+ }
+ if(opt.dataEvents) {
+ $.each(opt.dataEvents, function() {
+ if (this.data !== undefined) {
+ $(el).bind(this.type, this.data, this.fn);
+ } else {
+ $(el).bind(this.type, this.fn);
+ }
+ });
+ }
+ return opt;
+ }
+ function setAttributes(elm, atr, exl ) {
+ var exclude = ['dataInit','dataEvents','dataUrl', 'buildSelect','sopt', 'searchhidden', 'defaultValue', 'attr'];
+ if(typeof(exl) != "undefined" && $.isArray(exl)) {
+ $.merge(exclude, exl);
+ }
+ $.each(atr, function(key, value){
+ if($.inArray(key, exclude) === -1) {
+ $(elm).attr(key,value);
+ }
+ });
+ if(!atr.hasOwnProperty('id')) {
+ $(elm).attr('id', $.jgrid.randId());
+ }
+ }
+ switch (eltype)
+ {
+ case "textarea" :
+ elem = document.createElement("textarea");
+ if(autowidth) {
+ if(!options.cols) { $(elem).css({width:"98%"});}
+ } else if (!options.cols) { options.cols = 20; }
+ if(!options.rows) { options.rows = 2; }
+ if(vl==' ' || vl==' ' || (vl.length==1 && vl.charCodeAt(0)==160)) {vl="";}
+ elem.value = vl;
+ setAttributes(elem, options);
+ options = bindEv(elem,options);
+ $(elem).attr({"role":"textbox","multiline":"true"});
+ break;
+ case "checkbox" : //what code for simple checkbox
+ elem = document.createElement("input");
+ elem.type = "checkbox";
+ if( !options.value ) {
+ var vl1 = vl.toLowerCase();
+ if(vl1.search(/(false|0|no|off|undefined)/i)<0 && vl1!=="") {
+ elem.checked=true;
+ elem.defaultChecked=true;
+ elem.value = vl;
+ } else {
+ elem.value = "on";
+ }
+ $(elem).attr("offval","off");
+ } else {
+ var cbval = options.value.split(":");
+ if(vl === cbval[0]) {
+ elem.checked=true;
+ elem.defaultChecked=true;
+ }
+ elem.value = cbval[0];
+ $(elem).attr("offval",cbval[1]);
+ }
+ setAttributes(elem, options, ['value']);
+ options = bindEv(elem,options);
+ $(elem).attr("role","checkbox");
+ break;
+ case "select" :
+ elem = document.createElement("select");
+ elem.setAttribute("role","select");
+ var msl, ovm = [];
+ if(options.multiple===true) {
+ msl = true;
+ elem.multiple="multiple";
+ $(elem).attr("aria-multiselectable","true");
+ } else { msl = false; }
+ if(typeof(options.dataUrl) != "undefined") {
+ $.ajax($.extend({
+ url: options.dataUrl,
+ type : "GET",
+ dataType: "html",
+ context: {elem:elem, options:options, vl:vl},
+ success: function(data){
+ var a, ovm = [], elem = this.elem, vl = this.vl,
+ options = $.extend({},this.options),
+ msl = options.multiple===true;
+ if($.isFunction(options.buildSelect)) {
+ var b = options.buildSelect.call($t,data);
+ a = $(b).html();
+ } else {
+ a = $(data).html();
+ }
+ if(a) {
+ $(elem).append(a);
+ setAttributes(elem, options);
+ options = bindEv(elem,options);
+ if(typeof options.size === 'undefined') { options.size = msl ? 3 : 1;}
+ if(msl) {
+ ovm = vl.split(",");
+ ovm = $.map(ovm,function(n){return $.trim(n);});
+ } else {
+ ovm[0] = $.trim(vl);
+ }
+ //$(elem).attr(options);
+ setTimeout(function(){
+ $("option",elem).each(function(i){
+ //if(i===0) { this.selected = ""; }
+ // fix IE8/IE7 problem with selecting of the first item on multiple=true
+ if (i === 0 && elem.multiple) { this.selected = false; }
+ $(this).attr("role","option");
+ if($.inArray($.trim($(this).text()),ovm) > -1 || $.inArray($.trim($(this).val()),ovm) > -1 ) {
+ this.selected= "selected";
+ }
+ });
+ },0);
+ }
+ }
+ },ajaxso || {}));
+ } else if(options.value) {
+ var i;
+ if(typeof options.size === 'undefined') {
+ options.size = msl ? 3 : 1;
+ }
+ if(msl) {
+ ovm = vl.split(",");
+ ovm = $.map(ovm,function(n){return $.trim(n);});
+ }
+ if(typeof options.value === 'function') { options.value = options.value(); }
+ var so,sv, ov,
+ sep = options.separator === undefined ? ":" : options.separator,
+ delim = options.delimiter === undefined ? ";" : options.delimiter;
+ if(typeof options.value === 'string') {
+ so = options.value.split(delim);
+ for(i=0; i<so.length;i++){
+ sv = so[i].split(sep);
+ if(sv.length > 2 ) {
+ sv[1] = $.map(sv,function(n,ii){if(ii>0) { return n;} }).join(sep);
+ }
+ ov = document.createElement("option");
+ ov.setAttribute("role","option");
+ ov.value = sv[0]; ov.innerHTML = sv[1];
+ elem.appendChild(ov);
+ if (!msl && ($.trim(sv[0]) == $.trim(vl) || $.trim(sv[1]) == $.trim(vl))) { ov.selected ="selected"; }
+ if (msl && ($.inArray($.trim(sv[1]), ovm)>-1 || $.inArray($.trim(sv[0]), ovm)>-1)) {ov.selected ="selected";}
+ }
+ } else if (typeof options.value === 'object') {
+ var oSv = options.value;
+ for ( var key in oSv) {
+ if (oSv.hasOwnProperty(key ) ){
+ ov = document.createElement("option");
+ ov.setAttribute("role","option");
+ ov.value = key; ov.innerHTML = oSv[key];
+ elem.appendChild(ov);
+ if (!msl && ( $.trim(key) == $.trim(vl) || $.trim(oSv[key]) == $.trim(vl)) ) { ov.selected ="selected"; }
+ if (msl && ($.inArray($.trim(oSv[key]),ovm)>-1 || $.inArray($.trim(key),ovm)>-1)) { ov.selected ="selected"; }
+ }
+ }
+ }
+ setAttributes(elem, options, ['value']);
+ options = bindEv(elem,options);
+ }
+ break;
+ case "text" :
+ case "password" :
+ case "button" :
+ var role;
+ if(eltype=="button") { role = "button"; }
+ else { role = "textbox"; }
+ elem = document.createElement("input");
+ elem.type = eltype;
+ elem.value = vl;
+ setAttributes(elem, options);
+ options = bindEv(elem,options);
+ if(eltype != "button"){
+ if(autowidth) {
+ if(!options.size) { $(elem).css({width:"98%"}); }
+ } else if (!options.size) { options.size = 20; }
+ }
+ $(elem).attr("role",role);
+ break;
+ case "image" :
+ case "file" :
+ elem = document.createElement("input");
+ elem.type = eltype;
+ setAttributes(elem, options);
+ options = bindEv(elem,options);
+ break;
+ case "custom" :
+ elem = document.createElement("span");
+ try {
+ if($.isFunction(options.custom_element)) {
+ var celm = options.custom_element.call($t,vl,options);
+ if(celm) {
+ celm = $(celm).addClass("customelement").attr({id:options.id,name:options.name});
+ $(elem).empty().append(celm);
+ } else {
+ throw "e2";
+ }
+ } else {
+ throw "e1";
+ }
+ } catch (e) {
+ if (e=="e1") { $.jgrid.info_dialog($.jgrid.errors.errcap,"function 'custom_element' "+$.jgrid.edit.msg.nodefined, $.jgrid.edit.bClose);}
+ if (e=="e2") { $.jgrid.info_dialog($.jgrid.errors.errcap,"function 'custom_element' "+$.jgrid.edit.msg.novalue,$.jgrid.edit.bClose);}
+ else { $.jgrid.info_dialog($.jgrid.errors.errcap,typeof(e)==="string"?e:e.message,$.jgrid.edit.bClose); }
+ }
+ break;
+ }
+ return elem;
+ },
+// Date Validation Javascript
+ checkDate : function (format, date) {
+ var daysInFebruary = function(year){
+ // February has 29 days in any year evenly divisible by four,
+ // EXCEPT for centurial years which are not also divisible by 400.
+ return (((year % 4 === 0) && ( year % 100 !== 0 || (year % 400 === 0))) ? 29 : 28 );
+ },
+ DaysArray = function(n) {
+ for (var i = 1; i <= n; i++) {
+ this[i] = 31;
+ if (i==4 || i==6 || i==9 || i==11) {this[i] = 30;}
+ if (i==2) {this[i] = 29;}
+ }
+ return this;
+ };
+
+ var tsp = {}, sep;
+ format = format.toLowerCase();
+ //we search for /,-,. for the date separator
+ if(format.indexOf("/") != -1) {
+ sep = "/";
+ } else if(format.indexOf("-") != -1) {
+ sep = "-";
+ } else if(format.indexOf(".") != -1) {
+ sep = ".";
+ } else {
+ sep = "/";
+ }
+ format = format.split(sep);
+ date = date.split(sep);
+ if (date.length != 3) { return false; }
+ var j=-1,yln, dln=-1, mln=-1;
+ for(var i=0;i<format.length;i++){
+ var dv = isNaN(date[i]) ? 0 : parseInt(date[i],10);
+ tsp[format[i]] = dv;
+ yln = format[i];
+ if(yln.indexOf("y") != -1) { j=i; }
+ if(yln.indexOf("m") != -1) { mln=i; }
+ if(yln.indexOf("d") != -1) { dln=i; }
+ }
+ if (format[j] == "y" || format[j] == "yyyy") {
+ yln=4;
+ } else if(format[j] =="yy"){
+ yln = 2;
+ } else {
+ yln = -1;
+ }
+ var daysInMonth = DaysArray(12),
+ strDate;
+ if (j === -1) {
+ return false;
+ } else {
+ strDate = tsp[format[j]].toString();
+ if(yln == 2 && strDate.length == 1) {yln = 1;}
+ if (strDate.length != yln || (tsp[format[j]]===0 && date[j]!="00")){
+ return false;
+ }
+ }
+ if(mln === -1) {
+ return false;
+ } else {
+ strDate = tsp[format[mln]].toString();
+ if (strDate.length<1 || tsp[format[mln]]<1 || tsp[format[mln]]>12){
+ return false;
+ }
+ }
+ if(dln === -1) {
+ return false;
+ } else {
+ strDate = tsp[format[dln]].toString();
+ if (strDate.length<1 || tsp[format[dln]]<1 || tsp[format[dln]]>31 || (tsp[format[mln]]==2 && tsp[format[dln]]>daysInFebruary(tsp[format[j]])) || tsp[format[dln]] > daysInMonth[tsp[format[mln]]]){
+ return false;
+ }
+ }
+ return true;
+ },
+ isEmpty : function(val)
+ {
+ if (val.match(/^\s+$/) || val === "") {
+ return true;
+ } else {
+ return false;
+ }
+ },
+ checkTime : function(time){
+ // checks only hh:ss (and optional am/pm)
+ var re = /^(\d{1,2}):(\d{2})([ap]m)?$/,regs;
+ if(!$.jgrid.isEmpty(time))
+ {
+ regs = time.match(re);
+ if(regs) {
+ if(regs[3]) {
+ if(regs[1] < 1 || regs[1] > 12) { return false; }
+ } else {
+ if(regs[1] > 23) { return false; }
+ }
+ if(regs[2] > 59) {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ }
+ return true;
+ },
+ checkValues : function(val, valref,g, customobject, nam) {
+ var edtrul,i, nm, dft, len;
+ if(typeof(customobject) === "undefined") {
+ if(typeof(valref)=='string'){
+ for( i =0, len=g.p.colModel.length;i<len; i++){
+ if(g.p.colModel[i].name==valref) {
+ edtrul = g.p.colModel[i].editrules;
+ valref = i;
+ try { nm = g.p.colModel[i].formoptions.label; } catch (e) {}
+ break;
+ }
+ }
+ } else if(valref >=0) {
+ edtrul = g.p.colModel[valref].editrules;
+ }
+ } else {
+ edtrul = customobject;
+ nm = nam===undefined ? "_" : nam;
+ }
+ if(edtrul) {
+ if(!nm) { nm = g.p.colNames[valref]; }
+ if(edtrul.required === true) {
+ if( $.jgrid.isEmpty(val) ) { return [false,nm+": "+$.jgrid.edit.msg.required,""]; }
+ }
+ // force required
+ var rqfield = edtrul.required === false ? false : true;
+ if(edtrul.number === true) {
+ if( !(rqfield === false && $.jgrid.isEmpty(val)) ) {
+ if(isNaN(val)) { return [false,nm+": "+$.jgrid.edit.msg.number,""]; }
+ }
+ }
+ if(typeof edtrul.minValue != 'undefined' && !isNaN(edtrul.minValue)) {
+ if (parseFloat(val) < parseFloat(edtrul.minValue) ) { return [false,nm+": "+$.jgrid.edit.msg.minValue+" "+edtrul.minValue,""];}
+ }
+ if(typeof edtrul.maxValue != 'undefined' && !isNaN(edtrul.maxValue)) {
+ if (parseFloat(val) > parseFloat(edtrul.maxValue) ) { return [false,nm+": "+$.jgrid.edit.msg.maxValue+" "+edtrul.maxValue,""];}
+ }
+ var filter;
+ if(edtrul.email === true) {
+ if( !(rqfield === false && $.jgrid.isEmpty(val)) ) {
+ // taken from $ Validate plugin
+ filter = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i;
+ if(!filter.test(val)) {return [false,nm+": "+$.jgrid.edit.msg.email,""];}
+ }
+ }
+ if(edtrul.integer === true) {
+ if( !(rqfield === false && $.jgrid.isEmpty(val)) ) {
+ if(isNaN(val)) { return [false,nm+": "+$.jgrid.edit.msg.integer,""]; }
+ if ((val % 1 !== 0) || (val.indexOf('.') != -1)) { return [false,nm+": "+$.jgrid.edit.msg.integer,""];}
+ }
+ }
+ if(edtrul.date === true) {
+ if( !(rqfield === false && $.jgrid.isEmpty(val)) ) {
+ if(g.p.colModel[valref].formatoptions && g.p.colModel[valref].formatoptions.newformat) {
+ dft = g.p.colModel[valref].formatoptions.newformat;
+ } else {
+ dft = g.p.colModel[valref].datefmt || "Y-m-d";
+ }
+ if(!$.jgrid.checkDate (dft, val)) { return [false,nm+": "+$.jgrid.edit.msg.date+" - "+dft,""]; }
+ }
+ }
+ if(edtrul.time === true) {
+ if( !(rqfield === false && $.jgrid.isEmpty(val)) ) {
+ if(!$.jgrid.checkTime (val)) { return [false,nm+": "+$.jgrid.edit.msg.date+" - hh:mm (am/pm)",""]; }
+ }
+ }
+ if(edtrul.url === true) {
+ if( !(rqfield === false && $.jgrid.isEmpty(val)) ) {
+ filter = /^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;
+ if(!filter.test(val)) {return [false,nm+": "+$.jgrid.edit.msg.url,""];}
+ }
+ }
+ if(edtrul.custom === true) {
+ if( !(rqfield === false && $.jgrid.isEmpty(val)) ) {
+ if($.isFunction(edtrul.custom_func)) {
+ var ret = edtrul.custom_func.call(g,val,nm);
+ if($.isArray(ret)) {
+ return ret;
+ } else {
+ return [false,$.jgrid.edit.msg.customarray,""];
+ }
+ } else {
+ return [false,$.jgrid.edit.msg.customfcheck,""];
+ }
+ }
+ }
+ }
+ return [true,"",""];
+ }
+});
+})(jQuery);/*
+ * jqFilter jQuery jqGrid filter addon.
+ * Copyright (c) 2011, Tony Tomov, tony(a)trirand.com
+ * Dual licensed under the MIT and GPL licenses
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl-2.0.html
+ *
+ * The work is inspired from this Stefan Pirvu
+ * http://www.codeproject.com/KB/scripting/json-filtering.aspx
+ *
+ * The filter uses JSON entities to hold filter rules and groups. Here is an example of a filter:
+
+{ "groupOp": "AND",
+ "groups" : [
+ { "groupOp": "OR",
+ "rules": [
+ { "field": "name", "op": "eq", "data": "England" },
+ { "field": "id", "op": "le", "data": "5"}
+ ]
+ }
+ ],
+ "rules": [
+ { "field": "name", "op": "eq", "data": "Romania" },
+ { "field": "id", "op": "le", "data": "1"}
+ ]
+}
+*/
+/*global jQuery, $, window, navigator */
+
+(function ($) {
+
+$.fn.jqFilter = function( arg ) {
+ if (typeof arg === 'string') {
+
+ var fn = $.fn.jqFilter[arg];
+ if (!fn) {
+ throw ("jqFilter - No such method: " + arg);
+ }
+ var args = $.makeArray(arguments).slice(1);
+ return fn.apply(this,args);
+ }
+
+ var p = $.extend(true,{
+ filter: null,
+ columns: [],
+ onChange : null,
+ afterRedraw : null,
+ checkValues : null,
+ error: false,
+ errmsg : "",
+ errorcheck : true,
+ showQuery : true,
+ sopt : null,
+ ops : [
+ {"name": "eq", "description": "equal", "operator":"="},
+ {"name": "ne", "description": "not equal", "operator":"<>"},
+ {"name": "lt", "description": "less", "operator":"<"},
+ {"name": "le", "description": "less or equal","operator":"<="},
+ {"name": "gt", "description": "greater", "operator":">"},
+ {"name": "ge", "description": "greater or equal", "operator":">="},
+ {"name": "bw", "description": "begins with", "operator":"LIKE"},
+ {"name": "bn", "description": "does not begin with", "operator":"NOT LIKE"},
+ {"name": "in", "description": "in", "operator":"IN"},
+ {"name": "ni", "description": "not in", "operator":"NOT IN"},
+ {"name": "ew", "description": "ends with", "operator":"LIKE"},
+ {"name": "en", "description": "does not end with", "operator":"NOT LIKE"},
+ {"name": "cn", "description": "contains", "operator":"LIKE"},
+ {"name": "nc", "description": "does not contain", "operator":"NOT LIKE"},
+ {"name": "nu", "description": "is null", "operator":"IS NULL"},
+ {"name": "nn", "description": "is not null", "operator":"IS NOT NULL"}
+ ],
+ numopts : ['eq','ne', 'lt', 'le', 'gt', 'ge', 'nu', 'nn', 'in', 'ni'],
+ stropts : ['eq', 'ne', 'bw', 'bn', 'ew', 'en', 'cn', 'nc', 'nu', 'nn', 'in', 'ni'],
+ _gridsopt : [], // grid translated strings, do not tuch
+ groupOps : [{ op: "AND", text: "AND" }, { op: "OR", text: "OR" }],
+ groupButton : true,
+ ruleButtons : true,
+ direction : "ltr"
+ }, $.jgrid.filter, arg || {});
+ return this.each( function() {
+ if (this.filter) {return;}
+ this.p = p;
+ // setup filter in case if they is not defined
+ if (this.p.filter === null || this.p.filter === undefined) {
+ this.p.filter = {
+ groupOp: this.p.groupOps[0].op,
+ rules: [],
+ groups: []
+ };
+ }
+ var i, len = this.p.columns.length, cl,
+ isIE = /msie/i.test(navigator.userAgent) && !window.opera;
+
+ // translating the options
+ if(this.p._gridsopt.length) {
+ // ['eq','ne','lt','le','gt','ge','bw','bn','in','ni','ew','en','cn','nc']
+ for(i=0;i<this.p._gridsopt.length;i++) {
+ this.p.ops[i].description = this.p._gridsopt[i];
+ }
+ }
+ this.p.initFilter = $.extend(true,{},this.p.filter);
+
+ // set default values for the columns if they are not set
+ if( !len ) {return;}
+ for(i=0; i < len; i++) {
+ cl = this.p.columns[i];
+ if( cl.stype ) {
+ // grid compatibility
+ cl.inputtype = cl.stype;
+ } else if(!cl.inputtype) {
+ cl.inputtype = 'text';
+ }
+ if( cl.sorttype ) {
+ // grid compatibility
+ cl.searchtype = cl.sorttype;
+ } else if (!cl.searchtype) {
+ cl.searchtype = 'string';
+ }
+ if(cl.hidden === undefined) {
+ // jqGrid compatibility
+ cl.hidden = false;
+ }
+ if(!cl.label) {
+ cl.label = cl.name;
+ }
+ if(cl.index) {
+ cl.name = cl.index;
+ }
+ if(!cl.hasOwnProperty('searchoptions')) {
+ cl.searchoptions = {};
+ }
+ if(!cl.hasOwnProperty('searchrules')) {
+ cl.searchrules = {};
+ }
+
+ }
+ if(this.p.showQuery) {
+ $(this).append("<table class='queryresult ui-widget ui-widget-content' style='display:block;max-width:440px;border:0px none;' dir='"+this.p.direction+"'><tbody><tr><td class='query'></td></tr></tbody></table>");
+ }
+ /*
+ *Perform checking.
+ *
+ */
+ var checkData = function(val, colModelItem) {
+ var ret = [true,""];
+ if($.isFunction(colModelItem.searchrules)) {
+ ret = colModelItem.searchrules(val, colModelItem);
+ } else if($.jgrid && $.jgrid.checkValues) {
+ try {
+ ret = $.jgrid.checkValues(val, -1, null, colModelItem.searchrules, colModelItem.label);
+ } catch (e) {}
+ }
+ if(ret && ret.length && ret[0] === false) {
+ p.error = !ret[0];
+ p.errmsg = ret[1];
+ }
+ };
+ /* moving to common
+ randId = function() {
+ return Math.floor(Math.random()*10000).toString();
+ };
+ */
+
+ this.onchange = function ( ){
+ // clear any error
+ this.p.error = false;
+ this.p.errmsg="";
+ return $.isFunction(this.p.onChange) ? this.p.onChange.call( this, this.p ) : false;
+ };
+ /*
+ * Redraw the filter every time when new field is added/deleted
+ * and field is changed
+ */
+ this.reDraw = function() {
+ $("table.group:first",this).remove();
+ var t = this.createTableForGroup(p.filter, null);
+ $(this).append(t);
+ if($.isFunction(this.p.afterRedraw) ) {
+ this.p.afterRedraw.call(this, this.p);
+ }
+ };
+ /*
+ * Creates a grouping data for the filter
+ * @param group - object
+ * @param parentgroup - object
+ */
+ this.createTableForGroup = function(group, parentgroup) {
+ var that = this, i;
+ // this table will hold all the group (tables) and rules (rows)
+ var table = $("<table class='group ui-widget ui-widget-content' style='border:0px none;'><tbody></tbody></table>"),
+ // create error message row
+ align = "left";
+ if(this.p.direction == "rtl") {
+ align = "right";
+ table.attr("dir","rtl");
+ }
+ if(parentgroup === null) {
+ table.append("<tr class='error' style='display:none;'><th colspan='5' class='ui-state-error' align='"+align+"'></th></tr>");
+ }
+
+ var tr = $("<tr></tr>");
+ table.append(tr);
+ // this header will hold the group operator type and group action buttons for
+ // creating subgroup "+ {}", creating rule "+" or deleting the group "-"
+ var th = $("<th colspan='5' align='"+align+"'></th>");
+ tr.append(th);
+
+ if(this.p.ruleButtons === true) {
+ // dropdown for: choosing group operator type
+ var groupOpSelect = $("<select class='opsel'></select>");
+ th.append(groupOpSelect);
+ // populate dropdown with all posible group operators: or, and
+ var str= "", selected;
+ for (i = 0; i < p.groupOps.length; i++) {
+ selected = group.groupOp === that.p.groupOps[i].op ? " selected='selected'" :"";
+ str += "<option value='"+that.p.groupOps[i].op+"'" + selected+">"+that.p.groupOps[i].text+"</option>";
+ }
+
+ groupOpSelect
+ .append(str)
+ .bind('change',function() {
+ group.groupOp = $(groupOpSelect).val();
+ that.onchange(); // signals that the filter has changed
+ });
+ }
+ // button for adding a new subgroup
+ var inputAddSubgroup ="<span></span>";
+ if(this.p.groupButton) {
+ inputAddSubgroup = $("<input type='button' value='+ {}' title='Add subgroup' class='add-group'/>");
+ inputAddSubgroup.bind('click',function() {
+ if (group.groups === undefined ) {
+ group.groups = [];
+ }
+
+ group.groups.push({
+ groupOp: p.groupOps[0].op,
+ rules: [],
+ groups: []
+ }); // adding a new group
+
+ that.reDraw(); // the html has changed, force reDraw
+
+ that.onchange(); // signals that the filter has changed
+ return false;
+ });
+ }
+ th.append(inputAddSubgroup);
+ if(this.p.ruleButtons === true) {
+ // button for adding a new rule
+ var inputAddRule = $("<input type='button' value='+' title='Add rule' class='add-rule ui-add'/>"), cm;
+ inputAddRule.bind('click',function() {
+ //if(!group) { group = {};}
+ if (group.rules === undefined) {
+ group.rules = [];
+ }
+ for (i = 0; i < that.p.columns.length; i++) {
+ // but show only serchable and serchhidden = true fields
+ var searchable = (typeof that.p.columns[i].search === 'undefined') ? true: that.p.columns[i].search ,
+ hidden = (that.p.columns[i].hidden === true),
+ ignoreHiding = (that.p.columns[i].searchoptions.searchhidden === true);
+ if ((ignoreHiding && searchable) || (searchable && !hidden)) {
+ cm = that.p.columns[i];
+ break;
+ }
+ }
+
+ var opr;
+ if( cm.searchoptions.sopt ) {opr = cm.searchoptions.sopt;}
+ else if(that.p.sopt) { opr= that.p.sopt; }
+ else if (cm.searchtype === 'string') {opr = that.p.stropts;}
+ else {opr = that.p.numopts;}
+
+ group.rules.push({
+ field: cm.name,
+ op: opr[0],
+ data: ""
+ }); // adding a new rule
+
+ that.reDraw(); // the html has changed, force reDraw
+ // for the moment no change have been made to the rule, so
+ // this will not trigger onchange event
+ return false;
+ });
+ th.append(inputAddRule);
+ }
+
+ // button for delete the group
+ if (parentgroup !== null) { // ignore the first group
+ var inputDeleteGroup = $("<input type='button' value='-' title='Delete group' class='delete-group'/>");
+ th.append(inputDeleteGroup);
+ inputDeleteGroup.bind('click',function() {
+ // remove group from parent
+ for (i = 0; i < parentgroup.groups.length; i++) {
+ if (parentgroup.groups[i] === group) {
+ parentgroup.groups.splice(i, 1);
+ break;
+ }
+ }
+
+ that.reDraw(); // the html has changed, force reDraw
+
+ that.onchange(); // signals that the filter has changed
+ return false;
+ });
+ }
+
+ // append subgroup rows
+ if (group.groups !== undefined) {
+ for (i = 0; i < group.groups.length; i++) {
+ var trHolderForSubgroup = $("<tr></tr>");
+ table.append(trHolderForSubgroup);
+
+ var tdFirstHolderForSubgroup = $("<td class='first'></td>");
+ trHolderForSubgroup.append(tdFirstHolderForSubgroup);
+
+ var tdMainHolderForSubgroup = $("<td colspan='4'></td>");
+ tdMainHolderForSubgroup.append(this.createTableForGroup(group.groups[i], group));
+ trHolderForSubgroup.append(tdMainHolderForSubgroup);
+ }
+ }
+ if(group.groupOp === undefined) {
+ group.groupOp = that.p.groupOps[0].op;
+ }
+
+ // append rules rows
+ if (group.rules !== undefined) {
+ for (i = 0; i < group.rules.length; i++) {
+ table.append(
+ this.createTableRowForRule(group.rules[i], group)
+ );
+ }
+ }
+
+ return table;
+ };
+ /*
+ * Create the rule data for the filter
+ */
+ this.createTableRowForRule = function(rule, group ) {
+ // save current entity in a variable so that it could
+ // be referenced in anonimous method calls
+
+ var that=this, tr = $("<tr></tr>"),
+ //document.createElement("tr"),
+
+ // first column used for padding
+ //tdFirstHolderForRule = document.createElement("td"),
+ i, op, trpar, cm, str="", selected;
+ //tdFirstHolderForRule.setAttribute("class", "first");
+ tr.append("<td class='first'></td>");
+
+
+ // create field container
+ var ruleFieldTd = $("<td class='columns'></td>");
+ tr.append(ruleFieldTd);
+
+
+ // dropdown for: choosing field
+ var ruleFieldSelect = $("<select></select>"), ina, aoprs = [];
+ ruleFieldTd.append(ruleFieldSelect);
+ ruleFieldSelect.bind('change',function() {
+ rule.field = $(ruleFieldSelect).val();
+
+ trpar = $(this).parents("tr:first");
+ for (i=0;i<that.p.columns.length;i++) {
+ if(that.p.columns[i].name === rule.field) {
+ cm = that.p.columns[i];
+ break;
+ }
+ }
+ if(!cm) {return;}
+ cm.searchoptions.id = $.jgrid.randId();
+ if(isIE && cm.inputtype === "text") {
+ if(!cm.searchoptions.size) {
+ cm.searchoptions.size = 10;
+ }
+ }
+ var elm = $.jgrid.createEl(cm.inputtype,cm.searchoptions, "", true, that.p.ajaxSelectOptions, true);
+ $(elm).addClass("input-elm");
+ //that.createElement(rule, "");
+
+ if( cm.searchoptions.sopt ) {op = cm.searchoptions.sopt;}
+ else if(that.p.sopt) { op= that.p.sopt; }
+ else if (cm.searchtype === 'string') {op = that.p.stropts;}
+ else {op = that.p.numopts;}
+ // operators
+ var s ="", so = 0;
+ aoprs = [];
+ $.each(that.p.ops, function() { aoprs.push(this.name) });
+ for ( i = 0 ; i < op.length; i++) {
+ ina = $.inArray(op[i],aoprs);
+ if(ina !== -1) {
+ if(so===0) {
+ rule.op = that.p.ops[ina].name;
+ }
+ s += "<option value='"+that.p.ops[ina].name+"'>"+that.p.ops[ina].description+"</option>";
+ so++;
+ }
+ }
+ $(".selectopts",trpar).empty().append( s );
+ $(".selectopts",trpar)[0].selectedIndex = 0;
+ if( $.browser.msie && $.browser.version < 9) {
+ var sw = parseInt($("select.selectopts",trpar)[0].offsetWidth) + 1;
+ $(".selectopts",trpar).width( sw );
+ $(".selectopts",trpar).css("width","auto");
+ }
+ // data
+ $(".data",trpar).empty().append( elm );
+ $(".input-elm",trpar).bind('change',function( e ) {
+ var tmo = $(this).hasClass("ui-autocomplete-input") ? 200 :0;
+ setTimeout(function(){
+ var elem = e.target;
+ rule.data = elem.nodeName.toUpperCase() === "SPAN" && cm.searchoptions && $.isFunction(cm.searchoptions.custom_value) ?
+ cm.searchoptions.custom_value($(elem).children(".customelement:first"), 'get') : elem.value;
+ that.onchange(); // signals that the filter has changed
+ }, tmo);
+ });
+ setTimeout(function(){ //IE, Opera, Chrome
+ rule.data = $(elm).val();
+ that.onchange(); // signals that the filter has changed
+ }, 0);
+ });
+
+ // populate drop down with user provided column definitions
+ var j=0;
+ for (i = 0; i < that.p.columns.length; i++) {
+ // but show only serchable and serchhidden = true fields
+ var searchable = (typeof that.p.columns[i].search === 'undefined') ? true: that.p.columns[i].search ,
+ hidden = (that.p.columns[i].hidden === true),
+ ignoreHiding = (that.p.columns[i].searchoptions.searchhidden === true);
+ if ((ignoreHiding && searchable) || (searchable && !hidden)) {
+ selected = "";
+ if(rule.field === that.p.columns[i].name) {
+ selected = " selected='selected'";
+ j=i;
+ }
+ str += "<option value='"+that.p.columns[i].name+"'" +selected+">"+that.p.columns[i].label+"</option>";
+ }
+ }
+ ruleFieldSelect.append( str );
+
+
+ // create operator container
+ var ruleOperatorTd = $("<td class='operators'></td>");
+ tr.append(ruleOperatorTd);
+ cm = p.columns[j];
+ // create it here so it can be referentiated in the onchange event
+ //var RD = that.createElement(rule, rule.data);
+ cm.searchoptions.id = $.jgrid.randId();
+ if(isIE && cm.inputtype === "text") {
+ if(!cm.searchoptions.size) {
+ cm.searchoptions.size = 10;
+ }
+ }
+ var ruleDataInput = $.jgrid.createEl(cm.inputtype,cm.searchoptions, rule.data, true, that.p.ajaxSelectOptions, true);
+
+ // dropdown for: choosing operator
+ var ruleOperatorSelect = $("<select class='selectopts'></select>");
+ ruleOperatorTd.append(ruleOperatorSelect);
+ ruleOperatorSelect.bind('change',function() {
+ rule.op = $(ruleOperatorSelect).val();
+ trpar = $(this).parents("tr:first");
+ var rd = $(".input-elm",trpar)[0];
+ if (rule.op === "nu" || rule.op === "nn") { // disable for operator "is null" and "is not null"
+ rule.data = "";
+ rd.value = "";
+ rd.setAttribute("readonly", "true");
+ rd.setAttribute("disabled", "true");
+ } else {
+ rd.removeAttribute("readonly");
+ rd.removeAttribute("disabled");
+ }
+
+ that.onchange(); // signals that the filter has changed
+ });
+
+ // populate drop down with all available operators
+ if( cm.searchoptions.sopt ) {op = cm.searchoptions.sopt;}
+ else if(that.p.sopt) { op= that.p.sopt; }
+ else if (cm.searchtype === 'string') {op = p.stropts;}
+ else {op = that.p.numopts;}
+ str="";
+ $.each(that.p.ops, function() { aoprs.push(this.name) });
+ for ( i = 0; i < op.length; i++) {
+ ina = $.inArray(op[i],aoprs);
+ if(ina !== -1) {
+ selected = rule.op === that.p.ops[ina].name ? " selected='selected'" : "";
+ str += "<option value='"+that.p.ops[ina].name+"'"+selected+">"+that.p.ops[ina].description+"</option>";
+ }
+ }
+ ruleOperatorSelect.append( str );
+ // create data container
+ var ruleDataTd = $("<td class='data'></td>");
+ tr.append(ruleDataTd);
+
+ // textbox for: data
+ // is created previously
+ //ruleDataInput.setAttribute("type", "text");
+ ruleDataTd.append(ruleDataInput);
+
+ $(ruleDataInput)
+ .addClass("input-elm")
+ .bind('change', function() {
+ rule.data = cm.inputtype === 'custom' ? cm.searchoptions.custom_value($(this).children(".customelement:first"),'get') : $(this).val();
+ that.onchange(); // signals that the filter has changed
+ });
+
+ // create action container
+ var ruleDeleteTd = $("<td></td>");
+ tr.append(ruleDeleteTd);
+
+ // create button for: delete rule
+ if(this.p.ruleButtons === true) {
+ var ruleDeleteInput = $("<input type='button' value='-' title='Delete rule' class='delete-rule ui-del'/>");
+ ruleDeleteTd.append(ruleDeleteInput);
+ //$(ruleDeleteInput).html("").height(20).width(30).button({icons: { primary: "ui-icon-minus", text:false}});
+ ruleDeleteInput.bind('click',function() {
+ // remove rule from group
+ for (i = 0; i < group.rules.length; i++) {
+ if (group.rules[i] === rule) {
+ group.rules.splice(i, 1);
+ break;
+ }
+ }
+
+ that.reDraw(); // the html has changed, force reDraw
+
+ that.onchange(); // signals that the filter has changed
+ return false;
+ });
+ }
+ return tr;
+ };
+
+ this.getStringForGroup = function(group) {
+ var s = "(", index;
+ if (group.groups !== undefined) {
+ for (index = 0; index < group.groups.length; index++) {
+ if (s.length > 1) {
+ s += " " + group.groupOp + " ";
+ }
+ try {
+ s += this.getStringForGroup(group.groups[index]);
+ } catch (eg) {alert(eg);}
+ }
+ }
+
+ if (group.rules !== undefined) {
+ try{
+ for (index = 0; index < group.rules.length; index++) {
+ if (s.length > 1) {
+ s += " " + group.groupOp + " ";
+ }
+ s += this.getStringForRule(group.rules[index]);
+ }
+ } catch (e) {alert(e);}
+ }
+
+ s += ")";
+
+ if (s === "()") {
+ return ""; // ignore groups that don't have rules
+ } else {
+ return s;
+ }
+ };
+ this.getStringForRule = function(rule) {
+ var opUF = "",opC="", i, cm, ret, val,
+ numtypes = ['int', 'integer', 'float', 'number', 'currency']; // jqGrid
+ for (i = 0; i < this.p.ops.length; i++) {
+ if (this.p.ops[i].name === rule.op) {
+ opUF = this.p.ops[i].operator;
+ opC = this.p.ops[i].name;
+ break;
+ }
+ }
+ for (i=0; i<this.p.columns.length; i++) {
+ if(this.p.columns[i].name === rule.field) {
+ cm = this.p.columns[i];
+ break;
+ }
+ }
+ val = rule.data;
+ if(opC === 'bw' || opC === 'bn') { val = val+"%"; }
+ if(opC === 'ew' || opC === 'en') { val = "%"+val; }
+ if(opC === 'cn' || opC === 'nc') { val = "%"+val+"%"; }
+ if(opC === 'in' || opC === 'ni') { val = " ("+val+")"; }
+ if(p.errorcheck) { checkData(rule.data, cm); }
+ if($.inArray(cm.searchtype, numtypes) !== -1 || opC === 'nn' || opC === 'nu') { ret = rule.field + " " + opUF + " " + val; }
+ else { ret = rule.field + " " + opUF + " \"" + val + "\""; }
+ return ret;
+ };
+ this.resetFilter = function () {
+ this.p.filter = $.extend(true,{},this.p.initFilter);
+ this.reDraw();
+ this.onchange();
+ };
+ this.hideError = function() {
+ $("th.ui-state-error", this).html("");
+ $("tr.error", this).hide();
+ };
+ this.showError = function() {
+ $("th.ui-state-error", this).html(this.p.errmsg);
+ $("tr.error", this).show();
+ };
+ this.toUserFriendlyString = function() {
+ return this.getStringForGroup(p.filter);
+ };
+ this.toString = function() {
+ // this will obtain a string that can be used to match an item.
+ var that = this;
+ function getStringRule(rule) {
+ if(that.p.errorcheck) {
+ var i, cm;
+ for (i=0; i<that.p.columns.length; i++) {
+ if(that.p.columns[i].name === rule.field) {
+ cm = that.p.columns[i];
+ break;
+ }
+ }
+ if(cm) {checkData(rule.data, cm);}
+ }
+ return rule.op + "(item." + rule.field + ",'" + rule.data + "')";
+ }
+
+ function getStringForGroup(group) {
+ var s = "(", index;
+
+ if (group.groups !== undefined) {
+ for (index = 0; index < group.groups.length; index++) {
+ if (s.length > 1) {
+ if (group.groupOp === "OR") {
+ s += " || ";
+ }
+ else {
+ s += " && ";
+ }
+ }
+ s += getStringForGroup(group.groups[index]);
+ }
+ }
+
+ if (group.rules !== undefined) {
+ for (index = 0; index < group.rules.length; index++) {
+ if (s.length > 1) {
+ if (group.groupOp === "OR") {
+ s += " || ";
+ }
+ else {
+ s += " && ";
+ }
+ }
+ s += getStringRule(group.rules[index]);
+ }
+ }
+
+ s += ")";
+
+ if (s === "()") {
+ return ""; // ignore groups that don't have rules
+ } else {
+ return s;
+ }
+ }
+
+ return getStringForGroup(this.p.filter);
+ };
+
+ // Here we init the filter
+ this.reDraw();
+
+ if(this.p.showQuery) {
+ this.onchange();
+ }
+ // mark is as created so that it will not be created twice on this element
+ this.filter = true;
+ });
+};
+$.extend($.fn.jqFilter,{
+ /*
+ * Return SQL like string. Can be used directly
+ */
+ toSQLString : function()
+ {
+ var s ="";
+ this.each(function(){
+ s = this.toUserFriendlyString();
+ });
+ return s;
+ },
+ /*
+ * Return filter data as object.
+ */
+ filterData : function()
+ {
+ var s;
+ this.each(function(){
+ s = this.p.filter;
+ });
+ return s;
+
+ },
+ getParameter : function (param) {
+ if(param !== undefined) {
+ if (this.p.hasOwnProperty(param) ) {
+ return this.p[param];
+ }
+ }
+ return this.p;
+ },
+ resetFilter: function() {
+ return this.each(function(){
+ this.resetFilter();
+ });
+ },
+ addFilter: function (pfilter) {
+ if (typeof pfilter === "string") {
+ pfilter = jQuery.jgrid.parse( pfilter );
+ }
+ this.each(function(){
+ this.p.filter = pfilter;
+ this.reDraw();
+ this.onchange();
+ });
+ }
+
+});
+})(jQuery);
+
+(function($){
+/**
+ * jqGrid extension for form editing Grid Data
+ * Tony Tomov tony(a)trirand.com
+ * http://trirand.com/blog/
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl-2.0.html
+**/
+"use strict";
+/*global xmlJsonClass, jQuery, $ */
+var rp_ge = {};
+$.jgrid.extend({
+ searchGrid : function (p) {
+ p = $.extend({
+ recreateFilter: false,
+ drag: true,
+ sField:'searchField',
+ sValue:'searchString',
+ sOper: 'searchOper',
+ sFilter: 'filters',
+ loadDefaults: true, // this options activates loading of default filters from grid's postData for Multipe Search only.
+ beforeShowSearch: null,
+ afterShowSearch : null,
+ onInitializeSearch: null,
+ afterRedraw : null,
+ afterChange: null,
+ closeAfterSearch : false,
+ closeAfterReset: false,
+ closeOnEscape : false,
+ searchOnEnter : false,
+ multipleSearch : false,
+ multipleGroup : false,
+ //cloneSearchRowOnAdd: true,
+ top : 0,
+ left: 0,
+ jqModal : true,
+ modal: false,
+ resize : true,
+ width: 450,
+ height: 'auto',
+ dataheight: 'auto',
+ showQuery: false,
+ errorcheck : true,
+ // translation
+ // if you want to change or remove the order change it in sopt
+ // ['eq','ne','lt','le','gt','ge','bw','bn','in','ni','ew','en','cn','nc'],
+ sopt: null,
+ stringResult: undefined,
+ onClose : null,
+ onSearch : null,
+ onReset : null,
+ toTop : true,
+ overlay : 30,
+ columns : [],
+ tmplNames : null,
+ tmplFilters : null,
+ // translations - later in lang file
+ tmplLabel : ' Template: ',
+ showOnLoad: false,
+ layer: null
+ }, $.jgrid.search, p || {});
+ return this.each(function() {
+ var $t = this;
+ if(!$t.grid) {return;}
+ var fid = "fbox_"+$t.p.id,
+ showFrm = true,
+ IDs = {themodal:'searchmod'+fid,modalhead:'searchhd'+fid,modalcontent:'searchcnt'+fid, scrollelm : fid},
+ defaultFilters = $t.p.postData[p.sFilter];
+ if(typeof(defaultFilters) === "string") {
+ defaultFilters = $.jgrid.parse( defaultFilters );
+ }
+ if(p.recreateFilter === true) {
+ $("#"+$.jgrid.jqID(IDs.themodal)).remove();
+ }
+ function showFilter(_filter) {
+ showFrm = $($t).triggerHandler("jqGridFilterBeforeShow", [_filter]);
+ if(typeof(showFrm) === "undefined") {
+ showFrm = true;
+ }
+ if(showFrm && $.isFunction(p.beforeShowSearch)) {
+ showFrm = p.beforeShowSearch.call($t,_filter);
+ }
+ if(showFrm) {
+ $.jgrid.viewModal("#"+$.jgrid.jqID(IDs.themodal),{gbox:"#gbox_"+$.jgrid.jqID(fid),jqm:p.jqModal, modal:p.modal, overlay: p.overlay, toTop: p.toTop});
+ $($t).triggerHandler("jqGridFilterAfterShow", [_filter]);
+ if($.isFunction(p.afterShowSearch)) {
+ p.afterShowSearch.call($t, _filter);
+ }
+ }
+ }
+ if ( $("#"+$.jgrid.jqID(IDs.themodal))[0] !== undefined ) {
+ showFilter($("#fbox_"+$.jgrid.jqID(+$t.p.id)));
+ } else {
+ var fil = $("<div><div id='"+fid+"' class='searchFilter' style='overflow:auto'></div></div>").insertBefore("#gview_"+$.jgrid.jqID($t.p.id)),
+ align = "left", butleft ="";
+ if($t.p.direction == "rtl") {
+ align = "right";
+ butleft = " style='text-align:left'";
+ fil.attr("dir","rtl");
+ }
+ var columns = $.extend([],$t.p.colModel),
+ bS ="<a href='javascript:void(0)' id='"+fid+"_search' class='fm-button ui-state-default ui-corner-all fm-button-icon-right ui-reset'><span class='ui-icon ui-icon-search'></span>"+p.Find+"</a>",
+ bC ="<a href='javascript:void(0)' id='"+fid+"_reset' class='fm-button ui-state-default ui-corner-all fm-button-icon-left ui-search'><span class='ui-icon ui-icon-arrowreturnthick-1-w'></span>"+p.Reset+"</a>",
+ bQ = "", tmpl="", colnm, found = false, bt, cmi=-1;
+ if(p.showQuery) {
+ bQ ="<a href='javascript:void(0)' id='"+fid+"_query' class='fm-button ui-state-default ui-corner-all fm-button-icon-left'><span class='ui-icon ui-icon-comment'></span>Query</a>";
+ }
+ if(!p.columns.length) {
+ $.each(columns, function(i,n){
+ if(!n.label) {
+ n.label = $t.p.colNames[i];
+ }
+ // find first searchable column and set it if no default filter
+ if(!found) {
+ var searchable = (typeof n.search === 'undefined') ? true: n.search ,
+ hidden = (n.hidden === true),
+ ignoreHiding = (n.searchoptions && n.searchoptions.searchhidden === true);
+ if ((ignoreHiding && searchable) || (searchable && !hidden)) {
+ found = true;
+ colnm = n.index || n.name;
+ cmi =i;
+ }
+ }
+ });
+ } else {
+ columns = p.columns;
+ }
+ // old behaviour
+ if( (!defaultFilters && colnm) || p.multipleSearch === false ) {
+ var cmop = "eq";
+ if(cmi >=0 && columns[cmi].searchoptions && columns[cmi].searchoptions.sopt) {
+ cmop = columns[cmi].searchoptions.sopt[0];
+ } else if(p.sopt && p.sopt.length) {
+ cmop = p.sopt[0];
+ }
+ defaultFilters = {"groupOp": "AND",rules:[{"field":colnm,"op":cmop,"data":""}]};
+ }
+ found = false;
+ if(p.tmplNames && p.tmplNames.length) {
+ found = true;
+ tmpl = p.tmplLabel;
+ tmpl += "<select class='ui-template'>";
+ tmpl += "<option value='default'>Default</option>";
+ $.each(p.tmplNames, function(i,n){
+ tmpl += "<option value='"+i+"'>"+n+"</option>";
+ });
+ tmpl += "</select>";
+ }
+
+ bt = "<table class='EditTable' style='border:0px none;margin-top:5px' id='"+fid+"_2'><tbody><tr><td colspan='2'><hr class='ui-widget-content' style='margin:1px'/></td></tr><tr><td class='EditButton' style='text-align:"+align+"'>"+bC+tmpl+"</td><td class='EditButton' "+butleft+">"+bQ+bS+"</td></tr></tbody></table>";
+ fid = $.jgrid.jqID( fid);
+ $("#"+fid).jqFilter({
+ columns : columns,
+ filter: p.loadDefaults ? defaultFilters : null,
+ showQuery: p.showQuery,
+ errorcheck : p.errorcheck,
+ sopt: p.sopt,
+ groupButton : p.multipleGroup,
+ ruleButtons : p.multipleSearch,
+ afterRedraw : p.afterRedraw,
+ _gridsopt : $.jgrid.search.odata,
+ ajaxSelectOptions: $t.p.ajaxSelectOptions,
+ groupOps: p.groupOps,
+ onChange : function() {
+ if(this.p.showQuery) {
+ $('.query',this).html(this.toUserFriendlyString());
+ }
+ if ($.isFunction(p.afterChange)) {
+ p.afterChange.call($t, $("#"+fid), p);
+ }
+ },
+ direction : $t.p.direction
+ });
+ fil.append( bt );
+ if(found && p.tmplFilters && p.tmplFilters.length) {
+ $(".ui-template", fil).bind('change', function(){
+ var curtempl = $(this).val();
+ if(curtempl=="default") {
+ $("#"+fid).jqFilter('addFilter', defaultFilters);
+ } else {
+ $("#"+fid).jqFilter('addFilter', p.tmplFilters[parseInt(curtempl,10)]);
+ }
+ return false;
+ });
+ }
+ if(p.multipleGroup === true) {p.multipleSearch = true;}
+ $($t).triggerHandler("jqGridFilterInitialize", [$("#"+fid)]);
+ if($.isFunction(p.onInitializeSearch) ) {
+ p.onInitializeSearch.call($t, $("#"+fid));
+ }
+ p.gbox = "#gbox_"+fid;
+ if (p.layer) {
+ $.jgrid.createModal(IDs ,fil,p,"#gview_"+$.jgrid.jqID($t.p.id),$("#gbox_"+$.jgrid.jqID($t.p.id))[0], "#"+$.jgrid.jqID(p.layer), {position: "relative"});
+ } else {
+ $.jgrid.createModal(IDs ,fil,p,"#gview_"+$.jgrid.jqID($t.p.id),$("#gbox_"+$.jgrid.jqID($t.p.id))[0]);
+ }
+ if (p.searchOnEnter || p.closeOnEscape) {
+ $("#"+$.jgrid.jqID(IDs.themodal)).keydown(function (e) {
+ var $target = $(e.target);
+ if (p.searchOnEnter && e.which === 13 && // 13 === $.ui.keyCode.ENTER
+ !$target.hasClass('add-group') && !$target.hasClass('add-rule') &&
+ !$target.hasClass('delete-group') && !$target.hasClass('delete-rule') &&
+ (!$target.hasClass("fm-button") || !$target.is("[id$=_query]"))) {
+ $("#"+fid+"_search").focus().click();
+ return false;
+ }
+ if (p.closeOnEscape && e.which === 27) { // 27 === $.ui.keyCode.ESCAPE
+ $("#"+$.jgrid.jqID(IDs.modalhead)).find(".ui-jqdialog-titlebar-close").focus().click();
+ return false;
+ }
+ });
+ }
+ if(bQ) {
+ $("#"+fid+"_query").bind('click', function(){
+ $(".queryresult", fil).toggle();
+ return false;
+ });
+ }
+ if (p.stringResult===undefined) {
+ // to provide backward compatibility, inferring stringResult value from multipleSearch
+ p.stringResult = p.multipleSearch;
+ }
+ $("#"+fid+"_search").bind('click', function(){
+ var fl = $("#"+fid),
+ sdata={}, res ,
+ filters = fl.jqFilter('filterData');
+ if(p.errorcheck) {
+ fl[0].hideError();
+ if(!p.showQuery) {fl.jqFilter('toSQLString');}
+ if(fl[0].p.error) {
+ fl[0].showError();
+ return false;
+ }
+ }
+
+ if(p.stringResult) {
+ try {
+ // xmlJsonClass or JSON.stringify
+ res = xmlJsonClass.toJson(filters, '', '', false);
+ } catch (e) {
+ try {
+ res = JSON.stringify(filters);
+ } catch (e2) { }
+ }
+ if(typeof(res)==="string") {
+ sdata[p.sFilter] = res;
+ $.each([p.sField,p.sValue, p.sOper], function() {sdata[this] = "";});
+ }
+ } else {
+ if(p.multipleSearch) {
+ sdata[p.sFilter] = filters;
+ $.each([p.sField,p.sValue, p.sOper], function() {sdata[this] = "";});
+ } else {
+ sdata[p.sField] = filters.rules[0].field;
+ sdata[p.sValue] = filters.rules[0].data;
+ sdata[p.sOper] = filters.rules[0].op;
+ sdata[p.sFilter] = "";
+ }
+ }
+ $t.p.search = true;
+ $.extend($t.p.postData,sdata);
+ $($t).triggerHandler("jqGridFilterSearch");
+ if($.isFunction(p.onSearch) ) {
+ p.onSearch.call($t);
+ }
+ $($t).trigger("reloadGrid",[{page:1}]);
+ if(p.closeAfterSearch) {
+ $.jgrid.hideModal("#"+$.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+$.jgrid.jqID($t.p.id),jqm:p.jqModal,onClose: p.onClose});
+ }
+ return false;
+ });
+ $("#"+fid+"_reset").bind('click', function(){
+ var sdata={},
+ fl = $("#"+fid);
+ $t.p.search = false;
+ if(p.multipleSearch===false) {
+ sdata[p.sField] = sdata[p.sValue] = sdata[p.sOper] = "";
+ } else {
+ sdata[p.sFilter] = "";
+ }
+ fl[0].resetFilter();
+ if(found) {
+ $(".ui-template", fil).val("default");
+ }
+ $.extend($t.p.postData,sdata);
+ $($t).triggerHandler("jqGridFilterReset");
+ if($.isFunction(p.onReset) ) {
+ p.onReset.call($t);
+ }
+ $($t).trigger("reloadGrid",[{page:1}]);
+ return false;
+ });
+ showFilter($("#"+fid));
+ $(".fm-button:not(.ui-state-disabled)",fil).hover(
+ function(){$(this).addClass('ui-state-hover');},
+ function(){$(this).removeClass('ui-state-hover');}
+ );
+ }
+ });
+ },
+ editGridRow : function(rowid, p){
+ p = $.extend({
+ top : 0,
+ left: 0,
+ width: 300,
+ height: 'auto',
+ dataheight: 'auto',
+ modal: false,
+ overlay : 30,
+ drag: true,
+ resize: true,
+ url: null,
+ mtype : "POST",
+ clearAfterAdd :true,
+ closeAfterEdit : false,
+ reloadAfterSubmit : true,
+ onInitializeForm: null,
+ beforeInitData: null,
+ beforeShowForm: null,
+ afterShowForm: null,
+ beforeSubmit: null,
+ afterSubmit: null,
+ onclickSubmit: null,
+ afterComplete: null,
+ onclickPgButtons : null,
+ afterclickPgButtons: null,
+ editData : {},
+ recreateForm : false,
+ jqModal : true,
+ closeOnEscape : false,
+ addedrow : "first",
+ topinfo : '',
+ bottominfo: '',
+ saveicon : [],
+ closeicon : [],
+ savekey: [false,13],
+ navkeys: [false,38,40],
+ checkOnSubmit : false,
+ checkOnUpdate : false,
+ _savedData : {},
+ processing : false,
+ onClose : null,
+ ajaxEditOptions : {},
+ serializeEditData : null,
+ viewPagerButtons : true
+ }, $.jgrid.edit, p || {});
+ rp_ge[$(this)[0].p.id] = p;
+ return this.each(function(){
+ var $t = this;
+ if (!$t.grid || !rowid) {return;}
+ var gID = $t.p.id,
+ frmgr = "FrmGrid_"+gID, frmtborg = "TblGrid_"+gID, frmtb = "#"+$.jgrid.jqID(frmtborg),
+ IDs = {themodal:'editmod'+gID,modalhead:'edithd'+gID,modalcontent:'editcnt'+gID, scrollelm : frmgr},
+ onBeforeShow = $.isFunction(rp_ge[$t.p.id].beforeShowForm) ? rp_ge[$t.p.id].beforeShowForm : false,
+ onAfterShow = $.isFunction(rp_ge[$t.p.id].afterShowForm) ? rp_ge[$t.p.id].afterShowForm : false,
+ onBeforeInit = $.isFunction(rp_ge[$t.p.id].beforeInitData) ? rp_ge[$t.p.id].beforeInitData : false,
+ onInitializeForm = $.isFunction(rp_ge[$t.p.id].onInitializeForm) ? rp_ge[$t.p.id].onInitializeForm : false,
+ showFrm = true,
+ maxCols = 1, maxRows=0, postdata, extpost, newData, diff, frmoper;
+ frmgr = $.jgrid.jqID(frmgr);
+ if (rowid === "new") {
+ rowid = "_empty";
+ frmoper = "add";
+ p.caption=rp_ge[$t.p.id].addCaption;
+ } else {
+ p.caption=rp_ge[$t.p.id].editCaption;
+ frmoper = "edit";
+ }
+ if(p.recreateForm===true && $("#"+$.jgrid.jqID(IDs.themodal))[0] !== undefined) {
+ $("#"+$.jgrid.jqID(IDs.themodal)).remove();
+ }
+ var closeovrl = true;
+ if(p.checkOnUpdate && p.jqModal && !p.modal) {
+ closeovrl = false;
+ }
+ function getFormData(){
+ $(frmtb+" > tbody > tr > td > .FormElement").each(function() {
+ var celm = $(".customelement", this);
+ if (celm.length) {
+ var elem = celm[0], nm = $(elem).attr('name');
+ $.each($t.p.colModel, function(){
+ if(this.name === nm && this.editoptions && $.isFunction(this.editoptions.custom_value)) {
+ try {
+ postdata[nm] = this.editoptions.custom_value.call($t, $("#"+$.jgrid.jqID(nm),frmtb),'get');
+ if (postdata[nm] === undefined) {throw "e1";}
+ } catch (e) {
+ if (e==="e1") {$.jgrid.info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+$.jgrid.edit.msg.novalue,jQuery.jgrid.edit.bClose);}
+ else {$.jgrid.info_dialog(jQuery.jgrid.errors.errcap,e.message,jQuery.jgrid.edit.bClose);}
+ }
+ return true;
+ }
+ });
+ } else {
+ switch ($(this).get(0).type) {
+ case "checkbox":
+ if($(this).is(":checked")) {
+ postdata[this.name]= $(this).val();
+ }else {
+ var ofv = $(this).attr("offval");
+ postdata[this.name]= ofv;
+ }
+ break;
+ case "select-one":
+ postdata[this.name]= $("option:selected",this).val();
+ extpost[this.name]= $("option:selected",this).text();
+ break;
+ case "select-multiple":
+ postdata[this.name]= $(this).val();
+ if(postdata[this.name]) {postdata[this.name] = postdata[this.name].join(",");}
+ else {postdata[this.name] ="";}
+ var selectedText = [];
+ $("option:selected",this).each(
+ function(i,selected){
+ selectedText[i] = $(selected).text();
+ }
+ );
+ extpost[this.name]= selectedText.join(",");
+ break;
+ case "password":
+ case "text":
+ case "textarea":
+ case "button":
+ postdata[this.name] = $(this).val();
+
+ break;
+ }
+ if($t.p.autoencode) {postdata[this.name] = $.jgrid.htmlEncode(postdata[this.name]);}
+ }
+ });
+ return true;
+ }
+ function createData(rowid,obj,tb,maxcols){
+ var nm, hc,trdata, cnt=0,tmp, dc,elc, retpos=[], ind=false,
+ tdtmpl = "<td class='CaptionTD'> </td><td class='DataTD'> </td>", tmpl="", i; //*2
+ for (i =1; i<=maxcols;i++) {
+ tmpl += tdtmpl;
+ }
+ if(rowid != '_empty') {
+ ind = $(obj).jqGrid("getInd",rowid);
+ }
+ $(obj.p.colModel).each( function(i) {
+ nm = this.name;
+ // hidden fields are included in the form
+ if(this.editrules && this.editrules.edithidden === true) {
+ hc = false;
+ } else {
+ hc = this.hidden === true ? true : false;
+ }
+ dc = hc ? "style='display:none'" : "";
+ if ( nm !== 'cb' && nm !== 'subgrid' && this.editable===true && nm !== 'rn') {
+ if(ind === false) {
+ tmp = "";
+ } else {
+ if(nm == obj.p.ExpandColumn && obj.p.treeGrid === true) {
+ tmp = $("td:eq("+i+")",obj.rows[ind]).text();
+ } else {
+ try {
+ tmp = $.unformat.call(obj, $("td:eq("+i+")",obj.rows[ind]),{rowId:rowid, colModel:this},i);
+ } catch (_) {
+ tmp = (this.edittype && this.edittype == "textarea") ? $("td:eq("+i+")",obj.rows[ind]).text() : $("td:eq("+i+")",obj.rows[ind]).html();
+ }
+ if(!tmp || tmp == " " || tmp == " " || (tmp.length==1 && tmp.charCodeAt(0)==160) ) {tmp='';}
+ }
+ }
+ var opt = $.extend({}, this.editoptions || {} ,{id:nm,name:nm}),
+ frmopt = $.extend({}, {elmprefix:'',elmsuffix:'',rowabove:false,rowcontent:''}, this.formoptions || {}),
+ rp = parseInt(frmopt.rowpos,10) || cnt+1,
+ cp = parseInt((parseInt(frmopt.colpos,10) || 1)*2,10);
+ if(rowid == "_empty" && opt.defaultValue ) {
+ tmp = $.isFunction(opt.defaultValue) ? opt.defaultValue.call($t) : opt.defaultValue;
+ }
+ if(!this.edittype) {this.edittype = "text";}
+ if($t.p.autoencode) {tmp = $.jgrid.htmlDecode(tmp);}
+ elc = $.jgrid.createEl.call($t,this.edittype,opt,tmp,false,$.extend({},$.jgrid.ajaxOptions,obj.p.ajaxSelectOptions || {}));
+ if(tmp === "" && this.edittype == "checkbox") {tmp = $(elc).attr("offval");}
+ if(tmp === "" && this.edittype == "select") {tmp = $("option:eq(0)",elc).text();}
+ if(rp_ge[$t.p.id].checkOnSubmit || rp_ge[$t.p.id].checkOnUpdate) {rp_ge[$t.p.id]._savedData[nm] = tmp;}
+ $(elc).addClass("FormElement");
+ if(this.edittype == 'text' || this.edittype == 'textarea') {
+ $(elc).addClass("ui-widget-content ui-corner-all");
+ }
+ trdata = $(tb).find("tr[rowpos="+rp+"]");
+ if(frmopt.rowabove) {
+ var newdata = $("<tr><td class='contentinfo' colspan='"+(maxcols*2)+"'>"+frmopt.rowcontent+"</td></tr>");
+ $(tb).append(newdata);
+ newdata[0].rp = rp;
+ }
+ if ( trdata.length===0 ) {
+ trdata = $("<tr "+dc+" rowpos='"+rp+"'></tr>").addClass("FormData").attr("id","tr_"+nm);
+ $(trdata).append(tmpl);
+ $(tb).append(trdata);
+ trdata[0].rp = rp;
+ }
+ $("td:eq("+(cp-2)+")",trdata[0]).html( typeof frmopt.label === 'undefined' ? obj.p.colNames[i]: frmopt.label);
+ $("td:eq("+(cp-1)+")",trdata[0]).append(frmopt.elmprefix).append(elc).append(frmopt.elmsuffix);
+ retpos[cnt] = i;
+ cnt++;
+ }
+ });
+ if( cnt > 0) {
+ var idrow = $("<tr class='FormData' style='display:none'><td class='CaptionTD'></td><td colspan='"+ (maxcols*2-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='"+obj.p.id+"_id' value='"+rowid+"'/></td></tr>");
+ idrow[0].rp = cnt+999;
+ $(tb).append(idrow);
+ if(rp_ge[$t.p.id].checkOnSubmit || rp_ge[$t.p.id].checkOnUpdate) {rp_ge[$t.p.id]._savedData[obj.p.id+"_id"] = rowid;}
+ }
+ return retpos;
+ }
+ function fillData(rowid,obj,fmid){
+ var nm,cnt=0,tmp, fld,opt,vl,vlc;
+ if(rp_ge[$t.p.id].checkOnSubmit || rp_ge[$t.p.id].checkOnUpdate) {rp_ge[$t.p.id]._savedData = {};rp_ge[$t.p.id]._savedData[obj.p.id+"_id"]=rowid;}
+ var cm = obj.p.colModel;
+ if(rowid == '_empty') {
+ $(cm).each(function(){
+ nm = this.name;
+ opt = $.extend({}, this.editoptions || {} );
+ fld = $("#"+$.jgrid.jqID(nm),"#"+fmid);
+ if(fld && fld.length && fld[0] !== null) {
+ vl = "";
+ if(opt.defaultValue ) {
+ vl = $.isFunction(opt.defaultValue) ? opt.defaultValue.call($t) : opt.defaultValue;
+ if(fld[0].type=='checkbox') {
+ vlc = vl.toLowerCase();
+ if(vlc.search(/(false|0|no|off|undefined)/i)<0 && vlc!=="") {
+ fld[0].checked = true;
+ fld[0].defaultChecked = true;
+ fld[0].value = vl;
+ } else {
+ fld[0].checked = false;
+ fld[0].defaultChecked = false;
+ }
+ } else {fld.val(vl);}
+ } else {
+ if( fld[0].type=='checkbox' ) {
+ fld[0].checked = false;
+ fld[0].defaultChecked = false;
+ vl = $(fld).attr("offval");
+ } else if (fld[0].type && fld[0].type.substr(0,6)=='select') {
+ fld[0].selectedIndex = 0;
+ } else {
+ fld.val(vl);
+ }
+ }
+ if(rp_ge[$t.p.id].checkOnSubmit===true || rp_ge[$t.p.id].checkOnUpdate) {rp_ge[$t.p.id]._savedData[nm] = vl;}
+ }
+ });
+ $("#id_g","#"+fmid).val(rowid);
+ return;
+ }
+ var tre = $(obj).jqGrid("getInd",rowid,true);
+ if(!tre) {return;}
+ $('td[role="gridcell"]',tre).each( function(i) {
+ nm = cm[i].name;
+ // hidden fields are included in the form
+ if ( nm !== 'cb' && nm !== 'subgrid' && nm !== 'rn' && cm[i].editable===true) {
+ if(nm == obj.p.ExpandColumn && obj.p.treeGrid === true) {
+ tmp = $(this).text();
+ } else {
+ try {
+ tmp = $.unformat.call(obj, $(this),{rowId:rowid, colModel:cm[i]},i);
+ } catch (_) {
+ tmp = cm[i].edittype=="textarea" ? $(this).text() : $(this).html();
+ }
+ }
+ if($t.p.autoencode) {tmp = $.jgrid.htmlDecode(tmp);}
+ if(rp_ge[$t.p.id].checkOnSubmit===true || rp_ge[$t.p.id].checkOnUpdate) {rp_ge[$t.p.id]._savedData[nm] = tmp;}
+ nm = $.jgrid.jqID(nm);
+ switch (cm[i].edittype) {
+ case "password":
+ case "text":
+ case "button" :
+ case "image":
+ case "textarea":
+ if(tmp == " " || tmp == " " || (tmp.length==1 && tmp.charCodeAt(0)==160) ) {tmp='';}
+ $("#"+nm,"#"+fmid).val(tmp);
+ break;
+ case "select":
+ var opv = tmp.split(",");
+ opv = $.map(opv,function(n){return $.trim(n);});
+ $("#"+nm+" option","#"+fmid).each(function(){
+ if (!cm[i].editoptions.multiple && ($.trim(tmp) == $.trim($(this).text()) || opv[0] == $.trim($(this).text()) || opv[0] == $.trim($(this).val())) ){
+ this.selected= true;
+ } else if (cm[i].editoptions.multiple){
+ if( $.inArray($.trim($(this).text()), opv ) > -1 || $.inArray($.trim($(this).val()), opv ) > -1 ){
+ this.selected = true;
+ }else{
+ this.selected = false;
+ }
+ } else {
+ this.selected = false;
+ }
+ });
+ break;
+ case "checkbox":
+ tmp = tmp+"";
+ if(cm[i].editoptions && cm[i].editoptions.value) {
+ var cb = cm[i].editoptions.value.split(":");
+ if(cb[0] == tmp) {
+ $("#"+nm,"#"+fmid)[$t.p.useProp ? 'prop': 'attr']("checked",true);
+ $("#"+nm,"#"+fmid)[$t.p.useProp ? 'prop': 'attr']("defaultChecked",true); //ie
+ } else {
+ $("#"+nm,"#"+fmid)[$t.p.useProp ? 'prop': 'attr']("checked", false);
+ $("#"+nm,"#"+fmid)[$t.p.useProp ? 'prop': 'attr']("defaultChecked", false); //ie
+ }
+ } else {
+ tmp = tmp.toLowerCase();
+ if(tmp.search(/(false|0|no|off|undefined)/i)<0 && tmp!=="") {
+ $("#"+nm,"#"+fmid)[$t.p.useProp ? 'prop': 'attr']("checked",true);
+ $("#"+nm,"#"+fmid)[$t.p.useProp ? 'prop': 'attr']("defaultChecked",true); //ie
+ } else {
+ $("#"+nm,"#"+fmid)[$t.p.useProp ? 'prop': 'attr']("checked", false);
+ $("#"+nm,"#"+fmid)[$t.p.useProp ? 'prop': 'attr']("defaultChecked", false); //ie
+ }
+ }
+ break;
+ case 'custom' :
+ try {
+ if(cm[i].editoptions && $.isFunction(cm[i].editoptions.custom_value)) {
+ cm[i].editoptions.custom_value.call($t, $("#"+nm,"#"+fmid),'set',tmp);
+ } else {throw "e1";}
+ } catch (e) {
+ if (e=="e1") {$.jgrid.info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+$.jgrid.edit.msg.nodefined,jQuery.jgrid.edit.bClose);}
+ else {$.jgrid.info_dialog(jQuery.jgrid.errors.errcap,e.message,jQuery.jgrid.edit.bClose);}
+ }
+ break;
+ }
+ cnt++;
+ }
+ });
+ if(cnt>0) {$("#id_g",frmtb).val(rowid);}
+ }
+ function setNulls() {
+ $.each($t.p.colModel, function(i,n){
+ if(n.editoptions && n.editoptions.NullIfEmpty === true) {
+ if(postdata.hasOwnProperty(n.name) && postdata[n.name] === "") {
+ postdata[n.name] = 'null';
+ }
+ }
+ });
+ }
+ function postIt() {
+ var copydata, ret=[true,"",""], onCS = {}, opers = $t.p.prmNames, idname, oper, key, selr, i;
+
+ var retvals = $($t).triggerHandler("jqGridAddEditBeforeCheckValues", [$("#"+frmgr), frmoper]);
+ if(retvals && typeof(retvals) === 'object') {postdata = retvals;}
+
+ if($.isFunction(rp_ge[$t.p.id].beforeCheckValues)) {
+ retvals = rp_ge[$t.p.id].beforeCheckValues.call($t, postdata,$("#"+frmgr),postdata[$t.p.id+"_id"] == "_empty" ? opers.addoper : opers.editoper);
+ if(retvals && typeof(retvals) === 'object') {postdata = retvals;}
+ }
+ for( key in postdata ){
+ if(postdata.hasOwnProperty(key)) {
+ ret = $.jgrid.checkValues.call($t,postdata[key],key,$t);
+ if(ret[0] === false) {break;}
+ }
+ }
+ setNulls();
+ if(ret[0]) {
+ onCS = $($t).triggerHandler("jqGridAddEditClickSubmit", [rp_ge[$t.p.id], postdata, frmoper]);
+ if( onCS === undefined && $.isFunction( rp_ge[$t.p.id].onclickSubmit)) {
+ onCS = rp_ge[$t.p.id].onclickSubmit.call($t, rp_ge[$t.p.id], postdata) || {};
+ }
+ ret = $($t).triggerHandler("jqGridAddEditBeforeSubmit", [postdata, $("#"+frmgr), frmoper]);
+ if(ret === undefined) {
+ ret = [true,"",""];
+ }
+ if( ret[0] && $.isFunction(rp_ge[$t.p.id].beforeSubmit)) {
+ ret = rp_ge[$t.p.id].beforeSubmit.call($t,postdata,$("#"+frmgr));
+ }
+ }
+
+ if(ret[0] && !rp_ge[$t.p.id].processing) {
+ rp_ge[$t.p.id].processing = true;
+ $("#sData", frmtb+"_2").addClass('ui-state-active');
+ oper = opers.oper;
+ idname = opers.id;
+ // we add to pos data array the action - the name is oper
+ postdata[oper] = ($.trim(postdata[$t.p.id+"_id"]) == "_empty") ? opers.addoper : opers.editoper;
+ if(postdata[oper] != opers.addoper) {
+ postdata[idname] = postdata[$t.p.id+"_id"];
+ } else {
+ // check to see if we have allredy this field in the form and if yes lieve it
+ if( postdata[idname] === undefined ) {postdata[idname] = postdata[$t.p.id+"_id"];}
+ }
+ delete postdata[$t.p.id+"_id"];
+ postdata = $.extend(postdata,rp_ge[$t.p.id].editData,onCS);
+ if($t.p.treeGrid === true) {
+ if(postdata[oper] == opers.addoper) {
+ selr = $($t).jqGrid("getGridParam", 'selrow');
+ var tr_par_id = $t.p.treeGridModel == 'adjacency' ? $t.p.treeReader.parent_id_field : 'parent_id';
+ postdata[tr_par_id] = selr;
+ }
+ for(i in $t.p.treeReader){
+ if($t.p.treeReader.hasOwnProperty(i)) {
+ var itm = $t.p.treeReader[i];
+ if(postdata.hasOwnProperty(itm)) {
+ if(postdata[oper] == opers.addoper && i === 'parent_id_field') {continue;}
+ delete postdata[itm];
+ }
+ }
+ }
+ }
+
+ postdata[idname] = $.jgrid.stripPref($t.p.idPrefix, postdata[idname]);
+ var ajaxOptions = $.extend({
+ url: rp_ge[$t.p.id].url ? rp_ge[$t.p.id].url : $($t).jqGrid('getGridParam','editurl'),
+ type: rp_ge[$t.p.id].mtype,
+ data: $.isFunction(rp_ge[$t.p.id].serializeEditData) ? rp_ge[$t.p.id].serializeEditData.call($t,postdata) : postdata,
+ complete:function(data,Status){
+ postdata[idname] = $t.p.idPrefix + postdata[idname];
+ if(Status != "success") {
+ ret[0] = false;
+ ret[1] = $($t).triggerHandler("jqGridAddEditErrorTextFormat", [data, frmoper]);
+ if ($.isFunction(rp_ge[$t.p.id].errorTextFormat)) {
+ ret[1] = rp_ge[$t.p.id].errorTextFormat.call($t, data);
+ } else {
+ ret[1] = Status + " Status: '" + data.statusText + "'. Error code: " + data.status;
+ }
+ } else {
+ // data is posted successful
+ // execute aftersubmit with the returned data from server
+ ret = $($t).triggerHandler("jqGridAddEditAfterSubmit", [data, postdata, frmoper]);
+ if(ret === undefined) {
+ ret = [true,"",""];
+ }
+ if( ret[0] && $.isFunction(rp_ge[$t.p.id].afterSubmit) ) {
+ ret = rp_ge[$t.p.id].afterSubmit.call($t, data,postdata);
+ }
+ }
+ if(ret[0] === false) {
+ $("#FormError>td",frmtb).html(ret[1]);
+ $("#FormError",frmtb).show();
+ } else {
+ // remove some values if formattaer select or checkbox
+ $.each($t.p.colModel, function(){
+ if(extpost[this.name] && this.formatter && this.formatter=='select') {
+ try {delete extpost[this.name];} catch (e) {}
+ }
+ });
+ postdata = $.extend(postdata,extpost);
+ if($t.p.autoencode) {
+ $.each(postdata,function(n,v){
+ postdata[n] = $.jgrid.htmlDecode(v);
+ });
+ }
+ //rp_ge[$t.p.id].reloadAfterSubmit = rp_ge[$t.p.id].reloadAfterSubmit && $t.p.datatype != "local";
+ // the action is add
+ if(postdata[oper] == opers.addoper ) {
+ //id processing
+ // user not set the id ret[2]
+ if(!ret[2]) {ret[2] = $.jgrid.randId();}
+ postdata[idname] = ret[2];
+ if(rp_ge[$t.p.id].closeAfterAdd) {
+ if(rp_ge[$t.p.id].reloadAfterSubmit) {$($t).trigger("reloadGrid");}
+ else {
+ if($t.p.treeGrid === true){
+ $($t).jqGrid("addChildNode",ret[2],selr,postdata );
+ } else {
+ $($t).jqGrid("addRowData",ret[2],postdata,p.addedrow);
+ $($t).jqGrid("setSelection",ret[2]);
+ }
+ }
+ $.jgrid.hideModal("#"+$.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+$.jgrid.jqID(gID),jqm:p.jqModal,onClose: rp_ge[$t.p.id].onClose});
+ } else if (rp_ge[$t.p.id].clearAfterAdd) {
+ if(rp_ge[$t.p.id].reloadAfterSubmit) {$($t).trigger("reloadGrid");}
+ else {
+ if($t.p.treeGrid === true){
+ $($t).jqGrid("addChildNode",ret[2],selr,postdata );
+ } else {
+ $($t).jqGrid("addRowData",ret[2],postdata,p.addedrow);
+ }
+ }
+ fillData("_empty",$t,frmgr);
+ } else {
+ if(rp_ge[$t.p.id].reloadAfterSubmit) {$($t).trigger("reloadGrid");}
+ else {
+ if($t.p.treeGrid === true){
+ $($t).jqGrid("addChildNode",ret[2],selr,postdata );
+ } else {
+ $($t).jqGrid("addRowData",ret[2],postdata,p.addedrow);
+ }
+ }
+ }
+ } else {
+ // the action is update
+ if(rp_ge[$t.p.id].reloadAfterSubmit) {
+ $($t).trigger("reloadGrid");
+ if( !rp_ge[$t.p.id].closeAfterEdit ) {setTimeout(function(){$($t).jqGrid("setSelection",postdata[idname]);},1000);}
+ } else {
+ if($t.p.treeGrid === true) {
+ $($t).jqGrid("setTreeRow", postdata[idname],postdata);
+ } else {
+ $($t).jqGrid("setRowData", postdata[idname],postdata);
+ }
+ }
+ if(rp_ge[$t.p.id].closeAfterEdit) {$.jgrid.hideModal("#"+$.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+$.jgrid.jqID(gID),jqm:p.jqModal,onClose: rp_ge[$t.p.id].onClose});}
+ }
+ if($.isFunction(rp_ge[$t.p.id].afterComplete)) {
+ copydata = data;
+ setTimeout(function(){
+ $($t).triggerHandler("jqGridAddEditAfterComplete", [copydata, postdata, $("#"+frmgr), frmoper]);
+ rp_ge[$t.p.id].afterComplete.call($t, copydata, postdata, $("#"+frmgr));
+ copydata=null;
+ },500);
+ }
+ if(rp_ge[$t.p.id].checkOnSubmit || rp_ge[$t.p.id].checkOnUpdate) {
+ $("#"+frmgr).data("disabled",false);
+ if(rp_ge[$t.p.id]._savedData[$t.p.id+"_id"] !="_empty"){
+ for(var key in rp_ge[$t.p.id]._savedData) {
+ if(postdata[key]) {
+ rp_ge[$t.p.id]._savedData[key] = postdata[key];
+ }
+ }
+ }
+ }
+ }
+ rp_ge[$t.p.id].processing=false;
+ $("#sData", frmtb+"_2").removeClass('ui-state-active');
+ try{$(':input:visible',"#"+frmgr)[0].focus();} catch (e){}
+ }
+ }, $.jgrid.ajaxOptions, rp_ge[$t.p.id].ajaxEditOptions );
+
+ if (!ajaxOptions.url && !rp_ge[$t.p.id].useDataProxy) {
+ if ($.isFunction($t.p.dataProxy)) {
+ rp_ge[$t.p.id].useDataProxy = true;
+ } else {
+ ret[0]=false;ret[1] += " "+$.jgrid.errors.nourl;
+ }
+ }
+ if (ret[0]) {
+ if (rp_ge[$t.p.id].useDataProxy) {
+ var dpret = $t.p.dataProxy.call($t, ajaxOptions, "set_"+$t.p.id);
+ if(typeof(dpret) == "undefined") {
+ dpret = [true, ""];
+ }
+ if(dpret[0] === false ) {
+ ret[0] = false;
+ ret[1] = dpret[1] || "Error deleting the selected row!" ;
+ } else {
+ if(ajaxOptions.data.oper == opers.addoper && rp_ge[$t.p.id].closeAfterAdd ) {
+ $.jgrid.hideModal("#"+$.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+$.jgrid.jqID(gID),jqm:p.jqModal, onClose: rp_ge[$t.p.id].onClose});
+ }
+ if(ajaxOptions.data.oper == opers.editoper && rp_ge[$t.p.id].closeAfterEdit ) {
+ $.jgrid.hideModal("#"+$.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+$.jgrid.jqID(gID),jqm:p.jqModal, onClose: rp_ge[$t.p.id].onClose});
+ }
+ }
+ } else {
+ $.ajax(ajaxOptions);
+ }
+ }
+ }
+ if(ret[0] === false) {
+ $("#FormError>td",frmtb).html(ret[1]);
+ $("#FormError",frmtb).show();
+ // return;
+ }
+ }
+ function compareData(nObj, oObj ) {
+ var ret = false,key;
+ for (key in nObj) {
+ if(nObj[key] != oObj[key]) {
+ ret = true;
+ break;
+ }
+ }
+ return ret;
+ }
+ function checkUpdates () {
+ var stat = true;
+ $("#FormError",frmtb).hide();
+ if(rp_ge[$t.p.id].checkOnUpdate) {
+ postdata = {};extpost={};
+ getFormData();
+ newData = $.extend({},postdata,extpost);
+ diff = compareData(newData,rp_ge[$t.p.id]._savedData);
+ if(diff) {
+ $("#"+frmgr).data("disabled",true);
+ $(".confirm","#"+IDs.themodal).show();
+ stat = false;
+ }
+ }
+ return stat;
+ }
+ function restoreInline()
+ {
+ if (rowid !== "_empty" && typeof($t.p.savedRow) !== "undefined" && $t.p.savedRow.length > 0 && $.isFunction($.fn.jqGrid.restoreRow)) {
+ for (var i=0;i<$t.p.savedRow.length;i++) {
+ if ($t.p.savedRow[i].id == rowid) {
+ $($t).jqGrid('restoreRow',rowid);
+ break;
+ }
+ }
+ }
+ }
+ function updateNav(cr,totr){
+ if (cr===0) {$("#pData",frmtb+"_2").addClass('ui-state-disabled');} else {$("#pData",frmtb+"_2").removeClass('ui-state-disabled');}
+ if (cr==totr) {$("#nData",frmtb+"_2").addClass('ui-state-disabled');} else {$("#nData",frmtb+"_2").removeClass('ui-state-disabled');}
+ }
+ function getCurrPos() {
+ var rowsInGrid = $($t).jqGrid("getDataIDs"),
+ selrow = $("#id_g",frmtb).val(),
+ pos = $.inArray(selrow,rowsInGrid);
+ return [pos,rowsInGrid];
+ }
+
+ if ( $("#"+$.jgrid.jqID(IDs.themodal))[0] !== undefined ) {
+ showFrm = $($t).triggerHandler("jqGridAddEditBeforeInitData", [$("#"+$.jgrid.jqID(frmgr)), frmoper]);
+ if(typeof(showFrm) == "undefined") {
+ showFrm = true;
+ }
+ if(showFrm && onBeforeInit) {
+ showFrm = onBeforeInit.call($t,$("#"+frmgr));
+ }
+ if(showFrm === false) {return;}
+ restoreInline();
+ $(".ui-jqdialog-title","#"+$.jgrid.jqID(IDs.modalhead)).html(p.caption);
+ $("#FormError",frmtb).hide();
+ if(rp_ge[$t.p.id].topinfo) {
+ $(".topinfo",frmtb).html(rp_ge[$t.p.id].topinfo);
+ $(".tinfo",frmtb).show();
+ } else {
+ $(".tinfo",frmtb).hide();
+ }
+ if(rp_ge[$t.p.id].bottominfo) {
+ $(".bottominfo",frmtb+"_2").html(rp_ge[$t.p.id].bottominfo);
+ $(".binfo",frmtb+"_2").show();
+ } else {
+ $(".binfo",frmtb+"_2").hide();
+ }
+ // filldata
+ fillData(rowid,$t,frmgr);
+ ///
+ if(rowid=="_empty" || !rp_ge[$t.p.id].viewPagerButtons) {
+ $("#pData, #nData",frmtb+"_2").hide();
+ } else {
+ $("#pData, #nData",frmtb+"_2").show();
+ }
+ if(rp_ge[$t.p.id].processing===true) {
+ rp_ge[$t.p.id].processing=false;
+ $("#sData", frmtb+"_2").removeClass('ui-state-active');
+ }
+ if($("#"+frmgr).data("disabled")===true) {
+ $(".confirm","#"+$.jgrid.jqID(IDs.themodal)).hide();
+ $("#"+frmgr).data("disabled",false);
+ }
+ $($t).triggerHandler("jqGridAddEditBeforeShowForm", [$("#"+frmgr), frmoper]);
+ if(onBeforeShow) { onBeforeShow.call($t, $("#"+frmgr)); }
+ $("#"+$.jgrid.jqID(IDs.themodal)).data("onClose",rp_ge[$t.p.id].onClose);
+ $.jgrid.viewModal("#"+$.jgrid.jqID(IDs.themodal),{gbox:"#gbox_"+$.jgrid.jqID(gID),jqm:p.jqModal, jqM: false, overlay: p.overlay, modal:p.modal});
+ if(!closeovrl) {
+ $(".jqmOverlay").click(function(){
+ if(!checkUpdates()) {return false;}
+ $.jgrid.hideModal("#"+$.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+$.jgrid.jqID(gID),jqm:p.jqModal, onClose: rp_ge[$t.p.id].onClose});
+ return false;
+ });
+ }
+ $($t).triggerHandler("jqGridAddEditAfterShowForm", [$("#"+frmgr), frmoper]);
+ if(onAfterShow) { onAfterShow.call($t, $("#"+frmgr)); }
+ } else {
+ var dh = isNaN(p.dataheight) ? p.dataheight : p.dataheight+"px",
+ frm = $("<form name='FormPost' id='"+frmgr+"' class='FormGrid' onSubmit='return false;' style='width:100%;overflow:auto;position:relative;height:"+dh+";'></form>").data("disabled",false),
+ tbl = $("<table id='"+frmtborg+"' class='EditTable' cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>");
+ showFrm = $($t).triggerHandler("jqGridAddEditBeforeInitData", [$("#"+frmgr), frmoper]);
+ if(typeof(showFrm) == "undefined") {
+ showFrm = true;
+ }
+ if(showFrm && onBeforeInit) {
+ showFrm = onBeforeInit.call($t,$("#"+frmgr));
+ }
+ if(showFrm === false) {return;}
+ restoreInline();
+ $($t.p.colModel).each( function() {
+ var fmto = this.formoptions;
+ maxCols = Math.max(maxCols, fmto ? fmto.colpos || 0 : 0 );
+ maxRows = Math.max(maxRows, fmto ? fmto.rowpos || 0 : 0 );
+ });
+ $(frm).append(tbl);
+ var flr = $("<tr id='FormError' style='display:none'><td class='ui-state-error' colspan='"+(maxCols*2)+"'></td></tr>");
+ flr[0].rp = 0;
+ $(tbl).append(flr);
+ //topinfo
+ flr = $("<tr style='display:none' class='tinfo'><td class='topinfo' colspan='"+(maxCols*2)+"'>"+rp_ge[$t.p.id].topinfo+"</td></tr>");
+ flr[0].rp = 0;
+ $(tbl).append(flr);
+ // set the id.
+ // use carefull only to change here colproperties.
+ // create data
+ var rtlb = $t.p.direction == "rtl" ? true :false,
+ bp = rtlb ? "nData" : "pData",
+ bn = rtlb ? "pData" : "nData";
+ createData(rowid,$t,tbl,maxCols);
+ // buttons at footer
+ var bP = "<a href='javascript:void(0)' id='"+bp+"' class='fm-button ui-state-default ui-corner-left'><span class='ui-icon ui-icon-triangle-1-w'></span></a>",
+ bN = "<a href='javascript:void(0)' id='"+bn+"' class='fm-button ui-state-default ui-corner-right'><span class='ui-icon ui-icon-triangle-1-e'></span></a>",
+ bS ="<a href='javascript:void(0)' id='sData' class='fm-button ui-state-default ui-corner-all'>"+p.bSubmit+"</a>",
+ bC ="<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>"+p.bCancel+"</a>";
+ var bt = "<table border='0' cellspacing='0' cellpadding='0' class='EditTable' id='"+frmtborg+"_2'><tbody><tr><td colspan='2'><hr class='ui-widget-content' style='margin:1px'/></td></tr><tr id='Act_Buttons'><td class='navButton'>"+(rtlb ? bN+bP : bP+bN)+"</td><td class='EditButton'>"+bS+bC+"</td></tr>";
+ bt += "<tr style='display:none' class='binfo'><td class='bottominfo' colspan='2'>"+rp_ge[$t.p.id].bottominfo+"</td></tr>";
+ bt += "</tbody></table>";
+ if(maxRows > 0) {
+ var sd=[];
+ $.each($(tbl)[0].rows,function(i,r){
+ sd[i] = r;
+ });
+ sd.sort(function(a,b){
+ if(a.rp > b.rp) {return 1;}
+ if(a.rp < b.rp) {return -1;}
+ return 0;
+ });
+ $.each(sd, function(index, row) {
+ $('tbody',tbl).append(row);
+ });
+ }
+ p.gbox = "#gbox_"+$.jgrid.jqID(gID);
+ var cle = false;
+ if(p.closeOnEscape===true){
+ p.closeOnEscape = false;
+ cle = true;
+ }
+ var tms = $("<span></span>").append(frm).append(bt);
+ $.jgrid.createModal(IDs,tms,p,"#gview_"+$.jgrid.jqID($t.p.id),$("#gbox_"+$.jgrid.jqID($t.p.id))[0]);
+ if(rtlb) {
+ $("#pData, #nData",frmtb+"_2").css("float","right");
+ $(".EditButton",frmtb+"_2").css("text-align","left");
+ }
+ if(rp_ge[$t.p.id].topinfo) {$(".tinfo",frmtb).show();}
+ if(rp_ge[$t.p.id].bottominfo) {$(".binfo",frmtb+"_2").show();}
+ tms = null;bt=null;
+ $("#"+$.jgrid.jqID(IDs.themodal)).keydown( function( e ) {
+ var wkey = e.target;
+ if ($("#"+frmgr).data("disabled")===true ) {return false;}//??
+ if(rp_ge[$t.p.id].savekey[0] === true && e.which == rp_ge[$t.p.id].savekey[1]) { // save
+ if(wkey.tagName != "TEXTAREA") {
+ $("#sData", frmtb+"_2").trigger("click");
+ return false;
+ }
+ }
+ if(e.which === 27) {
+ if(!checkUpdates()) {return false;}
+ if(cle) {$.jgrid.hideModal(this,{gb:p.gbox,jqm:p.jqModal, onClose: rp_ge[$t.p.id].onClose});}
+ return false;
+ }
+ if(rp_ge[$t.p.id].navkeys[0]===true) {
+ if($("#id_g",frmtb).val() == "_empty") {return true;}
+ if(e.which == rp_ge[$t.p.id].navkeys[1]){ //up
+ $("#pData", frmtb+"_2").trigger("click");
+ return false;
+ }
+ if(e.which == rp_ge[$t.p.id].navkeys[2]){ //down
+ $("#nData", frmtb+"_2").trigger("click");
+ return false;
+ }
+ }
+ });
+ if(p.checkOnUpdate) {
+ $("a.ui-jqdialog-titlebar-close span","#"+$.jgrid.jqID(IDs.themodal)).removeClass("jqmClose");
+ $("a.ui-jqdialog-titlebar-close","#"+$.jgrid.jqID(IDs.themodal)).unbind("click")
+ .click(function(){
+ if(!checkUpdates()) {return false;}
+ $.jgrid.hideModal("#"+$.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+$.jgrid.jqID(gID),jqm:p.jqModal,onClose: rp_ge[$t.p.id].onClose});
+ return false;
+ });
+ }
+ p.saveicon = $.extend([true,"left","ui-icon-disk"],p.saveicon);
+ p.closeicon = $.extend([true,"left","ui-icon-close"],p.closeicon);
+ // beforeinitdata after creation of the form
+ if(p.saveicon[0]===true) {
+ $("#sData",frmtb+"_2").addClass(p.saveicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
+ .append("<span class='ui-icon "+p.saveicon[2]+"'></span>");
+ }
+ if(p.closeicon[0]===true) {
+ $("#cData",frmtb+"_2").addClass(p.closeicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
+ .append("<span class='ui-icon "+p.closeicon[2]+"'></span>");
+ }
+ if(rp_ge[$t.p.id].checkOnSubmit || rp_ge[$t.p.id].checkOnUpdate) {
+ bS ="<a href='javascript:void(0)' id='sNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+p.bYes+"</a>";
+ bN ="<a href='javascript:void(0)' id='nNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+p.bNo+"</a>";
+ bC ="<a href='javascript:void(0)' id='cNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+p.bExit+"</a>";
+ var ii, zI = p.zIndex || 999;zI ++;
+ if ($.browser.msie && $.browser.version ==6) {
+ ii = '<iframe style="display:block;position:absolute;z-index:-1;filter:Alpha(Opacity=\'0\');" src="javascript:false;"></iframe>';
+ } else {ii="";}
+ $("<div class='ui-widget-overlay jqgrid-overlay confirm' style='z-index:"+zI+";display:none;'> "+ii+"</div><div class='confirm ui-widget-content ui-jqconfirm' style='z-index:"+(zI+1)+"'>"+p.saveData+"<br/><br/>"+bS+bN+bC+"</div>").insertAfter("#"+frmgr);
+ $("#sNew","#"+$.jgrid.jqID(IDs.themodal)).click(function(){
+ postIt();
+ $("#"+frmgr).data("disabled",false);
+ $(".confirm","#"+$.jgrid.jqID(IDs.themodal)).hide();
+ return false;
+ });
+ $("#nNew","#"+$.jgrid.jqID(IDs.themodal)).click(function(){
+ $(".confirm","#"+$.jgrid.jqID(IDs.themodal)).hide();
+ $("#"+frmgr).data("disabled",false);
+ setTimeout(function(){$(":input","#"+frmgr)[0].focus();},0);
+ return false;
+ });
+ $("#cNew","#"+$.jgrid.jqID(IDs.themodal)).click(function(){
+ $(".confirm","#"+$.jgrid.jqID(IDs.themodal)).hide();
+ $("#"+frmgr).data("disabled",false);
+ $.jgrid.hideModal("#"+$.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+$.jgrid.jqID(gID),jqm:p.jqModal,onClose: rp_ge[$t.p.id].onClose});
+ return false;
+ });
+ }
+ // here initform - only once
+ $($t).triggerHandler("jqGridAddEditInitializeForm", [$("#"+frmgr), frmoper]);
+ if(onInitializeForm) {onInitializeForm.call($t,$("#"+frmgr));}
+ if(rowid=="_empty" || !rp_ge[$t.p.id].viewPagerButtons) {$("#pData,#nData",frmtb+"_2").hide();} else {$("#pData,#nData",frmtb+"_2").show();}
+ $($t).triggerHandler("jqGridAddEditBeforeShowForm", [$("#"+frmgr), frmoper]);
+ if(onBeforeShow) { onBeforeShow.call($t, $("#"+frmgr));}
+ $("#"+$.jgrid.jqID(IDs.themodal)).data("onClose",rp_ge[$t.p.id].onClose);
+ $.jgrid.viewModal("#"+$.jgrid.jqID(IDs.themodal),{gbox:"#gbox_"+$.jgrid.jqID(gID),jqm:p.jqModal, overlay: p.overlay,modal:p.modal});
+ if(!closeovrl) {
+ $(".jqmOverlay").click(function(){
+ if(!checkUpdates()) {return false;}
+ $.jgrid.hideModal("#"+$.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+$.jgrid.jqID(gID),jqm:p.jqModal, onClose: rp_ge[$t.p.id].onClose});
+ return false;
+ });
+ }
+ $($t).triggerHandler("jqGridAddEditAfterShowForm", [$("#"+frmgr), frmoper]);
+ if(onAfterShow) { onAfterShow.call($t, $("#"+frmgr)); }
+ $(".fm-button","#"+$.jgrid.jqID(IDs.themodal)).hover(
+ function(){$(this).addClass('ui-state-hover');},
+ function(){$(this).removeClass('ui-state-hover');}
+ );
+ $("#sData", frmtb+"_2").click(function(){
+ postdata = {};extpost={};
+ $("#FormError",frmtb).hide();
+ // all depend on ret array
+ //ret[0] - succes
+ //ret[1] - msg if not succes
+ //ret[2] - the id that will be set if reload after submit false
+ getFormData();
+ if(postdata[$t.p.id+"_id"] == "_empty") {postIt();}
+ else if(p.checkOnSubmit===true ) {
+ newData = $.extend({},postdata,extpost);
+ diff = compareData(newData,rp_ge[$t.p.id]._savedData);
+ if(diff) {
+ $("#"+frmgr).data("disabled",true);
+ $(".confirm","#"+$.jgrid.jqID(IDs.themodal)).show();
+ } else {
+ postIt();
+ }
+ } else {
+ postIt();
+ }
+ return false;
+ });
+ $("#cData", frmtb+"_2").click(function(){
+ if(!checkUpdates()) {return false;}
+ $.jgrid.hideModal("#"+$.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+$.jgrid.jqID(gID),jqm:p.jqModal,onClose: rp_ge[$t.p.id].onClose});
+ return false;
+ });
+ $("#nData", frmtb+"_2").click(function(){
+ if(!checkUpdates()) {return false;}
+ $("#FormError",frmtb).hide();
+ var npos = getCurrPos();
+ npos[0] = parseInt(npos[0],10);
+ if(npos[0] != -1 && npos[1][npos[0]+1]) {
+ $($t).triggerHandler("jqGridAddEditClickPgButtons", ['next',$("#"+frmgr),npos[1][npos[0]]]);
+ var nposret = true;
+ if($.isFunction(p.onclickPgButtons)) {
+ nposret = p.onclickPgButtons.call($t, 'next',$("#"+frmgr),npos[1][npos[0]]);
+ if( nposret !== undefined && nposret === false ) {return false;}
+ }
+ if( $("#"+$.jgrid.jqID(npos[1][npos[0]+1])).hasClass('ui-state-disabled')) {return false;}
+ fillData(npos[1][npos[0]+1],$t,frmgr);
+ $($t).jqGrid("setSelection",npos[1][npos[0]+1]);
+ $($t).triggerHandler("jqGridAddEditAfterClickPgButtons", ['next',$("#"+frmgr),npos[1][npos[0]]]);
+ if($.isFunction(p.afterclickPgButtons)) {
+ p.afterclickPgButtons.call($t, 'next',$("#"+frmgr),npos[1][npos[0]+1]);
+ }
+ updateNav(npos[0]+1,npos[1].length-1);
+ }
+ return false;
+ });
+ $("#pData", frmtb+"_2").click(function(){
+ if(!checkUpdates()) {return false;}
+ $("#FormError",frmtb).hide();
+ var ppos = getCurrPos();
+ if(ppos[0] != -1 && ppos[1][ppos[0]-1]) {
+ $($t).triggerHandler("jqGridAddEditClickPgButtons", ['prev',$("#"+frmgr),ppos[1][ppos[0]]]);
+ var pposret = true;
+ if($.isFunction(p.onclickPgButtons)) {
+ pposret = p.onclickPgButtons.call($t, 'prev',$("#"+frmgr),ppos[1][ppos[0]]);
+ if( pposret !== undefined && pposret === false ) {return false;}
+ }
+ if( $("#"+$.jgrid.jqID(ppos[1][ppos[0]-1])).hasClass('ui-state-disabled')) {return false;}
+ fillData(ppos[1][ppos[0]-1],$t,frmgr);
+ $($t).jqGrid("setSelection",ppos[1][ppos[0]-1]);
+ $($t).triggerHandler("jqGridAddEditAfterClickPgButtons", ['prev',$("#"+frmgr),ppos[1][ppos[0]]]);
+ if($.isFunction(p.afterclickPgButtons)) {
+ p.afterclickPgButtons.call($t, 'prev',$("#"+frmgr),ppos[1][ppos[0]-1]);
+ }
+ updateNav(ppos[0]-1,ppos[1].length-1);
+ }
+ return false;
+ });
+ }
+ var posInit =getCurrPos();
+ updateNav(posInit[0],posInit[1].length-1);
+
+ });
+ },
+ viewGridRow : function(rowid, p){
+ p = $.extend({
+ top : 0,
+ left: 0,
+ width: 0,
+ height: 'auto',
+ dataheight: 'auto',
+ modal: false,
+ overlay: 30,
+ drag: true,
+ resize: true,
+ jqModal: true,
+ closeOnEscape : false,
+ labelswidth: '30%',
+ closeicon: [],
+ navkeys: [false,38,40],
+ onClose: null,
+ beforeShowForm : null,
+ beforeInitData : null,
+ viewPagerButtons : true
+ }, $.jgrid.view, p || {});
+ rp_ge[$(this)[0].p.id] = p;
+ return this.each(function(){
+ var $t = this;
+ if (!$t.grid || !rowid) {return;}
+ var gID = $t.p.id,
+ frmgr = "ViewGrid_"+$.jgrid.jqID( gID ), frmtb = "ViewTbl_" + $.jgrid.jqID( gID ),
+ frmgr_id = "ViewGrid_"+gID, frmtb_id = "ViewTbl_"+gID,
+ IDs = {themodal:'viewmod'+gID,modalhead:'viewhd'+gID,modalcontent:'viewcnt'+gID, scrollelm : frmgr},
+ onBeforeInit = $.isFunction(rp_ge[$t.p.id].beforeInitData) ? rp_ge[$t.p.id].beforeInitData : false,
+ showFrm = true,
+ maxCols = 1, maxRows=0;
+ function focusaref(){ //Sfari 3 issues
+ if(rp_ge[$t.p.id].closeOnEscape===true || rp_ge[$t.p.id].navkeys[0]===true) {
+ setTimeout(function(){$(".ui-jqdialog-titlebar-close","#"+$.jgrid.jqID(IDs.modalhead)).focus();},0);
+ }
+ }
+ function createData(rowid,obj,tb,maxcols){
+ var nm, hc,trdata, cnt=0,tmp, dc, retpos=[], ind=false,
+ tdtmpl = "<td class='CaptionTD form-view-label ui-widget-content' width='"+p.labelswidth+"'> </td><td class='DataTD form-view-data ui-helper-reset ui-widget-content'> </td>", tmpl="",
+ tdtmpl2 = "<td class='CaptionTD form-view-label ui-widget-content'> </td><td class='DataTD form-view-data ui-widget-content'> </td>",
+ fmtnum = ['integer','number','currency'],max1 =0, max2=0 ,maxw,setme, viewfld;
+ for (var i =1;i<=maxcols;i++) {
+ tmpl += i == 1 ? tdtmpl : tdtmpl2;
+ }
+ // find max number align rigth with property formatter
+ $(obj.p.colModel).each( function() {
+ if(this.editrules && this.editrules.edithidden === true) {
+ hc = false;
+ } else {
+ hc = this.hidden === true ? true : false;
+ }
+ if(!hc && this.align==='right') {
+ if(this.formatter && $.inArray(this.formatter,fmtnum) !== -1 ) {
+ max1 = Math.max(max1,parseInt(this.width,10));
+ } else {
+ max2 = Math.max(max2,parseInt(this.width,10));
+ }
+ }
+ });
+ maxw = max1 !==0 ? max1 : max2 !==0 ? max2 : 0;
+ ind = $(obj).jqGrid("getInd",rowid);
+ $(obj.p.colModel).each( function(i) {
+ nm = this.name;
+ setme = false;
+ // hidden fields are included in the form
+ if(this.editrules && this.editrules.edithidden === true) {
+ hc = false;
+ } else {
+ hc = this.hidden === true ? true : false;
+ }
+ dc = hc ? "style='display:none'" : "";
+ viewfld = (typeof this.viewable != 'boolean') ? true : this.viewable;
+ if ( nm !== 'cb' && nm !== 'subgrid' && nm !== 'rn' && viewfld) {
+ if(ind === false) {
+ tmp = "";
+ } else {
+ if(nm == obj.p.ExpandColumn && obj.p.treeGrid === true) {
+ tmp = $("td:eq("+i+")",obj.rows[ind]).text();
+ } else {
+ tmp = $("td:eq("+i+")",obj.rows[ind]).html();
+ }
+ }
+ setme = this.align === 'right' && maxw !==0 ? true : false;
+ var frmopt = $.extend({},{rowabove:false,rowcontent:''}, this.formoptions || {}),
+ rp = parseInt(frmopt.rowpos,10) || cnt+1,
+ cp = parseInt((parseInt(frmopt.colpos,10) || 1)*2,10);
+ if(frmopt.rowabove) {
+ var newdata = $("<tr><td class='contentinfo' colspan='"+(maxcols*2)+"'>"+frmopt.rowcontent+"</td></tr>");
+ $(tb).append(newdata);
+ newdata[0].rp = rp;
+ }
+ trdata = $(tb).find("tr[rowpos="+rp+"]");
+ if ( trdata.length===0 ) {
+ trdata = $("<tr "+dc+" rowpos='"+rp+"'></tr>").addClass("FormData").attr("id","trv_"+nm);
+ $(trdata).append(tmpl);
+ $(tb).append(trdata);
+ trdata[0].rp = rp;
+ }
+ $("td:eq("+(cp-2)+")",trdata[0]).html('<b>'+ (typeof frmopt.label === 'undefined' ? obj.p.colNames[i]: frmopt.label)+'</b>');
+ $("td:eq("+(cp-1)+")",trdata[0]).append("<span>"+tmp+"</span>").attr("id","v_"+nm);
+ if(setme){
+ $("td:eq("+(cp-1)+") span",trdata[0]).css({'text-align':'right',width:maxw+"px"});
+ }
+ retpos[cnt] = i;
+ cnt++;
+ }
+ });
+ if( cnt > 0) {
+ var idrow = $("<tr class='FormData' style='display:none'><td class='CaptionTD'></td><td colspan='"+ (maxcols*2-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='id' value='"+rowid+"'/></td></tr>");
+ idrow[0].rp = cnt+99;
+ $(tb).append(idrow);
+ }
+ return retpos;
+ }
+ function fillData(rowid,obj){
+ var nm, hc,cnt=0,tmp, opt,trv;
+ trv = $(obj).jqGrid("getInd",rowid,true);
+ if(!trv) {return;}
+ $('td',trv).each( function(i) {
+ nm = obj.p.colModel[i].name;
+ // hidden fields are included in the form
+ if(obj.p.colModel[i].editrules && obj.p.colModel[i].editrules.edithidden === true) {
+ hc = false;
+ } else {
+ hc = obj.p.colModel[i].hidden === true ? true : false;
+ }
+ if ( nm !== 'cb' && nm !== 'subgrid' && nm !== 'rn') {
+ if(nm == obj.p.ExpandColumn && obj.p.treeGrid === true) {
+ tmp = $(this).text();
+ } else {
+ tmp = $(this).html();
+ }
+ opt = $.extend({},obj.p.colModel[i].editoptions || {});
+ nm = $.jgrid.jqID("v_"+nm);
+ $("#"+nm+" span","#"+frmtb).html(tmp);
+ if (hc) {$("#"+nm,"#"+frmtb).parents("tr:first").hide();}
+ cnt++;
+ }
+ });
+ if(cnt>0) {$("#id_g","#"+frmtb).val(rowid);}
+ }
+ function updateNav(cr,totr){
+ if (cr===0) {$("#pData","#"+frmtb+"_2").addClass('ui-state-disabled');} else {$("#pData","#"+frmtb+"_2").removeClass('ui-state-disabled');}
+ if (cr==totr) {$("#nData","#"+frmtb+"_2").addClass('ui-state-disabled');} else {$("#nData","#"+frmtb+"_2").removeClass('ui-state-disabled');}
+ }
+ function getCurrPos() {
+ var rowsInGrid = $($t).jqGrid("getDataIDs"),
+ selrow = $("#id_g","#"+frmtb).val(),
+ pos = $.inArray(selrow,rowsInGrid);
+ return [pos,rowsInGrid];
+ }
+
+ if ( $("#"+$.jgrid.jqID(IDs.themodal))[0] !== undefined ) {
+ if(onBeforeInit) {
+ showFrm = onBeforeInit.call($t,$("#"+frmgr));
+ if(typeof(showFrm) == "undefined") {
+ showFrm = true;
+ }
+ }
+ if(showFrm === false) {return;}
+ $(".ui-jqdialog-title","#"+$.jgrid.jqID(IDs.modalhead)).html(p.caption);
+ $("#FormError","#"+frmtb).hide();
+ fillData(rowid,$t);
+ if($.isFunction(rp_ge[$t.p.id].beforeShowForm)) {rp_ge[$t.p.id].beforeShowForm.call($t,$("#"+frmgr));}
+ $.jgrid.viewModal("#"+$.jgrid.jqID(IDs.themodal),{gbox:"#gbox_"+$.jgrid.jqID(gID),jqm:p.jqModal, jqM: false, overlay: p.overlay, modal:p.modal});
+ focusaref();
+ } else {
+ var dh = isNaN(p.dataheight) ? p.dataheight : p.dataheight+"px";
+ var frm = $("<form name='FormPost' id='"+frmgr_id+"' class='FormGrid' style='width:100%;overflow:auto;position:relative;height:"+dh+";'></form>"),
+ tbl =$("<table id='"+frmtb_id+"' class='EditTable' cellspacing='1' cellpadding='2' border='0' style='table-layout:fixed'><tbody></tbody></table>");
+ if(onBeforeInit) {
+ showFrm = onBeforeInit.call($t,$("#"+frmgr));
+ if(typeof(showFrm) == "undefined") {
+ showFrm = true;
+ }
+ }
+ if(showFrm === false) {return;}
+ $($t.p.colModel).each( function() {
+ var fmto = this.formoptions;
+ maxCols = Math.max(maxCols, fmto ? fmto.colpos || 0 : 0 );
+ maxRows = Math.max(maxRows, fmto ? fmto.rowpos || 0 : 0 );
+ });
+ // set the id.
+ $(frm).append(tbl);
+ createData(rowid, $t, tbl, maxCols);
+ var rtlb = $t.p.direction == "rtl" ? true :false,
+ bp = rtlb ? "nData" : "pData",
+ bn = rtlb ? "pData" : "nData",
+
+ // buttons at footer
+ bP = "<a href='javascript:void(0)' id='"+bp+"' class='fm-button ui-state-default ui-corner-left'><span class='ui-icon ui-icon-triangle-1-w'></span></a>",
+ bN = "<a href='javascript:void(0)' id='"+bn+"' class='fm-button ui-state-default ui-corner-right'><span class='ui-icon ui-icon-triangle-1-e'></span></a>",
+ bC ="<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>"+p.bClose+"</a>";
+ if(maxRows > 0) {
+ var sd=[];
+ $.each($(tbl)[0].rows,function(i,r){
+ sd[i] = r;
+ });
+ sd.sort(function(a,b){
+ if(a.rp > b.rp) {return 1;}
+ if(a.rp < b.rp) {return -1;}
+ return 0;
+ });
+ $.each(sd, function(index, row) {
+ $('tbody',tbl).append(row);
+ });
+ }
+ p.gbox = "#gbox_"+$.jgrid.jqID(gID);
+ var bt = $("<span></span>").append(frm).append("<table border='0' class='EditTable' id='"+frmtb+"_2'><tbody><tr id='Act_Buttons'><td class='navButton' width='"+p.labelswidth+"'>"+(rtlb ? bN+bP : bP+bN)+"</td><td class='EditButton'>"+bC+"</td></tr></tbody></table>");
+ $.jgrid.createModal(IDs,bt,p,"#gview_"+$.jgrid.jqID($t.p.id),$("#gview_"+$.jgrid.jqID($t.p.id))[0]);
+ if(rtlb) {
+ $("#pData, #nData","#"+frmtb+"_2").css("float","right");
+ $(".EditButton","#"+frmtb+"_2").css("text-align","left");
+ }
+ if(!p.viewPagerButtons) {$("#pData, #nData","#"+frmtb+"_2").hide();}
+ bt = null;
+ $("#"+IDs.themodal).keydown( function( e ) {
+ if(e.which === 27) {
+ if(rp_ge[$t.p.id].closeOnEscape) {$.jgrid.hideModal(this,{gb:p.gbox,jqm:p.jqModal, onClose: p.onClose});}
+ return false;
+ }
+ if(p.navkeys[0]===true) {
+ if(e.which === p.navkeys[1]){ //up
+ $("#pData", "#"+frmtb+"_2").trigger("click");
+ return false;
+ }
+ if(e.which === p.navkeys[2]){ //down
+ $("#nData", "#"+frmtb+"_2").trigger("click");
+ return false;
+ }
+ }
+ });
+ p.closeicon = $.extend([true,"left","ui-icon-close"],p.closeicon);
+ if(p.closeicon[0]===true) {
+ $("#cData","#"+frmtb+"_2").addClass(p.closeicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
+ .append("<span class='ui-icon "+p.closeicon[2]+"'></span>");
+ }
+ if($.isFunction(p.beforeShowForm)) {p.beforeShowForm.call($t,$("#"+frmgr));}
+ $.jgrid.viewModal("#"+$.jgrid.jqID(IDs.themodal),{gbox:"#gbox_"+$.jgrid.jqID(gID),jqm:p.jqModal, modal:p.modal});
+ $(".fm-button:not(.ui-state-disabled)","#"+frmtb+"_2").hover(
+ function(){$(this).addClass('ui-state-hover');},
+ function(){$(this).removeClass('ui-state-hover');}
+ );
+ focusaref();
+ $("#cData", "#"+frmtb+"_2").click(function(){
+ $.jgrid.hideModal("#"+$.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+$.jgrid.jqID(gID),jqm:p.jqModal, onClose: p.onClose});
+ return false;
+ });
+ $("#nData", "#"+frmtb+"_2").click(function(){
+ $("#FormError","#"+frmtb).hide();
+ var npos = getCurrPos();
+ npos[0] = parseInt(npos[0],10);
+ if(npos[0] != -1 && npos[1][npos[0]+1]) {
+ if($.isFunction(p.onclickPgButtons)) {
+ p.onclickPgButtons.call($t,'next',$("#"+frmgr),npos[1][npos[0]]);
+ }
+ fillData(npos[1][npos[0]+1],$t);
+ $($t).jqGrid("setSelection",npos[1][npos[0]+1]);
+ if($.isFunction(p.afterclickPgButtons)) {
+ p.afterclickPgButtons.call($t,'next',$("#"+frmgr),npos[1][npos[0]+1]);
+ }
+ updateNav(npos[0]+1,npos[1].length-1);
+ }
+ focusaref();
+ return false;
+ });
+ $("#pData", "#"+frmtb+"_2").click(function(){
+ $("#FormError","#"+frmtb).hide();
+ var ppos = getCurrPos();
+ if(ppos[0] != -1 && ppos[1][ppos[0]-1]) {
+ if($.isFunction(p.onclickPgButtons)) {
+ p.onclickPgButtons.call($t,'prev',$("#"+frmgr),ppos[1][ppos[0]]);
+ }
+ fillData(ppos[1][ppos[0]-1],$t);
+ $($t).jqGrid("setSelection",ppos[1][ppos[0]-1]);
+ if($.isFunction(p.afterclickPgButtons)) {
+ p.afterclickPgButtons.call($t,'prev',$("#"+frmgr),ppos[1][ppos[0]-1]);
+ }
+ updateNav(ppos[0]-1,ppos[1].length-1);
+ }
+ focusaref();
+ return false;
+ });
+ }
+ var posInit =getCurrPos();
+ updateNav(posInit[0],posInit[1].length-1);
+ });
+ },
+ delGridRow : function(rowids,p) {
+ p = $.extend({
+ top : 0,
+ left: 0,
+ width: 240,
+ height: 'auto',
+ dataheight : 'auto',
+ modal: false,
+ overlay: 30,
+ drag: true,
+ resize: true,
+ url : '',
+ mtype : "POST",
+ reloadAfterSubmit: true,
+ beforeShowForm: null,
+ beforeInitData : null,
+ afterShowForm: null,
+ beforeSubmit: null,
+ onclickSubmit: null,
+ afterSubmit: null,
+ jqModal : true,
+ closeOnEscape : false,
+ delData: {},
+ delicon : [],
+ cancelicon : [],
+ onClose : null,
+ ajaxDelOptions : {},
+ processing : false,
+ serializeDelData : null,
+ useDataProxy : false
+ }, $.jgrid.del, p ||{});
+ rp_ge[$(this)[0].p.id] = p;
+ return this.each(function(){
+ var $t = this;
+ if (!$t.grid ) {return;}
+ if(!rowids) {return;}
+ var onBeforeShow = $.isFunction( rp_ge[$t.p.id].beforeShowForm ),
+ onAfterShow = $.isFunction( rp_ge[$t.p.id].afterShowForm ),
+ onBeforeInit = $.isFunction(rp_ge[$t.p.id].beforeInitData) ? rp_ge[$t.p.id].beforeInitData : false,
+ gID = $t.p.id, onCS = {},
+ showFrm = true,
+ dtbl = "DelTbl_"+$.jgrid.jqID(gID),postd, idname, opers, oper,
+ dtbl_id = "DelTbl_" + gID,
+ IDs = {themodal:'delmod'+gID,modalhead:'delhd'+gID,modalcontent:'delcnt'+gID, scrollelm: dtbl};
+ if (jQuery.isArray(rowids)) {rowids = rowids.join();}
+ if ( $("#"+$.jgrid.jqID(IDs.themodal))[0] !== undefined ) {
+ if(onBeforeInit) {
+ showFrm = onBeforeInit.call($t,$("#"+dtbl));
+ if(typeof(showFrm) == "undefined") {
+ showFrm = true;
+ }
+ }
+ if(showFrm === false) {return;}
+ $("#DelData>td","#"+dtbl).text(rowids);
+ $("#DelError","#"+dtbl).hide();
+ if( rp_ge[$t.p.id].processing === true) {
+ rp_ge[$t.p.id].processing=false;
+ $("#dData", "#"+dtbl).removeClass('ui-state-active');
+ }
+ if(onBeforeShow) {rp_ge[$t.p.id].beforeShowForm.call($t,$("#"+dtbl));}
+ $.jgrid.viewModal("#"+$.jgrid.jqID(IDs.themodal),{gbox:"#gbox_"+$.jgrid.jqID(gID),jqm:rp_ge[$t.p.id].jqModal,jqM: false, overlay: rp_ge[$t.p.id].overlay, modal:rp_ge[$t.p.id].modal});
+ if(onAfterShow) {rp_ge[$t.p.id].afterShowForm.call($t,$("#"+dtbl));}
+ } else {
+ var dh = isNaN(rp_ge[$t.p.id].dataheight) ? rp_ge[$t.p.id].dataheight : rp_ge[$t.p.id].dataheight+"px";
+ var tbl = "<div id='"+dtbl_id+"' class='formdata' style='width:100%;overflow:auto;position:relative;height:"+dh+";'>";
+ tbl += "<table class='DelTable'><tbody>";
+ // error data
+ tbl += "<tr id='DelError' style='display:none'><td class='ui-state-error'></td></tr>";
+ tbl += "<tr id='DelData' style='display:none'><td >"+rowids+"</td></tr>";
+ tbl += "<tr><td class=\"delmsg\" style=\"white-space:pre;\">"+rp_ge[$t.p.id].msg+"</td></tr><tr><td > </td></tr>";
+ // buttons at footer
+ tbl += "</tbody></table></div>";
+ var bS = "<a href='javascript:void(0)' id='dData' class='fm-button ui-state-default ui-corner-all'>"+p.bSubmit+"</a>",
+ bC = "<a href='javascript:void(0)' id='eData' class='fm-button ui-state-default ui-corner-all'>"+p.bCancel+"</a>";
+ tbl += "<table cellspacing='0' cellpadding='0' border='0' class='EditTable' id='"+dtbl+"_2'><tbody><tr><td><hr class='ui-widget-content' style='margin:1px'/></td></tr><tr><td class='DelButton EditButton'>"+bS+" "+bC+"</td></tr></tbody></table>";
+ p.gbox = "#gbox_"+$.jgrid.jqID(gID);
+ $.jgrid.createModal(IDs,tbl,p,"#gview_"+$.jgrid.jqID($t.p.id),$("#gview_"+$.jgrid.jqID($t.p.id))[0]);
+
+ if(onBeforeInit) {
+ showFrm = onBeforeInit.call($t,$("#"+dtbl));
+ if(typeof(showFrm) == "undefined") {
+ showFrm = true;
+ }
+ }
+ if(showFrm === false) {return;}
+
+ $(".fm-button","#"+dtbl+"_2").hover(
+ function(){$(this).addClass('ui-state-hover');},
+ function(){$(this).removeClass('ui-state-hover');}
+ );
+ p.delicon = $.extend([true,"left","ui-icon-scissors"],rp_ge[$t.p.id].delicon);
+ p.cancelicon = $.extend([true,"left","ui-icon-cancel"],rp_ge[$t.p.id].cancelicon);
+ if(p.delicon[0]===true) {
+ $("#dData","#"+dtbl+"_2").addClass(p.delicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
+ .append("<span class='ui-icon "+p.delicon[2]+"'></span>");
+ }
+ if(p.cancelicon[0]===true) {
+ $("#eData","#"+dtbl+"_2").addClass(p.cancelicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
+ .append("<span class='ui-icon "+p.cancelicon[2]+"'></span>");
+ }
+ $("#dData","#"+dtbl+"_2").click(function(){
+ var ret=[true,""];onCS = {};
+ var postdata = $("#DelData>td","#"+dtbl).text(); //the pair is name=val1,val2,...
+ if( $.isFunction( rp_ge[$t.p.id].onclickSubmit ) ) {onCS = rp_ge[$t.p.id].onclickSubmit.call($t,rp_ge[$t.p.id], postdata) || {};}
+ if( $.isFunction( rp_ge[$t.p.id].beforeSubmit ) ) {ret = rp_ge[$t.p.id].beforeSubmit.call($t,postdata);}
+ if(ret[0] && !rp_ge[$t.p.id].processing) {
+ rp_ge[$t.p.id].processing = true;
+ opers = $t.p.prmNames;
+ postd = $.extend({},rp_ge[$t.p.id].delData, onCS);
+ oper = opers.oper;
+ postd[oper] = opers.deloper;
+ idname = opers.id;
+ postdata = String(postdata).split(",");
+ if(!postdata.length) { return false; }
+ for( var pk in postdata) {
+ if(postdata.hasOwnProperty(pk)) {
+ postdata[pk] = $.jgrid.stripPref($t.p.idPrefix, postdata[pk]);
+ }
+ }
+ postd[idname] = postdata.join();
+ $(this).addClass('ui-state-active');
+ var ajaxOptions = $.extend({
+ url: rp_ge[$t.p.id].url ? rp_ge[$t.p.id].url : $($t).jqGrid('getGridParam','editurl'),
+ type: rp_ge[$t.p.id].mtype,
+ data: $.isFunction(rp_ge[$t.p.id].serializeDelData) ? rp_ge[$t.p.id].serializeDelData.call($t,postd) : postd,
+ complete:function(data,Status){
+ if(Status != "success") {
+ ret[0] = false;
+ if ($.isFunction(rp_ge[$t.p.id].errorTextFormat)) {
+ ret[1] = rp_ge[$t.p.id].errorTextFormat.call($t,data);
+ } else {
+ ret[1] = Status + " Status: '" + data.statusText + "'. Error code: " + data.status;
+ }
+ } else {
+ // data is posted successful
+ // execute aftersubmit with the returned data from server
+ if( $.isFunction( rp_ge[$t.p.id].afterSubmit ) ) {
+ ret = rp_ge[$t.p.id].afterSubmit.call($t,data,postd);
+ }
+ }
+ if(ret[0] === false) {
+ $("#DelError>td","#"+dtbl).html(ret[1]);
+ $("#DelError","#"+dtbl).show();
+ } else {
+ if(rp_ge[$t.p.id].reloadAfterSubmit && $t.p.datatype != "local") {
+ $($t).trigger("reloadGrid");
+ } else {
+ if($t.p.treeGrid===true){
+ try {$($t).jqGrid("delTreeNode",$t.p.idPrefix+postdata[0]);} catch(e){}
+ } else {
+ for(var i=0;i<postdata.length;i++) {
+ $($t).jqGrid("delRowData",$t.p.idPrefix+ postdata[i]);
+ }
+ }
+ $t.p.selrow = null;
+ $t.p.selarrrow = [];
+ }
+ if($.isFunction(rp_ge[$t.p.id].afterComplete)) {
+ setTimeout(function(){rp_ge[$t.p.id].afterComplete.call($t,data,postdata);},500);
+ }
+ }
+ rp_ge[$t.p.id].processing=false;
+ $("#dData", "#"+dtbl+"_2").removeClass('ui-state-active');
+ if(ret[0]) {$.jgrid.hideModal("#"+$.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+$.jgrid.jqID(gID),jqm:p.jqModal, onClose: rp_ge[$t.p.id].onClose});}
+ }
+ }, $.jgrid.ajaxOptions, rp_ge[$t.p.id].ajaxDelOptions);
+
+
+ if (!ajaxOptions.url && !rp_ge[$t.p.id].useDataProxy) {
+ if ($.isFunction($t.p.dataProxy)) {
+ rp_ge[$t.p.id].useDataProxy = true;
+ } else {
+ ret[0]=false;ret[1] += " "+$.jgrid.errors.nourl;
+ }
+ }
+ if (ret[0]) {
+ if (rp_ge[$t.p.id].useDataProxy) {
+ var dpret = $t.p.dataProxy.call($t, ajaxOptions, "del_"+$t.p.id);
+ if(typeof(dpret) == "undefined") {
+ dpret = [true, ""];
+ }
+ if(dpret[0] === false ) {
+ ret[0] = false;
+ ret[1] = dpret[1] || "Error deleting the selected row!" ;
+ } else {
+ $.jgrid.hideModal("#"+$.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+$.jgrid.jqID(gID),jqm:p.jqModal, onClose: rp_ge[$t.p.id].onClose});
+ }
+ }
+ else {$.ajax(ajaxOptions);}
+ }
+ }
+
+ if(ret[0] === false) {
+ $("#DelError>td","#"+dtbl).html(ret[1]);
+ $("#DelError","#"+dtbl).show();
+ }
+ return false;
+ });
+ $("#eData", "#"+dtbl+"_2").click(function(){
+ $.jgrid.hideModal("#"+$.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+$.jgrid.jqID(gID),jqm:rp_ge[$t.p.id].jqModal, onClose: rp_ge[$t.p.id].onClose});
+ return false;
+ });
+ if(onBeforeShow) {rp_ge[$t.p.id].beforeShowForm.call($t,$("#"+dtbl));}
+ $.jgrid.viewModal("#"+$.jgrid.jqID(IDs.themodal),{gbox:"#gbox_"+$.jgrid.jqID(gID),jqm:rp_ge[$t.p.id].jqModal, overlay: rp_ge[$t.p.id].overlay, modal:rp_ge[$t.p.id].modal});
+ if(onAfterShow) {rp_ge[$t.p.id].afterShowForm.call($t,$("#"+dtbl));}
+ }
+ if(rp_ge[$t.p.id].closeOnEscape===true) {
+ setTimeout(function(){$(".ui-jqdialog-titlebar-close","#"+$.jgrid.jqID(IDs.modalhead)).focus();},0);
+ }
+ });
+ },
+ navGrid : function (elem, o, pEdit,pAdd,pDel,pSearch, pView) {
+ o = $.extend({
+ edit: true,
+ editicon: "ui-icon-pencil",
+ add: true,
+ addicon:"ui-icon-plus",
+ del: true,
+ delicon:"ui-icon-trash",
+ search: true,
+ searchicon:"ui-icon-search",
+ refresh: true,
+ refreshicon:"ui-icon-refresh",
+ refreshstate: 'firstpage',
+ view: false,
+ viewicon : "ui-icon-document",
+ position : "left",
+ closeOnEscape : true,
+ beforeRefresh : null,
+ afterRefresh : null,
+ cloneToTop : false,
+ alertwidth : 200,
+ alertheight : 'auto',
+ alerttop: null,
+ alertleft: null,
+ alertzIndex : null
+ }, $.jgrid.nav, o ||{});
+ return this.each(function() {
+ if(this.nav) {return;}
+ var alertIDs = {themodal:'alertmod',modalhead:'alerthd',modalcontent:'alertcnt'},
+ $t = this, twd, tdw;
+ if(!$t.grid || typeof elem != 'string') {return;}
+ if ($("#"+alertIDs.themodal)[0] === undefined) {
+ if(!o.alerttop && !o.alertleft) {
+ if (typeof window.innerWidth != 'undefined') {
+ o.alertleft = window.innerWidth;
+ o.alerttop = window.innerHeight;
+ } else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth !== 0) {
+ o.alertleft = document.documentElement.clientWidth;
+ o.alerttop = document.documentElement.clientHeight;
+ } else {
+ o.alertleft=1024;
+ o.alerttop=768;
+ }
+ o.alertleft = o.alertleft/2 - parseInt(o.alertwidth,10)/2;
+ o.alerttop = o.alerttop/2-25;
+ }
+ $.jgrid.createModal(alertIDs,"<div>"+o.alerttext+"</div><span tabindex='0'><span tabindex='-1' id='jqg_alrt'></span></span>",{gbox:"#gbox_"+$.jgrid.jqID($t.p.id),jqModal:true,drag:true,resize:true,caption:o.alertcap,top:o.alerttop,left:o.alertleft,width:o.alertwidth,height: o.alertheight,closeOnEscape:o.closeOnEscape, zIndex: o.alertzIndex},"","",true);
+ }
+ var clone = 1;
+ if(o.cloneToTop && $t.p.toppager) {clone = 2;}
+ for(var i = 0; i<clone; i++) {
+ var tbd,
+ navtbl = $("<table cellspacing='0' cellpadding='0' border='0' class='ui-pg-table navtable' style='float:left;table-layout:auto;'><tbody><tr></tr></tbody></table>"),
+ sep = "<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>",
+ pgid, elemids;
+ if(i===0) {
+ pgid = elem;
+ elemids = $t.p.id;
+ if(pgid == $t.p.toppager) {
+ elemids += "_top";
+ clone = 1;
+ }
+ } else {
+ pgid = $t.p.toppager;
+ elemids = $t.p.id+"_top";
+ }
+ if($t.p.direction == "rtl") {$(navtbl).attr("dir","rtl").css("float","right");}
+ if (o.add) {
+ pAdd = pAdd || {};
+ tbd = $("<td class='ui-pg-button ui-corner-all'></td>");
+ $(tbd).append("<div class='ui-pg-div'><span class='ui-icon "+o.addicon+"'></span>"+o.addtext+"</div>");
+ $("tr",navtbl).append(tbd);
+ $(tbd,navtbl)
+ .attr({"title":o.addtitle || "",id : pAdd.id || "add_"+elemids})
+ .click(function(){
+ if (!$(this).hasClass('ui-state-disabled')) {
+ if ($.isFunction( o.addfunc )) {
+ o.addfunc.call($t);
+ } else {
+ $($t).jqGrid("editGridRow","new",pAdd);
+ }
+ }
+ return false;
+ }).hover(
+ function () {
+ if (!$(this).hasClass('ui-state-disabled')) {
+ $(this).addClass("ui-state-hover");
+ }
+ },
+ function () {$(this).removeClass("ui-state-hover");}
+ );
+ tbd = null;
+ }
+ if (o.edit) {
+ tbd = $("<td class='ui-pg-button ui-corner-all'></td>");
+ pEdit = pEdit || {};
+ $(tbd).append("<div class='ui-pg-div'><span class='ui-icon "+o.editicon+"'></span>"+o.edittext+"</div>");
+ $("tr",navtbl).append(tbd);
+ $(tbd,navtbl)
+ .attr({"title":o.edittitle || "",id: pEdit.id || "edit_"+elemids})
+ .click(function(){
+ if (!$(this).hasClass('ui-state-disabled')) {
+ var sr = $t.p.selrow;
+ if (sr) {
+ if($.isFunction( o.editfunc ) ) {
+ o.editfunc.call($t, sr);
+ } else {
+ $($t).jqGrid("editGridRow",sr,pEdit);
+ }
+ } else {
+ $.jgrid.viewModal("#"+alertIDs.themodal,{gbox:"#gbox_"+$.jgrid.jqID($t.p.id),jqm:true});
+ $("#jqg_alrt").focus();
+ }
+ }
+ return false;
+ }).hover(
+ function () {
+ if (!$(this).hasClass('ui-state-disabled')) {
+ $(this).addClass("ui-state-hover");
+ }
+ },
+ function () {$(this).removeClass("ui-state-hover");}
+ );
+ tbd = null;
+ }
+ if (o.view) {
+ tbd = $("<td class='ui-pg-button ui-corner-all'></td>");
+ pView = pView || {};
+ $(tbd).append("<div class='ui-pg-div'><span class='ui-icon "+o.viewicon+"'></span>"+o.viewtext+"</div>");
+ $("tr",navtbl).append(tbd);
+ $(tbd,navtbl)
+ .attr({"title":o.viewtitle || "",id: pView.id || "view_"+elemids})
+ .click(function(){
+ if (!$(this).hasClass('ui-state-disabled')) {
+ var sr = $t.p.selrow;
+ if (sr) {
+ if($.isFunction( o.viewfunc ) ) {
+ o.viewfunc.call($t, sr);
+ } else {
+ $($t).jqGrid("viewGridRow",sr,pView);
+ }
+ } else {
+ $.jgrid.viewModal("#"+alertIDs.themodal,{gbox:"#gbox_"+$.jgrid.jqID($t.p.id),jqm:true});
+ $("#jqg_alrt").focus();
+ }
+ }
+ return false;
+ }).hover(
+ function () {
+ if (!$(this).hasClass('ui-state-disabled')) {
+ $(this).addClass("ui-state-hover");
+ }
+ },
+ function () {$(this).removeClass("ui-state-hover");}
+ );
+ tbd = null;
+ }
+ if (o.del) {
+ tbd = $("<td class='ui-pg-button ui-corner-all'></td>");
+ pDel = pDel || {};
+ $(tbd).append("<div class='ui-pg-div'><span class='ui-icon "+o.delicon+"'></span>"+o.deltext+"</div>");
+ $("tr",navtbl).append(tbd);
+ $(tbd,navtbl)
+ .attr({"title":o.deltitle || "",id: pDel.id || "del_"+elemids})
+ .click(function(){
+ if (!$(this).hasClass('ui-state-disabled')) {
+ var dr;
+ if($t.p.multiselect) {
+ dr = $t.p.selarrrow;
+ if(dr.length===0) {dr = null;}
+ } else {
+ dr = $t.p.selrow;
+ }
+ if(dr){
+ if($.isFunction( o.delfunc )){
+ o.delfunc.call($t, dr);
+ }else{
+ $($t).jqGrid("delGridRow",dr,pDel);
+ }
+ } else {
+ $.jgrid.viewModal("#"+alertIDs.themodal,{gbox:"#gbox_"+$.jgrid.jqID($t.p.id),jqm:true});$("#jqg_alrt").focus();
+ }
+ }
+ return false;
+ }).hover(
+ function () {
+ if (!$(this).hasClass('ui-state-disabled')) {
+ $(this).addClass("ui-state-hover");
+ }
+ },
+ function () {$(this).removeClass("ui-state-hover");}
+ );
+ tbd = null;
+ }
+ if(o.add || o.edit || o.del || o.view) {$("tr",navtbl).append(sep);}
+ if (o.search) {
+ tbd = $("<td class='ui-pg-button ui-corner-all'></td>");
+ pSearch = pSearch || {};
+ $(tbd).append("<div class='ui-pg-div'><span class='ui-icon "+o.searchicon+"'></span>"+o.searchtext+"</div>");
+ $("tr",navtbl).append(tbd);
+ $(tbd,navtbl)
+ .attr({"title":o.searchtitle || "",id:pSearch.id || "search_"+elemids})
+ .click(function(){
+ if (!$(this).hasClass('ui-state-disabled')) {
+ if($.isFunction( o.searchfunc )) {
+ o.searchfunc.call($t, pSearch);
+ } else {
+ $($t).jqGrid("searchGrid",pSearch);
+ }
+ }
+ return false;
+ }).hover(
+ function () {
+ if (!$(this).hasClass('ui-state-disabled')) {
+ $(this).addClass("ui-state-hover");
+ }
+ },
+ function () {$(this).removeClass("ui-state-hover");}
+ );
+ if (pSearch.showOnLoad && pSearch.showOnLoad === true) {
+ $(tbd,navtbl).click();
+ }
+ tbd = null;
+ }
+ if (o.refresh) {
+ tbd = $("<td class='ui-pg-button ui-corner-all'></td>");
+ $(tbd).append("<div class='ui-pg-div'><span class='ui-icon "+o.refreshicon+"'></span>"+o.refreshtext+"</div>");
+ $("tr",navtbl).append(tbd);
+ $(tbd,navtbl)
+ .attr({"title":o.refreshtitle || "",id: "refresh_"+elemids})
+ .click(function(){
+ if (!$(this).hasClass('ui-state-disabled')) {
+ if($.isFunction(o.beforeRefresh)) {o.beforeRefresh.call($t);}
+ $t.p.search = false;
+ try {
+ var gID = $t.p.id;
+ $t.p.postData.filters ="";
+ $("#fbox_"+$.jgrid.jqID(gID)).jqFilter('resetFilter');
+ if($.isFunction($t.clearToolbar)) {$t.clearToolbar.call($t,false);}
+ } catch (e) {}
+ switch (o.refreshstate) {
+ case 'firstpage':
+ $($t).trigger("reloadGrid", [{page:1}]);
+ break;
+ case 'current':
+ $($t).trigger("reloadGrid", [{current:true}]);
+ break;
+ }
+ if($.isFunction(o.afterRefresh)) {o.afterRefresh.call($t);}
+ }
+ return false;
+ }).hover(
+ function () {
+ if (!$(this).hasClass('ui-state-disabled')) {
+ $(this).addClass("ui-state-hover");
+ }
+ },
+ function () {$(this).removeClass("ui-state-hover");}
+ );
+ tbd = null;
+ }
+ tdw = $(".ui-jqgrid").css("font-size") || "11px";
+ $('body').append("<div id='testpg2' class='ui-jqgrid ui-widget ui-widget-content' style='font-size:"+tdw+";visibility:hidden;' ></div>");
+ twd = $(navtbl).clone().appendTo("#testpg2").width();
+ $("#testpg2").remove();
+ $(pgid+"_"+o.position,pgid).append(navtbl);
+ if($t.p._nvtd) {
+ if(twd > $t.p._nvtd[0] ) {
+ $(pgid+"_"+o.position,pgid).width(twd);
+ $t.p._nvtd[0] = twd;
+ }
+ $t.p._nvtd[1] = twd;
+ }
+ tdw =null;twd=null;navtbl =null;
+ this.nav = true;
+ }
+ });
+ },
+ navButtonAdd : function (elem, p) {
+ p = $.extend({
+ caption : "newButton",
+ title: '',
+ buttonicon : 'ui-icon-newwin',
+ onClickButton: null,
+ position : "last",
+ cursor : 'pointer'
+ }, p ||{});
+ return this.each(function() {
+ if( !this.grid) {return;}
+ if( typeof elem === "string" && elem.indexOf("#") !== 0) {elem = "#"+$.jgrid.jqID(elem);}
+ var findnav = $(".navtable",elem)[0], $t = this;
+ if (findnav) {
+ if( p.id && $("#"+$.jgrid.jqID(p.id), findnav)[0] !== undefined ) {return;}
+ var tbd = $("<td></td>");
+ if(p.buttonicon.toString().toUpperCase() == "NONE") {
+ $(tbd).addClass('ui-pg-button ui-corner-all').append("<div class='ui-pg-div'>"+p.caption+"</div>");
+ } else {
+ $(tbd).addClass('ui-pg-button ui-corner-all').append("<div class='ui-pg-div'><span class='ui-icon "+p.buttonicon+"'></span>"+p.caption+"</div>");
+ }
+ if(p.id) {$(tbd).attr("id",p.id);}
+ if(p.position=='first'){
+ if(findnav.rows[0].cells.length ===0 ) {
+ $("tr",findnav).append(tbd);
+ } else {
+ $("tr td:eq(0)",findnav).before(tbd);
+ }
+ } else {
+ $("tr",findnav).append(tbd);
+ }
+ $(tbd,findnav)
+ .attr("title",p.title || "")
+ .click(function(e){
+ if (!$(this).hasClass('ui-state-disabled')) {
+ if ($.isFunction(p.onClickButton) ) {p.onClickButton.call($t,e);}
+ }
+ return false;
+ })
+ .hover(
+ function () {
+ if (!$(this).hasClass('ui-state-disabled')) {
+ $(this).addClass('ui-state-hover');
+ }
+ },
+ function () {$(this).removeClass("ui-state-hover");}
+ );
+ }
+ });
+ },
+ navSeparatorAdd:function (elem,p) {
+ p = $.extend({
+ sepclass : "ui-separator",
+ sepcontent: ''
+ }, p ||{});
+ return this.each(function() {
+ if( !this.grid) {return;}
+ if( typeof elem === "string" && elem.indexOf("#") !== 0) {elem = "#"+$.jgrid.jqID(elem);}
+ var findnav = $(".navtable",elem)[0];
+ if(findnav) {
+ var sep = "<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='"+p.sepclass+"'></span>"+p.sepcontent+"</td>";
+ $("tr",findnav).append(sep);
+ }
+ });
+ },
+ GridToForm : function( rowid, formid ) {
+ return this.each(function(){
+ var $t = this;
+ if (!$t.grid) {return;}
+ var rowdata = $($t).jqGrid("getRowData",rowid);
+ if (rowdata) {
+ for(var i in rowdata) {
+ if ( $("[name="+$.jgrid.jqID(i)+"]",formid).is("input:radio") || $("[name="+$.jgrid.jqID(i)+"]",formid).is("input:checkbox")) {
+ $("[name="+$.jgrid.jqID(i)+"]",formid).each( function() {
+ if( $(this).val() == rowdata[i] ) {
+ $(this)[$t.p.useProp ? 'prop': 'attr']("checked",true);
+ } else {
+ $(this)[$t.p.useProp ? 'prop': 'attr']("checked", false);
+ }
+ });
+ } else {
+ // this is very slow on big table and form.
+ $("[name="+$.jgrid.jqID(i)+"]",formid).val(rowdata[i]);
+ }
+ }
+ }
+ });
+ },
+ FormToGrid : function(rowid, formid, mode, position){
+ return this.each(function() {
+ var $t = this;
+ if(!$t.grid) {return;}
+ if(!mode) {mode = 'set';}
+ if(!position) {position = 'first';}
+ var fields = $(formid).serializeArray();
+ var griddata = {};
+ $.each(fields, function(i, field){
+ griddata[field.name] = field.value;
+ });
+ if(mode=='add') {$($t).jqGrid("addRowData",rowid,griddata, position);}
+ else if(mode=='set') {$($t).jqGrid("setRowData",rowid,griddata);}
+ });
+ }
+});
+})(jQuery);
+;(function($){
+/**
+ * jqGrid extension for manipulating Grid Data
+ * Tony Tomov tony(a)trirand.com
+ * http://trirand.com/blog/
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl-2.0.html
+**/
+//jsHint options
+/*global alert, $, jQuery */
+"use strict";
+$.jgrid.inlineEdit = $.jgrid.inlineEdit || {};
+$.jgrid.extend({
+//Editing
+ editRow : function(rowid,keys,oneditfunc,successfunc, url, extraparam, aftersavefunc,errorfunc, afterrestorefunc) {
+ // Compatible mode old versions
+ var o={}, args = $.makeArray(arguments).slice(1);
+
+ if( $.type(args[0]) === "object" ) {
+ o = args[0];
+ } else {
+ if (typeof keys !== "undefined") { o.keys = keys; }
+ if ($.isFunction(oneditfunc)) { o.oneditfunc = oneditfunc; }
+ if ($.isFunction(successfunc)) { o.successfunc = successfunc; }
+ if (typeof url !== "undefined") { o.url = url; }
+ if (typeof extraparam !== "undefined") { o.extraparam = extraparam; }
+ if ($.isFunction(aftersavefunc)) { o.aftersavefunc = aftersavefunc; }
+ if ($.isFunction(errorfunc)) { o.errorfunc = errorfunc; }
+ if ($.isFunction(afterrestorefunc)) { o.afterrestorefunc = afterrestorefunc; }
+ // last two not as param, but as object (sorry)
+ //if (typeof restoreAfterError !== "undefined") { o.restoreAfterError = restoreAfterError; }
+ //if (typeof mtype !== "undefined") { o.mtype = mtype || "POST"; }
+ }
+ o = $.extend(true, {
+ keys : false,
+ oneditfunc: null,
+ successfunc: null,
+ url: null,
+ extraparam: {},
+ aftersavefunc: null,
+ errorfunc: null,
+ afterrestorefunc: null,
+ restoreAfterError: true,
+ mtype: "POST"
+ }, $.jgrid.inlineEdit, o );
+
+ // End compatible
+ return this.each(function(){
+ var $t = this, nm, tmp, editable, cnt=0, focus=null, svr={}, ind,cm;
+ if (!$t.grid ) { return; }
+ ind = $($t).jqGrid("getInd",rowid,true);
+ if( ind === false ) {return;}
+ editable = $(ind).attr("editable") || "0";
+ if (editable == "0" && !$(ind).hasClass("not-editable-row")) {
+ cm = $t.p.colModel;
+ $('td[role="gridcell"]',ind).each( function(i) {
+ nm = cm[i].name;
+ var treeg = $t.p.treeGrid===true && nm == $t.p.ExpandColumn;
+ if(treeg) { tmp = $("span:first",this).html();}
+ else {
+ try {
+ tmp = $.unformat.call($t,this,{rowId:rowid, colModel:cm[i]},i);
+ } catch (_) {
+ tmp = ( cm[i].edittype && cm[i].edittype == 'textarea' ) ? $(this).text() : $(this).html();
+ }
+ }
+ if ( nm != 'cb' && nm != 'subgrid' && nm != 'rn') {
+ if($t.p.autoencode) { tmp = $.jgrid.htmlDecode(tmp); }
+ svr[nm]=tmp;
+ if(cm[i].editable===true) {
+ if(focus===null) { focus = i; }
+ if (treeg) { $("span:first",this).html(""); }
+ else { $(this).html(""); }
+ var opt = $.extend({},cm[i].editoptions || {},{id:rowid+"_"+nm,name:nm});
+ if(!cm[i].edittype) { cm[i].edittype = "text"; }
+ if(tmp == " " || tmp == " " || (tmp.length==1 && tmp.charCodeAt(0)==160) ) {tmp='';}
+ var elc = $.jgrid.createEl.call($t,cm[i].edittype,opt,tmp,true,$.extend({},$.jgrid.ajaxOptions,$t.p.ajaxSelectOptions || {}));
+ $(elc).addClass("editable");
+ if(treeg) { $("span:first",this).append(elc); }
+ else { $(this).append(elc); }
+ //Again IE
+ if(cm[i].edittype == "select" && typeof(cm[i].editoptions)!=="undefined" && cm[i].editoptions.multiple===true && typeof(cm[i].editoptions.dataUrl)==="undefined" && $.browser.msie) {
+ $(elc).width($(elc).width());
+ }
+ cnt++;
+ }
+ }
+ });
+ if(cnt > 0) {
+ svr.id = rowid; $t.p.savedRow.push(svr);
+ $(ind).attr("editable","1");
+ $("td:eq("+focus+") input",ind).focus();
+ if(o.keys===true) {
+ $(ind).bind("keydown",function(e) {
+ if (e.keyCode === 27) {
+ $($t).jqGrid("restoreRow",rowid, o.afterrestorefunc);
+ if($t.p._inlinenav) {
+ try {
+ $($t).jqGrid('showAddEditButtons');
+ } catch (eer1) {}
+ }
+ return false;
+ }
+ if (e.keyCode === 13) {
+ var ta = e.target;
+ if(ta.tagName == 'TEXTAREA') { return true; }
+ if( $($t).jqGrid("saveRow", rowid, o ) ) {
+ if($t.p._inlinenav) {
+ try {
+ $($t).jqGrid('showAddEditButtons');
+ } catch (eer2) {}
+ }
+ }
+ return false;
+ }
+ });
+ }
+ $($t).triggerHandler("jqGridInlineEditRow", [rowid, o]);
+ if( $.isFunction(o.oneditfunc)) { o.oneditfunc.call($t, rowid); }
+ }
+ }
+ });
+ },
+ saveRow : function(rowid, successfunc, url, extraparam, aftersavefunc,errorfunc, afterrestorefunc) {
+ // Compatible mode old versions
+ var args = $.makeArray(arguments).slice(1), o = {};
+
+ if( $.type(args[0]) === "object" ) {
+ o = args[0];
+ } else {
+ if ($.isFunction(successfunc)) { o.successfunc = successfunc; }
+ if (typeof url !== "undefined") { o.url = url; }
+ if (typeof extraparam !== "undefined") { o.extraparam = extraparam; }
+ if ($.isFunction(aftersavefunc)) { o.aftersavefunc = aftersavefunc; }
+ if ($.isFunction(errorfunc)) { o.errorfunc = errorfunc; }
+ if ($.isFunction(afterrestorefunc)) { o.afterrestorefunc = afterrestorefunc; }
+ }
+ o = $.extend(true, {
+ successfunc: null,
+ url: null,
+ extraparam: {},
+ aftersavefunc: null,
+ errorfunc: null,
+ afterrestorefunc: null,
+ restoreAfterError: true,
+ mtype: "POST"
+ }, $.jgrid.inlineEdit, o );
+ // End compatible
+
+ var success = false;
+ var $t = this[0], nm, tmp={}, tmp2={}, tmp3= {}, editable, fr, cv, ind;
+ if (!$t.grid ) { return success; }
+ ind = $($t).jqGrid("getInd",rowid,true);
+ if(ind === false) {return success;}
+ editable = $(ind).attr("editable");
+ o.url = o.url ? o.url : $t.p.editurl;
+ if (editable==="1") {
+ var cm;
+ $('td[role="gridcell"]',ind).each(function(i) {
+ cm = $t.p.colModel[i];
+ nm = cm.name;
+ if ( nm != 'cb' && nm != 'subgrid' && cm.editable===true && nm != 'rn' && !$(this).hasClass('not-editable-cell')) {
+ switch (cm.edittype) {
+ case "checkbox":
+ var cbv = ["Yes","No"];
+ if(cm.editoptions ) {
+ cbv = cm.editoptions.value.split(":");
+ }
+ tmp[nm]= $("input",this).is(":checked") ? cbv[0] : cbv[1];
+ break;
+ case 'text':
+ case 'password':
+ case 'textarea':
+ case "button" :
+ tmp[nm]=$("input, textarea",this).val();
+ break;
+ case 'select':
+ if(!cm.editoptions.multiple) {
+ tmp[nm] = $("select option:selected",this).val();
+ tmp2[nm] = $("select option:selected", this).text();
+ } else {
+ var sel = $("select",this), selectedText = [];
+ tmp[nm] = $(sel).val();
+ if(tmp[nm]) { tmp[nm]= tmp[nm].join(","); } else { tmp[nm] =""; }
+ $("select option:selected",this).each(
+ function(i,selected){
+ selectedText[i] = $(selected).text();
+ }
+ );
+ tmp2[nm] = selectedText.join(",");
+ }
+ if(cm.formatter && cm.formatter == 'select') { tmp2={}; }
+ break;
+ case 'custom' :
+ try {
+ if(cm.editoptions && $.isFunction(cm.editoptions.custom_value)) {
+ tmp[nm] = cm.editoptions.custom_value.call($t, $(".customelement",this),'get');
+ if (tmp[nm] === undefined) { throw "e2"; }
+ } else { throw "e1"; }
+ } catch (e) {
+ if (e=="e1") { $.jgrid.info_dialog($.jgrid.errors.errcap,"function 'custom_value' "+$.jgrid.edit.msg.nodefined,$.jgrid.edit.bClose); }
+ if (e=="e2") { $.jgrid.info_dialog($.jgrid.errors.errcap,"function 'custom_value' "+$.jgrid.edit.msg.novalue,$.jgrid.edit.bClose); }
+ else { $.jgrid.info_dialog($.jgrid.errors.errcap,e.message,$.jgrid.edit.bClose); }
+ }
+ break;
+ }
+ cv = $.jgrid.checkValues(tmp[nm],i,$t);
+ if(cv[0] === false) {
+ cv[1] = tmp[nm] + " " + cv[1];
+ return false;
+ }
+ if($t.p.autoencode) { tmp[nm] = $.jgrid.htmlEncode(tmp[nm]); }
+ if(o.url !== 'clientArray' && cm.editoptions && cm.editoptions.NullIfEmpty === true) {
+ if(tmp[nm] === "") {
+ tmp3[nm] = 'null';
+ }
+ }
+ }
+ });
+ if (cv[0] === false){
+ try {
+ var positions = $.jgrid.findPos($("#"+$.jgrid.jqID(rowid), $t.grid.bDiv)[0]);
+ $.jgrid.info_dialog($.jgrid.errors.errcap,cv[1],$.jgrid.edit.bClose,{left:positions[0],top:positions[1]});
+ } catch (e) {
+ alert(cv[1]);
+ }
+ return success;
+ }
+ var idname, opers, oper;
+ opers = $t.p.prmNames;
+ oper = opers.oper;
+ idname = opers.id;
+ if(tmp) {
+ tmp[oper] = opers.editoper;
+ tmp[idname] = rowid;
+ if(typeof($t.p.inlineData) == 'undefined') { $t.p.inlineData ={}; }
+ tmp = $.extend({},tmp,$t.p.inlineData,o.extraparam);
+ }
+ if (o.url == 'clientArray') {
+ tmp = $.extend({},tmp, tmp2);
+ if($t.p.autoencode) {
+ $.each(tmp,function(n,v){
+ tmp[n] = $.jgrid.htmlDecode(v);
+ });
+ }
+ var resp = $($t).jqGrid("setRowData",rowid,tmp);
+ $(ind).attr("editable","0");
+ for( var k=0;k<$t.p.savedRow.length;k++) {
+ if( $t.p.savedRow[k].id == rowid) {fr = k; break;}
+ }
+ if(fr >= 0) { $t.p.savedRow.splice(fr,1); }
+ $($t).triggerHandler("jqGridInlineAfterSaveRow", [rowid, resp, tmp, o]);
+ if( $.isFunction(o.aftersavefunc) ) { o.aftersavefunc.call($t, rowid,resp, o); }
+ success = true;
+ $(ind).unbind("keydown");
+ } else {
+ $("#lui_"+$.jgrid.jqID($t.p.id)).show();
+ tmp3 = $.extend({},tmp,tmp3);
+ tmp3[idname] = $.jgrid.stripPref($t.p.idPrefix, tmp3[idname]);
+ $.ajax($.extend({
+ url:o.url,
+ data: $.isFunction($t.p.serializeRowData) ? $t.p.serializeRowData.call($t, tmp3) : tmp3,
+ type: o.mtype,
+ async : false, //?!?
+ complete: function(res,stat){
+ $("#lui_"+$.jgrid.jqID($t.p.id)).hide();
+ if (stat === "success"){
+ var ret = true, sucret;
+ sucret = $($t).triggerHandler("jqGridInlineSuccessSaveRow", [res, rowid, o]);
+ if (!$.isArray(sucret)) {sucret = [true, tmp];}
+ if (sucret[0] && $.isFunction(o.successfunc)) {sucret = o.successfunc.call($t, res);}
+ if($.isArray(sucret)) {
+ // expect array - status, data, rowid
+ ret = sucret[0];
+ tmp = sucret[1] ? sucret[1] : tmp;
+ } else {
+ ret = sucret;
+ }
+ if (ret===true) {
+ if($t.p.autoencode) {
+ $.each(tmp,function(n,v){
+ tmp[n] = $.jgrid.htmlDecode(v);
+ });
+ }
+ tmp = $.extend({},tmp, tmp2);
+ $($t).jqGrid("setRowData",rowid,tmp);
+ $(ind).attr("editable","0");
+ for( var k=0;k<$t.p.savedRow.length;k++) {
+ if( $t.p.savedRow[k].id == rowid) {fr = k; break;}
+ }
+ if(fr >= 0) { $t.p.savedRow.splice(fr,1); }
+ $($t).triggerHandler("jqGridInlineAfterSaveRow", [rowid, res, tmp, o]);
+ if( $.isFunction(o.aftersavefunc) ) { o.aftersavefunc.call($t, rowid,res); }
+ success = true;
+ $(ind).unbind("keydown");
+ } else {
+ $($t).triggerHandler("jqGridInlineErrorSaveRow", [rowid, res, stat, null, o]);
+ if($.isFunction(o.errorfunc) ) {
+ o.errorfunc.call($t, rowid, res, stat, null);
+ }
+ if(o.restoreAfterError === true) {
+ $($t).jqGrid("restoreRow",rowid, o.afterrestorefunc);
+ }
+ }
+ }
+ },
+ error:function(res,stat,err){
+ $("#lui_"+$.jgrid.jqID($t.p.id)).hide();
+ $($t).triggerHandler("jqGridInlineErrorSaveRow", [rowid, res, stat, err, o]);
+ if($.isFunction(o.errorfunc) ) {
+ o.errorfunc.call($t, rowid, res, stat, err);
+ } else {
+ var rT = res.responseText || res.statusText;
+ try {
+ $.jgrid.info_dialog($.jgrid.errors.errcap,'<div class="ui-state-error">'+ rT +'</div>', $.jgrid.edit.bClose,{buttonalign:'right'});
+ } catch(e) {
+ alert(rT);
+ }
+ }
+ if(o.restoreAfterError === true) {
+ $($t).jqGrid("restoreRow",rowid, o.afterrestorefunc);
+ }
+ }
+ }, $.jgrid.ajaxOptions, $t.p.ajaxRowOptions || {}));
+ }
+ }
+ return success;
+ },
+ restoreRow : function(rowid, afterrestorefunc) {
+ // Compatible mode old versions
+ var args = $.makeArray(arguments).slice(1), o={};
+
+ if( $.type(args[0]) === "object" ) {
+ o = args[0];
+ } else {
+ if ($.isFunction(afterrestorefunc)) { o.afterrestorefunc = afterrestorefunc; }
+ }
+ o = $.extend(true, $.jgrid.inlineEdit, o );
+
+ // End compatible
+
+ return this.each(function(){
+ var $t= this, fr, ind, ares={};
+ if (!$t.grid ) { return; }
+ ind = $($t).jqGrid("getInd",rowid,true);
+ if(ind === false) {return;}
+ for( var k=0;k<$t.p.savedRow.length;k++) {
+ if( $t.p.savedRow[k].id == rowid) {fr = k; break;}
+ }
+ if(fr >= 0) {
+ if($.isFunction($.fn.datepicker)) {
+ try {
+ $("input.hasDatepicker","#"+$.jgrid.jqID(ind.id)).datepicker('hide');
+ } catch (e) {}
+ }
+ $.each($t.p.colModel, function(){
+ if(this.editable === true && this.name in $t.p.savedRow[fr] ) {
+ ares[this.name] = $t.p.savedRow[fr][this.name];
+ }
+ });
+ $($t).jqGrid("setRowData",rowid,ares);
+ $(ind).attr("editable","0").unbind("keydown");
+ $t.p.savedRow.splice(fr,1);
+ if($("#"+$.jgrid.jqID(rowid), "#"+$.jgrid.jqID($t.p.id)).hasClass("jqgrid-new-row")){
+ setTimeout(function(){$($t).jqGrid("delRowData",rowid);},0);
+ }
+ }
+ $($t).triggerHandler("jqGridInlineAfterRestoreRow", [rowid]);
+ if ($.isFunction(o.afterrestorefunc))
+ {
+ o.afterrestorefunc.call($t, rowid);
+ }
+ });
+ },
+ addRow : function ( p ) {
+ p = $.extend(true, {
+ rowID : "new_row",
+ initdata : {},
+ position :"first",
+ useDefValues : true,
+ useFormatter : false,
+ addRowParams : {extraparam:{}}
+ },p || {});
+ return this.each(function(){
+ if (!this.grid ) { return; }
+ var $t = this;
+ if(p.useDefValues === true) {
+ $($t.p.colModel).each(function(){
+ if( this.editoptions && this.editoptions.defaultValue ) {
+ var opt = this.editoptions.defaultValue,
+ tmp = $.isFunction(opt) ? opt.call($t) : opt;
+ p.initdata[this.name] = tmp;
+ }
+ });
+ }
+ $($t).jqGrid('addRowData', p.rowID, p.initdata, p.position);
+ p.rowID = $t.p.idPrefix + p.rowID;
+ $("#"+$.jgrid.jqID(p.rowID), "#"+$.jgrid.jqID($t.p.id)).addClass("jqgrid-new-row");
+ if(p.useFormatter) {
+ $("#"+$.jgrid.jqID(p.rowID)+" .ui-inline-edit", "#"+$.jgrid.jqID($t.p.id)).click();
+ } else {
+ var opers = $t.p.prmNames,
+ oper = opers.oper;
+ p.addRowParams.extraparam[oper] = opers.addoper;
+ $($t).jqGrid('editRow', p.rowID, p.addRowParams);
+ $($t).jqGrid('setSelection', p.rowID);
+ }
+ });
+ },
+ inlineNav : function (elem, o) {
+ o = $.extend({
+ edit: true,
+ editicon: "ui-icon-pencil",
+ add: true,
+ addicon:"ui-icon-plus",
+ save: true,
+ saveicon:"ui-icon-disk",
+ cancel: true,
+ cancelicon:"ui-icon-cancel",
+ addParams : {useFormatter : false,rowID : "new_row"},
+ editParams : {},
+ restoreAfterSelect : true
+ }, $.jgrid.nav, o ||{});
+ return this.each(function(){
+ if (!this.grid ) { return; }
+ var $t = this, onSelect, gID = $.jgrid.jqID($t.p.id);
+ $t.p._inlinenav = true;
+ // detect the formatactions column
+ if(o.addParams.useFormatter === true) {
+ var cm = $t.p.colModel,i;
+ for (i = 0; i<cm.length; i++) {
+ if(cm[i].formatter && cm[i].formatter === "actions" ) {
+ if(cm[i].formatoptions) {
+ var defaults = {
+ keys:false,
+ onEdit : null,
+ onSuccess: null,
+ afterSave:null,
+ onError: null,
+ afterRestore: null,
+ extraparam: {},
+ url: null
+ },
+ ap = $.extend( defaults, cm[i].formatoptions );
+ o.addParams.addRowParams = {
+ "keys" : ap.keys,
+ "oneditfunc" : ap.onEdit,
+ "successfunc" : ap.onSuccess,
+ "url" : ap.url,
+ "extraparam" : ap.extraparam,
+ "aftersavefunc" : ap.afterSavef,
+ "errorfunc": ap.onError,
+ "afterrestorefunc" : ap.afterRestore
+ };
+ }
+ break;
+ }
+ }
+ }
+ if(o.add) {
+ $($t).jqGrid('navButtonAdd', elem,{
+ caption : o.addtext,
+ title : o.addtitle,
+ buttonicon : o.addicon,
+ id : $t.p.id+"_iladd",
+ onClickButton : function () {
+ $($t).jqGrid('addRow', o.addParams);
+ if(!o.addParams.useFormatter) {
+ $("#"+gID+"_ilsave").removeClass('ui-state-disabled');
+ $("#"+gID+"_ilcancel").removeClass('ui-state-disabled');
+ $("#"+gID+"_iladd").addClass('ui-state-disabled');
+ $("#"+gID+"_iledit").addClass('ui-state-disabled');
+ }
+ }
+ });
+ }
+ if(o.edit) {
+ $($t).jqGrid('navButtonAdd', elem,{
+ caption : o.edittext,
+ title : o.edittitle,
+ buttonicon : o.editicon,
+ id : $t.p.id+"_iledit",
+ onClickButton : function () {
+ var sr = $($t).jqGrid('getGridParam','selrow');
+ if(sr) {
+ $($t).jqGrid('editRow', sr, o.editParams);
+ $("#"+gID+"_ilsave").removeClass('ui-state-disabled');
+ $("#"+gID+"_ilcancel").removeClass('ui-state-disabled');
+ $("#"+gID+"_iladd").addClass('ui-state-disabled');
+ $("#"+gID+"_iledit").addClass('ui-state-disabled');
+ } else {
+ $.jgrid.viewModal("#alertmod",{gbox:"#gbox_"+gID,jqm:true});$("#jqg_alrt").focus();
+ }
+ }
+ });
+ }
+ if(o.save) {
+ $($t).jqGrid('navButtonAdd', elem,{
+ caption : o.savetext || '',
+ title : o.savetitle || 'Save row',
+ buttonicon : o.saveicon,
+ id : $t.p.id+"_ilsave",
+ onClickButton : function () {
+ var sr = $t.p.savedRow[0].id;
+ if(sr) {
+ var opers = $t.p.prmNames,
+ oper = opers.oper;
+ if(!o.editParams.extraparam) {
+ o.editParams.extraparam = {};
+ }
+ if($("#"+$.jgrid.jqID(sr), "#"+gID ).hasClass("jqgrid-new-row")) {
+ o.editParams.extraparam[oper] = opers.addoper;
+ } else {
+ o.editParams.extraparam[oper] = opers.editoper;
+ }
+ if( $($t).jqGrid('saveRow', sr, o.editParams) ) {
+ $($t).jqGrid('showAddEditButtons');
+ }
+ } else {
+ $.jgrid.viewModal("#alertmod",{gbox:"#gbox_"+gID,jqm:true});$("#jqg_alrt").focus();
+ }
+ }
+ });
+ $("#"+gID+"_ilsave").addClass('ui-state-disabled');
+ }
+ if(o.cancel) {
+ $($t).jqGrid('navButtonAdd', elem,{
+ caption : o.canceltext || '',
+ title : o.canceltitle || 'Cancel row editing',
+ buttonicon : o.cancelicon,
+ id : $t.p.id+"_ilcancel",
+ onClickButton : function () {
+ var sr = $t.p.savedRow[0].id;
+ if(sr) {
+ $($t).jqGrid('restoreRow', sr, o.editParams);
+ $($t).jqGrid('showAddEditButtons');
+ } else {
+ $.jgrid.viewModal("#alertmod",{gbox:"#gbox_"+gID,jqm:true});$("#jqg_alrt").focus();
+ }
+ }
+ });
+ $("#"+gID+"_ilcancel").addClass('ui-state-disabled');
+ }
+ if(o.restoreAfterSelect === true) {
+ if($.isFunction($t.p.beforeSelectRow)) {
+ onSelect = $t.p.beforeSelectRow;
+ } else {
+ onSelect = false;
+ }
+ $t.p.beforeSelectRow = function(id, stat) {
+ var ret = true;
+ if($t.p.savedRow.length > 0 && $t.p._inlinenav===true && ( id !== $t.p.selrow && $t.p.selrow !==null) ) {
+ if($t.p.selrow == o.addParams.rowID ) {
+ $($t).jqGrid('delRowData', $t.p.selrow);
+ } else {
+ $($t).jqGrid('restoreRow', $t.p.selrow, o.editParams);
+ }
+ $($t).jqGrid('showAddEditButtons');
+ }
+ if(onSelect) {
+ ret = onSelect.call($t, id, stat);
+ }
+ return ret;
+ };
+ }
+
+ });
+ },
+ showAddEditButtons : function() {
+ return this.each(function(){
+ if (!this.grid ) { return; }
+ var gID = $.jgrid.jqID(this.p.id);
+ $("#"+gID+"_ilsave").addClass('ui-state-disabled');
+ $("#"+gID+"_ilcancel").addClass('ui-state-disabled');
+ $("#"+gID+"_iladd").removeClass('ui-state-disabled');
+ $("#"+gID+"_iledit").removeClass('ui-state-disabled');
+ });
+ }
+//end inline edit
+});
+})(jQuery);
+;(function($){
+/*
+**
+ * jqGrid extension for cellediting Grid Data
+ * Tony Tomov tony(a)trirand.com
+ * http://trirand.com/blog/
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl-2.0.html
+**/
+/**
+ * all events and options here are aded anonynous and not in the base grid
+ * since the array is to big. Here is the order of execution.
+ * From this point we use jQuery isFunction
+ * formatCell
+ * beforeEditCell,
+ * onSelectCell (used only for noneditable cels)
+ * afterEditCell,
+ * beforeSaveCell, (called before validation of values if any)
+ * beforeSubmitCell (if cellsubmit remote (ajax))
+ * afterSubmitCell(if cellsubmit remote (ajax)),
+ * afterSaveCell,
+ * errorCell,
+ * serializeCellData - new
+ * Options
+ * cellsubmit (remote,clientArray) (added in grid options)
+ * cellurl
+ * ajaxCellOptions
+* */
+"use strict";
+$.jgrid.extend({
+ editCell : function (iRow,iCol, ed){
+ return this.each(function (){
+ var $t = this, nm, tmp,cc, cm;
+ if (!$t.grid || $t.p.cellEdit !== true) {return;}
+ iCol = parseInt(iCol,10);
+ // select the row that can be used for other methods
+ $t.p.selrow = $t.rows[iRow].id;
+ if (!$t.p.knv) {$($t).jqGrid("GridNav");}
+ // check to see if we have already edited cell
+ if ($t.p.savedRow.length>0) {
+ // prevent second click on that field and enable selects
+ if (ed===true ) {
+ if(iRow == $t.p.iRow && iCol == $t.p.iCol){
+ return;
+ }
+ }
+ // save the cell
+ $($t).jqGrid("saveCell",$t.p.savedRow[0].id,$t.p.savedRow[0].ic);
+ } else {
+ window.setTimeout(function () { $("#"+$.jgrid.jqID($t.p.knv)).attr("tabindex","-1").focus();},0);
+ }
+ cm = $t.p.colModel[iCol];
+ nm = cm.name;
+ if (nm=='subgrid' || nm=='cb' || nm=='rn') {return;}
+ cc = $("td:eq("+iCol+")",$t.rows[iRow]);
+ if (cm.editable===true && ed===true && !cc.hasClass("not-editable-cell")) {
+ if(parseInt($t.p.iCol,10)>=0 && parseInt($t.p.iRow,10)>=0) {
+ $("td:eq("+$t.p.iCol+")",$t.rows[$t.p.iRow]).removeClass("edit-cell ui-state-highlight");
+ $($t.rows[$t.p.iRow]).removeClass("selected-row ui-state-hover");
+ }
+ $(cc).addClass("edit-cell ui-state-highlight");
+ $($t.rows[iRow]).addClass("selected-row ui-state-hover");
+ try {
+ tmp = $.unformat.call($t,cc,{rowId: $t.rows[iRow].id, colModel:cm},iCol);
+ } catch (_) {
+ tmp = ( cm.edittype && cm.edittype == 'textarea' ) ? $(cc).text() : $(cc).html();
+ }
+ if($t.p.autoencode) { tmp = $.jgrid.htmlDecode(tmp); }
+ if (!cm.edittype) {cm.edittype = "text";}
+ $t.p.savedRow.push({id:iRow,ic:iCol,name:nm,v:tmp});
+ if(tmp === " " || tmp === " " || (tmp.length===1 && tmp.charCodeAt(0)===160) ) {tmp='';}
+ if($.isFunction($t.p.formatCell)) {
+ var tmp2 = $t.p.formatCell.call($t, $t.rows[iRow].id,nm,tmp,iRow,iCol);
+ if(tmp2 !== undefined ) {tmp = tmp2;}
+ }
+ var opt = $.extend({}, cm.editoptions || {} ,{id:iRow+"_"+nm,name:nm});
+ var elc = $.jgrid.createEl.call($t,cm.edittype,opt,tmp,true,$.extend({},$.jgrid.ajaxOptions,$t.p.ajaxSelectOptions || {}));
+ $($t).triggerHandler("jqGridBeforeEditCell", [$t.rows[iRow].id, nm, tmp, iRow, iCol]);
+ if ($.isFunction($t.p.beforeEditCell)) {
+ $t.p.beforeEditCell.call($t, $t.rows[iRow].id,nm,tmp,iRow,iCol);
+ }
+ $(cc).html("").append(elc).attr("tabindex","0");
+ window.setTimeout(function () { $(elc).focus();},0);
+ $("input, select, textarea",cc).bind("keydown",function(e) {
+ if (e.keyCode === 27) {
+ if($("input.hasDatepicker",cc).length >0) {
+ if( $(".ui-datepicker").is(":hidden") ) { $($t).jqGrid("restoreCell",iRow,iCol); }
+ else { $("input.hasDatepicker",cc).datepicker('hide'); }
+ } else {
+ $($t).jqGrid("restoreCell",iRow,iCol);
+ }
+ } //ESC
+ if (e.keyCode === 13) {
+ $($t).jqGrid("saveCell",iRow,iCol);
+ // Prevent default action
+ return false;
+ } //Enter
+ if (e.keyCode === 9) {
+ if(!$t.grid.hDiv.loading ) {
+ if (e.shiftKey) {$($t).jqGrid("prevCell",iRow,iCol);} //Shift TAb
+ else {$($t).jqGrid("nextCell",iRow,iCol);} //Tab
+ } else {
+ return false;
+ }
+ }
+ e.stopPropagation();
+ });
+ $($t).triggerHandler("jqGridAfterEditCell", [$t.rows[iRow].id, nm, tmp, iRow, iCol]);
+ if ($.isFunction($t.p.afterEditCell)) {
+ $t.p.afterEditCell.call($t, $t.rows[iRow].id,nm,tmp,iRow,iCol);
+ }
+ } else {
+ if (parseInt($t.p.iCol,10)>=0 && parseInt($t.p.iRow,10)>=0) {
+ $("td:eq("+$t.p.iCol+")",$t.rows[$t.p.iRow]).removeClass("edit-cell ui-state-highlight");
+ $($t.rows[$t.p.iRow]).removeClass("selected-row ui-state-hover");
+ }
+ cc.addClass("edit-cell ui-state-highlight");
+ $($t.rows[iRow]).addClass("selected-row ui-state-hover");
+ tmp = cc.html().replace(/\ \;/ig,'');
+ $($t).triggerHandler("jqGridSelectCell", [$t.rows[iRow].id, nm, tmp, iRow, iCol]);
+ if ($.isFunction($t.p.onSelectCell)) {
+ $t.p.onSelectCell.call($t, $t.rows[iRow].id,nm,tmp,iRow,iCol);
+ }
+ }
+ $t.p.iCol = iCol; $t.p.iRow = iRow;
+ });
+ },
+ saveCell : function (iRow, iCol){
+ return this.each(function(){
+ var $t= this, fr;
+ if (!$t.grid || $t.p.cellEdit !== true) {return;}
+ if ( $t.p.savedRow.length >= 1) {fr = 0;} else {fr=null;}
+ if(fr !== null) {
+ var cc = $("td:eq("+iCol+")",$t.rows[iRow]),v,v2,
+ cm = $t.p.colModel[iCol], nm = cm.name, nmjq = $.jgrid.jqID(nm) ;
+ switch (cm.edittype) {
+ case "select":
+ if(!cm.editoptions.multiple) {
+ v = $("#"+iRow+"_"+nmjq+" option:selected",$t.rows[iRow]).val();
+ v2 = $("#"+iRow+"_"+nmjq+" option:selected",$t.rows[iRow]).text();
+ } else {
+ var sel = $("#"+iRow+"_"+nmjq,$t.rows[iRow]), selectedText = [];
+ v = $(sel).val();
+ if(v) { v.join(",");} else { v=""; }
+ $("option:selected",sel).each(
+ function(i,selected){
+ selectedText[i] = $(selected).text();
+ }
+ );
+ v2 = selectedText.join(",");
+ }
+ if(cm.formatter) { v2 = v; }
+ break;
+ case "checkbox":
+ var cbv = ["Yes","No"];
+ if(cm.editoptions){
+ cbv = cm.editoptions.value.split(":");
+ }
+ v = $("#"+iRow+"_"+nmjq,$t.rows[iRow]).is(":checked") ? cbv[0] : cbv[1];
+ v2=v;
+ break;
+ case "password":
+ case "text":
+ case "textarea":
+ case "button" :
+ v = $("#"+iRow+"_"+nmjq,$t.rows[iRow]).val();
+ v2=v;
+ break;
+ case 'custom' :
+ try {
+ if(cm.editoptions && $.isFunction(cm.editoptions.custom_value)) {
+ v = cm.editoptions.custom_value.call($t, $(".customelement",cc),'get');
+ if (v===undefined) { throw "e2";} else { v2=v; }
+ } else { throw "e1"; }
+ } catch (e) {
+ if (e=="e1") { $.jgrid.info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+$.jgrid.edit.msg.nodefined,jQuery.jgrid.edit.bClose); }
+ if (e=="e2") { $.jgrid.info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+$.jgrid.edit.msg.novalue,jQuery.jgrid.edit.bClose); }
+ else {$.jgrid.info_dialog(jQuery.jgrid.errors.errcap,e.message,jQuery.jgrid.edit.bClose); }
+ }
+ break;
+ }
+ // The common approach is if nothing changed do not do anything
+ if (v2 !== $t.p.savedRow[fr].v){
+ var vvv = $($t).triggerHandler("jqGridBeforeSaveCell", [$t.rows[iRow].id, nm, v, iRow, iCol]);
+ if (vvv) {v = vvv; v2=vvv;}
+ if ($.isFunction($t.p.beforeSaveCell)) {
+ var vv = $t.p.beforeSaveCell.call($t, $t.rows[iRow].id,nm, v, iRow,iCol);
+ if (vv) {v = vv; v2=vv;}
+ }
+ var cv = $.jgrid.checkValues(v,iCol,$t);
+ if(cv[0] === true) {
+ var addpost = $($t).triggerHandler("jqGridBeforeSubmitCell", [$t.rows[iRow].id, nm, v, iRow, iCol]) || {};
+ if ($.isFunction($t.p.beforeSubmitCell)) {
+ addpost = $t.p.beforeSubmitCell.call($t, $t.rows[iRow].id,nm, v, iRow,iCol);
+ if (!addpost) {addpost={};}
+ }
+ if( $("input.hasDatepicker",cc).length >0) { $("input.hasDatepicker",cc).datepicker('hide'); }
+ if ($t.p.cellsubmit == 'remote') {
+ if ($t.p.cellurl) {
+ var postdata = {};
+ if($t.p.autoencode) { v = $.jgrid.htmlEncode(v); }
+ postdata[nm] = v;
+ var idname,oper, opers;
+ opers = $t.p.prmNames;
+ idname = opers.id;
+ oper = opers.oper;
+ postdata[idname] = $.jgrid.stripPref($t.p.idPrefix, $t.rows[iRow].id);
+ postdata[oper] = opers.editoper;
+ postdata = $.extend(addpost,postdata);
+ $("#lui_"+$.jgrid.jqID($t.p.id)).show();
+ $t.grid.hDiv.loading = true;
+ $.ajax( $.extend( {
+ url: $t.p.cellurl,
+ data :$.isFunction($t.p.serializeCellData) ? $t.p.serializeCellData.call($t, postdata) : postdata,
+ type: "POST",
+ complete: function (result, stat) {
+ $("#lui_"+$t.p.id).hide();
+ $t.grid.hDiv.loading = false;
+ if (stat == 'success') {
+ var ret = $($t).triggerHandler("jqGridAfterSubmitCell", [$t, result, postdata.id, nm, v, iRow, iCol]) || [true, ''];
+ if (ret[0] === true && $.isFunction($t.p.afterSubmitCell)) {
+ ret = $t.p.afterSubmitCell.call($t, result,postdata.id,nm,v,iRow,iCol);
+ }
+ if(ret[0] === true){
+ $(cc).empty();
+ $($t).jqGrid("setCell",$t.rows[iRow].id, iCol, v2, false, false, true);
+ $(cc).addClass("dirty-cell");
+ $($t.rows[iRow]).addClass("edited");
+ $($t).triggerHandler("jqGridAfterSaveCell", [$t.rows[iRow].id, nm, v, iRow, iCol]);
+ if ($.isFunction($t.p.afterSaveCell)) {
+ $t.p.afterSaveCell.call($t, $t.rows[iRow].id,nm, v, iRow,iCol);
+ }
+ $t.p.savedRow.splice(0,1);
+ } else {
+ $.jgrid.info_dialog($.jgrid.errors.errcap,ret[1],$.jgrid.edit.bClose);
+ $($t).jqGrid("restoreCell",iRow,iCol);
+ }
+ }
+ },
+ error:function(res,stat,err) {
+ $("#lui_"+$.jgrid.jqID($t.p.id)).hide();
+ $t.grid.hDiv.loading = false;
+ $($t).triggerHandler("jqGridErrorCell", [res, stat, err]);
+ if ($.isFunction($t.p.errorCell)) {
+ $t.p.errorCell.call($t, res,stat,err);
+ $($t).jqGrid("restoreCell",iRow,iCol);
+ } else {
+ $.jgrid.info_dialog($.jgrid.errors.errcap,res.status+" : "+res.statusText+"<br/>"+stat,$.jgrid.edit.bClose);
+ $($t).jqGrid("restoreCell",iRow,iCol);
+ }
+ }
+ }, $.jgrid.ajaxOptions, $t.p.ajaxCellOptions || {}));
+ } else {
+ try {
+ $.jgrid.info_dialog($.jgrid.errors.errcap,$.jgrid.errors.nourl,$.jgrid.edit.bClose);
+ $($t).jqGrid("restoreCell",iRow,iCol);
+ } catch (e) {}
+ }
+ }
+ if ($t.p.cellsubmit == 'clientArray') {
+ $(cc).empty();
+ $($t).jqGrid("setCell",$t.rows[iRow].id,iCol, v2, false, false, true);
+ $(cc).addClass("dirty-cell");
+ $($t.rows[iRow]).addClass("edited");
+ $($t).triggerHandler("jqGridAfterSaveCell", [$t.rows[iRow].id, nm, v, iRow, iCol]);
+ if ($.isFunction($t.p.afterSaveCell)) {
+ $t.p.afterSaveCell.call($t, $t.rows[iRow].id,nm, v, iRow,iCol);
+ }
+ $t.p.savedRow.splice(0,1);
+ }
+ } else {
+ try {
+ window.setTimeout(function(){$.jgrid.info_dialog($.jgrid.errors.errcap,v+" "+cv[1],$.jgrid.edit.bClose);},100);
+ $($t).jqGrid("restoreCell",iRow,iCol);
+ } catch (e) {}
+ }
+ } else {
+ $($t).jqGrid("restoreCell",iRow,iCol);
+ }
+ }
+ if ($.browser.opera) {
+ $("#"+$.jgrid.jqID($t.p.knv)).attr("tabindex","-1").focus();
+ } else {
+ window.setTimeout(function () { $("#"+$.jgrid.jqID($t.p.knv)).attr("tabindex","-1").focus();},0);
+ }
+ });
+ },
+ restoreCell : function(iRow, iCol) {
+ return this.each(function(){
+ var $t= this, fr;
+ if (!$t.grid || $t.p.cellEdit !== true ) {return;}
+ if ( $t.p.savedRow.length >= 1) {fr = 0;} else {fr=null;}
+ if(fr !== null) {
+ var cc = $("td:eq("+iCol+")",$t.rows[iRow]);
+ // datepicker fix
+ if($.isFunction($.fn.datepicker)) {
+ try {
+ $("input.hasDatepicker",cc).datepicker('hide');
+ } catch (e) {}
+ }
+ $(cc).empty().attr("tabindex","-1");
+ $($t).jqGrid("setCell",$t.rows[iRow].id, iCol, $t.p.savedRow[fr].v, false, false, true);
+ $($t).triggerHandler("jqGridAfterRestoreCell", [$t.rows[iRow].id, $t.p.savedRow[fr].v, iRow, iCol]);
+ if ($.isFunction($t.p.afterRestoreCell)) {
+ $t.p.afterRestoreCell.call($t, $t.rows[iRow].id, $t.p.savedRow[fr].v, iRow, iCol);
+ }
+ $t.p.savedRow.splice(0,1);
+ }
+ window.setTimeout(function () { $("#"+$t.p.knv).attr("tabindex","-1").focus();},0);
+ });
+ },
+ nextCell : function (iRow,iCol) {
+ return this.each(function (){
+ var $t = this, nCol=false;
+ if (!$t.grid || $t.p.cellEdit !== true) {return;}
+ // try to find next editable cell
+ for (var i=iCol+1; i<$t.p.colModel.length; i++) {
+ if ( $t.p.colModel[i].editable ===true) {
+ nCol = i; break;
+ }
+ }
+ if(nCol !== false) {
+ $($t).jqGrid("editCell",iRow,nCol,true);
+ } else {
+ if ($t.p.savedRow.length >0) {
+ $($t).jqGrid("saveCell",iRow,iCol);
+ }
+ }
+ });
+ },
+ prevCell : function (iRow,iCol) {
+ return this.each(function (){
+ var $t = this, nCol=false;
+ if (!$t.grid || $t.p.cellEdit !== true) {return;}
+ // try to find next editable cell
+ for (var i=iCol-1; i>=0; i--) {
+ if ( $t.p.colModel[i].editable ===true) {
+ nCol = i; break;
+ }
+ }
+ if(nCol !== false) {
+ $($t).jqGrid("editCell",iRow,nCol,true);
+ } else {
+ if ($t.p.savedRow.length >0) {
+ $($t).jqGrid("saveCell",iRow,iCol);
+ }
+ }
+ });
+ },
+ GridNav : function() {
+ return this.each(function () {
+ var $t = this;
+ if (!$t.grid || $t.p.cellEdit !== true ) {return;}
+ // trick to process keydown on non input elements
+ $t.p.knv = $t.p.id + "_kn";
+ var selection = $("<div style='position:absolute;top:-1000000px;width:1px;height:1px;' tabindex='0'><div tabindex='-1' style='width:1px;height:1px;' id='"+$t.p.knv+"'></div></div>"),
+ i, kdir;
+ function scrollGrid(iR, iC, tp){
+ if (tp.substr(0,1)=='v') {
+ var ch = $($t.grid.bDiv)[0].clientHeight,
+ st = $($t.grid.bDiv)[0].scrollTop,
+ nROT = $t.rows[iR].offsetTop+$t.rows[iR].clientHeight,
+ pROT = $t.rows[iR].offsetTop;
+ if(tp == 'vd') {
+ if(nROT >= ch) {
+ $($t.grid.bDiv)[0].scrollTop = $($t.grid.bDiv)[0].scrollTop + $t.rows[iR].clientHeight;
+ }
+ }
+ if(tp == 'vu'){
+ if (pROT < st ) {
+ $($t.grid.bDiv)[0].scrollTop = $($t.grid.bDiv)[0].scrollTop - $t.rows[iR].clientHeight;
+ }
+ }
+ }
+ if(tp=='h') {
+ var cw = $($t.grid.bDiv)[0].clientWidth,
+ sl = $($t.grid.bDiv)[0].scrollLeft,
+ nCOL = $t.rows[iR].cells[iC].offsetLeft+$t.rows[iR].cells[iC].clientWidth,
+ pCOL = $t.rows[iR].cells[iC].offsetLeft;
+ if(nCOL >= cw+parseInt(sl,10)) {
+ $($t.grid.bDiv)[0].scrollLeft = $($t.grid.bDiv)[0].scrollLeft + $t.rows[iR].cells[iC].clientWidth;
+ } else if (pCOL < sl) {
+ $($t.grid.bDiv)[0].scrollLeft = $($t.grid.bDiv)[0].scrollLeft - $t.rows[iR].cells[iC].clientWidth;
+ }
+ }
+ }
+ function findNextVisible(iC,act){
+ var ind, i;
+ if(act == 'lft') {
+ ind = iC+1;
+ for (i=iC;i>=0;i--){
+ if ($t.p.colModel[i].hidden !== true) {
+ ind = i;
+ break;
+ }
+ }
+ }
+ if(act == 'rgt') {
+ ind = iC-1;
+ for (i=iC; i<$t.p.colModel.length;i++){
+ if ($t.p.colModel[i].hidden !== true) {
+ ind = i;
+ break;
+ }
+ }
+ }
+ return ind;
+ }
+
+ $(selection).insertBefore($t.grid.cDiv);
+ $("#"+$t.p.knv)
+ .focus()
+ .keydown(function (e){
+ kdir = e.keyCode;
+ if($t.p.direction == "rtl") {
+ if(kdir===37) { kdir = 39;}
+ else if (kdir===39) { kdir = 37; }
+ }
+ switch (kdir) {
+ case 38:
+ if ($t.p.iRow-1 >0 ) {
+ scrollGrid($t.p.iRow-1,$t.p.iCol,'vu');
+ $($t).jqGrid("editCell",$t.p.iRow-1,$t.p.iCol,false);
+ }
+ break;
+ case 40 :
+ if ($t.p.iRow+1 <= $t.rows.length-1) {
+ scrollGrid($t.p.iRow+1,$t.p.iCol,'vd');
+ $($t).jqGrid("editCell",$t.p.iRow+1,$t.p.iCol,false);
+ }
+ break;
+ case 37 :
+ if ($t.p.iCol -1 >= 0) {
+ i = findNextVisible($t.p.iCol-1,'lft');
+ scrollGrid($t.p.iRow, i,'h');
+ $($t).jqGrid("editCell",$t.p.iRow, i,false);
+ }
+ break;
+ case 39 :
+ if ($t.p.iCol +1 <= $t.p.colModel.length-1) {
+ i = findNextVisible($t.p.iCol+1,'rgt');
+ scrollGrid($t.p.iRow,i,'h');
+ $($t).jqGrid("editCell",$t.p.iRow,i,false);
+ }
+ break;
+ case 13:
+ if (parseInt($t.p.iCol,10)>=0 && parseInt($t.p.iRow,10)>=0) {
+ $($t).jqGrid("editCell",$t.p.iRow,$t.p.iCol,true);
+ }
+ break;
+ default :
+ return true;
+ }
+ return false;
+ });
+ });
+ },
+ getChangedCells : function (mthd) {
+ var ret=[];
+ if (!mthd) {mthd='all';}
+ this.each(function(){
+ var $t= this,nm;
+ if (!$t.grid || $t.p.cellEdit !== true ) {return;}
+ $($t.rows).each(function(j){
+ var res = {};
+ if ($(this).hasClass("edited")) {
+ $('td',this).each( function(i) {
+ nm = $t.p.colModel[i].name;
+ if ( nm !== 'cb' && nm !== 'subgrid') {
+ if (mthd=='dirty') {
+ if ($(this).hasClass('dirty-cell')) {
+ try {
+ res[nm] = $.unformat.call($t,this,{rowId:$t.rows[j].id, colModel:$t.p.colModel[i]},i);
+ } catch (e){
+ res[nm] = $.jgrid.htmlDecode($(this).html());
+ }
+ }
+ } else {
+ try {
+ res[nm] = $.unformat.call($t,this,{rowId:$t.rows[j].id,colModel:$t.p.colModel[i]},i);
+ } catch (e) {
+ res[nm] = $.jgrid.htmlDecode($(this).html());
+ }
+ }
+ }
+ });
+ res.id = this.id;
+ ret.push(res);
+ }
+ });
+ });
+ return ret;
+ }
+/// end cell editing
+});
+})(jQuery);
+;(function($){
+/**
+ * jqGrid extension for SubGrid Data
+ * Tony Tomov tony(a)trirand.com
+ * http://trirand.com/blog/
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl-2.0.html
+**/
+"use strict";
+$.jgrid.extend({
+setSubGrid : function () {
+ return this.each(function (){
+ var $t = this, cm,
+ suboptions = {
+ plusicon : "ui-icon-plus",
+ minusicon : "ui-icon-minus",
+ openicon: "ui-icon-carat-1-sw",
+ expandOnLoad: false,
+ delayOnLoad : 50,
+ selectOnExpand : false,
+ reloadOnExpand : true
+ };
+ $t.p.subGridOptions = $.extend(suboptions, $t.p.subGridOptions || {});
+ $t.p.colNames.unshift("");
+ $t.p.colModel.unshift({name:'subgrid',width: $.browser.safari ? $t.p.subGridWidth+$t.p.cellLayout : $t.p.subGridWidth,sortable: false,resizable:false,hidedlg:true,search:false,fixed:true});
+ cm = $t.p.subGridModel;
+ if(cm[0]) {
+ cm[0].align = $.extend([],cm[0].align || []);
+ for(var i=0;i<cm[0].name.length;i++) { cm[0].align[i] = cm[0].align[i] || 'left';}
+ }
+ });
+},
+addSubGridCell :function (pos,iRow) {
+ var prp='',ic,sid;
+ this.each(function(){
+ prp = this.formatCol(pos,iRow);
+ sid= this.p.id;
+ ic = this.p.subGridOptions.plusicon;
+ });
+ return "<td role=\"gridcell\" aria-describedby=\""+sid+"_subgrid\" class=\"ui-sgcollapsed sgcollapsed\" "+prp+"><a href='javascript:void(0);'><span class='ui-icon "+ic+"'></span></a></td>";
+},
+addSubGrid : function( pos, sind ) {
+ return this.each(function(){
+ var ts = this;
+ if (!ts.grid ) { return; }
+ //-------------------------
+ var subGridCell = function(trdiv,cell,pos)
+ {
+ var tddiv = $("<td align='"+ts.p.subGridModel[0].align[pos]+"'></td>").html(cell);
+ $(trdiv).append(tddiv);
+ };
+ var subGridXml = function(sjxml, sbid){
+ var tddiv, i, sgmap,
+ dummy = $("<table cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"),
+ trdiv = $("<tr></tr>");
+ for (i = 0; i<ts.p.subGridModel[0].name.length; i++) {
+ tddiv = $("<th class='ui-state-default ui-th-subgrid ui-th-column ui-th-"+ts.p.direction+"'></th>");
+ $(tddiv).html(ts.p.subGridModel[0].name[i]);
+ $(tddiv).width( ts.p.subGridModel[0].width[i]);
+ $(trdiv).append(tddiv);
+ }
+ $(dummy).append(trdiv);
+ if (sjxml){
+ sgmap = ts.p.xmlReader.subgrid;
+ $(sgmap.root+" "+sgmap.row, sjxml).each( function(){
+ trdiv = $("<tr class='ui-widget-content ui-subtblcell'></tr>");
+ if(sgmap.repeatitems === true) {
+ $(sgmap.cell,this).each( function(i) {
+ subGridCell(trdiv, $(this).text() || ' ',i);
+ });
+ } else {
+ var f = ts.p.subGridModel[0].mapping || ts.p.subGridModel[0].name;
+ if (f) {
+ for (i=0;i<f.length;i++) {
+ subGridCell(trdiv, $(f[i],this).text() || ' ',i);
+ }
+ }
+ }
+ $(dummy).append(trdiv);
+ });
+ }
+ var pID = $("table:first",ts.grid.bDiv).attr("id")+"_";
+ $("#"+$.jgrid.jqID(pID+sbid)).append(dummy);
+ ts.grid.hDiv.loading = false;
+ $("#load_"+$.jgrid.jqID(ts.p.id)).hide();
+ return false;
+ };
+ var subGridJson = function(sjxml, sbid){
+ var tddiv,result,i,cur, sgmap,j,
+ dummy = $("<table cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"),
+ trdiv = $("<tr></tr>");
+ for (i = 0; i<ts.p.subGridModel[0].name.length; i++) {
+ tddiv = $("<th class='ui-state-default ui-th-subgrid ui-th-column ui-th-"+ts.p.direction+"'></th>");
+ $(tddiv).html(ts.p.subGridModel[0].name[i]);
+ $(tddiv).width( ts.p.subGridModel[0].width[i]);
+ $(trdiv).append(tddiv);
+ }
+ $(dummy).append(trdiv);
+ if (sjxml){
+ sgmap = ts.p.jsonReader.subgrid;
+ result = $.jgrid.getAccessor(sjxml, sgmap.root);
+ if ( typeof result !== 'undefined' ) {
+ for (i=0;i<result.length;i++) {
+ cur = result[i];
+ trdiv = $("<tr class='ui-widget-content ui-subtblcell'></tr>");
+ if(sgmap.repeatitems === true) {
+ if(sgmap.cell) { cur=cur[sgmap.cell]; }
+ for (j=0;j<cur.length;j++) {
+ subGridCell(trdiv, cur[j] || ' ',j);
+ }
+ } else {
+ var f = ts.p.subGridModel[0].mapping || ts.p.subGridModel[0].name;
+ if(f.length) {
+ for (j=0;j<f.length;j++) {
+ subGridCell(trdiv, cur[f[j]] || ' ',j);
+ }
+ }
+ }
+ $(dummy).append(trdiv);
+ }
+ }
+ }
+ var pID = $("table:first",ts.grid.bDiv).attr("id")+"_";
+ $("#"+$.jgrid.jqID(pID+sbid)).append(dummy);
+ ts.grid.hDiv.loading = false;
+ $("#load_"+$.jgrid.jqID(ts.p.id)).hide();
+ return false;
+ };
+ var populatesubgrid = function( rd )
+ {
+ var sid,dp, i, j;
+ sid = $(rd).attr("id");
+ dp = {nd_: (new Date().getTime())};
+ dp[ts.p.prmNames.subgridid]=sid;
+ if(!ts.p.subGridModel[0]) { return false; }
+ if(ts.p.subGridModel[0].params) {
+ for(j=0; j < ts.p.subGridModel[0].params.length; j++) {
+ for(i=0; i<ts.p.colModel.length; i++) {
+ if(ts.p.colModel[i].name === ts.p.subGridModel[0].params[j]) {
+ dp[ts.p.colModel[i].name]= $("td:eq("+i+")",rd).text().replace(/\ \;/ig,'');
+ }
+ }
+ }
+ }
+ if(!ts.grid.hDiv.loading) {
+ ts.grid.hDiv.loading = true;
+ $("#load_"+$.jgrid.jqID(ts.p.id)).show();
+ if(!ts.p.subgridtype) { ts.p.subgridtype = ts.p.datatype; }
+ if($.isFunction(ts.p.subgridtype)) {
+ ts.p.subgridtype.call(ts, dp);
+ } else {
+ ts.p.subgridtype = ts.p.subgridtype.toLowerCase();
+ }
+ switch(ts.p.subgridtype) {
+ case "xml":
+ case "json":
+ $.ajax($.extend({
+ type:ts.p.mtype,
+ url: ts.p.subGridUrl,
+ dataType:ts.p.subgridtype,
+ data: $.isFunction(ts.p.serializeSubGridData)? ts.p.serializeSubGridData.call(ts, dp) : dp,
+ complete: function(sxml) {
+ if(ts.p.subgridtype === "xml") {
+ subGridXml(sxml.responseXML, sid);
+ } else {
+ subGridJson($.jgrid.parse(sxml.responseText),sid);
+ }
+ sxml=null;
+ }
+ }, $.jgrid.ajaxOptions, ts.p.ajaxSubgridOptions || {}));
+ break;
+ }
+ }
+ return false;
+ };
+ var _id, pID,atd, nhc=0, bfsc, r;
+ $.each(ts.p.colModel,function(){
+ if(this.hidden === true || this.name === 'rn' || this.name === 'cb') {
+ nhc++;
+ }
+ });
+ var len = ts.rows.length, i=1;
+ if( sind !== undefined && sind > 0) {
+ i = sind;
+ len = sind+1;
+ }
+ while(i < len) {
+ if($(ts.rows[i]).hasClass('jqgrow')) {
+ $(ts.rows[i].cells[pos]).bind('click', function() {
+ var tr = $(this).parent("tr")[0];
+ r = tr.nextSibling;
+ if($(this).hasClass("sgcollapsed")) {
+ pID = ts.p.id;
+ _id = tr.id;
+ if(ts.p.subGridOptions.reloadOnExpand === true || ( ts.p.subGridOptions.reloadOnExpand === false && !$(r).hasClass('ui-subgrid') ) ) {
+ atd = pos >=1 ? "<td colspan='"+pos+"'> </td>":"";
+ bfsc = $(ts).triggerHandler("jqGridSubGridBeforeExpand", [pID + "_" + _id, _id]);
+ bfsc = (bfsc === false || bfsc === 'stop') ? false : true;
+ if(bfsc && $.isFunction(ts.p.subGridBeforeExpand)) {
+ bfsc = ts.p.subGridBeforeExpand.call(ts, pID+"_"+_id,_id);
+ }
+ if(bfsc === false) {return false;}
+ $(tr).after( "<tr role='row' class='ui-subgrid'>"+atd+"<td class='ui-widget-content subgrid-cell'><span class='ui-icon "+ts.p.subGridOptions.openicon+"'></span></td><td colspan='"+parseInt(ts.p.colNames.length-1-nhc,10)+"' class='ui-widget-content subgrid-data'><div id="+pID+"_"+_id+" class='tablediv'></div></td></tr>" );
+ $(ts).triggerHandler("jqGridSubGridRowExpanded", [pID + "_" + _id, _id]);
+ if( $.isFunction(ts.p.subGridRowExpanded)) {
+ ts.p.subGridRowExpanded.call(ts, pID+"_"+ _id,_id);
+ } else {
+ populatesubgrid(tr);
+ }
+ } else {
+ $(r).show();
+ }
+ $(this).html("<a href='javascript:void(0);'><span class='ui-icon "+ts.p.subGridOptions.minusicon+"'></span></a>").removeClass("sgcollapsed").addClass("sgexpanded");
+ if(ts.p.subGridOptions.selectOnExpand) {
+ $(ts).jqGrid('setSelection',_id);
+ }
+ } else if($(this).hasClass("sgexpanded")) {
+ bfsc = $(ts).triggerHandler("jqGridSubGridRowColapsed", [pID + "_" + _id, _id]);
+ bfsc = (bfsc === false || bfsc === 'stop') ? false : true;
+ if( bfsc && $.isFunction(ts.p.subGridRowColapsed)) {
+ _id = tr.id;
+ bfsc = ts.p.subGridRowColapsed.call(ts, pID+"_"+_id,_id );
+ }
+ if(bfsc===false) {return false;}
+ if(ts.p.subGridOptions.reloadOnExpand === true) {
+ $(r).remove(".ui-subgrid");
+ } else if($(r).hasClass('ui-subgrid')) { // incase of dynamic deleting
+ $(r).hide();
+ }
+ $(this).html("<a href='javascript:void(0);'><span class='ui-icon "+ts.p.subGridOptions.plusicon+"'></span></a>").removeClass("sgexpanded").addClass("sgcollapsed");
+ }
+ return false;
+ });
+ }
+ i++;
+ }
+ if(ts.p.subGridOptions.expandOnLoad === true) {
+ $(ts.rows).filter('.jqgrow').each(function(index,row){
+ $(row.cells[0]).click();
+ });
+ }
+ ts.subGridXml = function(xml,sid) {subGridXml(xml,sid);};
+ ts.subGridJson = function(json,sid) {subGridJson(json,sid);};
+ });
+},
+expandSubGridRow : function(rowid) {
+ return this.each(function () {
+ var $t = this;
+ if(!$t.grid && !rowid) {return;}
+ if($t.p.subGrid===true) {
+ var rc = $(this).jqGrid("getInd",rowid,true);
+ if(rc) {
+ var sgc = $("td.sgcollapsed",rc)[0];
+ if(sgc) {
+ $(sgc).trigger("click");
+ }
+ }
+ }
+ });
+},
+collapseSubGridRow : function(rowid) {
+ return this.each(function () {
+ var $t = this;
+ if(!$t.grid && !rowid) {return;}
+ if($t.p.subGrid===true) {
+ var rc = $(this).jqGrid("getInd",rowid,true);
+ if(rc) {
+ var sgc = $("td.sgexpanded",rc)[0];
+ if(sgc) {
+ $(sgc).trigger("click");
+ }
+ }
+ }
+ });
+},
+toggleSubGridRow : function(rowid) {
+ return this.each(function () {
+ var $t = this;
+ if(!$t.grid && !rowid) {return;}
+ if($t.p.subGrid===true) {
+ var rc = $(this).jqGrid("getInd",rowid,true);
+ if(rc) {
+ var sgc = $("td.sgcollapsed",rc)[0];
+ if(sgc) {
+ $(sgc).trigger("click");
+ } else {
+ sgc = $("td.sgexpanded",rc)[0];
+ if(sgc) {
+ $(sgc).trigger("click");
+ }
+ }
+ }
+ }
+ });
+}
+});
+})(jQuery);
+/**
+ * jqGrid extension - Tree Grid
+ * Tony Tomov tony(a)trirand.com
+ * http://trirand.com/blog/
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+**/
+
+/*global document, jQuery, $ */
+(function($) {
+"use strict";
+$.jgrid.extend({
+ setTreeNode : function(i, len){
+ return this.each(function(){
+ var $t = this;
+ if( !$t.grid || !$t.p.treeGrid ) {return;}
+ var expCol = $t.p.expColInd,
+ expanded = $t.p.treeReader.expanded_field,
+ isLeaf = $t.p.treeReader.leaf_field,
+ level = $t.p.treeReader.level_field,
+ icon = $t.p.treeReader.icon_field,
+ loaded = $t.p.treeReader.loaded, lft, rgt, curLevel, ident,lftpos, twrap,
+ ldat, lf;
+ while(i<len) {
+ var ind = $t.rows[i].id, dind = $t.p._index[ind], expan;
+ ldat = $t.p.data[dind];
+ //$t.rows[i].level = ldat[level];
+ if($t.p.treeGridModel == 'nested') {
+ if(!ldat[isLeaf]) {
+ lft = parseInt(ldat[$t.p.treeReader.left_field],10);
+ rgt = parseInt(ldat[$t.p.treeReader.right_field],10);
+ // NS Model
+ ldat[isLeaf] = (rgt === lft+1) ? 'true' : 'false';
+ $t.rows[i].cells[$t.p._treeleafpos].innerHTML = ldat[isLeaf];
+ }
+ }
+ //else {
+ //row.parent_id = rd[$t.p.treeReader.parent_id_field];
+ //}
+ curLevel = parseInt(ldat[level],10);
+ if($t.p.tree_root_level === 0) {
+ ident = curLevel+1;
+ lftpos = curLevel;
+ } else {
+ ident = curLevel;
+ lftpos = curLevel -1;
+ }
+ twrap = "<div class='tree-wrap tree-wrap-"+$t.p.direction+"' style='width:"+(ident*18)+"px;'>";
+ twrap += "<div style='"+($t.p.direction=="rtl" ? "right:" : "left:")+(lftpos*18)+"px;' class='ui-icon ";
+
+
+ if(ldat[loaded] !== undefined) {
+ if(ldat[loaded]=="true" || ldat[loaded]===true) {
+ ldat[loaded] = true;
+ } else {
+ ldat[loaded] = false;
+ }
+ }
+ if(ldat[isLeaf] == "true" || ldat[isLeaf] === true) {
+ twrap += ((ldat[icon] !== undefined && ldat[icon] !== "") ? ldat[icon] : $t.p.treeIcons.leaf)+" tree-leaf treeclick";
+ ldat[isLeaf] = true;
+ lf="leaf";
+ } else {
+ ldat[isLeaf] = false;
+ lf="";
+ }
+ ldat[expanded] = ((ldat[expanded] == "true" || ldat[expanded] === true) ? true : false) && ldat[loaded];
+ if(ldat[expanded] === false) {
+ twrap += ((ldat[isLeaf] === true) ? "'" : $t.p.treeIcons.plus+" tree-plus treeclick'");
+ } else {
+ twrap += ((ldat[isLeaf] === true) ? "'" : $t.p.treeIcons.minus+" tree-minus treeclick'");
+ }
+
+ twrap += "></div></div>";
+ $($t.rows[i].cells[expCol]).wrapInner("<span class='cell-wrapper"+lf+"'></span>").prepend(twrap);
+
+ if(curLevel !== parseInt($t.p.tree_root_level,10)) {
+ var pn = $($t).jqGrid('getNodeParent',ldat);
+ expan = pn && pn.hasOwnProperty(expanded) ? pn[expanded] : true;
+ if( !expan ){
+ $($t.rows[i]).css("display","none");
+ }
+ }
+ $($t.rows[i].cells[expCol])
+ .find("div.treeclick")
+ .bind("click",function(e){
+ var target = e.target || e.srcElement,
+ ind2 =$(target,$t.rows).closest("tr.jqgrow")[0].id,
+ pos = $t.p._index[ind2];
+ if(!$t.p.data[pos][isLeaf]){
+ if($t.p.data[pos][expanded]){
+ $($t).jqGrid("collapseRow",$t.p.data[pos]);
+ $($t).jqGrid("collapseNode",$t.p.data[pos]);
+ } else {
+ $($t).jqGrid("expandRow",$t.p.data[pos]);
+ $($t).jqGrid("expandNode",$t.p.data[pos]);
+ }
+ }
+ return false;
+ });
+ if($t.p.ExpandColClick === true) {
+ $($t.rows[i].cells[expCol])
+ .find("span.cell-wrapper")
+ .css("cursor","pointer")
+ .bind("click",function(e) {
+ var target = e.target || e.srcElement,
+ ind2 =$(target,$t.rows).closest("tr.jqgrow")[0].id,
+ pos = $t.p._index[ind2];
+ if(!$t.p.data[pos][isLeaf]){
+ if($t.p.data[pos][expanded]){
+ $($t).jqGrid("collapseRow",$t.p.data[pos]);
+ $($t).jqGrid("collapseNode",$t.p.data[pos]);
+ } else {
+ $($t).jqGrid("expandRow",$t.p.data[pos]);
+ $($t).jqGrid("expandNode",$t.p.data[pos]);
+ }
+ }
+ $($t).jqGrid("setSelection",ind2);
+ return false;
+ });
+ }
+ i++;
+ }
+
+ });
+ },
+ setTreeGrid : function() {
+ return this.each(function (){
+ var $t = this, i=0, pico, ecol = false, nm, key, dupcols=[];
+ if(!$t.p.treeGrid) {return;}
+ if(!$t.p.treedatatype ) {$.extend($t.p,{treedatatype: $t.p.datatype});}
+ $t.p.subGrid = false;$t.p.altRows =false;
+ $t.p.pgbuttons = false;$t.p.pginput = false;
+ $t.p.gridview = true;
+ if($t.p.rowTotal === null ) { $t.p.rowNum = 10000; }
+ $t.p.multiselect = false;$t.p.rowList = [];
+ $t.p.expColInd = 0;
+ pico = 'ui-icon-triangle-1-' + ($t.p.direction=="rtl" ? 'w' : 'e');
+ $t.p.treeIcons = $.extend({plus:pico,minus:'ui-icon-triangle-1-s',leaf:'ui-icon-radio-off'},$t.p.treeIcons || {});
+ if($t.p.treeGridModel == 'nested') {
+ $t.p.treeReader = $.extend({
+ level_field: "level",
+ left_field:"lft",
+ right_field: "rgt",
+ leaf_field: "isLeaf",
+ expanded_field: "expanded",
+ loaded: "loaded",
+ icon_field: "icon"
+ },$t.p.treeReader);
+ } else if($t.p.treeGridModel == 'adjacency') {
+ $t.p.treeReader = $.extend({
+ level_field: "level",
+ parent_id_field: "parent",
+ leaf_field: "isLeaf",
+ expanded_field: "expanded",
+ loaded: "loaded",
+ icon_field: "icon"
+ },$t.p.treeReader );
+ }
+ for ( key in $t.p.colModel){
+ if($t.p.colModel.hasOwnProperty(key)) {
+ nm = $t.p.colModel[key].name;
+ if( nm == $t.p.ExpandColumn && !ecol ) {
+ ecol = true;
+ $t.p.expColInd = i;
+ }
+ i++;
+ //
+ for(var tkey in $t.p.treeReader) {
+ if($t.p.treeReader[tkey] == nm) {
+ dupcols.push(nm);
+ }
+ }
+ }
+ }
+ $.each($t.p.treeReader,function(j,n){
+ if(n && $.inArray(n, dupcols) === -1){
+ if(j==='leaf_field') { $t.p._treeleafpos= i; }
+ i++;
+ $t.p.colNames.push(n);
+ $t.p.colModel.push({name:n,width:1,hidden:true,sortable:false,resizable:false,hidedlg:true,editable:true,search:false});
+ }
+ });
+ });
+ },
+ expandRow: function (record){
+ this.each(function(){
+ var $t = this;
+ if(!$t.grid || !$t.p.treeGrid) {return;}
+ var childern = $($t).jqGrid("getNodeChildren",record),
+ //if ($($t).jqGrid("isVisibleNode",record)) {
+ expanded = $t.p.treeReader.expanded_field,
+ rows = $t.rows;
+ $(childern).each(function(){
+ var id = $.jgrid.getAccessor(this,$t.p.localReader.id);
+ $(rows.namedItem(id)).css("display","");
+ if(this[expanded]) {
+ $($t).jqGrid("expandRow",this);
+ }
+ });
+ //}
+ });
+ },
+ collapseRow : function (record) {
+ this.each(function(){
+ var $t = this;
+ if(!$t.grid || !$t.p.treeGrid) {return;}
+ var childern = $($t).jqGrid("getNodeChildren",record),
+ expanded = $t.p.treeReader.expanded_field,
+ rows = $t.rows;
+ $(childern).each(function(){
+ var id = $.jgrid.getAccessor(this,$t.p.localReader.id);
+ $(rows.namedItem(id)).css("display","none");
+ if(this[expanded]){
+ $($t).jqGrid("collapseRow",this);
+ }
+ });
+ });
+ },
+ // NS ,adjacency models
+ getRootNodes : function() {
+ var result = [];
+ this.each(function(){
+ var $t = this;
+ if(!$t.grid || !$t.p.treeGrid) {return;}
+ switch ($t.p.treeGridModel) {
+ case 'nested' :
+ var level = $t.p.treeReader.level_field;
+ $($t.p.data).each(function(){
+ if(parseInt(this[level],10) === parseInt($t.p.tree_root_level,10)) {
+ result.push(this);
+ }
+ });
+ break;
+ case 'adjacency' :
+ var parent_id = $t.p.treeReader.parent_id_field;
+ $($t.p.data).each(function(){
+ if(this[parent_id] === null || String(this[parent_id]).toLowerCase() == "null") {
+ result.push(this);
+ }
+ });
+ break;
+ }
+ });
+ return result;
+ },
+ getNodeDepth : function(rc) {
+ var ret = null;
+ this.each(function(){
+ if(!this.grid || !this.p.treeGrid) {return;}
+ var $t = this;
+ switch ($t.p.treeGridModel) {
+ case 'nested' :
+ var level = $t.p.treeReader.level_field;
+ ret = parseInt(rc[level],10) - parseInt($t.p.tree_root_level,10);
+ break;
+ case 'adjacency' :
+ ret = $($t).jqGrid("getNodeAncestors",rc).length;
+ break;
+ }
+ });
+ return ret;
+ },
+ getNodeParent : function(rc) {
+ var result = null;
+ this.each(function(){
+ var $t = this;
+ if(!$t.grid || !$t.p.treeGrid) {return;}
+ switch ($t.p.treeGridModel) {
+ case 'nested' :
+ var lftc = $t.p.treeReader.left_field,
+ rgtc = $t.p.treeReader.right_field,
+ levelc = $t.p.treeReader.level_field,
+ lft = parseInt(rc[lftc],10), rgt = parseInt(rc[rgtc],10), level = parseInt(rc[levelc],10);
+ $(this.p.data).each(function(){
+ if(parseInt(this[levelc],10) === level-1 && parseInt(this[lftc],10) < lft && parseInt(this[rgtc],10) > rgt) {
+ result = this;
+ return false;
+ }
+ });
+ break;
+ case 'adjacency' :
+ var parent_id = $t.p.treeReader.parent_id_field,
+ dtid = $t.p.localReader.id;
+ $(this.p.data).each(function(){
+ if(this[dtid] == rc[parent_id] ) {
+ result = this;
+ return false;
+ }
+ });
+ break;
+ }
+ });
+ return result;
+ },
+ getNodeChildren : function(rc) {
+ var result = [];
+ this.each(function(){
+ var $t = this;
+ if(!$t.grid || !$t.p.treeGrid) {return;}
+ switch ($t.p.treeGridModel) {
+ case 'nested' :
+ var lftc = $t.p.treeReader.left_field,
+ rgtc = $t.p.treeReader.right_field,
+ levelc = $t.p.treeReader.level_field,
+ lft = parseInt(rc[lftc],10), rgt = parseInt(rc[rgtc],10), level = parseInt(rc[levelc],10);
+ $(this.p.data).each(function(){
+ if(parseInt(this[levelc],10) === level+1 && parseInt(this[lftc],10) > lft && parseInt(this[rgtc],10) < rgt) {
+ result.push(this);
+ }
+ });
+ break;
+ case 'adjacency' :
+ var parent_id = $t.p.treeReader.parent_id_field,
+ dtid = $t.p.localReader.id;
+ $(this.p.data).each(function(){
+ if(this[parent_id] == rc[dtid]) {
+ result.push(this);
+ }
+ });
+ break;
+ }
+ });
+ return result;
+ },
+ getFullTreeNode : function(rc) {
+ var result = [];
+ this.each(function(){
+ var $t = this, len;
+ if(!$t.grid || !$t.p.treeGrid) {return;}
+ switch ($t.p.treeGridModel) {
+ case 'nested' :
+ var lftc = $t.p.treeReader.left_field,
+ rgtc = $t.p.treeReader.right_field,
+ levelc = $t.p.treeReader.level_field,
+ lft = parseInt(rc[lftc],10), rgt = parseInt(rc[rgtc],10), level = parseInt(rc[levelc],10);
+ $(this.p.data).each(function(){
+ if(parseInt(this[levelc],10) >= level && parseInt(this[lftc],10) >= lft && parseInt(this[lftc],10) <= rgt) {
+ result.push(this);
+ }
+ });
+ break;
+ case 'adjacency' :
+ if(rc) {
+ result.push(rc);
+ var parent_id = $t.p.treeReader.parent_id_field,
+ dtid = $t.p.localReader.id;
+ $(this.p.data).each(function(i){
+ len = result.length;
+ for (i = 0; i < len; i++) {
+ if (result[i][dtid] == this[parent_id]) {
+ result.push(this);
+ break;
+ }
+ }
+ });
+ }
+ break;
+ }
+ });
+ return result;
+ },
+ // End NS, adjacency Model
+ getNodeAncestors : function(rc) {
+ var ancestors = [];
+ this.each(function(){
+ if(!this.grid || !this.p.treeGrid) {return;}
+ var parent = $(this).jqGrid("getNodeParent",rc);
+ while (parent) {
+ ancestors.push(parent);
+ parent = $(this).jqGrid("getNodeParent",parent);
+ }
+ });
+ return ancestors;
+ },
+ isVisibleNode : function(rc) {
+ var result = true;
+ this.each(function(){
+ var $t = this;
+ if(!$t.grid || !$t.p.treeGrid) {return;}
+ var ancestors = $($t).jqGrid("getNodeAncestors",rc),
+ expanded = $t.p.treeReader.expanded_field;
+ $(ancestors).each(function(){
+ result = result && this[expanded];
+ if(!result) {return false;}
+ });
+ });
+ return result;
+ },
+ isNodeLoaded : function(rc) {
+ var result;
+ this.each(function(){
+ var $t = this;
+ if(!$t.grid || !$t.p.treeGrid) {return;}
+ var isLeaf = $t.p.treeReader.leaf_field;
+ if(rc !== undefined ) {
+ if(rc.loaded !== undefined) {
+ result = rc.loaded;
+ } else if( rc[isLeaf] || $($t).jqGrid("getNodeChildren",rc).length > 0){
+ result = true;
+ } else {
+ result = false;
+ }
+ } else {
+ result = false;
+ }
+ });
+ return result;
+ },
+ expandNode : function(rc) {
+ return this.each(function(){
+ if(!this.grid || !this.p.treeGrid) {return;}
+ var expanded = this.p.treeReader.expanded_field,
+ parent = this.p.treeReader.parent_id_field,
+ loaded = this.p.treeReader.loaded,
+ level = this.p.treeReader.level_field,
+ lft = this.p.treeReader.left_field,
+ rgt = this.p.treeReader.right_field;
+
+ if(!rc[expanded]) {
+ var id = $.jgrid.getAccessor(rc,this.p.localReader.id);
+ var rc1 = $("#"+$.jgrid.jqID(id),this.grid.bDiv)[0];
+ var position = this.p._index[id];
+ if( $(this).jqGrid("isNodeLoaded",this.p.data[position]) ) {
+ rc[expanded] = true;
+ $("div.treeclick",rc1).removeClass(this.p.treeIcons.plus+" tree-plus").addClass(this.p.treeIcons.minus+" tree-minus");
+ } else if (!this.grid.hDiv.loading) {
+ rc[expanded] = true;
+ $("div.treeclick",rc1).removeClass(this.p.treeIcons.plus+" tree-plus").addClass(this.p.treeIcons.minus+" tree-minus");
+ this.p.treeANode = rc1.rowIndex;
+ this.p.datatype = this.p.treedatatype;
+ if(this.p.treeGridModel == 'nested') {
+ $(this).jqGrid("setGridParam",{postData:{nodeid:id,n_left:rc[lft],n_right:rc[rgt],n_level:rc[level]}});
+ } else {
+ $(this).jqGrid("setGridParam",{postData:{nodeid:id,parentid:rc[parent],n_level:rc[level]}} );
+ }
+ $(this).trigger("reloadGrid");
+ rc[loaded] = true;
+ if(this.p.treeGridModel == 'nested') {
+ $(this).jqGrid("setGridParam",{postData:{nodeid:'',n_left:'',n_right:'',n_level:''}});
+ } else {
+ $(this).jqGrid("setGridParam",{postData:{nodeid:'',parentid:'',n_level:''}});
+ }
+ }
+ }
+ });
+ },
+ collapseNode : function(rc) {
+ return this.each(function(){
+ if(!this.grid || !this.p.treeGrid) {return;}
+ var expanded = this.p.treeReader.expanded_field;
+ if(rc[expanded]) {
+ rc[expanded] = false;
+ var id = $.jgrid.getAccessor(rc,this.p.localReader.id);
+ var rc1 = $("#"+$.jgrid.jqID(id),this.grid.bDiv)[0];
+ $("div.treeclick",rc1).removeClass(this.p.treeIcons.minus+" tree-minus").addClass(this.p.treeIcons.plus+" tree-plus");
+ }
+ });
+ },
+ SortTree : function( sortname, newDir, st, datefmt) {
+ return this.each(function(){
+ if(!this.grid || !this.p.treeGrid) {return;}
+ var i, len,
+ rec, records = [], $t = this, query, roots,
+ rt = $(this).jqGrid("getRootNodes");
+ // Sorting roots
+ query = $.jgrid.from(rt);
+ query.orderBy(sortname,newDir,st, datefmt);
+ roots = query.select();
+
+ // Sorting children
+ for (i = 0, len = roots.length; i < len; i++) {
+ rec = roots[i];
+ records.push(rec);
+ $(this).jqGrid("collectChildrenSortTree",records, rec, sortname, newDir,st, datefmt);
+ }
+ $.each(records, function(index) {
+ var id = $.jgrid.getAccessor(this,$t.p.localReader.id);
+ $('#'+$.jgrid.jqID($t.p.id)+ ' tbody tr:eq('+index+')').after($('tr#'+$.jgrid.jqID(id),$t.grid.bDiv));
+ });
+ query = null;roots=null;records=null;
+ });
+ },
+ collectChildrenSortTree : function(records, rec, sortname, newDir,st, datefmt) {
+ return this.each(function(){
+ if(!this.grid || !this.p.treeGrid) {return;}
+ var i, len,
+ child, ch, query, children;
+ ch = $(this).jqGrid("getNodeChildren",rec);
+ query = $.jgrid.from(ch);
+ query.orderBy(sortname, newDir, st, datefmt);
+ children = query.select();
+ for (i = 0, len = children.length; i < len; i++) {
+ child = children[i];
+ records.push(child);
+ $(this).jqGrid("collectChildrenSortTree",records, child, sortname, newDir, st, datefmt);
+ }
+ });
+ },
+ // experimental
+ setTreeRow : function(rowid, data) {
+ var success=false;
+ this.each(function(){
+ var t = this;
+ if(!t.grid || !t.p.treeGrid) {return;}
+ success = $(t).jqGrid("setRowData",rowid,data);
+ });
+ return success;
+ },
+ delTreeNode : function (rowid) {
+ return this.each(function () {
+ var $t = this, rid = $t.p.localReader.id,
+ left = $t.p.treeReader.left_field,
+ right = $t.p.treeReader.right_field, myright, width, res, key;
+ if(!$t.grid || !$t.p.treeGrid) {return;}
+ var rc = $t.p._index[rowid];
+ if (rc !== undefined) {
+ // nested
+ myright = parseInt($t.p.data[rc][right],10);
+ width = myright - parseInt($t.p.data[rc][left],10) + 1;
+ var dr = $($t).jqGrid("getFullTreeNode",$t.p.data[rc]);
+ if(dr.length>0){
+ for (var i=0;i<dr.length;i++){
+ $($t).jqGrid("delRowData",dr[i][rid]);
+ }
+ }
+ if( $t.p.treeGridModel === "nested") {
+ // ToDo - update grid data
+ res = $.jgrid.from($t.p.data)
+ .greater(left,myright,{stype:'integer'})
+ .select();
+ if(res.length) {
+ for( key in res) {
+ if(res.hasOwnProperty(key)) {
+ res[key][left] = parseInt(res[key][left],10) - width ;
+ }
+ }
+ }
+ res = $.jgrid.from($t.p.data)
+ .greater(right,myright,{stype:'integer'})
+ .select();
+ if(res.length) {
+ for( key in res) {
+ if(res.hasOwnProperty(key)) {
+ res[key][right] = parseInt(res[key][right],10) - width ;
+ }
+ }
+ }
+ }
+ }
+ });
+ },
+ addChildNode : function( nodeid, parentid, data ) {
+ //return this.each(function(){
+ var $t = this[0];
+ if(data) {
+ // we suppose tha the id is autoincremet and
+ var expanded = $t.p.treeReader.expanded_field,
+ isLeaf = $t.p.treeReader.leaf_field,
+ level = $t.p.treeReader.level_field,
+ //icon = $t.p.treeReader.icon_field,
+ parent = $t.p.treeReader.parent_id_field,
+ left = $t.p.treeReader.left_field,
+ right = $t.p.treeReader.right_field,
+ loaded = $t.p.treeReader.loaded,
+ method, parentindex, parentdata, parentlevel, i, len, max=0, rowind = parentid, leaf, maxright;
+
+ if ( typeof nodeid === 'undefined' || nodeid === null ) {
+ i = $t.p.data.length-1;
+ if( i>= 0 ) {
+ while(i>=0){max = Math.max(max, parseInt($t.p.data[i][$t.p.localReader.id],10)); i--;}
+ }
+ nodeid = max+1;
+ }
+ var prow = $($t).jqGrid('getInd', parentid);
+ leaf = false;
+ // if not a parent we assume root
+ if ( parentid === undefined || parentid === null || parentid==="") {
+ parentid = null;
+ rowind = null;
+ method = 'last';
+ parentlevel = $t.p.tree_root_level;
+ i = $t.p.data.length+1;
+ } else {
+ method = 'after';
+ parentindex = $t.p._index[parentid];
+ parentdata = $t.p.data[parentindex];
+ parentid = parentdata[$t.p.localReader.id];
+ parentlevel = parseInt(parentdata[level],10)+1;
+ var childs = $($t).jqGrid('getFullTreeNode', parentdata);
+ // if there are child nodes get the last index of it
+ if(childs.length) {
+ i = childs[childs.length-1][$t.p.localReader.id];
+ rowind = i;
+ i = $($t).jqGrid('getInd',rowind)+1;
+ } else {
+ i = $($t).jqGrid('getInd', parentid)+1;
+ }
+ // if the node is leaf
+ if(parentdata[isLeaf]) {
+ leaf = true;
+ parentdata[expanded] = true;
+ //var prow = $($t).jqGrid('getInd', parentid);
+ $($t.rows[prow])
+ .find("span.cell-wrapperleaf").removeClass("cell-wrapperleaf").addClass("cell-wrapper")
+ .end()
+ .find("div.tree-leaf").removeClass($t.p.treeIcons.leaf+" tree-leaf").addClass($t.p.treeIcons.minus+" tree-minus");
+ $t.p.data[parentindex][isLeaf] = false;
+ parentdata[loaded] = true;
+ }
+ }
+ len = i+1;
+
+ data[expanded] = false;
+ data[loaded] = true;
+ data[level] = parentlevel;
+ data[isLeaf] = true;
+ if( $t.p.treeGridModel === "adjacency") {
+ data[parent] = parentid;
+ }
+ if( $t.p.treeGridModel === "nested") {
+ // this method requiere more attention
+ var query, res, key;
+ //maxright = parseInt(maxright,10);
+ // ToDo - update grid data
+ if(parentid !== null) {
+ maxright = parseInt(parentdata[right],10);
+ query = $.jgrid.from($t.p.data);
+ query = query.greaterOrEquals(right,maxright,{stype:'integer'});
+ res = query.select();
+ if(res.length) {
+ for( key in res) {
+ if(res.hasOwnProperty(key)) {
+ res[key][left] = res[key][left] > maxright ? parseInt(res[key][left],10) +2 : res[key][left];
+ res[key][right] = res[key][right] >= maxright ? parseInt(res[key][right],10) +2 : res[key][right];
+ }
+ }
+ }
+ data[left] = maxright;
+ data[right]= maxright+1;
+ } else {
+ maxright = parseInt( $($t).jqGrid('getCol', right, false, 'max'), 10);
+ res = $.jgrid.from($t.p.data)
+ .greater(left,maxright,{stype:'integer'})
+ .select();
+ if(res.length) {
+ for( key in res) {
+ if(res.hasOwnProperty(key)) {
+ res[key][left] = parseInt(res[key][left],10) +2 ;
+ }
+ }
+ }
+ res = $.jgrid.from($t.p.data)
+ .greater(right,maxright,{stype:'integer'})
+ .select();
+ if(res.length) {
+ for( key in res) {
+ if(res.hasOwnProperty(key)) {
+ res[key][right] = parseInt(res[key][right],10) +2 ;
+ }
+ }
+ }
+ data[left] = maxright+1;
+ data[right] = maxright + 2;
+ }
+ }
+ if( parentid === null || $($t).jqGrid("isNodeLoaded",parentdata) || leaf ) {
+ $($t).jqGrid('addRowData', nodeid, data, method, rowind);
+ $($t).jqGrid('setTreeNode', i, len);
+ }
+ if(parentdata && !parentdata[expanded]) {
+ $($t.rows[prow])
+ .find("div.treeclick")
+ .click();
+ }
+ }
+ //});
+ }
+});
+})(jQuery);
+// Grouping module
+;(function($){
+"use strict";
+$.extend($.jgrid,{
+ template : function(format){ //jqgformat
+ var args = $.makeArray(arguments).slice(1), j = 1;
+ if(format===undefined) { format = ""; }
+ return format.replace(/\{([\w\-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g, function(m,i){
+ if(!isNaN(parseInt(i,10))) {
+ j++;
+ return args[parseInt(i,10)];
+ } else {
+ var nmarr = args[ j ],
+ k = nmarr.length;
+ while(k--) {
+ if(i===nmarr[k].nm) {
+ return nmarr[k].v;
+ break;
+ }
+ }
+ j++;
+ }
+ });
+ }
+});
+$.jgrid.extend({
+ groupingSetup : function () {
+ return this.each(function (){
+ var $t = this,
+ grp = $t.p.groupingView;
+ if(grp !== null && ( (typeof grp === 'object') || $.isFunction(grp) ) ) {
+ if(!grp.groupField.length) {
+ $t.p.grouping = false;
+ } else {
+ if ( typeof(grp.visibiltyOnNextGrouping) === 'undefined') {
+ grp.visibiltyOnNextGrouping = [];
+ }
+
+ grp.lastvalues=[];
+ grp.groups =[];
+ grp.counters =[];
+ for(var i=0;i<grp.groupField.length;i++) {
+ if(!grp.groupOrder[i]) {
+ grp.groupOrder[i] = 'asc';
+ }
+ if(!grp.groupText[i]) {
+ grp.groupText[i] = '{0}';
+ }
+ if( typeof(grp.groupColumnShow[i]) !== 'boolean') {
+ grp.groupColumnShow[i] = true;
+ }
+ if( typeof(grp.groupSummary[i]) !== 'boolean') {
+ grp.groupSummary[i] = false;
+ }
+ if(grp.groupColumnShow[i] === true) {
+ grp.visibiltyOnNextGrouping[i] = true;
+ $($t).jqGrid('showCol',grp.groupField[i]);
+ } else {
+ grp.visibiltyOnNextGrouping[i] = $("#"+$.jgrid.jqID($t.p.id+"_"+grp.groupField[i])).is(":visible");
+ $($t).jqGrid('hideCol',grp.groupField[i]);
+ }
+ }
+ grp.summary =[];
+ var cm = $t.p.colModel;
+ for(var j=0, cml = cm.length; j < cml; j++) {
+ if(cm[j].summaryType) {
+ grp.summary.push({nm:cm[j].name,st:cm[j].summaryType, v: '', sr: cm[j].summaryRound, srt: cm[j].summaryRoundType || 'round'});
+ }
+ }
+ }
+ } else {
+ $t.p.grouping = false;
+ }
+ });
+ },
+ groupingPrepare : function (rData, gdata, record, irow) {
+ this.each(function(){
+ var grp = this.p.groupingView, $t= this;
+ var grlen = grp.groupField.length,
+ fieldName,
+ v,
+ changed = 0;
+ for(var i=0;i<grlen;i++) {
+ fieldName = grp.groupField[i];
+ v = record[fieldName];
+ if( v !== undefined ) {
+ if(irow === 0 ) {
+ // First record always starts a new group
+ grp.groups.push({idx:i,dataIndex:fieldName,value:v, startRow: irow, cnt:1, summary : [] } );
+ grp.lastvalues[i] = v;
+ grp.counters[i] = {cnt:1, pos:grp.groups.length-1, summary: $.extend(true,[],grp.summary)};
+ $.each(grp.counters[i].summary,function() {
+ if ($.isFunction(this.st)) {
+ this.v = this.st.call($t, this.v, this.nm, record);
+ } else {
+ this.v = $($t).jqGrid('groupingCalculations.handler',this.st, this.v, this.nm, this.sr, this.srt, record);
+ }
+ });
+ grp.groups[grp.counters[i].pos].summary = grp.counters[i].summary;
+ } else {
+ if( (typeof(v) !== "object" && (grp.lastvalues[i] !== v) ) ) {
+ // This record is not in same group as previous one
+ grp.groups.push({idx:i,dataIndex:fieldName,value:v, startRow: irow, cnt:1, summary : [] } );
+ grp.lastvalues[i] = v;
+ changed = 1;
+ grp.counters[i] = {cnt:1, pos:grp.groups.length-1, summary: $.extend(true,[],grp.summary)};
+ $.each(grp.counters[i].summary,function() {
+ if ($.isFunction(this.st)) {
+ this.v = this.st.call($t, this.v, this.nm, record);
+ } else {
+ this.v = $($t).jqGrid('groupingCalculations.handler',this.st, this.v, this.nm, this.sr, this.srt, record);
+ }
+ });
+ grp.groups[grp.counters[i].pos].summary = grp.counters[i].summary;
+ } else {
+ if (changed === 1) {
+ // This group has changed because an earlier group changed.
+ grp.groups.push({idx:i,dataIndex:fieldName,value:v, startRow: irow, cnt:1, summary : [] } );
+ grp.lastvalues[i] = v;
+ grp.counters[i] = {cnt:1, pos:grp.groups.length-1, summary: $.extend(true,[],grp.summary)};
+ $.each(grp.counters[i].summary,function() {
+ if ($.isFunction(this.st)) {
+ this.v = this.st.call($t, this.v, this.nm, record);
+ } else {
+ this.v = $($t).jqGrid('groupingCalculations.handler',this.st, this.v, this.nm, this.sr, this.srt, record);
+ }
+ });
+ grp.groups[grp.counters[i].pos].summary = grp.counters[i].summary;
+ } else {
+ grp.counters[i].cnt += 1;
+ grp.groups[grp.counters[i].pos].cnt = grp.counters[i].cnt;
+ $.each(grp.counters[i].summary,function() {
+ if ($.isFunction(this.st)) {
+ this.v = this.st.call($t, this.v, this.nm, record);
+ } else {
+ this.v = $($t).jqGrid('groupingCalculations.handler',this.st, this.v, this.nm, this.sr, this.srt, record);
+ }
+ });
+ grp.groups[grp.counters[i].pos].summary = grp.counters[i].summary;
+ }
+ }
+ }
+ }
+ }
+ gdata.push( rData );
+ });
+ return gdata;
+ },
+ groupingToggle : function(hid){
+ this.each(function(){
+ var $t = this,
+ grp = $t.p.groupingView,
+ strpos = hid.split('_'),
+ //uid = hid.substring(0,strpos+1),
+ num = parseInt(strpos[strpos.length-2], 10);
+ strpos.splice(strpos.length-2,2);
+ var uid = strpos.join("_"),
+ minus = grp.minusicon,
+ plus = grp.plusicon,
+ tar = $("#"+$.jgrid.jqID(hid)),
+ r = tar.length ? tar[0].nextSibling : null,
+ tarspan = $("#"+$.jgrid.jqID(hid)+" span."+"tree-wrap-"+$t.p.direction),
+ collapsed = false, tspan;
+ if( tarspan.hasClass(minus) ) {
+ if(grp.showSummaryOnHide) {
+ if(r){
+ while(r) {
+ if($(r).hasClass('jqfoot') ) {
+ var lv = parseInt($(r).attr("jqfootlevel"),10);
+ if( lv <= num) {
+ break;
+ }
+ }
+ $(r).hide();
+ r = r.nextSibling;
+ }
+ }
+ } else {
+ if(r){
+ while(r) {
+ if( $(r).hasClass(uid+"_"+String(num) ) || $(r).hasClass(uid+"_"+String(num-1))) { break; }
+ $(r).hide();
+ r = r.nextSibling;
+ }
+ }
+ }
+ tarspan.removeClass(minus).addClass(plus);
+ collapsed = true;
+ } else {
+ if(r){
+ while(r) {
+ if($(r).hasClass(uid+"_"+String(num)) || $(r).hasClass(uid+"_"+String(num-1)) ) { break; }
+ $(r).show();
+ tspan = $(r).find("span."+"tree-wrap-"+$t.p.direction);
+ if( tspan && $(tspan).hasClass(plus) ) {
+ $(tspan).removeClass(plus).addClass(minus);
+ }
+ r = r.nextSibling;
+ }
+ }
+ tarspan.removeClass(plus).addClass(minus);
+ }
+ $($t).triggerHandler("jqGridGroupingClickGroup", [hid , collapsed]);
+ if( $.isFunction($t.p.onClickGroup)) { $t.p.onClickGroup.call($t, hid , collapsed); }
+
+ });
+ return false;
+ },
+ groupingRender : function (grdata, colspans ) {
+ return this.each(function(){
+ var $t = this,
+ grp = $t.p.groupingView,
+ str = "", icon = "", hid, clid, pmrtl = grp.groupCollapse ? grp.plusicon : grp.minusicon, gv, cp=[], ii, len =grp.groupField.length;
+ pmrtl += " tree-wrap-"+$t.p.direction;
+ ii = 0;
+ $.each($t.p.colModel, function (i,n){
+ for(var ii=0;ii<len;ii++) {
+ if(grp.groupField[ii] === n.name ) {
+ cp[ii] = i;
+ break;
+ }
+ }
+ });
+ var toEnd = 0;
+ function findGroupIdx( ind , offset, grp) {
+ if(offset===0) {
+ return grp[ind];
+ } else {
+ var id = grp[ind].idx;
+ if(id===0) { return grp[ind]; }
+ for(var i=ind;i >= 0; i--) {
+ if(grp[i].idx === id-offset) {
+ return grp[i];
+ }
+ }
+ }
+ }
+ var sumreverse = $.makeArray(grp.groupSummary);
+ sumreverse.reverse();
+ $.each(grp.groups,function(i,n){
+ toEnd++;
+ clid = $t.p.id+"ghead_"+n.idx;
+ hid = clid+"_"+i;
+ icon = "<span style='cursor:pointer;' class='ui-icon "+pmrtl+"' onclick=\"jQuery('#"+$.jgrid.jqID($t.p.id)+"').jqGrid('groupingToggle','"+hid+"');return false;\"></span>";
+ try {
+ gv = $t.formatter(hid, n.value, cp[n.idx], n.value );
+ } catch (egv) {
+ gv = n.value;
+ }
+ str += "<tr id=\""+hid+"\" role=\"row\" class= \"ui-widget-content jqgroup ui-row-"+$t.p.direction+" "+clid+"\"><td style=\"padding-left:"+(n.idx * 12) + "px;"+"\" colspan=\""+colspans+"\">"+icon+$.jgrid.template(grp.groupText[n.idx], gv, n.cnt, n.summary)+"</td></tr>";
+ var leaf = len-1 === n.idx;
+ if( leaf ) {
+ var gg = grp.groups[i+1];
+ var end = gg !== undefined ? grp.groups[i+1].startRow : grdata.length;
+ for(var kk=n.startRow;kk<end;kk++) {
+ str += grdata[kk].join('');
+ }
+ var jj;
+ if (gg !== undefined) {
+ for (jj = 0; jj < grp.groupField.length; jj++) {
+ if (gg.dataIndex === grp.groupField[jj]) {
+ break;
+ }
+ }
+ toEnd = grp.groupField.length - jj;
+ }
+ for (var ik = 0; ik < toEnd; ik++) {
+ if(!sumreverse[ik]) { continue; }
+ var hhdr = "";
+ if(grp.groupCollapse && !grp.showSummaryOnHide) {
+ hhdr = " style=\"display:none;\"";
+ }
+ str += "<tr"+hhdr+" jqfootlevel=\""+(n.idx-ik)+"\" role=\"row\" class=\"ui-widget-content jqfoot ui-row-"+$t.p.direction+"\">";
+ var fdata = findGroupIdx(i, ik, grp.groups),
+ cm = $t.p.colModel,
+ vv, grlen = fdata.cnt;
+ for(var k=0; k<colspans;k++) {
+ var tmpdata = "<td "+$t.formatCol(k,1,'')+"> </td>",
+ tplfld = "{0}";
+ $.each(fdata.summary,function(){
+ if(this.nm === cm[k].name) {
+ if(cm[k].summaryTpl) {
+ tplfld = cm[k].summaryTpl;
+ }
+ if(typeof(this.st) === 'string' && this.st.toLowerCase() === 'avg') {
+ if(this.v && grlen > 0) {
+ this.v = (this.v/grlen);
+ }
+ }
+ try {
+ vv = $t.formatter('', this.v, k, this);
+ } catch (ef) {
+ vv = this.v;
+ }
+ tmpdata= "<td "+$t.formatCol(k,1,'')+">"+$.jgrid.format(tplfld,vv)+ "</td>";
+ return false;
+ }
+ });
+ str += tmpdata;
+ }
+ str += "</tr>";
+ }
+ toEnd = jj;
+ }
+ });
+ $("#"+$.jgrid.jqID($t.p.id)+" tbody:first").append(str);
+ // free up memory
+ str = null;
+ });
+ },
+ groupingGroupBy : function (name, options ) {
+ return this.each(function(){
+ var $t = this;
+ if(typeof(name) === "string") {
+ name = [name];
+ }
+ var grp = $t.p.groupingView;
+ $t.p.grouping = true;
+
+ //Set default, in case visibilityOnNextGrouping is undefined
+ if (typeof grp.visibiltyOnNextGrouping === "undefined") {
+ grp.visibiltyOnNextGrouping = [];
+ }
+ var i;
+ // show previous hidden groups if they are hidden and weren't removed yet
+ for(i=0;i<grp.groupField.length;i++) {
+ if(!grp.groupColumnShow[i] && grp.visibiltyOnNextGrouping[i]) {
+ $($t).jqGrid('showCol',grp.groupField[i]);
+ }
+ }
+ // set visibility status of current group columns on next grouping
+ for(i=0;i<name.length;i++) {
+ grp.visibiltyOnNextGrouping[i] = $("#"+$.jgrid.jqID($t.p.id)+"_"+$.jgrid.jqID(name[i])).is(":visible");
+ }
+ $t.p.groupingView = $.extend($t.p.groupingView, options || {});
+ grp.groupField = name;
+ $($t).trigger("reloadGrid");
+ });
+ },
+ groupingRemove : function (current) {
+ return this.each(function(){
+ var $t = this;
+ if(typeof(current) === 'undefined') {
+ current = true;
+ }
+ $t.p.grouping = false;
+ if(current===true) {
+ var grp = $t.p.groupingView;
+ // show previous hidden groups if they are hidden and weren't removed yet
+ for(var i=0;i<grp.groupField.length;i++) {
+ if (!grp.groupColumnShow[i] && grp.visibiltyOnNextGrouping[i]) {
+ $($t).jqGrid('showCol', grp.groupField);
+ }
+ }
+ $("tr.jqgroup, tr.jqfoot","#"+$.jgrid.jqID($t.p.id)+" tbody:first").remove();
+ $("tr.jqgrow:hidden","#"+$.jgrid.jqID($t.p.id)+" tbody:first").show();
+ } else {
+ $($t).trigger("reloadGrid");
+ }
+ });
+ },
+ groupingCalculations : {
+ handler: function(fn, v, field, round, roundType, rc) {
+ var funcs = {
+ sum: function() {
+ return parseFloat(v||0) + parseFloat((rc[field]||0));
+ },
+
+ min: function() {
+ if(v==="") {
+ return parseFloat(rc[field]||0);
+ }
+ return Math.min(parseFloat(v),parseFloat(rc[field]||0));
+ },
+
+ max: function() {
+ if(v==="") {
+ return parseFloat(rc[field]||0);
+ }
+ return Math.max(parseFloat(v),parseFloat(rc[field]||0));
+ },
+
+ count: function() {
+ if(v==="") {v=0;}
+ if(rc.hasOwnProperty(field)) {
+ return v+1;
+ } else {
+ return 0;
+ }
+ },
+
+ avg: function() {
+ // the same as sum, but at end we divide it
+ // so use sum instead of duplicating the code (?)
+ return funcs.sum();
+ }
+ }
+
+ if(!funcs[fn]) {
+ throw ("jqGrid Grouping No such method: " + fn);
+ }
+ var res = funcs[fn]();
+
+ if (round != null) {
+ if (roundType == 'fixed')
+ res = res.toFixed(round);
+ else {
+ var mul = Math.pow(10, round);
+
+ res = Math.round(res * mul) / mul;
+ }
+ }
+
+ return res;
+ }
+ }
+});
+})(jQuery);
+;(function($){
+/*
+ * jqGrid extension for constructing Grid Data from external file
+ * Tony Tomov tony(a)trirand.com
+ * http://trirand.com/blog/
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl-2.0.html
+**/
+//jsHint options
+/*global jQuery, $, alert, xmlJsonClass */
+
+"use strict";
+ $.jgrid.extend({
+ jqGridImport : function(o) {
+ o = $.extend({
+ imptype : "xml", // xml, json, xmlstring, jsonstring
+ impstring: "",
+ impurl: "",
+ mtype: "GET",
+ impData : {},
+ xmlGrid :{
+ config : "roots>grid",
+ data: "roots>rows"
+ },
+ jsonGrid :{
+ config : "grid",
+ data: "data"
+ },
+ ajaxOptions :{}
+ }, o || {});
+ return this.each(function(){
+ var $t = this;
+ var xmlConvert = function (xml,o) {
+ var cnfg = $(o.xmlGrid.config,xml)[0];
+ var xmldata = $(o.xmlGrid.data,xml)[0], jstr, jstr1;
+ if(xmlJsonClass.xml2json && $.jgrid.parse) {
+ jstr = xmlJsonClass.xml2json(cnfg," ");
+ jstr = $.jgrid.parse(jstr);
+ for(var key in jstr) {
+ if(jstr.hasOwnProperty(key)) {
+ jstr1=jstr[key];
+ }
+ }
+ if(xmldata) {
+ // save the datatype
+ var svdatatype = jstr.grid.datatype;
+ jstr.grid.datatype = 'xmlstring';
+ jstr.grid.datastr = xml;
+ $($t).jqGrid( jstr1 ).jqGrid("setGridParam",{datatype:svdatatype});
+ } else {
+ $($t).jqGrid( jstr1 );
+ }
+ jstr = null;jstr1=null;
+ } else {
+ alert("xml2json or parse are not present");
+ }
+ };
+ var jsonConvert = function (jsonstr,o){
+ if (jsonstr && typeof jsonstr == 'string') {
+ var _jsonparse = false;
+ if($.jgrid.useJSON) {
+ $.jgrid.useJSON = false;
+ _jsonparse = true;
+ }
+ var json = $.jgrid.parse(jsonstr);
+ if(_jsonparse) { $.jgrid.useJSON = true; }
+ var gprm = json[o.jsonGrid.config];
+ var jdata = json[o.jsonGrid.data];
+ if(jdata) {
+ var svdatatype = gprm.datatype;
+ gprm.datatype = 'jsonstring';
+ gprm.datastr = jdata;
+ $($t).jqGrid( gprm ).jqGrid("setGridParam",{datatype:svdatatype});
+ } else {
+ $($t).jqGrid( gprm );
+ }
+ }
+ };
+ switch (o.imptype){
+ case 'xml':
+ $.ajax($.extend({
+ url:o.impurl,
+ type:o.mtype,
+ data: o.impData,
+ dataType:"xml",
+ complete: function(xml,stat) {
+ if(stat == 'success') {
+ xmlConvert(xml.responseXML,o);
+ $($t).triggerHandler("jqGridImportComplete", [xml, o]);
+ if($.isFunction(o.importComplete)) {
+ o.importComplete(xml);
+ }
+ }
+ xml=null;
+ }
+ }, o.ajaxOptions));
+ break;
+ case 'xmlstring' :
+ // we need to make just the conversion and use the same code as xml
+ if(o.impstring && typeof o.impstring == 'string') {
+ var xmld = $.jgrid.stringToDoc(o.impstring);
+ if(xmld) {
+ xmlConvert(xmld,o);
+ $($t).triggerHandler("jqGridImportComplete", [xmld, o]);
+ if($.isFunction(o.importComplete)) {
+ o.importComplete(xmld);
+ }
+ o.impstring = null;
+ }
+ xmld = null;
+ }
+ break;
+ case 'json':
+ $.ajax($.extend({
+ url:o.impurl,
+ type:o.mtype,
+ data: o.impData,
+ dataType:"json",
+ complete: function(json) {
+ try {
+ jsonConvert(json.responseText,o );
+ $($t).triggerHandler("jqGridImportComplete", [json, o]);
+ if($.isFunction(o.importComplete)) {
+ o.importComplete(json);
+ }
+ } catch (ee){}
+ json=null;
+ }
+ }, o.ajaxOptions ));
+ break;
+ case 'jsonstring' :
+ if(o.impstring && typeof o.impstring == 'string') {
+ jsonConvert(o.impstring,o );
+ $($t).triggerHandler("jqGridImportComplete", [o.impstring, o]);
+ if($.isFunction(o.importComplete)) {
+ o.importComplete(o.impstring);
+ }
+ o.impstring = null;
+ }
+ break;
+ }
+ });
+ },
+ jqGridExport : function(o) {
+ o = $.extend({
+ exptype : "xmlstring",
+ root: "grid",
+ ident: "\t"
+ }, o || {});
+ var ret = null;
+ this.each(function () {
+ if(!this.grid) { return;}
+ var gprm = $.extend(true, {},$(this).jqGrid("getGridParam"));
+ // we need to check for:
+ // 1.multiselect, 2.subgrid 3. treegrid and remove the unneded columns from colNames
+ if(gprm.rownumbers) {
+ gprm.colNames.splice(0,1);
+ gprm.colModel.splice(0,1);
+ }
+ if(gprm.multiselect) {
+ gprm.colNames.splice(0,1);
+ gprm.colModel.splice(0,1);
+ }
+ if(gprm.subGrid) {
+ gprm.colNames.splice(0,1);
+ gprm.colModel.splice(0,1);
+ }
+ gprm.knv = null;
+ if(gprm.treeGrid) {
+ for (var key in gprm.treeReader) {
+ if(gprm.treeReader.hasOwnProperty(key)) {
+ gprm.colNames.splice(gprm.colNames.length-1);
+ gprm.colModel.splice(gprm.colModel.length-1);
+ }
+ }
+ }
+ switch (o.exptype) {
+ case 'xmlstring' :
+ ret = "<"+o.root+">"+xmlJsonClass.json2xml(gprm,o.ident)+"</"+o.root+">";
+ break;
+ case 'jsonstring' :
+ ret = "{"+ xmlJsonClass.toJson(gprm,o.root,o.ident,false)+"}";
+ if(gprm.postData.filters !== undefined) {
+ ret=ret.replace(/filters":"/,'filters":');
+ ret=ret.replace(/}]}"/,'}]}');
+ }
+ break;
+ }
+ });
+ return ret;
+ },
+ excelExport : function(o) {
+ o = $.extend({
+ exptype : "remote",
+ url : null,
+ oper: "oper",
+ tag: "excel",
+ exportOptions : {}
+ }, o || {});
+ return this.each(function(){
+ if(!this.grid) { return;}
+ var url;
+ if(o.exptype == "remote") {
+ var pdata = $.extend({},this.p.postData);
+ pdata[o.oper] = o.tag;
+ var params = jQuery.param(pdata);
+ if(o.url.indexOf("?") != -1) { url = o.url+"&"+params; }
+ else { url = o.url+"?"+params; }
+ window.location = url;
+ }
+ });
+ }
+ });
+})(jQuery);;(function($){
+/*
+**
+ * jqGrid addons using jQuery UI
+ * Author: Mark Williams
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl-2.0.html
+ * depends on jQuery UI
+**/
+if ($.browser.msie && $.browser.version==8) {
+ $.expr[":"].hidden = function(elem) {
+ return elem.offsetWidth === 0 || elem.offsetHeight === 0 ||
+ elem.style.display == "none";
+ };
+}
+// requiere load multiselect before grid
+$.jgrid._multiselect = false;
+if($.ui) {
+ if ($.ui.multiselect ) {
+ if($.ui.multiselect.prototype._setSelected) {
+ var setSelected = $.ui.multiselect.prototype._setSelected;
+ $.ui.multiselect.prototype._setSelected = function(item,selected) {
+ var ret = setSelected.call(this,item,selected);
+ if (selected && this.selectedList) {
+ var elt = this.element;
+ this.selectedList.find('li').each(function() {
+ if ($(this).data('optionLink')) {
+ $(this).data('optionLink').remove().appendTo(elt);
+ }
+ });
+ }
+ return ret;
+ };
+ }
+ if($.ui.multiselect.prototype.destroy) {
+ $.ui.multiselect.prototype.destroy = function() {
+ this.element.show();
+ this.container.remove();
+ if ($.Widget === undefined) {
+ $.widget.prototype.destroy.apply(this, arguments);
+ } else {
+ $.Widget.prototype.destroy.apply(this, arguments);
+ }
+ };
+ }
+ $.jgrid._multiselect = true;
+ }
+}
+
+$.jgrid.extend({
+ sortableColumns : function (tblrow)
+ {
+ return this.each(function (){
+ var ts = this, tid= $.jgrid.jqID( ts.p.id );
+ function start() {ts.p.disableClick = true;}
+ var sortable_opts = {
+ "tolerance" : "pointer",
+ "axis" : "x",
+ "scrollSensitivity": "1",
+ "items": '>th:not(:has(#jqgh_'+tid+'_cb'+',#jqgh_'+tid+'_rn'+',#jqgh_'+tid+'_subgrid),:hidden)',
+ "placeholder": {
+ element: function(item) {
+ var el = $(document.createElement(item[0].nodeName))
+ .addClass(item[0].className+" ui-sortable-placeholder ui-state-highlight")
+ .removeClass("ui-sortable-helper")[0];
+ return el;
+ },
+ update: function(self, p) {
+ p.height(self.currentItem.innerHeight() - parseInt(self.currentItem.css('paddingTop')||0, 10) - parseInt(self.currentItem.css('paddingBottom')||0, 10));
+ p.width(self.currentItem.innerWidth() - parseInt(self.currentItem.css('paddingLeft')||0, 10) - parseInt(self.currentItem.css('paddingRight')||0, 10));
+ }
+ },
+ "update": function(event, ui) {
+ var p = $(ui.item).parent(),
+ th = $(">th", p),
+ colModel = ts.p.colModel,
+ cmMap = {}, tid= ts.p.id+"_";
+ $.each(colModel, function(i) { cmMap[this.name]=i; });
+ var permutation = [];
+ th.each(function() {
+ var id = $(">div", this).get(0).id.replace(/^jqgh_/, "").replace(tid,"");
+ if (id in cmMap) {
+ permutation.push(cmMap[id]);
+ }
+ });
+
+ $(ts).jqGrid("remapColumns",permutation, true, true);
+ if ($.isFunction(ts.p.sortable.update)) {
+ ts.p.sortable.update(permutation);
+ }
+ setTimeout(function(){ts.p.disableClick=false;}, 50);
+ }
+ };
+ if (ts.p.sortable.options) {
+ $.extend(sortable_opts, ts.p.sortable.options);
+ } else if ($.isFunction(ts.p.sortable)) {
+ ts.p.sortable = { "update" : ts.p.sortable };
+ }
+ if (sortable_opts.start) {
+ var s = sortable_opts.start;
+ sortable_opts.start = function(e,ui) {
+ start();
+ s.call(this,e,ui);
+ };
+ } else {
+ sortable_opts.start = start;
+ }
+ if (ts.p.sortable.exclude) {
+ sortable_opts.items += ":not("+ts.p.sortable.exclude+")";
+ }
+ tblrow.sortable(sortable_opts).data("sortable").floating = true;
+ });
+ },
+ columnChooser : function(opts) {
+ var self = this;
+ if($("#colchooser_"+$.jgrid.jqID(self[0].p.id)).length ) { return; }
+ var selector = $('<div id="colchooser_'+self[0].p.id+'" style="position:relative;overflow:hidden"><div><select multiple="multiple"></select></div></div>');
+ var select = $('select', selector);
+
+ function insert(perm,i,v) {
+ if(i>=0){
+ var a = perm.slice();
+ var b = a.splice(i,Math.max(perm.length-i,i));
+ if(i>perm.length) { i = perm.length; }
+ a[i] = v;
+ return a.concat(b);
+ }
+ }
+ opts = $.extend({
+ "width" : 420,
+ "height" : 240,
+ "classname" : null,
+ "done" : function(perm) { if (perm) { self.jqGrid("remapColumns", perm, true); } },
+ /* msel is either the name of a ui widget class that
+ extends a multiselect, or a function that supports
+ creating a multiselect object (with no argument,
+ or when passed an object), and destroying it (when
+ passed the string "destroy"). */
+ "msel" : "multiselect",
+ /* "msel_opts" : {}, */
+
+ /* dlog is either the name of a ui widget class that
+ behaves in a dialog-like way, or a function, that
+ supports creating a dialog (when passed dlog_opts)
+ or destroying a dialog (when passed the string
+ "destroy")
+ */
+ "dlog" : "dialog",
+ "dialog_opts" : {
+ "minWidth": 470
+ },
+ /* dlog_opts is either an option object to be passed
+ to "dlog", or (more likely) a function that creates
+ the options object.
+ The default produces a suitable options object for
+ ui.dialog */
+ "dlog_opts" : function(opts) {
+ var buttons = {};
+ buttons[opts.bSubmit] = function() {
+ opts.apply_perm();
+ opts.cleanup(false);
+ };
+ buttons[opts.bCancel] = function() {
+ opts.cleanup(true);
+ };
+ return $.extend(true, {
+ "buttons": buttons,
+ "close": function() {
+ opts.cleanup(true);
+ },
+ "modal" : opts.modal ? opts.modal : false,
+ "resizable": opts.resizable ? opts.resizable : true,
+ "width": opts.width+20
+ }, opts.dialog_opts || {});
+ },
+ /* Function to get the permutation array, and pass it to the
+ "done" function */
+ "apply_perm" : function() {
+ $('option',select).each(function() {
+ if (this.selected) {
+ self.jqGrid("showCol", colModel[this.value].name);
+ } else {
+ self.jqGrid("hideCol", colModel[this.value].name);
+ }
+ });
+
+ var perm = [];
+ //fixedCols.slice(0);
+ $('option:selected',select).each(function() { perm.push(parseInt(this.value,10)); });
+ $.each(perm, function() { delete colMap[colModel[parseInt(this,10)].name]; });
+ $.each(colMap, function() {
+ var ti = parseInt(this,10);
+ perm = insert(perm,ti,ti);
+ });
+ if (opts.done) {
+ opts.done.call(self, perm);
+ }
+ },
+ /* Function to cleanup the dialog, and select. Also calls the
+ done function with no permutation (to indicate that the
+ columnChooser was aborted */
+ "cleanup" : function(calldone) {
+ call(opts.dlog, selector, 'destroy');
+ call(opts.msel, select, 'destroy');
+ selector.remove();
+ if (calldone && opts.done) {
+ opts.done.call(self);
+ }
+ },
+ "msel_opts" : {}
+ }, $.jgrid.col, opts || {});
+ if($.ui) {
+ if ($.ui.multiselect ) {
+ if(opts.msel == "multiselect") {
+ if(!$.jgrid._multiselect) {
+ // should be in language file
+ alert("Multiselect plugin loaded after jqGrid. Please load the plugin before the jqGrid!");
+ return;
+ }
+ opts.msel_opts = $.extend($.ui.multiselect.defaults,opts.msel_opts);
+ }
+ }
+ }
+ if (opts.caption) {
+ selector.attr("title", opts.caption);
+ }
+ if (opts.classname) {
+ selector.addClass(opts.classname);
+ select.addClass(opts.classname);
+ }
+ if (opts.width) {
+ $(">div",selector).css({"width": opts.width,"margin":"0 auto"});
+ select.css("width", opts.width);
+ }
+ if (opts.height) {
+ $(">div",selector).css("height", opts.height);
+ select.css("height", opts.height - 10);
+ }
+ var colModel = self.jqGrid("getGridParam", "colModel");
+ var colNames = self.jqGrid("getGridParam", "colNames");
+ var colMap = {}, fixedCols = [];
+
+ select.empty();
+ $.each(colModel, function(i) {
+ colMap[this.name] = i;
+ if (this.hidedlg) {
+ if (!this.hidden) {
+ fixedCols.push(i);
+ }
+ return;
+ }
+
+ select.append("<option value='"+i+"' "+
+ (this.hidden?"":"selected='selected'")+">"+jQuery.jgrid.stripHtml(colNames[i])+"</option>");
+ });
+ function call(fn, obj) {
+ if (!fn) { return; }
+ if (typeof fn == 'string') {
+ if ($.fn[fn]) {
+ $.fn[fn].apply(obj, $.makeArray(arguments).slice(2));
+ }
+ } else if ($.isFunction(fn)) {
+ fn.apply(obj, $.makeArray(arguments).slice(2));
+ }
+ }
+
+ var dopts = $.isFunction(opts.dlog_opts) ? opts.dlog_opts.call(self, opts) : opts.dlog_opts;
+ call(opts.dlog, selector, dopts);
+ var mopts = $.isFunction(opts.msel_opts) ? opts.msel_opts.call(self, opts) : opts.msel_opts;
+ call(opts.msel, select, mopts);
+ },
+ sortableRows : function (opts) {
+ // Can accept all sortable options and events
+ return this.each(function(){
+ var $t = this;
+ if(!$t.grid) { return; }
+ // Currently we disable a treeGrid sortable
+ if($t.p.treeGrid) { return; }
+ if($.fn.sortable) {
+ opts = $.extend({
+ "cursor":"move",
+ "axis" : "y",
+ "items": ".jqgrow"
+ },
+ opts || {});
+ if(opts.start && $.isFunction(opts.start)) {
+ opts._start_ = opts.start;
+ delete opts.start;
+ } else {opts._start_=false;}
+ if(opts.update && $.isFunction(opts.update)) {
+ opts._update_ = opts.update;
+ delete opts.update;
+ } else {opts._update_ = false;}
+ opts.start = function(ev,ui) {
+ $(ui.item).css("border-width","0px");
+ $("td",ui.item).each(function(i){
+ this.style.width = $t.grid.cols[i].style.width;
+ });
+ if($t.p.subGrid) {
+ var subgid = $(ui.item).attr("id");
+ try {
+ $($t).jqGrid('collapseSubGridRow',subgid);
+ } catch (e) {}
+ }
+ if(opts._start_) {
+ opts._start_.apply(this,[ev,ui]);
+ }
+ };
+ opts.update = function (ev,ui) {
+ $(ui.item).css("border-width","");
+ if($t.p.rownumbers === true) {
+ $("td.jqgrid-rownum",$t.rows).each(function( i ){
+ $(this).html( i+1+(parseInt($t.p.page,10)-1)*parseInt($t.p.rowNum,10) );
+ });
+ }
+ if(opts._update_) {
+ opts._update_.apply(this,[ev,ui]);
+ }
+ };
+ $("tbody:first",$t).sortable(opts);
+ $("tbody:first",$t).disableSelection();
+ }
+ });
+ },
+ gridDnD : function(opts) {
+ return this.each(function(){
+ var $t = this;
+ if(!$t.grid) { return; }
+ // Currently we disable a treeGrid drag and drop
+ if($t.p.treeGrid) { return; }
+ if(!$.fn.draggable || !$.fn.droppable) { return; }
+ function updateDnD ()
+ {
+ var datadnd = $.data($t,"dnd");
+ $("tr.jqgrow:not(.ui-draggable)",$t).draggable($.isFunction(datadnd.drag) ? datadnd.drag.call($($t),datadnd) : datadnd.drag);
+ }
+ var appender = "<table id='jqgrid_dnd' class='ui-jqgrid-dnd'></table>";
+ if($("#jqgrid_dnd")[0] === undefined) {
+ $('body').append(appender);
+ }
+
+ if(typeof opts == 'string' && opts == 'updateDnD' && $t.p.jqgdnd===true) {
+ updateDnD();
+ return;
+ }
+ opts = $.extend({
+ "drag" : function (opts) {
+ return $.extend({
+ start : function (ev, ui) {
+ // if we are in subgrid mode try to collapse the node
+ if($t.p.subGrid) {
+ var subgid = $(ui.helper).attr("id");
+ try {
+ $($t).jqGrid('collapseSubGridRow',subgid);
+ } catch (e) {}
+ }
+ // hack
+ // drag and drop does not insert tr in table, when the table has no rows
+ // we try to insert new empty row on the target(s)
+ for (var i=0;i<$.data($t,"dnd").connectWith.length;i++){
+ if($($.data($t,"dnd").connectWith[i]).jqGrid('getGridParam','reccount') == "0" ){
+ $($.data($t,"dnd").connectWith[i]).jqGrid('addRowData','jqg_empty_row',{});
+ }
+ }
+ ui.helper.addClass("ui-state-highlight");
+ $("td",ui.helper).each(function(i) {
+ this.style.width = $t.grid.headers[i].width+"px";
+ });
+ if(opts.onstart && $.isFunction(opts.onstart) ) { opts.onstart.call($($t),ev,ui); }
+ },
+ stop :function(ev,ui) {
+ if(ui.helper.dropped && !opts.dragcopy) {
+ var ids = $(ui.helper).attr("id");
+ if(ids === undefined) { ids = $(this).attr("id"); }
+ $($t).jqGrid('delRowData',ids );
+ }
+ // if we have a empty row inserted from start event try to delete it
+ for (var i=0;i<$.data($t,"dnd").connectWith.length;i++){
+ $($.data($t,"dnd").connectWith[i]).jqGrid('delRowData','jqg_empty_row');
+ }
+ if(opts.onstop && $.isFunction(opts.onstop) ) { opts.onstop.call($($t),ev,ui); }
+ }
+ },opts.drag_opts || {});
+ },
+ "drop" : function (opts) {
+ return $.extend({
+ accept: function(d) {
+ if (!$(d).hasClass('jqgrow')) { return d;}
+ var tid = $(d).closest("table.ui-jqgrid-btable");
+ if(tid.length > 0 && $.data(tid[0],"dnd") !== undefined) {
+ var cn = $.data(tid[0],"dnd").connectWith;
+ return $.inArray('#'+$.jgrid.jqID(this.id),cn) != -1 ? true : false;
+ }
+ return false;
+ },
+ drop: function(ev, ui) {
+ if (!$(ui.draggable).hasClass('jqgrow')) { return; }
+ var accept = $(ui.draggable).attr("id");
+ var getdata = ui.draggable.parent().parent().jqGrid('getRowData',accept);
+ if(!opts.dropbyname) {
+ var j =0, tmpdata = {}, nm;
+ var dropmodel = $("#"+$.jgrid.jqID(this.id)).jqGrid('getGridParam','colModel');
+ try {
+ for (var key in getdata) {
+ nm = dropmodel[j].name;
+ if( !(nm == 'cb' || nm =='rn' || nm == 'subgrid' )) {
+ if(getdata.hasOwnProperty(key) && dropmodel[j]) {
+ tmpdata[nm] = getdata[key];
+ }
+ }
+ j++;
+ }
+ getdata = tmpdata;
+ } catch (e) {}
+ }
+ ui.helper.dropped = true;
+ if(opts.beforedrop && $.isFunction(opts.beforedrop) ) {
+ //parameters to this callback - event, element, data to be inserted, sender, reciever
+ // should return object which will be inserted into the reciever
+ var datatoinsert = opts.beforedrop.call(this,ev,ui,getdata,$('#'+$.jgrid.jqID($t.p.id)),$(this));
+ if (typeof datatoinsert != "undefined" && datatoinsert !== null && typeof datatoinsert == "object") { getdata = datatoinsert; }
+ }
+ if(ui.helper.dropped) {
+ var grid;
+ if(opts.autoid) {
+ if($.isFunction(opts.autoid)) {
+ grid = opts.autoid.call(this,getdata);
+ } else {
+ grid = Math.ceil(Math.random()*1000);
+ grid = opts.autoidprefix+grid;
+ }
+ }
+ // NULL is interpreted as undefined while null as object
+ $("#"+$.jgrid.jqID(this.id)).jqGrid('addRowData',grid,getdata,opts.droppos);
+ }
+ if(opts.ondrop && $.isFunction(opts.ondrop) ) { opts.ondrop.call(this,ev,ui, getdata); }
+ }}, opts.drop_opts || {});
+ },
+ "onstart" : null,
+ "onstop" : null,
+ "beforedrop": null,
+ "ondrop" : null,
+ "drop_opts" : {
+ "activeClass": "ui-state-active",
+ "hoverClass": "ui-state-hover"
+ },
+ "drag_opts" : {
+ "revert": "invalid",
+ "helper": "clone",
+ "cursor": "move",
+ "appendTo" : "#jqgrid_dnd",
+ "zIndex": 5000
+ },
+ "dragcopy": false,
+ "dropbyname" : false,
+ "droppos" : "first",
+ "autoid" : true,
+ "autoidprefix" : "dnd_"
+ }, opts || {});
+
+ if(!opts.connectWith) { return; }
+ opts.connectWith = opts.connectWith.split(",");
+ opts.connectWith = $.map(opts.connectWith,function(n){return $.trim(n);});
+ $.data($t,"dnd",opts);
+
+ if($t.p.reccount != "0" && !$t.p.jqgdnd) {
+ updateDnD();
+ }
+ $t.p.jqgdnd = true;
+ for (var i=0;i<opts.connectWith.length;i++){
+ var cn =opts.connectWith[i];
+ $(cn).droppable($.isFunction(opts.drop) ? opts.drop.call($($t),opts) : opts.drop);
+ }
+ });
+ },
+ gridResize : function(opts) {
+ return this.each(function(){
+ var $t = this, gID = $.jgrid.jqID($t.p.id);
+ if(!$t.grid || !$.fn.resizable) { return; }
+ opts = $.extend({}, opts || {});
+ if(opts.alsoResize ) {
+ opts._alsoResize_ = opts.alsoResize;
+ delete opts.alsoResize;
+ } else {
+ opts._alsoResize_ = false;
+ }
+ if(opts.stop && $.isFunction(opts.stop)) {
+ opts._stop_ = opts.stop;
+ delete opts.stop;
+ } else {
+ opts._stop_ = false;
+ }
+ opts.stop = function (ev, ui) {
+ $($t).jqGrid('setGridParam',{height:$("#gview_"+gID+" .ui-jqgrid-bdiv").height()});
+ $($t).jqGrid('setGridWidth',ui.size.width,opts.shrinkToFit);
+ if(opts._stop_) { opts._stop_.call($t,ev,ui); }
+ };
+ if(opts._alsoResize_) {
+ var optstest = "{\'#gview_"+gID+" .ui-jqgrid-bdiv\':true,'" +opts._alsoResize_+"':true}";
+ opts.alsoResize = eval('('+optstest+')'); // the only way that I found to do this
+ } else {
+ opts.alsoResize = $(".ui-jqgrid-bdiv","#gview_"+gID);
+ }
+ delete opts._alsoResize_;
+ $("#gbox_"+gID).resizable(opts);
+ });
+ }
+});
+})(jQuery);
+/*
+ Transform a table to a jqGrid.
+ Peter Romianowski <peter.romianowski(a)optivo.de>
+ If the first column of the table contains checkboxes or
+ radiobuttons then the jqGrid is made selectable.
+*/
+// Addition - selector can be a class or id
+function tableToGrid(selector, options) {
+jQuery(selector).each(function() {
+ if(this.grid) {return;} //Adedd from Tony Tomov
+ // This is a small "hack" to make the width of the jqGrid 100%
+ jQuery(this).width("99%");
+ var w = jQuery(this).width();
+
+ // Text whether we have single or multi select
+ var inputCheckbox = jQuery('tr td:first-child input[type=checkbox]:first', jQuery(this));
+ var inputRadio = jQuery('tr td:first-child input[type=radio]:first', jQuery(this));
+ var selectMultiple = inputCheckbox.length > 0;
+ var selectSingle = !selectMultiple && inputRadio.length > 0;
+ var selectable = selectMultiple || selectSingle;
+ //var inputName = inputCheckbox.attr("name") || inputRadio.attr("name");
+
+ // Build up the columnModel and the data
+ var colModel = [];
+ var colNames = [];
+ jQuery('th', jQuery(this)).each(function() {
+ if (colModel.length === 0 && selectable) {
+ colModel.push({
+ name: '__selection__',
+ index: '__selection__',
+ width: 0,
+ hidden: true
+ });
+ colNames.push('__selection__');
+ } else {
+ colModel.push({
+ name: jQuery(this).attr("id") || jQuery.trim(jQuery.jgrid.stripHtml(jQuery(this).html())).split(' ').join('_'),
+ index: jQuery(this).attr("id") || jQuery.trim(jQuery.jgrid.stripHtml(jQuery(this).html())).split(' ').join('_'),
+ width: jQuery(this).width() || 150
+ });
+ colNames.push(jQuery(this).html());
+ }
+ });
+ var data = [];
+ var rowIds = [];
+ var rowChecked = [];
+ jQuery('tbody > tr', jQuery(this)).each(function() {
+ var row = {};
+ var rowPos = 0;
+ jQuery('td', jQuery(this)).each(function() {
+ if (rowPos === 0 && selectable) {
+ var input = jQuery('input', jQuery(this));
+ var rowId = input.attr("value");
+ rowIds.push(rowId || data.length);
+ if (input.is(":checked")) {
+ rowChecked.push(rowId);
+ }
+ row[colModel[rowPos].name] = input.attr("value");
+ } else {
+ row[colModel[rowPos].name] = jQuery(this).html();
+ }
+ rowPos++;
+ });
+ if(rowPos >0) { data.push(row); }
+ });
+
+ // Clear the original HTML table
+ jQuery(this).empty();
+
+ // Mark it as jqGrid
+ jQuery(this).addClass("scroll");
+
+ jQuery(this).jqGrid(jQuery.extend({
+ datatype: "local",
+ width: w,
+ colNames: colNames,
+ colModel: colModel,
+ multiselect: selectMultiple
+ //inputName: inputName,
+ //inputValueCol: imputName != null ? "__selection__" : null
+ }, options || {}));
+
+ // Add data
+ var a;
+ for (a = 0; a < data.length; a++) {
+ var id = null;
+ if (rowIds.length > 0) {
+ id = rowIds[a];
+ if (id && id.replace) {
+ // We have to do this since the value of a checkbox
+ // or radio button can be anything
+ id = encodeURIComponent(id).replace(/[.\-%]/g, "_");
+ }
+ }
+ if (id === null) {
+ id = a + 1;
+ }
+ jQuery(this).jqGrid("addRowData",id, data[a]);
+ }
+
+ // Set the selection
+ for (a = 0; a < rowChecked.length; a++) {
+ jQuery(this).jqGrid("setSelection",rowChecked[a]);
+ }
+});
+};
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/grid.addons.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/grid.addons.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/grid.addons.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,704 @@
+(function($){
+/*
+ * jqGrid methods without support. Use as you wish
+ * Tony Tomov tony(a)trirand.com
+ * http://trirand.com/blog/
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl-2.0.html
+ *
+ * This list of deprecated methods.
+ * If you instead want to use them, please include this file after the grid main file.
+ * Some methods will be then overwritten.
+ *
+ */
+/*global jQuery, $ */
+
+$.jgrid.extend({
+// This is the ols search Filter method used in navigator.
+ searchGrid : function (p) {
+ p = $.extend({
+ recreateFilter: false,
+ drag: true,
+ sField:'searchField',
+ sValue:'searchString',
+ sOper: 'searchOper',
+ sFilter: 'filters',
+ loadDefaults: true, // this options activates loading of default filters from grid's postData for Multipe Search only.
+ beforeShowSearch: null,
+ afterShowSearch : null,
+ onInitializeSearch: null,
+ closeAfterSearch : false,
+ closeAfterReset: false,
+ closeOnEscape : false,
+ multipleSearch : false,
+ cloneSearchRowOnAdd: true,
+ // translation
+ // if you want to change or remove the order change it in sopt
+ // ['bw','eq','ne','lt','le','gt','ge','ew','cn']
+ sopt: null,
+ // Note: stringResult is intentionally declared "undefined by default".
+ // you are velcome to define stringResult expressly in the options you pass to searchGrid()
+ // stringResult is a "safeguard" measure to insure we post sensible data when communicated as form-encoded
+ // see http://github.com/tonytomov/jqGrid/issues/#issue/36
+ //
+ // If this value is not expressly defined in the incoming options,
+ // lower in the code we will infer the value based on value of multipleSearch
+ stringResult: undefined,
+ onClose : null,
+ // useDataProxy allows ADD, EDIT and DEL code to bypass calling $.ajax
+ // directly when grid's 'dataProxy' property (grid.p.dataProxy) is a function.
+ // Used for "editGridRow" and "delGridRow" below and automatically flipped to TRUE
+ // when ajax setting's 'url' (grid's 'editurl') property is undefined.
+ // When 'useDataProxy' is true, instead of calling $.ajax.call(gridDOMobj, o, i) we call
+ // gridDOMobj.p.dataProxy.call(gridDOMobj, o, i)
+ //
+ // Behavior is extremely similar to when 'datatype' is a function, but arguments are slightly different.
+ // Normally the following is fed to datatype.call(a, b, c):
+ // a = Pointer to grid's table DOM element, b = grid.p.postdata, c = "load_"+grid's ID
+ // In cases of "edit" and "del" the following is fed:
+ // a = Pointer to grid's table DOM element (same),
+ // b = extended Ajax Options including postdata in "data" property. (different object type)
+ // c = "set_"+grid's ID in case of "edit" and "del_"+grid's ID in case of "del" (same type, different content)
+ // The major difference is that complete ajax options object, with attached "complete" and "error"
+ // callback functions is fed instead of only post data.
+ // This allows you to emulate a $.ajax call (including calling "complete"/"error"),
+ // while retrieving the data locally in the browser.
+ useDataProxy: false,
+ overlay : true
+ }, $.jgrid.search, p || {});
+ return this.each(function() {
+ var $t = this;
+ if(!$t.grid) {return;}
+ var fid = "fbox_"+$t.p.id,
+ showFrm = true;
+ function applyDefaultFilters(gridDOMobj, filterSettings) {
+ /*
+ gridDOMobj = ointer to grid DOM object ( $(#list)[0] )
+ What we need from gridDOMobj:
+ gridDOMobj.SearchFilter is the pointer to the Search box, once it's created.
+ gridDOMobj.p.postData - dictionary of post settings. These can be overriden at grid creation to
+ contain default filter settings. We will parse these and will populate the search with defaults.
+ filterSettings - same settings object you (would) pass to $().jqGrid('searchGrid', filterSettings);
+ */
+
+ // Pulling default filter settings out of postData property of grid's properties.:
+ var defaultFilters = gridDOMobj.p.postData[filterSettings.sFilter];
+ // example of what we might get: {"groupOp":"and","rules":[{"field":"amount","op":"eq","data":"100"}]}
+ // suppose we have imported this with grid import, the this is a string.
+ if(typeof(defaultFilters) == "string") {
+ defaultFilters = $.jgrid.parse(defaultFilters);
+ }
+ if (defaultFilters) {
+ if (defaultFilters.groupOp) {
+ gridDOMobj.SearchFilter.setGroupOp(defaultFilters.groupOp);
+ }
+ if (defaultFilters.rules) {
+ var f, i = 0, li = defaultFilters.rules.length, success = false;
+ for (; i < li; i++) {
+ f = defaultFilters.rules[i];
+ // we are not trying to counter all issues with filter declaration here. Just the basics to avoid lookup exceptions.
+ if (f.field !== undefined && f.op !== undefined && f.data !== undefined) {
+ success = gridDOMobj.SearchFilter.setFilter({
+ 'sfref':gridDOMobj.SearchFilter.$.find(".sf:last"),
+ 'filter':$.extend({},f)
+ });
+ if (success) { gridDOMobj.SearchFilter.add(); }
+ }
+ }
+ }
+ }
+ } // end of applyDefaultFilters
+ function hideFilter(selector) {
+ if(p.onClose){
+ var fclm = p.onClose(selector);
+ if(typeof fclm == 'boolean' && !fclm) { return; }
+ }
+ selector.hide();
+ if(p.overlay === true) {
+ $(".jqgrid-overlay:first","#gbox_"+$t.p.id).hide();
+ }
+ }
+ function showFilter(){
+ var fl = $(".ui-searchFilter").length;
+ if(fl > 1) {
+ var zI = $("#"+fid).css("zIndex");
+ $("#"+fid).css({zIndex:parseInt(zI,10)+fl});
+ }
+ $("#"+fid).show();
+ if(p.overlay === true) {
+ $(".jqgrid-overlay:first","#gbox_"+$t.p.id).show();
+ }
+ try{$(':input:visible',"#"+fid)[0].focus();}catch(_){}
+ }
+ function searchFilters(filters) {
+ var hasFilters = (filters !== undefined),
+ grid = $("#"+$t.p.id),
+ sdata={};
+ if(p.multipleSearch===false) {
+ sdata[p.sField] = filters.rules[0].field;
+ sdata[p.sValue] = filters.rules[0].data;
+ sdata[p.sOper] = filters.rules[0].op;
+ if(sdata.hasOwnProperty(p.sFilter) ) {
+ delete sdata[p.sFilter];
+ }
+ } else {
+ sdata[p.sFilter] = filters;
+ $.each([p.sField, p.sValue, p.sOper], function(i, n){
+ if(sdata.hasOwnProperty(n)) { delete sdata[n];}
+ });
+ }
+ grid[0].p.search = hasFilters;
+ $.extend(grid[0].p.postData,sdata);
+ grid.trigger("reloadGrid",[{page:1}]);
+ if(p.closeAfterSearch) { hideFilter($("#"+fid)); }
+ }
+ function resetFilters(op) {
+ var reload = op && op.hasOwnProperty("reload") ? op.reload : true,
+ grid = $("#"+$t.p.id),
+ sdata={};
+ grid[0].p.search = false;
+ if(p.multipleSearch===false) {
+ sdata[p.sField] = sdata[p.sValue] = sdata[p.sOper] = "";
+ } else {
+ sdata[p.sFilter] = "";
+ }
+ $.extend(grid[0].p.postData,sdata);
+ if(reload) {
+ grid.trigger("reloadGrid",[{page:1}]);
+ }
+ if(p.closeAfterReset) { hideFilter($("#"+fid)); }
+ }
+ if($.fn.searchFilter) {
+ if(p.recreateFilter===true) {$("#"+fid).remove();}
+ if( $("#"+fid).html() !== null ) {
+ if ( $.isFunction(p.beforeShowSearch) ) {
+ showFrm = p.beforeShowSearch($("#"+fid));
+ if(typeof(showFrm) == "undefined") {
+ showFrm = true;
+ }
+ }
+ if(showFrm === false) { return; }
+ showFilter();
+ if( $.isFunction(p.afterShowSearch) ) { p.afterShowSearch($("#"+fid)); }
+ } else {
+ var fields = [],
+ colNames = $("#"+$t.p.id).jqGrid("getGridParam","colNames"),
+ colModel = $("#"+$t.p.id).jqGrid("getGridParam","colModel"),
+ stempl = ['eq','ne','lt','le','gt','ge','bw','bn','in','ni','ew','en','cn','nc'],
+ j,pos,k,oprtr=[];
+ if (p.sopt !==null) {
+ k=0;
+ for(j=0;j<p.sopt.length;j++) {
+ if( (pos= $.inArray(p.sopt[j],stempl)) != -1 ){
+ oprtr[k] = {op:p.sopt[j],text: p.odata[pos]};
+ k++;
+ }
+ }
+ } else {
+ for(j=0;j<stempl.length;j++) {
+ oprtr[j] = {op:stempl[j],text: p.odata[j]};
+ }
+ }
+ $.each(colModel, function(i, v) {
+ var searchable = (typeof v.search === 'undefined') ? true: v.search ,
+ hidden = (v.hidden === true),
+ soptions = $.extend({}, {text: colNames[i], itemval: v.index || v.name}, this.searchoptions),
+ ignoreHiding = (soptions.searchhidden === true);
+ if(typeof soptions.sopt !== 'undefined') {
+ k=0;
+ soptions.ops =[];
+ if(soptions.sopt.length>0) {
+ for(j=0;j<soptions.sopt.length;j++) {
+ if( (pos= $.inArray(soptions.sopt[j],stempl)) != -1 ){
+ soptions.ops[k] = {op:soptions.sopt[j],text: p.odata[pos]};
+ k++;
+ }
+ }
+ }
+ }
+ if(typeof(this.stype) === 'undefined') { this.stype='text'; }
+ if(this.stype == 'select') {
+ if ( soptions.dataUrl !== undefined) {}
+ else {
+ var eov;
+ if(soptions.value) {
+ eov = soptions.value;
+ } else if(this.editoptions) {
+ eov = this.editoptions.value;
+ }
+ if(eov) {
+ soptions.dataValues =[];
+ if(typeof(eov) === 'string') {
+ var so = eov.split(";"),sv;
+ for(j=0;j<so.length;j++) {
+ sv = so[j].split(":");
+ soptions.dataValues[j] ={value:sv[0],text:sv[1]};
+ }
+ } else if (typeof(eov) === 'object') {
+ j=0;
+ for (var key in eov) {
+ if(eov.hasOwnProperty(key)) {
+ soptions.dataValues[j] ={value:key,text:eov[key]};
+ j++;
+ }
+ }
+ }
+ }
+ }
+ }
+ if ((ignoreHiding && searchable) || (searchable && !hidden)) {
+ fields.push(soptions);
+ }
+ });
+ if(fields.length>0){
+ $("<div id='"+fid+"' role='dialog' tabindex='-1'></div>").insertBefore("#gview_"+$t.p.id);
+ // Before we create searchFilter we need to decide if we want to get back a string or a JS object.
+ // see http://github.com/tonytomov/jqGrid/issues/#issue/36 for background on the issue.
+ // If p.stringResult is defined, it was explisitly passed to us by user. Honor the choice, whatever it is.
+ if (p.stringResult===undefined) {
+ // to provide backward compatibility, inferring stringResult value from multipleSearch
+ p.stringResult = p.multipleSearch;
+ }
+ // we preserve the return value here to retain access to .add() and other good methods of search form.
+ $t.SearchFilter = $("#"+fid).searchFilter(fields, { groupOps: p.groupOps, operators: oprtr, onClose:hideFilter, resetText: p.Reset, searchText: p.Find, windowTitle: p.caption, rulesText:p.rulesText, matchText:p.matchText, onSearch: searchFilters, onReset: resetFilters,stringResult:p.stringResult, ajaxSelectOptions: $.extend({},$.jgrid.ajaxOptions,$t.p.ajaxSelectOptions ||{}), clone: p.cloneSearchRowOnAdd });
+ $(".ui-widget-overlay","#"+fid).remove();
+ if($t.p.direction=="rtl") { $(".ui-closer","#"+fid).css("float","left"); }
+ if (p.drag===true) {
+ $("#"+fid+" table thead tr:first td:first").css('cursor','move');
+ if(jQuery.fn.jqDrag) {
+ $("#"+fid).jqDrag($("#"+fid+" table thead tr:first td:first"));
+ } else {
+ try {
+ $("#"+fid).draggable({handle: $("#"+fid+" table thead tr:first td:first")});
+ } catch (e) {}
+ }
+ }
+ if(p.multipleSearch === false) {
+ $(".ui-del, .ui-add, .ui-del, .ui-add-last, .matchText, .rulesText", "#"+fid).hide();
+ $("select[name='groupOp']","#"+fid).hide();
+ }
+ if (p.multipleSearch === true && p.loadDefaults === true) {
+ applyDefaultFilters($t, p);
+ }
+ if ( $.isFunction(p.onInitializeSearch) ) { p.onInitializeSearch( $("#"+fid) ); }
+ if ( $.isFunction(p.beforeShowSearch) ) {
+ showFrm = p.beforeShowSearch($("#"+fid));
+ if(typeof(showFrm) == "undefined") {
+ showFrm = true;
+ }
+ }
+ if(showFrm === false) { return; }
+ showFilter();
+ if( $.isFunction(p.afterShowSearch) ) { p.afterShowSearch($("#"+fid)); }
+ if(p.closeOnEscape===true){
+ $("#"+fid).keydown( function( e ) {
+ if( e.which == 27 ) {
+ hideFilter($("#"+fid));
+ }
+ if (e.which == 13) {
+ $(".ui-search", this).click();
+ }
+ });
+ }
+ }
+ }
+ }
+ });
+ },
+ // methods taken from grid.custom.
+ updateGridRows : function (data, rowidname, jsonreader) {
+ var nm, success=false, title;
+ this.each(function(){
+ var t = this, vl, ind, srow, sid;
+ if(!t.grid) {return false;}
+ if(!rowidname) { rowidname = "id"; }
+ if( data && data.length >0 ) {
+ $(data).each(function(j){
+ srow = this;
+ ind = t.rows.namedItem(srow[rowidname]);
+ if(ind) {
+ sid = srow[rowidname];
+ if(jsonreader === true){
+ if(t.p.jsonReader.repeatitems === true) {
+ if(t.p.jsonReader.cell) {srow = srow[t.p.jsonReader.cell];}
+ for (var k=0;k<srow.length;k++) {
+ vl = t.formatter( sid, srow[k], k, srow, 'edit');
+ title = t.p.colModel[k].title ? {"title":$.jgrid.stripHtml(vl)} : {};
+ if(t.p.treeGrid===true && nm == t.p.ExpandColumn) {
+ $("td:eq("+k+") > span:first",ind).html(vl).attr(title);
+ } else {
+ $("td:eq("+k+")",ind).html(vl).attr(title);
+ }
+ }
+ success = true;
+ return true;
+ }
+ }
+ $(t.p.colModel).each(function(i){
+ nm = jsonreader===true ? this.jsonmap || this.name :this.name;
+ if( srow[nm] !== undefined) {
+ vl = t.formatter( sid, srow[nm], i, srow, 'edit');
+ title = this.title ? {"title":$.jgrid.stripHtml(vl)} : {};
+ if(t.p.treeGrid===true && nm == t.p.ExpandColumn) {
+ $("td:eq("+i+") > span:first",ind).html(vl).attr(title);
+ } else {
+ $("td:eq("+i+")",ind).html(vl).attr(title);
+ }
+ success = true;
+ }
+ });
+ }
+ });
+ }
+ });
+ return success;
+ },
+ // Form search - sorry for this method. Instead use ne jqFilter method.
+ filterGrid : function(gridid,p){
+ p = $.extend({
+ gridModel : false,
+ gridNames : false,
+ gridToolbar : false,
+ filterModel: [], // label/name/stype/defval/surl/sopt
+ formtype : "horizontal", // horizontal/vertical
+ autosearch: true, // if set to false a serch button should be enabled.
+ formclass: "filterform",
+ tableclass: "filtertable",
+ buttonclass: "filterbutton",
+ searchButton: "Search",
+ clearButton: "Clear",
+ enableSearch : false,
+ enableClear: false,
+ beforeSearch: null,
+ afterSearch: null,
+ beforeClear: null,
+ afterClear: null,
+ url : '',
+ marksearched: true
+ },p || {});
+ return this.each(function(){
+ var self = this;
+ this.p = p;
+ if(this.p.filterModel.length === 0 && this.p.gridModel===false) { alert("No filter is set"); return;}
+ if( !gridid) {alert("No target grid is set!"); return;}
+ this.p.gridid = gridid.indexOf("#") != -1 ? gridid : "#"+gridid;
+ var gcolMod = $(this.p.gridid).jqGrid("getGridParam",'colModel');
+ if(gcolMod) {
+ if( this.p.gridModel === true) {
+ var thegrid = $(this.p.gridid)[0];
+ var sh;
+ // we should use the options search, edittype, editoptions
+ // additionally surl and defval can be added in grid colModel
+ $.each(gcolMod, function (i,n) {
+ var tmpFil = [];
+ this.search = this.search === false ? false : true;
+ if(this.editrules && this.editrules.searchhidden === true) {
+ sh = true;
+ } else {
+ if(this.hidden === true ) {
+ sh = false;
+ } else {
+ sh = true;
+ }
+ }
+ if( this.search === true && sh === true) {
+ if(self.p.gridNames===true) {
+ tmpFil.label = thegrid.p.colNames[i];
+ } else {
+ tmpFil.label = '';
+ }
+ tmpFil.name = this.name;
+ tmpFil.index = this.index || this.name;
+ // we support only text and selects, so all other to text
+ tmpFil.stype = this.edittype || 'text';
+ if(tmpFil.stype != 'select' ) {
+ tmpFil.stype = 'text';
+ }
+ tmpFil.defval = this.defval || '';
+ tmpFil.surl = this.surl || '';
+ tmpFil.sopt = this.editoptions || {};
+ tmpFil.width = this.width;
+ self.p.filterModel.push(tmpFil);
+ }
+ });
+ } else {
+ $.each(self.p.filterModel,function(i,n) {
+ for(var j=0;j<gcolMod.length;j++) {
+ if(this.name == gcolMod[j].name) {
+ this.index = gcolMod[j].index || this.name;
+ break;
+ }
+ }
+ if(!this.index) {
+ this.index = this.name;
+ }
+ });
+ }
+ } else {
+ alert("Could not get grid colModel"); return;
+ }
+ var triggerSearch = function() {
+ var sdata={}, j=0, v;
+ var gr = $(self.p.gridid)[0], nm;
+ gr.p.searchdata = {};
+ if($.isFunction(self.p.beforeSearch)){self.p.beforeSearch();}
+ $.each(self.p.filterModel,function(i,n){
+ nm = this.index;
+ if(this.stype === 'select') {
+ v = $("select[name="+nm+"]",self).val();
+ if(v) {
+ sdata[nm] = v;
+ if(self.p.marksearched){
+ $("#jqgh_"+this.name,gr.grid.hDiv).addClass("dirty-cell");
+ }
+ j++;
+ } else {
+ if(self.p.marksearched){
+ $("#jqgh_"+this.name,gr.grid.hDiv).removeClass("dirty-cell");
+ }
+ try {
+ delete gr.p.postData[this.index];
+ } catch (e) {}
+ }
+ } else {
+ v = $("input[name="+nm+"]",self).val();
+ if(v) {
+ sdata[nm] = v;
+ if(self.p.marksearched){
+ $("#jqgh_"+this.name,gr.grid.hDiv).addClass("dirty-cell");
+ }
+ j++;
+ } else {
+ if(self.p.marksearched){
+ $("#jqgh_"+this.name,gr.grid.hDiv).removeClass("dirty-cell");
+ }
+ try {
+ delete gr.p.postData[this.index];
+ } catch(x) {}
+ }
+ }
+ });
+ var sd = j>0 ? true : false;
+ $.extend(gr.p.postData,sdata);
+ var saveurl;
+ if(self.p.url) {
+ saveurl = $(gr).jqGrid("getGridParam",'url');
+ $(gr).jqGrid("setGridParam",{url:self.p.url});
+ }
+ $(gr).jqGrid("setGridParam",{search:sd}).trigger("reloadGrid",[{page:1}]);
+ if(saveurl) {$(gr).jqGrid("setGridParam",{url:saveurl});}
+ if($.isFunction(self.p.afterSearch)){self.p.afterSearch();}
+ };
+ var clearSearch = function(){
+ var sdata={}, v, j=0;
+ var gr = $(self.p.gridid)[0], nm;
+ if($.isFunction(self.p.beforeClear)){self.p.beforeClear();}
+ $.each(self.p.filterModel,function(i,n){
+ nm = this.index;
+ v = (this.defval) ? this.defval : "";
+ if(!this.stype){this.stype='text';}
+ switch (this.stype) {
+ case 'select' :
+ var v1;
+ $("select[name="+nm+"] option",self).each(function (i){
+ if(i===0) { this.selected = true; }
+ if ($(this).text() == v) {
+ this.selected = true;
+ v1 = $(this).val();
+ return false;
+ }
+ });
+ if(v1) {
+ // post the key and not the text
+ sdata[nm] = v1;
+ if(self.p.marksearched){
+ $("#jqgh_"+this.name,gr.grid.hDiv).addClass("dirty-cell");
+ }
+ j++;
+ } else {
+ if(self.p.marksearched){
+ $("#jqgh_"+this.name,gr.grid.hDiv).removeClass("dirty-cell");
+ }
+ try {
+ delete gr.p.postData[this.index];
+ } catch (e) {}
+ }
+ break;
+ case 'text':
+ $("input[name="+nm+"]",self).val(v);
+ if(v) {
+ sdata[nm] = v;
+ if(self.p.marksearched){
+ $("#jqgh_"+this.name,gr.grid.hDiv).addClass("dirty-cell");
+ }
+ j++;
+ } else {
+ if(self.p.marksearched){
+ $("#jqgh_"+this.name,gr.grid.hDiv).removeClass("dirty-cell");
+ }
+ try {
+ delete gr.p.postData[this.index];
+ } catch (k) {}
+ }
+ break;
+ }
+ });
+ var sd = j>0 ? true : false;
+ $.extend(gr.p.postData,sdata);
+ var saveurl;
+ if(self.p.url) {
+ saveurl = $(gr).jqGrid("getGridParam",'url');
+ $(gr).jqGrid("setGridParam",{url:self.p.url});
+ }
+ $(gr).jqGrid("setGridParam",{search:sd}).trigger("reloadGrid",[{page:1}]);
+ if(saveurl) {$(gr).jqGrid("setGridParam",{url:saveurl});}
+ if($.isFunction(self.p.afterClear)){self.p.afterClear();}
+ };
+ var tbl;
+ var formFill = function(){
+ var tr = document.createElement("tr");
+ var tr1, sb, cb,tl,td;
+ if(self.p.formtype=='horizontal'){
+ $(tbl).append(tr);
+ }
+ $.each(self.p.filterModel,function(i,n){
+ tl = document.createElement("td");
+ $(tl).append("<label for='"+this.name+"'>"+this.label+"</label>");
+ td = document.createElement("td");
+ var $t=this;
+ if(!this.stype) { this.stype='text';}
+ switch (this.stype)
+ {
+ case "select":
+ if(this.surl) {
+ // data returned should have already constructed html select
+ $(td).load(this.surl,function(){
+ if($t.defval) { $("select",this).val($t.defval); }
+ $("select",this).attr({name:$t.index || $t.name, id: "sg_"+$t.name});
+ if($t.sopt) { $("select",this).attr($t.sopt); }
+ if(self.p.gridToolbar===true && $t.width) {
+ $("select",this).width($t.width);
+ }
+ if(self.p.autosearch===true){
+ $("select",this).change(function(e){
+ triggerSearch();
+ return false;
+ });
+ }
+ });
+ } else {
+ // sopt to construct the values
+ if($t.sopt.value) {
+ var oSv = $t.sopt.value;
+ var elem = document.createElement("select");
+ $(elem).attr({name:$t.index || $t.name, id: "sg_"+$t.name}).attr($t.sopt);
+ var so, sv, ov;
+ if(typeof oSv === "string") {
+ so = oSv.split(";");
+ for(var k=0; k<so.length;k++){
+ sv = so[k].split(":");
+ ov = document.createElement("option");
+ ov.value = sv[0]; ov.innerHTML = sv[1];
+ if (sv[1]==$t.defval) { ov.selected ="selected"; }
+ elem.appendChild(ov);
+ }
+ } else if(typeof oSv === "object" ) {
+ for ( var key in oSv) {
+ if(oSv.hasOwnProperty(key)) {
+ i++;
+ ov = document.createElement("option");
+ ov.value = key; ov.innerHTML = oSv[key];
+ if (oSv[key]==$t.defval) { ov.selected ="selected"; }
+ elem.appendChild(ov);
+ }
+ }
+ }
+ if(self.p.gridToolbar===true && $t.width) {
+ $(elem).width($t.width);
+ }
+ $(td).append(elem);
+ if(self.p.autosearch===true){
+ $(elem).change(function(e){
+ triggerSearch();
+ return false;
+ });
+ }
+ }
+ }
+ break;
+ case 'text':
+ var df = this.defval ? this.defval: "";
+ $(td).append("<input type='text' name='"+(this.index || this.name)+"' id='sg_"+this.name+"' value='"+df+"'/>");
+ if($t.sopt) { $("input",td).attr($t.sopt); }
+ if(self.p.gridToolbar===true && $t.width) {
+ if($.browser.msie) {
+ $("input",td).width($t.width-4);
+ } else {
+ $("input",td).width($t.width-2);
+ }
+ }
+ if(self.p.autosearch===true){
+ $("input",td).keypress(function(e){
+ var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
+ if(key == 13){
+ triggerSearch();
+ return false;
+ }
+ return this;
+ });
+ }
+ break;
+ }
+ if(self.p.formtype=='horizontal'){
+ if(self.p.gridToolbar===true && self.p.gridNames===false) {
+ $(tr).append(td);
+ } else {
+ $(tr).append(tl).append(td);
+ }
+ $(tr).append(td);
+ } else {
+ tr1 = document.createElement("tr");
+ $(tr1).append(tl).append(td);
+ $(tbl).append(tr1);
+ }
+ });
+ td = document.createElement("td");
+ if(self.p.enableSearch === true){
+ sb = "<input type='button' id='sButton' class='"+self.p.buttonclass+"' value='"+self.p.searchButton+"'/>";
+ $(td).append(sb);
+ $("input#sButton",td).click(function(){
+ triggerSearch();
+ return false;
+ });
+ }
+ if(self.p.enableClear === true) {
+ cb = "<input type='button' id='cButton' class='"+self.p.buttonclass+"' value='"+self.p.clearButton+"'/>";
+ $(td).append(cb);
+ $("input#cButton",td).click(function(){
+ clearSearch();
+ return false;
+ });
+ }
+ if(self.p.enableClear === true || self.p.enableSearch === true) {
+ if(self.p.formtype=='horizontal') {
+ $(tr).append(td);
+ } else {
+ tr1 = document.createElement("tr");
+ $(tr1).append("<td> </td>").append(td);
+ $(tbl).append(tr1);
+ }
+ }
+ };
+ var frm = $("<form name='SearchForm' style=display:inline;' class='"+this.p.formclass+"'></form>");
+ tbl =$("<table class='"+this.p.tableclass+"' cellspacing='0' cellpading='0' border='0'><tbody></tbody></table>");
+ $(frm).append(tbl);
+ formFill();
+ $(this).append(frm);
+ this.triggerSearch = triggerSearch;
+ this.clearSearch = clearSearch;
+ });
+ }
+
+});
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/grid.postext.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/grid.postext.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/grid.postext.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,64 @@
+;(function($){
+/**
+ * jqGrid extension
+ * Paul Tiseo ptiseo(a)wasteconsultants.com
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl-2.0.html
+**/
+$.jgrid.extend({
+ getPostData : function(){
+ var $t = this[0];
+ if(!$t.grid) { return; }
+ return $t.p.postData;
+ },
+ setPostData : function( newdata ) {
+ var $t = this[0];
+ if(!$t.grid) { return; }
+ // check if newdata is correct type
+ if ( typeof(newdata) === 'object' ) {
+ $t.p.postData = newdata;
+ }
+ else {
+ alert("Error: cannot add a non-object postData value. postData unchanged.");
+ }
+ },
+ appendPostData : function( newdata ) {
+ var $t = this[0];
+ if(!$t.grid) { return; }
+ // check if newdata is correct type
+ if ( typeof(newdata) === 'object' ) {
+ $.extend($t.p.postData, newdata);
+ }
+ else {
+ alert("Error: cannot append a non-object postData value. postData unchanged.");
+ }
+ },
+ setPostDataItem : function( key, val ) {
+ var $t = this[0];
+ if(!$t.grid) { return; }
+ $t.p.postData[key] = val;
+ },
+ getPostDataItem : function( key ) {
+ var $t = this[0];
+ if(!$t.grid) { return; }
+ return $t.p.postData[key];
+ },
+ removePostDataItem : function( key ) {
+ var $t = this[0];
+ if(!$t.grid) { return; }
+ delete $t.p.postData[key];
+ },
+ getUserData : function(){
+ var $t = this[0];
+ if(!$t.grid) { return; }
+ return $t.p.userData;
+ },
+ getUserDataItem : function( key ) {
+ var $t = this[0];
+ if(!$t.grid) { return; }
+ return $t.p.userData[key];
+ }
+});
+})(jQuery);
\ No newline at end of file
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/grid.setcolumns.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/grid.setcolumns.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/grid.setcolumns.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,126 @@
+;(function($){
+/**
+ * jqGrid extension for manipulating columns properties
+ * Piotr Roznicki roznicki(a)o2.pl
+ * http://www.roznicki.prv.pl
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl-2.0.html
+**/
+$.jgrid.extend({
+ setColumns : function(p) {
+ p = $.extend({
+ top : 0,
+ left: 0,
+ width: 200,
+ height: 'auto',
+ dataheight: 'auto',
+ modal: false,
+ drag: true,
+ beforeShowForm: null,
+ afterShowForm: null,
+ afterSubmitForm: null,
+ closeOnEscape : true,
+ ShrinkToFit : false,
+ jqModal : false,
+ saveicon: [true,"left","ui-icon-disk"],
+ closeicon: [true,"left","ui-icon-close"],
+ onClose : null,
+ colnameview : true,
+ closeAfterSubmit : true,
+ updateAfterCheck : false,
+ recreateForm : false
+ }, $.jgrid.col, p ||{});
+ return this.each(function(){
+ var $t = this;
+ if (!$t.grid ) { return; }
+ var onBeforeShow = typeof p.beforeShowForm === 'function' ? true: false;
+ var onAfterShow = typeof p.afterShowForm === 'function' ? true: false;
+ var onAfterSubmit = typeof p.afterSubmitForm === 'function' ? true: false;
+ var gID = $t.p.id,
+ dtbl = "ColTbl_"+gID,
+ IDs = {themodal:'colmod'+gID,modalhead:'colhd'+gID,modalcontent:'colcnt'+gID, scrollelm: dtbl};
+ if(p.recreateForm===true && $("#"+IDs.themodal).html() != null) {
+ $("#"+IDs.themodal).remove();
+ }
+ if ( $("#"+IDs.themodal).html() != null ) {
+ if(onBeforeShow) { p.beforeShowForm($("#"+dtbl)); }
+ $.jgrid.viewModal("#"+IDs.themodal,{gbox:"#gbox_"+gID,jqm:p.jqModal, jqM:false, modal:p.modal});
+ if(onAfterShow) { p.afterShowForm($("#"+dtbl)); }
+ } else {
+ var dh = isNaN(p.dataheight) ? p.dataheight : p.dataheight+"px";
+ var formdata = "<div id='"+dtbl+"' class='formdata' style='width:100%;overflow:auto;position:relative;height:"+dh+";'>";
+ formdata += "<table class='ColTable' cellspacing='1' cellpading='2' border='0'><tbody>";
+ for(i=0;i<this.p.colNames.length;i++){
+ if(!$t.p.colModel[i].hidedlg) { // added from T. Tomov
+ formdata += "<tr><td style='white-space: pre;'><input type='checkbox' style='margin-right:5px;' id='col_" + this.p.colModel[i].name + "' class='cbox' value='T' " +
+ ((this.p.colModel[i].hidden===false)?"checked":"") + "/>" + "<label for='col_" + this.p.colModel[i].name + "'>" + this.p.colNames[i] + ((p.colnameview) ? " (" + this.p.colModel[i].name + ")" : "" )+ "</label></td></tr>";
+ }
+ }
+ formdata += "</tbody></table></div>"
+ var bS = !p.updateAfterCheck ? "<a href='javascript:void(0)' id='dData' class='fm-button ui-state-default ui-corner-all'>"+p.bSubmit+"</a>" : "",
+ bC ="<a href='javascript:void(0)' id='eData' class='fm-button ui-state-default ui-corner-all'>"+p.bCancel+"</a>";
+ formdata += "<table border='0' class='EditTable' id='"+dtbl+"_2'><tbody><tr style='display:block;height:3px;'><td></td></tr><tr><td class='DataTD ui-widget-content'></td></tr><tr><td class='ColButton EditButton'>"+bS+" "+bC+"</td></tr></tbody></table>";
+ p.gbox = "#gbox_"+gID;
+ $.jgrid.createModal(IDs,formdata,p,"#gview_"+$t.p.id,$("#gview_"+$t.p.id)[0]);
+ if(p.saveicon[0]==true) {
+ $("#dData","#"+dtbl+"_2").addClass(p.saveicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
+ .append("<span class='ui-icon "+p.saveicon[2]+"'></span>");
+ }
+ if(p.closeicon[0]==true) {
+ $("#eData","#"+dtbl+"_2").addClass(p.closeicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
+ .append("<span class='ui-icon "+p.closeicon[2]+"'></span>");
+ }
+ if(!p.updateAfterCheck) {
+ $("#dData","#"+dtbl+"_2").click(function(e){
+ for(i=0;i<$t.p.colModel.length;i++){
+ if(!$t.p.colModel[i].hidedlg) { // added from T. Tomov
+ var nm = $t.p.colModel[i].name.replace(/\./g, "\\.");
+ if($("#col_" + nm,"#"+dtbl).attr("checked")) {
+ $($t).jqGrid("showCol",$t.p.colModel[i].name);
+ $("#col_" + nm,"#"+dtbl).attr("defaultChecked",true); // Added from T. Tomov IE BUG
+ } else {
+ $($t).jqGrid("hideCol",$t.p.colModel[i].name);
+ $("#col_" + nm,"#"+dtbl).attr("defaultChecked",""); // Added from T. Tomov IE BUG
+ }
+ }
+ }
+ if(p.ShrinkToFit===true) {
+ $($t).jqGrid("setGridWidth",$t.grid.width-0.001,true);
+ }
+ if(p.closeAfterSubmit) $.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal, onClose: p.onClose});
+ if (onAfterSubmit) { p.afterSubmitForm($("#"+dtbl)); }
+ return false;
+ });
+ } else {
+ $(":input","#"+dtbl).click(function(e){
+ var cn = this.id.substr(4);
+ if(cn){
+ if(this.checked) {
+ $($t).jqGrid("showCol",cn);
+ } else {
+ $($t).jqGrid("hideCol",cn);
+ }
+ if(p.ShrinkToFit===true) {
+ $($t).jqGrid("setGridWidth",$t.grid.width-0.001,true);
+ }
+ }
+ return this;
+ });
+ }
+ $("#eData", "#"+dtbl+"_2").click(function(e){
+ $.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal, onClose: p.onClose});
+ return false;
+ });
+ $("#dData, #eData","#"+dtbl+"_2").hover(
+ function(){$(this).addClass('ui-state-hover');},
+ function(){$(this).removeClass('ui-state-hover');}
+ );
+ if(onBeforeShow) { p.beforeShowForm($("#"+dtbl)); }
+ $.jgrid.viewModal("#"+IDs.themodal,{gbox:"#gbox_"+gID,jqm:p.jqModal, jqM: true, modal:p.modal});
+ if(onAfterShow) { p.afterShowForm($("#"+dtbl)); }
+ }
+ });
+ }
+});
+})(jQuery);
\ No newline at end of file
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/jquery.contextmenu.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/jquery.contextmenu.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/jquery.contextmenu.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,147 @@
+/*
+ * ContextMenu - jQuery plugin for right-click context menus
+ *
+ * Author: Chris Domigan
+ * Contributors: Dan G. Switzer, II
+ * Parts of this plugin are inspired by Joern Zaefferer's Tooltip plugin
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * Version: r2
+ * Date: 16 July 2007
+ *
+ * For documentation visit http://www.trendskitchens.co.nz/jquery/contextmenu/
+ *
+ */
+
+(function($) {
+
+ var menu, shadow, content, hash, currentTarget;
+ var defaults = {
+ menuStyle: {
+ listStyle: 'none',
+ padding: '1px',
+ margin: '0px',
+ backgroundColor: '#fff',
+ border: '1px solid #999',
+ width: '100px'
+ },
+ itemStyle: {
+ margin: '0px',
+ color: '#000',
+ display: 'block',
+ cursor: 'default',
+ padding: '3px',
+ border: '1px solid #fff',
+ backgroundColor: 'transparent'
+ },
+ itemHoverStyle: {
+ border: '1px solid #0a246a',
+ backgroundColor: '#b6bdd2'
+ },
+ eventPosX: 'pageX',
+ eventPosY: 'pageY',
+ shadow : true,
+ onContextMenu: null,
+ onShowMenu: null
+ };
+
+ $.fn.contextMenu = function(id, options) {
+ if (!menu) { // Create singleton menu
+ menu = $('<div id="jqContextMenu"></div>')
+ .hide()
+ .css({position:'absolute', zIndex:'500'})
+ .appendTo('body')
+ .bind('click', function(e) {
+ e.stopPropagation();
+ });
+ }
+ if (!shadow) {
+ shadow = $('<div></div>')
+ .css({backgroundColor:'#000',position:'absolute',opacity:0.2,zIndex:499})
+ .appendTo('body')
+ .hide();
+ }
+ hash = hash || [];
+ hash.push({
+ id : id,
+ menuStyle: $.extend({}, defaults.menuStyle, options.menuStyle || {}),
+ itemStyle: $.extend({}, defaults.itemStyle, options.itemStyle || {}),
+ itemHoverStyle: $.extend({}, defaults.itemHoverStyle, options.itemHoverStyle || {}),
+ bindings: options.bindings || {},
+ shadow: options.shadow || options.shadow === false ? options.shadow : defaults.shadow,
+ onContextMenu: options.onContextMenu || defaults.onContextMenu,
+ onShowMenu: options.onShowMenu || defaults.onShowMenu,
+ eventPosX: options.eventPosX || defaults.eventPosX,
+ eventPosY: options.eventPosY || defaults.eventPosY
+ });
+
+ var index = hash.length - 1;
+ $(this).bind('contextmenu', function(e) {
+ // Check if onContextMenu() defined
+ var bShowContext = (!!hash[index].onContextMenu) ? hash[index].onContextMenu(e) : true;
+ currentTarget = e.target;
+ if (bShowContext) {
+ display(index, this, e );
+ return false;
+ }
+ });
+ return this;
+ };
+
+ function display(index, trigger, e ) {
+ var cur = hash[index];
+ content = $('#'+cur.id).find('ul:first').clone(true);
+ content.css(cur.menuStyle).find('li').css(cur.itemStyle).hover(
+ function() {
+ $(this).css(cur.itemHoverStyle);
+ },
+ function(){
+ $(this).css(cur.itemStyle);
+ }
+ ).find('img').css({verticalAlign:'middle',paddingRight:'2px'});
+
+ // Send the content to the menu
+ menu.html(content);
+
+ // if there's an onShowMenu, run it now -- must run after content has been added
+ // if you try to alter the content variable before the menu.html(), IE6 has issues
+ // updating the content
+ if (!!cur.onShowMenu) menu = cur.onShowMenu(e, menu);
+
+ $.each(cur.bindings, function(id, func) {
+ $('#'+id, menu).bind('click', function() {
+ hide();
+ func(trigger, currentTarget);
+ });
+ });
+
+ menu.css({'left':e[cur.eventPosX],'top':e[cur.eventPosY]}).show();
+ if (cur.shadow) shadow.css({width:menu.width(),height:menu.height(),left:e.pageX+2,top:e.pageY+2}).show();
+ $(document).one('click', hide);
+ }
+
+ function hide() {
+ menu.hide();
+ shadow.hide();
+ }
+
+ // Apply defaults
+ $.contextMenu = {
+ defaults : function(userDefaults) {
+ $.each(userDefaults, function(i, val) {
+ if (typeof val == 'object' && defaults[i]) {
+ $.extend(defaults[i], val);
+ }
+ else defaults[i] = val;
+ });
+ }
+ };
+
+})(jQuery);
+
+$(function() {
+ $('div.contextMenu').hide();
+});
\ No newline at end of file
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/jquery.searchFilter.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/jquery.searchFilter.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/jquery.searchFilter.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,716 @@
+/* Plugin: searchFilter v1.2.9
+ * Author: Kasey Speakman (kasey(a)cornerspeed.com)
+ * License: Dual Licensed, MIT and GPL v2 (http://www.gnu.org/licenses/gpl-2.0.html)
+ *
+ * REQUIREMENTS:
+ * jQuery 1.3+ (http://jquery.com/)
+ * A Themeroller Theme (http://jqueryui.com/themeroller/)
+ *
+ * SECURITY WARNING
+ * You should always implement server-side checking to ensure that
+ * the query will fail when forged/invalid data is received.
+ * Clever users can send any value they want through JavaScript and HTTP POST/GET.
+ *
+ * THEMES
+ * Simply include the CSS file for your Themeroller theme.
+ *
+ * DESCRIPTION
+ * This plugin creates a new searchFilter object in the specified container
+ *
+ * INPUT TYPE
+ * fields: an array of field objects. each object has the following properties:
+ * text: a string containing the display name of the field (e.g. "Field 1")
+ * itemval: a string containing the actual field name (e.g. "field1")
+ * optional properties:
+ * ops: an array of operators in the same format as jQuery.fn.searchFilter.defaults.operators
+ * that is: [ { op: 'gt', text: 'greater than'}, { op:'lt', text: 'less than'}, ... ]
+ * if not specified, the passed-in options used, and failting that, jQuery.fn.searchFilter.defaults.operators will be used
+ * *** NOTE ***
+ * Specifying a dataUrl or dataValues property means that a <select ...> (drop-down-list) will be generated
+ * instead of a text input <input type='text'.../> where the user would normally type in their search data
+ * ************
+ * dataUrl: a url that will return the html select for this field, this url will only be called once for this field
+ * dataValues: the possible values for this field in the form [ { text: 'Data Display Text', value: 'data_actual_value' }, { ... } ]
+ * dataInit: a function that you can use to initialize the data field. this function is passed the jQuery-fied data element
+ * dataEvents: list of events to apply to the data element. uses $("#id").bind(type, [data], fn) to bind events to data element
+ * *** JSON of this object could look like this: ***
+ * var fields = [
+ * {
+ * text: 'Field Display Name',
+ * itemval: 'field_actual_name',
+ * // below this are optional values
+ * ops: [ // this format is the same as jQuery.fn.searchFilter.defaults.operators
+ * { op: 'gt', text: 'greater than' },
+ * { op: 'lt', text: 'less than' }
+ * ],
+ * dataUrl: 'http://server/path/script.php?propName=propValue', // using this creates a select for the data input instead of an input type='text'
+ * dataValues: [ // using this creates a select for the data input instead of an input type='text'
+ * { text: 'Data Value Display Name', value: 'data_actual_value' },
+ * { ... }
+ * ],
+ * dataInit: function(jElem) { jElem.datepicker(options); },
+ * dataEvents: [ // these are the same options that you pass to $("#id").bind(type, [data], fn)
+ * { type: 'click', data: { i: 7 }, fn: function(e) { console.log(e.data.i); } },
+ * { type: 'keypress', fn: function(e) { console.log('keypress'); } }
+ * ]
+ * },
+ * { ... }
+ * ]
+ * options: name:value properties containing various creation options
+ * see jQuery.fn.searchFilter.defaults for the overridable options
+ *
+ * RETURN TYPE: This plugin returns a SearchFilter object, which has additional SearchFilter methods:
+ * Methods
+ * add: Adds a filter. added to the end of the list unless a jQuery event object or valid row number is passed.
+ * del: Removes a filter. removed from the end of the list unless a jQuery event object or valid row number is passed.
+ * reset: resets filters back to original state (only one blank filter), and calls onReset
+ * search: puts the search rules into an object and calls onSearch with it
+ * close: calls the onClose event handler
+ *
+ * USAGE
+ * HTML
+ * <head>
+ * ...
+ * <script src="path/to/jquery.min.js" type="text/javascript"></script>
+ * <link href="path/to/themeroller.css" rel="Stylesheet" type="text/css" />
+ * <script src="path/to/jquery.searchFilter.js" type="text/javascript"></script>
+ * <link href="path/to/jquery.searchFilter.css" rel="Stylesheet" type="text/css" />
+ * ...
+ * </head>
+ * <body>
+ * ...
+ * <div id='mySearch'></div>
+ * ...
+ * </body>
+ * JQUERY
+ * Methods
+ * initializing: $("#mySearch").searchFilter([{text: "Field 1", value: "field1"},{text: "Field 2", value: "field2"}], {onSearch: myFilterRuleReceiverFn, onReset: myFilterResetFn });
+ * Manual Methods (there's no need to call these methods unless you are trying to manipulate searchFilter with script)
+ * add: $("#mySearch").searchFilter().add(); // appends a blank filter
+ * $("#mySearch").searchFilter().add(0); // copies the first filter as second
+ * del: $("#mySearch").searchFilter().del(); // removes the bottom filter
+ * $("#mySearch").searchFilter().del(1); // removes the second filter
+ * search: $("#mySearch").searchFilter().search(); // invokes onSearch, passing it a ruleGroup object
+ * reset: $("#mySearch").searchFilter().reset(); // resets rules and invokes onReset
+ * close: $("#mySearch").searchFilter().close(); // without an onClose handler, equivalent to $("#mySearch").hide();
+ *
+ * NOTE: You can get the jQuery object back from the SearchFilter object by chaining .$
+ * Example
+ * $("#mySearch").searchFilter().add().add().reset().$.hide();
+ * Verbose Example
+ * $("#mySearch") // gets jQuery object for the HTML element with id="mySearch"
+ * .searchFilter() // gets the SearchFilter object for an existing search filter
+ * .add() // adds a new filter to the end of the list
+ * .add() // adds another new filter to the end of the list
+ * .reset() // resets filters back to original state, triggers onReset
+ * .$ // returns jQuery object for $("#mySearch")
+ * .hide(); // equivalent to $("#mySearch").hide();
+ */
+
+jQuery.fn.searchFilter = function(fields, options) {
+
+ function SearchFilter(jQ, fields, options) {
+
+
+ //---------------------------------------------------------------
+ // PUBLIC VARS
+ //---------------------------------------------------------------
+
+ this.$ = jQ; // makes the jQuery object available as .$ from the return value
+
+
+ //---------------------------------------------------------------
+ // PUBLIC FUNCTIONS
+ //---------------------------------------------------------------
+
+ this.add = function(i) {
+ if (i == null) jQ.find(".ui-add-last").click();
+ else jQ.find(".sf:eq(" + i + ") .ui-add").click();
+ return this;
+ };
+
+ this.del = function(i) {
+ if (i == null) jQ.find(".sf:last .ui-del").click();
+ else jQ.find(".sf:eq(" + i + ") .ui-del").click();
+ return this;
+ };
+
+ this.search = function(e) {
+ jQ.find(".ui-search").click();
+ return this;
+ };
+
+ this.reset = function(o) {
+ if(o===undefined) o = false;
+ jQ.find(".ui-reset").trigger('click',[o]);
+ return this;
+ };
+
+ this.close = function() {
+ jQ.find(".ui-closer").click();
+ return this;
+ };
+
+
+
+ //---------------------------------------------------------------
+ // "CONSTRUCTOR" (in air quotes)
+ //---------------------------------------------------------------
+
+ if (fields != null) { // type coercion matches undefined as well as null
+
+
+ //---------------------------------------------------------------
+ // UTILITY FUNCTIONS
+ //---------------------------------------------------------------
+
+ function hover() {
+ jQuery(this).toggleClass("ui-state-hover");
+ return false;
+ }
+
+ function active(e) {
+ jQuery(this).toggleClass("ui-state-active", (e.type == "mousedown"));
+ return false;
+ }
+
+ function buildOpt(value, text) {
+ return "<option value='" + value + "'>" + text + "</option>";
+ }
+
+ function buildSel(className, options, isHidden) {
+ return "<select class='" + className + "'" + (isHidden ? " style='display:none;'" : "") + ">" + options + "</select>";
+ }
+
+ function initData(selector, fn) {
+ var jElem = jQ.find("tr.sf td.data " + selector);
+ if (jElem[0] != null)
+ fn(jElem);
+ }
+
+ function bindDataEvents(selector, events) {
+ var jElem = jQ.find("tr.sf td.data " + selector);
+ if (jElem[0] != null) {
+ jQuery.each(events, function() {
+ if (this.data != null)
+ jElem.bind(this.type, this.data, this.fn);
+ else
+ jElem.bind(this.type, this.fn);
+ });
+ }
+ }
+
+
+ //---------------------------------------------------------------
+ // SUPER IMPORTANT PRIVATE VARS
+ //---------------------------------------------------------------
+
+ // copies jQuery.fn.searchFilter.defaults.options properties onto an empty object, then options onto that
+ var opts = jQuery.extend({}, jQuery.fn.searchFilter.defaults, options);
+
+ // this is keeps track of the last asynchronous setup
+ var highest_late_setup = -1;
+
+
+ //---------------------------------------------------------------
+ // CREATION PROCESS STARTS
+ //---------------------------------------------------------------
+
+ // generate the global ops
+ var gOps_html = "";
+ jQuery.each(opts.groupOps, function() { gOps_html += buildOpt(this.op, this.text); });
+ gOps_html = "<select name='groupOp'>" + gOps_html + "</select>";
+
+ /* original content - doesn't minify very well
+ jQ
+ .html("") // clear any old content
+ .addClass("ui-searchFilter") // add classes
+ .append( // add content
+ "\
+ <div class='ui-widget-overlay' style='z-index: -1'> </div>\
+ <table class='ui-widget-content ui-corner-all'>\
+ <thead>\
+ <tr>\
+ <td colspan='5' class='ui-widget-header ui-corner-all' style='line-height: 18px;'>\
+ <div class='ui-closer ui-state-default ui-corner-all ui-helper-clearfix' style='float: right;'>\
+ <span class='ui-icon ui-icon-close'></span>\
+ </div>\
+ " + opts.windowTitle + "\
+ </td>\
+ </tr>\
+ </thead>\
+ <tbody>\
+ <tr class='sf'>\
+ <td class='fields'></td>\
+ <td class='ops'></td>\
+ <td class='data'></td>\
+ <td><div class='ui-del ui-state-default ui-corner-all'><span class='ui-icon ui-icon-minus'></span></div></td>\
+ <td><div class='ui-add ui-state-default ui-corner-all'><span class='ui-icon ui-icon-plus'></span></div></td>\
+ </tr>\
+ <tr>\
+ <td colspan='5' class='divider'><div> </div></td>\
+ </tr>\
+ </tbody>\
+ <tfoot>\
+ <tr>\
+ <td colspan='3'>\
+ <span class='ui-reset ui-state-default ui-corner-all' style='display: inline-block; float: left;'><span class='ui-icon ui-icon-arrowreturnthick-1-w' style='float: left;'></span><span style='line-height: 18px; padding: 0 7px 0 3px;'>" + opts.resetText + "</span></span>\
+ <span class='ui-search ui-state-default ui-corner-all' style='display: inline-block; float: right;'><span class='ui-icon ui-icon-search' style='float: left;'></span><span style='line-height: 18px; padding: 0 7px 0 3px;'>" + opts.searchText + "</span></span>\
+ <span class='matchText'>" + opts.matchText + "</span> \
+ " + gOps_html + " \
+ <span class='rulesText'>" + opts.rulesText + "</span>\
+ </td>\
+ <td> </td>\
+ <td><div class='ui-add-last ui-state-default ui-corner-all'><span class='ui-icon ui-icon-plusthick'></span></div></td>\
+ </tr>\
+ </tfoot>\
+ </table>\
+ ");
+ /* end hard-to-minify code */
+ /* begin easier to minify code */
+ jQ.html("").addClass("ui-searchFilter").append("<div class='ui-widget-overlay' style='z-index: -1'> </div><table class='ui-widget-content ui-corner-all'><thead><tr><td colspan='5' class='ui-widget-header ui-corner-all' style='line-height: 18px;'><div class='ui-closer ui-state-default ui-corner-all ui-helper-clearfix' style='float: right;'><span class='ui-icon ui-icon-close'></span></div>" + opts.windowTitle + "</td></tr></thead><tbody><tr class='sf'><td class='fields'></td><td class='ops'></td><td class='data'></td><td><div class='ui-del ui-state-default ui-corner-all'><span class='ui-icon ui-icon-minus'></span></div></td><td><div class='ui-add ui-state-default ui-corner-all'><span class='ui-icon ui-icon-plus'></span></div></td></tr><tr><td colspan='5' class='divider'><hr class='ui-widget-content' style='margin:1px'/></td></tr></tbody><tfoot><tr><td colspan='3'><span class='ui-reset ui-state-default ui-corner-all' style='display: inline-block; float: left;'><span class='ui-icon ui-icon-arrowreturnthick-1-w' style='float: left;'></span><span style='line-height: 18px; padding: 0 7px 0 3px;'>" + opts.resetText + "</span></span><span class='ui-search ui-state-default ui-corner-all' style='display: inline-block; float: right;'><span class='ui-icon ui-icon-search' style='float: left;'></span><span style='line-height: 18px; padding: 0 7px 0 3px;'>" + opts.searchText + "</span></span><span class='matchText'>" + opts.matchText + "</span> " + gOps_html + " <span class='rulesText'>" + opts.rulesText + "</span></td><td> </td><td><div class='ui-add-last ui-state-default ui-corner-all'><span class='ui-icon ui-icon-plusthick'></span></div></td></tr></tfoot></table>");
+ /* end easier-to-minify code */
+
+ var jRow = jQ.find("tr.sf");
+ var jFields = jRow.find("td.fields");
+ var jOps = jRow.find("td.ops");
+ var jData = jRow.find("td.data");
+
+ // generate the defaults
+ var default_ops_html = "";
+ jQuery.each(opts.operators, function() { default_ops_html += buildOpt(this.op, this.text); });
+ default_ops_html = buildSel("default", default_ops_html, true);
+ jOps.append(default_ops_html);
+ var default_data_html = "<input type='text' class='default' style='display:none;' />";
+ jData.append(default_data_html);
+
+ // generate the field list as a string
+ var fields_html = "";
+ var has_custom_ops = false;
+ var has_custom_data = false;
+ jQuery.each(fields, function(i) {
+ var field_num = i;
+ fields_html += buildOpt(this.itemval, this.text);
+ // add custom ops if they exist
+ if (this.ops != null) {
+ has_custom_ops = true;
+ var custom_ops = "";
+ jQuery.each(this.ops, function() { custom_ops += buildOpt(this.op, this.text); });
+ custom_ops = buildSel("field" + field_num, custom_ops, true);
+ jOps.append(custom_ops);
+ }
+ // add custom data if it is given
+ if (this.dataUrl != null) {
+ if (i > highest_late_setup) highest_late_setup = i;
+ has_custom_data = true;
+ var dEvents = this.dataEvents;
+ var iEvent = this.dataInit;
+ var bs = this.buildSelect;
+ jQuery.ajax(jQuery.extend({
+ url : this.dataUrl,
+ complete: function(data) {
+ var $d;
+ if(bs != null) $d =jQuery("<div />").append(bs(data));
+ else $d = jQuery("<div />").append(data.responseText);
+ $d.find("select").addClass("field" + field_num).hide();
+ jData.append($d.html());
+ if (iEvent) initData(".field" + i, iEvent);
+ if (dEvents) bindDataEvents(".field" + i, dEvents);
+ if (i == highest_late_setup) { // change should get called no more than twice when this searchFilter is constructed
+ jQ.find("tr.sf td.fields select[name='field']").change();
+ }
+ }
+ },opts.ajaxSelectOptions));
+ } else if (this.dataValues != null) {
+ has_custom_data = true;
+ var custom_data = "";
+ jQuery.each(this.dataValues, function() { custom_data += buildOpt(this.value, this.text); });
+ custom_data = buildSel("field" + field_num, custom_data, true);
+ jData.append(custom_data);
+ } else if (this.dataEvents != null || this.dataInit != null) {
+ has_custom_data = true;
+ var custom_data = "<input type='text' class='field" + field_num + "' />";
+ jData.append(custom_data);
+ }
+ // attach events to data if they exist
+ if (this.dataInit != null && i != highest_late_setup)
+ initData(".field" + i, this.dataInit);
+ if (this.dataEvents != null && i != highest_late_setup)
+ bindDataEvents(".field" + i, this.dataEvents);
+ });
+ fields_html = "<select name='field'>" + fields_html + "</select>";
+ jFields.append(fields_html);
+
+ // setup the field select with an on-change event if there are custom ops or data
+ var jFSelect = jFields.find("select[name='field']");
+ if (has_custom_ops) jFSelect.change(function(e) {
+ var index = e.target.selectedIndex;
+ var td = jQuery(e.target).parents("tr.sf").find("td.ops");
+ td.find("select").removeAttr("name").hide(); // disown and hide all elements
+ var jElem = td.find(".field" + index);
+ if (jElem[0] == null) jElem = td.find(".default"); // if there's not an element for that field, use the default one
+ jElem.attr("name", "op").show();
+ return false;
+ });
+ else jOps.find(".default").attr("name", "op").show();
+ if (has_custom_data) jFSelect.change(function(e) {
+ var index = e.target.selectedIndex;
+ var td = jQuery(e.target).parents("tr.sf").find("td.data");
+ td.find("select,input").removeClass("vdata").hide(); // disown and hide all elements
+ var jElem = td.find(".field" + index);
+ if (jElem[0] == null) jElem = td.find(".default"); // if there's not an element for that field, use the default one
+ jElem.show().addClass("vdata");
+ return false;
+ });
+ else jData.find(".default").show().addClass("vdata");
+ // go ahead and call the change event and setup the ops and data values
+ if (has_custom_ops || has_custom_data) jFSelect.change();
+
+ // bind events
+ jQ.find(".ui-state-default").hover(hover, hover).mousedown(active).mouseup(active); // add hover/active effects to all buttons
+ jQ.find(".ui-closer").click(function(e) {
+ opts.onClose(jQuery(jQ.selector));
+ return false;
+ });
+ jQ.find(".ui-del").click(function(e) {
+ var row = jQuery(e.target).parents(".sf");
+ if (row.siblings(".sf").length > 0) { // doesn't remove if there's only one filter left
+ if (opts.datepickerFix === true && jQuery.fn.datepicker !== undefined)
+ row.find(".hasDatepicker").datepicker("destroy"); // clean up datepicker's $.data mess
+ row.remove(); // also unbinds
+ } else { // resets the filter if it's the last one
+ row.find("select[name='field']")[0].selectedIndex = 0;
+ row.find("select[name='op']")[0].selectedIndex = 0;
+ row.find(".data input").val(""); // blank all input values
+ row.find(".data select").each(function() { this.selectedIndex = 0; }); // select first option on all selects
+ row.find("select[name='field']").change(function(event){event.stopPropagation();}); // trigger any change events
+ }
+ return false;
+ });
+ jQ.find(".ui-add").click(function(e) {
+ var row = jQuery(e.target).parents(".sf");
+ var newRow = row.clone(true).insertAfter(row);
+ newRow.find(".ui-state-default").removeClass("ui-state-hover ui-state-active");
+ if (opts.clone) {
+ newRow.find("select[name='field']")[0].selectedIndex = row.find("select[name='field']")[0].selectedIndex;
+ var stupid_browser = (newRow.find("select[name='op']")[0] == null); // true for IE6
+ if (!stupid_browser)
+ newRow.find("select[name='op']").focus()[0].selectedIndex = row.find("select[name='op']")[0].selectedIndex;
+ var jElem = newRow.find("select.vdata");
+ if (jElem[0] != null) // select doesn't copy it's selected index when cloned
+ jElem[0].selectedIndex = row.find("select.vdata")[0].selectedIndex;
+ } else {
+ newRow.find(".data input").val(""); // blank all input values
+ newRow.find("select[name='field']").focus();
+ }
+ if (opts.datepickerFix === true && jQuery.fn.datepicker !== undefined) { // using $.data to associate data with document elements is Not Good
+ row.find(".hasDatepicker").each(function() {
+ var settings = jQuery.data(this, "datepicker").settings;
+ newRow.find("#" + this.id).unbind().removeAttr("id").removeClass("hasDatepicker").datepicker(settings);
+ });
+ }
+ newRow.find("select[name='field']").change(function(event){event.stopPropagation();} );
+ return false;
+ });
+ jQ.find(".ui-search").click(function(e) {
+ var ui = jQuery(jQ.selector); // pointer to search box wrapper element
+ var ruleGroup;
+ var group_op = ui.find("select[name='groupOp'] :selected").val(); // puls "AND" or "OR"
+ if (!opts.stringResult) {
+ ruleGroup = {
+ groupOp: group_op,
+ rules: []
+ };
+ } else {
+ ruleGroup = "{\"groupOp\":\"" + group_op + "\",\"rules\":[";
+ }
+ ui.find(".sf").each(function(i) {
+ var tField = jQuery(this).find("select[name='field'] :selected").val();
+ var tOp = jQuery(this).find("select[name='op'] :selected").val();
+ var tData = jQuery(this).find("input.vdata,select.vdata :selected").val();
+ tData += "";
+ if (!opts.stringResult) {
+ ruleGroup.rules.push({
+ field: tField,
+ op: tOp,
+ data: tData
+ });
+ } else {
+ tData = tData.replace(/\\/g,'\\\\').replace(/\"/g,'\\"');
+ if (i > 0) ruleGroup += ",";
+ ruleGroup += "{\"field\":\"" + tField + "\",";
+ ruleGroup += "\"op\":\"" + tOp + "\",";
+ ruleGroup += "\"data\":\"" + tData + "\"}";
+ }
+ });
+ if (opts.stringResult) ruleGroup += "]}";
+ opts.onSearch(ruleGroup);
+ return false;
+ });
+ jQ.find(".ui-reset").click(function(e,op) {
+ var ui = jQuery(jQ.selector);
+ ui.find(".ui-del").click(); // removes all filters, resets the last one
+ ui.find("select[name='groupOp']")[0].selectedIndex = 0; // changes the op back to the default one
+ opts.onReset(op);
+ return false;
+ });
+ jQ.find(".ui-add-last").click(function() {
+ var row = jQuery(jQ.selector + " .sf:last");
+ var newRow = row.clone(true).insertAfter(row);
+ newRow.find(".ui-state-default").removeClass("ui-state-hover ui-state-active");
+ newRow.find(".data input").val(""); // blank all input values
+ newRow.find("select[name='field']").focus();
+ if (opts.datepickerFix === true && jQuery.fn.datepicker !== undefined) { // using $.data to associate data with document elements is Not Good
+ row.find(".hasDatepicker").each(function() {
+ var settings = jQuery.data(this, "datepicker").settings;
+ newRow.find("#" + this.id).unbind().removeAttr("id").removeClass("hasDatepicker").datepicker(settings);
+ });
+ }
+ newRow.find("select[name='field']").change(function(event){event.stopPropagation();});
+ return false;
+ });
+
+ this.setGroupOp = function(setting) {
+ /* a "setter" for groupping argument.
+ * ("AND" or "OR")
+ *
+ * Inputs:
+ * setting - a string
+ *
+ * Returns:
+ * Does not return anything. May add success / failure reporting in future versions.
+ *
+ * author: Daniel Dotsenko (dotsa(a)hotmail.com)
+ */
+ selDOMobj = jQ.find("select[name='groupOp']")[0];
+ var indexmap = {}, l = selDOMobj.options.length, i;
+ for (i=0; i<l; i++) {
+ indexmap[selDOMobj.options[i].value] = i;
+ }
+ selDOMobj.selectedIndex = indexmap[setting];
+ jQuery(selDOMobj).change(function(event){event.stopPropagation();});
+ };
+
+ this.setFilter = function(settings) {
+ /* a "setter" for an arbitrary SearchFilter's filter line.
+ * designed to abstract the DOM manipulations required to infer
+ * a particular filter is a fit to the search box.
+ *
+ * Inputs:
+ * settings - an "object" (dictionary)
+ * index (optional*) (to be implemented in the future) : signed integer index (from top to bottom per DOM) of the filter line to fill.
+ * Negative integers (rooted in -1 and lower) denote position of the line from the bottom.
+ * sfref (optional*) : DOM object referencing individual '.sf' (normally a TR element) to be populated. (optional)
+ * filter (mandatory) : object (dictionary) of form {'field':'field_value','op':'op_value','data':'data value'}
+ *
+ * * It is mandatory to have either index or sfref defined.
+ *
+ * Returns:
+ * Does not return anything. May add success / failure reporting in future versions.
+ *
+ * author: Daniel Dotsenko (dotsa(a)hotmail.com)
+ */
+
+ var o = settings['sfref'], filter = settings['filter'];
+
+ // setting up valueindexmap that we will need to manipulate SELECT elements.
+ var fields = [], i, j , l, lj, li,
+ valueindexmap = {};
+ // example of valueindexmap:
+ // {'field1':{'index':0,'ops':{'eq':0,'ne':1}},'fieldX':{'index':1,'ops':{'eq':0,'ne':1},'data':{'true':0,'false':1}}},
+ // if data is undefined it's a INPUT field. If defined, it's SELECT
+ selDOMobj = o.find("select[name='field']")[0];
+ for (i=0, l=selDOMobj.options.length; i<l; i++) {
+ valueindexmap[selDOMobj.options[i].value] = {'index':i,'ops':{}};
+ fields.push(selDOMobj.options[i].value);
+ }
+ for (i=0, li=fields.length; i < li; i++) {
+ selDOMobj = o.find(".ops > select[class='field"+i+"']")[0];
+ if (selDOMobj) {
+ for (j=0, lj=selDOMobj.options.length; j<lj; j++) {
+ valueindexmap[fields[i]]['ops'][selDOMobj.options[j].value] = j;
+ }
+ }
+ selDOMobj = o.find(".data > select[class='field"+i+"']")[0];
+ if (selDOMobj) {
+ valueindexmap[fields[i]]['data'] = {}; // this setting is the flag that 'data' is contained in a SELECT
+ for (j=0, lj=selDOMobj.options.length; j<lj; j++) {
+ valueindexmap[fields[i]]['data'][selDOMobj.options[j].value] = j;
+ }
+ }
+ } // done populating valueindexmap
+
+ // preparsing the index values for SELECT elements.
+ var fieldvalue, fieldindex, opindex, datavalue, dataindex;
+ fieldvalue = filter['field'];
+ if (valueindexmap[fieldvalue]) {
+ fieldindex = valueindexmap[fieldvalue]['index'];
+ }
+ if (fieldindex != null) {
+ opindex = valueindexmap[fieldvalue]['ops'][filter['op']];
+ if(opindex === undefined) {
+ for(i=0,li=options.operators.length; i<li;i++) {
+ if(options.operators[i].op == filter.op ){
+ opindex = i;
+ break;
+ }
+ }
+ }
+ datavalue = filter['data'];
+ if (valueindexmap[fieldvalue]['data'] == null) {
+ dataindex = -1; // 'data' is not SELECT, Making the var 'defined'
+ } else {
+ dataindex = valueindexmap[fieldvalue]['data'][datavalue]; // 'undefined' may come from here.
+ }
+ }
+ // only if values for 'field' and 'op' and 'data' are 'found' in mapping...
+ if (fieldindex != null && opindex != null && dataindex != null) {
+ o.find("select[name='field']")[0].selectedIndex = fieldindex;
+ o.find("select[name='field']").change();
+ o.find("select[name='op']")[0].selectedIndex = opindex;
+ o.find("input.vdata").val(datavalue); // if jquery does not find any INPUT, it does not set any. This means we deal with SELECT
+ o = o.find("select.vdata")[0];
+ if (o) {
+ o.selectedIndex = dataindex;
+ }
+ return true
+ } else {
+ return false
+ }
+ }; // end of this.setFilter fn
+ } // end of if fields != null
+ }
+ return new SearchFilter(this, fields, options);
+};
+
+jQuery.fn.searchFilter.version = '1.2.9';
+
+/* This property contains the default options */
+jQuery.fn.searchFilter.defaults = {
+
+ /*
+ * PROPERTY
+ * TYPE: boolean
+ * DESCRIPTION: clone a row if it is added from an existing row
+ * when false, any new added rows will be blank.
+ */
+ clone: true,
+
+ /*
+ * PROPERTY
+ * TYPE: boolean
+ * DESCRIPTION: current version of datepicker uses a data store,
+ * which is incompatible with $().clone(true)
+ */
+ datepickerFix: true,
+
+ /*
+ * FUNCTION
+ * DESCRIPTION: the function that will be called when the user clicks Reset
+ * INPUT TYPE: JS object if stringResult is false, otherwise is JSON string
+ */
+ onReset: function(data) { alert("Reset Clicked. Data Returned: " + data) },
+
+ /*
+ * FUNCTION
+ * DESCRIPTION: the function that will be called when the user clicks Search
+ * INPUT TYPE: JS object if stringResult is false, otherwise is JSON string
+ */
+ onSearch: function(data) { alert("Search Clicked. Data Returned: " + data) },
+
+ /*
+ * FUNCTION
+ * DESCRIPTION: the function that will be called when the user clicks the Closer icon
+ * or the close() function is called
+ * if left null, it simply does a .hide() on the searchFilter
+ * INPUT TYPE: a jQuery object for the searchFilter
+ */
+ onClose: function(jElem) { jElem.hide(); },
+
+ /*
+ * PROPERTY
+ * TYPE: array of objects, each object has the properties op and text
+ * DESCRIPTION: the selectable operators that are applied between rules
+ * e.g. for {op:"AND", text:"all"}
+ * the search filter box will say: match all rules
+ * the server should interpret this as putting the AND op between each rule:
+ * rule1 AND rule2 AND rule3
+ * text will be the option text, and op will be the option value
+ */
+ groupOps: [
+ { op: "AND", text: "all" },
+ { op: "OR", text: "any" }
+ ],
+
+
+ /*
+ * PROPERTY
+ * TYPE: array of objects, each object has the properties op and text
+ * DESCRIPTION: the operators that will appear as drop-down options
+ * text will be the option text, and op will be the option value
+ */
+ operators: [
+ { op: "eq", text: "is equal to" },
+ { op: "ne", text: "is not equal to" },
+ { op: "lt", text: "is less than" },
+ { op: "le", text: "is less or equal to" },
+ { op: "gt", text: "is greater than" },
+ { op: "ge", text: "is greater or equal to" },
+ { op: "in", text: "is in" },
+ { op: "ni", text: "is not in" },
+ { op: "bw", text: "begins with" },
+ { op: "bn", text: "does not begin with" },
+ { op: "ew", text: "ends with" },
+ { op: "en", text: "does not end with" },
+ { op: "cn", text: "contains" },
+ { op: "nc", text: "does not contain" }
+ ],
+
+ /*
+ * PROPERTY
+ * TYPE: string
+ * DESCRIPTION: part of the phrase: _match_ ANY/ALL rules
+ */
+ matchText: "match",
+
+ /*
+ * PROPERTY
+ * TYPE: string
+ * DESCRIPTION: part of the phrase: match ANY/ALL _rules_
+ */
+ rulesText: "rules",
+
+ /*
+ * PROPERTY
+ * TYPE: string
+ * DESCRIPTION: the text that will be displayed in the reset button
+ */
+ resetText: "Reset",
+
+ /*
+ * PROPERTY
+ * TYPE: string
+ * DESCRIPTION: the text that will be displayed in the search button
+ */
+ searchText: "Search",
+
+ /*
+ * PROPERTY
+ * TYPE: boolean
+ * DESCRIPTION: a flag that, when set, will make the onSearch and onReset return strings instead of objects
+ */
+ stringResult: true,
+
+ /*
+ * PROPERTY
+ * TYPE: string
+ * DESCRIPTION: the title of the searchFilter window
+ */
+ windowTitle: "Search Rules",
+ /*
+ * PROPERTY
+ * TYPE: object
+ * DESCRIPTION: options to extend the ajax request
+ */
+ ajaxSelectOptions : {}
+}; /* end of searchFilter */
\ No newline at end of file
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/jquery.tablednd.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/jquery.tablednd.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/jquery.tablednd.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,383 @@
+/**
+ * TableDnD plug-in for JQuery, allows you to drag and drop table rows
+ * You can set up various options to control how the system will work
+ * Copyright (c) Denis Howlett <denish(a)isocra.com>
+ * Licensed like jQuery, see http://docs.jquery.com/License.
+ *
+ * Configuration options:
+ *
+ * onDragStyle
+ * This is the style that is assigned to the row during drag. There are limitations to the styles that can be
+ * associated with a row (such as you can't assign a border--well you can, but it won't be
+ * displayed). (So instead consider using onDragClass.) The CSS style to apply is specified as
+ * a map (as used in the jQuery css(...) function).
+ * onDropStyle
+ * This is the style that is assigned to the row when it is dropped. As for onDragStyle, there are limitations
+ * to what you can do. Also this replaces the original style, so again consider using onDragClass which
+ * is simply added and then removed on drop.
+ * onDragClass
+ * This class is added for the duration of the drag and then removed when the row is dropped. It is more
+ * flexible than using onDragStyle since it can be inherited by the row cells and other content. The default
+ * is class is tDnD_whileDrag. So to use the default, simply customise this CSS class in your
+ * stylesheet.
+ * onDrop
+ * Pass a function that will be called when the row is dropped. The function takes 2 parameters: the table
+ * and the row that was dropped. You can work out the new order of the rows by using
+ * table.rows.
+ * onDragStart
+ * Pass a function that will be called when the user starts dragging. The function takes 2 parameters: the
+ * table and the row which the user has started to drag.
+ * onAllowDrop
+ * Pass a function that will be called as a row is over another row. If the function returns true, allow
+ * dropping on that row, otherwise not. The function takes 2 parameters: the dragged row and the row under
+ * the cursor. It returns a boolean: true allows the drop, false doesn't allow it.
+ * scrollAmount
+ * This is the number of pixels to scroll if the user moves the mouse cursor to the top or bottom of the
+ * window. The page should automatically scroll up or down as appropriate (tested in IE6, IE7, Safari, FF2,
+ * FF3 beta
+ * dragHandle
+ * This is the name of a class that you assign to one or more cells in each row that is draggable. If you
+ * specify this class, then you are responsible for setting cursor: move in the CSS and only these cells
+ * will have the drag behaviour. If you do not specify a dragHandle, then you get the old behaviour where
+ * the whole row is draggable.
+ *
+ * Other ways to control behaviour:
+ *
+ * Add class="nodrop" to any rows for which you don't want to allow dropping, and class="nodrag" to any rows
+ * that you don't want to be draggable.
+ *
+ * Inside the onDrop method you can also call $.tableDnD.serialize() this returns a string of the form
+ * <tableID>[]=<rowID1>&<tableID>[]=<rowID2> so that you can send this back to the server. The table must have
+ * an ID as must all the rows.
+ *
+ * Other methods:
+ *
+ * $("...").tableDnDUpdate()
+ * Will update all the matching tables, that is it will reapply the mousedown method to the rows (or handle cells).
+ * This is useful if you have updated the table rows using Ajax and you want to make the table draggable again.
+ * The table maintains the original configuration (so you don't have to specify it again).
+ *
+ * $("...").tableDnDSerialize()
+ * Will serialize and return the serialized string as above, but for each of the matching tables--so it can be
+ * called from anywhere and isn't dependent on the currentTable being set up correctly before calling
+ *
+ * Known problems:
+ * - Auto-scoll has some problems with IE7 (it scrolls even when it shouldn't), work-around: set scrollAmount to 0
+ *
+ * Version 0.2: 2008-02-20 First public version
+ * Version 0.3: 2008-02-07 Added onDragStart option
+ * Made the scroll amount configurable (default is 5 as before)
+ * Version 0.4: 2008-03-15 Changed the noDrag/noDrop attributes to nodrag/nodrop classes
+ * Added onAllowDrop to control dropping
+ * Fixed a bug which meant that you couldn't set the scroll amount in both directions
+ * Added serialize method
+ * Version 0.5: 2008-05-16 Changed so that if you specify a dragHandle class it doesn't make the whole row
+ * draggable
+ * Improved the serialize method to use a default (and settable) regular expression.
+ * Added tableDnDupate() and tableDnDSerialize() to be called when you are outside the table
+ */
+jQuery.tableDnD = {
+ /** Keep hold of the current table being dragged */
+ currentTable : null,
+ /** Keep hold of the current drag object if any */
+ dragObject: null,
+ /** The current mouse offset */
+ mouseOffset: null,
+ /** Remember the old value of Y so that we don't do too much processing */
+ oldY: 0,
+
+ /** Actually build the structure */
+ build: function(options) {
+ // Set up the defaults if any
+
+ this.each(function() {
+ // This is bound to each matching table, set up the defaults and override with user options
+ this.tableDnDConfig = jQuery.extend({
+ onDragStyle: null,
+ onDropStyle: null,
+ // Add in the default class for whileDragging
+ onDragClass: "tDnD_whileDrag",
+ onDrop: null,
+ onDragStart: null,
+ scrollAmount: 5,
+ serializeRegexp: /[^\-]*$/, // The regular expression to use to trim row IDs
+ serializeParamName: null, // If you want to specify another parameter name instead of the table ID
+ dragHandle: null // If you give the name of a class here, then only Cells with this class will be draggable
+ }, options || {});
+ // Now make the rows draggable
+ jQuery.tableDnD.makeDraggable(this);
+ });
+
+ // Now we need to capture the mouse up and mouse move event
+ // We can use bind so that we don't interfere with other event handlers
+ jQuery(document)
+ .bind('mousemove', jQuery.tableDnD.mousemove)
+ .bind('mouseup', jQuery.tableDnD.mouseup);
+
+ // Don't break the chain
+ return this;
+ },
+
+ /** This function makes all the rows on the table draggable apart from those marked as "NoDrag" */
+ makeDraggable: function(table) {
+ var config = table.tableDnDConfig;
+ if (table.tableDnDConfig.dragHandle) {
+ // We only need to add the event to the specified cells
+ var cells = jQuery("td."+table.tableDnDConfig.dragHandle, table);
+ cells.each(function() {
+ // The cell is bound to "this"
+ jQuery(this).mousedown(function(ev) {
+ jQuery.tableDnD.dragObject = this.parentNode;
+ jQuery.tableDnD.currentTable = table;
+ jQuery.tableDnD.mouseOffset = jQuery.tableDnD.getMouseOffset(this, ev);
+ if (config.onDragStart) {
+ // Call the onDrop method if there is one
+ config.onDragStart(table, this);
+ }
+ return false;
+ });
+ })
+ } else {
+ // For backwards compatibility, we add the event to the whole row
+ var rows = jQuery("tr", table); // get all the rows as a wrapped set
+ rows.each(function() {
+ // Iterate through each row, the row is bound to "this"
+ var row = jQuery(this);
+ if (! row.hasClass("nodrag")) {
+ row.mousedown(function(ev) {
+ if (ev.target.tagName == "TD") {
+ jQuery.tableDnD.dragObject = this;
+ jQuery.tableDnD.currentTable = table;
+ jQuery.tableDnD.mouseOffset = jQuery.tableDnD.getMouseOffset(this, ev);
+ if (config.onDragStart) {
+ // Call the onDrop method if there is one
+ config.onDragStart(table, this);
+ }
+ return false;
+ }
+ }).css("cursor", "move"); // Store the tableDnD object
+ }
+ });
+ }
+ },
+
+ updateTables: function() {
+ this.each(function() {
+ // this is now bound to each matching table
+ if (this.tableDnDConfig) {
+ jQuery.tableDnD.makeDraggable(this);
+ }
+ })
+ },
+
+ /** Get the mouse coordinates from the event (allowing for browser differences) */
+ mouseCoords: function(ev){
+ if(ev.pageX || ev.pageY){
+ return {x:ev.pageX, y:ev.pageY};
+ }
+ return {
+ x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
+ y:ev.clientY + document.body.scrollTop - document.body.clientTop
+ };
+ },
+
+ /** Given a target element and a mouse event, get the mouse offset from that element.
+ To do this we need the element's position and the mouse position */
+ getMouseOffset: function(target, ev) {
+ ev = ev || window.event;
+
+ var docPos = this.getPosition(target);
+ var mousePos = this.mouseCoords(ev);
+ return {x:mousePos.x - docPos.x, y:mousePos.y - docPos.y};
+ },
+
+ /** Get the position of an element by going up the DOM tree and adding up all the offsets */
+ getPosition: function(e){
+ var left = 0;
+ var top = 0;
+ /** Safari fix -- thanks to Luis Chato for this! */
+ if (e.offsetHeight == 0) {
+ /** Safari 2 doesn't correctly grab the offsetTop of a table row
+ this is detailed here:
+ http://jacob.peargrove.com/blog/2006/technical/table-row-offsettop-bug-in-s…
+ the solution is likewise noted there, grab the offset of a table cell in the row - the firstChild.
+ note that firefox will return a text node as a first child, so designing a more thorough
+ solution may need to take that into account, for now this seems to work in firefox, safari, ie */
+ e = e.firstChild; // a table cell
+ }
+ if (e && e.offsetParent) {
+ while (e.offsetParent){
+ left += e.offsetLeft;
+ top += e.offsetTop;
+ e = e.offsetParent;
+ }
+
+ left += e.offsetLeft;
+ top += e.offsetTop;
+ }
+
+ return {x:left, y:top};
+ },
+
+ mousemove: function(ev) {
+ if (jQuery.tableDnD.dragObject == null) {
+ return;
+ }
+
+ var dragObj = jQuery(jQuery.tableDnD.dragObject);
+ var config = jQuery.tableDnD.currentTable.tableDnDConfig;
+ var mousePos = jQuery.tableDnD.mouseCoords(ev);
+ var y = mousePos.y - jQuery.tableDnD.mouseOffset.y;
+ //auto scroll the window
+ var yOffset = window.pageYOffset;
+ if (document.all) {
+ // Windows version
+ //yOffset=document.body.scrollTop;
+ if (typeof document.compatMode != 'undefined' &&
+ document.compatMode != 'BackCompat') {
+ yOffset = document.documentElement.scrollTop;
+ }
+ else if (typeof document.body != 'undefined') {
+ yOffset=document.body.scrollTop;
+ }
+
+ }
+
+ if (mousePos.y-yOffset < config.scrollAmount) {
+ window.scrollBy(0, -config.scrollAmount);
+ } else {
+ var windowHeight = window.innerHeight ? window.innerHeight
+ : document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
+ if (windowHeight-(mousePos.y-yOffset) < config.scrollAmount) {
+ window.scrollBy(0, config.scrollAmount);
+ }
+ }
+
+
+ if (y != jQuery.tableDnD.oldY) {
+ // work out if we're going up or down...
+ var movingDown = y > jQuery.tableDnD.oldY;
+ // update the old value
+ jQuery.tableDnD.oldY = y;
+ // update the style to show we're dragging
+ if (config.onDragClass) {
+ dragObj.addClass(config.onDragClass);
+ } else {
+ dragObj.css(config.onDragStyle);
+ }
+ // If we're over a row then move the dragged row to there so that the user sees the
+ // effect dynamically
+ var currentRow = jQuery.tableDnD.findDropTargetRow(dragObj, y);
+ if (currentRow) {
+ // TODO worry about what happens when there are multiple TBODIES
+ if (movingDown && jQuery.tableDnD.dragObject != currentRow) {
+ jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject, currentRow.nextSibling);
+ } else if (! movingDown && jQuery.tableDnD.dragObject != currentRow) {
+ jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject, currentRow);
+ }
+ }
+ }
+
+ return false;
+ },
+
+ /** We're only worried about the y position really, because we can only move rows up and down */
+ findDropTargetRow: function(draggedRow, y) {
+ var rows = jQuery.tableDnD.currentTable.rows;
+ for (var i=0; i<rows.length; i++) {
+ var row = rows[i];
+ var rowY = this.getPosition(row).y;
+ var rowHeight = parseInt(row.offsetHeight)/2;
+ if (row.offsetHeight == 0) {
+ rowY = this.getPosition(row.firstChild).y;
+ rowHeight = parseInt(row.firstChild.offsetHeight)/2;
+ }
+ // Because we always have to insert before, we need to offset the height a bit
+ if ((y > rowY - rowHeight) && (y < (rowY + rowHeight))) {
+ // that's the row we're over
+ // If it's the same as the current row, ignore it
+ if (row == draggedRow) {return null;}
+ var config = jQuery.tableDnD.currentTable.tableDnDConfig;
+ if (config.onAllowDrop) {
+ if (config.onAllowDrop(draggedRow, row)) {
+ return row;
+ } else {
+ return null;
+ }
+ } else {
+ // If a row has nodrop class, then don't allow dropping (inspired by John Tarr and Famic)
+ var nodrop = jQuery(row).hasClass("nodrop");
+ if (! nodrop) {
+ return row;
+ } else {
+ return null;
+ }
+ }
+ return row;
+ }
+ }
+ return null;
+ },
+
+ mouseup: function(e) {
+ if (jQuery.tableDnD.currentTable && jQuery.tableDnD.dragObject) {
+ var droppedRow = jQuery.tableDnD.dragObject;
+ var config = jQuery.tableDnD.currentTable.tableDnDConfig;
+ // If we have a dragObject, then we need to release it,
+ // The row will already have been moved to the right place so we just reset stuff
+ if (config.onDragClass) {
+ jQuery(droppedRow).removeClass(config.onDragClass);
+ } else {
+ jQuery(droppedRow).css(config.onDropStyle);
+ }
+ jQuery.tableDnD.dragObject = null;
+ if (config.onDrop) {
+ // Call the onDrop method if there is one
+ config.onDrop(jQuery.tableDnD.currentTable, droppedRow);
+ }
+ jQuery.tableDnD.currentTable = null; // let go of the table too
+ }
+ },
+
+ serialize: function() {
+ if (jQuery.tableDnD.currentTable) {
+ return jQuery.tableDnD.serializeTable(jQuery.tableDnD.currentTable);
+ } else {
+ return "Error: No Table id set, you need to set an id on your table and every row";
+ }
+ },
+
+ serializeTable: function(table) {
+ var result = "";
+ var tableId = table.id;
+ var rows = table.rows;
+ for (var i=0; i<rows.length; i++) {
+ if (result.length > 0) result += "&";
+ var rowId = rows[i].id;
+ if (rowId && rowId && table.tableDnDConfig && table.tableDnDConfig.serializeRegexp) {
+ rowId = rowId.match(table.tableDnDConfig.serializeRegexp)[0];
+ }
+
+ result += tableId + '[]=' + rowId;
+ }
+ return result;
+ },
+
+ serializeTables: function() {
+ var result = "";
+ this.each(function() {
+ // this is now bound to each matching table
+ result += jQuery.tableDnD.serializeTable(this);
+ });
+ return result;
+ }
+
+}
+
+jQuery.fn.extend(
+ {
+ tableDnD : jQuery.tableDnD.build,
+ tableDnDUpdate : jQuery.tableDnD.updateTables,
+ tableDnDSerialize: jQuery.tableDnD.serializeTables
+ }
+);
\ No newline at end of file
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/searchFilter.css
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/searchFilter.css (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/searchFilter.css 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,6 @@
+.ui-searchFilter { display: none; position: absolute; z-index: 770; overflow: visible;}
+.ui-searchFilter table {position:relative; margin:0em; width:auto}
+.ui-searchFilter table td {margin: 0em; padding: 1px;}
+.ui-searchFilter table td input, .ui-searchFilter table td select {margin: 0.1em;}
+.ui-searchFilter .ui-state-default { cursor: pointer; }
+.ui-searchFilter .divider hr {margin: 1px; }
\ No newline at end of file
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/ui.multiselect.css
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/ui.multiselect.css (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/ui.multiselect.css 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,30 @@
+/* Multiselect
+----------------------------------*/
+
+.ui-multiselect { border: solid 1px; font-size: 0.8em; }
+.ui-multiselect ul { -moz-user-select: none; }
+.ui-multiselect li { margin: 0; padding: 0; cursor: default; line-height: 20px; height: 20px; font-size: 11px; list-style: none; }
+.ui-multiselect li a { color: #999; text-decoration: none; padding: 0; display: block; float: left; cursor: pointer;}
+.ui-multiselect li.ui-draggable-dragging { padding-left: 10px; }
+
+.ui-multiselect div.selected { position: relative; padding: 0; margin: 0; border: 0; float:left; }
+.ui-multiselect ul.selected { position: relative; padding: 0; overflow: auto; overflow-x: hidden; background: #fff; margin: 0; list-style: none; border: 0; position: relative; width: 100%; }
+.ui-multiselect ul.selected li { }
+
+.ui-multiselect div.available { position: relative; padding: 0; margin: 0; border: 0; float:left; border-left: 1px solid; }
+.ui-multiselect ul.available { position: relative; padding: 0; overflow: auto; overflow-x: hidden; background: #fff; margin: 0; list-style: none; border: 0; width: 100%; }
+.ui-multiselect ul.available li { padding-left: 10px; }
+
+.ui-multiselect .ui-state-default { border: none; margin-bottom: 1px; position: relative; padding-left: 20px;}
+.ui-multiselect .ui-state-hover { border: none; }
+.ui-multiselect .ui-widget-header {border: none; font-size: 11px; margin-bottom: 1px;}
+
+.ui-multiselect .add-all { float: right; padding: 7px;}
+.ui-multiselect .remove-all { float: right; padding: 7px;}
+.ui-multiselect .search { float: left; padding: 4px;}
+.ui-multiselect .count { float: left; padding: 7px;}
+
+.ui-multiselect li span.ui-icon-arrowthick-2-n-s { position: absolute; left: 2px; }
+.ui-multiselect li a.action { position: absolute; right: 2px; top: 2px; }
+
+.ui-multiselect input.search { height: 14px; padding: 1px; opacity: 0.5; margin: 4px; width: 100px; }
\ No newline at end of file
Added: trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/ui.multiselect.js
===================================================================
--- trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/ui.multiselect.js (rev 0)
+++ trunk/nuiton-js-jqgrid/src/main/resources/nuiton-js-jqgrid/plugins/ui.multiselect.js 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,314 @@
+/*
+ * jQuery UI Multiselect
+ *
+ * Authors:
+ * Michael Aufreiter (quasipartikel.at)
+ * Yanick Rochon (yanick.rochon[at]gmail[dot]com)
+ *
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://www.quasipartikel.at/multiselect/
+ *
+ *
+ * Depends:
+ * ui.core.js
+ * ui.sortable.js
+ *
+ * Optional:
+ * localization (http://plugins.jquery.com/project/localisation)
+ * scrollTo (http://plugins.jquery.com/project/ScrollTo)
+ *
+ * Todo:
+ * Make batch actions faster
+ * Implement dynamic insertion through remote calls
+ */
+
+
+(function($) {
+
+$.widget("ui.multiselect", {
+ _init: function() {
+ this.element.hide();
+ this.id = this.element.attr("id");
+ this.container = $('<div class="ui-multiselect ui-helper-clearfix ui-widget"></div>').insertAfter(this.element);
+ this.count = 0; // number of currently selected options
+ this.selectedContainer = $('<div class="selected"></div>').appendTo(this.container);
+ this.availableContainer = $('<div class="available"></div>').appendTo(this.container);
+ this.selectedActions = $('<div class="actions ui-widget-header ui-helper-clearfix"><span class="count">0 '+$.ui.multiselect.locale.itemsCount+'</span><a href="#" class="remove-all">'+$.ui.multiselect.locale.removeAll+'</a></div>').appendTo(this.selectedContainer);
+ this.availableActions = $('<div class="actions ui-widget-header ui-helper-clearfix"><input type="text" class="search empty ui-widget-content ui-corner-all"/><a href="#" class="add-all">'+$.ui.multiselect.locale.addAll+'</a></div>').appendTo(this.availableContainer);
+ this.selectedList = $('<ul class="selected connected-list"><li class="ui-helper-hidden-accessible"></li></ul>').bind('selectstart', function(){return false;}).appendTo(this.selectedContainer);
+ this.availableList = $('<ul class="available connected-list"><li class="ui-helper-hidden-accessible"></li></ul>').bind('selectstart', function(){return false;}).appendTo(this.availableContainer);
+
+ var that = this;
+
+ // set dimensions
+ this.container.width(this.element.width()+1);
+ this.selectedContainer.width(Math.floor(this.element.width()*this.options.dividerLocation));
+ this.availableContainer.width(Math.floor(this.element.width()*(1-this.options.dividerLocation)));
+
+ // fix list height to match <option> depending on their individual header's heights
+ this.selectedList.height(Math.max(this.element.height()-this.selectedActions.height(),1));
+ this.availableList.height(Math.max(this.element.height()-this.availableActions.height(),1));
+
+ if ( !this.options.animated ) {
+ this.options.show = 'show';
+ this.options.hide = 'hide';
+ }
+
+ // init lists
+ this._populateLists(this.element.find('option'));
+
+ // make selection sortable
+ if (this.options.sortable) {
+ $("ul.selected").sortable({
+ placeholder: 'ui-state-highlight',
+ axis: 'y',
+ update: function(event, ui) {
+ // apply the new sort order to the original selectbox
+ that.selectedList.find('li').each(function() {
+ if ($(this).data('optionLink'))
+ $(this).data('optionLink').remove().appendTo(that.element);
+ });
+ },
+ receive: function(event, ui) {
+ ui.item.data('optionLink').attr('selected', true);
+ // increment count
+ that.count += 1;
+ that._updateCount();
+ // workaround, because there's no way to reference
+ // the new element, see http://dev.jqueryui.com/ticket/4303
+ that.selectedList.children('.ui-draggable').each(function() {
+ $(this).removeClass('ui-draggable');
+ $(this).data('optionLink', ui.item.data('optionLink'));
+ $(this).data('idx', ui.item.data('idx'));
+ that._applyItemState($(this), true);
+ });
+
+ // workaround according to http://dev.jqueryui.com/ticket/4088
+ setTimeout(function() { ui.item.remove(); }, 1);
+ }
+ });
+ }
+
+ // set up livesearch
+ if (this.options.searchable) {
+ this._registerSearchEvents(this.availableContainer.find('input.search'));
+ } else {
+ $('.search').hide();
+ }
+
+ // batch actions
+ $(".remove-all").click(function() {
+ that._populateLists(that.element.find('option').removeAttr('selected'));
+ return false;
+ });
+ $(".add-all").click(function() {
+ that._populateLists(that.element.find('option').attr('selected', 'selected'));
+ return false;
+ });
+ },
+ destroy: function() {
+ this.element.show();
+ this.container.remove();
+
+ $.widget.prototype.destroy.apply(this, arguments);
+ },
+ _populateLists: function(options) {
+ this.selectedList.children('.ui-element').remove();
+ this.availableList.children('.ui-element').remove();
+ this.count = 0;
+
+ var that = this;
+ var items = $(options.map(function(i) {
+ var item = that._getOptionNode(this).appendTo(this.selected ? that.selectedList : that.availableList).show();
+
+ if (this.selected) that.count += 1;
+ that._applyItemState(item, this.selected);
+ item.data('idx', i);
+ return item[0];
+ }));
+
+ // update count
+ this._updateCount();
+ },
+ _updateCount: function() {
+ this.selectedContainer.find('span.count').text(this.count+" "+$.ui.multiselect.locale.itemsCount);
+ },
+ _getOptionNode: function(option) {
+ option = $(option);
+ var node = $('<li class="ui-state-default ui-element" title="'+option.text()+'"><span class="ui-icon"/>'+option.text()+'<a href="#" class="action"><span class="ui-corner-all ui-icon"/></a></li>').hide();
+ node.data('optionLink', option);
+ return node;
+ },
+ // clones an item with associated data
+ // didn't find a smarter away around this
+ _cloneWithData: function(clonee) {
+ var clone = clonee.clone();
+ clone.data('optionLink', clonee.data('optionLink'));
+ clone.data('idx', clonee.data('idx'));
+ return clone;
+ },
+ _setSelected: function(item, selected) {
+ item.data('optionLink').attr('selected', selected);
+
+ if (selected) {
+ var selectedItem = this._cloneWithData(item);
+ item[this.options.hide](this.options.animated, function() { $(this).remove(); });
+ selectedItem.appendTo(this.selectedList).hide()[this.options.show](this.options.animated);
+
+ this._applyItemState(selectedItem, true);
+ return selectedItem;
+ } else {
+
+ // look for successor based on initial option index
+ var items = this.availableList.find('li'), comparator = this.options.nodeComparator;
+ var succ = null, i = item.data('idx'), direction = comparator(item, $(items[i]));
+
+ // TODO: test needed for dynamic list populating
+ if ( direction ) {
+ while (i>=0 && i<items.length) {
+ direction > 0 ? i++ : i--;
+ if ( direction != comparator(item, $(items[i])) ) {
+ // going up, go back one item down, otherwise leave as is
+ succ = items[direction > 0 ? i : i+1];
+ break;
+ }
+ }
+ } else {
+ succ = items[i];
+ }
+
+ var availableItem = this._cloneWithData(item);
+ succ ? availableItem.insertBefore($(succ)) : availableItem.appendTo(this.availableList);
+ item[this.options.hide](this.options.animated, function() { $(this).remove(); });
+ availableItem.hide()[this.options.show](this.options.animated);
+
+ this._applyItemState(availableItem, false);
+ return availableItem;
+ }
+ },
+ _applyItemState: function(item, selected) {
+ if (selected) {
+ if (this.options.sortable)
+ item.children('span').addClass('ui-icon-arrowthick-2-n-s').removeClass('ui-helper-hidden').addClass('ui-icon');
+ else
+ item.children('span').removeClass('ui-icon-arrowthick-2-n-s').addClass('ui-helper-hidden').removeClass('ui-icon');
+ item.find('a.action span').addClass('ui-icon-minus').removeClass('ui-icon-plus');
+ this._registerRemoveEvents(item.find('a.action'));
+
+ } else {
+ item.children('span').removeClass('ui-icon-arrowthick-2-n-s').addClass('ui-helper-hidden').removeClass('ui-icon');
+ item.find('a.action span').addClass('ui-icon-plus').removeClass('ui-icon-minus');
+ this._registerAddEvents(item.find('a.action'));
+ }
+
+ this._registerHoverEvents(item);
+ },
+ // taken from John Resig's liveUpdate script
+ _filter: function(list) {
+ var input = $(this);
+ var rows = list.children('li'),
+ cache = rows.map(function(){
+
+ return $(this).text().toLowerCase();
+ });
+
+ var term = $.trim(input.val().toLowerCase()), scores = [];
+
+ if (!term) {
+ rows.show();
+ } else {
+ rows.hide();
+
+ cache.each(function(i) {
+ if (this.indexOf(term)>-1) { scores.push(i); }
+ });
+
+ $.each(scores, function() {
+ $(rows[this]).show();
+ });
+ }
+ },
+ _registerHoverEvents: function(elements) {
+ elements.removeClass('ui-state-hover');
+ elements.mouseover(function() {
+ $(this).addClass('ui-state-hover');
+ });
+ elements.mouseout(function() {
+ $(this).removeClass('ui-state-hover');
+ });
+ },
+ _registerAddEvents: function(elements) {
+ var that = this;
+ elements.click(function() {
+ var item = that._setSelected($(this).parent(), true);
+ that.count += 1;
+ that._updateCount();
+ return false;
+ })
+ // make draggable
+ .each(function() {
+ $(this).parent().draggable({
+ connectToSortable: 'ul.selected',
+ helper: function() {
+ var selectedItem = that._cloneWithData($(this)).width($(this).width() - 50);
+ selectedItem.width($(this).width());
+ return selectedItem;
+ },
+ appendTo: '.ui-multiselect',
+ containment: '.ui-multiselect',
+ revert: 'invalid'
+ });
+ });
+ },
+ _registerRemoveEvents: function(elements) {
+ var that = this;
+ elements.click(function() {
+ that._setSelected($(this).parent(), false);
+ that.count -= 1;
+ that._updateCount();
+ return false;
+ });
+ },
+ _registerSearchEvents: function(input) {
+ var that = this;
+
+ input.focus(function() {
+ $(this).addClass('ui-state-active');
+ })
+ .blur(function() {
+ $(this).removeClass('ui-state-active');
+ })
+ .keypress(function(e) {
+ if (e.keyCode == 13)
+ return false;
+ })
+ .keyup(function() {
+ that._filter.apply(this, [that.availableList]);
+ });
+ }
+});
+
+$.extend($.ui.multiselect, {
+ defaults: {
+ sortable: true,
+ searchable: true,
+ animated: 'fast',
+ show: 'slideDown',
+ hide: 'slideUp',
+ dividerLocation: 0.6,
+ nodeComparator: function(node1,node2) {
+ var text1 = node1.text(),
+ text2 = node2.text();
+ return text1 == text2 ? 0 : (text1 < text2 ? -1 : 1);
+ }
+ },
+ locale: {
+ addAll:'Add all',
+ removeAll:'Remove all',
+ itemsCount:'items selected'
+ }
+});
+
+})(jQuery);
Added: trunk/nuiton-js-jqgrid/src/site/rst/index.rst
===================================================================
--- trunk/nuiton-js-jqgrid/src/site/rst/index.rst (rev 0)
+++ trunk/nuiton-js-jqgrid/src/site/rst/index.rst 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,70 @@
+Utilisation
+===========
+
+::
+
+ <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+
+ <link rel="stylesheet" type="text/css" href="<c:url value="/nuiton-js/jqgrid.css"/>" />
+ <script language="javascript" type="text/javascript" src="<c:url value="/nuiton-js/jqgrid.js"/>"></script>
+ <script language="javascript" type="text/javascript" src="<c:url value="/nuiton-js/jqgrid-fr.js"/>"></script>
+
+JS disponible
+-------------
+
+- jqgrid-only : jquery-ui
+- jqgrid: jquery et jqgrid
+
+plugins:
+
+- jqgrid-addons:
+- jqgrid-postext:
+- jqgrid-setcolumns:
+- jqgrid-contextmenu:
+- jqgrid-searchFilter:
+- jqgrid-tablednd:
+- jqgrid-multiselect:
+
+fichier de langue:
+
+- jqgrid-ar: specifique i18n
+- jqgrid-bg: specifique i18n
+- jqgrid-bg1251: specifique i18n
+- jqgrid-cat: specifique i18n
+- jqgrid-cn: specifique i18n
+- jqgrid-cs: specifique i18n
+- jqgrid-da: specifique i18n
+- jqgrid-de: specifique i18n
+- jqgrid-dk: specifique i18n
+- jqgrid-el: specifique i18n
+- jqgrid-en: specifique i18n
+- jqgrid-es: specifique i18n
+- jqgrid-fa: specifique i18n
+- jqgrid-fi: specifique i18n
+- jqgrid-fr: specifique i18n
+- jqgrid-gl: specifique i18n
+- jqgrid-he: specifique i18n
+- jqgrid-hr: specifique i18n
+- jqgrid-hr1250: specifique i18n
+- jqgrid-hu: specifique i18n
+- jqgrid-is: specifique i18n
+- jqgrid-it: specifique i18n
+- jqgrid-ja: specifique i18n
+- jqgrid-kr: specifique i18n
+- jqgrid-lt: specifique i18n
+- jqgrid-mne: specifique i18n
+- jqgrid-nl: specifique i18n
+- jqgrid-no: specifique i18n
+- jqgrid-pl: specifique i18n
+- jqgrid-pt-br: specifique i18n
+- jqgrid-pt: specifique i18n
+- jqgrid-ro: specifique i18n
+- jqgrid-ru: specifique i18n
+- jqgrid-sk: specifique i18n
+- jqgrid-sr-latin: specifique i18n
+- jqgrid-sr: specifique i18n
+- jqgrid-sv: specifique i18n
+- jqgrid-th: specifique i18n
+- jqgrid-tr: specifique i18n
+- jqgrid-tw: specifique i18n
+- jqgrid-ua: specifique i18n
Added: trunk/nuiton-js-jqgrid/src/site/site_fr.xml
===================================================================
--- trunk/nuiton-js-jqgrid/src/site/site_fr.xml (rev 0)
+++ trunk/nuiton-js-jqgrid/src/site/site_fr.xml 2013-01-19 11:25:15 UTC (rev 20)
@@ -0,0 +1,49 @@
+<project name="${project.name}">
+
+ <bannerLeft>
+ <src alt="NuitonJS">logo.jpg</src>
+ <name>${project.name}</name>
+ <href>index.html</href>
+ </bannerLeft>
+
+ <body>
+
+ <head>
+ <script type="text/javascript"
+ src="http://maven-site.nuiton.org/public/js/mavenpom-site.js">
+ </script>
+
+ <link rel="stylesheet" type="text/css"
+ href="http://maven-site.nuiton.org/public/css/mavenpom-site.css"/>
+ </head>
+
+ <breadcrumbs>
+ <item name="${project.name}" href="${project.url}"/>
+ </breadcrumbs>
+
+ <menu ref="parent"/>
+
+ <menu name="Utilisateurs">
+ <item name="Accueil" href="index.html"/>
+ </menu>
+
+ <menu ref="reports"/>
+
+ <footer>
+
+ <div id='projectMetas'
+ projectversion='${project.version}'
+ platform='${project.platform}'
+ projectid='${project.projectId}'
+ scm='${project.scm.connection}'
+ scmwebeditorenabled='${project.scmwebeditorEnabled}'
+ scmwebeditorurl='${project.scmwebeditorUrl}'
+ siteSourcesType='${project.siteSourcesType}'
+ piwikEnabled='${project.piwikEnabled}'
+ piwikId='${project.piwikId}'>
+ </div>
+ </footer>
+
+ </body>
+
+</project>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-01-19 11:15:23 UTC (rev 19)
+++ trunk/pom.xml 2013-01-19 11:25:15 UTC (rev 20)
@@ -24,6 +24,7 @@
<module>nuiton-js-jqplot</module>
<module>nuiton-js-bootstrap</module>
<module>nuiton-js-jstree</module>
+ <module>nuiton-js-jqgrid</module>
</modules>
<dependencyManagement>
1
0
r19 - in trunk/nuiton-js-jquery-ui: . src/main/resources/META-INF/nuiton-js
by bpoussin@users.nuiton.org Jan. 19, 2013
by bpoussin@users.nuiton.org Jan. 19, 2013
Jan. 19, 2013
Author: bpoussin
Date: 2013-01-19 12:15:23 +0100 (Sat, 19 Jan 2013)
New Revision: 19
Url: http://nuiton.org/projects/nuiton-js/repository/revisions/19
Log:
fix bad i18n path
Modified:
trunk/nuiton-js-jquery-ui/generate-i18n-group.sh
trunk/nuiton-js-jquery-ui/src/main/resources/META-INF/nuiton-js/wro-jquery-ui.xml
Modified: trunk/nuiton-js-jquery-ui/generate-i18n-group.sh
===================================================================
--- trunk/nuiton-js-jquery-ui/generate-i18n-group.sh 2013-01-16 17:17:44 UTC (rev 18)
+++ trunk/nuiton-js-jquery-ui/generate-i18n-group.sh 2013-01-19 11:15:23 UTC (rev 19)
@@ -5,6 +5,6 @@
#
for t in src/main/resources/nuiton-js-jquery-ui/js/i18n/*; do
f=$(basename $t)
- n=$(basename $t .js|tr '.' '-')
- echo -e " <group name='$n'>\n <css>classpath:nuiton-js-jquery-ui/i18n/$f</css>\n </group>\n"
+ n=$(basename $t .js|tr '.' '-' |sed 's/datepicker-//g')
+ echo -e " <group name='$n'>\n <css>classpath:nuiton-js-jquery-ui/js/i18n/$f</css>\n </group>\n"
done
Modified: trunk/nuiton-js-jquery-ui/src/main/resources/META-INF/nuiton-js/wro-jquery-ui.xml
===================================================================
--- trunk/nuiton-js-jquery-ui/src/main/resources/META-INF/nuiton-js/wro-jquery-ui.xml 2013-01-16 17:17:44 UTC (rev 18)
+++ trunk/nuiton-js-jquery-ui/src/main/resources/META-INF/nuiton-js/wro-jquery-ui.xml 2013-01-19 11:15:23 UTC (rev 19)
@@ -125,279 +125,279 @@
+-->
<group name='jquery-ui-i18n'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery-ui-i18n.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery-ui-i18n.js</css>
</group>
<group name='jquery-ui-af'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-af.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-af.js</css>
</group>
<group name='jquery-ui-ar-DZ'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-ar-DZ.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ar-DZ.js</css>
</group>
<group name='jquery-ui-ar'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-ar.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ar.js</css>
</group>
<group name='jquery-ui-az'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-az.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-az.js</css>
</group>
<group name='jquery-ui-bg'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-bg.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-bg.js</css>
</group>
<group name='jquery-ui-bs'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-bs.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-bs.js</css>
</group>
<group name='jquery-ui-ca'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-ca.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ca.js</css>
</group>
<group name='jquery-ui-cs'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-cs.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-cs.js</css>
</group>
<group name='jquery-ui-cy-GB'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-cy-GB.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-cy-GB.js</css>
</group>
<group name='jquery-ui-da'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-da.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-da.js</css>
</group>
<group name='jquery-ui-de'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-de.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-de.js</css>
</group>
<group name='jquery-ui-el'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-el.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-el.js</css>
</group>
<group name='jquery-ui-en-AU'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-en-AU.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-en-AU.js</css>
</group>
<group name='jquery-ui-en-GB'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-en-GB.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-en-GB.js</css>
</group>
<group name='jquery-ui-en-NZ'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-en-NZ.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-en-NZ.js</css>
</group>
<group name='jquery-ui-eo'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-eo.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-eo.js</css>
</group>
<group name='jquery-ui-es'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-es.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-es.js</css>
</group>
<group name='jquery-ui-et'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-et.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-et.js</css>
</group>
<group name='jquery-ui-eu'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-eu.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-eu.js</css>
</group>
<group name='jquery-ui-fa'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-fa.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-fa.js</css>
</group>
<group name='jquery-ui-fi'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-fi.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-fi.js</css>
</group>
<group name='jquery-ui-fo'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-fo.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-fo.js</css>
</group>
<group name='jquery-ui-fr-CH'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-fr-CH.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-fr-CH.js</css>
</group>
<group name='jquery-ui-fr'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-fr.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-fr.js</css>
</group>
<group name='jquery-ui-gl'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-gl.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-gl.js</css>
</group>
<group name='jquery-ui-he'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-he.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-he.js</css>
</group>
<group name='jquery-ui-hi'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-hi.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-hi.js</css>
</group>
<group name='jquery-ui-hr'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-hr.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-hr.js</css>
</group>
<group name='jquery-ui-hu'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-hu.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-hu.js</css>
</group>
<group name='jquery-ui-hy'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-hy.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-hy.js</css>
</group>
<group name='jquery-ui-id'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-id.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-id.js</css>
</group>
<group name='jquery-ui-is'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-is.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-is.js</css>
</group>
<group name='jquery-ui-it'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-it.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-it.js</css>
</group>
<group name='jquery-ui-ja'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-ja.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ja.js</css>
</group>
<group name='jquery-ui-ka'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-ka.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ka.js</css>
</group>
<group name='jquery-ui-kk'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-kk.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-kk.js</css>
</group>
<group name='jquery-ui-km'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-km.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-km.js</css>
</group>
<group name='jquery-ui-ko'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-ko.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ko.js</css>
</group>
<group name='jquery-ui-lb'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-lb.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-lb.js</css>
</group>
<group name='jquery-ui-lt'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-lt.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-lt.js</css>
</group>
<group name='jquery-ui-lv'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-lv.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-lv.js</css>
</group>
<group name='jquery-ui-mk'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-mk.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-mk.js</css>
</group>
<group name='jquery-ui-ml'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-ml.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ml.js</css>
</group>
<group name='jquery-ui-ms'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-ms.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ms.js</css>
</group>
<group name='jquery-ui-nl-BE'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-nl-BE.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-nl-BE.js</css>
</group>
<group name='jquery-ui-nl'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-nl.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-nl.js</css>
</group>
<group name='jquery-ui-no'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-no.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-no.js</css>
</group>
<group name='jquery-ui-pl'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-pl.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-pl.js</css>
</group>
<group name='jquery-ui-pt-BR'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-pt-BR.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-pt-BR.js</css>
</group>
<group name='jquery-ui-pt'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-pt.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-pt.js</css>
</group>
<group name='jquery-ui-rm'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-rm.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-rm.js</css>
</group>
<group name='jquery-ui-ro'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-ro.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ro.js</css>
</group>
<group name='jquery-ui-ru'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-ru.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ru.js</css>
</group>
<group name='jquery-ui-sk'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-sk.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sk.js</css>
</group>
<group name='jquery-ui-sl'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-sl.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sl.js</css>
</group>
<group name='jquery-ui-sq'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-sq.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sq.js</css>
</group>
<group name='jquery-ui-sr-SR'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-sr-SR.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sr-SR.js</css>
</group>
<group name='jquery-ui-sr'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-sr.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sr.js</css>
</group>
<group name='jquery-ui-sv'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-sv.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-sv.js</css>
</group>
<group name='jquery-ui-ta'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-ta.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-ta.js</css>
</group>
<group name='jquery-ui-th'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-th.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-th.js</css>
</group>
<group name='jquery-ui-tj'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-tj.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-tj.js</css>
</group>
<group name='jquery-ui-tr'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-tr.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-tr.js</css>
</group>
<group name='jquery-ui-uk'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-uk.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-uk.js</css>
</group>
<group name='jquery-ui-vi'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-vi.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-vi.js</css>
</group>
<group name='jquery-ui-zh-CN'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-zh-CN.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-zh-CN.js</css>
</group>
<group name='jquery-ui-zh-HK'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-zh-HK.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-zh-HK.js</css>
</group>
<group name='jquery-ui-zh-TW'>
- <css>classpath:nuiton-js-jquery-ui/i18n/jquery.ui.datepicker-zh-TW.js</css>
+ <css>classpath:nuiton-js-jquery-ui/js/i18n/jquery.ui.datepicker-zh-TW.js</css>
</group>
</groups>
1
0
r18 - in trunk: . nuiton-js-bootstrap nuiton-js-jqplot nuiton-js-jquery nuiton-js-jquery-ui nuiton-js-jstree nuiton-js-wro
by echatellier@users.nuiton.org Jan. 16, 2013
by echatellier@users.nuiton.org Jan. 16, 2013
Jan. 16, 2013
Author: echatellier
Date: 2013-01-16 18:17:44 +0100 (Wed, 16 Jan 2013)
New Revision: 18
Url: http://nuiton.org/projects/nuiton-js/repository/revisions/18
Log:
Fix svn:ignore
Modified:
trunk/
trunk/nuiton-js-bootstrap/
trunk/nuiton-js-jqplot/
trunk/nuiton-js-jquery-ui/
trunk/nuiton-js-jquery/
trunk/nuiton-js-jstree/
trunk/nuiton-js-wro/
Property changes on: trunk
___________________________________________________________________
Modified: svn:ignore
- target
.idea
.ipr
.iws
.iml
+ target
.idea
.ipr
.iws
.iml
.settings
.project
Property changes on: trunk/nuiton-js-bootstrap
___________________________________________________________________
Added: svn:ignore
+ .classpath
.project
.settings
target
Property changes on: trunk/nuiton-js-jqplot
___________________________________________________________________
Added: svn:ignore
+ .classpath
.project
.settings
target
Property changes on: trunk/nuiton-js-jquery
___________________________________________________________________
Modified: svn:ignore
- target
.idea
.ipr
.iws
.iml
+ target
.idea
.ipr
.iws
.iml
.classpath
.project
.settings
Property changes on: trunk/nuiton-js-jquery-ui
___________________________________________________________________
Modified: svn:ignore
- target
.idea
.ipr
.iws
.iml
+ target
.idea
.ipr
.iws
.iml
.classpath
.project
.settings
Property changes on: trunk/nuiton-js-jstree
___________________________________________________________________
Added: svn:ignore
+ .classpath
.project
.settings
target
Property changes on: trunk/nuiton-js-wro
___________________________________________________________________
Modified: svn:ignore
- target
.idea
.ipr
.iws
.iml
+ target
.idea
.ipr
.iws
.iml
.classpath
.project
.settings
1
0