From 1795cb87292b2f31a7727640a630d04a8ff55953 Mon Sep 17 00:00:00 2001 From: Catouse Date: Wed, 16 Jul 2014 16:45:34 +0800 Subject: [PATCH] * rebuilt assets with gruntjs. --- Gruntfile.js | 69 +- assets/chartjs/chart.line.js | 956 ++---------- assets/chartjs/chart.line.min.js | 11 +- assets/chosen/css/chosen.css | 2 +- assets/chosen/css/chosen.min.css | 2 +- assets/chosen/js/chosen.all.js | 1387 +++++++++++++++++ assets/chosen/js/chosen.all.min.js | 14 +- assets/chosen/js/chosen.icons.js | 9 + assets/chosen/js/chosen.icons.min.js | 11 +- .../datetimepicker/css/datetimepicker.min.css | 2 +- .../datetimepicker/js/datetimepicker.min.js | 11 +- assets/kindeditor/themes/default/default.css | 1084 ++++++++++++- docs/mindmap.html | 4 +- src/js/chart.line.js | 947 +---------- ...ult.less => kindeditor-theme.default.less} | 0 15 files changed, 2748 insertions(+), 1761 deletions(-) create mode 100644 assets/chosen/js/chosen.all.js rename src/less/{kindeditor-default.less => kindeditor-theme.default.less} (100%) diff --git a/Gruntfile.js b/Gruntfile.js index 1637a8941..43352a45a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -43,7 +43,7 @@ module.exports = function(grunt) { options: { - banner: banner + statement, + banner: banner, stripBanners: false }, js: @@ -89,12 +89,17 @@ module.exports = function(grunt) }, mindmap: { - options: - { - banner: banner - }, src: [srcPath + 'js/mindmap.js'], dest: distJsPath + '<%= pkg.name %>-mindmap.js' + }, + assets: + { + files: + { + 'assets/chartjs/chart.line.js': srcPath + 'js/chart.line.js', + 'assets/chosen/js/chosen.icons.js': srcPath + 'js/chosen.icons.js', + 'assets/chosen/js/chosen.all.js': ['assets/chosen/js/chosen.jquery.js', 'assets/chosen/js/chosen.icons.js'] + } } }, @@ -102,18 +107,29 @@ module.exports = function(grunt) { options: { - banner: banner + statement + banner: banner }, js: { + options: {banner: banner + statement}, src: ['<%= concat.js.dest %>'], dest: distJsPath + '<%= pkg.name %>.min.js' }, mindmap: { - options: {banner: banner}, src: ['<%= concat.mindmap.dest %>'], dest: distJsPath + '<%= pkg.name %>-mindmap.min.js' + }, + assets: + { + files: + { + 'assets/chartjs/chart.line.min.js': 'assets/chartjs/chart.line.js', + 'assets/chosen/js/chosen.icons.min.js': 'assets/chosen/js/chosen.icons.js', + 'assets/chosen/js/chosen.all.min.js': 'assets/chosen/js/chosen.all.js', + 'assets/datetimepicker/js/datetimepicker.min.js': 'assets/datetimepicker/js/datetimepicker.js' + } + } }, @@ -177,6 +193,33 @@ module.exports = function(grunt) 'dist/css/<%= pkg.name %>-theme.min.css': distPath + 'css/<%= pkg.name %>-theme.css', 'dist/css/<%= pkg.name %>-mindmap.min.css': distPath + 'css/<%= pkg.name %>-mindmap.css' } + }, + assets: + { + options: + { + strictMath: true, + sourceMap: false + }, + files: + { + 'assets/datetimepicker/css/datetimepicker.css': srcPath + 'less/datetimepicker.less', + 'assets/kindeditor/themes/default/default.css': srcPath + 'less/kindeditor-theme.default.less', + 'assets/chosen/css/chosen.css': srcPath + 'less/chosen.less' + } + }, + 'assets-min': + { + options: + { + cleancss: true, + report: 'min' + }, + files: + { + 'assets/datetimepicker/css/datetimepicker.min.css': 'assets/datetimepicker/css/datetimepicker.css', + 'assets/chosen/css/chosen.min.css': 'assets/chosen/css/chosen.css' + } } }, @@ -224,11 +267,15 @@ module.exports = function(grunt) // These plugins provide necessary tasks. require('load-grunt-tasks')(grunt, {scope: 'devDependencies'}); - // JS distribution task - grunt.registerTask('dist-js', ['concat', 'uglify']); - grunt.registerTask('dist-css', ['less', 'csscomb', 'usebanner']); + // Distribution task + grunt.registerTask('dist-js', ['concat:mindmap', 'concat:js', 'uglify:js', 'uglify:mindmap']); + grunt.registerTask('dist-css', ['less:zui', 'less:theme', 'less:mindmap', 'less:min', 'csscomb', 'usebanner']); grunt.registerTask('dist-fonts', ['copy:fonts']); + grunt.registerTask('dist', ['clean', 'dist-js', 'dist-css', 'dist-fonts']); + + // assets componets task + grunt.registerTask('assets', ['less:assets', 'less:assets-min', 'concat:assets', 'uglify:assets']); // The default task - grunt.registerTask('default', ['clean', 'dist-js', 'dist-css', 'dist-fonts']); + grunt.registerTask('default', ['dist', 'assets']); } diff --git a/assets/chartjs/chart.line.js b/assets/chartjs/chart.line.js index 3766ac6ff..0ab747d27 100644 --- a/assets/chartjs/chart.line.js +++ b/assets/chartjs/chart.line.js @@ -1,3 +1,12 @@ +/*! + * ==================================================== + * ZUI - v1.1.0 - 2014-07-16 + * https://github.com/easysoft/zui + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2014 Catouse@easysoft; Licensed GNU + * ==================================================== + */ + /*! * Chart.js * http://chartjs.org/ @@ -11,11 +20,11 @@ window.Chart = function(context){ var chart = this; - - + + //Easing functions adapted from Robert Penner's easing equations //http://www.robertpenner.com/easing/ - + var animationOptions = { linear : function (t){ return t; @@ -123,7 +132,7 @@ window.Chart = function(context){ return 1*((t=t/1-1)*t*((s+1)*t + s) + 1); }, easeInOutBack: function (t) { - var s = 1.70158; + var s = 1.70158; if ((t/=1/2) < 1) return 1/2*(t*t*(((s*=(1.525))+1)*t - s)); return 1/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2); }, @@ -161,129 +170,8 @@ window.Chart = function(context){ context.scale(window.devicePixelRatio, window.devicePixelRatio); } - // this.PolarArea = function(data,options){ - - // chart.PolarArea.defaults = { - // scaleOverlay : true, - // scaleOverride : false, - // scaleSteps : null, - // scaleStepWidth : null, - // scaleStartValue : null, - // scaleShowLine : true, - // scaleLineColor : "rgba(0,0,0,.1)", - // scaleLineWidth : 1, - // scaleShowLabels : true, - // scaleLabel : "<%=value%>", - // scaleFontFamily : "'Arial'", - // scaleFontSize : 12, - // scaleFontStyle : "normal", - // scaleFontColor : "#666", - // scaleShowLabelBackdrop : true, - // scaleBackdropColor : "rgba(255,255,255,0.75)", - // scaleBackdropPaddingY : 2, - // scaleBackdropPaddingX : 2, - // segmentShowStroke : true, - // segmentStrokeColor : "#fff", - // segmentStrokeWidth : 2, - // animation : true, - // animationSteps : 100, - // animationEasing : "easeOutBounce", - // animateRotate : true, - // animateScale : false, - // onAnimationComplete : null - // }; - - // var config = (options)? mergeChartConfig(chart.PolarArea.defaults,options) : chart.PolarArea.defaults; - - // return new PolarArea(data,config,context); - // }; - - // this.Radar = function(data,options){ - - // chart.Radar.defaults = { - // scaleOverlay : false, - // scaleOverride : false, - // scaleSteps : null, - // scaleStepWidth : null, - // scaleStartValue : null, - // scaleShowLine : true, - // scaleLineColor : "rgba(0,0,0,.1)", - // scaleLineWidth : 1, - // scaleShowLabels : false, - // scaleLabel : "<%=value%>", - // scaleFontFamily : "'Arial'", - // scaleFontSize : 12, - // scaleFontStyle : "normal", - // scaleFontColor : "#666", - // scaleShowLabelBackdrop : true, - // scaleBackdropColor : "rgba(255,255,255,0.75)", - // scaleBackdropPaddingY : 2, - // scaleBackdropPaddingX : 2, - // angleShowLineOut : true, - // angleLineColor : "rgba(0,0,0,.1)", - // angleLineWidth : 1, - // pointLabelFontFamily : "'Arial'", - // pointLabelFontStyle : "normal", - // pointLabelFontSize : 12, - // pointLabelFontColor : "#666", - // pointDot : true, - // pointDotRadius : 3, - // pointDotStrokeWidth : 1, - // datasetStroke : true, - // datasetStrokeWidth : 2, - // datasetFill : true, - // animation : true, - // animationSteps : 60, - // animationEasing : "easeOutQuart", - // onAnimationComplete : null - // }; - - // var config = (options)? mergeChartConfig(chart.Radar.defaults,options) : chart.Radar.defaults; - - // return new Radar(data,config,context); - // }; - - // this.Pie = function(data,options){ - // chart.Pie.defaults = { - // segmentShowStroke : true, - // segmentStrokeColor : "#fff", - // segmentStrokeWidth : 2, - // animation : true, - // animationSteps : 100, - // animationEasing : "easeOutBounce", - // animateRotate : true, - // animateScale : false, - // onAnimationComplete : null - // }; - - // var config = (options)? mergeChartConfig(chart.Pie.defaults,options) : chart.Pie.defaults; - - // return new Pie(data,config,context); - // }; - - // this.Doughnut = function(data,options){ - - // chart.Doughnut.defaults = { - // segmentShowStroke : true, - // segmentStrokeColor : "#fff", - // segmentStrokeWidth : 2, - // percentageInnerCutout : 50, - // animation : true, - // animationSteps : 100, - // animationEasing : "easeOutBounce", - // animateRotate : true, - // animateScale : false, - // onAnimationComplete : null - // }; - - // var config = (options)? mergeChartConfig(chart.Doughnut.defaults,options) : chart.Doughnut.defaults; - - // return new Doughnut(data,config,context); - - // }; - this.Line = function(data,options){ - + chart.Line.defaults = { scaleOverlay : false, scaleOverride : false, @@ -312,490 +200,26 @@ window.Chart = function(context){ animationSteps : 30, animationEasing : "easeOutQuart", onAnimationComplete : null - }; + }; var config = (options) ? mergeChartConfig(chart.Line.defaults,options) : chart.Line.defaults; - + return new Line(data,config,context); } - - // this.Bar = function(data,options){ - // chart.Bar.defaults = { - // scaleOverlay : false, - // scaleOverride : false, - // scaleSteps : null, - // scaleStepWidth : null, - // scaleStartValue : null, - // scaleLineColor : "rgba(0,0,0,.1)", - // scaleLineWidth : 1, - // scaleShowLabels : true, - // scaleLabel : "<%=value%>", - // scaleFontFamily : "'Arial'", - // scaleFontSize : 12, - // scaleFontStyle : "normal", - // scaleFontColor : "#666", - // scaleShowGridLines : true, - // scaleGridLineColor : "rgba(0,0,0,.05)", - // scaleGridLineWidth : 1, - // barShowStroke : true, - // barStrokeWidth : 2, - // barValueSpacing : 5, - // barDatasetSpacing : 1, - // animation : true, - // animationSteps : 60, - // animationEasing : "easeOutQuart", - // onAnimationComplete : null - // }; - // var config = (options) ? mergeChartConfig(chart.Bar.defaults,options) : chart.Bar.defaults; - - // return new Bar(data,config,context); - // } - + var clear = function(c){ c.clearRect(0, 0, width, height); }; - // var PolarArea = function(data,config,ctx){ - // var maxSize, scaleHop, calculatedScale, labelHeight, scaleHeight, valueBounds, labelTemplateString; - - - // calculateDrawingSizes(); - - // valueBounds = getValueBounds(); - - // labelTemplateString = (config.scaleShowLabels)? config.scaleLabel : null; - - // //Check and set the scale - // if (!config.scaleOverride){ - - // calculatedScale = calculateScale(scaleHeight,valueBounds.maxSteps,valueBounds.minSteps,valueBounds.maxValue,valueBounds.minValue,labelTemplateString); - // } - // else { - // calculatedScale = { - // steps : config.scaleSteps, - // stepValue : config.scaleStepWidth, - // graphMin : config.scaleStartValue, - // labels : [] - // } - // populateLabels(labelTemplateString, calculatedScale.labels,calculatedScale.steps,config.scaleStartValue,config.scaleStepWidth); - // } - - // scaleHop = maxSize/(calculatedScale.steps); - - // //Wrap in an animation loop wrapper - // animationLoop(config,drawScale,drawAllSegments,ctx); - - // function calculateDrawingSizes(){ - // maxSize = (Min([width,height])/2); - // //Remove whatever is larger - the font size or line width. - - // maxSize -= Max([config.scaleFontSize*0.5,config.scaleLineWidth*0.5]); - - // labelHeight = config.scaleFontSize*2; - // //If we're drawing the backdrop - add the Y padding to the label height and remove from drawing region. - // if (config.scaleShowLabelBackdrop){ - // labelHeight += (2 * config.scaleBackdropPaddingY); - // maxSize -= config.scaleBackdropPaddingY*1.5; - // } - - // scaleHeight = maxSize; - // //If the label height is less than 5, set it to 5 so we don't have lines on top of each other. - // labelHeight = Default(labelHeight,5); - // } - // function drawScale(){ - // for (var i=0; i upperValue) {upperValue = data[i].value;} - // if (data[i].value < lowerValue) {lowerValue = data[i].value;} - // }; - - // var maxSteps = Math.floor((scaleHeight / (labelHeight*0.66))); - // var minSteps = Math.floor((scaleHeight / labelHeight*0.5)); - - // return { - // maxValue : upperValue, - // minValue : lowerValue, - // maxSteps : maxSteps, - // minSteps : minSteps - // }; - - - // } - // } - - // var Radar = function (data,config,ctx) { - // var maxSize, scaleHop, calculatedScale, labelHeight, scaleHeight, valueBounds, labelTemplateString; - - // //If no labels are defined set to an empty array, so referencing length for looping doesn't blow up. - // if (!data.labels) data.labels = []; - - // calculateDrawingSizes(); - - // var valueBounds = getValueBounds(); - - // labelTemplateString = (config.scaleShowLabels)? config.scaleLabel : null; - - // //Check and set the scale - // if (!config.scaleOverride){ - - // calculatedScale = calculateScale(scaleHeight,valueBounds.maxSteps,valueBounds.minSteps,valueBounds.maxValue,valueBounds.minValue,labelTemplateString); - // } - // else { - // calculatedScale = { - // steps : config.scaleSteps, - // stepValue : config.scaleStepWidth, - // graphMin : config.scaleStartValue, - // labels : [] - // } - // populateLabels(labelTemplateString, calculatedScale.labels,calculatedScale.steps,config.scaleStartValue,config.scaleStepWidth); - // } - - // scaleHop = maxSize/(calculatedScale.steps); - - // animationLoop(config,drawScale,drawAllDataPoints,ctx); - - // //Radar specific functions. - // function drawAllDataPoints(animationDecimal){ - // var rotationDegree = (2*Math.PI)/data.datasets[0].data.length; - - // ctx.save(); - // //translate to the centre of the canvas. - // ctx.translate(width/2,height/2); - - // //We accept multiple data sets for radar charts, so show loop through each set - // for (var i=0; i Math.PI){ - // ctx.textAlign = "right"; - // } - // else{ - // ctx.textAlign = "left"; - // } - - // ctx.textBaseline = "middle"; - - // ctx.fillText(data.labels[k],opposite,-adjacent); - - // } - // ctx.restore(); - // }; - // function calculateDrawingSizes(){ - // maxSize = (Min([width,height])/2); - - // labelHeight = config.scaleFontSize*2; - - // var labelLength = 0; - // for (var i=0; ilabelLength) labelLength = textMeasurement; - // } - - // //Figure out whats the largest - the height of the text or the width of what's there, and minus it from the maximum usable size. - // maxSize -= Max([labelLength,((config.pointLabelFontSize/2)*1.5)]); - - // maxSize -= config.pointLabelFontSize; - // maxSize = CapValue(maxSize, null, 0); - // scaleHeight = maxSize; - // //If the label height is less than 5, set it to 5 so we don't have lines on top of each other. - // labelHeight = Default(labelHeight,5); - // }; - // function getValueBounds() { - // var upperValue = Number.MIN_VALUE; - // var lowerValue = Number.MAX_VALUE; - - // for (var i=0; i upperValue){upperValue = data.datasets[i].data[j]} - // if (data.datasets[i].data[j] < lowerValue){lowerValue = data.datasets[i].data[j]} - // } - // } - - // var maxSteps = Math.floor((scaleHeight / (labelHeight*0.66))); - // var minSteps = Math.floor((scaleHeight / labelHeight*0.5)); - - // return { - // maxValue : upperValue, - // minValue : lowerValue, - // maxSteps : maxSteps, - // minSteps : minSteps - // }; - - - // } - // } - - // var Pie = function(data,config,ctx){ - // var segmentTotal = 0; - - // //In case we have a canvas that is not a square. Minus 5 pixels as padding round the edge. - // var pieRadius = Min([height/2,width/2]) - 5; - - // for (var i=0; i 0){ ctx.save(); ctx.textAlign = "right"; @@ -884,26 +308,26 @@ window.Chart = function(context){ // ctx.fillText(data.labels[i], 0,0); // ctx.restore(); // } - + // else{ - // ctx.fillText(data.labels[i], yAxisPosX + i*valueHop,xAxisPosY + config.scaleFontSize+3); + // ctx.fillText(data.labels[i], yAxisPosX + i*valueHop,xAxisPosY + config.scaleFontSize+3); // } ctx.beginPath(); ctx.moveTo(yAxisPosX + i * valueHop, xAxisPosY+3); - + //Check i isnt 0, so we dont go over the Y axis twice. if(config.scaleShowGridLines && i>0){ ctx.lineWidth = config.scaleGridLineWidth; - ctx.strokeStyle = config.scaleGridLineColor; + ctx.strokeStyle = config.scaleGridLineColor; ctx.lineTo(yAxisPosX + i * valueHop, 5); } else{ - ctx.lineTo(yAxisPosX + i * valueHop, xAxisPosY+3); + ctx.lineTo(yAxisPosX + i * valueHop, xAxisPosY+3); } ctx.stroke(); } - + //Y axis ctx.lineWidth = config.scaleLineWidth; ctx.strokeStyle = config.scaleLineColor; @@ -911,7 +335,7 @@ window.Chart = function(context){ // ctx.moveTo(yAxisPosX,xAxisPosY+5); // ctx.lineTo(yAxisPosX,5); // ctx.stroke(); - + ctx.textAlign = "right"; ctx.textBaseline = "middle"; for (var j=0; j 0){ - // ctx.save(); - // ctx.textAlign = "right"; - // } - // else{ - // ctx.textAlign = "center"; - // } - // ctx.fillStyle = config.scaleFontColor; - // for (var i=0; i 0){ - // ctx.translate(yAxisPosX + i*valueHop,xAxisPosY + config.scaleFontSize); - // ctx.rotate(-(rotateLabels * (Math.PI/180))); - // ctx.fillText(data.labels[i], 0,0); - // ctx.restore(); - // } - - // else{ - // ctx.fillText(data.labels[i], yAxisPosX + i*valueHop + valueHop/2,xAxisPosY + config.scaleFontSize+3); - // } - - // ctx.beginPath(); - // ctx.moveTo(yAxisPosX + (i+1) * valueHop, xAxisPosY+3); - - // //Check i isnt 0, so we dont go over the Y axis twice. - // ctx.lineWidth = config.scaleGridLineWidth; - // ctx.strokeStyle = config.scaleGridLineColor; - // ctx.lineTo(yAxisPosX + (i+1) * valueHop, 5); - // ctx.stroke(); - // } - - // //Y axis - // ctx.lineWidth = config.scaleLineWidth; - // ctx.strokeStyle = config.scaleLineColor; - // ctx.beginPath(); - // ctx.moveTo(yAxisPosX,xAxisPosY+5); - // ctx.lineTo(yAxisPosX,5); - // ctx.stroke(); - - // ctx.textAlign = "right"; - // ctx.textBaseline = "middle"; - // for (var j=0; j longestText)? measuredText : longestText; - // } - // //Add a little extra padding from the y axis - // longestText +=10; - // } - // xAxisLength = width - longestText - widestXLabel; - // valueHop = Math.floor(xAxisLength/(data.labels.length)); - - // barWidth = (valueHop - config.scaleGridLineWidth*2 - (config.barValueSpacing*2) - (config.barDatasetSpacing*data.datasets.length-1) - ((config.barStrokeWidth/2)*data.datasets.length-1))/data.datasets.length; - - // yAxisPosX = width-widestXLabel/2-xAxisLength; - // xAxisPosY = scaleHeight + config.scaleFontSize/2; - // } - // function calculateDrawingSizes(){ - // maxSize = height; - - // //Need to check the X axis first - measure the length of each text metric, and figure out if we need to rotate by 45 degrees. - // ctx.font = config.scaleFontStyle + " " + config.scaleFontSize+"px " + config.scaleFontFamily; - // widestXLabel = 1; - // for (var i=0; i widestXLabel)? textLength : widestXLabel; - // } - // if (width/data.labels.length < widestXLabel){ - // rotateLabels = 45; - // if (width/data.labels.length < Math.cos(rotateLabels) * widestXLabel){ - // rotateLabels = 90; - // maxSize -= widestXLabel; - // } - // else{ - // maxSize -= Math.sin(rotateLabels) * widestXLabel; - // } - // } - // else{ - // maxSize -= config.scaleFontSize; - // } - - // //Add a little padding between the x line and the text - // maxSize -= 5; - - - // labelHeight = config.scaleFontSize; - - // maxSize -= labelHeight; - // //Set 5 pixels greater than the font size to allow for a little padding from the X axis. - - // scaleHeight = maxSize; - - // //Then get the area above we can safely draw on. - - // } - // function getValueBounds() { - // var upperValue = Number.MIN_VALUE; - // var lowerValue = Number.MAX_VALUE; - // for (var i=0; i upperValue) { upperValue = data.datasets[i].data[j] }; - // if ( data.datasets[i].data[j] < lowerValue) { lowerValue = data.datasets[i].data[j] }; - // } - // }; - - // var maxSteps = Math.floor((scaleHeight / (labelHeight*0.66))); - // var minSteps = Math.floor((scaleHeight / labelHeight*0.5)); - - // return { - // maxValue : upperValue, - // minValue : lowerValue, - // maxSteps : maxSteps, - // minSteps : minSteps - // }; - - - // } - // } - + function calculateOffset(val,calculatedScale,scaleHop){ var outerValue = calculatedScale.steps * calculatedScale.stepValue; var adjustedValue = val - calculatedScale.graphMin; var scalingFactor = CapValue(adjustedValue/outerValue,1,0); return (scaleHop*calculatedScale.steps) * scalingFactor; } - + function animationLoop(config,drawScale,drawData,ctx){ var animFrameAmount = (config.animation)? 1/CapValue(config.animationSteps,Number.MAX_VALUE,1) : 1, easingFunction = animationOptions[config.animationEasing], percentAnimComplete =(config.animation)? 0 : 1; - - - + + + if (typeof drawScale !== "function") drawScale = function(){}; - + requestAnimFrame(animLoop); - + function animateFrame(){ var easeAdjustedAnimationPercent =(config.animation)? CapValue(easingFunction(percentAnimComplete),null,0) : 1; clear(ctx); @@ -1228,12 +446,12 @@ window.Chart = function(context){ } else { drawScale(); drawData(easeAdjustedAnimationPercent); - } + } } function animLoop(){ //We need to check if the animation is incomplete (less than 1), or complete (1). percentAnimComplete += animFrameAmount; - animateFrame(); + animateFrame(); //Stop the loop continuing forever if (percentAnimComplete <= 1){ requestAnimFrame(animLoop); @@ -1241,14 +459,14 @@ window.Chart = function(context){ else{ if (typeof config.onAnimationComplete == "function") config.onAnimationComplete(); } - - } - + + } + } //Declare global functions to be called within this namespace here. - - + + // shim layer with setTimeout fallback var requestAnimFrame = (function(){ return window.requestAnimationFrame || @@ -1263,22 +481,22 @@ window.Chart = function(context){ function calculateScale(drawingHeight,maxSteps,minSteps,maxValue,minValue,labelTemplateString){ var graphMin,graphMax,graphRange,stepValue,numberOfSteps,valueRange,rangeOrderOfMagnitude,decimalNum; - + valueRange = maxValue - minValue; - + rangeOrderOfMagnitude = calculateOrderOfMagnitude(valueRange); graphMin = Math.floor(minValue / (1 * Math.pow(10, rangeOrderOfMagnitude))) * Math.pow(10, rangeOrderOfMagnitude); - + graphMax = Math.ceil(maxValue / (1 * Math.pow(10, rangeOrderOfMagnitude))) * Math.pow(10, rangeOrderOfMagnitude); - + graphRange = graphMax - graphMin; - + stepValue = Math.pow(10, rangeOrderOfMagnitude); - + numberOfSteps = Math.round(graphRange / stepValue); - - //Compare number of steps to the max and min for that size graph, and add in half steps if need be. + + //Compare number of steps to the max and min for that size graph, and add in half steps if need be. while(numberOfSteps < minSteps || numberOfSteps > maxSteps) { if (numberOfSteps < minSteps){ stepValue /= 2; @@ -1292,18 +510,18 @@ window.Chart = function(context){ var labels = []; populateLabels(labelTemplateString, labels, numberOfSteps, graphMin, stepValue); - + return { steps : numberOfSteps, stepValue : stepValue, graphMin : graphMin, - labels : labels - + labels : labels + } - + function calculateOrderOfMagnitude(val){ return Math.floor(Math.log(val) / Math.LN10); - } + } } @@ -1317,7 +535,7 @@ window.Chart = function(context){ } } } - + //Max value from array function Max( array ){ return Math.max.apply( Math, array ); @@ -1360,34 +578,34 @@ window.Chart = function(context){ else{ return 0; } - - } - + + } + function mergeChartConfig(defaults,userDefined){ var returnObj = {}; for (var attrname in defaults) { returnObj[attrname] = defaults[attrname]; } for (var attrname in userDefined) { returnObj[attrname] = userDefined[attrname]; } return returnObj; } - + //Javascript micro templating by John Resig - source at http://ejohn.org/blog/javascript-micro-templating/ var cache = {}; - + function tmpl(str, data){ // Figure out if we're getting a template, or if we need to // load the template - and be sure to cache the result. var fn = !/\W/.test(str) ? cache[str] = cache[str] || tmpl(document.getElementById(str).innerHTML) : - + // Generate a reusable function that will serve as a template // generator (and which will be cached). new Function("obj", "var p=[],print=function(){p.push.apply(p,arguments);};" + - + // Introduce the data as local variables using with(){} "with(obj){p.push('" + - + // Convert the template into pure JavaScript str .replace(/[\r\t\n]/g, " ") @@ -1398,7 +616,7 @@ window.Chart = function(context){ .split("%>").join("p.push('") .split("\r").join("\\'") + "');}return p.join('');"); - + // Provide some basic currying to the user return data ? fn( data ) : fn; }; diff --git a/assets/chartjs/chart.line.min.js b/assets/chartjs/chart.line.min.js index 3d7642340..37769d6e1 100644 --- a/assets/chartjs/chart.line.min.js +++ b/assets/chartjs/chart.line.min.js @@ -1 +1,10 @@ -window.Chart=function(t){function e(t,e,i){var n=e.steps*e.stepValue,o=t-e.graphMin,a=s(o/n,1,0);return i*e.steps*a}function i(t,e,i,n){function o(){var o=t.animation?s(d(l),null,0):1;f(n),t.scaleOverlay?(i(o),e()):(e(),i(o))}function a(){l+=r,o(),1>=l?v(a):"function"==typeof t.onAnimationComplete&&t.onAnimationComplete()}var r=t.animation?1/s(t.animationSteps,Number.MAX_VALUE,1):1,d=c[t.animationEasing],l=t.animation?0:1;"function"!=typeof e&&(e=function(){}),v(a)}function n(t,e,i,n,a,s){function r(t){return Math.floor(Math.log(t)/Math.LN10)}var d,l,h,c,p,u,f;for(u=n-a,f=r(u),d=Math.floor(a/(1*Math.pow(10,f)))*Math.pow(10,f),l=Math.ceil(n/(1*Math.pow(10,f)))*Math.pow(10,f),h=l-d,c=Math.pow(10,f),p=Math.round(h/c);i>p||p>e;)i>p?(c/=2,p=Math.round(h/c)):(c*=2,p=Math.round(h/c));var g=[];return o(s,g,p,d,c),{steps:p,stepValue:c,graphMin:d,labels:g}}function o(t,e,i,n,o){if(t)for(var a=1;i+1>a;a++)e.push(l(t,{value:(n+o*a).toFixed(r(o))}))}function a(t){return!isNaN(parseFloat(t))&&isFinite(t)}function s(t,e,i){return a(e)&&t>e?e:a(i)&&i>t?i:t}function r(t){return 0!=t%1?t.toString().split(".")[1].length:0}function d(t,e){var i={};for(var n in t)i[n]=t[n];for(var n in e)i[n]=e[n];return i}function l(t,e){var i=/\W/.test(t)?new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+t.replace(/[\r\t\n]/g," ").split("<%").join(" ").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split(" ").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');"):m[t]=m[t]||l(document.getElementById(t).innerHTML);return e?i(e):i}var h=this,c={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-1*t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-0.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return 1*((t=t/1-1)*t*t+1)},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-1*((t=t/1-1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-0.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return 1*(t/=1)*t*t*t*t},easeOutQuint:function(t){return 1*((t=t/1-1)*t*t*t*t+1)},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return-1*Math.cos(t/1*(Math.PI/2))+1},easeOutSine:function(t){return 1*Math.sin(t/1*(Math.PI/2))},easeInOutSine:function(t){return-0.5*(Math.cos(Math.PI*t/1)-1)},easeInExpo:function(t){return 0==t?1:1*Math.pow(2,10*(t/1-1))},easeOutExpo:function(t){return 1==t?1:1*(-Math.pow(2,-10*t/1)+1)},easeInOutExpo:function(t){return 0==t?0:1==t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(-Math.pow(2,-10*--t)+2)},easeInCirc:function(t){return t>=1?t:-1*(Math.sqrt(1-(t/=1)*t)-1)},easeOutCirc:function(t){return 1*Math.sqrt(1-(t=t/1-1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-0.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,i=0,n=1;if(0==t)return 0;if(1==(t/=1))return 1;if(i||(i=.3),nt?-.5*n*Math.pow(2,10*(t-=1))*Math.sin((1*t-e)*2*Math.PI/i):.5*n*Math.pow(2,-10*(t-=1))*Math.sin((1*t-e)*2*Math.PI/i)+1},easeInBack:function(t){var e=1.70158;return 1*(t/=1)*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return 1*((t=t/1-1)*t*((e+1)*t+e)+1)},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?.5*t*t*(((e*=1.525)+1)*t-e):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:function(t){return 1-c.easeOutBounce(1-t)},easeOutBounce:function(t){return(t/=1)<1/2.75?1*7.5625*t*t:2/2.75>t?1*(7.5625*(t-=1.5/2.75)*t+.75):2.5/2.75>t?1*(7.5625*(t-=2.25/2.75)*t+.9375):1*(7.5625*(t-=2.625/2.75)*t+.984375)},easeInOutBounce:function(t){return.5>t?.5*c.easeInBounce(2*t):.5*c.easeOutBounce(2*t-1)+.5}},p=t.canvas.width,u=t.canvas.height;window.devicePixelRatio&&(t.canvas.style.width=p+"px",t.canvas.style.height=u+"px",t.canvas.height=u*window.devicePixelRatio,t.canvas.width=p*window.devicePixelRatio,t.scale(window.devicePixelRatio,window.devicePixelRatio)),this.Line=function(e,i){h.Line.defaults={scaleOverlay:!1,scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!1,scaleLabel:"<%=value%>",scaleFontFamily:"'Arial'",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",scaleShowGridLines:!1,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,bezierCurve:!0,pointDot:!1,pointDotRadius:4,pointDotStrokeWidth:2,datasetStroke:!0,datasetStrokeWidth:1,datasetFill:!0,animation:!0,animationSteps:30,animationEasing:"easeOutQuart",onAnimationComplete:null};var n=i?d(h.Line.defaults,i):h.Line.defaults;return new g(e,n,t)};var f=function(t){t.clearRect(0,0,p,u)},g=function(t,a,s){function r(i){function n(n,o){return D-i*e(t.datasets[n].data[o],v,g)}function o(t){return T+x*t}for(var r=0;r0?(s.save(),s.textAlign="right"):s.textAlign="center",s.fillStyle=a.scaleFontColor;for(var e=0;e0?(s.lineWidth=a.scaleGridLineWidth,s.strokeStyle=a.scaleGridLineColor,s.lineTo(T+e*x,5)):s.lineTo(T+e*x,D+3),s.stroke();s.lineWidth=a.scaleLineWidth,s.strokeStyle=a.scaleLineColor,s.textAlign="right",s.textBaseline="middle";for(var i=0;iC?i:C}p/t.labels.lengthe&&(e=t.datasets[n].data[o]),t.datasets[n].data[o]=j?q(f):"function"==typeof a.onAnimationComplete&&a.onAnimationComplete()}var h=a.animation?1/g(a.animationSteps,Number.MAX_VALUE,1):1,i=l[a.animationEasing],j=a.animation?0:1;"function"!=typeof b&&(b=function(){}),q(f)}function d(a,b,c,d,f,g){function h(a){return Math.floor(Math.log(a)/Math.LN10)}var i,j,k,l,m,n,o;for(n=d-f,o=h(n),i=Math.floor(f/(1*Math.pow(10,o)))*Math.pow(10,o),j=Math.ceil(d/(1*Math.pow(10,o)))*Math.pow(10,o),k=j-i,l=Math.pow(10,o),m=Math.round(k/l);c>m||m>b;)c>m?(l/=2,m=Math.round(k/l)):(l*=2,m=Math.round(k/l));var p=[];return e(g,p,m,i,l),{steps:m,stepValue:l,graphMin:i,labels:p}}function e(a,b,c,d,e){if(a)for(var f=1;c+1>f;f++)b.push(j(a,{value:(d+e*f).toFixed(h(e))}))}function f(a){return!isNaN(parseFloat(a))&&isFinite(a)}function g(a,b,c){return f(b)&&a>b?b:f(c)&&c>a?c:a}function h(a){return a%1!=0?a.toString().split(".")[1].length:0}function i(a,b){var c={};for(var d in a)c[d]=a[d];for(var d in b)c[d]=b[d];return c}function j(a,b){var c=/\W/.test(a)?new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+a.replace(/[\r\t\n]/g," ").split("<%").join(" ").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split(" ").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');"):r[a]=r[a]||j(document.getElementById(a).innerHTML);return b?c(b):c}var k=this,l={linear:function(a){return a},easeInQuad:function(a){return a*a},easeOutQuad:function(a){return-1*a*(a-2)},easeInOutQuad:function(a){return(a/=.5)<1?.5*a*a:-0.5*(--a*(a-2)-1)},easeInCubic:function(a){return a*a*a},easeOutCubic:function(a){return 1*((a=a/1-1)*a*a+1)},easeInOutCubic:function(a){return(a/=.5)<1?.5*a*a*a:.5*((a-=2)*a*a+2)},easeInQuart:function(a){return a*a*a*a},easeOutQuart:function(a){return-1*((a=a/1-1)*a*a*a-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*a*a*a*a:-0.5*((a-=2)*a*a*a-2)},easeInQuint:function(a){return 1*(a/=1)*a*a*a*a},easeOutQuint:function(a){return 1*((a=a/1-1)*a*a*a*a+1)},easeInOutQuint:function(a){return(a/=.5)<1?.5*a*a*a*a*a:.5*((a-=2)*a*a*a*a+2)},easeInSine:function(a){return-1*Math.cos(a/1*(Math.PI/2))+1},easeOutSine:function(a){return 1*Math.sin(a/1*(Math.PI/2))},easeInOutSine:function(a){return-0.5*(Math.cos(Math.PI*a/1)-1)},easeInExpo:function(a){return 0==a?1:1*Math.pow(2,10*(a/1-1))},easeOutExpo:function(a){return 1==a?1:1*(-Math.pow(2,-10*a/1)+1)},easeInOutExpo:function(a){return 0==a?0:1==a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return a>=1?a:-1*(Math.sqrt(1-(a/=1)*a)-1)},easeOutCirc:function(a){return 1*Math.sqrt(1-(a=a/1-1)*a)},easeInOutCirc:function(a){return(a/=.5)<1?-0.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeInElastic:function(a){var b=1.70158,c=0,d=1;if(0==a)return 0;if(1==(a/=1))return 1;if(c||(c=.3),da?-.5*d*Math.pow(2,10*(a-=1))*Math.sin(2*(1*a-b)*Math.PI/c):d*Math.pow(2,-10*(a-=1))*Math.sin(2*(1*a-b)*Math.PI/c)*.5+1},easeInBack:function(a){var b=1.70158;return 1*(a/=1)*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return 1*((a=a/1-1)*a*((b+1)*a+b)+1)},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},easeInBounce:function(a){return 1-l.easeOutBounce(1-a)},easeOutBounce:function(a){return(a/=1)<1/2.75?7.5625*a*a:2/2.75>a?1*(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?1*(7.5625*(a-=2.25/2.75)*a+.9375):1*(7.5625*(a-=2.625/2.75)*a+.984375)},easeInOutBounce:function(a){return.5>a?.5*l.easeInBounce(2*a):.5*l.easeOutBounce(2*a-1)+.5}},m=a.canvas.width,n=a.canvas.height;window.devicePixelRatio&&(a.canvas.style.width=m+"px",a.canvas.style.height=n+"px",a.canvas.height=n*window.devicePixelRatio,a.canvas.width=m*window.devicePixelRatio,a.scale(window.devicePixelRatio,window.devicePixelRatio)),this.Line=function(b,c){k.Line.defaults={scaleOverlay:!1,scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!1,scaleLabel:"<%=value%>",scaleFontFamily:"'Arial'",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",scaleShowGridLines:!1,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,bezierCurve:!0,pointDot:!1,pointDotRadius:4,pointDotStrokeWidth:2,datasetStroke:!0,datasetStrokeWidth:1,datasetFill:!0,animation:!0,animationSteps:30,animationEasing:"easeOutQuart",onAnimationComplete:null};var d=c?i(k.Line.defaults,c):k.Line.defaults;return new p(b,d,a)};var o=function(a){a.clearRect(0,0,m,n)},p=function(a,f,g){function h(c){function d(d,e){return z-c*b(a.datasets[d].data[e],q,p)}function e(a){return y+v*a}for(var h=0;h0?(g.save(),g.textAlign="right"):g.textAlign="center",g.fillStyle=f.scaleFontColor;for(var b=0;b0?(g.lineWidth=f.scaleGridLineWidth,g.strokeStyle=f.scaleGridLineColor,g.lineTo(y+b*v,5)):g.lineTo(y+b*v,z+3),g.stroke();g.lineWidth=f.scaleLineWidth,g.strokeStyle=f.scaleLineColor,g.textAlign="right",g.textBaseline="middle";for(var c=0;cw?c:w}m/a.labels.lengthb&&(b=a.datasets[d].data[e]),a.datasets[d].data[e]span{display:block;overflow:hidden;margin-right:26px;text-overflow:ellipsis;white-space:nowrap}.chosen-container-single .chosen-single-with-deselect span{margin-right:38px}.chosen-container-single .chosen-single abbr{position:absolute;top:7px;right:24px;display:block;width:19.5px;height:19.5px;line-height:19.5px;font-size:19.5px;font-weight:700;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.chosen-container-single .chosen-single abbr:before{content:'×'}.chosen-container-single .chosen-single abbr:focus,.chosen-container-single .chosen-single abbr:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.5;filter:alpha(opacity=50)}.chosen-container-single .chosen-single div{position:absolute;top:0;right:0;display:block;height:100%;padding:5px 8px}.chosen-container-single .chosen-single div b{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid #333;border-right:4px solid transparent;border-left:4px solid transparent;border-bottom:0 dotted}.chosen-container-single .chosen-search{position:relative;z-index:1010;margin:0;padding:3px 4px;white-space:nowrap}.chosen-container-single .chosen-search input[type=text]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:1px 0;padding:2px 26px 2px 8px;width:100%;height:auto;outline:0;border:1px solid #ccc;border-radius:4px;background-color:#fff;font-size:12px;line-height:1.5}.chosen-container-single .chosen-search input[type=text]:focus{border-color:#145ccd}.chosen-container-single .chosen-search:before{position:absolute;display:block;right:10px;color:gray;top:8px;content:"\e603";font-family:ZenIcon}.chosen-container-single .chosen-drop{margin-top:-1px;border-radius:0 0 4px 4px;background-clip:padding-box}.chosen-container-single.chosen-container-single-nosearch .chosen-search{position:absolute;left:-9999px}.chosen-container .chosen-results{position:relative;overflow-x:hidden;overflow-y:auto;margin:0;padding:0;max-height:240px;-webkit-overflow-scrolling:touch}.chosen-container .chosen-results li{display:none;margin:0;padding:5px 10px;list-style:none;line-height:15px;-webkit-touch-callout:none;-webkit-transition:background-color .3s cubic-bezier(0.175,.885,.32,1);transition:background-color .3s cubic-bezier(0.175,.885,.32,1)}.chosen-container .chosen-results li.active-result{display:list-item;cursor:pointer}.chosen-container .chosen-results li.disabled-result{display:list-item;color:#ccc;cursor:default}.chosen-container .chosen-results li.highlighted{color:#fff;background-color:#3280fc}.chosen-container .chosen-results li.no-results{display:list-item;background:#f4f4f4}.chosen-container .chosen-results li.group-result{display:list-item;font-weight:700;cursor:default}.chosen-container .chosen-results li.group-option{padding-left:15px}.chosen-container .chosen-results li em{font-style:normal;text-decoration:underline}.chosen-container-multi .chosen-choices{position:relative;overflow:hidden;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;width:100%;min-height:32px;min-height:30px \0;border:1px solid #ccc;border-radius:4px;background-color:#fff;cursor:text;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.chosen-container-multi .chosen-choices:after,.chosen-container-multi .chosen-choices:before{content:" ";display:table}.chosen-container-multi .chosen-choices:after{clear:both}.chosen-container-multi .chosen-choices li{display:block;float:left;list-style:none;padding:0 6px;margin:4px 0 0 6px}.chosen-container-multi .chosen-choices li.search-field{padding:0;margin-bottom:4px;white-space:nowrap}.chosen-container-multi .chosen-choices li.search-field input[type=text]{height:20px;outline:0;border:0!important;background:transparent!important;box-shadow:none;color:gray;font-size:100%;border-radius:0}.chosen-container-multi .chosen-choices li.search-field .default{color:#999}.chosen-container-multi .chosen-choices li.search-choice{position:relative;padding:3px 20px 3px 5px;background-color:#f1f1f1;border-radius:3px;border:1px solid #ddd;background-clip:padding-box;-moz-box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);-webkit-box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);line-height:12px;cursor:default;-webkit-transition:all .5s cubic-bezier(0.175,.885,.32,1);transition:all .5s cubic-bezier(0.175,.885,.32,1)}.chosen-container-multi .chosen-choices li.search-choice:hover{border-color:#c4c4c4;background-color:#fff;-moz-box-shadow:0 1px 0 rgba(0,0,0,.1);-webkit-box-shadow:0 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 0 rgba(0,0,0,.1)}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close{position:absolute;top:-1px;right:0;text-align:center;display:block;width:19.5px;height:19.5px;line-height:19.5px;font-size:15.6px;font-weight:700;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:before{content:'×'}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:focus,.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.5;filter:alpha(opacity=50)}.chosen-container-multi .chosen-choices li.search-choice-disabled{padding-right:5px;border:1px solid #ccc;background-color:#e4e4e4;color:#666}.chosen-container-multi .chosen-choices li.search-choice-focus{background:#d4d4d4}.chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close{background-position:-42px -10px}.chosen-container-multi .chosen-results{margin:0;padding:0}.chosen-container-multi .chosen-drop .result-selected{display:list-item;color:#ccc;cursor:default}.chosen-container-active .chosen-single{border-color:#145ccd;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(20,92,205,.6);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(20,92,205,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(20,92,205,.6)}.chosen-container-active.chosen-with-drop .chosen-single{border:1px solid #cbcbcb;border:1px solid rgba(0,0,0,.15);-moz-border-radius-bottomright:0;border-bottom-right-radius:0;-moz-border-radius-bottomleft:0;border-bottom-left-radius:0;-moz-box-shadow:0 6px 12px rgba(0,0,0,.175);-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.chosen-container-active.chosen-with-drop .chosen-single div{border-left:none;background:0 0}.chosen-container-active.chosen-with-drop .chosen-single div b{border-top:0 dotted;border-bottom:4px solid #333;content:""}.chosen-container-active .chosen-choices{border-color:#145ccd;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(20,92,205,.6);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(20,92,205,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(20,92,205,.6)}.chosen-container-active .chosen-choices li.search-field input[type=text]{color:#111!important}.chosen-disabled{opacity:.5!important;cursor:default}.chosen-disabled .chosen-choices .search-choice .search-choice-close,.chosen-disabled .chosen-single{cursor:default}.chosen-container.chosen-icons .chosen-results{padding:5px}.chosen-container.chosen-icons .chosen-results li.group-result{padding:5px 0;color:#666;font-size:12px}.chosen-container.chosen-icons .chosen-results li.group-option{display:inline-block;padding:8px;font-size:14px;line-height:14px;width:30px;text-align:center;border-radius:4px} \ No newline at end of file +.chosen-container{position:relative;display:inline-block;vertical-align:middle;font-size:13px;zoom:1;*display:inline;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.chosen-container .chosen-drop{position:absolute;top:100%;left:-9999px;z-index:1010;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:100%;border:1px solid #cbcbcb;border:1px solid rgba(0,0,0,.15);border-top:0;background:#fff;box-shadow:0 4px 5px rgba(0,0,0,.15)}.chosen-container.chosen-with-drop .chosen-drop{left:0}.chosen-container a{cursor:pointer}.chosen-container-single .chosen-single{display:block;overflow:hidden;padding:5px 8px;height:32px;width:100%;border:1px solid #ccc;border-radius:4px;background-color:#fff;background-clip:padding-box;vertical-align:middle;color:#222;text-decoration:none;white-space:nowrap;line-height:1.53846154;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.chosen-container-single .chosen-default{color:gray}.chosen-container-single .chosen-single>span{display:block;overflow:hidden;margin-right:26px;text-overflow:ellipsis;white-space:nowrap}.chosen-container-single .chosen-single-with-deselect span{margin-right:38px}.chosen-container-single .chosen-single abbr{position:absolute;top:7px;right:24px;display:block;width:19.5px;height:19.5px;line-height:19.5px;font-size:19.5px;font-weight:700;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.chosen-container-single .chosen-single abbr:before{content:'×'}.chosen-container-single .chosen-single abbr:hover,.chosen-container-single .chosen-single abbr:focus{color:#000;text-decoration:none;cursor:pointer;opacity:.5;filter:alpha(opacity=50)}.chosen-container-single .chosen-single div{position:absolute;top:0;right:0;display:block;height:100%;padding:5px 8px}.chosen-container-single .chosen-single div b{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid #333;border-right:4px solid transparent;border-left:4px solid transparent;border-bottom:0 dotted}.chosen-container-single .chosen-search{position:relative;z-index:1010;margin:0;padding:3px 4px;white-space:nowrap}.chosen-container-single .chosen-search input[type=text]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:1px 0;padding:2px 26px 2px 8px;width:100%;height:auto;outline:0;border:1px solid #ccc;border-radius:4px;background-color:#fff;font-size:12px;line-height:1.5}.chosen-container-single .chosen-search input[type=text]:focus{border-color:#145ccd}.chosen-container-single .chosen-search:before{position:absolute;display:block;right:10px;color:gray;top:8px;content:"\e603";font-family:ZenIcon}.chosen-container-single .chosen-drop{margin-top:-1px;border-radius:0 0 4px 4px;background-clip:padding-box}.chosen-container-single.chosen-container-single-nosearch .chosen-search{position:absolute;left:-9999px}.chosen-container .chosen-results{position:relative;overflow-x:hidden;overflow-y:auto;margin:0;padding:0;max-height:240px;-webkit-overflow-scrolling:touch}.chosen-container .chosen-results li{display:none;margin:0;padding:5px 10px;list-style:none;line-height:15px;-webkit-touch-callout:none;-webkit-transition:background-color .3s cubic-bezier(0.175,.885,.32,1);transition:background-color .3s cubic-bezier(0.175,.885,.32,1)}.chosen-container .chosen-results li.active-result{display:list-item;cursor:pointer}.chosen-container .chosen-results li.disabled-result{display:list-item;color:#ccc;cursor:default}.chosen-container .chosen-results li.highlighted{color:#fff;background-color:#3280fc}.chosen-container .chosen-results li.no-results{display:list-item;background:#f4f4f4}.chosen-container .chosen-results li.group-result{display:list-item;font-weight:700;cursor:default}.chosen-container .chosen-results li.group-option{padding-left:15px}.chosen-container .chosen-results li em{font-style:normal;text-decoration:underline}.chosen-container-multi .chosen-choices{position:relative;overflow:hidden;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;width:100%;min-height:32px;min-height:30px \0;border:1px solid #ccc;border-radius:4px;background-color:#fff;cursor:text;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.chosen-container-multi .chosen-choices:before,.chosen-container-multi .chosen-choices:after{content:" ";display:table}.chosen-container-multi .chosen-choices:after{clear:both}.chosen-container-multi .chosen-choices li{display:block;float:left;list-style:none;padding:0 6px;margin:4px 0 0 6px}.chosen-container-multi .chosen-choices li.search-field{padding:0;margin-bottom:4px;white-space:nowrap}.chosen-container-multi .chosen-choices li.search-field input[type=text]{height:20px;outline:0;border:0!important;background:transparent!important;box-shadow:none;color:gray;font-size:100%;border-radius:0}.chosen-container-multi .chosen-choices li.search-field .default{color:#999}.chosen-container-multi .chosen-choices li.search-choice{position:relative;padding:3px 20px 3px 5px;background-color:#f1f1f1;border-radius:3px;border:1px solid #ddd;background-clip:padding-box;-moz-box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);-webkit-box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);line-height:12px;cursor:default;-webkit-transition:all .5s cubic-bezier(0.175,.885,.32,1);transition:all .5s cubic-bezier(0.175,.885,.32,1)}.chosen-container-multi .chosen-choices li.search-choice:hover{border-color:#c4c4c4;background-color:#fff;-moz-box-shadow:0 1px 0 rgba(0,0,0,.1);-webkit-box-shadow:0 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 0 rgba(0,0,0,.1)}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close{position:absolute;top:-1px;right:0;text-align:center;display:block;width:19.5px;height:19.5px;line-height:19.5px;font-size:15.6px;font-weight:700;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:before{content:'×'}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover,.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:focus{color:#000;text-decoration:none;cursor:pointer;opacity:.5;filter:alpha(opacity=50)}.chosen-container-multi .chosen-choices li.search-choice-disabled{padding-right:5px;border:1px solid #ccc;background-color:#e4e4e4;color:#666}.chosen-container-multi .chosen-choices li.search-choice-focus{background:#d4d4d4}.chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close{background-position:-42px -10px}.chosen-container-multi .chosen-results{margin:0;padding:0}.chosen-container-multi .chosen-drop .result-selected{display:list-item;color:#ccc;cursor:default}.chosen-container-active .chosen-single{border-color:#145ccd;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(20,92,205,.6);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(20,92,205,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(20,92,205,.6)}.chosen-container-active.chosen-with-drop .chosen-single{border:1px solid #cbcbcb;border:1px solid rgba(0,0,0,.15);-moz-border-radius-bottomright:0;border-bottom-right-radius:0;-moz-border-radius-bottomleft:0;border-bottom-left-radius:0;-moz-box-shadow:0 6px 12px rgba(0,0,0,.175);-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.chosen-container-active.chosen-with-drop .chosen-single div{border-left:0;background:0 0}.chosen-container-active.chosen-with-drop .chosen-single div b{border-top:0 dotted;border-bottom:4px solid #333;content:""}.chosen-container-active .chosen-choices{border-color:#145ccd;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(20,92,205,.6);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(20,92,205,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(20,92,205,.6)}.chosen-container-active .chosen-choices li.search-field input[type=text]{color:#111!important}.chosen-disabled{opacity:.5!important;cursor:default}.chosen-disabled .chosen-single{cursor:default}.chosen-disabled .chosen-choices .search-choice .search-choice-close{cursor:default}.chosen-container.chosen-icons .chosen-results{padding:5px}.chosen-container.chosen-icons .chosen-results li.group-result{padding:5px 0;color:#666;font-size:12px}.chosen-container.chosen-icons .chosen-results li.group-option{display:inline-block;padding:8px;font-size:14px;line-height:14px;width:30px;text-align:center;border-radius:4px} \ No newline at end of file diff --git a/assets/chosen/js/chosen.all.js b/assets/chosen/js/chosen.all.js new file mode 100644 index 000000000..dfe63a4e6 --- /dev/null +++ b/assets/chosen/js/chosen.all.js @@ -0,0 +1,1387 @@ +/*! + * ==================================================== + * ZUI - v1.1.0 - 2014-07-16 + * https://github.com/easysoft/zui + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2014 Catouse@easysoft; Licensed GNU + * ==================================================== + */ + +/*! +Chosen, a Select Box Enhancer for jQuery and Prototype +by Patrick Filler for Harvest, http://getharvest.com + +Version 1.1.0 +Full source at https://github.com/harvesthq/chosen +Copyright (c) 2011 Harvest http://getharvest.com + +MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md +This file is generated by `grunt build`, do not edit it by hand. +*/ + +(function() { + var $, AbstractChosen, Chosen, SelectParser, _ref, + __hasProp = {}.hasOwnProperty, + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; + + SelectParser = (function() { + function SelectParser() { + this.options_index = 0; + this.parsed = []; + } + + SelectParser.prototype.add_node = function(child) { + if (child.nodeName.toUpperCase() === "OPTGROUP") { + return this.add_group(child); + } else { + return this.add_option(child); + } + }; + + SelectParser.prototype.add_group = function(group) { + var group_position, option, _i, _len, _ref, _results; + group_position = this.parsed.length; + this.parsed.push({ + array_index: group_position, + group: true, + label: this.escapeExpression(group.label), + children: 0, + disabled: group.disabled + }); + _ref = group.childNodes; + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + option = _ref[_i]; + _results.push(this.add_option(option, group_position, group.disabled)); + } + return _results; + }; + + SelectParser.prototype.add_option = function(option, group_position, group_disabled) { + if (option.nodeName.toUpperCase() === "OPTION") { + if (option.text !== "") { + if (group_position != null) { + this.parsed[group_position].children += 1; + } + this.parsed.push({ + array_index: this.parsed.length, + options_index: this.options_index, + value: option.value, + text: option.text, + html: option.innerHTML, + selected: option.selected, + disabled: group_disabled === true ? group_disabled : option.disabled, + group_array_index: group_position, + classes: option.className, + style: option.style.cssText + }); + } else { + this.parsed.push({ + array_index: this.parsed.length, + options_index: this.options_index, + empty: true + }); + } + return this.options_index += 1; + } + }; + + SelectParser.prototype.escapeExpression = function(text) { + var map, unsafe_chars; + if ((text == null) || text === false) { + return ""; + } + if (!/[\&\<\>\"\'\`]/.test(text)) { + return text; + } + map = { + "<": "<", + ">": ">", + '"': """, + "'": "'", + "`": "`" + }; + unsafe_chars = /&(?!\w+;)|[\<\>\"\'\`]/g; + return text.replace(unsafe_chars, function(chr) { + return map[chr] || "&"; + }); + }; + + return SelectParser; + + })(); + + SelectParser.select_to_array = function(select) { + var child, parser, _i, _len, _ref; + parser = new SelectParser(); + _ref = select.childNodes; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + child = _ref[_i]; + parser.add_node(child); + } + return parser.parsed; + }; + + AbstractChosen = (function() { + function AbstractChosen(form_field, options) { + this.form_field = form_field; + this.options = options != null ? options : {}; + if (!AbstractChosen.browser_is_supported()) { + return; + } + this.is_multiple = this.form_field.multiple; + this.set_default_text(); + this.set_default_values(); + this.setup(); + this.set_up_html(); + this.register_observers(); + } + + AbstractChosen.prototype.set_default_values = function() { + var _this = this; + this.click_test_action = function(evt) { + return _this.test_active_click(evt); + }; + this.activate_action = function(evt) { + return _this.activate_field(evt); + }; + this.active_field = false; + this.mouse_on_container = false; + this.results_showing = false; + this.result_highlighted = null; + this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false; + this.disable_search_threshold = this.options.disable_search_threshold || 0; + this.disable_search = this.options.disable_search || false; + this.enable_split_word_search = this.options.enable_split_word_search != null ? this.options.enable_split_word_search : true; + this.group_search = this.options.group_search != null ? this.options.group_search : true; + this.search_contains = this.options.search_contains || false; + this.single_backstroke_delete = this.options.single_backstroke_delete != null ? this.options.single_backstroke_delete : true; + this.max_selected_options = this.options.max_selected_options || Infinity; + this.inherit_select_classes = this.options.inherit_select_classes || false; + this.display_selected_options = this.options.display_selected_options != null ? this.options.display_selected_options : true; + return this.display_disabled_options = this.options.display_disabled_options != null ? this.options.display_disabled_options : true; + }; + + AbstractChosen.prototype.set_default_text = function() { + if (this.form_field.getAttribute("data-placeholder")) { + this.default_text = this.form_field.getAttribute("data-placeholder"); + } else if (this.is_multiple) { + this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || AbstractChosen.default_multiple_text; + } else { + this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || AbstractChosen.default_single_text; + } + return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || AbstractChosen.default_no_result_text; + }; + + AbstractChosen.prototype.mouse_enter = function() { + return this.mouse_on_container = true; + }; + + AbstractChosen.prototype.mouse_leave = function() { + return this.mouse_on_container = false; + }; + + AbstractChosen.prototype.input_focus = function(evt) { + var _this = this; + if (this.is_multiple) { + if (!this.active_field) { + return setTimeout((function() { + return _this.container_mousedown(); + }), 50); + } + } else { + if (!this.active_field) { + return this.activate_field(); + } + } + }; + + AbstractChosen.prototype.input_blur = function(evt) { + var _this = this; + if (!this.mouse_on_container) { + this.active_field = false; + return setTimeout((function() { + return _this.blur_test(); + }), 100); + } + }; + + AbstractChosen.prototype.results_option_build = function(options) { + var content, data, _i, _len, _ref; + content = ''; + _ref = this.results_data; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + data = _ref[_i]; + if (data.group) { + content += this.result_add_group(data); + } else { + content += this.result_add_option(data); + } + if (options != null ? options.first : void 0) { + if (data.selected && this.is_multiple) { + this.choice_build(data); + } else if (data.selected && !this.is_multiple) { + this.single_set_selected_text(data.text); + } + } + } + return content; + }; + + AbstractChosen.prototype.result_add_option = function(option) { + var classes, option_el; + if (!option.search_match) { + return ''; + } + if (!this.include_option_in_results(option)) { + return ''; + } + classes = []; + if (!option.disabled && !(option.selected && this.is_multiple)) { + classes.push("active-result"); + } + if (option.disabled && !(option.selected && this.is_multiple)) { + classes.push("disabled-result"); + } + if (option.selected) { + classes.push("result-selected"); + } + if (option.group_array_index != null) { + classes.push("group-option"); + } + if (option.classes !== "") { + classes.push(option.classes); + } + option_el = document.createElement("li"); + option_el.className = classes.join(" "); + option_el.style.cssText = option.style; + option_el.setAttribute("data-option-array-index", option.array_index); + option_el.innerHTML = option.search_text; + return this.outerHTML(option_el); + }; + + AbstractChosen.prototype.result_add_group = function(group) { + var group_el; + if (!(group.search_match || group.group_match)) { + return ''; + } + if (!(group.active_options > 0)) { + return ''; + } + group_el = document.createElement("li"); + group_el.className = "group-result"; + group_el.innerHTML = group.search_text; + return this.outerHTML(group_el); + }; + + AbstractChosen.prototype.results_update_field = function() { + this.set_default_text(); + if (!this.is_multiple) { + this.results_reset_cleanup(); + } + this.result_clear_highlight(); + this.results_build(); + if (this.results_showing) { + return this.winnow_results(); + } + }; + + AbstractChosen.prototype.reset_single_select_options = function() { + var result, _i, _len, _ref, _results; + _ref = this.results_data; + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + result = _ref[_i]; + if (result.selected) { + _results.push(result.selected = false); + } else { + _results.push(void 0); + } + } + return _results; + }; + + AbstractChosen.prototype.results_toggle = function() { + if (this.results_showing) { + return this.results_hide(); + } else { + return this.results_show(); + } + }; + + AbstractChosen.prototype.results_search = function(evt) { + if (this.results_showing) { + return this.winnow_results(); + } else { + return this.results_show(); + } + }; + + AbstractChosen.prototype.winnow_results = function() { + var escapedSearchText, option, regex, regexAnchor, results, results_group, searchText, startpos, text, zregex, _i, _len, _ref; + this.no_results_clear(); + results = 0; + searchText = this.get_search_text(); + escapedSearchText = searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + regexAnchor = this.search_contains ? "" : "^"; + regex = new RegExp(regexAnchor + escapedSearchText, 'i'); + zregex = new RegExp(escapedSearchText, 'i'); + _ref = this.results_data; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + option = _ref[_i]; + option.search_match = false; + results_group = null; + if (this.include_option_in_results(option)) { + if (option.group) { + option.group_match = false; + option.active_options = 0; + } + if ((option.group_array_index != null) && this.results_data[option.group_array_index]) { + results_group = this.results_data[option.group_array_index]; + if (results_group.active_options === 0 && results_group.search_match) { + results += 1; + } + results_group.active_options += 1; + } + if (!(option.group && !this.group_search)) { + option.search_text = option.group ? option.label : option.html; + option.search_match = this.search_string_match(option.search_text, regex); + if (option.search_match && !option.group) { + results += 1; + } + if (option.search_match) { + if (searchText.length) { + startpos = option.search_text.search(zregex); + text = option.search_text.substr(0, startpos + searchText.length) + '' + option.search_text.substr(startpos + searchText.length); + option.search_text = text.substr(0, startpos) + '' + text.substr(startpos); + } + if (results_group != null) { + results_group.group_match = true; + } + } else if ((option.group_array_index != null) && this.results_data[option.group_array_index].search_match) { + option.search_match = true; + } + } + } + } + this.result_clear_highlight(); + if (results < 1 && searchText.length) { + this.update_results_content(""); + return this.no_results(searchText); + } else { + this.update_results_content(this.results_option_build()); + return this.winnow_results_set_highlight(); + } + }; + + AbstractChosen.prototype.search_string_match = function(search_string, regex) { + var part, parts, _i, _len; + if (regex.test(search_string)) { + return true; + } else if (this.enable_split_word_search && (search_string.indexOf(" ") >= 0 || search_string.indexOf("[") === 0)) { + parts = search_string.replace(/\[|\]/g, "").split(" "); + if (parts.length) { + for (_i = 0, _len = parts.length; _i < _len; _i++) { + part = parts[_i]; + if (regex.test(part)) { + return true; + } + } + } + } + }; + + AbstractChosen.prototype.choices_count = function() { + var option, _i, _len, _ref; + if (this.selected_option_count != null) { + return this.selected_option_count; + } + this.selected_option_count = 0; + _ref = this.form_field.options; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + option = _ref[_i]; + if (option.selected) { + this.selected_option_count += 1; + } + } + return this.selected_option_count; + }; + + AbstractChosen.prototype.choices_click = function(evt) { + evt.preventDefault(); + if (!(this.results_showing || this.is_disabled)) { + return this.results_show(); + } + }; + + AbstractChosen.prototype.keyup_checker = function(evt) { + var stroke, _ref; + stroke = (_ref = evt.which) != null ? _ref : evt.keyCode; + this.search_field_scale(); + switch (stroke) { + case 8: + if (this.is_multiple && this.backstroke_length < 1 && this.choices_count() > 0) { + return this.keydown_backstroke(); + } else if (!this.pending_backstroke) { + this.result_clear_highlight(); + return this.results_search(); + } + break; + case 13: + evt.preventDefault(); + if (this.results_showing) { + return this.result_select(evt); + } + break; + case 27: + if (this.results_showing) { + this.results_hide(); + } + return true; + case 9: + case 38: + case 40: + case 16: + case 91: + case 17: + break; + default: + return this.results_search(); + } + }; + + AbstractChosen.prototype.clipboard_event_checker = function(evt) { + var _this = this; + return setTimeout((function() { + return _this.results_search(); + }), 50); + }; + + AbstractChosen.prototype.container_width = function() { + if (this.options.width != null) { + return this.options.width; + } else { + return "" + this.form_field.offsetWidth + "px"; + } + }; + + AbstractChosen.prototype.include_option_in_results = function(option) { + if (this.is_multiple && (!this.display_selected_options && option.selected)) { + return false; + } + if (!this.display_disabled_options && option.disabled) { + return false; + } + if (option.empty) { + return false; + } + return true; + }; + + AbstractChosen.prototype.search_results_touchstart = function(evt) { + this.touch_started = true; + return this.search_results_mouseover(evt); + }; + + AbstractChosen.prototype.search_results_touchmove = function(evt) { + this.touch_started = false; + return this.search_results_mouseout(evt); + }; + + AbstractChosen.prototype.search_results_touchend = function(evt) { + if (this.touch_started) { + return this.search_results_mouseup(evt); + } + }; + + AbstractChosen.prototype.outerHTML = function(element) { + var tmp; + if (element.outerHTML) { + return element.outerHTML; + } + tmp = document.createElement("div"); + tmp.appendChild(element); + return tmp.innerHTML; + }; + + AbstractChosen.browser_is_supported = function() { + if (window.navigator.appName === "Microsoft Internet Explorer") { + return document.documentMode >= 8; + } + if (/iP(od|hone)/i.test(window.navigator.userAgent)) { + return false; + } + if (/Android/i.test(window.navigator.userAgent)) { + if (/Mobile/i.test(window.navigator.userAgent)) { + return false; + } + } + return true; + }; + + AbstractChosen.default_multiple_text = "Select Some Options"; + + AbstractChosen.default_single_text = "Select an Option"; + + AbstractChosen.default_no_result_text = "No results match"; + + return AbstractChosen; + + })(); + + $ = jQuery; + + $.fn.extend({ + chosen: function(options) { + if (!AbstractChosen.browser_is_supported()) { + return this; + } + return this.each(function(input_field) { + var $this, chosen; + $this = $(this); + chosen = $this.data('chosen'); + if (options === 'destroy' && chosen) { + chosen.destroy(); + } else if (!chosen) { + $this.data('chosen', new Chosen(this, options)); + } + }); + } + }); + + Chosen = (function(_super) { + __extends(Chosen, _super); + + function Chosen() { + _ref = Chosen.__super__.constructor.apply(this, arguments); + return _ref; + } + + Chosen.prototype.setup = function() { + this.form_field_jq = $(this.form_field); + this.current_selectedIndex = this.form_field.selectedIndex; + return this.is_rtl = this.form_field_jq.hasClass("chosen-rtl"); + }; + + Chosen.prototype.set_up_html = function() { + var container_classes, container_props; + container_classes = ["chosen-container"]; + container_classes.push("chosen-container-" + (this.is_multiple ? "multi" : "single")); + if (this.inherit_select_classes && this.form_field.className) { + container_classes.push(this.form_field.className); + } + if (this.is_rtl) { + container_classes.push("chosen-rtl"); + } + container_props = { + 'class': container_classes.join(' '), + 'style': "width: " + (this.container_width()) + ";", + 'title': this.form_field.title + }; + if (this.form_field.id.length) { + container_props.id = this.form_field.id.replace(/[^\w]/g, '_') + "_chosen"; + } + this.container = $("
", container_props); + if (this.is_multiple) { + this.container.html('
    '); + } else { + this.container.html('' + this.default_text + '
      '); + } + this.form_field_jq.hide().after(this.container); + this.dropdown = this.container.find('div.chosen-drop').first(); + this.search_field = this.container.find('input').first(); + this.search_results = this.container.find('ul.chosen-results').first(); + this.search_field_scale(); + this.search_no_results = this.container.find('li.no-results').first(); + if (this.is_multiple) { + this.search_choices = this.container.find('ul.chosen-choices').first(); + this.search_container = this.container.find('li.search-field').first(); + } else { + this.search_container = this.container.find('div.chosen-search').first(); + this.selected_item = this.container.find('.chosen-single').first(); + } + this.results_build(); + this.set_tab_index(); + this.set_label_behavior(); + return this.form_field_jq.trigger("chosen:ready", { + chosen: this + }); + }; + + Chosen.prototype.register_observers = function() { + var _this = this; + this.container.bind('mousedown.chosen', function(evt) { + _this.container_mousedown(evt); + }); + this.container.bind('mouseup.chosen', function(evt) { + _this.container_mouseup(evt); + }); + this.container.bind('mouseenter.chosen', function(evt) { + _this.mouse_enter(evt); + }); + this.container.bind('mouseleave.chosen', function(evt) { + _this.mouse_leave(evt); + }); + this.search_results.bind('mouseup.chosen', function(evt) { + _this.search_results_mouseup(evt); + }); + this.search_results.bind('mouseover.chosen', function(evt) { + _this.search_results_mouseover(evt); + }); + this.search_results.bind('mouseout.chosen', function(evt) { + _this.search_results_mouseout(evt); + }); + this.search_results.bind('mousewheel.chosen DOMMouseScroll.chosen', function(evt) { + _this.search_results_mousewheel(evt); + }); + this.search_results.bind('touchstart.chosen', function(evt) { + _this.search_results_touchstart(evt); + }); + this.search_results.bind('touchmove.chosen', function(evt) { + _this.search_results_touchmove(evt); + }); + this.search_results.bind('touchend.chosen', function(evt) { + _this.search_results_touchend(evt); + }); + this.form_field_jq.bind("chosen:updated.chosen", function(evt) { + _this.results_update_field(evt); + }); + this.form_field_jq.bind("chosen:activate.chosen", function(evt) { + _this.activate_field(evt); + }); + this.form_field_jq.bind("chosen:open.chosen", function(evt) { + _this.container_mousedown(evt); + }); + this.form_field_jq.bind("chosen:close.chosen", function(evt) { + _this.input_blur(evt); + }); + this.search_field.bind('blur.chosen', function(evt) { + _this.input_blur(evt); + }); + this.search_field.bind('keyup.chosen', function(evt) { + _this.keyup_checker(evt); + }); + this.search_field.bind('keydown.chosen', function(evt) { + _this.keydown_checker(evt); + }); + this.search_field.bind('focus.chosen', function(evt) { + _this.input_focus(evt); + }); + this.search_field.bind('cut.chosen', function(evt) { + _this.clipboard_event_checker(evt); + }); + this.search_field.bind('paste.chosen', function(evt) { + _this.clipboard_event_checker(evt); + }); + if (this.is_multiple) { + return this.search_choices.bind('click.chosen', function(evt) { + _this.choices_click(evt); + }); + } else { + return this.container.bind('click.chosen', function(evt) { + evt.preventDefault(); + }); + } + }; + + Chosen.prototype.destroy = function() { + $(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action); + if (this.search_field[0].tabIndex) { + this.form_field_jq[0].tabIndex = this.search_field[0].tabIndex; + } + this.container.remove(); + this.form_field_jq.removeData('chosen'); + return this.form_field_jq.show(); + }; + + Chosen.prototype.search_field_disabled = function() { + this.is_disabled = this.form_field_jq[0].disabled; + if (this.is_disabled) { + this.container.addClass('chosen-disabled'); + this.search_field[0].disabled = true; + if (!this.is_multiple) { + this.selected_item.unbind("focus.chosen", this.activate_action); + } + return this.close_field(); + } else { + this.container.removeClass('chosen-disabled'); + this.search_field[0].disabled = false; + if (!this.is_multiple) { + return this.selected_item.bind("focus.chosen", this.activate_action); + } + } + }; + + Chosen.prototype.container_mousedown = function(evt) { + if (!this.is_disabled) { + if (evt && evt.type === "mousedown" && !this.results_showing) { + evt.preventDefault(); + } + if (!((evt != null) && ($(evt.target)).hasClass("search-choice-close"))) { + if (!this.active_field) { + if (this.is_multiple) { + this.search_field.val(""); + } + $(this.container[0].ownerDocument).bind('click.chosen', this.click_test_action); + this.results_show(); + } else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chosen-single").length)) { + evt.preventDefault(); + this.results_toggle(); + } + return this.activate_field(); + } + } + }; + + Chosen.prototype.container_mouseup = function(evt) { + if (evt.target.nodeName === "ABBR" && !this.is_disabled) { + return this.results_reset(evt); + } + }; + + Chosen.prototype.search_results_mousewheel = function(evt) { + var delta; + if (evt.originalEvent) { + delta = -evt.originalEvent.wheelDelta || evt.originalEvent.detail; + } + if (delta != null) { + evt.preventDefault(); + if (evt.type === 'DOMMouseScroll') { + delta = delta * 40; + } + return this.search_results.scrollTop(delta + this.search_results.scrollTop()); + } + }; + + Chosen.prototype.blur_test = function(evt) { + if (!this.active_field && this.container.hasClass("chosen-container-active")) { + return this.close_field(); + } + }; + + Chosen.prototype.close_field = function() { + $(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action); + this.active_field = false; + this.results_hide(); + this.container.removeClass("chosen-container-active"); + this.clear_backstroke(); + this.show_search_field_default(); + return this.search_field_scale(); + }; + + Chosen.prototype.activate_field = function() { + this.container.addClass("chosen-container-active"); + this.active_field = true; + this.search_field.val(this.search_field.val()); + return this.search_field.focus(); + }; + + Chosen.prototype.test_active_click = function(evt) { + var active_container; + active_container = $(evt.target).closest('.chosen-container'); + if (active_container.length && this.container[0] === active_container[0]) { + return this.active_field = true; + } else { + return this.close_field(); + } + }; + + Chosen.prototype.results_build = function() { + this.parsing = true; + this.selected_option_count = null; + this.results_data = SelectParser.select_to_array(this.form_field); + if (this.is_multiple) { + this.search_choices.find("li.search-choice").remove(); + } else if (!this.is_multiple) { + this.single_set_selected_text(); + if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) { + this.search_field[0].readOnly = true; + this.container.addClass("chosen-container-single-nosearch"); + } else { + this.search_field[0].readOnly = false; + this.container.removeClass("chosen-container-single-nosearch"); + } + } + this.update_results_content(this.results_option_build({ + first: true + })); + this.search_field_disabled(); + this.show_search_field_default(); + this.search_field_scale(); + return this.parsing = false; + }; + + Chosen.prototype.result_do_highlight = function(el) { + var high_bottom, high_top, maxHeight, visible_bottom, visible_top; + if (el.length) { + this.result_clear_highlight(); + this.result_highlight = el; + this.result_highlight.addClass("highlighted"); + maxHeight = parseInt(this.search_results.css("maxHeight"), 10); + visible_top = this.search_results.scrollTop(); + visible_bottom = maxHeight + visible_top; + high_top = this.result_highlight.position().top + this.search_results.scrollTop(); + high_bottom = high_top + this.result_highlight.outerHeight(); + if (high_bottom >= visible_bottom) { + return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0); + } else if (high_top < visible_top) { + return this.search_results.scrollTop(high_top); + } + } + }; + + Chosen.prototype.result_clear_highlight = function() { + if (this.result_highlight) { + this.result_highlight.removeClass("highlighted"); + } + return this.result_highlight = null; + }; + + Chosen.prototype.results_show = function() { + if (this.is_multiple && this.max_selected_options <= this.choices_count()) { + this.form_field_jq.trigger("chosen:maxselected", { + chosen: this + }); + return false; + } + this.container.addClass("chosen-with-drop"); + this.results_showing = true; + this.search_field.focus(); + this.search_field.val(this.search_field.val()); + this.winnow_results(); + return this.form_field_jq.trigger("chosen:showing_dropdown", { + chosen: this + }); + }; + + Chosen.prototype.update_results_content = function(content) { + return this.search_results.html(content); + }; + + Chosen.prototype.results_hide = function() { + if (this.results_showing) { + this.result_clear_highlight(); + this.container.removeClass("chosen-with-drop"); + this.form_field_jq.trigger("chosen:hiding_dropdown", { + chosen: this + }); + } + return this.results_showing = false; + }; + + Chosen.prototype.set_tab_index = function(el) { + var ti; + if (this.form_field.tabIndex) { + ti = this.form_field.tabIndex; + this.form_field.tabIndex = -1; + return this.search_field[0].tabIndex = ti; + } + }; + + Chosen.prototype.set_label_behavior = function() { + var _this = this; + this.form_field_label = this.form_field_jq.parents("label"); + if (!this.form_field_label.length && this.form_field.id.length) { + this.form_field_label = $("label[for='" + this.form_field.id + "']"); + } + if (this.form_field_label.length > 0) { + return this.form_field_label.bind('click.chosen', function(evt) { + if (_this.is_multiple) { + return _this.container_mousedown(evt); + } else { + return _this.activate_field(); + } + }); + } + }; + + Chosen.prototype.show_search_field_default = function() { + if (this.is_multiple && this.choices_count() < 1 && !this.active_field) { + this.search_field.val(this.default_text); + return this.search_field.addClass("default"); + } else { + this.search_field.val(""); + return this.search_field.removeClass("default"); + } + }; + + Chosen.prototype.search_results_mouseup = function(evt) { + var target; + target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first(); + if (target.length) { + this.result_highlight = target; + this.result_select(evt); + return this.search_field.focus(); + } + }; + + Chosen.prototype.search_results_mouseover = function(evt) { + var target; + target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first(); + if (target) { + return this.result_do_highlight(target); + } + }; + + Chosen.prototype.search_results_mouseout = function(evt) { + if ($(evt.target).hasClass("active-result" || $(evt.target).parents('.active-result').first())) { + return this.result_clear_highlight(); + } + }; + + Chosen.prototype.choice_build = function(item) { + var choice, close_link, + _this = this; + choice = $('
    • ', { + "class": "search-choice" + }).html("" + item.html + ""); + if (item.disabled) { + choice.addClass('search-choice-disabled'); + } else { + close_link = $('', { + "class": 'search-choice-close', + 'data-option-array-index': item.array_index + }); + close_link.bind('click.chosen', function(evt) { + return _this.choice_destroy_link_click(evt); + }); + choice.append(close_link); + } + return this.search_container.before(choice); + }; + + Chosen.prototype.choice_destroy_link_click = function(evt) { + evt.preventDefault(); + evt.stopPropagation(); + if (!this.is_disabled) { + return this.choice_destroy($(evt.target)); + } + }; + + Chosen.prototype.choice_destroy = function(link) { + if (this.result_deselect(link[0].getAttribute("data-option-array-index"))) { + this.show_search_field_default(); + if (this.is_multiple && this.choices_count() > 0 && this.search_field.val().length < 1) { + this.results_hide(); + } + link.parents('li').first().remove(); + return this.search_field_scale(); + } + }; + + Chosen.prototype.results_reset = function() { + this.reset_single_select_options(); + this.form_field.options[0].selected = true; + this.single_set_selected_text(); + this.show_search_field_default(); + this.results_reset_cleanup(); + this.form_field_jq.trigger("change"); + if (this.active_field) { + return this.results_hide(); + } + }; + + Chosen.prototype.results_reset_cleanup = function() { + this.current_selectedIndex = this.form_field.selectedIndex; + return this.selected_item.find("abbr").remove(); + }; + + Chosen.prototype.result_select = function(evt) { + var high, item; + if (this.result_highlight) { + high = this.result_highlight; + this.result_clear_highlight(); + if (this.is_multiple && this.max_selected_options <= this.choices_count()) { + this.form_field_jq.trigger("chosen:maxselected", { + chosen: this + }); + return false; + } + if (this.is_multiple) { + high.removeClass("active-result"); + } else { + this.reset_single_select_options(); + } + item = this.results_data[high[0].getAttribute("data-option-array-index")]; + item.selected = true; + this.form_field.options[item.options_index].selected = true; + this.selected_option_count = null; + if (this.is_multiple) { + this.choice_build(item); + } else { + this.single_set_selected_text(item.text); + } + if (!((evt.metaKey || evt.ctrlKey) && this.is_multiple)) { + this.results_hide(); + } + this.search_field.val(""); + if (this.is_multiple || this.form_field.selectedIndex !== this.current_selectedIndex) { + this.form_field_jq.trigger("change", { + 'selected': this.form_field.options[item.options_index].value + }); + } + this.current_selectedIndex = this.form_field.selectedIndex; + return this.search_field_scale(); + } + }; + + Chosen.prototype.single_set_selected_text = function(text) { + if (text == null) { + text = this.default_text; + } + if (text === this.default_text) { + this.selected_item.addClass("chosen-default"); + } else { + this.single_deselect_control_build(); + this.selected_item.removeClass("chosen-default"); + } + return this.selected_item.find("span").text(text); + }; + + Chosen.prototype.result_deselect = function(pos) { + var result_data; + result_data = this.results_data[pos]; + if (!this.form_field.options[result_data.options_index].disabled) { + result_data.selected = false; + this.form_field.options[result_data.options_index].selected = false; + this.selected_option_count = null; + this.result_clear_highlight(); + if (this.results_showing) { + this.winnow_results(); + } + this.form_field_jq.trigger("change", { + deselected: this.form_field.options[result_data.options_index].value + }); + this.search_field_scale(); + return true; + } else { + return false; + } + }; + + Chosen.prototype.single_deselect_control_build = function() { + if (!this.allow_single_deselect) { + return; + } + if (!this.selected_item.find("abbr").length) { + this.selected_item.find("span").first().after(""); + } + return this.selected_item.addClass("chosen-single-with-deselect"); + }; + + Chosen.prototype.get_search_text = function() { + if (this.search_field.val() === this.default_text) { + return ""; + } else { + return $('
      ').text($.trim(this.search_field.val())).html(); + } + }; + + Chosen.prototype.winnow_results_set_highlight = function() { + var do_high, selected_results; + selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : []; + do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first(); + if (do_high != null) { + return this.result_do_highlight(do_high); + } + }; + + Chosen.prototype.no_results = function(terms) { + var no_results_html; + no_results_html = $('
    • ' + this.results_none_found + ' ""
    • '); + no_results_html.find("span").first().html(terms); + this.search_results.append(no_results_html); + return this.form_field_jq.trigger("chosen:no_results", { + chosen: this + }); + }; + + Chosen.prototype.no_results_clear = function() { + return this.search_results.find(".no-results").remove(); + }; + + Chosen.prototype.keydown_arrow = function() { + var next_sib; + if (this.results_showing && this.result_highlight) { + next_sib = this.result_highlight.nextAll("li.active-result").first(); + if (next_sib) { + return this.result_do_highlight(next_sib); + } + } else { + return this.results_show(); + } + }; + + Chosen.prototype.keyup_arrow = function() { + var prev_sibs; + if (!this.results_showing && !this.is_multiple) { + return this.results_show(); + } else if (this.result_highlight) { + prev_sibs = this.result_highlight.prevAll("li.active-result"); + if (prev_sibs.length) { + return this.result_do_highlight(prev_sibs.first()); + } else { + if (this.choices_count() > 0) { + this.results_hide(); + } + return this.result_clear_highlight(); + } + } + }; + + Chosen.prototype.keydown_backstroke = function() { + var next_available_destroy; + if (this.pending_backstroke) { + this.choice_destroy(this.pending_backstroke.find("a").first()); + return this.clear_backstroke(); + } else { + next_available_destroy = this.search_container.siblings("li.search-choice").last(); + if (next_available_destroy.length && !next_available_destroy.hasClass("search-choice-disabled")) { + this.pending_backstroke = next_available_destroy; + if (this.single_backstroke_delete) { + return this.keydown_backstroke(); + } else { + return this.pending_backstroke.addClass("search-choice-focus"); + } + } + } + }; + + Chosen.prototype.clear_backstroke = function() { + if (this.pending_backstroke) { + this.pending_backstroke.removeClass("search-choice-focus"); + } + return this.pending_backstroke = null; + }; + + Chosen.prototype.keydown_checker = function(evt) { + var stroke, _ref1; + stroke = (_ref1 = evt.which) != null ? _ref1 : evt.keyCode; + this.search_field_scale(); + if (stroke !== 8 && this.pending_backstroke) { + this.clear_backstroke(); + } + switch (stroke) { + case 8: + this.backstroke_length = this.search_field.val().length; + break; + case 9: + if (this.results_showing && !this.is_multiple) { + this.result_select(evt); + } + this.mouse_on_container = false; + break; + case 13: + evt.preventDefault(); + break; + case 38: + evt.preventDefault(); + this.keyup_arrow(); + break; + case 40: + evt.preventDefault(); + this.keydown_arrow(); + break; + } + }; + + Chosen.prototype.search_field_scale = function() { + var div, f_width, h, style, style_block, styles, w, _i, _len; + if (this.is_multiple) { + h = 0; + w = 0; + style_block = "position:absolute; left: -1000px; top: -1000px; display:none;"; + styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing']; + for (_i = 0, _len = styles.length; _i < _len; _i++) { + style = styles[_i]; + style_block += style + ":" + this.search_field.css(style) + ";"; + } + div = $('
      ', { + 'style': style_block + }); + div.text(this.search_field.val()); + $('body').append(div); + w = div.width() + 25; + div.remove(); + f_width = this.container.outerWidth(); + if (w > f_width - 10) { + w = f_width - 10; + } + return this.search_field.css({ + 'width': w + 'px' + }); + } + }; + + return Chosen; + + })(AbstractChosen); + +}).call(this); + ++function(o,e,t,n){"use strict";var s=function(e,t){this.$=o(e),this.options=this.getOptions(t),this.lang=s.LANGS[this.options.lang],this.id="chosen-icons-"+parseInt(1e10*n.random()+1),this.init()};s.DEFAULTS={canEmpty:!0,lang:"zh-cn",commonIcons:["heart","user","group","list-ul","th","star","star-empty","search","envelope","dashboard","sitemap","umbrella","lightbulb","envelope-alt","cog","ok","remove","home","time","flag","flag-alt","flag-checkered","qrcode","tag","tags","book","bookmark","bookmark-empty","print","camera","picture","globe","map-marker","edit","edit-sign","play","stop","plus-sign","minus-sign","remove-sign","ok-sign","check-sign","question-sign","info-sign","exclamation-sign","plus","plus-sign","minus","minus-sign","asterisk","calendar","calendar-empty","comment","comment-alt","comments","comments-alt","folder-close","folder-open","folder-close-alt","folder-open-alt","gears","thumbs-up-alt","thumbs-up","thumbs-down-alt","thumbs-down","pushpin","building","phone","rss","rss-sign","bullhorn","bell","bell-alt","certificate","wrench","tasks","cloud","beaker","magic","smile","frown","meh","code","location-arrow"],webIcons:["share","pencil","trash","file-alt","file","file-text","download-alt","upload-alt","inbox","repeat","rotate-left","refresh","lock","unlock","check","check-empty","eye-open","eye-close","key","signin","signout","external-link","external-link-sign","link","reorder","quote-left","quote-right","spinner","reply","question","info","exclamation","archive","collapse","collapse-top"],editorIcons:["table","copy","paperclip","save","list-ol","paste","keyboard","crop","unlink","sort-by-alphabet","sort-by-alphabet-alt","sort-by-attributes","sort-by-attributes-alt","sort-by-order","sort-by-order-alt"],directionalIcons:["chevron-left","chevron-right","chevron-down","chevron-up","arrow-left","arrow-right","arrow-down","arrow-up","hand-right","hand-left","hand-up","hand-down","circle-arrow-left","circle-arrow-right","circle-arrow-up","circle-arrow-down","double-angle-left","double-angle-right","double-angle-down","double-angle-up","angle-left","angle-right","angle-down","angle-up","long-arrow-left","long-arrow-right","long-arrow-down","long-arrow-up","caret-left","caret-right","caret-down","caret-up"],otherIcons:["desktop","laptop","tablet","mobile-phone","github","building","yen","cny","firefox","ie","opera","qq","lemon","sign-blank","circle","circle-blank","terminal","html5","female","male","andriod","apple","windows","weibo","renren","bug","moon","sun"]},s.LANGS={},s.LANGS["zh-cn"]={commonIcons:"常用图标",webIcons:"Web 图标",editorIcons:"编辑器图标",directionalIcons:"箭头总汇",otherIcons:"其他图标"},s.LANGS.en={commonIcons:"Common Icons",webIcons:"Web Icons",editorIcons:"Editor Icons",directionalIcons:"Directional Icons",otherIcons:"Other Icons"},s.LANGS["zh-tw"]={commonIcons:"常用圖標",webIcons:"Web 圖標",editorIcons:"編輯器圖標",directionalIcons:"箭頭總匯",otherIcons:"其他圖標"},s.prototype.getOptions=function(e){return e=o.extend({},s.DEFAULTS,this.$.data(),e)},s.prototype.init=function(){var e=this.$.addClass("chosen-icons").addClass(this.id);e.empty(),this.options.canEmpty&&e.append(this.getOptionHtml()),e.append(this.getgroupHtml("commonIcons")),e.append(this.getgroupHtml("webIcons")),e.append(this.getgroupHtml("editorIcons")),e.append(this.getgroupHtml("directionalIcons")),e.append(this.getgroupHtml("otherIcons")),e.chosen({placeholder_text:" ",disable_search:!0,width:"100%",inherit_select_classes:!0});var t=".chosen-container."+this.id;e.on("chosen:showing_dropdown",function(){o(t+" .chosen-results .group-option").each(function(){var e=o(this).addClass("icon"),t=e.text();e.html('')})}).change(function(){o(t+" .chosen-single > span");var e=o(this).val();o(t+" .chosen-single > span").html('   '+e)});var n=e.data("value");n&&e.val(n).change()},s.prototype.getgroupHtml=function(o){var e=this.options[o],t='';for(var n in e)t+=this.getOptionHtml(e[n]);return t+""},s.prototype.getOptionHtml=function(o){return o=o&&o.length>0?"icon-"+o:"",'"},o.fn.chosenIcons=function(e){return this.each(function(){var t=o(this),n=t.data("zui.chosenIcons"),r="object"==typeof e&&e;n||t.data("zui.chosenIcons",n=new s(this,r)),"string"==typeof e&&n[e]()})},o.fn.chosenIcons.Constructor=s}(jQuery,window,document,Math); + +/*! + * ==================================================== + * ZUI - v1.1.0 - 2014-07-16 + * https://github.com/easysoft/zui + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2014 Catouse@easysoft; Licensed GNU + * ==================================================== + */ + +/* ChosenIcons */ ++function($, window, document, Math) +{ + "use strict"; + + var ChosenIcons = function(element, options) + { + this.$ = $(element); + this.options = this.getOptions(options); + this.lang = ChosenIcons.LANGS[this.options.lang]; + this.id = 'chosen-icons-' + parseInt(Math.random() * 10000000000 + 1); + + this.init(); + }; + + ChosenIcons.DEFAULTS = + { + canEmpty: true, + lang: 'zh-cn', + commonIcons: ['heart', 'user', 'group', 'list-ul', 'th', 'th-large', 'star', 'star-empty', 'search', 'envelope', 'dashboard', 'sitemap', 'umbrella', 'lightbulb', 'envelope-alt', 'cog', 'ok', 'remove', 'home', 'time', 'flag', 'flag-alt', 'flag-checkered', 'qrcode', 'tag', 'tags', 'book', 'bookmark', 'bookmark-empty', 'print', 'camera', 'picture', 'globe', 'map-marker', 'edit', 'edit-sign', 'play', 'stop', 'plus-sign', 'minus-sign', 'remove-sign', 'ok-sign', 'check-sign', 'question-sign', 'info-sign', 'exclamation-sign', 'plus', 'plus-sign', 'minus', 'minus-sign', 'asterisk', 'calendar', 'calendar-empty', 'comment', 'comment-alt', 'comments', 'comments-alt', 'folder-close', 'folder-open', 'folder-close-alt', 'folder-open-alt', 'thumbs-up', 'thumbs-down', 'pushpin', 'building', 'phone', 'rss', 'rss-sign', 'bullhorn', 'bell', 'bell-alt', 'certificate', 'wrench', 'tasks', 'cloud', 'beaker', 'magic', 'smile', 'frown', 'meh', 'code', 'location-arrow'], + webIcons: ['share', 'pencil', 'trash', 'file-alt', 'file', 'file-text', 'download-alt', 'upload-alt', 'inbox', 'repeat', 'refresh', 'lock', 'check', 'check-empty', 'eye-open', 'eye-close', 'key', 'signin', 'signout', 'external-link', 'external-link-sign', 'link', 'reorder', 'quote-left', 'quote-right', 'spinner', 'reply', 'question', 'info', 'archive', 'collapse', 'collapse-top'], + editorIcons: ['table', 'copy', 'save', 'list-ol','paste', 'keyboard', 'paper-clip', 'crop', 'unlink', 'sort-by-alphabet', 'sort-by-alphabet-alt', 'sort-by-attributes', 'sort-by-attributes-alt', 'sort-by-order', 'sort-by-order-alt'], + directionalIcons: ['chevron-left', 'chevron-right', 'chevron-down', 'chevron-up', 'arrow-left', 'arrow-right', 'arrow-down', 'arrow-up', 'hand-right', 'hand-left', 'hand-up', 'hand-down', 'circle-arrow-left', 'circle-arrow-right', 'circle-arrow-up', 'circle-arrow-down', 'double-angle-left', 'double-angle-right', 'double-angle-down', 'double-angle-up', 'angle-left', 'angle-right', 'angle-down', 'angle-up', 'long-arrow-left', 'long-arrow-right', 'long-arrow-down', 'long-arrow-up', 'caret-left', 'caret-right', 'caret-down', 'caret-up'], + otherIcons: ['desktop', 'laptop', 'tablet', 'mobile-phone', 'building', 'firefox', 'ie', 'opera', 'qq', 'lemon', 'sign-blank', 'circle', 'circle-blank', 'terminal', 'html5', 'android', 'apple', 'windows', 'weibo', 'renren', 'bug', 'moon', 'sun'] + }; + + ChosenIcons.LANGS = {}; + ChosenIcons.LANGS['zh-cn'] = + { + emptyIcon : '[没有图标]', + commonIcons : '常用图标', + webIcons: 'Web 图标', + editorIcons: '编辑器图标', + directionalIcons: '箭头总汇', + otherIcons: '其他图标', + }; + ChosenIcons.LANGS['en'] = + { + emptyIcon : '[No Icon]', + commonIcons : 'Common Icons', + webIcons: 'Web Icons', + editorIcons: 'Editor Icons', + directionalIcons: 'Directional Icons', + otherIcons: 'Other Icons' + }; + ChosenIcons.LANGS['zh-tw'] = + { + emptyIcon : '[沒有圖標]', + commonIcons : '常用圖標', + webIcons: 'Web 圖標', + editorIcons: '編輯器圖標', + directionalIcons: '箭頭總匯', + otherIcons: '其他圖標' + }; + + ChosenIcons.prototype.getOptions = function (options) + { + options = $.extend({}, ChosenIcons.DEFAULTS, this.$.data(), options); + return options; + }; + + ChosenIcons.prototype.init = function() + { + var $this = this.$.addClass('chosen-icons').addClass(this.id); + + $this.empty(); + + if(this.options.canEmpty) + { + $this.append(this.getOptionHtml()); + } + + var lang = this.lang; + + $this.append(this.getgroupHtml('commonIcons')); + $this.append(this.getgroupHtml('webIcons')); + $this.append(this.getgroupHtml('editorIcons')); + $this.append(this.getgroupHtml('directionalIcons')); + $this.append(this.getgroupHtml('otherIcons')); + + $this.chosen({placeholder_text:' ', disable_search: true, width: '100%', inherit_select_classes: true}); + + var chosenSelector = '.chosen-container.' + this.id; + + $this.on('chosen:showing_dropdown', function() + { + $(chosenSelector + ' .chosen-results .group-option').each(function() + { + var $this = $(this).addClass('icon'); + var text = $(this).text(); + $this.html(''); + }); + }).change(function() + { + var span = $(chosenSelector + ' .chosen-single > span'); + var text = $(this).val(); + + if(text && text.length > 0) + span.html('   ' + text.substr(5).replace(/-/g, ' ') + ''); + else span.html('' + lang.emptyIcon + '') + + }); + + var val = $this.data('value'); + if(val) + { + $this.val(val).change(); + } + + } + + ChosenIcons.prototype.getgroupHtml = function(name) + { + var icons = this.options[name]; + var html = ''; + + for(var i in icons) + { + html += this.getOptionHtml(icons[i]); + } + + return html + ''; + } + + ChosenIcons.prototype.getOptionHtml = function(value) + { + name = value; + if(value && value.length > 0) + { + value = 'icon-' + value; + } + else + { + value = ''; + name = this.lang.emptyIcon; + } + return ''; + } + + $.fn.chosenIcons = function(option) + { + return this.each(function() + { + var $this = $(this); + var data = $this.data('zui.chosenIcons'); + var options = typeof option == 'object' && option; + + if (!data) $this.data('zui.chosenIcons', (data = new ChosenIcons(this, options))); + + if (typeof option == 'string') data[option](); + }) + }; + + $.fn.chosenIcons.Constructor = ChosenIcons; +}(jQuery,window,document,Math); diff --git a/assets/chosen/js/chosen.all.min.js b/assets/chosen/js/chosen.all.min.js index a3717fac7..ed8f0550c 100644 --- a/assets/chosen/js/chosen.all.min.js +++ b/assets/chosen/js/chosen.all.min.js @@ -1,3 +1,11 @@ -/* Chosen v1.1.0 | (c) 2011-2013 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */ -!function(){var a,AbstractChosen,Chosen,SelectParser,b,c={}.hasOwnProperty,d=function(a,b){function d(){this.constructor=a}for(var e in b)c.call(b,e)&&(a[e]=b[e]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};SelectParser=function(){function SelectParser(){this.options_index=0,this.parsed=[]}return SelectParser.prototype.add_node=function(a){return"OPTGROUP"===a.nodeName.toUpperCase()?this.add_group(a):this.add_option(a)},SelectParser.prototype.add_group=function(a){var b,c,d,e,f,g;for(b=this.parsed.length,this.parsed.push({array_index:b,group:!0,label:this.escapeExpression(a.label),children:0,disabled:a.disabled}),f=a.childNodes,g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(this.add_option(c,b,a.disabled));return g},SelectParser.prototype.add_option=function(a,b,c){return"OPTION"===a.nodeName.toUpperCase()?(""!==a.text?(null!=b&&(this.parsed[b].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:a.value,text:a.text,html:a.innerHTML,selected:a.selected,disabled:c===!0?c:a.disabled,group_array_index:b,classes:a.className,style:a.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1):void 0},SelectParser.prototype.escapeExpression=function(a){var b,c;return null==a||a===!1?"":/[\&\<\>\"\'\`]/.test(a)?(b={"<":"<",">":">",'"':""","'":"'","`":"`"},c=/&(?!\w+;)|[\<\>\"\'\`]/g,a.replace(c,function(a){return b[a]||"&"})):a},SelectParser}(),SelectParser.select_to_array=function(a){var b,c,d,e,f;for(c=new SelectParser,f=a.childNodes,d=0,e=f.length;e>d;d++)b=f[d],c.add_node(b);return c.parsed},AbstractChosen=function(){function AbstractChosen(a,b){this.form_field=a,this.options=null!=b?b:{},AbstractChosen.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers())}return AbstractChosen.prototype.set_default_values=function(){var a=this;return this.click_test_action=function(b){return a.test_active_click(b)},this.activate_action=function(b){return a.activate_field(b)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null!=this.options.enable_split_word_search?this.options.enable_split_word_search:!0,this.group_search=null!=this.options.group_search?this.options.group_search:!0,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null!=this.options.single_backstroke_delete?this.options.single_backstroke_delete:!0,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null!=this.options.display_selected_options?this.options.display_selected_options:!0,this.display_disabled_options=null!=this.options.display_disabled_options?this.options.display_disabled_options:!0},AbstractChosen.prototype.set_default_text=function(){return this.default_text=this.form_field.getAttribute("data-placeholder")?this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.options.placeholder_text_multiple||this.options.placeholder_text||AbstractChosen.default_multiple_text:this.options.placeholder_text_single||this.options.placeholder_text||AbstractChosen.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||AbstractChosen.default_no_result_text},AbstractChosen.prototype.mouse_enter=function(){return this.mouse_on_container=!0},AbstractChosen.prototype.mouse_leave=function(){return this.mouse_on_container=!1},AbstractChosen.prototype.input_focus=function(){var a=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return a.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},AbstractChosen.prototype.input_blur=function(){var a=this;return this.mouse_on_container?void 0:(this.active_field=!1,setTimeout(function(){return a.blur_test()},100))},AbstractChosen.prototype.results_option_build=function(a){var b,c,d,e,f;for(b="",f=this.results_data,d=0,e=f.length;e>d;d++)c=f[d],b+=c.group?this.result_add_group(c):this.result_add_option(c),(null!=a?a.first:void 0)&&(c.selected&&this.is_multiple?this.choice_build(c):c.selected&&!this.is_multiple&&this.single_set_selected_text(c.text));return b},AbstractChosen.prototype.result_add_option=function(a){var b,c;return a.search_match?this.include_option_in_results(a)?(b=[],a.disabled||a.selected&&this.is_multiple||b.push("active-result"),!a.disabled||a.selected&&this.is_multiple||b.push("disabled-result"),a.selected&&b.push("result-selected"),null!=a.group_array_index&&b.push("group-option"),""!==a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.style.cssText=a.style,c.setAttribute("data-option-array-index",a.array_index),c.innerHTML=a.search_text,this.outerHTML(c)):"":""},AbstractChosen.prototype.result_add_group=function(a){var b;return a.search_match||a.group_match?a.active_options>0?(b=document.createElement("li"),b.className="group-result",b.innerHTML=a.search_text,this.outerHTML(b)):"":""},AbstractChosen.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing?this.winnow_results():void 0},AbstractChosen.prototype.reset_single_select_options=function(){var a,b,c,d,e;for(d=this.results_data,e=[],b=0,c=d.length;c>b;b++)a=d[b],a.selected?e.push(a.selected=!1):e.push(void 0);return e},AbstractChosen.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},AbstractChosen.prototype.results_search=function(){return this.results_showing?this.winnow_results():this.results_show()},AbstractChosen.prototype.winnow_results=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m;for(this.no_results_clear(),e=0,g=this.get_search_text(),a=g.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),d=this.search_contains?"":"^",c=new RegExp(d+a,"i"),j=new RegExp(a,"i"),m=this.results_data,k=0,l=m.length;l>k;k++)b=m[k],b.search_match=!1,f=null,this.include_option_in_results(b)&&(b.group&&(b.group_match=!1,b.active_options=0),null!=b.group_array_index&&this.results_data[b.group_array_index]&&(f=this.results_data[b.group_array_index],0===f.active_options&&f.search_match&&(e+=1),f.active_options+=1),(!b.group||this.group_search)&&(b.search_text=b.group?b.label:b.html,b.search_match=this.search_string_match(b.search_text,c),b.search_match&&!b.group&&(e+=1),b.search_match?(g.length&&(h=b.search_text.search(j),i=b.search_text.substr(0,h+g.length)+""+b.search_text.substr(h+g.length),b.search_text=i.substr(0,h)+""+i.substr(h)),null!=f&&(f.group_match=!0)):null!=b.group_array_index&&this.results_data[b.group_array_index].search_match&&(b.search_match=!0)));return this.result_clear_highlight(),1>e&&g.length?(this.update_results_content(""),this.no_results(g)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},AbstractChosen.prototype.search_string_match=function(a,b){var c,d,e,f;if(b.test(a))return!0;if(this.enable_split_word_search&&(a.indexOf(" ")>=0||0===a.indexOf("["))&&(d=a.replace(/\[|\]/g,"").split(" "),d.length))for(e=0,f=d.length;f>e;e++)if(c=d[e],b.test(c))return!0},AbstractChosen.prototype.choices_count=function(){var a,b,c,d;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,d=this.form_field.options,b=0,c=d.length;c>b;b++)a=d[b],a.selected&&(this.selected_option_count+=1);return this.selected_option_count},AbstractChosen.prototype.choices_click=function(a){return a.preventDefault(),this.results_showing||this.is_disabled?void 0:this.results_show()},AbstractChosen.prototype.keyup_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),b){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(a.preventDefault(),this.results_showing)return this.result_select(a);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},AbstractChosen.prototype.clipboard_event_checker=function(){var a=this;return setTimeout(function(){return a.results_search()},50)},AbstractChosen.prototype.container_width=function(){return null!=this.options.width?this.options.width:""+this.form_field.offsetWidth+"px"},AbstractChosen.prototype.include_option_in_results=function(a){return this.is_multiple&&!this.display_selected_options&&a.selected?!1:!this.display_disabled_options&&a.disabled?!1:a.empty?!1:!0},AbstractChosen.prototype.search_results_touchstart=function(a){return this.touch_started=!0,this.search_results_mouseover(a)},AbstractChosen.prototype.search_results_touchmove=function(a){return this.touch_started=!1,this.search_results_mouseout(a)},AbstractChosen.prototype.search_results_touchend=function(a){return this.touch_started?this.search_results_mouseup(a):void 0},AbstractChosen.prototype.outerHTML=function(a){var b;return a.outerHTML?a.outerHTML:(b=document.createElement("div"),b.appendChild(a),b.innerHTML)},AbstractChosen.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:/iP(od|hone)/i.test(window.navigator.userAgent)?!1:/Android/i.test(window.navigator.userAgent)&&/Mobile/i.test(window.navigator.userAgent)?!1:!0},AbstractChosen.default_multiple_text="Select Some Options",AbstractChosen.default_single_text="Select an Option",AbstractChosen.default_no_result_text="No results match",AbstractChosen}(),a=jQuery,a.fn.extend({chosen:function(b){return AbstractChosen.browser_is_supported()?this.each(function(){var c,d;c=a(this),d=c.data("chosen"),"destroy"===b&&d?d.destroy():d||c.data("chosen",new Chosen(this,b))}):this}}),Chosen=function(c){function Chosen(){return b=Chosen.__super__.constructor.apply(this,arguments)}return d(Chosen,c),Chosen.prototype.setup=function(){return this.form_field_jq=a(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},Chosen.prototype.set_up_html=function(){var b,c;return b=["chosen-container"],b.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&b.push(this.form_field.className),this.is_rtl&&b.push("chosen-rtl"),c={"class":b.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(c.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=a("
      ",c),this.is_multiple?this.container.html('
        '):this.container.html('
        '+this.default_text+'
          '),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior(),this.form_field_jq.trigger("chosen:ready",{chosen:this})},Chosen.prototype.register_observers=function(){var a=this;return this.container.bind("mousedown.chosen",function(b){a.container_mousedown(b)}),this.container.bind("mouseup.chosen",function(b){a.container_mouseup(b)}),this.container.bind("mouseenter.chosen",function(b){a.mouse_enter(b)}),this.container.bind("mouseleave.chosen",function(b){a.mouse_leave(b)}),this.search_results.bind("mouseup.chosen",function(b){a.search_results_mouseup(b)}),this.search_results.bind("mouseover.chosen",function(b){a.search_results_mouseover(b)}),this.search_results.bind("mouseout.chosen",function(b){a.search_results_mouseout(b)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(b){a.search_results_mousewheel(b)}),this.search_results.bind("touchstart.chosen",function(b){a.search_results_touchstart(b)}),this.search_results.bind("touchmove.chosen",function(b){a.search_results_touchmove(b)}),this.search_results.bind("touchend.chosen",function(b){a.search_results_touchend(b)}),this.form_field_jq.bind("chosen:updated.chosen",function(b){a.results_update_field(b)}),this.form_field_jq.bind("chosen:activate.chosen",function(b){a.activate_field(b)}),this.form_field_jq.bind("chosen:open.chosen",function(b){a.container_mousedown(b)}),this.form_field_jq.bind("chosen:close.chosen",function(b){a.input_blur(b)}),this.search_field.bind("blur.chosen",function(b){a.input_blur(b)}),this.search_field.bind("keyup.chosen",function(b){a.keyup_checker(b)}),this.search_field.bind("keydown.chosen",function(b){a.keydown_checker(b)}),this.search_field.bind("focus.chosen",function(b){a.input_focus(b)}),this.search_field.bind("cut.chosen",function(b){a.clipboard_event_checker(b)}),this.search_field.bind("paste.chosen",function(b){a.clipboard_event_checker(b)}),this.is_multiple?this.search_choices.bind("click.chosen",function(b){a.choices_click(b)}):this.container.bind("click.chosen",function(a){a.preventDefault()})},Chosen.prototype.destroy=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},Chosen.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},Chosen.prototype.container_mousedown=function(b){return this.is_disabled||(b&&"mousedown"===b.type&&!this.results_showing&&b.preventDefault(),null!=b&&a(b.target).hasClass("search-choice-close"))?void 0:(this.active_field?this.is_multiple||!b||a(b.target)[0]!==this.selected_item[0]&&!a(b.target).parents("a.chosen-single").length||(b.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),a(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},Chosen.prototype.container_mouseup=function(a){return"ABBR"!==a.target.nodeName||this.is_disabled?void 0:this.results_reset(a)},Chosen.prototype.search_results_mousewheel=function(a){var b;return a.originalEvent&&(b=-a.originalEvent.wheelDelta||a.originalEvent.detail),null!=b?(a.preventDefault(),"DOMMouseScroll"===a.type&&(b=40*b),this.search_results.scrollTop(b+this.search_results.scrollTop())):void 0},Chosen.prototype.blur_test=function(){return!this.active_field&&this.container.hasClass("chosen-container-active")?this.close_field():void 0},Chosen.prototype.close_field=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},Chosen.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},Chosen.prototype.test_active_click=function(b){var c;return c=a(b.target).closest(".chosen-container"),c.length&&this.container[0]===c[0]?this.active_field=!0:this.close_field()},Chosen.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=SelectParser.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},Chosen.prototype.result_do_highlight=function(a){var b,c,d,e,f;if(a.length){if(this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClass("highlighted"),d=parseInt(this.search_results.css("maxHeight"),10),f=this.search_results.scrollTop(),e=d+f,c=this.result_highlight.position().top+this.search_results.scrollTop(),b=c+this.result_highlight.outerHeight(),b>=e)return this.search_results.scrollTop(b-d>0?b-d:0);if(f>c)return this.search_results.scrollTop(c)}},Chosen.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},Chosen.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},Chosen.prototype.update_results_content=function(a){return this.search_results.html(a)},Chosen.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},Chosen.prototype.set_tab_index=function(){var a;return this.form_field.tabIndex?(a=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=a):void 0},Chosen.prototype.set_label_behavior=function(){var b=this;return this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=a("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0?this.form_field_label.bind("click.chosen",function(a){return b.is_multiple?b.container_mousedown(a):b.activate_field()}):void 0},Chosen.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},Chosen.prototype.search_results_mouseup=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c.length?(this.result_highlight=c,this.result_select(b),this.search_field.focus()):void 0},Chosen.prototype.search_results_mouseover=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c?this.result_do_highlight(c):void 0},Chosen.prototype.search_results_mouseout=function(b){return a(b.target).hasClass("active-result")?this.result_clear_highlight():void 0},Chosen.prototype.choice_build=function(b){var c,d,e=this;return c=a("
        • ",{"class":"search-choice"}).html(""+b.html+""),b.disabled?c.addClass("search-choice-disabled"):(d=a("",{"class":"search-choice-close","data-option-array-index":b.array_index}),d.bind("click.chosen",function(a){return e.choice_destroy_link_click(a)}),c.append(d)),this.search_container.before(c)},Chosen.prototype.choice_destroy_link_click=function(b){return b.preventDefault(),b.stopPropagation(),this.is_disabled?void 0:this.choice_destroy(a(b.target))},Chosen.prototype.choice_destroy=function(a){return this.result_deselect(a[0].getAttribute("data-option-array-index"))?(this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),a.parents("li").first().remove(),this.search_field_scale()):void 0},Chosen.prototype.results_reset=function(){return this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change"),this.active_field?this.results_hide():void 0},Chosen.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},Chosen.prototype.result_select=function(a){var b,c;return this.result_highlight?(b=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?b.removeClass("active-result"):this.reset_single_select_options(),c=this.results_data[b[0].getAttribute("data-option-array-index")],c.selected=!0,this.form_field.options[c.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(c):this.single_set_selected_text(c.text),(a.metaKey||a.ctrlKey)&&this.is_multiple||this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[c.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale())):void 0},Chosen.prototype.single_set_selected_text=function(a){return null==a&&(a=this.default_text),a===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").text(a)},Chosen.prototype.result_deselect=function(a){var b;return b=this.results_data[a],this.form_field.options[b.options_index].disabled?!1:(b.selected=!1,this.form_field.options[b.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[b.options_index].value}),this.search_field_scale(),!0)},Chosen.prototype.single_deselect_control_build=function(){return this.allow_single_deselect?(this.selected_item.find("abbr").length||this.selected_item.find("span").first().after(''),this.selected_item.addClass("chosen-single-with-deselect")):void 0},Chosen.prototype.get_search_text=function(){return this.search_field.val()===this.default_text?"":a("
          ").text(a.trim(this.search_field.val())).html()},Chosen.prototype.winnow_results_set_highlight=function(){var a,b;return b=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),a=b.length?b.first():this.search_results.find(".active-result").first(),null!=a?this.result_do_highlight(a):void 0},Chosen.prototype.no_results=function(b){var c;return c=a('
        • '+this.results_none_found+' ""
        • '),c.find("span").first().html(b),this.search_results.append(c),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},Chosen.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},Chosen.prototype.keydown_arrow=function(){var a;return this.results_showing&&this.result_highlight?(a=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(a):void 0:this.results_show()},Chosen.prototype.keyup_arrow=function(){var a;return this.results_showing||this.is_multiple?this.result_highlight?(a=this.result_highlight.prevAll("li.active-result"),a.length?this.result_do_highlight(a.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},Chosen.prototype.keydown_backstroke=function(){var a;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(a=this.search_container.siblings("li.search-choice").last(),a.length&&!a.hasClass("search-choice-disabled")?(this.pending_backstroke=a,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},Chosen.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},Chosen.prototype.keydown_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),8!==b&&this.pending_backstroke&&this.clear_backstroke(),b){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:a.preventDefault(),this.keydown_arrow()}},Chosen.prototype.search_field_scale=function(){var b,c,d,e,f,g,h,i,j;if(this.is_multiple){for(d=0,h=0,f="position:absolute; left: -1000px; top: -1000px; display:none;",g=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],i=0,j=g.length;j>i;i++)e=g[i],f+=e+":"+this.search_field.css(e)+";";return b=a("
          ",{style:f}),b.text(this.search_field.val()),a("body").append(b),h=b.width()+25,b.remove(),c=this.container.outerWidth(),h>c-10&&(h=c-10),this.search_field.css({width:h+"px"})}},Chosen}(AbstractChosen)}.call(this); -+function(e,o,t,n){"use strict";var s=function(o,t){this.$=e(o),this.options=this.getOptions(t),this.lang=s.LANGS[this.options.lang],this.id="chosen-icons-"+parseInt(1e10*n.random()+1),this.init()};s.DEFAULTS={canEmpty:!0,lang:"zh-cn",commonIcons:["heart","user","group","list-ul","th","th-large","star","star-empty","search","envelope","dashboard","sitemap","umbrella","lightbulb","envelope-alt","cog","ok","remove","home","time","flag","flag-alt","flag-checkered","qrcode","tag","tags","book","bookmark","bookmark-empty","print","camera","picture","globe","map-marker","edit","edit-sign","play","stop","plus-sign","minus-sign","remove-sign","ok-sign","check-sign","question-sign","info-sign","exclamation-sign","plus","plus-sign","minus","minus-sign","asterisk","calendar","calendar-empty","comment","comment-alt","comments","comments-alt","folder-close","folder-open","folder-close-alt","folder-open-alt","gears","thumbs-up-alt","thumbs-up","thumbs-down-alt","thumbs-down","pushpin","building","phone","rss","rss-sign","bullhorn","bell","bell-alt","certificate","wrench","tasks","cloud","beaker","magic","smile","frown","meh","code","location-arrow"],webIcons:["share","pencil","trash","file-alt","file","file-text","download-alt","upload-alt","inbox","repeat","rotate-left","refresh","lock","unlock","check","check-empty","eye-open","eye-close","key","signin","signout","external-link","external-link-sign","link","reorder","quote-left","quote-right","spinner","reply","question","info","exclamation","archive","collapse","collapse-top"],editorIcons:["table","copy","paperclip","save","list-ol","paste","keyboard","crop","unlink","sort-by-alphabet","sort-by-alphabet-alt","sort-by-attributes","sort-by-attributes-alt","sort-by-order","sort-by-order-alt"],directionalIcons:["chevron-left","chevron-right","chevron-down","chevron-up","arrow-left","arrow-right","arrow-down","arrow-up","hand-right","hand-left","hand-up","hand-down","circle-arrow-left","circle-arrow-right","circle-arrow-up","circle-arrow-down","double-angle-left","double-angle-right","double-angle-down","double-angle-up","angle-left","angle-right","angle-down","angle-up","long-arrow-left","long-arrow-right","long-arrow-down","long-arrow-up","caret-left","caret-right","caret-down","caret-up"],otherIcons:["desktop","laptop","tablet","mobile-phone","github","building","yen","cny","firefox","ie","opera","qq","lemon","sign-blank","circle","circle-blank","terminal","html5","female","male","android","apple","windows","weibo","renren","bug","moon","sun"]},s.LANGS={},s.LANGS["zh-cn"]={emptyIcon:"[没有图标]",commonIcons:"常用图标",webIcons:"Web 图标",editorIcons:"编辑器图标",directionalIcons:"箭头总汇",otherIcons:"其他图标"},s.LANGS.en={emptyIcon:"[No Icon]",commonIcons:"Common Icons",webIcons:"Web Icons",editorIcons:"Editor Icons",directionalIcons:"Directional Icons",otherIcons:"Other Icons"},s.LANGS["zh-tw"]={emptyIcon:"[沒有圖標]",commonIcons:"常用圖標",webIcons:"Web 圖標",editorIcons:"編輯器圖標",directionalIcons:"箭頭總匯",otherIcons:"其他圖標"},s.prototype.getOptions=function(o){return o=e.extend({},s.DEFAULTS,this.$.data(),o)},s.prototype.init=function(){var o=this.$.addClass("chosen-icons").addClass(this.id);o.empty(),this.options.canEmpty&&o.append(this.getOptionHtml());var t=this.lang;o.append(this.getgroupHtml("commonIcons")),o.append(this.getgroupHtml("webIcons")),o.append(this.getgroupHtml("editorIcons")),o.append(this.getgroupHtml("directionalIcons")),o.append(this.getgroupHtml("otherIcons")),o.chosen({placeholder_text:" ",disable_search:!0,width:"100%",inherit_select_classes:!0});var n=".chosen-container."+this.id;o.on("chosen:showing_dropdown",function(){e(n+" .chosen-results .group-option").each(function(){var o=e(this).addClass("icon"),t=e(this).text();o.html('')})}).change(function(){console.log("changed");var o=e(n+" .chosen-single > span"),s=e(this).val();s&&s.length>0?o.html('   '+s.substr(5).replace(/-/g," ")+""):o.html(''+t.emptyIcon+"")});var s=o.data("value");s&&o.val(s).change()},s.prototype.getgroupHtml=function(e){var o=this.options[e],t='';for(var n in o)t+=this.getOptionHtml(o[n]);return t+""},s.prototype.getOptionHtml=function(e){return name=e,e&&e.length>0?e="icon-"+e:(e="",name=this.lang.emptyIcon),'"},e.fn.chosenIcons=function(o){return this.each(function(){var t=e(this),n=t.data("zui.chosenIcons"),a="object"==typeof o&&o;n||t.data("zui.chosenIcons",n=new s(this,a)),"string"==typeof o&&n[o]()})},e.fn.chosenIcons.Constructor=s}(jQuery,window,document,Math); +/*! + * ==================================================== + * ZUI - v1.1.0 - 2014-07-16 + * https://github.com/easysoft/zui + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2014 Catouse@easysoft; Licensed GNU + * ==================================================== + */ + +(function(){var a,b,c,d,e,f={}.hasOwnProperty,g=function(a,b){function c(){this.constructor=a}for(var d in b)f.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a};d=function(){function a(){this.options_index=0,this.parsed=[]}return a.prototype.add_node=function(a){return"OPTGROUP"===a.nodeName.toUpperCase()?this.add_group(a):this.add_option(a)},a.prototype.add_group=function(a){var b,c,d,e,f,g;for(b=this.parsed.length,this.parsed.push({array_index:b,group:!0,label:this.escapeExpression(a.label),children:0,disabled:a.disabled}),f=a.childNodes,g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(this.add_option(c,b,a.disabled));return g},a.prototype.add_option=function(a,b,c){return"OPTION"===a.nodeName.toUpperCase()?(""!==a.text?(null!=b&&(this.parsed[b].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:a.value,text:a.text,html:a.innerHTML,selected:a.selected,disabled:c===!0?c:a.disabled,group_array_index:b,classes:a.className,style:a.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1):void 0},a.prototype.escapeExpression=function(a){var b,c;return null==a||a===!1?"":/[\&\<\>\"\'\`]/.test(a)?(b={"<":"<",">":">",'"':""","'":"'","`":"`"},c=/&(?!\w+;)|[\<\>\"\'\`]/g,a.replace(c,function(a){return b[a]||"&"})):a},a}(),d.select_to_array=function(a){var b,c,e,f,g;for(c=new d,g=a.childNodes,e=0,f=g.length;f>e;e++)b=g[e],c.add_node(b);return c.parsed},b=function(){function a(b,c){this.form_field=b,this.options=null!=c?c:{},a.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers())}return a.prototype.set_default_values=function(){var a=this;return this.click_test_action=function(b){return a.test_active_click(b)},this.activate_action=function(b){return a.activate_field(b)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null!=this.options.enable_split_word_search?this.options.enable_split_word_search:!0,this.group_search=null!=this.options.group_search?this.options.group_search:!0,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null!=this.options.single_backstroke_delete?this.options.single_backstroke_delete:!0,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null!=this.options.display_selected_options?this.options.display_selected_options:!0,this.display_disabled_options=null!=this.options.display_disabled_options?this.options.display_disabled_options:!0},a.prototype.set_default_text=function(){return this.default_text=this.form_field.getAttribute("data-placeholder")?this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.options.placeholder_text_multiple||this.options.placeholder_text||a.default_multiple_text:this.options.placeholder_text_single||this.options.placeholder_text||a.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||a.default_no_result_text},a.prototype.mouse_enter=function(){return this.mouse_on_container=!0},a.prototype.mouse_leave=function(){return this.mouse_on_container=!1},a.prototype.input_focus=function(){var a=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return a.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},a.prototype.input_blur=function(){var a=this;return this.mouse_on_container?void 0:(this.active_field=!1,setTimeout(function(){return a.blur_test()},100))},a.prototype.results_option_build=function(a){var b,c,d,e,f;for(b="",f=this.results_data,d=0,e=f.length;e>d;d++)c=f[d],b+=c.group?this.result_add_group(c):this.result_add_option(c),(null!=a?a.first:void 0)&&(c.selected&&this.is_multiple?this.choice_build(c):c.selected&&!this.is_multiple&&this.single_set_selected_text(c.text));return b},a.prototype.result_add_option=function(a){var b,c;return a.search_match&&this.include_option_in_results(a)?(b=[],a.disabled||a.selected&&this.is_multiple||b.push("active-result"),!a.disabled||a.selected&&this.is_multiple||b.push("disabled-result"),a.selected&&b.push("result-selected"),null!=a.group_array_index&&b.push("group-option"),""!==a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.style.cssText=a.style,c.setAttribute("data-option-array-index",a.array_index),c.innerHTML=a.search_text,this.outerHTML(c)):""},a.prototype.result_add_group=function(a){var b;return(a.search_match||a.group_match)&&a.active_options>0?(b=document.createElement("li"),b.className="group-result",b.innerHTML=a.search_text,this.outerHTML(b)):""},a.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing?this.winnow_results():void 0},a.prototype.reset_single_select_options=function(){var a,b,c,d,e;for(d=this.results_data,e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(a.selected?a.selected=!1:void 0);return e},a.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},a.prototype.results_search=function(){return this.results_showing?this.winnow_results():this.results_show()},a.prototype.winnow_results=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m;for(this.no_results_clear(),e=0,g=this.get_search_text(),a=g.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),d=this.search_contains?"":"^",c=new RegExp(d+a,"i"),j=new RegExp(a,"i"),m=this.results_data,k=0,l=m.length;l>k;k++)b=m[k],b.search_match=!1,f=null,this.include_option_in_results(b)&&(b.group&&(b.group_match=!1,b.active_options=0),null!=b.group_array_index&&this.results_data[b.group_array_index]&&(f=this.results_data[b.group_array_index],0===f.active_options&&f.search_match&&(e+=1),f.active_options+=1),(!b.group||this.group_search)&&(b.search_text=b.group?b.label:b.html,b.search_match=this.search_string_match(b.search_text,c),b.search_match&&!b.group&&(e+=1),b.search_match?(g.length&&(h=b.search_text.search(j),i=b.search_text.substr(0,h+g.length)+""+b.search_text.substr(h+g.length),b.search_text=i.substr(0,h)+""+i.substr(h)),null!=f&&(f.group_match=!0)):null!=b.group_array_index&&this.results_data[b.group_array_index].search_match&&(b.search_match=!0)));return this.result_clear_highlight(),1>e&&g.length?(this.update_results_content(""),this.no_results(g)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},a.prototype.search_string_match=function(a,b){var c,d,e,f;if(b.test(a))return!0;if(this.enable_split_word_search&&(a.indexOf(" ")>=0||0===a.indexOf("["))&&(d=a.replace(/\[|\]/g,"").split(" "),d.length))for(e=0,f=d.length;f>e;e++)if(c=d[e],b.test(c))return!0},a.prototype.choices_count=function(){var a,b,c,d;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,d=this.form_field.options,b=0,c=d.length;c>b;b++)a=d[b],a.selected&&(this.selected_option_count+=1);return this.selected_option_count},a.prototype.choices_click=function(a){return a.preventDefault(),this.results_showing||this.is_disabled?void 0:this.results_show()},a.prototype.keyup_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),b){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(a.preventDefault(),this.results_showing)return this.result_select(a);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},a.prototype.clipboard_event_checker=function(){var a=this;return setTimeout(function(){return a.results_search()},50)},a.prototype.container_width=function(){return null!=this.options.width?this.options.width:""+this.form_field.offsetWidth+"px"},a.prototype.include_option_in_results=function(a){return this.is_multiple&&!this.display_selected_options&&a.selected?!1:!this.display_disabled_options&&a.disabled?!1:a.empty?!1:!0},a.prototype.search_results_touchstart=function(a){return this.touch_started=!0,this.search_results_mouseover(a)},a.prototype.search_results_touchmove=function(a){return this.touch_started=!1,this.search_results_mouseout(a)},a.prototype.search_results_touchend=function(a){return this.touch_started?this.search_results_mouseup(a):void 0},a.prototype.outerHTML=function(a){var b;return a.outerHTML?a.outerHTML:(b=document.createElement("div"),b.appendChild(a),b.innerHTML)},a.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:/iP(od|hone)/i.test(window.navigator.userAgent)?!1:/Android/i.test(window.navigator.userAgent)&&/Mobile/i.test(window.navigator.userAgent)?!1:!0},a.default_multiple_text="Select Some Options",a.default_single_text="Select an Option",a.default_no_result_text="No results match",a}(),a=jQuery,a.fn.extend({chosen:function(d){return b.browser_is_supported()?this.each(function(){var b,e;b=a(this),e=b.data("chosen"),"destroy"===d&&e?e.destroy():e||b.data("chosen",new c(this,d))}):this}}),c=function(b){function c(){return e=c.__super__.constructor.apply(this,arguments)}return g(c,b),c.prototype.setup=function(){return this.form_field_jq=a(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},c.prototype.set_up_html=function(){var b,c;return b=["chosen-container"],b.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&b.push(this.form_field.className),this.is_rtl&&b.push("chosen-rtl"),c={"class":b.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(c.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=a("
          ",c),this.container.html(this.is_multiple?'
            ':'
            '+this.default_text+'
              '),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior(),this.form_field_jq.trigger("chosen:ready",{chosen:this})},c.prototype.register_observers=function(){var a=this;return this.container.bind("mousedown.chosen",function(b){a.container_mousedown(b)}),this.container.bind("mouseup.chosen",function(b){a.container_mouseup(b)}),this.container.bind("mouseenter.chosen",function(b){a.mouse_enter(b)}),this.container.bind("mouseleave.chosen",function(b){a.mouse_leave(b)}),this.search_results.bind("mouseup.chosen",function(b){a.search_results_mouseup(b)}),this.search_results.bind("mouseover.chosen",function(b){a.search_results_mouseover(b)}),this.search_results.bind("mouseout.chosen",function(b){a.search_results_mouseout(b)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(b){a.search_results_mousewheel(b)}),this.search_results.bind("touchstart.chosen",function(b){a.search_results_touchstart(b)}),this.search_results.bind("touchmove.chosen",function(b){a.search_results_touchmove(b)}),this.search_results.bind("touchend.chosen",function(b){a.search_results_touchend(b)}),this.form_field_jq.bind("chosen:updated.chosen",function(b){a.results_update_field(b)}),this.form_field_jq.bind("chosen:activate.chosen",function(b){a.activate_field(b)}),this.form_field_jq.bind("chosen:open.chosen",function(b){a.container_mousedown(b)}),this.form_field_jq.bind("chosen:close.chosen",function(b){a.input_blur(b)}),this.search_field.bind("blur.chosen",function(b){a.input_blur(b)}),this.search_field.bind("keyup.chosen",function(b){a.keyup_checker(b)}),this.search_field.bind("keydown.chosen",function(b){a.keydown_checker(b)}),this.search_field.bind("focus.chosen",function(b){a.input_focus(b)}),this.search_field.bind("cut.chosen",function(b){a.clipboard_event_checker(b)}),this.search_field.bind("paste.chosen",function(b){a.clipboard_event_checker(b)}),this.is_multiple?this.search_choices.bind("click.chosen",function(b){a.choices_click(b)}):this.container.bind("click.chosen",function(a){a.preventDefault()})},c.prototype.destroy=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},c.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},c.prototype.container_mousedown=function(b){return this.is_disabled||(b&&"mousedown"===b.type&&!this.results_showing&&b.preventDefault(),null!=b&&a(b.target).hasClass("search-choice-close"))?void 0:(this.active_field?this.is_multiple||!b||a(b.target)[0]!==this.selected_item[0]&&!a(b.target).parents("a.chosen-single").length||(b.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),a(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},c.prototype.container_mouseup=function(a){return"ABBR"!==a.target.nodeName||this.is_disabled?void 0:this.results_reset(a)},c.prototype.search_results_mousewheel=function(a){var b;return a.originalEvent&&(b=-a.originalEvent.wheelDelta||a.originalEvent.detail),null!=b?(a.preventDefault(),"DOMMouseScroll"===a.type&&(b=40*b),this.search_results.scrollTop(b+this.search_results.scrollTop())):void 0},c.prototype.blur_test=function(){return!this.active_field&&this.container.hasClass("chosen-container-active")?this.close_field():void 0},c.prototype.close_field=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},c.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},c.prototype.test_active_click=function(b){var c;return c=a(b.target).closest(".chosen-container"),c.length&&this.container[0]===c[0]?this.active_field=!0:this.close_field()},c.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=d.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},c.prototype.result_do_highlight=function(a){var b,c,d,e,f;if(a.length){if(this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClass("highlighted"),d=parseInt(this.search_results.css("maxHeight"),10),f=this.search_results.scrollTop(),e=d+f,c=this.result_highlight.position().top+this.search_results.scrollTop(),b=c+this.result_highlight.outerHeight(),b>=e)return this.search_results.scrollTop(b-d>0?b-d:0);if(f>c)return this.search_results.scrollTop(c)}},c.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},c.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},c.prototype.update_results_content=function(a){return this.search_results.html(a)},c.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},c.prototype.set_tab_index=function(){var a;return this.form_field.tabIndex?(a=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=a):void 0},c.prototype.set_label_behavior=function(){var b=this;return this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=a("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0?this.form_field_label.bind("click.chosen",function(a){return b.is_multiple?b.container_mousedown(a):b.activate_field()}):void 0},c.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},c.prototype.search_results_mouseup=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c.length?(this.result_highlight=c,this.result_select(b),this.search_field.focus()):void 0},c.prototype.search_results_mouseover=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c?this.result_do_highlight(c):void 0},c.prototype.search_results_mouseout=function(b){return a(b.target).hasClass("active-result")?this.result_clear_highlight():void 0},c.prototype.choice_build=function(b){var c,d,e=this;return c=a("
            • ",{"class":"search-choice"}).html(""+b.html+""),b.disabled?c.addClass("search-choice-disabled"):(d=a("",{"class":"search-choice-close","data-option-array-index":b.array_index}),d.bind("click.chosen",function(a){return e.choice_destroy_link_click(a)}),c.append(d)),this.search_container.before(c)},c.prototype.choice_destroy_link_click=function(b){return b.preventDefault(),b.stopPropagation(),this.is_disabled?void 0:this.choice_destroy(a(b.target))},c.prototype.choice_destroy=function(a){return this.result_deselect(a[0].getAttribute("data-option-array-index"))?(this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),a.parents("li").first().remove(),this.search_field_scale()):void 0},c.prototype.results_reset=function(){return this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change"),this.active_field?this.results_hide():void 0},c.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},c.prototype.result_select=function(a){var b,c;return this.result_highlight?(b=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?b.removeClass("active-result"):this.reset_single_select_options(),c=this.results_data[b[0].getAttribute("data-option-array-index")],c.selected=!0,this.form_field.options[c.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(c):this.single_set_selected_text(c.text),(a.metaKey||a.ctrlKey)&&this.is_multiple||this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[c.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale())):void 0},c.prototype.single_set_selected_text=function(a){return null==a&&(a=this.default_text),a===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").text(a)},c.prototype.result_deselect=function(a){var b;return b=this.results_data[a],this.form_field.options[b.options_index].disabled?!1:(b.selected=!1,this.form_field.options[b.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[b.options_index].value}),this.search_field_scale(),!0)},c.prototype.single_deselect_control_build=function(){return this.allow_single_deselect?(this.selected_item.find("abbr").length||this.selected_item.find("span").first().after(''),this.selected_item.addClass("chosen-single-with-deselect")):void 0},c.prototype.get_search_text=function(){return this.search_field.val()===this.default_text?"":a("
              ").text(a.trim(this.search_field.val())).html()},c.prototype.winnow_results_set_highlight=function(){var a,b;return b=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),a=b.length?b.first():this.search_results.find(".active-result").first(),null!=a?this.result_do_highlight(a):void 0},c.prototype.no_results=function(b){var c;return c=a('
            • '+this.results_none_found+' ""
            • '),c.find("span").first().html(b),this.search_results.append(c),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},c.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},c.prototype.keydown_arrow=function(){var a;return this.results_showing&&this.result_highlight?(a=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(a):void 0:this.results_show()},c.prototype.keyup_arrow=function(){var a;return this.results_showing||this.is_multiple?this.result_highlight?(a=this.result_highlight.prevAll("li.active-result"),a.length?this.result_do_highlight(a.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},c.prototype.keydown_backstroke=function(){var a;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(a=this.search_container.siblings("li.search-choice").last(),a.length&&!a.hasClass("search-choice-disabled")?(this.pending_backstroke=a,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},c.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},c.prototype.keydown_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),8!==b&&this.pending_backstroke&&this.clear_backstroke(),b){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:a.preventDefault(),this.keydown_arrow()}},c.prototype.search_field_scale=function(){var b,c,d,e,f,g,h,i,j;if(this.is_multiple){for(d=0,h=0,f="position:absolute; left: -1000px; top: -1000px; display:none;",g=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],i=0,j=g.length;j>i;i++)e=g[i],f+=e+":"+this.search_field.css(e)+";";return b=a("
              ",{style:f}),b.text(this.search_field.val()),a("body").append(b),h=b.width()+25,b.remove(),c=this.container.outerWidth(),h>c-10&&(h=c-10),this.search_field.css({width:h+"px"})}},c}(b)}).call(this),+function(a,b,c,d){"use strict";var e=function(b,c){this.$=a(b),this.options=this.getOptions(c),this.lang=e.LANGS[this.options.lang],this.id="chosen-icons-"+parseInt(1e10*d.random()+1),this.init()};e.DEFAULTS={canEmpty:!0,lang:"zh-cn",commonIcons:["heart","user","group","list-ul","th","star","star-empty","search","envelope","dashboard","sitemap","umbrella","lightbulb","envelope-alt","cog","ok","remove","home","time","flag","flag-alt","flag-checkered","qrcode","tag","tags","book","bookmark","bookmark-empty","print","camera","picture","globe","map-marker","edit","edit-sign","play","stop","plus-sign","minus-sign","remove-sign","ok-sign","check-sign","question-sign","info-sign","exclamation-sign","plus","plus-sign","minus","minus-sign","asterisk","calendar","calendar-empty","comment","comment-alt","comments","comments-alt","folder-close","folder-open","folder-close-alt","folder-open-alt","gears","thumbs-up-alt","thumbs-up","thumbs-down-alt","thumbs-down","pushpin","building","phone","rss","rss-sign","bullhorn","bell","bell-alt","certificate","wrench","tasks","cloud","beaker","magic","smile","frown","meh","code","location-arrow"],webIcons:["share","pencil","trash","file-alt","file","file-text","download-alt","upload-alt","inbox","repeat","rotate-left","refresh","lock","unlock","check","check-empty","eye-open","eye-close","key","signin","signout","external-link","external-link-sign","link","reorder","quote-left","quote-right","spinner","reply","question","info","exclamation","archive","collapse","collapse-top"],editorIcons:["table","copy","paperclip","save","list-ol","paste","keyboard","crop","unlink","sort-by-alphabet","sort-by-alphabet-alt","sort-by-attributes","sort-by-attributes-alt","sort-by-order","sort-by-order-alt"],directionalIcons:["chevron-left","chevron-right","chevron-down","chevron-up","arrow-left","arrow-right","arrow-down","arrow-up","hand-right","hand-left","hand-up","hand-down","circle-arrow-left","circle-arrow-right","circle-arrow-up","circle-arrow-down","double-angle-left","double-angle-right","double-angle-down","double-angle-up","angle-left","angle-right","angle-down","angle-up","long-arrow-left","long-arrow-right","long-arrow-down","long-arrow-up","caret-left","caret-right","caret-down","caret-up"],otherIcons:["desktop","laptop","tablet","mobile-phone","github","building","yen","cny","firefox","ie","opera","qq","lemon","sign-blank","circle","circle-blank","terminal","html5","female","male","andriod","apple","windows","weibo","renren","bug","moon","sun"]},e.LANGS={},e.LANGS["zh-cn"]={commonIcons:"常用图标",webIcons:"Web 图标",editorIcons:"编辑器图标",directionalIcons:"箭头总汇",otherIcons:"其他图标"},e.LANGS.en={commonIcons:"Common Icons",webIcons:"Web Icons",editorIcons:"Editor Icons",directionalIcons:"Directional Icons",otherIcons:"Other Icons"},e.LANGS["zh-tw"]={commonIcons:"常用圖標",webIcons:"Web 圖標",editorIcons:"編輯器圖標",directionalIcons:"箭頭總匯",otherIcons:"其他圖標"},e.prototype.getOptions=function(b){return b=a.extend({},e.DEFAULTS,this.$.data(),b)},e.prototype.init=function(){var b=this.$.addClass("chosen-icons").addClass(this.id);b.empty(),this.options.canEmpty&&b.append(this.getOptionHtml()),b.append(this.getgroupHtml("commonIcons")),b.append(this.getgroupHtml("webIcons")),b.append(this.getgroupHtml("editorIcons")),b.append(this.getgroupHtml("directionalIcons")),b.append(this.getgroupHtml("otherIcons")),b.chosen({placeholder_text:" ",disable_search:!0,width:"100%",inherit_select_classes:!0});var c=".chosen-container."+this.id;b.on("chosen:showing_dropdown",function(){a(c+" .chosen-results .group-option").each(function(){var b=a(this).addClass("icon"),c=b.text();b.html('')})}).change(function(){a(c+" .chosen-single > span");var b=a(this).val();a(c+" .chosen-single > span").html('   '+b)});var d=b.data("value");d&&b.val(d).change()},e.prototype.getgroupHtml=function(a){var b=this.options[a],c='';for(var d in b)c+=this.getOptionHtml(b[d]);return c+""},e.prototype.getOptionHtml=function(a){return a=a&&a.length>0?"icon-"+a:"",'"},a.fn.chosenIcons=function(b){return this.each(function(){var c=a(this),d=c.data("zui.chosenIcons"),f="object"==typeof b&&b;d||c.data("zui.chosenIcons",d=new e(this,f)),"string"==typeof b&&d[b]()})},a.fn.chosenIcons.Constructor=e}(jQuery,window,document,Math),+function(a,b,c,d){"use strict";var e=function(b,c){this.$=a(b),this.options=this.getOptions(c),this.lang=e.LANGS[this.options.lang],this.id="chosen-icons-"+parseInt(1e10*d.random()+1),this.init()};e.DEFAULTS={canEmpty:!0,lang:"zh-cn",commonIcons:["heart","user","group","list-ul","th","th-large","star","star-empty","search","envelope","dashboard","sitemap","umbrella","lightbulb","envelope-alt","cog","ok","remove","home","time","flag","flag-alt","flag-checkered","qrcode","tag","tags","book","bookmark","bookmark-empty","print","camera","picture","globe","map-marker","edit","edit-sign","play","stop","plus-sign","minus-sign","remove-sign","ok-sign","check-sign","question-sign","info-sign","exclamation-sign","plus","plus-sign","minus","minus-sign","asterisk","calendar","calendar-empty","comment","comment-alt","comments","comments-alt","folder-close","folder-open","folder-close-alt","folder-open-alt","thumbs-up","thumbs-down","pushpin","building","phone","rss","rss-sign","bullhorn","bell","bell-alt","certificate","wrench","tasks","cloud","beaker","magic","smile","frown","meh","code","location-arrow"],webIcons:["share","pencil","trash","file-alt","file","file-text","download-alt","upload-alt","inbox","repeat","refresh","lock","check","check-empty","eye-open","eye-close","key","signin","signout","external-link","external-link-sign","link","reorder","quote-left","quote-right","spinner","reply","question","info","archive","collapse","collapse-top"],editorIcons:["table","copy","save","list-ol","paste","keyboard","paper-clip","crop","unlink","sort-by-alphabet","sort-by-alphabet-alt","sort-by-attributes","sort-by-attributes-alt","sort-by-order","sort-by-order-alt"],directionalIcons:["chevron-left","chevron-right","chevron-down","chevron-up","arrow-left","arrow-right","arrow-down","arrow-up","hand-right","hand-left","hand-up","hand-down","circle-arrow-left","circle-arrow-right","circle-arrow-up","circle-arrow-down","double-angle-left","double-angle-right","double-angle-down","double-angle-up","angle-left","angle-right","angle-down","angle-up","long-arrow-left","long-arrow-right","long-arrow-down","long-arrow-up","caret-left","caret-right","caret-down","caret-up"],otherIcons:["desktop","laptop","tablet","mobile-phone","building","firefox","ie","opera","qq","lemon","sign-blank","circle","circle-blank","terminal","html5","android","apple","windows","weibo","renren","bug","moon","sun"]},e.LANGS={},e.LANGS["zh-cn"]={emptyIcon:"[没有图标]",commonIcons:"常用图标",webIcons:"Web 图标",editorIcons:"编辑器图标",directionalIcons:"箭头总汇",otherIcons:"其他图标"},e.LANGS.en={emptyIcon:"[No Icon]",commonIcons:"Common Icons",webIcons:"Web Icons",editorIcons:"Editor Icons",directionalIcons:"Directional Icons",otherIcons:"Other Icons"},e.LANGS["zh-tw"]={emptyIcon:"[沒有圖標]",commonIcons:"常用圖標",webIcons:"Web 圖標",editorIcons:"編輯器圖標",directionalIcons:"箭頭總匯",otherIcons:"其他圖標"},e.prototype.getOptions=function(b){return b=a.extend({},e.DEFAULTS,this.$.data(),b) +},e.prototype.init=function(){var b=this.$.addClass("chosen-icons").addClass(this.id);b.empty(),this.options.canEmpty&&b.append(this.getOptionHtml());var c=this.lang;b.append(this.getgroupHtml("commonIcons")),b.append(this.getgroupHtml("webIcons")),b.append(this.getgroupHtml("editorIcons")),b.append(this.getgroupHtml("directionalIcons")),b.append(this.getgroupHtml("otherIcons")),b.chosen({placeholder_text:" ",disable_search:!0,width:"100%",inherit_select_classes:!0});var d=".chosen-container."+this.id;b.on("chosen:showing_dropdown",function(){a(d+" .chosen-results .group-option").each(function(){var b=a(this).addClass("icon"),c=a(this).text();b.html('')})}).change(function(){var b=a(d+" .chosen-single > span"),e=a(this).val();b.html(e&&e.length>0?'   '+e.substr(5).replace(/-/g," ")+"":''+c.emptyIcon+"")});var e=b.data("value");e&&b.val(e).change()},e.prototype.getgroupHtml=function(a){var b=this.options[a],c='';for(var d in b)c+=this.getOptionHtml(b[d]);return c+""},e.prototype.getOptionHtml=function(a){return name=a,a&&a.length>0?a="icon-"+a:(a="",name=this.lang.emptyIcon),'"},a.fn.chosenIcons=function(b){return this.each(function(){var c=a(this),d=c.data("zui.chosenIcons"),f="object"==typeof b&&b;d||c.data("zui.chosenIcons",d=new e(this,f)),"string"==typeof b&&d[b]()})},a.fn.chosenIcons.Constructor=e}(jQuery,window,document,Math); \ No newline at end of file diff --git a/assets/chosen/js/chosen.icons.js b/assets/chosen/js/chosen.icons.js index e3497a4f4..9097f1365 100644 --- a/assets/chosen/js/chosen.icons.js +++ b/assets/chosen/js/chosen.icons.js @@ -1,3 +1,12 @@ +/*! + * ==================================================== + * ZUI - v1.1.0 - 2014-07-16 + * https://github.com/easysoft/zui + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2014 Catouse@easysoft; Licensed GNU + * ==================================================== + */ + /* ChosenIcons */ +function($, window, document, Math) { diff --git a/assets/chosen/js/chosen.icons.min.js b/assets/chosen/js/chosen.icons.min.js index 04ddeb696..fb62672bb 100644 --- a/assets/chosen/js/chosen.icons.min.js +++ b/assets/chosen/js/chosen.icons.min.js @@ -1 +1,10 @@ -+function(e,t,i,s){"use strict";var a=function(t,i){this.$=e(t),this.options=this.getOptions(i),this.lang=a.LANGS[this.options.lang],this.id="chosen-icons-"+parseInt(1e10*s.random()+1),this.init()};a.DEFAULTS={canEmpty:!0,lang:"zh-cn",commonIcons:["heart","user","group","list-ul","th","th-large","star","star-empty","search","envelope","dashboard","sitemap","umbrella","lightbulb","envelope-alt","cog","ok","remove","home","time","flag","flag-alt","flag-checkered","qrcode","tag","tags","book","bookmark","bookmark-empty","print","camera","picture","globe","map-marker","edit","edit-sign","play","stop","plus-sign","minus-sign","remove-sign","ok-sign","check-sign","question-sign","info-sign","exclamation-sign","plus","plus-sign","minus","minus-sign","asterisk","calendar","calendar-empty","comment","comment-alt","comments","comments-alt","folder-close","folder-open","folder-close-alt","folder-open-alt","thumbs-up","thumbs-down","pushpin","building","phone","rss","rss-sign","bullhorn","bell","bell-alt","certificate","wrench","tasks","cloud","beaker","magic","smile","frown","meh","code","location-arrow"],webIcons:["share","pencil","trash","file-alt","file","file-text","download-alt","upload-alt","inbox","repeat","refresh","lock","check","check-empty","eye-open","eye-close","key","signin","signout","external-link","external-link-sign","link","reorder","quote-left","quote-right","spinner","reply","question","info","archive","collapse","collapse-top"],editorIcons:["table","copy","save","list-ol","paste","keyboard","paper-clip","crop","unlink","sort-by-alphabet","sort-by-alphabet-alt","sort-by-attributes","sort-by-attributes-alt","sort-by-order","sort-by-order-alt"],directionalIcons:["chevron-left","chevron-right","chevron-down","chevron-up","arrow-left","arrow-right","arrow-down","arrow-up","hand-right","hand-left","hand-up","hand-down","circle-arrow-left","circle-arrow-right","circle-arrow-up","circle-arrow-down","double-angle-left","double-angle-right","double-angle-down","double-angle-up","angle-left","angle-right","angle-down","angle-up","long-arrow-left","long-arrow-right","long-arrow-down","long-arrow-up","caret-left","caret-right","caret-down","caret-up"],otherIcons:["desktop","laptop","tablet","mobile-phone","building","firefox","ie","opera","qq","lemon","sign-blank","circle","circle-blank","terminal","html5","android","apple","windows","weibo","renren","bug","moon","sun"]},a.LANGS={},a.LANGS["zh-cn"]={emptyIcon:"[没有图标]",commonIcons:"常用图标",webIcons:"Web 图标",editorIcons:"编辑器图标",directionalIcons:"箭头总汇",otherIcons:"其他图标"},a.LANGS.en={emptyIcon:"[No Icon]",commonIcons:"Common Icons",webIcons:"Web Icons",editorIcons:"Editor Icons",directionalIcons:"Directional Icons",otherIcons:"Other Icons"},a.LANGS["zh-tw"]={emptyIcon:"[沒有圖標]",commonIcons:"常用圖標",webIcons:"Web 圖標",editorIcons:"編輯器圖標",directionalIcons:"箭頭總匯",otherIcons:"其他圖標"},a.prototype.getOptions=function(t){return t=e.extend({},a.DEFAULTS,this.$.data(),t)},a.prototype.init=function(){var t=this.$.addClass("chosen-icons").addClass(this.id);t.empty(),this.options.canEmpty&&t.append(this.getOptionHtml());var i=this.lang;t.append(this.getgroupHtml("commonIcons")),t.append(this.getgroupHtml("webIcons")),t.append(this.getgroupHtml("editorIcons")),t.append(this.getgroupHtml("directionalIcons")),t.append(this.getgroupHtml("otherIcons")),t.chosen({placeholder_text:" ",disable_search:!0,width:"100%",inherit_select_classes:!0});var s=".chosen-container."+this.id;t.on("chosen:showing_dropdown",function(){e(s+" .chosen-results .group-option").each(function(){var t=e(this).addClass("icon"),i=e(this).text();t.html('')})}).change(function(){var t=e(s+" .chosen-single > span"),a=e(this).val();a&&a.length>0?t.html('   '+a.substr(5).replace(/-/g," ")+""):t.html(''+i.emptyIcon+"")});var a=t.data("value");a&&t.val(a).change()},a.prototype.getgroupHtml=function(e){var t=this.options[e],i='';for(var s in t)i+=this.getOptionHtml(t[s]);return i+""},a.prototype.getOptionHtml=function(e){return name=e,e&&e.length>0?e="icon-"+e:(e="",name=this.lang.emptyIcon),'"},e.fn.chosenIcons=function(t){return this.each(function(){var i=e(this),s=i.data("zui.chosenIcons"),n="object"==typeof t&&t;s||i.data("zui.chosenIcons",s=new a(this,n)),"string"==typeof t&&s[t]()})},e.fn.chosenIcons.Constructor=a}(jQuery,window,document,Math); \ No newline at end of file +/*! + * ==================================================== + * ZUI - v1.1.0 - 2014-07-16 + * https://github.com/easysoft/zui + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2014 Catouse@easysoft; Licensed GNU + * ==================================================== + */ + ++function(a,b,c,d){"use strict";var e=function(b,c){this.$=a(b),this.options=this.getOptions(c),this.lang=e.LANGS[this.options.lang],this.id="chosen-icons-"+parseInt(1e10*d.random()+1),this.init()};e.DEFAULTS={canEmpty:!0,lang:"zh-cn",commonIcons:["heart","user","group","list-ul","th","th-large","star","star-empty","search","envelope","dashboard","sitemap","umbrella","lightbulb","envelope-alt","cog","ok","remove","home","time","flag","flag-alt","flag-checkered","qrcode","tag","tags","book","bookmark","bookmark-empty","print","camera","picture","globe","map-marker","edit","edit-sign","play","stop","plus-sign","minus-sign","remove-sign","ok-sign","check-sign","question-sign","info-sign","exclamation-sign","plus","plus-sign","minus","minus-sign","asterisk","calendar","calendar-empty","comment","comment-alt","comments","comments-alt","folder-close","folder-open","folder-close-alt","folder-open-alt","thumbs-up","thumbs-down","pushpin","building","phone","rss","rss-sign","bullhorn","bell","bell-alt","certificate","wrench","tasks","cloud","beaker","magic","smile","frown","meh","code","location-arrow"],webIcons:["share","pencil","trash","file-alt","file","file-text","download-alt","upload-alt","inbox","repeat","refresh","lock","check","check-empty","eye-open","eye-close","key","signin","signout","external-link","external-link-sign","link","reorder","quote-left","quote-right","spinner","reply","question","info","archive","collapse","collapse-top"],editorIcons:["table","copy","save","list-ol","paste","keyboard","paper-clip","crop","unlink","sort-by-alphabet","sort-by-alphabet-alt","sort-by-attributes","sort-by-attributes-alt","sort-by-order","sort-by-order-alt"],directionalIcons:["chevron-left","chevron-right","chevron-down","chevron-up","arrow-left","arrow-right","arrow-down","arrow-up","hand-right","hand-left","hand-up","hand-down","circle-arrow-left","circle-arrow-right","circle-arrow-up","circle-arrow-down","double-angle-left","double-angle-right","double-angle-down","double-angle-up","angle-left","angle-right","angle-down","angle-up","long-arrow-left","long-arrow-right","long-arrow-down","long-arrow-up","caret-left","caret-right","caret-down","caret-up"],otherIcons:["desktop","laptop","tablet","mobile-phone","building","firefox","ie","opera","qq","lemon","sign-blank","circle","circle-blank","terminal","html5","android","apple","windows","weibo","renren","bug","moon","sun"]},e.LANGS={},e.LANGS["zh-cn"]={emptyIcon:"[没有图标]",commonIcons:"常用图标",webIcons:"Web 图标",editorIcons:"编辑器图标",directionalIcons:"箭头总汇",otherIcons:"其他图标"},e.LANGS.en={emptyIcon:"[No Icon]",commonIcons:"Common Icons",webIcons:"Web Icons",editorIcons:"Editor Icons",directionalIcons:"Directional Icons",otherIcons:"Other Icons"},e.LANGS["zh-tw"]={emptyIcon:"[沒有圖標]",commonIcons:"常用圖標",webIcons:"Web 圖標",editorIcons:"編輯器圖標",directionalIcons:"箭頭總匯",otherIcons:"其他圖標"},e.prototype.getOptions=function(b){return b=a.extend({},e.DEFAULTS,this.$.data(),b)},e.prototype.init=function(){var b=this.$.addClass("chosen-icons").addClass(this.id);b.empty(),this.options.canEmpty&&b.append(this.getOptionHtml());var c=this.lang;b.append(this.getgroupHtml("commonIcons")),b.append(this.getgroupHtml("webIcons")),b.append(this.getgroupHtml("editorIcons")),b.append(this.getgroupHtml("directionalIcons")),b.append(this.getgroupHtml("otherIcons")),b.chosen({placeholder_text:" ",disable_search:!0,width:"100%",inherit_select_classes:!0});var d=".chosen-container."+this.id;b.on("chosen:showing_dropdown",function(){a(d+" .chosen-results .group-option").each(function(){var b=a(this).addClass("icon"),c=a(this).text();b.html('')})}).change(function(){var b=a(d+" .chosen-single > span"),e=a(this).val();b.html(e&&e.length>0?'   '+e.substr(5).replace(/-/g," ")+"":''+c.emptyIcon+"")});var e=b.data("value");e&&b.val(e).change()},e.prototype.getgroupHtml=function(a){var b=this.options[a],c='';for(var d in b)c+=this.getOptionHtml(b[d]);return c+""},e.prototype.getOptionHtml=function(a){return name=a,a&&a.length>0?a="icon-"+a:(a="",name=this.lang.emptyIcon),'"},a.fn.chosenIcons=function(b){return this.each(function(){var c=a(this),d=c.data("zui.chosenIcons"),f="object"==typeof b&&b;d||c.data("zui.chosenIcons",d=new e(this,f)),"string"==typeof b&&d[b]()})},a.fn.chosenIcons.Constructor=e}(jQuery,window,document,Math); \ No newline at end of file diff --git a/assets/datetimepicker/css/datetimepicker.min.css b/assets/datetimepicker/css/datetimepicker.min.css index af044c0df..ecaa9cb98 100644 --- a/assets/datetimepicker/css/datetimepicker.min.css +++ b/assets/datetimepicker/css/datetimepicker.min.css @@ -3,4 +3,4 @@ * Copyright 2012 Stefan Petre * Improvements by Catouse * Licensed under the Apache License v2.0 - */.datetimepicker{padding:4px;margin-top:1px;white-space:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;direction:ltr}.datetimepicker.datetimepicker-rtl{direction:rtl}.datetimepicker.datetimepicker-rtl table tr td span{float:right}.datetimepicker>div{display:none}.datetimepicker.days div.datetimepicker-days,.datetimepicker.hours div.datetimepicker-hours,.datetimepicker.minutes div.datetimepicker-minutes,.datetimepicker.months div.datetimepicker-months,.datetimepicker.years div.datetimepicker-years{display:block}.datetimepicker table{margin:0}.datetimepicker table tr td.day:hover,.datetimepicker table tr td.hour:hover,.datetimepicker table tr td.minute:hover{background:#eee;cursor:pointer}.datetimepicker table tr td span{display:block;width:23%;height:54px;line-height:54px;float:left;margin:1%;cursor:pointer;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.datetimepicker table tr td span:hover{background:#eee}.datetimepicker table tr td span.old{color:#999}.datetimepicker .datetimepicker-hours span,.datetimepicker .datetimepicker-minutes span{height:26px;line-height:26px}.datetimepicker th.switch{width:145px}.datetimepicker-inline{width:220px}.datetimepicker-dropdown,.datetimepicker-dropdown-left{top:0;left:0}[class*=datetimepicker-dropdown]: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,.2);position:absolute}[class*=datetimepicker-dropdown]:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;position:absolute}[class*=datetimepicker-dropdown-top]:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid #ccc;border-top-color:rgba(0,0,0,.2);border-bottom:0}[class*=datetimepicker-dropdown-top]:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #fff;border-bottom:0}.datetimepicker-dropdown-bottom-left:before{top:-7px;right:6px}.datetimepicker-dropdown-bottom-left:after{top:-6px;right:7px}.datetimepicker-dropdown-bottom-right:before{top:-7px;left:6px}.datetimepicker-dropdown-bottom-right:after{top:-6px;left:7px}.datetimepicker-dropdown-top-left:before{bottom:-7px;right:6px}.datetimepicker-dropdown-top-left:after{bottom:-6px;right:7px}.datetimepicker-dropdown-top-right:before{bottom:-7px;left:6px}.datetimepicker-dropdown-top-right:after{bottom:-6px;left:7px}.datetimepicker td,.datetimepicker th{text-align:center;width:22px;height:20px;padding:3px 0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;border:none}.table-striped .datetimepicker td,.table-striped .datetimepicker th{background-color:transparent}.datetimepicker td.new,.datetimepicker td.old{color:#999}.datetimepicker td.disabled,.datetimepicker td.disabled:hover{background:0 0;color:#999;cursor:default}.datetimepicker td.day.today{background-color:#e48600;border-color:#e48600;border-color:rgba(0,0,0,.1)rgba(0,0,0,.1)rgba(0,0,0,.25);color:#fff}.datetimepicker td.day.active{background-color:#3280fc;border-color:#0462f7;border-color:rgba(0,0,0,.1)rgba(0,0,0,.1)rgba(0,0,0,.25);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.datetimepicker td.day.active:hover{background-color:#0462f7}.datetimepicker td.day.today.active:hover,.datetimepicker td.day.today:hover{background-color:#b16800}.datetimepicker .datetimepicker-hours td span.hour_am,.datetimepicker .datetimepicker-hours td span.hour_pm{width:14.6%}.datetimepicker .datetimepicker-hours fieldset legend,.datetimepicker .datetimepicker-minutes fieldset legend{margin-bottom:inherit;line-height:30px}.datetimepicker td span.disabled,.datetimepicker td span.disabled:hover{background:0 0;color:#999;cursor:default}.datetimepicker td span.active,.datetimepicker td span.active.disabled,.datetimepicker td span.active.disabled:hover,.datetimepicker td span.active:hover{background-color:#3280fc;border-color:#0462f7;border-color:rgba(0,0,0,.1)rgba(0,0,0,.1)rgba(0,0,0,.25);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.datetimepicker tfoot tr:first-child th,.datetimepicker thead tr:first-child th{cursor:pointer}.datetimepicker tfoot tr:first-child th:hover,.datetimepicker thead tr:first-child th:hover{background:#eee}.input-append.date .add-on i,.input-group.date .input-group-addon span,.input-prepend.date .add-on i{cursor:pointer;width:14px;height:14px} \ No newline at end of file + */.datetimepicker{padding:4px;margin-top:1px;white-space:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;direction:ltr}.datetimepicker.datetimepicker-rtl{direction:rtl}.datetimepicker.datetimepicker-rtl table tr td span{float:right}.datetimepicker>div{display:none}.datetimepicker.minutes div.datetimepicker-minutes{display:block}.datetimepicker.hours div.datetimepicker-hours{display:block}.datetimepicker.days div.datetimepicker-days{display:block}.datetimepicker.months div.datetimepicker-months{display:block}.datetimepicker.years div.datetimepicker-years{display:block}.datetimepicker table{margin:0}.datetimepicker table tr td.minute:hover{background:#eee;cursor:pointer}.datetimepicker table tr td.hour:hover{background:#eee;cursor:pointer}.datetimepicker table tr td.day:hover{background:#eee;cursor:pointer}.datetimepicker table tr td span{display:block;width:23%;height:54px;line-height:54px;float:left;margin:1%;cursor:pointer;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.datetimepicker table tr td span:hover{background:#eee}.datetimepicker table tr td span.old{color:#999}.datetimepicker .datetimepicker-hours span{height:26px;line-height:26px}.datetimepicker .datetimepicker-minutes span{height:26px;line-height:26px}.datetimepicker th.switch{width:145px}.datetimepicker-inline{width:220px}.datetimepicker-dropdown,.datetimepicker-dropdown-left{top:0;left:0}[class*=datetimepicker-dropdown]: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,.2);position:absolute}[class*=datetimepicker-dropdown]:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;position:absolute}[class*=datetimepicker-dropdown-top]:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid #ccc;border-top-color:rgba(0,0,0,.2);border-bottom:0}[class*=datetimepicker-dropdown-top]:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #fff;border-bottom:0}.datetimepicker-dropdown-bottom-left:before{top:-7px;right:6px}.datetimepicker-dropdown-bottom-left:after{top:-6px;right:7px}.datetimepicker-dropdown-bottom-right:before{top:-7px;left:6px}.datetimepicker-dropdown-bottom-right:after{top:-6px;left:7px}.datetimepicker-dropdown-top-left:before{bottom:-7px;right:6px}.datetimepicker-dropdown-top-left:after{bottom:-6px;right:7px}.datetimepicker-dropdown-top-right:before{bottom:-7px;left:6px}.datetimepicker-dropdown-top-right:after{bottom:-6px;left:7px}.datetimepicker td,.datetimepicker th{text-align:center;width:22px;height:20px;padding:3px 0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;border:0}.table-striped .datetimepicker td,.table-striped .datetimepicker th{background-color:transparent}.datetimepicker td.old,.datetimepicker td.new{color:#999}.datetimepicker td.disabled,.datetimepicker td.disabled:hover{background:0 0;color:#999;cursor:default}.datetimepicker td.day.today{background-color:#e48600;border-color:#e48600;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);color:#fff}.datetimepicker td.day.active{background-color:#3280fc;border-color:#0462f7;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.datetimepicker td.day.active:hover{background-color:#0462f7}.datetimepicker td.day.today:hover,.datetimepicker td.day.today.active:hover{background-color:#b16800}.datetimepicker .datetimepicker-hours td span.hour_am,.datetimepicker .datetimepicker-hours td span.hour_pm{width:14.6%}.datetimepicker .datetimepicker-hours fieldset legend,.datetimepicker .datetimepicker-minutes fieldset legend{margin-bottom:inherit;line-height:30px}.datetimepicker td span.disabled,.datetimepicker td span.disabled:hover{background:0 0;color:#999;cursor:default}.datetimepicker td span.active,.datetimepicker td span.active:hover,.datetimepicker td span.active.disabled,.datetimepicker td span.active.disabled:hover{background-color:#3280fc;border-color:#0462f7;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.datetimepicker thead tr:first-child th,.datetimepicker tfoot tr:first-child th{cursor:pointer}.datetimepicker thead tr:first-child th:hover,.datetimepicker tfoot tr:first-child th:hover{background:#eee}.input-append.date .add-on i,.input-prepend.date .add-on i,.input-group.date .input-group-addon span{cursor:pointer;width:14px;height:14px} \ No newline at end of file diff --git a/assets/datetimepicker/js/datetimepicker.min.js b/assets/datetimepicker/js/datetimepicker.min.js index e4e81f763..cfa2a3c30 100644 --- a/assets/datetimepicker/js/datetimepicker.min.js +++ b/assets/datetimepicker/js/datetimepicker.min.js @@ -1 +1,10 @@ -!function(e){function t(){return new Date(Date.UTC.apply(Date,arguments))}var i=function(t,i){var n=this;this.element=e(t),this.language=i.language||this.element.data("date-language")||"en",this.language=this.language in s?this.language:"en",this.isRTL=s[this.language].rtl||!1,this.formatType=i.formatType||this.element.data("format-type")||"standard",this.format=a.parseFormat(i.format||this.element.data("date-format")||s[this.language].format||a.getDefaultFormat(this.formatType,"input"),this.formatType),this.isInline=!1,this.isVisible=!1,this.isInput=this.element.is("input"),this.component=this.element.is(".date")?this.element.find(".input-group-addon .icon-th, .input-group-addon .icon-time, .input-group-addon .icon-calendar").parent():!1,this.componentReset=this.element.is(".date")?this.element.find(".input-group-addon .icon-remove").parent():!1,this.hasInput=this.component&&this.element.find("input").length,this.component&&0===this.component.length&&(this.component=!1),this.linkField=i.linkField||this.element.data("link-field")||!1,this.linkFormat=a.parseFormat(i.linkFormat||this.element.data("link-format")||a.getDefaultFormat(this.formatType,"link"),this.formatType),this.minuteStep=i.minuteStep||this.element.data("minute-step")||5,this.pickerPosition=i.pickerPosition||this.element.data("picker-position")||"bottom-right",this.showMeridian=i.showMeridian||this.element.data("show-meridian")||!1,this.initialDate=i.initialDate||new Date,this._attachEvents(),this.formatViewType="datetime","formatViewType"in i?this.formatViewType=i.formatViewType:"formatViewType"in this.element.data()&&(this.formatViewType=this.element.data("formatViewType")),this.minView=0,"minView"in i?this.minView=i.minView:"minView"in this.element.data()&&(this.minView=this.element.data("min-view")),this.minView=a.convertViewMode(this.minView),this.maxView=a.modes.length-1,"maxView"in i?this.maxView=i.maxView:"maxView"in this.element.data()&&(this.maxView=this.element.data("max-view")),this.maxView=a.convertViewMode(this.maxView),this.wheelViewModeNavigation=!1,"wheelViewModeNavigation"in i?this.wheelViewModeNavigation=i.wheelViewModeNavigation:"wheelViewModeNavigation"in this.element.data()&&(this.wheelViewModeNavigation=this.element.data("view-mode-wheel-navigation")),this.wheelViewModeNavigationInverseDirection=!1,"wheelViewModeNavigationInverseDirection"in i?this.wheelViewModeNavigationInverseDirection=i.wheelViewModeNavigationInverseDirection:"wheelViewModeNavigationInverseDirection"in this.element.data()&&(this.wheelViewModeNavigationInverseDirection=this.element.data("view-mode-wheel-navigation-inverse-dir")),this.wheelViewModeNavigationDelay=100,"wheelViewModeNavigationDelay"in i?this.wheelViewModeNavigationDelay=i.wheelViewModeNavigationDelay:"wheelViewModeNavigationDelay"in this.element.data()&&(this.wheelViewModeNavigationDelay=this.element.data("view-mode-wheel-navigation-delay")),this.startViewMode=2,"startView"in i?this.startViewMode=i.startView:"startView"in this.element.data()&&(this.startViewMode=this.element.data("start-view")),this.startViewMode=a.convertViewMode(this.startViewMode),this.viewMode=this.startViewMode,this.viewSelect=this.minView,"viewSelect"in i?this.viewSelect=i.viewSelect:"viewSelect"in this.element.data()&&(this.viewSelect=this.element.data("view-select")),this.viewSelect=a.convertViewMode(this.viewSelect),this.forceParse=!0,"forceParse"in i?this.forceParse=i.forceParse:"dateForceParse"in this.element.data()&&(this.forceParse=this.element.data("date-force-parse")),this.picker=e(a.template).appendTo(this.isInline?this.element:"body").on({click:e.proxy(this.click,this),mousedown:e.proxy(this.mousedown,this)}),this.wheelViewModeNavigation&&(e.fn.mousewheel?this.picker.on({mousewheel:e.proxy(this.mousewheel,this)}):console.log("Mouse Wheel event is not supported. Please include the jQuery Mouse Wheel plugin before enabling this option")),this.isInline?this.picker.addClass("datetimepicker-inline"):this.picker.addClass("datetimepicker-dropdown-"+this.pickerPosition+" dropdown-menu"),this.isRTL&&(this.picker.addClass("datetimepicker-rtl"),this.picker.find(".prev span, .next span").toggleClass("icon-arrow-left icon-arrow-right")),e(document).on("mousedown",function(t){0===e(t.target).closest(".datetimepicker").length&&n.hide()}),this.autoclose=!1,"autoclose"in i?this.autoclose=i.autoclose:"dateAutoclose"in this.element.data()&&(this.autoclose=this.element.data("date-autoclose")),this.keyboardNavigation=!0,"keyboardNavigation"in i?this.keyboardNavigation=i.keyboardNavigation:"dateKeyboardNavigation"in this.element.data()&&(this.keyboardNavigation=this.element.data("date-keyboard-navigation")),this.todayBtn=i.todayBtn||this.element.data("date-today-btn")||!1,this.todayHighlight=i.todayHighlight||this.element.data("date-today-highlight")||!1,this.weekStart=(i.weekStart||this.element.data("date-weekstart")||s[this.language].weekStart||0)%7,this.weekEnd=(this.weekStart+6)%7,this.startDate=-1/0,this.endDate=1/0,this.daysOfWeekDisabled=[],this.setStartDate(i.startDate||this.element.data("date-startdate")),this.setEndDate(i.endDate||this.element.data("date-enddate")),this.setDaysOfWeekDisabled(i.daysOfWeekDisabled||this.element.data("date-days-of-week-disabled")),this.fillDow(),this.fillMonths(),this.update(),this.showMode(),this.isInline&&this.show()};i.prototype={constructor:i,_events:[],_attachEvents:function(){this._detachEvents(),this.isInput?this._events=[[this.element,{focus:e.proxy(this.show,this),keyup:e.proxy(this.update,this),keydown:e.proxy(this.keydown,this)}]]:this.component&&this.hasInput?(this._events=[[this.element.find("input"),{focus:e.proxy(this.show,this),keyup:e.proxy(this.update,this),keydown:e.proxy(this.keydown,this)}],[this.component,{click:e.proxy(this.show,this)}]],this.componentReset&&this._events.push([this.componentReset,{click:e.proxy(this.reset,this)}])):this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:e.proxy(this.show,this)}]];for(var t,i,s=0;s=this.startDate&&e<=this.endDate?(this.date=e,this.setValue(),this.viewDate=this.date,this.fill()):this.element.trigger({type:"outOfRange",date:e,startDate:this.startDate,endDate:this.endDate})},setFormat:function(e){this.format=a.parseFormat(e,this.formatType);var t;this.isInput?t=this.element:this.component&&(t=this.element.find("input")),t&&t.val()&&this.setValue()},setValue:function(){var t=this.getFormattedDate();this.isInput?this.element.val(t):(this.component&&this.element.find("input").val(t),this.element.data("date",t)),this.linkField&&e("#"+this.linkField).val(this.getFormattedDate(this.linkFormat))},getFormattedDate:function(e){return void 0==e&&(e=this.format),a.formatDate(this.date,e,this.language,this.formatType)},setStartDate:function(e){this.startDate=e||-1/0,this.startDate!==-1/0&&(this.startDate=a.parseDate(this.startDate,this.format,this.language,this.formatType)),this.update(),this.updateNavArrows()},setEndDate:function(e){this.endDate=e||1/0,1/0!==this.endDate&&(this.endDate=a.parseDate(this.endDate,this.format,this.language,this.formatType)),this.update(),this.updateNavArrows()},setDaysOfWeekDisabled:function(t){this.daysOfWeekDisabled=t||[],e.isArray(this.daysOfWeekDisabled)||(this.daysOfWeekDisabled=this.daysOfWeekDisabled.split(/,\s*/)),this.daysOfWeekDisabled=e.map(this.daysOfWeekDisabled,function(e){return parseInt(e,10)}),this.update(),this.updateNavArrows()},place:function(){if(!this.isInline){var t=0;e("div").each(function(){var i=parseInt(e(this).css("zIndex"),10);i>t&&(t=i)});var i,s,a,n=t+10;this.component?(i=this.component.offset(),a=i.left,("bottom-left"==this.pickerPosition||"top-left"==this.pickerPosition)&&(a+=this.component.outerWidth()-this.picker.outerWidth())):(i=this.element.offset(),a=i.left),s="top-left"==this.pickerPosition||"top-right"==this.pickerPosition?i.top-this.picker.outerHeight():i.top+this.height,this.picker.css({top:s,left:a,zIndex:n})}},update:function(){var e,t=!1;arguments&&arguments.length&&("string"==typeof arguments[0]||arguments[0]instanceof Date)?(e=arguments[0],t=!0):(e=this.element.data("date")||(this.isInput?this.element.val():this.element.find("input").val())||this.initialDate,("string"==typeof e||e instanceof String)&&(e=e.replace(/^\s+|\s+$/g,""))),e||(e=new Date,t=!1),this.date=a.parseDate(e,this.format,this.language,this.formatType),t&&this.setValue(),this.viewDate=this.datethis.endDate?new Date(this.endDate):new Date(this.date),this.fill()},fillDow:function(){for(var e=this.weekStart,t="";e'+s[this.language].daysMin[e++%7]+"";t+="",this.picker.find(".datetimepicker-days thead").append(t)},fillMonths:function(){for(var e="",t=0;12>t;)e+=''+s[this.language].monthsShort[t++]+"";this.picker.find(".datetimepicker-months td").html(e)},fill:function(){if(null!=this.date&&null!=this.viewDate){var i=new Date(this.viewDate),n=i.getUTCFullYear(),h=i.getUTCMonth(),o=i.getUTCDate(),r=i.getUTCHours(),d=i.getUTCMinutes(),l=this.startDate!==-1/0?this.startDate.getUTCFullYear():-1/0,u=this.startDate!==-1/0?this.startDate.getUTCMonth():-1/0,c=1/0!==this.endDate?this.endDate.getUTCFullYear():1/0,m=1/0!==this.endDate?this.endDate.getUTCMonth():1/0,p=new t(this.date.getUTCFullYear(),this.date.getUTCMonth(),this.date.getUTCDate()).valueOf(),v=new Date;if(this.picker.find(".datetimepicker-days thead th:eq(1)").text(s[this.language].months[h]+" "+n),"time"==this.formatViewType){var g=r%12?r%12:12,f=(10>g?"0":"")+g,w=(10>d?"0":"")+d,D=s[this.language].meridiem[12>r?0:1];this.picker.find(".datetimepicker-hours thead th:eq(1)").text(f+":"+w+" "+D.toUpperCase()),this.picker.find(".datetimepicker-minutes thead th:eq(1)").text(f+":"+w+" "+D.toUpperCase())}else this.picker.find(".datetimepicker-hours thead th:eq(1)").text(o+" "+s[this.language].months[h]+" "+n),this.picker.find(".datetimepicker-minutes thead th:eq(1)").text(o+" "+s[this.language].months[h]+" "+n);this.picker.find("tfoot th.today").text(s[this.language].today).toggle(this.todayBtn!==!1),this.updateNavArrows(),this.fillMonths();var y=t(n,h-1,28,0,0,0,0),T=a.getDaysInMonth(y.getUTCFullYear(),y.getUTCMonth());y.setUTCDate(T),y.setUTCDate(T-(y.getUTCDay()-this.weekStart+7)%7);var M=new Date(y);M.setUTCDate(M.getUTCDate()+42),M=M.valueOf();for(var C,k=[];y.valueOf()"),C="",y.getUTCFullYear()n||y.getUTCFullYear()==n&&y.getUTCMonth()>h)&&(C+=" new"),this.todayHighlight&&y.getUTCFullYear()==v.getFullYear()&&y.getUTCMonth()==v.getMonth()&&y.getUTCDate()==v.getDate()&&(C+=" today"),y.valueOf()==p&&(C+=" active"),(y.valueOf()+864e5<=this.startDate||y.valueOf()>this.endDate||-1!==e.inArray(y.getUTCDay(),this.daysOfWeekDisabled))&&(C+=" disabled"),k.push(''+y.getUTCDate()+""),y.getUTCDay()==this.weekEnd&&k.push(""),y.setUTCDate(y.getUTCDate()+1);this.picker.find(".datetimepicker-days tbody").empty().append(k.join("")),k=[];for(var U="",b="",V="",S=0;24>S;S++){var F=t(n,h,o,S);C="",F.valueOf()+36e5<=this.startDate||F.valueOf()>this.endDate?C+=" disabled":r==S&&(C+=" active"),this.showMeridian&&2==s[this.language].meridiem.length?(b=12>S?s[this.language].meridiem[0]:s[this.language].meridiem[1],b!=V&&(""!=V&&k.push(""),k.push('
              '+b.toUpperCase()+"")),V=b,U=S%12?S%12:12,k.push('S?"am":"pm")+'">'+U+""),23==S&&k.push("
              ")):(U=S+":00",k.push(''+U+""))}this.picker.find(".datetimepicker-hours td").html(k.join("")),k=[],U="",b="",V="";for(var S=0;60>S;S+=this.minuteStep){var F=t(n,h,o,r,S,0);C="",F.valueOf()this.endDate?C+=" disabled":Math.floor(d/this.minuteStep)==Math.floor(S/this.minuteStep)&&(C+=" active"),this.showMeridian&&2==s[this.language].meridiem.length?(b=12>r?s[this.language].meridiem[0]:s[this.language].meridiem[1],b!=V&&(""!=V&&k.push(""),k.push('
              '+b.toUpperCase()+"")),V=b,U=r%12?r%12:12,k.push(''+U+":"+(10>S?"0"+S:S)+""),59==S&&k.push("
              ")):(U=S+":00",k.push(''+r+":"+(10>S?"0"+S:S)+""))}this.picker.find(".datetimepicker-minutes td").html(k.join(""));var x=this.date.getUTCFullYear(),H=this.picker.find(".datetimepicker-months").find("th:eq(1)").text(n).end().find("span").removeClass("active");x==n&&H.eq(this.date.getUTCMonth()).addClass("active"),(l>n||n>c)&&H.addClass("disabled"),n==l&&H.slice(0,u).addClass("disabled"),n==c&&H.slice(m+1).addClass("disabled"),k="",n=10*parseInt(n/10,10);var N=this.picker.find(".datetimepicker-years").find("th:eq(1)").text(n+"-"+(n+9)).end().find("td");n-=1;for(var S=-1;11>S;S++)k+='n||n>c?" disabled":"")+'">'+n+"",n+=1;N.html(k),this.place()}},updateNavArrows:function(){var e=new Date(this.viewDate),t=e.getUTCFullYear(),i=e.getUTCMonth(),s=e.getUTCDate(),a=e.getUTCHours();switch(this.viewMode){case 0:this.startDate!==-1/0&&t<=this.startDate.getUTCFullYear()&&i<=this.startDate.getUTCMonth()&&s<=this.startDate.getUTCDate()&&a<=this.startDate.getUTCHours()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),1/0!==this.endDate&&t>=this.endDate.getUTCFullYear()&&i>=this.endDate.getUTCMonth()&&s>=this.endDate.getUTCDate()&&a>=this.endDate.getUTCHours()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:this.startDate!==-1/0&&t<=this.startDate.getUTCFullYear()&&i<=this.startDate.getUTCMonth()&&s<=this.startDate.getUTCDate()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),1/0!==this.endDate&&t>=this.endDate.getUTCFullYear()&&i>=this.endDate.getUTCMonth()&&s>=this.endDate.getUTCDate()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 2:this.startDate!==-1/0&&t<=this.startDate.getUTCFullYear()&&i<=this.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),1/0!==this.endDate&&t>=this.endDate.getUTCFullYear()&&i>=this.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 3:case 4:this.startDate!==-1/0&&t<=this.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),1/0!==this.endDate&&t>=this.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}},mousewheel:function(t){if(t.preventDefault(),t.stopPropagation(),!this.wheelPause){this.wheelPause=!0;var i=t.originalEvent,s=i.wheelDelta,a=s>0?1:0===s?0:-1;this.wheelViewModeNavigationInverseDirection&&(a=-a),this.showMode(a),setTimeout(e.proxy(function(){this.wheelPause=!1},this),this.wheelViewModeNavigationDelay)}},click:function(i){i.stopPropagation(),i.preventDefault();var s=e(i.target).closest("span, td, th, legend");if(1==s.length){if(s.is(".disabled"))return this.element.trigger({type:"outOfRange",date:this.viewDate,startDate:this.startDate,endDate:this.endDate}),void 0;switch(s[0].nodeName.toLowerCase()){case"th":switch(s[0].className){case"switch":this.showMode(1);break;case"prev":case"next":var n=a.modes[this.viewMode].navStep*("prev"==s[0].className?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveHour(this.viewDate,n);break;case 1:this.viewDate=this.moveDate(this.viewDate,n);break;case 2:this.viewDate=this.moveMonth(this.viewDate,n);break;case 3:case 4:this.viewDate=this.moveYear(this.viewDate,n)}this.fill();break;case"today":var h=new Date;h=t(h.getFullYear(),h.getMonth(),h.getDate(),h.getHours(),h.getMinutes(),h.getSeconds(),0),hthis.endDate&&(h=this.endDate),this.viewMode=this.startViewMode,this.showMode(0),this._setDate(h),this.fill(),this.autoclose&&this.hide()}break;case"span":if(!s.is(".disabled")){var o=this.viewDate.getUTCFullYear(),r=this.viewDate.getUTCMonth(),d=this.viewDate.getUTCDate(),l=this.viewDate.getUTCHours(),u=this.viewDate.getUTCMinutes(),c=this.viewDate.getUTCSeconds();if(s.is(".month")?(this.viewDate.setUTCDate(1),r=s.parent().find("span").index(s),d=this.viewDate.getUTCDate(),this.viewDate.setUTCMonth(r),this.element.trigger({type:"changeMonth",date:this.viewDate}),this.viewSelect>=3&&this._setDate(t(o,r,d,l,u,c,0))):s.is(".year")?(this.viewDate.setUTCDate(1),o=parseInt(s.text(),10)||0,this.viewDate.setUTCFullYear(o),this.element.trigger({type:"changeYear",date:this.viewDate}),this.viewSelect>=4&&this._setDate(t(o,r,d,l,u,c,0))):s.is(".hour")?(l=parseInt(s.text(),10)||0,(s.hasClass("hour_am")||s.hasClass("hour_pm"))&&(12==l&&s.hasClass("hour_am")?l=0:12!=l&&s.hasClass("hour_pm")&&(l+=12)),this.viewDate.setUTCHours(l),this.element.trigger({type:"changeHour",date:this.viewDate}),this.viewSelect>=1&&this._setDate(t(o,r,d,l,u,c,0))):s.is(".minute")&&(u=parseInt(s.text().substr(s.text().indexOf(":")+1),10)||0,this.viewDate.setUTCMinutes(u),this.element.trigger({type:"changeMinute",date:this.viewDate}),this.viewSelect>=0&&this._setDate(t(o,r,d,l,u,c,0))),0!=this.viewMode){var m=this.viewMode;this.showMode(-1),this.fill(),m==this.viewMode&&this.autoclose&&this.hide()}else this.fill(),this.autoclose&&this.hide()}break;case"td":if(s.is(".day")&&!s.is(".disabled")){var d=parseInt(s.text(),10)||1,o=this.viewDate.getUTCFullYear(),r=this.viewDate.getUTCMonth(),l=this.viewDate.getUTCHours(),u=this.viewDate.getUTCMinutes(),c=this.viewDate.getUTCSeconds();s.is(".old")?0===r?(r=11,o-=1):r-=1:s.is(".new")&&(11==r?(r=0,o+=1):r+=1),this.viewDate.setUTCFullYear(o),this.viewDate.setUTCMonth(r,d),this.element.trigger({type:"changeDay",date:this.viewDate}),this.viewSelect>=2&&this._setDate(t(o,r,d,l,u,c,0))}var m=this.viewMode;this.showMode(-1),this.fill(),m==this.viewMode&&this.autoclose&&this.hide()}}},_setDate:function(e,t){t&&"date"!=t||(this.date=e),t&&"view"!=t||(this.viewDate=e),this.fill(),this.setValue();var i;this.isInput?i=this.element:this.component&&(i=this.element.find("input")),i&&(i.change(),this.autoclose&&(!t||"date"==t)),this.element.trigger({type:"changeDate",date:this.date})},moveMinute:function(e,t){if(!t)return e;var i=new Date(e.valueOf());return i.setUTCMinutes(i.getUTCMinutes()+t*this.minuteStep),i},moveHour:function(e,t){if(!t)return e;var i=new Date(e.valueOf());return i.setUTCHours(i.getUTCHours()+t),i},moveDate:function(e,t){if(!t)return e;var i=new Date(e.valueOf());return i.setUTCDate(i.getUTCDate()+t),i},moveMonth:function(e,t){if(!t)return e;var i,s,a=new Date(e.valueOf()),n=a.getUTCDate(),h=a.getUTCMonth(),o=Math.abs(t);if(t=t>0?1:-1,1==o)s=-1==t?function(){return a.getUTCMonth()==h}:function(){return a.getUTCMonth()!=i},i=h+t,a.setUTCMonth(i),(0>i||i>11)&&(i=(i+12)%12);else{for(var r=0;o>r;r++)a=this.moveMonth(a,t);i=a.getUTCMonth(),a.setUTCDate(n),s=function(){return i!=a.getUTCMonth()}}for(;s();)a.setUTCDate(--n),a.setUTCMonth(i);return a},moveYear:function(e,t){return this.moveMonth(e,12*t)},dateWithinRange:function(e){return e>=this.startDate&&e<=this.endDate},keydown:function(e){if(this.picker.is(":not(:visible)"))return 27==e.keyCode&&this.show(),void 0;var t,i,s,a=!1;switch(e.keyCode){case 27:this.hide(),e.preventDefault();break;case 37:case 39:if(!this.keyboardNavigation)break;t=37==e.keyCode?-1:1,viewMode=this.viewMode,e.ctrlKey?viewMode+=2:e.shiftKey&&(viewMode+=1),4==viewMode?(i=this.moveYear(this.date,t),s=this.moveYear(this.viewDate,t)):3==viewMode?(i=this.moveMonth(this.date,t),s=this.moveMonth(this.viewDate,t)):2==viewMode?(i=this.moveDate(this.date,t),s=this.moveDate(this.viewDate,t)):1==viewMode?(i=this.moveHour(this.date,t),s=this.moveHour(this.viewDate,t)):0==viewMode&&(i=this.moveMinute(this.date,t),s=this.moveMinute(this.viewDate,t)),this.dateWithinRange(i)&&(this.date=i,this.viewDate=s,this.setValue(),this.update(),e.preventDefault(),a=!0);break;case 38:case 40:if(!this.keyboardNavigation)break;t=38==e.keyCode?-1:1,viewMode=this.viewMode,e.ctrlKey?viewMode+=2:e.shiftKey&&(viewMode+=1),4==viewMode?(i=this.moveYear(this.date,t),s=this.moveYear(this.viewDate,t)):3==viewMode?(i=this.moveMonth(this.date,t),s=this.moveMonth(this.viewDate,t)):2==viewMode?(i=this.moveDate(this.date,7*t),s=this.moveDate(this.viewDate,7*t)):1==viewMode?this.showMeridian?(i=this.moveHour(this.date,6*t),s=this.moveHour(this.viewDate,6*t)):(i=this.moveHour(this.date,4*t),s=this.moveHour(this.viewDate,4*t)):0==viewMode&&(i=this.moveMinute(this.date,4*t),s=this.moveMinute(this.viewDate,4*t)),this.dateWithinRange(i)&&(this.date=i,this.viewDate=s,this.setValue(),this.update(),e.preventDefault(),a=!0);break;case 13:if(0!=this.viewMode){var n=this.viewMode;this.showMode(-1),this.fill(),n==this.viewMode&&this.autoclose&&this.hide()}else this.fill(),this.autoclose&&this.hide();e.preventDefault();break;case 9:this.hide()}if(a){var h;this.isInput?h=this.element:this.component&&(h=this.element.find("input")),h&&h.change(),this.element.trigger({type:"changeDate",date:this.date})}},showMode:function(e){if(e){var t=Math.max(0,Math.min(a.modes.length-1,this.viewMode+e));t>=this.minView&&t<=this.maxView&&(this.element.trigger({type:"changeMode",date:this.viewDate,oldViewMode:this.viewMode,newViewMode:t}),this.viewMode=t)}this.picker.find(">div").hide().filter(".datetimepicker-"+a.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()},reset:function(){this._setDate(null,"date")}},e.fn.datetimepicker=function(t){var s=Array.apply(null,arguments);return s.shift(),this.each(function(){var a=e(this),n=a.data("datetimepicker"),h="object"==typeof t&&t;n||a.data("datetimepicker",n=new i(this,e.extend({},e.fn.datetimepicker.defaults,h))),"string"==typeof t&&"function"==typeof n[t]&&n[t].apply(n,s)})},e.fn.datetimepicker.defaults={},e.fn.datetimepicker.Constructor=i;var s=e.fn.datetimepicker.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"],meridiem:["am","pm"],suffix:["st","nd","rd","th"],today:"Today"}};s["zh-cn"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["周日","周一","周二","周三","周四","周五","周六","周日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今日",suffix:[],meridiem:[]},s["zh-tw"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["周日","周一","周二","周三","周四","周五","周六","周日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今天",suffix:[],meridiem:["上午","下午"]};var a={modes:[{clsName:"minutes",navFnc:"Hours",navStep:1},{clsName:"hours",navFnc:"Date",navStep:1},{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(e){return 0===e%4&&0!==e%100||0===e%400},getDaysInMonth:function(e,t){return[31,a.isLeapYear(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},getDefaultFormat:function(e,t){if("standard"==e)return"input"==t?"yyyy-mm-dd hh:ii":"yyyy-mm-dd hh:ii:ss";if("php"==e)return"input"==t?"Y-m-d H:i":"Y-m-d H:i:s";throw new Error("Invalid format type.")},validParts:function(e){if("standard"==e)return/hh?|HH?|p|P|ii?|ss?|dd?|DD?|mm?|MM?|yy(?:yy)?/g;if("php"==e)return/[dDjlNwzFmMnStyYaABgGhHis]/g;throw new Error("Invalid format type.")},nonpunctuation:/[^ -\/:-@\[-`{-~\t\n\rTZ]+/g,parseFormat:function(e,t){var i=e.replace(this.validParts(t),"\0").split("\0"),s=e.match(this.validParts(t));if(!i||!i.length||!s||0==s.length)throw new Error("Invalid date format.");return{separators:i,parts:s}},parseDate:function(a,n,h,o){if(a instanceof Date){var r=new Date(a.valueOf()-6e4*a.getTimezoneOffset());return r.setMilliseconds(0),r}if(/^\d{4}\-\d{1,2}\-\d{1,2}$/.test(a)&&(n=this.parseFormat("yyyy-mm-dd",o)),/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}$/.test(a)&&(n=this.parseFormat("yyyy-mm-dd hh:ii",o)),/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}\:\d{1,2}[Z]{0,1}$/.test(a)&&(n=this.parseFormat("yyyy-mm-dd hh:ii:ss",o)),/^[-+]\d+[dmwy]([\s,]+[-+]\d+[dmwy])*$/.test(a)){var d,l,u=/([-+]\d+)([dmwy])/,c=a.match(/([-+]\d+)([dmwy])/g);a=new Date;for(var m=0;mt;)t+=12;for(t%=12,e.setUTCMonth(t);e.getUTCMonth()!=t;)e.setUTCDate(e.getUTCDate()-1);return e},d:function(e,t){return e.setUTCDate(t)},p:function(e,t){return e.setUTCHours(1==t?e.getUTCHours()+12:e.getUTCHours())}};if(w.M=w.MM=w.mm=w.m,w.dd=w.d,w.P=w.p,a=t(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds()),c.length==n.parts.length){for(var m=0,D=n.parts.length;D>m;m++){if(p=parseInt(c[m],10),d=n.parts[m],isNaN(p))switch(d){case"MM":v=e(s[h].months).filter(function(){var e=this.slice(0,c[m].length),t=c[m].slice(0,e.length);return e==t}),p=e.inArray(v[0],s[h].months)+1;break;case"M":v=e(s[h].monthsShort).filter(function(){var e=this.slice(0,c[m].length),t=c[m].slice(0,e.length);return e==t}),p=e.inArray(v[0],s[h].monthsShort)+1;break;case"p":case"P":p=e.inArray(c[m].toLowerCase(),s[h].meridiem)}g[d]=p}for(var y,m=0;md;d++)r.length&&t.push(r.shift()),t.push(o[i.parts[d]]);return r.length&&t.push(r.shift()),t.join("")},convertViewMode:function(e){switch(e){case 4:case"decade":e=4;break;case 3:case"year":e=3;break;case 2:case"month":e=2;break;case 1:case"day":e=1;break;case 0:case"hour":e=0}return e},headTemplate:'',contTemplate:'',footTemplate:''};a.template='
              '+a.headTemplate+a.contTemplate+a.footTemplate+"
              "+"
              "+'
              '+''+a.headTemplate+a.contTemplate+a.footTemplate+"
              "+"
              "+'
              '+''+a.headTemplate+""+a.footTemplate+"
              "+"
              "+'
              '+''+a.headTemplate+a.contTemplate+a.footTemplate+"
              "+"
              "+'
              '+''+a.headTemplate+a.contTemplate+a.footTemplate+"
              "+"
              "+"
              ",e.fn.datetimepicker.DPGlobal=a,e.fn.datetimepicker.noConflict=function(){return e.fn.datetimepicker=old,this},e(document).on("focus.datetimepicker.data-api click.datetimepicker.data-api",'[data-provide="datetimepicker"]',function(t){var i=e(this);i.data("datetimepicker")||(t.preventDefault(),i.datetimepicker("show"))}),e(function(){e('[data-provide="datetimepicker-inline"]').datetimepicker()})}(window.jQuery); \ No newline at end of file +/*! + * ==================================================== + * ZUI - v1.1.0 - 2014-07-16 + * https://github.com/easysoft/zui + * GitHub: https://github.com/easysoft/zui.git + * Copyright (c) 2014 Catouse@easysoft; Licensed GNU + * ==================================================== + */ + +!function(a){function b(){return new Date(Date.UTC.apply(Date,arguments))}var c=function(b,c){var f=this;this.element=a(b),this.language=c.language||this.element.data("date-language")||"en",this.language=this.language in d?this.language:"en",this.isRTL=d[this.language].rtl||!1,this.formatType=c.formatType||this.element.data("format-type")||"standard",this.format=e.parseFormat(c.format||this.element.data("date-format")||d[this.language].format||e.getDefaultFormat(this.formatType,"input"),this.formatType),this.isInline=!1,this.isVisible=!1,this.isInput=this.element.is("input"),this.component=this.element.is(".date")?this.element.find(".input-group-addon .icon-th, .input-group-addon .icon-time, .input-group-addon .icon-calendar").parent():!1,this.componentReset=this.element.is(".date")?this.element.find(".input-group-addon .icon-remove").parent():!1,this.hasInput=this.component&&this.element.find("input").length,this.component&&0===this.component.length&&(this.component=!1),this.linkField=c.linkField||this.element.data("link-field")||!1,this.linkFormat=e.parseFormat(c.linkFormat||this.element.data("link-format")||e.getDefaultFormat(this.formatType,"link"),this.formatType),this.minuteStep=c.minuteStep||this.element.data("minute-step")||5,this.pickerPosition=c.pickerPosition||this.element.data("picker-position")||"bottom-right",this.showMeridian=c.showMeridian||this.element.data("show-meridian")||!1,this.initialDate=c.initialDate||new Date,this._attachEvents(),this.formatViewType="datetime","formatViewType"in c?this.formatViewType=c.formatViewType:"formatViewType"in this.element.data()&&(this.formatViewType=this.element.data("formatViewType")),this.minView=0,"minView"in c?this.minView=c.minView:"minView"in this.element.data()&&(this.minView=this.element.data("min-view")),this.minView=e.convertViewMode(this.minView),this.maxView=e.modes.length-1,"maxView"in c?this.maxView=c.maxView:"maxView"in this.element.data()&&(this.maxView=this.element.data("max-view")),this.maxView=e.convertViewMode(this.maxView),this.wheelViewModeNavigation=!1,"wheelViewModeNavigation"in c?this.wheelViewModeNavigation=c.wheelViewModeNavigation:"wheelViewModeNavigation"in this.element.data()&&(this.wheelViewModeNavigation=this.element.data("view-mode-wheel-navigation")),this.wheelViewModeNavigationInverseDirection=!1,"wheelViewModeNavigationInverseDirection"in c?this.wheelViewModeNavigationInverseDirection=c.wheelViewModeNavigationInverseDirection:"wheelViewModeNavigationInverseDirection"in this.element.data()&&(this.wheelViewModeNavigationInverseDirection=this.element.data("view-mode-wheel-navigation-inverse-dir")),this.wheelViewModeNavigationDelay=100,"wheelViewModeNavigationDelay"in c?this.wheelViewModeNavigationDelay=c.wheelViewModeNavigationDelay:"wheelViewModeNavigationDelay"in this.element.data()&&(this.wheelViewModeNavigationDelay=this.element.data("view-mode-wheel-navigation-delay")),this.startViewMode=2,"startView"in c?this.startViewMode=c.startView:"startView"in this.element.data()&&(this.startViewMode=this.element.data("start-view")),this.startViewMode=e.convertViewMode(this.startViewMode),this.viewMode=this.startViewMode,this.viewSelect=this.minView,"viewSelect"in c?this.viewSelect=c.viewSelect:"viewSelect"in this.element.data()&&(this.viewSelect=this.element.data("view-select")),this.viewSelect=e.convertViewMode(this.viewSelect),this.forceParse=!0,"forceParse"in c?this.forceParse=c.forceParse:"dateForceParse"in this.element.data()&&(this.forceParse=this.element.data("date-force-parse")),this.picker=a(e.template).appendTo(this.isInline?this.element:"body").on({click:a.proxy(this.click,this),mousedown:a.proxy(this.mousedown,this)}),this.wheelViewModeNavigation&&(a.fn.mousewheel?this.picker.on({mousewheel:a.proxy(this.mousewheel,this)}):console.log("Mouse Wheel event is not supported. Please include the jQuery Mouse Wheel plugin before enabling this option")),this.picker.addClass(this.isInline?"datetimepicker-inline":"datetimepicker-dropdown-"+this.pickerPosition+" dropdown-menu"),this.isRTL&&(this.picker.addClass("datetimepicker-rtl"),this.picker.find(".prev span, .next span").toggleClass("icon-arrow-left icon-arrow-right")),a(document).on("mousedown",function(b){0===a(b.target).closest(".datetimepicker").length&&f.hide()}),this.autoclose=!1,"autoclose"in c?this.autoclose=c.autoclose:"dateAutoclose"in this.element.data()&&(this.autoclose=this.element.data("date-autoclose")),this.keyboardNavigation=!0,"keyboardNavigation"in c?this.keyboardNavigation=c.keyboardNavigation:"dateKeyboardNavigation"in this.element.data()&&(this.keyboardNavigation=this.element.data("date-keyboard-navigation")),this.todayBtn=c.todayBtn||this.element.data("date-today-btn")||!1,this.todayHighlight=c.todayHighlight||this.element.data("date-today-highlight")||!1,this.weekStart=(c.weekStart||this.element.data("date-weekstart")||d[this.language].weekStart||0)%7,this.weekEnd=(this.weekStart+6)%7,this.startDate=-1/0,this.endDate=1/0,this.daysOfWeekDisabled=[],this.setStartDate(c.startDate||this.element.data("date-startdate")),this.setEndDate(c.endDate||this.element.data("date-enddate")),this.setDaysOfWeekDisabled(c.daysOfWeekDisabled||this.element.data("date-days-of-week-disabled")),this.fillDow(),this.fillMonths(),this.update(),this.showMode(),this.isInline&&this.show()};c.prototype={constructor:c,_events:[],_attachEvents:function(){this._detachEvents(),this.isInput?this._events=[[this.element,{focus:a.proxy(this.show,this),keyup:a.proxy(this.update,this),keydown:a.proxy(this.keydown,this)}]]:this.component&&this.hasInput?(this._events=[[this.element.find("input"),{focus:a.proxy(this.show,this),keyup:a.proxy(this.update,this),keydown:a.proxy(this.keydown,this)}],[this.component,{click:a.proxy(this.show,this)}]],this.componentReset&&this._events.push([this.componentReset,{click:a.proxy(this.reset,this)}])):this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:a.proxy(this.show,this)}]];for(var b,c,d=0;d=this.startDate&&a<=this.endDate?(this.date=a,this.setValue(),this.viewDate=this.date,this.fill()):this.element.trigger({type:"outOfRange",date:a,startDate:this.startDate,endDate:this.endDate})},setFormat:function(a){this.format=e.parseFormat(a,this.formatType);var b;this.isInput?b=this.element:this.component&&(b=this.element.find("input")),b&&b.val()&&this.setValue()},setValue:function(){var b=this.getFormattedDate();this.isInput?this.element.val(b):(this.component&&this.element.find("input").val(b),this.element.data("date",b)),this.linkField&&a("#"+this.linkField).val(this.getFormattedDate(this.linkFormat))},getFormattedDate:function(a){return void 0==a&&(a=this.format),e.formatDate(this.date,a,this.language,this.formatType)},setStartDate:function(a){this.startDate=a||-1/0,this.startDate!==-1/0&&(this.startDate=e.parseDate(this.startDate,this.format,this.language,this.formatType)),this.update(),this.updateNavArrows()},setEndDate:function(a){this.endDate=a||1/0,1/0!==this.endDate&&(this.endDate=e.parseDate(this.endDate,this.format,this.language,this.formatType)),this.update(),this.updateNavArrows()},setDaysOfWeekDisabled:function(b){this.daysOfWeekDisabled=b||[],a.isArray(this.daysOfWeekDisabled)||(this.daysOfWeekDisabled=this.daysOfWeekDisabled.split(/,\s*/)),this.daysOfWeekDisabled=a.map(this.daysOfWeekDisabled,function(a){return parseInt(a,10)}),this.update(),this.updateNavArrows()},place:function(){if(!this.isInline){var b=0;a("div").each(function(){var c=parseInt(a(this).css("zIndex"),10);c>b&&(b=c)});var c,d,e,f=b+10;this.component?(c=this.component.offset(),e=c.left,("bottom-left"==this.pickerPosition||"top-left"==this.pickerPosition)&&(e+=this.component.outerWidth()-this.picker.outerWidth())):(c=this.element.offset(),e=c.left),d="top-left"==this.pickerPosition||"top-right"==this.pickerPosition?c.top-this.picker.outerHeight():c.top+this.height,this.picker.css({top:d,left:e,zIndex:f})}},update:function(){var a,b=!1;arguments&&arguments.length&&("string"==typeof arguments[0]||arguments[0]instanceof Date)?(a=arguments[0],b=!0):(a=this.element.data("date")||(this.isInput?this.element.val():this.element.find("input").val())||this.initialDate,("string"==typeof a||a instanceof String)&&(a=a.replace(/^\s+|\s+$/g,""))),a||(a=new Date,b=!1),this.date=e.parseDate(a,this.format,this.language,this.formatType),b&&this.setValue(),this.viewDate=new Date(this.datethis.endDate?this.endDate:this.date),this.fill()},fillDow:function(){for(var a=this.weekStart,b="";a'+d[this.language].daysMin[a++%7]+"";b+="",this.picker.find(".datetimepicker-days thead").append(b)},fillMonths:function(){for(var a="",b=0;12>b;)a+=''+d[this.language].monthsShort[b++]+"";this.picker.find(".datetimepicker-months td").html(a)},fill:function(){if(null!=this.date&&null!=this.viewDate){var c=new Date(this.viewDate),f=c.getUTCFullYear(),g=c.getUTCMonth(),h=c.getUTCDate(),i=c.getUTCHours(),j=c.getUTCMinutes(),k=this.startDate!==-1/0?this.startDate.getUTCFullYear():-1/0,l=this.startDate!==-1/0?this.startDate.getUTCMonth():-1/0,m=1/0!==this.endDate?this.endDate.getUTCFullYear():1/0,n=1/0!==this.endDate?this.endDate.getUTCMonth():1/0,o=new b(this.date.getUTCFullYear(),this.date.getUTCMonth(),this.date.getUTCDate()).valueOf(),p=new Date;if(this.picker.find(".datetimepicker-days thead th:eq(1)").text(d[this.language].months[g]+" "+f),"time"==this.formatViewType){var q=i%12?i%12:12,r=(10>q?"0":"")+q,s=(10>j?"0":"")+j,t=d[this.language].meridiem[12>i?0:1];this.picker.find(".datetimepicker-hours thead th:eq(1)").text(r+":"+s+" "+t.toUpperCase()),this.picker.find(".datetimepicker-minutes thead th:eq(1)").text(r+":"+s+" "+t.toUpperCase())}else this.picker.find(".datetimepicker-hours thead th:eq(1)").text(h+" "+d[this.language].months[g]+" "+f),this.picker.find(".datetimepicker-minutes thead th:eq(1)").text(h+" "+d[this.language].months[g]+" "+f);this.picker.find("tfoot th.today").text(d[this.language].today).toggle(this.todayBtn!==!1),this.updateNavArrows(),this.fillMonths();var u=b(f,g-1,28,0,0,0,0),v=e.getDaysInMonth(u.getUTCFullYear(),u.getUTCMonth());u.setUTCDate(v),u.setUTCDate(v-(u.getUTCDay()-this.weekStart+7)%7);var w=new Date(u);w.setUTCDate(w.getUTCDate()+42),w=w.valueOf();for(var x,y=[];u.valueOf()"),x="",u.getUTCFullYear()f||u.getUTCFullYear()==f&&u.getUTCMonth()>g)&&(x+=" new"),this.todayHighlight&&u.getUTCFullYear()==p.getFullYear()&&u.getUTCMonth()==p.getMonth()&&u.getUTCDate()==p.getDate()&&(x+=" today"),u.valueOf()==o&&(x+=" active"),(u.valueOf()+864e5<=this.startDate||u.valueOf()>this.endDate||-1!==a.inArray(u.getUTCDay(),this.daysOfWeekDisabled))&&(x+=" disabled"),y.push(''+u.getUTCDate()+""),u.getUTCDay()==this.weekEnd&&y.push(""),u.setUTCDate(u.getUTCDate()+1);this.picker.find(".datetimepicker-days tbody").empty().append(y.join("")),y=[];for(var z="",A="",B="",C=0;24>C;C++){var D=b(f,g,h,C);x="",D.valueOf()+36e5<=this.startDate||D.valueOf()>this.endDate?x+=" disabled":i==C&&(x+=" active"),this.showMeridian&&2==d[this.language].meridiem.length?(A=12>C?d[this.language].meridiem[0]:d[this.language].meridiem[1],A!=B&&(""!=B&&y.push(""),y.push('
              '+A.toUpperCase()+"")),B=A,z=C%12?C%12:12,y.push('C?"am":"pm")+'">'+z+""),23==C&&y.push("
              ")):(z=C+":00",y.push(''+z+""))}this.picker.find(".datetimepicker-hours td").html(y.join("")),y=[],z="",A="",B="";for(var C=0;60>C;C+=this.minuteStep){var D=b(f,g,h,i,C,0);x="",D.valueOf()this.endDate?x+=" disabled":Math.floor(j/this.minuteStep)==Math.floor(C/this.minuteStep)&&(x+=" active"),this.showMeridian&&2==d[this.language].meridiem.length?(A=12>i?d[this.language].meridiem[0]:d[this.language].meridiem[1],A!=B&&(""!=B&&y.push(""),y.push('
              '+A.toUpperCase()+"")),B=A,z=i%12?i%12:12,y.push(''+z+":"+(10>C?"0"+C:C)+""),59==C&&y.push("
              ")):(z=C+":00",y.push(''+i+":"+(10>C?"0"+C:C)+""))}this.picker.find(".datetimepicker-minutes td").html(y.join(""));var E=this.date.getUTCFullYear(),F=this.picker.find(".datetimepicker-months").find("th:eq(1)").text(f).end().find("span").removeClass("active");E==f&&F.eq(this.date.getUTCMonth()).addClass("active"),(k>f||f>m)&&F.addClass("disabled"),f==k&&F.slice(0,l).addClass("disabled"),f==m&&F.slice(n+1).addClass("disabled"),y="",f=10*parseInt(f/10,10);var G=this.picker.find(".datetimepicker-years").find("th:eq(1)").text(f+"-"+(f+9)).end().find("td");f-=1;for(var C=-1;11>C;C++)y+='f||f>m?" disabled":"")+'">'+f+"",f+=1;G.html(y),this.place()}},updateNavArrows:function(){var a=new Date(this.viewDate),b=a.getUTCFullYear(),c=a.getUTCMonth(),d=a.getUTCDate(),e=a.getUTCHours();switch(this.viewMode){case 0:this.picker.find(".prev").css(this.startDate!==-1/0&&b<=this.startDate.getUTCFullYear()&&c<=this.startDate.getUTCMonth()&&d<=this.startDate.getUTCDate()&&e<=this.startDate.getUTCHours()?{visibility:"hidden"}:{visibility:"visible"}),this.picker.find(".next").css(1/0!==this.endDate&&b>=this.endDate.getUTCFullYear()&&c>=this.endDate.getUTCMonth()&&d>=this.endDate.getUTCDate()&&e>=this.endDate.getUTCHours()?{visibility:"hidden"}:{visibility:"visible"});break;case 1:this.picker.find(".prev").css(this.startDate!==-1/0&&b<=this.startDate.getUTCFullYear()&&c<=this.startDate.getUTCMonth()&&d<=this.startDate.getUTCDate()?{visibility:"hidden"}:{visibility:"visible"}),this.picker.find(".next").css(1/0!==this.endDate&&b>=this.endDate.getUTCFullYear()&&c>=this.endDate.getUTCMonth()&&d>=this.endDate.getUTCDate()?{visibility:"hidden"}:{visibility:"visible"});break;case 2:this.picker.find(".prev").css(this.startDate!==-1/0&&b<=this.startDate.getUTCFullYear()&&c<=this.startDate.getUTCMonth()?{visibility:"hidden"}:{visibility:"visible"}),this.picker.find(".next").css(1/0!==this.endDate&&b>=this.endDate.getUTCFullYear()&&c>=this.endDate.getUTCMonth()?{visibility:"hidden"}:{visibility:"visible"});break;case 3:case 4:this.picker.find(".prev").css(this.startDate!==-1/0&&b<=this.startDate.getUTCFullYear()?{visibility:"hidden"}:{visibility:"visible"}),this.picker.find(".next").css(1/0!==this.endDate&&b>=this.endDate.getUTCFullYear()?{visibility:"hidden"}:{visibility:"visible"})}},mousewheel:function(b){if(b.preventDefault(),b.stopPropagation(),!this.wheelPause){this.wheelPause=!0;var c=b.originalEvent,d=c.wheelDelta,e=d>0?1:0===d?0:-1;this.wheelViewModeNavigationInverseDirection&&(e=-e),this.showMode(e),setTimeout(a.proxy(function(){this.wheelPause=!1},this),this.wheelViewModeNavigationDelay)}},click:function(c){c.stopPropagation(),c.preventDefault();var d=a(c.target).closest("span, td, th, legend");if(1==d.length){if(d.is(".disabled"))return void this.element.trigger({type:"outOfRange",date:this.viewDate,startDate:this.startDate,endDate:this.endDate});switch(d[0].nodeName.toLowerCase()){case"th":switch(d[0].className){case"switch":this.showMode(1);break;case"prev":case"next":var f=e.modes[this.viewMode].navStep*("prev"==d[0].className?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveHour(this.viewDate,f);break;case 1:this.viewDate=this.moveDate(this.viewDate,f);break;case 2:this.viewDate=this.moveMonth(this.viewDate,f);break;case 3:case 4:this.viewDate=this.moveYear(this.viewDate,f)}this.fill();break;case"today":var g=new Date;g=b(g.getFullYear(),g.getMonth(),g.getDate(),g.getHours(),g.getMinutes(),g.getSeconds(),0),gthis.endDate&&(g=this.endDate),this.viewMode=this.startViewMode,this.showMode(0),this._setDate(g),this.fill(),this.autoclose&&this.hide()}break;case"span":if(!d.is(".disabled")){var h=this.viewDate.getUTCFullYear(),i=this.viewDate.getUTCMonth(),j=this.viewDate.getUTCDate(),k=this.viewDate.getUTCHours(),l=this.viewDate.getUTCMinutes(),m=this.viewDate.getUTCSeconds();if(d.is(".month")?(this.viewDate.setUTCDate(1),i=d.parent().find("span").index(d),j=this.viewDate.getUTCDate(),this.viewDate.setUTCMonth(i),this.element.trigger({type:"changeMonth",date:this.viewDate}),this.viewSelect>=3&&this._setDate(b(h,i,j,k,l,m,0))):d.is(".year")?(this.viewDate.setUTCDate(1),h=parseInt(d.text(),10)||0,this.viewDate.setUTCFullYear(h),this.element.trigger({type:"changeYear",date:this.viewDate}),this.viewSelect>=4&&this._setDate(b(h,i,j,k,l,m,0))):d.is(".hour")?(k=parseInt(d.text(),10)||0,(d.hasClass("hour_am")||d.hasClass("hour_pm"))&&(12==k&&d.hasClass("hour_am")?k=0:12!=k&&d.hasClass("hour_pm")&&(k+=12)),this.viewDate.setUTCHours(k),this.element.trigger({type:"changeHour",date:this.viewDate}),this.viewSelect>=1&&this._setDate(b(h,i,j,k,l,m,0))):d.is(".minute")&&(l=parseInt(d.text().substr(d.text().indexOf(":")+1),10)||0,this.viewDate.setUTCMinutes(l),this.element.trigger({type:"changeMinute",date:this.viewDate}),this.viewSelect>=0&&this._setDate(b(h,i,j,k,l,m,0))),0!=this.viewMode){var n=this.viewMode;this.showMode(-1),this.fill(),n==this.viewMode&&this.autoclose&&this.hide()}else this.fill(),this.autoclose&&this.hide()}break;case"td":if(d.is(".day")&&!d.is(".disabled")){var j=parseInt(d.text(),10)||1,h=this.viewDate.getUTCFullYear(),i=this.viewDate.getUTCMonth(),k=this.viewDate.getUTCHours(),l=this.viewDate.getUTCMinutes(),m=this.viewDate.getUTCSeconds();d.is(".old")?0===i?(i=11,h-=1):i-=1:d.is(".new")&&(11==i?(i=0,h+=1):i+=1),this.viewDate.setUTCFullYear(h),this.viewDate.setUTCMonth(i,j),this.element.trigger({type:"changeDay",date:this.viewDate}),this.viewSelect>=2&&this._setDate(b(h,i,j,k,l,m,0))}var n=this.viewMode;this.showMode(-1),this.fill(),n==this.viewMode&&this.autoclose&&this.hide()}}},_setDate:function(a,b){b&&"date"!=b||(this.date=a),b&&"view"!=b||(this.viewDate=a),this.fill(),this.setValue();var c;this.isInput?c=this.element:this.component&&(c=this.element.find("input")),c&&(c.change(),this.autoclose&&(!b||"date"==b)),this.element.trigger({type:"changeDate",date:this.date})},moveMinute:function(a,b){if(!b)return a;var c=new Date(a.valueOf());return c.setUTCMinutes(c.getUTCMinutes()+b*this.minuteStep),c},moveHour:function(a,b){if(!b)return a;var c=new Date(a.valueOf());return c.setUTCHours(c.getUTCHours()+b),c},moveDate:function(a,b){if(!b)return a;var c=new Date(a.valueOf());return c.setUTCDate(c.getUTCDate()+b),c},moveMonth:function(a,b){if(!b)return a;var c,d,e=new Date(a.valueOf()),f=e.getUTCDate(),g=e.getUTCMonth(),h=Math.abs(b);if(b=b>0?1:-1,1==h)d=-1==b?function(){return e.getUTCMonth()==g}:function(){return e.getUTCMonth()!=c},c=g+b,e.setUTCMonth(c),(0>c||c>11)&&(c=(c+12)%12);else{for(var i=0;h>i;i++)e=this.moveMonth(e,b);c=e.getUTCMonth(),e.setUTCDate(f),d=function(){return c!=e.getUTCMonth()}}for(;d();)e.setUTCDate(--f),e.setUTCMonth(c);return e},moveYear:function(a,b){return this.moveMonth(a,12*b)},dateWithinRange:function(a){return a>=this.startDate&&a<=this.endDate},keydown:function(a){if(this.picker.is(":not(:visible)"))return void(27==a.keyCode&&this.show());var b,c,d,e=!1;switch(a.keyCode){case 27:this.hide(),a.preventDefault();break;case 37:case 39:if(!this.keyboardNavigation)break;b=37==a.keyCode?-1:1,viewMode=this.viewMode,a.ctrlKey?viewMode+=2:a.shiftKey&&(viewMode+=1),4==viewMode?(c=this.moveYear(this.date,b),d=this.moveYear(this.viewDate,b)):3==viewMode?(c=this.moveMonth(this.date,b),d=this.moveMonth(this.viewDate,b)):2==viewMode?(c=this.moveDate(this.date,b),d=this.moveDate(this.viewDate,b)):1==viewMode?(c=this.moveHour(this.date,b),d=this.moveHour(this.viewDate,b)):0==viewMode&&(c=this.moveMinute(this.date,b),d=this.moveMinute(this.viewDate,b)),this.dateWithinRange(c)&&(this.date=c,this.viewDate=d,this.setValue(),this.update(),a.preventDefault(),e=!0);break;case 38:case 40:if(!this.keyboardNavigation)break;b=38==a.keyCode?-1:1,viewMode=this.viewMode,a.ctrlKey?viewMode+=2:a.shiftKey&&(viewMode+=1),4==viewMode?(c=this.moveYear(this.date,b),d=this.moveYear(this.viewDate,b)):3==viewMode?(c=this.moveMonth(this.date,b),d=this.moveMonth(this.viewDate,b)):2==viewMode?(c=this.moveDate(this.date,7*b),d=this.moveDate(this.viewDate,7*b)):1==viewMode?this.showMeridian?(c=this.moveHour(this.date,6*b),d=this.moveHour(this.viewDate,6*b)):(c=this.moveHour(this.date,4*b),d=this.moveHour(this.viewDate,4*b)):0==viewMode&&(c=this.moveMinute(this.date,4*b),d=this.moveMinute(this.viewDate,4*b)),this.dateWithinRange(c)&&(this.date=c,this.viewDate=d,this.setValue(),this.update(),a.preventDefault(),e=!0);break;case 13:if(0!=this.viewMode){var f=this.viewMode;this.showMode(-1),this.fill(),f==this.viewMode&&this.autoclose&&this.hide()}else this.fill(),this.autoclose&&this.hide();a.preventDefault();break;case 9:this.hide()}if(e){var g;this.isInput?g=this.element:this.component&&(g=this.element.find("input")),g&&g.change(),this.element.trigger({type:"changeDate",date:this.date})}},showMode:function(a){if(a){var b=Math.max(0,Math.min(e.modes.length-1,this.viewMode+a));b>=this.minView&&b<=this.maxView&&(this.element.trigger({type:"changeMode",date:this.viewDate,oldViewMode:this.viewMode,newViewMode:b}),this.viewMode=b)}this.picker.find(">div").hide().filter(".datetimepicker-"+e.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()},reset:function(){this._setDate(null,"date")}},a.fn.datetimepicker=function(b){var d=Array.apply(null,arguments);return d.shift(),this.each(function(){var e=a(this),f=e.data("datetimepicker"),g="object"==typeof b&&b;f||e.data("datetimepicker",f=new c(this,a.extend({},a.fn.datetimepicker.defaults,g))),"string"==typeof b&&"function"==typeof f[b]&&f[b].apply(f,d)})},a.fn.datetimepicker.defaults={},a.fn.datetimepicker.Constructor=c;var d=a.fn.datetimepicker.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"],meridiem:["am","pm"],suffix:["st","nd","rd","th"],today:"Today"}};d["zh-cn"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["周日","周一","周二","周三","周四","周五","周六","周日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今日",suffix:[],meridiem:[]},d["zh-tw"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["周日","周一","周二","周三","周四","周五","周六","周日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今天",suffix:[],meridiem:["上午","下午"]};var e={modes:[{clsName:"minutes",navFnc:"Hours",navStep:1},{clsName:"hours",navFnc:"Date",navStep:1},{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(a){return a%4===0&&a%100!==0||a%400===0},getDaysInMonth:function(a,b){return[31,e.isLeapYear(a)?29:28,31,30,31,30,31,31,30,31,30,31][b]},getDefaultFormat:function(a,b){if("standard"==a)return"input"==b?"yyyy-mm-dd hh:ii":"yyyy-mm-dd hh:ii:ss";if("php"==a)return"input"==b?"Y-m-d H:i":"Y-m-d H:i:s";throw new Error("Invalid format type.")},validParts:function(a){if("standard"==a)return/hh?|HH?|p|P|ii?|ss?|dd?|DD?|mm?|MM?|yy(?:yy)?/g;if("php"==a)return/[dDjlNwzFmMnStyYaABgGhHis]/g;throw new Error("Invalid format type.")},nonpunctuation:/[^ -\/:-@\[-`{-~\t\n\rTZ]+/g,parseFormat:function(a,b){var c=a.replace(this.validParts(b),"\x00").split("\x00"),d=a.match(this.validParts(b));if(!c||!c.length||!d||0==d.length)throw new Error("Invalid date format.");return{separators:c,parts:d}},parseDate:function(e,f,g,h){if(e instanceof Date){var i=new Date(e.valueOf()-6e4*e.getTimezoneOffset());return i.setMilliseconds(0),i}if(/^\d{4}\-\d{1,2}\-\d{1,2}$/.test(e)&&(f=this.parseFormat("yyyy-mm-dd",h)),/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}$/.test(e)&&(f=this.parseFormat("yyyy-mm-dd hh:ii",h)),/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}\:\d{1,2}[Z]{0,1}$/.test(e)&&(f=this.parseFormat("yyyy-mm-dd hh:ii:ss",h)),/^[-+]\d+[dmwy]([\s,]+[-+]\d+[dmwy])*$/.test(e)){var j,k,l=/([-+]\d+)([dmwy])/,m=e.match(/([-+]\d+)([dmwy])/g);e=new Date;for(var n=0;nb;)b+=12;for(b%=12,a.setUTCMonth(b);a.getUTCMonth()!=b;)a.setUTCDate(a.getUTCDate()-1);return a},d:function(a,b){return a.setUTCDate(b)},p:function(a,b){return a.setUTCHours(1==b?a.getUTCHours()+12:a.getUTCHours())}};if(s.M=s.MM=s.mm=s.m,s.dd=s.d,s.P=s.p,e=b(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds()),m.length==f.parts.length){for(var n=0,t=f.parts.length;t>n;n++){if(o=parseInt(m[n],10),j=f.parts[n],isNaN(o))switch(j){case"MM":p=a(d[g].months).filter(function(){var a=this.slice(0,m[n].length),b=m[n].slice(0,a.length);return a==b}),o=a.inArray(p[0],d[g].months)+1;break;case"M":p=a(d[g].monthsShort).filter(function(){var a=this.slice(0,m[n].length),b=m[n].slice(0,a.length);return a==b}),o=a.inArray(p[0],d[g].monthsShort)+1;break;case"p":case"P":o=a.inArray(m[n].toLowerCase(),d[g].meridiem)}q[j]=o}for(var u,n=0;nj;j++)i.length&&b.push(i.shift()),b.push(h[c.parts[j]]);return i.length&&b.push(i.shift()),b.join("")},convertViewMode:function(a){switch(a){case 4:case"decade":a=4;break;case 3:case"year":a=3;break;case 2:case"month":a=2;break;case 1:case"day":a=1;break;case 0:case"hour":a=0}return a},headTemplate:'',contTemplate:'',footTemplate:''};e.template='
              '+e.headTemplate+e.contTemplate+e.footTemplate+'
              '+e.headTemplate+e.contTemplate+e.footTemplate+'
              '+e.headTemplate+""+e.footTemplate+'
              '+e.headTemplate+e.contTemplate+e.footTemplate+'
              '+e.headTemplate+e.contTemplate+e.footTemplate+"
              ",a.fn.datetimepicker.DPGlobal=e,a.fn.datetimepicker.noConflict=function(){return a.fn.datetimepicker=old,this},a(document).on("focus.datetimepicker.data-api click.datetimepicker.data-api",'[data-provide="datetimepicker"]',function(b){var c=a(this);c.data("datetimepicker")||(b.preventDefault(),c.datetimepicker("show"))}),a(function(){a('[data-provide="datetimepicker-inline"]').datetimepicker()})}(window.jQuery); \ No newline at end of file diff --git a/assets/kindeditor/themes/default/default.css b/assets/kindeditor/themes/default/default.css index 534ddf06d..c5f851333 100644 --- a/assets/kindeditor/themes/default/default.css +++ b/assets/kindeditor/themes/default/default.css @@ -1 +1,1083 @@ -.ke-inline-block{display:-moz-inline-stack;display:inline-block;vertical-align:middle;zoom:1;*display:inline}.ke-clearfix{zoom:1}.ke-clearfix:after{content:".";display:block;clear:both;font-size:0;height:0;line-height:0;visibility:hidden}.ke-shadow{-moz-box-shadow:0 6px 12px rgba(0,0,0,0.175);-webkit-box-shadow:0 6px 12px rgba(0,0,0,0.175);box-shadow:0 6px 12px rgba(0,0,0,0.175)}[class^="ke-icon-"],[class*=" ke-icon-"]{width:16px;height:16px}.ke-icon-source{background-position:0 0}.ke-icon-preview{background-position:0 -16px}.ke-icon-print{background-position:0 -32px}.ke-icon-undo{background-position:0 -48px}.ke-icon-redo{background-position:0 -64px}.ke-icon-cut{background-position:0 -80px}.ke-icon-copy{background-position:0 -96px}.ke-icon-paste{background-position:0 -112px}.ke-icon-selectall{background-position:0 -128px}.ke-icon-justifyleft{background-position:0 -144px}.ke-icon-justifycenter{background-position:0 -160px}.ke-icon-justifyright{background-position:0 -176px}.ke-icon-justifyfull{background-position:0 -192px}.ke-icon-insertorderedlist{background-position:0 -208px}.ke-icon-insertunorderedlist{background-position:0 -224px}.ke-icon-indent{background-position:0 -240px}.ke-icon-outdent{background-position:0 -256px}.ke-icon-subscript{background-position:0 -272px}.ke-icon-superscript{background-position:0 -288px}.ke-icon-date{background-position:0 -304px;width:25px}.ke-icon-time{background-position:0 -320px;width:25px}.ke-icon-formatblock{background-position:0 -336px;width:25px}.ke-icon-fontname{background-position:0 -352px;width:21px}.ke-icon-fontsize{background-position:0 -368px;width:23px}.ke-icon-forecolor{background-position:0 -384px;width:20px}.ke-icon-hilitecolor{background-position:0 -400px;width:23px}.ke-icon-bold{background-position:0 -416px}.ke-icon-italic{background-position:0 -432px}.ke-icon-underline{background-position:0 -448px}.ke-icon-strikethrough{background-position:0 -464px}.ke-icon-removeformat{background-position:0 -480px}.ke-icon-image{background-position:0 -496px}.ke-icon-flash{background-position:0 -512px}.ke-icon-media{background-position:0 -528px}.ke-icon-div{background-position:0 -544px}.ke-icon-formula{background-position:0 -576px}.ke-icon-hr{background-position:0 -592px}.ke-icon-emoticons{background-position:0 -608px}.ke-icon-link{background-position:0 -624px}.ke-icon-unlink{background-position:0 -640px}.ke-icon-fullscreen{background-position:0 -656px}.ke-icon-about{background-position:0 -672px}.ke-icon-plainpaste{background-position:0 -704px}.ke-icon-wordpaste{background-position:0 -720px}.ke-icon-table{background-position:0 -784px}.ke-icon-tablemenu{background-position:0 -768px}.ke-icon-tableinsert{background-position:0 -784px}.ke-icon-tabledelete{background-position:0 -800px}.ke-icon-tablecolinsertleft{background-position:0 -816px}.ke-icon-tablecolinsertright{background-position:0 -832px}.ke-icon-tablerowinsertabove{background-position:0 -848px}.ke-icon-tablerowinsertbelow{background-position:0 -864px}.ke-icon-tablecoldelete{background-position:0 -880px}.ke-icon-tablerowdelete{background-position:0 -896px}.ke-icon-tablecellprop{background-position:0 -912px}.ke-icon-tableprop{background-position:0 -928px}.ke-icon-checked{background-position:0 -944px}.ke-icon-code{background-position:0 -960px}.ke-icon-map{background-position:0 -976px}.ke-icon-baidumap{background-position:0 -976px}.ke-icon-lineheight{background-position:0 -992px}.ke-icon-clearhtml{background-position:0 -1008px}.ke-icon-pagebreak{background-position:0 -1024px}.ke-icon-insertfile{background-position:0 -1040px}.ke-icon-quickformat{background-position:0 -1056px}.ke-icon-template{background-position:0 -1072px}.ke-icon-tablecellsplit{background-position:0 -1088px}.ke-icon-tablerowmerge{background-position:0 -1104px}.ke-icon-tablerowsplit{background-position:0 -1120px}.ke-icon-tablecolmerge{background-position:0 -1136px}.ke-icon-tablecolsplit{background-position:0 -1152px}.ke-icon-anchor{background-position:0 -1168px}.ke-icon-search{background-position:0 -1184px}.ke-icon-new{background-position:0 -1200px}.ke-icon-specialchar{background-position:0 -1216px}.ke-icon-multiimage{background-position:0 -1232px}.ke-container{position:relative;display:block;border:1px solid #ccc;background-color:#fff;border-radius:4px;overflow:hidden;margin:0;padding:0;-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.ke-container.focus{border-color:#145ccd;outline:0;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(20,92,205,0.6);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(20,92,205,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(20,92,205,0.6)}.ke-toolbar{border-bottom:1px solid #ccc;background-color:#fff;padding:2px 5px;text-align:left;overflow:hidden;zoom:1}.ke-toolbar-icon{background-repeat:no-repeat;font-size:0;line-height:0;overflow:hidden;display:block}.ke-toolbar-icon-url{background-image:url(default.png)}.ke-toolbar .ke-outline{border:1px solid #fff;margin:1px;padding:1px 2px;font-size:0;line-height:0;overflow:hidden;cursor:pointer;display:block;float:left;border-radius:4px;opacity:.8;filter:alpha(opacity=80);-webkit-transition:all .5s cubic-bezier(0.175,0.885,0.32,1);transition:all .5s cubic-bezier(0.175,0.885,0.32,1)}.ke-toolbar .ke-on,.ke-toolbar .ke-selected{opacity:1;filter:alpha(opacity=100);border-color:#ddd}.ke-toolbar .ke-selected{background-color:#f1f1f1}.ke-toolbar .ke-disabled{cursor:default}.ke-toolbar .ke-separator{height:16px;margin:2px 3px;border-left:1px dotted #ddd;border-top:0;border-bottom:0;width:0;font-size:0;line-height:0;overflow:hidden;display:block;float:left}.ke-toolbar .ke-hr{overflow:hidden;height:1px;clear:both}.ke-edit{padding:0}.ke-edit-iframe,.ke-edit-textarea{border:0;margin:0;padding:0;overflow:auto}.ke-edit-textarea{font-size:12px;font-family:Monaco,Menlo,Consolas,"Courier New",monospace;background-color:#222;color:#e5e5e5;overflow:auto;resize:none}.ke-edit-textarea:focus{outline:0}.ke-statusbar{position:absolute;width:100%;bottom:0;background-color:#fff;border-top:1px solid #ccc;font-size:0;line-height:0;*height:12px;overflow:hidden;text-align:center;cursor:s-resize;-webkit-transition:all .5s cubic-bezier(0.175,0.885,0.32,1);transition:all .5s cubic-bezier(0.175,0.885,0.32,1);opacity:0;filter:alpha(opacity=0)}.ke-statusbar .ke-statusbar-center-icon,.ke-statusbar .ke-statusbar-right-icon{height:11px;background-image:url(default.png)}.ke-statusbar .ke-statusbar-center-icon{background-position:0 -754px;width:15px}.ke-statusbar .ke-statusbar-right-icon{position:absolute;right:0;bottom:0;cursor:se-resize;background-position:-5px -741px;width:11px}.ke-statusbar:hover{opacity:1;filter:alpha(opacity=100)}.ke-menu{padding:5px 0;font-family:"Helvetica Neue",Helvetica,Tahoma,Arial,sans-serif;font-size:12px;text-align:left;overflow:hidden;background-color:#fff;border:1px solid #cbcbcb;border:1px solid rgba(0,0,0,0.15);border-radius:4px}.ke-menu-item{height:24px;overflow:hidden;cursor:pointer}.ke-menu-item-on{color:#fff;text-decoration:none;outline:0;background-color:#3280fc}.ke-menu-item-left{width:27px;text-align:center;overflow:hidden}.ke-menu-item-center{width:0;height:24px;border-left:1px solid #e3e3e3;border-right:1px solid #fff;border-top:0;border-bottom:0}.ke-menu-item-center-on{border-left:1px solid #e9eff6;border-right:1px solid #e9eff6}.ke-menu-item-right{border:0;padding:0 0 0 5px;line-height:24px;text-align:left;overflow:hidden}.ke-menu-separator{margin:2px 0;height:0;overflow:hidden;border-top:1px solid #ccc;border-bottom:1px solid #fff;border-left:0;border-right:0}.ke-colorpicker{background-color:#fff;border:1px solid #cbcbcb;border:1px solid rgba(0,0,0,0.15);border-radius:4px}.ke-colorpicker-table{border:0;margin:0;padding:0;border-collapse:separate}.ke-colorpicker-cell{font-size:0;line-height:0;border:0;cursor:pointer;padding:0}.ke-colorpicker-cell-color{width:25px;height:25px;padding:0;border:0;-webkit-transition:all .5s cubic-bezier(0.175,0.885,0.32,1);transition:all .5s cubic-bezier(0.175,0.885,0.32,1)}.ke-colorpicker-cell-top{font-family:"Helvetica Neue",Helvetica,Tahoma,Arial,sans-serif;font-size:12px;line-height:25px;cursor:pointer;margin:0;padding:0;text-align:center}.ke-colorpicker-cell-on{color:#fff;background-color:#3280fc}.ke-colorpicker-cell-on .ke-colorpicker-cell-color{border:2px solid #333}.ke-colorpicker-cell-selected .ke-colorpicker-cell-color{border:2px solid #333}.ke-dialog{position:absolute;margin:0;padding:0}.ke-dialog .ke-header{width:100%;margin-bottom:10px}.ke-dialog .ke-header .ke-left{float:left}.ke-dialog .ke-header .ke-right{float:right}.ke-dialog .ke-header label{margin-right:0;cursor:pointer;font-weight:normal;display:inline;vertical-align:top}.ke-dialog-content{width:100%;height:100%;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.2);border-radius:4px;overflow:hidden}.ke-dialog-shadow{position:absolute;z-index:-1;top:0;left:0;width:100%;height:100%;-moz-box-shadow:0 3px 9px rgba(0,0,0,0.5);-webkit-box-shadow:0 3px 9px rgba(0,0,0,0.5);box-shadow:0 3px 9px rgba(0,0,0,0.5);background-color:#f0f0ee}.ke-dialog-header{border:0;margin:0;background:#f1f1f1;font-weight:bold;font-family:"Helvetica Neue",Helvetica,Tahoma,Arial,sans-serif;font-size:14px;text-align:left;cursor:move;padding:7.5px 15px;border-bottom:1px solid #e5e5e5;min-height:16.428571429px}.ke-dialog-icon-close{display:block;background:url(default.png) no-repeat scroll 0 -688px;width:16px;height:16px;position:absolute;right:8px;top:10px;cursor:pointer;opacity:.6;filter:alpha(opacity=60)}.ke-dialog-icon-close:hover{opacity:1;filter:alpha(opacity=100)}.ke-dialog-body{font-family:"Helvetica Neue",Helvetica,Tahoma,Arial,sans-serif;font-size:12px;text-align:left;overflow:hidden;width:100%}.ke-dialog-body textarea{display:block;overflow:auto;padding:0;resize:none}.ke-dialog-body textarea:focus,.ke-dialog-body input:focus,.ke-dialog-body select:focus{outline:0}.ke-dialog-body label{margin-right:10px;cursor:pointer;display:-moz-inline-stack;display:inline-block;vertical-align:middle;zoom:1;*display:inline}.ke-dialog-body img{display:-moz-inline-stack;display:inline-block;vertical-align:middle;zoom:1;*display:inline}.ke-dialog-body select{display:-moz-inline-stack;display:inline-block;vertical-align:middle;zoom:1;*display:inline;width:auto}.ke-dialog-body .ke-textarea{display:block;width:408px;height:260px;background-color:#fff;border:1px solid #ccc;border-radius:4px;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.ke-dialog-body .ke-form{margin:0;padding:0}.ke-dialog-loading{position:absolute;top:0;left:1px;z-index:1;text-align:center}.ke-dialog-loading-content{background:url("../common/loading.gif") no-repeat;color:#666;font-size:14px;font-weight:bold;height:31px;line-height:31px;padding-left:36px}.ke-dialog-row{margin-bottom:10px}.ke-dialog-footer{text-align:right;padding:5px;width:100%;border-top:1px solid #e5e5e5}.ke-dialog-preview,.ke-dialog-yes{margin:5px}.ke-dialog-no{margin:5px 10px 5px 5px}.ke-dialog-mask{background-color:#000;opacity:.5;filter:alpha(opacity=50)}.ke-button-common{height:23px;line-height:21px;overflow:visible;display:inline-block;vertical-align:middle;cursor:pointer}.ke-button-outer{padding:0;position:relative;display:-moz-inline-stack;display:inline-block;vertical-align:middle;zoom:1;*display:inline}.ke-button{padding:0 12px;margin:0;border-radius:4px;border:1px solid #c9c9c9;color:#333;background-color:#fcfcfc;border-color:#dedede;font-size:12px;left:2px;text-decoration:none}.ke-button:hover,.ke-button:focus,.ke-button:active,.ke-button.active,.open .dropdown-toggle.ke-button{color:#333;background-color:#e8e8e8;border-color:#ababab;-moz-box-shadow:0 2px 1px rgba(0,0,0,0.1);-webkit-box-shadow:0 2px 1px rgba(0,0,0,0.1);box-shadow:0 2px 1px rgba(0,0,0,0.1)}.ke-button:active,.ke-button.active,.open .dropdown-toggle.ke-button{background-image:none;-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.ke-button.disabled,.ke-button[disabled],fieldset[disabled] .ke-button,.ke-button.disabled:hover,.ke-button[disabled]:hover,fieldset[disabled] .ke-button:hover,.ke-button.disabled:focus,.ke-button[disabled]:focus,fieldset[disabled] .ke-button:focus,.ke-button.disabled:active,.ke-button[disabled]:active,fieldset[disabled] .ke-button:active,.ke-button.disabled.active,.ke-button[disabled].active,fieldset[disabled] .ke-button.active{background-color:#fcfcfc;border-color:#c9c9c9}.ke-input-text{font-family:"sans serif",tahoma,verdana,helvetica;font-size:12px;line-height:20px;height:20px;padding:0 4px;display:-moz-inline-stack;display:inline-block;vertical-align:middle;zoom:1;*display:inline;background-color:#fff;border:1px solid #ccc;border-radius:4px;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.ke-input-text:focus{border-color:#145ccd;outline:0;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(20,92,205,0.6);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(20,92,205,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(20,92,205,0.6)}.ke-input-number{width:50px}.ke-input-color,select{border:1px solid #ccc;background-color:#333;font-size:12px;width:60px;height:20px;line-height:20px;padding-left:5px;overflow:hidden;cursor:pointer;display:-moz-inline-stack;display:inline-block;vertical-align:middle;zoom:1;*display:inline}.ke-upload-button{position:relative}.ke-upload-area{position:relative;overflow:hidden;margin:0;padding:0}.ke-upload-area .ke-upload-file{position:absolute;font-size:60px;top:0;right:0;padding:0;margin:0;z-index:811212;border:0 none;opacity:0;filter:alpha(opacity=0)}.ke-tabs{font:12px/1 "sans serif",tahoma,verdana,helvetica;border-bottom:1px solid #a0a0a0;padding-left:5px;margin-bottom:20px}.ke-tabs-ul{list-style-image:none;list-style-position:outside;list-style-type:none;margin:0;padding:0}.ke-tabs-li{position:relative;border:1px solid #a0a0a0;background-color:#f0f0ee;margin:0 2px -1px 0;padding:0 20px;float:left;line-height:25px;text-align:center;color:#555;cursor:pointer}.ke-tabs-li-selected{background-color:#FFF;border-bottom:1px solid #FFF;color:#000;cursor:default}.ke-tabs-li-on{background-color:#FFF;color:#000}.ke-progressbar{position:relative;margin:0;padding:0}.ke-progressbar-bar{border:1px solid #6fa5db;width:80px;height:5px;margin:10px 10px 0 10px;padding:0}.ke-progressbar-bar-inner{width:0;height:5px;background-color:#6fa5db;overflow:hidden;margin:0;padding:0}.ke-progressbar-percent{position:absolute;top:0;left:40%;display:none}.ke-swfupload-top{position:relative;margin-bottom:10px;_width:608px}.ke-swfupload-button{height:23px;line-height:23px}.ke-swfupload-desc{padding:0 10px;height:23px;line-height:23px}.ke-swfupload-startupload{position:absolute;top:0;right:0}.ke-swfupload-body{overflow:scroll;background-color:#fff;border:1px solid #ccc;width:auto;height:370px;padding:5px}.ke-swfupload-body .ke-item{width:100px;margin:5px}.ke-swfupload-body .ke-photo{position:relative;border:1px solid #ddd;background-color:#fff;padding:10px}.ke-swfupload-body .ke-delete{display:block;background:url(default.png) no-repeat scroll 0 -688px;width:16px;height:16px;position:absolute;right:0;top:0;cursor:pointer}.ke-swfupload-body .ke-status{position:absolute;left:0;bottom:5px;width:100px;height:17px}.ke-swfupload-body .ke-message{width:100px;text-align:center;overflow:hidden;height:17px}.ke-swfupload-body .ke-error{color:red}.ke-swfupload-body .ke-name{width:100px;text-align:center;overflow:hidden;height:16px}.ke-swfupload-body .ke-on{border:1px solid #5690d2;background-color:#e9eff6}.ke-plugin-emoticons{position:relative}.ke-plugin-emoticons .ke-preview{position:absolute;text-align:center;margin:2px;padding:10px;top:0;border:1px solid #a0a0a0;background-color:#fff;display:none}.ke-plugin-emoticons .ke-preview-img{border:0;margin:0;padding:0}.ke-plugin-emoticons .ke-table{border:0;margin:0;padding:0;border-collapse:separate}.ke-plugin-emoticons .ke-cell{margin:0;padding:1px;border:1px solid #f0f0ee;cursor:pointer}.ke-plugin-emoticons .ke-on{border:1px solid #5690d2;background-color:#e9eff6}.ke-plugin-emoticons .ke-img{display:block;background-repeat:no-repeat;overflow:hidden;margin:2px;width:24px;height:24px;margin:0;padding:0;border:0}.ke-plugin-emoticons .ke-page{text-align:right;margin:5px;padding:0;border:0;font:12px/1 "sans serif",tahoma,verdana,helvetica;color:#333;text-decoration:none}.ke-plugin-plainpaste-textarea,.ke-plugin-wordpaste-iframe{display:block;width:408px;height:260px;font-family:"sans serif",tahoma,verdana,helvetica;font-size:12px;border:1px solid #ccc}.ke-plugin-filemanager-header{width:100%;margin-bottom:10px}.ke-plugin-filemanager-header .ke-left{float:left}.ke-plugin-filemanager-header .ke-right{float:right}.ke-plugin-filemanager-body{overflow:scroll;background-color:#fff;border:1px solid #ccc;width:auto;height:370px;padding:5px}.ke-plugin-filemanager-body .ke-item{width:100px;margin:5px}.ke-plugin-filemanager-body .ke-photo{border:1px solid #ddd;background-color:#fff;padding:10px}.ke-plugin-filemanager-body .ke-name{width:100px;text-align:center;overflow:hidden;height:16px}.ke-plugin-filemanager-body .ke-on{border:1px solid #5690d2;background-color:#e9eff6}.ke-plugin-filemanager-body .ke-table{width:95%;border:0;margin:0;padding:0;border-collapse:separate}.ke-plugin-filemanager-body .ke-table .ke-cell{margin:0;padding:0;border:0}.ke-plugin-filemanager-body .ke-table .ke-name{width:55%;text-align:left}.ke-plugin-filemanager-body .ke-table .ke-size{width:15%;text-align:left}.ke-plugin-filemanager-body .ke-table .ke-datetime{width:30%;text-align:center} \ No newline at end of file +/* common */ +.ke-inline-block { + display: -moz-inline-stack; + display: inline-block; + vertical-align: middle; + zoom: 1; + *display: inline; +} +.ke-clearfix { + zoom: 1; +} +.ke-clearfix:after { + content: "."; + display: block; + clear: both; + font-size: 0; + height: 0; + line-height: 0; + visibility: hidden; +} +.ke-shadow { + -moz-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); + -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); + box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); +} +/* icons */ +[class^="ke-icon-"], +[class*=" ke-icon-"] { + width: 16px; + height: 16px; +} +.ke-icon-source { + background-position: 0 0; +} +.ke-icon-preview { + background-position: 0 -16px; +} +.ke-icon-print { + background-position: 0 -32px; +} +.ke-icon-undo { + background-position: 0 -48px; +} +.ke-icon-redo { + background-position: 0 -64px; +} +.ke-icon-cut { + background-position: 0 -80px; +} +.ke-icon-copy { + background-position: 0 -96px; +} +.ke-icon-paste { + background-position: 0 -112px; +} +.ke-icon-selectall { + background-position: 0 -128px; +} +.ke-icon-justifyleft { + background-position: 0 -144px; +} +.ke-icon-justifycenter { + background-position: 0 -160px; +} +.ke-icon-justifyright { + background-position: 0 -176px; +} +.ke-icon-justifyfull { + background-position: 0 -192px; +} +.ke-icon-insertorderedlist { + background-position: 0 -208px; +} +.ke-icon-insertunorderedlist { + background-position: 0 -224px; +} +.ke-icon-indent { + background-position: 0 -240px; +} +.ke-icon-outdent { + background-position: 0 -256px; +} +.ke-icon-subscript { + background-position: 0 -272px; +} +.ke-icon-superscript { + background-position: 0 -288px; +} +.ke-icon-date { + background-position: 0 -304px; + width: 25px; +} +.ke-icon-time { + background-position: 0 -320px; + width: 25px; +} +.ke-icon-formatblock { + background-position: 0 -336px; + width: 25px; +} +.ke-icon-fontname { + background-position: 0 -352px; + width: 21px; +} +.ke-icon-fontsize { + background-position: 0 -368px; + width: 23px; +} +.ke-icon-forecolor { + background-position: 0 -384px; + width: 20px; +} +.ke-icon-hilitecolor { + background-position: 0 -400px; + width: 23px; +} +.ke-icon-bold { + background-position: 0 -416px; +} +.ke-icon-italic { + background-position: 0 -432px; +} +.ke-icon-underline { + background-position: 0 -448px; +} +.ke-icon-strikethrough { + background-position: 0 -464px; +} +.ke-icon-removeformat { + background-position: 0 -480px; +} +.ke-icon-image { + background-position: 0 -496px; +} +.ke-icon-flash { + background-position: 0 -512px; +} +.ke-icon-media { + background-position: 0 -528px; +} +.ke-icon-div { + background-position: 0 -544px; +} +.ke-icon-formula { + background-position: 0 -576px; +} +.ke-icon-hr { + background-position: 0 -592px; +} +.ke-icon-emoticons { + background-position: 0 -608px; +} +.ke-icon-link { + background-position: 0 -624px; +} +.ke-icon-unlink { + background-position: 0 -640px; +} +.ke-icon-fullscreen { + background-position: 0 -656px; +} +.ke-icon-about { + background-position: 0 -672px; +} +.ke-icon-plainpaste { + background-position: 0 -704px; +} +.ke-icon-wordpaste { + background-position: 0 -720px; +} +.ke-icon-table { + background-position: 0 -784px; +} +.ke-icon-tablemenu { + background-position: 0 -768px; +} +.ke-icon-tableinsert { + background-position: 0 -784px; +} +.ke-icon-tabledelete { + background-position: 0 -800px; +} +.ke-icon-tablecolinsertleft { + background-position: 0 -816px; +} +.ke-icon-tablecolinsertright { + background-position: 0 -832px; +} +.ke-icon-tablerowinsertabove { + background-position: 0 -848px; +} +.ke-icon-tablerowinsertbelow { + background-position: 0 -864px; +} +.ke-icon-tablecoldelete { + background-position: 0 -880px; +} +.ke-icon-tablerowdelete { + background-position: 0 -896px; +} +.ke-icon-tablecellprop { + background-position: 0 -912px; +} +.ke-icon-tableprop { + background-position: 0 -928px; +} +.ke-icon-checked { + background-position: 0 -944px; +} +.ke-icon-code { + background-position: 0 -960px; +} +.ke-icon-map { + background-position: 0 -976px; +} +.ke-icon-baidumap { + background-position: 0 -976px; +} +.ke-icon-lineheight { + background-position: 0 -992px; +} +.ke-icon-clearhtml { + background-position: 0 -1008px; +} +.ke-icon-pagebreak { + background-position: 0 -1024px; +} +.ke-icon-insertfile { + background-position: 0 -1040px; +} +.ke-icon-quickformat { + background-position: 0 -1056px; +} +.ke-icon-template { + background-position: 0 -1072px; +} +.ke-icon-tablecellsplit { + background-position: 0 -1088px; +} +.ke-icon-tablerowmerge { + background-position: 0 -1104px; +} +.ke-icon-tablerowsplit { + background-position: 0 -1120px; +} +.ke-icon-tablecolmerge { + background-position: 0 -1136px; +} +.ke-icon-tablecolsplit { + background-position: 0 -1152px; +} +.ke-icon-anchor { + background-position: 0 -1168px; +} +.ke-icon-search { + background-position: 0 -1184px; +} +.ke-icon-new { + background-position: 0 -1200px; +} +.ke-icon-specialchar { + background-position: 0 -1216px; +} +.ke-icon-multiimage { + background-position: 0 -1232px; +} +/* container */ +.ke-container { + position: relative; + display: block; + border: 1px solid #cccccc; + background-color: #ffffff; + border-radius: 4px; + overflow: hidden; + margin: 0; + padding: 0; + -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; +} +.ke-container.focus { + border-color: #145ccd; + outline: 0; + -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(20, 92, 205, 0.6); + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(20, 92, 205, 0.6); + box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(20, 92, 205, 0.6); +} +/* toolbar */ +.ke-toolbar { + border-bottom: 1px solid #cccccc; + background-color: #ffffff; + padding: 2px 5px; + text-align: left; + overflow: hidden; + zoom: 1; +} +.ke-toolbar-icon { + background-repeat: no-repeat; + font-size: 0; + line-height: 0; + overflow: hidden; + display: block; +} +.ke-toolbar-icon-url { + background-image: url(default.png); +} +.ke-toolbar .ke-outline { + border: 1px solid #ffffff; + margin: 1px; + padding: 1px 2px; + font-size: 0; + line-height: 0; + overflow: hidden; + cursor: pointer; + display: block; + float: left; + border-radius: 4px; + opacity: 0.8; + filter: alpha(opacity=80); + -webkit-transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1); + transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1); +} +.ke-toolbar .ke-on, +.ke-toolbar .ke-selected { + opacity: 1; + filter: alpha(opacity=100); + border-color: #dddddd; +} +.ke-toolbar .ke-selected { + background-color: #f1f1f1; +} +.ke-toolbar .ke-disabled { + cursor: default; +} +.ke-toolbar .ke-separator { + height: 16px; + margin: 2px 3px; + border-left: 1px dotted #dddddd; + border-top: 0; + border-bottom: 0; + width: 0; + font-size: 0; + line-height: 0; + overflow: hidden; + display: block; + float: left; +} +.ke-toolbar .ke-hr { + overflow: hidden; + height: 1px; + clear: both; +} +/* edit */ +.ke-edit { + padding: 0; +} +.ke-edit-iframe, +.ke-edit-textarea { + border: 0; + margin: 0; + padding: 0; + overflow: auto; +} +.ke-edit-textarea { + font-size: 12px; + font-family: Monaco, Menlo, Consolas, "Courier New", monospace; + background-color: #ffffff; + color: #333333; + overflow: auto; + resize: none; +} +.ke-edit-textarea:focus { + outline: none; +} +/* statusbar */ +.ke-statusbar { + position: absolute; + width: 100%; + bottom: 0; + background-color: #ffffff; + border-top: 1px solid #cccccc; + font-size: 0; + line-height: 0; + *height: 12px; + overflow: hidden; + text-align: center; + cursor: s-resize; + -webkit-transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1); + transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1); + opacity: 0; + filter: alpha(opacity=0); +} +.ke-statusbar .ke-statusbar-center-icon, +.ke-statusbar .ke-statusbar-right-icon { + height: 11px; + background-image: url(default.png); +} +.ke-statusbar .ke-statusbar-center-icon { + background-position: 0px -754px; + width: 15px; +} +.ke-statusbar .ke-statusbar-right-icon { + position: absolute; + right: 0; + bottom: 0; + cursor: se-resize; + background-position: -5px -741px; + width: 11px; +} +.ke-statusbar:hover { + opacity: 1; + filter: alpha(opacity=100); +} +/* menu */ +.ke-menu { + padding: 5px 0; + font-family: "Helvetica Neue", Helvetica, Tahoma, Arial, sans-serif; + font-size: 12px; + text-align: left; + overflow: hidden; + background-color: #ffffff; + border: 1px solid #cbcbcb; + border: 1px solid rgba(0, 0, 0, 0.15); + border-radius: 4px; +} +.ke-menu-item { + height: 24px; + overflow: hidden; + cursor: pointer; +} +.ke-menu-item-on { + color: #ffffff; + text-decoration: none; + outline: 0; + background-color: #3280fc; +} +.ke-menu-item-left { + width: 27px; + text-align: center; + overflow: hidden; +} +.ke-menu-item-center { + width: 0; + height: 24px; + border-left: 1px solid #E3E3E3; + border-right: 1px solid #FFFFFF; + border-top: 0; + border-bottom: 0; +} +.ke-menu-item-center-on { + border-left: 1px solid #E9EFF6; + border-right: 1px solid #E9EFF6; +} +.ke-menu-item-right { + border: 0; + padding: 0 0 0 5px; + line-height: 24px; + text-align: left; + overflow: hidden; +} +.ke-menu-separator { + margin: 2px 0; + height: 0; + overflow: hidden; + border-top: 1px solid #CCCCCC; + border-bottom: 1px solid #FFFFFF; + border-left: 0; + border-right: 0; +} +/* colorpicker */ +.ke-colorpicker { + background-color: #ffffff; + border: 1px solid #cbcbcb; + border: 1px solid rgba(0, 0, 0, 0.15); + border-radius: 4px; +} +.ke-colorpicker-table { + border: 0; + margin: 0; + padding: 0; + border-collapse: separate; +} +.ke-colorpicker-cell { + font-size: 0; + line-height: 0; + border: none; + cursor: pointer; + padding: 0; +} +.ke-colorpicker-cell-color { + width: 25px; + height: 25px; + padding: 0; + border: 0; + -webkit-transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1); + transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1); +} +.ke-colorpicker-cell-top { + font-family: "Helvetica Neue", Helvetica, Tahoma, Arial, sans-serif; + font-size: 12px; + line-height: 25px; + cursor: pointer; + margin: 0; + padding: 0; + text-align: center; +} +.ke-colorpicker-cell-on { + color: #ffffff; + background-color: #3280fc; +} +.ke-colorpicker-cell-on .ke-colorpicker-cell-color { + border: 2px solid #333333; +} +.ke-colorpicker-cell-selected .ke-colorpicker-cell-color { + border: 2px solid #333333; +} +/* dialog */ +.ke-dialog { + position: absolute; + margin: 0; + padding: 0; +} +.ke-dialog .ke-header { + width: 100%; + margin-bottom: 10px; +} +.ke-dialog .ke-header .ke-left { + float: left; +} +.ke-dialog .ke-header .ke-right { + float: right; +} +.ke-dialog .ke-header label { + margin-right: 0; + cursor: pointer; + font-weight: normal; + display: inline; + vertical-align: top; +} +.ke-dialog-content { + width: 100%; + height: 100%; + background-color: #ffffff; + border: 1px solid #999999; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 4px; + overflow: hidden; +} +.ke-dialog-shadow { + position: absolute; + z-index: -1; + top: 0; + left: 0; + width: 100%; + height: 100%; + -moz-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); + -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); + box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); + background-color: #F0F0EE; +} +.ke-dialog-header { + border: 0; + margin: 0; + background: #f1f1f1; + font-weight: bold; + font-family: "Helvetica Neue", Helvetica, Tahoma, Arial, sans-serif; + font-size: 13px; + text-align: left; + cursor: move; + padding: 15px / 2 15px; + border-bottom: 1px solid #e5e5e5; + min-height: 16.53846154px; +} +.ke-dialog-icon-close { + display: block; + background: url(default.png) no-repeat scroll 0 -688px; + width: 16px; + height: 16px; + position: absolute; + right: 8px; + top: 10px; + cursor: pointer; + opacity: 0.6; + filter: alpha(opacity=60); +} +.ke-dialog-icon-close:hover { + opacity: 1; + filter: alpha(opacity=100); +} +.ke-dialog-body { + font-family: "Helvetica Neue", Helvetica, Tahoma, Arial, sans-serif; + font-size: 12px; + text-align: left; + overflow: hidden; + width: 100%; +} +.ke-dialog-body textarea { + display: block; + overflow: auto; + padding: 0; + resize: none; +} +.ke-dialog-body textarea:focus, +.ke-dialog-body input:focus, +.ke-dialog-body select:focus { + outline: none; +} +.ke-dialog-body label { + margin-right: 10px; + cursor: pointer; + display: -moz-inline-stack; + display: inline-block; + vertical-align: middle; + zoom: 1; + *display: inline; +} +.ke-dialog-body img { + display: -moz-inline-stack; + display: inline-block; + vertical-align: middle; + zoom: 1; + *display: inline; +} +.ke-dialog-body select { + display: -moz-inline-stack; + display: inline-block; + vertical-align: middle; + zoom: 1; + *display: inline; + width: auto; +} +.ke-dialog-body .ke-textarea { + display: block; + width: 408px; + height: 260px; + background-color: #ffffff; + border: 1px solid #cccccc; + border-radius: 4px; + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; +} +.ke-dialog-body .ke-form { + margin: 0; + padding: 0; +} +.ke-dialog-loading { + position: absolute; + top: 0; + left: 1px; + z-index: 1; + text-align: center; +} +.ke-dialog-loading-content { + background: url("../common/loading.gif") no-repeat; + color: #666; + font-size: 14px; + font-weight: bold; + height: 31px; + line-height: 31px; + padding-left: 36px; +} +.ke-dialog-row { + margin-bottom: 10px; +} +.ke-dialog-footer { + text-align: right; + padding: 5px; + width: 100%; + border-top: 1px solid #e5e5e5; +} +.ke-dialog-preview, +.ke-dialog-yes { + margin: 5px; +} +.ke-dialog-no { + margin: 5px 10px 5px 5px; +} +.ke-dialog-mask { + background-color: #000000; + opacity: 0.5; + filter: alpha(opacity=50); +} +.ke-button-common { + height: 23px; + line-height: 21px; + overflow: visible; + display: inline-block; + vertical-align: middle; + cursor: pointer; +} +.ke-button-outer { + padding: 0; + position: relative; + display: -moz-inline-stack; + display: inline-block; + vertical-align: middle; + zoom: 1; + *display: inline; +} +.ke-button { + padding: 0 12px; + margin: 0; + border-radius: 4px; + border: 1px solid #bfbfbf; + color: #333333; + background-color: #f2f2f2; + border-color: #d4d4d4; + font-size: 12px; + left: 2px; + text-decoration: none; +} +.ke-button:hover, +.ke-button:focus, +.ke-button:active, +.ke-button.active, +.open .dropdown-toggle.ke-button { + color: #333333; + background-color: #dedede; + border-color: #a1a1a1; + -moz-box-shadow: 0 2px 1px rgba(0, 0, 0, 0.1); + -webkit-box-shadow: 0 2px 1px rgba(0, 0, 0, 0.1); + box-shadow: 0 2px 1px rgba(0, 0, 0, 0.1); +} +.ke-button:active, +.ke-button.active, +.open .dropdown-toggle.ke-button { + background-image: none; + -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); +} +.ke-button.disabled, +.ke-button[disabled], +fieldset[disabled] .ke-button, +.ke-button.disabled:hover, +.ke-button[disabled]:hover, +fieldset[disabled] .ke-button:hover, +.ke-button.disabled:focus, +.ke-button[disabled]:focus, +fieldset[disabled] .ke-button:focus, +.ke-button.disabled:active, +.ke-button[disabled]:active, +fieldset[disabled] .ke-button:active, +.ke-button.disabled.active, +.ke-button[disabled].active, +fieldset[disabled] .ke-button.active { + background-color: #f2f2f2; + border-color: #bfbfbf; +} +/* inputbox */ +.ke-input-text { + font-family: "sans serif", tahoma, verdana, helvetica; + font-size: 12px; + line-height: 20px; + height: 20px; + padding: 0 4px; + display: -moz-inline-stack; + display: inline-block; + vertical-align: middle; + zoom: 1; + *display: inline; + background-color: #ffffff; + border: 1px solid #cccccc; + border-radius: 4px; + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; +} +.ke-input-text:focus { + border-color: #145ccd; + outline: 0; + -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(20, 92, 205, 0.6); + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(20, 92, 205, 0.6); + box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(20, 92, 205, 0.6); +} +.ke-input-number { + width: 50px; +} +.ke-input-color, +ke-dialog-content select { + border: 1px solid #cccccc; + background-color: #ffffff; + font-size: 12px; + width: 60px; + height: 20px; + line-height: 20px; + padding-left: 5px; + overflow: hidden; + cursor: pointer; + display: -moz-inline-stack; + display: inline-block; + vertical-align: middle; + zoom: 1; + *display: inline; +} +.ke-upload-button { + position: relative; +} +.ke-upload-area { + position: relative; + overflow: hidden; + margin: 0; + padding: 0; +} +.ke-upload-area .ke-upload-file { + position: absolute; + font-size: 60px; + top: 0; + right: 0; + padding: 0; + margin: 0; + z-index: 811212; + border: 0 none; + opacity: 0; + filter: alpha(opacity=0); +} +/* tabs */ +.ke-tabs { + font: 12px/1 "sans serif", tahoma, verdana, helvetica; + border-bottom: 1px solid #A0A0A0; + padding-left: 5px; + margin-bottom: 20px; +} +.ke-tabs-ul { + list-style-image: none; + list-style-position: outside; + list-style-type: none; + margin: 0; + padding: 0; +} +.ke-tabs-li { + position: relative; + border: 1px solid #A0A0A0; + background-color: #F0F0EE; + margin: 0 2px -1px 0; + padding: 0 20px; + float: left; + line-height: 25px; + text-align: center; + color: #555555; + cursor: pointer; +} +.ke-tabs-li-selected { + background-color: #FFF; + border-bottom: 1px solid #FFF; + color: #000; + cursor: default; +} +.ke-tabs-li-on { + background-color: #FFF; + color: #000; +} +/* progressbar */ +.ke-progressbar { + position: relative; + margin: 0; + padding: 0; +} +.ke-progressbar-bar { + border: 1px solid #6FA5DB; + width: 80px; + height: 5px; + margin: 10px 10px 0 10px; + padding: 0; +} +.ke-progressbar-bar-inner { + width: 0; + height: 5px; + background-color: #6FA5DB; + overflow: hidden; + margin: 0; + padding: 0; +} +.ke-progressbar-percent { + position: absolute; + top: 0; + left: 40%; + display: none; +} +/* swfupload */ +.ke-swfupload-top { + position: relative; + margin-bottom: 10px; + _width: 608px; +} +.ke-swfupload-button { + height: 23px; + line-height: 23px; +} +.ke-swfupload-desc { + padding: 0 10px; + height: 23px; + line-height: 23px; +} +.ke-swfupload-startupload { + position: absolute; + top: 0; + right: 0; +} +.ke-swfupload-body { + overflow: scroll; + background-color: #FFFFFF; + border: 1px solid #cccccc; + width: auto; + height: 370px; + padding: 5px; +} +.ke-swfupload-body .ke-item { + width: 100px; + margin: 5px; +} +.ke-swfupload-body .ke-photo { + position: relative; + border: 1px solid #DDDDDD; + background-color: #FFFFFF; + padding: 10px; +} +.ke-swfupload-body .ke-delete { + display: block; + background: url(default.png) no-repeat scroll 0 -688px; + width: 16px; + height: 16px; + position: absolute; + right: 0; + top: 0; + cursor: pointer; +} +.ke-swfupload-body .ke-status { + position: absolute; + left: 0; + bottom: 5px; + width: 100px; + height: 17px; +} +.ke-swfupload-body .ke-message { + width: 100px; + text-align: center; + overflow: hidden; + height: 17px; +} +.ke-swfupload-body .ke-error { + color: red; +} +.ke-swfupload-body .ke-name { + width: 100px; + text-align: center; + overflow: hidden; + height: 16px; +} +.ke-swfupload-body .ke-on { + border: 1px solid #5690D2; + background-color: #E9EFF6; +} +/* emoticons */ +.ke-plugin-emoticons { + position: relative; +} +.ke-plugin-emoticons .ke-preview { + position: absolute; + text-align: center; + margin: 2px; + padding: 10px; + top: 0; + border: 1px solid #A0A0A0; + background-color: #FFFFFF; + display: none; +} +.ke-plugin-emoticons .ke-preview-img { + border: 0; + margin: 0; + padding: 0; +} +.ke-plugin-emoticons .ke-table { + border: 0; + margin: 0; + padding: 0; + border-collapse: separate; +} +.ke-plugin-emoticons .ke-cell { + margin: 0; + padding: 1px; + border: 1px solid #F0F0EE; + cursor: pointer; +} +.ke-plugin-emoticons .ke-on { + border: 1px solid #5690D2; + background-color: #E9EFF6; +} +.ke-plugin-emoticons .ke-img { + display: block; + background-repeat: no-repeat; + overflow: hidden; + margin: 2px; + width: 24px; + height: 24px; + margin: 0; + padding: 0; + border: 0; +} +.ke-plugin-emoticons .ke-page { + text-align: right; + margin: 5px; + padding: 0; + border: 0; + font: 12px/1 "sans serif", tahoma, verdana, helvetica; + color: #333; + text-decoration: none; +} +.ke-plugin-plainpaste-textarea, +.ke-plugin-wordpaste-iframe { + display: block; + width: 408px; + height: 260px; + font-family: "sans serif", tahoma, verdana, helvetica; + font-size: 12px; + border: 1px solid #cccccc; +} +/* filemanager */ +.ke-plugin-filemanager-header { + width: 100%; + margin-bottom: 10px; +} +.ke-plugin-filemanager-header .ke-left { + float: left; +} +.ke-plugin-filemanager-header .ke-right { + float: right; +} +.ke-plugin-filemanager-body { + overflow: scroll; + background-color: #FFFFFF; + border: 1px solid #cccccc; + width: auto; + height: 370px; + padding: 5px; +} +.ke-plugin-filemanager-body .ke-item { + width: 100px; + margin: 5px; +} +.ke-plugin-filemanager-body .ke-photo { + border: 1px solid #DDDDDD; + background-color: #FFFFFF; + padding: 10px; +} +.ke-plugin-filemanager-body .ke-name { + width: 100px; + text-align: center; + overflow: hidden; + height: 16px; +} +.ke-plugin-filemanager-body .ke-on { + border: 1px solid #5690D2; + background-color: #E9EFF6; +} +.ke-plugin-filemanager-body .ke-table { + width: 95%; + border: 0; + margin: 0; + padding: 0; + border-collapse: separate; +} +.ke-plugin-filemanager-body .ke-table .ke-cell { + margin: 0; + padding: 0; + border: 0; +} +.ke-plugin-filemanager-body .ke-table .ke-name { + width: 55%; + text-align: left; +} +.ke-plugin-filemanager-body .ke-table .ke-size { + width: 15%; + text-align: left; +} +.ke-plugin-filemanager-body .ke-table .ke-datetime { + width: 30%; + text-align: center; +} diff --git a/docs/mindmap.html b/docs/mindmap.html index d4a906455..cbbfdd709 100644 --- a/docs/mindmap.html +++ b/docs/mindmap.html @@ -10,7 +10,7 @@ ZUI - + @@ -21,7 +21,7 @@ - + diff --git a/src/js/chart.line.js b/src/js/chart.line.js index 3766ac6ff..b4ef28f18 100644 --- a/src/js/chart.line.js +++ b/src/js/chart.line.js @@ -11,11 +11,11 @@ window.Chart = function(context){ var chart = this; - - + + //Easing functions adapted from Robert Penner's easing equations //http://www.robertpenner.com/easing/ - + var animationOptions = { linear : function (t){ return t; @@ -123,7 +123,7 @@ window.Chart = function(context){ return 1*((t=t/1-1)*t*((s+1)*t + s) + 1); }, easeInOutBack: function (t) { - var s = 1.70158; + var s = 1.70158; if ((t/=1/2) < 1) return 1/2*(t*t*(((s*=(1.525))+1)*t - s)); return 1/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2); }, @@ -161,129 +161,8 @@ window.Chart = function(context){ context.scale(window.devicePixelRatio, window.devicePixelRatio); } - // this.PolarArea = function(data,options){ - - // chart.PolarArea.defaults = { - // scaleOverlay : true, - // scaleOverride : false, - // scaleSteps : null, - // scaleStepWidth : null, - // scaleStartValue : null, - // scaleShowLine : true, - // scaleLineColor : "rgba(0,0,0,.1)", - // scaleLineWidth : 1, - // scaleShowLabels : true, - // scaleLabel : "<%=value%>", - // scaleFontFamily : "'Arial'", - // scaleFontSize : 12, - // scaleFontStyle : "normal", - // scaleFontColor : "#666", - // scaleShowLabelBackdrop : true, - // scaleBackdropColor : "rgba(255,255,255,0.75)", - // scaleBackdropPaddingY : 2, - // scaleBackdropPaddingX : 2, - // segmentShowStroke : true, - // segmentStrokeColor : "#fff", - // segmentStrokeWidth : 2, - // animation : true, - // animationSteps : 100, - // animationEasing : "easeOutBounce", - // animateRotate : true, - // animateScale : false, - // onAnimationComplete : null - // }; - - // var config = (options)? mergeChartConfig(chart.PolarArea.defaults,options) : chart.PolarArea.defaults; - - // return new PolarArea(data,config,context); - // }; - - // this.Radar = function(data,options){ - - // chart.Radar.defaults = { - // scaleOverlay : false, - // scaleOverride : false, - // scaleSteps : null, - // scaleStepWidth : null, - // scaleStartValue : null, - // scaleShowLine : true, - // scaleLineColor : "rgba(0,0,0,.1)", - // scaleLineWidth : 1, - // scaleShowLabels : false, - // scaleLabel : "<%=value%>", - // scaleFontFamily : "'Arial'", - // scaleFontSize : 12, - // scaleFontStyle : "normal", - // scaleFontColor : "#666", - // scaleShowLabelBackdrop : true, - // scaleBackdropColor : "rgba(255,255,255,0.75)", - // scaleBackdropPaddingY : 2, - // scaleBackdropPaddingX : 2, - // angleShowLineOut : true, - // angleLineColor : "rgba(0,0,0,.1)", - // angleLineWidth : 1, - // pointLabelFontFamily : "'Arial'", - // pointLabelFontStyle : "normal", - // pointLabelFontSize : 12, - // pointLabelFontColor : "#666", - // pointDot : true, - // pointDotRadius : 3, - // pointDotStrokeWidth : 1, - // datasetStroke : true, - // datasetStrokeWidth : 2, - // datasetFill : true, - // animation : true, - // animationSteps : 60, - // animationEasing : "easeOutQuart", - // onAnimationComplete : null - // }; - - // var config = (options)? mergeChartConfig(chart.Radar.defaults,options) : chart.Radar.defaults; - - // return new Radar(data,config,context); - // }; - - // this.Pie = function(data,options){ - // chart.Pie.defaults = { - // segmentShowStroke : true, - // segmentStrokeColor : "#fff", - // segmentStrokeWidth : 2, - // animation : true, - // animationSteps : 100, - // animationEasing : "easeOutBounce", - // animateRotate : true, - // animateScale : false, - // onAnimationComplete : null - // }; - - // var config = (options)? mergeChartConfig(chart.Pie.defaults,options) : chart.Pie.defaults; - - // return new Pie(data,config,context); - // }; - - // this.Doughnut = function(data,options){ - - // chart.Doughnut.defaults = { - // segmentShowStroke : true, - // segmentStrokeColor : "#fff", - // segmentStrokeWidth : 2, - // percentageInnerCutout : 50, - // animation : true, - // animationSteps : 100, - // animationEasing : "easeOutBounce", - // animateRotate : true, - // animateScale : false, - // onAnimationComplete : null - // }; - - // var config = (options)? mergeChartConfig(chart.Doughnut.defaults,options) : chart.Doughnut.defaults; - - // return new Doughnut(data,config,context); - - // }; - this.Line = function(data,options){ - + chart.Line.defaults = { scaleOverlay : false, scaleOverride : false, @@ -312,490 +191,26 @@ window.Chart = function(context){ animationSteps : 30, animationEasing : "easeOutQuart", onAnimationComplete : null - }; + }; var config = (options) ? mergeChartConfig(chart.Line.defaults,options) : chart.Line.defaults; - + return new Line(data,config,context); } - - // this.Bar = function(data,options){ - // chart.Bar.defaults = { - // scaleOverlay : false, - // scaleOverride : false, - // scaleSteps : null, - // scaleStepWidth : null, - // scaleStartValue : null, - // scaleLineColor : "rgba(0,0,0,.1)", - // scaleLineWidth : 1, - // scaleShowLabels : true, - // scaleLabel : "<%=value%>", - // scaleFontFamily : "'Arial'", - // scaleFontSize : 12, - // scaleFontStyle : "normal", - // scaleFontColor : "#666", - // scaleShowGridLines : true, - // scaleGridLineColor : "rgba(0,0,0,.05)", - // scaleGridLineWidth : 1, - // barShowStroke : true, - // barStrokeWidth : 2, - // barValueSpacing : 5, - // barDatasetSpacing : 1, - // animation : true, - // animationSteps : 60, - // animationEasing : "easeOutQuart", - // onAnimationComplete : null - // }; - // var config = (options) ? mergeChartConfig(chart.Bar.defaults,options) : chart.Bar.defaults; - - // return new Bar(data,config,context); - // } - + var clear = function(c){ c.clearRect(0, 0, width, height); }; - // var PolarArea = function(data,config,ctx){ - // var maxSize, scaleHop, calculatedScale, labelHeight, scaleHeight, valueBounds, labelTemplateString; - - - // calculateDrawingSizes(); - - // valueBounds = getValueBounds(); - - // labelTemplateString = (config.scaleShowLabels)? config.scaleLabel : null; - - // //Check and set the scale - // if (!config.scaleOverride){ - - // calculatedScale = calculateScale(scaleHeight,valueBounds.maxSteps,valueBounds.minSteps,valueBounds.maxValue,valueBounds.minValue,labelTemplateString); - // } - // else { - // calculatedScale = { - // steps : config.scaleSteps, - // stepValue : config.scaleStepWidth, - // graphMin : config.scaleStartValue, - // labels : [] - // } - // populateLabels(labelTemplateString, calculatedScale.labels,calculatedScale.steps,config.scaleStartValue,config.scaleStepWidth); - // } - - // scaleHop = maxSize/(calculatedScale.steps); - - // //Wrap in an animation loop wrapper - // animationLoop(config,drawScale,drawAllSegments,ctx); - - // function calculateDrawingSizes(){ - // maxSize = (Min([width,height])/2); - // //Remove whatever is larger - the font size or line width. - - // maxSize -= Max([config.scaleFontSize*0.5,config.scaleLineWidth*0.5]); - - // labelHeight = config.scaleFontSize*2; - // //If we're drawing the backdrop - add the Y padding to the label height and remove from drawing region. - // if (config.scaleShowLabelBackdrop){ - // labelHeight += (2 * config.scaleBackdropPaddingY); - // maxSize -= config.scaleBackdropPaddingY*1.5; - // } - - // scaleHeight = maxSize; - // //If the label height is less than 5, set it to 5 so we don't have lines on top of each other. - // labelHeight = Default(labelHeight,5); - // } - // function drawScale(){ - // for (var i=0; i upperValue) {upperValue = data[i].value;} - // if (data[i].value < lowerValue) {lowerValue = data[i].value;} - // }; - - // var maxSteps = Math.floor((scaleHeight / (labelHeight*0.66))); - // var minSteps = Math.floor((scaleHeight / labelHeight*0.5)); - - // return { - // maxValue : upperValue, - // minValue : lowerValue, - // maxSteps : maxSteps, - // minSteps : minSteps - // }; - - - // } - // } - - // var Radar = function (data,config,ctx) { - // var maxSize, scaleHop, calculatedScale, labelHeight, scaleHeight, valueBounds, labelTemplateString; - - // //If no labels are defined set to an empty array, so referencing length for looping doesn't blow up. - // if (!data.labels) data.labels = []; - - // calculateDrawingSizes(); - - // var valueBounds = getValueBounds(); - - // labelTemplateString = (config.scaleShowLabels)? config.scaleLabel : null; - - // //Check and set the scale - // if (!config.scaleOverride){ - - // calculatedScale = calculateScale(scaleHeight,valueBounds.maxSteps,valueBounds.minSteps,valueBounds.maxValue,valueBounds.minValue,labelTemplateString); - // } - // else { - // calculatedScale = { - // steps : config.scaleSteps, - // stepValue : config.scaleStepWidth, - // graphMin : config.scaleStartValue, - // labels : [] - // } - // populateLabels(labelTemplateString, calculatedScale.labels,calculatedScale.steps,config.scaleStartValue,config.scaleStepWidth); - // } - - // scaleHop = maxSize/(calculatedScale.steps); - - // animationLoop(config,drawScale,drawAllDataPoints,ctx); - - // //Radar specific functions. - // function drawAllDataPoints(animationDecimal){ - // var rotationDegree = (2*Math.PI)/data.datasets[0].data.length; - - // ctx.save(); - // //translate to the centre of the canvas. - // ctx.translate(width/2,height/2); - - // //We accept multiple data sets for radar charts, so show loop through each set - // for (var i=0; i Math.PI){ - // ctx.textAlign = "right"; - // } - // else{ - // ctx.textAlign = "left"; - // } - - // ctx.textBaseline = "middle"; - - // ctx.fillText(data.labels[k],opposite,-adjacent); - - // } - // ctx.restore(); - // }; - // function calculateDrawingSizes(){ - // maxSize = (Min([width,height])/2); - - // labelHeight = config.scaleFontSize*2; - - // var labelLength = 0; - // for (var i=0; ilabelLength) labelLength = textMeasurement; - // } - - // //Figure out whats the largest - the height of the text or the width of what's there, and minus it from the maximum usable size. - // maxSize -= Max([labelLength,((config.pointLabelFontSize/2)*1.5)]); - - // maxSize -= config.pointLabelFontSize; - // maxSize = CapValue(maxSize, null, 0); - // scaleHeight = maxSize; - // //If the label height is less than 5, set it to 5 so we don't have lines on top of each other. - // labelHeight = Default(labelHeight,5); - // }; - // function getValueBounds() { - // var upperValue = Number.MIN_VALUE; - // var lowerValue = Number.MAX_VALUE; - - // for (var i=0; i upperValue){upperValue = data.datasets[i].data[j]} - // if (data.datasets[i].data[j] < lowerValue){lowerValue = data.datasets[i].data[j]} - // } - // } - - // var maxSteps = Math.floor((scaleHeight / (labelHeight*0.66))); - // var minSteps = Math.floor((scaleHeight / labelHeight*0.5)); - - // return { - // maxValue : upperValue, - // minValue : lowerValue, - // maxSteps : maxSteps, - // minSteps : minSteps - // }; - - - // } - // } - - // var Pie = function(data,config,ctx){ - // var segmentTotal = 0; - - // //In case we have a canvas that is not a square. Minus 5 pixels as padding round the edge. - // var pieRadius = Min([height/2,width/2]) - 5; - - // for (var i=0; i 0){ ctx.save(); ctx.textAlign = "right"; @@ -884,26 +299,26 @@ window.Chart = function(context){ // ctx.fillText(data.labels[i], 0,0); // ctx.restore(); // } - + // else{ - // ctx.fillText(data.labels[i], yAxisPosX + i*valueHop,xAxisPosY + config.scaleFontSize+3); + // ctx.fillText(data.labels[i], yAxisPosX + i*valueHop,xAxisPosY + config.scaleFontSize+3); // } ctx.beginPath(); ctx.moveTo(yAxisPosX + i * valueHop, xAxisPosY+3); - + //Check i isnt 0, so we dont go over the Y axis twice. if(config.scaleShowGridLines && i>0){ ctx.lineWidth = config.scaleGridLineWidth; - ctx.strokeStyle = config.scaleGridLineColor; + ctx.strokeStyle = config.scaleGridLineColor; ctx.lineTo(yAxisPosX + i * valueHop, 5); } else{ - ctx.lineTo(yAxisPosX + i * valueHop, xAxisPosY+3); + ctx.lineTo(yAxisPosX + i * valueHop, xAxisPosY+3); } ctx.stroke(); } - + //Y axis ctx.lineWidth = config.scaleLineWidth; ctx.strokeStyle = config.scaleLineColor; @@ -911,7 +326,7 @@ window.Chart = function(context){ // ctx.moveTo(yAxisPosX,xAxisPosY+5); // ctx.lineTo(yAxisPosX,5); // ctx.stroke(); - + ctx.textAlign = "right"; ctx.textBaseline = "middle"; for (var j=0; j 0){ - // ctx.save(); - // ctx.textAlign = "right"; - // } - // else{ - // ctx.textAlign = "center"; - // } - // ctx.fillStyle = config.scaleFontColor; - // for (var i=0; i 0){ - // ctx.translate(yAxisPosX + i*valueHop,xAxisPosY + config.scaleFontSize); - // ctx.rotate(-(rotateLabels * (Math.PI/180))); - // ctx.fillText(data.labels[i], 0,0); - // ctx.restore(); - // } - - // else{ - // ctx.fillText(data.labels[i], yAxisPosX + i*valueHop + valueHop/2,xAxisPosY + config.scaleFontSize+3); - // } - - // ctx.beginPath(); - // ctx.moveTo(yAxisPosX + (i+1) * valueHop, xAxisPosY+3); - - // //Check i isnt 0, so we dont go over the Y axis twice. - // ctx.lineWidth = config.scaleGridLineWidth; - // ctx.strokeStyle = config.scaleGridLineColor; - // ctx.lineTo(yAxisPosX + (i+1) * valueHop, 5); - // ctx.stroke(); - // } - - // //Y axis - // ctx.lineWidth = config.scaleLineWidth; - // ctx.strokeStyle = config.scaleLineColor; - // ctx.beginPath(); - // ctx.moveTo(yAxisPosX,xAxisPosY+5); - // ctx.lineTo(yAxisPosX,5); - // ctx.stroke(); - - // ctx.textAlign = "right"; - // ctx.textBaseline = "middle"; - // for (var j=0; j longestText)? measuredText : longestText; - // } - // //Add a little extra padding from the y axis - // longestText +=10; - // } - // xAxisLength = width - longestText - widestXLabel; - // valueHop = Math.floor(xAxisLength/(data.labels.length)); - - // barWidth = (valueHop - config.scaleGridLineWidth*2 - (config.barValueSpacing*2) - (config.barDatasetSpacing*data.datasets.length-1) - ((config.barStrokeWidth/2)*data.datasets.length-1))/data.datasets.length; - - // yAxisPosX = width-widestXLabel/2-xAxisLength; - // xAxisPosY = scaleHeight + config.scaleFontSize/2; - // } - // function calculateDrawingSizes(){ - // maxSize = height; - - // //Need to check the X axis first - measure the length of each text metric, and figure out if we need to rotate by 45 degrees. - // ctx.font = config.scaleFontStyle + " " + config.scaleFontSize+"px " + config.scaleFontFamily; - // widestXLabel = 1; - // for (var i=0; i widestXLabel)? textLength : widestXLabel; - // } - // if (width/data.labels.length < widestXLabel){ - // rotateLabels = 45; - // if (width/data.labels.length < Math.cos(rotateLabels) * widestXLabel){ - // rotateLabels = 90; - // maxSize -= widestXLabel; - // } - // else{ - // maxSize -= Math.sin(rotateLabels) * widestXLabel; - // } - // } - // else{ - // maxSize -= config.scaleFontSize; - // } - - // //Add a little padding between the x line and the text - // maxSize -= 5; - - - // labelHeight = config.scaleFontSize; - - // maxSize -= labelHeight; - // //Set 5 pixels greater than the font size to allow for a little padding from the X axis. - - // scaleHeight = maxSize; - - // //Then get the area above we can safely draw on. - - // } - // function getValueBounds() { - // var upperValue = Number.MIN_VALUE; - // var lowerValue = Number.MAX_VALUE; - // for (var i=0; i upperValue) { upperValue = data.datasets[i].data[j] }; - // if ( data.datasets[i].data[j] < lowerValue) { lowerValue = data.datasets[i].data[j] }; - // } - // }; - - // var maxSteps = Math.floor((scaleHeight / (labelHeight*0.66))); - // var minSteps = Math.floor((scaleHeight / labelHeight*0.5)); - - // return { - // maxValue : upperValue, - // minValue : lowerValue, - // maxSteps : maxSteps, - // minSteps : minSteps - // }; - - - // } - // } - + function calculateOffset(val,calculatedScale,scaleHop){ var outerValue = calculatedScale.steps * calculatedScale.stepValue; var adjustedValue = val - calculatedScale.graphMin; var scalingFactor = CapValue(adjustedValue/outerValue,1,0); return (scaleHop*calculatedScale.steps) * scalingFactor; } - + function animationLoop(config,drawScale,drawData,ctx){ var animFrameAmount = (config.animation)? 1/CapValue(config.animationSteps,Number.MAX_VALUE,1) : 1, easingFunction = animationOptions[config.animationEasing], percentAnimComplete =(config.animation)? 0 : 1; - - - + + + if (typeof drawScale !== "function") drawScale = function(){}; - + requestAnimFrame(animLoop); - + function animateFrame(){ var easeAdjustedAnimationPercent =(config.animation)? CapValue(easingFunction(percentAnimComplete),null,0) : 1; clear(ctx); @@ -1228,12 +437,12 @@ window.Chart = function(context){ } else { drawScale(); drawData(easeAdjustedAnimationPercent); - } + } } function animLoop(){ //We need to check if the animation is incomplete (less than 1), or complete (1). percentAnimComplete += animFrameAmount; - animateFrame(); + animateFrame(); //Stop the loop continuing forever if (percentAnimComplete <= 1){ requestAnimFrame(animLoop); @@ -1241,14 +450,14 @@ window.Chart = function(context){ else{ if (typeof config.onAnimationComplete == "function") config.onAnimationComplete(); } - - } - + + } + } //Declare global functions to be called within this namespace here. - - + + // shim layer with setTimeout fallback var requestAnimFrame = (function(){ return window.requestAnimationFrame || @@ -1263,22 +472,22 @@ window.Chart = function(context){ function calculateScale(drawingHeight,maxSteps,minSteps,maxValue,minValue,labelTemplateString){ var graphMin,graphMax,graphRange,stepValue,numberOfSteps,valueRange,rangeOrderOfMagnitude,decimalNum; - + valueRange = maxValue - minValue; - + rangeOrderOfMagnitude = calculateOrderOfMagnitude(valueRange); graphMin = Math.floor(minValue / (1 * Math.pow(10, rangeOrderOfMagnitude))) * Math.pow(10, rangeOrderOfMagnitude); - + graphMax = Math.ceil(maxValue / (1 * Math.pow(10, rangeOrderOfMagnitude))) * Math.pow(10, rangeOrderOfMagnitude); - + graphRange = graphMax - graphMin; - + stepValue = Math.pow(10, rangeOrderOfMagnitude); - + numberOfSteps = Math.round(graphRange / stepValue); - - //Compare number of steps to the max and min for that size graph, and add in half steps if need be. + + //Compare number of steps to the max and min for that size graph, and add in half steps if need be. while(numberOfSteps < minSteps || numberOfSteps > maxSteps) { if (numberOfSteps < minSteps){ stepValue /= 2; @@ -1292,18 +501,18 @@ window.Chart = function(context){ var labels = []; populateLabels(labelTemplateString, labels, numberOfSteps, graphMin, stepValue); - + return { steps : numberOfSteps, stepValue : stepValue, graphMin : graphMin, - labels : labels - + labels : labels + } - + function calculateOrderOfMagnitude(val){ return Math.floor(Math.log(val) / Math.LN10); - } + } } @@ -1317,7 +526,7 @@ window.Chart = function(context){ } } } - + //Max value from array function Max( array ){ return Math.max.apply( Math, array ); @@ -1360,34 +569,34 @@ window.Chart = function(context){ else{ return 0; } - - } - + + } + function mergeChartConfig(defaults,userDefined){ var returnObj = {}; for (var attrname in defaults) { returnObj[attrname] = defaults[attrname]; } for (var attrname in userDefined) { returnObj[attrname] = userDefined[attrname]; } return returnObj; } - + //Javascript micro templating by John Resig - source at http://ejohn.org/blog/javascript-micro-templating/ var cache = {}; - + function tmpl(str, data){ // Figure out if we're getting a template, or if we need to // load the template - and be sure to cache the result. var fn = !/\W/.test(str) ? cache[str] = cache[str] || tmpl(document.getElementById(str).innerHTML) : - + // Generate a reusable function that will serve as a template // generator (and which will be cached). new Function("obj", "var p=[],print=function(){p.push.apply(p,arguments);};" + - + // Introduce the data as local variables using with(){} "with(obj){p.push('" + - + // Convert the template into pure JavaScript str .replace(/[\r\t\n]/g, " ") @@ -1398,7 +607,7 @@ window.Chart = function(context){ .split("%>").join("p.push('") .split("\r").join("\\'") + "');}return p.join('');"); - + // Provide some basic currying to the user return data ? fn( data ) : fn; }; diff --git a/src/less/kindeditor-default.less b/src/less/kindeditor-theme.default.less similarity index 100% rename from src/less/kindeditor-default.less rename to src/less/kindeditor-theme.default.less -- GitLab