Add version files and new GIF images for UI components
This commit is contained in:
134
modules/lib/CLEditor/jquery.cleditor.bbcode.js
Normal file
134
modules/lib/CLEditor/jquery.cleditor.bbcode.js
Normal file
@ -0,0 +1,134 @@
|
||||
/**
|
||||
@preserve CLEditor BBCode Plugin v1.0.0
|
||||
http://premiumsoftware.net/cleditor
|
||||
requires CLEditor v1.3.0 or later
|
||||
|
||||
Copyright 2010, Chris Landowski, Premium Software, LLC
|
||||
Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
*/
|
||||
|
||||
// ==ClosureCompiler==
|
||||
// @compilation_level SIMPLE_OPTIMIZATIONS
|
||||
// @output_file_name jquery.cleditor.bbcode.min.js
|
||||
// ==/ClosureCompiler==
|
||||
|
||||
/*
|
||||
|
||||
The CLEditor useCSS optional parameter should be set to false for this plugin
|
||||
to function properly.
|
||||
|
||||
Supported HTML and BBCode Tags:
|
||||
|
||||
Bold <b>Hello</b>
|
||||
[b]Hello[/b]
|
||||
Italics <i>Hello</i>
|
||||
[i]Hello[/i]
|
||||
Underlined <u>Hello</u>
|
||||
[u]Hello[/u]
|
||||
Strikethrough <strike>Hello</strike>
|
||||
[s]Hello[/s]
|
||||
Unordered Lists <ul><li>Red</li><li>Blue</li><li>Green</li></ul>
|
||||
[list][*]Red[/*][*]Green[/*][*]Blue[/*][/list]
|
||||
Ordered Lists <ol><li>Red</li><li>Blue</li><li>Green</li></ol>
|
||||
[list=1][*]Red[/*][*]Green[/*][*]Blue[/*][/list]
|
||||
Images <img src="http://premiumsoftware.net/image.jpg">
|
||||
[img]http://premiumsoftware.net/image.jpg[/img]
|
||||
Links <a href="http://premiumsoftware.net">Premium Software</a>
|
||||
[url=http://premiumsoftware.net]Premium Software[/url]
|
||||
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
// BBCode only supports a small subset of HTML, so remove
|
||||
// any toolbar buttons that are not currently supported.
|
||||
$.cleditor.defaultOptions.controls =
|
||||
"bold italic underline strikethrough removeformat | bullets numbering | " +
|
||||
"undo redo | image link unlink | cut copy paste pastetext | print source";
|
||||
|
||||
// Save the previously assigned callback handlers
|
||||
var oldAreaCallback = $.cleditor.defaultOptions.updateTextArea;
|
||||
var oldFrameCallback = $.cleditor.defaultOptions.updateFrame;
|
||||
|
||||
// Wireup the updateTextArea callback handler
|
||||
$.cleditor.defaultOptions.updateTextArea = function(html) {
|
||||
|
||||
// Fire the previously assigned callback handler
|
||||
if (oldAreaCallback)
|
||||
html = oldAreaCallback(html);
|
||||
|
||||
// Convert the HTML to BBCode
|
||||
return $.cleditor.convertHTMLtoBBCode(html);
|
||||
|
||||
}
|
||||
|
||||
// Wireup the updateFrame callback handler
|
||||
$.cleditor.defaultOptions.updateFrame = function(code) {
|
||||
|
||||
// Fire the previously assigned callback handler
|
||||
if (oldFrameCallback)
|
||||
code = oldFrameCallback(code);
|
||||
|
||||
// Convert the BBCode to HTML
|
||||
return $.cleditor.convertBBCodeToHTML(code);
|
||||
|
||||
}
|
||||
|
||||
// Expose the convertHTMLtoBBCode method
|
||||
$.cleditor.convertHTMLtoBBCode = function(html) {
|
||||
|
||||
$.each([
|
||||
[/[\r|\n]/g, ""],
|
||||
[/<br.*?>/gi, "\n"],
|
||||
[/<b>(.*?)<\/b>/gi, "[b]$1[/b]"],
|
||||
[/<strong>(.*?)<\/strong>/gi, "[b]$1[/b]"],
|
||||
[/<i>(.*?)<\/i>/gi, "[i]$1[/i]"],
|
||||
[/<em>(.*?)<\/em>/gi, "[i]$1[/i]"],
|
||||
[/<u>(.*?)<\/u>/gi, "[u]$1[/u]"],
|
||||
[/<ins>(.*?)<\/ins>/gi, "[u]$1[/u]"],
|
||||
[/<strike>(.*?)<\/strike>/gi, "[s]$1[/s]"],
|
||||
[/<del>(.*?)<\/del>/gi, "[s]$1[/s]"],
|
||||
[/<a.*?href="(.*?)".*?>(.*?)<\/a>/gi, "[url=$1]$2[/url]"],
|
||||
[/<img.*?src="(.*?)".*?>/gi, "[img]$1[/img]"],
|
||||
[/<ul>/gi, "[list]"],
|
||||
[/<\/ul>/gi, "[/list]"],
|
||||
[/<ol>/gi, "[list=1]"],
|
||||
[/<\/ol>/gi, "[/list]"],
|
||||
[/<li>/gi, "[*]"],
|
||||
[/<\/li>/gi, "[/*]"],
|
||||
[/<.*?>(.*?)<\/.*?>/g, "$1"]
|
||||
], function(index, item) {
|
||||
html = html.replace(item[0], item[1]);
|
||||
});
|
||||
|
||||
return html;
|
||||
|
||||
}
|
||||
|
||||
// Expose the convertBBCodeToHTML method
|
||||
$.cleditor.convertBBCodeToHTML = function(code) {
|
||||
|
||||
$.each([
|
||||
[/\r/g, ""],
|
||||
[/\n/g, "<br />"],
|
||||
[/\[b\](.*?)\[\/b\]/gi, "<b>$1</b>"],
|
||||
[/\[i\](.*?)\[\/i\]/gi, "<i>$1</i>"],
|
||||
[/\[u\](.*?)\[\/u\]/gi, "<u>$1</u>"],
|
||||
[/\[s\](.*?)\[\/s\]/gi, "<strike>$1</strike>"],
|
||||
[/\[url=(.*?)\](.*?)\[\/url\]/gi, "<a href=\"$1\">$2</a>"],
|
||||
[/\[img\](.*?)\[\/img\]/gi, "<img src=\"$1\">"],
|
||||
[/\[list\](.*?)\[\/list\]/gi, "<ul>$1</ul>"],
|
||||
[/\[list=1\](.*?)\[\/list\]/gi, "<ol>$1</ol>"],
|
||||
[/\[list\]/gi, "<ul>"],
|
||||
[/\[list=1\]/gi, "<ol>"],
|
||||
[/\[\*\](.*?)\[\/\*\]/g, "<li>$1</li>"],
|
||||
[/\[\*\]/g, "<li>"]
|
||||
], function(index, item) {
|
||||
code = code.replace(item[0], item[1]);
|
||||
});
|
||||
|
||||
return code;
|
||||
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
12
modules/lib/CLEditor/jquery.cleditor.bbcode.min.js
vendored
Normal file
12
modules/lib/CLEditor/jquery.cleditor.bbcode.min.js
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
/*
|
||||
CLEditor BBCode Plugin v1.0.0
|
||||
http://premiumsoftware.net/cleditor
|
||||
requires CLEditor v1.3.0 or later
|
||||
|
||||
Copyright 2010, Chris Landowski, Premium Software, LLC
|
||||
Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
*/
|
||||
(function(b){b.cleditor.defaultOptions.controls="bold italic underline strikethrough removeformat | bullets numbering | undo redo | image link unlink | cut copy paste pastetext | print source";var d=b.cleditor.defaultOptions.updateTextArea,e=b.cleditor.defaultOptions.updateFrame;b.cleditor.defaultOptions.updateTextArea=function(a){if(d)a=d(a);return b.cleditor.convertHTMLtoBBCode(a)};b.cleditor.defaultOptions.updateFrame=function(a){if(e)a=e(a);return b.cleditor.convertBBCodeToHTML(a)};b.cleditor.convertHTMLtoBBCode=
|
||||
function(a){b.each([[/[\r|\n]/g,""],[/<br.*?>/gi,"\n"],[/<b>(.*?)<\/b>/gi,"[b]$1[/b]"],[/<strong>(.*?)<\/strong>/gi,"[b]$1[/b]"],[/<i>(.*?)<\/i>/gi,"[i]$1[/i]"],[/<em>(.*?)<\/em>/gi,"[i]$1[/i]"],[/<u>(.*?)<\/u>/gi,"[u]$1[/u]"],[/<ins>(.*?)<\/ins>/gi,"[u]$1[/u]"],[/<strike>(.*?)<\/strike>/gi,"[s]$1[/s]"],[/<del>(.*?)<\/del>/gi,"[s]$1[/s]"],[/<a.*?href="(.*?)".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"],[/<img.*?src="(.*?)".*?>/gi,"[img]$1[/img]"],[/<ul>/gi,"[list]"],[/<\/ul>/gi,"[/list]"],[/<ol>/gi,"[list=1]"],
|
||||
[/<\/ol>/gi,"[/list]"],[/<li>/gi,"[*]"],[/<\/li>/gi,"[/*]"],[/<.*?>(.*?)<\/.*?>/g,"$1"]],function(f,c){a=a.replace(c[0],c[1])});return a};b.cleditor.convertBBCodeToHTML=function(a){b.each([[/\r/g,""],[/\n/g,"<br />"],[/\[b\](.*?)\[\/b\]/gi,"<b>$1</b>"],[/\[i\](.*?)\[\/i\]/gi,"<i>$1</i>"],[/\[u\](.*?)\[\/u\]/gi,"<u>$1</u>"],[/\[s\](.*?)\[\/s\]/gi,"<strike>$1</strike>"],[/\[url=(.*?)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>'],[/\[img\](.*?)\[\/img\]/gi,'<img src="$1">'],[/\[list\](.*?)\[\/list\]/gi,
|
||||
"<ul>$1</ul>"],[/\[list=1\](.*?)\[\/list\]/gi,"<ol>$1</ol>"],[/\[list\]/gi,"<ul>"],[/\[list=1\]/gi,"<ol>"],[/\[\*\](.*?)\[\/\*\]/g,"<li>$1</li>"],[/\[\*\]/g,"<li>"]],function(f,c){a=a.replace(c[0],c[1])});return a}})(jQuery);
|
||||
24
modules/lib/CLEditor/jquery.cleditor.css
Normal file
24
modules/lib/CLEditor/jquery.cleditor.css
Normal file
@ -0,0 +1,24 @@
|
||||
.cleditorMain {background-color:#fff;-webkit-border-radius: 6px;border-radius: 6px}
|
||||
.cleditorMain iframe {border:none; margin:0; padding:0}
|
||||
.cleditorMain textarea {border:none; margin:0; padding:0; overflow-y:scroll; font:10pt Arial,Verdana; resize:none; outline:none /* webkit grip focus */}
|
||||
.cleditorToolbar {background: #f2f2f2;padding:0 4px}
|
||||
.cleditorGroup {float:left; height:26px}
|
||||
.cleditorButton {float:left; width:24px; height:24px; margin:1px 0 1px 0; background: url('images/buttons.gif')}
|
||||
.cleditorDisabled {opacity:0.3; filter:alpha(opacity=30)}
|
||||
.cleditorDivider {float:left; width:1px; height:23px; margin:1px 0 1px 0; background:#CCC}
|
||||
.cleditorPopup {border:solid 1px #999; background-color:white; position:absolute; font:10pt Arial,Verdana; cursor:default; z-index:10000}
|
||||
.cleditorList div {padding:2px 4px 2px 4px}
|
||||
.cleditorList p,
|
||||
.cleditorList h1,
|
||||
.cleditorList h2,
|
||||
.cleditorList h3,
|
||||
.cleditorList h4,
|
||||
.cleditorList h5,
|
||||
.cleditorList h6,
|
||||
.cleditorList font {padding:0; margin:0; background-color:Transparent}
|
||||
.cleditorColor {width:150px; padding:1px 0 0 1px}
|
||||
.cleditorColor div {float:left; width:14px; height:14px; margin:0 1px 1px 0}
|
||||
.cleditorPrompt {background-color:#F6F7F9; padding:4px; font-size:8.5pt}
|
||||
.cleditorPrompt input,
|
||||
.cleditorPrompt textarea {font:8.5pt Arial,Verdana;}
|
||||
.cleditorMsg {background-color:#FDFCEE; width:150px; padding:4px; font-size:8.5pt}
|
||||
65
modules/lib/CLEditor/jquery.cleditor.icon.js
Normal file
65
modules/lib/CLEditor/jquery.cleditor.icon.js
Normal file
@ -0,0 +1,65 @@
|
||||
/**
|
||||
@preserve CLEditor Icon Plugin v1.0
|
||||
http://premiumsoftware.net/cleditor
|
||||
requires CLEditor v1.2 or later
|
||||
|
||||
Copyright 2010, Chris Landowski, Premium Software, LLC
|
||||
Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
*/
|
||||
|
||||
// ==ClosureCompiler==
|
||||
// @compilation_level SIMPLE_OPTIMIZATIONS
|
||||
// @output_file_name jquery.cleditor.icon.min.js
|
||||
// ==/ClosureCompiler==
|
||||
|
||||
(function($) {
|
||||
|
||||
// Constants
|
||||
var FOLDER = $.cleditor.imagesPath() + "icons/",
|
||||
STRIP = "icons",
|
||||
EXT = ".gif",
|
||||
URL = "URL(" + FOLDER + STRIP + EXT + ")",
|
||||
BUTTON_COUNT = 12,
|
||||
BUTTON_WIDTH = 20,
|
||||
BUTTON_HEIGHT = 20;
|
||||
|
||||
// Define the icon button
|
||||
$.cleditor.buttons.icon = {
|
||||
name: "icon",
|
||||
css: {
|
||||
backgroundImage: URL,
|
||||
backgroundPosition: "2px 2px"
|
||||
},
|
||||
title: "Insert Icon",
|
||||
command: "insertimage",
|
||||
popupName: "Icon",
|
||||
popupHover: true,
|
||||
buttonClick: function(e, data) {
|
||||
$(data.popup).width(60);
|
||||
},
|
||||
popupClick: function(e, data) {
|
||||
var index = -parseInt(e.target.style.backgroundPosition) / BUTTON_WIDTH + 1;
|
||||
data.value = FOLDER + index + EXT;
|
||||
}
|
||||
};
|
||||
|
||||
// Build the popup content
|
||||
var $content = $("<div>");
|
||||
for (var x = 0; x < BUTTON_COUNT; x++) {
|
||||
$("<div>")
|
||||
.css({
|
||||
width: BUTTON_WIDTH,
|
||||
height: BUTTON_HEIGHT,
|
||||
backgroundImage: URL,
|
||||
backgroundPosition: x * -BUTTON_WIDTH
|
||||
})
|
||||
.css("float", "left") // closure comiler errors when float is mapped
|
||||
.appendTo($content);
|
||||
}
|
||||
$.cleditor.buttons.icon.popupContent = $content.children();
|
||||
|
||||
// Add the button to the default controls
|
||||
$.cleditor.defaultOptions.controls = $.cleditor.defaultOptions.controls
|
||||
.replace("| cut", "icon | cut");
|
||||
|
||||
})(jQuery);
|
||||
10
modules/lib/CLEditor/jquery.cleditor.icon.min.js
vendored
Normal file
10
modules/lib/CLEditor/jquery.cleditor.icon.min.js
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
/*
|
||||
CLEditor Icon Plugin v1.0
|
||||
http://premiumsoftware.net/cleditor
|
||||
requires CLEditor v1.2 or later
|
||||
|
||||
Copyright 2010, Chris Landowski, Premium Software, LLC
|
||||
Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
*/
|
||||
(function(a){var d=a.cleditor.imagesPath()+"icons/",e="URL("+d+"icons.gif)";a.cleditor.buttons.icon={name:"icon",css:{backgroundImage:e,backgroundPosition:"2px 2px"},title:"Insert Icon",command:"insertimage",popupName:"Icon",popupHover:true,buttonClick:function(f,b){a(b.popup).width(60)},popupClick:function(f,b){var h=-parseInt(f.target.style.backgroundPosition)/20+1;b.value=d+h+".gif"}};for(var g=a("<div>"),c=0;c<12;c++)a("<div>").css({width:20,height:20,backgroundImage:e,backgroundPosition:c*-20}).css("float",
|
||||
"left").appendTo(g);a.cleditor.buttons.icon.popupContent=g.children();a.cleditor.defaultOptions.controls=a.cleditor.defaultOptions.controls.replace("| cut","icon | cut")})(jQuery);
|
||||
1132
modules/lib/CLEditor/jquery.cleditor.js
Normal file
1132
modules/lib/CLEditor/jquery.cleditor.js
Normal file
File diff suppressed because it is too large
Load Diff
31
modules/lib/CLEditor/jquery.cleditor.min.js
vendored
Normal file
31
modules/lib/CLEditor/jquery.cleditor.min.js
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
/*
|
||||
CLEditor WYSIWYG HTML Editor v1.3.0
|
||||
http://premiumsoftware.net/cleditor
|
||||
requires jQuery v1.4.2 or later
|
||||
|
||||
Copyright 2010, Chris Landowski, Premium Software, LLC
|
||||
Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
*/
|
||||
(function(e){function aa(a){var b=this,c=a.target,d=e.data(c,x),h=s[d],f=h.popupName,i=p[f];if(!(b.disabled||e(c).attr(n)==n)){var g={editor:b,button:c,buttonName:d,popup:i,popupName:f,command:h.command,useCSS:b.options.useCSS};if(h.buttonClick&&h.buttonClick(a,g)===false)return false;if(d=="source"){if(t(b)){delete b.range;b.$area.hide();b.$frame.show();c.title=h.title}else{b.$frame.hide();b.$area.show();c.title="Show Rich Text"}setTimeout(function(){u(b)},100)}else if(!t(b))if(f){var j=e(i);if(f==
|
||||
"url"){if(d=="link"&&M(b)===""){z(b,"A selection is required when inserting a link.",c);return false}j.children(":button").unbind(q).bind(q,function(){var k=j.find(":text"),o=e.trim(k.val());o!==""&&v(b,g.command,o,null,g.button);k.val("http://");r();w(b)})}else f=="pastetext"&&j.children(":button").unbind(q).bind(q,function(){var k=j.find("textarea"),o=k.val().replace(/\n/g,"<br />");o!==""&&v(b,g.command,o,null,g.button);k.val("");r();w(b)});if(c!==e.data(i,A)){N(b,i,c);return false}return}else if(d==
|
||||
"print")b.$frame[0].contentWindow.print();else if(!v(b,g.command,g.value,g.useCSS,c))return false;w(b)}}function O(a){a=e(a.target).closest("div");a.css(H,a.data(x)?"#FFF":"#FFC")}function P(a){e(a.target).closest("div").css(H,"transparent")}function ba(a){var b=a.data.popup,c=a.target;if(!(b===p.msg||e(b).hasClass(B))){var d=e.data(b,A),h=e.data(d,x),f=s[h],i=f.command,g,j=this.options.useCSS;if(h=="font")g=c.style.fontFamily.replace(/"/g,"");else if(h=="size"){if(c.tagName=="DIV")c=c.children[0];
|
||||
g=c.innerHTML}else if(h=="style")g="<"+c.tagName+">";else if(h=="color")g=Q(c.style.backgroundColor);else if(h=="highlight"){g=Q(c.style.backgroundColor);if(l)i="backcolor";else j=true}b={editor:this,button:d,buttonName:h,popup:b,popupName:f.popupName,command:i,value:g,useCSS:j};if(!(f.popupClick&&f.popupClick(a,b)===false)){if(b.command&&!v(this,b.command,b.value,b.useCSS,d))return false;r();w(this)}}}function C(a){for(var b=1,c=0,d=0;d<a.length;++d){b=(b+a.charCodeAt(d))%65521;c=(c+b)%65521}return c<<
|
||||
16|b}function R(a,b,c,d,h){if(p[a])return p[a];var f=e(m).hide().addClass(ca).appendTo("body");if(d)f.html(d);else if(a=="color"){b=b.colors.split(" ");b.length<10&&f.width("auto");e.each(b,function(i,g){e(m).appendTo(f).css(H,"#"+g)});c=da}else if(a=="font")e.each(b.fonts.split(","),function(i,g){e(m).appendTo(f).css("fontFamily",g).html(g)});else if(a=="size")e.each(b.sizes.split(","),function(i,g){e(m).appendTo(f).html("<font size="+g+">"+g+"</font>")});else if(a=="style")e.each(b.styles,function(i,
|
||||
g){e(m).appendTo(f).html(g[1]+g[0]+g[1].replace("<","</"))});else if(a=="url"){f.html('Enter URL:<br><input type=text value="http://" size=35><br><input type=button value="Submit">');c=B}else if(a=="pastetext"){f.html("Paste your content here and click submit.<br /><textarea cols=40 rows=3></textarea><br /><input type=button value=Submit>");c=B}if(!c&&!d)c=S;f.addClass(c);l&&f.attr(I,"on").find("div,font,p,h1,h2,h3,h4,h5,h6").attr(I,"on");if(f.hasClass(S)||h===true)f.children().hover(O,P);p[a]=f[0];
|
||||
return f[0]}function T(a,b){if(b){a.$area.attr(n,n);a.disabled=true}else{a.$area.removeAttr(n);delete a.disabled}try{if(l)a.doc.body.contentEditable=!b;else a.doc.designMode=!b?"on":"off"}catch(c){}u(a)}function v(a,b,c,d,h){D(a);if(!l){if(d===undefined||d===null)d=a.options.useCSS;a.doc.execCommand("styleWithCSS",0,d.toString())}d=true;var f;if(l&&b.toLowerCase()=="inserthtml")y(a).pasteHTML(c);else{try{d=a.doc.execCommand(b,0,c||null)}catch(i){f=i.description;d=false}d||("cutcopypaste".indexOf(b)>
|
||||
-1?z(a,"For security reasons, your browser does not support the "+b+" command. Try using the keyboard shortcut or context menu instead.",h):z(a,f?f:"Error executing the "+b+" command.",h))}u(a);return d}function w(a){setTimeout(function(){t(a)?a.$area.focus():a.$frame[0].contentWindow.focus();u(a)},0)}function y(a){if(l)return J(a).createRange();return J(a).getRangeAt(0)}function J(a){if(l)return a.doc.selection;return a.$frame[0].contentWindow.getSelection()}function Q(a){var b=/rgba?\((\d+), (\d+), (\d+)/.exec(a),
|
||||
c=a.split("");if(b)for(a=(b[1]<<16|b[2]<<8|b[3]).toString(16);a.length<6;)a="0"+a;return"#"+(a.length==6?a:c[1]+c[1]+c[2]+c[2]+c[3]+c[3])}function r(){e.each(p,function(a,b){e(b).hide().unbind(q).removeData(A)})}function U(){var a=e("link[href$='jquery.cleditor.css']").attr("href");return a.substr(0,a.length-19)+"images/"}function K(a){var b=a.$main,c=a.options;a.$frame&&a.$frame.remove();var d=a.$frame=e('<iframe frameborder="0" src="javascript:true;">').hide().appendTo(b),h=d[0].contentWindow,f=
|
||||
a.doc=h.document,i=e(f);f.open();f.write(c.docType+"<html>"+(c.docCSSFile===""?"":'<head><link rel="stylesheet" type="text/css" href="'+c.docCSSFile+'" /></head>')+'<body style="'+c.bodyStyle+'"></body></html>');f.close();l&&i.click(function(){w(a)});E(a);if(l){i.bind("beforedeactivate beforeactivate selectionchange keypress",function(g){if(g.type=="beforedeactivate")a.inactive=true;else if(g.type=="beforeactivate"){!a.inactive&&a.range&&a.range.length>1&&a.range.shift();delete a.inactive}else if(!a.inactive){if(!a.range)a.range=
|
||||
[];for(a.range.unshift(y(a));a.range.length>2;)a.range.pop()}});d.focus(function(){D(a)})}(e.browser.mozilla?i:e(h)).blur(function(){V(a,true)});i.click(r).bind("keyup mouseup",function(){u(a)});L?a.$area.show():d.show();e(function(){var g=a.$toolbar,j=g.children("div:last"),k=b.width();j=j.offset().top+j.outerHeight()-g.offset().top+1;g.height(j);j=(/%/.test(""+c.height)?b.height():parseInt(c.height))-j;d.width(k).height(j);a.$area.width(k).height(ea?j-2:j);T(a,a.disabled);u(a)})}function u(a){if(!L&&
|
||||
e.browser.webkit&&!a.focused){a.$frame[0].contentWindow.focus();window.focus();a.focused=true}var b=a.doc;if(l)b=y(a);var c=t(a);e.each(a.$toolbar.find("."+W),function(d,h){var f=e(h),i=e.cleditor.buttons[e.data(h,x)],g=i.command,j=true;if(a.disabled)j=false;else if(i.getEnabled){j=i.getEnabled({editor:a,button:h,buttonName:i.name,popup:p[i.popupName],popupName:i.popupName,command:i.command,useCSS:a.options.useCSS});if(j===undefined)j=true}else if((c||L)&&i.name!="source"||l&&(g=="undo"||g=="redo"))j=
|
||||
false;else if(g&&g!="print"){if(l&&g=="hilitecolor")g="backcolor";if(!l||g!="inserthtml")try{j=b.queryCommandEnabled(g)}catch(k){j=false}}if(j){f.removeClass(X);f.removeAttr(n)}else{f.addClass(X);f.attr(n,n)}})}function D(a){l&&a.range&&a.range[0].select()}function M(a){D(a);if(l)return y(a).text;return J(a).toString()}function z(a,b,c){var d=R("msg",a.options,fa);d.innerHTML=b;N(a,d,c)}function N(a,b,c){var d,h,f=e(b);if(c){var i=e(c);d=i.offset();h=--d.left;d=d.top+i.height()}else{i=a.$toolbar;
|
||||
d=i.offset();h=Math.floor((i.width()-f.width())/2)+d.left;d=d.top+i.height()-2}r();f.css({left:h,top:d}).show();if(c){e.data(b,A,c);f.bind(q,{popup:b},e.proxy(ba,a))}setTimeout(function(){f.find(":text,textarea").eq(0).focus().select()},100)}function t(a){return a.$area.is(":visible")}function E(a,b){var c=a.$area.val(),d=a.options,h=d.updateFrame,f=e(a.doc.body);if(h){var i=C(c);if(b&&a.areaChecksum==i)return;a.areaChecksum=i}c=h?h(c):c;c=c.replace(/<(?=\/?script)/ig,"<");if(d.updateTextArea)a.frameChecksum=
|
||||
C(c);if(c!=f.html()){f.html(c);e(a).triggerHandler(F)}}function V(a,b){var c=e(a.doc.body).html(),d=a.options,h=d.updateTextArea,f=a.$area;if(h){var i=C(c);if(b&&a.frameChecksum==i)return;a.frameChecksum=i}c=h?h(c):c;if(d.updateFrame)a.areaChecksum=C(c);if(c!=f.val()){f.val(c);e(a).triggerHandler(F)}}e.cleditor={defaultOptions:{width:500,height:250,controls:"bold italic underline strikethrough subscript superscript | font size style | color highlight removeformat | bullets numbering | outdent indent | alignleft center alignright justify | undo redo | rule image link unlink | cut copy paste pastetext | print source",
|
||||
colors:"FFF FCC FC9 FF9 FFC 9F9 9FF CFF CCF FCF CCC F66 F96 FF6 FF3 6F9 3FF 6FF 99F F9F BBB F00 F90 FC6 FF0 3F3 6CC 3CF 66C C6C 999 C00 F60 FC3 FC0 3C0 0CC 36F 63F C3C 666 900 C60 C93 990 090 399 33F 60C 939 333 600 930 963 660 060 366 009 339 636 000 300 630 633 330 030 033 006 309 303",fonts:"Arial,Arial Black,Comic Sans MS,Courier New,Narrow,Garamond,Georgia,Impact,Sans Serif,Serif,Tahoma,Trebuchet MS,Verdana",sizes:"1,2,3,4,5,6,7",styles:[["Paragraph","<p>"],["Header 1","<h1>"],["Header 2","<h2>"],
|
||||
["Header 3","<h3>"],["Header 4","<h4>"],["Header 5","<h5>"],["Header 6","<h6>"]],useCSS:false,docType:'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',docCSSFile:"",bodyStyle:"margin:4px; font:10pt Arial,Verdana; cursor:text"},buttons:{init:"bold,,|italic,,|underline,,|strikethrough,,|subscript,,|superscript,,|font,,fontname,|size,Font Size,fontsize,|style,,formatblock,|color,Font Color,forecolor,|highlight,Text Highlight Color,hilitecolor,color|removeformat,Remove Formatting,|bullets,,insertunorderedlist|numbering,,insertorderedlist|outdent,,|indent,,|alignleft,Align Text Left,justifyleft|center,,justifycenter|alignright,Align Text Right,justifyright|justify,,justifyfull|undo,,|redo,,|rule,Insert Horizontal Rule,inserthorizontalrule|image,Insert Image,insertimage,url|link,Insert Hyperlink,createlink,url|unlink,Remove Hyperlink,|cut,,|copy,,|paste,,|pastetext,Paste as Text,inserthtml,|print,,|source,Show Source"},
|
||||
imagesPath:function(){return U()}};e.fn.cleditor=function(a){var b=e([]);this.each(function(c,d){if(d.tagName=="TEXTAREA"){var h=e.data(d,Y);h||(h=new cleditor(d,a));b=b.add(h)}});return b};var H="backgroundColor",A="button",x="buttonName",F="change",Y="cleditor",q="click",n="disabled",m="<div>",I="unselectable",W="cleditorButton",X="cleditorDisabled",ca="cleditorPopup",S="cleditorList",da="cleditorColor",B="cleditorPrompt",fa="cleditorMsg",l=e.browser.msie,ea=/msie\s6/i.test(navigator.userAgent),
|
||||
L=/iphone|ipad|ipod/i.test(navigator.userAgent),p={},Z,s=e.cleditor.buttons;e.each(s.init.split("|"),function(a,b){var c=b.split(","),d=c[0];s[d]={stripIndex:a,name:d,title:c[1]===""?d.charAt(0).toUpperCase()+d.substr(1):c[1],command:c[2]===""?d:c[2],popupName:c[3]===""?d:c[3]}});delete s.init;cleditor=function(a,b){var c=this;c.options=b=e.extend({},e.cleditor.defaultOptions,b);var d=c.$area=e(a).hide().data(Y,c).blur(function(){E(c,true)}),h=c.$main=e(m).addClass("cleditorMain").width(b.width).height(b.height),
|
||||
f=c.$toolbar=e(m).addClass("cleditorToolbar").appendTo(h),i=e(m).addClass("cleditorGroup").appendTo(f);e.each(b.controls.split(" "),function(g,j){if(j==="")return true;if(j=="|"){e(m).addClass("cleditorDivider").appendTo(i);i=e(m).addClass("cleditorGroup").appendTo(f)}else{var k=s[j],o=e(m).data(x,k.name).addClass(W).attr("title",k.title).bind(q,e.proxy(aa,c)).appendTo(i).hover(O,P),G={};if(k.css)G=k.css;else if(k.image)G.backgroundImage="url("+U()+k.image+")";if(k.stripIndex)G.backgroundPosition=
|
||||
k.stripIndex*-24;o.css(G);l&&o.attr(I,"on");k.popupName&&R(k.popupName,b,k.popupClass,k.popupContent,k.popupHover)}});h.insertBefore(d).append(d);if(!Z){e(document).click(function(g){g=e(g.target);g.add(g.parents()).is("."+B)||r()});Z=true}/auto|%/.test(""+b.width+b.height)&&e(window).resize(function(){K(c)});K(c)};var $=cleditor.prototype;e.each([["clear",function(a){a.$area.val("");E(a)}],["disable",T],["execCommand",v],["focus",w],["hidePopups",r],["sourceMode",t,true],["refresh",K],["select",
|
||||
function(a){setTimeout(function(){t(a)?a.$area.select():v(a,"selectall")},0)}],["selectedHTML",function(a){D(a);a=y(a);if(l)return a.htmlText;var b=e("<layer>")[0];b.appendChild(a.cloneContents());return b.innerHTML},true],["selectedText",M,true],["showMessage",z],["updateFrame",E],["updateTextArea",V]],function(a,b){$[b[0]]=function(){for(var c=[this],d=0;d<arguments.length;d++)c.push(arguments[d]);c=b[1].apply(this,c);if(b[2])return c;return this}});$.change=function(a){var b=e(this);return a?b.bind(F,
|
||||
a):b.trigger(F)}})(jQuery);
|
||||
55
modules/lib/UItoTop/jquery.ui.totop.js
vendored
Normal file
55
modules/lib/UItoTop/jquery.ui.totop.js
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| UItoTop jQuery Plugin 1.2 by Matt Varone
|
||||
| http://www.mattvarone.com/web-design/uitotop-jquery-plugin/
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
(function($){
|
||||
$.fn.UItoTop = function(options) {
|
||||
|
||||
var defaults = {
|
||||
text: 'To Top',
|
||||
min: 200,
|
||||
inDelay:600,
|
||||
outDelay:400,
|
||||
containerID: 'toTop',
|
||||
containerHoverID: 'toTopHover',
|
||||
scrollSpeed: 1200,
|
||||
easingType: 'linear'
|
||||
},
|
||||
settings = $.extend(defaults, options),
|
||||
containerIDhash = '#' + settings.containerID,
|
||||
containerHoverIDHash = '#'+settings.containerHoverID;
|
||||
|
||||
$('body').append('<a href="#" id="'+settings.containerID+'">'+settings.text+'</a>');
|
||||
$(containerIDhash).hide().on('click.UItoTop',function(){
|
||||
$('html, body').animate({scrollTop:0}, settings.scrollSpeed, settings.easingType);
|
||||
$('#'+settings.containerHoverID, this).stop().animate({'opacity': 0 }, settings.inDelay, settings.easingType);
|
||||
return false;
|
||||
})
|
||||
.prepend('<span id="'+settings.containerHoverID+'"></span>')
|
||||
.hover(function() {
|
||||
$(containerHoverIDHash, this).stop().animate({
|
||||
'opacity': 1
|
||||
}, 200, 'linear');
|
||||
}, function() {
|
||||
$(containerHoverIDHash, this).stop().animate({
|
||||
'opacity': 0
|
||||
}, 300, 'linear');
|
||||
});
|
||||
|
||||
$(window).scroll(function() {
|
||||
var sd = $(window).scrollTop();
|
||||
if(typeof document.body.style.maxHeight === "undefined") {
|
||||
$(containerIDhash).css({
|
||||
'position': 'absolute',
|
||||
'top': sd + $(window).height() - 50
|
||||
});
|
||||
}
|
||||
if ( sd > settings.min )
|
||||
$(containerIDhash).fadeIn(settings.inDelay);
|
||||
else
|
||||
$(containerIDhash).fadeOut(settings.Outdelay);
|
||||
});
|
||||
};
|
||||
})(jQuery);
|
||||
5
modules/lib/UItoTop/jquery.ui.totop.min.js
vendored
Normal file
5
modules/lib/UItoTop/jquery.ui.totop.min.js
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
/* UItoTop jQuery Plugin 1.2 | Matt Varone | http://www.mattvarone.com/web-design/uitotop-jquery-plugin */
|
||||
(function($){$.fn.UItoTop=function(options){var defaults={text:'To Top',min:200,inDelay:600,outDelay:400,containerID:'toTop',containerHoverID:'toTopHover',scrollSpeed:1200,easingType:'linear'},settings=$.extend(defaults,options),containerIDhash='#'+settings.containerID,containerHoverIDHash='#'+settings.containerHoverID;$('body').append('<a href="#" id="'+settings.containerID+'">'+settings.text+'</a>');$(containerIDhash).hide().on('click.UItoTop',function(){$('html, body').animate({scrollTop:0},settings.scrollSpeed,settings.easingType);$('#'+settings.containerHoverID,this).stop().animate({'opacity':0},settings.inDelay,settings.easingType);return false;}).prepend('<span id="'+settings.containerHoverID+'"></span>').hover(function(){$(containerHoverIDHash,this).stop().animate({'opacity':1},200,'linear');},function(){$(containerHoverIDHash,this).stop().animate({'opacity':0},300,'linear');});$(window).scroll(function(){var sd=$(window).scrollTop();if(typeof document.body.style.maxHeight==="undefined"){$(containerIDhash).css({'position':'absolute','top':sd+$(window).height()-50});}
|
||||
if(sd>settings.min)
|
||||
$(containerIDhash).fadeIn(settings.inDelay);else
|
||||
$(containerIDhash).fadeOut(settings.Outdelay);});};})(jQuery);
|
||||
54
modules/lib/antiscroll/antiscroll.css
Normal file
54
modules/lib/antiscroll/antiscroll.css
Normal file
@ -0,0 +1,54 @@
|
||||
.antiScroll {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.antiscroll-scrollbar {
|
||||
background: gray;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
-webkit-border-radius: 7px;
|
||||
-moz-border-radius: 7px;
|
||||
border-radius: 7px;
|
||||
-webkit-box-shadow: 0 0 1px #fff;
|
||||
-moz-box-shadow: 0 0 1px #fff;
|
||||
box-shadow: 0 0 1px #fff;
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
|
||||
-webkit-transition: linear 300ms opacity;
|
||||
-moz-transition: linear 300ms opacity;
|
||||
-o-transition: linear 300ms opacity;
|
||||
}
|
||||
|
||||
.antiscroll-scrollbar-shown {
|
||||
opacity: 1;
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
|
||||
}
|
||||
|
||||
.antiscroll-scrollbar-horizontal {
|
||||
height: 7px;
|
||||
margin-left: 2px;
|
||||
bottom: 2px;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.antiscroll-scrollbar-vertical {
|
||||
width: 7px;
|
||||
margin-top: 2px;
|
||||
right: 2px;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.antiscroll-inner {
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
.antiScroll,.antiscroll-content, .antiscroll-inner {
|
||||
width: 240px;
|
||||
}
|
||||
|
||||
.antiscroll-inner::-webkit-scrollbar, .antiscroll-inner::scrollbar {
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
439
modules/lib/antiscroll/antiscroll.js
Normal file
439
modules/lib/antiscroll/antiscroll.js
Normal file
@ -0,0 +1,439 @@
|
||||
|
||||
(function ($) {
|
||||
|
||||
/**
|
||||
* Augment jQuery prototype.
|
||||
*/
|
||||
|
||||
$.fn.antiscroll = function (options) {
|
||||
return this.each(function () {
|
||||
if ($(this).data('antiscroll')) {
|
||||
$(this).data('antiscroll').destroy();
|
||||
}
|
||||
|
||||
$(this).data('antiscroll', new $.Antiscroll(this, options));
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Expose constructor.
|
||||
*/
|
||||
|
||||
$.Antiscroll = Antiscroll;
|
||||
|
||||
/**
|
||||
* Antiscroll pane constructor.
|
||||
*
|
||||
* @param {Element|jQuery} main pane
|
||||
* @parma {Object} options
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function Antiscroll (el, opts) {
|
||||
this.el = $(el);
|
||||
this.options = opts || {};
|
||||
|
||||
this.x = false !== this.options.x;
|
||||
this.y = false !== this.options.y;
|
||||
this.padding = undefined == this.options.padding ? 2 : this.options.padding;
|
||||
|
||||
this.inner = this.el.find('.antiscroll-inner');
|
||||
this.inner.css({
|
||||
'width': '+=' + scrollbarSize()
|
||||
, 'height': '+=' + scrollbarSize()
|
||||
});
|
||||
|
||||
this.refresh();
|
||||
};
|
||||
|
||||
/**
|
||||
* refresh scrollbars
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Antiscroll.prototype.refresh = function() {
|
||||
var needHScroll = this.inner.get(0).scrollWidth > this.el.width()
|
||||
, needVScroll = this.inner.get(0).scrollHeight > this.el.height();
|
||||
|
||||
if (!this.horizontal && needHScroll && this.x) {
|
||||
this.horizontal = new Scrollbar.Horizontal(this);
|
||||
} else if (this.horizontal && !needHScroll) {
|
||||
this.horizontal.destroy();
|
||||
this.horizontal = null
|
||||
}
|
||||
|
||||
if (!this.vertical && needVScroll && this.y) {
|
||||
this.vertical = new Scrollbar.Vertical(this);
|
||||
} else if (this.vertical && !needVScroll) {
|
||||
this.vertical.destroy();
|
||||
this.vertical = null
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Cleans up.
|
||||
*
|
||||
* @return {Antiscroll} for chaining
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Antiscroll.prototype.destroy = function () {
|
||||
if (this.horizontal) {
|
||||
this.horizontal.destroy();
|
||||
}
|
||||
if (this.vertical) {
|
||||
this.vertical.destroy();
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Rebuild Antiscroll.
|
||||
*
|
||||
* @return {Antiscroll} for chaining
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Antiscroll.prototype.rebuild = function () {
|
||||
this.destroy();
|
||||
this.inner.attr('style', '');
|
||||
Antiscroll.call(this, this.el, this.options);
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Scrollbar constructor.
|
||||
*
|
||||
* @param {Element|jQuery} element
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function Scrollbar (pane) {
|
||||
this.pane = pane;
|
||||
this.pane.el.append(this.el);
|
||||
this.innerEl = this.pane.inner.get(0);
|
||||
|
||||
this.dragging = false;
|
||||
this.enter = false;
|
||||
this.shown = false;
|
||||
|
||||
// hovering
|
||||
this.pane.el.mouseenter($.proxy(this, 'mouseenter'));
|
||||
this.pane.el.mouseleave($.proxy(this, 'mouseleave'));
|
||||
|
||||
// dragging
|
||||
this.el.mousedown($.proxy(this, 'mousedown'));
|
||||
|
||||
// scrolling
|
||||
this.pane.inner.scroll($.proxy(this, 'scroll'));
|
||||
|
||||
// wheel -optional-
|
||||
this.pane.inner.bind('mousewheel', $.proxy(this, 'mousewheel'));
|
||||
|
||||
// show
|
||||
var initialDisplay = this.pane.options.initialDisplay;
|
||||
|
||||
if (initialDisplay !== false) {
|
||||
this.show();
|
||||
this.hiding = setTimeout($.proxy(this, 'hide'), parseInt(initialDisplay, 10) || 3000);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Cleans up.
|
||||
*
|
||||
* @return {Scrollbar} for chaining
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Scrollbar.prototype.destroy = function () {
|
||||
this.el.remove();
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Called upon mouseenter.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Scrollbar.prototype.mouseenter = function () {
|
||||
this.enter = true;
|
||||
this.show();
|
||||
};
|
||||
|
||||
/**
|
||||
* Called upon mouseleave.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Scrollbar.prototype.mouseleave = function () {
|
||||
this.enter = false;
|
||||
|
||||
if (!this.dragging) {
|
||||
this.hide();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called upon wrap scroll.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Scrollbar.prototype.scroll = function () {
|
||||
if (!this.shown) {
|
||||
this.show();
|
||||
if (!this.enter && !this.dragging) {
|
||||
this.hiding = setTimeout($.proxy(this, 'hide'), 1500);
|
||||
}
|
||||
}
|
||||
|
||||
this.update();
|
||||
};
|
||||
|
||||
/**
|
||||
* Called upon scrollbar mousedown.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Scrollbar.prototype.mousedown = function (ev) {
|
||||
ev.preventDefault();
|
||||
|
||||
this.dragging = true;
|
||||
|
||||
this.startPageY = ev.pageY - parseInt(this.el.css('top'), 10);
|
||||
this.startPageX = ev.pageX - parseInt(this.el.css('left'), 10);
|
||||
|
||||
// prevent crazy selections on IE
|
||||
document.onselectstart = function () { return false; };
|
||||
|
||||
var pane = this.pane
|
||||
, move = $.proxy(this, 'mousemove')
|
||||
, self = this
|
||||
|
||||
$(document)
|
||||
.mousemove(move)
|
||||
.mouseup(function () {
|
||||
self.dragging = false;
|
||||
document.onselectstart = null;
|
||||
|
||||
$(document).unbind('mousemove', move);
|
||||
|
||||
if (!self.enter) {
|
||||
self.hide();
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
/**
|
||||
* Show scrollbar.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Scrollbar.prototype.show = function (duration) {
|
||||
if (!this.shown) {
|
||||
this.update();
|
||||
this.el.addClass('antiscroll-scrollbar-shown');
|
||||
if (this.hiding) {
|
||||
clearTimeout(this.hiding);
|
||||
this.hiding = null;
|
||||
}
|
||||
this.shown = true;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Hide scrollbar.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Scrollbar.prototype.hide = function () {
|
||||
var autoHide = this.pane.options.autoHide;
|
||||
if (autoHide !== false && this.shown) {
|
||||
// check for dragging
|
||||
this.el.removeClass('antiscroll-scrollbar-shown');
|
||||
this.shown = false;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Horizontal scrollbar constructor
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Scrollbar.Horizontal = function (pane) {
|
||||
this.el = $('<div class="antiscroll-scrollbar antiscroll-scrollbar-horizontal">');
|
||||
Scrollbar.call(this, pane);
|
||||
}
|
||||
|
||||
/**
|
||||
* Inherits from Scrollbar.
|
||||
*/
|
||||
|
||||
inherits(Scrollbar.Horizontal, Scrollbar);
|
||||
|
||||
/**
|
||||
* Updates size/position of scrollbar.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Scrollbar.Horizontal.prototype.update = function () {
|
||||
var paneWidth = this.pane.el.width()
|
||||
, trackWidth = paneWidth - this.pane.padding * 2
|
||||
, innerEl = this.pane.inner.get(0)
|
||||
|
||||
this.el
|
||||
.css('width', trackWidth * paneWidth / innerEl.scrollWidth)
|
||||
.css('left', trackWidth * innerEl.scrollLeft / innerEl.scrollWidth)
|
||||
}
|
||||
|
||||
/**
|
||||
* Called upon drag.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Scrollbar.Horizontal.prototype.mousemove = function (ev) {
|
||||
var trackWidth = this.pane.el.width() - this.pane.padding * 2
|
||||
, pos = ev.pageX - this.startPageX
|
||||
, barWidth = this.el.width()
|
||||
, innerEl = this.pane.inner.get(0)
|
||||
|
||||
// minimum top is 0, maximum is the track height
|
||||
var y = Math.min(Math.max(pos, 0), trackWidth - barWidth)
|
||||
|
||||
innerEl.scrollLeft = (innerEl.scrollWidth - this.pane.el.width())
|
||||
* y / (trackWidth - barWidth)
|
||||
};
|
||||
|
||||
/**
|
||||
* Called upon container mousewheel.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Scrollbar.Horizontal.prototype.mousewheel = function (ev, delta, x, y) {
|
||||
if ((x < 0 && 0 == this.pane.inner.get(0).scrollLeft) ||
|
||||
(x > 0 && (this.innerEl.scrollLeft + Math.ceil(this.pane.el.width())
|
||||
== this.innerEl.scrollWidth))) {
|
||||
ev.preventDefault();
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Vertical scrollbar constructor
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Scrollbar.Vertical = function (pane) {
|
||||
this.el = $('<div class="antiscroll-scrollbar antiscroll-scrollbar-vertical">');
|
||||
Scrollbar.call(this, pane);
|
||||
};
|
||||
|
||||
/**
|
||||
* Inherits from Scrollbar.
|
||||
*/
|
||||
|
||||
inherits(Scrollbar.Vertical, Scrollbar);
|
||||
|
||||
/**
|
||||
* Updates size/position of scrollbar.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Scrollbar.Vertical.prototype.update = function () {
|
||||
var paneHeight = this.pane.el.height()
|
||||
, trackHeight = paneHeight - this.pane.padding * 2
|
||||
, innerEl = this.innerEl
|
||||
|
||||
this.el
|
||||
.css('height', trackHeight * paneHeight / innerEl.scrollHeight)
|
||||
.css('top', trackHeight * innerEl.scrollTop / innerEl.scrollHeight)
|
||||
};
|
||||
|
||||
/**
|
||||
* Called upon drag.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Scrollbar.Vertical.prototype.mousemove = function (ev) {
|
||||
var paneHeight = this.pane.el.height()
|
||||
, trackHeight = paneHeight - this.pane.padding * 2
|
||||
, pos = ev.pageY - this.startPageY
|
||||
, barHeight = this.el.height()
|
||||
, innerEl = this.innerEl
|
||||
|
||||
// minimum top is 0, maximum is the track height
|
||||
var y = Math.min(Math.max(pos, 0), trackHeight - barHeight)
|
||||
|
||||
innerEl.scrollTop = (innerEl.scrollHeight - paneHeight)
|
||||
* y / (trackHeight - barHeight)
|
||||
};
|
||||
|
||||
/**
|
||||
* Called upon container mousewheel.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Scrollbar.Vertical.prototype.mousewheel = function (ev, delta, x, y) {
|
||||
if ((y > 0 && 0 == this.innerEl.scrollTop) ||
|
||||
(y < 0 && (this.innerEl.scrollTop + Math.ceil(this.pane.el.height())
|
||||
== this.innerEl.scrollHeight))) {
|
||||
ev.preventDefault();
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Cross-browser inheritance.
|
||||
*
|
||||
* @param {Function} constructor
|
||||
* @param {Function} constructor we inherit from
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function inherits (ctorA, ctorB) {
|
||||
function f() {};
|
||||
f.prototype = ctorB.prototype;
|
||||
ctorA.prototype = new f;
|
||||
};
|
||||
|
||||
/**
|
||||
* Scrollbar size detection.
|
||||
*/
|
||||
|
||||
var size;
|
||||
|
||||
function scrollbarSize () {
|
||||
if (size === undefined) {
|
||||
var div = $(
|
||||
'<div class="antiscroll-inner" style="width:50px;height:50px;overflow-y:scroll;'
|
||||
+ 'position:absolute;top:-200px;left:-200px;"><div style="height:100px;width:100%">'
|
||||
+ '</div>'
|
||||
);
|
||||
|
||||
$('body').append(div);
|
||||
var w1 = $(div).innerWidth();
|
||||
var w2 = $('div', div).innerWidth();
|
||||
$(div).remove();
|
||||
|
||||
size = w1 - w2;
|
||||
}
|
||||
|
||||
return size;
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
9
modules/lib/antiscroll/antiscroll.min.js
vendored
Normal file
9
modules/lib/antiscroll/antiscroll.min.js
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
(function(b){function f(a,e){this.el=b(a);this.options=e||{};this.x=!1!==this.options.x;this.y=!1!==this.options.y;this.padding=void 0==this.options.padding?2:this.options.padding;this.inner=this.el.find(".antiscroll-inner");this.inner.css({width:"+="+h(),height:"+="+h()});this.refresh()}function c(a){this.pane=a;this.pane.el.append(this.el);this.innerEl=this.pane.inner.get(0);this.shown=this.enter=this.dragging=!1;this.pane.el.mouseenter(b.proxy(this,"mouseenter"));this.pane.el.mouseleave(b.proxy(this,
|
||||
"mouseleave"));this.el.mousedown(b.proxy(this,"mousedown"));this.pane.inner.scroll(b.proxy(this,"scroll"));this.pane.inner.bind("mousewheel",b.proxy(this,"mousewheel"));a=this.pane.options.initialDisplay;!1!==a&&(this.show(),this.hiding=setTimeout(b.proxy(this,"hide"),parseInt(a,10)||3E3))}function j(a,e){function d(){}d.prototype=e.prototype;a.prototype=new d}function h(){if(void 0===g){var a=b('<div class="antiscroll-inner" style="width:50px;height:50px;overflow-y:scroll;position:absolute;top:-200px;left:-200px;"><div style="height:100px;width:100%"></div>');
|
||||
b("body").append(a);var e=b(a).innerWidth(),d=b("div",a).innerWidth();b(a).remove();g=e-d}return g}b.fn.antiscroll=function(a){return this.each(function(){b(this).data("antiscroll")&&b(this).data("antiscroll").destroy();b(this).data("antiscroll",new b.Antiscroll(this,a))})};b.Antiscroll=f;f.prototype.refresh=function(){var a=this.inner.get(0).scrollWidth>this.el.width(),e=this.inner.get(0).scrollHeight>this.el.height();!this.horizontal&&a&&this.x?this.horizontal=new c.Horizontal(this):this.horizontal&&
|
||||
!a&&(this.horizontal.destroy(),this.horizontal=null);!this.vertical&&e&&this.y?this.vertical=new c.Vertical(this):this.vertical&&!e&&(this.vertical.destroy(),this.vertical=null)};f.prototype.destroy=function(){this.horizontal&&this.horizontal.destroy();this.vertical&&this.vertical.destroy();return this};f.prototype.rebuild=function(){this.destroy();this.inner.attr("style","");f.call(this,this.el,this.options);return this};c.prototype.destroy=function(){this.el.remove();return this};c.prototype.mouseenter=
|
||||
function(){this.enter=!0;this.show()};c.prototype.mouseleave=function(){this.enter=!1;this.dragging||this.hide()};c.prototype.scroll=function(){this.shown||(this.show(),!this.enter&&!this.dragging&&(this.hiding=setTimeout(b.proxy(this,"hide"),1500)));this.update()};c.prototype.mousedown=function(a){a.preventDefault();this.dragging=!0;this.startPageY=a.pageY-parseInt(this.el.css("top"),10);this.startPageX=a.pageX-parseInt(this.el.css("left"),10);document.onselectstart=function(){return!1};var e=b.proxy(this,
|
||||
"mousemove"),d=this;b(document).mousemove(e).mouseup(function(){d.dragging=!1;document.onselectstart=null;b(document).unbind("mousemove",e);d.enter||d.hide()})};c.prototype.show=function(){this.shown||(this.update(),this.el.addClass("antiscroll-scrollbar-shown"),this.hiding&&(clearTimeout(this.hiding),this.hiding=null),this.shown=!0)};c.prototype.hide=function(){!1!==this.pane.options.autoHide&&this.shown&&(this.el.removeClass("antiscroll-scrollbar-shown"),this.shown=!1)};c.Horizontal=function(a){this.el=
|
||||
b('<div class="antiscroll-scrollbar antiscroll-scrollbar-horizontal">');c.call(this,a)};j(c.Horizontal,c);c.Horizontal.prototype.update=function(){var a=this.pane.el.width(),e=a-2*this.pane.padding,d=this.pane.inner.get(0);this.el.css("width",e*a/d.scrollWidth).css("left",e*d.scrollLeft/d.scrollWidth)};c.Horizontal.prototype.mousemove=function(a){var e=this.pane.el.width()-2*this.pane.padding,d=a.pageX-this.startPageX;a=this.el.width();var b=this.pane.inner.get(0),d=Math.min(Math.max(d,0),e-a);b.scrollLeft=
|
||||
(b.scrollWidth-this.pane.el.width())*d/(e-a)};c.Horizontal.prototype.mousewheel=function(a,b,d){if(0>d&&0==this.pane.inner.get(0).scrollLeft||0<d&&this.innerEl.scrollLeft+Math.ceil(this.pane.el.width())==this.innerEl.scrollWidth)return a.preventDefault(),!1};c.Vertical=function(a){this.el=b('<div class="antiscroll-scrollbar antiscroll-scrollbar-vertical">');c.call(this,a)};j(c.Vertical,c);c.Vertical.prototype.update=function(){var a=this.pane.el.height(),b=a-2*this.pane.padding,d=this.innerEl;this.el.css("height",
|
||||
b*a/d.scrollHeight).css("top",b*d.scrollTop/d.scrollHeight)};c.Vertical.prototype.mousemove=function(a){var b=this.pane.el.height(),d=b-2*this.pane.padding,c=a.pageY-this.startPageY;a=this.el.height();var f=this.innerEl,c=Math.min(Math.max(c,0),d-a);f.scrollTop=(f.scrollHeight-b)*c/(d-a)};c.Vertical.prototype.mousewheel=function(a,b,c,f){if(0<f&&0==this.innerEl.scrollTop||0>f&&this.innerEl.scrollTop+Math.ceil(this.pane.el.height())==this.innerEl.scrollHeight)return a.preventDefault(),!1};var g})(jQuery);
|
||||
304
modules/lib/antiscroll/index.html
Normal file
304
modules/lib/antiscroll/index.html
Normal file
@ -0,0 +1,304 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Antiscroll - os x lion style cross-browser native scrolling on the web that gets out of the way</title>
|
||||
<link href="antiscroll.css" rel="stylesheet" />
|
||||
|
||||
<style>
|
||||
body {
|
||||
padding: 80px 100px;
|
||||
font: 14px/1.4 'helvetica neue', helvetica, arial, sans-serif;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.box {
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
.box, .box .antiscroll-inner {
|
||||
width: 250px;
|
||||
height: 250px;
|
||||
font: 14px Helvetica, Arial;
|
||||
}
|
||||
|
||||
.box-wrap {
|
||||
margin: 20px 40px;
|
||||
border: 1px solid #999;
|
||||
}
|
||||
|
||||
.box-inner {
|
||||
background: #eee;
|
||||
padding: 10px;
|
||||
color: #999;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
}
|
||||
|
||||
.button {
|
||||
-webkit-user-select: none;
|
||||
display: block;
|
||||
background: #3b88d8;
|
||||
text-decoration: none;
|
||||
background: -o-linear-gradient(0% 100% 90deg, #377ad0, #52a8e8);
|
||||
background: -moz-linear-gradient(0% 100% 90deg, #377ad0, #52a8e8);
|
||||
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#52a8e8), to(#377ad0));
|
||||
border-top: 1px solid #4081af;
|
||||
border-right: 1px solid #2e69a3;
|
||||
border-bottom: 1px solid #20559a;
|
||||
border-left: 1px solid #2e69a3;
|
||||
-moz-border-radius: 16px;
|
||||
-webkit-border-radius: 16px;
|
||||
border-radius: 16px;
|
||||
-moz-box-shadow: inset 0 1px 0 0 #72b9eb, 0 1px 2px 0 #b3b3b3;
|
||||
-webkit-box-shadow: inset 0 1px 0 0 #72b9eb, 0 1px 2px 0 #b3b3b3;
|
||||
box-shadow: inset 0 1px 0 0 #72b9eb, 0 1px 2px 0 #b3b3b3;
|
||||
color: #fff;
|
||||
font-family: "lucida grande", sans-serif;
|
||||
font-size: 11px;
|
||||
font-weight: normal;
|
||||
line-height: 1;
|
||||
padding: 3px 0 5px 0;
|
||||
text-align: center;
|
||||
text-shadow: 0 -1px 1px #3275bc;
|
||||
width: 112px;
|
||||
-webkit-background-clip: padding-box;
|
||||
}
|
||||
|
||||
.button:hover {
|
||||
background: #2a81d7;
|
||||
background: -o-linear-gradient(0% 100% 90deg, #206bcb, #3e9ee5);
|
||||
background: -moz-linear-gradient(0% 100% 90deg, #206bcb, #3e9ee5);
|
||||
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#3e9ee5), to(#206bcb));
|
||||
border-top: 1px solid #2a73a6;
|
||||
border-right: 1px solid #165899;
|
||||
border-bottom: 1px solid #07428f;
|
||||
border-left: 1px solid #165899;
|
||||
-moz-box-shadow: inset 0 1px 0 0 #62b1e9;
|
||||
-webkit-box-shadow: inset 0 1px 0 0 #62b1e9;
|
||||
cursor: pointer;
|
||||
text-shadow: 0 -1px 1px #1d62ab;
|
||||
-webkit-background-clip: padding-box;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.button:active {
|
||||
background: #3282d3;
|
||||
border: 1px solid #154c8c;
|
||||
border-bottom: 1px solid #0e408e;
|
||||
-moz-box-shadow: inset 0 0 6px 3px #1657b5, 0 1px 0 0 #fff;
|
||||
-webkit-box-shadow: inset 0 0 6px 3px #1657b5, 0 1px 0 0 #fff;
|
||||
box-shadow: inset 0 0 6px 3px #1657b5, 0 1px 0 0 #fff;
|
||||
text-shadow: 0 -1px 1px #2361a4;
|
||||
-webkit-background-clip: padding-box;
|
||||
}
|
||||
|
||||
ul#features {
|
||||
margin: 40px 0;
|
||||
padding: 0 20px;
|
||||
float: left;
|
||||
width: 600px;
|
||||
}
|
||||
|
||||
ul#features li {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
ul {
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
ul li {
|
||||
margin: 0 5px;
|
||||
padding: 3px 0;
|
||||
}
|
||||
|
||||
.action {
|
||||
color: #0069d6;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.action:hover {
|
||||
color: #00438a;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<script src="deps/jquery.js"></script>
|
||||
<script src="deps/jquery-mousewheel.js"></script>
|
||||
<script src="antiscroll.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
$(function () {
|
||||
scroller = $('.box-wrap').antiscroll().data('antiscroll');
|
||||
|
||||
$("#addRow").click(function() {
|
||||
$('.box-wrap tr:last').clone().appendTo('.box-wrap table');
|
||||
$("#rows b").text($(".box-wrap tr").length);
|
||||
scroller.refresh();
|
||||
});
|
||||
|
||||
$("#removeRow").click(function() {
|
||||
$('.box-wrap tr:last').remove();
|
||||
$("#rows b").text($(".box-wrap tr").length);
|
||||
scroller.refresh();
|
||||
});
|
||||
|
||||
$("#addCol").click(function() {
|
||||
$('.box-wrap tr').each(function(index, tr) {
|
||||
$('td:last', tr).clone().appendTo(tr);
|
||||
});
|
||||
$("#cols b").text($(".box-wrap tr:last td").length);
|
||||
scroller.refresh();
|
||||
});
|
||||
|
||||
$("#removeCol").click(function() {
|
||||
$('.box-wrap tr').find('td:last').remove();
|
||||
$("#cols b").text($(".box-wrap tr:last td").length);
|
||||
scroller.refresh();
|
||||
});
|
||||
|
||||
$("#rows b").text($(".box-wrap tr").length);
|
||||
$("#cols b").text($(".box-wrap tr:last td").length);
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<h1>Antiscroll</h1>
|
||||
<p>os x lion style cross-browser native scrolling on the web that gets out of the way.</p>
|
||||
<ul id="features">
|
||||
<li>supports mousewheels, trackpads, other input devices natively.</li>
|
||||
<li>total size is <b>1kb</b> minified and gzipped.</li>
|
||||
<li>doesn't magically autowrap your elements with divs (manual wrapping is necessary, please see index.html demo).</li>
|
||||
<li>fade in/out controlled with CSS3 animations.</li>
|
||||
<li>shows scrollbars upon hovering.</li>
|
||||
<li>scrollbars are draggable.</li>
|
||||
<li>size of container can be dynamically adjusted and scrollbars will adapt.</li>
|
||||
<li>supports IE7+, Firefox 3+, Chrome, Safari, Opera</li>
|
||||
</ul>
|
||||
<div class="box-wrap antiscroll-wrap">
|
||||
<div class="box">
|
||||
<div class="antiscroll-inner">
|
||||
<div class="box-inner">
|
||||
<table>
|
||||
<tr>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
<td>Body</td><td>Body</td><td>Body</td><td>Body</td><td>Body</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br style="clear: both">
|
||||
<a href="https://github.com/learnboost/antiscroll/downloads" class="button">Download</a>
|
||||
|
||||
<br />
|
||||
|
||||
<p id="rows"><b>X</b> rows</p>
|
||||
<ul>
|
||||
<li><a class="action" id="addRow" >Add row</a></li>
|
||||
<li><a class="action" id="removeRow">Remove row</a></li>
|
||||
</ul>
|
||||
|
||||
<p id="cols"><b>X</b> cols</p>
|
||||
</ul>
|
||||
<li><a class="action" id="addCol" >Add col</a></li>
|
||||
<li><a class="action" id="removeCol">Remove col</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
78
modules/lib/antiscroll/jquery-mousewheel.js
vendored
Normal file
78
modules/lib/antiscroll/jquery-mousewheel.js
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
|
||||
* Licensed under the MIT License (LICENSE.txt).
|
||||
*
|
||||
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
|
||||
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
|
||||
* Thanks to: Seamus Leahy for adding deltaX and deltaY
|
||||
*
|
||||
* Version: 3.0.4
|
||||
*
|
||||
* Requires: 1.2.2+
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
var types = ['DOMMouseScroll', 'mousewheel'];
|
||||
|
||||
$.event.special.mousewheel = {
|
||||
setup: function() {
|
||||
if ( this.addEventListener ) {
|
||||
for ( var i=types.length; i; ) {
|
||||
this.addEventListener( types[--i], handler, false );
|
||||
}
|
||||
} else {
|
||||
this.onmousewheel = handler;
|
||||
}
|
||||
},
|
||||
|
||||
teardown: function() {
|
||||
if ( this.removeEventListener ) {
|
||||
for ( var i=types.length; i; ) {
|
||||
this.removeEventListener( types[--i], handler, false );
|
||||
}
|
||||
} else {
|
||||
this.onmousewheel = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.extend({
|
||||
mousewheel: function(fn) {
|
||||
return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
|
||||
},
|
||||
|
||||
unmousewheel: function(fn) {
|
||||
return this.unbind("mousewheel", fn);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function handler(event) {
|
||||
var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0;
|
||||
event = $.event.fix(orgEvent);
|
||||
event.type = "mousewheel";
|
||||
|
||||
// Old school scrollwheel delta
|
||||
if ( event.wheelDelta ) { delta = event.wheelDelta/120; }
|
||||
if ( event.detail ) { delta = -event.detail/3; }
|
||||
|
||||
// New school multidimensional scroll (touchpads) deltas
|
||||
deltaY = delta;
|
||||
|
||||
// Gecko
|
||||
if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
|
||||
deltaY = 0;
|
||||
deltaX = -1*delta;
|
||||
}
|
||||
|
||||
// Webkit
|
||||
if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; }
|
||||
if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; }
|
||||
|
||||
// Add event and delta to the front of the arguments
|
||||
args.unshift(event, delta, deltaX, deltaY);
|
||||
|
||||
return $.event.handle.apply(this, args);
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
4
modules/lib/bootstrap-toggle-buttons/.gitignore
vendored
Normal file
4
modules/lib/bootstrap-toggle-buttons/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
target/
|
||||
.idea
|
||||
.sass-cache/
|
||||
.DS_Store
|
||||
176
modules/lib/bootstrap-toggle-buttons/LICENSE
Normal file
176
modules/lib/bootstrap-toggle-buttons/LICENSE
Normal file
@ -0,0 +1,176 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
6
modules/lib/bootstrap-toggle-buttons/README.md
Normal file
6
modules/lib/bootstrap-toggle-buttons/README.md
Normal file
@ -0,0 +1,6 @@
|
||||
Bootstrap-toggle-buttons
|
||||
========================
|
||||
|
||||
Bootstrap-toggle-buttons has moved to https://github.com/nostalgiaz/bootstrap-switch
|
||||
|
||||
Old doc -> https://github.com/nostalgiaz/bootstrap-toggle-buttons/blob/master/README_OLD.md
|
||||
123
modules/lib/bootstrap-toggle-buttons/README_OLD.md
Normal file
123
modules/lib/bootstrap-toggle-buttons/README_OLD.md
Normal file
@ -0,0 +1,123 @@
|
||||
Bootstrap-toggle-buttons
|
||||
========================
|
||||
|
||||
Demo
|
||||
----
|
||||
http://www.larentis.eu/bootstrap_toggle_buttons/
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
Just include Twitter Bootstrap, jQuery and Bootstrap Toggle Buttons CSS and Javascript
|
||||
``` html
|
||||
<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet">
|
||||
<link href="bootstrap-toggle-buttons.css" rel="stylesheet">
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
|
||||
<script src="jquery.toggle.buttons.js"></script>
|
||||
```
|
||||
|
||||
Basic Example
|
||||
-------------
|
||||
|
||||
HTML
|
||||
``` html
|
||||
<div id="toggle-button">
|
||||
<input id="checkbox1" type="checkbox" value="value1" checked="checked">
|
||||
</div>
|
||||
```
|
||||
|
||||
JS
|
||||
``` javascript
|
||||
$('#toggle-button').toggleButtons();
|
||||
```
|
||||
|
||||
Full Example
|
||||
------------
|
||||
|
||||
HTML
|
||||
``` html
|
||||
<div id="toggle-button">
|
||||
<input id="checkbox1" type="checkbox" value="value1" checked="checked">
|
||||
</div>
|
||||
```
|
||||
|
||||
JS
|
||||
``` javascript
|
||||
$('#toggle-button').toggleButtons({
|
||||
onChange: function ($el, status, e) {
|
||||
// $el = $('#toggle-button');
|
||||
// status = [true, false], the value of the checkbox
|
||||
// e = the event
|
||||
console.log($el, status, e);
|
||||
},
|
||||
width: 100,
|
||||
height: 25,
|
||||
font: {
|
||||
'font-size': '20px',
|
||||
'font-style': 'italic'
|
||||
},
|
||||
animated: true,
|
||||
transitionspeed: 1, // Accepted values float or "percent" [ 1, 0.5, "150%" ]
|
||||
label: {
|
||||
enabled: "ON",
|
||||
disabled: "OFF"
|
||||
},
|
||||
style: {
|
||||
// Accepted values ["primary", "danger", "info", "success", "warning"] or nothing
|
||||
enabled: "primary",
|
||||
disabled: "danger",
|
||||
custom: {
|
||||
enabled: {
|
||||
background:"#FF00FF",
|
||||
gradient: "#D300D3",
|
||||
color: "#FFFFFF"
|
||||
},
|
||||
disabled: {
|
||||
background: "#FFAA00",
|
||||
gradient: "#DD9900",
|
||||
color: "#333333"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#toggle-button').toggleButtons('toggleActivation'); // to toggle the disabled status
|
||||
```
|
||||
|
||||
Data Attributes Example
|
||||
-----------------------
|
||||
|
||||
HTML
|
||||
``` html
|
||||
<div id="data-attribute-toggle-button"
|
||||
data-toggleButton-width="170"
|
||||
data-toggleButton-transitionspeed="500%"
|
||||
data-toggleButton-style-custom-enabled-background="#FF0000"
|
||||
data-toggleButton-style-custom-enabled-gradient="#000000">
|
||||
<input type="checkbox" checked="checked">
|
||||
</div>
|
||||
```
|
||||
|
||||
JS
|
||||
``` javascript
|
||||
$('#data-attribute-toggle-button').toggleButtons();
|
||||
```
|
||||
|
||||
Toggle state
|
||||
------------
|
||||
JS
|
||||
``` javascript
|
||||
$('#my-toggle-button').toggleButtons('toggleState');
|
||||
```
|
||||
|
||||
Destroy
|
||||
-------
|
||||
JS
|
||||
``` javascript
|
||||
$('#my-toggle-button').toggleButtons('destroy');
|
||||
```
|
||||
|
||||
Like this project?
|
||||
------------------
|
||||
[](http://coderwall.com/nostalgia)
|
||||
24
modules/lib/chosen/LICENSE.md
Normal file
24
modules/lib/chosen/LICENSE.md
Normal file
@ -0,0 +1,24 @@
|
||||
# Chosen, a Select Box Enhancer for jQuery and Protoype
|
||||
## by Patrick Filler for [Harvest](http://getharvest.com)
|
||||
|
||||
Available for use under the [MIT License](http://en.wikipedia.org/wiki/MIT_License)
|
||||
|
||||
Copyright (c) 2011 by Harvest
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
50
modules/lib/chosen/README.md
Normal file
50
modules/lib/chosen/README.md
Normal file
@ -0,0 +1,50 @@
|
||||
# Chosen
|
||||
|
||||
Chosen is a library for making long, unwieldy select boxes more user friendly.
|
||||
|
||||
- jQuery support: 1.4+
|
||||
- Prototype support: 1.7+
|
||||
|
||||
For documentation, usage, and examples, see:
|
||||
http://harvesthq.github.com/chosen
|
||||
|
||||
### Contributing to Chosen
|
||||
|
||||
Contributions and pull requests are very welcome. Please follow these guidelines when submitting new code.
|
||||
|
||||
1. Make all changes in Coffeescript files, **not** JavaScript files.
|
||||
2. For feature changes, update both jQuery *and* Prototype versions
|
||||
3. Use `npm install -d` to install the correct development dependencies.
|
||||
4. Use `cake build` or `cake watch` to generate Chosen's JavaScript file and minified version.
|
||||
5. Don't touch the `VERSION` file
|
||||
6. Submit a Pull Request using GitHub.
|
||||
|
||||
### Using CoffeeScript & Cake
|
||||
|
||||
First, make sure you have the proper CoffeeScript / Cake set-up in place. We have added a package.json that makes this easy:
|
||||
|
||||
```
|
||||
npm install -d
|
||||
```
|
||||
|
||||
This will install `coffee-script` and `uglifyjs`.
|
||||
|
||||
Once you're configured, building the JavasScript from the command line is easy:
|
||||
|
||||
cake build # build Chosen from source
|
||||
cake watch # watch coffee/ for changes and build Chosen
|
||||
|
||||
If you're interested, you can find the recipes in Cakefile.
|
||||
|
||||
|
||||
### Chosen Credits
|
||||
|
||||
- Built by [Harvest](http://www.getharvest.com/). Want to work on projects like this? [We’re hiring](http://www.getharvest.com/careers)!
|
||||
- Concept and development by [Patrick Filler](http://www.patrickfiller.com/)
|
||||
- Design and CSS by [Matthew Lettini](http://matthewlettini.com/)
|
||||
|
||||
### Notable Forks
|
||||
|
||||
- [Chosen for MooTools](https://github.com/julesjanssen/chosen), by Jules Janssen
|
||||
- [Chosen Drupal 7 Module](http://drupal.org/project/chosen), by Pol Dell'Aiera, Arshad Chummun, Bart Feenstra, Kálmán Hosszu, etc.
|
||||
- [Chosen CakePHP Plugin](https://github.com/paulredmond/chosen-cakephp), by Paul Redmond
|
||||
1
modules/lib/chosen/VERSION
Normal file
1
modules/lib/chosen/VERSION
Normal file
@ -0,0 +1 @@
|
||||
0.9.12
|
||||
BIN
modules/lib/chosen/chosen-sprite.png
Normal file
BIN
modules/lib/chosen/chosen-sprite.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 646 B |
BIN
modules/lib/chosen/chosen-sprite@2x.png
Normal file
BIN
modules/lib/chosen/chosen-sprite@2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 872 B |
378
modules/lib/chosen/chosen.css
Normal file
378
modules/lib/chosen/chosen.css
Normal file
@ -0,0 +1,378 @@
|
||||
/* @group Base */
|
||||
.chzn-container {
|
||||
font-size: 13px;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
zoom: 1;
|
||||
*display: inline;
|
||||
}
|
||||
.chzn-container .chzn-drop {
|
||||
background: #fff;
|
||||
border: 1px solid #ccc;
|
||||
border-top: 0;
|
||||
position: absolute;
|
||||
top: 29px;
|
||||
left: 0;
|
||||
-webkit-box-shadow: 0 4px 5px rgba(0,0,0,.15);
|
||||
-moz-box-shadow : 0 4px 5px rgba(0,0,0,.15);
|
||||
box-shadow : 0 4px 5px rgba(0,0,0,.15);
|
||||
z-index: 1010;
|
||||
}
|
||||
/* @end */
|
||||
|
||||
/* @group Single Chosen */
|
||||
.chzn-container-single .chzn-single {
|
||||
background-color: #ffffff;
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius : 3px;
|
||||
border-radius : 3px;
|
||||
-moz-background-clip : padding;
|
||||
-webkit-background-clip: padding-box;
|
||||
background-clip : padding-box;
|
||||
border: 1px solid #ccc;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
position: relative;
|
||||
height: 28px;
|
||||
line-height: 27px;
|
||||
padding: 0 0 0 8px;
|
||||
color: #444444;
|
||||
text-decoration: none;
|
||||
}
|
||||
.chzn-container-single .chzn-default {
|
||||
color: #999;
|
||||
}
|
||||
.chzn-container-single .chzn-single span {
|
||||
margin-right: 26px;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
-o-text-overflow: ellipsis;
|
||||
-ms-text-overflow: ellipsis;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.chzn-container-single .chzn-single abbr {
|
||||
display: block;
|
||||
position: absolute;
|
||||
right: 26px;
|
||||
top: 9px;
|
||||
width: 13px;
|
||||
height: 12px;
|
||||
font-size: 1px;
|
||||
background: url('chosen-sprite.png') -42px 1px no-repeat;
|
||||
}
|
||||
.chzn-container-single .chzn-single abbr:hover {
|
||||
background-position: -42px -10px;
|
||||
}
|
||||
.chzn-container-single.chzn-disabled .chzn-single abbr:hover {
|
||||
background-position: -42px -10px;
|
||||
}
|
||||
.chzn-container-single .chzn-single div {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
display: block;
|
||||
height: 100%;
|
||||
width: 18px;
|
||||
}
|
||||
.chzn-container-single .chzn-single div b {
|
||||
background: url('chosen-sprite.png') no-repeat 0px 5px;
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.chzn-container-single .chzn-search {
|
||||
padding: 3px 4px;
|
||||
position: relative;
|
||||
margin: 0;
|
||||
white-space: nowrap;
|
||||
z-index: 1010;
|
||||
}
|
||||
.chzn-container-single .chzn-search input {
|
||||
background: #fff url('chosen-sprite.png') no-repeat 100% -20px;
|
||||
background: url('chosen-sprite.png') no-repeat 100% -20px, -webkit-gradient(linear, 0 0, 0 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
|
||||
background: url('chosen-sprite.png') no-repeat 100% -20px, -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
||||
background: url('chosen-sprite.png') no-repeat 100% -20px, -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
||||
background: url('chosen-sprite.png') no-repeat 100% -20px, -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
||||
background: url('chosen-sprite.png') no-repeat 100% -20px, linear-gradient(#eeeeee 1%, #ffffff 15%);
|
||||
margin: 1px 0;
|
||||
padding: 3px 20px 2px 5px;
|
||||
outline: 0;
|
||||
border: 1px solid #aaa;
|
||||
font-family: sans-serif;
|
||||
font-size: 13px;
|
||||
min-height:13px;
|
||||
}
|
||||
.chzn-container-single .chzn-drop {
|
||||
-webkit-border-radius: 0 0 4px 4px;
|
||||
-moz-border-radius : 0 0 4px 4px;
|
||||
border-radius : 0 0 4px 4px;
|
||||
-moz-background-clip : padding;
|
||||
-webkit-background-clip: padding-box;
|
||||
background-clip : padding-box;
|
||||
margin-top:1px;
|
||||
}
|
||||
/* @end */
|
||||
|
||||
.chzn-container-single-nosearch .chzn-search input {
|
||||
position: absolute;
|
||||
left: -9000px;
|
||||
}
|
||||
|
||||
/* @group Multi Chosen */
|
||||
.chzn-container-multi .chzn-choices {
|
||||
background-color: #fff;
|
||||
border: 1px solid #ccc;
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
margin: 0;
|
||||
padding: 0 5px 0 0;
|
||||
cursor: text;
|
||||
overflow: hidden;
|
||||
height: auto !important;
|
||||
height: 1%;
|
||||
position: relative;
|
||||
}
|
||||
.chzn-container-multi .chzn-choices li {
|
||||
float: left;
|
||||
list-style: none;
|
||||
}
|
||||
.chzn-container-multi .chzn-choices .search-field {
|
||||
white-space: nowrap;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.chzn-container-multi .chzn-choices .search-field input {
|
||||
color: #666;
|
||||
background: transparent !important;
|
||||
border: 0 !important;
|
||||
font-family: sans-serif;
|
||||
font-size: 100%;
|
||||
height: 16px;
|
||||
padding: 5px;
|
||||
margin: 1px 0;
|
||||
outline: 0;
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow : none;
|
||||
box-shadow : none;
|
||||
}
|
||||
.chzn-container-multi .chzn-choices .search-field .default {
|
||||
color: #999;
|
||||
}
|
||||
.chzn-container-multi .chzn-choices .search-choice {
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius : 3px;
|
||||
border-radius : 3px;
|
||||
-moz-background-clip : padding;
|
||||
-webkit-background-clip: padding-box;
|
||||
background-clip : padding-box;
|
||||
background-color: #CEE5F5;
|
||||
color: #2B4F62;
|
||||
line-height: 13px;
|
||||
padding: 5px 20px 4px 5px;
|
||||
margin: 3px 0 3px 5px;
|
||||
position: relative;
|
||||
cursor: default;
|
||||
}
|
||||
.chzn-container-multi .chzn-choices .search-choice.search-choice-disabled {
|
||||
background-color: #e4e4e4;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eeeeee', GradientType=0 );
|
||||
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
|
||||
background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
|
||||
background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
|
||||
background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
|
||||
background-image: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
|
||||
background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
|
||||
color: #666;
|
||||
border: 1px solid #cccccc;
|
||||
padding-right: 5px;
|
||||
}
|
||||
.chzn-container-multi .chzn-choices .search-choice-focus {
|
||||
background: #d4d4d4;
|
||||
}
|
||||
.chzn-container-multi .chzn-choices .search-choice .search-choice-close {
|
||||
display: block;
|
||||
position: absolute;
|
||||
right: 3px;
|
||||
top: 6px;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
font-size: 1px;
|
||||
background: url('chosen-sprite.png') -42px 1px no-repeat;
|
||||
}
|
||||
.chzn-container-multi .chzn-choices .search-choice .search-choice-close:hover {
|
||||
background-position: -42px -10px;
|
||||
}
|
||||
.chzn-container-multi .chzn-choices .search-choice-focus .search-choice-close {
|
||||
background-position: -42px -10px;
|
||||
}
|
||||
/* @end */
|
||||
|
||||
/* @group Results */
|
||||
.chzn-container .chzn-results {
|
||||
margin: 0 4px 4px 0;
|
||||
max-height: 240px;
|
||||
padding: 0 0 0 4px;
|
||||
position: relative;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
.chzn-container-multi .chzn-results {
|
||||
margin: -1px 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
.chzn-container .chzn-results li {
|
||||
display: none;
|
||||
line-height: 15px;
|
||||
padding: 5px 6px;
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
}
|
||||
.chzn-container .chzn-results .active-result {
|
||||
cursor: pointer;
|
||||
display: list-item;
|
||||
}
|
||||
.chzn-container .chzn-results .highlighted {
|
||||
background-color: #48A6D2;
|
||||
color: #fff;
|
||||
}
|
||||
.chzn-container .chzn-results li em {
|
||||
background: #feffde;
|
||||
font-style: normal;
|
||||
}
|
||||
.chzn-container .chzn-results .highlighted em {
|
||||
background: transparent;
|
||||
}
|
||||
.chzn-container .chzn-results .no-results {
|
||||
background: #f4f4f4;
|
||||
display: list-item;
|
||||
}
|
||||
.chzn-container .chzn-results .group-result {
|
||||
cursor: default;
|
||||
color: #999;
|
||||
font-weight: bold;
|
||||
}
|
||||
.chzn-container .chzn-results .group-option {
|
||||
padding-left: 15px;
|
||||
}
|
||||
.chzn-container-multi .chzn-drop .result-selected {
|
||||
display: none;
|
||||
}
|
||||
.chzn-container .chzn-results-scroll {
|
||||
background: white;
|
||||
margin: 0 4px;
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
width: 321px; /* This should by dynamic with js */
|
||||
z-index: 1;
|
||||
}
|
||||
.chzn-container .chzn-results-scroll span {
|
||||
display: inline-block;
|
||||
height: 17px;
|
||||
text-indent: -5000px;
|
||||
width: 9px;
|
||||
}
|
||||
.chzn-container .chzn-results-scroll-down {
|
||||
bottom: 0;
|
||||
}
|
||||
.chzn-container .chzn-results-scroll-down span {
|
||||
background: url('chosen-sprite.png') no-repeat -4px -3px;
|
||||
}
|
||||
.chzn-container .chzn-results-scroll-up span {
|
||||
background: url('chosen-sprite.png') no-repeat -22px -3px;
|
||||
}
|
||||
/* @end */
|
||||
|
||||
/* @group Active */
|
||||
.chzn-container-active .chzn-single {
|
||||
}
|
||||
.chzn-container-active .chzn-single-with-drop {
|
||||
border: 1px solid #aaa;
|
||||
-webkit-box-shadow: 0 1px 0 #fff inset;
|
||||
-moz-box-shadow : 0 1px 0 #fff inset;
|
||||
box-shadow : 0 1px 0 #fff inset;
|
||||
background-color: #fff;
|
||||
-webkit-border-bottom-left-radius : 0;
|
||||
-webkit-border-bottom-right-radius: 0;
|
||||
-moz-border-radius-bottomleft : 0;
|
||||
-moz-border-radius-bottomright: 0;
|
||||
border-bottom-left-radius : 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
.chzn-container-active .chzn-single-with-drop div {
|
||||
background: transparent;
|
||||
border-left: none;
|
||||
}
|
||||
.chzn-container-active .chzn-single-with-drop div b {
|
||||
background-position: -18px 5px;
|
||||
}
|
||||
.chzn-container-active .chzn-choices {
|
||||
|
||||
}
|
||||
.chzn-container-active .chzn-choices .search-field input {
|
||||
color: #111 !important;
|
||||
}
|
||||
/* @end */
|
||||
|
||||
/* @group Disabled Support */
|
||||
.chzn-disabled {
|
||||
cursor: default;
|
||||
opacity:0.5 !important;
|
||||
}
|
||||
.chzn-disabled .chzn-single {
|
||||
cursor: default;
|
||||
}
|
||||
.chzn-disabled .chzn-choices .search-choice .search-choice-close {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/* @group Right to Left */
|
||||
.chzn-rtl { text-align: right; }
|
||||
.chzn-rtl .chzn-single { padding: 0 8px 0 0; overflow: visible; }
|
||||
.chzn-rtl .chzn-single span { margin-left: 26px; margin-right: 0; direction: rtl; }
|
||||
|
||||
.chzn-rtl .chzn-single div { left: 3px; right: auto; }
|
||||
.chzn-rtl .chzn-single abbr {
|
||||
left: 26px;
|
||||
right: auto;
|
||||
}
|
||||
.chzn-rtl .chzn-choices .search-field input { direction: rtl; }
|
||||
.chzn-rtl .chzn-choices li { float: right; }
|
||||
.chzn-rtl .chzn-choices .search-choice { padding: 3px 5px 3px 19px; margin: 3px 5px 3px 0; }
|
||||
.chzn-rtl .chzn-choices .search-choice .search-choice-close { left: 4px; right: auto; }
|
||||
.chzn-rtl.chzn-container-single .chzn-results { margin: 0 0 4px 4px; padding: 0 4px 0 0; }
|
||||
.chzn-rtl .chzn-results .group-option { padding-left: 0; padding-right: 15px; }
|
||||
.chzn-rtl.chzn-container-active .chzn-single-with-drop div { border-right: none; }
|
||||
.chzn-rtl .chzn-search input {
|
||||
background: #fff url('chosen-sprite.png') no-repeat -30px -20px;
|
||||
background: url('chosen-sprite.png') no-repeat -30px -20px, -webkit-gradient(linear, 0 0, 0 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
|
||||
background: url('chosen-sprite.png') no-repeat -30px -20px, -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
||||
background: url('chosen-sprite.png') no-repeat -30px -20px, -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
||||
background: url('chosen-sprite.png') no-repeat -30px -20px, -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
||||
background: url('chosen-sprite.png') no-repeat -30px -20px, linear-gradient(#eeeeee 1%, #ffffff 15%);
|
||||
padding: 4px 5px 4px 20px;
|
||||
direction: rtl;
|
||||
}
|
||||
.chzn-container-single.chzn-rtl .chzn-single div b {
|
||||
background-position: 6px 2px;
|
||||
}
|
||||
.chzn-container-single.chzn-rtl .chzn-single-with-drop div b {
|
||||
background-position: -12px 2px;
|
||||
}
|
||||
/* @end */
|
||||
|
||||
/* @group Retina compatibility */
|
||||
@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-resolution: 144dpi) {
|
||||
.chzn-rtl .chzn-search input, .chzn-container-single .chzn-single abbr, .chzn-container-single .chzn-single div b, .chzn-container-single .chzn-search input, .chzn-container-multi .chzn-choices .search-choice .search-choice-close, .chzn-container .chzn-results-scroll-down span, .chzn-container .chzn-results-scroll-up span {
|
||||
background-image: url('chosen-sprite@2x.png') !important;
|
||||
background-repeat: no-repeat !important;
|
||||
background-size: 52px 37px !important;
|
||||
}
|
||||
}
|
||||
/* @end */
|
||||
|
||||
.chzn-container, .chzn-container-single .chzn-drop,.chzn-container .chzn-drop {max-width:100%}
|
||||
.chzn-container-single .chzn-search input {max-width:94%}
|
||||
1089
modules/lib/chosen/chosen.jquery.js
Normal file
1089
modules/lib/chosen/chosen.jquery.js
Normal file
File diff suppressed because it is too large
Load Diff
10
modules/lib/chosen/chosen.jquery.min.js
vendored
Normal file
10
modules/lib/chosen/chosen.jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
318
modules/lib/colorbox/README.md
Normal file
318
modules/lib/colorbox/README.md
Normal file
@ -0,0 +1,318 @@
|
||||
## About ColorBox:
|
||||
A customizable lightbox plugin for jQuery. See the [project page](http://jacklmoore.com/colorbox/) for documentation and a demonstration, and the [FAQ](http://jacklmoore.com/colorbox/faq/) for solutions and examples to common issues. Released under the [MIT license](http://www.opensource.org/licenses/mit-license.php).
|
||||
|
||||
## Changelog:
|
||||
|
||||
### Version 1.3.19 - December 08 2011
|
||||
Files Changed:jquery.colorbox.js/jquery.colorbox-min.js, colorbox.css (all)
|
||||
|
||||
* Fixed bug related to using the 'fixed' property.
|
||||
* Optimized the setup procedure to be more efficient.
|
||||
* Removed $.colorbox.init() as it will no longer be needed (will self-init when called).
|
||||
* Removed use of $.browser.
|
||||
|
||||
### Version 1.3.18 - October 07 2011
|
||||
Files Changed:jquery.colorbox.js/jquery.colorbox-min.js, colorbox.css (all) and example 1's controls.png
|
||||
|
||||
* Fixed a regression where Flash content displayed in ColorBox would be reloaded if the browser window was resized.
|
||||
* Added safety check to make sure that ColorBox's markup is only added to the DOM a single time, even if $.colorbox.init() is called multiple times. This will allow site owners to manually initialize ColorBox if they need it before the DOM has finished loading.
|
||||
* Updated the example index.html files to be HTML5 compliant.
|
||||
* Changed the slideshow behavior so that it immediately moves to the next slide when the slideshow is started.
|
||||
* Minor regex bugfix to allow automatic detection of image URLs that include fragments.
|
||||
|
||||
### Version 1.3.17 - May 11 2011
|
||||
Files Changed:jquery.colorbox.js/jquery.colorbox-min.js
|
||||
|
||||
* Added properties "top", "bottom", "left" and "right" to specify a position relative to the viewport, rather than using the default centering.
|
||||
* Added property "data" to specify GET or POST data when using Ajax. ColorBox's ajax functionality is handled by jQuery's .load() method, so the data property works the same way as it does with .load().
|
||||
* Added property "fixed" which can provide fixed positioning for ColorBox, rather than absolute positioning. This will allow ColorBox to remain in a fixed position within the visitors viewport, despite scrolling. IE6 support for this was not added, it will continue to use the default absolute positioning.
|
||||
* Fixed ClearType problem with IE7.
|
||||
* Minor fixes.
|
||||
|
||||
### Version 1.3.16 - March 01 2011
|
||||
Files Changed:jquery.colorbox.js/jquery.colorbox-min.js, colorbox.css (all) and example 4 background png files
|
||||
|
||||
* Better IE related transparency workarounds. IE7 and up now uses the same background image sprite as other browsers.
|
||||
* Added error handling for broken image links. A message will be displayed telling the user that the image could not be loaded.
|
||||
* Added new property: 'fastIframe' and set it to true by default. Setting to fastIframe:false will delay the loading graphic removal and onComplete event until iframe has completely loaded.
|
||||
* Ability to redefine $.colorbox.close (or prev, or next) at any time.
|
||||
|
||||
### Version 1.3.15 - October 27 2010
|
||||
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
|
||||
|
||||
* Minor fixes for specific cases.
|
||||
|
||||
### Version 1.3.14 - October 27 2010
|
||||
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
|
||||
|
||||
* In IE6, closing an iframe when using HTTPS no longer generates a security warning.
|
||||
|
||||
### Version 1.3.13 - October 22 2010
|
||||
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
|
||||
|
||||
* Changed the index.html example files to use YouTube's new embedded link format.
|
||||
* By default, ColorBox returns focus to the element it was launched from once it closes. This can now be disabled by setting the 'returnFocus' property to false. Focus was causing problems for some users who had their anchor elements inside animated containers.
|
||||
* Minor bug fix involved in using a combination of slideshow and non-slideshow content.
|
||||
|
||||
### Version 1.3.12 - October 20 2010
|
||||
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
|
||||
|
||||
* Minor bug fix involved in preloading images when using a function as a value for the href property.
|
||||
|
||||
### Version 1.3.11 - October 19 2010
|
||||
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
|
||||
|
||||
* Fixed the slideshow functionality that broke with 1.3.10
|
||||
* The slideshow now respects the loop property.
|
||||
|
||||
### Version 1.3.10 - October 16 2010
|
||||
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
|
||||
|
||||
* Fixed compatibility with jQuery 1.4.3
|
||||
* The 'open' property now accepts a function as a value, like all of the other properties.
|
||||
* Preloading now loads the correct href for images when using a dynamic (function) value for the href property.
|
||||
* Fixed bug in Safari 3 for Win where ColorBox centered on the document, rather than the visitor's viewport.
|
||||
* May have fixed an issue in Opera 10.6+ where ColorBox would rarely/randomly freeze up while switching between photos in a group.
|
||||
* Some functionality better encapsulated & minor performance improvements.
|
||||
|
||||
### Version 1.3.9 - July 7 2010
|
||||
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js/ all colorbox.css (the core styles)
|
||||
|
||||
* Fixed a problem where iframed youtube videos would cause a security alert in IE.
|
||||
* More code is event driven now, making the source easier to grasp.
|
||||
* Removed some unnecessary style from the core CSS.
|
||||
|
||||
### Version 1.3.8 - June 21 2010
|
||||
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
|
||||
|
||||
* Fixed a bug in Chrome where it would sometimes render photos at 0 by 0 width and height (behavior introduced in recent update to Chrome).
|
||||
* Fixed a bug where the onClosed callback would fire twice (only affected 1.3.7).
|
||||
* Fixed a bug in IE7 that existed with some iframed websites that use JS to reposition the viewport caused ColorBox to move out of position.
|
||||
* Abstracted the identifiers (HTML ids & classes, and JS plugin name, method, and events) so that the plugin can be easily rebranded.
|
||||
* Small changes to improve either code readability or compression.
|
||||
|
||||
### Version 1.3.7 - June 13 2010
|
||||
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js/index.html
|
||||
|
||||
* $.colorbox can now be used for direct calls and accessing public methods. Example: $.colorbox.close();
|
||||
* Resize now accepts 'width', 'innerWidth', 'height' and 'innerHeight'. Example: $.colorbox.resize({width:"100%"})
|
||||
* Added option (loop:false) to disable looping in a group.
|
||||
* Added options (escKey:false, arrowKey:false) to disable esc-key and arrow-key bindings.
|
||||
* Added method for removing ColorBox from a document: $.colorbox.remove();
|
||||
* Fixed a bug where iframed URLs would be truncated if they contained an unencoded apostrophe.
|
||||
* Now uses the exact href specified on an anchor, rather than the version returned by 'this.href'. This was causing "#example" to be normalized to "http://domain/#example" which interfered with how some users were setting up links to inline content.
|
||||
* Changed example documents over to HTML5.
|
||||
|
||||
### Version 1.3.6 - Jan 13 2010
|
||||
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
|
||||
|
||||
* Small change to make ColorBox compatible with jQuery 1.4
|
||||
|
||||
### Version 1.3.5 - December 15 2009
|
||||
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
|
||||
|
||||
* Fixed a bug introduced in 1.3.4 with IE7's display of example 2 and 3, and auto-width in Opera.
|
||||
* Fixed a bug introduced in 1.3.4 where colorbox could not be launched by triggering an element's click event through JavaScript.
|
||||
* Minor refinements.
|
||||
|
||||
### Version 1.3.4 - December 5 2009
|
||||
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
|
||||
|
||||
* Event delegation is now used for elements that ColorBox is assigned to, rather than individual click events.
|
||||
* Additional callbacks have been added to represent other stages of ColorBox's lifecycle. Available callbacks, in order of their execution: onOpen, onLoad, onComplete, onCleanup, onClosed These take place at the same time as the event hooks, but will be better suited than the hooks for targeting specific instances of ColorBox.
|
||||
* Ajax content is now immediately added to the DOM to be more compatible if that content contains script tags.
|
||||
* Focus is now returned to the calling element on closing.
|
||||
* Fixed a bug where maxHeight and maxWidth did not work for non-photo content.
|
||||
* Direct calls no longer need 'open:true', it is assumed. Example: `$.fn.colorbox({html:'<p>Hi</p>'});`
|
||||
|
||||
### Version 1.3.3 - November 7 2009
|
||||
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
|
||||
|
||||
* Changed $.fn.colorbox.element() to return a jQuery object rather the DOM element.
|
||||
* jQuery.colorbox-min.js is compressed with Google's Closure Compiler rather than YUI Compressor.
|
||||
|
||||
### Version 1.3.2 - October 27 2009
|
||||
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
|
||||
|
||||
* Added 'innerWidth' and 'innerHeight' options to allow people to easily set the size dimensions for ColorBox, without having to anticipate the size of the borders and buttons.
|
||||
* Renamed 'scrollbars' option to 'scrolling' to be in keeping with the existing HTML attribute. The option now also applies to iframes.
|
||||
* Bug fix: In Safari, positioning occassionally incorrect when using '100%' dimensions.
|
||||
* Bug fix: In IE6, the background overlay is briefly not full size when first viewing.
|
||||
* Bug fix: In Firefox, opening ColorBox causes a split second shift with a small minority of webpage layouts.
|
||||
* Simplified code in a few areas.
|
||||
|
||||
### Version 1.3.1 - September 16 2009
|
||||
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js/colorbox.css/colorbox-ie.css(removed)
|
||||
|
||||
* Removed the IE-only stylesheets and conditional comments for example styles 1 & 4. All CSS is handled by a single CSS file for all examples.
|
||||
* Removed user-agent sniffing from the js and replaced it with feature detection. This will allow correct rendering for visitors masking their agent type.
|
||||
|
||||
### Version 1.3.0 - September 15 2009
|
||||
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js/colorbox.css
|
||||
|
||||
* Added $.fn.colorbox.resize() method to allow ColorBox to resize it's height if it's contents change.
|
||||
* Added 'scrollbars' option to allow users to turn off scrollbars when using the resize() method.
|
||||
* Renamed the 'resize' option to be less ambiguous. It's now 'scalePhotos'.
|
||||
* Renamed the 'cbox_close' event to be less ambiguous. It's now 'cbox_cleanup'. It is the first thing to happen in the close method while the 'cbox_closed' event is the last to happen.
|
||||
* Fixed a bug with the slideshow mouseover graphics that appeared after ColorBox is opened a 2nd time.
|
||||
* Fixed a bug where ClearType may not work in IE6&7 if using the fade transition.
|
||||
* Minor code optimizations to increase compression.
|
||||
|
||||
### Version 1.2.9 - August 7 2009
|
||||
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
|
||||
|
||||
* Minor change to enable use with $.getScript();
|
||||
* Minor change to the timing of the 'cbox_load' event so that it is more useful.
|
||||
* Added a direct link to a YouTube video to the examples.
|
||||
|
||||
### Version 1.2.8 - August 5 2009
|
||||
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
|
||||
|
||||
* Fixed a bug with the overlay in IE6
|
||||
* Fixed a bug where left & right keypress events might be prematurely unbound.
|
||||
|
||||
### Version 1.2.7 - July 31 2009
|
||||
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js, example stylesheets and background images (core styles have not changed and the updates will not affect existing user themes / old example themes)
|
||||
|
||||
* Code cleanup and reduction, better organization and documentation in the full source.
|
||||
* Added ability to use functions in place of static values for ColorBox's options (thanks Ken!).
|
||||
* Added an option for straight HTML. Example: `$.fn.colorbox({html:'<p>Howdy</p>', open:true})`
|
||||
* Added an event for the beginning of the closing process. This is in addition to the event that already existed for when ColorBox had completely closed. 'cbox_close' and 'cbox_closed' respectively.
|
||||
* Fixed a minor bug in IE6 that would cause a brief content shift in the parent document when opening ColorBox.
|
||||
* Fixed a minor bug in IE6 that would reveal select elements that had a hidden visibility after closing ColorBox.
|
||||
* The 'esc' key is unbound now when ColorBox is not open, to avoid any potential conflicts.
|
||||
* Used background sprites for examples 1 & 4. Put IE-only (non-sprite) background images in a separate folder.
|
||||
* Example themes 1, 3, & 4 received slight visual tweaks.
|
||||
* Optimized pngs for smaller file size.
|
||||
* Added slices, grid, and correct sizing to the Adobe Illustrator file, all theme files are now export ready!
|
||||
|
||||
### Version 1.2.6 - July 15 2009
|
||||
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
|
||||
|
||||
* Fixed a bug with fixed width/height images in Opera 9.64.
|
||||
* Fixed a bug with trying to set a value for rel during a direct call to ColorBox. Example: `$.fn.colorbox({rel:'foo', open:true});`
|
||||
* Changed how href/rel/title settings are determined to avoid users having to manually update ColorBox settings if they use JavaScript to update any of those attributes, after ColorBox has been defined.
|
||||
* Fixed a FF3 bug where the back button was disabled after closing an iframe.
|
||||
|
||||
### Version 1.2.5 - June 23 2009
|
||||
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
|
||||
|
||||
* Changed the point at which iframe srcs are set (to eliminate the need to refresh the iframe once it has been added to the DOM).
|
||||
* Removed unnecessary return values for a very slight code reduction.
|
||||
|
||||
### Version 1.2.4 - June 9 2009
|
||||
Files Changed: jquery.colorbox.js, jquery.colorbox-min.js
|
||||
|
||||
* Fixed an issue where ColorBox may not close completely if it is closed during a transition animation.
|
||||
* Minor code reduction.
|
||||
|
||||
### Version 1.2.3 - June 4 2009
|
||||
* Fixed a png transparency stacking issue in IE.
|
||||
* More accurate Ajax auto-sizing if the user was depending on the #cboxLoadedContent ID for CSS styling.
|
||||
* Added a public function for returning the current html element that ColorBox is associated with. Example use: var that = $.fn.colorbox.element();
|
||||
* Added bicubic scaling for resized images in the original IE7.
|
||||
* Removed the IE6 stylesheet and png files from Example 3. It now uses the same png file for the controls that the rest of the browsers use (an alpha transparency PNG8). This example now only has 2 graphics files and 1 stylesheet.
|
||||
|
||||
### Version 1.2.2 - May 28 2009
|
||||
* Fixed an issue with the 'resize' option.
|
||||
|
||||
### Version 1.2.1 - May 28 2009
|
||||
* Note: If you are upgrading, update your jquery.colorbox.js and colorbox.css files.
|
||||
* Added photo resizing.
|
||||
* Added a maximum width and maximum height. Example: {height:800, maxHeight:'100%'}, would allow the box to be a maximum potential height of 800px, instead of a fixed height of 800px. With maxHeight of 100% the height of ColorBox cannot exceed the height of the browser window.
|
||||
* Added 'rel' setting to add the ability to set an alternative rel for any ColorBox call. This allows the user to group any combination of elements together for a gallery, or to override an existing rel. attribute so those element are not grouped together, without having to alter their rel in the HTML.
|
||||
* Added a 'photo' setting to force ColorBox to display a link as a photo. Use this when automatic photo detection fails (such as using a url like 'photo.php' instead of 'photo.jpg', 'photo.jpg#1', or 'photo.jpg?pic=1')
|
||||
* Removed the need to ever create disposable elements to call colorbox on. ColorBox can now be called directly, without being associated with any existing element, by using the following format:
|
||||
`$.fn.colorbox({open:true, href:'yourLink.xxx'});`
|
||||
* ColorBox settings are now persistent and unique for each element. This allows for extremely flexible options for individual elements. You could use this to create a gallery in which each page in the gallery has different settings. One could be a photo with a fade transition, next could be an inline element with an elastic transition with a set width and height, etc.
|
||||
* For user callbacks, 'this' now refers to the element colorbox was opened from.
|
||||
* Fixed a minor grouping issue with IE6, when transition type is set to 'none'.
|
||||
* Added an Adobe Illustrator file that contains the borders and buttons used in the various examples.
|
||||
|
||||
### Version 1.2 - May 13 2009
|
||||
* Added a slideshow feature.
|
||||
* Added re-positioning on browser resize. If the browser is resized, ColorBox will recenter itself onscreen.
|
||||
* Added hooks for key events: cbox_open, cbox_load, cbox_complete, cbox_closed.
|
||||
* Fixed an IE transparency-stacking problem, where transparent PNGs would show through to the background overlay.
|
||||
* Fixed an IE iframe issue where the ifame might shift up and to the left under certain circumstances.
|
||||
* Fixed an IE6 bug where the loading overlay was not at full height.
|
||||
* Removed the delay in switching between same-sized gallery content when using transitions.
|
||||
* Changed how iframes are loaded to make it more compatible with iframed pages that use DOM dependent JavaScript.
|
||||
* Changed how the JS is structured to be better organized and increase compression. Increased documentation.
|
||||
* Changed CSS :hover states to a .hover class. This sidesteps a minor IE8 bug with css hover states and allows easier access to hover state user styles from the JavaScript.
|
||||
* Changed: elements added to the DOM have new ID's. The naming is more consistent and less likely to cause conflicts with existing website stylesheets. All stylesheets have been updated.
|
||||
* Changed the behavior for prev/next links so that ColorBox does not get hung up on broken links. A visitor can now skip through broken or long-loading links by clicking prev/next buttons.
|
||||
* Changed the naming of variables in the parameter map to be more concise and intuitive.
|
||||
* Removed colorbox.css. Combined the colorbox.css styles with jquery.colorbox.js: the css file was not large enough to warrant being a separate file.
|
||||
|
||||
### Version 1.1.6 - April 28 2009
|
||||
* Prevented the default action of the next & previous anchors and the left and right keys for gallery mode.
|
||||
* Fixed a bug where the title element was being added back to the DOM when closing ColorBox while using inline content.
|
||||
* Fixed a bug where IE7 would crash for example 2.
|
||||
* Smaller filesize: removed a small amount of unused code and rewrote the HTML injection with less syntax.
|
||||
* Added a public method for closing ColorBox: $.fn.colorbox.close(). This will allow iframe users to add an event to close ColorBox without having to create an additional function.
|
||||
|
||||
### Version 1.1.5 - April 11 2009
|
||||
* Fixed minor issues with exiting ColorBox.
|
||||
|
||||
### Version 1.1.4 - April 08 2009
|
||||
* Fixed a bug in the fade transition where ColorBox not close completely if instructed to close during the fade-in portion of the transition.
|
||||
|
||||
### Version 1.1.3 - April 06 2009
|
||||
* Fixed an IE6&7 issue with using ColorBox to display animated GIFs.
|
||||
|
||||
### Version 1.1.2 - April 05 2009
|
||||
* Added ability to change content when ColorBox is already open.
|
||||
* Added vertical photo centering now works for all browsers (this feature previously excluded IE6&7).
|
||||
* Added namespacing to the esc-key keydown event for people who want to disable it: "keydown.colorClose"
|
||||
* Added 'title' setting to add the ability to set an alternative title for any ColorBox call.
|
||||
* Fixed rollover navigation issue with IE8. (Added JS-based rollover state due to a browser-bug.)
|
||||
* Fixed an overflow issue for when the fixed width/height is smaller than the size of a photo.
|
||||
* Fixed a bug in the fade transition where the border would still come up if ColorBox was closed mid-transition.
|
||||
* Switch from JSMin to Yui Compressor for minification. Minified code now under 7KB.
|
||||
|
||||
### Version 1.1.1 - March 31 2009
|
||||
* More robust image detection regex. Now detects image file types with url fragments and/or query strings.
|
||||
* Added 'nofollow' exception to rel grouping.
|
||||
* Changed how images are loaded into the DOM to prevent premature size calculation by ColorBox.
|
||||
* Added timestamp to iframe name to prevent caching - this was a problem in some browsers if the user had multiple iframes and the visitor left the page and came back, or if they refreshed the page.
|
||||
|
||||
### Version 1.1.0 - March 21 2009
|
||||
* Animation is now much smoother and less resource intensive.
|
||||
* Added support for % sizing.
|
||||
* Callback option added.
|
||||
* Inline content now preserves JavaScript events, and changes made while ColorBox is open are also preserved.
|
||||
* Added 'href' setting to add the ability to set an alternative href for any anchor, or to assign the ColorBox event to non-anchors.
|
||||
Example: $('button').colorbox({'href':'process.php'})
|
||||
Example: $('a[href='http://msn.com']).colorbox({'href':'http://google.com', iframe:true});
|
||||
* Photos are now horizontally centered if they are smaller than the lightbox size. Also vertically centered for browsers newer than IE7.
|
||||
* Buttons in the examples are now included in the 'protected zone'. The lightbox will never expand it's borders or buttons beyond an accessible area of the screen.
|
||||
* Keypress events don't queue up by holding down the arrow keys.
|
||||
* Added option to close ColorBox by clicking on the background overlay.
|
||||
* Added 'none' transition setting.
|
||||
* Changed 'contentIframe' and 'contentInline' to 'inline' and 'iframe'. Removed 'contentAjax' because it is automatically assumed for non-image file types.
|
||||
* Changed 'contentWidth' and 'contentHeight' to 'fixedWidth' and 'fixedHeight'. These sizes now reflect the total size of the lightbox, not just the inner content. This is so users can accurately anticipate % sizes without fear of creating scrollbars.
|
||||
* Clicking on a photo will now switch to the next photo in a set.
|
||||
* Loading.gif is more stable in it's position.
|
||||
* Added a minified version.
|
||||
* Code passes JSLint.
|
||||
|
||||
### Version 1.0.5 - March 11 2009
|
||||
* Redo: Fixed a bug where IE would cut off the bottom portion of a photo, if the photo was larger than the document dimensions.
|
||||
|
||||
### Version 1.0.4 - March 10 2009
|
||||
* Added an option to allow users to automatically open the lightbox. Example usage: $(".colorbox").colorbox({open:true});
|
||||
* Fixed a bug where IE would cut off the bottom portion of a photo, if the photo was larger than the document dimensions.
|
||||
|
||||
### Version 1.0.3 - March 09 2009
|
||||
* Fixed vertical centering for Safari 3.0.x.
|
||||
|
||||
### Version 1.0.2 - March 06 2009
|
||||
* Corrected a typo.
|
||||
* Changed the content-type check so that it does not assume all links to photos should actually display photos. This allows for Ajax/inline/and iframe calls on anchors linking to picture file types.
|
||||
|
||||
### Version 1.0.1 - March 05 2009
|
||||
* Fixed keydown events (esc, left arrow, right arrow) for Webkit browsers.
|
||||
|
||||
### Version 1.0 - March 03 2009
|
||||
* First release
|
||||
50
modules/lib/colorbox/colorbox.css
Normal file
50
modules/lib/colorbox/colorbox.css
Normal file
@ -0,0 +1,50 @@
|
||||
/*
|
||||
ColorBox Core Style:
|
||||
The following CSS is consistent between example themes and should not be altered.
|
||||
*/
|
||||
#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
|
||||
#cboxOverlay{position:fixed; width:100%; height:100%;}
|
||||
#cboxMiddleLeft, #cboxBottomLeft{clear:left;}
|
||||
#cboxContent{position:relative;}
|
||||
#cboxLoadedContent{overflow:auto;}
|
||||
#cboxTitle{margin:0;}
|
||||
#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
|
||||
#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
|
||||
.cboxPhoto{float:left; margin:auto; border:0; display:block;}
|
||||
.cboxIframe{width:100%; height:100%; display:block; border:0;}
|
||||
#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box;}
|
||||
|
||||
/*
|
||||
User Style:
|
||||
Change the following styles to modify the appearance of ColorBox. They are
|
||||
ordered & tabbed in a way that represents the nesting of the generated HTML.
|
||||
*/
|
||||
#cboxOverlay{background:#777}
|
||||
#colorbox{}
|
||||
#cboxContent{margin-top:32px; overflow:visible;}
|
||||
.cboxIframe{background:#fff;}
|
||||
#cboxError{padding:50px; border:1px solid #ccc;}
|
||||
#cboxLoadedContent{border:8px solid rgba(0,0,0,.5);-webkit-border-radius: 6px;-moz-border-radius: 6px;-ms-border-radius: 6px;border-radius: 6px;display:none}
|
||||
#cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;}
|
||||
#cboxLoadingOverlay{background: #000;background: rgba(0,0,0,.5);-webkit-border-radius: 6px;-moz-border-radius: 6px;-ms-border-radius: 6px;border-radius: 6px}
|
||||
#cboxTitle{position:absolute; top:-22px; left:0; color:#000;background:#000;background: rgba(0,0,0,.5);-webkit-border-radius: 4px;-moz-border-radius: 4px;-ms-border-radius: 4px;border-radius: 4px;color:#fff;font-size:11px;padding:0 6px}
|
||||
#cboxCurrent{position:absolute; top:-22px; right:205px; text-indent:-9999px;}
|
||||
|
||||
#cboxPrevious, #cboxNext,#cboxSlideshow, #cboxClose{width:20px;height:20px;top:-22px;text-indent:-9999px; position:absolute; background: #fff url(images/controls.png) no-repeat 0 0; background: rgba(255,255,255,.6) url(images/controls.png) no-repeat 0 0;-webkit-border-radius: 4px;-moz-border-radius: 4px;-ms-border-radius: 4px;border-radius: 4px}
|
||||
#cboxPrevious:hover, #cboxNext:hover,#cboxSlideshow:hover, #cboxClose:hover {background-color: rgba(255,255,255,.8)}
|
||||
|
||||
#cboxPrevious{background-position:0 -1px; right:56px}
|
||||
#cboxPrevious:hover{background-position:0 -26px}
|
||||
#cboxNext{background-position:-25px -1px; right:32px}
|
||||
#cboxNext:hover{background-position:-25px -26px}
|
||||
|
||||
#cboxClose{background-position:-50px -1px;right:0}
|
||||
#cboxClose:hover{background-position:-50px -26px}
|
||||
|
||||
#cboxSlideshow {right:90px}
|
||||
.cboxSlideshow_on #cboxSlideshow{background-position:-75px -1px}
|
||||
.cboxSlideshow_on #cboxSlideshow:hover{background-position:-75px -26px}
|
||||
.cboxSlideshow_off #cboxSlideshow{background-position:-100px -1px}
|
||||
.cboxSlideshow_off #cboxSlideshow:hover{background-position:-100px -26px}
|
||||
|
||||
.cbox_content {background:#fff;padding:20px}
|
||||
993
modules/lib/colorbox/jquery.colorbox.js
Normal file
993
modules/lib/colorbox/jquery.colorbox.js
Normal file
@ -0,0 +1,993 @@
|
||||
/*!
|
||||
jQuery ColorBox v1.3.34 - 2013-02-04
|
||||
(c) 2013 Jack Moore - jacklmoore.com/colorbox
|
||||
license: http://www.opensource.org/licenses/mit-license.php
|
||||
*/
|
||||
(function ($, document, window) {
|
||||
var
|
||||
// Default settings object.
|
||||
// See http://jacklmoore.com/colorbox for details.
|
||||
defaults = {
|
||||
transition: "elastic",
|
||||
speed: 300,
|
||||
width: false,
|
||||
initialWidth: "600",
|
||||
innerWidth: false,
|
||||
maxWidth: false,
|
||||
height: false,
|
||||
initialHeight: "450",
|
||||
innerHeight: false,
|
||||
maxHeight: false,
|
||||
scalePhotos: true,
|
||||
scrolling: true,
|
||||
inline: false,
|
||||
html: false,
|
||||
iframe: false,
|
||||
fastIframe: true,
|
||||
photo: false,
|
||||
href: false,
|
||||
title: false,
|
||||
rel: false,
|
||||
opacity: 0.9,
|
||||
preloading: true,
|
||||
className: false,
|
||||
|
||||
// alternate image paths for high-res displays
|
||||
retinaImage: false,
|
||||
retinaUrl: false,
|
||||
retinaSuffix: '@2x.$1',
|
||||
|
||||
// internationalization
|
||||
current: "image {current} of {total}",
|
||||
previous: "previous",
|
||||
next: "next",
|
||||
close: "close",
|
||||
xhrError: "This content failed to load.",
|
||||
imgError: "This image failed to load.",
|
||||
|
||||
open: false,
|
||||
returnFocus: true,
|
||||
reposition: true,
|
||||
loop: true,
|
||||
slideshow: false,
|
||||
slideshowAuto: true,
|
||||
slideshowSpeed: 2500,
|
||||
slideshowStart: "start slideshow",
|
||||
slideshowStop: "stop slideshow",
|
||||
photoRegex: /\.(gif|png|jp(e|g|eg)|bmp|ico)((#|\?).*)?$/i,
|
||||
|
||||
onOpen: false,
|
||||
onLoad: false,
|
||||
onComplete: false,
|
||||
onCleanup: false,
|
||||
onClosed: false,
|
||||
overlayClose: true,
|
||||
escKey: true,
|
||||
arrowKey: true,
|
||||
top: false,
|
||||
bottom: false,
|
||||
left: false,
|
||||
right: false,
|
||||
fixed: false,
|
||||
data: undefined
|
||||
},
|
||||
|
||||
// Abstracting the HTML and event identifiers for easy rebranding
|
||||
colorbox = 'colorbox',
|
||||
prefix = 'cbox',
|
||||
boxElement = prefix + 'Element',
|
||||
|
||||
// Events
|
||||
event_open = prefix + '_open',
|
||||
event_load = prefix + '_load',
|
||||
event_complete = prefix + '_complete',
|
||||
event_cleanup = prefix + '_cleanup',
|
||||
event_closed = prefix + '_closed',
|
||||
event_purge = prefix + '_purge',
|
||||
|
||||
// Special Handling for IE
|
||||
isIE = !$.support.leadingWhitespace, // IE6 to IE8
|
||||
isIE6 = isIE && !window.XMLHttpRequest, // IE6
|
||||
event_ie6 = prefix + '_IE6',
|
||||
|
||||
// Cached jQuery Object Variables
|
||||
$overlay,
|
||||
$box,
|
||||
$wrap,
|
||||
$content,
|
||||
$topBorder,
|
||||
$leftBorder,
|
||||
$rightBorder,
|
||||
$bottomBorder,
|
||||
$related,
|
||||
$window,
|
||||
$loaded,
|
||||
$loadingBay,
|
||||
$loadingOverlay,
|
||||
$title,
|
||||
$current,
|
||||
$slideshow,
|
||||
$next,
|
||||
$prev,
|
||||
$close,
|
||||
$groupControls,
|
||||
$events = $({}),
|
||||
|
||||
// Variables for cached values or use across multiple functions
|
||||
settings,
|
||||
interfaceHeight,
|
||||
interfaceWidth,
|
||||
loadedHeight,
|
||||
loadedWidth,
|
||||
element,
|
||||
index,
|
||||
photo,
|
||||
open,
|
||||
active,
|
||||
closing,
|
||||
loadingTimer,
|
||||
publicMethod,
|
||||
div = "div",
|
||||
className,
|
||||
init;
|
||||
|
||||
// ****************
|
||||
// HELPER FUNCTIONS
|
||||
// ****************
|
||||
|
||||
// Convience function for creating new jQuery objects
|
||||
function $tag(tag, id, css) {
|
||||
var element = document.createElement(tag);
|
||||
|
||||
if (id) {
|
||||
element.id = prefix + id;
|
||||
}
|
||||
|
||||
if (css) {
|
||||
element.style.cssText = css;
|
||||
}
|
||||
|
||||
return $(element);
|
||||
}
|
||||
|
||||
// Determine the next and previous members in a group.
|
||||
function getIndex(increment) {
|
||||
var
|
||||
max = $related.length,
|
||||
newIndex = (index + increment) % max;
|
||||
|
||||
return (newIndex < 0) ? max + newIndex : newIndex;
|
||||
}
|
||||
|
||||
// Convert '%' and 'px' values to integers
|
||||
function setSize(size, dimension) {
|
||||
return Math.round((/%/.test(size) ? ((dimension === 'x' ? $window.width() : $window.height()) / 100) : 1) * parseInt(size, 10));
|
||||
}
|
||||
|
||||
// Checks an href to see if it is a photo.
|
||||
// There is a force photo option (photo: true) for hrefs that cannot be matched by the regex.
|
||||
function isImage(url) {
|
||||
return settings.photo || settings.photoRegex.test(url);
|
||||
}
|
||||
|
||||
function retinaUrl(url) {
|
||||
return settings.retinaUrl && window.devicePixelRatio > 1 ? url.replace(settings.photoRegex, settings.retinaSuffix) : url;
|
||||
}
|
||||
|
||||
// Assigns function results to their respective properties
|
||||
function makeSettings() {
|
||||
var i,
|
||||
data = $.data(element, colorbox);
|
||||
|
||||
if (data == null) {
|
||||
settings = $.extend({}, defaults);
|
||||
if (console && console.log) {
|
||||
console.log('Error: cboxElement missing settings object');
|
||||
}
|
||||
} else {
|
||||
settings = $.extend({}, data);
|
||||
}
|
||||
|
||||
for (i in settings) {
|
||||
if ($.isFunction(settings[i]) && i.slice(0, 2) !== 'on') { // checks to make sure the function isn't one of the callbacks, they will be handled at the appropriate time.
|
||||
settings[i] = settings[i].call(element);
|
||||
}
|
||||
}
|
||||
|
||||
settings.rel = settings.rel || element.rel || $(element).data('rel') || 'nofollow';
|
||||
settings.href = settings.href || $(element).attr('href');
|
||||
settings.title = settings.title || element.title;
|
||||
|
||||
if (typeof settings.href === "string") {
|
||||
settings.href = $.trim(settings.href);
|
||||
}
|
||||
}
|
||||
|
||||
function trigger(event, callback) {
|
||||
// for external use
|
||||
$(document).trigger(event);
|
||||
|
||||
// for internal use
|
||||
$events.trigger(event);
|
||||
|
||||
if ($.isFunction(callback)) {
|
||||
callback.call(element);
|
||||
}
|
||||
}
|
||||
|
||||
// Slideshow functionality
|
||||
function slideshow() {
|
||||
var
|
||||
timeOut,
|
||||
className = prefix + "Slideshow_",
|
||||
click = "click." + prefix,
|
||||
clear,
|
||||
set,
|
||||
start,
|
||||
stop;
|
||||
|
||||
if (settings.slideshow && $related[1]) {
|
||||
clear = function () {
|
||||
clearTimeout(timeOut);
|
||||
};
|
||||
|
||||
set = function () {
|
||||
if (settings.loop || $related[index + 1]) {
|
||||
timeOut = setTimeout(publicMethod.next, settings.slideshowSpeed);
|
||||
}
|
||||
};
|
||||
|
||||
start = function () {
|
||||
$slideshow
|
||||
.html(settings.slideshowStop)
|
||||
.unbind(click)
|
||||
.one(click, stop);
|
||||
|
||||
$events
|
||||
.bind(event_complete, set)
|
||||
.bind(event_load, clear)
|
||||
.bind(event_cleanup, stop);
|
||||
|
||||
$box.removeClass(className + "off").addClass(className + "on");
|
||||
};
|
||||
|
||||
stop = function () {
|
||||
clear();
|
||||
|
||||
$events
|
||||
.unbind(event_complete, set)
|
||||
.unbind(event_load, clear)
|
||||
.unbind(event_cleanup, stop);
|
||||
|
||||
$slideshow
|
||||
.html(settings.slideshowStart)
|
||||
.unbind(click)
|
||||
.one(click, function () {
|
||||
publicMethod.next();
|
||||
start();
|
||||
});
|
||||
|
||||
$box.removeClass(className + "on").addClass(className + "off");
|
||||
};
|
||||
|
||||
if (settings.slideshowAuto) {
|
||||
start();
|
||||
} else {
|
||||
stop();
|
||||
}
|
||||
} else {
|
||||
$box.removeClass(className + "off " + className + "on");
|
||||
}
|
||||
}
|
||||
|
||||
function launch(target) {
|
||||
if (!closing) {
|
||||
|
||||
element = target;
|
||||
|
||||
makeSettings();
|
||||
|
||||
$related = $(element);
|
||||
|
||||
index = 0;
|
||||
|
||||
if (settings.rel !== 'nofollow') {
|
||||
$related = $('.' + boxElement).filter(function () {
|
||||
var data = $.data(this, colorbox),
|
||||
relRelated;
|
||||
|
||||
if (data) {
|
||||
relRelated = $(this).data('rel') || data.rel || this.rel;
|
||||
}
|
||||
|
||||
return (relRelated === settings.rel);
|
||||
});
|
||||
index = $related.index(element);
|
||||
|
||||
// Check direct calls to ColorBox.
|
||||
if (index === -1) {
|
||||
$related = $related.add(element);
|
||||
index = $related.length - 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!open) {
|
||||
open = active = true; // Prevents the page-change action from queuing up if the visitor holds down the left or right keys.
|
||||
|
||||
// Show colorbox so the sizes can be calculated in older versions of jQuery
|
||||
$box.css({visibility:'hidden', display:'block'});
|
||||
|
||||
$loaded = $tag(div, 'LoadedContent', 'width:0; height:0; overflow:hidden').appendTo($content);
|
||||
|
||||
// Cache values needed for size calculations
|
||||
interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();//Subtraction needed for IE6
|
||||
interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width();
|
||||
loadedHeight = $loaded.outerHeight(true);
|
||||
loadedWidth = $loaded.outerWidth(true);
|
||||
|
||||
if (settings.returnFocus) {
|
||||
$(element).blur();
|
||||
$events.one(event_closed, function () {
|
||||
$(element).focus();
|
||||
});
|
||||
}
|
||||
|
||||
$overlay.css({
|
||||
opacity: parseFloat(settings.opacity),
|
||||
cursor: settings.overlayClose ? "pointer" : "auto",
|
||||
visibility: 'visible'
|
||||
}).show();
|
||||
|
||||
// Opens inital empty ColorBox prior to content being loaded.
|
||||
settings.w = setSize(settings.initialWidth, 'x');
|
||||
settings.h = setSize(settings.initialHeight, 'y');
|
||||
publicMethod.position();
|
||||
|
||||
if (isIE6) {
|
||||
$window.bind('resize.' + event_ie6 + ' scroll.' + event_ie6, function () {
|
||||
$overlay.css({width: $window.width(), height: $window.height(), top: $window.scrollTop(), left: $window.scrollLeft()});
|
||||
}).trigger('resize.' + event_ie6);
|
||||
}
|
||||
|
||||
slideshow();
|
||||
|
||||
trigger(event_open, settings.onOpen);
|
||||
|
||||
$groupControls.add($title).hide();
|
||||
|
||||
$close.html(settings.close).show();
|
||||
}
|
||||
|
||||
publicMethod.load(true);
|
||||
}
|
||||
}
|
||||
|
||||
// ColorBox's markup needs to be added to the DOM prior to being called
|
||||
// so that the browser will go ahead and load the CSS background images.
|
||||
function appendHTML() {
|
||||
if (!$box && document.body) {
|
||||
init = false;
|
||||
|
||||
$window = $(window);
|
||||
$box = $tag(div).attr({id: colorbox, 'class': isIE ? prefix + (isIE6 ? 'IE6' : 'IE') : ''}).hide();
|
||||
$overlay = $tag(div, "Overlay", isIE6 ? 'position:absolute' : '').hide();
|
||||
$loadingOverlay = $tag(div, "LoadingOverlay").add($tag(div, "LoadingGraphic"));
|
||||
$wrap = $tag(div, "Wrapper");
|
||||
$content = $tag(div, "Content").append(
|
||||
$title = $tag(div, "Title"),
|
||||
$current = $tag(div, "Current"),
|
||||
$next = $tag(div, "Next"),
|
||||
$prev = $tag(div, "Previous"),
|
||||
$slideshow = $tag(div, "Slideshow"),
|
||||
$close = $tag(div, "Close")
|
||||
);
|
||||
|
||||
$wrap.append( // The 3x3 Grid that makes up ColorBox
|
||||
$tag(div).append(
|
||||
$tag(div, "TopLeft"),
|
||||
$topBorder = $tag(div, "TopCenter"),
|
||||
$tag(div, "TopRight")
|
||||
),
|
||||
$tag(div, false, 'clear:left').append(
|
||||
$leftBorder = $tag(div, "MiddleLeft"),
|
||||
$content,
|
||||
$rightBorder = $tag(div, "MiddleRight")
|
||||
),
|
||||
$tag(div, false, 'clear:left').append(
|
||||
$tag(div, "BottomLeft"),
|
||||
$bottomBorder = $tag(div, "BottomCenter"),
|
||||
$tag(div, "BottomRight")
|
||||
)
|
||||
).find('div div').css({'float': 'left'});
|
||||
|
||||
$loadingBay = $tag(div, false, 'position:absolute; width:9999px; visibility:hidden; display:none');
|
||||
|
||||
$groupControls = $next.add($prev).add($current).add($slideshow);
|
||||
|
||||
$(document.body).append($overlay, $box.append($wrap, $loadingBay));
|
||||
}
|
||||
}
|
||||
|
||||
// Add ColorBox's event bindings
|
||||
function addBindings() {
|
||||
function clickHandler(e) {
|
||||
// ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.
|
||||
// See: http://jacklmoore.com/notes/click-events/
|
||||
if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey)) {
|
||||
e.preventDefault();
|
||||
launch(this);
|
||||
}
|
||||
}
|
||||
|
||||
if ($box) {
|
||||
if (!init) {
|
||||
init = true;
|
||||
|
||||
// Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.
|
||||
$next.click(function () {
|
||||
publicMethod.next();
|
||||
});
|
||||
$prev.click(function () {
|
||||
publicMethod.prev();
|
||||
});
|
||||
$close.click(function () {
|
||||
publicMethod.close();
|
||||
});
|
||||
$overlay.click(function () {
|
||||
if (settings.overlayClose) {
|
||||
publicMethod.close();
|
||||
}
|
||||
});
|
||||
|
||||
// Key Bindings
|
||||
$(document).bind('keydown.' + prefix, function (e) {
|
||||
var key = e.keyCode;
|
||||
if (open && settings.escKey && key === 27) {
|
||||
e.preventDefault();
|
||||
publicMethod.close();
|
||||
}
|
||||
if (open && settings.arrowKey && $related[1]) {
|
||||
if (key === 37) {
|
||||
e.preventDefault();
|
||||
$prev.click();
|
||||
} else if (key === 39) {
|
||||
e.preventDefault();
|
||||
$next.click();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if ($.isFunction($.fn.on)) {
|
||||
$(document).on('click.'+prefix, '.'+boxElement, clickHandler);
|
||||
} else { // For jQuery 1.3.x -> 1.6.x
|
||||
$('.'+boxElement).live('click.'+prefix, clickHandler);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Don't do anything if ColorBox already exists.
|
||||
if ($.colorbox) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Append the HTML when the DOM loads
|
||||
$(appendHTML);
|
||||
|
||||
|
||||
// ****************
|
||||
// PUBLIC FUNCTIONS
|
||||
// Usage format: $.fn.colorbox.close();
|
||||
// Usage from within an iframe: parent.$.fn.colorbox.close();
|
||||
// ****************
|
||||
|
||||
publicMethod = $.fn[colorbox] = $[colorbox] = function (options, callback) {
|
||||
var $this = this;
|
||||
|
||||
options = options || {};
|
||||
|
||||
appendHTML();
|
||||
|
||||
if (addBindings()) {
|
||||
if ($.isFunction($this)) { // assume a call to $.colorbox
|
||||
$this = $('<a/>');
|
||||
options.open = true;
|
||||
} else if (!$this[0]) { // colorbox being applied to empty collection
|
||||
return $this;
|
||||
}
|
||||
|
||||
if (callback) {
|
||||
options.onComplete = callback;
|
||||
}
|
||||
|
||||
$this.each(function () {
|
||||
$.data(this, colorbox, $.extend({}, $.data(this, colorbox) || defaults, options));
|
||||
}).addClass(boxElement);
|
||||
|
||||
if (($.isFunction(options.open) && options.open.call($this)) || options.open) {
|
||||
launch($this[0]);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
};
|
||||
|
||||
publicMethod.position = function (speed, loadedCallback) {
|
||||
var
|
||||
css,
|
||||
top = 0,
|
||||
left = 0,
|
||||
offset = $box.offset(),
|
||||
scrollTop,
|
||||
scrollLeft;
|
||||
|
||||
$window.unbind('resize.' + prefix);
|
||||
|
||||
// remove the modal so that it doesn't influence the document width/height
|
||||
$box.css({top: -9e4, left: -9e4});
|
||||
|
||||
scrollTop = $window.scrollTop();
|
||||
scrollLeft = $window.scrollLeft();
|
||||
|
||||
if (settings.fixed && !isIE6) {
|
||||
offset.top -= scrollTop;
|
||||
offset.left -= scrollLeft;
|
||||
$box.css({position: 'fixed'});
|
||||
} else {
|
||||
top = scrollTop;
|
||||
left = scrollLeft;
|
||||
$box.css({position: 'absolute'});
|
||||
}
|
||||
|
||||
// keeps the top and left positions within the browser's viewport.
|
||||
if (settings.right !== false) {
|
||||
left += Math.max($window.width() - settings.w - loadedWidth - interfaceWidth - setSize(settings.right, 'x'), 0);
|
||||
} else if (settings.left !== false) {
|
||||
left += setSize(settings.left, 'x');
|
||||
} else {
|
||||
left += Math.round(Math.max($window.width() - settings.w - loadedWidth - interfaceWidth, 0) / 2);
|
||||
}
|
||||
|
||||
if (settings.bottom !== false) {
|
||||
top += Math.max($window.height() - settings.h - loadedHeight - interfaceHeight - setSize(settings.bottom, 'y'), 0);
|
||||
} else if (settings.top !== false) {
|
||||
top += setSize(settings.top, 'y');
|
||||
} else {
|
||||
top += Math.round(Math.max($window.height() - settings.h - loadedHeight - interfaceHeight, 0) / 2);
|
||||
}
|
||||
|
||||
$box.css({top: offset.top, left: offset.left, visibility:'visible'});
|
||||
|
||||
// setting the speed to 0 to reduce the delay between same-sized content.
|
||||
speed = ($box.width() === settings.w + loadedWidth && $box.height() === settings.h + loadedHeight) ? 0 : speed || 0;
|
||||
|
||||
// this gives the wrapper plenty of breathing room so it's floated contents can move around smoothly,
|
||||
// but it has to be shrank down around the size of div#colorbox when it's done. If not,
|
||||
// it can invoke an obscure IE bug when using iframes.
|
||||
$wrap[0].style.width = $wrap[0].style.height = "9999px";
|
||||
|
||||
function modalDimensions(that) {
|
||||
$topBorder[0].style.width = $bottomBorder[0].style.width = $content[0].style.width = (parseInt(that.style.width,10) - interfaceWidth)+'px';
|
||||
$content[0].style.height = $leftBorder[0].style.height = $rightBorder[0].style.height = (parseInt(that.style.height,10) - interfaceHeight)+'px';
|
||||
}
|
||||
|
||||
css = {width: settings.w + loadedWidth + interfaceWidth, height: settings.h + loadedHeight + interfaceHeight, top: top, left: left};
|
||||
|
||||
if(speed===0){ // temporary workaround to side-step jQuery-UI 1.8 bug (http://bugs.jquery.com/ticket/12273)
|
||||
$box.css(css);
|
||||
}
|
||||
$box.dequeue().animate(css, {
|
||||
duration: speed,
|
||||
complete: function () {
|
||||
modalDimensions(this);
|
||||
|
||||
active = false;
|
||||
|
||||
// shrink the wrapper down to exactly the size of colorbox to avoid a bug in IE's iframe implementation.
|
||||
$wrap[0].style.width = (settings.w + loadedWidth + interfaceWidth) + "px";
|
||||
$wrap[0].style.height = (settings.h + loadedHeight + interfaceHeight) + "px";
|
||||
|
||||
if (settings.reposition) {
|
||||
setTimeout(function () { // small delay before binding onresize due to an IE8 bug.
|
||||
$window.bind('resize.' + prefix, publicMethod.position);
|
||||
}, 1);
|
||||
}
|
||||
|
||||
if (loadedCallback) {
|
||||
loadedCallback();
|
||||
}
|
||||
},
|
||||
step: function () {
|
||||
modalDimensions(this);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
publicMethod.resize = function (options) {
|
||||
if (open) {
|
||||
options = options || {};
|
||||
|
||||
if (options.width) {
|
||||
settings.w = setSize(options.width, 'x') - loadedWidth - interfaceWidth;
|
||||
}
|
||||
if (options.innerWidth) {
|
||||
settings.w = setSize(options.innerWidth, 'x');
|
||||
}
|
||||
$loaded.css({width: settings.w});
|
||||
|
||||
if (options.height) {
|
||||
settings.h = setSize(options.height, 'y') - loadedHeight - interfaceHeight;
|
||||
}
|
||||
if (options.innerHeight) {
|
||||
settings.h = setSize(options.innerHeight, 'y');
|
||||
}
|
||||
if (!options.innerHeight && !options.height) {
|
||||
$loaded.css({height: "auto"});
|
||||
settings.h = $loaded.height();
|
||||
}
|
||||
$loaded.css({height: settings.h});
|
||||
|
||||
publicMethod.position(settings.transition === "none" ? 0 : settings.speed);
|
||||
}
|
||||
};
|
||||
|
||||
publicMethod.prep = function (object) {
|
||||
if (!open) {
|
||||
return;
|
||||
}
|
||||
|
||||
var callback, speed = settings.transition === "none" ? 0 : settings.speed;
|
||||
|
||||
$loaded.empty().remove(); // Using empty first may prevent some IE7 issues.
|
||||
|
||||
$loaded = $tag(div, 'LoadedContent').append(object);
|
||||
|
||||
function getWidth() {
|
||||
settings.w = settings.w || $loaded.width();
|
||||
settings.w = settings.mw && settings.mw < settings.w ? settings.mw : settings.w;
|
||||
return settings.w;
|
||||
}
|
||||
function getHeight() {
|
||||
settings.h = settings.h || $loaded.height();
|
||||
settings.h = settings.mh && settings.mh < settings.h ? settings.mh : settings.h;
|
||||
return settings.h;
|
||||
}
|
||||
|
||||
$loaded.hide()
|
||||
.appendTo($loadingBay.show())// content has to be appended to the DOM for accurate size calculations.
|
||||
.css({width: getWidth(), overflow: settings.scrolling ? 'auto' : 'hidden'})
|
||||
.css({height: getHeight()})// sets the height independently from the width in case the new width influences the value of height.
|
||||
.prependTo($content);
|
||||
|
||||
$loadingBay.hide();
|
||||
|
||||
// floating the IMG removes the bottom line-height and fixed a problem where IE miscalculates the width of the parent element as 100% of the document width.
|
||||
|
||||
$(photo).css({'float': 'none'});
|
||||
|
||||
callback = function () {
|
||||
var total = $related.length,
|
||||
iframe,
|
||||
frameBorder = 'frameBorder',
|
||||
allowTransparency = 'allowTransparency',
|
||||
complete;
|
||||
|
||||
if (!open) {
|
||||
return;
|
||||
}
|
||||
|
||||
function removeFilter() {
|
||||
if (isIE) {
|
||||
$box[0].style.removeAttribute('filter');
|
||||
}
|
||||
}
|
||||
|
||||
complete = function () {
|
||||
clearTimeout(loadingTimer);
|
||||
$loadingOverlay.remove();
|
||||
trigger(event_complete, settings.onComplete);
|
||||
};
|
||||
|
||||
if (isIE) {
|
||||
//This fadeIn helps the bicubic resampling to kick-in.
|
||||
if (photo) {
|
||||
$loaded.fadeIn(100);
|
||||
}
|
||||
}
|
||||
|
||||
$title.html(settings.title).add($loaded).show();
|
||||
|
||||
if (total > 1) { // handle grouping
|
||||
if (typeof settings.current === "string") {
|
||||
$current.html(settings.current.replace('{current}', index + 1).replace('{total}', total)).show();
|
||||
}
|
||||
|
||||
$next[(settings.loop || index < total - 1) ? "show" : "hide"]().html(settings.next);
|
||||
$prev[(settings.loop || index) ? "show" : "hide"]().html(settings.previous);
|
||||
|
||||
if (settings.slideshow) {
|
||||
$slideshow.show();
|
||||
}
|
||||
|
||||
// Preloads images within a rel group
|
||||
if (settings.preloading) {
|
||||
$.each([getIndex(-1), getIndex(1)], function(){
|
||||
var src,
|
||||
img,
|
||||
i = $related[this],
|
||||
data = $.data(i, colorbox);
|
||||
|
||||
if (data && data.href) {
|
||||
src = data.href;
|
||||
if ($.isFunction(src)) {
|
||||
src = src.call(i);
|
||||
}
|
||||
} else {
|
||||
src = $(i).attr('href');
|
||||
}
|
||||
|
||||
if (src && (isImage(src) || data.photo)) {
|
||||
img = new Image();
|
||||
img.src = src;
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
$groupControls.hide();
|
||||
}
|
||||
|
||||
if (settings.iframe) {
|
||||
iframe = $tag('iframe')[0];
|
||||
|
||||
if (frameBorder in iframe) {
|
||||
iframe[frameBorder] = 0;
|
||||
}
|
||||
|
||||
if (allowTransparency in iframe) {
|
||||
iframe[allowTransparency] = "true";
|
||||
}
|
||||
|
||||
if (!settings.scrolling) {
|
||||
iframe.scrolling = "no";
|
||||
}
|
||||
|
||||
$(iframe)
|
||||
.attr({
|
||||
src: settings.href,
|
||||
name: (new Date()).getTime(), // give the iframe a unique name to prevent caching
|
||||
'class': prefix + 'Iframe',
|
||||
allowFullScreen : true, // allow HTML5 video to go fullscreen
|
||||
webkitAllowFullScreen : true,
|
||||
mozallowfullscreen : true
|
||||
})
|
||||
.one('load', complete)
|
||||
.appendTo($loaded);
|
||||
|
||||
$events.one(event_purge, function () {
|
||||
iframe.src = "//about:blank";
|
||||
});
|
||||
|
||||
if (settings.fastIframe) {
|
||||
$(iframe).trigger('load');
|
||||
}
|
||||
} else {
|
||||
complete();
|
||||
}
|
||||
|
||||
if (settings.transition === 'fade') {
|
||||
$box.fadeTo(speed, 1, removeFilter);
|
||||
} else {
|
||||
removeFilter();
|
||||
}
|
||||
};
|
||||
|
||||
if (settings.transition === 'fade') {
|
||||
$box.fadeTo(speed, 0, function () {
|
||||
publicMethod.position(0, callback);
|
||||
});
|
||||
} else {
|
||||
publicMethod.position(speed, callback);
|
||||
}
|
||||
};
|
||||
|
||||
publicMethod.load = function (launched) {
|
||||
var href, setResize, prep = publicMethod.prep, $inline;
|
||||
|
||||
active = true;
|
||||
|
||||
photo = false;
|
||||
|
||||
element = $related[index];
|
||||
|
||||
if (!launched) {
|
||||
makeSettings();
|
||||
}
|
||||
|
||||
if (className) {
|
||||
$box.add($overlay).removeClass(className);
|
||||
}
|
||||
if (settings.className) {
|
||||
$box.add($overlay).addClass(settings.className);
|
||||
}
|
||||
className = settings.className;
|
||||
|
||||
trigger(event_purge);
|
||||
|
||||
trigger(event_load, settings.onLoad);
|
||||
|
||||
settings.h = settings.height ?
|
||||
setSize(settings.height, 'y') - loadedHeight - interfaceHeight :
|
||||
settings.innerHeight && setSize(settings.innerHeight, 'y');
|
||||
|
||||
settings.w = settings.width ?
|
||||
setSize(settings.width, 'x') - loadedWidth - interfaceWidth :
|
||||
settings.innerWidth && setSize(settings.innerWidth, 'x');
|
||||
|
||||
// Sets the minimum dimensions for use in image scaling
|
||||
settings.mw = settings.w;
|
||||
settings.mh = settings.h;
|
||||
|
||||
// Re-evaluate the minimum width and height based on maxWidth and maxHeight values.
|
||||
// If the width or height exceed the maxWidth or maxHeight, use the maximum values instead.
|
||||
if (settings.maxWidth) {
|
||||
settings.mw = setSize(settings.maxWidth, 'x') - loadedWidth - interfaceWidth;
|
||||
settings.mw = settings.w && settings.w < settings.mw ? settings.w : settings.mw;
|
||||
}
|
||||
if (settings.maxHeight) {
|
||||
settings.mh = setSize(settings.maxHeight, 'y') - loadedHeight - interfaceHeight;
|
||||
settings.mh = settings.h && settings.h < settings.mh ? settings.h : settings.mh;
|
||||
}
|
||||
|
||||
href = settings.href;
|
||||
|
||||
loadingTimer = setTimeout(function () {
|
||||
$loadingOverlay.appendTo($content);
|
||||
}, 100);
|
||||
|
||||
if (settings.inline) {
|
||||
// Inserts an empty placeholder where inline content is being pulled from.
|
||||
// An event is bound to put inline content back when ColorBox closes or loads new content.
|
||||
$inline = $tag(div).hide().insertBefore($(href)[0]);
|
||||
|
||||
$events.one(event_purge, function () {
|
||||
$inline.replaceWith($loaded.children());
|
||||
});
|
||||
|
||||
prep($(href));
|
||||
} else if (settings.iframe) {
|
||||
// IFrame element won't be added to the DOM until it is ready to be displayed,
|
||||
// to avoid problems with DOM-ready JS that might be trying to run in that iframe.
|
||||
prep(" ");
|
||||
} else if (settings.html) {
|
||||
prep(settings.html);
|
||||
} else if (isImage(href)) {
|
||||
|
||||
href = retinaUrl(href);
|
||||
|
||||
$(photo = new Image())
|
||||
.addClass(prefix + 'Photo')
|
||||
.bind('error',function () {
|
||||
settings.title = false;
|
||||
prep($tag(div, 'Error').html(settings.imgError));
|
||||
})
|
||||
.one('load', function () {
|
||||
var percent;
|
||||
|
||||
if (settings.retinaImage && window.devicePixelRatio > 1) {
|
||||
photo.height = photo.height / window.devicePixelRatio;
|
||||
photo.width = photo.width / window.devicePixelRatio;
|
||||
}
|
||||
|
||||
if (settings.scalePhotos) {
|
||||
setResize = function () {
|
||||
photo.height -= photo.height * percent;
|
||||
photo.width -= photo.width * percent;
|
||||
};
|
||||
if (settings.mw && photo.width > settings.mw) {
|
||||
percent = (photo.width - settings.mw) / photo.width;
|
||||
setResize();
|
||||
}
|
||||
if (settings.mh && photo.height > settings.mh) {
|
||||
percent = (photo.height - settings.mh) / photo.height;
|
||||
setResize();
|
||||
}
|
||||
}
|
||||
|
||||
if (settings.h) {
|
||||
photo.style.marginTop = Math.max(settings.mh - photo.height, 0) / 2 + 'px';
|
||||
}
|
||||
|
||||
if ($related[1] && (settings.loop || $related[index + 1])) {
|
||||
photo.style.cursor = 'pointer';
|
||||
photo.onclick = function () {
|
||||
publicMethod.next();
|
||||
};
|
||||
}
|
||||
|
||||
if (isIE) {
|
||||
photo.style.msInterpolationMode = 'bicubic';
|
||||
}
|
||||
|
||||
setTimeout(function () { // A pause because Chrome will sometimes report a 0 by 0 size otherwise.
|
||||
prep(photo);
|
||||
}, 1);
|
||||
});
|
||||
|
||||
setTimeout(function () { // A pause because Opera 10.6+ will sometimes not run the onload function otherwise.
|
||||
photo.src = href;
|
||||
}, 1);
|
||||
} else if (href) {
|
||||
$loadingBay.load(href, settings.data, function (data, status) {
|
||||
prep(status === 'error' ? $tag(div, 'Error').html(settings.xhrError) : $(this).contents());
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// Navigates to the next page/image in a set.
|
||||
publicMethod.next = function () {
|
||||
if (!active && $related[1] && (settings.loop || $related[index + 1])) {
|
||||
index = getIndex(1);
|
||||
publicMethod.load();
|
||||
}
|
||||
};
|
||||
|
||||
publicMethod.prev = function () {
|
||||
if (!active && $related[1] && (settings.loop || index)) {
|
||||
index = getIndex(-1);
|
||||
publicMethod.load();
|
||||
}
|
||||
};
|
||||
|
||||
// Note: to use this within an iframe use the following format: parent.$.fn.colorbox.close();
|
||||
publicMethod.close = function () {
|
||||
if (open && !closing) {
|
||||
|
||||
closing = true;
|
||||
|
||||
open = false;
|
||||
|
||||
trigger(event_cleanup, settings.onCleanup);
|
||||
|
||||
$window.unbind('.' + prefix + ' .' + event_ie6);
|
||||
|
||||
$overlay.fadeTo(200, 0);
|
||||
|
||||
$box.stop().fadeTo(300, 0, function () {
|
||||
|
||||
$box.add($overlay).css({'opacity': 1, cursor: 'auto'}).hide();
|
||||
|
||||
trigger(event_purge);
|
||||
|
||||
$loaded.empty().remove(); // Using empty first may prevent some IE7 issues.
|
||||
|
||||
setTimeout(function () {
|
||||
closing = false;
|
||||
trigger(event_closed, settings.onClosed);
|
||||
}, 1);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// Removes changes ColorBox made to the document, but does not remove the plugin
|
||||
// from jQuery.
|
||||
publicMethod.remove = function () {
|
||||
$([]).add($box).add($overlay).remove();
|
||||
$box = null;
|
||||
$('.' + boxElement)
|
||||
.removeData(colorbox)
|
||||
.removeClass(boxElement);
|
||||
|
||||
$(document).unbind('click.'+prefix);
|
||||
};
|
||||
|
||||
// A method for fetching the current element ColorBox is referencing.
|
||||
// returns a jQuery object.
|
||||
publicMethod.element = function () {
|
||||
return $(element);
|
||||
};
|
||||
|
||||
publicMethod.settings = defaults;
|
||||
|
||||
}(jQuery, document, window));
|
||||
6
modules/lib/colorbox/jquery.colorbox.min.js
vendored
Normal file
6
modules/lib/colorbox/jquery.colorbox.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
520
modules/lib/colorpicker/bootstrap-colorpicker.js
vendored
Normal file
520
modules/lib/colorpicker/bootstrap-colorpicker.js
vendored
Normal file
@ -0,0 +1,520 @@
|
||||
/* =========================================================
|
||||
* bootstrap-colorpicker.js
|
||||
* http://www.eyecon.ro/bootstrap-colorpicker
|
||||
* =========================================================
|
||||
* Copyright 2012 Stefan Petre
|
||||
*
|
||||
* 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.
|
||||
* ========================================================= */
|
||||
|
||||
!function( $ ) {
|
||||
|
||||
// Color object
|
||||
|
||||
var Color = function(val) {
|
||||
this.value = {
|
||||
h: 1,
|
||||
s: 1,
|
||||
b: 1,
|
||||
a: 1
|
||||
};
|
||||
this.setColor(val);
|
||||
};
|
||||
|
||||
Color.prototype = {
|
||||
constructor: Color,
|
||||
|
||||
//parse a string to HSB
|
||||
setColor: function(val){
|
||||
val = val.toLowerCase();
|
||||
var that = this;
|
||||
$.each( CPGlobal.stringParsers, function( i, parser ) {
|
||||
var match = parser.re.exec( val ),
|
||||
values = match && parser.parse( match ),
|
||||
space = parser.space||'rgba';
|
||||
if ( values ) {
|
||||
if (space == 'hsla') {
|
||||
that.value = CPGlobal.RGBtoHSB.apply(null, CPGlobal.HSLtoRGB.apply(null, values));
|
||||
} else {
|
||||
that.value = CPGlobal.RGBtoHSB.apply(null, values);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
setHue: function(h) {
|
||||
this.value.h = 1- h;
|
||||
},
|
||||
|
||||
setSaturation: function(s) {
|
||||
this.value.s = s;
|
||||
},
|
||||
|
||||
setLightness: function(b) {
|
||||
this.value.b = 1- b;
|
||||
},
|
||||
|
||||
setAlpha: function(a) {
|
||||
this.value.a = parseInt((1 - a)*100, 10)/100;
|
||||
},
|
||||
|
||||
// HSBtoRGB from RaphaelJS
|
||||
// https://github.com/DmitryBaranovskiy/raphael/
|
||||
toRGB: function(h, s, b, a) {
|
||||
if (!h) {
|
||||
h = this.value.h;
|
||||
s = this.value.s;
|
||||
b = this.value.b;
|
||||
}
|
||||
h *= 360;
|
||||
var R, G, B, X, C;
|
||||
h = (h % 360) / 60;
|
||||
C = b * s;
|
||||
X = C * (1 - Math.abs(h % 2 - 1));
|
||||
R = G = B = b - C;
|
||||
|
||||
h = ~~h;
|
||||
R += [C, X, 0, 0, X, C][h];
|
||||
G += [X, C, C, X, 0, 0][h];
|
||||
B += [0, 0, X, C, C, X][h];
|
||||
return {
|
||||
r: Math.round(R*255),
|
||||
g: Math.round(G*255),
|
||||
b: Math.round(B*255),
|
||||
a: a||this.value.a
|
||||
};
|
||||
},
|
||||
|
||||
toHex: function(h, s, b, a){
|
||||
var rgb = this.toRGB(h, s, b, a);
|
||||
return '#'+((1 << 24) | (parseInt(rgb.r) << 16) | (parseInt(rgb.g) << 8) | parseInt(rgb.b)).toString(16).substr(1);
|
||||
},
|
||||
|
||||
toHSL: function(h, s, b, a){
|
||||
if (!h) {
|
||||
h = this.value.h;
|
||||
s = this.value.s;
|
||||
b = this.value.b;
|
||||
}
|
||||
var H = h,
|
||||
L = (2 - s) * b,
|
||||
S = s * b;
|
||||
if (L > 0 && L <= 1) {
|
||||
S /= L;
|
||||
} else {
|
||||
S /= 2 - L;
|
||||
}
|
||||
L /= 2;
|
||||
if (S > 1) {
|
||||
S = 1;
|
||||
}
|
||||
return {
|
||||
h: H,
|
||||
s: S,
|
||||
l: L,
|
||||
a: a||this.value.a
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
// Picker object
|
||||
|
||||
var Colorpicker = function(element, options){
|
||||
this.element = $(element);
|
||||
var format = options.format||this.element.data('color-format')||'hex';
|
||||
this.format = CPGlobal.translateFormats[format];
|
||||
this.isInput = this.element.is('input');
|
||||
this.component = this.element.is('.color') ? this.element.find('.add-on') : false;
|
||||
|
||||
this.picker = $(CPGlobal.template)
|
||||
.appendTo('body')
|
||||
.on('mousedown', $.proxy(this.mousedown, this));
|
||||
|
||||
if (this.isInput) {
|
||||
this.element.on({
|
||||
'focus': $.proxy(this.show, this),
|
||||
'keyup': $.proxy(this.update, this)
|
||||
});
|
||||
} else if (this.component){
|
||||
this.component.on({
|
||||
'click': $.proxy(this.show, this)
|
||||
});
|
||||
} else {
|
||||
this.element.on({
|
||||
'click': $.proxy(this.show, this)
|
||||
});
|
||||
}
|
||||
if (format == 'rgba' || format == 'hsla') {
|
||||
this.picker.addClass('alpha');
|
||||
this.alpha = this.picker.find('.colorpicker-alpha')[0].style;
|
||||
}
|
||||
|
||||
if (this.component){
|
||||
this.picker.find('.colorpicker-color').hide();
|
||||
this.preview = this.element.find('i')[0].style;
|
||||
} else {
|
||||
this.preview = this.picker.find('div:last')[0].style;
|
||||
}
|
||||
|
||||
this.base = this.picker.find('div:first')[0].style;
|
||||
this.update();
|
||||
};
|
||||
|
||||
Colorpicker.prototype = {
|
||||
constructor: Colorpicker,
|
||||
|
||||
show: function(e) {
|
||||
this.picker.show();
|
||||
this.height = this.component ? this.component.outerHeight() : this.element.outerHeight();
|
||||
this.place();
|
||||
$(window).on('resize', $.proxy(this.place, this));
|
||||
if (!this.isInput) {
|
||||
if (e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
$(document).on({
|
||||
'mousedown': $.proxy(this.hide, this)
|
||||
});
|
||||
this.element.trigger({
|
||||
type: 'show',
|
||||
color: this.color
|
||||
});
|
||||
},
|
||||
|
||||
update: function(){
|
||||
this.color = new Color(this.isInput ? this.element.prop('value') : this.element.data('color'));
|
||||
this.picker.find('i')
|
||||
.eq(0).css({left: this.color.value.s*100, top: 100 - this.color.value.b*100}).end()
|
||||
.eq(1).css('top', 100 * (1 - this.color.value.h)).end()
|
||||
.eq(2).css('top', 100 * (1 - this.color.value.a));
|
||||
this.previewColor();
|
||||
},
|
||||
|
||||
hide: function(){
|
||||
this.picker.hide();
|
||||
$(window).off('resize', this.place);
|
||||
if (!this.isInput) {
|
||||
$(document).off({
|
||||
'mousedown': this.hide
|
||||
});
|
||||
if (this.component){
|
||||
this.element.find('input').prop('value', this.format.call(this));
|
||||
}
|
||||
this.element.data('color', this.format.call(this));
|
||||
} else {
|
||||
this.element.prop('value', this.format.call(this));
|
||||
}
|
||||
this.element.trigger({
|
||||
type: 'hide',
|
||||
color: this.color
|
||||
});
|
||||
},
|
||||
|
||||
place: function(){
|
||||
var offset = this.component ? this.component.offset() : this.element.offset();
|
||||
this.picker.css({
|
||||
top: offset.top + this.height,
|
||||
left: offset.left
|
||||
});
|
||||
},
|
||||
|
||||
//preview color change
|
||||
previewColor: function(){
|
||||
this.preview.backgroundColor = this.format.call(this);
|
||||
//set the color for brightness/saturation slider
|
||||
this.base.backgroundColor = this.color.toHex(this.color.value.h, 1, 1, 1);
|
||||
//set te color for alpha slider
|
||||
if (this.alpha) {
|
||||
this.alpha.backgroundColor = this.color.toHex();
|
||||
}
|
||||
},
|
||||
|
||||
pointer: null,
|
||||
|
||||
slider: null,
|
||||
|
||||
mousedown: function(e){
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
var target = $(e.target);
|
||||
|
||||
//detect the slider and set the limits and callbacks
|
||||
var zone = target.closest('div');
|
||||
if (!zone.is('.colorpicker')) {
|
||||
if (zone.is('.colorpicker-saturation')) {
|
||||
this.slider = $.extend({}, CPGlobal.sliders['saturation']);
|
||||
}
|
||||
else if (zone.is('.colorpicker-hue')) {
|
||||
this.slider = $.extend({}, CPGlobal.sliders['hue']);
|
||||
}
|
||||
else if (zone.is('.colorpicker-alpha')) {
|
||||
this.slider = $.extend({}, CPGlobal.sliders['alpha']);
|
||||
}
|
||||
var offset = zone.offset();
|
||||
//reference to knob's style
|
||||
this.slider.knob = zone.find('i')[0].style;
|
||||
this.slider.left = e.pageX - offset.left;
|
||||
this.slider.top = e.pageY - offset.top;
|
||||
this.pointer = {
|
||||
left: e.pageX,
|
||||
top: e.pageY
|
||||
};
|
||||
//trigger mousemove to move the knob to the current position
|
||||
$(document).on({
|
||||
mousemove: $.proxy(this.mousemove, this),
|
||||
mouseup: $.proxy(this.mouseup, this)
|
||||
}).trigger('mousemove');
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
mousemove: function(e){
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
var left = Math.max(
|
||||
0,
|
||||
Math.min(
|
||||
this.slider.maxLeft,
|
||||
this.slider.left + ((e.pageX||this.pointer.left) - this.pointer.left)
|
||||
)
|
||||
);
|
||||
var top = Math.max(
|
||||
0,
|
||||
Math.min(
|
||||
this.slider.maxTop,
|
||||
this.slider.top + ((e.pageY||this.pointer.top) - this.pointer.top)
|
||||
)
|
||||
);
|
||||
this.slider.knob.left = left + 'px';
|
||||
this.slider.knob.top = top + 'px';
|
||||
if (this.slider.callLeft) {
|
||||
this.color[this.slider.callLeft].call(this.color, left/100);
|
||||
}
|
||||
if (this.slider.callTop) {
|
||||
this.color[this.slider.callTop].call(this.color, top/100);
|
||||
}
|
||||
this.previewColor();
|
||||
this.element.trigger({
|
||||
type: 'changeColor',
|
||||
color: this.color
|
||||
});
|
||||
return false;
|
||||
},
|
||||
|
||||
mouseup: function(e){
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
$(document).off({
|
||||
mousemove: this.mousemove,
|
||||
mouseup: this.mouseup
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$.fn.colorpicker = function ( option ) {
|
||||
return this.each(function () {
|
||||
var $this = $(this),
|
||||
data = $this.data('colorpicker'),
|
||||
options = typeof option == 'object' && option;
|
||||
if (!data) {
|
||||
$this.data('colorpicker', (data = new Colorpicker(this, $.extend({}, $.fn.colorpicker.defaults,options))));
|
||||
}
|
||||
if (typeof option == 'string') data[option]();
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.colorpicker.defaults = {
|
||||
};
|
||||
|
||||
$.fn.colorpicker.Constructor = Colorpicker;
|
||||
|
||||
var CPGlobal = {
|
||||
|
||||
// translate a format from Color object to a string
|
||||
translateFormats: {
|
||||
'rgb': function(){
|
||||
var rgb = this.color.toRGB();
|
||||
return 'rgb('+rgb.r+','+rgb.g+','+rgb.b+')';
|
||||
},
|
||||
|
||||
'rgba': function(){
|
||||
var rgb = this.color.toRGB();
|
||||
return 'rgba('+rgb.r+','+rgb.g+','+rgb.b+','+rgb.a+')';
|
||||
},
|
||||
|
||||
'hsl': function(){
|
||||
var hsl = this.color.toHSL();
|
||||
return 'hsl('+Math.round(hsl.h*360)+','+Math.round(hsl.s*100)+'%,'+Math.round(hsl.l*100)+'%)';
|
||||
},
|
||||
|
||||
'hsla': function(){
|
||||
var hsl = this.color.toHSL();
|
||||
return 'hsla('+Math.round(hsl.h*360)+','+Math.round(hsl.s*100)+'%,'+Math.round(hsl.l*100)+'%,'+hsl.a+')';
|
||||
},
|
||||
|
||||
'hex': function(){
|
||||
return this.color.toHex();
|
||||
}
|
||||
},
|
||||
|
||||
sliders: {
|
||||
saturation: {
|
||||
maxLeft: 100,
|
||||
maxTop: 100,
|
||||
callLeft: 'setSaturation',
|
||||
callTop: 'setLightness'
|
||||
},
|
||||
|
||||
hue: {
|
||||
maxLeft: 0,
|
||||
maxTop: 100,
|
||||
callLeft: false,
|
||||
callTop: 'setHue'
|
||||
},
|
||||
|
||||
alpha: {
|
||||
maxLeft: 0,
|
||||
maxTop: 100,
|
||||
callLeft: false,
|
||||
callTop: 'setAlpha'
|
||||
}
|
||||
},
|
||||
|
||||
// HSBtoRGB from RaphaelJS
|
||||
// https://github.com/DmitryBaranovskiy/raphael/
|
||||
RGBtoHSB: function (r, g, b, a){
|
||||
r /= 255;
|
||||
g /= 255;
|
||||
b /= 255;
|
||||
|
||||
var H, S, V, C;
|
||||
V = Math.max(r, g, b);
|
||||
C = V - Math.min(r, g, b);
|
||||
H = (C == 0 ? null :
|
||||
V == r ? (g - b) / C :
|
||||
V == g ? (b - r) / C + 2 :
|
||||
(r - g) / C + 4
|
||||
);
|
||||
H = ((H + 360) % 6) * 60 / 360;
|
||||
S = C == 0 ? 0 : C / V;
|
||||
return {h: H||1, s: S, b: V, a: a||1};
|
||||
},
|
||||
|
||||
HueToRGB: function (p, q, h) {
|
||||
if (h < 0)
|
||||
h += 1;
|
||||
else if (h > 1)
|
||||
h -= 1;
|
||||
|
||||
if ((h * 6) < 1)
|
||||
return p + (q - p) * h * 6;
|
||||
else if ((h * 2) < 1)
|
||||
return q;
|
||||
else if ((h * 3) < 2)
|
||||
return p + (q - p) * ((2 / 3) - h) * 6;
|
||||
else
|
||||
return p;
|
||||
},
|
||||
|
||||
HSLtoRGB: function (h, s, l, a)
|
||||
{
|
||||
|
||||
if (s < 0)
|
||||
s = 0;
|
||||
|
||||
if (l <= 0.5)
|
||||
var q = l * (1 + s);
|
||||
else
|
||||
var q = l + s - (l * s);
|
||||
|
||||
var p = 2 * l - q;
|
||||
|
||||
var tr = h + (1 / 3);
|
||||
var tg = h;
|
||||
var tb = h - (1 / 3);
|
||||
|
||||
var r = Math.round(CPGlobal.HueToRGB(p, q, tr) * 255);
|
||||
var g = Math.round(CPGlobal.HueToRGB(p, q, tg) * 255);
|
||||
var b = Math.round(CPGlobal.HueToRGB(p, q, tb) * 255);
|
||||
return [r, g, b, a||1];
|
||||
},
|
||||
|
||||
// a set of RE's that can match strings and generate color tuples.
|
||||
// from John Resig color plugin
|
||||
// https://github.com/jquery/jquery-color/
|
||||
stringParsers: [
|
||||
{
|
||||
re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,
|
||||
parse: function( execResult ) {
|
||||
return [
|
||||
execResult[ 1 ],
|
||||
execResult[ 2 ],
|
||||
execResult[ 3 ],
|
||||
execResult[ 4 ]
|
||||
];
|
||||
}
|
||||
}, {
|
||||
re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,
|
||||
parse: function( execResult ) {
|
||||
return [
|
||||
2.55 * execResult[1],
|
||||
2.55 * execResult[2],
|
||||
2.55 * execResult[3],
|
||||
execResult[ 4 ]
|
||||
];
|
||||
}
|
||||
}, {
|
||||
re: /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,
|
||||
parse: function( execResult ) {
|
||||
return [
|
||||
parseInt( execResult[ 1 ], 16 ),
|
||||
parseInt( execResult[ 2 ], 16 ),
|
||||
parseInt( execResult[ 3 ], 16 )
|
||||
];
|
||||
}
|
||||
}, {
|
||||
re: /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/,
|
||||
parse: function( execResult ) {
|
||||
return [
|
||||
parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ),
|
||||
parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ),
|
||||
parseInt( execResult[ 3 ] + execResult[ 3 ], 16 )
|
||||
];
|
||||
}
|
||||
}, {
|
||||
re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,
|
||||
space: 'hsla',
|
||||
parse: function( execResult ) {
|
||||
return [
|
||||
execResult[1]/360,
|
||||
execResult[2] / 100,
|
||||
execResult[3] / 100,
|
||||
execResult[4]
|
||||
];
|
||||
}
|
||||
}
|
||||
],
|
||||
template: '<div class="colorpicker dropdown-menu">'+
|
||||
'<div class="colorpicker-saturation"><i><b></b></i></div>'+
|
||||
'<div class="colorpicker-hue"><i></i></div>'+
|
||||
'<div class="colorpicker-alpha"><i></i></div>'+
|
||||
'<div class="colorpicker-color"><div /></div>'+
|
||||
'</div>'
|
||||
};
|
||||
|
||||
}( window.jQuery )
|
||||
157
modules/lib/complexify/jquery.complexify.js
Normal file
157
modules/lib/complexify/jquery.complexify.js
Normal file
@ -0,0 +1,157 @@
|
||||
/*
|
||||
http://github.com/danpalmer/jquery.complexify.js
|
||||
|
||||
This code is distributed under the WTFPL v2:
|
||||
*/
|
||||
(function ($) {
|
||||
|
||||
$.fn.extend({
|
||||
complexify: function(options, callback) {
|
||||
|
||||
var MIN_COMPLEXITY = 49; // 12 chars with Upper, Lower and Number
|
||||
var MAX_COMPLEXITY = 120; // 25 chars, all charsets
|
||||
var CHARSETS = [
|
||||
// Commonly Used
|
||||
////////////////////
|
||||
[0x0030, 0x0039], // Numbers
|
||||
[0x0041, 0x005A], // Uppercase
|
||||
[0x0061, 0x007A], // Lowercase
|
||||
[0x0021, 0x002F], // Punctuation
|
||||
[0x003A, 0x0040], // Punctuation
|
||||
[0x005B, 0x0060], // Punctuation
|
||||
[0x007B, 0x007E], // Punctuation
|
||||
// Everything Else
|
||||
////////////////////
|
||||
[0x0080, 0x00FF], // Latin-1 Supplement
|
||||
[0x0100, 0x017F], // Latin Extended-A
|
||||
[0x0180, 0x024F], // Latin Extended-B
|
||||
[0x0250, 0x02AF], // IPA Extensions
|
||||
[0x02B0, 0x02FF], // Spacing Modifier Letters
|
||||
[0x0300, 0x036F], // Combining Diacritical Marks
|
||||
[0x0370, 0x03FF], // Greek
|
||||
[0x0400, 0x04FF], // Cyrillic
|
||||
[0x0530, 0x058F], // Armenian
|
||||
[0x0590, 0x05FF], // Hebrew
|
||||
[0x0600, 0x06FF], // Arabic
|
||||
[0x0700, 0x074F], // Syriac
|
||||
[0x0780, 0x07BF], // Thaana
|
||||
[0x0900, 0x097F], // Devanagari
|
||||
[0x0980, 0x09FF], // Bengali
|
||||
[0x0A00, 0x0A7F], // Gurmukhi
|
||||
[0x0A80, 0x0AFF], // Gujarati
|
||||
[0x0B00, 0x0B7F], // Oriya
|
||||
[0x0B80, 0x0BFF], // Tamil
|
||||
[0x0C00, 0x0C7F], // Telugu
|
||||
[0x0C80, 0x0CFF], // Kannada
|
||||
[0x0D00, 0x0D7F], // Malayalam
|
||||
[0x0D80, 0x0DFF], // Sinhala
|
||||
[0x0E00, 0x0E7F], // Thai
|
||||
[0x0E80, 0x0EFF], // Lao
|
||||
[0x0F00, 0x0FFF], // Tibetan
|
||||
[0x1000, 0x109F], // Myanmar
|
||||
[0x10A0, 0x10FF], // Georgian
|
||||
[0x1100, 0x11FF], // Hangul Jamo
|
||||
[0x1200, 0x137F], // Ethiopic
|
||||
[0x13A0, 0x13FF], // Cherokee
|
||||
[0x1400, 0x167F], // Unified Canadian Aboriginal Syllabics
|
||||
[0x1680, 0x169F], // Ogham
|
||||
[0x16A0, 0x16FF], // Runic
|
||||
[0x1780, 0x17FF], // Khmer
|
||||
[0x1800, 0x18AF], // Mongolian
|
||||
[0x1E00, 0x1EFF], // Latin Extended Additional
|
||||
[0x1F00, 0x1FFF], // Greek Extended
|
||||
[0x2000, 0x206F], // General Punctuation
|
||||
[0x2070, 0x209F], // Superscripts and Subscripts
|
||||
[0x20A0, 0x20CF], // Currency Symbols
|
||||
[0x20D0, 0x20FF], // Combining Marks for Symbols
|
||||
[0x2100, 0x214F], // Letterlike Symbols
|
||||
[0x2150, 0x218F], // Number Forms
|
||||
[0x2190, 0x21FF], // Arrows
|
||||
[0x2200, 0x22FF], // Mathematical Operators
|
||||
[0x2300, 0x23FF], // Miscellaneous Technical
|
||||
[0x2400, 0x243F], // Control Pictures
|
||||
[0x2440, 0x245F], // Optical Character Recognition
|
||||
[0x2460, 0x24FF], // Enclosed Alphanumerics
|
||||
[0x2500, 0x257F], // Box Drawing
|
||||
[0x2580, 0x259F], // Block Elements
|
||||
[0x25A0, 0x25FF], // Geometric Shapes
|
||||
[0x2600, 0x26FF], // Miscellaneous Symbols
|
||||
[0x2700, 0x27BF], // Dingbats
|
||||
[0x2800, 0x28FF], // Braille Patterns
|
||||
[0x2E80, 0x2EFF], // CJK Radicals Supplement
|
||||
[0x2F00, 0x2FDF], // Kangxi Radicals
|
||||
[0x2FF0, 0x2FFF], // Ideographic Description Characters
|
||||
[0x3000, 0x303F], // CJK Symbols and Punctuation
|
||||
[0x3040, 0x309F], // Hiragana
|
||||
[0x30A0, 0x30FF], // Katakana
|
||||
[0x3100, 0x312F], // Bopomofo
|
||||
[0x3130, 0x318F], // Hangul Compatibility Jamo
|
||||
[0x3190, 0x319F], // Kanbun
|
||||
[0x31A0, 0x31BF], // Bopomofo Extended
|
||||
[0x3200, 0x32FF], // Enclosed CJK Letters and Months
|
||||
[0x3300, 0x33FF], // CJK Compatibility
|
||||
[0x3400, 0x4DB5], // CJK Unified Ideographs Extension A
|
||||
[0x4E00, 0x9FFF], // CJK Unified Ideographs
|
||||
[0xA000, 0xA48F], // Yi Syllables
|
||||
[0xA490, 0xA4CF], // Yi Radicals
|
||||
[0xAC00, 0xD7A3], // Hangul Syllables
|
||||
[0xD800, 0xDB7F], // High Surrogates
|
||||
[0xDB80, 0xDBFF], // High Private Use Surrogates
|
||||
[0xDC00, 0xDFFF], // Low Surrogates
|
||||
[0xE000, 0xF8FF], // Private Use
|
||||
[0xF900, 0xFAFF], // CJK Compatibility Ideographs
|
||||
[0xFB00, 0xFB4F], // Alphabetic Presentation Forms
|
||||
[0xFB50, 0xFDFF], // Arabic Presentation Forms-A
|
||||
[0xFE20, 0xFE2F], // Combining Half Marks
|
||||
[0xFE30, 0xFE4F], // CJK Compatibility Forms
|
||||
[0xFE50, 0xFE6F], // Small Form Variants
|
||||
[0xFE70, 0xFEFE], // Arabic Presentation Forms-B
|
||||
[0xFEFF, 0xFEFF], // Specials
|
||||
[0xFF00, 0xFFEF], // Halfwidth and Fullwidth Forms
|
||||
[0xFFF0, 0xFFFD] // Specials
|
||||
];
|
||||
|
||||
var defaults = {
|
||||
minimumChars: 8,
|
||||
strengthScaleFactor: 1
|
||||
};
|
||||
if($.isFunction(options) && !callback) {
|
||||
callback = options;
|
||||
options = {};
|
||||
}
|
||||
options = $.extend(defaults, options);
|
||||
|
||||
function additionalComplexityForCharset(str, charset) {
|
||||
for (var i = str.length - 1; i >= 0; i--) {
|
||||
if (charset[0] <= str.charCodeAt(i) && str.charCodeAt(i) <= charset[1]) {
|
||||
return charset[1] - charset[0] + 1;
|
||||
};
|
||||
}; return 0;
|
||||
};
|
||||
|
||||
return this.each(function () {
|
||||
$(this).keyup(function () {
|
||||
var password = $(this).val();
|
||||
var complexity = 0, valid = false;
|
||||
|
||||
for (var i = CHARSETS.length - 1; i >= 0; i--) {
|
||||
complexity += additionalComplexityForCharset(password, CHARSETS[i]);
|
||||
}
|
||||
|
||||
// Use natural log to produce linear scale
|
||||
complexity = Math.log(Math.pow(complexity, password.length)) * (1/options.strengthScaleFactor);
|
||||
|
||||
valid = (complexity > MIN_COMPLEXITY && password.length >= options.minimumChars);
|
||||
|
||||
// Scale to percentage, so it can be used for a progress bar
|
||||
complexity = (complexity / MAX_COMPLEXITY) * 100;
|
||||
complexity = (complexity > 100) ? 100 : complexity;
|
||||
|
||||
callback.call(this, valid, complexity);
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
9
modules/lib/complexify/jquery.complexify.min.js
vendored
Normal file
9
modules/lib/complexify/jquery.complexify.min.js
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
/*
|
||||
http://github.com/danpalmer/jquery.complexify.js
|
||||
This code is distributed under the WTFPL v2:
|
||||
*/
|
||||
(function($){$.fn.extend({complexify:function(options,callback){var MIN_COMPLEXITY=49;var MAX_COMPLEXITY=120;var CHARSETS=[[48,57],[65,90],[97,122],[33,47],[58,64],[91,96],[123,126],[128,255],[256,383],[384,591],[592,687],[688,767],[768,879],[880,1023],[1024,1279],[1328,1423],[1424,1535],[1536,1791],[1792,1871],[1920,1983],[2304,2431],[2432,2559],[2560,2687],[2688,2815],[2816,2943],[2944,3071],[3072,3199],[3200,3327],[3328,3455],[3456,3583],[3584,3711],[3712,3839],[3840,4095],[4096,4255],[4256,4351],
|
||||
[4352,4607],[4608,4991],[5024,5119],[5120,5759],[5760,5791],[5792,5887],[6016,6143],[6144,6319],[7680,7935],[7936,8191],[8192,8303],[8304,8351],[8352,8399],[8400,8447],[8448,8527],[8528,8591],[8592,8703],[8704,8959],[8960,9215],[9216,9279],[9280,9311],[9312,9471],[9472,9599],[9600,9631],[9632,9727],[9728,9983],[9984,10175],[10240,10495],[11904,12031],[12032,12255],[12272,12287],[12288,12351],[12352,12447],[12448,12543],[12544,12591],[12592,12687],[12688,12703],[12704,12735],[12800,13055],[13056,13311],
|
||||
[13312,19893],[19968,40959],[40960,42127],[42128,42191],[44032,55203],[55296,56191],[56192,56319],[56320,57343],[57344,63743],[63744,64255],[64256,64335],[64336,65023],[65056,65071],[65072,65103],[65104,65135],[65136,65278],[65279,65279],[65280,65519],[65520,65533]];var defaults={minimumChars:8,strengthScaleFactor:1};if($.isFunction(options)&&!callback){callback=options;options={}}options=$.extend(defaults,options);function additionalComplexityForCharset(str,charset){for(var i=str.length-1;i>=0;i--)if(charset[0]<=
|
||||
str.charCodeAt(i)&&str.charCodeAt(i)<=charset[1])return charset[1]-charset[0]+1;return 0}return this.each(function(){$(this).keyup(function(){var password=$(this).val();var complexity=0,valid=false;for(var i=CHARSETS.length-1;i>=0;i--)complexity+=additionalComplexityForCharset(password,CHARSETS[i]);complexity=Math.log(Math.pow(complexity,password.length))*(1/options.strengthScaleFactor);valid=complexity>MIN_COMPLEXITY&&password.length>=options.minimumChars;complexity=complexity/
|
||||
MAX_COMPLEXITY*100;complexity=complexity>100?100:complexity;callback.call(this,valid,complexity)})})}})})(jQuery);
|
||||
11
modules/lib/datatables/Readme.txt
Normal file
11
modules/lib/datatables/Readme.txt
Normal file
@ -0,0 +1,11 @@
|
||||
This DataTables plugin (v1.9.x) for jQuery was developed out of the desire to allow highly configurable access to HTML tables with advanced access features.
|
||||
|
||||
For detailed installation, usage and API instructions, please refer to the DataTables web-pages: http://www.datatables.net
|
||||
|
||||
Questions, feature requests and bug reports (etc) can all be asked on the DataTables forums: http://www.datatables.net/forums/
|
||||
|
||||
The DataTables source can be found in the media/js/ directory of this archive.
|
||||
|
||||
DataTables is released with dual licensing, using the GPL v2 (license-gpl2.txt) and an BSD style license (license-bsd.txt). You may select which of the two licenses you wish to use DataTables under. Please see the corresponding license file for details of these licenses. You are free to use, modify and distribute this software, but all copyright information must remain.
|
||||
|
||||
If you discover any bugs in DataTables, have any suggestions for improvements or even if you just like using it, please free to get in touch with me: www.datatables.net/contact
|
||||
233
modules/lib/datatables/jquery.dataTables.bootstrap.min.js
vendored
Normal file
233
modules/lib/datatables/jquery.dataTables.bootstrap.min.js
vendored
Normal file
@ -0,0 +1,233 @@
|
||||
/* Set the defaults for DataTables initialisation */
|
||||
$.extend( true, $.fn.dataTable.defaults, {
|
||||
"sDom": "<'dt-top-row'lf>r<'dt-wrapper't><'dt-row dt-bottom-row'ip>",
|
||||
"sPaginationType": "bootstrap",
|
||||
"oLanguage": {
|
||||
"sLengthMenu": "_MENU_",
|
||||
"sSearch": "_INPUT_"
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
/* Default class modification */
|
||||
$.extend( $.fn.dataTableExt.oStdClasses, {
|
||||
"sWrapper": "dataTables_wrapper form-inline"
|
||||
} );
|
||||
|
||||
|
||||
/* API method to get paging information */
|
||||
$.fn.dataTableExt.oApi.fnPagingInfo = function ( oSettings )
|
||||
{
|
||||
return {
|
||||
"iStart": oSettings._iDisplayStart,
|
||||
"iEnd": oSettings.fnDisplayEnd(),
|
||||
"iLength": oSettings._iDisplayLength,
|
||||
"iTotal": oSettings.fnRecordsTotal(),
|
||||
"iFilteredTotal": oSettings.fnRecordsDisplay(),
|
||||
"iPage": Math.ceil( oSettings._iDisplayStart / oSettings._iDisplayLength ),
|
||||
"iTotalPages": Math.ceil( oSettings.fnRecordsDisplay() / oSettings._iDisplayLength )
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
/* Bootstrap style pagination control */
|
||||
$.extend( $.fn.dataTableExt.oPagination, {
|
||||
"bootstrap": {
|
||||
"fnInit": function( oSettings, nPaging, fnDraw ) {
|
||||
var oLang = oSettings.oLanguage.oPaginate;
|
||||
var fnClickHandler = function ( e ) {
|
||||
e.preventDefault();
|
||||
if ( oSettings.oApi._fnPageChange(oSettings, e.data.action) ) {
|
||||
fnDraw( oSettings );
|
||||
}
|
||||
};
|
||||
|
||||
$(nPaging).addClass('pagination').append(
|
||||
'<ul>'+
|
||||
'<li class="prev disabled"><a href="#">'+oLang.sPrevious+'</a></li>'+
|
||||
'<li class="next disabled"><a href="#">'+oLang.sNext+'</a></li>'+
|
||||
'</ul>'
|
||||
);
|
||||
var els = $('a', nPaging);
|
||||
$(els[0]).bind( 'click.DT', { action: "previous" }, fnClickHandler );
|
||||
$(els[1]).bind( 'click.DT', { action: "next" }, fnClickHandler );
|
||||
},
|
||||
|
||||
"fnUpdate": function ( oSettings, fnDraw ) {
|
||||
var iListLength = 5;
|
||||
var oPaging = oSettings.oInstance.fnPagingInfo();
|
||||
var an = oSettings.aanFeatures.p;
|
||||
var i, j, sClass, iStart, iEnd, iHalf=Math.floor(iListLength/2);
|
||||
|
||||
if ( oPaging.iTotalPages < iListLength) {
|
||||
iStart = 1;
|
||||
iEnd = oPaging.iTotalPages;
|
||||
}
|
||||
else if ( oPaging.iPage <= iHalf ) {
|
||||
iStart = 1;
|
||||
iEnd = iListLength;
|
||||
} else if ( oPaging.iPage >= (oPaging.iTotalPages-iHalf) ) {
|
||||
iStart = oPaging.iTotalPages - iListLength + 1;
|
||||
iEnd = oPaging.iTotalPages;
|
||||
} else {
|
||||
iStart = oPaging.iPage - iHalf + 1;
|
||||
iEnd = iStart + iListLength - 1;
|
||||
}
|
||||
|
||||
for ( i=0, iLen=an.length ; i<iLen ; i++ ) {
|
||||
// Remove the middle elements
|
||||
$('li:gt(0)', an[i]).filter(':not(:last)').remove();
|
||||
|
||||
// Add the new list items and their event handlers
|
||||
for ( j=iStart ; j<=iEnd ; j++ ) {
|
||||
sClass = (j==oPaging.iPage+1) ? 'class="active"' : '';
|
||||
$('<li '+sClass+'><a href="#">'+j+'</a></li>')
|
||||
.insertBefore( $('li:last', an[i])[0] )
|
||||
.bind('click', function (e) {
|
||||
e.preventDefault();
|
||||
oSettings._iDisplayStart = (parseInt($('a', this).text(),10)-1) * oPaging.iLength;
|
||||
fnDraw( oSettings );
|
||||
} );
|
||||
}
|
||||
|
||||
// Add / remove disabled classes from the static elements
|
||||
if ( oPaging.iPage === 0 ) {
|
||||
$('li:first', an[i]).addClass('disabled');
|
||||
} else {
|
||||
$('li:first', an[i]).removeClass('disabled');
|
||||
}
|
||||
|
||||
if ( oPaging.iPage === oPaging.iTotalPages-1 || oPaging.iTotalPages === 0 ) {
|
||||
$('li:last', an[i]).addClass('disabled');
|
||||
} else {
|
||||
$('li:last', an[i]).removeClass('disabled');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
/* Bootstrap style pagination control */
|
||||
$.extend( $.fn.dataTableExt.oPagination, {
|
||||
"bootstrap_full": {
|
||||
"fnInit": function( oSettings, nPaging, fnDraw ) {
|
||||
var oLang = oSettings.oLanguage.oPaginate;
|
||||
var fnClickHandler = function ( e ) {
|
||||
e.preventDefault();
|
||||
if ( oSettings.oApi._fnPageChange(oSettings, e.data.action) ) {
|
||||
fnDraw( oSettings );
|
||||
}
|
||||
};
|
||||
|
||||
$(nPaging).addClass('pagination').append(
|
||||
'<ul>'+
|
||||
'<li class="first disabled"><a href="#">'+oLang.sFirst+'</a></li>'+
|
||||
'<li class="prev disabled"><a href="#">'+oLang.sPrevious+'</a></li>'+
|
||||
'<li class="next disabled"><a href="#">'+oLang.sNext+'</a></li>'+
|
||||
'<li class="last disabled"><a href="#">'+oLang.sLast+'</a></li>'+
|
||||
'</ul>'
|
||||
);
|
||||
var els = $('a', nPaging);
|
||||
$(els[0]).bind( 'click.DT', { action: "first" }, fnClickHandler );
|
||||
$(els[1]).bind( 'click.DT', { action: "previous" }, fnClickHandler );
|
||||
$(els[2]).bind( 'click.DT', { action: "next" }, fnClickHandler );
|
||||
$(els[3]).bind( 'click.DT', { action: "last" }, fnClickHandler );
|
||||
},
|
||||
|
||||
"fnUpdate": function ( oSettings, fnDraw ) {
|
||||
var iListLength = 5;
|
||||
var oPaging = oSettings.oInstance.fnPagingInfo();
|
||||
var an = oSettings.aanFeatures.p;
|
||||
var i, j, sClass, iStart, iEnd, iHalf=Math.floor(iListLength/2);
|
||||
|
||||
if ( oPaging.iTotalPages < iListLength) {
|
||||
iStart = 1;
|
||||
iEnd = oPaging.iTotalPages;
|
||||
}
|
||||
else if ( oPaging.iPage <= iHalf ) {
|
||||
iStart = 1;
|
||||
iEnd = iListLength;
|
||||
} else if ( oPaging.iPage >= (oPaging.iTotalPages-iHalf) ) {
|
||||
iStart = oPaging.iTotalPages - iListLength + 1;
|
||||
iEnd = oPaging.iTotalPages;
|
||||
} else {
|
||||
iStart = oPaging.iPage - iHalf + 1;
|
||||
iEnd = iStart + iListLength - 1;
|
||||
}
|
||||
|
||||
for ( i=0, iLen=an.length ; i<iLen ; i++ ) {
|
||||
// Remove the middle elements
|
||||
$('li', an[i]).filter(":not(.first)").filter(":not(.last)").filter(":not(.prev)").filter(":not(.next)").remove();
|
||||
|
||||
// Add the new list items and their event handlers
|
||||
for ( j=iStart ; j<=iEnd ; j++ ) {
|
||||
sClass = (j==oPaging.iPage+1) ? 'class="active"' : '';
|
||||
$('<li '+sClass+'><a href="#">'+j+'</a></li>')
|
||||
.insertBefore( $('li.next', an[i])[0] )
|
||||
.bind('click', function (e) {
|
||||
e.preventDefault();
|
||||
oSettings._iDisplayStart = (parseInt($('a', this).text(),10)-1) * oPaging.iLength;
|
||||
fnDraw( oSettings );
|
||||
} );
|
||||
}
|
||||
|
||||
// Add / remove disabled classes from the static elements
|
||||
if ( oPaging.iPage === 0 ) {
|
||||
$('li.first', an[i]).addClass('disabled');
|
||||
$('li.prev', an[i]).addClass('disabled');
|
||||
} else {
|
||||
$('li.prev', an[i]).removeClass('disabled');
|
||||
$('li.first', an[i]).removeClass('disabled');
|
||||
}
|
||||
|
||||
if ( oPaging.iPage === oPaging.iTotalPages-1 || oPaging.iTotalPages === 0 ) {
|
||||
$('li.last', an[i]).addClass('disabled');
|
||||
$('li.next', an[i]).addClass('disabled');
|
||||
} else {
|
||||
$('li.next', an[i]).removeClass('disabled');
|
||||
$('li.last', an[i]).removeClass('disabled');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
/*
|
||||
* TableTools Bootstrap compatibility
|
||||
* Required TableTools 2.1+
|
||||
*/
|
||||
if ( $.fn.DataTable.TableTools ) {
|
||||
// Set the classes that TableTools uses to something suitable for Bootstrap
|
||||
$.extend( true, $.fn.DataTable.TableTools.classes, {
|
||||
"container": "DTTT btn-group",
|
||||
"buttons": {
|
||||
"normal": "btn",
|
||||
"disabled": "disabled"
|
||||
},
|
||||
"collection": {
|
||||
"container": "DTTT_dropdown dropdown-menu",
|
||||
"buttons": {
|
||||
"normal": "",
|
||||
"disabled": "disabled"
|
||||
}
|
||||
},
|
||||
"print": {
|
||||
"info": "DTTT_print_info modal"
|
||||
},
|
||||
"select": {
|
||||
"row": "active"
|
||||
}
|
||||
} );
|
||||
|
||||
// Have the collection use a bootstrap compatible dropdown
|
||||
$.extend( true, $.fn.DataTable.TableTools.DEFAULTS.oTags, {
|
||||
"collection": {
|
||||
"container": "ul",
|
||||
"button": "li",
|
||||
"liner": "a"
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
$.extend($.fn.dataTableExt.oPagination,{bootstrap_alt:{fnInit:function(d,e,b){var c=d.oLanguage.oPaginate,a=function(a){a.preventDefault();d.oApi._fnPageChange(d,a.data.action)&&b(d)};$(e).addClass("pagination").append('<ul><li class="first disabled"><a href="#"><< '+c.sFirst+'</a></li><li class="prev disabled"><a href="#">< '+c.sPrevious+'</a></li><li class="next disabled"><a href="#">'+c.sNext+' ></a></li><li class="last disabled"><a href="#">'+c.sLast+" >></a></li></ul>");e=$("a", e);$(e[0]).bind("click.DT",{action:"first"},a);$(e[1]).bind("click.DT",{action:"previous"},a);$(e[2]).bind("click.DT",{action:"next"},a);$(e[3]).bind("click.DT",{action:"last"},a)},fnUpdate:function(d,e){var b=d.oInstance.fnPagingInfo(),c=d.aanFeatures.p,a,g,i,f,h;a=Math.floor(2.5);5>b.iTotalPages?(f=1,h=b.iTotalPages):b.iPage<=a?(f=1,h=5):b.iPage>=b.iTotalPages-a?(f=b.iTotalPages-5+1,h=b.iTotalPages):(f=b.iPage-a+1,h=f+5-1);a=0;for(iLen=c.length;a<iLen;a++){$("li",c[a]).filter(":not(.first)").filter(":not(.last)").filter(":not(.prev)").filter(":not(.next)").remove(); var j=$(c[a]).find(".next");for(g=f;g<=h;g++)i=g==b.iPage+1?'class="active"':"",$("<li "+i+'><a href="#">'+g+"</a></li>").insertBefore(j).bind("click",function(a){a.preventDefault();d._iDisplayStart=(parseInt($("a",this).text(),10)-1)*b.iLength;e(d)});0===b.iPage?($("li.first",c[a]).addClass("disabled"),$("li.prev",c[a]).addClass("disabled")):($("li.first",c[a]).removeClass("disabled"),$("li.prev",c[a]).removeClass("disabled"));b.iPage===b.iTotalPages-1||0===b.iTotalPages?($("li.next",c[a]).addClass("disabled"), $("li.last",c[a]).addClass("disabled")):($("li.next",c[a]).removeClass("disabled"),$("li.last",c[a]).removeClass("disabled"))}}}});
|
||||
12099
modules/lib/datatables/jquery.dataTables.js
vendored
Normal file
12099
modules/lib/datatables/jquery.dataTables.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
155
modules/lib/datatables/jquery.dataTables.min.js
vendored
Normal file
155
modules/lib/datatables/jquery.dataTables.min.js
vendored
Normal file
@ -0,0 +1,155 @@
|
||||
/*
|
||||
* File: jquery.dataTables.min.js
|
||||
* Version: 1.9.4
|
||||
* Author: Allan Jardine (www.sprymedia.co.uk)
|
||||
* Info: www.datatables.net
|
||||
*
|
||||
* Copyright 2008-2012 Allan Jardine, all rights reserved.
|
||||
*
|
||||
* This source file is free software, under either the GPL v2 license or a
|
||||
* BSD style license, available at:
|
||||
* http://datatables.net/license_gpl2
|
||||
* http://datatables.net/license_bsd
|
||||
*
|
||||
* This source file is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
|
||||
*/
|
||||
(function(X,l,n){var L=function(h){var j=function(e){function o(a,b){var c=j.defaults.columns,d=a.aoColumns.length,c=h.extend({},j.models.oColumn,c,{sSortingClass:a.oClasses.sSortable,sSortingClassJUI:a.oClasses.sSortJUI,nTh:b?b:l.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mData:c.mData?c.oDefaults:d});a.aoColumns.push(c);if(a.aoPreSearchCols[d]===n||null===a.aoPreSearchCols[d])a.aoPreSearchCols[d]=h.extend({},j.models.oSearch);else if(c=a.aoPreSearchCols[d],
|
||||
c.bRegex===n&&(c.bRegex=!0),c.bSmart===n&&(c.bSmart=!0),c.bCaseInsensitive===n)c.bCaseInsensitive=!0;m(a,d,null)}function m(a,b,c){var d=a.aoColumns[b];c!==n&&null!==c&&(c.mDataProp&&!c.mData&&(c.mData=c.mDataProp),c.sType!==n&&(d.sType=c.sType,d._bAutoType=!1),h.extend(d,c),p(d,c,"sWidth","sWidthOrig"),c.iDataSort!==n&&(d.aDataSort=[c.iDataSort]),p(d,c,"aDataSort"));var i=d.mRender?Q(d.mRender):null,f=Q(d.mData);d.fnGetData=function(a,b){var c=f(a,b);return d.mRender&&b&&""!==b?i(c,b,a):c};d.fnSetData=
|
||||
L(d.mData);a.oFeatures.bSort||(d.bSortable=!1);!d.bSortable||-1==h.inArray("asc",d.asSorting)&&-1==h.inArray("desc",d.asSorting)?(d.sSortingClass=a.oClasses.sSortableNone,d.sSortingClassJUI=""):-1==h.inArray("asc",d.asSorting)&&-1==h.inArray("desc",d.asSorting)?(d.sSortingClass=a.oClasses.sSortable,d.sSortingClassJUI=a.oClasses.sSortJUI):-1!=h.inArray("asc",d.asSorting)&&-1==h.inArray("desc",d.asSorting)?(d.sSortingClass=a.oClasses.sSortableAsc,d.sSortingClassJUI=a.oClasses.sSortJUIAscAllowed):-1==
|
||||
h.inArray("asc",d.asSorting)&&-1!=h.inArray("desc",d.asSorting)&&(d.sSortingClass=a.oClasses.sSortableDesc,d.sSortingClassJUI=a.oClasses.sSortJUIDescAllowed)}function k(a){if(!1===a.oFeatures.bAutoWidth)return!1;da(a);for(var b=0,c=a.aoColumns.length;b<c;b++)a.aoColumns[b].nTh.style.width=a.aoColumns[b].sWidth}function G(a,b){var c=r(a,"bVisible");return"number"===typeof c[b]?c[b]:null}function R(a,b){var c=r(a,"bVisible"),c=h.inArray(b,c);return-1!==c?c:null}function t(a){return r(a,"bVisible").length}
|
||||
function r(a,b){var c=[];h.map(a.aoColumns,function(a,i){a[b]&&c.push(i)});return c}function B(a){for(var b=j.ext.aTypes,c=b.length,d=0;d<c;d++){var i=b[d](a);if(null!==i)return i}return"string"}function u(a,b){for(var c=b.split(","),d=[],i=0,f=a.aoColumns.length;i<f;i++)for(var g=0;g<f;g++)if(a.aoColumns[i].sName==c[g]){d.push(g);break}return d}function M(a){for(var b="",c=0,d=a.aoColumns.length;c<d;c++)b+=a.aoColumns[c].sName+",";return b.length==d?"":b.slice(0,-1)}function ta(a,b,c,d){var i,f,
|
||||
g,e,w;if(b)for(i=b.length-1;0<=i;i--){var j=b[i].aTargets;h.isArray(j)||D(a,1,"aTargets must be an array of targets, not a "+typeof j);f=0;for(g=j.length;f<g;f++)if("number"===typeof j[f]&&0<=j[f]){for(;a.aoColumns.length<=j[f];)o(a);d(j[f],b[i])}else if("number"===typeof j[f]&&0>j[f])d(a.aoColumns.length+j[f],b[i]);else if("string"===typeof j[f]){e=0;for(w=a.aoColumns.length;e<w;e++)("_all"==j[f]||h(a.aoColumns[e].nTh).hasClass(j[f]))&&d(e,b[i])}}if(c){i=0;for(a=c.length;i<a;i++)d(i,c[i])}}function H(a,
|
||||
b){var c;c=h.isArray(b)?b.slice():h.extend(!0,{},b);var d=a.aoData.length,i=h.extend(!0,{},j.models.oRow);i._aData=c;a.aoData.push(i);for(var f,i=0,g=a.aoColumns.length;i<g;i++)c=a.aoColumns[i],"function"===typeof c.fnRender&&c.bUseRendered&&null!==c.mData?F(a,d,i,S(a,d,i)):F(a,d,i,v(a,d,i)),c._bAutoType&&"string"!=c.sType&&(f=v(a,d,i,"type"),null!==f&&""!==f&&(f=B(f),null===c.sType?c.sType=f:c.sType!=f&&"html"!=c.sType&&(c.sType="string")));a.aiDisplayMaster.push(d);a.oFeatures.bDeferRender||ea(a,
|
||||
d);return d}function ua(a){var b,c,d,i,f,g,e;if(a.bDeferLoading||null===a.sAjaxSource)for(b=a.nTBody.firstChild;b;){if("TR"==b.nodeName.toUpperCase()){c=a.aoData.length;b._DT_RowIndex=c;a.aoData.push(h.extend(!0,{},j.models.oRow,{nTr:b}));a.aiDisplayMaster.push(c);f=b.firstChild;for(d=0;f;){g=f.nodeName.toUpperCase();if("TD"==g||"TH"==g)F(a,c,d,h.trim(f.innerHTML)),d++;f=f.nextSibling}}b=b.nextSibling}i=T(a);d=[];b=0;for(c=i.length;b<c;b++)for(f=i[b].firstChild;f;)g=f.nodeName.toUpperCase(),("TD"==
|
||||
g||"TH"==g)&&d.push(f),f=f.nextSibling;c=0;for(i=a.aoColumns.length;c<i;c++){e=a.aoColumns[c];null===e.sTitle&&(e.sTitle=e.nTh.innerHTML);var w=e._bAutoType,o="function"===typeof e.fnRender,k=null!==e.sClass,n=e.bVisible,m,p;if(w||o||k||!n){g=0;for(b=a.aoData.length;g<b;g++)f=a.aoData[g],m=d[g*i+c],w&&"string"!=e.sType&&(p=v(a,g,c,"type"),""!==p&&(p=B(p),null===e.sType?e.sType=p:e.sType!=p&&"html"!=e.sType&&(e.sType="string"))),e.mRender?m.innerHTML=v(a,g,c,"display"):e.mData!==c&&(m.innerHTML=v(a,
|
||||
g,c,"display")),o&&(p=S(a,g,c),m.innerHTML=p,e.bUseRendered&&F(a,g,c,p)),k&&(m.className+=" "+e.sClass),n?f._anHidden[c]=null:(f._anHidden[c]=m,m.parentNode.removeChild(m)),e.fnCreatedCell&&e.fnCreatedCell.call(a.oInstance,m,v(a,g,c,"display"),f._aData,g,c)}}if(0!==a.aoRowCreatedCallback.length){b=0;for(c=a.aoData.length;b<c;b++)f=a.aoData[b],A(a,"aoRowCreatedCallback",null,[f.nTr,f._aData,b])}}function I(a,b){return b._DT_RowIndex!==n?b._DT_RowIndex:null}function fa(a,b,c){for(var b=J(a,b),d=0,a=
|
||||
a.aoColumns.length;d<a;d++)if(b[d]===c)return d;return-1}function Y(a,b,c,d){for(var i=[],f=0,g=d.length;f<g;f++)i.push(v(a,b,d[f],c));return i}function v(a,b,c,d){var i=a.aoColumns[c];if((c=i.fnGetData(a.aoData[b]._aData,d))===n)return a.iDrawError!=a.iDraw&&null===i.sDefaultContent&&(D(a,0,"Requested unknown parameter "+("function"==typeof i.mData?"{mData function}":"'"+i.mData+"'")+" from the data source for row "+b),a.iDrawError=a.iDraw),i.sDefaultContent;if(null===c&&null!==i.sDefaultContent)c=
|
||||
i.sDefaultContent;else if("function"===typeof c)return c();return"display"==d&&null===c?"":c}function F(a,b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,d)}function Q(a){if(null===a)return function(){return null};if("function"===typeof a)return function(b,d,i){return a(b,d,i)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("["))){var b=function(a,d,i){var f=i.split("."),g;if(""!==i){var e=0;for(g=f.length;e<g;e++){if(i=f[e].match(U)){f[e]=f[e].replace(U,"");""!==f[e]&&(a=a[f[e]]);
|
||||
g=[];f.splice(0,e+1);for(var f=f.join("."),e=0,h=a.length;e<h;e++)g.push(b(a[e],d,f));a=i[0].substring(1,i[0].length-1);a=""===a?g:g.join(a);break}if(null===a||a[f[e]]===n)return n;a=a[f[e]]}}return a};return function(c,d){return b(c,d,a)}}return function(b){return b[a]}}function L(a){if(null===a)return function(){};if("function"===typeof a)return function(b,d){a(b,"set",d)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("["))){var b=function(a,d,i){var i=i.split("."),f,g,e=0;for(g=
|
||||
i.length-1;e<g;e++){if(f=i[e].match(U)){i[e]=i[e].replace(U,"");a[i[e]]=[];f=i.slice();f.splice(0,e+1);g=f.join(".");for(var h=0,j=d.length;h<j;h++)f={},b(f,d[h],g),a[i[e]].push(f);return}if(null===a[i[e]]||a[i[e]]===n)a[i[e]]={};a=a[i[e]]}a[i[i.length-1].replace(U,"")]=d};return function(c,d){return b(c,d,a)}}return function(b,d){b[a]=d}}function Z(a){for(var b=[],c=a.aoData.length,d=0;d<c;d++)b.push(a.aoData[d]._aData);return b}function ga(a){a.aoData.splice(0,a.aoData.length);a.aiDisplayMaster.splice(0,
|
||||
a.aiDisplayMaster.length);a.aiDisplay.splice(0,a.aiDisplay.length);y(a)}function ha(a,b){for(var c=-1,d=0,i=a.length;d<i;d++)a[d]==b?c=d:a[d]>b&&a[d]--; -1!=c&&a.splice(c,1)}function S(a,b,c){var d=a.aoColumns[c];return d.fnRender({iDataRow:b,iDataColumn:c,oSettings:a,aData:a.aoData[b]._aData,mDataProp:d.mData},v(a,b,c,"display"))}function ea(a,b){var c=a.aoData[b],d;if(null===c.nTr){c.nTr=l.createElement("tr");c.nTr._DT_RowIndex=b;c._aData.DT_RowId&&(c.nTr.id=c._aData.DT_RowId);c._aData.DT_RowClass&&
|
||||
(c.nTr.className=c._aData.DT_RowClass);for(var i=0,f=a.aoColumns.length;i<f;i++){var g=a.aoColumns[i];d=l.createElement(g.sCellType);d.innerHTML="function"===typeof g.fnRender&&(!g.bUseRendered||null===g.mData)?S(a,b,i):v(a,b,i,"display");null!==g.sClass&&(d.className=g.sClass);g.bVisible?(c.nTr.appendChild(d),c._anHidden[i]=null):c._anHidden[i]=d;g.fnCreatedCell&&g.fnCreatedCell.call(a.oInstance,d,v(a,b,i,"display"),c._aData,b,i)}A(a,"aoRowCreatedCallback",null,[c.nTr,c._aData,b])}}function va(a){var b,
|
||||
c,d;if(0!==h("th, td",a.nTHead).length){b=0;for(d=a.aoColumns.length;b<d;b++)if(c=a.aoColumns[b].nTh,c.setAttribute("role","columnheader"),a.aoColumns[b].bSortable&&(c.setAttribute("tabindex",a.iTabIndex),c.setAttribute("aria-controls",a.sTableId)),null!==a.aoColumns[b].sClass&&h(c).addClass(a.aoColumns[b].sClass),a.aoColumns[b].sTitle!=c.innerHTML)c.innerHTML=a.aoColumns[b].sTitle}else{var i=l.createElement("tr");b=0;for(d=a.aoColumns.length;b<d;b++)c=a.aoColumns[b].nTh,c.innerHTML=a.aoColumns[b].sTitle,
|
||||
c.setAttribute("tabindex","0"),null!==a.aoColumns[b].sClass&&h(c).addClass(a.aoColumns[b].sClass),i.appendChild(c);h(a.nTHead).html("")[0].appendChild(i);V(a.aoHeader,a.nTHead)}h(a.nTHead).children("tr").attr("role","row");if(a.bJUI){b=0;for(d=a.aoColumns.length;b<d;b++){c=a.aoColumns[b].nTh;i=l.createElement("div");i.className=a.oClasses.sSortJUIWrapper;h(c).contents().appendTo(i);var f=l.createElement("span");f.className=a.oClasses.sSortIcon;i.appendChild(f);c.appendChild(i)}}if(a.oFeatures.bSort)for(b=
|
||||
0;b<a.aoColumns.length;b++)!1!==a.aoColumns[b].bSortable?ia(a,a.aoColumns[b].nTh,b):h(a.aoColumns[b].nTh).addClass(a.oClasses.sSortableNone);""!==a.oClasses.sFooterTH&&h(a.nTFoot).children("tr").children("th").addClass(a.oClasses.sFooterTH);if(null!==a.nTFoot){c=N(a,null,a.aoFooter);b=0;for(d=a.aoColumns.length;b<d;b++)c[b]&&(a.aoColumns[b].nTf=c[b],a.aoColumns[b].sClass&&h(c[b]).addClass(a.aoColumns[b].sClass))}}function W(a,b,c){var d,i,f,g=[],e=[],h=a.aoColumns.length,j;c===n&&(c=!1);d=0;for(i=
|
||||
b.length;d<i;d++){g[d]=b[d].slice();g[d].nTr=b[d].nTr;for(f=h-1;0<=f;f--)!a.aoColumns[f].bVisible&&!c&&g[d].splice(f,1);e.push([])}d=0;for(i=g.length;d<i;d++){if(a=g[d].nTr)for(;f=a.firstChild;)a.removeChild(f);f=0;for(b=g[d].length;f<b;f++)if(j=h=1,e[d][f]===n){a.appendChild(g[d][f].cell);for(e[d][f]=1;g[d+h]!==n&&g[d][f].cell==g[d+h][f].cell;)e[d+h][f]=1,h++;for(;g[d][f+j]!==n&&g[d][f].cell==g[d][f+j].cell;){for(c=0;c<h;c++)e[d+c][f+j]=1;j++}g[d][f].cell.rowSpan=h;g[d][f].cell.colSpan=j}}}function x(a){var b=
|
||||
A(a,"aoPreDrawCallback","preDraw",[a]);if(-1!==h.inArray(!1,b))E(a,!1);else{var c,d,b=[],i=0,f=a.asStripeClasses.length;c=a.aoOpenRows.length;a.bDrawing=!0;a.iInitDisplayStart!==n&&-1!=a.iInitDisplayStart&&(a._iDisplayStart=a.oFeatures.bServerSide?a.iInitDisplayStart:a.iInitDisplayStart>=a.fnRecordsDisplay()?0:a.iInitDisplayStart,a.iInitDisplayStart=-1,y(a));if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++;else if(a.oFeatures.bServerSide){if(!a.bDestroying&&!wa(a))return}else a.iDraw++;if(0!==a.aiDisplay.length){var g=
|
||||
a._iDisplayStart;d=a._iDisplayEnd;a.oFeatures.bServerSide&&(g=0,d=a.aoData.length);for(;g<d;g++){var e=a.aoData[a.aiDisplay[g]];null===e.nTr&&ea(a,a.aiDisplay[g]);var j=e.nTr;if(0!==f){var o=a.asStripeClasses[i%f];e._sRowStripe!=o&&(h(j).removeClass(e._sRowStripe).addClass(o),e._sRowStripe=o)}A(a,"aoRowCallback",null,[j,a.aoData[a.aiDisplay[g]]._aData,i,g]);b.push(j);i++;if(0!==c)for(e=0;e<c;e++)if(j==a.aoOpenRows[e].nParent){b.push(a.aoOpenRows[e].nTr);break}}}else b[0]=l.createElement("tr"),a.asStripeClasses[0]&&
|
||||
(b[0].className=a.asStripeClasses[0]),c=a.oLanguage,f=c.sZeroRecords,1==a.iDraw&&null!==a.sAjaxSource&&!a.oFeatures.bServerSide?f=c.sLoadingRecords:c.sEmptyTable&&0===a.fnRecordsTotal()&&(f=c.sEmptyTable),c=l.createElement("td"),c.setAttribute("valign","top"),c.colSpan=t(a),c.className=a.oClasses.sRowEmpty,c.innerHTML=ja(a,f),b[i].appendChild(c);A(a,"aoHeaderCallback","header",[h(a.nTHead).children("tr")[0],Z(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay]);A(a,"aoFooterCallback","footer",[h(a.nTFoot).children("tr")[0],
|
||||
Z(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay]);i=l.createDocumentFragment();c=l.createDocumentFragment();if(a.nTBody){f=a.nTBody.parentNode;c.appendChild(a.nTBody);if(!a.oScroll.bInfinite||!a._bInitComplete||a.bSorted||a.bFiltered)for(;c=a.nTBody.firstChild;)a.nTBody.removeChild(c);c=0;for(d=b.length;c<d;c++)i.appendChild(b[c]);a.nTBody.appendChild(i);null!==f&&f.appendChild(a.nTBody)}A(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing=!1;a.oFeatures.bServerSide&&(E(a,!1),
|
||||
a._bInitComplete||$(a))}}function aa(a){a.oFeatures.bSort?O(a,a.oPreviousSearch):a.oFeatures.bFilter?K(a,a.oPreviousSearch):(y(a),x(a))}function xa(a){var b=h("<div></div>")[0];a.nTable.parentNode.insertBefore(b,a.nTable);a.nTableWrapper=h('<div id="'+a.sTableId+'_wrapper" class="'+a.oClasses.sWrapper+'" role="grid"></div>')[0];a.nTableReinsertBefore=a.nTable.nextSibling;for(var c=a.nTableWrapper,d=a.sDom.split(""),i,f,g,e,w,o,k,m=0;m<d.length;m++){f=0;g=d[m];if("<"==g){e=h("<div></div>")[0];w=d[m+
|
||||
1];if("'"==w||'"'==w){o="";for(k=2;d[m+k]!=w;)o+=d[m+k],k++;"H"==o?o=a.oClasses.sJUIHeader:"F"==o&&(o=a.oClasses.sJUIFooter);-1!=o.indexOf(".")?(w=o.split("."),e.id=w[0].substr(1,w[0].length-1),e.className=w[1]):"#"==o.charAt(0)?e.id=o.substr(1,o.length-1):e.className=o;m+=k}c.appendChild(e);c=e}else if(">"==g)c=c.parentNode;else if("l"==g&&a.oFeatures.bPaginate&&a.oFeatures.bLengthChange)i=ya(a),f=1;else if("f"==g&&a.oFeatures.bFilter)i=za(a),f=1;else if("r"==g&&a.oFeatures.bProcessing)i=Aa(a),f=
|
||||
1;else if("t"==g)i=Ba(a),f=1;else if("i"==g&&a.oFeatures.bInfo)i=Ca(a),f=1;else if("p"==g&&a.oFeatures.bPaginate)i=Da(a),f=1;else if(0!==j.ext.aoFeatures.length){e=j.ext.aoFeatures;k=0;for(w=e.length;k<w;k++)if(g==e[k].cFeature){(i=e[k].fnInit(a))&&(f=1);break}}1==f&&null!==i&&("object"!==typeof a.aanFeatures[g]&&(a.aanFeatures[g]=[]),a.aanFeatures[g].push(i),c.appendChild(i))}b.parentNode.replaceChild(a.nTableWrapper,b)}function V(a,b){var c=h(b).children("tr"),d,i,f,g,e,j,o,k,m,p;a.splice(0,a.length);
|
||||
f=0;for(j=c.length;f<j;f++)a.push([]);f=0;for(j=c.length;f<j;f++){d=c[f];for(i=d.firstChild;i;){if("TD"==i.nodeName.toUpperCase()||"TH"==i.nodeName.toUpperCase()){k=1*i.getAttribute("colspan");m=1*i.getAttribute("rowspan");k=!k||0===k||1===k?1:k;m=!m||0===m||1===m?1:m;g=0;for(e=a[f];e[g];)g++;o=g;p=1===k?!0:!1;for(e=0;e<k;e++)for(g=0;g<m;g++)a[f+g][o+e]={cell:i,unique:p},a[f+g].nTr=d}i=i.nextSibling}}}function N(a,b,c){var d=[];c||(c=a.aoHeader,b&&(c=[],V(c,b)));for(var b=0,i=c.length;b<i;b++)for(var f=
|
||||
0,g=c[b].length;f<g;f++)if(c[b][f].unique&&(!d[f]||!a.bSortCellsTop))d[f]=c[b][f].cell;return d}function wa(a){if(a.bAjaxDataGet){a.iDraw++;E(a,!0);var b=Ea(a);ka(a,b);a.fnServerData.call(a.oInstance,a.sAjaxSource,b,function(b){Fa(a,b)},a);return!1}return!0}function Ea(a){var b=a.aoColumns.length,c=[],d,i,f,g;c.push({name:"sEcho",value:a.iDraw});c.push({name:"iColumns",value:b});c.push({name:"sColumns",value:M(a)});c.push({name:"iDisplayStart",value:a._iDisplayStart});c.push({name:"iDisplayLength",
|
||||
value:!1!==a.oFeatures.bPaginate?a._iDisplayLength:-1});for(f=0;f<b;f++)d=a.aoColumns[f].mData,c.push({name:"mDataProp_"+f,value:"function"===typeof d?"function":d});if(!1!==a.oFeatures.bFilter){c.push({name:"sSearch",value:a.oPreviousSearch.sSearch});c.push({name:"bRegex",value:a.oPreviousSearch.bRegex});for(f=0;f<b;f++)c.push({name:"sSearch_"+f,value:a.aoPreSearchCols[f].sSearch}),c.push({name:"bRegex_"+f,value:a.aoPreSearchCols[f].bRegex}),c.push({name:"bSearchable_"+f,value:a.aoColumns[f].bSearchable})}if(!1!==
|
||||
a.oFeatures.bSort){var e=0;d=null!==a.aaSortingFixed?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(f=0;f<d.length;f++){i=a.aoColumns[d[f][0]].aDataSort;for(g=0;g<i.length;g++)c.push({name:"iSortCol_"+e,value:i[g]}),c.push({name:"sSortDir_"+e,value:d[f][1]}),e++}c.push({name:"iSortingCols",value:e});for(f=0;f<b;f++)c.push({name:"bSortable_"+f,value:a.aoColumns[f].bSortable})}return c}function ka(a,b){A(a,"aoServerParams","serverParams",[b])}function Fa(a,b){if(b.sEcho!==n){if(1*b.sEcho<
|
||||
a.iDraw)return;a.iDraw=1*b.sEcho}(!a.oScroll.bInfinite||a.oScroll.bInfinite&&(a.bSorted||a.bFiltered))&&ga(a);a._iRecordsTotal=parseInt(b.iTotalRecords,10);a._iRecordsDisplay=parseInt(b.iTotalDisplayRecords,10);var c=M(a),c=b.sColumns!==n&&""!==c&&b.sColumns!=c,d;c&&(d=u(a,b.sColumns));for(var i=Q(a.sAjaxDataProp)(b),f=0,g=i.length;f<g;f++)if(c){for(var e=[],h=0,j=a.aoColumns.length;h<j;h++)e.push(i[f][d[h]]);H(a,e)}else H(a,i[f]);a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=!1;x(a);a.bAjaxDataGet=
|
||||
!0;E(a,!1)}function za(a){var b=a.oPreviousSearch,c=a.oLanguage.sSearch,c=-1!==c.indexOf("_INPUT_")?c.replace("_INPUT_",'<input type="text" />'):""===c?'<input type="text" />':c+' <input type="text" />',d=l.createElement("div");d.className=a.oClasses.sFilter;d.innerHTML="<label>"+c+"</label>";a.aanFeatures.f||(d.id=a.sTableId+"_filter");c=h('input[type="text"]',d);d._DT_Input=c[0];c.val(b.sSearch.replace('"',"""));c.bind("keyup.DT",function(){for(var c=a.aanFeatures.f,d=this.value===""?"":this.value,
|
||||
g=0,e=c.length;g<e;g++)c[g]!=h(this).parents("div.dataTables_filter")[0]&&h(c[g]._DT_Input).val(d);d!=b.sSearch&&K(a,{sSearch:d,bRegex:b.bRegex,bSmart:b.bSmart,bCaseInsensitive:b.bCaseInsensitive})});c.attr("aria-controls",a.sTableId).bind("keypress.DT",function(a){if(a.keyCode==13)return false});return d}function K(a,b,c){var d=a.oPreviousSearch,i=a.aoPreSearchCols,f=function(a){d.sSearch=a.sSearch;d.bRegex=a.bRegex;d.bSmart=a.bSmart;d.bCaseInsensitive=a.bCaseInsensitive};if(a.oFeatures.bServerSide)f(b);
|
||||
else{Ga(a,b.sSearch,c,b.bRegex,b.bSmart,b.bCaseInsensitive);f(b);for(b=0;b<a.aoPreSearchCols.length;b++)Ha(a,i[b].sSearch,b,i[b].bRegex,i[b].bSmart,i[b].bCaseInsensitive);Ia(a)}a.bFiltered=!0;h(a.oInstance).trigger("filter",a);a._iDisplayStart=0;y(a);x(a);la(a,0)}function Ia(a){for(var b=j.ext.afnFiltering,c=r(a,"bSearchable"),d=0,i=b.length;d<i;d++)for(var f=0,g=0,e=a.aiDisplay.length;g<e;g++){var h=a.aiDisplay[g-f];b[d](a,Y(a,h,"filter",c),h)||(a.aiDisplay.splice(g-f,1),f++)}}function Ha(a,b,c,
|
||||
d,i,f){if(""!==b)for(var g=0,b=ma(b,d,i,f),d=a.aiDisplay.length-1;0<=d;d--)i=Ja(v(a,a.aiDisplay[d],c,"filter"),a.aoColumns[c].sType),b.test(i)||(a.aiDisplay.splice(d,1),g++)}function Ga(a,b,c,d,i,f){d=ma(b,d,i,f);i=a.oPreviousSearch;c||(c=0);0!==j.ext.afnFiltering.length&&(c=1);if(0>=b.length)a.aiDisplay.splice(0,a.aiDisplay.length),a.aiDisplay=a.aiDisplayMaster.slice();else if(a.aiDisplay.length==a.aiDisplayMaster.length||i.sSearch.length>b.length||1==c||0!==b.indexOf(i.sSearch)){a.aiDisplay.splice(0,
|
||||
a.aiDisplay.length);la(a,1);for(b=0;b<a.aiDisplayMaster.length;b++)d.test(a.asDataSearch[b])&&a.aiDisplay.push(a.aiDisplayMaster[b])}else for(b=c=0;b<a.asDataSearch.length;b++)d.test(a.asDataSearch[b])||(a.aiDisplay.splice(b-c,1),c++)}function la(a,b){if(!a.oFeatures.bServerSide){a.asDataSearch=[];for(var c=r(a,"bSearchable"),d=1===b?a.aiDisplayMaster:a.aiDisplay,i=0,f=d.length;i<f;i++)a.asDataSearch[i]=na(a,Y(a,d[i],"filter",c))}}function na(a,b){var c=b.join(" ");-1!==c.indexOf("&")&&(c=h("<div>").html(c).text());
|
||||
return c.replace(/[\n\r]/g," ")}function ma(a,b,c,d){if(c)return a=b?a.split(" "):oa(a).split(" "),a="^(?=.*?"+a.join(")(?=.*?")+").*$",RegExp(a,d?"i":"");a=b?a:oa(a);return RegExp(a,d?"i":"")}function Ja(a,b){return"function"===typeof j.ext.ofnSearch[b]?j.ext.ofnSearch[b](a):null===a?"":"html"==b?a.replace(/[\r\n]/g," ").replace(/<.*?>/g,""):"string"===typeof a?a.replace(/[\r\n]/g," "):a}function oa(a){return a.replace(RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^|\\-)","g"),
|
||||
"\\$1")}function Ca(a){var b=l.createElement("div");b.className=a.oClasses.sInfo;a.aanFeatures.i||(a.aoDrawCallback.push({fn:Ka,sName:"information"}),b.id=a.sTableId+"_info");a.nTable.setAttribute("aria-describedby",a.sTableId+"_info");return b}function Ka(a){if(a.oFeatures.bInfo&&0!==a.aanFeatures.i.length){var b=a.oLanguage,c=a._iDisplayStart+1,d=a.fnDisplayEnd(),i=a.fnRecordsTotal(),f=a.fnRecordsDisplay(),g;g=0===f?b.sInfoEmpty:b.sInfo;f!=i&&(g+=" "+b.sInfoFiltered);g+=b.sInfoPostFix;g=ja(a,g);
|
||||
null!==b.fnInfoCallback&&(g=b.fnInfoCallback.call(a.oInstance,a,c,d,i,f,g));a=a.aanFeatures.i;b=0;for(c=a.length;b<c;b++)h(a[b]).html(g)}}function ja(a,b){var c=a.fnFormatNumber(a._iDisplayStart+1),d=a.fnDisplayEnd(),d=a.fnFormatNumber(d),i=a.fnRecordsDisplay(),i=a.fnFormatNumber(i),f=a.fnRecordsTotal(),f=a.fnFormatNumber(f);a.oScroll.bInfinite&&(c=a.fnFormatNumber(1));return b.replace(/_START_/g,c).replace(/_END_/g,d).replace(/_TOTAL_/g,i).replace(/_MAX_/g,f)}function ba(a){var b,c,d=a.iInitDisplayStart;
|
||||
if(!1===a.bInitialised)setTimeout(function(){ba(a)},200);else{xa(a);va(a);W(a,a.aoHeader);a.nTFoot&&W(a,a.aoFooter);E(a,!0);a.oFeatures.bAutoWidth&&da(a);b=0;for(c=a.aoColumns.length;b<c;b++)null!==a.aoColumns[b].sWidth&&(a.aoColumns[b].nTh.style.width=q(a.aoColumns[b].sWidth));a.oFeatures.bSort?O(a):a.oFeatures.bFilter?K(a,a.oPreviousSearch):(a.aiDisplay=a.aiDisplayMaster.slice(),y(a),x(a));null!==a.sAjaxSource&&!a.oFeatures.bServerSide?(c=[],ka(a,c),a.fnServerData.call(a.oInstance,a.sAjaxSource,
|
||||
c,function(c){var f=a.sAjaxDataProp!==""?Q(a.sAjaxDataProp)(c):c;for(b=0;b<f.length;b++)H(a,f[b]);a.iInitDisplayStart=d;if(a.oFeatures.bSort)O(a);else{a.aiDisplay=a.aiDisplayMaster.slice();y(a);x(a)}E(a,false);$(a,c)},a)):a.oFeatures.bServerSide||(E(a,!1),$(a))}}function $(a,b){a._bInitComplete=!0;A(a,"aoInitComplete","init",[a,b])}function pa(a){var b=j.defaults.oLanguage;!a.sEmptyTable&&(a.sZeroRecords&&"No data available in table"===b.sEmptyTable)&&p(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&
|
||||
(a.sZeroRecords&&"Loading..."===b.sLoadingRecords)&&p(a,a,"sZeroRecords","sLoadingRecords")}function ya(a){if(a.oScroll.bInfinite)return null;var b='<select size="1" '+('name="'+a.sTableId+'_length"')+">",c,d,i=a.aLengthMenu;if(2==i.length&&"object"===typeof i[0]&&"object"===typeof i[1]){c=0;for(d=i[0].length;c<d;c++)b+='<option value="'+i[0][c]+'">'+i[1][c]+"</option>"}else{c=0;for(d=i.length;c<d;c++)b+='<option value="'+i[c]+'">'+i[c]+"</option>"}b+="</select>";i=l.createElement("div");a.aanFeatures.l||
|
||||
(i.id=a.sTableId+"_length");i.className=a.oClasses.sLength;i.innerHTML="<label>"+a.oLanguage.sLengthMenu.replace("_MENU_",b)+"</label>";h('select option[value="'+a._iDisplayLength+'"]',i).attr("selected",!0);h("select",i).bind("change.DT",function(){var b=h(this).val(),i=a.aanFeatures.l;c=0;for(d=i.length;c<d;c++)i[c]!=this.parentNode&&h("select",i[c]).val(b);a._iDisplayLength=parseInt(b,10);y(a);if(a.fnDisplayEnd()==a.fnRecordsDisplay()){a._iDisplayStart=a.fnDisplayEnd()-a._iDisplayLength;if(a._iDisplayStart<
|
||||
0)a._iDisplayStart=0}if(a._iDisplayLength==-1)a._iDisplayStart=0;x(a)});h("select",i).attr("aria-controls",a.sTableId);return i}function y(a){a._iDisplayEnd=!1===a.oFeatures.bPaginate?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength>a.aiDisplay.length||-1==a._iDisplayLength?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength}function Da(a){if(a.oScroll.bInfinite)return null;var b=l.createElement("div");b.className=a.oClasses.sPaging+a.sPaginationType;j.ext.oPagination[a.sPaginationType].fnInit(a,
|
||||
b,function(a){y(a);x(a)});a.aanFeatures.p||a.aoDrawCallback.push({fn:function(a){j.ext.oPagination[a.sPaginationType].fnUpdate(a,function(a){y(a);x(a)})},sName:"pagination"});return b}function qa(a,b){var c=a._iDisplayStart;if("number"===typeof b)a._iDisplayStart=b*a._iDisplayLength,a._iDisplayStart>a.fnRecordsDisplay()&&(a._iDisplayStart=0);else if("first"==b)a._iDisplayStart=0;else if("previous"==b)a._iDisplayStart=0<=a._iDisplayLength?a._iDisplayStart-a._iDisplayLength:0,0>a._iDisplayStart&&(a._iDisplayStart=
|
||||
0);else if("next"==b)0<=a._iDisplayLength?a._iDisplayStart+a._iDisplayLength<a.fnRecordsDisplay()&&(a._iDisplayStart+=a._iDisplayLength):a._iDisplayStart=0;else if("last"==b)if(0<=a._iDisplayLength){var d=parseInt((a.fnRecordsDisplay()-1)/a._iDisplayLength,10)+1;a._iDisplayStart=(d-1)*a._iDisplayLength}else a._iDisplayStart=0;else D(a,0,"Unknown paging action: "+b);h(a.oInstance).trigger("page",a);return c!=a._iDisplayStart}function Aa(a){var b=l.createElement("div");a.aanFeatures.r||(b.id=a.sTableId+
|
||||
"_processing");b.innerHTML=a.oLanguage.sProcessing;b.className=a.oClasses.sProcessing;a.nTable.parentNode.insertBefore(b,a.nTable);return b}function E(a,b){if(a.oFeatures.bProcessing)for(var c=a.aanFeatures.r,d=0,i=c.length;d<i;d++)c[d].style.visibility=b?"visible":"hidden";h(a.oInstance).trigger("processing",[a,b])}function Ba(a){if(""===a.oScroll.sX&&""===a.oScroll.sY)return a.nTable;var b=l.createElement("div"),c=l.createElement("div"),d=l.createElement("div"),i=l.createElement("div"),f=l.createElement("div"),
|
||||
g=l.createElement("div"),e=a.nTable.cloneNode(!1),j=a.nTable.cloneNode(!1),o=a.nTable.getElementsByTagName("thead")[0],k=0===a.nTable.getElementsByTagName("tfoot").length?null:a.nTable.getElementsByTagName("tfoot")[0],m=a.oClasses;c.appendChild(d);f.appendChild(g);i.appendChild(a.nTable);b.appendChild(c);b.appendChild(i);d.appendChild(e);e.appendChild(o);null!==k&&(b.appendChild(f),g.appendChild(j),j.appendChild(k));b.className=m.sScrollWrapper;c.className=m.sScrollHead;d.className=m.sScrollHeadInner;
|
||||
i.className=m.sScrollBody;f.className=m.sScrollFoot;g.className=m.sScrollFootInner;a.oScroll.bAutoCss&&(c.style.overflow="hidden",c.style.position="relative",f.style.overflow="hidden",i.style.overflow="auto");c.style.border="0";c.style.width="100%";f.style.border="0";d.style.width=""!==a.oScroll.sXInner?a.oScroll.sXInner:"100%";e.removeAttribute("id");e.style.marginLeft="0";a.nTable.style.marginLeft="0";null!==k&&(j.removeAttribute("id"),j.style.marginLeft="0");d=h(a.nTable).children("caption");0<
|
||||
d.length&&(d=d[0],"top"===d._captionSide?e.appendChild(d):"bottom"===d._captionSide&&k&&j.appendChild(d));""!==a.oScroll.sX&&(c.style.width=q(a.oScroll.sX),i.style.width=q(a.oScroll.sX),null!==k&&(f.style.width=q(a.oScroll.sX)),h(i).scroll(function(){c.scrollLeft=this.scrollLeft;if(k!==null)f.scrollLeft=this.scrollLeft}));""!==a.oScroll.sY&&(i.style.height=q(a.oScroll.sY));a.aoDrawCallback.push({fn:La,sName:"scrolling"});a.oScroll.bInfinite&&h(i).scroll(function(){if(!a.bDrawing&&h(this).scrollTop()!==
|
||||
0&&h(this).scrollTop()+h(this).height()>h(a.nTable).height()-a.oScroll.iLoadGap&&a.fnDisplayEnd()<a.fnRecordsDisplay()){qa(a,"next");y(a);x(a)}});a.nScrollHead=c;a.nScrollFoot=f;return b}function La(a){var b=a.nScrollHead.getElementsByTagName("div")[0],c=b.getElementsByTagName("table")[0],d=a.nTable.parentNode,i,f,g,e,j,o,k,m,p=[],n=[],l=null!==a.nTFoot?a.nScrollFoot.getElementsByTagName("div")[0]:null,R=null!==a.nTFoot?l.getElementsByTagName("table")[0]:null,r=a.oBrowser.bScrollOversize,s=function(a){k=
|
||||
a.style;k.paddingTop="0";k.paddingBottom="0";k.borderTopWidth="0";k.borderBottomWidth="0";k.height=0};h(a.nTable).children("thead, tfoot").remove();i=h(a.nTHead).clone()[0];a.nTable.insertBefore(i,a.nTable.childNodes[0]);g=a.nTHead.getElementsByTagName("tr");e=i.getElementsByTagName("tr");null!==a.nTFoot&&(j=h(a.nTFoot).clone()[0],a.nTable.insertBefore(j,a.nTable.childNodes[1]),o=a.nTFoot.getElementsByTagName("tr"),j=j.getElementsByTagName("tr"));""===a.oScroll.sX&&(d.style.width="100%",b.parentNode.style.width=
|
||||
"100%");var t=N(a,i);i=0;for(f=t.length;i<f;i++)m=G(a,i),t[i].style.width=a.aoColumns[m].sWidth;null!==a.nTFoot&&C(function(a){a.style.width=""},j);a.oScroll.bCollapse&&""!==a.oScroll.sY&&(d.style.height=d.offsetHeight+a.nTHead.offsetHeight+"px");i=h(a.nTable).outerWidth();if(""===a.oScroll.sX){if(a.nTable.style.width="100%",r&&(h("tbody",d).height()>d.offsetHeight||"scroll"==h(d).css("overflow-y")))a.nTable.style.width=q(h(a.nTable).outerWidth()-a.oScroll.iBarWidth)}else""!==a.oScroll.sXInner?a.nTable.style.width=
|
||||
q(a.oScroll.sXInner):i==h(d).width()&&h(d).height()<h(a.nTable).height()?(a.nTable.style.width=q(i-a.oScroll.iBarWidth),h(a.nTable).outerWidth()>i-a.oScroll.iBarWidth&&(a.nTable.style.width=q(i))):a.nTable.style.width=q(i);i=h(a.nTable).outerWidth();C(s,e);C(function(a){p.push(q(h(a).width()))},e);C(function(a,b){a.style.width=p[b]},g);h(e).height(0);null!==a.nTFoot&&(C(s,j),C(function(a){n.push(q(h(a).width()))},j),C(function(a,b){a.style.width=n[b]},o),h(j).height(0));C(function(a,b){a.innerHTML=
|
||||
"";a.style.width=p[b]},e);null!==a.nTFoot&&C(function(a,b){a.innerHTML="";a.style.width=n[b]},j);if(h(a.nTable).outerWidth()<i){g=d.scrollHeight>d.offsetHeight||"scroll"==h(d).css("overflow-y")?i+a.oScroll.iBarWidth:i;if(r&&(d.scrollHeight>d.offsetHeight||"scroll"==h(d).css("overflow-y")))a.nTable.style.width=q(g-a.oScroll.iBarWidth);d.style.width=q(g);a.nScrollHead.style.width=q(g);null!==a.nTFoot&&(a.nScrollFoot.style.width=q(g));""===a.oScroll.sX?D(a,1,"The table cannot fit into the current element which will cause column misalignment. The table has been drawn at its minimum possible width."):
|
||||
""!==a.oScroll.sXInner&&D(a,1,"The table cannot fit into the current element which will cause column misalignment. Increase the sScrollXInner value or remove it to allow automatic calculation")}else d.style.width=q("100%"),a.nScrollHead.style.width=q("100%"),null!==a.nTFoot&&(a.nScrollFoot.style.width=q("100%"));""===a.oScroll.sY&&r&&(d.style.height=q(a.nTable.offsetHeight+a.oScroll.iBarWidth));""!==a.oScroll.sY&&a.oScroll.bCollapse&&(d.style.height=q(a.oScroll.sY),r=""!==a.oScroll.sX&&a.nTable.offsetWidth>
|
||||
d.offsetWidth?a.oScroll.iBarWidth:0,a.nTable.offsetHeight<d.offsetHeight&&(d.style.height=q(a.nTable.offsetHeight+r)));r=h(a.nTable).outerWidth();c.style.width=q(r);b.style.width=q(r);c=h(a.nTable).height()>d.clientHeight||"scroll"==h(d).css("overflow-y");b.style.paddingRight=c?a.oScroll.iBarWidth+"px":"0px";null!==a.nTFoot&&(R.style.width=q(r),l.style.width=q(r),l.style.paddingRight=c?a.oScroll.iBarWidth+"px":"0px");h(d).scroll();if(a.bSorted||a.bFiltered)d.scrollTop=0}function C(a,b,c){for(var d=
|
||||
0,i=0,f=b.length,g,e;i<f;){g=b[i].firstChild;for(e=c?c[i].firstChild:null;g;)1===g.nodeType&&(c?a(g,e,d):a(g,d),d++),g=g.nextSibling,e=c?e.nextSibling:null;i++}}function Ma(a,b){if(!a||null===a||""===a)return 0;b||(b=l.body);var c,d=l.createElement("div");d.style.width=q(a);b.appendChild(d);c=d.offsetWidth;b.removeChild(d);return c}function da(a){var b=0,c,d=0,i=a.aoColumns.length,f,e,j=h("th",a.nTHead),o=a.nTable.getAttribute("width");e=a.nTable.parentNode;for(f=0;f<i;f++)a.aoColumns[f].bVisible&&
|
||||
(d++,null!==a.aoColumns[f].sWidth&&(c=Ma(a.aoColumns[f].sWidthOrig,e),null!==c&&(a.aoColumns[f].sWidth=q(c)),b++));if(i==j.length&&0===b&&d==i&&""===a.oScroll.sX&&""===a.oScroll.sY)for(f=0;f<a.aoColumns.length;f++)c=h(j[f]).width(),null!==c&&(a.aoColumns[f].sWidth=q(c));else{b=a.nTable.cloneNode(!1);f=a.nTHead.cloneNode(!0);d=l.createElement("tbody");c=l.createElement("tr");b.removeAttribute("id");b.appendChild(f);null!==a.nTFoot&&(b.appendChild(a.nTFoot.cloneNode(!0)),C(function(a){a.style.width=
|
||||
""},b.getElementsByTagName("tr")));b.appendChild(d);d.appendChild(c);d=h("thead th",b);0===d.length&&(d=h("tbody tr:eq(0)>td",b));j=N(a,f);for(f=d=0;f<i;f++){var k=a.aoColumns[f];k.bVisible&&null!==k.sWidthOrig&&""!==k.sWidthOrig?j[f-d].style.width=q(k.sWidthOrig):k.bVisible?j[f-d].style.width="":d++}for(f=0;f<i;f++)a.aoColumns[f].bVisible&&(d=Na(a,f),null!==d&&(d=d.cloneNode(!0),""!==a.aoColumns[f].sContentPadding&&(d.innerHTML+=a.aoColumns[f].sContentPadding),c.appendChild(d)));e.appendChild(b);
|
||||
""!==a.oScroll.sX&&""!==a.oScroll.sXInner?b.style.width=q(a.oScroll.sXInner):""!==a.oScroll.sX?(b.style.width="",h(b).width()<e.offsetWidth&&(b.style.width=q(e.offsetWidth))):""!==a.oScroll.sY?b.style.width=q(e.offsetWidth):o&&(b.style.width=q(o));b.style.visibility="hidden";Oa(a,b);i=h("tbody tr:eq(0)",b).children();0===i.length&&(i=N(a,h("thead",b)[0]));if(""!==a.oScroll.sX){for(f=d=e=0;f<a.aoColumns.length;f++)a.aoColumns[f].bVisible&&(e=null===a.aoColumns[f].sWidthOrig?e+h(i[d]).outerWidth():
|
||||
e+(parseInt(a.aoColumns[f].sWidth.replace("px",""),10)+(h(i[d]).outerWidth()-h(i[d]).width())),d++);b.style.width=q(e);a.nTable.style.width=q(e)}for(f=d=0;f<a.aoColumns.length;f++)a.aoColumns[f].bVisible&&(e=h(i[d]).width(),null!==e&&0<e&&(a.aoColumns[f].sWidth=q(e)),d++);i=h(b).css("width");a.nTable.style.width=-1!==i.indexOf("%")?i:q(h(b).outerWidth());b.parentNode.removeChild(b)}o&&(a.nTable.style.width=q(o))}function Oa(a,b){""===a.oScroll.sX&&""!==a.oScroll.sY?(h(b).width(),b.style.width=q(h(b).outerWidth()-
|
||||
a.oScroll.iBarWidth)):""!==a.oScroll.sX&&(b.style.width=q(h(b).outerWidth()))}function Na(a,b){var c=Pa(a,b);if(0>c)return null;if(null===a.aoData[c].nTr){var d=l.createElement("td");d.innerHTML=v(a,c,b,"");return d}return J(a,c)[b]}function Pa(a,b){for(var c=-1,d=-1,i=0;i<a.aoData.length;i++){var e=v(a,i,b,"display")+"",e=e.replace(/<.*?>/g,"");e.length>c&&(c=e.length,d=i)}return d}function q(a){if(null===a)return"0px";if("number"==typeof a)return 0>a?"0px":a+"px";var b=a.charCodeAt(a.length-1);
|
||||
return 48>b||57<b?a:a+"px"}function Qa(){var a=l.createElement("p"),b=a.style;b.width="100%";b.height="200px";b.padding="0px";var c=l.createElement("div"),b=c.style;b.position="absolute";b.top="0px";b.left="0px";b.visibility="hidden";b.width="200px";b.height="150px";b.padding="0px";b.overflow="hidden";c.appendChild(a);l.body.appendChild(c);b=a.offsetWidth;c.style.overflow="scroll";a=a.offsetWidth;b==a&&(a=c.clientWidth);l.body.removeChild(c);return b-a}function O(a,b){var c,d,i,e,g,k,o=[],m=[],p=
|
||||
j.ext.oSort,l=a.aoData,q=a.aoColumns,G=a.oLanguage.oAria;if(!a.oFeatures.bServerSide&&(0!==a.aaSorting.length||null!==a.aaSortingFixed)){o=null!==a.aaSortingFixed?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(c=0;c<o.length;c++)if(d=o[c][0],i=R(a,d),e=a.aoColumns[d].sSortDataType,j.ext.afnSortData[e])if(g=j.ext.afnSortData[e].call(a.oInstance,a,d,i),g.length===l.length){i=0;for(e=l.length;i<e;i++)F(a,i,d,g[i])}else D(a,0,"Returned data sort array (col "+d+") is the wrong length");c=
|
||||
0;for(d=a.aiDisplayMaster.length;c<d;c++)m[a.aiDisplayMaster[c]]=c;var r=o.length,s;c=0;for(d=l.length;c<d;c++)for(i=0;i<r;i++){s=q[o[i][0]].aDataSort;g=0;for(k=s.length;g<k;g++)e=q[s[g]].sType,e=p[(e?e:"string")+"-pre"],l[c]._aSortData[s[g]]=e?e(v(a,c,s[g],"sort")):v(a,c,s[g],"sort")}a.aiDisplayMaster.sort(function(a,b){var c,d,e,i,f;for(c=0;c<r;c++){f=q[o[c][0]].aDataSort;d=0;for(e=f.length;d<e;d++)if(i=q[f[d]].sType,i=p[(i?i:"string")+"-"+o[c][1]](l[a]._aSortData[f[d]],l[b]._aSortData[f[d]]),0!==
|
||||
i)return i}return p["numeric-asc"](m[a],m[b])})}(b===n||b)&&!a.oFeatures.bDeferRender&&P(a);c=0;for(d=a.aoColumns.length;c<d;c++)e=q[c].sTitle.replace(/<.*?>/g,""),i=q[c].nTh,i.removeAttribute("aria-sort"),i.removeAttribute("aria-label"),q[c].bSortable?0<o.length&&o[0][0]==c?(i.setAttribute("aria-sort","asc"==o[0][1]?"ascending":"descending"),i.setAttribute("aria-label",e+("asc"==(q[c].asSorting[o[0][2]+1]?q[c].asSorting[o[0][2]+1]:q[c].asSorting[0])?G.sSortAscending:G.sSortDescending))):i.setAttribute("aria-label",
|
||||
e+("asc"==q[c].asSorting[0]?G.sSortAscending:G.sSortDescending)):i.setAttribute("aria-label",e);a.bSorted=!0;h(a.oInstance).trigger("sort",a);a.oFeatures.bFilter?K(a,a.oPreviousSearch,1):(a.aiDisplay=a.aiDisplayMaster.slice(),a._iDisplayStart=0,y(a),x(a))}function ia(a,b,c,d){Ra(b,{},function(b){if(!1!==a.aoColumns[c].bSortable){var e=function(){var d,e;if(b.shiftKey){for(var f=!1,h=0;h<a.aaSorting.length;h++)if(a.aaSorting[h][0]==c){f=!0;d=a.aaSorting[h][0];e=a.aaSorting[h][2]+1;a.aoColumns[d].asSorting[e]?
|
||||
(a.aaSorting[h][1]=a.aoColumns[d].asSorting[e],a.aaSorting[h][2]=e):a.aaSorting.splice(h,1);break}!1===f&&a.aaSorting.push([c,a.aoColumns[c].asSorting[0],0])}else 1==a.aaSorting.length&&a.aaSorting[0][0]==c?(d=a.aaSorting[0][0],e=a.aaSorting[0][2]+1,a.aoColumns[d].asSorting[e]||(e=0),a.aaSorting[0][1]=a.aoColumns[d].asSorting[e],a.aaSorting[0][2]=e):(a.aaSorting.splice(0,a.aaSorting.length),a.aaSorting.push([c,a.aoColumns[c].asSorting[0],0]));O(a)};a.oFeatures.bProcessing?(E(a,!0),setTimeout(function(){e();
|
||||
a.oFeatures.bServerSide||E(a,!1)},0)):e();"function"==typeof d&&d(a)}})}function P(a){var b,c,d,e,f,g=a.aoColumns.length,j=a.oClasses;for(b=0;b<g;b++)a.aoColumns[b].bSortable&&h(a.aoColumns[b].nTh).removeClass(j.sSortAsc+" "+j.sSortDesc+" "+a.aoColumns[b].sSortingClass);c=null!==a.aaSortingFixed?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(b=0;b<a.aoColumns.length;b++)if(a.aoColumns[b].bSortable){f=a.aoColumns[b].sSortingClass;e=-1;for(d=0;d<c.length;d++)if(c[d][0]==b){f="asc"==c[d][1]?
|
||||
j.sSortAsc:j.sSortDesc;e=d;break}h(a.aoColumns[b].nTh).addClass(f);a.bJUI&&(f=h("span."+j.sSortIcon,a.aoColumns[b].nTh),f.removeClass(j.sSortJUIAsc+" "+j.sSortJUIDesc+" "+j.sSortJUI+" "+j.sSortJUIAscAllowed+" "+j.sSortJUIDescAllowed),f.addClass(-1==e?a.aoColumns[b].sSortingClassJUI:"asc"==c[e][1]?j.sSortJUIAsc:j.sSortJUIDesc))}else h(a.aoColumns[b].nTh).addClass(a.aoColumns[b].sSortingClass);f=j.sSortColumn;if(a.oFeatures.bSort&&a.oFeatures.bSortClasses){a=J(a);e=[];for(b=0;b<g;b++)e.push("");b=0;
|
||||
for(d=1;b<c.length;b++)j=parseInt(c[b][0],10),e[j]=f+d,3>d&&d++;f=RegExp(f+"[123]");var o;b=0;for(c=a.length;b<c;b++)j=b%g,d=a[b].className,o=e[j],j=d.replace(f,o),j!=d?a[b].className=h.trim(j):0<o.length&&-1==d.indexOf(o)&&(a[b].className=d+" "+o)}}function ra(a){if(a.oFeatures.bStateSave&&!a.bDestroying){var b,c;b=a.oScroll.bInfinite;var d={iCreate:(new Date).getTime(),iStart:b?0:a._iDisplayStart,iEnd:b?a._iDisplayLength:a._iDisplayEnd,iLength:a._iDisplayLength,aaSorting:h.extend(!0,[],a.aaSorting),
|
||||
oSearch:h.extend(!0,{},a.oPreviousSearch),aoSearchCols:h.extend(!0,[],a.aoPreSearchCols),abVisCols:[]};b=0;for(c=a.aoColumns.length;b<c;b++)d.abVisCols.push(a.aoColumns[b].bVisible);A(a,"aoStateSaveParams","stateSaveParams",[a,d]);a.fnStateSave.call(a.oInstance,a,d)}}function Sa(a,b){if(a.oFeatures.bStateSave){var c=a.fnStateLoad.call(a.oInstance,a);if(c){var d=A(a,"aoStateLoadParams","stateLoadParams",[a,c]);if(-1===h.inArray(!1,d)){a.oLoadedState=h.extend(!0,{},c);a._iDisplayStart=c.iStart;a.iInitDisplayStart=
|
||||
c.iStart;a._iDisplayEnd=c.iEnd;a._iDisplayLength=c.iLength;a.aaSorting=c.aaSorting.slice();a.saved_aaSorting=c.aaSorting.slice();h.extend(a.oPreviousSearch,c.oSearch);h.extend(!0,a.aoPreSearchCols,c.aoSearchCols);b.saved_aoColumns=[];for(d=0;d<c.abVisCols.length;d++)b.saved_aoColumns[d]={},b.saved_aoColumns[d].bVisible=c.abVisCols[d];A(a,"aoStateLoaded","stateLoaded",[a,c])}}}}function s(a){for(var b=0;b<j.settings.length;b++)if(j.settings[b].nTable===a)return j.settings[b];return null}function T(a){for(var b=
|
||||
[],a=a.aoData,c=0,d=a.length;c<d;c++)null!==a[c].nTr&&b.push(a[c].nTr);return b}function J(a,b){var c=[],d,e,f,g,h,j;e=0;var o=a.aoData.length;b!==n&&(e=b,o=b+1);for(f=e;f<o;f++)if(j=a.aoData[f],null!==j.nTr){e=[];for(d=j.nTr.firstChild;d;)g=d.nodeName.toLowerCase(),("td"==g||"th"==g)&&e.push(d),d=d.nextSibling;g=d=0;for(h=a.aoColumns.length;g<h;g++)a.aoColumns[g].bVisible?c.push(e[g-d]):(c.push(j._anHidden[g]),d++)}return c}function D(a,b,c){a=null===a?"DataTables warning: "+c:"DataTables warning (table id = '"+
|
||||
a.sTableId+"'): "+c;if(0===b)if("alert"==j.ext.sErrMode)alert(a);else throw Error(a);else X.console&&console.log&&console.log(a)}function p(a,b,c,d){d===n&&(d=c);b[c]!==n&&(a[d]=b[c])}function Ta(a,b){var c,d;for(d in b)b.hasOwnProperty(d)&&(c=b[d],"object"===typeof e[d]&&null!==c&&!1===h.isArray(c)?h.extend(!0,a[d],c):a[d]=c);return a}function Ra(a,b,c){h(a).bind("click.DT",b,function(b){a.blur();c(b)}).bind("keypress.DT",b,function(a){13===a.which&&c(a)}).bind("selectstart.DT",function(){return!1})}
|
||||
function z(a,b,c,d){c&&a[b].push({fn:c,sName:d})}function A(a,b,c,d){for(var b=a[b],e=[],f=b.length-1;0<=f;f--)e.push(b[f].fn.apply(a.oInstance,d));null!==c&&h(a.oInstance).trigger(c,d);return e}function Ua(a){var b=h('<div style="position:absolute; top:0; left:0; height:1px; width:1px; overflow:hidden"><div style="position:absolute; top:1px; left:1px; width:100px; overflow:scroll;"><div id="DT_BrowserTest" style="width:100%; height:10px;"></div></div></div>')[0];l.body.appendChild(b);a.oBrowser.bScrollOversize=
|
||||
100===h("#DT_BrowserTest",b)[0].offsetWidth?!0:!1;l.body.removeChild(b)}function Va(a){return function(){var b=[s(this[j.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return j.ext.oApi[a].apply(this,b)}}var U=/\[.*?\]$/,Wa=X.JSON?JSON.stringify:function(a){var b=typeof a;if("object"!==b||null===a)return"string"===b&&(a='"'+a+'"'),a+"";var c,d,e=[],f=h.isArray(a);for(c in a)d=a[c],b=typeof d,"string"===b?d='"'+d+'"':"object"===b&&null!==d&&(d=Wa(d)),e.push((f?"":'"'+c+'":')+d);return(f?
|
||||
"[":"{")+e+(f?"]":"}")};this.$=function(a,b){var c,d,e=[],f;d=s(this[j.ext.iApiIndex]);var g=d.aoData,o=d.aiDisplay,k=d.aiDisplayMaster;b||(b={});b=h.extend({},{filter:"none",order:"current",page:"all"},b);if("current"==b.page){c=d._iDisplayStart;for(d=d.fnDisplayEnd();c<d;c++)(f=g[o[c]].nTr)&&e.push(f)}else if("current"==b.order&&"none"==b.filter){c=0;for(d=k.length;c<d;c++)(f=g[k[c]].nTr)&&e.push(f)}else if("current"==b.order&&"applied"==b.filter){c=0;for(d=o.length;c<d;c++)(f=g[o[c]].nTr)&&e.push(f)}else if("original"==
|
||||
b.order&&"none"==b.filter){c=0;for(d=g.length;c<d;c++)(f=g[c].nTr)&&e.push(f)}else if("original"==b.order&&"applied"==b.filter){c=0;for(d=g.length;c<d;c++)f=g[c].nTr,-1!==h.inArray(c,o)&&f&&e.push(f)}else D(d,1,"Unknown selection options");e=h(e);c=e.filter(a);e=e.find(a);return h([].concat(h.makeArray(c),h.makeArray(e)))};this._=function(a,b){var c=[],d,e,f=this.$(a,b);d=0;for(e=f.length;d<e;d++)c.push(this.fnGetData(f[d]));return c};this.fnAddData=function(a,b){if(0===a.length)return[];var c=[],
|
||||
d,e=s(this[j.ext.iApiIndex]);if("object"===typeof a[0]&&null!==a[0])for(var f=0;f<a.length;f++){d=H(e,a[f]);if(-1==d)return c;c.push(d)}else{d=H(e,a);if(-1==d)return c;c.push(d)}e.aiDisplay=e.aiDisplayMaster.slice();(b===n||b)&&aa(e);return c};this.fnAdjustColumnSizing=function(a){var b=s(this[j.ext.iApiIndex]);k(b);a===n||a?this.fnDraw(!1):(""!==b.oScroll.sX||""!==b.oScroll.sY)&&this.oApi._fnScrollDraw(b)};this.fnClearTable=function(a){var b=s(this[j.ext.iApiIndex]);ga(b);(a===n||a)&&x(b)};this.fnClose=
|
||||
function(a){for(var b=s(this[j.ext.iApiIndex]),c=0;c<b.aoOpenRows.length;c++)if(b.aoOpenRows[c].nParent==a)return(a=b.aoOpenRows[c].nTr.parentNode)&&a.removeChild(b.aoOpenRows[c].nTr),b.aoOpenRows.splice(c,1),0;return 1};this.fnDeleteRow=function(a,b,c){var d=s(this[j.ext.iApiIndex]),e,f,a="object"===typeof a?I(d,a):a,g=d.aoData.splice(a,1);e=0;for(f=d.aoData.length;e<f;e++)null!==d.aoData[e].nTr&&(d.aoData[e].nTr._DT_RowIndex=e);e=h.inArray(a,d.aiDisplay);d.asDataSearch.splice(e,1);ha(d.aiDisplayMaster,
|
||||
a);ha(d.aiDisplay,a);"function"===typeof b&&b.call(this,d,g);d._iDisplayStart>=d.fnRecordsDisplay()&&(d._iDisplayStart-=d._iDisplayLength,0>d._iDisplayStart&&(d._iDisplayStart=0));if(c===n||c)y(d),x(d);return g};this.fnDestroy=function(a){var b=s(this[j.ext.iApiIndex]),c=b.nTableWrapper.parentNode,d=b.nTBody,i,f,a=a===n?!1:a;b.bDestroying=!0;A(b,"aoDestroyCallback","destroy",[b]);if(!a){i=0;for(f=b.aoColumns.length;i<f;i++)!1===b.aoColumns[i].bVisible&&this.fnSetColumnVis(i,!0)}h(b.nTableWrapper).find("*").andSelf().unbind(".DT");
|
||||
h("tbody>tr>td."+b.oClasses.sRowEmpty,b.nTable).parent().remove();b.nTable!=b.nTHead.parentNode&&(h(b.nTable).children("thead").remove(),b.nTable.appendChild(b.nTHead));b.nTFoot&&b.nTable!=b.nTFoot.parentNode&&(h(b.nTable).children("tfoot").remove(),b.nTable.appendChild(b.nTFoot));b.nTable.parentNode.removeChild(b.nTable);h(b.nTableWrapper).remove();b.aaSorting=[];b.aaSortingFixed=[];P(b);h(T(b)).removeClass(b.asStripeClasses.join(" "));h("th, td",b.nTHead).removeClass([b.oClasses.sSortable,b.oClasses.sSortableAsc,
|
||||
b.oClasses.sSortableDesc,b.oClasses.sSortableNone].join(" "));b.bJUI&&(h("th span."+b.oClasses.sSortIcon+", td span."+b.oClasses.sSortIcon,b.nTHead).remove(),h("th, td",b.nTHead).each(function(){var a=h("div."+b.oClasses.sSortJUIWrapper,this),c=a.contents();h(this).append(c);a.remove()}));!a&&b.nTableReinsertBefore?c.insertBefore(b.nTable,b.nTableReinsertBefore):a||c.appendChild(b.nTable);i=0;for(f=b.aoData.length;i<f;i++)null!==b.aoData[i].nTr&&d.appendChild(b.aoData[i].nTr);!0===b.oFeatures.bAutoWidth&&
|
||||
(b.nTable.style.width=q(b.sDestroyWidth));if(f=b.asDestroyStripes.length){a=h(d).children("tr");for(i=0;i<f;i++)a.filter(":nth-child("+f+"n + "+i+")").addClass(b.asDestroyStripes[i])}i=0;for(f=j.settings.length;i<f;i++)j.settings[i]==b&&j.settings.splice(i,1);e=b=null};this.fnDraw=function(a){var b=s(this[j.ext.iApiIndex]);!1===a?(y(b),x(b)):aa(b)};this.fnFilter=function(a,b,c,d,e,f){var g=s(this[j.ext.iApiIndex]);if(g.oFeatures.bFilter){if(c===n||null===c)c=!1;if(d===n||null===d)d=!0;if(e===n||null===
|
||||
e)e=!0;if(f===n||null===f)f=!0;if(b===n||null===b){if(K(g,{sSearch:a+"",bRegex:c,bSmart:d,bCaseInsensitive:f},1),e&&g.aanFeatures.f){b=g.aanFeatures.f;c=0;for(d=b.length;c<d;c++)try{b[c]._DT_Input!=l.activeElement&&h(b[c]._DT_Input).val(a)}catch(o){h(b[c]._DT_Input).val(a)}}}else h.extend(g.aoPreSearchCols[b],{sSearch:a+"",bRegex:c,bSmart:d,bCaseInsensitive:f}),K(g,g.oPreviousSearch,1)}};this.fnGetData=function(a,b){var c=s(this[j.ext.iApiIndex]);if(a!==n){var d=a;if("object"===typeof a){var e=a.nodeName.toLowerCase();
|
||||
"tr"===e?d=I(c,a):"td"===e&&(d=I(c,a.parentNode),b=fa(c,d,a))}return b!==n?v(c,d,b,""):c.aoData[d]!==n?c.aoData[d]._aData:null}return Z(c)};this.fnGetNodes=function(a){var b=s(this[j.ext.iApiIndex]);return a!==n?b.aoData[a]!==n?b.aoData[a].nTr:null:T(b)};this.fnGetPosition=function(a){var b=s(this[j.ext.iApiIndex]),c=a.nodeName.toUpperCase();return"TR"==c?I(b,a):"TD"==c||"TH"==c?(c=I(b,a.parentNode),a=fa(b,c,a),[c,R(b,a),a]):null};this.fnIsOpen=function(a){for(var b=s(this[j.ext.iApiIndex]),c=0;c<
|
||||
b.aoOpenRows.length;c++)if(b.aoOpenRows[c].nParent==a)return!0;return!1};this.fnOpen=function(a,b,c){var d=s(this[j.ext.iApiIndex]),e=T(d);if(-1!==h.inArray(a,e)){this.fnClose(a);var e=l.createElement("tr"),f=l.createElement("td");e.appendChild(f);f.className=c;f.colSpan=t(d);"string"===typeof b?f.innerHTML=b:h(f).html(b);b=h("tr",d.nTBody);-1!=h.inArray(a,b)&&h(e).insertAfter(a);d.aoOpenRows.push({nTr:e,nParent:a});return e}};this.fnPageChange=function(a,b){var c=s(this[j.ext.iApiIndex]);qa(c,a);
|
||||
y(c);(b===n||b)&&x(c)};this.fnSetColumnVis=function(a,b,c){var d=s(this[j.ext.iApiIndex]),e,f,g=d.aoColumns,h=d.aoData,o,m;if(g[a].bVisible!=b){if(b){for(e=f=0;e<a;e++)g[e].bVisible&&f++;m=f>=t(d);if(!m)for(e=a;e<g.length;e++)if(g[e].bVisible){o=e;break}e=0;for(f=h.length;e<f;e++)null!==h[e].nTr&&(m?h[e].nTr.appendChild(h[e]._anHidden[a]):h[e].nTr.insertBefore(h[e]._anHidden[a],J(d,e)[o]))}else{e=0;for(f=h.length;e<f;e++)null!==h[e].nTr&&(o=J(d,e)[a],h[e]._anHidden[a]=o,o.parentNode.removeChild(o))}g[a].bVisible=
|
||||
b;W(d,d.aoHeader);d.nTFoot&&W(d,d.aoFooter);e=0;for(f=d.aoOpenRows.length;e<f;e++)d.aoOpenRows[e].nTr.colSpan=t(d);if(c===n||c)k(d),x(d);ra(d)}};this.fnSettings=function(){return s(this[j.ext.iApiIndex])};this.fnSort=function(a){var b=s(this[j.ext.iApiIndex]);b.aaSorting=a;O(b)};this.fnSortListener=function(a,b,c){ia(s(this[j.ext.iApiIndex]),a,b,c)};this.fnUpdate=function(a,b,c,d,e){var f=s(this[j.ext.iApiIndex]),b="object"===typeof b?I(f,b):b;if(h.isArray(a)&&c===n){f.aoData[b]._aData=a.slice();
|
||||
for(c=0;c<f.aoColumns.length;c++)this.fnUpdate(v(f,b,c),b,c,!1,!1)}else if(h.isPlainObject(a)&&c===n){f.aoData[b]._aData=h.extend(!0,{},a);for(c=0;c<f.aoColumns.length;c++)this.fnUpdate(v(f,b,c),b,c,!1,!1)}else{F(f,b,c,a);var a=v(f,b,c,"display"),g=f.aoColumns[c];null!==g.fnRender&&(a=S(f,b,c),g.bUseRendered&&F(f,b,c,a));null!==f.aoData[b].nTr&&(J(f,b)[c].innerHTML=a)}c=h.inArray(b,f.aiDisplay);f.asDataSearch[c]=na(f,Y(f,b,"filter",r(f,"bSearchable")));(e===n||e)&&k(f);(d===n||d)&&aa(f);return 0};
|
||||
this.fnVersionCheck=j.ext.fnVersionCheck;this.oApi={_fnExternApiFunc:Va,_fnInitialise:ba,_fnInitComplete:$,_fnLanguageCompat:pa,_fnAddColumn:o,_fnColumnOptions:m,_fnAddData:H,_fnCreateTr:ea,_fnGatherData:ua,_fnBuildHead:va,_fnDrawHead:W,_fnDraw:x,_fnReDraw:aa,_fnAjaxUpdate:wa,_fnAjaxParameters:Ea,_fnAjaxUpdateDraw:Fa,_fnServerParams:ka,_fnAddOptionsHtml:xa,_fnFeatureHtmlTable:Ba,_fnScrollDraw:La,_fnAdjustColumnSizing:k,_fnFeatureHtmlFilter:za,_fnFilterComplete:K,_fnFilterCustom:Ia,_fnFilterColumn:Ha,
|
||||
_fnFilter:Ga,_fnBuildSearchArray:la,_fnBuildSearchRow:na,_fnFilterCreateSearch:ma,_fnDataToSearch:Ja,_fnSort:O,_fnSortAttachListener:ia,_fnSortingClasses:P,_fnFeatureHtmlPaginate:Da,_fnPageChange:qa,_fnFeatureHtmlInfo:Ca,_fnUpdateInfo:Ka,_fnFeatureHtmlLength:ya,_fnFeatureHtmlProcessing:Aa,_fnProcessingDisplay:E,_fnVisibleToColumnIndex:G,_fnColumnIndexToVisible:R,_fnNodeToDataIndex:I,_fnVisbleColumns:t,_fnCalculateEnd:y,_fnConvertToWidth:Ma,_fnCalculateColumnWidths:da,_fnScrollingWidthAdjust:Oa,_fnGetWidestNode:Na,
|
||||
_fnGetMaxLenString:Pa,_fnStringToCss:q,_fnDetectType:B,_fnSettingsFromNode:s,_fnGetDataMaster:Z,_fnGetTrNodes:T,_fnGetTdNodes:J,_fnEscapeRegex:oa,_fnDeleteIndex:ha,_fnReOrderIndex:u,_fnColumnOrdering:M,_fnLog:D,_fnClearTable:ga,_fnSaveState:ra,_fnLoadState:Sa,_fnCreateCookie:function(a,b,c,d,e){var f=new Date;f.setTime(f.getTime()+1E3*c);var c=X.location.pathname.split("/"),a=a+"_"+c.pop().replace(/[\/:]/g,"").toLowerCase(),g;null!==e?(g="function"===typeof h.parseJSON?h.parseJSON(b):eval("("+b+")"),
|
||||
b=e(a,g,f.toGMTString(),c.join("/")+"/")):b=a+"="+encodeURIComponent(b)+"; expires="+f.toGMTString()+"; path="+c.join("/")+"/";a=l.cookie.split(";");e=b.split(";")[0].length;f=[];if(4096<e+l.cookie.length+10){for(var j=0,o=a.length;j<o;j++)if(-1!=a[j].indexOf(d)){var k=a[j].split("=");try{(g=eval("("+decodeURIComponent(k[1])+")"))&&g.iCreate&&f.push({name:k[0],time:g.iCreate})}catch(m){}}for(f.sort(function(a,b){return b.time-a.time});4096<e+l.cookie.length+10;){if(0===f.length)return;d=f.pop();l.cookie=
|
||||
d.name+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path="+c.join("/")+"/"}}l.cookie=b},_fnReadCookie:function(a){for(var b=X.location.pathname.split("/"),a=a+"_"+b[b.length-1].replace(/[\/:]/g,"").toLowerCase()+"=",b=l.cookie.split(";"),c=0;c<b.length;c++){for(var d=b[c];" "==d.charAt(0);)d=d.substring(1,d.length);if(0===d.indexOf(a))return decodeURIComponent(d.substring(a.length,d.length))}return null},_fnDetectHeader:V,_fnGetUniqueThs:N,_fnScrollBarWidth:Qa,_fnApplyToChildren:C,_fnMap:p,_fnGetRowData:Y,
|
||||
_fnGetCellData:v,_fnSetCellData:F,_fnGetObjectDataFn:Q,_fnSetObjectDataFn:L,_fnApplyColumnDefs:ta,_fnBindAction:Ra,_fnExtend:Ta,_fnCallbackReg:z,_fnCallbackFire:A,_fnJsonString:Wa,_fnRender:S,_fnNodeToColumnIndex:fa,_fnInfoMacros:ja,_fnBrowserDetect:Ua,_fnGetColumns:r};h.extend(j.ext.oApi,this.oApi);for(var sa in j.ext.oApi)sa&&(this[sa]=Va(sa));var ca=this;this.each(function(){var a=0,b,c,d;c=this.getAttribute("id");var i=!1,f=!1;if("table"!=this.nodeName.toLowerCase())D(null,0,"Attempted to initialise DataTables on a node which is not a table: "+
|
||||
this.nodeName);else{a=0;for(b=j.settings.length;a<b;a++){if(j.settings[a].nTable==this){if(e===n||e.bRetrieve)return j.settings[a].oInstance;if(e.bDestroy){j.settings[a].oInstance.fnDestroy();break}else{D(j.settings[a],0,"Cannot reinitialise DataTable.\n\nTo retrieve the DataTables object for this table, pass no arguments or see the docs for bRetrieve and bDestroy");return}}if(j.settings[a].sTableId==this.id){j.settings.splice(a,1);break}}if(null===c||""===c)this.id=c="DataTables_Table_"+j.ext._oExternConfig.iNextUnique++;
|
||||
var g=h.extend(!0,{},j.models.oSettings,{nTable:this,oApi:ca.oApi,oInit:e,sDestroyWidth:h(this).width(),sInstance:c,sTableId:c});j.settings.push(g);g.oInstance=1===ca.length?ca:h(this).dataTable();e||(e={});e.oLanguage&&pa(e.oLanguage);e=Ta(h.extend(!0,{},j.defaults),e);p(g.oFeatures,e,"bPaginate");p(g.oFeatures,e,"bLengthChange");p(g.oFeatures,e,"bFilter");p(g.oFeatures,e,"bSort");p(g.oFeatures,e,"bInfo");p(g.oFeatures,e,"bProcessing");p(g.oFeatures,e,"bAutoWidth");p(g.oFeatures,e,"bSortClasses");
|
||||
p(g.oFeatures,e,"bServerSide");p(g.oFeatures,e,"bDeferRender");p(g.oScroll,e,"sScrollX","sX");p(g.oScroll,e,"sScrollXInner","sXInner");p(g.oScroll,e,"sScrollY","sY");p(g.oScroll,e,"bScrollCollapse","bCollapse");p(g.oScroll,e,"bScrollInfinite","bInfinite");p(g.oScroll,e,"iScrollLoadGap","iLoadGap");p(g.oScroll,e,"bScrollAutoCss","bAutoCss");p(g,e,"asStripeClasses");p(g,e,"asStripClasses","asStripeClasses");p(g,e,"fnServerData");p(g,e,"fnFormatNumber");p(g,e,"sServerMethod");p(g,e,"aaSorting");p(g,
|
||||
e,"aaSortingFixed");p(g,e,"aLengthMenu");p(g,e,"sPaginationType");p(g,e,"sAjaxSource");p(g,e,"sAjaxDataProp");p(g,e,"iCookieDuration");p(g,e,"sCookiePrefix");p(g,e,"sDom");p(g,e,"bSortCellsTop");p(g,e,"iTabIndex");p(g,e,"oSearch","oPreviousSearch");p(g,e,"aoSearchCols","aoPreSearchCols");p(g,e,"iDisplayLength","_iDisplayLength");p(g,e,"bJQueryUI","bJUI");p(g,e,"fnCookieCallback");p(g,e,"fnStateLoad");p(g,e,"fnStateSave");p(g.oLanguage,e,"fnInfoCallback");z(g,"aoDrawCallback",e.fnDrawCallback,"user");
|
||||
z(g,"aoServerParams",e.fnServerParams,"user");z(g,"aoStateSaveParams",e.fnStateSaveParams,"user");z(g,"aoStateLoadParams",e.fnStateLoadParams,"user");z(g,"aoStateLoaded",e.fnStateLoaded,"user");z(g,"aoRowCallback",e.fnRowCallback,"user");z(g,"aoRowCreatedCallback",e.fnCreatedRow,"user");z(g,"aoHeaderCallback",e.fnHeaderCallback,"user");z(g,"aoFooterCallback",e.fnFooterCallback,"user");z(g,"aoInitComplete",e.fnInitComplete,"user");z(g,"aoPreDrawCallback",e.fnPreDrawCallback,"user");g.oFeatures.bServerSide&&
|
||||
g.oFeatures.bSort&&g.oFeatures.bSortClasses?z(g,"aoDrawCallback",P,"server_side_sort_classes"):g.oFeatures.bDeferRender&&z(g,"aoDrawCallback",P,"defer_sort_classes");e.bJQueryUI?(h.extend(g.oClasses,j.ext.oJUIClasses),e.sDom===j.defaults.sDom&&"lfrtip"===j.defaults.sDom&&(g.sDom='<"H"lfr>t<"F"ip>')):h.extend(g.oClasses,j.ext.oStdClasses);h(this).addClass(g.oClasses.sTable);if(""!==g.oScroll.sX||""!==g.oScroll.sY)g.oScroll.iBarWidth=Qa();g.iInitDisplayStart===n&&(g.iInitDisplayStart=e.iDisplayStart,
|
||||
g._iDisplayStart=e.iDisplayStart);e.bStateSave&&(g.oFeatures.bStateSave=!0,Sa(g,e),z(g,"aoDrawCallback",ra,"state_save"));null!==e.iDeferLoading&&(g.bDeferLoading=!0,a=h.isArray(e.iDeferLoading),g._iRecordsDisplay=a?e.iDeferLoading[0]:e.iDeferLoading,g._iRecordsTotal=a?e.iDeferLoading[1]:e.iDeferLoading);null!==e.aaData&&(f=!0);""!==e.oLanguage.sUrl?(g.oLanguage.sUrl=e.oLanguage.sUrl,h.getJSON(g.oLanguage.sUrl,null,function(a){pa(a);h.extend(true,g.oLanguage,e.oLanguage,a);ba(g)}),i=!0):h.extend(!0,
|
||||
g.oLanguage,e.oLanguage);null===e.asStripeClasses&&(g.asStripeClasses=[g.oClasses.sStripeOdd,g.oClasses.sStripeEven]);b=g.asStripeClasses.length;g.asDestroyStripes=[];if(b){c=!1;d=h(this).children("tbody").children("tr:lt("+b+")");for(a=0;a<b;a++)d.hasClass(g.asStripeClasses[a])&&(c=!0,g.asDestroyStripes.push(g.asStripeClasses[a]));c&&d.removeClass(g.asStripeClasses.join(" "))}c=[];a=this.getElementsByTagName("thead");0!==a.length&&(V(g.aoHeader,a[0]),c=N(g));if(null===e.aoColumns){d=[];a=0;for(b=
|
||||
c.length;a<b;a++)d.push(null)}else d=e.aoColumns;a=0;for(b=d.length;a<b;a++)e.saved_aoColumns!==n&&e.saved_aoColumns.length==b&&(null===d[a]&&(d[a]={}),d[a].bVisible=e.saved_aoColumns[a].bVisible),o(g,c?c[a]:null);ta(g,e.aoColumnDefs,d,function(a,b){m(g,a,b)});a=0;for(b=g.aaSorting.length;a<b;a++){g.aaSorting[a][0]>=g.aoColumns.length&&(g.aaSorting[a][0]=0);var k=g.aoColumns[g.aaSorting[a][0]];g.aaSorting[a][2]===n&&(g.aaSorting[a][2]=0);e.aaSorting===n&&g.saved_aaSorting===n&&(g.aaSorting[a][1]=
|
||||
k.asSorting[0]);c=0;for(d=k.asSorting.length;c<d;c++)if(g.aaSorting[a][1]==k.asSorting[c]){g.aaSorting[a][2]=c;break}}P(g);Ua(g);a=h(this).children("caption").each(function(){this._captionSide=h(this).css("caption-side")});b=h(this).children("thead");0===b.length&&(b=[l.createElement("thead")],this.appendChild(b[0]));g.nTHead=b[0];b=h(this).children("tbody");0===b.length&&(b=[l.createElement("tbody")],this.appendChild(b[0]));g.nTBody=b[0];g.nTBody.setAttribute("role","alert");g.nTBody.setAttribute("aria-live",
|
||||
"polite");g.nTBody.setAttribute("aria-relevant","all");b=h(this).children("tfoot");if(0===b.length&&0<a.length&&(""!==g.oScroll.sX||""!==g.oScroll.sY))b=[l.createElement("tfoot")],this.appendChild(b[0]);0<b.length&&(g.nTFoot=b[0],V(g.aoFooter,g.nTFoot));if(f)for(a=0;a<e.aaData.length;a++)H(g,e.aaData[a]);else ua(g);g.aiDisplay=g.aiDisplayMaster.slice();g.bInitialised=!0;!1===i&&ba(g)}});ca=null;return this};j.fnVersionCheck=function(e){for(var h=function(e,h){for(;e.length<h;)e+="0";return e},m=j.ext.sVersion.split("."),
|
||||
e=e.split("."),k="",n="",l=0,t=e.length;l<t;l++)k+=h(m[l],3),n+=h(e[l],3);return parseInt(k,10)>=parseInt(n,10)};j.fnIsDataTable=function(e){for(var h=j.settings,m=0;m<h.length;m++)if(h[m].nTable===e||h[m].nScrollHead===e||h[m].nScrollFoot===e)return!0;return!1};j.fnTables=function(e){var o=[];jQuery.each(j.settings,function(j,k){(!e||!0===e&&h(k.nTable).is(":visible"))&&o.push(k.nTable)});return o};j.version="1.9.4";j.settings=[];j.models={};j.models.ext={afnFiltering:[],afnSortData:[],aoFeatures:[],
|
||||
aTypes:[],fnVersionCheck:j.fnVersionCheck,iApiIndex:0,ofnSearch:{},oApi:{},oStdClasses:{},oJUIClasses:{},oPagination:{},oSort:{},sVersion:j.version,sErrMode:"alert",_oExternConfig:{iNextUnique:0}};j.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0};j.models.oRow={nTr:null,_aData:[],_aSortData:[],_anHidden:[],_sRowStripe:""};j.models.oColumn={aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bUseRendered:null,bVisible:null,_bAutoType:!0,fnCreatedCell:null,fnGetData:null,
|
||||
fnRender:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};j.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bJQueryUI:!1,bLengthChange:!0,
|
||||
bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollAutoCss:!0,bScrollCollapse:!1,bScrollInfinite:!1,bServerSide:!1,bSort:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCookieCallback:null,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(e){if(1E3>e)return e;for(var h=e+"",e=h.split(""),j="",h=h.length,k=0;k<h;k++)0===k%3&&0!==k&&(j=this.oLanguage.sInfoThousands+j),j=e[h-k-1]+j;return j},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,
|
||||
fnRowCallback:null,fnServerData:function(e,j,m,k){k.jqXHR=h.ajax({url:e,data:j,success:function(e){e.sError&&k.oApi._fnLog(k,0,e.sError);h(k.oInstance).trigger("xhr",[k,e]);m(e)},dataType:"json",cache:!1,type:k.sServerMethod,error:function(e,h){"parsererror"==h&&k.oApi._fnLog(k,0,"DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.")}})},fnServerParams:null,fnStateLoad:function(e){var e=this.oApi._fnReadCookie(e.sCookiePrefix+e.sInstance),j;try{j=
|
||||
"function"===typeof h.parseJSON?h.parseJSON(e):eval("("+e+")")}catch(m){j=null}return j},fnStateLoadParams:null,fnStateLoaded:null,fnStateSave:function(e,h){this.oApi._fnCreateCookie(e.sCookiePrefix+e.sInstance,this.oApi._fnJsonString(h),e.iCookieDuration,e.sCookiePrefix,e.fnCookieCallback)},fnStateSaveParams:null,iCookieDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iScrollLoadGap:100,iTabIndex:0,oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},
|
||||
oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sInfoThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sUrl:"",sZeroRecords:"No matching records found"},oSearch:h.extend({},j.models.oSearch),sAjaxDataProp:"aaData",
|
||||
sAjaxSource:null,sCookiePrefix:"SpryMedia_DataTables_",sDom:"lfrtip",sPaginationType:"two_button",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET"};j.defaults.columns={aDataSort:null,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bUseRendered:!0,bVisible:!0,fnCreatedCell:null,fnRender:null,iDataSort:-1,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};j.models.oSettings={oFeatures:{bAutoWidth:null,
|
||||
bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortClasses:null,bStateSave:null},oScroll:{bAutoCss:null,bCollapse:null,bInfinite:null,iBarWidth:0,iLoadGap:null,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1},aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aoColumns:[],aoHeader:[],aoFooter:[],asDataSearch:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:null,
|
||||
asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,sPaginationType:"two_button",iCookieDuration:0,sCookiePrefix:"",fnCookieCallback:null,aoStateSave:[],aoStateLoad:[],
|
||||
oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iDisplayEnd:10,_iRecordsTotal:0,_iRecordsDisplay:0,bJUI:null,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsTotal,10):this.aiDisplayMaster.length},
|
||||
fnRecordsDisplay:function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsDisplay,10):this.aiDisplay.length},fnDisplayEnd:function(){return this.oFeatures.bServerSide?!1===this.oFeatures.bPaginate||-1==this._iDisplayLength?this._iDisplayStart+this.aiDisplay.length:Math.min(this._iDisplayStart+this._iDisplayLength,this._iRecordsDisplay):this._iDisplayEnd},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null};j.ext=h.extend(!0,{},j.models.ext);h.extend(j.ext.oStdClasses,
|
||||
{sTable:"dataTable",sPagePrevEnabled:"paginate_enabled_previous",sPagePrevDisabled:"paginate_disabled_previous",sPageNextEnabled:"paginate_enabled_next",sPageNextDisabled:"paginate_disabled_next",sPageJUINext:"",sPageJUIPrev:"",sPageButton:"paginate_button",sPageButtonActive:"paginate_active",sPageButtonStaticDisabled:"paginate_button paginate_button_disabled",sPageFirst:"first",sPagePrevious:"previous",sPageNext:"next",sPageLast:"last",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",
|
||||
sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",
|
||||
sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sFooterTH:"",sJUIHeader:"",sJUIFooter:""});h.extend(j.ext.oJUIClasses,j.ext.oStdClasses,{sPagePrevEnabled:"fg-button ui-button ui-state-default ui-corner-left",sPagePrevDisabled:"fg-button ui-button ui-state-default ui-corner-left ui-state-disabled",sPageNextEnabled:"fg-button ui-button ui-state-default ui-corner-right",
|
||||
sPageNextDisabled:"fg-button ui-button ui-state-default ui-corner-right ui-state-disabled",sPageJUINext:"ui-icon ui-icon-circle-arrow-e",sPageJUIPrev:"ui-icon ui-icon-circle-arrow-w",sPageButton:"fg-button ui-button ui-state-default",sPageButtonActive:"fg-button ui-button ui-state-default ui-state-disabled",sPageButtonStaticDisabled:"fg-button ui-button ui-state-default ui-state-disabled",sPageFirst:"first ui-corner-tl ui-corner-bl",sPageLast:"last ui-corner-tr ui-corner-br",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",
|
||||
sSortAsc:"ui-state-default",sSortDesc:"ui-state-default",sSortable:"ui-state-default",sSortableAsc:"ui-state-default",sSortableDesc:"ui-state-default",sSortableNone:"ui-state-default",sSortJUIAsc:"css_right ui-icon ui-icon-triangle-1-n",sSortJUIDesc:"css_right ui-icon ui-icon-triangle-1-s",sSortJUI:"css_right ui-icon ui-icon-carat-2-n-s",sSortJUIAscAllowed:"css_right ui-icon ui-icon-carat-1-n",sSortJUIDescAllowed:"css_right ui-icon ui-icon-carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon",
|
||||
sScrollHead:"dataTables_scrollHead ui-state-default",sScrollFoot:"dataTables_scrollFoot ui-state-default",sFooterTH:"ui-state-default",sJUIHeader:"fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix",sJUIFooter:"fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"});h.extend(j.ext.oPagination,{two_button:{fnInit:function(e,j,m){var k=e.oLanguage.oPaginate,n=function(h){e.oApi._fnPageChange(e,h.data.action)&&m(e)},k=!e.bJUI?'<a class="'+
|
||||
e.oClasses.sPagePrevDisabled+'" tabindex="'+e.iTabIndex+'" role="button">'+k.sPrevious+'</a><a class="'+e.oClasses.sPageNextDisabled+'" tabindex="'+e.iTabIndex+'" role="button">'+k.sNext+"</a>":'<a class="'+e.oClasses.sPagePrevDisabled+'" tabindex="'+e.iTabIndex+'" role="button"><span class="'+e.oClasses.sPageJUIPrev+'"></span></a><a class="'+e.oClasses.sPageNextDisabled+'" tabindex="'+e.iTabIndex+'" role="button"><span class="'+e.oClasses.sPageJUINext+'"></span></a>';h(j).append(k);var l=h("a",j),
|
||||
k=l[0],l=l[1];e.oApi._fnBindAction(k,{action:"previous"},n);e.oApi._fnBindAction(l,{action:"next"},n);e.aanFeatures.p||(j.id=e.sTableId+"_paginate",k.id=e.sTableId+"_previous",l.id=e.sTableId+"_next",k.setAttribute("aria-controls",e.sTableId),l.setAttribute("aria-controls",e.sTableId))},fnUpdate:function(e){if(e.aanFeatures.p)for(var h=e.oClasses,j=e.aanFeatures.p,k,l=0,n=j.length;l<n;l++)if(k=j[l].firstChild)k.className=0===e._iDisplayStart?h.sPagePrevDisabled:h.sPagePrevEnabled,k=k.nextSibling,
|
||||
k.className=e.fnDisplayEnd()==e.fnRecordsDisplay()?h.sPageNextDisabled:h.sPageNextEnabled}},iFullNumbersShowPages:5,full_numbers:{fnInit:function(e,j,m){var k=e.oLanguage.oPaginate,l=e.oClasses,n=function(h){e.oApi._fnPageChange(e,h.data.action)&&m(e)};h(j).append('<a tabindex="'+e.iTabIndex+'" class="'+l.sPageButton+" "+l.sPageFirst+'">'+k.sFirst+'</a><a tabindex="'+e.iTabIndex+'" class="'+l.sPageButton+" "+l.sPagePrevious+'">'+k.sPrevious+'</a><span></span><a tabindex="'+e.iTabIndex+'" class="'+
|
||||
l.sPageButton+" "+l.sPageNext+'">'+k.sNext+'</a><a tabindex="'+e.iTabIndex+'" class="'+l.sPageButton+" "+l.sPageLast+'">'+k.sLast+"</a>");var t=h("a",j),k=t[0],l=t[1],r=t[2],t=t[3];e.oApi._fnBindAction(k,{action:"first"},n);e.oApi._fnBindAction(l,{action:"previous"},n);e.oApi._fnBindAction(r,{action:"next"},n);e.oApi._fnBindAction(t,{action:"last"},n);e.aanFeatures.p||(j.id=e.sTableId+"_paginate",k.id=e.sTableId+"_first",l.id=e.sTableId+"_previous",r.id=e.sTableId+"_next",t.id=e.sTableId+"_last")},
|
||||
fnUpdate:function(e,o){if(e.aanFeatures.p){var m=j.ext.oPagination.iFullNumbersShowPages,k=Math.floor(m/2),l=Math.ceil(e.fnRecordsDisplay()/e._iDisplayLength),n=Math.ceil(e._iDisplayStart/e._iDisplayLength)+1,t="",r,B=e.oClasses,u,M=e.aanFeatures.p,L=function(h){e.oApi._fnBindAction(this,{page:h+r-1},function(h){e.oApi._fnPageChange(e,h.data.page);o(e);h.preventDefault()})};-1===e._iDisplayLength?n=k=r=1:l<m?(r=1,k=l):n<=k?(r=1,k=m):n>=l-k?(r=l-m+1,k=l):(r=n-Math.ceil(m/2)+1,k=r+m-1);for(m=r;m<=k;m++)t+=
|
||||
n!==m?'<a tabindex="'+e.iTabIndex+'" class="'+B.sPageButton+'">'+e.fnFormatNumber(m)+"</a>":'<a tabindex="'+e.iTabIndex+'" class="'+B.sPageButtonActive+'">'+e.fnFormatNumber(m)+"</a>";m=0;for(k=M.length;m<k;m++)u=M[m],u.hasChildNodes()&&(h("span:eq(0)",u).html(t).children("a").each(L),u=u.getElementsByTagName("a"),u=[u[0],u[1],u[u.length-2],u[u.length-1]],h(u).removeClass(B.sPageButton+" "+B.sPageButtonActive+" "+B.sPageButtonStaticDisabled),h([u[0],u[1]]).addClass(1==n?B.sPageButtonStaticDisabled:
|
||||
B.sPageButton),h([u[2],u[3]]).addClass(0===l||n===l||-1===e._iDisplayLength?B.sPageButtonStaticDisabled:B.sPageButton))}}}});h.extend(j.ext.oSort,{"string-pre":function(e){"string"!=typeof e&&(e=null!==e&&e.toString?e.toString():"");return e.toLowerCase()},"string-asc":function(e,h){return e<h?-1:e>h?1:0},"string-desc":function(e,h){return e<h?1:e>h?-1:0},"html-pre":function(e){return e.replace(/<.*?>/g,"").toLowerCase()},"html-asc":function(e,h){return e<h?-1:e>h?1:0},"html-desc":function(e,h){return e<
|
||||
h?1:e>h?-1:0},"date-pre":function(e){e=Date.parse(e);if(isNaN(e)||""===e)e=Date.parse("01/01/1970 00:00:00");return e},"date-asc":function(e,h){return e-h},"date-desc":function(e,h){return h-e},"numeric-pre":function(e){return"-"==e||""===e?0:1*e},"numeric-asc":function(e,h){return e-h},"numeric-desc":function(e,h){return h-e}});h.extend(j.ext.aTypes,[function(e){if("number"===typeof e)return"numeric";if("string"!==typeof e)return null;var h,j=!1;h=e.charAt(0);if(-1=="0123456789-".indexOf(h))return null;
|
||||
for(var k=1;k<e.length;k++){h=e.charAt(k);if(-1=="0123456789.".indexOf(h))return null;if("."==h){if(j)return null;j=!0}}return"numeric"},function(e){var h=Date.parse(e);return null!==h&&!isNaN(h)||"string"===typeof e&&0===e.length?"date":null},function(e){return"string"===typeof e&&-1!=e.indexOf("<")&&-1!=e.indexOf(">")?"html":null}]);h.fn.DataTable=j;h.fn.dataTable=j;h.fn.dataTableSettings=j.settings;h.fn.dataTableExt=j.ext};"function"===typeof define&&define.amd?define(["jquery"],L):jQuery&&!jQuery.fn.dataTable&&
|
||||
L(jQuery)})(window,document);
|
||||
159
modules/lib/datatables/jquery.dataTables.sorting.js
Normal file
159
modules/lib/datatables/jquery.dataTables.sorting.js
Normal file
@ -0,0 +1,159 @@
|
||||
//Commas for decimal place
|
||||
jQuery.fn.dataTableExt.oSort['numeric-comma-asc'] = function(a,b) {
|
||||
var x = (a == "-") ? 0 : a.replace( /,/, "." );
|
||||
var y = (b == "-") ? 0 : b.replace( /,/, "." );
|
||||
x = parseFloat( x );
|
||||
y = parseFloat( y );
|
||||
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
|
||||
};
|
||||
|
||||
jQuery.fn.dataTableExt.oSort['numeric-comma-desc'] = function(a,b) {
|
||||
var x = (a == "-") ? 0 : a.replace( /,/, "." );
|
||||
var y = (b == "-") ? 0 : b.replace( /,/, "." );
|
||||
x = parseFloat( x );
|
||||
y = parseFloat( y );
|
||||
return ((x < y) ? 1 : ((x > y) ? -1 : 0));
|
||||
};
|
||||
|
||||
//Formatted numbers
|
||||
jQuery.fn.dataTableExt.oSort['formatted-num-asc'] = function(x,y){
|
||||
x = x.replace(/[^\d\-\.\/]/g,'');
|
||||
y = y.replace(/[^\d\-\.\/]/g,'');
|
||||
if(x.indexOf('/')>=0)x = eval(x);
|
||||
if(y.indexOf('/')>=0)y = eval(y);
|
||||
return x/1 - y/1;
|
||||
}
|
||||
jQuery.fn.dataTableExt.oSort['formatted-num-desc'] = function(x,y){
|
||||
x = x.replace(/[^\d\-\.\/]/g,'');
|
||||
y = y.replace(/[^\d\-\.\/]/g,'');
|
||||
if(x.indexOf('/')>=0)x = eval(x);
|
||||
if(y.indexOf('/')>=0)y = eval(y);
|
||||
return y/1 - x/1;
|
||||
}
|
||||
|
||||
// Date (dd . mm[ . YYYY])
|
||||
function calculate_date(date) {
|
||||
var date = date.replace(" ", "");
|
||||
|
||||
if (date.indexOf('.') > 0) {
|
||||
/*date a, format dd.mn.(yyyy) ; (year is optional)*/
|
||||
var eu_date = date.split('.');
|
||||
} else {
|
||||
/*date a, format dd/mn/(yyyy) ; (year is optional)*/
|
||||
var eu_date = date.split('/');
|
||||
}
|
||||
|
||||
/*year (optional)*/
|
||||
if (eu_date[2]) {
|
||||
var year = eu_date[2];
|
||||
} else {
|
||||
var year = 0;
|
||||
}
|
||||
|
||||
/*month*/
|
||||
var month = eu_date[1];
|
||||
if (month.length == 1) {
|
||||
month = 0+month;
|
||||
}
|
||||
|
||||
/*day*/
|
||||
var day = eu_date[0];
|
||||
if (day.length == 1) {
|
||||
day = 0+day;
|
||||
}
|
||||
|
||||
return (year + month + day) * 1;
|
||||
}
|
||||
|
||||
jQuery.fn.dataTableExt.oSort['eu_date-asc'] = function(a, b) {
|
||||
x = calculate_date(a);
|
||||
y = calculate_date(b);
|
||||
|
||||
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
|
||||
};
|
||||
|
||||
jQuery.fn.dataTableExt.oSort['eu_date-desc'] = function(a, b) {
|
||||
x = calculate_date(a);
|
||||
y = calculate_date(b);
|
||||
|
||||
return ((x < y) ? 1 : ((x > y) ? -1 : 0));
|
||||
};
|
||||
|
||||
//Automatic HTML type detection
|
||||
jQuery.fn.dataTableExt.aTypes.push(
|
||||
function ( sData ) {
|
||||
return 'html';
|
||||
}
|
||||
);
|
||||
|
||||
//Priority
|
||||
function fnPriority( a ) {
|
||||
if ( a == "High" ) { return 1; }
|
||||
else if ( a == "Medium" ) { return 2; }
|
||||
else if ( a == "Low" ) { return 3; }
|
||||
return 4;
|
||||
}
|
||||
|
||||
jQuery.fn.dataTableExt.oSort['priority-asc'] = function(a,b) {
|
||||
var x = fnPriority( a );
|
||||
var y = fnPriority( b );
|
||||
|
||||
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
|
||||
};
|
||||
|
||||
jQuery.fn.dataTableExt.oSort['priority-desc'] = function(a,b) {
|
||||
var x = fnPriority( a );
|
||||
var y = fnPriority( b );
|
||||
|
||||
return ((x < y) ? 1 : ((x > y) ? -1 : 0));
|
||||
};
|
||||
|
||||
/*
|
||||
* Natural Sort algorithm for Javascript - Version 0.6 - Released under MIT license
|
||||
* Author: Jim Palmer (based on chunking idea from Dave Koelle)
|
||||
* Contributors: Mike Grier (mgrier.com), Clint Priest, Kyle Adams, guillermo
|
||||
*/
|
||||
function naturalSort (a, b) {
|
||||
var re = /(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi,
|
||||
sre = /(^[ ]*|[ ]*$)/g,
|
||||
dre = /(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,
|
||||
hre = /^0x[0-9a-f]+$/i,
|
||||
ore = /^0/,
|
||||
// convert all to strings and trim()
|
||||
x = a.toString().replace(sre, '') || '',
|
||||
y = b.toString().replace(sre, '') || '',
|
||||
// chunk/tokenize
|
||||
xN = x.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0'),
|
||||
yN = y.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0'),
|
||||
// numeric, hex or date detection
|
||||
xD = parseInt(x.match(hre)) || (xN.length != 1 && x.match(dre) && Date.parse(x)),
|
||||
yD = parseInt(y.match(hre)) || xD && y.match(dre) && Date.parse(y) || null;
|
||||
// first try and sort Hex codes or Dates
|
||||
if (yD)
|
||||
if ( xD < yD ) return -1;
|
||||
else if ( xD > yD ) return 1;
|
||||
// natural sorting through split numeric strings and default strings
|
||||
for(var cLoc=0, numS=Math.max(xN.length, yN.length); cLoc < numS; cLoc++) {
|
||||
// find floats not starting with '0', string or 0 if not defined (Clint Priest)
|
||||
oFxNcL = !(xN[cLoc] || '').match(ore) && parseFloat(xN[cLoc]) || xN[cLoc] || 0;
|
||||
oFyNcL = !(yN[cLoc] || '').match(ore) && parseFloat(yN[cLoc]) || yN[cLoc] || 0;
|
||||
// handle numeric vs string comparison - number < string - (Kyle Adams)
|
||||
if (isNaN(oFxNcL) !== isNaN(oFyNcL)) return (isNaN(oFxNcL)) ? 1 : -1;
|
||||
// rely on string comparison if different types - i.e. '02' < 2 != '02' < '2'
|
||||
else if (typeof oFxNcL !== typeof oFyNcL) {
|
||||
oFxNcL += '';
|
||||
oFyNcL += '';
|
||||
}
|
||||
if (oFxNcL < oFyNcL) return -1;
|
||||
if (oFxNcL > oFyNcL) return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
jQuery.fn.dataTableExt.oSort['natural-asc'] = function(a,b) {
|
||||
return naturalSort(a,b);
|
||||
};
|
||||
|
||||
jQuery.fn.dataTableExt.oSort['natural-desc'] = function(a,b) {
|
||||
return naturalSort(a,b) * -1;
|
||||
};
|
||||
10
modules/lib/datatables/license-bsd.txt
Normal file
10
modules/lib/datatables/license-bsd.txt
Normal file
@ -0,0 +1,10 @@
|
||||
Copyright (c) 2008-2010, Allan Jardine
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Allan Jardine nor SpryMedia UK may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
339
modules/lib/datatables/license-gpl2.txt
Normal file
339
modules/lib/datatables/license-gpl2.txt
Normal file
@ -0,0 +1,339 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the 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 Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 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 Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
203
modules/lib/datatables/server_side.php
Normal file
203
modules/lib/datatables/server_side.php
Normal file
@ -0,0 +1,203 @@
|
||||
<?php
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Easy set variables
|
||||
*/
|
||||
|
||||
/* Array of database columns which should be read and sent back to DataTables. Use a space where
|
||||
* you want to insert a non-database field (for example a counter or static image)
|
||||
*/
|
||||
$aColumns = array( 'engine', 'browser', 'platform', 'version', 'grade' );
|
||||
|
||||
/* Indexed column (used for fast and accurate table cardinality) */
|
||||
$sIndexColumn = "id";
|
||||
|
||||
/* DB table to use */
|
||||
$sTable = "ajax";
|
||||
|
||||
/* Database connection information */
|
||||
$gaSql['user'] = "";
|
||||
$gaSql['password'] = "";
|
||||
$gaSql['db'] = "";
|
||||
$gaSql['server'] = "localhost";
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* If you just want to use the basic configuration for DataTables with PHP server-side, there is
|
||||
* no need to edit below this line
|
||||
*/
|
||||
|
||||
/*
|
||||
* MySQL connection
|
||||
*/
|
||||
$gaSql['link'] = mysql_pconnect( $gaSql['server'], $gaSql['user'], $gaSql['password'] ) or
|
||||
die( 'Could not open connection to server' );
|
||||
|
||||
mysql_select_db( $gaSql['db'], $gaSql['link'] ) or
|
||||
die( 'Could not select database '. $gaSql['db'] );
|
||||
|
||||
|
||||
/*
|
||||
* Paging
|
||||
*/
|
||||
$sLimit = "";
|
||||
if ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )
|
||||
{
|
||||
$sLimit = "LIMIT ".mysql_real_escape_string( $_GET['iDisplayStart'] ).", ".
|
||||
mysql_real_escape_string( $_GET['iDisplayLength'] );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Ordering
|
||||
*/
|
||||
$sOrder = "";
|
||||
if ( isset( $_GET['iSortCol_0'] ) )
|
||||
{
|
||||
$sOrder = "ORDER BY ";
|
||||
for ( $i=0 ; $i<intval( $_GET['iSortingCols'] ) ; $i++ )
|
||||
{
|
||||
if ( $_GET[ 'bSortable_'.intval($_GET['iSortCol_'.$i]) ] == "true" )
|
||||
{
|
||||
$sOrder .= $aColumns[ intval( $_GET['iSortCol_'.$i] )-1 ]."
|
||||
".mysql_real_escape_string( $_GET['sSortDir_'.$i] ) .", ";
|
||||
}
|
||||
}
|
||||
|
||||
$sOrder = substr_replace( $sOrder, "", -2 );
|
||||
if ( $sOrder == "ORDER BY" )
|
||||
{
|
||||
$sOrder = "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Filtering
|
||||
* NOTE this does not match the built-in DataTables filtering which does it
|
||||
* word by word on any field. It's possible to do here, but concerned about efficiency
|
||||
* on very large tables, and MySQL's regex functionality is very limited
|
||||
*/
|
||||
$sWhere = "";
|
||||
if ( $_GET['sSearch'] != "" )
|
||||
{
|
||||
$sWhere = "(";
|
||||
$aWords = preg_split('/\s+/', $_GET['sSearch']);
|
||||
for ( $j=0 ; $j<count($aWords) ; $j++ )
|
||||
{
|
||||
if ( $aWords[$j] != "" )
|
||||
{
|
||||
$sWhere .= "(";
|
||||
for ( $i=0 ; $i<count($aColumns) ; $i++ )
|
||||
{
|
||||
$sWhere .= $aColumns[$i]." LIKE '%".mysql_real_escape_string( $aWords[$j] )."%' OR ";
|
||||
}
|
||||
$sWhere = substr_replace( $sWhere, "", -3 );
|
||||
$sWhere .= ") AND ";
|
||||
}
|
||||
}
|
||||
|
||||
$sWhere = substr_replace( $sWhere, "", -5 );
|
||||
$sWhere .= ")";
|
||||
}
|
||||
|
||||
/* Individual column filtering */
|
||||
$sColumnWhere = "";
|
||||
for ( $i=0 ; $i<count($aColumns) ; $i++ )
|
||||
{
|
||||
if ( $_GET['sSearch_'.$i] != "" )
|
||||
{
|
||||
$aWords = preg_split('/\s+/', $_GET['sSearch_'.$i]);
|
||||
$sColumnWhere .= "(";
|
||||
for ( $j=0 ; $j<count($aWords) ; $j++ )
|
||||
{
|
||||
if ( $aWords[$j] != "" )
|
||||
{
|
||||
$sColumnWhere .= $aColumns[$i]." LIKE '%".mysql_real_escape_string( $aWords[$j] )."%' OR ";
|
||||
}
|
||||
}
|
||||
$sColumnWhere = substr_replace( $sColumnWhere, "", -3 );
|
||||
$sColumnWhere .= ") AND ";
|
||||
}
|
||||
}
|
||||
|
||||
if ( $sColumnWhere != "" ) {
|
||||
$sColumnWhere = substr_replace( $sColumnWhere, "", -5 );
|
||||
if ( $sWhere == "" ) {
|
||||
$sWhere = $sColumnWhere;
|
||||
} else {
|
||||
$sWhere .= " AND ".$sColumnWhere;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $sWhere != "" )
|
||||
{
|
||||
$sWhere = "WHERE ".$sWhere;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* SQL queries
|
||||
* Get data to display
|
||||
*/
|
||||
$sQuery = "
|
||||
SELECT SQL_CALC_FOUND_ROWS ".str_replace(" , ", " ", implode(", ", $aColumns))."
|
||||
FROM $sTable
|
||||
$sWhere
|
||||
$sOrder
|
||||
$sLimit
|
||||
";
|
||||
$rResult = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
|
||||
/* Data set length after filtering */
|
||||
$sQuery = "
|
||||
SELECT FOUND_ROWS()
|
||||
";
|
||||
$rResultFilterTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$aResultFilterTotal = mysql_fetch_array($rResultFilterTotal);
|
||||
$iFilteredTotal = $aResultFilterTotal[0];
|
||||
|
||||
/* Total data set length */
|
||||
$sQuery = "
|
||||
SELECT COUNT(".$sIndexColumn.")
|
||||
FROM $sTable
|
||||
";
|
||||
$rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
|
||||
$aResultTotal = mysql_fetch_array($rResultTotal);
|
||||
$iTotal = $aResultTotal[0];
|
||||
|
||||
|
||||
/*
|
||||
* Output
|
||||
*/
|
||||
$output = array(
|
||||
"sEcho" => intval($_GET['sEcho']),
|
||||
"iTotalRecords" => $iTotal,
|
||||
"iTotalDisplayRecords" => $iFilteredTotal,
|
||||
"aaData" => array()
|
||||
);
|
||||
|
||||
while ( $aRow = mysql_fetch_array( $rResult ) )
|
||||
{
|
||||
$row = array();
|
||||
|
||||
/* Add the details image at the start of the display array */
|
||||
$row[] = '<img src="img/details_open.png">';
|
||||
|
||||
for ( $i=0 ; $i<count($aColumns) ; $i++ )
|
||||
{
|
||||
if ( $aColumns[$i] == "version" )
|
||||
{
|
||||
/* Special output formatting for 'version' column */
|
||||
$row[] = ($aRow[ $aColumns[$i] ]=="0") ? '-' : $aRow[ $aColumns[$i] ];
|
||||
}
|
||||
else if ( $aColumns[$i] != ' ' )
|
||||
{
|
||||
/* General output */
|
||||
$row[] = $aRow[ $aColumns[$i] ];
|
||||
}
|
||||
}
|
||||
$row['extra'] = 'hrmll';
|
||||
$output['aaData'][] = $row;
|
||||
}
|
||||
|
||||
echo json_encode( $output );
|
||||
?>
|
||||
202
modules/lib/datepicker/LICENSE
Normal file
202
modules/lib/datepicker/LICENSE
Normal file
@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
753
modules/lib/datepicker/bootstrap-datepicker.js
vendored
Normal file
753
modules/lib/datepicker/bootstrap-datepicker.js
vendored
Normal file
@ -0,0 +1,753 @@
|
||||
/* =========================================================
|
||||
* bootstrap-datepicker.js
|
||||
* http://www.eyecon.ro/bootstrap-datepicker
|
||||
* =========================================================
|
||||
* Copyright 2012 Stefan Petre
|
||||
* Improvements by Andrew Rowls
|
||||
*
|
||||
* 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.
|
||||
* ========================================================= */
|
||||
|
||||
!function( $ ) {
|
||||
|
||||
// Picker object
|
||||
|
||||
var Datepicker = function(element, options){
|
||||
this.element = $(element);
|
||||
this.language = options.language||this.element.data('date-language')||"en";
|
||||
this.language = this.language in dates ? this.language : "en";
|
||||
this.format = DPGlobal.parseFormat(options.format||this.element.data('date-format')||'mm/dd/yyyy');
|
||||
this.picker = $(DPGlobal.template)
|
||||
.appendTo('body')
|
||||
.on({
|
||||
click: $.proxy(this.click, this),
|
||||
mousedown: $.proxy(this.mousedown, this)
|
||||
});
|
||||
this.isInput = this.element.is('input');
|
||||
this.component = this.element.is('.date') ? this.element.find('.add-on') : false;
|
||||
if(this.component && this.component.length === 0)
|
||||
this.component = false;
|
||||
|
||||
if (this.isInput) {
|
||||
this.element.on({
|
||||
focus: $.proxy(this.show, this),
|
||||
blur: $.proxy(this._hide, this),
|
||||
keyup: $.proxy(this.update, this),
|
||||
keydown: $.proxy(this.keydown, this)
|
||||
});
|
||||
} else {
|
||||
if (this.component){
|
||||
this.component.on('click', $.proxy(this.show, this));
|
||||
var element = this.element.find('input');
|
||||
element.on({
|
||||
blur: $.proxy(this._hide, this)
|
||||
})
|
||||
} else {
|
||||
this.element.on('click', $.proxy(this.show, this));
|
||||
}
|
||||
}
|
||||
|
||||
this.autoclose = false;
|
||||
if ('autoclose' in options) {
|
||||
this.autoclose = options.autoclose;
|
||||
} else if ('dateAutoclose' in this.element.data()) {
|
||||
this.autoclose = this.element.data('date-autoclose');
|
||||
}
|
||||
|
||||
switch(options.startView){
|
||||
case 2:
|
||||
case 'decade':
|
||||
this.viewMode = this.startViewMode = 2;
|
||||
break;
|
||||
case 1:
|
||||
case 'year':
|
||||
this.viewMode = this.startViewMode = 1;
|
||||
break;
|
||||
case 0:
|
||||
case 'month':
|
||||
default:
|
||||
this.viewMode = this.startViewMode = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
this.weekStart = ((options.weekStart||this.element.data('date-weekstart')||dates[this.language].weekStart||0) % 7);
|
||||
this.weekEnd = ((this.weekStart + 6) % 7);
|
||||
this.startDate = -Infinity;
|
||||
this.endDate = Infinity;
|
||||
this.setStartDate(options.startDate||this.element.data('date-startdate'));
|
||||
this.setEndDate(options.endDate||this.element.data('date-enddate'));
|
||||
this.fillDow();
|
||||
this.fillMonths();
|
||||
this.update();
|
||||
this.showMode();
|
||||
};
|
||||
|
||||
Datepicker.prototype = {
|
||||
constructor: Datepicker,
|
||||
|
||||
show: function(e) {
|
||||
this.picker.show();
|
||||
this.height = this.component ? this.component.outerHeight() : this.element.outerHeight();
|
||||
this.place();
|
||||
$(window).on('resize', $.proxy(this.place, this));
|
||||
if (e ) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
}
|
||||
if (!this.isInput) {
|
||||
$(document).on('mousedown', $.proxy(this.hide, this));
|
||||
}
|
||||
this.element.trigger({
|
||||
type: 'show',
|
||||
date: this.date
|
||||
});
|
||||
},
|
||||
|
||||
_hide: function(e){
|
||||
// When going from the input to the picker, IE handles the blur/click
|
||||
// events differently than other browsers, in such a way that the blur
|
||||
// event triggers a hide before the click event can stop propagation.
|
||||
if ($.browser.msie) {
|
||||
var t = this, args = arguments;
|
||||
|
||||
function cancel_hide(){
|
||||
clearTimeout(hide_timeout);
|
||||
e.target.focus();
|
||||
t.picker.off('click', cancel_hide);
|
||||
}
|
||||
|
||||
function do_hide(){
|
||||
t.hide.apply(t, args);
|
||||
t.picker.off('click', cancel_hide);
|
||||
}
|
||||
|
||||
this.picker.on('click', cancel_hide);
|
||||
var hide_timeout = setTimeout(do_hide, 100);
|
||||
} else {
|
||||
return this.hide.apply(this, arguments);
|
||||
}
|
||||
},
|
||||
|
||||
hide: function(e){
|
||||
this.picker.hide();
|
||||
$(window).off('resize', this.place);
|
||||
this.viewMode = this.startViewMode;
|
||||
this.showMode();
|
||||
if (!this.isInput) {
|
||||
$(document).off('mousedown', this.hide);
|
||||
}
|
||||
if (e && e.currentTarget.value)
|
||||
this.setValue();
|
||||
this.element.trigger({
|
||||
type: 'hide',
|
||||
date: this.date
|
||||
});
|
||||
},
|
||||
|
||||
setValue: function() {
|
||||
var formated = DPGlobal.formatDate(this.date, this.format, this.language);
|
||||
if (!this.isInput) {
|
||||
if (this.component){
|
||||
this.element.find('input').prop('value', formated);
|
||||
}
|
||||
this.element.data('date', formated);
|
||||
} else {
|
||||
this.element.prop('value', formated);
|
||||
}
|
||||
},
|
||||
|
||||
setStartDate: function(startDate){
|
||||
this.startDate = startDate||-Infinity;
|
||||
if (this.startDate !== -Infinity) {
|
||||
this.startDate = DPGlobal.parseDate(this.startDate, this.format, this.language);
|
||||
}
|
||||
this.update();
|
||||
this.updateNavArrows();
|
||||
},
|
||||
|
||||
setEndDate: function(endDate){
|
||||
this.endDate = endDate||Infinity;
|
||||
if (this.endDate !== Infinity) {
|
||||
this.endDate = DPGlobal.parseDate(this.endDate, this.format, this.language);
|
||||
}
|
||||
this.update();
|
||||
this.updateNavArrows();
|
||||
},
|
||||
|
||||
place: function(){
|
||||
var offset = this.component ? this.component.offset() : this.element.offset();
|
||||
var windowWidth = $(window).width()
|
||||
var posOver = windowWidth - offset.left;
|
||||
var componentWidth = this.component ? this.component.outerWidth() : 0;
|
||||
if((posOver) < 208 ) {
|
||||
this.picker.addClass('dp_right').css({
|
||||
top: offset.top + this.height,
|
||||
right: posOver - componentWidth,
|
||||
left: 'auto'
|
||||
})
|
||||
} else {
|
||||
this.picker.css({
|
||||
top: offset.top + this.height,
|
||||
left: offset.left
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
update: function(){
|
||||
this.date = DPGlobal.parseDate(
|
||||
this.isInput ? this.element.prop('value') : this.element.data('date'),
|
||||
this.format, this.language
|
||||
);
|
||||
if (this.date < this.startDate) {
|
||||
this.viewDate = new Date(this.startDate);
|
||||
} else if (this.date > this.endDate) {
|
||||
this.viewDate = new Date(this.endDate);
|
||||
} else {
|
||||
this.viewDate = new Date(this.date);
|
||||
}
|
||||
this.fill();
|
||||
},
|
||||
|
||||
fillDow: function(){
|
||||
var dowCnt = this.weekStart;
|
||||
var html = '<tr>';
|
||||
while (dowCnt < this.weekStart + 7) {
|
||||
html += '<th class="dow">'+dates[this.language].daysMin[(dowCnt++)%7]+'</th>';
|
||||
}
|
||||
html += '</tr>';
|
||||
this.picker.find('.datepicker-days thead').append(html);
|
||||
},
|
||||
|
||||
fillMonths: function(){
|
||||
var html = '';
|
||||
var i = 0
|
||||
while (i < 12) {
|
||||
html += '<span class="month">'+dates[this.language].monthsShort[i++]+'</span>';
|
||||
}
|
||||
this.picker.find('.datepicker-months td').html(html);
|
||||
},
|
||||
|
||||
fill: function() {
|
||||
var d = new Date(this.viewDate),
|
||||
year = d.getFullYear(),
|
||||
month = d.getMonth(),
|
||||
startYear = this.startDate !== -Infinity ? this.startDate.getFullYear() : -Infinity,
|
||||
startMonth = this.startDate !== -Infinity ? this.startDate.getMonth() : -Infinity,
|
||||
endYear = this.endDate !== Infinity ? this.endDate.getFullYear() : Infinity,
|
||||
endMonth = this.endDate !== Infinity ? this.endDate.getMonth() : Infinity,
|
||||
currentDate = this.date.valueOf();
|
||||
this.picker.find('.datepicker-days th:eq(1)')
|
||||
.text(dates[this.language].months[month]+' '+year);
|
||||
this.updateNavArrows();
|
||||
this.fillMonths();
|
||||
var prevMonth = new Date(year, month-1, 28,0,0,0,0),
|
||||
day = DPGlobal.getDaysInMonth(prevMonth.getFullYear(), prevMonth.getMonth());
|
||||
prevMonth.setDate(day);
|
||||
prevMonth.setDate(day - (prevMonth.getDay() - this.weekStart + 7)%7);
|
||||
var nextMonth = new Date(prevMonth);
|
||||
nextMonth.setDate(nextMonth.getDate() + 42);
|
||||
nextMonth = nextMonth.valueOf();
|
||||
html = [];
|
||||
var clsName;
|
||||
while(prevMonth.valueOf() < nextMonth) {
|
||||
if (prevMonth.getDay() == this.weekStart) {
|
||||
html.push('<tr>');
|
||||
}
|
||||
clsName = '';
|
||||
if (prevMonth.getFullYear() < year || (prevMonth.getFullYear() == year && prevMonth.getMonth() < month)) {
|
||||
clsName += ' old';
|
||||
} else if (prevMonth.getFullYear() > year || (prevMonth.getFullYear() == year && prevMonth.getMonth() > month)) {
|
||||
clsName += ' new';
|
||||
}
|
||||
if (prevMonth.valueOf() == currentDate) {
|
||||
clsName += ' active';
|
||||
}
|
||||
if (prevMonth.valueOf() < this.startDate || prevMonth.valueOf() > this.endDate) {
|
||||
clsName += ' disabled';
|
||||
}
|
||||
html.push('<td class="day'+clsName+'">'+prevMonth.getDate() + '</td>');
|
||||
if (prevMonth.getDay() == this.weekEnd) {
|
||||
html.push('</tr>');
|
||||
}
|
||||
prevMonth.setDate(prevMonth.getDate()+1);
|
||||
}
|
||||
this.picker.find('.datepicker-days tbody').empty().append(html.join(''));
|
||||
var currentYear = this.date.getFullYear();
|
||||
|
||||
var months = this.picker.find('.datepicker-months')
|
||||
.find('th:eq(1)')
|
||||
.text(year)
|
||||
.end()
|
||||
.find('span').removeClass('active');
|
||||
if (currentYear == year) {
|
||||
months.eq(this.date.getMonth()).addClass('active');
|
||||
}
|
||||
if (year < startYear || year > endYear) {
|
||||
months.addClass('disabled');
|
||||
}
|
||||
if (year == startYear) {
|
||||
months.slice(0, startMonth).addClass('disabled');
|
||||
}
|
||||
if (year == endYear) {
|
||||
months.slice(endMonth+1).addClass('disabled');
|
||||
}
|
||||
|
||||
html = '';
|
||||
year = parseInt(year/10, 10) * 10;
|
||||
var yearCont = this.picker.find('.datepicker-years')
|
||||
.find('th:eq(1)')
|
||||
.text(year + '-' + (year + 9))
|
||||
.end()
|
||||
.find('td');
|
||||
year -= 1;
|
||||
for (var i = -1; i < 11; i++) {
|
||||
html += '<span class="year'+(i == -1 || i == 10 ? ' old' : '')+(currentYear == year ? ' active' : '')+(year < startYear || year > endYear ? ' disabled' : '')+'">'+year+'</span>';
|
||||
year += 1;
|
||||
}
|
||||
yearCont.html(html);
|
||||
},
|
||||
|
||||
updateNavArrows: function() {
|
||||
var d = new Date(this.viewDate),
|
||||
year = d.getFullYear(),
|
||||
month = d.getMonth();
|
||||
switch (this.viewMode) {
|
||||
case 0:
|
||||
if (this.startDate !== -Infinity && year <= this.startDate.getFullYear() && month <= this.startDate.getMonth()) {
|
||||
this.picker.find('.prev').css({visibility: 'hidden'});
|
||||
} else {
|
||||
this.picker.find('.prev').css({visibility: 'visible'});
|
||||
}
|
||||
if (this.endDate !== Infinity && year >= this.endDate.getFullYear() && month >= this.endDate.getMonth()) {
|
||||
this.picker.find('.next').css({visibility: 'hidden'});
|
||||
} else {
|
||||
this.picker.find('.next').css({visibility: 'visible'});
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
if (this.startDate !== -Infinity && year <= this.startDate.getFullYear()) {
|
||||
this.picker.find('.prev').css({visibility: 'hidden'});
|
||||
} else {
|
||||
this.picker.find('.prev').css({visibility: 'visible'});
|
||||
}
|
||||
if (this.endDate !== Infinity && year >= this.endDate.getFullYear()) {
|
||||
this.picker.find('.next').css({visibility: 'hidden'});
|
||||
} else {
|
||||
this.picker.find('.next').css({visibility: 'visible'});
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
click: function(e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
var target = $(e.target).closest('span, td, th');
|
||||
if (target.length == 1) {
|
||||
switch(target[0].nodeName.toLowerCase()) {
|
||||
case 'th':
|
||||
switch(target[0].className) {
|
||||
case 'switch':
|
||||
this.showMode(1);
|
||||
break;
|
||||
case 'prev':
|
||||
case 'next':
|
||||
var dir = DPGlobal.modes[this.viewMode].navStep * (target[0].className == 'prev' ? -1 : 1);
|
||||
switch(this.viewMode){
|
||||
case 0:
|
||||
this.viewDate = this.moveMonth(this.viewDate, dir);
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
this.viewDate = this.moveYear(this.viewDate, dir);
|
||||
break;
|
||||
}
|
||||
this.fill();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'span':
|
||||
if (!target.is('.disabled')) {
|
||||
if (target.is('.month')) {
|
||||
var month = target.parent().find('span').index(target);
|
||||
this.viewDate.setMonth(month);
|
||||
} else {
|
||||
var year = parseInt(target.text(), 10)||0;
|
||||
this.viewDate.setFullYear(year);
|
||||
}
|
||||
this.showMode(-1);
|
||||
this.fill();
|
||||
}
|
||||
break;
|
||||
case 'td':
|
||||
if (target.is('.day') && !target.is('.disabled')){
|
||||
var day = parseInt(target.text(), 10)||1;
|
||||
var year = this.viewDate.getFullYear(),
|
||||
month = this.viewDate.getMonth();
|
||||
if (target.is('.old')) {
|
||||
if (month == 0) {
|
||||
month = 11;
|
||||
year -= 1;
|
||||
} else {
|
||||
month -= 1;
|
||||
}
|
||||
} else if (target.is('.new')) {
|
||||
if (month == 11) {
|
||||
month = 0;
|
||||
year += 1;
|
||||
} else {
|
||||
month += 1;
|
||||
}
|
||||
}
|
||||
this.date = new Date(year, month, day,0,0,0,0);
|
||||
this.viewDate = new Date(year, month, day,0,0,0,0);
|
||||
this.fill();
|
||||
this.setValue();
|
||||
this.element.trigger({
|
||||
type: 'changeDate',
|
||||
date: this.date
|
||||
});
|
||||
var element;
|
||||
if (this.isInput) {
|
||||
element = this.element;
|
||||
} else if (this.component){
|
||||
element = this.element.find('input');
|
||||
}
|
||||
if (element) {
|
||||
element.change();
|
||||
if (this.autoclose) {
|
||||
element.blur();
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
mousedown: function(e){
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
},
|
||||
|
||||
moveMonth: function(date, dir){
|
||||
if (!dir) return date;
|
||||
var new_date = new Date(date.valueOf()),
|
||||
day = new_date.getDate(),
|
||||
month = new_date.getMonth(),
|
||||
mag = Math.abs(dir),
|
||||
new_month, test;
|
||||
dir = dir > 0 ? 1 : -1;
|
||||
if (mag == 1){
|
||||
test = dir == -1
|
||||
// If going back one month, make sure month is not current month
|
||||
// (eg, Mar 31 -> Feb 31 == Feb 28, not Mar 02)
|
||||
? function(){ return new_date.getMonth() == month; }
|
||||
// If going forward one month, make sure month is as expected
|
||||
// (eg, Jan 31 -> Feb 31 == Feb 28, not Mar 02)
|
||||
: function(){ return new_date.getMonth() != new_month; };
|
||||
new_month = month + dir;
|
||||
new_date.setMonth(new_month);
|
||||
// Dec -> Jan (12) or Jan -> Dec (-1) -- limit expected date to 0-11
|
||||
if (new_month < 0 || new_month > 11)
|
||||
new_month = (new_month + 12) % 12;
|
||||
} else {
|
||||
// For magnitudes >1, move one month at a time...
|
||||
for (var i=0; i<mag; i++)
|
||||
// ...which might decrease the day (eg, Jan 31 to Feb 28, etc)...
|
||||
new_date = this.moveMonth(new_date, dir);
|
||||
// ...then reset the day, keeping it in the new month
|
||||
new_month = new_date.getMonth();
|
||||
new_date.setDate(day);
|
||||
test = function(){ return new_month != new_date.getMonth(); };
|
||||
}
|
||||
// Common date-resetting loop -- if date is beyond end of month, make it
|
||||
// end of month
|
||||
while (test()){
|
||||
new_date.setDate(--day);
|
||||
new_date.setMonth(new_month);
|
||||
}
|
||||
return new_date;
|
||||
},
|
||||
|
||||
moveYear: function(date, dir){
|
||||
return this.moveMonth(date, dir*12);
|
||||
},
|
||||
|
||||
keydown: function(e){
|
||||
if (this.picker.is(':not(:visible)')){
|
||||
if (e.keyCode == 27) // allow escape to hide and re-show picker
|
||||
this.show();
|
||||
return;
|
||||
}
|
||||
var dateChanged = false,
|
||||
dir, day, month;
|
||||
switch(e.keyCode){
|
||||
case 27: // escape
|
||||
this.hide();
|
||||
e.preventDefault();
|
||||
break;
|
||||
case 37: // left
|
||||
case 39: // right
|
||||
dir = e.keyCode == 37 ? -1 : 1;
|
||||
if (e.ctrlKey){
|
||||
this.date = this.moveYear(this.date, dir);
|
||||
this.viewDate = this.moveYear(this.viewDate, dir);
|
||||
} else if (e.shiftKey){
|
||||
this.date = this.moveMonth(this.date, dir);
|
||||
this.viewDate = this.moveMonth(this.viewDate, dir);
|
||||
} else {
|
||||
this.date.setDate(this.date.getDate() + dir);
|
||||
this.viewDate.setDate(this.viewDate.getDate() + dir);
|
||||
}
|
||||
this.setValue();
|
||||
this.update();
|
||||
e.preventDefault();
|
||||
dateChanged = true;
|
||||
break;
|
||||
case 38: // up
|
||||
case 40: // down
|
||||
dir = e.keyCode == 38 ? -1 : 1;
|
||||
if (e.ctrlKey){
|
||||
this.date = this.moveYear(this.date, dir);
|
||||
this.viewDate = this.moveYear(this.viewDate, dir);
|
||||
} else if (e.shiftKey){
|
||||
this.date = this.moveMonth(this.date, dir);
|
||||
this.viewDate = this.moveMonth(this.viewDate, dir);
|
||||
} else {
|
||||
this.date.setDate(this.date.getDate() + dir * 7);
|
||||
this.viewDate.setDate(this.viewDate.getDate() + dir * 7);
|
||||
}
|
||||
this.setValue();
|
||||
this.update();
|
||||
e.preventDefault();
|
||||
dateChanged = true;
|
||||
break;
|
||||
case 13: // enter
|
||||
this.hide();
|
||||
e.preventDefault();
|
||||
break;
|
||||
}
|
||||
if (dateChanged){
|
||||
this.element.trigger({
|
||||
type: 'changeDate',
|
||||
date: this.date
|
||||
});
|
||||
var element;
|
||||
if (this.isInput) {
|
||||
element = this.element;
|
||||
} else if (this.component){
|
||||
element = this.element.find('input');
|
||||
}
|
||||
if (element) {
|
||||
element.change();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
showMode: function(dir) {
|
||||
if (dir) {
|
||||
this.viewMode = Math.max(0, Math.min(2, this.viewMode + dir));
|
||||
}
|
||||
this.picker.find('>div').hide().filter('.datepicker-'+DPGlobal.modes[this.viewMode].clsName).show();
|
||||
this.updateNavArrows();
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.datepicker = function ( option ) {
|
||||
var args = Array.apply(null, arguments);
|
||||
args.shift();
|
||||
return this.each(function () {
|
||||
var $this = $(this),
|
||||
data = $this.data('datepicker'),
|
||||
options = typeof option == 'object' && option;
|
||||
if (!data) {
|
||||
$this.data('datepicker', (data = new Datepicker(this, $.extend({}, $.fn.datepicker.defaults,options))));
|
||||
}
|
||||
if (typeof option == 'string') data[option].apply(data, args);
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.datepicker.defaults = {
|
||||
};
|
||||
$.fn.datepicker.Constructor = Datepicker;
|
||||
var dates = $.fn.datepicker.dates = {
|
||||
en: {
|
||||
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
|
||||
daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
|
||||
daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],
|
||||
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
|
||||
monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
|
||||
}
|
||||
}
|
||||
|
||||
var DPGlobal = {
|
||||
modes: [
|
||||
{
|
||||
clsName: 'days',
|
||||
navFnc: 'Month',
|
||||
navStep: 1
|
||||
},
|
||||
{
|
||||
clsName: 'months',
|
||||
navFnc: 'FullYear',
|
||||
navStep: 1
|
||||
},
|
||||
{
|
||||
clsName: 'years',
|
||||
navFnc: 'FullYear',
|
||||
navStep: 10
|
||||
}],
|
||||
isLeapYear: function (year) {
|
||||
return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0))
|
||||
},
|
||||
getDaysInMonth: function (year, month) {
|
||||
return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]
|
||||
},
|
||||
validParts: /dd?|mm?|MM?|yy(?:yy)?/g,
|
||||
nonpunctuation: /[^ -\/:-@\[-`{-~\t\n\r]+/g,
|
||||
parseFormat: function(format){
|
||||
// IE treats \0 as a string end in inputs (truncating the value),
|
||||
// so it's a bad format delimiter, anyway
|
||||
var separators = format.replace(this.validParts, '\0').split('\0'),
|
||||
parts = format.match(this.validParts);
|
||||
if (!separators || !separators.length || !parts || parts.length == 0){
|
||||
throw new Error("Invalid date format.");
|
||||
}
|
||||
return {separators: separators, parts: parts};
|
||||
},
|
||||
parseDate: function(date, format, language) {
|
||||
if (date instanceof Date) return date;
|
||||
if (/^[-+]\d+[dmwy]([\s,]+[-+]\d+[dmwy])*$/.test(date)) {
|
||||
var part_re = /([-+]\d+)([dmwy])/,
|
||||
parts = date.match(/([-+]\d+)([dmwy])/g),
|
||||
part, dir;
|
||||
date = new Date();
|
||||
for (var i=0; i<parts.length; i++) {
|
||||
part = part_re.exec(parts[i]);
|
||||
dir = parseInt(part[1]);
|
||||
switch(part[2]){
|
||||
case 'd':
|
||||
date.setDate(date.getDate() + dir);
|
||||
break;
|
||||
case 'm':
|
||||
date = Datepicker.prototype.moveMonth.call(Datepicker.prototype, date, dir);
|
||||
break;
|
||||
case 'w':
|
||||
date.setDate(date.getDate() + dir * 7);
|
||||
break;
|
||||
case 'y':
|
||||
date = Datepicker.prototype.moveYear.call(Datepicker.prototype, date, dir);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
|
||||
}
|
||||
var parts = date ? date.match(this.nonpunctuation) : [],
|
||||
date = new Date(),
|
||||
parsed = {},
|
||||
setters_order = ['yyyy', 'yy', 'M', 'MM', 'm', 'mm', 'd', 'dd'],
|
||||
setters_map = {
|
||||
yyyy: function(d,v){ return d.setFullYear(v); },
|
||||
yy: function(d,v){ return d.setFullYear(2000+v); },
|
||||
m: function(d,v){ return d.setMonth(v-1); },
|
||||
d: function(d,v){ return d.setDate(v); },
|
||||
},
|
||||
val, filtered, part;
|
||||
setters_map['M'] = setters_map['MM'] = setters_map['mm'] = setters_map['m'];
|
||||
setters_map['dd'] = setters_map['d'];
|
||||
date = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
|
||||
if (parts.length == format.parts.length) {
|
||||
for (var i=0, cnt = format.parts.length; i < cnt; i++) {
|
||||
val = parseInt(parts[i], 10)||1;
|
||||
part = format.parts[i];
|
||||
switch(part) {
|
||||
case 'MM':
|
||||
filtered = $(dates[language].months).filter(function(){
|
||||
var m = this.slice(0, parts[i].length),
|
||||
p = parts[i].slice(0, m.length);
|
||||
return m == p;
|
||||
});
|
||||
val = $.inArray(filtered[0], dates[language].months) + 1;
|
||||
break;
|
||||
case 'M':
|
||||
filtered = $(dates[language].monthsShort).filter(function(){
|
||||
var m = this.slice(0, parts[i].length),
|
||||
p = parts[i].slice(0, m.length);
|
||||
return m == p;
|
||||
});
|
||||
val = $.inArray(filtered[0], dates[language].monthsShort) + 1;
|
||||
break;
|
||||
}
|
||||
parsed[part] = val;
|
||||
}
|
||||
for (var i=0, s; i<setters_order.length; i++){
|
||||
s = setters_order[i];
|
||||
if (s in parsed)
|
||||
setters_map[s](date, parsed[s])
|
||||
}
|
||||
}
|
||||
return date;
|
||||
},
|
||||
formatDate: function(date, format, language){
|
||||
var val = {
|
||||
d: date.getDate(),
|
||||
m: date.getMonth() + 1,
|
||||
M: dates[language].monthsShort[date.getMonth()],
|
||||
MM: dates[language].months[date.getMonth()],
|
||||
yy: date.getFullYear().toString().substring(2),
|
||||
yyyy: date.getFullYear()
|
||||
};
|
||||
val.dd = (val.d < 10 ? '0' : '') + val.d;
|
||||
val.mm = (val.m < 10 ? '0' : '') + val.m;
|
||||
var date = [],
|
||||
seps = $.extend([], format.separators);
|
||||
for (var i=0, cnt = format.parts.length; i < cnt; i++) {
|
||||
if (seps.length)
|
||||
date.push(seps.shift())
|
||||
date.push(val[format.parts[i]]);
|
||||
}
|
||||
return date.join('');
|
||||
},
|
||||
headTemplate: '<thead>'+
|
||||
'<tr>'+
|
||||
'<th class="prev"><i class="icon-arrow-left"/></th>'+
|
||||
'<th colspan="5" class="switch"></th>'+
|
||||
'<th class="next"><i class="icon-arrow-right"/></th>'+
|
||||
'</tr>'+
|
||||
'</thead>',
|
||||
contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>'
|
||||
};
|
||||
DPGlobal.template = '<div class="datepicker dropdown-menu">'+
|
||||
'<div class="datepicker-days">'+
|
||||
'<table class=" table-condensed">'+
|
||||
DPGlobal.headTemplate+
|
||||
'<tbody></tbody>'+
|
||||
'</table>'+
|
||||
'</div>'+
|
||||
'<div class="datepicker-months">'+
|
||||
'<table class="table-condensed">'+
|
||||
DPGlobal.headTemplate+
|
||||
DPGlobal.contTemplate+
|
||||
'</table>'+
|
||||
'</div>'+
|
||||
'<div class="datepicker-years">'+
|
||||
'<table class="table-condensed">'+
|
||||
DPGlobal.headTemplate+
|
||||
DPGlobal.contTemplate+
|
||||
'</table>'+
|
||||
'</div>'+
|
||||
'</div>';
|
||||
|
||||
}( window.jQuery )
|
||||
21
modules/lib/datepicker/bootstrap-datepicker.min.js
vendored
Normal file
21
modules/lib/datepicker/bootstrap-datepicker.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
394
modules/lib/datepicker/bootstrap-timepicker.js
vendored
Normal file
394
modules/lib/datepicker/bootstrap-timepicker.js
vendored
Normal file
@ -0,0 +1,394 @@
|
||||
/* =========================================================
|
||||
* bootstrap-timepicker.js
|
||||
* http://www.github.com/jdewit/bootstrap-timepicker
|
||||
* =========================================================
|
||||
* Copyright 2012
|
||||
*
|
||||
* Created By:
|
||||
* Joris de Wit @joris_dewit
|
||||
*
|
||||
* Contributions By:
|
||||
* Gilbert @mindeavor
|
||||
* Koen Punt info@koenpunt.nl
|
||||
* Nek
|
||||
* Chris Martin
|
||||
* Dominic Barnes contact@dominicbarnes.us
|
||||
*
|
||||
* 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.
|
||||
* ========================================================= */
|
||||
|
||||
!function($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
/* TIMEPICKER PUBLIC CLASS DEFINITION
|
||||
* ================================== */
|
||||
var Timepicker = function(element, options) {
|
||||
this.$element = $(element);
|
||||
this.options = $.extend({}, $.fn.timepicker.defaults, options, this.$element.data());
|
||||
this.minuteStep = this.options.minuteStep || this.minuteStep;
|
||||
this.showMeridian = this.options.showMeridian || this.showMeridian;
|
||||
this.disableFocus = this.options.disableFocus || this.disableFocus;
|
||||
this.template = this.options.template || this.template;
|
||||
this.defaultTime = this.options.defaultTime || this.defaultTime;
|
||||
this.open = false;
|
||||
this.init();
|
||||
};
|
||||
|
||||
Timepicker.prototype = {
|
||||
|
||||
constructor: Timepicker
|
||||
|
||||
, init: function () {
|
||||
|
||||
this.$element
|
||||
.on('click', $.proxy(this.show, this))
|
||||
.on('keyup', $.proxy(this.updateFromElementVal, this))
|
||||
;
|
||||
|
||||
this.$widget = $(this.getTemplate()).appendTo('body');
|
||||
|
||||
this.$widget.on('click', $.proxy(this.click, this));
|
||||
|
||||
this.setDefaultTime(this.defaultTime);
|
||||
}
|
||||
|
||||
, show: function(e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
this.$element.trigger('show');
|
||||
|
||||
$('html').on('click.timepicker.data-api', $.proxy(this.hide, this));
|
||||
|
||||
if (true === this.disableFocus) {
|
||||
this.$element.blur();
|
||||
}
|
||||
|
||||
var pos = $.extend({}, this.$element.offset(), {
|
||||
height: this.$element[0].offsetHeight
|
||||
});
|
||||
|
||||
if (this.options.template === 'modal') {
|
||||
this.$widget.modal('show');
|
||||
} else {
|
||||
this.$widget.css({
|
||||
top: pos.top + pos.height
|
||||
, left: pos.left
|
||||
})
|
||||
|
||||
if (!this.open) {
|
||||
this.$widget.addClass('open');
|
||||
}
|
||||
}
|
||||
|
||||
this.open = true;
|
||||
this.$element.trigger('shown');
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
, hide: function(){
|
||||
this.$element.trigger('hide');
|
||||
|
||||
$('html').off('click.timepicker.data-api', $.proxy(this.hide, this));
|
||||
|
||||
if (this.options.template === 'modal') {
|
||||
this.$widget.modal('hide');
|
||||
} else {
|
||||
this.$widget.removeClass('open');
|
||||
}
|
||||
this.open = false;
|
||||
this.$element.trigger('hidden');
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
, setValues: function(time) {
|
||||
var meridian, match = time.match(/(AM|PM)/i);
|
||||
if (match) {
|
||||
meridian = match[1];
|
||||
}
|
||||
time = $.trim(time.replace(/(PM|AM)/i, ''));
|
||||
var timeArray = time.split(':');
|
||||
|
||||
this.meridian = meridian;
|
||||
this.hour = parseInt(timeArray[0], 10);
|
||||
if (isNaN(this.hour)) {
|
||||
this.hour = 0;
|
||||
this.updateElement();
|
||||
}
|
||||
this.minute = parseInt(timeArray[1], 10);
|
||||
if (isNaN(this.minute)) {
|
||||
this.minute = 0;
|
||||
this.updateElement();
|
||||
}
|
||||
}
|
||||
|
||||
, setDefaultTime: function(defaultTime){
|
||||
if (defaultTime) {
|
||||
if (defaultTime === 'current') {
|
||||
var dTime = new Date();
|
||||
var hours = dTime.getHours();
|
||||
var minutes = Math.floor(dTime.getMinutes() / this.minuteStep) * this.minuteStep;
|
||||
var meridian = "AM";
|
||||
if ( this.showMeridian ) {
|
||||
if (hours === 0) {
|
||||
hours = 12;
|
||||
} else if (hours >= 12) {
|
||||
if (hours > 12) {
|
||||
hours = hours - 12;
|
||||
}
|
||||
meridian = "PM";
|
||||
} else {
|
||||
meridian = "AM";
|
||||
}
|
||||
}
|
||||
this.hour = hours;
|
||||
this.minute = minutes;
|
||||
this.meridian = meridian;
|
||||
} else if (defaultTime === 'value') {
|
||||
this.setValues( this.$element.val() );
|
||||
} else {
|
||||
this.setValues(defaultTime);
|
||||
}
|
||||
this.update();
|
||||
} else {
|
||||
this.hour = 0;
|
||||
this.minute = 0;
|
||||
}
|
||||
}
|
||||
|
||||
, formatTime: function(hour, minute, meridian) {
|
||||
hour = hour < 10 ? '0' + hour : hour;
|
||||
minute = minute < 10 ? '0' + minute : minute;
|
||||
|
||||
return hour + ':' + minute + ( this.showMeridian ? ' ' + meridian : '' );
|
||||
}
|
||||
|
||||
, getTime: function() {
|
||||
return this.formatTime(this.hour, this.minute, this.meridian);
|
||||
}
|
||||
|
||||
, setTime: function(time) {
|
||||
this.setValues(time);
|
||||
this.update();
|
||||
}
|
||||
|
||||
, updateElement: function() {
|
||||
var time = this.getTime();
|
||||
|
||||
this.$element.val(time).change();
|
||||
}
|
||||
|
||||
, updateWidget: function() {
|
||||
this.$widget
|
||||
.find('td.bootstrap-timepicker-hour').text(this.hour).end()
|
||||
.find('td.bootstrap-timepicker-minute').text(this.minute < 10 ? '0' + this.minute : this.minute).end()
|
||||
.find('td.bootstrap-timepicker-meridian').text(this.meridian);
|
||||
}
|
||||
|
||||
, update: function() {
|
||||
this.updateElement();
|
||||
this.updateWidget();
|
||||
}
|
||||
|
||||
, updateFromElementVal: function () {
|
||||
var time = this.$element.val();
|
||||
if (time) {
|
||||
this.setValues(time);
|
||||
this.updateWidget();
|
||||
}
|
||||
}
|
||||
|
||||
, click: function(e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
if (true !== this.disableFocus) {
|
||||
this.$element.focus();
|
||||
}
|
||||
|
||||
var action = $(e.target).closest('a').data('action');
|
||||
if (action) {
|
||||
this[action]();
|
||||
this.update();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
, incrementHour: function() {
|
||||
if ( this.showMeridian ) {
|
||||
if ( this.hour === 12 ) {
|
||||
this.hour = 1;
|
||||
return this.toggleMeridian();
|
||||
}
|
||||
}
|
||||
if ( this.hour === 23 ) {
|
||||
return this.hour = 0;
|
||||
}
|
||||
this.hour = this.hour + 1;
|
||||
}
|
||||
|
||||
, decrementHour: function() {
|
||||
if ( this.showMeridian ) {
|
||||
if (this.hour === 1) {
|
||||
this.hour = 12;
|
||||
return this.toggleMeridian();
|
||||
}
|
||||
}
|
||||
if (this.hour === 0) {
|
||||
return this.hour = 23;
|
||||
}
|
||||
this.hour = this.hour - 1;
|
||||
}
|
||||
|
||||
, incrementMinute: function() {
|
||||
var newVal = this.minute + this.minuteStep - (this.minute % this.minuteStep);
|
||||
if (newVal > 59) {
|
||||
this.incrementHour();
|
||||
this.minute = newVal - 60;
|
||||
} else {
|
||||
this.minute = newVal;
|
||||
}
|
||||
}
|
||||
|
||||
, decrementMinute: function() {
|
||||
var newVal = this.minute - this.minuteStep;
|
||||
if (newVal < 0) {
|
||||
this.decrementHour();
|
||||
this.minute = newVal + 60;
|
||||
} else {
|
||||
this.minute = newVal;
|
||||
}
|
||||
}
|
||||
|
||||
, toggleMeridian: function() {
|
||||
this.meridian = this.meridian === 'AM' ? 'PM' : 'AM';
|
||||
|
||||
this.update();
|
||||
}
|
||||
|
||||
, getTemplate: function() {
|
||||
if (this.options.templates[this.options.template]) {
|
||||
return this.options.templates[this.options.template];
|
||||
}
|
||||
var template;
|
||||
switch(this.options.template) {
|
||||
case 'modal':
|
||||
template = '<div class="bootstrap-timepicker modal hide fade in" style="top: 30%; margin-top: 0; width: 200px; margin-left: -100px;" data-backdrop="false">'+
|
||||
'<div class="modal-header">'+
|
||||
'<a href="#" class="close" data-action="hide">×</a>'+
|
||||
'<h3>Pick a Time</h3>'+
|
||||
'</div>'+
|
||||
'<div class="modal-content">'+
|
||||
'<table>'+
|
||||
'<tr>'+
|
||||
'<td><a href="#" data-action="incrementHour"><i class="icon-chevron-up"></i></a></td>'+
|
||||
'<td class="separator"></td>'+
|
||||
'<td><a href="#" data-action="incrementMinute"><i class="icon-chevron-up"></i></a></td>'+
|
||||
( this.showMeridian ? '<td><a href="#" data-action="toggleMeridian"><i class="icon-chevron-up"></i></a></td>' : '' ) +
|
||||
'</tr>'+
|
||||
'<tr>'+
|
||||
'<td class="bootstrap-timepicker-hour"></td> '+
|
||||
'<td class="separator">:</td>'+
|
||||
'<td class="bootstrap-timepicker-minute"></td> '+
|
||||
( this.showMeridian ? '<td class="bootstrap-timepicker-meridian"></td>' : '' ) +
|
||||
'</tr>'+
|
||||
'<tr>'+
|
||||
'<td><a href="#" data-action="decrementHour"><i class="icon-chevron-down"></i></a></td>'+
|
||||
'<td class="separator"></td>'+
|
||||
'<td><a href="#" data-action="decrementMinute"><i class="icon-chevron-down"></i></a></td>'+
|
||||
( this.showMeridian ? '<td><a href="#" data-action="toggleMeridian"><i class="icon-chevron-down"></i></a></td>' : '' ) +
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'</div>'+
|
||||
'<div class="modal-footer">'+
|
||||
'<a href="#" class="btn btn-primary" data-action="hide">Ok</a>'+
|
||||
'</div>'+
|
||||
'</div>';
|
||||
|
||||
break;
|
||||
case 'dropdown':
|
||||
template = '<div class="bootstrap-timepicker dropdown-menu">'+
|
||||
'<table>'+
|
||||
'<tr>'+
|
||||
'<td><a href="#" data-action="incrementHour"><i class="icon-chevron-up"></i></a></td>'+
|
||||
'<td class="separator"></td>'+
|
||||
'<td><a href="#" data-action="incrementMinute"><i class="icon-chevron-up"></i></a></td>'+
|
||||
( this.showMeridian ? '<td><a href="#" data-action="toggleMeridian"><i class="icon-chevron-up"></i></a></td>' : '' ) +
|
||||
'</tr>'+
|
||||
'<tr>'+
|
||||
'<td class="bootstrap-timepicker-hour"></td> '+
|
||||
'<td class="separator">:</td>'+
|
||||
'<td class="bootstrap-timepicker-minute"></td> '+
|
||||
( this.showMeridian ? '<td class="bootstrap-timepicker-meridian"></td>' : '' ) +
|
||||
'</tr>'+
|
||||
'<tr>'+
|
||||
'<td><a href="#" data-action="decrementHour"><i class="icon-chevron-down"></i></a></td>'+
|
||||
'<td class="separator"></td>'+
|
||||
'<td><a href="#" data-action="decrementMinute"><i class="icon-chevron-down"></i></a></td>'+
|
||||
( this.showMeridian ? '<td><a href="#" data-action="toggleMeridian"><i class="icon-chevron-down"></i></a></td>' : '' ) +
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'</div>';
|
||||
break;
|
||||
|
||||
}
|
||||
return template;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/* TIMEPICKER PLUGIN DEFINITION
|
||||
* =========================== */
|
||||
|
||||
$.fn.timepicker = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('timepicker')
|
||||
, options = typeof option == 'object' && option;
|
||||
if (!data) {
|
||||
$this.data('timepicker', (data = new Timepicker(this, options)));
|
||||
}
|
||||
if (typeof option == 'string') {
|
||||
data[option]();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.timepicker.defaults = {
|
||||
minuteStep: 15
|
||||
, disableFocus: false
|
||||
, defaultTime: 'current'
|
||||
, showMeridian: true
|
||||
, template: 'dropdown'
|
||||
, templates: {} // set custom templates
|
||||
}
|
||||
|
||||
$.fn.timepicker.Constructor = Timepicker
|
||||
|
||||
/* TIMEPICKER DATA-API
|
||||
* ================== */
|
||||
|
||||
$(function () {
|
||||
$('body').on('focus.timepicker.data-api', '[data-provide="timepicker"]', function (e) {
|
||||
var $this = $(this);
|
||||
if ($this.data('timepicker')) {
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
$this.timepicker($this.data());
|
||||
})
|
||||
})
|
||||
}(window.jQuery);
|
||||
24
modules/lib/datepicker/bootstrap-timepicker.min.js
vendored
Normal file
24
modules/lib/datepicker/bootstrap-timepicker.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
289
modules/lib/datepicker/datepicker.css
Normal file
289
modules/lib/datepicker/datepicker.css
Normal file
@ -0,0 +1,289 @@
|
||||
/*!
|
||||
* Datepicker for Bootstrap
|
||||
*
|
||||
* Copyright 2012 Stefan Petre
|
||||
* Improvements by Andrew Rowls
|
||||
* Licensed under the Apache License v2.0
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*/
|
||||
.datepicker {
|
||||
top: 0;
|
||||
left: 0;
|
||||
padding: 4px;
|
||||
margin-top: 1px;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
/*.dow {
|
||||
border-top: 1px solid #ddd !important;
|
||||
}*/
|
||||
|
||||
}
|
||||
.datepicker:before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
border-left: 7px solid transparent;
|
||||
border-right: 7px solid transparent;
|
||||
border-bottom: 7px solid #ccc;
|
||||
border-bottom-color: rgba(0, 0, 0, 0.2);
|
||||
position: absolute;
|
||||
top: -7px;
|
||||
left: 6px;
|
||||
}
|
||||
.datepicker:after {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
border-left: 6px solid transparent;
|
||||
border-right: 6px solid transparent;
|
||||
border-bottom: 6px solid #ffffff;
|
||||
position: absolute;
|
||||
top: -6px;
|
||||
left: 7px;
|
||||
}
|
||||
.datepicker > div {
|
||||
display: none;
|
||||
}
|
||||
.datepicker.days div.datepicker-days {
|
||||
display: block;
|
||||
}
|
||||
.datepicker.months div.datepicker-months {
|
||||
display: block;
|
||||
}
|
||||
.datepicker.years div.datepicker-years {
|
||||
display: block;
|
||||
}
|
||||
.datepicker table {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
.datepicker td,
|
||||
.datepicker th {
|
||||
text-align: center;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.datepicker td.day:hover {
|
||||
background: #eeeeee;
|
||||
cursor: pointer;
|
||||
}
|
||||
.datepicker td.old,
|
||||
.datepicker td.new {
|
||||
color: #999999;
|
||||
}
|
||||
.datepicker td.disabled,
|
||||
.datepicker td.disabled:hover {
|
||||
background: none;
|
||||
color: #999999;
|
||||
cursor: default;
|
||||
}
|
||||
.datepicker td.active,
|
||||
.datepicker td.active:hover,
|
||||
.datepicker td.active.disabled,
|
||||
.datepicker td.active.disabled:hover {
|
||||
background-color: #006dcc;
|
||||
background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
|
||||
background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
|
||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
|
||||
background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
|
||||
background-image: -o-linear-gradient(top, #0088cc, #0044cc);
|
||||
background-image: linear-gradient(top, #0088cc, #0044cc);
|
||||
background-repeat: repeat-x;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
|
||||
border-color: #0044cc #0044cc #002a80;
|
||||
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
||||
filter: progid:dximagetransform.microsoft.gradient(enabled=false);
|
||||
color: #fff;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
.datepicker td.active:hover,
|
||||
.datepicker td.active:hover:hover,
|
||||
.datepicker td.active.disabled:hover,
|
||||
.datepicker td.active.disabled:hover:hover,
|
||||
.datepicker td.active:active,
|
||||
.datepicker td.active:hover:active,
|
||||
.datepicker td.active.disabled:active,
|
||||
.datepicker td.active.disabled:hover:active,
|
||||
.datepicker td.active.active,
|
||||
.datepicker td.active:hover.active,
|
||||
.datepicker td.active.disabled.active,
|
||||
.datepicker td.active.disabled:hover.active,
|
||||
.datepicker td.active.disabled,
|
||||
.datepicker td.active:hover.disabled,
|
||||
.datepicker td.active.disabled.disabled,
|
||||
.datepicker td.active.disabled:hover.disabled,
|
||||
.datepicker td.active[disabled],
|
||||
.datepicker td.active:hover[disabled],
|
||||
.datepicker td.active.disabled[disabled],
|
||||
.datepicker td.active.disabled:hover[disabled] {
|
||||
background-color: #0044cc;
|
||||
}
|
||||
.datepicker td.active:active,
|
||||
.datepicker td.active:hover:active,
|
||||
.datepicker td.active.disabled:active,
|
||||
.datepicker td.active.disabled:hover:active,
|
||||
.datepicker td.active.active,
|
||||
.datepicker td.active:hover.active,
|
||||
.datepicker td.active.disabled.active,
|
||||
.datepicker td.active.disabled:hover.active {
|
||||
background-color: #003399 \9;
|
||||
}
|
||||
.datepicker td span {
|
||||
display: block;
|
||||
width: 47px;
|
||||
height: 54px;
|
||||
line-height: 54px;
|
||||
float: left;
|
||||
margin: 2px;
|
||||
cursor: pointer;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.datepicker td span:hover {
|
||||
background: #eeeeee;
|
||||
}
|
||||
.datepicker td span.disabled,
|
||||
.datepicker td span.disabled:hover {
|
||||
background: none;
|
||||
color: #999999;
|
||||
cursor: default;
|
||||
}
|
||||
.datepicker td span.active,
|
||||
.datepicker td span.active:hover,
|
||||
.datepicker td span.active.disabled,
|
||||
.datepicker td span.active.disabled:hover {
|
||||
background-color: #006dcc;
|
||||
background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
|
||||
background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
|
||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
|
||||
background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
|
||||
background-image: -o-linear-gradient(top, #0088cc, #0044cc);
|
||||
background-image: linear-gradient(top, #0088cc, #0044cc);
|
||||
background-repeat: repeat-x;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
|
||||
border-color: #0044cc #0044cc #002a80;
|
||||
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
||||
filter: progid:dximagetransform.microsoft.gradient(enabled=false);
|
||||
color: #fff;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
.datepicker td span.active:hover,
|
||||
.datepicker td span.active:hover:hover,
|
||||
.datepicker td span.active.disabled:hover,
|
||||
.datepicker td span.active.disabled:hover:hover,
|
||||
.datepicker td span.active:active,
|
||||
.datepicker td span.active:hover:active,
|
||||
.datepicker td span.active.disabled:active,
|
||||
.datepicker td span.active.disabled:hover:active,
|
||||
.datepicker td span.active.active,
|
||||
.datepicker td span.active:hover.active,
|
||||
.datepicker td span.active.disabled.active,
|
||||
.datepicker td span.active.disabled:hover.active,
|
||||
.datepicker td span.active.disabled,
|
||||
.datepicker td span.active:hover.disabled,
|
||||
.datepicker td span.active.disabled.disabled,
|
||||
.datepicker td span.active.disabled:hover.disabled,
|
||||
.datepicker td span.active[disabled],
|
||||
.datepicker td span.active:hover[disabled],
|
||||
.datepicker td span.active.disabled[disabled],
|
||||
.datepicker td span.active.disabled:hover[disabled] {
|
||||
background-color: #0044cc;
|
||||
}
|
||||
.datepicker td span.active:active,
|
||||
.datepicker td span.active:hover:active,
|
||||
.datepicker td span.active.disabled:active,
|
||||
.datepicker td span.active.disabled:hover:active,
|
||||
.datepicker td span.active.active,
|
||||
.datepicker td span.active:hover.active,
|
||||
.datepicker td span.active.disabled.active,
|
||||
.datepicker td span.active.disabled:hover.active {
|
||||
background-color: #003399 \9;
|
||||
}
|
||||
.datepicker td span.old {
|
||||
color: #999999;
|
||||
}
|
||||
.datepicker th.switch {
|
||||
width: 145px;
|
||||
}
|
||||
.datepicker thead tr:first-child th {
|
||||
cursor: pointer;
|
||||
}
|
||||
.datepicker thead tr:first-child th:hover {
|
||||
background: #eeeeee;
|
||||
}
|
||||
.input-append.date .add-on i,
|
||||
.input-prepend.date .add-on i {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.datepicker.dp_right:before {left:auto;right:6px}
|
||||
.datepicker.dp_right:after {left:auto;right:7px}
|
||||
|
||||
|
||||
|
||||
.bootstrap-timepicker.dropdown-menu {
|
||||
border-radius: 4px 4px 4px 4px;
|
||||
display: none;
|
||||
left: 0;
|
||||
margin-top: 1px;
|
||||
padding: 4px;
|
||||
top: 0;
|
||||
}
|
||||
.bootstrap-timepicker.dropdown-menu.open {
|
||||
display: inline-block;
|
||||
}
|
||||
.bootstrap-timepicker.dropdown-menu:before {
|
||||
border-bottom: 7px solid rgba(0, 0, 0, 0.2);
|
||||
border-left: 7px solid transparent;
|
||||
border-right: 7px solid transparent;
|
||||
content: "";
|
||||
left: 6px;
|
||||
position: absolute;
|
||||
top: -7px;
|
||||
}
|
||||
.bootstrap-timepicker.dropdown-menu:after {
|
||||
border-bottom: 6px solid #FFFFFF;
|
||||
border-left: 6px solid transparent;
|
||||
border-right: 6px solid transparent;
|
||||
content: "";
|
||||
left: 7px;
|
||||
position: absolute;
|
||||
top: -6px;
|
||||
}
|
||||
.bootstrap-timepicker.modal {
|
||||
margin-left: -100px;
|
||||
margin-top: 0;
|
||||
top: 30%;
|
||||
width: 200px;
|
||||
}
|
||||
.bootstrap-timepicker.modal .modal-content {
|
||||
padding: 0;
|
||||
}
|
||||
.bootstrap-timepicker table {
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.bootstrap-timepicker td, .bootstrap-timepicker th {
|
||||
border-radius: 4px 4px 4px 4px;
|
||||
height: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
.bootstrap-timepicker td.separator {
|
||||
width: 1px;
|
||||
}
|
||||
.bootstrap-timepicker td a {
|
||||
border: 1px solid transparent;
|
||||
display: block;
|
||||
margin: 4px;
|
||||
padding: 4px 0;
|
||||
}
|
||||
.bootstrap-timepicker td a:hover {
|
||||
background-color: #EEEEEE;
|
||||
border-color: #DDDDDD;
|
||||
border-radius: 4px 4px 4px 4px;
|
||||
}
|
||||
|
||||
80
modules/lib/dynatree/grunt.js
Normal file
80
modules/lib/dynatree/grunt.js
Normal file
@ -0,0 +1,80 @@
|
||||
/*jslint node:true */
|
||||
|
||||
module.exports = function(grunt) {
|
||||
// Project configuration.
|
||||
grunt.initConfig({
|
||||
pkg: "<json:package.json>",
|
||||
// Project metadata, used by the <banner> directive.
|
||||
meta: {
|
||||
banner: "/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - " +
|
||||
"<%= grunt.template.today('yyyy-mm-dd') %>\n" +
|
||||
"<%= pkg.homepage ? '* ' + pkg.homepage + '\n' : '' %>" +
|
||||
"* Copyright (c) <%= grunt.template.today('yyyy') %> <%= pkg.author.name %>;" +
|
||||
" Licensed <%= _.pluck(pkg.licenses, 'type').join(', ') %> */"
|
||||
},
|
||||
concat: {
|
||||
dist: {
|
||||
src: ["<banner:meta.banner>", "<file_strip_banner:src/<%= pkg.name %>.js>"],
|
||||
// src: ["src/jquery.dynatree.js"],
|
||||
dest: "dist/<%= pkg.name %>-<%= pkg.version %>.js"
|
||||
}
|
||||
},
|
||||
min: {
|
||||
dist: {
|
||||
src: ["<banner:meta.banner>", "<config:concat.dist.dest>"],
|
||||
dest: "dist/<%= pkg.name %>.min.js"
|
||||
}
|
||||
},
|
||||
// qunit: {
|
||||
// files: ["tests/unit/**/*.html"]
|
||||
// },
|
||||
lint: {
|
||||
// beforeconcat: ["grunt.js", "src/**/*.js", "tests/**/*.js"],
|
||||
beforeconcat: ["src/jquery.dynatree.js"],
|
||||
// beforeconcat: ["grunt.js"],
|
||||
// beforeconcat: ["grunt.js", "src/jquery.dynatree.js", "tests/**/*.js"],
|
||||
afterconcat: ["<config:concat.dist.dest>"]
|
||||
},
|
||||
// watch: {
|
||||
// files: "<config:lint.files>",
|
||||
// tasks: "lint qunit"
|
||||
// },
|
||||
|
||||
jshint: {
|
||||
options: {
|
||||
// Enforcing Options:
|
||||
bitwise: true,
|
||||
curly: true,
|
||||
// forin: true,
|
||||
eqeqeq: true,
|
||||
immed: true,
|
||||
latedef: true,
|
||||
newcap: true,
|
||||
noarg: true,
|
||||
// noempty: true,
|
||||
nonew: true,
|
||||
// plusplus: true,
|
||||
regexp: true,
|
||||
// strict: true,
|
||||
sub: true,
|
||||
undef: true,
|
||||
// Relaxing Options:
|
||||
eqnull: false,
|
||||
laxbreak: true,
|
||||
// laxcomma: true,
|
||||
smarttabs: false,
|
||||
// globalstrict: true,
|
||||
// Environments:
|
||||
// node: true, // TODO: only for grunt.js and dynatree-server.json
|
||||
browser: true
|
||||
},
|
||||
globals: {
|
||||
jQuery: true
|
||||
}
|
||||
},
|
||||
uglify: {
|
||||
}
|
||||
});
|
||||
// Default task.
|
||||
grunt.registerTask("default", "lint:beforeconcat concat lint:afterconcat min");
|
||||
};
|
||||
16
modules/lib/dynatree/index.html
Normal file
16
modules/lib/dynatree/index.html
Normal file
@ -0,0 +1,16 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
|
||||
<title>Dynatree</title>
|
||||
</head>
|
||||
|
||||
<body class="example">
|
||||
<h1>dynatree.js</h1>
|
||||
<ul>
|
||||
<li><a href="doc/samples.html">Example Browser</a>
|
||||
<li><a href="doc/dynatree-doc.html">Documentation</a>
|
||||
<li><a href="http://dynatree.googlecode.com">Project home</a>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
32
modules/lib/dynatree/package.json
Normal file
32
modules/lib/dynatree/package.json
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "jquery.dynatree",
|
||||
"title": "jQuery Dynatree Plugin",
|
||||
"description": "Dynatree is a JavaScript dynamic tree view plugin for jQuery with support for persistence, keyboard, checkboxes, drag'n'drop, and lazy loading.",
|
||||
"version": "1.2.4",
|
||||
"homepage": "http://dynatree.googlecode.com/",
|
||||
"author": {
|
||||
"name": "Martin Wendt",
|
||||
"url": "http://wwwendt.de/"
|
||||
},
|
||||
"repository": {
|
||||
"type": "svn",
|
||||
"url": "http://dynatree.googlecode.com/svn/trunk/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://code.google.com/p/dynatree/issues/list"
|
||||
},
|
||||
"licenses": [
|
||||
{
|
||||
"type": "MIT",
|
||||
"url": "https://code.google.com/p/dynatree/wiki/LicenseInfo"
|
||||
},
|
||||
{
|
||||
"type": "GPL",
|
||||
"url": "https://code.google.com/p/dynatree/wiki/LicenseInfo"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"jquery": "~1.4.2"
|
||||
},
|
||||
"keywords": []
|
||||
}
|
||||
20
modules/lib/floating_header/LICENSE.txt
Normal file
20
modules/lib/floating_header/LICENSE.txt
Normal file
@ -0,0 +1,20 @@
|
||||
Copyright (c) 2012 Digital Fusion, http://teamdf.com/
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
430
modules/lib/floating_header/jquery.list.js
Normal file
430
modules/lib/floating_header/jquery.list.js
Normal file
@ -0,0 +1,430 @@
|
||||
/**
|
||||
* jQuery list plug-in 1.2.1
|
||||
* Copyright 2012, Digital Fusion
|
||||
* Licensed under the MIT license.
|
||||
* http://teamdf.com/jquery-plugins/license/
|
||||
*
|
||||
* @author Sam Sehnert, Phil Taylor
|
||||
*/
|
||||
|
||||
(function($){
|
||||
"use strict";
|
||||
|
||||
// The name of your plugin. This is used to namespace your
|
||||
// plugin methods, object data, and registerd events.
|
||||
var plugin_name = 'list';
|
||||
var plugin_version = '1.2.1';
|
||||
var plugin_logging = true;
|
||||
|
||||
// Set up the plugin defaults.
|
||||
// These will be stored in $this.data(plugin_name).settings,
|
||||
// and can be overwritten by having 'options' passed through
|
||||
// as the parameter to the init method.
|
||||
var defaults = {
|
||||
headerSelector : 'dt',
|
||||
zIndex : 1
|
||||
};
|
||||
|
||||
var scrollTimeout = null;
|
||||
|
||||
// Any private methods that the plugin uses, such as event handlers,
|
||||
// or small utility functions for parsing data etc that isn't useful
|
||||
// outside the context of the plugin code itself.
|
||||
var _private = {
|
||||
|
||||
log : function(){
|
||||
// SAFELY call console.log without fear of errors
|
||||
// also provides an override for turning off all plugin console output.
|
||||
if( plugin_logging && window.console && window.console.log ){
|
||||
try {
|
||||
// IE 8 doesn't implement apply on the console methods.
|
||||
window.console.log.apply(console,arguments);
|
||||
} catch (e) {
|
||||
// Because IE8 doesn't implement apply for console methods,
|
||||
// we simply pass the arguments directly to the log.
|
||||
window.console.log( arguments );
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Contains events for this plugin.
|
||||
events : {
|
||||
|
||||
/**
|
||||
* Window resize (should also be called when resizing the target element).
|
||||
*/
|
||||
resize : function(){
|
||||
var $this = $(this),data = $this.data(plugin_name);
|
||||
|
||||
if( data ){
|
||||
data.fakeHeader.width(data.headers.width());
|
||||
data.wrapper.css('maxHeight',$this.css('maxHeight'));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* List element scroll handler event. Called to animate and substitute heading blocks.
|
||||
*/
|
||||
scroll : function(){
|
||||
var $this = $(this),data = $this.data(plugin_name);
|
||||
|
||||
if( data ){
|
||||
|
||||
var newHeader = null,
|
||||
currentHeader = data.headers.eq( data.currentHeader ),
|
||||
nextHeader = data.currentHeader >= data.headers.length-1 ? null : data.headers.eq( data.currentHeader+1 ),
|
||||
prevHeader = data.currentHeader <= 0 ? null : data.headers.eq( data.currentHeader-1 ),
|
||||
trigger = false;
|
||||
|
||||
// Make sure the container top position is fresh.
|
||||
data.containerTop = $this.offset().top + parseInt($this.css('marginTop'),10) + parseInt($this.css('borderTopWidth'),10);
|
||||
data.fakeHeader.css('top',0);
|
||||
|
||||
// Check the position of the current header rather than the previous header.
|
||||
if( prevHeader !== null ){
|
||||
|
||||
var top = currentHeader.offset().top,
|
||||
height = currentHeader.outerHeight();
|
||||
|
||||
if( top > data.containerTop ){
|
||||
|
||||
data.fakeHeader.css('top',(top-height)-data.containerTop);
|
||||
data.fakeHeader.html(prevHeader.html());
|
||||
data.currentHeader = data.currentHeader-1;
|
||||
trigger = true;
|
||||
}
|
||||
|
||||
if( (top-height) > data.containerTop ){
|
||||
|
||||
data.fakeHeader.css('top',0);
|
||||
newHeader = data.currentHeader-1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Check the position of the next header element.
|
||||
if( nextHeader !== null ){
|
||||
|
||||
var top = nextHeader.offset().top,
|
||||
height = nextHeader.outerHeight();
|
||||
|
||||
if( (top-height) < data.containerTop ){
|
||||
|
||||
data.fakeHeader.css('top',(top-height)-data.containerTop);
|
||||
}
|
||||
|
||||
if( top < data.containerTop ){
|
||||
|
||||
data.fakeHeader.css('top',0);
|
||||
newHeader = data.currentHeader+1;
|
||||
}
|
||||
}
|
||||
|
||||
// Now assign the contents of the previous header.
|
||||
if( newHeader !== null ){
|
||||
|
||||
var $header = data.headers.eq(newHeader);
|
||||
|
||||
data.currentHeader = newHeader;
|
||||
data.fakeHeader.html($header.html());
|
||||
trigger = true;
|
||||
}
|
||||
|
||||
var max = ( data.wrapper.scrollTop() >= data.wrapper.prop('scrollHeight') - data.wrapper.height() );
|
||||
|
||||
if( trigger || max || data.max && !max ){
|
||||
// Trigger the headingChange event.
|
||||
$this.trigger('headingChange',[data.currentHeader,data.headers.eq(data.currentHeader),max]);
|
||||
}
|
||||
|
||||
data.max = max;
|
||||
|
||||
// Save the new data.
|
||||
$this.data(plugin_name,data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The methods array will allow you to define public methods that
|
||||
// can be called using the plugin function using the following syntax;
|
||||
//
|
||||
// $('.selector').plugin_name( 'my_method'/*, optional arguments */);
|
||||
//
|
||||
// The 'init' method is special, and will be called when the user calls;
|
||||
//
|
||||
// $('.selector').plugin_name(/*{ options object }*/);
|
||||
var methods = {
|
||||
|
||||
/**
|
||||
* Initialises the plugin.
|
||||
*
|
||||
* @param options object : An object containing any overrides to the default settings.
|
||||
*
|
||||
* @return collection : Returns the jQuery collection
|
||||
*/
|
||||
init : function( options ){
|
||||
|
||||
// Loop through each passed element.
|
||||
return $(this).each(function(){
|
||||
|
||||
// Settings to the defaults.
|
||||
var settings = $.extend({},defaults);
|
||||
|
||||
// If options exist, lets merge them
|
||||
// with our default settings.
|
||||
if( typeof options == 'object' ) $.extend( settings, options );
|
||||
|
||||
// Create shortcuts, and get any existing data.
|
||||
var $this = $(this), data = $this.data(plugin_name);
|
||||
|
||||
// If the plugin hasn't been initialized yet
|
||||
if ( ! data ) {
|
||||
|
||||
// Create the data object.
|
||||
data = {
|
||||
target : $this, // This element.
|
||||
wrapper : $this.wrapInner('<div class="ui-'+plugin_name+'" />').find('.ui-'+plugin_name+''),
|
||||
settings : settings, // The settings for this plugin.
|
||||
headers : [],
|
||||
containerTop : 0,
|
||||
currentHeader : 0,
|
||||
fakeHeader : null,
|
||||
scrolllist : [],
|
||||
original : {
|
||||
position : '',
|
||||
overflowX : '',
|
||||
overflowY : ''
|
||||
},
|
||||
max : false
|
||||
}
|
||||
|
||||
// Add the container class, and the base HTML structure
|
||||
$this.addClass('-'+plugin_name+'-container').css({
|
||||
position : $this.css('position') == 'absolute' ? 'absolute' : 'relative',
|
||||
overflowY : 'hidden'
|
||||
});
|
||||
|
||||
// Grab some variables to set up the list.
|
||||
data.headers = $this.find(data.settings.headerSelector);
|
||||
data.fakeHeader = data.headers.eq(0).clone().removeAttr('id').addClass('-'+plugin_name+'-fakeheader').replaceWith('<div class="-'+plugin_name+'-fakeheader">'+data.headers.eq(0).html()+'</div>');
|
||||
|
||||
// bind a scroll event and change the text of the fake heading
|
||||
data.wrapper.bind('scroll.'+plugin_name,$.proxy(_private.events.scroll,$this)).css({
|
||||
height : '100%',
|
||||
maxHeight : $this.css('maxHeight'),
|
||||
overflowY : 'scroll',
|
||||
position : 'relative'
|
||||
});
|
||||
|
||||
// Set the fake headers
|
||||
data.fakeHeader.css({
|
||||
position : 'absolute',
|
||||
top : 0,
|
||||
width : data.headers.width(),
|
||||
zIndex : data.settings.zIndex
|
||||
});
|
||||
|
||||
// Bind the resize event to the window.
|
||||
$(window).bind('resize.'+plugin_name,$.proxy(_private.events.resize,$this));
|
||||
|
||||
// Add the fake header before all other children, and set the HTML.
|
||||
$this.data(plugin_name,data).prepend( data.fakeHeader );
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Retrieves the current header index that the user is scrolled to.
|
||||
*
|
||||
* @return int : The index position of the header (relative to the headers collection).
|
||||
*/
|
||||
header : function(){
|
||||
|
||||
var $this = $(this),
|
||||
data = $this.data(plugin_name);
|
||||
|
||||
// Only bother if we've set this up before.
|
||||
if( data ){
|
||||
return data.currentHeader;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Used to scroll to a new header element, or to retrieve the currently set header.
|
||||
*
|
||||
* @param int newHeader : The index position of the header (relative to the headers collection).
|
||||
* @param mixed speed : The animation speed of scrolling to the new header.
|
||||
* @param mixed easing : The animation easing to use.
|
||||
* @param function completion : The animation completion function to call.
|
||||
*
|
||||
* @return collection : The collection that this was called with
|
||||
*/
|
||||
scrollTo : function( newHeader, speed, easing, completion ){
|
||||
|
||||
return this.each(function(){
|
||||
|
||||
var $this = $(this),
|
||||
data = $this.data(plugin_name);
|
||||
|
||||
// Only bother if we've set this up before.
|
||||
if( data ){
|
||||
|
||||
// If we've got the header, and its a number
|
||||
if( newHeader !== undefined && !isNaN( newHeader ) && newHeader >= 0 && newHeader < data.headers.length ){
|
||||
|
||||
// Get the new header.
|
||||
var $header = data.headers.eq(newHeader),
|
||||
borderHeight = $header.outerHeight() - $header.height(),
|
||||
scrollTo = $header.position().top + data.wrapper.scrollTop() + borderHeight;
|
||||
|
||||
// If we're not animating, we need to set the element directly.
|
||||
if( !speed ){
|
||||
|
||||
data.wrapper.stop().scrollTop( scrollTo );
|
||||
|
||||
// Set as the current header.
|
||||
data.currentHeader = newHeader;
|
||||
data.fakeHeader.html($header.html());
|
||||
|
||||
// Trigger the headingChange event.
|
||||
$this.trigger('headingChange',[newHeader,$header]);
|
||||
|
||||
// Store the new header data.
|
||||
$this.data(plugin_name,data);
|
||||
|
||||
} else {
|
||||
// If we are animating, the scroll event will fire.
|
||||
data.wrapper.stop().animate({scrollTop:scrollTo},speed,easing,completion);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Used to modify settings after initialisation has taken place.
|
||||
* an example switch construct has been written to show how you
|
||||
* might fire off an update procedure for certain defaults.
|
||||
* Should only be called on one element at a time.
|
||||
*
|
||||
* @param key string : The option name that you want to update.
|
||||
* @param value mixed : (opt) The value that you want to set the option to.
|
||||
*
|
||||
* @return mixed : If no value is passed, will return the value for the passed key, otherwise, returns the jQuery collection.
|
||||
*/
|
||||
option : function( key, value ){
|
||||
|
||||
var $this = $(this),
|
||||
data = $this.data(plugin_name);
|
||||
|
||||
// Only bother if we've set this up before.
|
||||
if( data ){
|
||||
|
||||
// Return settings array if no key is provided.
|
||||
if( typeof key == 'undefined' ) return data.settings;
|
||||
|
||||
// The key has to exist, otherwise its invalid.
|
||||
if( !key in data.settings ) return false;
|
||||
|
||||
// Check if we're adding or updating.
|
||||
if( typeof value == 'undefined' ){
|
||||
return data.settings[key];
|
||||
} else {
|
||||
data.settings[key] = value;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Get the current name and version number of this plugin.
|
||||
*
|
||||
* @param num bool : Whether to return the version number, or string.
|
||||
*
|
||||
* @return string | number : The version string or version number.
|
||||
*/
|
||||
version : function( num ){
|
||||
// Returns the version string for this plugin.
|
||||
if( num ){
|
||||
// Calculate the version number.
|
||||
var v = plugin_version.split('.'),
|
||||
major = ( Number( v[0] ) || 1 )+'',
|
||||
minor = ( Number( v[1] ) || 0 )+'',
|
||||
bugfix = ( Number( v[2] ) || 0 )+'',
|
||||
fill = '000';
|
||||
|
||||
// Return the version as a comparable number.
|
||||
return Number( fill.slice(0,3-major.length)+major+fill.slice(0,3-minor.length)+minor+fill.slice(0,3-bugfix.length)+bugfix );
|
||||
|
||||
} else {
|
||||
// Return the version string for this plugin.
|
||||
return plugin_name+' v'+plugin_version;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Remove all data and events associated with the plugin, and restore
|
||||
* the status of any manipulated elmenets to pre-plugin state.
|
||||
*
|
||||
* @return collection : Returns the jQuery collection.
|
||||
*/
|
||||
destroy: function(){
|
||||
/* Remove the ui plugin from these elements that have it */
|
||||
|
||||
return this.each(function(){
|
||||
|
||||
var $this = $(this),
|
||||
data = $this.data(plugin_name);
|
||||
|
||||
// Only bother if we've set this up before.
|
||||
if( data ){
|
||||
|
||||
// Remove wrapper and fakeheader.
|
||||
data.wrapper.children().unwrap();
|
||||
data.fakeHeader.remove();
|
||||
|
||||
// Now, remove all data, etc, then
|
||||
// reattach this element to its parent, then delete list div.
|
||||
$this.css(data.original)
|
||||
.removeData(plugin_name)
|
||||
.removeClass('-'+plugin_name+'-container')
|
||||
.unbind('.'+plugin_name);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Plugin method calling handler.
|
||||
*
|
||||
* @param method string : (opt) Calls the defined method (or init function if omitted).
|
||||
* @param arguments : Any remaining arguments will be passed as arguments to the recieving method.
|
||||
*
|
||||
* @return mixed : Returns the result of the called method.
|
||||
*/
|
||||
$.fn[plugin_name] = function( method ){
|
||||
// Method calling logic
|
||||
if ( methods[method] ) {
|
||||
return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ));
|
||||
} else if ( typeof method === 'object' || ! method ) {
|
||||
return methods.init.apply( this, arguments );
|
||||
} else {
|
||||
$.error( 'Method ' + method + ' does not exist on jQuery.' + plugin_name );
|
||||
}
|
||||
}
|
||||
|
||||
// Initialise $.plugin_name for methods below.
|
||||
$[plugin_name] = {};
|
||||
|
||||
/**
|
||||
* Allow console logging from this plugin?
|
||||
*
|
||||
* @param l bool : (opt) Turn logging on or off...
|
||||
*
|
||||
* @return bool : Whether this plugin will print to the log or not.
|
||||
*/
|
||||
$[plugin_name].log = function(l){ if(l!==undefined){ plugin_logging=l; } return plugin_logging; };
|
||||
|
||||
})(jQuery);
|
||||
1
modules/lib/floating_header/jquery.list.min.js
vendored
Normal file
1
modules/lib/floating_header/jquery.list.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
;(function(e){var k=!0,l={headerSelector:"dt",zIndex:1},m=function(){var b=e(this),a=b.data("list");a&&(a.fakeHeader.width(a.headers.width()),a.wrapper.css("maxHeight",b.css("maxHeight")))},n=function(){var b=e(this),a=b.data("list");if(a){var d=null,c=a.headers.eq(a.currentHeader),i=a.currentHeader>=a.headers.length-1?null:a.headers.eq(a.currentHeader+1),f=0>=a.currentHeader?null:a.headers.eq(a.currentHeader-1),h=!1;a.containerTop=b.offset().top+parseInt(b.css("marginTop"),10)+parseInt(b.css("borderTopWidth"), 10);a.fakeHeader.css("top",0);if(null!==f){var g=c.offset().top,c=c.outerHeight();g>a.containerTop&&(a.fakeHeader.css("top",g-c-a.containerTop),a.fakeHeader.html(f.html()),a.currentHeader-=1,h=!0);g-c>a.containerTop&&(a.fakeHeader.css("top",0),d=a.currentHeader-1)}null!==i&&(g=i.offset().top,c=i.outerHeight(),g-c<a.containerTop&&a.fakeHeader.css("top",g-c-a.containerTop),g<a.containerTop&&(a.fakeHeader.css("top",0),d=a.currentHeader+1));null!==d&&(h=a.headers.eq(d),a.currentHeader=d,a.fakeHeader.html(h.html()), h=!0);d=a.wrapper.scrollTop()>=a.wrapper.prop("scrollHeight")-a.wrapper.height();(h||d||a.max&&!d)&&b.trigger("headingChange",[a.currentHeader,a.headers.eq(a.currentHeader),d]);a.max=d;b.data("list",a)}},j={init:function(b){return e(this).each(function(){var a=e.extend({},l);"object"==typeof b&&e.extend(a,b);var d=e(this),c=d.data("list");c||(c={target:d,wrapper:d.wrapInner('<div class="ui-list" />').find(".ui-list"),settings:a,headers:[],containerTop:0,currentHeader:0,fakeHeader:null,scrolllist:[], original:{position:"",overflowX:"",overflowY:""},max:!1},d.addClass("-list-container").css({position:"absolute"==d.css("position")?"absolute":"relative",overflowY:"hidden"}),c.headers=d.find(c.settings.headerSelector),c.fakeHeader=c.headers.eq(0).clone().removeAttr("id").addClass("-list-fakeheader").replaceWith('<div class="-list-fakeheader">'+c.headers.eq(0).html()+"</div>"),c.wrapper.bind("scroll.list",e.proxy(n,d)).css({height:"100%",maxHeight:d.css("maxHeight"),overflowY:"scroll",position:"relative"}), c.fakeHeader.css({position:"absolute",top:0,width:c.headers.width(),zIndex:c.settings.zIndex}),e(window).bind("resize.list",e.proxy(m,d)),d.data("list",c).prepend(c.fakeHeader))})},header:function(){var b=e(this).data("list");if(b)return b.currentHeader},scrollTo:function(b,a,d,c){return this.each(function(){var i=e(this),f=i.data("list");if(f&&void 0!==b&&!isNaN(b)&&0<=b&&b<f.headers.length){var h=f.headers.eq(b),g=h.outerHeight()-h.height(),g=h.position().top+f.wrapper.scrollTop()+g;a?f.wrapper.stop().animate({scrollTop:g}, a,d,c):(f.wrapper.stop().scrollTop(g),f.currentHeader=b,f.fakeHeader.html(h.html()),i.trigger("headingChange",[b,h]),i.data("list",f))}})},option:function(b,a){var d=e(this),c=d.data("list");if(c){if("undefined"==typeof b)return c.settings;if(!b in c.settings)return!1;if("undefined"==typeof a)return c.settings[b];c.settings[b]=a;return d}},version:function(b){if(b){var a=["1","2","1"],b=(Number(a[0])||1)+"",d=(Number(a[1])||0)+"",a=(Number(a[2])||0)+"";return Number("000".slice(0,3-b.length)+b+"000".slice(0, 3-d.length)+d+"000".slice(0,3-a.length)+a)}return"list v1.2.1"},destroy:function(){return this.each(function(){var b=e(this),a=b.data("list");a&&(a.wrapper.children().unwrap(),a.fakeHeader.remove(),b.css(a.original).removeData("list").removeClass("-list-container").unbind(".list"))})}};e.fn.list=function(b){if(j[b])return j[b].apply(this,Array.prototype.slice.call(arguments,1));if("object"===typeof b||!b)return j.init.apply(this,arguments);e.error("Method "+b+" does not exist on jQuery.list")};e.list= {};e.list.log=function(b){void 0!==b&&(k=b);return k}})(jQuery);
|
||||
1201
modules/lib/flot/API.txt
Normal file
1201
modules/lib/flot/API.txt
Normal file
File diff suppressed because it is too large
Load Diff
76
modules/lib/flot/FAQ.txt
Normal file
76
modules/lib/flot/FAQ.txt
Normal file
@ -0,0 +1,76 @@
|
||||
Frequently asked questions
|
||||
--------------------------
|
||||
|
||||
Q: How much data can Flot cope with?
|
||||
|
||||
A: Flot will happily draw everything you send to it so the answer
|
||||
depends on the browser. The excanvas emulation used for IE (built with
|
||||
VML) makes IE by far the slowest browser so be sure to test with that
|
||||
if IE users are in your target group.
|
||||
|
||||
1000 points is not a problem, but as soon as you start having more
|
||||
points than the pixel width, you should probably start thinking about
|
||||
downsampling/aggregation as this is near the resolution limit of the
|
||||
chart anyway. If you downsample server-side, you also save bandwidth.
|
||||
|
||||
|
||||
Q: Flot isn't working when I'm using JSON data as source!
|
||||
|
||||
A: Actually, Flot loves JSON data, you just got the format wrong.
|
||||
Double check that you're not inputting strings instead of numbers,
|
||||
like [["0", "-2.13"], ["5", "4.3"]]. This is most common mistake, and
|
||||
the error might not show up immediately because Javascript can do some
|
||||
conversion automatically.
|
||||
|
||||
|
||||
Q: Can I export the graph?
|
||||
|
||||
A: This is a limitation of the canvas technology. There's a hook in
|
||||
the canvas object for getting an image out, but you won't get the tick
|
||||
labels. And it's not likely to be supported by IE. At this point, your
|
||||
best bet is probably taking a screenshot, e.g. with PrtScn.
|
||||
|
||||
|
||||
Q: The bars are all tiny in time mode?
|
||||
|
||||
A: It's not really possible to determine the bar width automatically.
|
||||
So you have to set the width with the barWidth option which is NOT in
|
||||
pixels, but in the units of the x axis (or the y axis for horizontal
|
||||
bars). For time mode that's milliseconds so the default value of 1
|
||||
makes the bars 1 millisecond wide.
|
||||
|
||||
|
||||
Q: Can I use Flot with libraries like Mootools or Prototype?
|
||||
|
||||
A: Yes, Flot supports it out of the box and it's easy! Just use jQuery
|
||||
instead of $, e.g. call jQuery.plot instead of $.plot and use
|
||||
jQuery(something) instead of $(something). As a convenience, you can
|
||||
put in a DOM element for the graph placeholder where the examples and
|
||||
the API documentation are using jQuery objects.
|
||||
|
||||
Depending on how you include jQuery, you may have to add one line of
|
||||
code to prevent jQuery from overwriting functions from the other
|
||||
libraries, see the documentation in jQuery ("Using jQuery with other
|
||||
libraries") for details.
|
||||
|
||||
|
||||
Q: Flot doesn't work with [insert name of Javascript UI framework]!
|
||||
|
||||
A: The only non-standard thing used by Flot is the canvas tag;
|
||||
otherwise it is simply a series of absolute positioned divs within the
|
||||
placeholder tag you put in. If this is not working, it's probably
|
||||
because the framework you're using is doing something weird with the
|
||||
DOM, or you're using it the wrong way.
|
||||
|
||||
A common problem is that there's display:none on a container until the
|
||||
user does something. Many tab widgets work this way, and there's
|
||||
nothing wrong with it - you just can't call Flot inside a display:none
|
||||
container as explained in the README so you need to hold off the Flot
|
||||
call until the container is actually displayed (or use
|
||||
visibility:hidden instead of display:none or move the container
|
||||
off-screen).
|
||||
|
||||
If you find there's a specific thing we can do to Flot to help, feel
|
||||
free to submit a bug report. Otherwise, you're welcome to ask for help
|
||||
on the forum/mailing list, but please don't submit a bug report to
|
||||
Flot.
|
||||
22
modules/lib/flot/LICENSE.txt
Normal file
22
modules/lib/flot/LICENSE.txt
Normal file
@ -0,0 +1,22 @@
|
||||
Copyright (c) 2007-2009 IOLA and Ole Laursen
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
9
modules/lib/flot/Makefile
Normal file
9
modules/lib/flot/Makefile
Normal file
@ -0,0 +1,9 @@
|
||||
# Makefile for generating minified files
|
||||
|
||||
.PHONY: all
|
||||
|
||||
# we cheat and process all .js files instead of an exhaustive list
|
||||
all: $(patsubst %.js,%.min.js,$(filter-out %.min.js,$(wildcard *.js)))
|
||||
|
||||
%.min.js: %.js
|
||||
yui-compressor $< -o $@
|
||||
508
modules/lib/flot/NEWS.txt
Normal file
508
modules/lib/flot/NEWS.txt
Normal file
@ -0,0 +1,508 @@
|
||||
Flot 0.7
|
||||
--------
|
||||
|
||||
API changes:
|
||||
|
||||
Multiple axes support. Code using dual axes should be changed from
|
||||
using x2axis/y2axis in the options to using an array (although
|
||||
backwards-compatibility hooks are in place). For instance,
|
||||
|
||||
{
|
||||
xaxis: { ... }, x2axis: { ... },
|
||||
yaxis: { ... }, y2axis: { ... }
|
||||
}
|
||||
|
||||
becomes
|
||||
|
||||
{
|
||||
xaxes: [ { ... }, { ... } ],
|
||||
yaxes: [ { ... }, { ... } ]
|
||||
}
|
||||
|
||||
Note that if you're just using one axis, continue to use the
|
||||
xaxis/yaxis directly (it now sets the default settings for the
|
||||
arrays). Plugins touching the axes must be ported to take the extra
|
||||
axes into account, check the source to see some examples.
|
||||
|
||||
A related change is that the visibility of axes is now auto-detected.
|
||||
So if you were relying on an axis to show up even without any data in
|
||||
the chart, you now need to set the axis "show" option explicitly.
|
||||
|
||||
"tickColor" on the grid options is now deprecated in favour of a
|
||||
corresponding option on the axes, so { grid: { tickColor: "#000" }}
|
||||
becomes { xaxis: { tickColor: "#000"}, yaxis: { tickColor: "#000"} },
|
||||
but if you just configure a base color Flot will now autogenerate a
|
||||
tick color by adding transparency. Backwards-compatibility hooks are
|
||||
in place.
|
||||
|
||||
Final note: now that IE 9 is coming out with canvas support, you may
|
||||
want to adapt the excanvas include to skip loading it in IE 9 (the
|
||||
examples have been adapted thanks to Ryley Breiddal). An alternative
|
||||
to excanvas using Flash has also surfaced, if your graphs are slow in
|
||||
IE, you may want to give it a spin:
|
||||
|
||||
http://code.google.com/p/flashcanvas/
|
||||
|
||||
|
||||
Changes:
|
||||
|
||||
- Support for specifying a bottom for each point for line charts when
|
||||
filling them, this means that an arbitrary bottom can be used
|
||||
instead of just the x axis (based on patches patiently provided by
|
||||
Roman V. Prikhodchenko).
|
||||
- New fillbetween plugin that can compute a bottom for a series from
|
||||
another series, useful for filling areas between lines (see new
|
||||
example percentiles.html for a use case).
|
||||
- More predictable handling of gaps for the stacking plugin, now all
|
||||
undefined ranges are skipped.
|
||||
- Stacking plugin can stack horizontal bar charts.
|
||||
- Navigate plugin now redraws the plot while panning instead of only
|
||||
after the fact (can be disabled by setting the pan.frameRate option
|
||||
to null), raised by lastthemy (issue 235).
|
||||
- Date formatter now accepts %0m and %0d to get a zero-padded month or
|
||||
day (issue raised by Maximillian Dornseif).
|
||||
- Revamped internals to support an unlimited number of axes, not just
|
||||
dual (sponsored by Flight Data Services,
|
||||
www.flightdataservices.com).
|
||||
- New setting on axes, "tickLength", to control the size of ticks or
|
||||
turn them off without turning off the labels.
|
||||
- Axis labels are now put in container divs with classes, for instance
|
||||
labels in the x axes can be reached via ".xAxis .tickLabel".
|
||||
- Support for setting the color of an axis (sponsored by Flight Data
|
||||
Services, www.flightdataservices.com).
|
||||
- Tick color is now auto-generated as the base color with some
|
||||
transparency (unless you override it).
|
||||
- Support for aligning ticks in the axes with "alignTicksWithAxis" to
|
||||
ensure that they appear next to each other rather than in between,
|
||||
at the expense of possibly awkward tick steps (sponsored by Flight
|
||||
Data Services, www.flightdataservices.com).
|
||||
- Support for customizing the point type through a callback when
|
||||
plotting points and new symbol plugin with some predefined point
|
||||
types (sponsored by Utility Data Corporation).
|
||||
- Resize plugin for automatically redrawing when the placeholder
|
||||
changes size, e.g. on window resizes (sponsored by Novus Partners).
|
||||
A resize() method has been added to plot object facilitate this.
|
||||
- Support Infinity/-Infinity for plotting asymptotes by hacking it
|
||||
into +/-Number.MAX_VALUE (reported by rabaea.mircea).
|
||||
- Support for restricting navigate plugin to not pan/zoom an axis (based
|
||||
on patch by kkaefer).
|
||||
- Support for providing the drag cursor for the navigate plugin as an
|
||||
option (based on patch by Kelly T. Moore).
|
||||
- Options for controlling whether an axis is shown or not (suggestion
|
||||
by Timo Tuominen) and whether to reserve space for it even if it
|
||||
isn't shown.
|
||||
- New attribute $.plot.version with the Flot version as a string.
|
||||
- The version comment is now included in the minified jquery.flot.min.js.
|
||||
- New options.grid.minBorderMargin for adjusting the minimum margin
|
||||
provided around the border (based on patch by corani, issue 188).
|
||||
- Refactor replot behaviour so Flot tries to reuse the existing
|
||||
canvas, adding shutdown() methods to the plot (based on patch by
|
||||
Ryley Breiddal, issue 269). This prevents a memory leak in Chrome
|
||||
and hopefully makes replotting faster for those who are using $.plot
|
||||
instead of .setData()/.draw(). Also update jQuery to 1.5.1 to
|
||||
prevent IE leaks fixed in jQuery.
|
||||
- New real-time line chart example.
|
||||
|
||||
- New hooks: drawSeries, shutdown
|
||||
|
||||
Bug fixes:
|
||||
|
||||
- Fixed problem with findNearbyItem and bars on top of each other
|
||||
(reported by ragingchikn, issue 242).
|
||||
- Fixed problem with ticks and the border (based on patch from
|
||||
ultimatehustler69, issue 236).
|
||||
- Fixed problem with plugins adding options to the series objects.
|
||||
- Fixed a problem introduced in 0.6 with specifying a gradient with {
|
||||
brightness: x, opacity: y }.
|
||||
- Don't use $.browser.msie, check for getContext on the created canvas
|
||||
element instead and try to use excanvas if it's not found (fixes IE
|
||||
9 compatibility).
|
||||
- highlight(s, index) was looking up the point in the original s.data
|
||||
instead of in the computed datapoints array, which breaks with
|
||||
plugins that modify the datapoints (such as the stacking plugin).
|
||||
Issue 316 reported by curlypaul924.
|
||||
- More robust handling of axis from data passed in from getData()
|
||||
(problem reported by Morgan).
|
||||
- Fixed problem with turning off bar outline (issue 253, fix by Jordi
|
||||
Castells).
|
||||
- Check the selection passed into setSelection in the selection
|
||||
plugin, to guard against errors when synchronizing plots (fix by Lau
|
||||
Bech Lauritzen).
|
||||
- Fix bug in crosshair code with mouseout resetting the crosshair even
|
||||
if it is locked (fix by Lau Bech Lauritzen and Banko Adam).
|
||||
- Fix bug with points plotting using line width from lines rather than
|
||||
points.
|
||||
- Fix bug with passing non-array 0 data (for plugins that don't expect
|
||||
arrays, patch by vpapp1).
|
||||
- Fix errors in JSON in examples so they work with jQuery 1.4.2
|
||||
(fix reported by honestbleeps, issue 357).
|
||||
- Fix bug with tooltip in interacting.html, this makes the tooltip
|
||||
much smoother (fix by bdkahn). Fix related bug inside highlighting
|
||||
handler in Flot.
|
||||
- Use closure trick to make inline colorhelpers plugin respect
|
||||
jQuery.noConflict(true), renaming the global jQuery object (reported
|
||||
by Nick Stielau).
|
||||
- Listen for mouseleave events and fire a plothover event with empty
|
||||
item when it occurs to drop highlights when the mouse leaves the
|
||||
plot (reported by by outspirit).
|
||||
- Fix bug with using aboveData with a background (reported by
|
||||
amitayd).
|
||||
- Fix possible excanvas leak (report and suggested fix by tom9729).
|
||||
- Fix bug with backwards compatibility for shadowSize = 0 (report and
|
||||
suggested fix by aspinak).
|
||||
- Adapt examples to skip loading excanvas (fix by Ryley Breiddal).
|
||||
- Fix bug that prevent a simple f(x) = -x transform from working
|
||||
correctly (fix by Mike, issue 263).
|
||||
- Fix bug in restoring cursor in navigate plugin (reported by Matteo
|
||||
Gattanini, issue 395).
|
||||
- Fix bug in picking items when transform/inverseTransform is in use
|
||||
(reported by Ofri Raviv, and patches and analysis by Jan and Tom
|
||||
Paton, issue 334 and 467).
|
||||
- Fix problem with unaligned ticks and hover/click events caused by
|
||||
padding on the placeholder by hardcoding the placeholder padding to
|
||||
0 (reported by adityadineshsaxena, Matt Sommer, Daniel Atos and some
|
||||
other people, issue 301).
|
||||
- Update colorhelpers plugin to avoid dying when trying to parse an
|
||||
invalid string (reported by cadavor, issue 483).
|
||||
|
||||
|
||||
Flot 0.6
|
||||
--------
|
||||
|
||||
API changes:
|
||||
|
||||
1. Selection support has been moved to a plugin. Thus if you're
|
||||
passing selection: { mode: something }, you MUST include the file
|
||||
jquery.flot.selection.js after jquery.flot.js. This reduces the size
|
||||
of base Flot and makes it easier to customize the selection as well as
|
||||
improving code clarity. The change is based on a patch from andershol.
|
||||
|
||||
2. In the global options specified in the $.plot command,
|
||||
"lines", "points", "bars" and "shadowSize" have been moved to a
|
||||
sub-object called "series", i.e.
|
||||
|
||||
$.plot(placeholder, data, { lines: { show: true }})
|
||||
|
||||
should be changed to
|
||||
|
||||
$.plot(placeholder, data, { series: { lines: { show: true }}})
|
||||
|
||||
All future series-specific options will go into this sub-object to
|
||||
simplify plugin writing. Backward-compatibility code is in place, so
|
||||
old code should not break.
|
||||
|
||||
3. "plothover" no longer provides the original data point, but instead
|
||||
a normalized one, since there may be no corresponding original point.
|
||||
|
||||
4. Due to a bug in previous versions of jQuery, you now need at least
|
||||
jQuery 1.2.6. But if you can, try jQuery 1.3.2 as it got some
|
||||
improvements in event handling speed.
|
||||
|
||||
|
||||
Changes:
|
||||
|
||||
- Added support for disabling interactivity for specific data series
|
||||
(request from Ronald Schouten and Steve Upton).
|
||||
|
||||
- Flot now calls $() on the placeholder and optional legend container
|
||||
passed in so you can specify DOM elements or CSS expressions to make
|
||||
it easier to use Flot with libraries like Prototype or Mootools or
|
||||
through raw JSON from Ajax responses.
|
||||
|
||||
- A new "plotselecting" event is now emitted while the user is making
|
||||
a selection.
|
||||
|
||||
- The "plothover" event is now emitted immediately instead of at most
|
||||
10 times per second, you'll have to put in a setTimeout yourself if
|
||||
you're doing something really expensive on this event.
|
||||
|
||||
- The built-in date formatter can now be accessed as
|
||||
$.plot.formatDate(...) (suggestion by Matt Manela) and even
|
||||
replaced.
|
||||
|
||||
- Added "borderColor" option to the grid (patch from Amaury Chamayou
|
||||
and patch from Mike R. Williamson).
|
||||
|
||||
- Added support for gradient backgrounds for the grid, take a look at
|
||||
the "setting options" example (based on patch from Amaury Chamayou,
|
||||
issue 90).
|
||||
|
||||
- Gradient bars (suggestion by stefpet).
|
||||
|
||||
- Added a "plotunselected" event which is triggered when the selection
|
||||
is removed, see "selection" example (suggestion by Meda Ugo);
|
||||
|
||||
- The option legend.margin can now specify horizontal and vertical
|
||||
margins independently (suggestion by someone who's annoyed).
|
||||
|
||||
- Data passed into Flot is now copied to a new canonical format to
|
||||
enable further processing before it hits the drawing routines. As a
|
||||
side-effect, this should make Flot more robust in the face of bad
|
||||
data (and fixes issue 112).
|
||||
|
||||
- Step-wise charting: line charts have a new option "steps" that when
|
||||
set to true connects the points with horizontal/vertical steps
|
||||
instead of diagonal lines.
|
||||
|
||||
- The legend labelFormatter now passes the series in addition to just
|
||||
the label (suggestion by Vincent Lemeltier).
|
||||
|
||||
- Horizontal bars (based on patch by Jason LeBrun).
|
||||
|
||||
- Support for partial bars by specifying a third coordinate, i.e. they
|
||||
don't have to start from the axis. This can be used to make stacked
|
||||
bars.
|
||||
|
||||
- New option to disable the (grid.show).
|
||||
|
||||
- Added pointOffset method for converting a point in data space to an
|
||||
offset within the placeholder.
|
||||
|
||||
- Plugin system: register an init method in the $.flot.plugins array
|
||||
to get started, see PLUGINS.txt for details on how to write plugins
|
||||
(it's easy). There are also some extra methods to enable access to
|
||||
internal state.
|
||||
|
||||
- Hooks: you can register functions that are called while Flot is
|
||||
crunching the data and doing the plot. This can be used to modify
|
||||
Flot without changing the source, useful for writing plugins. Some
|
||||
hooks are defined, more are likely to come.
|
||||
|
||||
- Threshold plugin: you can set a threshold and a color, and the data
|
||||
points below that threshold will then get the color. Useful for
|
||||
marking data below 0, for instance.
|
||||
|
||||
- Stack plugin: you can specify a stack key for each series to have
|
||||
them summed. This is useful for drawing additive/cumulative graphs
|
||||
with bars and (currently unfilled) lines.
|
||||
|
||||
- Crosshairs plugin: trace the mouse position on the axes, enable with
|
||||
crosshair: { mode: "x"} (see the new tracking example for a use).
|
||||
|
||||
- Image plugin: plot prerendered images.
|
||||
|
||||
- Navigation plugin for panning and zooming a plot.
|
||||
|
||||
- More configurable grid.
|
||||
|
||||
- Axis transformation support, useful for non-linear plots, e.g. log
|
||||
axes and compressed time axes (like omitting weekends).
|
||||
|
||||
- Support for twelve-hour date formatting (patch by Forrest Aldridge).
|
||||
|
||||
- The color parsing code in Flot has been cleaned up and split out so
|
||||
it's now available as a separate jQuery plugin. It's included inline
|
||||
in the Flot source to make dependency managing easier. This also
|
||||
makes it really easy to use the color helpers in Flot plugins.
|
||||
|
||||
Bug fixes:
|
||||
|
||||
- Fixed two corner-case bugs when drawing filled curves (report and
|
||||
analysis by Joshua Varner).
|
||||
- Fix auto-adjustment code when setting min to 0 for an axis where the
|
||||
dataset is completely flat on that axis (report by chovy).
|
||||
- Fixed a bug with passing in data from getData to setData when the
|
||||
secondary axes are used (issue 65, reported by nperelman).
|
||||
- Fixed so that it is possible to turn lines off when no other chart
|
||||
type is shown (based on problem reported by Glenn Vanderburg), and
|
||||
fixed so that setting lineWidth to 0 also hides the shadow (based on
|
||||
problem reported by Sergio Nunes).
|
||||
- Updated mousemove position expression to the latest from jQuery (bug
|
||||
reported by meyuchas).
|
||||
- Use CSS borders instead of background in legend (fix printing issue 25
|
||||
and 45).
|
||||
- Explicitly convert axis min/max to numbers.
|
||||
- Fixed a bug with drawing marking lines with different colors
|
||||
(reported by Khurram).
|
||||
- Fixed a bug with returning y2 values in the selection event (fix
|
||||
by exists, issue 75).
|
||||
- Only set position relative on placeholder if it hasn't already a
|
||||
position different from static (reported by kyberneticist, issue 95).
|
||||
- Don't round markings to prevent sub-pixel problems (reported by Dan
|
||||
Lipsitt).
|
||||
- Make the grid border act similarly to a regular CSS border, i.e.
|
||||
prevent it from overlapping the plot itself. This also fixes a
|
||||
problem with anti-aliasing when the width is 1 pixel (reported by
|
||||
Anthony Ettinger).
|
||||
- Imported version 3 of excanvas and fixed two issues with the newer
|
||||
version. Hopefully, this will make Flot work with IE8 (nudge by
|
||||
Fabien Menager, further analysis by Booink, issue 133).
|
||||
- Changed the shadow code for lines to hopefully look a bit better
|
||||
with vertical lines.
|
||||
- Round tick positions to avoid possible problems with fractions
|
||||
(suggestion by Fred, issue 130).
|
||||
- Made the heuristic for determining how many ticks to aim for a bit
|
||||
smarter.
|
||||
- Fix for uneven axis margins (report and patch by Paul Kienzle) and
|
||||
snapping to ticks (concurrent report and patch by lifthrasiir).
|
||||
- Fixed bug with slicing in findNearbyItems (patch by zollman).
|
||||
- Make heuristic for x axis label widths more dynamic (patch by
|
||||
rickinhethuis).
|
||||
- Make sure points on top take precedence when finding nearby points
|
||||
when hovering (reported by didroe, issue 224).
|
||||
|
||||
Flot 0.5
|
||||
--------
|
||||
|
||||
Backwards API change summary: Timestamps are now in UTC. Also
|
||||
"selected" event -> becomes "plotselected" with new data, the
|
||||
parameters for setSelection are now different (but backwards
|
||||
compatibility hooks are in place), coloredAreas becomes markings with
|
||||
a new interface (but backwards compatibility hooks are in place).
|
||||
|
||||
|
||||
Interactivity: added a new "plothover" event and this and the
|
||||
"plotclick" event now returns the closest data item (based on patch by
|
||||
/david, patch by Mark Byers for bar support). See the revamped
|
||||
"interacting with the data" example for some hints on what you can do.
|
||||
|
||||
Highlighting: you can now highlight points and datapoints are
|
||||
autohighlighted when you hover over them (if hovering is turned on).
|
||||
|
||||
Support for dual axis has been added (based on patch by someone who's
|
||||
annoyed and /david). For each data series you can specify which axes
|
||||
it belongs to, and there are two more axes, x2axis and y2axis, to
|
||||
customize. This affects the "selected" event which has been renamed to
|
||||
"plotselected" and spews out { xaxis: { from: -10, to: 20 } ... },
|
||||
setSelection in which the parameters are on a new form (backwards
|
||||
compatible hooks are in place so old code shouldn't break) and
|
||||
markings (formerly coloredAreas).
|
||||
|
||||
Timestamps in time mode are now displayed according to
|
||||
UTC instead of the time zone of the visitor. This affects the way the
|
||||
timestamps should be input; you'll probably have to offset the
|
||||
timestamps according to your local time zone. It also affects any
|
||||
custom date handling code (which basically now should use the
|
||||
equivalent UTC date mehods, e.g. .setUTCMonth() instead of
|
||||
.setMonth().
|
||||
|
||||
Added support for specifying the size of tick labels (axis.labelWidth,
|
||||
axis.labelHeight). Useful for specifying a max label size to keep
|
||||
multiple plots aligned.
|
||||
|
||||
Markings, previously coloredAreas, are now specified as ranges on the
|
||||
axes, like { xaxis: { from: 0, to: 10 }}. Furthermore with markings
|
||||
you can now draw horizontal/vertical lines by setting from and to to
|
||||
the same coordinate (idea from line support patch by by Ryan Funduk).
|
||||
|
||||
The "fill" option can now be a number that specifies the opacity of
|
||||
the fill.
|
||||
|
||||
You can now specify a coordinate as null (like [2, null]) and Flot
|
||||
will take the other coordinate into account when scaling the axes
|
||||
(based on patch by joebno).
|
||||
|
||||
New option for bars "align". Set it to "center" to center the bars on
|
||||
the value they represent.
|
||||
|
||||
setSelection now takes a second parameter which you can use to prevent
|
||||
the method from firing the "plotselected" handler.
|
||||
|
||||
Using the "container" option in legend now overwrites the container
|
||||
element instead of just appending to it (fixes infinite legend bug,
|
||||
reported by several people, fix by Brad Dewey).
|
||||
|
||||
Fixed a bug in calculating spacing around the plot (reported by
|
||||
timothytoe). Fixed a bug in finding max values for all-negative data
|
||||
sets. Prevent the possibility of eternal looping in tick calculations.
|
||||
Fixed a bug when borderWidth is set to 0 (reported by
|
||||
Rob/sanchothefat). Fixed a bug with drawing bars extending below 0
|
||||
(reported by James Hewitt, patch by Ryan Funduk). Fixed a
|
||||
bug with line widths of bars (reported by MikeM). Fixed a bug with
|
||||
'nw' and 'sw' legend positions. Improved the handling of axis
|
||||
auto-scaling with bars. Fixed a bug with multi-line x-axis tick
|
||||
labels (reported by Luca Ciano). IE-fix help by Savage Zhang.
|
||||
|
||||
|
||||
Flot 0.4
|
||||
--------
|
||||
|
||||
API changes: deprecated axis.noTicks in favor of just specifying the
|
||||
number as axis.ticks. So "xaxis: { noTicks: 10 }" becomes
|
||||
"xaxis: { ticks: 10 }"
|
||||
|
||||
Time series support. Specify axis.mode: "time", put in Javascript
|
||||
timestamps as data, and Flot will automatically spit out sensible
|
||||
ticks. Take a look at the two new examples. The format can be
|
||||
customized with axis.timeformat and axis.monthNames, or if that fails
|
||||
with axis.tickFormatter.
|
||||
|
||||
Support for colored background areas via grid.coloredAreas. Specify an
|
||||
array of { x1, y1, x2, y2 } objects or a function that returns these
|
||||
given { xmin, xmax, ymin, ymax }.
|
||||
|
||||
More members on the plot object (report by Chris Davies and others).
|
||||
"getData" for inspecting the assigned settings on data series (e.g.
|
||||
color) and "setData", "setupGrid" and "draw" for updating the contents
|
||||
without a total replot.
|
||||
|
||||
The default number of ticks to aim for is now dependent on the size of
|
||||
the plot in pixels. Support for customizing tick interval sizes
|
||||
directly with axis.minTickSize and axis.tickSize.
|
||||
|
||||
Cleaned up the automatic axis scaling algorithm and fixed how it
|
||||
interacts with ticks. Also fixed a couple of tick-related corner case
|
||||
bugs (one reported by mainstreetmark, another reported by timothytoe).
|
||||
|
||||
The option axis.tickFormatter now takes a function with two
|
||||
parameters, the second parameter is an optional object with
|
||||
information about the axis. It has min, max, tickDecimals, tickSize.
|
||||
|
||||
Added support for segmented lines (based on patch from Michael
|
||||
MacDonald) and for ignoring null and bad values (suggestion from Nick
|
||||
Konidaris and joshwaihi).
|
||||
|
||||
Added support for changing the border width (joebno and safoo).
|
||||
Label colors can be changed via CSS by selecting the tickLabel class.
|
||||
|
||||
Fixed a bug in handling single-item bar series (reported by Emil
|
||||
Filipov). Fixed erratic behaviour when interacting with the plot
|
||||
with IE 7 (reported by Lau Bech Lauritzen). Prevent IE/Safari text
|
||||
selection when selecting stuff on the canvas.
|
||||
|
||||
|
||||
|
||||
Flot 0.3
|
||||
--------
|
||||
|
||||
This is mostly a quick-fix release because jquery.js wasn't included
|
||||
in the previous zip/tarball.
|
||||
|
||||
Support clicking on the plot. Turn it on with grid: { clickable: true },
|
||||
then you get a "plotclick" event on the graph placeholder with the
|
||||
position in units of the plot.
|
||||
|
||||
Fixed a bug in dealing with data where min = max, thanks to Michael
|
||||
Messinides.
|
||||
|
||||
Include jquery.js in the zip/tarball.
|
||||
|
||||
|
||||
Flot 0.2
|
||||
--------
|
||||
|
||||
Added support for putting a background behind the default legend. The
|
||||
default is the partly transparent background color. Added
|
||||
backgroundColor and backgroundOpacity to the legend options to control
|
||||
this.
|
||||
|
||||
The ticks options can now be a callback function that takes one
|
||||
parameter, an object with the attributes min and max. The function
|
||||
should return a ticks array.
|
||||
|
||||
Added labelFormatter option in legend, useful for turning the legend
|
||||
labels into links.
|
||||
|
||||
Fixed a couple of bugs.
|
||||
|
||||
The API should now be fully documented.
|
||||
|
||||
Patch from Guy Fraser to make parts of the code smaller.
|
||||
|
||||
API changes: Moved labelMargin option to grid from x/yaxis.
|
||||
|
||||
|
||||
Flot 0.1
|
||||
--------
|
||||
|
||||
First public release.
|
||||
137
modules/lib/flot/PLUGINS.txt
Normal file
137
modules/lib/flot/PLUGINS.txt
Normal file
@ -0,0 +1,137 @@
|
||||
Writing plugins
|
||||
---------------
|
||||
|
||||
All you need to do to make a new plugin is creating an init function
|
||||
and a set of options (if needed), stuffing it into an object and
|
||||
putting it in the $.plot.plugins array. For example:
|
||||
|
||||
function myCoolPluginInit(plot) {
|
||||
plot.coolstring = "Hello!";
|
||||
};
|
||||
|
||||
$.plot.plugins.push({ init: myCoolPluginInit, options: { ... } });
|
||||
|
||||
// if $.plot is called, it will return a plot object with the
|
||||
// attribute "coolstring"
|
||||
|
||||
Now, given that the plugin might run in many different places, it's
|
||||
a good idea to avoid leaking names. The usual trick here is wrap the
|
||||
above lines in an anonymous function which is called immediately, like
|
||||
this: (function () { inner code ... })(). To make it even more robust
|
||||
in case $ is not bound to jQuery but some other Javascript library, we
|
||||
can write it as
|
||||
|
||||
(function ($) {
|
||||
// plugin definition
|
||||
// ...
|
||||
})(jQuery);
|
||||
|
||||
There's a complete example below, but you should also check out the
|
||||
plugins bundled with Flot.
|
||||
|
||||
|
||||
Complete example
|
||||
----------------
|
||||
|
||||
Here is a simple debug plugin which alerts each of the series in the
|
||||
plot. It has a single option that control whether it is enabled and
|
||||
how much info to output:
|
||||
|
||||
(function ($) {
|
||||
function init(plot) {
|
||||
var debugLevel = 1;
|
||||
|
||||
function checkDebugEnabled(plot, options) {
|
||||
if (options.debug) {
|
||||
debugLevel = options.debug;
|
||||
|
||||
plot.hooks.processDatapoints.push(alertSeries);
|
||||
}
|
||||
}
|
||||
|
||||
function alertSeries(plot, series, datapoints) {
|
||||
var msg = "series " + series.label;
|
||||
if (debugLevel > 1)
|
||||
msg += " with " + series.data.length + " points";
|
||||
alert(msg);
|
||||
}
|
||||
|
||||
plot.hooks.processOptions.push(checkDebugEnabled);
|
||||
}
|
||||
|
||||
var options = { debug: 0 };
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: "simpledebug",
|
||||
version: "0.1"
|
||||
});
|
||||
})(jQuery);
|
||||
|
||||
We also define "name" and "version". It's not used by Flot, but might
|
||||
be helpful for other plugins in resolving dependencies.
|
||||
|
||||
Put the above in a file named "jquery.flot.debug.js", include it in an
|
||||
HTML page and then it can be used with:
|
||||
|
||||
$.plot($("#placeholder"), [...], { debug: 2 });
|
||||
|
||||
This simple plugin illustrates a couple of points:
|
||||
|
||||
- It uses the anonymous function trick to avoid name pollution.
|
||||
- It can be enabled/disabled through an option.
|
||||
- Variables in the init function can be used to store plot-specific
|
||||
state between the hooks.
|
||||
|
||||
The two last points are important because there may be multiple plots
|
||||
on the same page, and you'd want to make sure they are not mixed up.
|
||||
|
||||
|
||||
Shutting down a plugin
|
||||
----------------------
|
||||
|
||||
Each plot object has a shutdown hook which is run when plot.shutdown()
|
||||
is called. This usually mostly happens in case another plot is made on
|
||||
top of an existing one.
|
||||
|
||||
The purpose of the hook is to give you a chance to unbind any event
|
||||
handlers you've registered and remove any extra DOM things you've
|
||||
inserted.
|
||||
|
||||
The problem with event handlers is that you can have registered a
|
||||
handler which is run in some point in the future, e.g. with
|
||||
setTimeout(). Meanwhile, the plot may have been shutdown and removed,
|
||||
but because your event handler is still referencing it, it can't be
|
||||
garbage collected yet, and worse, if your handler eventually runs, it
|
||||
may overwrite stuff on a completely different plot.
|
||||
|
||||
|
||||
Some hints on the options
|
||||
-------------------------
|
||||
|
||||
Plugins should always support appropriate options to enable/disable
|
||||
them because the plugin user may have several plots on the same page
|
||||
where only one should use the plugin. In most cases it's probably a
|
||||
good idea if the plugin is turned off rather than on per default, just
|
||||
like most of the powerful features in Flot.
|
||||
|
||||
If the plugin needs options that are specific to each series, like the
|
||||
points or lines options in core Flot, you can put them in "series" in
|
||||
the options object, e.g.
|
||||
|
||||
var options = {
|
||||
series: {
|
||||
downsample: {
|
||||
algorithm: null,
|
||||
maxpoints: 1000
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Then they will be copied by Flot into each series, providing default
|
||||
values in case none are specified.
|
||||
|
||||
Think hard and long about naming the options. These names are going to
|
||||
be public API, and code is going to depend on them if the plugin is
|
||||
successful.
|
||||
90
modules/lib/flot/README.txt
Normal file
90
modules/lib/flot/README.txt
Normal file
@ -0,0 +1,90 @@
|
||||
About
|
||||
-----
|
||||
|
||||
Flot is a Javascript plotting library for jQuery. Read more at the
|
||||
website:
|
||||
|
||||
http://code.google.com/p/flot/
|
||||
|
||||
Take a look at the examples linked from above, they should give a good
|
||||
impression of what Flot can do and the source code of the examples is
|
||||
probably the fastest way to learn how to use Flot.
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
Just include the Javascript file after you've included jQuery.
|
||||
|
||||
Generally, all browsers that support the HTML5 canvas tag are
|
||||
supported.
|
||||
|
||||
For support for Internet Explorer < 9, you can use Excanvas, a canvas
|
||||
emulator; this is used in the examples bundled with Flot. You just
|
||||
include the excanvas script like this:
|
||||
|
||||
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="excanvas.min.js"></script><![endif]-->
|
||||
|
||||
If it's not working on your development IE 6.0, check that it has
|
||||
support for VML which Excanvas is relying on. It appears that some
|
||||
stripped down versions used for test environments on virtual machines
|
||||
lack the VML support.
|
||||
|
||||
You can also try using Flashcanvas (see
|
||||
http://code.google.com/p/flashcanvas/), which uses Flash to do the
|
||||
emulation. Although Flash can be a bit slower to load than VML, if
|
||||
you've got a lot of points, the Flash version can be much faster
|
||||
overall. Flot contains some wrapper code for activating Excanvas which
|
||||
Flashcanvas is compatible with.
|
||||
|
||||
You need at least jQuery 1.2.6, but try at least 1.3.2 for interactive
|
||||
charts because of performance improvements in event handling.
|
||||
|
||||
|
||||
Basic usage
|
||||
-----------
|
||||
|
||||
Create a placeholder div to put the graph in:
|
||||
|
||||
<div id="placeholder"></div>
|
||||
|
||||
You need to set the width and height of this div, otherwise the plot
|
||||
library doesn't know how to scale the graph. You can do it inline like
|
||||
this:
|
||||
|
||||
<div id="placeholder" style="width:600px;height:300px"></div>
|
||||
|
||||
You can also do it with an external stylesheet. Make sure that the
|
||||
placeholder isn't within something with a display:none CSS property -
|
||||
in that case, Flot has trouble measuring label dimensions which
|
||||
results in garbled looks and might have trouble measuring the
|
||||
placeholder dimensions which is fatal (it'll throw an exception).
|
||||
|
||||
Then when the div is ready in the DOM, which is usually on document
|
||||
ready, run the plot function:
|
||||
|
||||
$.plot($("#placeholder"), data, options);
|
||||
|
||||
Here, data is an array of data series and options is an object with
|
||||
settings if you want to customize the plot. Take a look at the
|
||||
examples for some ideas of what to put in or look at the reference
|
||||
in the file "API.txt". Here's a quick example that'll draw a line from
|
||||
(0, 0) to (1, 1):
|
||||
|
||||
$.plot($("#placeholder"), [ [[0, 0], [1, 1]] ], { yaxis: { max: 1 } });
|
||||
|
||||
The plot function immediately draws the chart and then returns a plot
|
||||
object with a couple of methods.
|
||||
|
||||
|
||||
What's with the name?
|
||||
---------------------
|
||||
|
||||
First: it's pronounced with a short o, like "plot". Not like "flawed".
|
||||
|
||||
So "Flot" rhymes with "plot".
|
||||
|
||||
And if you look up "flot" in a Danish-to-English dictionary, some up
|
||||
the words that come up are "good-looking", "attractive", "stylish",
|
||||
"smart", "impressive", "extravagant". One of the main goals with Flot
|
||||
is pretty looks.
|
||||
1427
modules/lib/flot/excanvas.js
Normal file
1427
modules/lib/flot/excanvas.js
Normal file
File diff suppressed because it is too large
Load Diff
1
modules/lib/flot/excanvas.min.js
vendored
Normal file
1
modules/lib/flot/excanvas.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
179
modules/lib/flot/jquery.colorhelpers.js
Normal file
179
modules/lib/flot/jquery.colorhelpers.js
Normal file
@ -0,0 +1,179 @@
|
||||
/* Plugin for jQuery for working with colors.
|
||||
*
|
||||
* Version 1.1.
|
||||
*
|
||||
* Inspiration from jQuery color animation plugin by John Resig.
|
||||
*
|
||||
* Released under the MIT license by Ole Laursen, October 2009.
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* $.color.parse("#fff").scale('rgb', 0.25).add('a', -0.5).toString()
|
||||
* var c = $.color.extract($("#mydiv"), 'background-color');
|
||||
* console.log(c.r, c.g, c.b, c.a);
|
||||
* $.color.make(100, 50, 25, 0.4).toString() // returns "rgba(100,50,25,0.4)"
|
||||
*
|
||||
* Note that .scale() and .add() return the same modified object
|
||||
* instead of making a new one.
|
||||
*
|
||||
* V. 1.1: Fix error handling so e.g. parsing an empty string does
|
||||
* produce a color rather than just crashing.
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
$.color = {};
|
||||
|
||||
// construct color object with some convenient chainable helpers
|
||||
$.color.make = function (r, g, b, a) {
|
||||
var o = {};
|
||||
o.r = r || 0;
|
||||
o.g = g || 0;
|
||||
o.b = b || 0;
|
||||
o.a = a != null ? a : 1;
|
||||
|
||||
o.add = function (c, d) {
|
||||
for (var i = 0; i < c.length; ++i)
|
||||
o[c.charAt(i)] += d;
|
||||
return o.normalize();
|
||||
};
|
||||
|
||||
o.scale = function (c, f) {
|
||||
for (var i = 0; i < c.length; ++i)
|
||||
o[c.charAt(i)] *= f;
|
||||
return o.normalize();
|
||||
};
|
||||
|
||||
o.toString = function () {
|
||||
if (o.a >= 1.0) {
|
||||
return "rgb("+[o.r, o.g, o.b].join(",")+")";
|
||||
} else {
|
||||
return "rgba("+[o.r, o.g, o.b, o.a].join(",")+")";
|
||||
}
|
||||
};
|
||||
|
||||
o.normalize = function () {
|
||||
function clamp(min, value, max) {
|
||||
return value < min ? min: (value > max ? max: value);
|
||||
}
|
||||
|
||||
o.r = clamp(0, parseInt(o.r), 255);
|
||||
o.g = clamp(0, parseInt(o.g), 255);
|
||||
o.b = clamp(0, parseInt(o.b), 255);
|
||||
o.a = clamp(0, o.a, 1);
|
||||
return o;
|
||||
};
|
||||
|
||||
o.clone = function () {
|
||||
return $.color.make(o.r, o.b, o.g, o.a);
|
||||
};
|
||||
|
||||
return o.normalize();
|
||||
}
|
||||
|
||||
// extract CSS color property from element, going up in the DOM
|
||||
// if it's "transparent"
|
||||
$.color.extract = function (elem, css) {
|
||||
var c;
|
||||
do {
|
||||
c = elem.css(css).toLowerCase();
|
||||
// keep going until we find an element that has color, or
|
||||
// we hit the body
|
||||
if (c != '' && c != 'transparent')
|
||||
break;
|
||||
elem = elem.parent();
|
||||
} while (!$.nodeName(elem.get(0), "body"));
|
||||
|
||||
// catch Safari's way of signalling transparent
|
||||
if (c == "rgba(0, 0, 0, 0)")
|
||||
c = "transparent";
|
||||
|
||||
return $.color.parse(c);
|
||||
}
|
||||
|
||||
// parse CSS color string (like "rgb(10, 32, 43)" or "#fff"),
|
||||
// returns color object, if parsing failed, you get black (0, 0,
|
||||
// 0) out
|
||||
$.color.parse = function (str) {
|
||||
var res, m = $.color.make;
|
||||
|
||||
// Look for rgb(num,num,num)
|
||||
if (res = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(str))
|
||||
return m(parseInt(res[1], 10), parseInt(res[2], 10), parseInt(res[3], 10));
|
||||
|
||||
// Look for rgba(num,num,num,num)
|
||||
if (res = /rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str))
|
||||
return m(parseInt(res[1], 10), parseInt(res[2], 10), parseInt(res[3], 10), parseFloat(res[4]));
|
||||
|
||||
// Look for rgb(num%,num%,num%)
|
||||
if (res = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(str))
|
||||
return m(parseFloat(res[1])*2.55, parseFloat(res[2])*2.55, parseFloat(res[3])*2.55);
|
||||
|
||||
// Look for rgba(num%,num%,num%,num)
|
||||
if (res = /rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str))
|
||||
return m(parseFloat(res[1])*2.55, parseFloat(res[2])*2.55, parseFloat(res[3])*2.55, parseFloat(res[4]));
|
||||
|
||||
// Look for #a0b1c2
|
||||
if (res = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(str))
|
||||
return m(parseInt(res[1], 16), parseInt(res[2], 16), parseInt(res[3], 16));
|
||||
|
||||
// Look for #fff
|
||||
if (res = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(str))
|
||||
return m(parseInt(res[1]+res[1], 16), parseInt(res[2]+res[2], 16), parseInt(res[3]+res[3], 16));
|
||||
|
||||
// Otherwise, we're most likely dealing with a named color
|
||||
var name = $.trim(str).toLowerCase();
|
||||
if (name == "transparent")
|
||||
return m(255, 255, 255, 0);
|
||||
else {
|
||||
// default to black
|
||||
res = lookupColors[name] || [0, 0, 0];
|
||||
return m(res[0], res[1], res[2]);
|
||||
}
|
||||
}
|
||||
|
||||
var lookupColors = {
|
||||
aqua:[0,255,255],
|
||||
azure:[240,255,255],
|
||||
beige:[245,245,220],
|
||||
black:[0,0,0],
|
||||
blue:[0,0,255],
|
||||
brown:[165,42,42],
|
||||
cyan:[0,255,255],
|
||||
darkblue:[0,0,139],
|
||||
darkcyan:[0,139,139],
|
||||
darkgrey:[169,169,169],
|
||||
darkgreen:[0,100,0],
|
||||
darkkhaki:[189,183,107],
|
||||
darkmagenta:[139,0,139],
|
||||
darkolivegreen:[85,107,47],
|
||||
darkorange:[255,140,0],
|
||||
darkorchid:[153,50,204],
|
||||
darkred:[139,0,0],
|
||||
darksalmon:[233,150,122],
|
||||
darkviolet:[148,0,211],
|
||||
fuchsia:[255,0,255],
|
||||
gold:[255,215,0],
|
||||
green:[0,128,0],
|
||||
indigo:[75,0,130],
|
||||
khaki:[240,230,140],
|
||||
lightblue:[173,216,230],
|
||||
lightcyan:[224,255,255],
|
||||
lightgreen:[144,238,144],
|
||||
lightgrey:[211,211,211],
|
||||
lightpink:[255,182,193],
|
||||
lightyellow:[255,255,224],
|
||||
lime:[0,255,0],
|
||||
magenta:[255,0,255],
|
||||
maroon:[128,0,0],
|
||||
navy:[0,0,128],
|
||||
olive:[128,128,0],
|
||||
orange:[255,165,0],
|
||||
pink:[255,192,203],
|
||||
purple:[128,0,128],
|
||||
violet:[128,0,128],
|
||||
red:[255,0,0],
|
||||
silver:[192,192,192],
|
||||
white:[255,255,255],
|
||||
yellow:[255,255,0]
|
||||
};
|
||||
})(jQuery);
|
||||
1
modules/lib/flot/jquery.colorhelpers.min.js
vendored
Normal file
1
modules/lib/flot/jquery.colorhelpers.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
(function(b){b.color={};b.color.make=function(f,e,c,d){var h={};h.r=f||0;h.g=e||0;h.b=c||0;h.a=d!=null?d:1;h.add=function(k,j){for(var g=0;g<k.length;++g){h[k.charAt(g)]+=j}return h.normalize()};h.scale=function(k,j){for(var g=0;g<k.length;++g){h[k.charAt(g)]*=j}return h.normalize()};h.toString=function(){if(h.a>=1){return"rgb("+[h.r,h.g,h.b].join(",")+")"}else{return"rgba("+[h.r,h.g,h.b,h.a].join(",")+")"}};h.normalize=function(){function g(j,k,i){return k<j?j:(k>i?i:k)}h.r=g(0,parseInt(h.r),255);h.g=g(0,parseInt(h.g),255);h.b=g(0,parseInt(h.b),255);h.a=g(0,h.a,1);return h};h.clone=function(){return b.color.make(h.r,h.b,h.g,h.a)};return h.normalize()};b.color.extract=function(e,d){var f;do{f=e.css(d).toLowerCase();if(f!=""&&f!="transparent"){break}e=e.parent()}while(!b.nodeName(e.get(0),"body"));if(f=="rgba(0, 0, 0, 0)"){f="transparent"}return b.color.parse(f)};b.color.parse=function(f){var e,c=b.color.make;if(e=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(f)){return c(parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10))}if(e=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(f)){return c(parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10),parseFloat(e[4]))}if(e=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(f)){return c(parseFloat(e[1])*2.55,parseFloat(e[2])*2.55,parseFloat(e[3])*2.55)}if(e=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(f)){return c(parseFloat(e[1])*2.55,parseFloat(e[2])*2.55,parseFloat(e[3])*2.55,parseFloat(e[4]))}if(e=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(f)){return c(parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16))}if(e=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(f)){return c(parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16))}var d=b.trim(f).toLowerCase();if(d=="transparent"){return c(255,255,255,0)}else{e=a[d]||[0,0,0];return c(e[0],e[1],e[2])}};var a={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);
|
||||
167
modules/lib/flot/jquery.flot.crosshair.js
Normal file
167
modules/lib/flot/jquery.flot.crosshair.js
Normal file
@ -0,0 +1,167 @@
|
||||
/*
|
||||
Flot plugin for showing crosshairs, thin lines, when the mouse hovers
|
||||
over the plot.
|
||||
|
||||
crosshair: {
|
||||
mode: null or "x" or "y" or "xy"
|
||||
color: color
|
||||
lineWidth: number
|
||||
}
|
||||
|
||||
Set the mode to one of "x", "y" or "xy". The "x" mode enables a
|
||||
vertical crosshair that lets you trace the values on the x axis, "y"
|
||||
enables a horizontal crosshair and "xy" enables them both. "color" is
|
||||
the color of the crosshair (default is "rgba(170, 0, 0, 0.80)"),
|
||||
"lineWidth" is the width of the drawn lines (default is 1).
|
||||
|
||||
The plugin also adds four public methods:
|
||||
|
||||
- setCrosshair(pos)
|
||||
|
||||
Set the position of the crosshair. Note that this is cleared if
|
||||
the user moves the mouse. "pos" is in coordinates of the plot and
|
||||
should be on the form { x: xpos, y: ypos } (you can use x2/x3/...
|
||||
if you're using multiple axes), which is coincidentally the same
|
||||
format as what you get from a "plothover" event. If "pos" is null,
|
||||
the crosshair is cleared.
|
||||
|
||||
- clearCrosshair()
|
||||
|
||||
Clear the crosshair.
|
||||
|
||||
- lockCrosshair(pos)
|
||||
|
||||
Cause the crosshair to lock to the current location, no longer
|
||||
updating if the user moves the mouse. Optionally supply a position
|
||||
(passed on to setCrosshair()) to move it to.
|
||||
|
||||
Example usage:
|
||||
var myFlot = $.plot( $("#graph"), ..., { crosshair: { mode: "x" } } };
|
||||
$("#graph").bind("plothover", function (evt, position, item) {
|
||||
if (item) {
|
||||
// Lock the crosshair to the data point being hovered
|
||||
myFlot.lockCrosshair({ x: item.datapoint[0], y: item.datapoint[1] });
|
||||
}
|
||||
else {
|
||||
// Return normal crosshair operation
|
||||
myFlot.unlockCrosshair();
|
||||
}
|
||||
});
|
||||
|
||||
- unlockCrosshair()
|
||||
|
||||
Free the crosshair to move again after locking it.
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
var options = {
|
||||
crosshair: {
|
||||
mode: null, // one of null, "x", "y" or "xy",
|
||||
color: "rgba(170, 0, 0, 0.80)",
|
||||
lineWidth: 1
|
||||
}
|
||||
};
|
||||
|
||||
function init(plot) {
|
||||
// position of crosshair in pixels
|
||||
var crosshair = { x: -1, y: -1, locked: false };
|
||||
|
||||
plot.setCrosshair = function setCrosshair(pos) {
|
||||
if (!pos)
|
||||
crosshair.x = -1;
|
||||
else {
|
||||
var o = plot.p2c(pos);
|
||||
crosshair.x = Math.max(0, Math.min(o.left, plot.width()));
|
||||
crosshair.y = Math.max(0, Math.min(o.top, plot.height()));
|
||||
}
|
||||
|
||||
plot.triggerRedrawOverlay();
|
||||
};
|
||||
|
||||
plot.clearCrosshair = plot.setCrosshair; // passes null for pos
|
||||
|
||||
plot.lockCrosshair = function lockCrosshair(pos) {
|
||||
if (pos)
|
||||
plot.setCrosshair(pos);
|
||||
crosshair.locked = true;
|
||||
}
|
||||
|
||||
plot.unlockCrosshair = function unlockCrosshair() {
|
||||
crosshair.locked = false;
|
||||
}
|
||||
|
||||
function onMouseOut(e) {
|
||||
if (crosshair.locked)
|
||||
return;
|
||||
|
||||
if (crosshair.x != -1) {
|
||||
crosshair.x = -1;
|
||||
plot.triggerRedrawOverlay();
|
||||
}
|
||||
}
|
||||
|
||||
function onMouseMove(e) {
|
||||
if (crosshair.locked)
|
||||
return;
|
||||
|
||||
if (plot.getSelection && plot.getSelection()) {
|
||||
crosshair.x = -1; // hide the crosshair while selecting
|
||||
return;
|
||||
}
|
||||
|
||||
var offset = plot.offset();
|
||||
crosshair.x = Math.max(0, Math.min(e.pageX - offset.left, plot.width()));
|
||||
crosshair.y = Math.max(0, Math.min(e.pageY - offset.top, plot.height()));
|
||||
plot.triggerRedrawOverlay();
|
||||
}
|
||||
|
||||
plot.hooks.bindEvents.push(function (plot, eventHolder) {
|
||||
if (!plot.getOptions().crosshair.mode)
|
||||
return;
|
||||
|
||||
eventHolder.mouseout(onMouseOut);
|
||||
eventHolder.mousemove(onMouseMove);
|
||||
});
|
||||
|
||||
plot.hooks.drawOverlay.push(function (plot, ctx) {
|
||||
var c = plot.getOptions().crosshair;
|
||||
if (!c.mode)
|
||||
return;
|
||||
|
||||
var plotOffset = plot.getPlotOffset();
|
||||
|
||||
ctx.save();
|
||||
ctx.translate(plotOffset.left, plotOffset.top);
|
||||
|
||||
if (crosshair.x != -1) {
|
||||
ctx.strokeStyle = c.color;
|
||||
ctx.lineWidth = c.lineWidth;
|
||||
ctx.lineJoin = "round";
|
||||
|
||||
ctx.beginPath();
|
||||
if (c.mode.indexOf("x") != -1) {
|
||||
ctx.moveTo(crosshair.x, 0);
|
||||
ctx.lineTo(crosshair.x, plot.height());
|
||||
}
|
||||
if (c.mode.indexOf("y") != -1) {
|
||||
ctx.moveTo(0, crosshair.y);
|
||||
ctx.lineTo(plot.width(), crosshair.y);
|
||||
}
|
||||
ctx.stroke();
|
||||
}
|
||||
ctx.restore();
|
||||
});
|
||||
|
||||
plot.hooks.shutdown.push(function (plot, eventHolder) {
|
||||
eventHolder.unbind("mouseout", onMouseOut);
|
||||
eventHolder.unbind("mousemove", onMouseMove);
|
||||
});
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'crosshair',
|
||||
version: '1.0'
|
||||
});
|
||||
})(jQuery);
|
||||
1
modules/lib/flot/jquery.flot.crosshair.min.js
vendored
Normal file
1
modules/lib/flot/jquery.flot.crosshair.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
(function(b){var a={crosshair:{mode:null,color:"rgba(0, 0, 0, 0.7)",lineWidth:1}};function c(h){var j={x:-1,y:-1,locked:false};h.setCrosshair=function e(l){if(!l){j.x=-1}else{var k=h.p2c(l);j.x=Math.max(0,Math.min(k.left,h.width()));j.y=Math.max(0,Math.min(k.top,h.height()))}h.triggerRedrawOverlay()};h.clearCrosshair=h.setCrosshair;h.lockCrosshair=function f(k){if(k){h.setCrosshair(k)}j.locked=true};h.unlockCrosshair=function g(){j.locked=false};function d(k){if(j.locked){return}if(j.x!=-1){j.x=-1;h.triggerRedrawOverlay()}}function i(k){if(j.locked){return}if(h.getSelection&&h.getSelection()){j.x=-1;return}var l=h.offset();j.x=Math.max(0,Math.min(k.pageX-l.left,h.width()));j.y=Math.max(0,Math.min(k.pageY-l.top,h.height()));h.triggerRedrawOverlay()}h.hooks.bindEvents.push(function(l,k){if(!l.getOptions().crosshair.mode){return}k.mouseout(d);k.mousemove(i)});h.hooks.drawOverlay.push(function(m,k){var n=m.getOptions().crosshair;if(!n.mode){return}var l=m.getPlotOffset();k.save();k.translate(l.left,l.top);if(j.x!=-1){k.strokeStyle=n.color;k.lineWidth=n.lineWidth;k.lineJoin="round";k.beginPath();if(n.mode.indexOf("x")!=-1){k.moveTo(j.x,0);k.lineTo(j.x,m.height())}if(n.mode.indexOf("y")!=-1){k.moveTo(0,j.y);k.lineTo(m.width(),j.y)}k.stroke()}k.restore()});h.hooks.shutdown.push(function(l,k){k.unbind("mouseout",d);k.unbind("mousemove",i)})}b.plot.plugins.push({init:c,options:a,name:"crosshair",version:"1.0"})})(jQuery);
|
||||
84
modules/lib/flot/jquery.flot.curvedLines.min.js
vendored
Normal file
84
modules/lib/flot/jquery.flot.curvedLines.min.js
vendored
Normal file
@ -0,0 +1,84 @@
|
||||
/* The MIT License
|
||||
|
||||
Copyright (c) 2011 by Michael Zinsmaier and nergal.dev
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
|
||||
____________________________________________________
|
||||
|
||||
what it is:
|
||||
____________________________________________________
|
||||
|
||||
curvedLines is a plugin for flot, that tries to display lines in a smoother way.
|
||||
The plugin is based on nergal.dev's work https://code.google.com/p/flot/issues/detail?id=226
|
||||
and further extended with a mode that forces the min/max points of the curves to be on the
|
||||
points. Both modes are achieved through adding of more data points
|
||||
=> 1) with large data sets you may get trouble
|
||||
=> 2) if you want to display the points too, you have to plot them as 2nd data series over the lines
|
||||
|
||||
This is version 0.1 of curvedLines so it will probably not work in every case. However
|
||||
the basic form of use descirbed next works (:
|
||||
|
||||
Feel free to further improve the code
|
||||
|
||||
____________________________________________________
|
||||
|
||||
how to use it:
|
||||
____________________________________________________
|
||||
|
||||
|
||||
var d1 = [[5,5],[7,3],[9,12]];
|
||||
|
||||
var options = { series: { curvedLines: { active: true }}};
|
||||
|
||||
|
||||
$.plot($("#placeholder"), [{data = d1, curvedLines: { show: true}}], options);
|
||||
|
||||
_____________________________________________________
|
||||
|
||||
options:
|
||||
_____________________________________________________
|
||||
|
||||
fill: bool true => lines get filled
|
||||
fillColor: null or the color that should be used for filling
|
||||
active: bool true => plugin can be used
|
||||
show: bool true => series will be drawn as curved line
|
||||
fit: bool true => forces the max,mins of the curve to be on the datapoints
|
||||
lineWidth: int width of the line
|
||||
curvePointFactor int defines how many "virtual" points are used per "real" data point to
|
||||
emulate the curvedLines
|
||||
fitPointDist: int defines the x axis distance of the additional two points that are used
|
||||
to enforce the min max condition. (you will get curvePointFactor * 3 * |datapoints|
|
||||
"virtual" points if fit is true)
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
* v0.1 initial commit
|
||||
* v0.15 negative values should work now (outcommented a negative -> 0 hook hope it does no harm)
|
||||
* v0.2 added fill option (thanks to monemihir) and multi axis support (thanks to soewono effendi)
|
||||
*
|
||||
*
|
||||
*/
|
||||
(function(t){t.plot.plugins.push({init:function(w){function x(r,n){for(var l,u=r.getData(),v=r.getPlotOffset(),s=0;s<u.length;s++)if(l=u[s],l.curvedLines.show&&0<l.curvedLines.lineWidth){axisx=l.xaxis;axisy=l.yaxis;n.save();n.translate(v.left,v.top);n.lineJoin="round";n.strokeStyle=l.color;if(l.curvedLines.fill){var m=t.color.parse(null==l.curvedLines.fillColor?l.color:l.curvedLines.fillColor);m.a="number"==typeof fill?fill:0.4;m.normalize();n.fillStyle=m.toString()}n.lineWidth=l.curvedLines.lineWidth; var g;a:{var b=l.data,j=l.curvedLines,m=j.curvePointFactor*b.length;g=[];var e=[];if(j.fit)for(var j=j.fitPointDist,d=0,a=0;a<b.length;a++)g[d]=b[a][0]-0.1,e[d]=0<a?b[a-1][1]*j+b[a][1]*(1-j):b[a][1],d++,g[d]=b[a][0],e[d]=b[a][1],d++,g[d]=b[a][0]+0.1,e[d]=a+1<b.length?b[a+1][1]*j+b[a][1]*(1-j):b[a][1],d++;else for(a=0;a<b.length;a++)g[a]=b[a][0],e[a]=b[a][1];var b=g.length,j=[],k=[];j[0]=0;j[b-1]=0;k[0]=0;for(a=1;a<b-1;++a){d=g[a+1]-g[a-1];if(0==d){g=null;break a}var d=(g[a]-g[a-1])/d,c=d*j[a-1]+2; j[a]=(d-1)/c;k[a]=(e[a+1]-e[a])/(g[a+1]-g[a])-(e[a]-e[a-1])/(g[a]-g[a-1]);k[a]=(6*k[a]/(g[a+1]-g[a-1])-d*k[a-1])/c}for(d=b-2;0<=d;--d)j[d]=j[d]*j[d+1]+k[d];var a=(g[b-1]-g[0])/(m-1),k=[],c=[],f=[];k[0]=g[0];c[0]=e[0];for(d=1;d<m;++d){k[d]=k[0]+d*a;for(var h=b-1,i=0;1<h-i;){var o=Math.round((h+i)/2);g[o]>k[d]?h=o:i=o}o=g[h]-g[i];if(0==o){g=null;break a}var p=(g[h]-k[d])/o,q=(k[d]-g[i])/o;c[d]=p*e[i]+q*e[h]+((p*p*p-p)*j[i]+(q*q*q-q)*j[h])*o*o/6;f.push(k[d]);f.push(c[d])}g=f}m=n;e=axisx;b=axisy;l=l.curvedLines.fill; d=j=null;a=0;m.beginPath();for(k=2;k<g.length;k+=2)if(c=g[k-2],f=g[k-2+1],h=g[k],i=g[k+1],!(null==c||null==h)){if(f<=i&&f<b.min){if(i<b.min)continue;c=(b.min-f)/(i-f)*(h-c)+c;f=b.min}else if(i<=f&&i<b.min){if(f<b.min)continue;h=(b.min-f)/(i-f)*(h-c)+c;i=b.min}if(f>=i&&f>b.max){if(i>b.max)continue;c=(b.max-f)/(i-f)*(h-c)+c;f=b.max}else if(i>=f&&i>b.max){if(f>b.max)continue;h=(b.max-f)/(i-f)*(h-c)+c;i=b.max}if(c<=h&&c<e.min){if(h<e.min)continue;f=(e.min-c)/(h-c)*(i-f)+f;c=e.min}else if(h<=c&&h<e.min){if(c< e.min)continue;i=(e.min-c)/(h-c)*(i-f)+f;h=e.min}if(c>=h&&c>e.max){if(h>e.max)continue;f=(e.max-c)/(h-c)*(i-f)+f;c=e.max}else if(h>=c&&h>e.max){if(c>e.max)continue;i=(e.max-c)/(h-c)*(i-f)+f;h=e.max}(c!=j||f!=d)&&m.lineTo(e.p2c(c),b.p2c(f));null==j&&(a=i);j=h;d=i;m.lineTo(e.p2c(h),b.p2c(i))}l&&(m.lineTo(e.p2c(e.max),b.p2c(b.min)),m.lineTo(e.p2c(e.min),b.p2c(b.min)),m.lineTo(e.p2c(e.min),b.p2c(a)),m.fill());m.stroke();n.restore()}}w.hooks.processOptions.push(function(r,n){n.series.curvedLines.active&& r.hooks.draw.push(x)})},options:{series:{curvedLines:{active:!1,show:!1,fit:!1,fill:!1,fillColor:null,lineWidth:2,curvePointFactor:20,fitPointDist:1.0E-4}}},name:"curvedLines",version:"0.2"})})(jQuery);
|
||||
183
modules/lib/flot/jquery.flot.fillbetween.js
Normal file
183
modules/lib/flot/jquery.flot.fillbetween.js
Normal file
@ -0,0 +1,183 @@
|
||||
/*
|
||||
Flot plugin for computing bottoms for filled line and bar charts.
|
||||
|
||||
The case: you've got two series that you want to fill the area
|
||||
between. In Flot terms, you need to use one as the fill bottom of the
|
||||
other. You can specify the bottom of each data point as the third
|
||||
coordinate manually, or you can use this plugin to compute it for you.
|
||||
|
||||
In order to name the other series, you need to give it an id, like this
|
||||
|
||||
var dataset = [
|
||||
{ data: [ ... ], id: "foo" } , // use default bottom
|
||||
{ data: [ ... ], fillBetween: "foo" }, // use first dataset as bottom
|
||||
];
|
||||
|
||||
$.plot($("#placeholder"), dataset, { line: { show: true, fill: true }});
|
||||
|
||||
As a convenience, if the id given is a number that doesn't appear as
|
||||
an id in the series, it is interpreted as the index in the array
|
||||
instead (so fillBetween: 0 can also mean the first series).
|
||||
|
||||
Internally, the plugin modifies the datapoints in each series. For
|
||||
line series, extra data points might be inserted through
|
||||
interpolation. Note that at points where the bottom line is not
|
||||
defined (due to a null point or start/end of line), the current line
|
||||
will show a gap too. The algorithm comes from the jquery.flot.stack.js
|
||||
plugin, possibly some code could be shared.
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
var options = {
|
||||
series: { fillBetween: null } // or number
|
||||
};
|
||||
|
||||
function init(plot) {
|
||||
function findBottomSeries(s, allseries) {
|
||||
var i;
|
||||
for (i = 0; i < allseries.length; ++i) {
|
||||
if (allseries[i].id == s.fillBetween)
|
||||
return allseries[i];
|
||||
}
|
||||
|
||||
if (typeof s.fillBetween == "number") {
|
||||
i = s.fillBetween;
|
||||
|
||||
if (i < 0 || i >= allseries.length)
|
||||
return null;
|
||||
|
||||
return allseries[i];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function computeFillBottoms(plot, s, datapoints) {
|
||||
if (s.fillBetween == null)
|
||||
return;
|
||||
|
||||
var other = findBottomSeries(s, plot.getData());
|
||||
if (!other)
|
||||
return;
|
||||
|
||||
var ps = datapoints.pointsize,
|
||||
points = datapoints.points,
|
||||
otherps = other.datapoints.pointsize,
|
||||
otherpoints = other.datapoints.points,
|
||||
newpoints = [],
|
||||
px, py, intery, qx, qy, bottom,
|
||||
withlines = s.lines.show,
|
||||
withbottom = ps > 2 && datapoints.format[2].y,
|
||||
withsteps = withlines && s.lines.steps,
|
||||
fromgap = true,
|
||||
i = 0, j = 0, l;
|
||||
|
||||
while (true) {
|
||||
if (i >= points.length)
|
||||
break;
|
||||
|
||||
l = newpoints.length;
|
||||
|
||||
if (points[i] == null) {
|
||||
// copy gaps
|
||||
for (m = 0; m < ps; ++m)
|
||||
newpoints.push(points[i + m]);
|
||||
i += ps;
|
||||
}
|
||||
else if (j >= otherpoints.length) {
|
||||
// for lines, we can't use the rest of the points
|
||||
if (!withlines) {
|
||||
for (m = 0; m < ps; ++m)
|
||||
newpoints.push(points[i + m]);
|
||||
}
|
||||
i += ps;
|
||||
}
|
||||
else if (otherpoints[j] == null) {
|
||||
// oops, got a gap
|
||||
for (m = 0; m < ps; ++m)
|
||||
newpoints.push(null);
|
||||
fromgap = true;
|
||||
j += otherps;
|
||||
}
|
||||
else {
|
||||
// cases where we actually got two points
|
||||
px = points[i];
|
||||
py = points[i + 1];
|
||||
qx = otherpoints[j];
|
||||
qy = otherpoints[j + 1];
|
||||
bottom = 0;
|
||||
|
||||
if (px == qx) {
|
||||
for (m = 0; m < ps; ++m)
|
||||
newpoints.push(points[i + m]);
|
||||
|
||||
//newpoints[l + 1] += qy;
|
||||
bottom = qy;
|
||||
|
||||
i += ps;
|
||||
j += otherps;
|
||||
}
|
||||
else if (px > qx) {
|
||||
// we got past point below, might need to
|
||||
// insert interpolated extra point
|
||||
if (withlines && i > 0 && points[i - ps] != null) {
|
||||
intery = py + (points[i - ps + 1] - py) * (qx - px) / (points[i - ps] - px);
|
||||
newpoints.push(qx);
|
||||
newpoints.push(intery)
|
||||
for (m = 2; m < ps; ++m)
|
||||
newpoints.push(points[i + m]);
|
||||
bottom = qy;
|
||||
}
|
||||
|
||||
j += otherps;
|
||||
}
|
||||
else { // px < qx
|
||||
if (fromgap && withlines) {
|
||||
// if we come from a gap, we just skip this point
|
||||
i += ps;
|
||||
continue;
|
||||
}
|
||||
|
||||
for (m = 0; m < ps; ++m)
|
||||
newpoints.push(points[i + m]);
|
||||
|
||||
// we might be able to interpolate a point below,
|
||||
// this can give us a better y
|
||||
if (withlines && j > 0 && otherpoints[j - otherps] != null)
|
||||
bottom = qy + (otherpoints[j - otherps + 1] - qy) * (px - qx) / (otherpoints[j - otherps] - qx);
|
||||
|
||||
//newpoints[l + 1] += bottom;
|
||||
|
||||
i += ps;
|
||||
}
|
||||
|
||||
fromgap = false;
|
||||
|
||||
if (l != newpoints.length && withbottom)
|
||||
newpoints[l + 2] = bottom;
|
||||
}
|
||||
|
||||
// maintain the line steps invariant
|
||||
if (withsteps && l != newpoints.length && l > 0
|
||||
&& newpoints[l] != null
|
||||
&& newpoints[l] != newpoints[l - ps]
|
||||
&& newpoints[l + 1] != newpoints[l - ps + 1]) {
|
||||
for (m = 0; m < ps; ++m)
|
||||
newpoints[l + ps + m] = newpoints[l + m];
|
||||
newpoints[l + 1] = newpoints[l - ps + 1];
|
||||
}
|
||||
}
|
||||
|
||||
datapoints.points = newpoints;
|
||||
}
|
||||
|
||||
plot.hooks.processDatapoints.push(computeFillBottoms);
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'fillbetween',
|
||||
version: '1.0'
|
||||
});
|
||||
})(jQuery);
|
||||
1
modules/lib/flot/jquery.flot.fillbetween.min.js
vendored
Normal file
1
modules/lib/flot/jquery.flot.fillbetween.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
(function(b){var a={series:{fillBetween:null}};function c(f){function d(j,h){var g;for(g=0;g<h.length;++g){if(h[g].id==j.fillBetween){return h[g]}}if(typeof j.fillBetween=="number"){g=j.fillBetween;if(g<0||g>=h.length){return null}return h[g]}return null}function e(B,u,g){if(u.fillBetween==null){return}var p=d(u,B.getData());if(!p){return}var y=g.pointsize,E=g.points,h=p.datapoints.pointsize,x=p.datapoints.points,r=[],w,v,k,G,F,q,t=u.lines.show,o=y>2&&g.format[2].y,n=t&&u.lines.steps,D=true,C=0,A=0,z;while(true){if(C>=E.length){break}z=r.length;if(E[C]==null){for(m=0;m<y;++m){r.push(E[C+m])}C+=y}else{if(A>=x.length){if(!t){for(m=0;m<y;++m){r.push(E[C+m])}}C+=y}else{if(x[A]==null){for(m=0;m<y;++m){r.push(null)}D=true;A+=h}else{w=E[C];v=E[C+1];G=x[A];F=x[A+1];q=0;if(w==G){for(m=0;m<y;++m){r.push(E[C+m])}q=F;C+=y;A+=h}else{if(w>G){if(t&&C>0&&E[C-y]!=null){k=v+(E[C-y+1]-v)*(G-w)/(E[C-y]-w);r.push(G);r.push(k);for(m=2;m<y;++m){r.push(E[C+m])}q=F}A+=h}else{if(D&&t){C+=y;continue}for(m=0;m<y;++m){r.push(E[C+m])}if(t&&A>0&&x[A-h]!=null){q=F+(x[A-h+1]-F)*(w-G)/(x[A-h]-G)}C+=y}}D=false;if(z!=r.length&&o){r[z+2]=q}}}}if(n&&z!=r.length&&z>0&&r[z]!=null&&r[z]!=r[z-y]&&r[z+1]!=r[z-y+1]){for(m=0;m<y;++m){r[z+y+m]=r[z+m]}r[z+1]=r[z-y+1]}}g.points=r}f.hooks.processDatapoints.push(e)}b.plot.plugins.push({init:c,options:a,name:"fillbetween",version:"1.0"})})(jQuery);
|
||||
238
modules/lib/flot/jquery.flot.image.js
Normal file
238
modules/lib/flot/jquery.flot.image.js
Normal file
@ -0,0 +1,238 @@
|
||||
/*
|
||||
Flot plugin for plotting images, e.g. useful for putting ticks on a
|
||||
prerendered complex visualization.
|
||||
|
||||
The data syntax is [[image, x1, y1, x2, y2], ...] where (x1, y1) and
|
||||
(x2, y2) are where you intend the two opposite corners of the image to
|
||||
end up in the plot. Image must be a fully loaded Javascript image (you
|
||||
can make one with new Image()). If the image is not complete, it's
|
||||
skipped when plotting.
|
||||
|
||||
There are two helpers included for retrieving images. The easiest work
|
||||
the way that you put in URLs instead of images in the data (like
|
||||
["myimage.png", 0, 0, 10, 10]), then call $.plot.image.loadData(data,
|
||||
options, callback) where data and options are the same as you pass in
|
||||
to $.plot. This loads the images, replaces the URLs in the data with
|
||||
the corresponding images and calls "callback" when all images are
|
||||
loaded (or failed loading). In the callback, you can then call $.plot
|
||||
with the data set. See the included example.
|
||||
|
||||
A more low-level helper, $.plot.image.load(urls, callback) is also
|
||||
included. Given a list of URLs, it calls callback with an object
|
||||
mapping from URL to Image object when all images are loaded or have
|
||||
failed loading.
|
||||
|
||||
Options for the plugin are
|
||||
|
||||
series: {
|
||||
images: {
|
||||
show: boolean
|
||||
anchor: "corner" or "center"
|
||||
alpha: [0,1]
|
||||
}
|
||||
}
|
||||
|
||||
which can be specified for a specific series
|
||||
|
||||
$.plot($("#placeholder"), [{ data: [ ... ], images: { ... } ])
|
||||
|
||||
Note that because the data format is different from usual data points,
|
||||
you can't use images with anything else in a specific data series.
|
||||
|
||||
Setting "anchor" to "center" causes the pixels in the image to be
|
||||
anchored at the corner pixel centers inside of at the pixel corners,
|
||||
effectively letting half a pixel stick out to each side in the plot.
|
||||
|
||||
|
||||
A possible future direction could be support for tiling for large
|
||||
images (like Google Maps).
|
||||
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
var options = {
|
||||
series: {
|
||||
images: {
|
||||
show: false,
|
||||
alpha: 1,
|
||||
anchor: "corner" // or "center"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$.plot.image = {};
|
||||
|
||||
$.plot.image.loadDataImages = function (series, options, callback) {
|
||||
var urls = [], points = [];
|
||||
|
||||
var defaultShow = options.series.images.show;
|
||||
|
||||
$.each(series, function (i, s) {
|
||||
if (!(defaultShow || s.images.show))
|
||||
return;
|
||||
|
||||
if (s.data)
|
||||
s = s.data;
|
||||
|
||||
$.each(s, function (i, p) {
|
||||
if (typeof p[0] == "string") {
|
||||
urls.push(p[0]);
|
||||
points.push(p);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$.plot.image.load(urls, function (loadedImages) {
|
||||
$.each(points, function (i, p) {
|
||||
var url = p[0];
|
||||
if (loadedImages[url])
|
||||
p[0] = loadedImages[url];
|
||||
});
|
||||
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
||||
$.plot.image.load = function (urls, callback) {
|
||||
var missing = urls.length, loaded = {};
|
||||
if (missing == 0)
|
||||
callback({});
|
||||
|
||||
$.each(urls, function (i, url) {
|
||||
var handler = function () {
|
||||
--missing;
|
||||
|
||||
loaded[url] = this;
|
||||
|
||||
if (missing == 0)
|
||||
callback(loaded);
|
||||
};
|
||||
|
||||
$('<img />').load(handler).error(handler).attr('src', url);
|
||||
});
|
||||
}
|
||||
|
||||
function drawSeries(plot, ctx, series) {
|
||||
var plotOffset = plot.getPlotOffset();
|
||||
|
||||
if (!series.images || !series.images.show)
|
||||
return;
|
||||
|
||||
var points = series.datapoints.points,
|
||||
ps = series.datapoints.pointsize;
|
||||
|
||||
for (var i = 0; i < points.length; i += ps) {
|
||||
var img = points[i],
|
||||
x1 = points[i + 1], y1 = points[i + 2],
|
||||
x2 = points[i + 3], y2 = points[i + 4],
|
||||
xaxis = series.xaxis, yaxis = series.yaxis,
|
||||
tmp;
|
||||
|
||||
// actually we should check img.complete, but it
|
||||
// appears to be a somewhat unreliable indicator in
|
||||
// IE6 (false even after load event)
|
||||
if (!img || img.width <= 0 || img.height <= 0)
|
||||
continue;
|
||||
|
||||
if (x1 > x2) {
|
||||
tmp = x2;
|
||||
x2 = x1;
|
||||
x1 = tmp;
|
||||
}
|
||||
if (y1 > y2) {
|
||||
tmp = y2;
|
||||
y2 = y1;
|
||||
y1 = tmp;
|
||||
}
|
||||
|
||||
// if the anchor is at the center of the pixel, expand the
|
||||
// image by 1/2 pixel in each direction
|
||||
if (series.images.anchor == "center") {
|
||||
tmp = 0.5 * (x2-x1) / (img.width - 1);
|
||||
x1 -= tmp;
|
||||
x2 += tmp;
|
||||
tmp = 0.5 * (y2-y1) / (img.height - 1);
|
||||
y1 -= tmp;
|
||||
y2 += tmp;
|
||||
}
|
||||
|
||||
// clip
|
||||
if (x1 == x2 || y1 == y2 ||
|
||||
x1 >= xaxis.max || x2 <= xaxis.min ||
|
||||
y1 >= yaxis.max || y2 <= yaxis.min)
|
||||
continue;
|
||||
|
||||
var sx1 = 0, sy1 = 0, sx2 = img.width, sy2 = img.height;
|
||||
if (x1 < xaxis.min) {
|
||||
sx1 += (sx2 - sx1) * (xaxis.min - x1) / (x2 - x1);
|
||||
x1 = xaxis.min;
|
||||
}
|
||||
|
||||
if (x2 > xaxis.max) {
|
||||
sx2 += (sx2 - sx1) * (xaxis.max - x2) / (x2 - x1);
|
||||
x2 = xaxis.max;
|
||||
}
|
||||
|
||||
if (y1 < yaxis.min) {
|
||||
sy2 += (sy1 - sy2) * (yaxis.min - y1) / (y2 - y1);
|
||||
y1 = yaxis.min;
|
||||
}
|
||||
|
||||
if (y2 > yaxis.max) {
|
||||
sy1 += (sy1 - sy2) * (yaxis.max - y2) / (y2 - y1);
|
||||
y2 = yaxis.max;
|
||||
}
|
||||
|
||||
x1 = xaxis.p2c(x1);
|
||||
x2 = xaxis.p2c(x2);
|
||||
y1 = yaxis.p2c(y1);
|
||||
y2 = yaxis.p2c(y2);
|
||||
|
||||
// the transformation may have swapped us
|
||||
if (x1 > x2) {
|
||||
tmp = x2;
|
||||
x2 = x1;
|
||||
x1 = tmp;
|
||||
}
|
||||
if (y1 > y2) {
|
||||
tmp = y2;
|
||||
y2 = y1;
|
||||
y1 = tmp;
|
||||
}
|
||||
|
||||
tmp = ctx.globalAlpha;
|
||||
ctx.globalAlpha *= series.images.alpha;
|
||||
ctx.drawImage(img,
|
||||
sx1, sy1, sx2 - sx1, sy2 - sy1,
|
||||
x1 + plotOffset.left, y1 + plotOffset.top,
|
||||
x2 - x1, y2 - y1);
|
||||
ctx.globalAlpha = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
function processRawData(plot, series, data, datapoints) {
|
||||
if (!series.images.show)
|
||||
return;
|
||||
|
||||
// format is Image, x1, y1, x2, y2 (opposite corners)
|
||||
datapoints.format = [
|
||||
{ required: true },
|
||||
{ x: true, number: true, required: true },
|
||||
{ y: true, number: true, required: true },
|
||||
{ x: true, number: true, required: true },
|
||||
{ y: true, number: true, required: true }
|
||||
];
|
||||
}
|
||||
|
||||
function init(plot) {
|
||||
plot.hooks.processRawData.push(processRawData);
|
||||
plot.hooks.drawSeries.push(drawSeries);
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'image',
|
||||
version: '1.1'
|
||||
});
|
||||
})(jQuery);
|
||||
1
modules/lib/flot/jquery.flot.image.min.js
vendored
Normal file
1
modules/lib/flot/jquery.flot.image.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
(function(c){var a={series:{images:{show:false,alpha:1,anchor:"corner"}}};c.plot.image={};c.plot.image.loadDataImages=function(g,f,k){var j=[],h=[];var i=f.series.images.show;c.each(g,function(l,m){if(!(i||m.images.show)){return}if(m.data){m=m.data}c.each(m,function(n,o){if(typeof o[0]=="string"){j.push(o[0]);h.push(o)}})});c.plot.image.load(j,function(l){c.each(h,function(n,o){var m=o[0];if(l[m]){o[0]=l[m]}});k()})};c.plot.image.load=function(h,i){var g=h.length,f={};if(g==0){i({})}c.each(h,function(k,j){var l=function(){--g;f[j]=this;if(g==0){i(f)}};c("<img />").load(l).error(l).attr("src",j)})};function d(q,o,l){var m=q.getPlotOffset();if(!l.images||!l.images.show){return}var r=l.datapoints.points,n=l.datapoints.pointsize;for(var t=0;t<r.length;t+=n){var y=r[t],w=r[t+1],g=r[t+2],v=r[t+3],f=r[t+4],h=l.xaxis,u=l.yaxis,x;if(!y||y.width<=0||y.height<=0){continue}if(w>v){x=v;v=w;w=x}if(g>f){x=f;f=g;g=x}if(l.images.anchor=="center"){x=0.5*(v-w)/(y.width-1);w-=x;v+=x;x=0.5*(f-g)/(y.height-1);g-=x;f+=x}if(w==v||g==f||w>=h.max||v<=h.min||g>=u.max||f<=u.min){continue}var k=0,s=0,j=y.width,p=y.height;if(w<h.min){k+=(j-k)*(h.min-w)/(v-w);w=h.min}if(v>h.max){j+=(j-k)*(h.max-v)/(v-w);v=h.max}if(g<u.min){p+=(s-p)*(u.min-g)/(f-g);g=u.min}if(f>u.max){s+=(s-p)*(u.max-f)/(f-g);f=u.max}w=h.p2c(w);v=h.p2c(v);g=u.p2c(g);f=u.p2c(f);if(w>v){x=v;v=w;w=x}if(g>f){x=f;f=g;g=x}x=o.globalAlpha;o.globalAlpha*=l.images.alpha;o.drawImage(y,k,s,j-k,p-s,w+m.left,g+m.top,v-w,f-g);o.globalAlpha=x}}function b(i,f,g,h){if(!f.images.show){return}h.format=[{required:true},{x:true,number:true,required:true},{y:true,number:true,required:true},{x:true,number:true,required:true},{y:true,number:true,required:true}]}function e(f){f.hooks.processRawData.push(b);f.hooks.drawSeries.push(d)}c.plot.plugins.push({init:e,options:a,name:"image",version:"1.1"})})(jQuery);
|
||||
2599
modules/lib/flot/jquery.flot.js
Normal file
2599
modules/lib/flot/jquery.flot.js
Normal file
File diff suppressed because it is too large
Load Diff
6
modules/lib/flot/jquery.flot.min.js
vendored
Normal file
6
modules/lib/flot/jquery.flot.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
95
modules/lib/flot/jquery.flot.multihighlight.min.js
vendored
Normal file
95
modules/lib/flot/jquery.flot.multihighlight.min.js
vendored
Normal file
@ -0,0 +1,95 @@
|
||||
(function($) {
|
||||
|
||||
var options = {
|
||||
multihighlight: {
|
||||
mode: null, // null, x or y.
|
||||
linkedPlots: null, // null or array of plots.
|
||||
hoverMode: null // null, point or bar.
|
||||
}
|
||||
};
|
||||
|
||||
function init(plot) {
|
||||
|
||||
// Builds an array of plots to highlight - the current plot and all the linked plots if any.
|
||||
function getPlotsToHighlight() {
|
||||
var plotsToHighlight = [ plot ];
|
||||
if (plot.getOptions().multihighlight.linkedPlots != null) {
|
||||
$.each(plot.getOptions().multihighlight.linkedPlots, function(index, linkedPlot){
|
||||
plotsToHighlight.push(linkedPlot);
|
||||
});
|
||||
}
|
||||
return plotsToHighlight;
|
||||
}
|
||||
|
||||
function onPlotHover(event, position, item) {
|
||||
$.each(getPlotsToHighlight(), function(index, plotToHighlight) {
|
||||
if (!plotToHighlight.getOptions().multihighlight.mode != null) {
|
||||
plotToHighlight.unhighlight();
|
||||
|
||||
var axisPosition = plotToHighlight.getOptions().multihighlight.mode == 'x' ? position.x : position.y;
|
||||
var dataIndex = plotToHighlight.getOptions().multihighlight.mode == 'x' ? 0 : 1;
|
||||
|
||||
var highlightedItems = new Array();
|
||||
$.each(plotToHighlight.getData(), function(i, serie) {
|
||||
var j;
|
||||
|
||||
for (j = 0; j < serie.data.length; j++) {
|
||||
if (serie.data[j] == null || serie.data[j][dataIndex] > axisPosition) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (j != 0) {
|
||||
var highlighted = j-1;
|
||||
// Checking which one is closer if it is not a bar graph.
|
||||
if (plotToHighlight.getOptions().multihighlight.hoverMode !== 'bar' && serie.data[j] != null) {
|
||||
if (axisPosition-serie.data[j-1][dataIndex] > Math.abs(axisPosition-serie.data[j][dataIndex])) {
|
||||
highlighted = j;
|
||||
}
|
||||
}
|
||||
|
||||
plotToHighlight.highlight(i, highlighted);
|
||||
highlightedItems.push({ serieIndex: i, dataIndex: highlighted });
|
||||
}
|
||||
});
|
||||
|
||||
if (highlightedItems.length > 0) {
|
||||
plotToHighlight.getPlaceholder().trigger("multihighlighted", [ position, highlightedItems ]);
|
||||
}
|
||||
else {
|
||||
plotToHighlight.getPlaceholder().trigger("unmultihighlighted");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function onMouseOut(event) {
|
||||
$.each(getPlotsToHighlight(), function(index, plotToHighlight) {
|
||||
if (!plotToHighlight.getOptions().multihighlight.mode != null) {
|
||||
plotToHighlight.unhighlight();
|
||||
plotToHighlight.getPlaceholder().trigger("unmultihighlighted");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Hook up the events.
|
||||
plot.hooks.bindEvents.push(function(plot, eventHolder) {
|
||||
if (!plot.getOptions().multihighlight.mode)
|
||||
return;
|
||||
|
||||
plot.getPlaceholder().bind('plothover', onPlotHover);
|
||||
plot.getPlaceholder().bind('mouseout', onMouseOut);
|
||||
});
|
||||
plot.hooks.shutdown.push(function(plot, eventHolder) {
|
||||
plot.getPlaceholder().unbind('plothover', onPlotHover);
|
||||
plot.getPlaceholder().unbind('mouseout', onMouseOut);
|
||||
});
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'multihighlight',
|
||||
version: '1.0'
|
||||
});
|
||||
})(jQuery);
|
||||
336
modules/lib/flot/jquery.flot.navigate.js
Normal file
336
modules/lib/flot/jquery.flot.navigate.js
Normal file
@ -0,0 +1,336 @@
|
||||
/*
|
||||
Flot plugin for adding panning and zooming capabilities to a plot.
|
||||
|
||||
The default behaviour is double click and scrollwheel up/down to zoom
|
||||
in, drag to pan. The plugin defines plot.zoom({ center }),
|
||||
plot.zoomOut() and plot.pan(offset) so you easily can add custom
|
||||
controls. It also fires a "plotpan" and "plotzoom" event when
|
||||
something happens, useful for synchronizing plots.
|
||||
|
||||
Options:
|
||||
|
||||
zoom: {
|
||||
interactive: false
|
||||
trigger: "dblclick" // or "click" for single click
|
||||
amount: 1.5 // 2 = 200% (zoom in), 0.5 = 50% (zoom out)
|
||||
}
|
||||
|
||||
pan: {
|
||||
interactive: false
|
||||
cursor: "move" // CSS mouse cursor value used when dragging, e.g. "pointer"
|
||||
frameRate: 20
|
||||
}
|
||||
|
||||
xaxis, yaxis, x2axis, y2axis: {
|
||||
zoomRange: null // or [number, number] (min range, max range) or false
|
||||
panRange: null // or [number, number] (min, max) or false
|
||||
}
|
||||
|
||||
"interactive" enables the built-in drag/click behaviour. If you enable
|
||||
interactive for pan, then you'll have a basic plot that supports
|
||||
moving around; the same for zoom.
|
||||
|
||||
"amount" specifies the default amount to zoom in (so 1.5 = 150%)
|
||||
relative to the current viewport.
|
||||
|
||||
"cursor" is a standard CSS mouse cursor string used for visual
|
||||
feedback to the user when dragging.
|
||||
|
||||
"frameRate" specifies the maximum number of times per second the plot
|
||||
will update itself while the user is panning around on it (set to null
|
||||
to disable intermediate pans, the plot will then not update until the
|
||||
mouse button is released).
|
||||
|
||||
"zoomRange" is the interval in which zooming can happen, e.g. with
|
||||
zoomRange: [1, 100] the zoom will never scale the axis so that the
|
||||
difference between min and max is smaller than 1 or larger than 100.
|
||||
You can set either end to null to ignore, e.g. [1, null]. If you set
|
||||
zoomRange to false, zooming on that axis will be disabled.
|
||||
|
||||
"panRange" confines the panning to stay within a range, e.g. with
|
||||
panRange: [-10, 20] panning stops at -10 in one end and at 20 in the
|
||||
other. Either can be null, e.g. [-10, null]. If you set
|
||||
panRange to false, panning on that axis will be disabled.
|
||||
|
||||
Example API usage:
|
||||
|
||||
plot = $.plot(...);
|
||||
|
||||
// zoom default amount in on the pixel (10, 20)
|
||||
plot.zoom({ center: { left: 10, top: 20 } });
|
||||
|
||||
// zoom out again
|
||||
plot.zoomOut({ center: { left: 10, top: 20 } });
|
||||
|
||||
// zoom 200% in on the pixel (10, 20)
|
||||
plot.zoom({ amount: 2, center: { left: 10, top: 20 } });
|
||||
|
||||
// pan 100 pixels to the left and 20 down
|
||||
plot.pan({ left: -100, top: 20 })
|
||||
|
||||
Here, "center" specifies where the center of the zooming should
|
||||
happen. Note that this is defined in pixel space, not the space of the
|
||||
data points (you can use the p2c helpers on the axes in Flot to help
|
||||
you convert between these).
|
||||
|
||||
"amount" is the amount to zoom the viewport relative to the current
|
||||
range, so 1 is 100% (i.e. no change), 1.5 is 150% (zoom in), 0.7 is
|
||||
70% (zoom out). You can set the default in the options.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
// First two dependencies, jquery.event.drag.js and
|
||||
// jquery.mousewheel.js, we put them inline here to save people the
|
||||
// effort of downloading them.
|
||||
|
||||
/*
|
||||
jquery.event.drag.js ~ v1.5 ~ Copyright (c) 2008, Three Dub Media (http://threedubmedia.com)
|
||||
Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-LICENSE.txt
|
||||
*/
|
||||
(function(E){E.fn.drag=function(L,K,J){if(K){this.bind("dragstart",L)}if(J){this.bind("dragend",J)}return !L?this.trigger("drag"):this.bind("drag",K?K:L)};var A=E.event,B=A.special,F=B.drag={not:":input",distance:0,which:1,dragging:false,setup:function(J){J=E.extend({distance:F.distance,which:F.which,not:F.not},J||{});J.distance=I(J.distance);A.add(this,"mousedown",H,J);if(this.attachEvent){this.attachEvent("ondragstart",D)}},teardown:function(){A.remove(this,"mousedown",H);if(this===F.dragging){F.dragging=F.proxy=false}G(this,true);if(this.detachEvent){this.detachEvent("ondragstart",D)}}};B.dragstart=B.dragend={setup:function(){},teardown:function(){}};function H(L){var K=this,J,M=L.data||{};if(M.elem){K=L.dragTarget=M.elem;L.dragProxy=F.proxy||K;L.cursorOffsetX=M.pageX-M.left;L.cursorOffsetY=M.pageY-M.top;L.offsetX=L.pageX-L.cursorOffsetX;L.offsetY=L.pageY-L.cursorOffsetY}else{if(F.dragging||(M.which>0&&L.which!=M.which)||E(L.target).is(M.not)){return }}switch(L.type){case"mousedown":E.extend(M,E(K).offset(),{elem:K,target:L.target,pageX:L.pageX,pageY:L.pageY});A.add(document,"mousemove mouseup",H,M);G(K,false);F.dragging=null;return false;case !F.dragging&&"mousemove":if(I(L.pageX-M.pageX)+I(L.pageY-M.pageY)<M.distance){break}L.target=M.target;J=C(L,"dragstart",K);if(J!==false){F.dragging=K;F.proxy=L.dragProxy=E(J||K)[0]}case"mousemove":if(F.dragging){J=C(L,"drag",K);if(B.drop){B.drop.allowed=(J!==false);B.drop.handler(L)}if(J!==false){break}L.type="mouseup"}case"mouseup":A.remove(document,"mousemove mouseup",H);if(F.dragging){if(B.drop){B.drop.handler(L)}C(L,"dragend",K)}G(K,true);F.dragging=F.proxy=M.elem=false;break}return true}function C(M,K,L){M.type=K;var J=E.event.handle.call(L,M);return J===false?false:J||M.result}function I(J){return Math.pow(J,2)}function D(){return(F.dragging===false)}function G(K,J){if(!K){return }K.unselectable=J?"off":"on";K.onselectstart=function(){return J};if(K.style){K.style.MozUserSelect=J?"":"none"}}})(jQuery);
|
||||
|
||||
|
||||
/* jquery.mousewheel.min.js
|
||||
* Copyright (c) 2009 Brandon Aaron (http://brandonaaron.net)
|
||||
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
|
||||
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
|
||||
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
|
||||
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
|
||||
*
|
||||
* Version: 3.0.2
|
||||
*
|
||||
* Requires: 1.2.2+
|
||||
*/
|
||||
(function(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(f){var d=[].slice.call(arguments,1),g=0,e=true;f=c.event.fix(f||window.event);f.type="mousewheel";if(f.wheelDelta){g=f.wheelDelta/120}if(f.detail){g=-f.detail/3}d.unshift(f,g);return c.event.handle.apply(this,d)}})(jQuery);
|
||||
|
||||
|
||||
|
||||
|
||||
(function ($) {
|
||||
var options = {
|
||||
xaxis: {
|
||||
zoomRange: null, // or [number, number] (min range, max range)
|
||||
panRange: null // or [number, number] (min, max)
|
||||
},
|
||||
zoom: {
|
||||
interactive: false,
|
||||
trigger: "dblclick", // or "click" for single click
|
||||
amount: 1.5 // how much to zoom relative to current position, 2 = 200% (zoom in), 0.5 = 50% (zoom out)
|
||||
},
|
||||
pan: {
|
||||
interactive: false,
|
||||
cursor: "move",
|
||||
frameRate: 20
|
||||
}
|
||||
};
|
||||
|
||||
function init(plot) {
|
||||
function onZoomClick(e, zoomOut) {
|
||||
var c = plot.offset();
|
||||
c.left = e.pageX - c.left;
|
||||
c.top = e.pageY - c.top;
|
||||
if (zoomOut)
|
||||
plot.zoomOut({ center: c });
|
||||
else
|
||||
plot.zoom({ center: c });
|
||||
}
|
||||
|
||||
function onMouseWheel(e, delta) {
|
||||
onZoomClick(e, delta < 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
var prevCursor = 'default', prevPageX = 0, prevPageY = 0,
|
||||
panTimeout = null;
|
||||
|
||||
function onDragStart(e) {
|
||||
if (e.which != 1) // only accept left-click
|
||||
return false;
|
||||
var c = plot.getPlaceholder().css('cursor');
|
||||
if (c)
|
||||
prevCursor = c;
|
||||
plot.getPlaceholder().css('cursor', plot.getOptions().pan.cursor);
|
||||
prevPageX = e.pageX;
|
||||
prevPageY = e.pageY;
|
||||
}
|
||||
|
||||
function onDrag(e) {
|
||||
var frameRate = plot.getOptions().pan.frameRate;
|
||||
if (panTimeout || !frameRate)
|
||||
return;
|
||||
|
||||
panTimeout = setTimeout(function () {
|
||||
plot.pan({ left: prevPageX - e.pageX,
|
||||
top: prevPageY - e.pageY });
|
||||
prevPageX = e.pageX;
|
||||
prevPageY = e.pageY;
|
||||
|
||||
panTimeout = null;
|
||||
}, 1 / frameRate * 1000);
|
||||
}
|
||||
|
||||
function onDragEnd(e) {
|
||||
if (panTimeout) {
|
||||
clearTimeout(panTimeout);
|
||||
panTimeout = null;
|
||||
}
|
||||
|
||||
plot.getPlaceholder().css('cursor', prevCursor);
|
||||
plot.pan({ left: prevPageX - e.pageX,
|
||||
top: prevPageY - e.pageY });
|
||||
}
|
||||
|
||||
function bindEvents(plot, eventHolder) {
|
||||
var o = plot.getOptions();
|
||||
if (o.zoom.interactive) {
|
||||
eventHolder[o.zoom.trigger](onZoomClick);
|
||||
eventHolder.mousewheel(onMouseWheel);
|
||||
}
|
||||
|
||||
if (o.pan.interactive) {
|
||||
eventHolder.bind("dragstart", { distance: 10 }, onDragStart);
|
||||
eventHolder.bind("drag", onDrag);
|
||||
eventHolder.bind("dragend", onDragEnd);
|
||||
}
|
||||
}
|
||||
|
||||
plot.zoomOut = function (args) {
|
||||
if (!args)
|
||||
args = {};
|
||||
|
||||
if (!args.amount)
|
||||
args.amount = plot.getOptions().zoom.amount
|
||||
|
||||
args.amount = 1 / args.amount;
|
||||
plot.zoom(args);
|
||||
}
|
||||
|
||||
plot.zoom = function (args) {
|
||||
if (!args)
|
||||
args = {};
|
||||
|
||||
var c = args.center,
|
||||
amount = args.amount || plot.getOptions().zoom.amount,
|
||||
w = plot.width(), h = plot.height();
|
||||
|
||||
if (!c)
|
||||
c = { left: w / 2, top: h / 2 };
|
||||
|
||||
var xf = c.left / w,
|
||||
yf = c.top / h,
|
||||
minmax = {
|
||||
x: {
|
||||
min: c.left - xf * w / amount,
|
||||
max: c.left + (1 - xf) * w / amount
|
||||
},
|
||||
y: {
|
||||
min: c.top - yf * h / amount,
|
||||
max: c.top + (1 - yf) * h / amount
|
||||
}
|
||||
};
|
||||
|
||||
$.each(plot.getAxes(), function(_, axis) {
|
||||
var opts = axis.options,
|
||||
min = minmax[axis.direction].min,
|
||||
max = minmax[axis.direction].max,
|
||||
zr = opts.zoomRange;
|
||||
|
||||
if (zr === false) // no zooming on this axis
|
||||
return;
|
||||
|
||||
min = axis.c2p(min);
|
||||
max = axis.c2p(max);
|
||||
if (min > max) {
|
||||
// make sure min < max
|
||||
var tmp = min;
|
||||
min = max;
|
||||
max = tmp;
|
||||
}
|
||||
|
||||
var range = max - min;
|
||||
if (zr &&
|
||||
((zr[0] != null && range < zr[0]) ||
|
||||
(zr[1] != null && range > zr[1])))
|
||||
return;
|
||||
|
||||
opts.min = min;
|
||||
opts.max = max;
|
||||
});
|
||||
|
||||
plot.setupGrid();
|
||||
plot.draw();
|
||||
|
||||
if (!args.preventEvent)
|
||||
plot.getPlaceholder().trigger("plotzoom", [ plot ]);
|
||||
}
|
||||
|
||||
plot.pan = function (args) {
|
||||
var delta = {
|
||||
x: +args.left,
|
||||
y: +args.top
|
||||
};
|
||||
|
||||
if (isNaN(delta.x))
|
||||
delta.x = 0;
|
||||
if (isNaN(delta.y))
|
||||
delta.y = 0;
|
||||
|
||||
$.each(plot.getAxes(), function (_, axis) {
|
||||
var opts = axis.options,
|
||||
min, max, d = delta[axis.direction];
|
||||
|
||||
min = axis.c2p(axis.p2c(axis.min) + d),
|
||||
max = axis.c2p(axis.p2c(axis.max) + d);
|
||||
|
||||
var pr = opts.panRange;
|
||||
if (pr === false) // no panning on this axis
|
||||
return;
|
||||
|
||||
if (pr) {
|
||||
// check whether we hit the wall
|
||||
if (pr[0] != null && pr[0] > min) {
|
||||
d = pr[0] - min;
|
||||
min += d;
|
||||
max += d;
|
||||
}
|
||||
|
||||
if (pr[1] != null && pr[1] < max) {
|
||||
d = pr[1] - max;
|
||||
min += d;
|
||||
max += d;
|
||||
}
|
||||
}
|
||||
|
||||
opts.min = min;
|
||||
opts.max = max;
|
||||
});
|
||||
|
||||
plot.setupGrid();
|
||||
plot.draw();
|
||||
|
||||
if (!args.preventEvent)
|
||||
plot.getPlaceholder().trigger("plotpan", [ plot ]);
|
||||
}
|
||||
|
||||
function shutdown(plot, eventHolder) {
|
||||
eventHolder.unbind(plot.getOptions().zoom.trigger, onZoomClick);
|
||||
eventHolder.unbind("mousewheel", onMouseWheel);
|
||||
eventHolder.unbind("dragstart", onDragStart);
|
||||
eventHolder.unbind("drag", onDrag);
|
||||
eventHolder.unbind("dragend", onDragEnd);
|
||||
if (panTimeout)
|
||||
clearTimeout(panTimeout);
|
||||
}
|
||||
|
||||
plot.hooks.bindEvents.push(bindEvents);
|
||||
plot.hooks.shutdown.push(shutdown);
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'navigate',
|
||||
version: '1.3'
|
||||
});
|
||||
})(jQuery);
|
||||
1
modules/lib/flot/jquery.flot.navigate.min.js
vendored
Normal file
1
modules/lib/flot/jquery.flot.navigate.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
23
modules/lib/flot/jquery.flot.orderBars.min.js
vendored
Normal file
23
modules/lib/flot/jquery.flot.orderBars.min.js
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Flot plugin to order bars side by side.
|
||||
*
|
||||
* Released under the MIT license by Benjamin BUFFET, 20-Sep-2010.
|
||||
*
|
||||
* This plugin is an alpha version.
|
||||
*
|
||||
* To activate the plugin you must specify the parameter "order" for the specific serie :
|
||||
*
|
||||
* $.plot($("#placeholder"), [{ data: [ ... ], bars :{ order = null or integer }])
|
||||
*
|
||||
* If 2 series have the same order param, they are ordered by the position in the array;
|
||||
*
|
||||
* The plugin adjust the point by adding a value depanding of the barwidth
|
||||
* Exemple for 3 series (barwidth : 0.1) :
|
||||
*
|
||||
* first bar dĂŠcalage : -0.15
|
||||
* second bar dĂŠcalage : -0.05
|
||||
* third bar dĂŠcalage : 0.05
|
||||
*
|
||||
*/
|
||||
|
||||
(function(k){k.plot.plugins.push({init:function(k){function m(a,c){for(var d=[],b=0;b<a.length;b++)d[0]=a[b].data[0][c],d[1]=a[b].data[a[b].data.length-1][c];return d}function q(a,c){var d=a.bars.order,b=c.bars.order;return d<b?-1:d>b?1:0}function n(a,c,d){for(var b=0;c<=d;c++)b+=a[c].bars.barWidth+2*l;return b}var g,h,o,l,p=1,j=!1;k.hooks.processDatapoints.push(function(a,c,d){var b=null;if(null!=c.bars&&c.bars.show&&null!=c.bars.order){c.bars.horizontal&&(j=!0);var f=j?a.getPlaceholder().innerHeight(): a.getPlaceholder().innerWidth(),e=j?m(a.getData(),1):m(a.getData(),0);p=(e[1]-e[0])/f;a=a.getData();f=[];for(e=0;e<a.length;e++)null!=a[e].bars.order&&a[e].bars.show&&f.push(a[e]);g=f.sort(q);h=g.length;o=c.bars.lineWidth?c.bars.lineWidth:2;l=o*p;if(2<=h){for(a=b=0;a<g.length;++a)if(c==g[a]){b=a;break}b+=1;a=a=0;0!=h%2&&(a=g[Math.ceil(h/2)].bars.barWidth/2);for(var b=a=b<=Math.ceil(h/2)?-1*n(g,b-1,Math.floor(h/2)-1)-a:n(g,Math.ceil(h/2),b-2)+a+2*l,a=d.pointsize,f=d.points,e=0,i=j?1:0;i<f.length;i+= a)f[i]+=b,c.data[e][3]=f[i],e++;b=f;d.points=b}}return b})},options:{series:{bars:{order:null}}},name:"orderBars",version:"0.2"})})(jQuery);
|
||||
751
modules/lib/flot/jquery.flot.pie.js
Normal file
751
modules/lib/flot/jquery.flot.pie.js
Normal file
@ -0,0 +1,751 @@
|
||||
/*
|
||||
Flot plugin for rendering pie charts. The plugin assumes the data is
|
||||
coming is as a single data value for each series, and each of those
|
||||
values is a positive value or zero (negative numbers don't make
|
||||
any sense and will cause strange effects). The data values do
|
||||
NOT need to be passed in as percentage values because it
|
||||
internally calculates the total and percentages.
|
||||
|
||||
* Created by Brian Medendorp, June 2009
|
||||
* Updated November 2009 with contributions from: btburnett3, Anthony Aragues and Xavi Ivars
|
||||
|
||||
* Changes:
|
||||
2009-10-22: lineJoin set to round
|
||||
2009-10-23: IE full circle fix, donut
|
||||
2009-11-11: Added basic hover from btburnett3 - does not work in IE, and center is off in Chrome and Opera
|
||||
2009-11-17: Added IE hover capability submitted by Anthony Aragues
|
||||
2009-11-18: Added bug fix submitted by Xavi Ivars (issues with arrays when other JS libraries are included as well)
|
||||
|
||||
|
||||
Available options are:
|
||||
series: {
|
||||
pie: {
|
||||
show: true/false
|
||||
radius: 0-1 for percentage of fullsize, or a specified pixel length, or 'auto'
|
||||
innerRadius: 0-1 for percentage of fullsize or a specified pixel length, for creating a donut effect
|
||||
startAngle: 0-2 factor of PI used for starting angle (in radians) i.e 3/2 starts at the top, 0 and 2 have the same result
|
||||
tilt: 0-1 for percentage to tilt the pie, where 1 is no tilt, and 0 is completely flat (nothing will show)
|
||||
offset: {
|
||||
top: integer value to move the pie up or down
|
||||
left: integer value to move the pie left or right, or 'auto'
|
||||
},
|
||||
stroke: {
|
||||
color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#FFF')
|
||||
width: integer pixel width of the stroke
|
||||
},
|
||||
label: {
|
||||
show: true/false, or 'auto'
|
||||
formatter: a user-defined function that modifies the text/style of the label text
|
||||
radius: 0-1 for percentage of fullsize, or a specified pixel length
|
||||
background: {
|
||||
color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#000')
|
||||
opacity: 0-1
|
||||
},
|
||||
threshold: 0-1 for the percentage value at which to hide labels (if they're too small)
|
||||
},
|
||||
combine: {
|
||||
threshold: 0-1 for the percentage value at which to combine slices (if they're too small)
|
||||
color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#CCC'), if null, the plugin will automatically use the color of the first slice to be combined
|
||||
label: any text value of what the combined slice should be labeled
|
||||
}
|
||||
highlight: {
|
||||
opacity: 0-1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
More detail and specific examples can be found in the included HTML file.
|
||||
|
||||
*/
|
||||
|
||||
(function ($)
|
||||
{
|
||||
function init(plot) // this is the "body" of the plugin
|
||||
{
|
||||
var canvas = null;
|
||||
var target = null;
|
||||
var maxRadius = null;
|
||||
var centerLeft = null;
|
||||
var centerTop = null;
|
||||
var total = 0;
|
||||
var redraw = true;
|
||||
var redrawAttempts = 10;
|
||||
var shrink = 0.95;
|
||||
var legendWidth = 0;
|
||||
var processed = false;
|
||||
var raw = false;
|
||||
|
||||
// interactive variables
|
||||
var highlights = [];
|
||||
|
||||
// add hook to determine if pie plugin in enabled, and then perform necessary operations
|
||||
plot.hooks.processOptions.push(checkPieEnabled);
|
||||
plot.hooks.bindEvents.push(bindEvents);
|
||||
|
||||
// check to see if the pie plugin is enabled
|
||||
function checkPieEnabled(plot, options)
|
||||
{
|
||||
if (options.series.pie.show)
|
||||
{
|
||||
//disable grid
|
||||
options.grid.show = false;
|
||||
|
||||
// set labels.show
|
||||
if (options.series.pie.label.show=='auto')
|
||||
if (options.legend.show)
|
||||
options.series.pie.label.show = false;
|
||||
else
|
||||
options.series.pie.label.show = true;
|
||||
|
||||
// set radius
|
||||
if (options.series.pie.radius=='auto')
|
||||
if (options.series.pie.label.show)
|
||||
options.series.pie.radius = 3/4;
|
||||
else
|
||||
options.series.pie.radius = 1;
|
||||
|
||||
// ensure sane tilt
|
||||
if (options.series.pie.tilt>1)
|
||||
options.series.pie.tilt=1;
|
||||
if (options.series.pie.tilt<0)
|
||||
options.series.pie.tilt=0;
|
||||
|
||||
// add processData hook to do transformations on the data
|
||||
plot.hooks.processDatapoints.push(processDatapoints);
|
||||
plot.hooks.drawOverlay.push(drawOverlay);
|
||||
|
||||
// add draw hook
|
||||
plot.hooks.draw.push(draw);
|
||||
}
|
||||
}
|
||||
|
||||
// bind hoverable events
|
||||
function bindEvents(plot, eventHolder)
|
||||
{
|
||||
var options = plot.getOptions();
|
||||
|
||||
if (options.series.pie.show && options.grid.hoverable)
|
||||
eventHolder.unbind('mousemove').mousemove(onMouseMove);
|
||||
|
||||
if (options.series.pie.show && options.grid.clickable)
|
||||
eventHolder.unbind('click').click(onClick);
|
||||
}
|
||||
|
||||
|
||||
// debugging function that prints out an object
|
||||
function alertObject(obj)
|
||||
{
|
||||
var msg = '';
|
||||
function traverse(obj, depth)
|
||||
{
|
||||
if (!depth)
|
||||
depth = 0;
|
||||
for (var i = 0; i < obj.length; ++i)
|
||||
{
|
||||
for (var j=0; j<depth; j++)
|
||||
msg += '\t';
|
||||
|
||||
if( typeof obj[i] == "object")
|
||||
{ // its an object
|
||||
msg += ''+i+':\n';
|
||||
traverse(obj[i], depth+1);
|
||||
}
|
||||
else
|
||||
{ // its a value
|
||||
msg += ''+i+': '+obj[i]+'\n';
|
||||
}
|
||||
}
|
||||
}
|
||||
traverse(obj);
|
||||
alert(msg);
|
||||
}
|
||||
|
||||
function calcTotal(data)
|
||||
{
|
||||
for (var i = 0; i < data.length; ++i)
|
||||
{
|
||||
var item = parseFloat(data[i].data[0][1]);
|
||||
if (item)
|
||||
total += item;
|
||||
}
|
||||
}
|
||||
|
||||
function processDatapoints(plot, series, data, datapoints)
|
||||
{
|
||||
if (!processed)
|
||||
{
|
||||
processed = true;
|
||||
|
||||
canvas = plot.getCanvas();
|
||||
target = $(canvas).parent();
|
||||
options = plot.getOptions();
|
||||
|
||||
plot.setData(combine(plot.getData()));
|
||||
}
|
||||
}
|
||||
|
||||
function setupPie()
|
||||
{
|
||||
legendWidth = target.children().filter('.legend').children().width();
|
||||
|
||||
// calculate maximum radius and center point
|
||||
maxRadius = Math.min(canvas.width,(canvas.height/options.series.pie.tilt))/2;
|
||||
centerTop = (canvas.height/2)+options.series.pie.offset.top;
|
||||
centerLeft = (canvas.width/2);
|
||||
|
||||
if (options.series.pie.offset.left=='auto')
|
||||
if (options.legend.position.match('w'))
|
||||
centerLeft += legendWidth/2;
|
||||
else
|
||||
centerLeft -= legendWidth/2;
|
||||
else
|
||||
centerLeft += options.series.pie.offset.left;
|
||||
|
||||
if (centerLeft<maxRadius)
|
||||
centerLeft = maxRadius;
|
||||
else if (centerLeft>canvas.width-maxRadius)
|
||||
centerLeft = canvas.width-maxRadius;
|
||||
}
|
||||
|
||||
function fixData(data)
|
||||
{
|
||||
for (var i = 0; i < data.length; ++i)
|
||||
{
|
||||
if (typeof(data[i].data)=='number')
|
||||
data[i].data = [[1,data[i].data]];
|
||||
else if (typeof(data[i].data)=='undefined' || typeof(data[i].data[0])=='undefined')
|
||||
{
|
||||
if (typeof(data[i].data)!='undefined' && typeof(data[i].data.label)!='undefined')
|
||||
data[i].label = data[i].data.label; // fix weirdness coming from flot
|
||||
data[i].data = [[1,0]];
|
||||
|
||||
}
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
function combine(data)
|
||||
{
|
||||
data = fixData(data);
|
||||
calcTotal(data);
|
||||
var combined = 0;
|
||||
var numCombined = 0;
|
||||
var color = options.series.pie.combine.color;
|
||||
|
||||
var newdata = [];
|
||||
for (var i = 0; i < data.length; ++i)
|
||||
{
|
||||
// make sure its a number
|
||||
data[i].data[0][1] = parseFloat(data[i].data[0][1]);
|
||||
if (!data[i].data[0][1])
|
||||
data[i].data[0][1] = 0;
|
||||
|
||||
if (data[i].data[0][1]/total<=options.series.pie.combine.threshold)
|
||||
{
|
||||
combined += data[i].data[0][1];
|
||||
numCombined++;
|
||||
if (!color)
|
||||
color = data[i].color;
|
||||
}
|
||||
else
|
||||
{
|
||||
newdata.push({
|
||||
data: [[1,data[i].data[0][1]]],
|
||||
color: data[i].color,
|
||||
label: data[i].label,
|
||||
angle: (data[i].data[0][1]*(Math.PI*2))/total,
|
||||
percent: (data[i].data[0][1]/total*100)
|
||||
});
|
||||
}
|
||||
}
|
||||
if (numCombined>0)
|
||||
newdata.push({
|
||||
data: [[1,combined]],
|
||||
color: color,
|
||||
label: options.series.pie.combine.label,
|
||||
angle: (combined*(Math.PI*2))/total,
|
||||
percent: (combined/total*100)
|
||||
});
|
||||
return newdata;
|
||||
}
|
||||
|
||||
function draw(plot, newCtx)
|
||||
{
|
||||
if (!target) return; // if no series were passed
|
||||
ctx = newCtx;
|
||||
|
||||
setupPie();
|
||||
var slices = plot.getData();
|
||||
|
||||
var attempts = 0;
|
||||
redraw = true;
|
||||
while (redraw && attempts<redrawAttempts)
|
||||
{
|
||||
redraw = false;
|
||||
if (attempts>0)
|
||||
maxRadius *= shrink;
|
||||
attempts += 1;
|
||||
clear();
|
||||
if (options.series.pie.tilt<=0.8)
|
||||
drawShadow();
|
||||
drawPie();
|
||||
}
|
||||
if (attempts >= redrawAttempts) {
|
||||
clear();
|
||||
target.prepend('<div class="error">Could not draw pie with labels contained inside canvas</div>');
|
||||
}
|
||||
|
||||
if ( plot.setSeries && plot.insertLegend )
|
||||
{
|
||||
plot.setSeries(slices);
|
||||
plot.insertLegend();
|
||||
}
|
||||
|
||||
// we're actually done at this point, just defining internal functions at this point
|
||||
|
||||
function clear()
|
||||
{
|
||||
ctx.clearRect(0,0,canvas.width,canvas.height);
|
||||
target.children().filter('.pieLabel, .pieLabelBackground').remove();
|
||||
}
|
||||
|
||||
function drawShadow()
|
||||
{
|
||||
var shadowLeft = 5;
|
||||
var shadowTop = 15;
|
||||
var edge = 10;
|
||||
var alpha = 0.02;
|
||||
|
||||
// set radius
|
||||
if (options.series.pie.radius>1)
|
||||
var radius = options.series.pie.radius;
|
||||
else
|
||||
var radius = maxRadius * options.series.pie.radius;
|
||||
|
||||
if (radius>=(canvas.width/2)-shadowLeft || radius*options.series.pie.tilt>=(canvas.height/2)-shadowTop || radius<=edge)
|
||||
return; // shadow would be outside canvas, so don't draw it
|
||||
|
||||
ctx.save();
|
||||
ctx.translate(shadowLeft,shadowTop);
|
||||
ctx.globalAlpha = alpha;
|
||||
ctx.fillStyle = '#000';
|
||||
|
||||
// center and rotate to starting position
|
||||
ctx.translate(centerLeft,centerTop);
|
||||
ctx.scale(1, options.series.pie.tilt);
|
||||
|
||||
//radius -= edge;
|
||||
for (var i=1; i<=edge; i++)
|
||||
{
|
||||
ctx.beginPath();
|
||||
ctx.arc(0,0,radius,0,Math.PI*2,false);
|
||||
ctx.fill();
|
||||
radius -= i;
|
||||
}
|
||||
|
||||
ctx.restore();
|
||||
}
|
||||
|
||||
function drawPie()
|
||||
{
|
||||
startAngle = Math.PI*options.series.pie.startAngle;
|
||||
|
||||
// set radius
|
||||
if (options.series.pie.radius>1)
|
||||
var radius = options.series.pie.radius;
|
||||
else
|
||||
var radius = maxRadius * options.series.pie.radius;
|
||||
|
||||
// center and rotate to starting position
|
||||
ctx.save();
|
||||
ctx.translate(centerLeft,centerTop);
|
||||
ctx.scale(1, options.series.pie.tilt);
|
||||
//ctx.rotate(startAngle); // start at top; -- This doesn't work properly in Opera
|
||||
|
||||
// draw slices
|
||||
ctx.save();
|
||||
var currentAngle = startAngle;
|
||||
for (var i = 0; i < slices.length; ++i)
|
||||
{
|
||||
slices[i].startAngle = currentAngle;
|
||||
drawSlice(slices[i].angle, slices[i].color, true);
|
||||
}
|
||||
ctx.restore();
|
||||
|
||||
// draw slice outlines
|
||||
ctx.save();
|
||||
ctx.lineWidth = options.series.pie.stroke.width;
|
||||
currentAngle = startAngle;
|
||||
for (var i = 0; i < slices.length; ++i)
|
||||
drawSlice(slices[i].angle, options.series.pie.stroke.color, false);
|
||||
ctx.restore();
|
||||
|
||||
// draw donut hole
|
||||
drawDonutHole(ctx);
|
||||
|
||||
// draw labels
|
||||
if (options.series.pie.label.show)
|
||||
drawLabels();
|
||||
|
||||
// restore to original state
|
||||
ctx.restore();
|
||||
|
||||
function drawSlice(angle, color, fill)
|
||||
{
|
||||
if (angle<=0)
|
||||
return;
|
||||
|
||||
if (fill)
|
||||
ctx.fillStyle = color;
|
||||
else
|
||||
{
|
||||
ctx.strokeStyle = color;
|
||||
ctx.lineJoin = 'round';
|
||||
}
|
||||
|
||||
ctx.beginPath();
|
||||
if (Math.abs(angle - Math.PI*2) > 0.000000001)
|
||||
ctx.moveTo(0,0); // Center of the pie
|
||||
else if ($.browser.msie)
|
||||
angle -= 0.0001;
|
||||
//ctx.arc(0,0,radius,0,angle,false); // This doesn't work properly in Opera
|
||||
ctx.arc(0,0,radius,currentAngle,currentAngle+angle,false);
|
||||
ctx.closePath();
|
||||
//ctx.rotate(angle); // This doesn't work properly in Opera
|
||||
currentAngle += angle;
|
||||
|
||||
if (fill)
|
||||
ctx.fill();
|
||||
else
|
||||
ctx.stroke();
|
||||
}
|
||||
|
||||
function drawLabels()
|
||||
{
|
||||
var currentAngle = startAngle;
|
||||
|
||||
// set radius
|
||||
if (options.series.pie.label.radius>1)
|
||||
var radius = options.series.pie.label.radius;
|
||||
else
|
||||
var radius = maxRadius * options.series.pie.label.radius;
|
||||
|
||||
for (var i = 0; i < slices.length; ++i)
|
||||
{
|
||||
if (slices[i].percent >= options.series.pie.label.threshold*100)
|
||||
drawLabel(slices[i], currentAngle, i);
|
||||
currentAngle += slices[i].angle;
|
||||
}
|
||||
|
||||
function drawLabel(slice, startAngle, index)
|
||||
{
|
||||
if (slice.data[0][1]==0)
|
||||
return;
|
||||
|
||||
// format label text
|
||||
var lf = options.legend.labelFormatter, text, plf = options.series.pie.label.formatter;
|
||||
if (lf)
|
||||
text = lf(slice.label, slice);
|
||||
else
|
||||
text = slice.label;
|
||||
if (plf)
|
||||
text = plf(text, slice);
|
||||
|
||||
var halfAngle = ((startAngle+slice.angle) + startAngle)/2;
|
||||
var x = centerLeft + Math.round(Math.cos(halfAngle) * radius);
|
||||
var y = centerTop + Math.round(Math.sin(halfAngle) * radius) * options.series.pie.tilt;
|
||||
|
||||
var html = '<span class="pieLabel" id="pieLabel'+index+'" style="position:absolute;top:' + y + 'px;left:' + x + 'px;">' + text + "</span>";
|
||||
target.append(html);
|
||||
var label = target.children('#pieLabel'+index);
|
||||
var labelTop = (y - label.height()/2);
|
||||
var labelLeft = (x - label.width()/2);
|
||||
label.css('top', labelTop);
|
||||
label.css('left', labelLeft);
|
||||
|
||||
// check to make sure that the label is not outside the canvas
|
||||
if (0-labelTop>0 || 0-labelLeft>0 || canvas.height-(labelTop+label.height())<0 || canvas.width-(labelLeft+label.width())<0)
|
||||
redraw = true;
|
||||
|
||||
if (options.series.pie.label.background.opacity != 0) {
|
||||
// put in the transparent background separately to avoid blended labels and label boxes
|
||||
var c = options.series.pie.label.background.color;
|
||||
if (c == null) {
|
||||
c = slice.color;
|
||||
}
|
||||
var pos = 'top:'+labelTop+'px;left:'+labelLeft+'px;';
|
||||
$('<div class="pieLabelBackground" style="position:absolute;width:' + label.width() + 'px;height:' + label.height() + 'px;' + pos +'background-color:' + c + ';"> </div>').insertBefore(label).css('opacity', options.series.pie.label.background.opacity);
|
||||
}
|
||||
} // end individual label function
|
||||
} // end drawLabels function
|
||||
} // end drawPie function
|
||||
} // end draw function
|
||||
|
||||
// Placed here because it needs to be accessed from multiple locations
|
||||
function drawDonutHole(layer)
|
||||
{
|
||||
// draw donut hole
|
||||
if(options.series.pie.innerRadius > 0)
|
||||
{
|
||||
// subtract the center
|
||||
layer.save();
|
||||
innerRadius = options.series.pie.innerRadius > 1 ? options.series.pie.innerRadius : maxRadius * options.series.pie.innerRadius;
|
||||
layer.globalCompositeOperation = 'destination-out'; // this does not work with excanvas, but it will fall back to using the stroke color
|
||||
layer.beginPath();
|
||||
layer.fillStyle = options.series.pie.stroke.color;
|
||||
layer.arc(0,0,innerRadius,0,Math.PI*2,false);
|
||||
layer.fill();
|
||||
layer.closePath();
|
||||
layer.restore();
|
||||
|
||||
// add inner stroke
|
||||
layer.save();
|
||||
layer.beginPath();
|
||||
layer.strokeStyle = options.series.pie.stroke.color;
|
||||
layer.arc(0,0,innerRadius,0,Math.PI*2,false);
|
||||
layer.stroke();
|
||||
layer.closePath();
|
||||
layer.restore();
|
||||
// TODO: add extra shadow inside hole (with a mask) if the pie is tilted.
|
||||
}
|
||||
}
|
||||
|
||||
//-- Additional Interactive related functions --
|
||||
|
||||
function isPointInPoly(poly, pt)
|
||||
{
|
||||
for(var c = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i)
|
||||
((poly[i][1] <= pt[1] && pt[1] < poly[j][1]) || (poly[j][1] <= pt[1] && pt[1]< poly[i][1]))
|
||||
&& (pt[0] < (poly[j][0] - poly[i][0]) * (pt[1] - poly[i][1]) / (poly[j][1] - poly[i][1]) + poly[i][0])
|
||||
&& (c = !c);
|
||||
return c;
|
||||
}
|
||||
|
||||
function findNearbySlice(mouseX, mouseY)
|
||||
{
|
||||
var slices = plot.getData(),
|
||||
options = plot.getOptions(),
|
||||
radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
|
||||
|
||||
for (var i = 0; i < slices.length; ++i)
|
||||
{
|
||||
var s = slices[i];
|
||||
|
||||
if(s.pie.show)
|
||||
{
|
||||
ctx.save();
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0,0); // Center of the pie
|
||||
//ctx.scale(1, options.series.pie.tilt); // this actually seems to break everything when here.
|
||||
ctx.arc(0,0,radius,s.startAngle,s.startAngle+s.angle,false);
|
||||
ctx.closePath();
|
||||
x = mouseX-centerLeft;
|
||||
y = mouseY-centerTop;
|
||||
if(ctx.isPointInPath)
|
||||
{
|
||||
if (ctx.isPointInPath(mouseX-centerLeft, mouseY-centerTop))
|
||||
{
|
||||
//alert('found slice!');
|
||||
ctx.restore();
|
||||
return {datapoint: [s.percent, s.data], dataIndex: 0, series: s, seriesIndex: i};
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// excanvas for IE doesn;t support isPointInPath, this is a workaround.
|
||||
p1X = (radius * Math.cos(s.startAngle));
|
||||
p1Y = (radius * Math.sin(s.startAngle));
|
||||
p2X = (radius * Math.cos(s.startAngle+(s.angle/4)));
|
||||
p2Y = (radius * Math.sin(s.startAngle+(s.angle/4)));
|
||||
p3X = (radius * Math.cos(s.startAngle+(s.angle/2)));
|
||||
p3Y = (radius * Math.sin(s.startAngle+(s.angle/2)));
|
||||
p4X = (radius * Math.cos(s.startAngle+(s.angle/1.5)));
|
||||
p4Y = (radius * Math.sin(s.startAngle+(s.angle/1.5)));
|
||||
p5X = (radius * Math.cos(s.startAngle+s.angle));
|
||||
p5Y = (radius * Math.sin(s.startAngle+s.angle));
|
||||
arrPoly = [[0,0],[p1X,p1Y],[p2X,p2Y],[p3X,p3Y],[p4X,p4Y],[p5X,p5Y]];
|
||||
arrPoint = [x,y];
|
||||
// TODO: perhaps do some mathmatical trickery here with the Y-coordinate to compensate for pie tilt?
|
||||
if(isPointInPoly(arrPoly, arrPoint))
|
||||
{
|
||||
ctx.restore();
|
||||
return {datapoint: [s.percent, s.data], dataIndex: 0, series: s, seriesIndex: i};
|
||||
}
|
||||
}
|
||||
ctx.restore();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function onMouseMove(e)
|
||||
{
|
||||
triggerClickHoverEvent('plothover', e);
|
||||
}
|
||||
|
||||
function onClick(e)
|
||||
{
|
||||
triggerClickHoverEvent('plotclick', e);
|
||||
}
|
||||
|
||||
// trigger click or hover event (they send the same parameters so we share their code)
|
||||
function triggerClickHoverEvent(eventname, e)
|
||||
{
|
||||
var offset = plot.offset(),
|
||||
canvasX = parseInt(e.pageX - offset.left),
|
||||
canvasY = parseInt(e.pageY - offset.top),
|
||||
item = findNearbySlice(canvasX, canvasY);
|
||||
|
||||
if (options.grid.autoHighlight)
|
||||
{
|
||||
// clear auto-highlights
|
||||
for (var i = 0; i < highlights.length; ++i)
|
||||
{
|
||||
var h = highlights[i];
|
||||
if (h.auto == eventname && !(item && h.series == item.series))
|
||||
unhighlight(h.series);
|
||||
}
|
||||
}
|
||||
|
||||
// highlight the slice
|
||||
if (item)
|
||||
highlight(item.series, eventname);
|
||||
|
||||
// trigger any hover bind events
|
||||
var pos = { pageX: e.pageX, pageY: e.pageY };
|
||||
target.trigger(eventname, [ pos, item ]);
|
||||
}
|
||||
|
||||
function highlight(s, auto)
|
||||
{
|
||||
if (typeof s == "number")
|
||||
s = series[s];
|
||||
|
||||
var i = indexOfHighlight(s);
|
||||
if (i == -1)
|
||||
{
|
||||
highlights.push({ series: s, auto: auto });
|
||||
plot.triggerRedrawOverlay();
|
||||
}
|
||||
else if (!auto)
|
||||
highlights[i].auto = false;
|
||||
}
|
||||
|
||||
function unhighlight(s)
|
||||
{
|
||||
if (s == null)
|
||||
{
|
||||
highlights = [];
|
||||
plot.triggerRedrawOverlay();
|
||||
}
|
||||
|
||||
if (typeof s == "number")
|
||||
s = series[s];
|
||||
|
||||
var i = indexOfHighlight(s);
|
||||
if (i != -1)
|
||||
{
|
||||
highlights.splice(i, 1);
|
||||
plot.triggerRedrawOverlay();
|
||||
}
|
||||
}
|
||||
|
||||
function indexOfHighlight(s)
|
||||
{
|
||||
for (var i = 0; i < highlights.length; ++i)
|
||||
{
|
||||
var h = highlights[i];
|
||||
if (h.series == s)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
function drawOverlay(plot, octx)
|
||||
{
|
||||
//alert(options.series.pie.radius);
|
||||
var options = plot.getOptions();
|
||||
//alert(options.series.pie.radius);
|
||||
|
||||
var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
|
||||
|
||||
octx.save();
|
||||
octx.translate(centerLeft, centerTop);
|
||||
octx.scale(1, options.series.pie.tilt);
|
||||
|
||||
for (i = 0; i < highlights.length; ++i)
|
||||
drawHighlight(highlights[i].series);
|
||||
|
||||
drawDonutHole(octx);
|
||||
|
||||
octx.restore();
|
||||
|
||||
function drawHighlight(series)
|
||||
{
|
||||
if (series.angle < 0) return;
|
||||
|
||||
//octx.fillStyle = parseColor(options.series.pie.highlight.color).scale(null, null, null, options.series.pie.highlight.opacity).toString();
|
||||
octx.fillStyle = "rgba(255, 255, 255, "+options.series.pie.highlight.opacity+")"; // this is temporary until we have access to parseColor
|
||||
|
||||
octx.beginPath();
|
||||
if (Math.abs(series.angle - Math.PI*2) > 0.000000001)
|
||||
octx.moveTo(0,0); // Center of the pie
|
||||
octx.arc(0,0,radius,series.startAngle,series.startAngle+series.angle,false);
|
||||
octx.closePath();
|
||||
octx.fill();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} // end init (plugin body)
|
||||
|
||||
// define pie specific options and their default values
|
||||
var options = {
|
||||
series: {
|
||||
pie: {
|
||||
show: false,
|
||||
radius: 'auto', // actual radius of the visible pie (based on full calculated radius if <=1, or hard pixel value)
|
||||
innerRadius:0, /* for donut */
|
||||
startAngle: 3/2,
|
||||
tilt: 1,
|
||||
offset: {
|
||||
top: 0,
|
||||
left: 'auto'
|
||||
},
|
||||
stroke: {
|
||||
color: '#FFF',
|
||||
width: 1
|
||||
},
|
||||
label: {
|
||||
show: 'auto',
|
||||
formatter: function(label, slice){
|
||||
return '<div style="font-size:x-small;text-align:center;padding:2px;color:'+slice.color+';">'+label+'<br/>'+Math.round(slice.percent)+'%</div>';
|
||||
}, // formatter function
|
||||
radius: 1, // radius at which to place the labels (based on full calculated radius if <=1, or hard pixel value)
|
||||
background: {
|
||||
color: null,
|
||||
opacity: 0
|
||||
},
|
||||
threshold: 0 // percentage at which to hide the label (i.e. the slice is too narrow)
|
||||
},
|
||||
combine: {
|
||||
threshold: -1, // percentage at which to combine little slices into one larger slice
|
||||
color: null, // color to give the new slice (auto-generated if null)
|
||||
label: 'Other' // label to give the new slice
|
||||
},
|
||||
highlight: {
|
||||
//color: '#FFF', // will add this functionality once parseColor is available
|
||||
opacity: 0.5
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: "pie",
|
||||
version: "1.0"
|
||||
});
|
||||
})(jQuery);
|
||||
1
modules/lib/flot/jquery.flot.pie.min.js
vendored
Normal file
1
modules/lib/flot/jquery.flot.pie.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
12
modules/lib/flot/jquery.flot.pyramid.min.js
vendored
Normal file
12
modules/lib/flot/jquery.flot.pyramid.min.js
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
//
|
||||
// This is a plugin for drawing [population pyramids](http://en.wikipedia.org/wiki/Population_pyramid) with
|
||||
// [flot](http://code.google.com/p/flot/).
|
||||
//
|
||||
// Ok, let's wrap everything in a warm, secure closure.
|
||||
//
|
||||
// Copyright (c) 2011 Asís García Chao
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
var FlotPyramid=function(){function o(a){for(var b=0,c=a.length;b<c;b+=1)a[b][0]=b}function n(a,b){var c,d;d=$.map(b,function(a){return a[1]}),c=$.map(a,function(a){return a[0]});return d.toString()==c.toString()}function m(a,b){return b.length==a.length}function l(b,c){if(!m(b,c)||!n(b,c))throw a}function k(a,b){var c,d;for(c=0,d=a.length;c<d;c+=1)b.push([c,a[c][0]])}function j(a,b){b.length==0?k(a,b):l(a,b),o(a)}function i(a){var c=a.pyramid.direction;if(c&&!c.match(/L|W|R|E/))throw b}function h(a,b){function g(a,b){return a.reduce(function(a,c,d,e){return b(a,c)})}var c,d=a.xaxes[0].max||0,e=b.data,f;i(b),f=e.map(function(a){return a[1]}),c=g(f,Math.max),a.xaxes[0].max=Math.max(c,d),a.xaxes[0].min=-a.xaxes[0].max}function g(a){return function(b,c){b=b<0?-b:b;return a?a(b,c):b}}function f(a,b,c){var d=[],e=c.points,f=(b.pyramid.direction||"R").match(/L|W/)?-1:1;for(var g=0,h=e.length;g<h;g+=c.format.length)d.push(e[g+1]*f),d.push(e[g]),d.push(e[g+2]);c.points=d}function e(a,b,c){b.data=$.extend(!0,[],b.data),j(b.data,a.pyramidYaxisTicks),h(a.getOptions(),b)}function d(a,b){a.pyramidYaxisTicks=[];if(b.series.pyramid&&b.series.pyramid.show){$.extend(b.series.bars,{show:!0,horizontal:!0,align:"center",barWidth:b.series.pyramid.barWidth||.6});var c=b.xaxes[b.series.xaxis-1||0];$.extend(c,{tickFormatter:g(c.tickFormatter)});var d=b.yaxes[b.series.yaxis-1||0];$.extend(d,{ticks:a.pyramidYaxisTicks}),a.hooks.processRawData.push(e),a.hooks.processDatapoints.push(f)}}function c(a){a.hooks.processOptions.push(d)}var a={plugin:"flot.pyramid",msg:"Invalid series for pyramid plot! The supplied data must have exactly the same labels!"},b={plugin:"flot.pyramid",msg:"Invalid direction specified for pyramid series. Use 'L' or 'W' for left, or 'R' or 'E' for right (default is right)"};return{init:c,InvalidDirection:b,InvalidData:a}}();(function(a){a.plot.plugins.push({init:FlotPyramid.init,name:"pyramid",version:"1.0.1"})})(jQuery)
|
||||
60
modules/lib/flot/jquery.flot.resize.js
Normal file
60
modules/lib/flot/jquery.flot.resize.js
Normal file
@ -0,0 +1,60 @@
|
||||
/*
|
||||
Flot plugin for automatically redrawing plots when the placeholder
|
||||
size changes, e.g. on window resizes.
|
||||
|
||||
It works by listening for changes on the placeholder div (through the
|
||||
jQuery resize event plugin) - if the size changes, it will redraw the
|
||||
plot.
|
||||
|
||||
There are no options. If you need to disable the plugin for some
|
||||
plots, you can just fix the size of their placeholders.
|
||||
*/
|
||||
|
||||
|
||||
/* Inline dependency:
|
||||
* jQuery resize event - v1.1 - 3/14/2010
|
||||
* http://benalman.com/projects/jquery-resize-plugin/
|
||||
*
|
||||
* Copyright (c) 2010 "Cowboy" Ben Alman
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
* http://benalman.com/about/license/
|
||||
*/
|
||||
(function($,h,c){var a=$([]),e=$.resize=$.extend($.resize,{}),i,k="setTimeout",j="resize",d=j+"-special-event",b="delay",f="throttleWindow";e[b]=250;e[f]=true;$.event.special[j]={setup:function(){if(!e[f]&&this[k]){return false}var l=$(this);a=a.add(l);$.data(this,d,{w:l.width(),h:l.height()});if(a.length===1){g()}},teardown:function(){if(!e[f]&&this[k]){return false}var l=$(this);a=a.not(l);l.removeData(d);if(!a.length){clearTimeout(i)}},add:function(l){if(!e[f]&&this[k]){return false}var n;function m(s,o,p){var q=$(this),r=$.data(this,d);r.w=o!==c?o:q.width();r.h=p!==c?p:q.height();n.apply(this,arguments)}if($.isFunction(l)){n=l;return m}else{n=l.handler;l.handler=m}}};function g(){i=h[k](function(){a.each(function(){var n=$(this),m=n.width(),l=n.height(),o=$.data(this,d);if(m!==o.w||l!==o.h){n.trigger(j,[o.w=m,o.h=l])}});g()},e[b])}})(jQuery,this);
|
||||
|
||||
|
||||
(function ($) {
|
||||
var options = { }; // no options
|
||||
|
||||
function init(plot) {
|
||||
function onResize() {
|
||||
var placeholder = plot.getPlaceholder();
|
||||
|
||||
// somebody might have hidden us and we can't plot
|
||||
// when we don't have the dimensions
|
||||
if (placeholder.width() == 0 || placeholder.height() == 0)
|
||||
return;
|
||||
|
||||
plot.resize();
|
||||
plot.setupGrid();
|
||||
plot.draw();
|
||||
}
|
||||
|
||||
function bindEvents(plot, eventHolder) {
|
||||
plot.getPlaceholder().resize(onResize);
|
||||
}
|
||||
|
||||
function shutdown(plot, eventHolder) {
|
||||
plot.getPlaceholder().unbind("resize", onResize);
|
||||
}
|
||||
|
||||
plot.hooks.bindEvents.push(bindEvents);
|
||||
plot.hooks.shutdown.push(shutdown);
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'resize',
|
||||
version: '1.0'
|
||||
});
|
||||
})(jQuery);
|
||||
1
modules/lib/flot/jquery.flot.resize.min.js
vendored
Normal file
1
modules/lib/flot/jquery.flot.resize.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
(function(n,p,u){var w=n([]),s=n.resize=n.extend(n.resize,{}),o,l="setTimeout",m="resize",t=m+"-special-event",v="delay",r="throttleWindow";s[v]=250;s[r]=true;n.event.special[m]={setup:function(){if(!s[r]&&this[l]){return false}var a=n(this);w=w.add(a);n.data(this,t,{w:a.width(),h:a.height()});if(w.length===1){q()}},teardown:function(){if(!s[r]&&this[l]){return false}var a=n(this);w=w.not(a);a.removeData(t);if(!w.length){clearTimeout(o)}},add:function(b){if(!s[r]&&this[l]){return false}var c;function a(d,h,g){var f=n(this),e=n.data(this,t);e.w=h!==u?h:f.width();e.h=g!==u?g:f.height();c.apply(this,arguments)}if(n.isFunction(b)){c=b;return a}else{c=b.handler;b.handler=a}}};function q(){o=p[l](function(){w.each(function(){var d=n(this),a=d.width(),b=d.height(),c=n.data(this,t);if(a!==c.w||b!==c.h){d.trigger(m,[c.w=a,c.h=b])}});q()},s[v])}})(jQuery,this);(function(b){var a={};function c(f){function e(){var h=f.getPlaceholder();if(h.width()==0||h.height()==0){return}f.resize();f.setupGrid();f.draw()}function g(i,h){i.getPlaceholder().resize(e)}function d(i,h){i.getPlaceholder().unbind("resize",e)}f.hooks.bindEvents.push(g);f.hooks.shutdown.push(d)}b.plot.plugins.push({init:c,options:a,name:"resize",version:"1.0"})})(jQuery);
|
||||
344
modules/lib/flot/jquery.flot.selection.js
Normal file
344
modules/lib/flot/jquery.flot.selection.js
Normal file
@ -0,0 +1,344 @@
|
||||
/*
|
||||
Flot plugin for selecting regions.
|
||||
|
||||
The plugin defines the following options:
|
||||
|
||||
selection: {
|
||||
mode: null or "x" or "y" or "xy",
|
||||
color: color
|
||||
}
|
||||
|
||||
Selection support is enabled by setting the mode to one of "x", "y" or
|
||||
"xy". In "x" mode, the user will only be able to specify the x range,
|
||||
similarly for "y" mode. For "xy", the selection becomes a rectangle
|
||||
where both ranges can be specified. "color" is color of the selection
|
||||
(if you need to change the color later on, you can get to it with
|
||||
plot.getOptions().selection.color).
|
||||
|
||||
When selection support is enabled, a "plotselected" event will be
|
||||
emitted on the DOM element you passed into the plot function. The
|
||||
event handler gets a parameter with the ranges selected on the axes,
|
||||
like this:
|
||||
|
||||
placeholder.bind("plotselected", function(event, ranges) {
|
||||
alert("You selected " + ranges.xaxis.from + " to " + ranges.xaxis.to)
|
||||
// similar for yaxis - with multiple axes, the extra ones are in
|
||||
// x2axis, x3axis, ...
|
||||
});
|
||||
|
||||
The "plotselected" event is only fired when the user has finished
|
||||
making the selection. A "plotselecting" event is fired during the
|
||||
process with the same parameters as the "plotselected" event, in case
|
||||
you want to know what's happening while it's happening,
|
||||
|
||||
A "plotunselected" event with no arguments is emitted when the user
|
||||
clicks the mouse to remove the selection.
|
||||
|
||||
The plugin allso adds the following methods to the plot object:
|
||||
|
||||
- setSelection(ranges, preventEvent)
|
||||
|
||||
Set the selection rectangle. The passed in ranges is on the same
|
||||
form as returned in the "plotselected" event. If the selection mode
|
||||
is "x", you should put in either an xaxis range, if the mode is "y"
|
||||
you need to put in an yaxis range and both xaxis and yaxis if the
|
||||
selection mode is "xy", like this:
|
||||
|
||||
setSelection({ xaxis: { from: 0, to: 10 }, yaxis: { from: 40, to: 60 } });
|
||||
|
||||
setSelection will trigger the "plotselected" event when called. If
|
||||
you don't want that to happen, e.g. if you're inside a
|
||||
"plotselected" handler, pass true as the second parameter. If you
|
||||
are using multiple axes, you can specify the ranges on any of those,
|
||||
e.g. as x2axis/x3axis/... instead of xaxis, the plugin picks the
|
||||
first one it sees.
|
||||
|
||||
- clearSelection(preventEvent)
|
||||
|
||||
Clear the selection rectangle. Pass in true to avoid getting a
|
||||
"plotunselected" event.
|
||||
|
||||
- getSelection()
|
||||
|
||||
Returns the current selection in the same format as the
|
||||
"plotselected" event. If there's currently no selection, the
|
||||
function returns null.
|
||||
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
function init(plot) {
|
||||
var selection = {
|
||||
first: { x: -1, y: -1}, second: { x: -1, y: -1},
|
||||
show: false,
|
||||
active: false
|
||||
};
|
||||
|
||||
// FIXME: The drag handling implemented here should be
|
||||
// abstracted out, there's some similar code from a library in
|
||||
// the navigation plugin, this should be massaged a bit to fit
|
||||
// the Flot cases here better and reused. Doing this would
|
||||
// make this plugin much slimmer.
|
||||
var savedhandlers = {};
|
||||
|
||||
var mouseUpHandler = null;
|
||||
|
||||
function onMouseMove(e) {
|
||||
if (selection.active) {
|
||||
updateSelection(e);
|
||||
|
||||
plot.getPlaceholder().trigger("plotselecting", [ getSelection() ]);
|
||||
}
|
||||
}
|
||||
|
||||
function onMouseDown(e) {
|
||||
if (e.which != 1) // only accept left-click
|
||||
return;
|
||||
|
||||
// cancel out any text selections
|
||||
document.body.focus();
|
||||
|
||||
// prevent text selection and drag in old-school browsers
|
||||
if (document.onselectstart !== undefined && savedhandlers.onselectstart == null) {
|
||||
savedhandlers.onselectstart = document.onselectstart;
|
||||
document.onselectstart = function () { return false; };
|
||||
}
|
||||
if (document.ondrag !== undefined && savedhandlers.ondrag == null) {
|
||||
savedhandlers.ondrag = document.ondrag;
|
||||
document.ondrag = function () { return false; };
|
||||
}
|
||||
|
||||
setSelectionPos(selection.first, e);
|
||||
|
||||
selection.active = true;
|
||||
|
||||
// this is a bit silly, but we have to use a closure to be
|
||||
// able to whack the same handler again
|
||||
mouseUpHandler = function (e) { onMouseUp(e); };
|
||||
|
||||
$(document).one("mouseup", mouseUpHandler);
|
||||
}
|
||||
|
||||
function onMouseUp(e) {
|
||||
mouseUpHandler = null;
|
||||
|
||||
// revert drag stuff for old-school browsers
|
||||
if (document.onselectstart !== undefined)
|
||||
document.onselectstart = savedhandlers.onselectstart;
|
||||
if (document.ondrag !== undefined)
|
||||
document.ondrag = savedhandlers.ondrag;
|
||||
|
||||
// no more dragging
|
||||
selection.active = false;
|
||||
updateSelection(e);
|
||||
|
||||
if (selectionIsSane())
|
||||
triggerSelectedEvent();
|
||||
else {
|
||||
// this counts as a clear
|
||||
plot.getPlaceholder().trigger("plotunselected", [ ]);
|
||||
plot.getPlaceholder().trigger("plotselecting", [ null ]);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function getSelection() {
|
||||
if (!selectionIsSane())
|
||||
return null;
|
||||
|
||||
var r = {}, c1 = selection.first, c2 = selection.second;
|
||||
$.each(plot.getAxes(), function (name, axis) {
|
||||
if (axis.used) {
|
||||
var p1 = axis.c2p(c1[axis.direction]), p2 = axis.c2p(c2[axis.direction]);
|
||||
r[name] = { from: Math.min(p1, p2), to: Math.max(p1, p2) };
|
||||
}
|
||||
});
|
||||
return r;
|
||||
}
|
||||
|
||||
function triggerSelectedEvent() {
|
||||
var r = getSelection();
|
||||
|
||||
plot.getPlaceholder().trigger("plotselected", [ r ]);
|
||||
|
||||
// backwards-compat stuff, to be removed in future
|
||||
if (r.xaxis && r.yaxis)
|
||||
plot.getPlaceholder().trigger("selected", [ { x1: r.xaxis.from, y1: r.yaxis.from, x2: r.xaxis.to, y2: r.yaxis.to } ]);
|
||||
}
|
||||
|
||||
function clamp(min, value, max) {
|
||||
return value < min ? min: (value > max ? max: value);
|
||||
}
|
||||
|
||||
function setSelectionPos(pos, e) {
|
||||
var o = plot.getOptions();
|
||||
var offset = plot.getPlaceholder().offset();
|
||||
var plotOffset = plot.getPlotOffset();
|
||||
pos.x = clamp(0, e.pageX - offset.left - plotOffset.left, plot.width());
|
||||
pos.y = clamp(0, e.pageY - offset.top - plotOffset.top, plot.height());
|
||||
|
||||
if (o.selection.mode == "y")
|
||||
pos.x = pos == selection.first ? 0 : plot.width();
|
||||
|
||||
if (o.selection.mode == "x")
|
||||
pos.y = pos == selection.first ? 0 : plot.height();
|
||||
}
|
||||
|
||||
function updateSelection(pos) {
|
||||
if (pos.pageX == null)
|
||||
return;
|
||||
|
||||
setSelectionPos(selection.second, pos);
|
||||
if (selectionIsSane()) {
|
||||
selection.show = true;
|
||||
plot.triggerRedrawOverlay();
|
||||
}
|
||||
else
|
||||
clearSelection(true);
|
||||
}
|
||||
|
||||
function clearSelection(preventEvent) {
|
||||
if (selection.show) {
|
||||
selection.show = false;
|
||||
plot.triggerRedrawOverlay();
|
||||
if (!preventEvent)
|
||||
plot.getPlaceholder().trigger("plotunselected", [ ]);
|
||||
}
|
||||
}
|
||||
|
||||
// function taken from markings support in Flot
|
||||
function extractRange(ranges, coord) {
|
||||
var axis, from, to, key, axes = plot.getAxes();
|
||||
|
||||
for (var k in axes) {
|
||||
axis = axes[k];
|
||||
if (axis.direction == coord) {
|
||||
key = coord + axis.n + "axis";
|
||||
if (!ranges[key] && axis.n == 1)
|
||||
key = coord + "axis"; // support x1axis as xaxis
|
||||
if (ranges[key]) {
|
||||
from = ranges[key].from;
|
||||
to = ranges[key].to;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// backwards-compat stuff - to be removed in future
|
||||
if (!ranges[key]) {
|
||||
axis = coord == "x" ? plot.getXAxes()[0] : plot.getYAxes()[0];
|
||||
from = ranges[coord + "1"];
|
||||
to = ranges[coord + "2"];
|
||||
}
|
||||
|
||||
// auto-reverse as an added bonus
|
||||
if (from != null && to != null && from > to) {
|
||||
var tmp = from;
|
||||
from = to;
|
||||
to = tmp;
|
||||
}
|
||||
|
||||
return { from: from, to: to, axis: axis };
|
||||
}
|
||||
|
||||
function setSelection(ranges, preventEvent) {
|
||||
var axis, range, o = plot.getOptions();
|
||||
|
||||
if (o.selection.mode == "y") {
|
||||
selection.first.x = 0;
|
||||
selection.second.x = plot.width();
|
||||
}
|
||||
else {
|
||||
range = extractRange(ranges, "x");
|
||||
|
||||
selection.first.x = range.axis.p2c(range.from);
|
||||
selection.second.x = range.axis.p2c(range.to);
|
||||
}
|
||||
|
||||
if (o.selection.mode == "x") {
|
||||
selection.first.y = 0;
|
||||
selection.second.y = plot.height();
|
||||
}
|
||||
else {
|
||||
range = extractRange(ranges, "y");
|
||||
|
||||
selection.first.y = range.axis.p2c(range.from);
|
||||
selection.second.y = range.axis.p2c(range.to);
|
||||
}
|
||||
|
||||
selection.show = true;
|
||||
plot.triggerRedrawOverlay();
|
||||
if (!preventEvent && selectionIsSane())
|
||||
triggerSelectedEvent();
|
||||
}
|
||||
|
||||
function selectionIsSane() {
|
||||
var minSize = 5;
|
||||
return Math.abs(selection.second.x - selection.first.x) >= minSize &&
|
||||
Math.abs(selection.second.y - selection.first.y) >= minSize;
|
||||
}
|
||||
|
||||
plot.clearSelection = clearSelection;
|
||||
plot.setSelection = setSelection;
|
||||
plot.getSelection = getSelection;
|
||||
|
||||
plot.hooks.bindEvents.push(function(plot, eventHolder) {
|
||||
var o = plot.getOptions();
|
||||
if (o.selection.mode != null) {
|
||||
eventHolder.mousemove(onMouseMove);
|
||||
eventHolder.mousedown(onMouseDown);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
plot.hooks.drawOverlay.push(function (plot, ctx) {
|
||||
// draw selection
|
||||
if (selection.show && selectionIsSane()) {
|
||||
var plotOffset = plot.getPlotOffset();
|
||||
var o = plot.getOptions();
|
||||
|
||||
ctx.save();
|
||||
ctx.translate(plotOffset.left, plotOffset.top);
|
||||
|
||||
var c = $.color.parse(o.selection.color);
|
||||
|
||||
ctx.strokeStyle = c.scale('a', 0.8).toString();
|
||||
ctx.lineWidth = 1;
|
||||
ctx.lineJoin = "round";
|
||||
ctx.fillStyle = c.scale('a', 0.4).toString();
|
||||
|
||||
var x = Math.min(selection.first.x, selection.second.x),
|
||||
y = Math.min(selection.first.y, selection.second.y),
|
||||
w = Math.abs(selection.second.x - selection.first.x),
|
||||
h = Math.abs(selection.second.y - selection.first.y);
|
||||
|
||||
ctx.fillRect(x, y, w, h);
|
||||
ctx.strokeRect(x, y, w, h);
|
||||
|
||||
ctx.restore();
|
||||
}
|
||||
});
|
||||
|
||||
plot.hooks.shutdown.push(function (plot, eventHolder) {
|
||||
eventHolder.unbind("mousemove", onMouseMove);
|
||||
eventHolder.unbind("mousedown", onMouseDown);
|
||||
|
||||
if (mouseUpHandler)
|
||||
$(document).unbind("mouseup", mouseUpHandler);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: {
|
||||
selection: {
|
||||
mode: null, // one of null, "x", "y" or "xy"
|
||||
color: "#e8cfac"
|
||||
}
|
||||
},
|
||||
name: 'selection',
|
||||
version: '1.1'
|
||||
});
|
||||
})(jQuery);
|
||||
1
modules/lib/flot/jquery.flot.selection.min.js
vendored
Normal file
1
modules/lib/flot/jquery.flot.selection.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
(function(a){function b(k){var p={first:{x:-1,y:-1},second:{x:-1,y:-1},show:false,active:false};var m={};var r=null;function e(s){if(p.active){l(s);k.getPlaceholder().trigger("plotselecting",[g()])}}function n(s){if(s.which!=1){return}document.body.focus();if(document.onselectstart!==undefined&&m.onselectstart==null){m.onselectstart=document.onselectstart;document.onselectstart=function(){return false}}if(document.ondrag!==undefined&&m.ondrag==null){m.ondrag=document.ondrag;document.ondrag=function(){return false}}d(p.first,s);p.active=true;r=function(t){j(t)};a(document).one("mouseup",r)}function j(s){r=null;if(document.onselectstart!==undefined){document.onselectstart=m.onselectstart}if(document.ondrag!==undefined){document.ondrag=m.ondrag}p.active=false;l(s);if(f()){i()}else{k.getPlaceholder().trigger("plotunselected",[]);k.getPlaceholder().trigger("plotselecting",[null])}return false}function g(){if(!f()){return null}var u={},t=p.first,s=p.second;a.each(k.getAxes(),function(v,w){if(w.used){var y=w.c2p(t[w.direction]),x=w.c2p(s[w.direction]);u[v]={from:Math.min(y,x),to:Math.max(y,x)}}});return u}function i(){var s=g();k.getPlaceholder().trigger("plotselected",[s]);if(s.xaxis&&s.yaxis){k.getPlaceholder().trigger("selected",[{x1:s.xaxis.from,y1:s.yaxis.from,x2:s.xaxis.to,y2:s.yaxis.to}])}}function h(t,u,s){return u<t?t:(u>s?s:u)}function d(w,t){var v=k.getOptions();var u=k.getPlaceholder().offset();var s=k.getPlotOffset();w.x=h(0,t.pageX-u.left-s.left,k.width());w.y=h(0,t.pageY-u.top-s.top,k.height());if(v.selection.mode=="y"){w.x=w==p.first?0:k.width()}if(v.selection.mode=="x"){w.y=w==p.first?0:k.height()}}function l(s){if(s.pageX==null){return}d(p.second,s);if(f()){p.show=true;k.triggerRedrawOverlay()}else{q(true)}}function q(s){if(p.show){p.show=false;k.triggerRedrawOverlay();if(!s){k.getPlaceholder().trigger("plotunselected",[])}}}function c(s,w){var t,y,z,A,x=k.getAxes();for(var u in x){t=x[u];if(t.direction==w){A=w+t.n+"axis";if(!s[A]&&t.n==1){A=w+"axis"}if(s[A]){y=s[A].from;z=s[A].to;break}}}if(!s[A]){t=w=="x"?k.getXAxes()[0]:k.getYAxes()[0];y=s[w+"1"];z=s[w+"2"]}if(y!=null&&z!=null&&y>z){var v=y;y=z;z=v}return{from:y,to:z,axis:t}}function o(t,s){var v,u,w=k.getOptions();if(w.selection.mode=="y"){p.first.x=0;p.second.x=k.width()}else{u=c(t,"x");p.first.x=u.axis.p2c(u.from);p.second.x=u.axis.p2c(u.to)}if(w.selection.mode=="x"){p.first.y=0;p.second.y=k.height()}else{u=c(t,"y");p.first.y=u.axis.p2c(u.from);p.second.y=u.axis.p2c(u.to)}p.show=true;k.triggerRedrawOverlay();if(!s&&f()){i()}}function f(){var s=5;return Math.abs(p.second.x-p.first.x)>=s&&Math.abs(p.second.y-p.first.y)>=s}k.clearSelection=q;k.setSelection=o;k.getSelection=g;k.hooks.bindEvents.push(function(t,s){var u=t.getOptions();if(u.selection.mode!=null){s.mousemove(e);s.mousedown(n)}});k.hooks.drawOverlay.push(function(v,D){if(p.show&&f()){var t=v.getPlotOffset();var s=v.getOptions();D.save();D.translate(t.left,t.top);var z=a.color.parse(s.selection.color);D.strokeStyle=z.scale("a",0.8).toString();D.lineWidth=1;D.lineJoin="round";D.fillStyle=z.scale("a",0.4).toString();var B=Math.min(p.first.x,p.second.x),A=Math.min(p.first.y,p.second.y),C=Math.abs(p.second.x-p.first.x),u=Math.abs(p.second.y-p.first.y);D.fillRect(B,A,C,u);D.strokeRect(B,A,C,u);D.restore()}});k.hooks.shutdown.push(function(t,s){s.unbind("mousemove",e);s.unbind("mousedown",n);if(r){a(document).unbind("mouseup",r)}})}a.plot.plugins.push({init:b,options:{selection:{mode:null,color:"#e8cfac"}},name:"selection",version:"1.1"})})(jQuery);
|
||||
184
modules/lib/flot/jquery.flot.stack.js
Normal file
184
modules/lib/flot/jquery.flot.stack.js
Normal file
@ -0,0 +1,184 @@
|
||||
/*
|
||||
Flot plugin for stacking data sets, i.e. putting them on top of each
|
||||
other, for accumulative graphs.
|
||||
|
||||
The plugin assumes the data is sorted on x (or y if stacking
|
||||
horizontally). For line charts, it is assumed that if a line has an
|
||||
undefined gap (from a null point), then the line above it should have
|
||||
the same gap - insert zeros instead of "null" if you want another
|
||||
behaviour. This also holds for the start and end of the chart. Note
|
||||
that stacking a mix of positive and negative values in most instances
|
||||
doesn't make sense (so it looks weird).
|
||||
|
||||
Two or more series are stacked when their "stack" attribute is set to
|
||||
the same key (which can be any number or string or just "true"). To
|
||||
specify the default stack, you can set
|
||||
|
||||
series: {
|
||||
stack: null or true or key (number/string)
|
||||
}
|
||||
|
||||
or specify it for a specific series
|
||||
|
||||
$.plot($("#placeholder"), [{ data: [ ... ], stack: true }])
|
||||
|
||||
The stacking order is determined by the order of the data series in
|
||||
the array (later series end up on top of the previous).
|
||||
|
||||
Internally, the plugin modifies the datapoints in each series, adding
|
||||
an offset to the y value. For line series, extra data points are
|
||||
inserted through interpolation. If there's a second y value, it's also
|
||||
adjusted (e.g for bar charts or filled areas).
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
var options = {
|
||||
series: { stack: null } // or number/string
|
||||
};
|
||||
|
||||
function init(plot) {
|
||||
function findMatchingSeries(s, allseries) {
|
||||
var res = null
|
||||
for (var i = 0; i < allseries.length; ++i) {
|
||||
if (s == allseries[i])
|
||||
break;
|
||||
|
||||
if (allseries[i].stack == s.stack)
|
||||
res = allseries[i];
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
function stackData(plot, s, datapoints) {
|
||||
if (s.stack == null)
|
||||
return;
|
||||
|
||||
var other = findMatchingSeries(s, plot.getData());
|
||||
if (!other)
|
||||
return;
|
||||
|
||||
var ps = datapoints.pointsize,
|
||||
points = datapoints.points,
|
||||
otherps = other.datapoints.pointsize,
|
||||
otherpoints = other.datapoints.points,
|
||||
newpoints = [],
|
||||
px, py, intery, qx, qy, bottom,
|
||||
withlines = s.lines.show,
|
||||
horizontal = s.bars.horizontal,
|
||||
withbottom = ps > 2 && (horizontal ? datapoints.format[2].x : datapoints.format[2].y),
|
||||
withsteps = withlines && s.lines.steps,
|
||||
fromgap = true,
|
||||
keyOffset = horizontal ? 1 : 0,
|
||||
accumulateOffset = horizontal ? 0 : 1,
|
||||
i = 0, j = 0, l;
|
||||
|
||||
while (true) {
|
||||
if (i >= points.length)
|
||||
break;
|
||||
|
||||
l = newpoints.length;
|
||||
|
||||
if (points[i] == null) {
|
||||
// copy gaps
|
||||
for (m = 0; m < ps; ++m)
|
||||
newpoints.push(points[i + m]);
|
||||
i += ps;
|
||||
}
|
||||
else if (j >= otherpoints.length) {
|
||||
// for lines, we can't use the rest of the points
|
||||
if (!withlines) {
|
||||
for (m = 0; m < ps; ++m)
|
||||
newpoints.push(points[i + m]);
|
||||
}
|
||||
i += ps;
|
||||
}
|
||||
else if (otherpoints[j] == null) {
|
||||
// oops, got a gap
|
||||
for (m = 0; m < ps; ++m)
|
||||
newpoints.push(null);
|
||||
fromgap = true;
|
||||
j += otherps;
|
||||
}
|
||||
else {
|
||||
// cases where we actually got two points
|
||||
px = points[i + keyOffset];
|
||||
py = points[i + accumulateOffset];
|
||||
qx = otherpoints[j + keyOffset];
|
||||
qy = otherpoints[j + accumulateOffset];
|
||||
bottom = 0;
|
||||
|
||||
if (px == qx) {
|
||||
for (m = 0; m < ps; ++m)
|
||||
newpoints.push(points[i + m]);
|
||||
|
||||
newpoints[l + accumulateOffset] += qy;
|
||||
bottom = qy;
|
||||
|
||||
i += ps;
|
||||
j += otherps;
|
||||
}
|
||||
else if (px > qx) {
|
||||
// we got past point below, might need to
|
||||
// insert interpolated extra point
|
||||
if (withlines && i > 0 && points[i - ps] != null) {
|
||||
intery = py + (points[i - ps + accumulateOffset] - py) * (qx - px) / (points[i - ps + keyOffset] - px);
|
||||
newpoints.push(qx);
|
||||
newpoints.push(intery + qy);
|
||||
for (m = 2; m < ps; ++m)
|
||||
newpoints.push(points[i + m]);
|
||||
bottom = qy;
|
||||
}
|
||||
|
||||
j += otherps;
|
||||
}
|
||||
else { // px < qx
|
||||
if (fromgap && withlines) {
|
||||
// if we come from a gap, we just skip this point
|
||||
i += ps;
|
||||
continue;
|
||||
}
|
||||
|
||||
for (m = 0; m < ps; ++m)
|
||||
newpoints.push(points[i + m]);
|
||||
|
||||
// we might be able to interpolate a point below,
|
||||
// this can give us a better y
|
||||
if (withlines && j > 0 && otherpoints[j - otherps] != null)
|
||||
bottom = qy + (otherpoints[j - otherps + accumulateOffset] - qy) * (px - qx) / (otherpoints[j - otherps + keyOffset] - qx);
|
||||
|
||||
newpoints[l + accumulateOffset] += bottom;
|
||||
|
||||
i += ps;
|
||||
}
|
||||
|
||||
fromgap = false;
|
||||
|
||||
if (l != newpoints.length && withbottom)
|
||||
newpoints[l + 2] += bottom;
|
||||
}
|
||||
|
||||
// maintain the line steps invariant
|
||||
if (withsteps && l != newpoints.length && l > 0
|
||||
&& newpoints[l] != null
|
||||
&& newpoints[l] != newpoints[l - ps]
|
||||
&& newpoints[l + 1] != newpoints[l - ps + 1]) {
|
||||
for (m = 0; m < ps; ++m)
|
||||
newpoints[l + ps + m] = newpoints[l + m];
|
||||
newpoints[l + 1] = newpoints[l - ps + 1];
|
||||
}
|
||||
}
|
||||
|
||||
datapoints.points = newpoints;
|
||||
}
|
||||
|
||||
plot.hooks.processDatapoints.push(stackData);
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'stack',
|
||||
version: '1.2'
|
||||
});
|
||||
})(jQuery);
|
||||
1
modules/lib/flot/jquery.flot.stack.min.js
vendored
Normal file
1
modules/lib/flot/jquery.flot.stack.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
(function(b){var a={series:{stack:null}};function c(f){function d(k,j){var h=null;for(var g=0;g<j.length;++g){if(k==j[g]){break}if(j[g].stack==k.stack){h=j[g]}}return h}function e(C,v,g){if(v.stack==null){return}var p=d(v,C.getData());if(!p){return}var z=g.pointsize,F=g.points,h=p.datapoints.pointsize,y=p.datapoints.points,t=[],x,w,k,J,I,r,u=v.lines.show,G=v.bars.horizontal,o=z>2&&(G?g.format[2].x:g.format[2].y),n=u&&v.lines.steps,E=true,q=G?1:0,H=G?0:1,D=0,B=0,A;while(true){if(D>=F.length){break}A=t.length;if(F[D]==null){for(m=0;m<z;++m){t.push(F[D+m])}D+=z}else{if(B>=y.length){if(!u){for(m=0;m<z;++m){t.push(F[D+m])}}D+=z}else{if(y[B]==null){for(m=0;m<z;++m){t.push(null)}E=true;B+=h}else{x=F[D+q];w=F[D+H];J=y[B+q];I=y[B+H];r=0;if(x==J){for(m=0;m<z;++m){t.push(F[D+m])}t[A+H]+=I;r=I;D+=z;B+=h}else{if(x>J){if(u&&D>0&&F[D-z]!=null){k=w+(F[D-z+H]-w)*(J-x)/(F[D-z+q]-x);t.push(J);t.push(k+I);for(m=2;m<z;++m){t.push(F[D+m])}r=I}B+=h}else{if(E&&u){D+=z;continue}for(m=0;m<z;++m){t.push(F[D+m])}if(u&&B>0&&y[B-h]!=null){r=I+(y[B-h+H]-I)*(x-J)/(y[B-h+q]-J)}t[A+H]+=r;D+=z}}E=false;if(A!=t.length&&o){t[A+2]+=r}}}}if(n&&A!=t.length&&A>0&&t[A]!=null&&t[A]!=t[A-z]&&t[A+1]!=t[A-z+1]){for(m=0;m<z;++m){t[A+z+m]=t[A+m]}t[A+1]=t[A-z+1]}}g.points=t}f.hooks.processDatapoints.push(e)}b.plot.plugins.push({init:c,options:a,name:"stack",version:"1.2"})})(jQuery);
|
||||
70
modules/lib/flot/jquery.flot.symbol.js
Normal file
70
modules/lib/flot/jquery.flot.symbol.js
Normal file
@ -0,0 +1,70 @@
|
||||
/*
|
||||
Flot plugin that adds some extra symbols for plotting points.
|
||||
|
||||
The symbols are accessed as strings through the standard symbol
|
||||
choice:
|
||||
|
||||
series: {
|
||||
points: {
|
||||
symbol: "square" // or "diamond", "triangle", "cross"
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
function processRawData(plot, series, datapoints) {
|
||||
// we normalize the area of each symbol so it is approximately the
|
||||
// same as a circle of the given radius
|
||||
|
||||
var handlers = {
|
||||
square: function (ctx, x, y, radius, shadow) {
|
||||
// pi * r^2 = (2s)^2 => s = r * sqrt(pi)/2
|
||||
var size = radius * Math.sqrt(Math.PI) / 2;
|
||||
ctx.rect(x - size, y - size, size + size, size + size);
|
||||
},
|
||||
diamond: function (ctx, x, y, radius, shadow) {
|
||||
// pi * r^2 = 2s^2 => s = r * sqrt(pi/2)
|
||||
var size = radius * Math.sqrt(Math.PI / 2);
|
||||
ctx.moveTo(x - size, y);
|
||||
ctx.lineTo(x, y - size);
|
||||
ctx.lineTo(x + size, y);
|
||||
ctx.lineTo(x, y + size);
|
||||
ctx.lineTo(x - size, y);
|
||||
},
|
||||
triangle: function (ctx, x, y, radius, shadow) {
|
||||
// pi * r^2 = 1/2 * s^2 * sin (pi / 3) => s = r * sqrt(2 * pi / sin(pi / 3))
|
||||
var size = radius * Math.sqrt(2 * Math.PI / Math.sin(Math.PI / 3));
|
||||
var height = size * Math.sin(Math.PI / 3);
|
||||
ctx.moveTo(x - size/2, y + height/2);
|
||||
ctx.lineTo(x + size/2, y + height/2);
|
||||
if (!shadow) {
|
||||
ctx.lineTo(x, y - height/2);
|
||||
ctx.lineTo(x - size/2, y + height/2);
|
||||
}
|
||||
},
|
||||
cross: function (ctx, x, y, radius, shadow) {
|
||||
// pi * r^2 = (2s)^2 => s = r * sqrt(pi)/2
|
||||
var size = radius * Math.sqrt(Math.PI) / 2;
|
||||
ctx.moveTo(x - size, y - size);
|
||||
ctx.lineTo(x + size, y + size);
|
||||
ctx.moveTo(x - size, y + size);
|
||||
ctx.lineTo(x + size, y - size);
|
||||
}
|
||||
}
|
||||
|
||||
var s = series.points.symbol;
|
||||
if (handlers[s])
|
||||
series.points.symbol = handlers[s];
|
||||
}
|
||||
|
||||
function init(plot) {
|
||||
plot.hooks.processDatapoints.push(processRawData);
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
name: 'symbols',
|
||||
version: '1.0'
|
||||
});
|
||||
})(jQuery);
|
||||
1
modules/lib/flot/jquery.flot.symbol.min.js
vendored
Normal file
1
modules/lib/flot/jquery.flot.symbol.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
(function(b){function a(h,e,g){var d={square:function(k,j,n,i,m){var l=i*Math.sqrt(Math.PI)/2;k.rect(j-l,n-l,l+l,l+l)},diamond:function(k,j,n,i,m){var l=i*Math.sqrt(Math.PI/2);k.moveTo(j-l,n);k.lineTo(j,n-l);k.lineTo(j+l,n);k.lineTo(j,n+l);k.lineTo(j-l,n)},triangle:function(l,k,o,j,n){var m=j*Math.sqrt(2*Math.PI/Math.sin(Math.PI/3));var i=m*Math.sin(Math.PI/3);l.moveTo(k-m/2,o+i/2);l.lineTo(k+m/2,o+i/2);if(!n){l.lineTo(k,o-i/2);l.lineTo(k-m/2,o+i/2)}},cross:function(k,j,n,i,m){var l=i*Math.sqrt(Math.PI)/2;k.moveTo(j-l,n-l);k.lineTo(j+l,n+l);k.moveTo(j-l,n+l);k.lineTo(j+l,n-l)}};var f=e.points.symbol;if(d[f]){e.points.symbol=d[f]}}function c(d){d.hooks.processDatapoints.push(a)}b.plot.plugins.push({init:c,name:"symbols",version:"1.0"})})(jQuery);
|
||||
103
modules/lib/flot/jquery.flot.threshold.js
Normal file
103
modules/lib/flot/jquery.flot.threshold.js
Normal file
@ -0,0 +1,103 @@
|
||||
/*
|
||||
Flot plugin for thresholding data. Controlled through the option
|
||||
"threshold" in either the global series options
|
||||
|
||||
series: {
|
||||
threshold: {
|
||||
below: number
|
||||
color: colorspec
|
||||
}
|
||||
}
|
||||
|
||||
or in a specific series
|
||||
|
||||
$.plot($("#placeholder"), [{ data: [ ... ], threshold: { ... }}])
|
||||
|
||||
The data points below "below" are drawn with the specified color. This
|
||||
makes it easy to mark points below 0, e.g. for budget data.
|
||||
|
||||
Internally, the plugin works by splitting the data into two series,
|
||||
above and below the threshold. The extra series below the threshold
|
||||
will have its label cleared and the special "originSeries" attribute
|
||||
set to the original series. You may need to check for this in hover
|
||||
events.
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
var options = {
|
||||
series: { threshold: null } // or { below: number, color: color spec}
|
||||
};
|
||||
|
||||
function init(plot) {
|
||||
function thresholdData(plot, s, datapoints) {
|
||||
if (!s.threshold)
|
||||
return;
|
||||
|
||||
var ps = datapoints.pointsize, i, x, y, p, prevp,
|
||||
thresholded = $.extend({}, s); // note: shallow copy
|
||||
|
||||
thresholded.datapoints = { points: [], pointsize: ps };
|
||||
thresholded.label = null;
|
||||
thresholded.color = s.threshold.color;
|
||||
thresholded.threshold = null;
|
||||
thresholded.originSeries = s;
|
||||
thresholded.data = [];
|
||||
|
||||
var below = s.threshold.below,
|
||||
origpoints = datapoints.points,
|
||||
addCrossingPoints = s.lines.show;
|
||||
|
||||
threspoints = [];
|
||||
newpoints = [];
|
||||
|
||||
for (i = 0; i < origpoints.length; i += ps) {
|
||||
x = origpoints[i]
|
||||
y = origpoints[i + 1];
|
||||
|
||||
prevp = p;
|
||||
if (y < below)
|
||||
p = threspoints;
|
||||
else
|
||||
p = newpoints;
|
||||
|
||||
if (addCrossingPoints && prevp != p && x != null
|
||||
&& i > 0 && origpoints[i - ps] != null) {
|
||||
var interx = (x - origpoints[i - ps]) / (y - origpoints[i - ps + 1]) * (below - y) + x;
|
||||
prevp.push(interx);
|
||||
prevp.push(below);
|
||||
for (m = 2; m < ps; ++m)
|
||||
prevp.push(origpoints[i + m]);
|
||||
|
||||
p.push(null); // start new segment
|
||||
p.push(null);
|
||||
for (m = 2; m < ps; ++m)
|
||||
p.push(origpoints[i + m]);
|
||||
p.push(interx);
|
||||
p.push(below);
|
||||
for (m = 2; m < ps; ++m)
|
||||
p.push(origpoints[i + m]);
|
||||
}
|
||||
|
||||
p.push(x);
|
||||
p.push(y);
|
||||
}
|
||||
|
||||
datapoints.points = newpoints;
|
||||
thresholded.datapoints.points = threspoints;
|
||||
|
||||
if (thresholded.datapoints.points.length > 0)
|
||||
plot.getData().push(thresholded);
|
||||
|
||||
// FIXME: there are probably some edge cases left in bars
|
||||
}
|
||||
|
||||
plot.hooks.processDatapoints.push(thresholdData);
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'threshold',
|
||||
version: '1.0'
|
||||
});
|
||||
})(jQuery);
|
||||
1
modules/lib/flot/jquery.flot.threshold.min.js
vendored
Normal file
1
modules/lib/flot/jquery.flot.threshold.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
(function(B){var A={series:{threshold:null}};function C(D){function E(L,S,M){if(!S.threshold){return }var F=M.pointsize,I,O,N,G,K,H=B.extend({},S);H.datapoints={points:[],pointsize:F};H.label=null;H.color=S.threshold.color;H.threshold=null;H.originSeries=S;H.data=[];var P=S.threshold.below,Q=M.points,R=S.lines.show;threspoints=[];newpoints=[];for(I=0;I<Q.length;I+=F){O=Q[I];N=Q[I+1];K=G;if(N<P){G=threspoints}else{G=newpoints}if(R&&K!=G&&O!=null&&I>0&&Q[I-F]!=null){var J=(O-Q[I-F])/(N-Q[I-F+1])*(P-N)+O;K.push(J);K.push(P);for(m=2;m<F;++m){K.push(Q[I+m])}G.push(null);G.push(null);for(m=2;m<F;++m){G.push(Q[I+m])}G.push(J);G.push(P);for(m=2;m<F;++m){G.push(Q[I+m])}}G.push(O);G.push(N)}M.points=newpoints;H.datapoints.points=threspoints;if(H.datapoints.points.length>0){L.getData().push(H)}}D.hooks.processDatapoints.push(E)}B.plot.plugins.push({init:C,options:A,name:"threshold",version:"1.0"})})(jQuery);
|
||||
278
modules/lib/fullcalendar/GPL-LICENSE.txt
Normal file
278
modules/lib/fullcalendar/GPL-LICENSE.txt
Normal file
@ -0,0 +1,278 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the 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 Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
20
modules/lib/fullcalendar/MIT-LICENSE.txt
Normal file
20
modules/lib/fullcalendar/MIT-LICENSE.txt
Normal file
@ -0,0 +1,20 @@
|
||||
Copyright (c) 2009 Adam Shaw
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
618
modules/lib/fullcalendar/fullcalendar.css
Normal file
618
modules/lib/fullcalendar/fullcalendar.css
Normal file
@ -0,0 +1,618 @@
|
||||
/*
|
||||
* FullCalendar v1.5.4 Stylesheet
|
||||
*
|
||||
* Copyright (c) 2011 Adam Shaw
|
||||
* Dual licensed under the MIT and GPL licenses, located in
|
||||
* MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
|
||||
*
|
||||
* Date: Tue Sep 4 23:38:33 2012 -0700
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
.fc {
|
||||
direction: ltr;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.fc table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
html .fc,
|
||||
.fc table {
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
.fc td,
|
||||
.fc th {
|
||||
padding: 0;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Header
|
||||
------------------------------------------------------------------------*/
|
||||
|
||||
.fc-header td {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.fc-header-left {
|
||||
width: 25%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.fc-header-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.fc-header-right {
|
||||
width: 25%;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.fc-header-title {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.fc-header-title h2 {
|
||||
margin-top: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.fc .fc-header-space {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.fc-header .fc-button {
|
||||
margin-bottom: 1em;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
/* buttons edges butting together */
|
||||
|
||||
.fc-header .fc-button {
|
||||
margin-right: -1px;
|
||||
}
|
||||
|
||||
.fc-header .fc-corner-right {
|
||||
margin-right: 1px; /* back to normal */
|
||||
}
|
||||
|
||||
.fc-header .ui-corner-right {
|
||||
margin-right: 0; /* back to normal */
|
||||
}
|
||||
|
||||
/* button layering (for border precedence) */
|
||||
|
||||
.fc-header .fc-state-hover,
|
||||
.fc-header .ui-state-hover {
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.fc-header .fc-state-down {
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.fc-header .fc-state-active,
|
||||
.fc-header .ui-state-active {
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Content
|
||||
------------------------------------------------------------------------*/
|
||||
|
||||
.fc-content {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.fc-view {
|
||||
width: 100%; /* needed for view switching (when view is absolute) */
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Cell Styles
|
||||
------------------------------------------------------------------------*/
|
||||
|
||||
.fc-widget-header, /* <th>, usually */
|
||||
.fc-widget-content { /* <td>, usually */
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
.fc-state-highlight { /* <td> today cell */ /* TODO: add .fc-today to <th> */
|
||||
background: #ffc;
|
||||
}
|
||||
|
||||
.fc-cell-overlay { /* semi-transparent rectangle while dragging */
|
||||
background: #9cf;
|
||||
opacity: .2;
|
||||
filter: alpha(opacity=20); /* for IE */
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Buttons
|
||||
------------------------------------------------------------------------*/
|
||||
|
||||
.fc-button {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.fc-state-default { /* non-theme */
|
||||
border-style: solid;
|
||||
border-width: 1px 0;
|
||||
}
|
||||
|
||||
.fc-button-inner {
|
||||
position: relative;
|
||||
float: left;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.fc-state-default .fc-button-inner { /* non-theme */
|
||||
border-style: solid;
|
||||
border-width: 0 1px;
|
||||
}
|
||||
|
||||
.fc-button-content {
|
||||
position: relative;
|
||||
float: left;
|
||||
height: 1.9em;
|
||||
line-height: 1.9em;
|
||||
padding: 0 .6em;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* icon (for jquery ui) */
|
||||
|
||||
.fc-button-content .fc-icon-wrap {
|
||||
position: relative;
|
||||
float: left;
|
||||
top: 50%;
|
||||
}
|
||||
|
||||
.fc-button-content .ui-icon {
|
||||
position: relative;
|
||||
float: left;
|
||||
margin-top: -50%;
|
||||
*margin-top: 0;
|
||||
*top: -50%;
|
||||
}
|
||||
|
||||
/* gloss effect */
|
||||
|
||||
.fc-state-default .fc-button-effect {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.fc-state-default .fc-button-effect span {
|
||||
position: absolute;
|
||||
top: -100px;
|
||||
left: 0;
|
||||
width: 500px;
|
||||
height: 100px;
|
||||
border-width: 100px 0 0 1px;
|
||||
border-style: solid;
|
||||
border-color: #fff;
|
||||
background: #444;
|
||||
opacity: .09;
|
||||
filter: alpha(opacity=9);
|
||||
}
|
||||
|
||||
/* button states (determines colors) */
|
||||
|
||||
.fc-state-default,
|
||||
.fc-state-default .fc-button-inner {
|
||||
border-style: solid;
|
||||
border-color: #ccc #bbb #aaa;
|
||||
background: #F3F3F3;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.fc-state-hover,
|
||||
.fc-state-hover .fc-button-inner {
|
||||
border-color: #999;
|
||||
}
|
||||
|
||||
.fc-state-down,
|
||||
.fc-state-down .fc-button-inner {
|
||||
border-color: #555;
|
||||
background: #777;
|
||||
}
|
||||
|
||||
.fc-state-active,
|
||||
.fc-state-active .fc-button-inner {
|
||||
border-color: #555;
|
||||
background: #777;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.fc-state-disabled,
|
||||
.fc-state-disabled .fc-button-inner {
|
||||
color: #999;
|
||||
border-color: #ddd;
|
||||
}
|
||||
|
||||
.fc-state-disabled {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.fc-state-disabled .fc-button-effect {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Global Event Styles
|
||||
------------------------------------------------------------------------*/
|
||||
|
||||
.fc-event {
|
||||
border-style: solid;
|
||||
border-width: 0;
|
||||
font-size: .85em;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
a.fc-event,
|
||||
.fc-event-draggable {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
a.fc-event {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.fc-rtl .fc-event {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.fc-event-skin {
|
||||
border-color: #36c; /* default BORDER color */
|
||||
background-color: #36c; /* default BACKGROUND color */
|
||||
color: #fff; /* default TEXT color */
|
||||
}
|
||||
|
||||
.fc-event-inner {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-style: solid;
|
||||
border-width: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.fc-event-time,
|
||||
.fc-event-title {
|
||||
padding: 0 1px;
|
||||
}
|
||||
|
||||
.fc .ui-resizable-handle { /*** TODO: don't use ui-resizable anymore, change class ***/
|
||||
display: block;
|
||||
position: absolute;
|
||||
z-index: 99999;
|
||||
overflow: hidden; /* hacky spaces (IE6/7) */
|
||||
font-size: 300%; /* */
|
||||
line-height: 50%; /* */
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Horizontal Events
|
||||
------------------------------------------------------------------------*/
|
||||
|
||||
.fc-event-hori {
|
||||
border-width: 1px 0;
|
||||
margin-bottom: 1px;
|
||||
}
|
||||
|
||||
/* resizable */
|
||||
|
||||
.fc-event-hori .ui-resizable-e {
|
||||
top: 0 !important; /* importants override pre jquery ui 1.7 styles */
|
||||
right: -3px !important;
|
||||
width: 7px !important;
|
||||
height: 100% !important;
|
||||
cursor: e-resize;
|
||||
}
|
||||
|
||||
.fc-event-hori .ui-resizable-w {
|
||||
top: 0 !important;
|
||||
left: -3px !important;
|
||||
width: 7px !important;
|
||||
height: 100% !important;
|
||||
cursor: w-resize;
|
||||
}
|
||||
|
||||
.fc-event-hori .ui-resizable-handle {
|
||||
_padding-bottom: 14px; /* IE6 had 0 height */
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Fake Rounded Corners (for buttons and events)
|
||||
------------------------------------------------------------*/
|
||||
|
||||
.fc-corner-left {
|
||||
margin-left: 1px;
|
||||
}
|
||||
|
||||
.fc-corner-left .fc-button-inner,
|
||||
.fc-corner-left .fc-event-inner {
|
||||
margin-left: -1px;
|
||||
}
|
||||
|
||||
.fc-corner-right {
|
||||
margin-right: 1px;
|
||||
}
|
||||
|
||||
.fc-corner-right .fc-button-inner,
|
||||
.fc-corner-right .fc-event-inner {
|
||||
margin-right: -1px;
|
||||
}
|
||||
|
||||
.fc-corner-top {
|
||||
margin-top: 1px;
|
||||
}
|
||||
|
||||
.fc-corner-top .fc-event-inner {
|
||||
margin-top: -1px;
|
||||
}
|
||||
|
||||
.fc-corner-bottom {
|
||||
margin-bottom: 1px;
|
||||
}
|
||||
|
||||
.fc-corner-bottom .fc-event-inner {
|
||||
margin-bottom: -1px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Fake Rounded Corners SPECIFICALLY FOR EVENTS
|
||||
-----------------------------------------------------------------*/
|
||||
|
||||
.fc-corner-left .fc-event-inner {
|
||||
border-left-width: 1px;
|
||||
}
|
||||
|
||||
.fc-corner-right .fc-event-inner {
|
||||
border-right-width: 1px;
|
||||
}
|
||||
|
||||
.fc-corner-top .fc-event-inner {
|
||||
border-top-width: 1px;
|
||||
}
|
||||
|
||||
.fc-corner-bottom .fc-event-inner {
|
||||
border-bottom-width: 1px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Reusable Separate-border Table
|
||||
------------------------------------------------------------*/
|
||||
|
||||
table.fc-border-separate {
|
||||
border-collapse: separate;
|
||||
}
|
||||
|
||||
.fc-border-separate th,
|
||||
.fc-border-separate td {
|
||||
border-width: 1px 0 0 1px;
|
||||
}
|
||||
|
||||
.fc-border-separate th.fc-last,
|
||||
.fc-border-separate td.fc-last {
|
||||
border-right-width: 1px;
|
||||
}
|
||||
|
||||
.fc-border-separate tr.fc-last th,
|
||||
.fc-border-separate tr.fc-last td {
|
||||
border-bottom-width: 1px;
|
||||
}
|
||||
|
||||
.fc-border-separate tbody tr.fc-first td,
|
||||
.fc-border-separate tbody tr.fc-first th {
|
||||
border-top-width: 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Month View, Basic Week View, Basic Day View
|
||||
------------------------------------------------------------------------*/
|
||||
|
||||
.fc-grid th {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.fc-grid .fc-day-number {
|
||||
float: right;
|
||||
padding: 0 2px;
|
||||
}
|
||||
|
||||
.fc-grid .fc-other-month .fc-day-number {
|
||||
opacity: 0.3;
|
||||
filter: alpha(opacity=30); /* for IE */
|
||||
/* opacity with small font can sometimes look too faded
|
||||
might want to set the 'color' property instead
|
||||
making day-numbers bold also fixes the problem */
|
||||
}
|
||||
|
||||
.fc-grid .fc-day-content {
|
||||
clear: both;
|
||||
padding: 2px 2px 1px; /* distance between events and day edges */
|
||||
}
|
||||
|
||||
/* event styles */
|
||||
|
||||
.fc-grid .fc-event-time {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* right-to-left */
|
||||
|
||||
.fc-rtl .fc-grid .fc-day-number {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.fc-rtl .fc-grid .fc-event-time {
|
||||
float: right;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Agenda Week View, Agenda Day View
|
||||
------------------------------------------------------------------------*/
|
||||
|
||||
.fc-agenda table {
|
||||
border-collapse: separate;
|
||||
}
|
||||
|
||||
.fc-agenda-days th {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.fc-agenda .fc-agenda-axis {
|
||||
width: 50px;
|
||||
padding: 0 4px;
|
||||
vertical-align: middle;
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.fc-agenda .fc-day-content {
|
||||
padding: 2px 2px 1px;
|
||||
}
|
||||
|
||||
/* make axis border take precedence */
|
||||
|
||||
.fc-agenda-days .fc-agenda-axis {
|
||||
border-right-width: 1px;
|
||||
}
|
||||
|
||||
.fc-agenda-days .fc-col0 {
|
||||
border-left-width: 0;
|
||||
}
|
||||
|
||||
/* all-day area */
|
||||
|
||||
.fc-agenda-allday th {
|
||||
border-width: 0 1px;
|
||||
}
|
||||
|
||||
.fc-agenda-allday .fc-day-content {
|
||||
min-height: 34px; /* TODO: doesnt work well in quirksmode */
|
||||
_height: 34px;
|
||||
}
|
||||
|
||||
/* divider (between all-day and slots) */
|
||||
|
||||
.fc-agenda-divider-inner {
|
||||
height: 2px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.fc-widget-header .fc-agenda-divider-inner {
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
/* slot rows */
|
||||
|
||||
.fc-agenda-slots th {
|
||||
border-width: 1px 1px 0;
|
||||
}
|
||||
|
||||
.fc-agenda-slots td {
|
||||
border-width: 1px 0 0;
|
||||
background: none;
|
||||
}
|
||||
|
||||
.fc-agenda-slots td div {
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.fc-agenda-slots tr.fc-slot0 th,
|
||||
.fc-agenda-slots tr.fc-slot0 td {
|
||||
border-top-width: 0;
|
||||
}
|
||||
|
||||
.fc-agenda-slots tr.fc-minor th,
|
||||
.fc-agenda-slots tr.fc-minor td {
|
||||
border-top-style: dotted;
|
||||
}
|
||||
|
||||
.fc-agenda-slots tr.fc-minor th.ui-widget-header {
|
||||
*border-top-style: solid; /* doesn't work with background in IE6/7 */
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Vertical Events
|
||||
------------------------------------------------------------------------*/
|
||||
|
||||
.fc-event-vert {
|
||||
border-width: 0 1px;
|
||||
}
|
||||
|
||||
.fc-event-vert .fc-event-head,
|
||||
.fc-event-vert .fc-event-content {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.fc-event-vert .fc-event-time {
|
||||
white-space: nowrap;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.fc-event-vert .fc-event-bg { /* makes the event lighter w/ a semi-transparent overlay */
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
opacity: .3;
|
||||
filter: alpha(opacity=30);
|
||||
}
|
||||
|
||||
.fc .ui-draggable-dragging .fc-event-bg, /* TODO: something nicer like .fc-opacity */
|
||||
.fc-select-helper .fc-event-bg {
|
||||
display: none\9; /* for IE6/7/8. nested opacity filters while dragging don't work */
|
||||
}
|
||||
|
||||
/* resizable */
|
||||
|
||||
.fc-event-vert .ui-resizable-s {
|
||||
bottom: 0 !important; /* importants override pre jquery ui 1.7 styles */
|
||||
width: 100% !important;
|
||||
height: 8px !important;
|
||||
overflow: hidden !important;
|
||||
line-height: 8px !important;
|
||||
font-size: 11px !important;
|
||||
font-family: monospace;
|
||||
text-align: center;
|
||||
cursor: s-resize;
|
||||
}
|
||||
|
||||
.fc-agenda .ui-resizable-resizing { /* TODO: better selector */
|
||||
_overflow: hidden;
|
||||
}
|
||||
|
||||
|
||||
5215
modules/lib/fullcalendar/fullcalendar.js
Normal file
5215
modules/lib/fullcalendar/fullcalendar.js
Normal file
File diff suppressed because it is too large
Load Diff
1
modules/lib/fullcalendar/fullcalendar.min.js
vendored
Normal file
1
modules/lib/fullcalendar/fullcalendar.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
61
modules/lib/fullcalendar/fullcalendar.print.css
Normal file
61
modules/lib/fullcalendar/fullcalendar.print.css
Normal file
@ -0,0 +1,61 @@
|
||||
/*
|
||||
* FullCalendar v1.5.4 Print Stylesheet
|
||||
*
|
||||
* Include this stylesheet on your page to get a more printer-friendly calendar.
|
||||
* When including this stylesheet, use the media='print' attribute of the <link> tag.
|
||||
* Make sure to include this stylesheet IN ADDITION to the regular fullcalendar.css.
|
||||
*
|
||||
* Copyright (c) 2011 Adam Shaw
|
||||
* Dual licensed under the MIT and GPL licenses, located in
|
||||
* MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
|
||||
*
|
||||
* Date: Tue Sep 4 23:38:33 2012 -0700
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* Events
|
||||
-----------------------------------------------------*/
|
||||
|
||||
.fc-event-skin {
|
||||
background: none !important;
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
/* horizontal events */
|
||||
|
||||
.fc-event-hori {
|
||||
border-width: 0 0 1px 0 !important;
|
||||
border-bottom-style: dotted !important;
|
||||
border-bottom-color: #000 !important;
|
||||
padding: 1px 0 0 0 !important;
|
||||
}
|
||||
|
||||
.fc-event-hori .fc-event-inner {
|
||||
border-width: 0 !important;
|
||||
padding: 0 1px !important;
|
||||
}
|
||||
|
||||
/* vertical events */
|
||||
|
||||
.fc-event-vert {
|
||||
border-width: 0 0 0 1px !important;
|
||||
border-left-style: dotted !important;
|
||||
border-left-color: #000 !important;
|
||||
padding: 0 1px 0 0 !important;
|
||||
}
|
||||
|
||||
.fc-event-vert .fc-event-inner {
|
||||
border-width: 0 !important;
|
||||
padding: 1px 0 !important;
|
||||
}
|
||||
|
||||
.fc-event-bg {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.fc-event .ui-resizable-handle {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
|
||||
104
modules/lib/fullcalendar/fullcalendar_gebo.css
Normal file
104
modules/lib/fullcalendar/fullcalendar_gebo.css
Normal file
@ -0,0 +1,104 @@
|
||||
.fc{direction:ltr;text-align:left}
|
||||
.fc table{border-collapse:collapse;border-spacing:0}
|
||||
html .fc,.fc table{font-size:1em}
|
||||
.fc td,.fc th{vertical-align:top;padding:0}
|
||||
.fc-header td{white-space:nowrap}
|
||||
.fc-header-left{width:25%;text-align:left}
|
||||
.fc-header-right{width:25%;text-align:right}
|
||||
.fc-header-title{display:inline-block;vertical-align:middle}
|
||||
.fc-header-title h2{margin-top:0;white-space:nowrap}
|
||||
.fc .fc-header-space{padding-left:10px}
|
||||
.fc-header .fc-button{margin-bottom:1em;vertical-align:top;margin-right:-1px}
|
||||
.fc-header .ui-corner-right{margin-right:0}
|
||||
.fc-header .fc-state-hover,.fc-header .ui-state-hover{z-index:2}
|
||||
.fc-header .fc-state-down{z-index:3}
|
||||
.fc-header .fc-state-active,.fc-header .ui-state-active{z-index:4}
|
||||
.fc-content{clear:both}
|
||||
.fc-view{width:100%;overflow:hidden}
|
||||
.fc-widget-header,/* <th>,usually */
|
||||
.fc-widget-content{border:1px solid #e5e5e5}
|
||||
.fc-state-highlight{background:#fffad7}
|
||||
.fc-cell-overlay{background:#9cf;opacity:.2;filter:alpha(opacity=20)}
|
||||
.fc-state-disabled{cursor:default}
|
||||
.fc-state-disabled .fc-button-effect{display:none}
|
||||
.fc-event{font-size:.85em;cursor:default;border-style:solid;border-width:0}
|
||||
a.fc-event,.fc-event-draggable{cursor:pointer}
|
||||
a.fc-event{text-decoration:none}
|
||||
.fc-rtl .fc-event{text-align:right}
|
||||
.fc-event-skin{background-color:#36c;color:#1c546d;border-color:#36c}
|
||||
.fc-event-inner{position:relative;width:100%;height:100%;overflow:hidden;border-style:solid;border-width:0}
|
||||
.fc-event-time,.fc-event-title{padding:0 1px}
|
||||
.fc .ui-resizable-handle{display:block;position:absolute;z-index:99999;overflow:hidden;font-size:300%;line-height:50%}
|
||||
.fc-event-hori{margin-bottom:1px;border-width:1px 0}
|
||||
.fc-event-hori .ui-resizable-e{top:0!important;right:-3px!important;width:7px!important;height:100%!important;cursor:e-resize}
|
||||
.fc-event-hori .ui-resizable-w{top:0!important;left:-3px!important;width:7px!important;height:100%!important;cursor:w-resize}
|
||||
.fc-event-hori .ui-resizable-handle{_padding-bottom:14px}
|
||||
.fc-corner-left{margin-left:1px}
|
||||
.fc-corner-left .fc-button-inner,.fc-corner-left .fc-event-inner{margin-left:-1px}
|
||||
.fc-corner-right .fc-button-inner,.fc-corner-right .fc-event-inner{margin-right:-1px}
|
||||
.fc-corner-top{margin-top:1px}
|
||||
.fc-corner-top .fc-event-inner{margin-top:-1px;border-top-width:1px}
|
||||
.fc-corner-bottom{margin-bottom:1px}
|
||||
.fc-corner-bottom .fc-event-inner{margin-bottom:-1px;border-bottom-width:1px}
|
||||
.fc-corner-left .fc-event-inner{border-left-width:1px}
|
||||
.fc-border-separate th,.fc-border-separate td{border-width:1px 0 0 1px}
|
||||
.fc-border-separate tr.fc-last th,.fc-border-separate tr.fc-last td{border-bottom-width:1px}
|
||||
.fc-grid .fc-day-number{float:left;padding:0 2px}
|
||||
.fc-grid .fc-other-month .fc-day-number{opacity:0.4;filter:alpha(opacity=40)}
|
||||
.fc-grid .fc-day-content{clear:both;padding:2px 2px 1px}
|
||||
.fc-grid .fc-event-time{font-weight:700}
|
||||
.fc-rtl .fc-grid .fc-day-number{float:left}
|
||||
.fc-rtl .fc-grid .fc-event-time{float:right}
|
||||
.fc-agenda .fc-agenda-axis{width:50px;vertical-align:middle;text-align:right;white-space:nowrap;font-weight:400;padding:0 4px}
|
||||
.fc-agenda .fc-day-content{padding:2px 2px 1px}
|
||||
.fc-agenda-days .fc-col0{border-left-width:0}
|
||||
.fc-agenda-allday .fc-day-content{min-height:34px;_height:34px}
|
||||
.fc-agenda-divider-inner{height:2px;overflow:hidden}
|
||||
.fc-widget-header .fc-agenda-divider-inner{background:#eee}
|
||||
.fc-agenda-slots th{border-width:1px 1px 0}
|
||||
.fc-agenda-slots td{background:none;border-width:1px 0 0}
|
||||
.fc-agenda-slots td div{height:20px}
|
||||
.fc-agenda-slots tr.fc-minor th,.fc-agenda-slots tr.fc-minor td{border-top-style:dotted}
|
||||
.fc-agenda-slots tr.fc-minor th.ui-widget-header{border-top-style:solid}
|
||||
.fc-event-vert .fc-event-head,.fc-event-vert .fc-event-content{position:relative;z-index:2;width:100%;overflow:hidden}
|
||||
.fc-event-vert .fc-event-time{white-space:nowrap;font-size:10px}
|
||||
.fc-event-vert .fc-event-bg{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;background:#fff;opacity:.3;filter:alpha(opacity=30)}
|
||||
.fc .ui-draggable-dragging .fc-event-bg,/* TODO: something nicer like .fc-opacity */
|
||||
.fc-select-helper .fc-event-bg{display:none\9}
|
||||
.fc-event-vert .ui-resizable-s{bottom:0!important;width:100%!important;height:8px!important;overflow:hidden!important;line-height:8px!important;font-size:11px!important;font-family:monospace;text-align:center;cursor:s-resize}
|
||||
.fc-agenda .ui-resizable-resizing{_overflow:hidden}
|
||||
.fc-header-center,.fc-grid th,.fc-agenda-days th{text-align:center}
|
||||
.fc-header .fc-corner-right,.fc-corner-right{margin-right:1px}
|
||||
.fc-corner-right .fc-event-inner,.fc-border-separate th.fc-last,.fc-border-separate td.fc-last,.fc-agenda-days .fc-agenda-axis{border-right-width:1px}
|
||||
table.fc-border-separate,.fc-agenda table{border-collapse:separate}
|
||||
.fc-border-separate tbody tr.fc-first td,.fc-border-separate tbody tr.fc-first th,.fc-agenda-slots tr.fc-slot0 th,.fc-agenda-slots tr.fc-slot0 td{border-top-width:0}
|
||||
.fc-agenda-allday th,.fc-event-vert{border-width:0 1px}
|
||||
|
||||
|
||||
.fc thead {background: #f9f9f9;
|
||||
background: -moz-linear-gradient(top, #f9f9f9 0%, #ececec 100%);
|
||||
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f9f9f9), color-stop(100%,#ececec));
|
||||
background: -webkit-linear-gradient(top, #f9f9f9 0%,#ececec 100%);
|
||||
background: linear-gradient(top, #f9f9f9 0%,#ececec 100%);
|
||||
}
|
||||
.fc tbody {background:#fff}
|
||||
.fc thead th {background: none;padding:10px 0;font-size:14px;border-color:#e5e5e5 #e5e5e5 #dadada}
|
||||
.fc-header {position:relative}
|
||||
.fc-header-left {width:100%;float:none;height:38px;overflow:hidden}
|
||||
.fc-header-center {position:absolute;width:80%;text-align:center;left:10%;top:0}
|
||||
.fc-header-title h2{font-size:18px;color:#222;font-family: 'PT Sans', sans-serif;font-weight:400}
|
||||
.fc-header-right {position:absolute;width:auto;top:-48px;right:10px}
|
||||
.fc-header-right > .fc-btn {float:left;padding-right:12px;padding-left:12px;margin-right:2px;line-height:26px;color:#0088CC;display:block;border:1px solid transparent}
|
||||
.fc-header-right .fc-state-hover {background: #eee;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}
|
||||
.fc-header-right .fc-state-active {position:relative;top:-2px;line-height:30px;color:#555;background-color:#fff !important;border:1px solid #ddd;border-bottom-color:transparent;cursor:default;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}
|
||||
.fc-btn {cursor:pointer}
|
||||
.cal_prev {float:left;margin:11px 0 0 8px !important}
|
||||
.cal_next {float:right;margin:11px 8px 0 0 !important}
|
||||
.cal_prev,.cal_next {opacity:0.7}
|
||||
.cal_prev:hover,.cal_next:hover {opacity:1}
|
||||
.fc-state-hover .table_prev {background-position:0 -26px}
|
||||
.fc-state-hover .table_next {background-position:right -26px}
|
||||
.fc-day-number {font-size:11px;color:#777}
|
||||
.fc-event-title,.fc-event-time {padding-left:3px}
|
||||
.fc-button-today {vertical-align:middle;font-size:11px;margin-left:15px;color: #0088cc;display:inline-block}
|
||||
.fc-button-today.fc-state-disabled {color:#999;cursor:default}
|
||||
112
modules/lib/fullcalendar/gcal.js
Normal file
112
modules/lib/fullcalendar/gcal.js
Normal file
@ -0,0 +1,112 @@
|
||||
/*
|
||||
* FullCalendar v1.5.4 Google Calendar Plugin
|
||||
*
|
||||
* Copyright (c) 2011 Adam Shaw
|
||||
* Dual licensed under the MIT and GPL licenses, located in
|
||||
* MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
|
||||
*
|
||||
* Date: Tue Sep 4 23:38:33 2012 -0700
|
||||
*
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
|
||||
var fc = $.fullCalendar;
|
||||
var formatDate = fc.formatDate;
|
||||
var parseISO8601 = fc.parseISO8601;
|
||||
var addDays = fc.addDays;
|
||||
var applyAll = fc.applyAll;
|
||||
|
||||
|
||||
fc.sourceNormalizers.push(function(sourceOptions) {
|
||||
if (sourceOptions.dataType == 'gcal' ||
|
||||
sourceOptions.dataType === undefined &&
|
||||
(sourceOptions.url || '').match(/^(http|https):\/\/www.google.com\/calendar\/feeds\//)) {
|
||||
sourceOptions.dataType = 'gcal';
|
||||
if (sourceOptions.editable === undefined) {
|
||||
sourceOptions.editable = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
fc.sourceFetchers.push(function(sourceOptions, start, end) {
|
||||
if (sourceOptions.dataType == 'gcal') {
|
||||
return transformOptions(sourceOptions, start, end);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function transformOptions(sourceOptions, start, end) {
|
||||
|
||||
var success = sourceOptions.success;
|
||||
var data = $.extend({}, sourceOptions.data || {}, {
|
||||
'start-min': formatDate(start, 'u'),
|
||||
'start-max': formatDate(end, 'u'),
|
||||
'singleevents': true,
|
||||
'max-results': 9999
|
||||
});
|
||||
|
||||
var ctz = sourceOptions.currentTimezone;
|
||||
if (ctz) {
|
||||
data.ctz = ctz = ctz.replace(' ', '_');
|
||||
}
|
||||
|
||||
return $.extend({}, sourceOptions, {
|
||||
url: sourceOptions.url.replace(/\/basic$/, '/full') + '?alt=json-in-script&callback=?',
|
||||
dataType: 'jsonp',
|
||||
data: data,
|
||||
startParam: false,
|
||||
endParam: false,
|
||||
success: function(data) {
|
||||
var events = [];
|
||||
if (data.feed.entry) {
|
||||
$.each(data.feed.entry, function(i, entry) {
|
||||
var startStr = entry['gd$when'][0]['startTime'];
|
||||
var start = parseISO8601(startStr, true);
|
||||
var end = parseISO8601(entry['gd$when'][0]['endTime'], true);
|
||||
var allDay = startStr.indexOf('T') == -1;
|
||||
var url;
|
||||
$.each(entry.link, function(i, link) {
|
||||
if (link.type == 'text/html') {
|
||||
url = link.href;
|
||||
if (ctz) {
|
||||
url += (url.indexOf('?') == -1 ? '?' : '&') + 'ctz=' + ctz;
|
||||
}
|
||||
}
|
||||
});
|
||||
if (allDay) {
|
||||
addDays(end, -1); // make inclusive
|
||||
}
|
||||
events.push({
|
||||
id: entry['gCal$uid']['value'],
|
||||
title: entry['title']['$t'],
|
||||
url: url,
|
||||
start: start,
|
||||
end: end,
|
||||
allDay: allDay,
|
||||
location: entry['gd$where'][0]['valueString'],
|
||||
description: entry['content']['$t']
|
||||
});
|
||||
});
|
||||
}
|
||||
var args = [events].concat(Array.prototype.slice.call(arguments, 1));
|
||||
var res = applyAll(success, this, args);
|
||||
if ($.isArray(res)) {
|
||||
return res;
|
||||
}
|
||||
return events;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
// legacy
|
||||
fc.gcalFeed = function(url, sourceOptions) {
|
||||
return $.extend({}, sourceOptions, { url: url, dataType: 'gcal' });
|
||||
};
|
||||
|
||||
|
||||
})(jQuery);
|
||||
2
modules/lib/google-code-prettify/lang-apollo.js
Normal file
2
modules/lib/google-code-prettify/lang-apollo.js
Normal file
@ -0,0 +1,2 @@
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\n\r]*/,null,"#"],["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r <20>\xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/,
|
||||
null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[ES]?BANK=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[!-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["apollo","agc","aea"]);
|
||||
18
modules/lib/google-code-prettify/lang-clj.js
Normal file
18
modules/lib/google-code-prettify/lang-clj.js
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
Copyright (C) 2011 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.
|
||||
*/
|
||||
var a=null;
|
||||
PR.registerLangHandler(PR.createSimpleLexer([["opn",/^[([{]+/,a,"([{"],["clo",/^[)\]}]+/,a,")]}"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/,a],
|
||||
["typ",/^:[\dA-Za-z-]+/]]),["clj"]);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user