diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/.gitignore b/resources/library/applications/Calculator.wgt/Calculator.wgt/.gitignore new file mode 100644 index 00000000..b512c09d --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/Gruntfile.js b/resources/library/applications/Calculator.wgt/Calculator.wgt/Gruntfile.js new file mode 100644 index 00000000..f7fc6480 --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/Gruntfile.js @@ -0,0 +1,33 @@ +module.exports = function (grunt) { + + var baseSrc = 'js/src'; + + grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + + grunt.initConfig({ + uglify: { + options: { + separator: ';' + }, + compile: { + src: [ + baseSrc + '/Sankore/klass.js', + baseSrc + '/**/*.js' + ], + dest: 'dist/calculator.js' + } + }, + watch: { + scripts: { + files: 'js/src/**/*.js', + tasks: ['scripts:dist'] + } + } + }); + + grunt.registerTask('default', ['dist', 'watch']); + grunt.registerTask('dist', ['scripts:dist']); + + grunt.registerTask('scripts:dist', ['uglify:compile']); +}; \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/config.xml b/resources/library/applications/Calculator.wgt/Calculator.wgt/config.xml new file mode 100644 index 00000000..53510bd4 --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/config.xml @@ -0,0 +1,14 @@ + + + Calculator + + diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/css/calculator.css b/resources/library/applications/Calculator.wgt/Calculator.wgt/css/calculator.css new file mode 100644 index 00000000..62a93e3f --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/css/calculator.css @@ -0,0 +1,380 @@ +* { + margin: 0; + padding: 0; +} +body { + font-size: 12px; + margin:0; +} +.calculator { + -webkit-user-select: none; + font-family: Verdana; + background: -webkit-linear-gradient(top, #f6f6f6 0%, #f7f7f7 25%, #f4f4f4 25%, #e8e8e8 100%); + background: linear-gradient(to bottom, #f6f6f6 0%, #f7f7f7 25%, #f4f4f4 25%, #e8e8e8 100%); + padding: 1em; + width: auto; + border-radius: 0.66em; + border: 1px solid #bbb; + margin: 0.33em; + box-shadow: 0.16em 0.16em 0.46em rgba(0, 0, 0, 0.35), inset 0 0 0.45em rgba(0, 0, 0, 0.3); +} +.calculator .title { + font-weight:bold; + color:#333; + text-shadow:0 1px 1px rgba(0, 0, 0, 0.2); + display:block; + margin-top: -1.1em; + margin-right:25%; + top: 0.4em; + position:relative; +} +.calculator .controls { + float: right; + margin: -1.3em 0.2em 0.25em 0; +} +.calculator .controls button { + background: -webkit-linear-gradient(top, #666666 0%, #444444 100%); + background: linear-gradient(to bottom, #666666 0%, #444444 100%); + padding: 0.12em 0.5em; + border: none; + color: white; + outline: none; + text-shadow: 0 -1px 0 black; + border-radius: 0 0 0.25em 0.25em; + box-shadow: inset 0 -1px 1px #000000, 0 1px 1px rgba(0, 0, 0, 0.5); +} +.calculator .controls button + button { + margin-left:2px; +} +.calculator .controls button:active { + background: -webkit-linear-gradient(bottom, #666666 0%, #444444 100%); + background: linear-gradient(to top, #666666 0%, #444444 100%); + box-shadow: inset 0 -1px 3px #000000; + color: #cccccc; +} +.calculator table { + table-layout: fixed; + line-height:90%; + width: 100%; + border-collapse: separate; + border-spacing: 1px; +} +.calculator .screen td { + height: 1px; +} +.calculator .screen ul { + height: 100%; + cursor: default; + box-sizing: border-box; + margin-bottom: 0.8rem; + padding: 0.4rem; + font-size: 1.5em; + line-height: normal; + text-shadow: 0 1px 1px #ffffff; + color: #444f53; + background: -webkit-linear-gradient(top, #f6f8f9 0%, #d2edf2 70%, #c9e3e7 70%, #d4eff4 100%); + background: linear-gradient(to bottom, #f6f8f9 0%, #d2edf2 70%, #c9e3e7 70%, #d4eff4 100%); + border: 1px solid #d3d3d3; + border-top-color: #d0d0d0; + border-left-color: #d0d0d0; + border-radius: 0.33rem; + box-shadow: 0 0 0.4rem #ffffff, inset 0.15rem 0.15rem 0.4rem rgba(21, 39, 54, 0.5); +} +.calculator .screen li { + list-style-type: none; +} +.calculator .screen .expression-row .caret { + border-left: 1px solid #444f53; + box-sizing: border-box; + margin-right: -1px; + -webkit-animation-name: blinker; + -webkit-animation-duration: 1.2s; + -webkit-animation-timing-function: linear; + -webkit-animation-iteration-count: infinite; + animation-name: blinker; + animation-duration: 1.2s; + animation-timing-function: linear; + animation-iteration-count: infinite; +} +@-webkit-keyframes blinker { + 0% { + opacity: 1.0; + } + 40% { + opacity: 1.0; + } + 50% { + opacity: 0.0; + } + 90% { + opacity: 0.0; + } +} +@keyframes blinker { + 0% { + opacity: 1.0; + } + 40% { + opacity: 1.0; + } + 50% { + opacity: 0.0; + } + 90% { + opacity: 0.0; + } +} +.calculator .screen .flag-row { + font-size: 0.6em; + min-height: 15px; + overflow: hidden; +} +.calculator .screen .flag-row span { + margin-right:0.3em; + display: inline-block; +} +.calculator .screen .result-row { + min-height: 38px; + font-size: 1.6em; + text-align: right; +} +.calculator .screen .result-row .error { + color: #4b2525; +} +.calculator .screen .euclidean { + font-size: 0.8em; +} +.calculator .screen .euclidean span { + border-bottom: 1px solid #444f53; + position: relative; + margin-bottom: 0.5rem; + display: block; + float: right; +} +.calculator .screen .euclidean .remainder { + margin-left: 0.5em; +} +.calculator .screen .euclidean span:before { + font-size: 0.4em; + display: block; + position: absolute; + bottom: -1em; + width: 100%; + text-align: center; +} +.calculator .screen .euclidean .quotient:before { + content: 'q'; +} +.calculator .screen .euclidean .remainder:before { + content: 'r'; +} +.calculator .screen .front-screen ul { + overflow: hidden; +} +.calculator .screen .front-screen .expression-row { + min-height: 22px; + max-height: 22px; + white-space: nowrap; +} +.calculator .screen .rear-screen { + width: 50%; +} +.calculator .screen .rear-screen ul { + -webkit-user-select: initial; + height: 103.5%; + margin-right: 0.8rem; + margin-bottom: 0; + font-size: 1.3em; + background: -webkit-linear-gradient(top, #3b474f 0%, #131f21 51%, #0d1516 100%); + background: linear-gradient(to bottom, #3b474f 0%, #131f21 51%, #0d1516 100%); + box-shadow: 0 0 0.4rem #ffffff, inset 0.15rem 0.15rem 0.4rem rgba(21, 39, 54, 0.8); + text-shadow: 0 -1px 1px #000000; + color: #cbe7f4; + overflow-y: scroll; +} +.calculator .screen .rear-screen .expression-row { + word-wrap:break-word; +} +.calculator .screen .rear-screen .euclidian span:before { + font-size: 0.6em; +} +.calculator .edit-area { + height: 100%; + margin-right: 0.8rem; + margin-bottom: 0; + font-size: 1em; + position: relative; +} +.calculator .edit-area hr { + margin: 0.7em 0 0.5em 0; + border: none; + border-top: 1px solid #d0d0d0; + border-bottom: 1px solid #fcfcfc; +} +.calculator .edit-area select { + width: 100%; +} +.calculator .edit-area button.small { + float: right; + width: 9.13%; + height:20px; + padding: 0; + font-size:0; + position:relative; +} +.calculator .edit-area button.small:before { + position: absolute; + display: block; + height:100%; + width: 100%; + font-size:16px; + top: 0; + left: 0; + font-weight:bold; +} +.calculator .edit-area button.small.add:before { + content: '+'; +} +.calculator .edit-area button.small.remove:before { + content: '-'; +} +.calculator .edit-area button.small + button.small { + margin-right:0.4rem; +} +.calculator .edit-area select.layout-select { + width: 74.77%; +} +.calculator .edit-area label { + width: 100%; + display: block; + color: #555555; + margin: 0.7em 0 0.5em 0; +} +.calculator .edit-area input[type=text], +.calculator .edit-area textarea { + display: block; + box-sizing: border-box; + width: 100%; + border: 1px solid #d0d0d0; + font-size: 1em; + font-family: Verdana; + border-radius: 3px; + padding: 4px 2px; + box-shadow: inset 0.1em 0.1em 0.2em rgba(0, 0, 0, 0.2); + resize: none; +} +.calculator .edit-area input[type=text][disabled], +.calculator .edit-area textarea[disabled] { + background-color: #eeeeee; + color: #555555; +} +.calculator .edit-area .assignation { + margin-top: 1em; + border: 1px solid #d0d0d0; + padding: 0.5em; + box-shadow: inset 0 0 0.5em rgba(255, 255, 255, 1); + border-radius: 3px; +} +.calculator .edit-area .assignation em { + font-size: 1.1em; + line-height: 1.1em; + color: #555555; + text-align: center; + display: block; +} +.calculator .edit-area .assignation label:first-child { + margin-top: 0; +} +.calculator .edit-area .assignation .help { + display: block; + margin-top: 0.3em; + font-size: 0.9em; + color: #777777; +} +.calculator .edit-area .run { + display: block; + width: 100%; + position: absolute; + padding: 0.5em 0; + bottom: 0; + font-weight: bold; + outline: 0; +} +.calculator .buttons td { + padding: 0; + margin: 0; +} +.calculator .buttons button { + outline: 0; + font-family: Verdana; + font-size: 1.2em; + font-weight: 500; + color: #555555; + background: -webkit-linear-gradient(bottom, #eeeeee 0%, #fdfdfd 100%); + background: linear-gradient(to top, #eeeeee 0%, #fdfdfd 100%); + border: 0.4em solid #ffffff; + border-top-width: 0.3em; + border-bottom-width: 0.5em; + border-bottom-color: #eeeeee; + border-right-color: #eeeeee; + border-radius: 0.33rem; + box-shadow: 0.2em 0.2em 0.2em 0.1em rgba(0, 0, 0, 0.2); + box-sizing: border-box; + display: block; + width: 100%; + height: 2.4rem; + padding: 0; + margin: 0; +} +.calculator .buttons button:hover { + color: #29a0b5; + background: -webkit-linear-gradient(bottom, #d0ecf0 0%, #ffffff 100%); + background: linear-gradient(to top, #d0ecf0 0%, #ffffff 100%); + border-bottom-color: #d0ecf0; + border-right-color: #d0ecf0; +} +.calculator .buttons button:active { + font-size: 1.1em; + color: #29a0b5; + border: 1px solid #cccccc; + background: -webkit-linear-gradient(bottom, #d0ecf0 0%, #ffffff 100%); + background: linear-gradient(to top, #d0ecf0 0%, #ffffff 100%); + box-shadow: inset 0 0 0.5em 0.2em rgba(0, 0, 0, 0.1), 0.1em 0.1em 0.2em #ffffff; +} +.calculator .buttons .alt button { + color: #2b8eac; + font-weight: bold; +} +.calculator .buttons .edit button { + border:1px solid #aac3b2; + box-shadow: inset 0 0 1.5em 0.2em rgba(48, 114, 71, 0.3); + color: #678d74; +} +.calculator .buttons .danger button { + font-weight: bold; +} +.calculator .buttons .danger button:hover { + color: #cc5d54; + background: -webkit-linear-gradient(bottom, #f0dad0 0%, #ffffff 100%); + background: linear-gradient(to top, #f0dad0 0%, #ffffff 100%); + border-bottom-color: #f0dad0; + border-right-color: #f0dad0; +} +.calculator .buttons .danger button:active { + color: #cc5d54; + background: -webkit-linear-gradient(bottom, #f0dad0 0%, #ffffff 100%); + background: linear-gradient(to top, #f0dad0 0%, #ffffff 100%); +} +.calculator .buttons button[disabled] { + background: inherit; + box-shadow: 0.1em 0.1em 0.2em #ffffff; + border: 1px solid #cccccc; + color: #cccccc; +} +.calculator .buttons button[disabled]:hover { + background: inherit; + box-shadow: 0.1em 0.1em 0.2em #ffffff; +} +.calculator .buttons button[disabled]:active { + font-size: 1.2em; +} \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/dist/calculator.js b/resources/library/applications/Calculator.wgt/Calculator.wgt/dist/calculator.js new file mode 100644 index 00000000..10bcb8cd --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/dist/calculator.js @@ -0,0 +1,2 @@ +!function(){"use strict";Function.prototype.bind||(Function.prototype.bind=function(a){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var b=Array.prototype.slice.call(arguments,1),c=this,d=function(){},e=function(){return c.apply(this instanceof d&&a?this:a,b.concat(Array.prototype.slice.call(arguments)))};return d.prototype=this.prototype,e.prototype=new d,e}),window.klass={create:function(){var a=Object.create(this);return"function"==typeof a.constructor&&a.constructor.apply(a,arguments),a},extend:function(a){var b=Object.create(this);return a?(Object.keys(a).forEach(function(c){b[c]=a[c]}),b):b},define:function(a,b,c){var d=function(a,b){var c,e=a.split(".");return e.length>0?(c=e.shift(),"undefined"==typeof b[c]&&(b[c]={}),e.length>0?d(e.join("."),b[c]):b[c]):null},e=d(a,window);e[b]=c}}}(),function(){"use strict";klass.define("Sankore","Button",klass.extend({constructor:function(a,b,c,d){this.text=a,this.command=b,this.useLimit="undefined"==typeof c?-1:c,this.editable="undefined"==typeof d?!0:d},isEditable:function(){return this.editable},isUsable:function(){return-1===this.useLimit},isDisabled:function(){return 0===this.useLimit},clone:function(){return Sankore.Button.create(this.text,this.command,this.useLimit,this.editable)}}))}(),function(){"use strict";klass.define("Sankore","Calculator",klass.extend({constructor:function(a,b){Sankore.Util.i18n.load(b.locale||"en"),this.currentLayout=null,this.lastError=null,this.memory=null,this.op=null,this.output=null,this.history=[],this.buttonUseCount={},this.expressionString="",this.unpredictable=b.unpredictableMode||!1,this.eventDispatcher=Sankore.Util.EventDispatcher.create(),this.commands=Sankore.Util.Hash.create(),this.texts=Sankore.Util.Hash.create(),this.calculusEngine=Sankore.Calculus.Engine.create(),this.keystrokeLine=Sankore.KeystrokeLine.create(this.eventDispatcher),this.ui=Sankore.UI.MainInterface.create(a,this.eventDispatcher,this.texts,this.unpredictable),this.editor=Sankore.Editor.Editor.create(this),"undefined"!=typeof b.ready&&this.eventDispatcher.addEventListener("calculator.create",b.ready.bind(this));var c=Sankore.Text.create.bind(Sankore.Text);this.texts.add("id",[c("0","0","0"),c("1","1","1"),c("2","2","2"),c("3","3","3"),c("4","4","4"),c("5","5","5"),c("6","6","6"),c("7","7","7"),c("8","8","8"),c("9","9","9"),c("+","+","+","alt"),c("-","-","-","alt"),c("*","×","×","alt"),c("/","÷","÷","alt"),c(":","⊢","⊢","alt"),c("=","=","=","alt"),c(".",_("text.comma"),_("text.comma")),c("(","(","("),c(")",")",")"),c("op","OP","OP"),c("mr","MR","MR"),c("mc","MC","MC"),c("m+","M+","M+"),c("m-","M-","M-"),c("s","",_("text.del"),"alt",!1),c("l","","←","alt",!1),c("r","","→","alt",!1),c("c","","C","danger",!1)]),c=Sankore.Command.create.bind(Sankore.Command),this.commands.add("id",[c("0",_("command.zero"),function(){this.expressionString+="0"}),c("1",_("command.one"),function(){this.expressionString+="1"}),c("2",_("command.two"),function(){this.expressionString+="2"}),c("3",_("command.three"),function(){this.expressionString+="3"}),c("4",_("command.four"),function(){this.expressionString+="4"}),c("5",_("command.five"),function(){this.expressionString+="5"}),c("6",_("command.six"),function(){this.expressionString+="6"}),c("7",_("command.seven"),function(){this.expressionString+="7"}),c("8",_("command.eight"),function(){this.expressionString+="8"}),c("9",_("command.nine"),function(){this.expressionString+="9"}),c("+",_("command.plus"),function(){this.expressionString+="+"}),c("-",_("command.minus"),function(){this.expressionString+="-"}),c("*",_("command.times"),function(){this.expressionString+="*"}),c("/",_("command.divide"),function(){this.expressionString+="/"}),c(":",_("command.euclidean_divide"),function(){this.expressionString+=":"}),Sankore.InterruptingCommand.create("=",_("command.equal"),function(){this.evaluateStack()}),c(".",_("command.comma"),function(){this.expressionString+="."}),c("(",_("command.open_parenthesis"),function(){this.expressionString+="("}),c(")",_("command.close_parenthesis"),function(){this.expressionString+=")"}),Sankore.InterruptingCommand.create("op",_("command.op"),function(){if(null===this.op){if(this.expressionString.length>1&&-1!=="+-*/:".indexOf(this.expressionString[0]))try{this.calculusEngine.evaluate("(1)"+this.expressionString).getValue(),this.op=this.expressionString,this.eventDispatcher.notify("calculator.op_changed",this.op)}catch(a){}this.expressionString="",this.output=null}else 0===this.expressionString.length&&null!==this.output&&(this.expressionString="("+this.output.toString()+")"),this.expressionString+=this.op,this.execCommand("=")}),Sankore.InterruptingCommand.create("memoryAdd",_("command.memory_add"),function(){this.execCommand("=");try{null===this.memory&&(this.memory=0),this.memory+=this.output.getValue()}catch(a){this.memory=null}this.eventDispatcher.notify("calculator.memory_changed",this.memory)}),Sankore.InterruptingCommand.create("memorySub",_("command.memory_sub"),function(){this.execCommand("=");try{null===this.memory&&(this.memory=0),this.memory-=this.output.getValue()}catch(a){this.memory=null}this.eventDispatcher.notify("calculator.memory_changed",this.memory)}),c("memoryRecall",_("command.memory_recall"),function(){null!==this.memory&&(this.expressionString+="("+this.memory.toString()+")")}),c("memoryClear",_("command.memory_clear"),function(){this.memory=null,this.eventDispatcher.notify("calculator.memory_changed",this.memory)}),Sankore.InternalCommand.create("clear",_("command.clear"),function(){this.reset(),this.eventDispatcher.notify("calculator.memory_changed",this.memory),this.eventDispatcher.notify("calculator.op_changed",this.op),this.eventDispatcher.notify("calculator.output_changed",{output:this.output,error:this.lastError})}),Sankore.InternalCommand.create("left",_("command.left"),function(){this.keystrokeLine.moveCaretLeft()}),Sankore.InternalCommand.create("right",_("command.right"),function(){this.keystrokeLine.moveCaretRight()}),Sankore.InternalCommand.create("del",_("command.del"),function(){var a=this.keystrokeLine.del();a&&this.getButtonUseCount(a.slot)&&(this.buttonUseCount[a.slot]--,this.getButtonUseCount(a.slot)=c.button.useLimit&&b.notify("calculator.button_disabled",c))}),b.addEventListener("main_interface.reset_click",function(){a.reload()})},reset:function(){this.memory=null,this.op=null,this.output=null,this.lastError=null,this.expressionString=[],this.keystrokeLine.reset()},init:function(a){var b=this;this.ui.render(),this.editor.init(a.editor||{}),null!==this.layout&&this.loadLayout(a.layout||"default"),"buttonUseCount"in a&&(this.buttonUseCount=a.buttonUseCount),"keystrokes"in a&&this.keystrokeLine.loadState(a.keystrokes||{}),"output"in a&&a.output&&(this.expressionString=a.output||"",this.evaluateStack()),"error"in a&&a.error&&(this.lastError=Sankore.Util.Error.create(a.error.name,a.error.message),this.eventDispatcher.notify("calculator.output_changed",{output:this.output,error:this.lastError})),"memory"in a&&(this.memory=a.memory,this.eventDispatcher.notify("calculator.memory_changed",this.memory)),"op"in a&&(this.op=a.op,this.eventDispatcher.notify("calculator.op_changed",this.op)),"history"in a&&a.history.length>0&&(this.history=a.history.map(function(a){return{expression:a.expression,output:b.calculusEngine.evaluate(a.output)}}),this.eventDispatcher.notify("calculator.history_changed",this.history)),this.eventDispatcher.notify("calculator.init")},getState:function(){return{layout:this.currentLayout?this.currentLayout.id:null,error:this.lastError,memory:this.memory,op:this.op,output:this.output?this.output.toString():null,buttonUseCount:this.buttonUseCount,editor:this.editor.getState(),keystrokes:this.keystrokeLine.getState(),history:this.history.map(function(a){return{expression:a.expression,output:a.output.toString()}})}},loadLayout:function(a){this.currentLayout=this.editor.layouts.get(a),this.execCommand("clear"),this.buttonUseCount={},this.history=[],this.eventDispatcher.notify("calculator.layout_loaded",this.currentLayout)},reload:function(){this.loadLayout(this.currentLayout.id)},execCommand:function(a,b){var c=this.commands.get(a);c.exec(this,b),this.eventDispatcher.notify("calculator.command_executed",{command:c,args:b})},evaluateStack:function(){try{this.output=this.expressionString.length>0?this.calculusEngine.evaluate(this.expressionString):null,this.lastError=null}catch(a){this.lastError=a,this.output=null}this.expressionString="",this.eventDispatcher.notify("calculator.output_changed",{output:this.output,error:this.lastError})},keystroke:function(a,b){var c=this.commands.get(b.command),d=this.texts.get(b.text);c.isInternal()?this.execCommand(c.id):(c.isInterrupting()&&this.keystrokeLine.moveCaretToEnd(),this.keystrokeLine.hit({slot:a,text:d.screen,command:b.command})),c.isInterrupting()&&this.execute()},execute:function(){var a,b=this.keystrokeLine.count();for(a=0;b>a;a++)this.execCommand(this.keystrokeLine.at(a).command);if(this.eventDispatcher.notify("calculator.executed"),!this.lastError&&this.output)try{this.backup(this.keystrokeLine.getAsText().join(""),this.output)}catch(c){}this.keystrokeLine.reset()},useButton:function(a){"undefined"==typeof this.buttonUseCount[a]&&(this.buttonUseCount[a]=0),this.buttonUseCount[a]++},getButtonUseCount:function(a){return this.buttonUseCount[a]||0},backup:function(a,b){try{b.getValue(),this.history.push({expression:a,output:b}),this.eventDispatcher.notify("calculator.history_changed",this.history)}catch(c){}}}))}(),function(){"use strict";klass.define("Sankore.Calculus","Engine",klass.extend({constructor:function(){this.expressions=[],this.operators=[]},init:function(){this.expressions=[],this.operators=[]},evaluate:function(a){var b,c,d,e=[];a=a.replace(/\s+/g,"");for(var f in a)d=a[f],b=e.length>0?e[e.length-1]:void 0,c=e.length>1?e[e.length-2]:void 0,-1!=="0123456789.".indexOf(d)?isNaN(Number(b))&&"."!==b&&"-."!==b&&("-"!==b||"("!==c&&void 0!==c)?e.push(d):e[e.length-1]+=d:e.push(d);for(var g in e)if(e[g].length>1&&"."===e[g].charAt(e[g].length-1))throw Sankore.Util.Error.create("InvalidExpression","Trailing comma");return this.computeExpression(e)},computeExpression:function(a){var b=function(a,b){for(var c,d=Sankore.Calculus.BinaryOperation.getOperatorPrecedence;;){if(c=a.operators[a.operators.length-1],0===a.operators.length||"("===c||d(b)>d(c))return a.operators.push(b);a.reduce()}};this.init();for(var c in a)switch(a[c]){case"(":this.operators.push(a[c]);break;case")":if(0===this.operators.length)throw Sankore.Util.Error.create("InvalidExpression","Trailing closing brackets");for(;0!==this.operators.length&&"("!==this.operators[this.operators.length-1];)this.reduce();"("===this.operators[this.operators.length-1]&&this.operators.pop();break;case"+":case"-":case"*":case"/":case":":b(this,a[c]);break;default:this.expressions.push(Sankore.Calculus.Operand.create(a[c]))}for(;0!==this.operators.length;)this.reduce();if(1!==this.expressions.length)throw Sankore.Util.Error.create("InvalidExpression",'"'+a.join(" ")+'" is not a valid expression');return this.expressions.pop()},reduce:function(){var a,b=this.expressions.pop(),c=this.expressions.pop(),d=this.operators.pop();if("undefined"==typeof d||"undefined"==typeof c||"undefined"==typeof b)throw Sankore.Util.Error.create("InvalidExpression","Invalid expression");a=":"===d?Sankore.Calculus.EuclideanDivisionOperation.create(c,b):Sankore.Calculus.BinaryOperation.create(c,d,b),this.expressions.push(a)}}))}(),function(){"use strict";klass.define("Sankore.Calculus","Expression",klass.extend({constructor:function(){},getValue:function(){return null},isInteger:function(){try{var a=this.getValue();return a===Math.floor(a)}catch(b){return 0}},toString:function(){return""},isCompound:function(){return!1}})),klass.define("Sankore.Calculus","Operand",Sankore.Calculus.Expression.extend({constructor:function(a){if(this.value=Number(a),isNaN(this.value))throw Sankore.Util.Error.create("InvalidNumber",'"'+String(a)+'" is a not a number')},getValue:function(){return this.value},toString:function(){return String(this.value)}})),klass.define("Sankore.Calculus","Operation",Sankore.Calculus.Expression.extend({constructor:function(a,b){this.operator=a,Sankore.Calculus.Expression.isPrototypeOf(b)||(b=Sankore.Calculus.Operand.create(b)),this.right=b},getPrecedence:function(){return Sankore.Calculus.Operation.getOperatorPrecedence(this.operator)},isLeftAssociative:function(){return!1},isCompound:function(){return!0},getValue:function(){var a=Number(this.right.getValue());return"-"===this.operator&&(a*=-1),a},toString:function(){var a=this.right.toString();return"-"!==this.operator?a:(this.right.isCompound()&&(a="("+a+")"),"-"+a)}})),Sankore.Calculus.Operation.getOperatorPrecedence=function(a){switch(a){case"+":case"-":return 1;case"*":case"/":case":":return 2}},klass.define("Sankore.Calculus","BinaryOperation",Sankore.Calculus.Operation.extend({constructor:function(a,b,c){Sankore.Calculus.Operation.constructor.call(this,b,c),Sankore.Calculus.Expression.isPrototypeOf(a)||(a=Sankore.Calculus.Operand.create(a)),this.left=a},isLeftAssociative:function(){return!0},getValue:function(){var a=this.left.getValue(),b=this.right.getValue();switch(this.operator){case"+":return a+b;case"-":return a-b;case"*":return a*b;case"/":if(0===b)throw Sankore.Util.Error.create("ZeroDivision","Division by zero");return a/b;default:throw Sankore.Util.Error.create("InvalidOperator","This is not a valid operator : "+this.operator)}},toString:function(){if(this.isInteger())return String(this.getValue());var a=this.left.toString(),b=this.right.toString();return Sankore.Calculus.Operation.isPrototypeOf(this.left)&&this.left.getPrecedence()0&&(a.getCurrentLayout().name=c,b.notify("editor.layout_changed"))}),b.addEventListener("editor_interface.layout_description_change",function(c){a.getCurrentLayout().description!==c&&(a.getCurrentLayout().description=c,b.notify("editor.layout_changed"))}),b.addEventListener("editor_interface.button_command_change",function(c){a.activeButton&&(a.getCurrentLayout().getButton(a.activeButton).command=c,b.notify("editor.layout_changed"))}),b.addEventListener("editor_interface.button_text_change",function(c){if(a.activeButton){var d=a.getCurrentLayout().getButton(a.activeButton);d.text=c,b.notify("editor.button_renamed",{slot:a.activeButton,button:d}),b.notify("editor.layout_changed")}}),b.addEventListener("editor_interface.button_uselimit_change",function(c){a.activeButton&&(isNaN(Number(c))||(a.getCurrentLayout().getButton(a.activeButton).useLimit=0===c.length?-1:Number(c),b.notify("editor.layout_changed")))}),b.addEventListener("main_interface.button_click",function(b){a.enabled&&a.setActiveButton(b.slot)}),b.addEventListener("main_interface.editor_click",function(){a.enabled?a.runCurrentLayout():a.enable()}),b.addEventListener("main_interface.reset_click",function(){a.enabled&&a.resetActiveButton()})},init:function(a){"layouts"in a&&this.loadLayouts(a.layouts),"enabled"in a&&(this.enabled=a.enabled),this.ui.render(this.calculator.ui),this.setCurrentLayout("current"in a&&a.current?a.current:"default"),this.enabled&&this.enable(),"activeButton"in a&&this.enabled&&this.setActiveButton(a.activeButton)},getState:function(){return{current:this.current,activeButton:this.activeButton,enabled:this.enabled,layouts:this.layouts.map(function(a,b){return b.isEditable()?b:void 0})}},loadLayouts:function(a){var b,c={};for(var d in a){for(var e in a[d].buttonMap)a[d].buttonMap.hasOwnProperty(e)&&(c[e]=Sankore.Button.create(a[d].buttonMap[e].text,a[d].buttonMap[e].command,a[d].buttonMap[e].useLimit));b=Sankore.Editor.Layout.create({id:a[d].id,name:a[d].name,description:a[d].description,buttonMap:c}),b.setEditable(!0),this.layouts.add("id",[b])}},getCurrentLayout:function(){return null===this.current?null:this.layouts.get(this.current)},setCurrentLayout:function(a){this.current=a,this.calculator.eventDispatcher.notify("editor.layout_selected",this.getCurrentLayout()),this.resetActiveButton()},createLayout:function(){var a=this.layouts.get("default").clone();return a.id=this.generateId(),a.name=_("layout.new_name"),a.setEditable(!0),this.layouts.set(a.id,a),this.calculator.eventDispatcher.notify("editor.layout_created"),a},generateId:function(){var a,b="",c=new Date,d=0;for(a=0;a0){var a=this.keystrokes.splice(this.caret-1,1)[0];return this.caret--,this.notify(),a}},moveCaretLeft:function(){this.caret>0&&(this.caret--,this.notify())},moveCaretRight:function(){this.careta)throw Sankore.Util.Error.create("OutOfRangeError","Cannot get keystroke before index 0");if(a>this.keystrokes.length)throw Sankore.Util.Error.create("OutOfRangeError","Cannot get keystroke after index "+this.keystrokes.length);for(c=a;b>c;c++)d+=this.at(c).text;return d},getState:function(){return{keystrokes:this.keystrokes,caret:this.caret}},loadState:function(a){this.keystrokes=a.keystrokes||{},this.caret=a.caret||0,this.notify()}}))}(),function(){"use strict";klass.define("Sankore","Text",klass.extend({constructor:function(a,b,c,d,e){this.id=a,this.screen=b,this.button=c,this.type="undefined"!=typeof d?d:"normal",this.editable="undefined"!=typeof e?!!e:!0},isEditable:function(){return this.editable},setEditable:function(a){this.editable=!!a}}))}(),function(){"use strict";klass.define("Sankore.UI","EditorInterface",klass.extend({constructor:function(a,b){this.editor=a,this.dispatcher=b,this.hidden=!0,this.editArea=null,this.layoutSelect=null,this.layoutNameInput=null,this.layoutDescriptionInput=null,this.assignationDiv=null,this.runButton=null,this.addButton=null,this.removeButton=null,this.attachEventListeners(),this.rendered=!1},attachEventListeners:function(){var a=this;this.dispatcher.addEventListener("editor.show",this.show.bind(this)),this.dispatcher.addEventListener("editor.hide",this.hide.bind(this)),this.dispatcher.addEventSubscriber({events:["editor.layout_changed","editor.layout_created","editor.layout_removed"],listener:this.updateLayoutSelectElement.bind(this)}),this.dispatcher.addEventListener("editor.layout_selected",function(b){a.loadLayout(b),a.selectLayout(b.id)}),this.dispatcher.addEventListener("editor.button_selected",function(b){var c=b.button;null===c&&a.editor.getCurrentLayout()&&(c=a.editor.getCurrentLayout().isEditable()),a.renderAssignation(c)})},_clearElement:function(a){for(;a.firstChild;)a.removeChild(a.firstChild)},_map:function(a,b){var c,d=[];for(c in a)a.hasOwnProperty(c)&&d.push(b.call(a,a[c],c));return d},render:function(a){var b,c,d=this;this.editArea=document.createElement("div"),this.editArea.classList.add("edit-area"),this.layoutSelect=this.createLayoutSelectElement(),this.editArea.appendChild(this.layoutSelect),this.addButton=document.createElement("button"),this.addButton.className="small",this.addButton.setAttribute("type","button"),this.addButton.addEventListener("click",function(){d.dispatcher.notify("editor_interface.add_click")}),this.removeButton=this.addButton.cloneNode(),this.removeButton.classList.add("remove"),this.removeButton.addEventListener("click",function(){d.dispatcher.notify("editor_interface.remove_click")}),this.addButton.classList.add("add"),this.editArea.appendChild(this.addButton),this.editArea.appendChild(this.removeButton),this.editArea.appendChild(document.createElement("hr")),b=document.createElement("label"),b.appendChild(document.createTextNode(_("editor.layout_name.label"))),this.editArea.appendChild(b),this.layoutNameInput=document.createElement("input"),this.layoutNameInput.setAttribute("name","layout_name"),this.layoutNameInput.setAttribute("type","text"),this.layoutNameInput.setAttribute("maxlength",32),this.layoutNameInput.addEventListener("keyup",function(){d.dispatcher.notify("editor_interface.layout_name_change",this.value)}),this.layoutNameInput.addEventListener("change",function(){0===this.value.trim().length&&(this.value=d.editor.getCurrentLayout().name,d.dispatcher.notify("editor_interface.layout_name_change",this.value))}),this.editArea.appendChild(this.layoutNameInput),c=document.createElement("label"),c.appendChild(document.createTextNode(_("editor.layout_description.label"))),this.editArea.appendChild(c),this.layoutDescriptionInput=document.createElement("textarea"),this.layoutDescriptionInput.setAttribute("name","layout_description"),this.layoutDescriptionInput.setAttribute("maxlength",140),this.layoutDescriptionInput.addEventListener("keyup",function(){d.dispatcher.notify("editor_interface.layout_description_change",this.value)}),this.editArea.appendChild(this.layoutDescriptionInput),this.assignationDiv=document.createElement("div"),this.assignationDiv.classList.add("assignation"),this.editArea.appendChild(this.assignationDiv),this.runButton=document.createElement("button"),this.runButton.classList.add("run"),this.runButton.setAttribute("type","button"),this.runButton.appendChild(document.createTextNode(_("editor.run_button"))),this.runButton.addEventListener("click",function(){d.dispatcher.notify("editor_interface.run_click")}),this.editArea.appendChild(this.runButton),a.rearScreen.parentElement.appendChild(this.editArea),this.rendered=!0,this.hide()},createSelectElement:function(a,b,c,d){var e,f=document.createElement("select");f.setAttribute("name",b),c&&(f.className=c);for(var g in a)e=document.createElement("option"),e.setAttribute("value",a[g].value),"undefined"!=typeof d&&d===a[g].value&&(e.selected=!0),e.appendChild(document.createTextNode(a[g].text)),f.appendChild(e);return f},createLayoutSelectElement:function(){var a=this.createSelectElement(this.editor.layouts.map(function(a,b){return{text:b.name,value:b.id}}),"layouts","layout-select",this.editor.current),b=this;return a.addEventListener("change",function(){b.dispatcher.notify("editor_interface.layout_select",this.value)}),a},updateLayoutSelectElement:function(){var a=this.createLayoutSelectElement();this.editArea.replaceChild(a,this.layoutSelect),this.layoutSelect=a},selectLayout:function(a){this.layoutSelect.value=a},show:function(){this.rendered&&(this.editArea.style.display="block",this.hidden=!1)},hide:function(){this.rendered&&(this.editArea.style.display="none",this.hidden=!0)},loadLayout:function(a){this.layoutNameInput.value=a.name,this.layoutNameInput.disabled=!a.isEditable(),this.layoutDescriptionInput.value=a.description,this.layoutDescriptionInput.disabled=!a.isEditable(),this.removeButton.disabled=!a.isEditable(),this.renderAssignation(a.isEditable())},renderAssignation:function(a){var b,c,d,e,f,g,h,i,j,k=this;!1===a?(b=document.createElement("em"),b.appendChild(document.createTextNode(_("editor.assignation.disabled")))):Sankore.Button.isPrototypeOf(a)?(b=document.createDocumentFragment(),c=document.createElement("label"),c.appendChild(document.createTextNode(_("editor.assignation.text.label"))),b.appendChild(c),j=this.editor.calculator.texts.get(a.text),d=this.createSelectElement(this._map(this.editor.getAssignableTexts(),function(a){return{text:a.button,value:a.id}}),"button_text","",j.id),d.addEventListener("change",function(a){k.dispatcher.notify("editor_interface.button_text_change",a.target.value)}),b.appendChild(d),e=document.createElement("label"),e.appendChild(document.createTextNode(_("editor.assignation.command.label"))),b.appendChild(e),f=this.createSelectElement(this._map(this.editor.getAssignableCommands(),function(a){return{text:a.name,value:a.id}}),"button_command","",a.command),f.addEventListener("change",function(a){k.dispatcher.notify("editor_interface.button_command_change",a.target.value)}),b.appendChild(f),g=document.createElement("label"),g.appendChild(document.createTextNode(_("editor.assignation.use_limit.label"))),b.appendChild(g),h=document.createElement("input"),h.setAttribute("type","text"),h.setAttribute("name","button_count"),h.value=-1===a.useLimit?"":a.useLimit,h.addEventListener("change",function(a){k.dispatcher.notify("editor_interface.button_uselimit_change",a.target.value)}),b.appendChild(h),i=document.createElement("span"),i.className="help",i.appendChild(document.createTextNode(_("editor.assignation.use_limit.help"))),b.appendChild(i)):(b=document.createElement("em"),b.appendChild(document.createTextNode(_("editor.assignation.enabled")))),this._clearElement(this.assignationDiv),this.assignationDiv.appendChild(b)}}))}(),function(){"use strict";klass.define("Sankore.UI","MainInterface",klass.extend({constructor:function(a,b,c,d){this.id=a,this.dispatcher=b,this.texts=c,this.withEditor=d,this.title=null,this.caret=document.createElement("i"),this.caret.className="caret",this.frontScreen=null,this.expressionRow=null,this.resultRow=null,this.flagRow=null,this.flags=[],this.rearScreen=null,this.buttons=Sankore.Util.Hash.create(),this.rendered=!1,this.attachEventListeners()},attachEventListeners:function(){var a=this;this.dispatcher.addEventListener("keystroke_line.changed",function(b){a.updateExpressionRow(b.getAsText())}),this.dispatcher.addEventListener("calculator.memory_changed",function(b){null!==b?a.addFlag("M"):a.removeFlag("M"),a.updateFlagRow() +}),this.dispatcher.addEventListener("calculator.op_changed",function(b){null!==b?a.addFlag("OP"):a.removeFlag("OP"),a.updateFlagRow()}),this.dispatcher.addEventListener("calculator.output_changed",function(b){a.updateResultRow(null!==b.output?b.output:null!==b.error?b.error:"")}),this.dispatcher.addEventListener("calculator.history_changed",this.updateRearScreen.bind(this)),this.dispatcher.addEventListener("calculator.layout_loaded",function(b){a.renderButtons(b.buttonMap),a.changeTitle(b.name),a.clearRearScreen()}),this.dispatcher.addEventListener("calculator.button_disabled",function(b){var c=a.buttons.get(b.slot);c&&(c.disabled=!0)}),this.dispatcher.addEventListener("calculator.button_enabled",function(b){var c=a.buttons.get(b);c&&(c.disabled=!1)}),this.dispatcher.addEventListener("editor.show",this.hideRearScreen.bind(this)),this.dispatcher.addEventListener("editor.hide",this.showRearScreen.bind(this)),this.dispatcher.addEventListener("editor.button_selected",function(b){var c=a.buttons.get(b.slot),d=a.buttons.get(b.previousSlot);d&&d.parentElement.classList.remove("edit"),c&&c.parentElement.classList.add("edit")}),this.dispatcher.addEventListener("editor.button_renamed",function(b){var c,d=a.buttons.get(b.slot),e=a.texts.get(b.button.text);d&&(d.innerText=e.button,c=d.parentElement.classList.contains("edit"),d.parentElement.className=e.type,c&&d.parentElement.classList.add("edit"))})},_clearElement:function(a){for(;a.firstChild;)a.removeChild(a.firstChild)},getRootElement:function(){return document.getElementById(this.id)},render:function(){var a=this.getRootElement();this._clearElement(a),a.classList.contains("calculator")||a.classList.add("calculator"),this.createBaseMarkup(a),this.rearScreen=document.createElement("ul"),a.getElementsByClassName("rear-screen").item(0).appendChild(this.rearScreen),this.frontScreen=document.createElement("ul"),a.getElementsByClassName("front-screen").item(0).appendChild(this.frontScreen),this.expressionRow=document.createElement("li"),this.expressionRow.classList.add("expression-row"),this.frontScreen.appendChild(this.expressionRow),this.flagRow=document.createElement("li"),this.flagRow.classList.add("flag-row"),this.frontScreen.appendChild(this.flagRow),this.resultRow=document.createElement("li"),this.resultRow.classList.add("result-row"),this.frontScreen.appendChild(this.resultRow),this.rendered=!0},renderButtons:function(a){var b,c={},d=document.createDocumentFragment(),e=this.getRootElement().getElementsByClassName("screen").item(0).parentElement;for(var f in a)c[f]=a[f];for(c.a0=Sankore.Button.create("s","del",-1,!1),c.b0=Sankore.Button.create("l","left",-1,!1),c.c0=Sankore.Button.create("r","right",-1,!1),c.d0=Sankore.Button.create("c","clear",-1,!1),b=e.getElementsByClassName("buttons");b.length>0;)e.removeChild(b[0]);b=this.createButtons(c);for(var g in b)d.appendChild(b[g]);e.appendChild(d)},createBaseMarkup:function(a){var b=document.createElement("table"),c=document.createElement("tr"),d=document.createElement("td"),e=document.createElement("td");d.className="rear-screen",d.setAttribute("rowspan","8"),c.appendChild(d),e.className="front-screen",e.setAttribute("colspan","4"),c.appendChild(e),c.className="screen",b.appendChild(c),a.appendChild(this.createTitle()),a.appendChild(this.createControls()),a.appendChild(b)},createTitle:function(){return this.title=document.createElement("span"),this.title.appendChild(document.createTextNode("Chargement...")),this.title.className="title",this.title},createControls:function(){var a=document.createElement("div"),b=document.createElement("button"),c=document.createElement("button"),d=this;return this.withEditor&&(b.setAttribute("type","button"),b.appendChild(document.createTextNode(_("controls.editor"))),b.addEventListener("click",function(){d.dispatcher.notify("main_interface.editor_click")}),a.appendChild(b)),c.setAttribute("type","button"),c.appendChild(document.createTextNode(_("controls.reset"))),c.addEventListener("click",function(){d.dispatcher.notify("main_interface.reset_click")}),a.appendChild(c),a.className="controls",a},createButtons:function(a){var b,c=[];for(b=0;7>b;b++)c.push(this.createButtonRow(b,a));return c},createButtonRow:function(a,b){var c,d=document.createElement("tr");for(d.className="buttons",c="a";"d">=c;c=String.fromCharCode(c.charCodeAt(0)+1))d.appendChild(this.createButton(c+a,b));return d},createButton:function(a,b){var c,d,e=document.createElement("td"),f=this,g=b[a];return e.setAttribute("data-slot",a),e.setAttribute("data-editable",g.isEditable()),"undefined"!=typeof g&&(d=document.createElement("button"),c=this.texts.get(g.text),d.innerText=c.button,"normal"!==c.type&&e.classList.add(c.type),d.addEventListener("mousedown",function(b){f.handleButtonClick(this,b,g,a)}),this.buttons.set(a,d),this.dispatcher.notify("main_interface.button_created",{button:g,slot:a}),e.appendChild(d)),e},handleButtonClick:function(a,b,c,d){this.dispatcher.notify("main_interface.button_click",{button:c,slot:d})},updateFlagRow:function(){var a;this._clearElement(this.flagRow);for(var b in this.flags)a=document.createElement("span"),a.appendChild(document.createTextNode(this.flags[b])),this.flagRow.appendChild(a)},updateExpressionRow:function(a){this._clearElement(this.expressionRow),this.expressionRow.appendChild(document.createTextNode(a[0])),this.expressionRow.appendChild(this.caret),this.expressionRow.appendChild(document.createTextNode(a[1]))},updateResultRow:function(a){this._clearElement(this.resultRow),this.resultRow.appendChild(this.createResultRow(a))},createResultRow:function(a){try{return Sankore.Calculus.EuclideanDivisionOperation.isPrototypeOf(a)?this.createResultRowEuclidean(a.getValue(),a.getRemainder()):Sankore.Calculus.Expression.isPrototypeOf(a)?this.createResultRowExpression(a.getValue()):Sankore.Util.Error.isPrototypeOf(a)?this.createResultRowError(a):this.createResultRowText(String(a))}catch(b){return this.createResultRowError(b)}return null},createResultRowEuclidean:function(a,b){var c=document.createElement("p"),d=document.createElement("span"),e=document.createElement("span");return c.classList.add("euclidean"),e.classList.add("remainder"),e.textContent=this.formatResultValue(b),c.appendChild(e),d.classList.add("quotient"),d.textContent=this.formatResultValue(a),c.appendChild(d),c},createResultRowExpression:function(a){return document.createTextNode(this.formatResultValue(a))},createResultRowText:function(a){return document.createTextNode(a)},createResultRowError:function(a){var b=document.createElement("div"),c=_("error.common");return"ZeroDivision"===a.name&&(c=_("error.zero_division")),b.classList.add("error"),b.appendChild(document.createTextNode(c)),b},formatResultValue:function(a){var b,c=a.toFixed(Math.max(0,10-a.toFixed().length));if(-1!==c.indexOf("."))for(;;){b=c.charAt(c.length-1);{if("0"!==b){"."===b&&(c=c.slice(0,-1));break}c=c.slice(0,-1)}}return Number(c)>1e10-1&&(c=Number(c.substring(0,11)/10).toFixed()),-1!==c.indexOf(".")&&(c=c.replace(".",_("text.comma"))),c},updateRearScreen:function(a){var b,c,d=document.createDocumentFragment();for(var e in a)b=document.createElement("li"),b.className="expression-row",b.appendChild(document.createTextNode(a[e].expression)),d.appendChild(b),c=document.createElement("li"),c.className="result-row",c.appendChild(this.createResultRow(a[e].output)),d.appendChild(c);this.clearRearScreen(),this.rearScreen.appendChild(d),this.rearScreen.lastChild.scrollIntoView()},clearRearScreen:function(){this._clearElement(this.rearScreen)},showRearScreen:function(){this.rearScreen.style.display="block",this.showTitle()},hideRearScreen:function(){this.rearScreen.style.display="none",this.hideTitle()},addFlag:function(a){-1===this.flags.indexOf(a)&&(this.flags.push(a),this.flags.sort())},removeFlag:function(a){var b=this.flags.indexOf(a);-1!==b&&(this.flags.splice(b,1),this.flags.sort())},changeTitle:function(a){this._clearElement(this.title),this.title.appendChild(document.createTextNode(a))},showTitle:function(){this.title.style.visibility="visible"},hideTitle:function(){this.title.style.visibility="hidden"}}))}(),function(){"use strict";klass.define("Sankore.Util","Error",klass.extend({constructor:function(a,b){this.name=a,this.message=b},toString:function(){return this.name+": "+this.message}}))}(),function(){"use strict";klass.define("Sankore.Util","EventDispatcher",klass.extend({constructor:function(){this.eventListeners={}},addEventSubscriber:function(a){for(var b in a.events)this.addEventListener(a.events[b],a.listener);return this},addEventListener:function(a,b,c){return"undefined"==typeof this.eventListeners[a]&&(this.eventListeners[a]=[]),"undefined"==typeof c?this.eventListeners[a].push(b):this.eventListeners[a][c]=b,this},removeEventListener:function(a,b){delete this.eventListeners[a][b]},removeAllEventListeners:function(a){this.eventListeners[a]=[]},notify:function(a,b){var c;for(c in this.eventListeners[a])this.eventListeners[a][c](b)}}))}(),function(){"use strict";klass.define("Sankore.Util","Hash",klass.extend({constructor:function(a){this.elements=a||{}},length:function(){return this.keys().length},keys:function(){return Object.keys(this.elements)},set:function(a,b){this.elements[a]=b},add:function(a,b){for(var c in b)this.set(b[c][a],b[c])},has:function(a){return-1!==this.keys().indexOf(a)},get:function(a,b){return"undefined"!=typeof this.elements[a]?this.elements[a]:"undefined"!=typeof b?b:null},pos:function(a){var b=0;for(var c in this.elements){if(this.elements.hasOwnProperty(c)&&c===a)return b;b++}return null},remove:function(a){return delete this.elements[a]},map:function(a){var b,c=[];for(var d in this.elements)this.elements.hasOwnProperty(d)&&(b=a.call(this,d,this.elements[d]),b&&c.push(b));return c}}))}(),function(){"use strict";klass.define("Sankore.Util","I18N",klass.extend({catalogs:Sankore.Util.Hash.create(),constructor:function(){this.catalog={}},load:function(a){var b=a.split(/-|_/)[0].toLowerCase();Sankore.Util.I18N.catalogs.has(b)||(b="en"),this.catalog=Sankore.Util.I18N.catalogs.get(b,{})},translate:function(a){return a.split(".").reduce(function(a,b){return a&&b in a?a[b]:null},this.catalog)||a}})),Sankore.Util.i18n=Sankore.Util.I18N.create(),window._=function(a){return Sankore.Util.i18n.translate(a)}}(),function(){Sankore.Util.I18N.catalogs.set("en",{layout:{classic_name:"Basic calculator",new_name:"New calculator"},text:{del:"DEL",comma:"."},command:{zero:"0 digit",one:"1 digit",two:"2 digit",three:"3 digit",four:"4 digit",five:"5 digit",six:"6 digit",seven:"7 digit",eight:"8 digit",nine:"9 digit",plus:"Addition",minus:"Subtraction",times:"Multiplication",divide:"Division",euclidean_divide:"Euclidean division",equal:"Equal",comma:"Comma",open_parenthesis:"Open parenthesis",close_parenthesis:"Close parenthesis",op:"Constant operator",memory_add:"Memory addition",memory_sub:"Memory substraction",memory_recall:"Memory recall",memory_clear:"Memory clear",clear:"Clear",left:"Move left",right:"Move right",del:"Delete"},controls:{editor:"Editor",reset:"RST"},editor:{run_button:"Run",remove_alert:"Delete this calculator?",layout_name:{label:"Name"},layout_description:{label:"Description"},assignation:{enabled:"Click on a button to edit it",disabled:"This calculator is not editable",text:{label:"Display text"},command:{label:"Command"},use_limit:{label:"Use limit",help:"0 for disabled, empty for unlimited"}}},error:{common:"Error",zero_division:"Div/0 error"}})}(),function(){Sankore.Util.I18N.catalogs.set("fr",{layout:{classic_name:"Calculatrice standard",new_name:"Nouvelle calculatrice"},text:{del:"EFF",comma:","},command:{zero:"Chiffre 0",one:"Chiffre 1",two:"Chiffre 2",three:"Chiffre 3",four:"Chiffre 4",five:"Chiffre 5",six:"Chiffre 6",seven:"Chiffre 7",eight:"Chiffre 8",nine:"Chiffre 9",plus:"Addition",minus:"Soustraction",times:"Multiplication",divide:"Division",euclidean_divide:"Division euclidienne",equal:"Egalité",comma:"Virgule",open_parenthesis:"Parenthèse ouvrante",close_parenthesis:"Parenthèse fermante",op:"Opérateur constant",memory_add:"Addition mémoire",memory_sub:"Soustraction mémoire",memory_recall:"Rappel mémoire",memory_clear:"R.A.Z. mémoire",clear:"R.A.Z.",left:"Déplacement à gauche",right:"Déplacement à droite",del:"Suppression"},controls:{editor:"Editeur",reset:"RAZ"},editor:{run_button:"Utiliser",remove_alert:"Supprimer cette calculatrice ?",layout_name:{label:"Nom"},layout_description:{label:"Description"},assignation:{enabled:"Cliquez sur une touche pour la modifier",disabled:"Cette calculatrice n'est pas modifiable",text:{label:"Texte à afficher"},command:{label:"Commande"},use_limit:{label:"Nb d'utilisation",help:"0 pour désactiver, vide pour illimité"}}},error:{common:"Erreur",zero_division:"Erreur div/0"}})}(); \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/icon.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/icon.png new file mode 100644 index 00000000..ad760367 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/icon.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/index.html b/resources/library/applications/Calculator.wgt/Calculator.wgt/index.html new file mode 100644 index 00000000..df9e83cf --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/index.html @@ -0,0 +1,55 @@ + + + + + + Unpredictable Calculator + + + + + + + +
+ + + + + diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/js/sankore.js b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/sankore.js new file mode 100644 index 00000000..3d226e2e --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/sankore.js @@ -0,0 +1,22 @@ +/*jshint browser:true, devel:true*/ +if (!('sankore' in window)) { + window.sankore = { + preferences: { + state: '' + }, + + setPreference: function (name, value) { + console.log('Preference "' + name + '" set to : ' + value); + this.preferences[name] = value; + }, + + preference: function (name) { + console.log('Accessing "' + name + '"'); + return this.preferences[name] || ''; + }, + + locale: function () { + return window.navigator.language; + } + }; +} \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Button.js b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Button.js new file mode 100644 index 00000000..02d8d5b5 --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Button.js @@ -0,0 +1,35 @@ +/*global klass:true, Sankore:true*/ +(function() { + "use strict"; + + klass.define('Sankore', 'Button', klass.extend({ + constructor: function (text, command, useLimit, editable) { + this.text = text; + this.command = command; + + this.useLimit = typeof useLimit === 'undefined' ? -1 : useLimit; + this.editable = typeof editable === 'undefined' ? true : editable; + }, + + isEditable: function () { + return this.editable; + }, + + isUsable: function () { + return this.useLimit === -1; + }, + + isDisabled: function () { + return this.useLimit === 0; + }, + + clone: function () { + return Sankore.Button.create( + this.text, + this.command, + this.useLimit, + this.editable + ); + } + })); +})(); \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Calculator.js b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Calculator.js new file mode 100644 index 00000000..f625384a --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Calculator.js @@ -0,0 +1,528 @@ +/*jshint devel:true, browser:true*/ +/*globals klass:true, Sankore:true, _:true */ +(function () { + "use strict"; + + klass.define('Sankore', 'Calculator', klass.extend({ + constructor: function (id, options) { + Sankore.Util.i18n.load(options.locale || 'en'); + + // state attributes + this.currentLayout = null; + this.lastError = null; // last raised error + this.memory = null; // internal memory + this.op = null; // op memory + this.output = null; // last evaluated resut + this.history = []; // operation history + this.buttonUseCount = {}; // button use count + + // local attributes + this.expressionString = ''; // current expressionString + this.unpredictable = options.unpredictableMode || false; + + // components + this.eventDispatcher = Sankore.Util.EventDispatcher.create(); + this.commands = Sankore.Util.Hash.create(); // command hash + this.texts = Sankore.Util.Hash.create(); // text hash + this.calculusEngine = Sankore.Calculus.Engine.create(); + this.keystrokeLine = Sankore.KeystrokeLine.create(this.eventDispatcher); + this.ui = Sankore.UI.MainInterface.create(id, this.eventDispatcher, this.texts, this.unpredictable); + this.editor = Sankore.Editor.Editor.create(this); + + if (typeof options.ready !== 'undefined') { + this.eventDispatcher.addEventListener('calculator.create', options.ready.bind(this)); + } + + var c = Sankore.Text.create.bind(Sankore.Text); + this.texts.add('id', [ + c('0', '0', '0'), + c('1', '1', '1'), + c('2', '2', '2'), + c('3', '3', '3'), + c('4', '4', '4'), + c('5', '5', '5'), + c('6', '6', '6'), + c('7', '7', '7'), + c('8', '8', '8'), + c('9', '9', '9'), + c('+', '+', '+', 'alt'), + c('-', '-', '-', 'alt'), + c('*', '\u00D7', '\u00D7', 'alt'), + c('/', '\u00F7', '\u00F7', 'alt'), + c(':', '\u22A2', '\u22A2', 'alt'), + c('=', '=', '=', 'alt'), + c('.', _('text.comma'), _('text.comma')), + c('(', '(', '('), + c(')', ')', ')'), + c('op', 'OP', 'OP'), + c('mr', 'MR', 'MR'), + c('mc', 'MC', 'MC'), + c('m+', 'M+', 'M+'), + c('m-', 'M-', 'M-'), + c('s', '', _('text.del'), 'alt', false), + c('l', '', '\u2190', 'alt', false), + c('r', '', '\u2192', 'alt', false), + c('c', '', 'C', 'danger', false) + ]); + + c = Sankore.Command.create.bind(Sankore.Command); + this.commands.add('id', [ + // add 0 to the expression string + c('0', _('command.zero'), function (args) { + this.expressionString += '0'; + }), + + // add 1 to the expression string + c('1', _('command.one'), function (args) { + this.expressionString += '1'; + }), + + // add 2 to the expression string + c('2', _('command.two'), function (args) { + this.expressionString += '2'; + }), + + // add 3 to the expression string + c('3', _('command.three'), function (args) { + this.expressionString += '3'; + }), + + // add 4 to the expression string + c('4', _('command.four'), function (args) { + this.expressionString += '4'; + }), + + // add 5 to the expression string + c('5', _('command.five'), function (args) { + this.expressionString += '5'; + }), + + // add 6 to the expression string + c('6', _('command.six'), function (args) { + this.expressionString += '6'; + }), + + // add 7 to the expression string + c('7', _('command.seven'), function (args) { + this.expressionString += '7'; + }), + + // add 8 to the expression string + c('8', _('command.eight'), function (args) { + this.expressionString += '8'; + }), + + // add 9 to the expression string + c('9', _('command.nine'), function (args) { + this.expressionString += '9'; + }), + + // add + to the expression string + c('+', _('command.plus'), function (args) { + this.expressionString += '+'; + }), + + // add - to the expression string + c('-', _('command.minus'), function (args) { + this.expressionString += '-'; + }), + + // add * to the expression string + c('*', _('command.times'), function (args) { + this.expressionString += '*'; + }), + + // add / to the expression string + c('/', _('command.divide'), function (args) { + this.expressionString += '/'; + }), + + // add : to the expression string + c(':', _('command.euclidean_divide'), function (args) { + this.expressionString += ':'; + }), + + // evaluate the current expression + Sankore.InterruptingCommand.create('=', _('command.equal'), function (args) { + this.evaluateStack(); + }), + + // add . to the expression string + c('.', _('command.comma'), function (args) { + this.expressionString += '.'; + }), + + // add ( to the expression string + c('(', _('command.open_parenthesis'), function (args) { + this.expressionString += '('; + }), + + // add ) to the expression string + c(')', _('command.close_parenthesis'), function (args) { + this.expressionString += ')'; + }), + + // store the current (incomplete) expression if not already, else + // call the incomplete expression, append it to the expression string then evaluate + Sankore.InterruptingCommand.create('op', _('command.op'), function (args) { + if (null === this.op) { + if (this.expressionString.length > 1 && + -1 !== '+-*/:'.indexOf(this.expressionString[0]) + ) { + try { + // we parse the OP expression with a fake left operand (1) + // if it raised exceptions during parsing or evaluating, + // the expression is not good for an OP operation + this.calculusEngine.evaluate('(1)' + this.expressionString).getValue(); + + this.op = this.expressionString; + this.eventDispatcher.notify('calculator.op_changed', this.op); + } catch (e) { + } + } + + this.expressionString = ''; + this.output = null; + } else { + // case : the OP command is called immediately. The previous results is used + // as the left operand + if (0 === this.expressionString.length && null !== this.output) { + this.expressionString = '(' + this.output.toString() + ')'; + } + + this.expressionString += this.op; + this.execCommand('='); + } + }), + + // evaluate the expression string and add it to the memory + Sankore.InterruptingCommand.create('memoryAdd', _('command.memory_add'), function (args) { + this.execCommand('='); + + try { + if (null === this.memory) { + this.memory = 0; + } + + this.memory += this.output.getValue(); + } catch (e) { + this.memory = null; + } + + this.eventDispatcher.notify('calculator.memory_changed', this.memory); + }), + + // evaluate the expression string and substract it from the memory + Sankore.InterruptingCommand.create('memorySub', _('command.memory_sub'), function (args) { + this.execCommand('='); + + try { + if (null === this.memory) { + this.memory = 0; + } + + this.memory -= this.output.getValue(); + } catch (e) { + this.memory = null; + } + + this.eventDispatcher.notify('calculator.memory_changed', this.memory); + }), + + // add the current memory value to the expression string + c('memoryRecall', _('command.memory_recall'), function (args) { + if (null !== this.memory) { + this.expressionString += '(' + this.memory.toString() + ')'; + } + }), + + // clear the memory + c('memoryClear', _('command.memory_clear'), function (args) { + this.memory = null; + + this.eventDispatcher.notify('calculator.memory_changed', this.memory); + }), + + // clear the output, memory, op and expression string + Sankore.InternalCommand.create('clear', _('command.clear'), function (args) { + this.reset(); + + this.eventDispatcher.notify('calculator.memory_changed', this.memory); + this.eventDispatcher.notify('calculator.op_changed', this.op); + this.eventDispatcher.notify('calculator.output_changed', { + output: this.output, + error: this.lastError + }); + }), + + // move the caret left + Sankore.InternalCommand.create('left', _('command.left'), function (args) { + this.keystrokeLine.moveCaretLeft(); + }), + + // move the caret right + Sankore.InternalCommand.create('right', _('command.right'), function (args) { + this.keystrokeLine.moveCaretRight(); + }), + + // delete the keystroke before the caret + Sankore.InternalCommand.create('del', _('command.del'), function (args) { + var keystroke = this.keystrokeLine.del(); + + if (keystroke && this.getButtonUseCount(keystroke.slot)) { + this.buttonUseCount[keystroke.slot]--; + if (this.getButtonUseCount(keystroke.slot) < this.currentLayout.getButton(keystroke.slot).useLimit) { + this.eventDispatcher.notify('calculator.button_enabled', keystroke.slot); + } + } + }) + ]); + + this.attachEventHandlers(); + + this.eventDispatcher.notify('calculator.create'); + }, + + attachEventHandlers: function () { + var self = this, ed = this.eventDispatcher; + + if (this.unpredictable) { + ed.addEventListener('editor.show', this.reload.bind(this)); + ed.addEventListener('editor.hide', this.reload.bind(this)); + } + + ed.addEventListener('editor.layout_selected', function (layout) { + self.loadLayout(layout.id); + }); + + ed.addEventListener('main_interface.button_created', function (event) { + if (!self.editor.enabled && event.button.isDisabled()) { + ed.notify('calculator.button_disabled', event); + } + }); + + ed.addEventListener('main_interface.button_click', function (event) { + if (!self.editor.enabled) { + self.useButton(event.slot); + + self.keystroke(event.slot, event.button); + + if (!event.button.isUsable() && self.getButtonUseCount(event.slot) >= event.button.useLimit) { + ed.notify('calculator.button_disabled', event); + } + } + }); + + ed.addEventListener('main_interface.reset_click', function () { + self.reload(); + }); + }, + + reset: function () { + this.memory = null; + this.op = null; + this.output = null; + this.lastError = null; + this.expressionString = []; + this.keystrokeLine.reset(); + }, + + init: function (state) { + var self = this; + + this.ui.render(); + + this.editor.init(state.editor ||  {}); + + if (null !== this.layout) { + this.loadLayout(state.layout || 'default'); + } + + if ('buttonUseCount' in state) { + this.buttonUseCount = state.buttonUseCount; + } + + if ('keystrokes' in state) { + this.keystrokeLine.loadState(state.keystrokes || {}); + } + + if ('output' in state && state.output) { + this.expressionString = state.output || ''; + + this.evaluateStack(); + } + + if ('error' in state && state.error) { + this.lastError = Sankore.Util.Error.create(state.error.name, state.error.message); + + this.eventDispatcher.notify('calculator.output_changed', { + output: this.output, + error: this.lastError + }); + } + + if ('memory' in state) { + this.memory = state.memory; + + this.eventDispatcher.notify('calculator.memory_changed', this.memory); + } + + if ('op' in state) { + this.op = state.op; + + this.eventDispatcher.notify('calculator.op_changed', this.op); + } + + if ('history' in state && state.history.length > 0) { + this.history = state.history.map(function (log) { + return { + expression: log.expression, + output: self.calculusEngine.evaluate(log.output) + }; + }); + + this.eventDispatcher.notify('calculator.history_changed', this.history); + } + + this.eventDispatcher.notify('calculator.init'); + }, + + getState: function () { + return { + layout: this.currentLayout ? this.currentLayout.id : null, + error: this.lastError, + memory: this.memory, + op: this.op, + output: this.output ? this.output.toString() : null, + buttonUseCount: this.buttonUseCount, + editor: this.editor.getState(), + keystrokes: this.keystrokeLine.getState(), + history: this.history.map(function (log) { + return { + expression: log.expression, + output: log.output.toString() + }; + }) + }; + }, + + loadLayout: function (layoutId) { + this.currentLayout = this.editor.layouts.get(layoutId); + + this.execCommand('clear'); + this.buttonUseCount = {}; + this.history = []; + + this.eventDispatcher.notify('calculator.layout_loaded', this.currentLayout); + }, + + reload: function () { + this.loadLayout(this.currentLayout.id); + }, + + execCommand: function (name, args) { + var command = this.commands.get(name); + + command.exec(this, args); + + this.eventDispatcher.notify('calculator.command_executed', { + command: command, + args: args + }); + }, + + evaluateStack: function () { + try { + if (this.expressionString.length > 0) { + this.output = this.calculusEngine.evaluate(this.expressionString); + } else { + this.output = null; + } + + this.lastError = null; + } catch (e) { + this.lastError = e; + this.output = null; + } + + this.expressionString = ''; + + this.eventDispatcher.notify('calculator.output_changed', { + output: this.output, + error: this.lastError + }); + }, + + keystroke: function (slot, button) { + var command = this.commands.get(button.command), + text = this.texts.get(button.text); + + if (!command.isInternal()) { + if (command.isInterrupting()) { + this.keystrokeLine.moveCaretToEnd(); + } + + this.keystrokeLine.hit({ + slot: slot, + text: text.screen, + command: button.command + }); + } else { + this.execCommand(command.id); + } + + if (command.isInterrupting()) { + this.execute(); + } + }, + + execute: function () { + var length = this.keystrokeLine.count(), + i; + + for (i = 0; i < length; i++) { + this.execCommand(this.keystrokeLine.at(i).command); + } + + this.eventDispatcher.notify('calculator.executed'); + + if (!this.lastError && this.output) { + try { + this.backup( + this.keystrokeLine.getAsText().join(''), + this.output + ); + } catch (e) {} + } + + this.keystrokeLine.reset(); + }, + + useButton: function (slot) { + if (typeof this.buttonUseCount[slot] === 'undefined') { + this.buttonUseCount[slot] = 0; + } + + this.buttonUseCount[slot]++; + }, + + getButtonUseCount: function (slot) { + return this.buttonUseCount[slot] || 0; + }, + + backup: function (expression, output) { + try { + // precompute output value for raising potentials exceptions, ugly hack though + output.getValue(); + + this.history.push({ + expression: expression, + output: output + }); + + this.eventDispatcher.notify('calculator.history_changed', this.history); + } catch (e) {} + } + + })); +})(); \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Calculus/Engine.js b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Calculus/Engine.js new file mode 100644 index 00000000..dbecb9bb --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Calculus/Engine.js @@ -0,0 +1,155 @@ +/*jshint plusplus: true*/ +/*global klass: true, Sankore: true*/ +(function () { + "use strict"; + + klass.define('Sankore.Calculus', 'Engine', klass.extend({ + constructor: function () { + this.expressions = []; + this.operators = []; + }, + + init: function () { + this.expressions = []; + this.operators = []; + }, + + evaluate: function (expressionString) { + var tokens = [], + lastToken, + penultimateToken, + item; + + expressionString = expressionString.replace(/\s+/g, ''); + + for (var i in expressionString) { + item = expressionString[i]; + + if (tokens.length > 0) { + lastToken = tokens[tokens.length - 1]; + } else { + lastToken = undefined; + } + + if (tokens.length > 1) { + penultimateToken = tokens[tokens.length - 2]; + } else { + penultimateToken = undefined; + } + + if ('0123456789.'.indexOf(item) !== -1) { + if ( + !isNaN(Number(lastToken)) || + lastToken === '.' || + lastToken === '-.' || + ( + lastToken === '-' && + ( + penultimateToken === '(' || + penultimateToken === undefined + ) + ) + ) { + tokens[tokens.length - 1] += item; + } else { + tokens.push(item); + } + } else { + tokens.push(item); + } + } + + for (var j in tokens) { + if (tokens[j].length > 1 && tokens[j].charAt(tokens[j].length - 1) === '.') { + throw Sankore.Util.Error.create('InvalidExpression', 'Trailing comma'); + } + } + + return this.computeExpression(tokens); + }, + + computeExpression: function (tokens) { + var operatorCheck = function (stack, token) { + var prec = Sankore.Calculus.BinaryOperation.getOperatorPrecedence, + top; + + while (true) { + top = stack.operators[stack.operators.length - 1]; + + if (stack.operators.length === 0 || top === '(' || prec(token) > prec(top)) { + return stack.operators.push(token); + } + + stack.reduce(); + } + }; + + this.init(); + + for (var i in tokens) { + switch (tokens[i]) { + case '(': + this.operators.push(tokens[i]); + break; + + case ')': + if (this.operators.length === 0) { + throw Sankore.Util.Error.create('InvalidExpression', 'Trailing closing brackets'); + } + + while (this.operators.length !== 0 && this.operators[this.operators.length - 1] !== '(') { + this.reduce(); + } + + if (this.operators[this.operators.length - 1] === '(') { + this.operators.pop(); // get rid of the extra paren '(' + } + + break; + + case '+': + case '-': + case '*': + case '/': + case ':': + operatorCheck(this, tokens[i]); + break; + + default: + this.expressions.push(Sankore.Calculus.Operand.create(tokens[i])); + } + } + + while (this.operators.length !== 0) { + this.reduce(); + } + + // if there's not one and only one expression in the stack, the expression is invalid + if (this.expressions.length !== 1) { + throw Sankore.Util.Error.create('InvalidExpression', '"' + tokens.join(' ') + '" is not a valid expression'); + } + + return this.expressions.pop(); + }, + + reduce: function () { + var right = this.expressions.pop(), + left = this.expressions.pop(), + operator = this.operators.pop(), + operation; + + if (typeof operator === 'undefined' || typeof left === 'undefined' || typeof right === 'undefined') { + throw Sankore.Util.Error.create('InvalidExpression', 'Invalid expression'); + } + + if (operator === ':') { + operation = Sankore.Calculus.EuclideanDivisionOperation.create(left, right); + } else { + operation = Sankore.Calculus.BinaryOperation.create(left, operator, right); + } + + this.expressions.push(operation); + } + + })); +})(); \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Calculus/Expression.js b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Calculus/Expression.js new file mode 100644 index 00000000..427820a5 --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Calculus/Expression.js @@ -0,0 +1,217 @@ +/*global klass:true, Sankore:true */ +(function () { + "use strict"; + + /** + * Base class for expression + */ + klass.define('Sankore.Calculus', 'Expression', klass.extend({ + constructor: function () { + + }, + + getValue: function () { + return null; + }, + + isInteger: function () { + try { + var value = this.getValue(); + + return value === Math.floor(value); + } catch (e) { + return 0; + } + }, + + toString: function () { + return ''; + }, + + isCompound: function () { + return false; + } + })); + + /** + * Calculus operand + */ + klass.define('Sankore.Calculus', 'Operand', Sankore.Calculus.Expression.extend({ + constructor: function (value) { + this.value = Number(value); + + if (isNaN(this.value)) { + throw Sankore.Util.Error.create('InvalidNumber', '"' + String(value) + '" is a not a number'); + } + }, + + getValue: function () { + return this.value; + }, + + toString: function () { + return String(this.value); + } + })); + + /** + * Unary operator (+, -) + */ + klass.define('Sankore.Calculus', 'Operation', Sankore.Calculus.Expression.extend({ + constructor: function (operator, right) { + this.operator = operator; + + if (!Sankore.Calculus.Expression.isPrototypeOf(right)) { + right = Sankore.Calculus.Operand.create(right); + } + + this.right = right; + }, + + getPrecedence: function () { + return Sankore.Calculus.Operation.getOperatorPrecedence(this.operator); + }, + + isLeftAssociative: function () { + return false; + }, + + isCompound: function () { + return true; + }, + + getValue: function () { + var value = Number(this.right.getValue()); + + if (this.operator === '-') { + value *= -1; + } + + return value; + }, + + toString: function () { + var string = this.right.toString(); + + if (this.operator !== '-') { + return string; + } + + if (this.right.isCompound()) { + string = '(' + string + ')'; + } + + return '-' + string; + } + })); + + Sankore.Calculus.Operation.getOperatorPrecedence = function (operator) { + switch (operator) { + case '+': + case '-': + return 1; + case '*': + case '/': + case ':': + return 2; + } + }; + + /** + * Binary operator (+, -, *, /) + */ + klass.define('Sankore.Calculus', 'BinaryOperation', Sankore.Calculus.Operation.extend({ + constructor: function (left, operator, right) { + Sankore.Calculus.Operation.constructor.call(this, operator, right); + + if (!Sankore.Calculus.Expression.isPrototypeOf(left)) { + left = Sankore.Calculus.Operand.create(left); + } + + this.left = left; + }, + + isLeftAssociative: function () { + return true; + }, + + getValue: function () { + var leftValue = this.left.getValue(), + rightValue = this.right.getValue(); + + switch (this.operator) { + case '+': + return leftValue + rightValue; + + case '-': + return leftValue - rightValue; + + case '*': + return leftValue * rightValue; + + case '/': + if (0 === rightValue) { + throw Sankore.Util.Error.create('ZeroDivision', 'Division by zero'); + } + + return leftValue / rightValue; + + default: + throw Sankore.Util.Error.create('InvalidOperator', 'This is not a valid operator : ' + this.operator); + } + }, + + toString: function () { + if (this.isInteger()) { + return String(this.getValue()); + } + + var leftString = this.left.toString(), + rightString = this.right.toString(), + string = ''; + + if (Sankore.Calculus.Operation.isPrototypeOf(this.left)) { + if (this.left.getPrecedence() < this.getPrecedence()) { + leftString = '(' + leftString + ')'; + } + } + + if (Sankore.Calculus.Operation.isPrototypeOf(this.right)) { + if (this.right.getPrecedence() < this.getPrecedence()) { + rightString = '(' + rightString + ')'; + } + } + + return leftString + String(this.operator) + rightString; + } + })); + + /** + * Euclidean division operator + */ + klass.define('Sankore.Calculus', 'EuclideanDivisionOperation', Sankore.Calculus.BinaryOperation.extend({ + constructor: function (left, right) { + Sankore.Calculus.BinaryOperation.constructor.call(this, left, ':', right); + }, + + getValue: function () { + var rightValue = this.right.getValue(); + + if (0 === rightValue) { + throw Sankore.Util.Error.create('ZeroDivision', 'Division by zero'); + } + + return Math.floor(this.left.getValue() / rightValue); + }, + + getRemainder: function () { + var rightValue = this.right.getValue(); + + if (0 === rightValue) { + throw Sankore.Util.Error.create('ZeroDivision', 'Division by zero'); + } + + return this.left.getValue() % rightValue; + } + })); +})(); \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Command.js b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Command.js new file mode 100644 index 00000000..cda111ca --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Command.js @@ -0,0 +1,52 @@ +/*global klass:true, Sankore:true*/ +(function () { + "use strict"; + + klass.define('Sankore', 'Command', klass.extend({ + constructor: function (id, name, closure) { + this.id = id; + this.name = name; + this.closure = closure; + }, + + getId: function () { + return this.id; + }, + + getName: function () { + return this.name; + }, + + exec: function (scope, args) { + this.closure.call(scope, args); + }, + + isInterrupting: function () { + return false; + }, + + isInternal: function () { + return false; + } + })); + + klass.define('Sankore', 'InterruptingCommand', Sankore.Command.extend({ + constructor: function (id, name, closure) { + Sankore.Command.constructor.call(this, id, name, closure); + }, + + isInterrupting: function () { + return true; + } + })); + + klass.define('Sankore', 'InternalCommand', Sankore.Command.extend({ + constructor: function (id, name, closure) { + Sankore.Command.constructor.call(this, id, name, closure); + }, + + isInternal: function () { + return true; + } + })); +})(); \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Editor/Editor.js b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Editor/Editor.js new file mode 100644 index 00000000..ae9dd50b --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Editor/Editor.js @@ -0,0 +1,341 @@ +/*jshint browser:true, devel:true */ +/*global klass:true, Sankore:true, _:true*/ +(function () { + "use strict"; + + klass.define('Sankore.Editor', 'Editor', klass.extend({ + constructor: function (calculator) { + + // state attributes + this.current = null; + this.activeButton = null; + this.enabled = false; + this.layouts = Sankore.Util.Hash.create({ + 'default': Sankore.Editor.Layout.create({ + id: 'default', + name: _('layout.classic_name'), + buttonMap: { + a1: Sankore.Button.create('mr', 'memoryRecall'), + b1: Sankore.Button.create('mc', 'memoryClear'), + c1: Sankore.Button.create('m+', 'memoryAdd'), + d1: Sankore.Button.create('m-', 'memorySub'), + + a2: Sankore.Button.create('op', 'op'), + b2: Sankore.Button.create('(', '('), + c2: Sankore.Button.create(')', ')'), + d2: Sankore.Button.create(':', ':'), + + a3: Sankore.Button.create('7', '7'), + b3: Sankore.Button.create('8', '8'), + c3: Sankore.Button.create('9', '9'), + d3: Sankore.Button.create('/', '/'), + + a4: Sankore.Button.create('4', '4'), + b4: Sankore.Button.create('5', '5'), + c4: Sankore.Button.create('6', '6'), + d4: Sankore.Button.create('*', '*'), + + a5: Sankore.Button.create('1', '1'), + b5: Sankore.Button.create('2', '2'), + c5: Sankore.Button.create('3', '3'), + d5: Sankore.Button.create('-', '-'), + + a6: Sankore.Button.create('0', '0'), + b6: Sankore.Button.create('.', '.'), + c6: Sankore.Button.create('=', '='), + d6: Sankore.Button.create('+', '+') + } + }) + }); + + // components + this.calculator = calculator; + this.ui = Sankore.UI.EditorInterface.create(this, this.calculator.eventDispatcher); + + this.attachEventHandlers(); + }, + + attachEventHandlers: function () { + var self = this, ed = this.calculator.eventDispatcher; + + // click on Add button + ed.addEventListener('editor_interface.add_click', function () { + var clone = self.createLayout(); + + self.setCurrentLayout(clone.id); + }); + + // click on Remove button + ed.addEventListener('editor_interface.remove_click', function () { + self.removeLayout(self.current); + + self.setCurrentLayout('default'); + }); + + // click on Run button + ed.addEventListener('editor_interface.run_click', this.runCurrentLayout.bind(this)); + + // load the new selected layout + ed.addEventListener('editor_interface.layout_select', function (layoutId) { + self.setCurrentLayout(layoutId); + }); + + // the layout name has changed + ed.addEventListener('editor_interface.layout_name_change', function (name) { + if (self.getCurrentLayout().name !== name && name.trim().length > 0) { + self.getCurrentLayout().name = name; + ed.notify('editor.layout_changed'); + } + }); + + // the layout description has changed + ed.addEventListener('editor_interface.layout_description_change', function (description) { + if (self.getCurrentLayout().description !== description) { + self.getCurrentLayout().description = description; + ed.notify('editor.layout_changed'); + } + }); + + // the command of a button has changed + ed.addEventListener('editor_interface.button_command_change', function (command) { + if (self.activeButton) { + self.getCurrentLayout().getButton(self.activeButton).command = command; + ed.notify('editor.layout_changed'); + } + }); + + // the text of a button has changed + ed.addEventListener('editor_interface.button_text_change', function (text) { + if (self.activeButton) { + var button = self.getCurrentLayout().getButton(self.activeButton); + button.text = text; + + ed.notify('editor.button_renamed', { + slot: self.activeButton, + button: button + }); + + ed.notify('editor.layout_changed'); + } + }); + + // the use limit of a button has changed + ed.addEventListener('editor_interface.button_uselimit_change', function (limit) { + if (self.activeButton) { + if (!isNaN(Number(limit))) { + self.getCurrentLayout().getButton(self.activeButton).useLimit = limit.length === 0 ? -1 : Number(limit); + ed.notify('editor.layout_changed'); + } + } + }); + + // a button is clicked + ed.addEventListener('main_interface.button_click', function (event) { + if (self.enabled) { + self.setActiveButton(event.slot); + } + }); + + // the editor button is click + ed.addEventListener('main_interface.editor_click', function () { + if (self.enabled) { + self.runCurrentLayout(); + } else { + self.enable(); + } + }); + + // the editor button is click + ed.addEventListener('main_interface.reset_click', function () { + if (self.enabled) { + self.resetActiveButton(); + } + }); + }, + + init: function (state) { + var self = this; + + if ('layouts' in state) { + this.loadLayouts(state.layouts); + } + + if ('enabled' in state) { + this.enabled = state.enabled; + } + + this.ui.render(this.calculator.ui); + + this.setCurrentLayout(('current' in state && state.current) ? state.current : 'default'); + + if (this.enabled) { + this.enable(); + } + + if ('activeButton' in state && this.enabled) { + this.setActiveButton(state.activeButton); + } + }, + + getState: function () { + return { + current: this.current, + activeButton: this.activeButton, + enabled: this.enabled, + layouts: this.layouts.map(function (id, layout) { + if (layout.isEditable()) { + return layout; + } + }) + }; + }, + + loadLayouts: function (layouts) { + var buttonMap = {}, + layout; + + for (var i in layouts) { + for (var slot in layouts[i].buttonMap) { + if (layouts[i].buttonMap.hasOwnProperty(slot)) { + buttonMap[slot] = Sankore.Button.create( + layouts[i].buttonMap[slot].text, + layouts[i].buttonMap[slot].command, + layouts[i].buttonMap[slot].useLimit + ); + } + } + + layout = Sankore.Editor.Layout.create({ + id: layouts[i].id, + name: layouts[i].name, + description: layouts[i].description, + buttonMap: buttonMap + }); + + layout.setEditable(true); + + this.layouts.add('id', [layout]); + } + }, + + getCurrentLayout: function () { + if (null === this.current) { + return null; + } + + return this.layouts.get(this.current); + }, + + setCurrentLayout: function (id) { + this.current = id; + + this.calculator.eventDispatcher.notify('editor.layout_selected', this.getCurrentLayout()); + + this.resetActiveButton(); + }, + + createLayout: function () { + var clone = this.layouts.get('default').clone(); + + clone.id = this.generateId(); + clone.name = _('layout.new_name'); + clone.setEditable(true); + + this.layouts.set(clone.id, clone); + this.calculator.eventDispatcher.notify('editor.layout_created'); + + return clone; + }, + + /** + * don't try to understand the purpose of this method, it just generates an unique string based upon the current widget url and current time + */ + generateId: function () { + var values = '', + date = new Date(), + id = 0, + i; + + for (i = 0; i < document.URL.length; i++) { + values += String(document.URL.charCodeAt(i) * (date.getMilliseconds() + date.getSeconds() + date.getMinutes())); + } + + values = values.match(/.{1,10}/g); + + for (i in values) { + id += Number(values[i]); + } + + return id.toString(36); + }, + + removeLayout: function (id) { + if (confirm(_('editor.remove_alert'))) { + this.layouts.remove(id); + + this.calculator.eventDispatcher.notify('editor.layout_removed'); + } + }, + + setActiveButton: function (slot) { + if (slot && this.getCurrentLayout().isEditable()) { + var button = this.getCurrentLayout().getButton(slot); + + if (button.isEditable()) { + this.calculator.eventDispatcher.notify('editor.button_selected', { + slot: slot, + button: button, + previousSlot: this.activeButton + }); + + this.activeButton = slot; + } + } else { + this.resetActiveButton(); + } + }, + + resetActiveButton: function () { + this.calculator.eventDispatcher.notify('editor.button_selected', { + slot: null, + button: null, + previousSlot: this.activeButton + }); + + this.activeButton = null; + }, + + enable: function () { + this.enabled = true; + this.setActiveButton(null); + this.calculator.eventDispatcher.notify('editor.show'); + }, + + disable: function () { + this.enabled = false; + this.setActiveButton(null); + this.calculator.eventDispatcher.notify('editor.hide'); + }, + + getAssignableCommands: function () { + return this.calculator.commands.map(function (k, v) { + if (!v.isInternal()) { + return v; + } + }); + }, + + getAssignableTexts: function () { + return this.calculator.texts.map(function (k, v) { + if (v.isEditable()) { + return v; + } + }); + }, + + runCurrentLayout: function () { + this.disable(); + } + + })); +})(); \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Editor/Layout.js b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Editor/Layout.js new file mode 100644 index 00000000..78724eda --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Editor/Layout.js @@ -0,0 +1,44 @@ +/*global klass:true, Sankore:true*/ +(function () { + "use strict"; + + klass.define('Sankore.Editor', 'Layout', klass.extend({ + constructor: function (data) { + this.id = data.id || null; + this.name = data.name || null; + this.description = data.description || null; + this.editable = false; + this.buttonMap = data.buttonMap || {}; + }, + + setEditable: function (editable) { + this.editable = !! editable; + }, + + isEditable: function () { + return this.editable; + }, + + getButton: function (slot) { + return this.buttonMap[slot] || null; + }, + + clone: function () { + var clonedMap = {}; + + for (var index in this.buttonMap) { + if (this.buttonMap.hasOwnProperty(index)) { + clonedMap[index] = this.buttonMap[index].clone(); + } + } + + return Sankore.Editor.Layout.create({ + id: this.id, + name: this.name, + description: this.description, + editable: this.editable, + buttonMap: clonedMap + }); + } + })); +})(); \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/KeystrokeLine.js b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/KeystrokeLine.js new file mode 100644 index 00000000..2bf658e6 --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/KeystrokeLine.js @@ -0,0 +1,109 @@ +/*global klass:true, Sankore:true*/ +(function () { + "use strict"; + + klass.define('Sankore', 'KeystrokeLine', klass.extend({ + constructor: function (dispatcher) { + this.dispatcher = dispatcher; + + this.keystrokes = []; + this.caret = 0; + }, + + notify: function () { + this.dispatcher.notify('keystroke_line.changed', this); + }, + + hit: function (keystroke) { + this.keystrokes.splice(this.caret, 0, keystroke); + this.caret++; + this.notify(); + }, + + del: function () { + if (this.caret > 0) { + var deleted = this.keystrokes.splice(this.caret - 1, 1)[0]; + this.caret--; + this.notify(); + + return deleted; + } + }, + + moveCaretLeft: function () { + if (this.caret > 0) { + this.caret--; + this.notify(); + } + }, + + moveCaretRight: function () { + if (this.caret < this.keystrokes.length) { + this.caret++; + this.notify(); + } + }, + + moveCaretToEnd: function () { + this.caret = this.keystrokes.length; + this.notify(); + }, + + reset: function () { + this.caret = 0; + this.keystrokes = []; + this.notify(); + }, + + count: function () { + return this.keystrokes.length; + }, + + at: function (index) { + if (typeof this.keystrokes[index] !== 'undefined') { + return this.keystrokes[index]; + } + + throw Sankore.Util.Error.create('OutOfRangeError', 'No keystroke at index ' + index); + }, + + getAsText: function () { + return [ + this.getTextAtRange(0, this.caret), + this.getTextAtRange(this.caret, this.keystrokes.length) + ]; + }, + + getTextAtRange: function (from, to) { + var i, output = ''; + + if (from < 0) { + throw Sankore.Util.Error.create('OutOfRangeError', 'Cannot get keystroke before index 0'); + } + + if (from > this.keystrokes.length) { + throw Sankore.Util.Error.create('OutOfRangeError', 'Cannot get keystroke after index ' + this.keystrokes.length); + } + + for (i = from; i < to; i++) { + output += this.at(i).text; + } + + return output; + }, + + getState: function () { + return { + keystrokes: this.keystrokes, + caret: this.caret + }; + }, + + loadState: function (state) { + this.keystrokes = state.keystrokes || {}; + this.caret = state.caret || 0; + this.notify(); + } + + })); +})(); \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Text.js b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Text.js new file mode 100644 index 00000000..cb47c641 --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Text.js @@ -0,0 +1,23 @@ +/*globals klass:true, Sankore:true*/ +(function() { + "use strict"; + + klass.define('Sankore', 'Text', klass.extend({ + constructor: function (id, screen, button, type, editable) { + this.id = id; + this.screen = screen; + this.button = button; + + this.type = typeof type !== 'undefined' ? type : 'normal'; + this.editable = typeof editable !== 'undefined' ? !!editable : true; + }, + + isEditable: function () { + return this.editable; + }, + + setEditable: function (editable) { + this.editable = !!editable; + } + })); +})(); \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/UI/EditorInterface.js b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/UI/EditorInterface.js new file mode 100644 index 00000000..0f8d5450 --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/UI/EditorInterface.js @@ -0,0 +1,323 @@ +/*jshint browser:true*/ +/*global klass:true, Sankore: true, _:true*/ +(function () { + "use strict"; + + klass.define('Sankore.UI', 'EditorInterface', klass.extend({ + constructor: function (editor, ed) { + this.editor = editor; + this.dispatcher = ed; + this.hidden = true; + + this.editArea = null; + this.layoutSelect = null; + this.layoutNameInput = null; + this.layoutDescriptionInput = null; + this.assignationDiv = null; + this.runButton = null; + this.addButton = null; + this.removeButton = null; + + this.attachEventListeners(); + + this.rendered = false; + }, + + attachEventListeners: function () { + var self = this; + + this.dispatcher.addEventListener('editor.show', this.show.bind(this)); + this.dispatcher.addEventListener('editor.hide', this.hide.bind(this)); + + this.dispatcher.addEventSubscriber({ + events: ['editor.layout_changed', 'editor.layout_created', 'editor.layout_removed'], + listener: this.updateLayoutSelectElement.bind(this) + }); + + this.dispatcher.addEventListener('editor.layout_selected', function (layout) { + self.loadLayout(layout); + + self.selectLayout(layout.id); + }); + + this.dispatcher.addEventListener('editor.button_selected', function (e) { + var context = e.button; + + if (null === context && self.editor.getCurrentLayout()) { + context = self.editor.getCurrentLayout().isEditable(); + } + + self.renderAssignation(context); + }); + }, + + _clearElement: function (element) { + while (element.firstChild) { + element.removeChild(element.firstChild); + } + }, + + _map: function (iterable, callback) { + var mapped = [], + idx; + + for (idx in iterable) { + if (iterable.hasOwnProperty(idx)) { + mapped.push(callback.call(iterable, iterable[idx], idx)); + } + } + + return mapped; + }, + + render: function (mainInterface) { + var layoutNameLabel, + layoutDescriptionLabel, + assignationDiv, + assignationText, + self = this; + + this.editArea = document.createElement('div'); + this.editArea.classList.add('edit-area'); + + this.layoutSelect = this.createLayoutSelectElement(); + this.editArea.appendChild(this.layoutSelect); + + this.addButton = document.createElement('button'); + this.addButton.className = 'small'; + this.addButton.setAttribute('type', 'button'); + this.addButton.addEventListener('click', function (e) { + self.dispatcher.notify('editor_interface.add_click'); + }); + + this.removeButton = this.addButton.cloneNode(); + this.removeButton.classList.add('remove'); + this.removeButton.addEventListener('click', function (e) { + self.dispatcher.notify('editor_interface.remove_click'); + }); + + this.addButton.classList.add('add'); + + this.editArea.appendChild(this.addButton); + this.editArea.appendChild(this.removeButton); + + this.editArea.appendChild(document.createElement('hr')); + + layoutNameLabel = document.createElement('label'); + layoutNameLabel.appendChild(document.createTextNode(_('editor.layout_name.label'))); + this.editArea.appendChild(layoutNameLabel); + + this.layoutNameInput = document.createElement('input'); + this.layoutNameInput.setAttribute('name', 'layout_name'); + this.layoutNameInput.setAttribute('type', 'text'); + this.layoutNameInput.setAttribute('maxlength', 32); + this.layoutNameInput.addEventListener('keyup', function (e) { + self.dispatcher.notify('editor_interface.layout_name_change', this.value); + }); + this.layoutNameInput.addEventListener('change', function (e) { + if (this.value.trim().length === 0) { + this.value = self.editor.getCurrentLayout().name; + self.dispatcher.notify('editor_interface.layout_name_change', this.value); + } + }); + this.editArea.appendChild(this.layoutNameInput); + + layoutDescriptionLabel = document.createElement('label'); + layoutDescriptionLabel.appendChild(document.createTextNode(_('editor.layout_description.label'))); + this.editArea.appendChild(layoutDescriptionLabel); + + this.layoutDescriptionInput = document.createElement('textarea'); + this.layoutDescriptionInput.setAttribute('name', 'layout_description'); + this.layoutDescriptionInput.setAttribute('maxlength', 140); + this.layoutDescriptionInput.addEventListener('keyup', function(e) { + self.dispatcher.notify('editor_interface.layout_description_change', this.value); + }); + this.editArea.appendChild(this.layoutDescriptionInput); + + this.assignationDiv = document.createElement('div'); + this.assignationDiv.classList.add('assignation'); + + this.editArea.appendChild(this.assignationDiv); + + this.runButton = document.createElement('button'); + this.runButton.classList.add('run'); + this.runButton.setAttribute('type', 'button'); + this.runButton.appendChild(document.createTextNode(_('editor.run_button'))); + this.runButton.addEventListener('click', function (e) { + self.dispatcher.notify('editor_interface.run_click'); + }); + + this.editArea.appendChild(this.runButton); + + mainInterface.rearScreen.parentElement.appendChild(this.editArea); + + this.rendered = true; + + this.hide(); + }, + + createSelectElement: function (data, name, className, selectedValue) { + var select = document.createElement('select'), + option; + + select.setAttribute('name', name); + + if (className) { + select.className = className; + } + + for (var i in data) { + option = document.createElement('option'); + option.setAttribute('value', data[i].value); + + if (typeof selectedValue !== 'undefined' && selectedValue === data[i].value) { + option.selected = true; + } + + option.appendChild(document.createTextNode(data[i].text)); + + select.appendChild(option); + } + + return select; + }, + + createLayoutSelectElement: function () { + var select = this.createSelectElement( + this.editor.layouts.map(function (k, layout) { + return { + text: layout.name, + value: layout.id + }; + }), + 'layouts', + 'layout-select', + this.editor.current + ), + self = this; + + select.addEventListener('change', function (e) { + self.dispatcher.notify('editor_interface.layout_select', this.value); + }); + + return select; + }, + + updateLayoutSelectElement: function () { + var select = this.createLayoutSelectElement(); + + this.editArea.replaceChild(select, this.layoutSelect); + + this.layoutSelect = select; + }, + + selectLayout: function (selected) { + this.layoutSelect.value = selected; + }, + + show: function () { + if (this.rendered) { + this.editArea.style.display = 'block'; + this.hidden = false; + } + }, + + hide: function () { + if (this.rendered) { + this.editArea.style.display = 'none'; + this.hidden = true; + } + }, + + loadLayout: function (layout) { + this.layoutNameInput.value = layout.name; + this.layoutNameInput.disabled = !layout.isEditable(); + + this.layoutDescriptionInput.value = layout.description; + this.layoutDescriptionInput.disabled = !layout.isEditable(); + + this.removeButton.disabled = !layout.isEditable(); + + this.renderAssignation(layout.isEditable()); + }, + + renderAssignation: function (context) { + var innerEl, textLabel, textSelect, commandLabel, commandSelect, useLabel, useInput, useHelp, + text, + self = this; + + if (false === context) { + innerEl = document.createElement('em'); + innerEl.appendChild(document.createTextNode(_('editor.assignation.disabled'))); + } else if (Sankore.Button.isPrototypeOf(context)) { + innerEl = document.createDocumentFragment(); + + textLabel = document.createElement('label'); + textLabel.appendChild(document.createTextNode(_('editor.assignation.text.label'))); + innerEl.appendChild(textLabel); + + text = this.editor.calculator.texts.get(context.text); + + textSelect = this.createSelectElement( + this._map(this.editor.getAssignableTexts(), function (text) { + return { + text: text.button, + value: text.id + }; + }), + 'button_text', + '', + text.id + ); + textSelect.addEventListener('change', function (e) { + self.dispatcher.notify('editor_interface.button_text_change', e.target.value); + }); + innerEl.appendChild(textSelect); + + commandLabel = document.createElement('label'); + commandLabel.appendChild(document.createTextNode(_('editor.assignation.command.label'))); + innerEl.appendChild(commandLabel); + + commandSelect = this.createSelectElement( + this._map(this.editor.getAssignableCommands(), function (command) { + return { + text: command.name, + value: command.id + }; + }), + 'button_command', + '', + context.command + ); + commandSelect.addEventListener('change', function (e) { + self.dispatcher.notify('editor_interface.button_command_change', e.target.value); + }); + innerEl.appendChild(commandSelect); + + useLabel = document.createElement('label'); + useLabel.appendChild(document.createTextNode(_('editor.assignation.use_limit.label'))); + innerEl.appendChild(useLabel); + + useInput = document.createElement('input'); + useInput.setAttribute('type', 'text'); + useInput.setAttribute('name', 'button_count'); + useInput.value = (context.useLimit === -1 ? '' : context.useLimit); + useInput.addEventListener('change', function (e) { + self.dispatcher.notify('editor_interface.button_uselimit_change', e.target.value); + }); + innerEl.appendChild(useInput); + + useHelp = document.createElement('span'); + useHelp.className = 'help'; + useHelp.appendChild(document.createTextNode(_('editor.assignation.use_limit.help'))); + innerEl.appendChild(useHelp); + } else { + innerEl = document.createElement('em'); + innerEl.appendChild(document.createTextNode(_('editor.assignation.enabled'))); + } + + this._clearElement(this.assignationDiv); + this.assignationDiv.appendChild(innerEl); + } + })); +})(); \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/UI/MainInterface.js b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/UI/MainInterface.js new file mode 100644 index 00000000..78ec419f --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/UI/MainInterface.js @@ -0,0 +1,534 @@ +/*jshint browser:true */ +/*global klass:true, Sankore:true, _:true*/ +(function () { + "use strict"; + + klass.define('Sankore.UI', 'MainInterface', klass.extend({ + constructor: function (id, ed, texts, withEditor) { + this.id = id; + this.dispatcher = ed; + this.texts = texts; + this.withEditor = withEditor; + + this.title = null; + + this.caret = document.createElement('i'); + this.caret.className = 'caret'; + + this.frontScreen = null; + this.expressionRow = null; + this.resultRow = null; + this.flagRow = null; + + this.flags = []; + + this.rearScreen = null; + + this.buttons = Sankore.Util.Hash.create(); + + this.rendered = false; + + this.attachEventListeners(); + }, + + attachEventListeners: function () { + var self = this; + + // the main screen text has changed + this.dispatcher.addEventListener('keystroke_line.changed', function (keystrokeLine) { + self.updateExpressionRow(keystrokeLine.getAsText()); + }); + + // the internal memory has changed + this.dispatcher.addEventListener('calculator.memory_changed', function (memory) { + if (null !== memory) { + self.addFlag('M'); + } else { + self.removeFlag('M'); + } + + self.updateFlagRow(); + }); + + // the op memory has changed + this.dispatcher.addEventListener('calculator.op_changed', function (op) { + if (null !== op) { + self.addFlag('OP'); + } else { + self.removeFlag('OP'); + } + + self.updateFlagRow(); + }); + + // a new result has been computed + this.dispatcher.addEventListener('calculator.output_changed', function (event) { + if (null !== event.output) { + self.updateResultRow(event.output); + } else if (null !== event.error) { + self.updateResultRow(event.error); + } else { + self.updateResultRow(''); + } + }); + + // the history has changed + this.dispatcher.addEventListener('calculator.history_changed', this.updateRearScreen.bind(this)); + + // a new layout is loaded + this.dispatcher.addEventListener('calculator.layout_loaded', function (layout) { + self.renderButtons(layout.buttonMap); + + self.changeTitle(layout.name); + + self.clearRearScreen(); + }); + + // a button has been disabled + this.dispatcher.addEventListener('calculator.button_disabled', function (event) { + var buttonEl = self.buttons.get(event.slot); + + if (buttonEl) { + buttonEl.disabled = true; + } + }); + + // a button has been enabled + this.dispatcher.addEventListener('calculator.button_enabled', function (slot) { + var buttonEl = self.buttons.get(slot); + + if (buttonEl) { + buttonEl.disabled = false; + } + }); + + // the editor is shown/hidden + this.dispatcher.addEventListener('editor.show', this.hideRearScreen.bind(this)); + this.dispatcher.addEventListener('editor.hide', this.showRearScreen.bind(this)); + + // a button has been selected + this.dispatcher.addEventListener('editor.button_selected', function (event) { + var newButtonEl = self.buttons.get(event.slot), + oldButtonEl = self.buttons.get(event.previousSlot); + + if (oldButtonEl) { + oldButtonEl.parentElement.classList.remove('edit'); + } + + if (newButtonEl) { + newButtonEl.parentElement.classList.add('edit'); + } + }); + + // a button has been renamed + this.dispatcher.addEventListener('editor.button_renamed', function (event) { + var buttonEl = self.buttons.get(event.slot), + text = self.texts.get(event.button.text), + hasEditClass; + + if (buttonEl) { + buttonEl.innerText = text.button; + + hasEditClass = buttonEl.parentElement.classList.contains('edit'); + buttonEl.parentElement.className = text.type; + + if (hasEditClass) { + buttonEl.parentElement.classList.add('edit'); + } + } + }); + }, + + _clearElement: function (element) { + while (element.firstChild) { + element.removeChild(element.firstChild); + } + }, + + getRootElement: function () { + return document.getElementById(this.id); + }, + + render: function () { + var root = this.getRootElement(); + + this._clearElement(root); + + if (!root.classList.contains('calculator')) { + root.classList.add('calculator'); + } + + this.createBaseMarkup(root); + + this.rearScreen = document.createElement('ul'); + root + .getElementsByClassName('rear-screen') + .item(0) + .appendChild(this.rearScreen); + + this.frontScreen = document.createElement('ul'); + root + .getElementsByClassName('front-screen') + .item(0) + .appendChild(this.frontScreen); + + this.expressionRow = document.createElement('li'); + this.expressionRow.classList.add('expression-row'); + this.frontScreen.appendChild(this.expressionRow); + + this.flagRow = document.createElement('li'); + this.flagRow.classList.add('flag-row'); + this.frontScreen.appendChild(this.flagRow); + + this.resultRow = document.createElement('li'); + this.resultRow.classList.add('result-row'); + this.frontScreen.appendChild(this.resultRow); + + this.rendered = true; + }, + + renderButtons: function (buttonMap) { + var buttonsTrs, + map = {}, + buttons = document.createDocumentFragment(), + rootElement = this + .getRootElement() + .getElementsByClassName('screen') + .item(0) + .parentElement; + + // map copy in order to prevent alteration of the original map + for (var slot in buttonMap) { + map[slot] = buttonMap[slot]; + } + + // adding constant non-editable buttons + map.a0 = Sankore.Button.create('s', 'del', -1, false); + map.b0 = Sankore.Button.create('l', 'left', -1, false); + map.c0 = Sankore.Button.create('r', 'right', -1, false); + map.d0 = Sankore.Button.create('c', 'clear', -1, false); + + buttonsTrs = rootElement.getElementsByClassName('buttons'); + while (buttonsTrs.length > 0) { + rootElement.removeChild(buttonsTrs[0]); + } + + buttonsTrs = this.createButtons(map); + + // we use a DocumentFragment to avoid excessive and useless repaints + for (var i in buttonsTrs) { + buttons.appendChild(buttonsTrs[i]); + } + + rootElement.appendChild(buttons); + }, + + createBaseMarkup: function (element) { + var table = document.createElement('table'), + tr = document.createElement('tr'), + rearTd = document.createElement('td'), + frontTd = document.createElement('td'); + + rearTd.className = 'rear-screen'; + rearTd.setAttribute('rowspan', '8'); + tr.appendChild(rearTd); + + frontTd.className = 'front-screen'; + frontTd.setAttribute('colspan', '4'); + tr.appendChild(frontTd); + + tr.className = 'screen'; + table.appendChild(tr); + + element.appendChild(this.createTitle()); + element.appendChild(this.createControls()); + element.appendChild(table); + }, + + createTitle: function () { + this.title = document.createElement('span'); + + this.title.appendChild(document.createTextNode('Chargement...')); + this.title.className = 'title'; + + return this.title; + }, + + createControls: function () { + var controlsDiv = document.createElement('div'), + editorButton = document.createElement('button'), + resetButton = document.createElement('button'), + self = this; + + if (this.withEditor) { + editorButton.setAttribute('type', 'button'); + editorButton.appendChild(document.createTextNode(_('controls.editor'))); + editorButton.addEventListener('click', function (e) { + self.dispatcher.notify('main_interface.editor_click'); + }); + controlsDiv.appendChild(editorButton); + } + + resetButton.setAttribute('type', 'button'); + resetButton.appendChild(document.createTextNode(_('controls.reset'))); + resetButton.addEventListener('click', function (e) { + self.dispatcher.notify('main_interface.reset_click'); + }); + controlsDiv.appendChild(resetButton); + + controlsDiv.className = 'controls'; + + return controlsDiv; + }, + + createButtons: function (buttonMap) { + var trs = [], + i; + + for (i = 0; i < 7; i++) { + trs.push(this.createButtonRow(i, buttonMap)); + } + + return trs; + }, + + createButtonRow: function (rowNumber, buttonMap) { + var tr = document.createElement('tr'), + i; + + tr.className = 'buttons'; + + for (i = 'a'; i <= 'd'; i = String.fromCharCode(i.charCodeAt(0) + 1)) { + tr.appendChild(this.createButton(i + rowNumber, buttonMap)); + } + + return tr; + }, + + createButton: function (slot, buttonMap) { + var td = document.createElement('td'), + self = this, + text, + buttonEl, + button = buttonMap[slot]; + + td.setAttribute('data-slot', slot); + td.setAttribute('data-editable', button.isEditable()); + + if (typeof button !== 'undefined') { + buttonEl = document.createElement('button'); + text = this.texts.get(button.text); + buttonEl.innerText = text.button; + + if (text.type !== 'normal') { + td.classList.add(text.type); + } + + buttonEl.addEventListener('mousedown', function (e) { + self.handleButtonClick(this, e, button, slot); + }); + + this.buttons.set(slot, buttonEl); + + this.dispatcher.notify('main_interface.button_created', { + button: button, + slot: slot + }); + + td.appendChild(buttonEl); + } + + return td; + }, + + handleButtonClick: function (el, event, button, slot) { + this.dispatcher.notify('main_interface.button_click', { + button: button, + slot: slot + }); + }, + + updateFlagRow: function () { + var span; + + this._clearElement(this.flagRow); + + for (var i in this.flags) { + span = document.createElement('span'); + span.appendChild(document.createTextNode(this.flags[i])); + + this.flagRow.appendChild(span); + } + }, + + updateExpressionRow: function (keystrokeText) { + this._clearElement(this.expressionRow); + this.expressionRow.appendChild(document.createTextNode(keystrokeText[0])); + this.expressionRow.appendChild(this.caret); + this.expressionRow.appendChild(document.createTextNode(keystrokeText[1])); + }, + + updateResultRow: function (result) { + this._clearElement(this.resultRow); + this.resultRow.appendChild(this.createResultRow(result)); + }, + + createResultRow: function (result) { + try { + if (Sankore.Calculus.EuclideanDivisionOperation.isPrototypeOf(result)) { + return this.createResultRowEuclidean(result.getValue(), result.getRemainder()); + } else if (Sankore.Calculus.Expression.isPrototypeOf(result)) { + return this.createResultRowExpression(result.getValue()); + } else if (Sankore.Util.Error.isPrototypeOf(result)) { + return this.createResultRowError(result); + } else { + return this.createResultRowText(String(result)); + } + } catch (e) { + return this.createResultRowError(e); + } + + return null; + }, + + createResultRowEuclidean: function (quotient, remainder) { + var p = document.createElement('p'), + quotientSpan = document.createElement('span'), + remainderSpan = document.createElement('span'); + + p.classList.add('euclidean'); + + remainderSpan.classList.add('remainder'); + remainderSpan.textContent = this.formatResultValue(remainder); + p.appendChild(remainderSpan); + + quotientSpan.classList.add('quotient'); + quotientSpan.textContent = this.formatResultValue(quotient); + p.appendChild(quotientSpan); + + return p; + }, + + createResultRowExpression: function (value) { + return document.createTextNode(this.formatResultValue(value)); + }, + + createResultRowText: function (text) { + return document.createTextNode(text); + }, + + createResultRowError: function (error) { + var errorDiv = document.createElement('div'), + text = _('error.common'); + + if (error.name === 'ZeroDivision') { + text = _('error.zero_division'); + } + + errorDiv.classList.add('error'); + errorDiv.appendChild(document.createTextNode(text)); + + return errorDiv; + }, + + formatResultValue: function (raw) { + var fixed = raw.toFixed(Math.max(0, 10 - raw.toFixed().length)), + last; + + if (fixed.indexOf('.') !== -1) { + while (true) { + last = fixed.charAt(fixed.length - 1); + + if (last === "0") { + fixed = fixed.slice(0, -1); + continue; + } + + if (last === '.') { + fixed = fixed.slice(0, -1); + } + + break; + } + } + + // si le nombre de chiffres dépassent 10, on tronque à 10 à droite + // et on arrondit au dernier (wtf) + if (Number(fixed) > (1e10 - 1)) { + fixed = Number(fixed.substring(0, 11) / 10).toFixed(); + } + + if (fixed.indexOf('.') !== -1) { + fixed = fixed.replace('.', _('text.comma')); + } + + return fixed; + }, + + updateRearScreen: function (history) { + var expressionRow, + resultRow, + rows = document.createDocumentFragment(); + + for (var i in history) { + expressionRow = document.createElement('li'); + expressionRow.className = 'expression-row'; + expressionRow.appendChild(document.createTextNode(history[i].expression)); + rows.appendChild(expressionRow); + + resultRow = document.createElement('li'); + resultRow.className = 'result-row'; + resultRow.appendChild(this.createResultRow(history[i].output)); + rows.appendChild(resultRow); + } + + this.clearRearScreen(); + this.rearScreen.appendChild(rows); + this.rearScreen.lastChild.scrollIntoView(); + }, + + clearRearScreen: function () { + this._clearElement(this.rearScreen); + }, + + showRearScreen: function () { + this.rearScreen.style.display = 'block'; + this.showTitle(); + }, + + hideRearScreen: function () { + this.rearScreen.style.display = 'none'; + this.hideTitle(); + }, + + addFlag: function (flag) { + if (this.flags.indexOf(flag) === -1) { + this.flags.push(flag); + + this.flags.sort(); + } + }, + + removeFlag: function (flag) { + var idx = this.flags.indexOf(flag); + if (idx !== -1) { + this.flags.splice(idx, 1); + + this.flags.sort(); + } + }, + + changeTitle: function (title) { + this._clearElement(this.title); + this.title.appendChild(document.createTextNode(title)); + }, + + showTitle: function () { + this.title.style.visibility = 'visible'; + }, + + hideTitle: function () { + this.title.style.visibility = 'hidden'; + } + })); +})(); \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Util/Error.js b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Util/Error.js new file mode 100644 index 00000000..a09c6d34 --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Util/Error.js @@ -0,0 +1,15 @@ +/*globals klass:true Sankore:true*/ +(function(){ + "use strict"; + + klass.define('Sankore.Util', 'Error', klass.extend({ + constructor: function (name, message) { + this.name = name; + this.message = message; + }, + + toString: function () { + return this.name + ': ' + this.message; + } + })); +})(); \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Util/EventDispatcher.js b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Util/EventDispatcher.js new file mode 100644 index 00000000..c18a0cf5 --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Util/EventDispatcher.js @@ -0,0 +1,48 @@ +/*globals klass: true, Sankore:true*/ +(function () { + "use strict"; + + klass.define('Sankore.Util', 'EventDispatcher', klass.extend({ + constructor: function () { + this.eventListeners = {}; + }, + + addEventSubscriber: function(subscriber) { + for (var i in subscriber.events) { + this.addEventListener(subscriber.events[i], subscriber.listener); + } + + return this; + }, + + addEventListener: function (event, closure, id) { + if (typeof this.eventListeners[event] === 'undefined') { + this.eventListeners[event] = []; + } + + if (typeof id === 'undefined') { + this.eventListeners[event].push(closure); + } else { + this.eventListeners[event][id] = closure; + } + + return this; + }, + + removeEventListener: function (event, id) { + delete this.eventListeners[event][id]; + }, + + removeAllEventListeners: function (event) { + this.eventListeners[event] = []; + }, + + notify: function (event, obj) { + var closure; + + for (closure in this.eventListeners[event]) { + this.eventListeners[event][closure](obj); + } + } + })); +})(); \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Util/Hash.js b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Util/Hash.js new file mode 100644 index 00000000..84c0b64a --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Util/Hash.js @@ -0,0 +1,78 @@ +/*globals klass: true, Sankore: true*/ +(function() { + "use strict"; + + klass.define('Sankore.Util', 'Hash', klass.extend({ + constructor: function (elements) { + this.elements = elements || {}; + }, + + length: function () { + return this.keys().length; + }, + + keys: function () { + return Object.keys(this.elements); + }, + + set: function (id, value) { + this.elements[id] = value; + }, + + add: function (id, values) { + for (var i in values) { + this.set(values[i][id], values[i]); + } + }, + + has: function (id) { + return this.keys().indexOf(id) !== -1; + }, + + get: function (id, def) { + if (typeof this.elements[id] !== 'undefined') { + return this.elements[id]; + } + + if (typeof def !== 'undefined') { + return def; + } + + return null; + }, + + pos: function (id) { + var pos = 0; + + for (var i in this.elements) { + if (this.elements.hasOwnProperty(i) && i === id) { + return pos; + } + + pos++; + } + + return null; + }, + + remove: function (id) { + return delete this.elements[id]; + }, + + map: function (closure) { + var output = [], + called; + + for (var id in this.elements) { + if (this.elements.hasOwnProperty(id)) { + called = closure.call(this, id, this.elements[id]); + if (called) { + output.push(called); + } + } + } + + return output; + } + })); +})(); \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Util/I18N.js b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Util/I18N.js new file mode 100644 index 00000000..2e666082 --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Util/I18N.js @@ -0,0 +1,45 @@ +/*jshint devel:true, browser:true*/ +/*globals klass:true, Sankore:true*/ +(function () { + "use strict"; + + klass.define('Sankore.Util', 'I18N', klass.extend({ + + catalogs: Sankore.Util.Hash.create(), + + constructor: function () { + this.catalog = {}; + }, + + load: function (locale) { + var localeId = locale.split(/-|_/)[0].toLowerCase(); + + if (!Sankore.Util.I18N.catalogs.has(localeId)) { + localeId = 'en'; + } + + this.catalog = Sankore.Util.I18N.catalogs.get(localeId, {}); + }, + + translate: function (id) { + return id.split('.').reduce( + function (root, id) { + if (root && id in root) { + return root[id]; + } + + return null; + }, + this.catalog + ) || id; + } + })); + + // global instance + Sankore.Util.i18n = Sankore.Util.I18N.create(); + + // global helper + window._ = function (id) { + return Sankore.Util.i18n.translate(id); + }; +})(); \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Util/i18n/messages.en.js b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Util/i18n/messages.en.js new file mode 100644 index 00000000..1b3e7495 --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Util/i18n/messages.en.js @@ -0,0 +1,74 @@ +(function() { + Sankore.Util.I18N.catalogs.set('en', { + layout: { + classic_name: 'Basic calculator', + new_name: 'New calculator' + }, + text: { + del: 'DEL', + comma: '.' + }, + command: { + zero: '0 digit', + one: '1 digit', + two: '2 digit', + three: '3 digit', + four: '4 digit', + five: '5 digit', + six: '6 digit', + seven: '7 digit', + eight: '8 digit', + nine: '9 digit', + plus: 'Addition', + minus: 'Subtraction', + times: 'Multiplication', + divide: 'Division', + euclidean_divide: 'Euclidean division', + equal: 'Equal', + comma: 'Comma', + open_parenthesis: 'Open parenthesis', + close_parenthesis: 'Close parenthesis', + op: 'Constant operator', + memory_add: 'Memory addition', + memory_sub: 'Memory substraction', + memory_recall: 'Memory recall', + memory_clear: 'Memory clear', + clear: 'Clear', + left: 'Move left', + right: 'Move right', + del: 'Delete' + }, + controls: { + editor: 'Editor', + reset: 'RST' + }, + editor: { + run_button: 'Run', + remove_alert: 'Delete this calculator?', + layout_name: { + label: 'Name' + }, + layout_description: { + label: 'Description' + }, + assignation: { + enabled: 'Click on a button to edit it', + disabled: 'This calculator is not editable', + text: { + label: 'Display text' + }, + command: { + label: 'Command' + }, + use_limit: { + label: 'Use limit', + help: '0 for disabled, empty for unlimited' + } + } + }, + error: { + common: 'Error', + zero_division: 'Div/0 error' + } + }); +})(); \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Util/i18n/messages.fr.js b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Util/i18n/messages.fr.js new file mode 100644 index 00000000..633b3ede --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/Util/i18n/messages.fr.js @@ -0,0 +1,74 @@ +(function() { + Sankore.Util.I18N.catalogs.set('fr', { + layout: { + classic_name: 'Calculatrice standard', + new_name: 'Nouvelle calculatrice' + }, + text: { + del: 'EFF', + comma: ',' + }, + command: { + zero: 'Chiffre 0', + one: 'Chiffre 1', + two: 'Chiffre 2', + three: 'Chiffre 3', + four: 'Chiffre 4', + five: 'Chiffre 5', + six: 'Chiffre 6', + seven: 'Chiffre 7', + eight: 'Chiffre 8', + nine: 'Chiffre 9', + plus: 'Addition', + minus: 'Soustraction', + times: 'Multiplication', + divide: 'Division', + euclidean_divide: 'Division euclidienne', + equal: 'Egalité', + comma: 'Virgule', + open_parenthesis: 'Parenthèse ouvrante', + close_parenthesis: 'Parenthèse fermante', + op: 'Opérateur constant', + memory_add: 'Addition mémoire', + memory_sub: 'Soustraction mémoire', + memory_recall: 'Rappel mémoire', + memory_clear: 'R.A.Z. mémoire', + clear: 'R.A.Z.', + left: 'Déplacement à gauche', + right: 'Déplacement à droite', + del: 'Suppression' + }, + controls: { + editor: 'Editeur', + reset: 'RAZ' + }, + editor: { + run_button: 'Utiliser', + remove_alert: 'Supprimer cette calculatrice ?', + layout_name: { + label: 'Nom' + }, + layout_description: { + label: 'Description' + }, + assignation: { + enabled: 'Cliquez sur une touche pour la modifier', + disabled: 'Cette calculatrice n\'est pas modifiable', + text: { + label: 'Texte à afficher' + }, + command: { + label: 'Commande' + }, + use_limit: { + label: 'Nb d\'utilisation', + help: '0 pour désactiver, vide pour illimité' + } + } + }, + error: { + common: 'Erreur', + zero_division: 'Erreur div/0' + } + }); +})(); \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/klass.js b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/klass.js new file mode 100644 index 00000000..e012f2c2 --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/js/src/Sankore/klass.js @@ -0,0 +1,78 @@ +/*global window:true*/ +(function () { + "use strict"; + + // polyfill + if (!Function.prototype.bind) { + Function.prototype.bind = function (oThis) { + if (typeof this !== "function") { + throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable"); + } + + var aArgs = Array.prototype.slice.call(arguments, 1), + fToBind = this, + fNOP = function () {}, + fBound = function () { + return fToBind.apply(this instanceof fNOP && oThis ? this : oThis, + aArgs.concat(Array.prototype.slice.call(arguments))); + }; + + fNOP.prototype = this.prototype; + fBound.prototype = new fNOP(); + + return fBound; + }; + } + + window.klass = { + create: function () { + var self = Object.create(this); + + if (typeof self.constructor === "function") { + self.constructor.apply(self, arguments); + } + + return self; + }, + + extend: function (object) { + var self = Object.create(this); + + if (!object) { + return self; + } + + Object.keys(object).forEach(function (key) { + self[key] = object[key]; + }); + + return self; + }, + + define: function (namespace, name, object) { + var createNamespace = function (namespace, root) { + var namespaceParts = namespace.split('.'), + first; + + if (namespaceParts.length > 0) { + first = namespaceParts.shift(); + + if (typeof root[first] === 'undefined') { + root[first] = {}; + } + + if (namespaceParts.length > 0) { + return createNamespace(namespaceParts.join('.'), root[first]); + } + + return root[first]; + } + + return null; + }, + ns = createNamespace(namespace, window); + + ns[name] = object; + } + }; +})(); \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/css/ubwidget.css b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/css/ubwidget.css new file mode 100644 index 00000000..f18d9ef5 --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/css/ubwidget.css @@ -0,0 +1,102 @@ +* { + margin: 0; + padding: 0; +} + +body{ + margin:0px; +} + +.ubw-container{ + float:left; + margin:3px; + margin-right:0px; + margin-top: 2px; + background-image:url(../images/back_small.png); + overflow: hidden; +} + +.ubw-body{ + margin:5px; + margin-left: 9px; + margin-right: 0px; +} + +.ubw-inspector{ + position:absolute; + background-color:rgb(252, 252, 252); + border:1px solid #cccccc; + line-height:20px; + font-family:Arial, Helvetica, sans-serif; + font-weight:normal; + font-size:20px; + color:#333333; +} + +.ubw-inpubox{ + min-width:28px; + min-height:37px; + color:#333333; + background-image: url(../images/button_out.png); + border-left:1px solid rgb(231, 231, 231); + border-right:1px solid rgb(231, 231, 231); + border-bottom:1px solid rgb(221, 221, 221); + border-top:1px solid rgb(241, 241, 241); +} + +/*BUTTONS*/ + +.ubw-button-wrapper{ + float:left; + position:relative; + /*border:solid 1px yellow;*/ + margin-right:-7px; + z-index:0; + font-family:Arial, Helvetica, sans-serif; + font-weight:normal; + font-size:30px; + overflow:visible; +} + +.ubw-button-canvas{ + width:auto; + float:left; + position:relative; + overflow:visible; +} + +table{ + line-height:90%; +} + +.ubw-button-body{ + position:relative; + float:left; + + width:auto; + height:auto; + overflow:visible + + text-align:center; + vertical-align:middle; + + cursor:pointer; +} + +.ubw-button-content{ + height:auto; + width:auto; + text-align:center; + overflow:visible; +} + + +.ubw-button-over{ +} + +.ubw-button-out{ +} + +span.colored{ + color: #0080ff; +} \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/arrows_out/bottom.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/arrows_out/bottom.png new file mode 100644 index 00000000..0298af41 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/arrows_out/bottom.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/arrows_out/left.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/arrows_out/left.png new file mode 100644 index 00000000..cbc75bd1 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/arrows_out/left.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/arrows_out/right.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/arrows_out/right.png new file mode 100644 index 00000000..342d529b Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/arrows_out/right.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/arrows_out/top.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/arrows_out/top.png new file mode 100644 index 00000000..da79ff3f Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/arrows_out/top.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/arrows_over/button_arrow_bottom.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/arrows_over/button_arrow_bottom.png new file mode 100644 index 00000000..fbdbdf6e Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/arrows_over/button_arrow_bottom.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/arrows_over/button_arrow_left.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/arrows_over/button_arrow_left.png new file mode 100644 index 00000000..91f95e00 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/arrows_over/button_arrow_left.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/arrows_over/button_arrow_right.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/arrows_over/button_arrow_right.png new file mode 100644 index 00000000..18a87c2e Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/arrows_over/button_arrow_right.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/arrows_over/button_arrow_top.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/arrows_over/button_arrow_top.png new file mode 100644 index 00000000..331cc814 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/arrows_over/button_arrow_top.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/back.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/back.png new file mode 100644 index 00000000..1be0a07d Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/back.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/back_small.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/back_small.png new file mode 100644 index 00000000..cc12a91b Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/back_small.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/button_out-copie.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/button_out-copie.png new file mode 100644 index 00000000..693fdb29 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/button_out-copie.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/button_out.gif b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/button_out.gif new file mode 100644 index 00000000..0667fd90 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/button_out.gif differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/button_out.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/button_out.png new file mode 100644 index 00000000..97f0ba7f Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/button_out.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/button_out_dark.gif b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/button_out_dark.gif new file mode 100644 index 00000000..5076069a Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/button_out_dark.gif differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/button_out_dark.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/button_out_dark.png new file mode 100644 index 00000000..897aca5b Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/button_out_dark.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/button_over.gif b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/button_over.gif new file mode 100644 index 00000000..5d6b25d9 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/button_over.gif differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/button_toggle.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/button_toggle.png new file mode 100644 index 00000000..b5260aa5 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/button_toggle.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/button_toggle_invert.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/button_toggle_invert.png new file mode 100644 index 00000000..e7b238a6 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/button_toggle_invert.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/buttons_shadow/back.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/buttons_shadow/back.png new file mode 100644 index 00000000..693aee55 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/buttons_shadow/back.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/buttons_shadow/bottom.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/buttons_shadow/bottom.png new file mode 100644 index 00000000..58b61419 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/buttons_shadow/bottom.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/buttons_shadow/cbottomleft.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/buttons_shadow/cbottomleft.png new file mode 100644 index 00000000..c88ce0ba Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/buttons_shadow/cbottomleft.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/buttons_shadow/cbottomright.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/buttons_shadow/cbottomright.png new file mode 100644 index 00000000..d9d84a93 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/buttons_shadow/cbottomright.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/buttons_shadow/ctopleft.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/buttons_shadow/ctopleft.png new file mode 100644 index 00000000..47e0e467 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/buttons_shadow/ctopleft.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/buttons_shadow/ctopright.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/buttons_shadow/ctopright.png new file mode 100644 index 00000000..c2eef3af Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/buttons_shadow/ctopright.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/buttons_shadow/left.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/buttons_shadow/left.png new file mode 100644 index 00000000..953cd503 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/buttons_shadow/left.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/buttons_shadow/right.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/buttons_shadow/right.png new file mode 100644 index 00000000..9f4ec365 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/buttons_shadow/right.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/buttons_shadow/top.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/buttons_shadow/top.png new file mode 100644 index 00000000..e51b93bd Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/buttons_shadow/top.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/pi.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/pi.png new file mode 100644 index 00000000..2d38a03b Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/pi.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/pi.psd b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/pi.psd new file mode 100644 index 00000000..3eafab60 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/pi.psd differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/pi_click.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/pi_click.png new file mode 100644 index 00000000..1781c44c Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/pi_click.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/pi_over.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/pi_over.png new file mode 100644 index 00000000..d2ada45d Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/pi_over.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/pow.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/pow.png new file mode 100644 index 00000000..c572dc71 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/pow.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/pow.psd b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/pow.psd new file mode 100644 index 00000000..0f669e95 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/pow.psd differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/sq.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/sq.png new file mode 100644 index 00000000..9f5ae3af Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/sq.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/sq.psd b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/sq.psd new file mode 100644 index 00000000..3348d2e0 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/sq.psd differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/sq_click.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/sq_click.png new file mode 100644 index 00000000..cd6c9abe Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/sq_click.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/sq_over.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/sq_over.png new file mode 100644 index 00000000..e04defd9 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/calculator/sq_over.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/display copy.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/display copy.png new file mode 100644 index 00000000..3147ca21 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/display copy.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/display.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/display.png new file mode 100644 index 00000000..f85717ac Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/display.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/historyback.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/historyback.png new file mode 100644 index 00000000..990438b4 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/historyback.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/historytab.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/historytab.png new file mode 100644 index 00000000..5495a496 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/historytab.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/historytabOver.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/historytabOver.png new file mode 100644 index 00000000..20aa3e32 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/historytabOver.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/inspector.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/inspector.png new file mode 100644 index 00000000..ac92bb3c Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/inspector.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche0.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche0.png new file mode 100644 index 00000000..d7bd4a10 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche0.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche0_over.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche0_over.png new file mode 100644 index 00000000..f109695e Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche0_over.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche0_over_down.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche0_over_down.png new file mode 100644 index 00000000..0b535f84 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche0_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche1.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche1.png new file mode 100644 index 00000000..1c516543 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche1.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche1_over.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche1_over.png new file mode 100644 index 00000000..4d743b0a Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche1_over.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche1_over_down.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche1_over_down.png new file mode 100644 index 00000000..51b4f6f2 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche1_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche2.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche2.png new file mode 100644 index 00000000..6f163a3c Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche2.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche2_over.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche2_over.png new file mode 100644 index 00000000..0172ae00 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche2_over.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche2_over_down.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche2_over_down.png new file mode 100644 index 00000000..a91c6904 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche2_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche3.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche3.png new file mode 100644 index 00000000..f9a185a0 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche3.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche3_over.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche3_over.png new file mode 100644 index 00000000..346a16bc Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche3_over.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche3_over_down.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche3_over_down.png new file mode 100644 index 00000000..deda1682 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche3_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche4.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche4.png new file mode 100644 index 00000000..afab40f8 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche4.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche4_over.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche4_over.png new file mode 100644 index 00000000..34d4b871 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche4_over.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche4_over_down.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche4_over_down.png new file mode 100644 index 00000000..4db5f1d2 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche4_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche5.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche5.png new file mode 100644 index 00000000..dd034da1 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche5.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche5_over.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche5_over.png new file mode 100644 index 00000000..d3fd966e Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche5_over.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche5_over_down.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche5_over_down.png new file mode 100644 index 00000000..9273be47 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche5_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche6.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche6.png new file mode 100644 index 00000000..8335e6da Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche6.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche6_over.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche6_over.png new file mode 100644 index 00000000..9acc3cf0 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche6_over.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche6_over_down.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche6_over_down.png new file mode 100644 index 00000000..3de03bdc Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche6_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche7.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche7.png new file mode 100644 index 00000000..cebe3359 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche7.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche7_over.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche7_over.png new file mode 100644 index 00000000..45c0a194 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche7_over.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche7_over_down.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche7_over_down.png new file mode 100644 index 00000000..424cc762 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche7_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche8.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche8.png new file mode 100644 index 00000000..7f34839f Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche8.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche8_over.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche8_over.png new file mode 100644 index 00000000..dd3d0f18 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche8_over.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche8_over_down.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche8_over_down.png new file mode 100644 index 00000000..aa0cf26a Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche8_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche9.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche9.png new file mode 100644 index 00000000..a888813a Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche9.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche9_over.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche9_over.png new file mode 100644 index 00000000..f70b6ad4 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche9_over.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche9_over_down.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche9_over_down.png new file mode 100644 index 00000000..6f8aee22 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touche9_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchec.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchec.png new file mode 100644 index 00000000..ab6e2d1b Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchec.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchec_over.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchec_over.png new file mode 100644 index 00000000..3b5b6543 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchec_over.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchec_over_down.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchec_over_down.png new file mode 100644 index 00000000..55b929f0 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchec_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchediv.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchediv.png new file mode 100644 index 00000000..f27311e2 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchediv.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchediv_over.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchediv_over.png new file mode 100644 index 00000000..355ee3b9 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchediv_over.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchediv_over_down.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchediv_over_down.png new file mode 100644 index 00000000..d9a5adf2 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchediv_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchedot.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchedot.png new file mode 100644 index 00000000..fdb9fc78 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchedot.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchedot_over.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchedot_over.png new file mode 100644 index 00000000..200ed22c Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchedot_over.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchedot_over_down.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchedot_over_down.png new file mode 100644 index 00000000..f823927d Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchedot_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/toucheeq.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/toucheeq.png new file mode 100644 index 00000000..1ee66a10 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/toucheeq.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/toucheeq_over.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/toucheeq_over.png new file mode 100644 index 00000000..bb096c0f Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/toucheeq_over.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/toucheeq_over_down.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/toucheeq_over_down.png new file mode 100644 index 00000000..b2da17ad Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/toucheeq_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchef.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchef.png new file mode 100644 index 00000000..ccfbdff2 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchef.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchef_over.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchef_over.png new file mode 100644 index 00000000..a7d5fc24 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchef_over.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchef_over_down.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchef_over_down.png new file mode 100644 index 00000000..d08cd888 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchef_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchem.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchem.png new file mode 100644 index 00000000..58f61ab9 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchem.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchem_over.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchem_over.png new file mode 100644 index 00000000..d548b55b Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchem_over.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchem_over_down.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchem_over_down.png new file mode 100644 index 00000000..9f5f76e6 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchem_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchep.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchep.png new file mode 100644 index 00000000..30107880 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchep.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchep_over.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchep_over.png new file mode 100644 index 00000000..3a0842b9 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchep_over.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchep_over_down.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchep_over_down.png new file mode 100644 index 00000000..ae1395ed Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchep_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchepd.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchepd.png new file mode 100644 index 00000000..e7ee0061 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchepd.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchepd_over.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchepd_over.png new file mode 100644 index 00000000..7ff3729e Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchepd_over.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchepd_over_down.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchepd_over_down.png new file mode 100644 index 00000000..ee4a28e8 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchepd_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchepg.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchepg.png new file mode 100644 index 00000000..7bfb1fd6 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchepg.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchepg_over.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchepg_over.png new file mode 100644 index 00000000..2846d467 Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchepg_over.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchepg_over_down.png b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchepg_over_down.png new file mode 100644 index 00000000..360f99cd Binary files /dev/null and b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/images/touchepg_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/js/src/calculate.js b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/js/src/calculate.js new file mode 100644 index 00000000..61933cc8 --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/js/src/calculate.js @@ -0,0 +1,74 @@ +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . +*/ + +function addChar(input, character) { + if(input.value == null || input.value == "0") + input.value = character + else + input.value += character +} + +function cos(form) { + form.display.value = Math.cos(form.display.value); +} + +function sin(form) { + form.display.value = Math.sin(form.display.value); +} + +function tan(form) { + form.display.value = Math.tan(form.display.value); +} + +function sqrt(form) { + form.display.value = Math.sqrt(form.display.value); +} + +function ln(form) { + form.display.value = Math.log(form.display.value); +} + +function exp(form) { + form.display.value = Math.exp(form.display.value); +} + +function deleteChar(input) { + input.value = input.value.substring(0, input.value.length - 1) +} + +function changeSign(input) { + if(input.value.substring(0, 1) == "-") + input.value = input.value.substring(1, input.value.length) + else + input.value = "-" + input.value +} + +function square(form) { + form.display.value = eval(form.display.value) * eval(form.display.value) +} + +function checkNum(str) { + for (var i = 0; i < str.length; i++) { + var ch = str.substring(i, i+1) + if (ch < "0" || ch > "9") { + if (ch != "/" && ch != "*" && ch != "+" && ch != "-" && ch != "." + && ch != "(" && ch!= ")") { + $("#display").text("ERROR"); + return false + } + } + } + return true +} \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/js/src/jquery.ubwidget.js b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/js/src/jquery.ubwidget.js new file mode 100644 index 00000000..808ff234 --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/js/src/jquery.ubwidget.js @@ -0,0 +1,255 @@ +(function($) { + jQuery.fn.ubwidget = function(options) { + var settings = jQuery.extend({}, jQuery.fn.ubwidget.defaults, options); + + $(window) + .bind("blur", function(event){ + }) + .trigger("focus"); + + return this.each(function() { + var ubwbody = $(this) + .addClass("ubw-body"); + + var ubwcontainer = $("
") + .append(ubwbody) + .addClass("ubw-container") + .css({ + width:settings.width, + height:settings.height + }) + .disableTextSelect(); + + $('body').append(ubwcontainer); + }); + }; + + // Default options + + jQuery.fn.ubwidget.defaults = { + width:200, + height:250 + }; + + // Shadows + + jQuery.fn.ubwshadows = function(settings){ + + var shadow = $("
") + .addClass("ubw-standard-corners") + .css({ + backgroundColor:"#333377", + opacity:".1", + filter: "alpha(opacity = 10)", + position:"absolute", + top:settings.t, + left:settings.l, + width:settings.w, + height:settings.h + }); + + $(this).before(shadow); + }; + + jQuery.fn.ubwbutton = function(size, arrows) { + var arrows = typeof(arrows) != "undefined" ? arrows = arrows : arrows = {top:0, right:0, bottom:0, left:0}; + var button = null; + var scale = 0.20; + var url = ""; + var buttonbody; + + + return this.each(function() { + button = $(this) + .addClass("ubw-button-wrapper") + .css({zIndex:0}); + + url = $(this).find("img").attr("src"); + url = url.split("."); + + var buttonContent = $("
") + .addClass("ubw-button-content"); + buttonContent.find("td").html($(this).html()); + $(this).empty(); + + var buttonCanvas = $("
") + .addClass("ubw-button-canvas") + .appendTo(button) + .html('
'); + + if(arrows.top)buttonCanvas.find(".ubw-button-arrowTop").children("img").css({visibility:"visible"}); + if(arrows.right)buttonCanvas.find(".ubw-button-arrowRight").children("img").css({visibility:"visible"}); + if(arrows.bottom)buttonCanvas.find(".ubw-button-arrowBottom").children("img").css({visibility:"visible"}); + if(arrows.left)buttonCanvas.find(".ubw-button-arrowLeft").children("img").css({visibility:"visible"}); + + var buttonBody = buttonCanvas.find(".ubw-button-body") + .addClass("ubw-button-out") + .append(buttonContent) + .bind("mouseenter", buttonOverHandler) + .bind("mouseleave", buttonOutHandler) + .bind("mousedown", buttonDownHandler) + .bind("mouseup", buttonUpHandler) + .css({ + width:size.w, + height:size.h + }); + + button.width(size.w+9).height(size.h+2); + buttonbody = buttonBody.find(".ubw-button-content"); + }); + + + function buttonOverHandler(e) { + buttonbody.find("img").attr("src", url[0]+"_over.png"); + + button.css({ + zIndex:1 + }); + }; + + function buttonOutHandler(e){ + buttonbody.find("img").attr("src", url[0]+".png"); + + button.css({ + zIndex:0 + }); + }; + + function buttonDownHandler(e){ + buttonbody.find("img").attr("src", url[0]+"_over_down.png"); + }; + + function buttonUpHandler(e){ + url[0] = url[0].replace("_down", ""); + buttonbody.find("img").attr("src", url[0]+"_over.png"); + }; + + }; + + jQuery.fn.ubwtoggle = function(activated, _firstFunc, _secondFunc) { + var activated = typeof(activated) != "undefined" ? activated = 1 : activated = 0; + + return this.each(function(){ + var button = $(this); + var buttonBody = button.find(".ubw-button-body"); + var img = buttonBody.find("img"); + var imgsrc = img.attr("src"); + + var firstFunc = _firstFunc; + var secondFunc = _secondFunc; + + buttonBody + .toggle( + function(){ + img.css({visibility:"hidden"}); + firstFunc(); + }, + function(){ + img.css({visibility:"visible"}); + secondFunc(); + } + ); + + if(activated){ + buttonBody.trigger("click"); + }; + }); + }; + + + jQuery.fn.ubwidget.sliderbutton = function() { + + }; + + jQuery.fn.ubwidget.inspector = function(_position, content, button){ + + var position = {x:_position.x, y:_position.y}; + + var catcher = $("
") + .css({ + position:"absolute", + width:"100%", + height:"100%" + }) + .mousedown(function(){ + inspector.hide(); + removeDropShadow(); + catcher.hide(); + //resizeubcanvas() + }); + + $("body").append(catcher); + catcher.hide(); + + var inspector = $("
") + .css({ + left:position.x, + top:position.y + }) + .append(content) + .appendTo($("body")) + .hide() + .disableTextSelect(); + + var inspectorWidth = inspector.width(); + var inspectorHeight = inspector.height(); + var windowWidth = $(window).width(); + var windowHeight = $(window).height(); + + $("body").prepend(button); + button.addClass("ubw-rounded") + .click(function(){ + catcher.show(); + inspector.show(); + dropShadow(); + resizeubcanvas() + }); + + function dropShadow (){ + inspector.ubwshadows({w:inspectorWidth+23,h:inspectorHeight+22,l:55,t:55})} + function removeDropShadow (){ + $(".ubw-shadow").remove()} + + // !! + $(".ubw-shadow") + .mousedown(function(){ + inspector.hide(); + removeDropShadow(); + catcher.hide(); + resizeubcanvas() + }); + + function resizeWidget(w, h){ + window.resizeTo(w+2, h+2); + $("#indicator").remove(); + var indicator = $("
") + .css({ + width:w, + height:h, + position:"absolute", + left:0, + top:0, + border:"1px solid #ff0000" + }); + //$("body").prepend(indicator); + } + + function resizeubcanvas(){ + + if(inspector.css("display")=="none"){ + resizeWidget(windowWidth, windowHeight); + return 0; + }; + + var inspectorbottom = inspector.position().top+inspector.height()+40; + var inspectorright = inspector.position().left+inspector.width()+40; + + if($(window).height(). + */ + +function init() { + var h = 292; + var w = 160; + var wh = h + 6; + var ww = w + 6; + var clickFlag = false; + + var ubwidget = $("#ubwidget").ubwidget({ + width: w, + height: h + }); + + var historyTab = $("
") + .css({ + height: h, + marginRight: 0, + width: 20, + float: "left", + backgroundImage: "url(images/historytab.png)", + backgroundRepeat: "no-repeat" + }) + .toggle( + function () { + resizeWidget(370, 294); + historyPanel.show(); + $(".ubw-container").css({ + backgroundImage: "url(images/back.png)", + width: 328 + }); + if (window.sankore) { + window.sankore.setPreference('historyTab', "visible"); + }; + }, + function () { + resizeWidget(200, 294); + historyPanel.hide(); + $(".ubw-container").css({ + backgroundImage: "url(images/back_small.png)", + width: 160 + }); + if (window.sankore) { + window.sankore.setPreference('historyTab', "hidden"); + }; + } + ) + .hover( + function () { + $(this).css({ + backgroundImage: "url(images/historytabOver.png)" + }); + }, + function () { + $(this).css({ + backgroundImage: "url(images/historytab.png)" + }); + } + ) + .appendTo($("body")); + + var space = $("
"); + space.css({ + width: 5, + height: 1, + float: "left" + }); + + var keysPanel = $("
").css({ + float: "left" + }); + var mode = "standard"; + var calc = ""; + var displayTrunk = ""; + var historyTrunk = ""; + var lastHistory = ""; + var subtrunk = 0; + var itrunk = 0; + var trunkpos = 0; + var lastchar = { + type: "NaN", + value: "null" + }; + var inparenthesis = false; + var erase = false; + var abtn; + var readyToCompute = false; + var lastResult = "0"; + var gDecimalSeparator = ""; + var gThousandsSeparator = ""; + var gDecimalCode = 0; + var gDecimalString = ""; + var gError = false; + + var historyTxt = "0"; + + var display = $("
0
") + .addClass("ubw-inputbox") + .css({ + padding: "12px", + marginLeft: "2px", + marginBottom: "9px", + marginTop: 7, + backgroundImage: "url(images/display.png)", + fontSize: "22px", + fontFamily: "Arial, Helvetica, Sans-serif", + color: "#777788", + width: 118, + height: 28, + overflow: "hidden", + textAlign: "right", + }); + + var standardPanel = $("
").css({ + float: "left" + }); + + var cKeySize = { + w: 33, + h: 36 + }; + + var btn7 = $("
").ubwbutton({ + w: cKeySize.w, + h: cKeySize.h + }) + .mousedown(function () { + appendToDisplay("7", 1) + }); + var btn8 = $("
").ubwbutton({ + w: cKeySize.w, + h: cKeySize.h + }) + .mousedown(function () { + appendToDisplay("8", 1) + }); + var btn9 = $("
").ubwbutton({ + w: cKeySize.w, + h: cKeySize.h + }) + .mousedown(function () { + appendToDisplay("9", 1) + }); + var btnDiv = $("
").ubwbutton({ + w: cKeySize.w, + h: cKeySize.h + }) + .mousedown(function () { + appendToDisplay("/", 0) + }); + var btn4 = $("
").ubwbutton({ + w: cKeySize.w, + h: cKeySize.h + }) + .mousedown(function () { + appendToDisplay("4", 1) + }); + var btn5 = $("
").ubwbutton({ + w: cKeySize.w, + h: cKeySize.h + }) + .mousedown(function () { + appendToDisplay("5", 1) + }); + var btn6 = $("
").ubwbutton({ + w: cKeySize.w, + h: cKeySize.h + }) + .mousedown(function () { + appendToDisplay("6", 1) + }); + var btnMul = $("
").ubwbutton({ + w: cKeySize.w, + h: cKeySize.h + }) + .mousedown(function () { + appendToDisplay("*", 0) + }); + var btn1 = $("
").ubwbutton({ + w: cKeySize.w, + h: cKeySize.h + }) + .mousedown(function () { + appendToDisplay("1", 1) + }); + var btn2 = $("
").ubwbutton({ + w: cKeySize.w, + h: cKeySize.h + }) + .mousedown(function () { + appendToDisplay("2", 1) + }); + var btn3 = $("
").ubwbutton({ + w: cKeySize.w, + h: cKeySize.h + }) + .mousedown(function () { + appendToDisplay("3", 1) + }); + var btnSou = $("
").ubwbutton({ + w: 68, + h: 34 + }) + .mousedown(function () { + appendToDisplay("-", 0) + }); + var btn0 = $("
").ubwbutton({ + w: cKeySize.w, + h: cKeySize.h + }) + .mousedown(function () { + appendToDisplay("0", 1) + }); + var btnDot = $("
").ubwbutton({ + w: cKeySize.w, + h: cKeySize.h + }) + .mousedown(function () { + appendToDisplay(".", 1) + }); + var btnC = $("
").ubwbutton({ + w: cKeySize.w, + h: cKeySize.h + }) + .mousedown(function () { + reset() + }); + var btnAdd = $("
").ubwbutton({ + w: 68, + h: 34 + }) + .mousedown(function () { + appendToDisplay("+", 0) + }); + var btnPaL = $("
").ubwbutton({ + w: cKeySize.w, + h: cKeySize.h + }) + .mousedown(function () { + appendToDisplay("(", 1) + }); + var btnPaR = $("
").ubwbutton({ + w: cKeySize.w, + h: cKeySize.h + }) + .mousedown(function () { + appendToDisplay(")", 1) + }); + var btnEqu = $("
").ubwbutton({ + w: cKeySize.w, + h: cKeySize.h + }) + .mousedown(function () { + compute() + }); + + var historyPanel = $("
") + .css({ + backgroundImage: "url(images/historyback.png)", + width: "auto", + height: "auto", + float: "left", + marginLeft: 3, + marginRight: 2, + marginTop: 6 + }) + .hide(); + + var historyBox = $("") + .css({ + padding: 10, + fontSize: "20px", + fontFamily: "Arial, Helvetica, Sans-serif", + width: 143, + height: 236, + backgroundColor: "transparent", + resize: "none", + border: "none", + overlay: "none", + color: "#eeeeee" + }) + .val("0"); + + historyPanel.append(historyBox); + + var stop = $("
"); + var sleft = $("
"); + var sright = $("
"); + + stop.css({ + width: 140 + }) + .append(btnAdd).append(btnSou) + .append(btn7).append(btn8).append(btn9).append(btnMul) + .append(btn4).append(btn5).append(btn6).append(btnDiv); + + sleft.css({ + width: 105, + float: "left" + }) + .append(btn1).append(btn2).append(btn3) + .append(btn0).append(btnDot).append(btnC); + + sright.css({ + width: 45, + float: "left" + }) + .append(btnEqu); + + + standardPanel.css({ + width: 150 + }) + .append(stop) + .append(sleft).append(sright); + + keysPanel + .append(display) + .append(standardPanel); + + ubwidget + .append(historyPanel) + .append(keysPanel); + + if (window.sankore) { + historyTxt = window.sankore.preference('historyTxt', historyTxt); + var ht = window.sankore.preference('historyTab', "hidden"); + $("#historyBox").val(historyTxt); + if (ht === "visible") { + historyTab.trigger("click"); + }; + } + + function resizeWidget(w, h) { + if (window.sankore) { + window.sankore.resize(w + 2, h + 2); + } + } + + function compute() { + var result; + if (calc.length <= 1) + result = eval(calc); + else { + var fNumber, lNumber, operation = "", + fMinus = ""; + if (calc.charAt(0) == '-') { + fMinus = "-"; + calc = calc.substr(1, calc.length); + } + operation = (calc.indexOf("+", 0) != -1) ? calc.charAt(calc.indexOf("+", 0)) : ((calc.indexOf("*", 0) != -1) ? calc.charAt(calc.indexOf("*", 0)) : ((calc.indexOf("/", 0) != -1) ? calc.charAt(calc.indexOf("/", 0)) : ((calc.indexOf("-", 0) != -1) ? calc.charAt(calc.indexOf("-", 0)) : ""))); + fNumber = fMinus + calc.substring(0, calc.indexOf(operation, 0)); + lNumber = calc.substring(calc.indexOf(operation, 0) + 1, calc.length); + result = calcIt(fNumber, operation, lNumber); + } + + $("#display").text(updateDisplay(result)); + lastResult = result; + lastchar.type = "Nan"; + lastchar.value = ""; + calc = ""; + + $("#historyBox").val($("#historyBox").val() + historyTrunk + "\n= " + updateDisplay(result) + "\n\n"); + $("#historyBox").scrollTop(99999); + + displayTrunk = ""; + historyTrunk = ""; + + if (window.sankore) { + window.sankore.setPreference('historyTxt', $("#historyBox").val()); + } + + lastHistory = $("#historyBox").val(); + } + + function calcIt(fNumber, operation, lNumber) { + var result, fCount = "", + lCount = "", + length = 0; + fCount = (fNumber.indexOf(".", 0) != -1) ? fNumber.substring(fNumber.indexOf(".", 0) + 1, fNumber.length) : ""; + lCount = (lNumber.indexOf(".", 0) != -1) ? lNumber.substring(lNumber.indexOf(".", 0) + 1, lNumber.length) : ""; + length = (fCount.length >= lCount.length) ? fCount.length : lCount.length; + length = Math.pow(10, length); + fNumber = Math.round(fNumber * length); + lNumber = Math.round(lNumber * length); + switch (operation) { + case "+": + result = (fNumber + lNumber) / length; + break; + case "-": + result = (fNumber - lNumber) / length; + break; + case "*": + result = (fNumber * lNumber) / Math.pow(length, 2); + break; + case "/": + result = fNumber / lNumber; + break; + } + return result; + } + + function reset() { + $("#display").text("0"); + calc = ""; + lastchar.type = "NaN"; + displayTrunk = ""; + historyTrunk = ""; + $("#historyBox").val(lastHistory); + $("#historyBox").scrollTop(99999); + } + + function formatNumberWithDelimiters(number) { + var delimiter = gThousandsSeparator; + var numString = number.toString(); + + if (!numString) + return "0"; + + var dot = numString.indexOf(gDecimalSeparator); + if (dot == -1) + dot = numString.length; + + var stop = numString.length - dot; + var characteristic = numString.substr(0, dot); + if (!parseInt(characteristic)) + return numString; + + // see if it's a negative number + var numIsNegative = (parseInt(characteristic) < 0) + + var newNumber = ""; + var delimiterCount = Math.floor((characteristic.length - 1) / 3); + var extras = characteristic.length % 3; + if (!extras && characteristic.length > 2) + extras = 3; + + if (extras) + newNumber = newNumber + characteristic.substr(0, extras); + + for (var i = 0; i < delimiterCount; i++) { + + if ((0 == i) && numIsNegative && (extras == 1)) + newNumber = newNumber + characteristic.substr(extras + (i * 3), 3); + else + newNumber = newNumber + delimiter + characteristic.substr(extras + (i * 3), 3); + } + + return (dot ? (newNumber + numString.substr(dot, stop)) : newNumber); + } + + + function formatNumberWithScientificNotation(number) { + if (number == 0) + return number; + + var numString = number.toString(); + if (!numString) + return "0"; + + var num = new Number(numString); + var sci = num.toExponential(5); + if (sci == "NaN") + sci = formatNumberWithDelimiters(numString); + if (!sci) + return "0"; + + return sci; + } + + function updateDisplay(number) { + if (String(number).length > 8) { + number = formatNumberWithScientificNotation(number); + } else { + number = number; + } + + return number; + } + + function appendToDisplay(_char, v) { + var char = _char; + + // Display + if ($("#historyBox").val() === "0") { + $("#historyBox").val(""); + }; + + if (char == "-" && lastchar.type == "NaN") { + char = "m"; + }; + + // char is a number + if (char <= 0 || char > 0 || char == "." || char == "m" || char == "(" || char == ")") { + if (char == "m") { + char = "-"; + }; + + if (lastchar.type == "NaN") { + displayTrunk = ""; + }; + + if (lastchar.value == "." && char == ".") { + calc = calc.substr(0, calc.length - 1); + displayTrunk = displayTrunk.substr(0, displayTrunk.length - 1); + }; + + if (calc == "0") { + if (char != "0") { + if (char != ".") { + calc = String(char); + displayTrunk = String(char); + historyTrunk = String(char); + lastchar.type = "Number"; + } else { + calc += String(char); + displayTrunk += String(char); + historyTrunk += String(char); + lastchar.type = "Number"; + } + } + } else { + char = (char == ".") ? ((displayTrunk.indexOf(".", 0) != -1) ? "" : ".") : char; + calc += String(char); + displayTrunk += String(char); + historyTrunk += String(char); + lastchar.type = "Number"; + } + } + // char is an operator + else { + if (calc.length === 0) { + var endCalc = calc; + calc = lastResult + endCalc; + historyTrunk = updateDisplay(lastResult); + } + + if (lastchar.type == "NaN") { + calc = calc.substr(0, calc.length - 1); + calc += char; + $("#historyBox").val($("#historyBox").val().substr(0, $("#historyBox").val().length - 1)); + } else { + try { + calc = eval(calc) + String(char); + } catch (e) {} + } + + lastchar.type = "NaN"; + try { + displayTrunk = eval(calc.substr(0, calc.length - 1)); + } catch (e) {} + $("#historyBox").val($("#historyBox").val() + historyTrunk + char); + $("#historyBox").scrollTop(99999); + historyTrunk = ""; + } + + lastchar.value = char; + $("#display").text(updateDisplay(displayTrunk)); + } + + $("#historyBox").click(function () { + if (!clickFlag) { + $(this).select(); + clickFlag = true; + } else { + clickFlag = false; + $(this).blur(); + } + }); + $(document).disableTextSelect(); +}; \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/js/vendor/jquery-1.3.2.min.js b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/js/vendor/jquery-1.3.2.min.js new file mode 100644 index 00000000..b1ae21d8 --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/js/vendor/jquery-1.3.2.min.js @@ -0,0 +1,19 @@ +/* + * jQuery JavaScript Library v1.3.2 + * http://jquery.com/ + * + * Copyright (c) 2009 John Resig + * Dual licensed under the MIT and GPL licenses. + * http://docs.jquery.com/License + * + * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) + * Revision: 6246 + */ +(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); +/* + * Sizzle CSS Selector Engine - v0.9.3 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return UT[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="

";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="
";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("
").append(M.responseText.replace(//g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='
';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/js/vendor/jquery-ui-1.7.2.custom.min.js b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/js/vendor/jquery-ui-1.7.2.custom.min.js new file mode 100644 index 00000000..cf19f30a --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/js/vendor/jquery-ui-1.7.2.custom.min.js @@ -0,0 +1,298 @@ +/* + * jQuery UI 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI + */ +jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.2",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;/* + * jQuery UI Draggable 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Draggables + * + * Depends: + * ui.core.js + */ +(function(a){a.widget("ui.draggable",a.extend({},a.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return}this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(b);if(!this.handle){return false}return true},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b);this._cacheHelperProportions();if(a.ui.ddmanager){a.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;if(c.cursorAt){this._adjustOffsetFromHelper(c.cursorAt)}if(c.containment){this._setContainment()}this._trigger("start",b);this._cacheHelperProportions();if(a.ui.ddmanager&&!c.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,b)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(b,true);return true},_mouseDrag:function(b,d){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!d){var c=this._uiHash();this._trigger("drag",b,c);this.position=c.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(a.ui.ddmanager){a.ui.ddmanager.drag(this,b)}return false},_mouseStop:function(c){var d=false;if(a.ui.ddmanager&&!this.options.dropBehaviour){d=a.ui.ddmanager.drop(this,c)}if(this.dropped){d=this.dropped;this.dropped=false}if((this.options.revert=="invalid"&&!d)||(this.options.revert=="valid"&&d)||this.options.revert===true||(a.isFunction(this.options.revert)&&this.options.revert.call(this.element,d))){var b=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){b._trigger("stop",c);b._clear()})}else{this._trigger("stop",c);this._clear()}return false},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==b.target){c=true}});return c},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c])):(d.helper=="clone"?this.element.clone():this.element);if(!b.parents("body").length){b.appendTo((d.appendTo=="parent"?this.element[0].parentNode:d.appendTo))}if(b[0]!=this.element[0]&&!(/(fixed|absolute)/).test(b.css("position"))){b.css("position","absolute")}return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined){this.offset.click.left=b.left+this.margins.left}if(b.right!=undefined){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if(b.top!=undefined){this.offset.click.top=b.top+this.margins.top}if(b.bottom!=undefined){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)&&e.containment.constructor!=Array){var c=a(e.containment)[0];if(!c){return}var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}else{if(e.containment.constructor==Array){this.containment=e.containment}}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c)),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c))}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(b[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.leftthis.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.topthis.containment[3])?g:(!(g-this.offset.click.topthis.containment[2])?f:(!(f-this.offset.click.left
').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(a(this).offset()).appendTo("body")})},stop:function(b,c){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});a.ui.plugin.add("draggable","opacity",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("opacity")){e._opacity=b.css("opacity")}b.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._opacity){a(c.helper).css("opacity",d._opacity)}}});a.ui.plugin.add("draggable","scroll",{start:function(c,d){var b=a(this).data("draggable");if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){b.overflowOffset=b.scrollParent.offset()}},drag:function(d,e){var c=a(this).data("draggable"),f=c.options,b=false;if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){if(!f.axis||f.axis!="x"){if((c.overflowOffset.top+c.scrollParent[0].offsetHeight)-d.pageY=0;v--){var s=g.snapElements[v].left,n=s+g.snapElements[v].width,m=g.snapElements[v].top,A=m+g.snapElements[v].height;if(!((s-y=p&&n<=k)||(m>=p&&m<=k)||(nk))&&((e>=g&&e<=c)||(d>=g&&d<=c)||(ec));break;default:return false;break}};a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,g){var b=a.ui.ddmanager.droppables[e.options.scope];var f=g?g.type:null;var h=(e.currentItem||e.element).find(":data(droppable)").andSelf();droppablesLoop:for(var d=0;d').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=j.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var k=this.handles.split(",");this.handles={};for(var f=0;f');if(/sw|se|ne|nw/.test(h)){g.css({zIndex:++j.zIndex})}if("se"==h){g.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[h]=".ui-resizable-"+h;this.element.append(g)}}this._renderAxis=function(p){p=p||this.element;for(var m in this.handles){if(this.handles[m].constructor==String){this.handles[m]=c(this.handles[m],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var n=c(this.handles[m],this.element),o=0;o=/sw|ne|nw|se|n|s/.test(m)?n.outerHeight():n.outerWidth();var l=["padding",/ne|nw|n/.test(m)?"Top":/se|sw|s/.test(m)?"Bottom":/^e$/.test(m)?"Right":"Left"].join("");p.css(l,o);this._proportionallyResize()}if(!c(this.handles[m]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!e.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}e.axis=i&&i[1]?i[1]:"se"}});if(j.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){c(this).removeClass("ui-resizable-autohide");e._handles.show()},function(){if(!e.resizing){c(this).addClass("ui-resizable-autohide");e._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var d=function(f){c(f).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){d(this.element);var e=this.element;e.parent().append(this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")})).end().remove()}this.originalElement.css("resize",this.originalResizeStyle);d(this.originalElement)},_mouseCapture:function(e){var f=false;for(var d in this.handles){if(c(this.handles[d])[0]==e.target){f=true}}return this.options.disabled||!!f},_mouseStart:function(f){var i=this.options,e=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(d.is(".ui-draggable")||(/absolute/).test(d.css("position"))){d.css({position:"absolute",top:e.top,left:e.left})}if(c.browser.opera&&(/relative/).test(d.css("position"))){d.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var j=b(this.helper.css("left")),g=b(this.helper.css("top"));if(i.containment){j+=c(i.containment).scrollLeft()||0;g+=c(i.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:j,top:g};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:j,top:g};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:f.pageX,top:f.pageY};this.aspectRatio=(typeof i.aspectRatio=="number")?i.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var h=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",h=="auto"?this.axis+"-resize":h);d.addClass("ui-resizable-resizing");this._propagate("start",f);return true},_mouseDrag:function(d){var g=this.helper,f=this.options,l={},p=this,i=this.originalMousePosition,m=this.axis;var q=(d.pageX-i.left)||0,n=(d.pageY-i.top)||0;var h=this._change[m];if(!h){return false}var k=h.apply(this,[d,q,n]),j=c.browser.msie&&c.browser.version<7,e=this.sizeDiff;if(this._aspectRatio||d.shiftKey){k=this._updateRatio(k,d)}k=this._respectSize(k,d);this._propagate("resize",d);g.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(k);this._trigger("resize",d,this.ui());return false},_mouseStop:function(g){this.resizing=false;var h=this.options,l=this;if(this._helper){var f=this._proportionallyResizeElements,d=f.length&&(/textarea/i).test(f[0].nodeName),e=d&&c.ui.hasScroll(f[0],"left")?0:l.sizeDiff.height,j=d?0:l.sizeDiff.width;var m={width:(l.size.width-j),height:(l.size.height-e)},i=(parseInt(l.element.css("left"),10)+(l.position.left-l.originalPosition.left))||null,k=(parseInt(l.element.css("top"),10)+(l.position.top-l.originalPosition.top))||null;if(!h.animate){this.element.css(c.extend(m,{top:k,left:i}))}l.helper.height(l.size.height);l.helper.width(l.size.width);if(this._helper&&!h.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",g);if(this._helper){this.helper.remove()}return false},_updateCache:function(d){var e=this.options;this.offset=this.helper.offset();if(a(d.left)){this.position.left=d.left}if(a(d.top)){this.position.top=d.top}if(a(d.height)){this.size.height=d.height}if(a(d.width)){this.size.width=d.width}},_updateRatio:function(g,f){var h=this.options,i=this.position,e=this.size,d=this.axis;if(g.height){g.width=(e.height*this.aspectRatio)}else{if(g.width){g.height=(e.width/this.aspectRatio)}}if(d=="sw"){g.left=i.left+(e.width-g.width);g.top=null}if(d=="nw"){g.top=i.top+(e.height-g.height);g.left=i.left+(e.width-g.width)}return g},_respectSize:function(k,f){var i=this.helper,h=this.options,q=this._aspectRatio||f.shiftKey,p=this.axis,s=a(k.width)&&h.maxWidth&&(h.maxWidthk.width),r=a(k.height)&&h.minHeight&&(h.minHeight>k.height);if(g){k.width=h.minWidth}if(r){k.height=h.minHeight}if(s){k.width=h.maxWidth}if(l){k.height=h.maxHeight}var e=this.originalPosition.left+this.originalSize.width,n=this.position.top+this.size.height;var j=/sw|nw|w/.test(p),d=/nw|ne|n/.test(p);if(g&&j){k.left=e-h.minWidth}if(s&&j){k.left=e-h.maxWidth}if(r&&d){k.top=n-h.minHeight}if(l&&d){k.top=n-h.maxHeight}var m=!k.width&&!k.height;if(m&&!k.left&&k.top){k.top=null}else{if(m&&!k.top&&k.left){k.left=null}}return k},_proportionallyResize:function(){var j=this.options;if(!this._proportionallyResizeElements.length){return}var f=this.helper||this.element;for(var e=0;e');var d=c.browser.msie&&c.browser.version<7,f=(d?1:0),g=(d?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+g,height:this.element.outerHeight()+g,position:"absolute",left:this.elementOffset.left-f+"px",top:this.elementOffset.top-f+"px",zIndex:++h.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(f,e,d){return{width:this.originalSize.width+e}},w:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{left:h.left+e,width:f.width-e}},n:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{top:h.top+d,height:f.height-d}},s:function(f,e,d){return{height:this.originalSize.height+d}},se:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},sw:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[f,e,d]))},ne:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},nw:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[f,e,d]))}},_propagate:function(e,d){c.ui.plugin.call(this,e,[d,this.ui()]);(e!="resize"&&this._trigger(e,d,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}));c.extend(c.ui.resizable,{version:"1.7.2",eventPrefix:"resize",defaults:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,cancel:":input,option",containment:false,delay:0,distance:1,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000}});c.ui.plugin.add("resizable","alsoResize",{start:function(e,f){var d=c(this).data("resizable"),g=d.options;_store=function(h){c(h).each(function(){c(this).data("resizable-alsoresize",{width:parseInt(c(this).width(),10),height:parseInt(c(this).height(),10),left:parseInt(c(this).css("left"),10),top:parseInt(c(this).css("top"),10)})})};if(typeof(g.alsoResize)=="object"&&!g.alsoResize.parentNode){if(g.alsoResize.length){g.alsoResize=g.alsoResize[0];_store(g.alsoResize)}else{c.each(g.alsoResize,function(h,i){_store(h)})}}else{_store(g.alsoResize)}},resize:function(f,h){var e=c(this).data("resizable"),i=e.options,g=e.originalSize,k=e.originalPosition;var j={height:(e.size.height-g.height)||0,width:(e.size.width-g.width)||0,top:(e.position.top-k.top)||0,left:(e.position.left-k.left)||0},d=function(l,m){c(l).each(function(){var p=c(this),q=c(this).data("resizable-alsoresize"),o={},n=m&&m.length?m:["width","height","top","left"];c.each(n||["width","height","top","left"],function(r,t){var s=(q[t]||0)+(j[t]||0);if(s&&s>=0){o[t]=s||null}});if(/relative/.test(p.css("position"))&&c.browser.opera){e._revertToRelativePosition=true;p.css({position:"absolute",top:"auto",left:"auto"})}p.css(o)})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.nodeType){c.each(i.alsoResize,function(l,m){d(l,m)})}else{d(i.alsoResize)}},stop:function(e,f){var d=c(this).data("resizable");if(d._revertToRelativePosition&&c.browser.opera){d._revertToRelativePosition=false;el.css({position:"relative"})}c(this).removeData("resizable-alsoresize-start")}});c.ui.plugin.add("resizable","animate",{stop:function(h,m){var n=c(this).data("resizable"),i=n.options;var g=n._proportionallyResizeElements,d=g.length&&(/textarea/i).test(g[0].nodeName),e=d&&c.ui.hasScroll(g[0],"left")?0:n.sizeDiff.height,k=d?0:n.sizeDiff.width;var f={width:(n.size.width-k),height:(n.size.height-e)},j=(parseInt(n.element.css("left"),10)+(n.position.left-n.originalPosition.left))||null,l=(parseInt(n.element.css("top"),10)+(n.position.top-n.originalPosition.top))||null;n.element.animate(c.extend(f,l&&j?{top:l,left:j}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var o={width:parseInt(n.element.css("width"),10),height:parseInt(n.element.css("height"),10),top:parseInt(n.element.css("top"),10),left:parseInt(n.element.css("left"),10)};if(g&&g.length){c(g[0]).css({width:o.width,height:o.height})}n._updateCache(o);n._propagate("resize",h)}})}});c.ui.plugin.add("resizable","containment",{start:function(e,q){var s=c(this).data("resizable"),i=s.options,k=s.element;var f=i.containment,j=(f instanceof c)?f.get(0):(/parent/.test(f))?k.parent().get(0):f;if(!j){return}s.containerElement=c(j);if(/document/.test(f)||f==document){s.containerOffset={left:0,top:0};s.containerPosition={left:0,top:0};s.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var m=c(j),h=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){h[p]=b(m.css("padding"+o))});s.containerOffset=m.offset();s.containerPosition=m.position();s.containerSize={height:(m.innerHeight()-h[3]),width:(m.innerWidth()-h[1])};var n=s.containerOffset,d=s.containerSize.height,l=s.containerSize.width,g=(c.ui.hasScroll(j,"left")?j.scrollWidth:l),r=(c.ui.hasScroll(j)?j.scrollHeight:d);s.parentData={element:j,left:n.left,top:n.top,width:g,height:r}}},resize:function(f,p){var s=c(this).data("resizable"),h=s.options,e=s.containerSize,n=s.containerOffset,l=s.size,m=s.position,q=s._aspectRatio||f.shiftKey,d={top:0,left:0},g=s.containerElement;if(g[0]!=document&&(/static/).test(g.css("position"))){d=n}if(m.left<(s._helper?n.left:0)){s.size.width=s.size.width+(s._helper?(s.position.left-n.left):(s.position.left-d.left));if(q){s.size.height=s.size.width/h.aspectRatio}s.position.left=h.helper?n.left:0}if(m.top<(s._helper?n.top:0)){s.size.height=s.size.height+(s._helper?(s.position.top-n.top):s.position.top);if(q){s.size.width=s.size.height*h.aspectRatio}s.position.top=s._helper?n.top:0}s.offset.left=s.parentData.left+s.position.left;s.offset.top=s.parentData.top+s.position.top;var k=Math.abs((s._helper?s.offset.left-d.left:(s.offset.left-d.left))+s.sizeDiff.width),r=Math.abs((s._helper?s.offset.top-d.top:(s.offset.top-n.top))+s.sizeDiff.height);var j=s.containerElement.get(0)==s.element.parent().get(0),i=/relative|absolute/.test(s.containerElement.css("position"));if(j&&i){k-=s.parentData.left}if(k+s.size.width>=s.parentData.width){s.size.width=s.parentData.width-k;if(q){s.size.height=s.size.width/s.aspectRatio}}if(r+s.size.height>=s.parentData.height){s.size.height=s.parentData.height-r;if(q){s.size.width=s.size.height*s.aspectRatio}}},stop:function(e,m){var p=c(this).data("resizable"),f=p.options,k=p.position,l=p.containerOffset,d=p.containerPosition,g=p.containerElement;var i=c(p.helper),q=i.offset(),n=i.outerWidth()-p.sizeDiff.width,j=i.outerHeight()-p.sizeDiff.height;if(p._helper&&!f.animate&&(/relative/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}if(p._helper&&!f.animate&&(/static/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}}});c.ui.plugin.add("resizable","ghost",{start:function(f,g){var d=c(this).data("resizable"),h=d.options,e=d.size;d.ghost=d.originalElement.clone();d.ghost.css({opacity:0.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof h.ghost=="string"?h.ghost:"");d.ghost.appendTo(d.helper)},resize:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost){d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})}},stop:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost&&d.helper){d.helper.get(0).removeChild(d.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(d,l){var n=c(this).data("resizable"),g=n.options,j=n.size,h=n.originalSize,i=n.originalPosition,m=n.axis,k=g._aspectRatio||d.shiftKey;g.grid=typeof g.grid=="number"?[g.grid,g.grid]:g.grid;var f=Math.round((j.width-h.width)/(g.grid[0]||1))*(g.grid[0]||1),e=Math.round((j.height-h.height)/(g.grid[1]||1))*(g.grid[1]||1);if(/^(se|s|e)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e}else{if(/^(ne)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e}else{if(/^(sw)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.left=i.left-f}else{n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e;n.position.left=i.left-f}}}}});var b=function(d){return parseInt(d,10)||0};var a=function(d){return !isNaN(parseInt(d,10))}})(jQuery);;/* + * jQuery UI Selectable 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Selectables + * + * Depends: + * ui.core.js + */ +(function(a){a.widget("ui.selectable",a.extend({},a.ui.mouse,{_init:function(){var b=this;this.element.addClass("ui-selectable");this.dragged=false;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]);c.each(function(){var d=a(this);var e=d.offset();a.data(this,"selectable-item",{element:this,$element:d,left:e.left,top:e.top,right:e.left+d.outerWidth(),bottom:e.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"),selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=c.addClass("ui-selectee");this._mouseInit();this.helper=a(document.createElement("div")).css({border:"1px dotted black"}).addClass("ui-selectable-helper")},destroy:function(){this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy()},_mouseStart:function(d){var b=this;this.opos=[d.pageX,d.pageY];if(this.options.disabled){return}var c=this.options;this.selectees=a(c.filter,this.element[0]);this._trigger("start",d);a(c.appendTo).append(this.helper);this.helper.css({"z-index":100,position:"absolute",left:d.clientX,top:d.clientY,width:0,height:0});if(c.autoRefresh){this.refresh()}this.selectees.filter(".ui-selected").each(function(){var e=a.data(this,"selectable-item");e.startselected=true;if(!d.metaKey){e.$element.removeClass("ui-selected");e.selected=false;e.$element.addClass("ui-unselecting");e.unselecting=true;b._trigger("unselecting",d,{unselecting:e.element})}});a(d.target).parents().andSelf().each(function(){var e=a.data(this,"selectable-item");if(e){e.$element.removeClass("ui-unselecting").addClass("ui-selecting");e.unselecting=false;e.selecting=true;e.selected=true;b._trigger("selecting",d,{selecting:e.element});return false}})},_mouseDrag:function(i){var c=this;this.dragged=true;if(this.options.disabled){return}var e=this.options;var d=this.opos[0],h=this.opos[1],b=i.pageX,g=i.pageY;if(d>b){var f=b;b=d;d=f}if(h>g){var f=g;g=h;h=f}this.helper.css({left:d,top:h,width:b-d,height:g-h});this.selectees.each(function(){var j=a.data(this,"selectable-item");if(!j||j.element==c.element[0]){return}var k=false;if(e.tolerance=="touch"){k=(!(j.left>b||j.rightg||j.bottomd&&j.righth&&j.bottom=0;b--){this.items[b].item.removeData("sortable-item")}},_mouseCapture:function(e,f){if(this.reverting){return false}if(this.options.disabled||this.options.type=="static"){return false}this._refreshItems(e);var d=null,c=this,b=a(e.target).parents().each(function(){if(a.data(this,"sortable-item")==c){d=a(this);return false}});if(a.data(e.target,"sortable-item")==c){d=a(e.target)}if(!d){return false}if(this.options.handle&&!f){var g=false;a(this.options.handle,d).find("*").andSelf().each(function(){if(this==e.target){g=true}});if(!g){return false}}this.currentItem=d;this._removeCurrentsFromItems();return true},_mouseStart:function(e,f,b){var g=this.options,c=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(e);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");a.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(e);this.originalPageX=e.pageX;this.originalPageY=e.pageY;if(g.cursorAt){this._adjustOffsetFromHelper(g.cursorAt)}this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(g.containment){this._setContainment()}if(g.cursor){if(a("body").css("cursor")){this._storedCursor=a("body").css("cursor")}a("body").css("cursor",g.cursor)}if(g.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",g.opacity)}if(g.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",g.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",e,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!b){for(var d=this.containers.length-1;d>=0;d--){this.containers[d]._trigger("activate",e,c._uiHash(this))}}if(a.ui.ddmanager){a.ui.ddmanager.current=this}if(a.ui.ddmanager&&!g.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,e)}this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(e);return true},_mouseDrag:function(f){this.position=this._generatePosition(f);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){var g=this.options,b=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-f.pageY=0;d--){var e=this.items[d],c=e.item[0],h=this._intersectsWithPointer(e);if(!h){continue}if(c!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=c&&!a.ui.contains(this.placeholder[0],c)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],c):true)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(e)){this._rearrange(f,e)}else{break}this._trigger("change",f,this._uiHash());break}}this._contactContainers(f);if(a.ui.ddmanager){a.ui.ddmanager.drag(this,f)}this._trigger("sort",f,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(c,d){if(!c){return}if(a.ui.ddmanager&&!this.options.dropBehaviour){a.ui.ddmanager.drop(this,c)}if(this.options.revert){var b=this;var e=b.placeholder.offset();b.reverting=true;a(this.helper).animate({left:e.left-this.offset.parent.left-b.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-b.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){b._clear(c)})}else{this._clear(c,d)}return false},cancel:function(){var b=this;if(this.dragging){this._mouseUp();if(this.options.helper=="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}for(var c=this.containers.length-1;c>=0;c--){this.containers[c]._trigger("deactivate",null,b._uiHash(this));if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",null,b._uiHash(this));this.containers[c].containerCache.over=0}}}if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}a.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){a(this.domPosition.prev).after(this.currentItem)}else{a(this.domPosition.parent).prepend(this.currentItem)}return true},serialize:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};a(b).each(function(){var e=(a(d.item||this).attr(d.attribute||"id")||"").match(d.expression||(/(.+)[-=_](.+)/));if(e){c.push((d.key||e[1]+"[]")+"="+(d.key&&d.expression?e[1]:e[2]))}});return c.join("&")},toArray:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};b.each(function(){c.push(a(d.item||this).attr(d.attribute||"id")||"")});return c},_intersectsWith:function(m){var e=this.positionAbs.left,d=e+this.helperProportions.width,k=this.positionAbs.top,j=k+this.helperProportions.height;var f=m.left,c=f+m.width,n=m.top,i=n+m.height;var o=this.offset.click.top,h=this.offset.click.left;var g=(k+o)>n&&(k+o)f&&(e+h)m[this.floating?"width":"height"])){return g}else{return(f0?"down":"up")},_getDragHorizontalDirection:function(){var b=this.positionAbs.left-this.lastPositionAbs.left;return b!=0&&(b>0?"right":"left")},refresh:function(b){this._refreshItems(b);this.refreshPositions()},_connectWith:function(){var b=this.options;return b.connectWith.constructor==String?[b.connectWith]:b.connectWith},_getItemsAsjQuery:function(b){var l=this;var g=[];var e=[];var h=this._connectWith();if(h&&b){for(var d=h.length-1;d>=0;d--){var k=a(h[d]);for(var c=k.length-1;c>=0;c--){var f=a.data(k[c],"sortable");if(f&&f!=this&&!f.options.disabled){e.push([a.isFunction(f.options.items)?f.options.items.call(f.element):a(f.options.items,f.element).not(".ui-sortable-helper"),f])}}}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper"),this]);for(var d=e.length-1;d>=0;d--){e[d][0].each(function(){g.push(this)})}return a(g)},_removeCurrentsFromItems:function(){var d=this.currentItem.find(":data(sortable-item)");for(var c=0;c=0;e--){var m=a(l[e]);for(var d=m.length-1;d>=0;d--){var g=a.data(m[d],"sortable");if(g&&g!=this&&!g.options.disabled){f.push([a.isFunction(g.options.items)?g.options.items.call(g.element[0],b,{item:this.currentItem}):a(g.options.items,g.element),g]);this.containers.push(g)}}}}for(var e=f.length-1;e>=0;e--){var k=f[e][1];var c=f[e][0];for(var d=0,n=c.length;d=0;d--){var e=this.items[d];if(e.instance!=this.currentContainer&&this.currentContainer&&e.item[0]!=this.currentItem[0]){continue}var c=this.options.toleranceElement?a(this.options.toleranceElement,e.item):e.item;if(!b){e.width=c.outerWidth();e.height=c.outerHeight()}var f=c.offset();e.left=f.left;e.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var d=this.containers.length-1;d>=0;d--){var f=this.containers[d].element.offset();this.containers[d].containerCache.left=f.left;this.containers[d].containerCache.top=f.top;this.containers[d].containerCache.width=this.containers[d].element.outerWidth();this.containers[d].containerCache.height=this.containers[d].element.outerHeight()}}},_createPlaceholder:function(d){var b=d||this,e=b.options;if(!e.placeholder||e.placeholder.constructor==String){var c=e.placeholder;e.placeholder={element:function(){var f=a(document.createElement(b.currentItem[0].nodeName)).addClass(c||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!c){f.style.visibility="hidden"}return f},update:function(f,g){if(c&&!e.forcePlaceholderSize){return}if(!g.height()){g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10))}if(!g.width()){g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=a(e.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);e.placeholder.update(b,b.placeholder)},_contactContainers:function(d){for(var c=this.containers.length-1;c>=0;c--){if(this._intersectsWith(this.containers[c].containerCache)){if(!this.containers[c].containerCache.over){if(this.currentContainer!=this.containers[c]){var h=10000;var g=null;var e=this.positionAbs[this.containers[c].floating?"left":"top"];for(var b=this.items.length-1;b>=0;b--){if(!a.ui.contains(this.containers[c].element[0],this.items[b].item[0])){continue}var f=this.items[b][this.containers[c].floating?"left":"top"];if(Math.abs(f-e)this.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.topthis.containment[3])?g:(!(g-this.offset.click.topthis.containment[2])?f:(!(f-this.offset.click.left=0;c--){if(a.ui.contains(this.containers[c].element[0],this.currentItem[0])&&!e){f.push((function(g){return function(h){g._trigger("receive",h,this._uiHash(this))}}).call(this,this.containers[c]));f.push((function(g){return function(h){g._trigger("update",h,this._uiHash(this))}}).call(this,this.containers[c]))}}}for(var c=this.containers.length-1;c>=0;c--){if(!e){f.push((function(g){return function(h){g._trigger("deactivate",h,this._uiHash(this))}}).call(this,this.containers[c]))}if(this.containers[c].containerCache.over){f.push((function(g){return function(h){g._trigger("out",h,this._uiHash(this))}}).call(this,this.containers[c]));this.containers[c].containerCache.over=0}}if(this._storedCursor){a("body").css("cursor",this._storedCursor)}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex)}this.dragging=false;if(this.cancelHelperRemoval){if(!e){this._trigger("beforeStop",d,this._uiHash());for(var c=0;c *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000}})})(jQuery);;/* + * jQuery UI Accordion 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Accordion + * + * Depends: + * ui.core.js + */ +(function(a){a.widget("ui.accordion",{_init:function(){var d=this.options,b=this;this.running=0;if(d.collapsible==a.ui.accordion.defaults.collapsible&&d.alwaysOpen!=a.ui.accordion.defaults.alwaysOpen){d.collapsible=!d.alwaysOpen}if(d.navigation){var c=this.element.find("a").filter(d.navigationFilter);if(c.length){if(c.filter(d.header).length){this.active=c}else{this.active=c.parent().parent().prev();c.addClass("ui-accordion-content-active")}}}this.element.addClass("ui-accordion ui-widget ui-helper-reset");if(this.element[0].nodeName=="UL"){this.element.children("li").addClass("ui-accordion-li-fix")}this.headers=this.element.find(d.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){a(this).removeClass("ui-state-focus")});this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");this.active=this._findActive(this.active||d.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");this.active.next().addClass("ui-accordion-content-active");a("").addClass("ui-icon "+d.icons.header).prependTo(this.headers);this.active.find(".ui-icon").toggleClass(d.icons.header).toggleClass(d.icons.headerSelected);if(a.browser.msie){this.element.find("a").css("zoom","1")}this.resize();this.element.attr("role","tablist");this.headers.attr("role","tab").bind("keydown",function(e){return b._keydown(e)}).next().attr("role","tabpanel");this.headers.not(this.active||"").attr("aria-expanded","false").attr("tabIndex","-1").next().hide();if(!this.active.length){this.headers.eq(0).attr("tabIndex","0")}else{this.active.attr("aria-expanded","true").attr("tabIndex","0")}if(!a.browser.safari){this.headers.find("a").attr("tabIndex","-1")}if(d.event){this.headers.bind((d.event)+".accordion",function(e){return b._clickHandler.call(b,e,this)})}},destroy:function(){var c=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role").unbind(".accordion").removeData("accordion");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabindex");this.headers.find("a").removeAttr("tabindex");this.headers.children(".ui-icon").remove();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active");if(c.autoHeight||c.fillHeight){b.css("height","")}},_setData:function(b,c){if(b=="alwaysOpen"){b="collapsible";c=!c}a.widget.prototype._setData.apply(this,arguments)},_keydown:function(e){var g=this.options,f=a.ui.keyCode;if(g.disabled||e.altKey||e.ctrlKey){return}var d=this.headers.length;var b=this.headers.index(e.target);var c=false;switch(e.keyCode){case f.RIGHT:case f.DOWN:c=this.headers[(b+1)%d];break;case f.LEFT:case f.UP:c=this.headers[(b-1+d)%d];break;case f.SPACE:case f.ENTER:return this._clickHandler({target:e.target},e.target)}if(c){a(e.target).attr("tabIndex","-1");a(c).attr("tabIndex","0");c.focus();return false}return true},resize:function(){var e=this.options,d;if(e.fillSpace){if(a.browser.msie){var b=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}d=this.element.parent().height();if(a.browser.msie){this.element.parent().css("overflow",b)}this.headers.each(function(){d-=a(this).outerHeight()});var c=0;this.headers.next().each(function(){c=Math.max(c,a(this).innerHeight()-a(this).height())}).height(Math.max(0,d-c)).css("overflow","auto")}else{if(e.autoHeight){d=0;this.headers.next().each(function(){d=Math.max(d,a(this).outerHeight())}).height(d)}}},activate:function(b){var c=this._findActive(b)[0];this._clickHandler({target:c},c)},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===false?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,f){var d=this.options;if(d.disabled){return false}if(!b.target&&d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var h=this.active.next(),e={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:h},c=(this.active=a([]));this._toggle(c,h,e);return false}var g=a(b.currentTarget||f);var i=g[0]==this.active[0];if(this.running||(!d.collapsible&&i)){return false}this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");if(!i){g.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").find(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);g.next().addClass("ui-accordion-content-active")}var c=g.next(),h=this.active.next(),e={options:d,newHeader:i&&d.collapsible?a([]):g,oldHeader:this.active,newContent:i&&d.collapsible?a([]):c.find("> *"),oldContent:h.find("> *")},j=this.headers.index(this.active[0])>this.headers.index(g[0]);this.active=i?a([]):g;this._toggle(c,h,e,i,j);return false},_toggle:function(b,i,g,j,k){var d=this.options,m=this;this.toShow=b;this.toHide=i;this.data=g;var c=function(){if(!m){return}return m._completed.apply(m,arguments)};this._trigger("changestart",null,this.data);this.running=i.size()===0?b.size():i.size();if(d.animated){var f={};if(d.collapsible&&j){f={toShow:a([]),toHide:i,complete:c,down:k,autoHeight:d.autoHeight||d.fillSpace}}else{f={toShow:b,toHide:i,complete:c,down:k,autoHeight:d.autoHeight||d.fillSpace}}if(!d.proxied){d.proxied=d.animated}if(!d.proxiedDuration){d.proxiedDuration=d.duration}d.animated=a.isFunction(d.proxied)?d.proxied(f):d.proxied;d.duration=a.isFunction(d.proxiedDuration)?d.proxiedDuration(f):d.proxiedDuration;var l=a.ui.accordion.animations,e=d.duration,h=d.animated;if(!l[h]){l[h]=function(n){this.slide(n,{easing:h,duration:e||700})}}l[h](f)}else{if(d.collapsible&&j){b.toggle()}else{i.hide();b.show()}c(true)}i.prev().attr("aria-expanded","false").attr("tabIndex","-1").blur();b.prev().attr("aria-expanded","true").attr("tabIndex","0").focus()},_completed:function(b){var c=this.options;this.running=b?0:--this.running;if(this.running){return}if(c.clearStyle){this.toShow.add(this.toHide).css({height:"",overflow:""})}this._trigger("change",null,this.data)}});a.extend(a.ui.accordion,{version:"1.7.2",defaults:{active:null,alwaysOpen:true,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase()}},animations:{slide:function(j,h){j=a.extend({easing:"swing",duration:300},j,h);if(!j.toHide.size()){j.toShow.animate({height:"show"},j);return}if(!j.toShow.size()){j.toHide.animate({height:"hide"},j);return}var c=j.toShow.css("overflow"),g,d={},f={},e=["height","paddingTop","paddingBottom"],b;var i=j.toShow;b=i[0].style.width;i.width(parseInt(i.parent().width(),10)-parseInt(i.css("paddingLeft"),10)-parseInt(i.css("paddingRight"),10)-(parseInt(i.css("borderLeftWidth"),10)||0)-(parseInt(i.css("borderRightWidth"),10)||0));a.each(e,function(k,m){f[m]="hide";var l=(""+a.css(j.toShow[0],m)).match(/^([\d+-.]+)(.*)$/);d[m]={value:l[1],unit:l[2]||"px"}});j.toShow.css({height:0,overflow:"hidden"}).show();j.toHide.filter(":hidden").each(j.complete).end().filter(":visible").animate(f,{step:function(k,l){if(l.prop=="height"){g=(l.now-l.start)/(l.end-l.start)}j.toShow[0].style[l.prop]=(g*d[l.prop].value)+d[l.prop].unit},duration:j.duration,easing:j.easing,complete:function(){if(!j.autoHeight){j.toShow.css("height","")}j.toShow.css("width",b);j.toShow.css({overflow:c});j.complete()}})},bounceslide:function(b){this.slide(b,{easing:b.down?"easeOutBounce":"swing",duration:b.down?1000:200})},easeslide:function(b){this.slide(b,{easing:"easeinout",duration:700})}}})})(jQuery);;/* + * jQuery UI Dialog 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Dialog + * + * Depends: + * ui.core.js + * ui.draggable.js + * ui.resizable.js + */ +(function(c){var b={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"},a="ui-dialog ui-widget ui-widget-content ui-corner-all ";c.widget("ui.dialog",{_init:function(){this.originalTitle=this.element.attr("title");var l=this,m=this.options,j=m.title||this.originalTitle||" ",e=c.ui.dialog.getTitleId(this.element),k=(this.uiDialog=c("
")).appendTo(document.body).hide().addClass(a+m.dialogClass).css({position:"absolute",overflow:"hidden",zIndex:m.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(n){(m.closeOnEscape&&n.keyCode&&n.keyCode==c.ui.keyCode.ESCAPE&&l.close(n))}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(n){l.moveToTop(false,n)}),g=this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(k),f=(this.uiDialogTitlebar=c("
")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(k),i=c('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){i.addClass("ui-state-hover")},function(){i.removeClass("ui-state-hover")}).focus(function(){i.addClass("ui-state-focus")}).blur(function(){i.removeClass("ui-state-focus")}).mousedown(function(n){n.stopPropagation()}).click(function(n){l.close(n);return false}).appendTo(f),h=(this.uiDialogTitlebarCloseText=c("")).addClass("ui-icon ui-icon-closethick").text(m.closeText).appendTo(i),d=c("").addClass("ui-dialog-title").attr("id",e).html(j).prependTo(f);f.find("*").add(f).disableSelection();(m.draggable&&c.fn.draggable&&this._makeDraggable());(m.resizable&&c.fn.resizable&&this._makeResizable());this._createButtons(m.buttons);this._isOpen=false;(m.bgiframe&&c.fn.bgiframe&&k.bgiframe());(m.autoOpen&&this.open())},destroy:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");this.uiDialog.remove();(this.originalTitle&&this.element.attr("title",this.originalTitle))},close:function(f){var d=this;if(false===d._trigger("beforeclose",f)){return}(d.overlay&&d.overlay.destroy());d.uiDialog.unbind("keypress.ui-dialog");(d.options.hide?d.uiDialog.hide(d.options.hide,function(){d._trigger("close",f)}):d.uiDialog.hide()&&d._trigger("close",f));c.ui.dialog.overlay.resize();d._isOpen=false;if(d.options.modal){var e=0;c(".ui-dialog").each(function(){if(this!=d.uiDialog[0]){e=Math.max(e,c(this).css("z-index"))}});c.ui.dialog.maxZ=e}},isOpen:function(){return this._isOpen},moveToTop:function(f,e){if((this.options.modal&&!f)||(!this.options.stack&&!this.options.modal)){return this._trigger("focus",e)}if(this.options.zIndex>c.ui.dialog.maxZ){c.ui.dialog.maxZ=this.options.zIndex}(this.overlay&&this.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=++c.ui.dialog.maxZ));var d={scrollTop:this.element.attr("scrollTop"),scrollLeft:this.element.attr("scrollLeft")};this.uiDialog.css("z-index",++c.ui.dialog.maxZ);this.element.attr(d);this._trigger("focus",e)},open:function(){if(this._isOpen){return}var e=this.options,d=this.uiDialog;this.overlay=e.modal?new c.ui.dialog.overlay(this):null;(d.next().length&&d.appendTo("body"));this._size();this._position(e.position);d.show(e.show);this.moveToTop(true);(e.modal&&d.bind("keypress.ui-dialog",function(h){if(h.keyCode!=c.ui.keyCode.TAB){return}var g=c(":tabbable",this),i=g.filter(":first")[0],f=g.filter(":last")[0];if(h.target==f&&!h.shiftKey){setTimeout(function(){i.focus()},1)}else{if(h.target==i&&h.shiftKey){setTimeout(function(){f.focus()},1)}}}));c([]).add(d.find(".ui-dialog-content :tabbable:first")).add(d.find(".ui-dialog-buttonpane :tabbable:first")).add(d).filter(":first").focus();this._trigger("open");this._isOpen=true},_createButtons:function(g){var f=this,d=false,e=c("
").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");this.uiDialog.find(".ui-dialog-buttonpane").remove();(typeof g=="object"&&g!==null&&c.each(g,function(){return !(d=true)}));if(d){c.each(g,function(h,i){c('').addClass("ui-state-default ui-corner-all").text(h).click(function(){i.apply(f.element[0],arguments)}).hover(function(){c(this).addClass("ui-state-hover")},function(){c(this).removeClass("ui-state-hover")}).focus(function(){c(this).addClass("ui-state-focus")}).blur(function(){c(this).removeClass("ui-state-focus")}).appendTo(e)});e.appendTo(this.uiDialog)}},_makeDraggable:function(){var d=this,f=this.options,e;this.uiDialog.draggable({cancel:".ui-dialog-content",handle:".ui-dialog-titlebar",containment:"document",start:function(){e=f.height;c(this).height(c(this).height()).addClass("ui-dialog-dragging");(f.dragStart&&f.dragStart.apply(d.element[0],arguments))},drag:function(){(f.drag&&f.drag.apply(d.element[0],arguments))},stop:function(){c(this).removeClass("ui-dialog-dragging").height(e);(f.dragStop&&f.dragStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}})},_makeResizable:function(g){g=(g===undefined?this.options.resizable:g);var d=this,f=this.options,e=typeof g=="string"?g:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",alsoResize:this.element,maxWidth:f.maxWidth,maxHeight:f.maxHeight,minWidth:f.minWidth,minHeight:f.minHeight,start:function(){c(this).addClass("ui-dialog-resizing");(f.resizeStart&&f.resizeStart.apply(d.element[0],arguments))},resize:function(){(f.resize&&f.resize.apply(d.element[0],arguments))},handles:e,stop:function(){c(this).removeClass("ui-dialog-resizing");f.height=c(this).height();f.width=c(this).width();(f.resizeStop&&f.resizeStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}}).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_position:function(i){var e=c(window),f=c(document),g=f.scrollTop(),d=f.scrollLeft(),h=g;if(c.inArray(i,["center","top","right","bottom","left"])>=0){i=[i=="right"||i=="left"?i:"center",i=="top"||i=="bottom"?i:"middle"]}if(i.constructor!=Array){i=["center","middle"]}if(i[0].constructor==Number){d+=i[0]}else{switch(i[0]){case"left":d+=0;break;case"right":d+=e.width()-this.uiDialog.outerWidth();break;default:case"center":d+=(e.width()-this.uiDialog.outerWidth())/2}}if(i[1].constructor==Number){g+=i[1]}else{switch(i[1]){case"top":g+=0;break;case"bottom":g+=e.height()-this.uiDialog.outerHeight();break;default:case"middle":g+=(e.height()-this.uiDialog.outerHeight())/2}}g=Math.max(g,h);this.uiDialog.css({top:g,left:d})},_setData:function(e,f){(b[e]&&this.uiDialog.data(b[e],f));switch(e){case"buttons":this._createButtons(f);break;case"closeText":this.uiDialogTitlebarCloseText.text(f);break;case"dialogClass":this.uiDialog.removeClass(this.options.dialogClass).addClass(a+f);break;case"draggable":(f?this._makeDraggable():this.uiDialog.draggable("destroy"));break;case"height":this.uiDialog.height(f);break;case"position":this._position(f);break;case"resizable":var d=this.uiDialog,g=this.uiDialog.is(":data(resizable)");(g&&!f&&d.resizable("destroy"));(g&&typeof f=="string"&&d.resizable("option","handles",f));(g||this._makeResizable(f));break;case"title":c(".ui-dialog-title",this.uiDialogTitlebar).html(f||" ");break;case"width":this.uiDialog.width(f);break}c.widget.prototype._setData.apply(this,arguments)},_size:function(){var e=this.options;this.element.css({height:0,minHeight:0,width:"auto"});var d=this.uiDialog.css({height:"auto",width:e.width}).height();this.element.css({minHeight:Math.max(e.minHeight-d,0),height:e.height=="auto"?"auto":Math.max(e.height-d,0)})}});c.extend(c.ui.dialog,{version:"1.7.2",defaults:{autoOpen:true,bgiframe:false,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1000},getter:"isOpen",uuid:0,maxZ:0,getTitleId:function(d){return"ui-dialog-title-"+(d.attr("id")||++this.uuid)},overlay:function(d){this.$el=c.ui.dialog.overlay.create(d)}});c.extend(c.ui.dialog.overlay,{instances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(d){return d+".dialog-overlay"}).join(" "),create:function(e){if(this.instances.length===0){setTimeout(function(){if(c.ui.dialog.overlay.instances.length){c(document).bind(c.ui.dialog.overlay.events,function(f){var g=c(f.target).parents(".ui-dialog").css("zIndex")||0;return(g>c.ui.dialog.overlay.maxZ)})}},1);c(document).bind("keydown.dialog-overlay",function(f){(e.options.closeOnEscape&&f.keyCode&&f.keyCode==c.ui.keyCode.ESCAPE&&e.close(f))});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var d=c("
").appendTo(document.body).addClass("ui-widget-overlay").css({width:this.width(),height:this.height()});(e.options.bgiframe&&c.fn.bgiframe&&d.bgiframe());this.instances.push(d);return d},destroy:function(d){this.instances.splice(c.inArray(this.instances,d),1);if(this.instances.length===0){c([document,window]).unbind(".dialog-overlay")}d.remove();var e=0;c.each(this.instances,function(){e=Math.max(e,this.css("z-index"))});this.maxZ=e},height:function(){if(c.browser.msie&&c.browser.version<7){var e=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var d=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(e
");if(!c.values){c.values=[this._valueMin(),this._valueMin()]}if(c.values.length&&c.values.length!=2){c.values=[c.values[0],c.values[0]]}}else{this.range=a("
")}this.range.appendTo(this.element).addClass("ui-slider-range");if(c.range=="min"||c.range=="max"){this.range.addClass("ui-slider-range-"+c.range)}this.range.addClass("ui-widget-header")}if(a(".ui-slider-handle",this.element).length==0){a('
').appendTo(this.element).addClass("ui-slider-handle")}if(c.values&&c.values.length){while(a(".ui-slider-handle",this.element).length').appendTo(this.element).addClass("ui-slider-handle")}}this.handles=a(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(d){d.preventDefault()}).hover(function(){if(!c.disabled){a(this).addClass("ui-state-hover")}},function(){a(this).removeClass("ui-state-hover")}).focus(function(){if(!c.disabled){a(".ui-slider .ui-state-focus").removeClass("ui-state-focus");a(this).addClass("ui-state-focus")}else{a(this).blur()}}).blur(function(){a(this).removeClass("ui-state-focus")});this.handles.each(function(d){a(this).data("index.ui-slider-handle",d)});this.handles.keydown(function(i){var f=true;var e=a(this).data("index.ui-slider-handle");if(b.options.disabled){return}switch(i.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:f=false;if(!b._keySliding){b._keySliding=true;a(this).addClass("ui-state-active");b._start(i,e)}break}var g,d,h=b._step();if(b.options.values&&b.options.values.length){g=d=b.values(e)}else{g=d=b.value()}switch(i.keyCode){case a.ui.keyCode.HOME:d=b._valueMin();break;case a.ui.keyCode.END:d=b._valueMax();break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(g==b._valueMax()){return}d=g+h;break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(g==b._valueMin()){return}d=g-h;break}b._slide(i,e,d);return f}).keyup(function(e){var d=a(this).data("index.ui-slider-handle");if(b._keySliding){b._stop(e,d);b._change(e,d);b._keySliding=false;a(this).removeClass("ui-state-active")}});this._refreshValue()},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy()},_mouseCapture:function(d){var e=this.options;if(e.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var h={x:d.pageX,y:d.pageY};var j=this._normValueFromMouse(h);var c=this._valueMax()-this._valueMin()+1,f;var k=this,i;this.handles.each(function(l){var m=Math.abs(j-k.values(l));if(c>m){c=m;f=a(this);i=l}});if(e.range==true&&this.values(1)==e.min){f=a(this.handles[++i])}this._start(d,i);k._handleIndex=i;f.addClass("ui-state-active").focus();var g=f.offset();var b=!a(d.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=b?{left:0,top:0}:{left:d.pageX-g.left-(f.width()/2),top:d.pageY-g.top-(f.height()/2)-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};j=this._normValueFromMouse(h);this._slide(d,i,j);return true},_mouseStart:function(b){return true},_mouseDrag:function(d){var b={x:d.pageX,y:d.pageY};var c=this._normValueFromMouse(b);this._slide(d,this._handleIndex,c);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._handleIndex=null;this._clickOffset=null;return false},_detectOrientation:function(){this.orientation=this.options.orientation=="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(d){var c,h;if("horizontal"==this.orientation){c=this.elementSize.width;h=d.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{c=this.elementSize.height;h=d.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}var f=(h/c);if(f>1){f=1}if(f<0){f=0}if("vertical"==this.orientation){f=1-f}var e=this._valueMax()-this._valueMin(),i=f*e,b=i%this.options.step,g=this._valueMin()+i-b;if(b>(this.options.step/2)){g+=this.options.step}return parseFloat(g.toFixed(5))},_start:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("start",d,b)},_slide:function(f,e,d){var g=this.handles[e];if(this.options.values&&this.options.values.length){var b=this.values(e?0:1);if((this.options.values.length==2&&this.options.range===true)&&((e==0&&d>b)||(e==1&&d1){this.options.values[b]=e;this._refreshValue(c);if(!d){this._change(null,b)}}if(arguments.length){if(this.options.values&&this.options.values.length){return this._values(b)}else{return this.value()}}else{return this._values()}},_setData:function(b,d,c){a.widget.prototype._setData.apply(this,arguments);switch(b){case"disabled":if(d){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled")}else{this.handles.removeAttr("disabled")}case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue(c);break;case"value":this._refreshValue(c);break}},_step:function(){var b=this.options.step;return b},_value:function(){var b=this.options.value;if(bthis._valueMax()){b=this._valueMax()}return b},_values:function(b){if(arguments.length){var c=this.options.values[b];if(cthis._valueMax()){c=this._valueMax()}return c}else{return this.options.values}},_valueMin:function(){var b=this.options.min;return b},_valueMax:function(){var b=this.options.max;return b},_refreshValue:function(c){var f=this.options.range,d=this.options,l=this;if(this.options.values&&this.options.values.length){var i,h;this.handles.each(function(p,n){var o=(l.values(p)-l._valueMin())/(l._valueMax()-l._valueMin())*100;var m={};m[l.orientation=="horizontal"?"left":"bottom"]=o+"%";a(this).stop(1,1)[c?"animate":"css"](m,d.animate);if(l.options.range===true){if(l.orientation=="horizontal"){(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({left:o+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({width:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}else{(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({bottom:(o)+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({height:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}}lastValPercent=o})}else{var j=this.value(),g=this._valueMin(),k=this._valueMax(),e=k!=g?(j-g)/(k-g)*100:0;var b={};b[l.orientation=="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[c?"animate":"css"](b,d.animate);(f=="min")&&(this.orientation=="horizontal")&&this.range.stop(1,1)[c?"animate":"css"]({width:e+"%"},d.animate);(f=="max")&&(this.orientation=="horizontal")&&this.range[c?"animate":"css"]({width:(100-e)+"%"},{queue:false,duration:d.animate});(f=="min")&&(this.orientation=="vertical")&&this.range.stop(1,1)[c?"animate":"css"]({height:e+"%"},d.animate);(f=="max")&&(this.orientation=="vertical")&&this.range[c?"animate":"css"]({height:(100-e)+"%"},{queue:false,duration:d.animate})}}}));a.extend(a.ui.slider,{getter:"value values",version:"1.7.2",eventPrefix:"slide",defaults:{animate:false,delay:0,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null}})})(jQuery);;/* + * jQuery UI Tabs 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Tabs + * + * Depends: + * ui.core.js + */ +(function(a){a.widget("ui.tabs",{_init:function(){if(this.options.deselectable!==undefined){this.options.collapsible=this.options.deselectable}this._tabify(true)},_setData:function(b,c){if(b=="selected"){if(this.options.collapsible&&c==this.options.selected){return}this.select(c)}else{this.options[b]=c;if(b=="deselectable"){this.options.collapsible=c}this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+a.data(b)},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+a.data(this.list[0]));return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(c,b){return{tab:c,panel:b,index:this.anchors.index(c)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(n){this.list=this.element.children("ul:first");this.lis=a("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return a("a",this)[0]});this.panels=a([]);var p=this,d=this.options;var c=/^#.+/;this.anchors.each(function(r,o){var q=a(o).attr("href");var s=q.split("#")[0],u;if(s&&(s===location.toString().split("#")[0]||(u=a("base")[0])&&s===u.href)){q=o.hash;o.href=q}if(c.test(q)){p.panels=p.panels.add(p._sanitizeSelector(q))}else{if(q!="#"){a.data(o,"href.tabs",q);a.data(o,"load.tabs",q.replace(/#.*$/,""));var w=p._tabId(o);o.href="#"+w;var v=a("#"+w);if(!v.length){v=a(d.panelTemplate).attr("id",w).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(p.panels[r-1]||p.list);v.data("destroy.tabs",true)}p.panels=p.panels.add(v)}else{d.disabled.push(r)}}});if(n){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(d.selected===undefined){if(location.hash){this.anchors.each(function(q,o){if(o.hash==location.hash){d.selected=q;return false}})}if(typeof d.selected!="number"&&d.cookie){d.selected=parseInt(p._cookie(),10)}if(typeof d.selected!="number"&&this.lis.filter(".ui-tabs-selected").length){d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}d.selected=d.selected||0}else{if(d.selected===null){d.selected=-1}}d.selected=((d.selected>=0&&this.anchors[d.selected])||d.selected<0)?d.selected:0;d.disabled=a.unique(d.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(q,o){return p.lis.index(q)}))).sort();if(a.inArray(d.selected,d.disabled)!=-1){d.disabled.splice(a.inArray(d.selected,d.disabled),1)}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(d.selected>=0&&this.anchors.length){this.panels.eq(d.selected).removeClass("ui-tabs-hide");this.lis.eq(d.selected).addClass("ui-tabs-selected ui-state-active");p.element.queue("tabs",function(){p._trigger("show",null,p._ui(p.anchors[d.selected],p.panels[d.selected]))});this.load(d.selected)}a(window).bind("unload",function(){p.lis.add(p.anchors).unbind(".tabs");p.lis=p.anchors=p.panels=null})}else{d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[d.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(d.cookie){this._cookie(d.selected,d.cookie)}for(var g=0,m;(m=this.lis[g]);g++){a(m)[a.inArray(g,d.disabled)!=-1&&!a(m).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}if(d.cache===false){this.anchors.removeData("cache.tabs")}this.lis.add(this.anchors).unbind(".tabs");if(d.event!="mouseover"){var f=function(o,i){if(i.is(":not(.ui-state-disabled)")){i.addClass("ui-state-"+o)}};var j=function(o,i){i.removeClass("ui-state-"+o)};this.lis.bind("mouseover.tabs",function(){f("hover",a(this))});this.lis.bind("mouseout.tabs",function(){j("hover",a(this))});this.anchors.bind("focus.tabs",function(){f("focus",a(this).closest("li"))});this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var b,h;if(d.fx){if(a.isArray(d.fx)){b=d.fx[0];h=d.fx[1]}else{b=h=d.fx}}function e(i,o){i.css({display:""});if(a.browser.msie&&o.opacity){i[0].style.removeAttribute("filter")}}var k=h?function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.hide().removeClass("ui-tabs-hide").animate(h,h.duration||"normal",function(){e(o,h);p._trigger("show",null,p._ui(i,o[0]))})}:function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.removeClass("ui-tabs-hide");p._trigger("show",null,p._ui(i,o[0]))};var l=b?function(o,i){i.animate(b,b.duration||"normal",function(){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");e(i,b);p.element.dequeue("tabs")})}:function(o,i,q){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");p.element.dequeue("tabs")};this.anchors.bind(d.event+".tabs",function(){var o=this,r=a(this).closest("li"),i=p.panels.filter(":not(.ui-tabs-hide)"),q=a(p._sanitizeSelector(this.hash));if((r.hasClass("ui-tabs-selected")&&!d.collapsible)||r.hasClass("ui-state-disabled")||r.hasClass("ui-state-processing")||p._trigger("select",null,p._ui(this,q[0]))===false){this.blur();return false}d.selected=p.anchors.index(this);p.abort();if(d.collapsible){if(r.hasClass("ui-tabs-selected")){d.selected=-1;if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){l(o,i)}).dequeue("tabs");this.blur();return false}else{if(!i.length){if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this));this.blur();return false}}}if(d.cookie){p._cookie(d.selected,d.cookie)}if(q.length){if(i.length){p.element.queue("tabs",function(){l(o,i)})}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(a.browser.msie){this.blur()}});this.anchors.bind("click.tabs",function(){return false})},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var c=a.data(this,"href.tabs");if(c){this.href=c}var d=a(this).unbind(".tabs");a.each(["href","load","cache"],function(e,f){d.removeData(f+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){if(a.data(this,"destroy.tabs")){a(this).remove()}else{a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}});if(b.cookie){this._cookie(null,b.cookie)}},add:function(e,d,c){if(c===undefined){c=this.anchors.length}var b=this,g=this.options,i=a(g.tabTemplate.replace(/#\{href\}/g,e).replace(/#\{label\}/g,d)),h=!e.indexOf("#")?e.replace("#",""):this._tabId(a("a",i)[0]);i.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var f=a("#"+h);if(!f.length){f=a(g.panelTemplate).attr("id",h).data("destroy.tabs",true)}f.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(c>=this.lis.length){i.appendTo(this.list);f.appendTo(this.list[0].parentNode)}else{i.insertBefore(this.lis[c]);f.insertBefore(this.panels[c])}g.disabled=a.map(g.disabled,function(k,j){return k>=c?++k:k});this._tabify();if(this.anchors.length==1){i.addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){b._trigger("show",null,b._ui(b.anchors[0],b.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[c],this.panels[c]))},remove:function(b){var d=this.options,e=this.lis.eq(b).remove(),c=this.panels.eq(b).remove();if(e.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(b+(b+1=b?--g:g});this._tabify();this._trigger("remove",null,this._ui(e.find("a")[0],c[0]))},enable:function(b){var c=this.options;if(a.inArray(b,c.disabled)==-1){return}this.lis.eq(b).removeClass("ui-state-disabled");c.disabled=a.grep(c.disabled,function(e,d){return e!=b});this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]))},disable:function(c){var b=this,d=this.options;if(c!=d.selected){this.lis.eq(c).addClass("ui-state-disabled");d.disabled.push(c);d.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[c],this.panels[c]))}},select:function(b){if(typeof b=="string"){b=this.anchors.index(this.anchors.filter("[href$="+b+"]"))}else{if(b===null){b=-1}}if(b==-1&&this.options.collapsible){b=this.options.selected}this.anchors.eq(b).trigger(this.options.event+".tabs")},load:function(e){var c=this,g=this.options,b=this.anchors.eq(e)[0],d=a.data(b,"load.tabs");this.abort();if(!d||this.element.queue("tabs").length!==0&&a.data(b,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(e).addClass("ui-state-processing");if(g.spinner){var f=a("span",b);f.data("label.tabs",f.html()).html(g.spinner)}this.xhr=a.ajax(a.extend({},g.ajaxOptions,{url:d,success:function(i,h){a(c._sanitizeSelector(b.hash)).html(i);c._cleanup();if(g.cache){a.data(b,"cache.tabs",true)}c._trigger("load",null,c._ui(c.anchors[e],c.panels[e]));try{g.ajaxOptions.success(i,h)}catch(j){}c.element.dequeue("tabs")}}))},abort:function(){this.element.queue([]);this.panels.stop(false,true);if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup()},url:function(c,b){this.anchors.eq(c).removeData("cache.tabs").data("load.tabs",b)},length:function(){return this.anchors.length}});a.extend(a.ui.tabs,{version:"1.7.2",getter:"length",defaults:{ajaxOptions:null,cache:false,cookie:null,collapsible:false,disabled:[],event:"click",fx:null,idPrefix:"ui-tabs-",panelTemplate:"
",spinner:"Loading…",tabTemplate:'
  • #{label}
  • '}});a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(d,f){var b=this,g=this.options;var c=b._rotate||(b._rotate=function(h){clearTimeout(b.rotation);b.rotation=setTimeout(function(){var i=g.selected;b.select(++i')}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",log:function(){if(this.debug){console.log.apply("",arguments)}},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var inline=(nodeName=="div"||nodeName=="span");if(!target.id){target.id="dp"+(++this.uuid)}var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});if(nodeName=="input"){this._connectDatepicker(target,inst)}else{if(inline){this._inlineDatepicker(target,inst)}}},_newInst:function(target,inline){var id=target[0].id.replace(/([:\[\]\.])/g,"\\\\$1");return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:$('
    '))}},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]);inst.trigger=$([]);if(input.hasClass(this.markerClassName)){return}var appendText=this._get(inst,"appendText");var isRTL=this._get(inst,"isRTL");if(appendText){inst.append=$(''+appendText+"");input[isRTL?"before":"after"](inst.append)}var showOn=this._get(inst,"showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){var buttonText=this._get(inst,"buttonText");var buttonImage=this._get(inst,"buttonImage");inst.trigger=$(this._get(inst,"buttonImageOnly")?$("").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$('').addClass(this._triggerClass).html(buttonImage==""?buttonText:$("").attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?"before":"after"](inst.trigger);inst.trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==target){$.datepicker._hideDatepicker()}else{$.datepicker._showDatepicker(target)}return false})}input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst)},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName)){return}divSpan.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst);this._setDate(inst,this._getDefaultDate(inst));this._updateDatepicker(inst);this._updateAlternate(inst)},_dialogDatepicker:function(input,dateText,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){var id="dp"+(++this.uuid);this._dialogInput=$('');this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],PROP_NAME,inst)}extendRemove(inst.settings,settings||{});this._dialogInput.val(dateText);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY]}this._dialogInput.css("left",this._pos[0]+"px").css("top",this._pos[1]+"px");inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv)}$.data(this._dialogInput[0],PROP_NAME,inst);return this},_destroyDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();$.removeData(target,PROP_NAME);if(nodeName=="input"){inst.append.remove();inst.trigger.remove();$target.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress)}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}},_enableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=false;inst.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().removeClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)})},_disableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=true;inst.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().addClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)});this._disabledInputs[this._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i-1)}},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!="input"){input=$("input",input.parentNode)[0]}if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input){return}var inst=$.datepicker._getInst(input);var beforeShow=$.datepicker._get(inst,"beforeShow");extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepicker._hideDatepicker(null,"");$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog){input.value=""}if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight}var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")=="fixed";return !isFixed});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.rangeStart=null;inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});$.datepicker._updateDatepicker(inst);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute")),display:"none",left:offset.left+"px",top:offset.top+"px"});if(!inst.inline){var showAnim=$.datepicker._get(inst,"showAnim")||"show";var duration=$.datepicker._get(inst,"duration");var postProcess=function(){$.datepicker._datepickerShowing=true;if($.browser.msie&&parseInt($.browser.version,10)<7){$("iframe.ui-datepicker-cover").css({width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4})}};if($.effects&&$.effects[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[showAnim](duration,postProcess)}if(duration==""){postProcess()}if(inst.input[0].type!="hidden"){inst.input[0].focus()}$.datepicker._curInst=inst}},_updateDatepicker:function(inst){var dims={width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4};var self=this;inst.dpDiv.empty().append(this._generateHTML(inst)).find("iframe.ui-datepicker-cover").css({width:dims.width,height:dims.height}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){$(this).removeClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).removeClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).removeClass("ui-datepicker-next-hover")}}).bind("mouseover",function(){if(!self._isDisabledDatepicker(inst.inline?inst.dpDiv.parent()[0]:inst.input[0])){$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");$(this).addClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).addClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).addClass("ui-datepicker-next-hover")}}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();var numMonths=this._getNumberOfMonths(inst);var cols=numMonths[1];var width=17;if(cols>1){inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",(width*cols)+"em")}else{inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("")}inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(inst.input&&inst.input[0].type!="hidden"&&inst==$.datepicker._curInst){$(inst.input[0]).focus()}},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth();var dpHeight=inst.dpDiv.outerHeight();var inputWidth=inst.input?inst.input.outerWidth():0;var inputHeight=inst.input?inst.input.outerHeight():0;var viewWidth=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)+$(document).scrollLeft();var viewHeight=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)+$(document).scrollTop();offset.left-=(this._get(inst,"isRTL")?(dpWidth-inputWidth):0);offset.left-=(isFixed&&offset.left==inst.input.offset().left)?$(document).scrollLeft():0;offset.top-=(isFixed&&offset.top==(inst.input.offset().top+inputHeight))?$(document).scrollTop():0;offset.left-=(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0;offset.top-=(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(offset.top+dpHeight+inputHeight*2-viewHeight):0;return offset},_findPos:function(obj){while(obj&&(obj.type=="hidden"||obj.nodeType!=1)){obj=obj.nextSibling}var position=$(obj).offset();return[position.left,position.top]},_hideDatepicker:function(input,duration){var inst=this._curInst;if(!inst||(input&&inst!=$.data(input,PROP_NAME))){return}if(inst.stayOpen){this._selectDate("#"+inst.id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear))}inst.stayOpen=false;if(this._datepickerShowing){duration=(duration!=null?duration:this._get(inst,"duration"));var showAnim=this._get(inst,"showAnim");var postProcess=function(){$.datepicker._tidyDialog(inst)};if(duration!=""&&$.effects&&$.effects[showAnim]){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[(duration==""?"hide":(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide")))](duration,postProcess)}if(duration==""){this._tidyDialog(inst)}var onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():""),inst])}this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv)}}this._inDialog=false}this._curInst=null},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(event){if(!$.datepicker._curInst){return}var $target=$(event.target);if(($target.parents("#"+$.datepicker._mainDivId).length==0)&&!$target.hasClass($.datepicker.markerClassName)&&!$target.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker._hideDatepicker(null,"")}},_adjustDate:function(id,offset,period){var target=$(id);var inst=this._getInst(target[0]);if(this._isDisabledDatepicker(target[0])){return}this._adjustInstDate(inst,offset+(period=="M"?this._get(inst,"showCurrentAtPos"):0),period);this._updateDatepicker(inst)},_gotoToday:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,"gotoCurrent")&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear}else{var date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear()}this._notifyChange(inst);this._adjustDate(target)},_selectMonthYear:function(id,select,period){var target=$(id);var inst=this._getInst(target[0]);inst._selectingMonthYear=false;inst["selected"+(period=="M"?"Month":"Year")]=inst["draw"+(period=="M"?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target)},_clickMonthYear:function(id){var target=$(id);var inst=this._getInst(target[0]);if(inst.input&&inst._selectingMonthYear&&!$.browser.msie){inst.input[0].focus()}inst._selectingMonthYear=!inst._selectingMonthYear},_selectDay:function(id,month,year,td){var target=$(id);if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){return}var inst=this._getInst(target[0]);inst.selectedDay=inst.currentDay=$("a",td).html();inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;if(inst.stayOpen){inst.endDay=inst.endMonth=inst.endYear=null}this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));if(inst.stayOpen){inst.rangeStart=this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay));this._updateDatepicker(inst)}},_clearDate:function(id){var target=$(id);var inst=this._getInst(target[0]);inst.stayOpen=false;inst.endDay=inst.endMonth=inst.endYear=inst.rangeStart=null;this._selectDate(target,"")},_selectDate:function(id,dateStr){var target=$(id);var inst=this._getInst(target[0]);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(inst.input){inst.input.val(dateStr)}this._updateAlternate(inst);var onSelect=this._get(inst,"onSelect");if(onSelect){onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst])}else{if(inst.input){inst.input.trigger("change")}}if(inst.inline){this._updateDatepicker(inst)}else{if(!inst.stayOpen){this._hideDatepicker(null,this._get(inst,"duration"));this._lastInput=inst.input[0];if(typeof(inst.input[0])!="object"){inst.input[0].focus()}this._lastInput=null}}},_updateAlternate:function(inst){var altField=this._get(inst,"altField");if(altField){var altFormat=this._get(inst,"altFormat")||this._get(inst,"dateFormat");var date=this._getDate(inst);dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));$(altField).each(function(){$(this).val(dateStr)})}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""]},iso8601Week:function(date){var checkDate=new Date(date.getFullYear(),date.getMonth(),date.getDate());var firstMon=new Date(checkDate.getFullYear(),1-1,4);var firstDay=firstMon.getDay()||7;firstMon.setDate(firstMon.getDate()+1-firstDay);if(firstDay<4&&checkDatenew Date(checkDate.getFullYear(),12-1,28)){firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;if(firstDay>4&&(checkDate.getDay()||7)0&&iValue="0"&&value.charAt(iValue)<="9"){num=num*10+parseInt(value.charAt(iValue++),10);size--}if(size==origSize){throw"Missing number at position "+iValue}return num};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);var size=0;for(var j=0;j0&&iValue-1){month=1;day=doy;do{var dim=this._getDaysInMonth(year,month-1);if(day<=dim){break}month++;day-=dim}while(true)}var date=this._daylightSavingAdjust(new Date(year,month-1,day));if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day){throw"Invalid date"}return date},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TIMESTAMP:"@",W3C:"yy-mm-dd",formatDate:function(format,date,settings){if(!date){return""}var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1=0;m--){doy+=this._getDaysInMonth(date.getFullYear(),m)}output+=formatNumber("o",doy,3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100);break;case"@":output+=date.getTime();break;case"'":if(lookAhead("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(iFormat)}}}}return output},_possibleChars:function(format){var chars="";var literal=false;for(var iFormat=0;iFormatmaxDate?maxDate:date);return date},_determineDate:function(date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date};var offsetString=function(offset,getDaysInMonth){var date=new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;var matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":case"W":day+=parseInt(matches[1],10)*7;break;case"m":case"M":month+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break}matches=pattern.exec(offset)}return new Date(year,month,day)};date=(date==null?defaultDate:(typeof date=="string"?offsetString(date,this._getDaysInMonth):(typeof date=="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):date)));date=(date&&date.toString()=="Invalid Date"?defaultDate:date);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0)}return this._daylightSavingAdjust(date)},_daylightSavingAdjust:function(date){if(!date){return null}date.setHours(date.getHours()>12?date.getHours()+2:0);return date},_setDate:function(inst,date,endDate){var clear=!(date);var origMonth=inst.selectedMonth;var origYear=inst.selectedYear;date=this._determineDate(date,new Date());inst.selectedDay=inst.currentDay=date.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=date.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=date.getFullYear();if(origMonth!=inst.selectedMonth||origYear!=inst.selectedYear){this._notifyChange(inst)}this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst))}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()=="")?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return startDate},_generateHTML:function(inst){var today=new Date();today=this._daylightSavingAdjust(new Date(today.getFullYear(),today.getMonth(),today.getDate()));var isRTL=this._get(inst,"isRTL");var showButtonPanel=this._get(inst,"showButtonPanel");var hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext");var navigationAsDateFormat=this._get(inst,"navigationAsDateFormat");var numMonths=this._getNumberOfMonths(inst);var showCurrentAtPos=this._get(inst,"showCurrentAtPos");var stepMonths=this._get(inst,"stepMonths");var stepBigMonths=this._get(inst,"stepBigMonths");var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");var drawMonth=inst.drawMonth-showCurrentAtPos;var drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--}if(maxDate){var maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[1]+1,maxDate.getDate()));maxDraw=(minDate&&maxDrawmaxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--}}}inst.drawMonth=drawMonth;inst.drawYear=drawYear;var prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));var prev=(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?''+prevText+"":(hideIfNoPrevNext?"":''+prevText+""));var nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));var next=(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?''+nextText+"":(hideIfNoPrevNext?"":''+nextText+""));var currentText=this._get(inst,"currentText");var gotoDate=(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));var controls=(!inst.inline?'":"");var buttonPanel=(showButtonPanel)?'
    '+(isRTL?controls:"")+(this._isInRange(inst,gotoDate)?'":"")+(isRTL?"":controls)+"
    ":"";var firstDay=parseInt(this._get(inst,"firstDay"),10);firstDay=(isNaN(firstDay)?0:firstDay);var dayNames=this._get(inst,"dayNames");var dayNamesShort=this._get(inst,"dayNamesShort");var dayNamesMin=this._get(inst,"dayNamesMin");var monthNames=this._get(inst,"monthNames");var monthNamesShort=this._get(inst,"monthNamesShort");var beforeShowDay=this._get(inst,"beforeShowDay");var showOtherMonths=this._get(inst,"showOtherMonths");var calculateWeek=this._get(inst,"calculateWeek")||this.iso8601Week;var endDate=inst.endDay?this._daylightSavingAdjust(new Date(inst.endYear,inst.endMonth,inst.endDay)):currentDate;var defaultDate=this._getDefaultDate(inst);var html="";for(var row=0;row'+(/all|left/.test(cornerClass)&&row==0?(isRTL?next:prev):"")+(/all|right/.test(cornerClass)&&row==0?(isRTL?prev:next):"")+this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,row>0||col>0,monthNames,monthNamesShort)+'';var thead="";for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;thead+="=5?' class="ui-datepicker-week-end"':"")+'>'+dayNamesMin[day]+""}calender+=thead+"";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth)}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(var dRow=0;dRow";var tbody="";for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=otherMonth||!daySettings[0]||(minDate&&printDatemaxDate);tbody+='";printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate)}calender+=tbody+""}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++}calender+="
    =currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" "+this._currentClass:"")+(printDate.getTime()==today.getTime()?" ui-datepicker-today":""))+'"'+((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':"")+(unselectable?"":" onclick=\"DP_jQuery.datepicker._selectDay('#"+inst.id+"',"+drawMonth+","+drawYear+', this);return false;"')+">"+(otherMonth?(showOtherMonths?printDate.getDate():" "):(unselectable?''+printDate.getDate()+"":'=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" ui-state-active":"")+'" href="#">'+printDate.getDate()+""))+"
    "+(isMultiMonth?""+((numMonths[0]>0&&col==numMonths[1]-1)?'
    ':""):"");group+=calender}html+=group}html+=buttonPanel+($.browser.msie&&parseInt($.browser.version,10)<7&&!inst.inline?'':"");inst._keyEvent=false;return html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,secondary,monthNames,monthNamesShort){minDate=(inst.rangeStart&&minDate&&selectedDate "}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+='"}if(!showMonthAfterYear){html+=monthHtml+((secondary||changeMonth||changeYear)&&(!(changeMonth&&changeYear))?" ":"")}if(secondary||!changeYear){html+=''+drawYear+""}else{var years=this._get(inst,"yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=drawYear+parseInt(years[0],10);endYear=drawYear+parseInt(years[1],10)}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='"}if(showMonthAfterYear){html+=(secondary||changeMonth||changeYear?" ":"")+monthHtml}html+="";return html},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=="Y"?offset:0);var month=inst.drawMonth+(period=="M"?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=this._daylightSavingAdjust(new Date(year,month,day));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&datemaxDate?maxDate:date);inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=="M"||period=="Y"){this._notifyChange(inst)}},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst])}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(inst,minMax,checkRange){var date=this._determineDate(this._get(inst,minMax+"Date"),null);return(!checkRange||!inst.rangeStart?date:(!date||inst.rangeStart>date?inst.rangeStart:date))},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(inst,date)},_isInRange:function(inst,date){var newMinDate=(!inst.rangeStart?null:this._daylightSavingAdjust(new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay)));newMinDate=(newMinDate&&inst.rangeStart=minDate)&&(!maxDate||date<=maxDate))},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear}var date=(day?(typeof day=="object"?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null||props[name]==undefined){target[name]=props[name]}}return target}function isArray(a){return(a&&(($.browser.safari&&typeof a=="object"&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))))}$.fn.datepicker=function(options){if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv);$.datepicker.initialized=true}var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}if(options=="option"&&arguments.length==2&&typeof arguments[1]=="string"){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.7.2";window.DP_jQuery=$})(jQuery);;/* + * jQuery UI Progressbar 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Progressbar + * + * Depends: + * ui.core.js + */ +(function(a){a.widget("ui.progressbar",{_init:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this._valueMin(),"aria-valuemax":this._valueMax(),"aria-valuenow":this._value()});this.valueDiv=a('
    ').appendTo(this.element);this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow").removeData("progressbar").unbind(".progressbar");this.valueDiv.remove();a.widget.prototype.destroy.apply(this,arguments)},value:function(b){if(b===undefined){return this._value()}this._setData("value",b);return this},_setData:function(b,c){switch(b){case"value":this.options.value=c;this._refreshValue();this._trigger("change",null,{});break}a.widget.prototype._setData.apply(this,arguments)},_value:function(){var b=this.options.value;if(bthis._valueMax()){b=this._valueMax()}return b},_valueMin:function(){var b=0;return b},_valueMax:function(){var b=100;return b},_refreshValue:function(){var b=this.value();this.valueDiv[b==this._valueMax()?"addClass":"removeClass"]("ui-corner-right");this.valueDiv.width(b+"%");this.element.attr("aria-valuenow",b)}});a.extend(a.ui.progressbar,{version:"1.7.2",defaults:{value:0}})})(jQuery);;/* + * jQuery UI Effects 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/ + */ +jQuery.effects||(function(d){d.effects={version:"1.7.2",save:function(g,h){for(var f=0;f');var j=f.parent();if(f.css("position")=="static"){j.css({position:"relative"});f.css({position:"relative"})}else{var i=f.css("top");if(isNaN(parseInt(i,10))){i="auto"}var h=f.css("left");if(isNaN(parseInt(h,10))){h="auto"}j.css({position:f.css("position"),top:i,left:h,zIndex:f.css("z-index")}).show();f.css({position:"relative",top:0,left:0})}j.css(g);return j},removeWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent().replaceWith(f)}return f},setTransition:function(g,i,f,h){h=h||{};d.each(i,function(k,j){unit=g.cssUnit(j);if(unit[0]>0){h[j]=unit[0]*f+unit[1]}});return h},animateClass:function(h,i,k,j){var f=(typeof k=="function"?k:(j?j:null));var g=(typeof k=="string"?k:null);return this.each(function(){var q={};var o=d(this);var p=o.attr("style")||"";if(typeof p=="object"){p=p.cssText}if(h.toggle){o.hasClass(h.toggle)?h.remove=h.toggle:h.add=h.toggle}var l=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.addClass(h.add)}if(h.remove){o.removeClass(h.remove)}var m=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.removeClass(h.add)}if(h.remove){o.addClass(h.remove)}for(var r in m){if(typeof m[r]!="function"&&m[r]&&r.indexOf("Moz")==-1&&r.indexOf("length")==-1&&m[r]!=l[r]&&(r.match(/color/i)||(!r.match(/color/i)&&!isNaN(parseInt(m[r],10))))&&(l.position!="static"||(l.position=="static"&&!r.match(/left|top|bottom|right/)))){q[r]=m[r]}}o.animate(q,i,g,function(){if(typeof d(this).attr("style")=="object"){d(this).attr("style")["cssText"]="";d(this).attr("style")["cssText"]=p}else{d(this).attr("style",p)}if(h.add){d(this).addClass(h.add)}if(h.remove){d(this).removeClass(h.remove)}if(f){f.apply(this,arguments)}})})}};function c(g,f){var i=g[1]&&g[1].constructor==Object?g[1]:{};if(f){i.mode=f}var h=g[1]&&g[1].constructor!=Object?g[1]:(i.duration?i.duration:g[2]);h=d.fx.off?0:typeof h==="number"?h:d.fx.speeds[h]||d.fx.speeds._default;var j=i.callback||(d.isFunction(g[1])&&g[1])||(d.isFunction(g[2])&&g[2])||(d.isFunction(g[3])&&g[3]);return[g[0],i,h,j]}d.fn.extend({_show:d.fn.show,_hide:d.fn.hide,__toggle:d.fn.toggle,_addClass:d.fn.addClass,_removeClass:d.fn.removeClass,_toggleClass:d.fn.toggleClass,effect:function(g,f,h,i){return d.effects[g]?d.effects[g].call(this,{method:g,options:f||{},duration:h,callback:i}):null},show:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._show.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"show"))}},hide:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._hide.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"hide"))}},toggle:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))||(d.isFunction(arguments[0])||typeof arguments[0]=="boolean")){return this.__toggle.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"toggle"))}},addClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{add:g},f,i,h]):this._addClass(g)},removeClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{remove:g},f,i,h]):this._removeClass(g)},toggleClass:function(g,f,i,h){return((typeof f!=="boolean")&&f)?d.effects.animateClass.apply(this,[{toggle:g},f,i,h]):this._toggleClass(g,f)},morph:function(f,h,g,j,i){return d.effects.animateClass.apply(this,[{add:h,remove:f},g,j,i])},switchClass:function(){return this.morph.apply(this,arguments)},cssUnit:function(f){var g=this.css(f),h=[];d.each(["em","px","%","pt"],function(j,k){if(g.indexOf(k)>0){h=[parseFloat(g),k]}});return h}});d.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(g,f){d.fx.step[f]=function(h){if(h.state==0){h.start=e(h.elem,f);h.end=b(h.end)}h.elem.style[f]="rgb("+[Math.max(Math.min(parseInt((h.pos*(h.end[0]-h.start[0]))+h.start[0],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[1]-h.start[1]))+h.start[1],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[2]-h.start[2]))+h.start[2],10),255),0)].join(",")+")"}});function b(g){var f;if(g&&g.constructor==Array&&g.length==3){return g}if(f=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(g)){return[parseInt(f[1],10),parseInt(f[2],10),parseInt(f[3],10)]}if(f=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(g)){return[parseFloat(f[1])*2.55,parseFloat(f[2])*2.55,parseFloat(f[3])*2.55]}if(f=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(g)){return[parseInt(f[1],16),parseInt(f[2],16),parseInt(f[3],16)]}if(f=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(g)){return[parseInt(f[1]+f[1],16),parseInt(f[2]+f[2],16),parseInt(f[3]+f[3],16)]}if(f=/rgba\(0, 0, 0, 0\)/.exec(g)){return a.transparent}return a[d.trim(g).toLowerCase()]}function e(h,f){var g;do{g=d.curCSS(h,f);if(g!=""&&g!="transparent"||d.nodeName(h,"body")){break}f="backgroundColor"}while(h=h.parentNode);return b(g)}var a={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};d.easing.jswing=d.easing.swing;d.extend(d.easing,{def:"easeOutQuad",swing:function(g,h,f,j,i){return d.easing[d.easing.def](g,h,f,j,i)},easeInQuad:function(g,h,f,j,i){return j*(h/=i)*h+f},easeOutQuad:function(g,h,f,j,i){return -j*(h/=i)*(h-2)+f},easeInOutQuad:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h+f}return -j/2*((--h)*(h-2)-1)+f},easeInCubic:function(g,h,f,j,i){return j*(h/=i)*h*h+f},easeOutCubic:function(g,h,f,j,i){return j*((h=h/i-1)*h*h+1)+f},easeInOutCubic:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h+f}return j/2*((h-=2)*h*h+2)+f},easeInQuart:function(g,h,f,j,i){return j*(h/=i)*h*h*h+f},easeOutQuart:function(g,h,f,j,i){return -j*((h=h/i-1)*h*h*h-1)+f},easeInOutQuart:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h+f}return -j/2*((h-=2)*h*h*h-2)+f},easeInQuint:function(g,h,f,j,i){return j*(h/=i)*h*h*h*h+f},easeOutQuint:function(g,h,f,j,i){return j*((h=h/i-1)*h*h*h*h+1)+f},easeInOutQuint:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h*h+f}return j/2*((h-=2)*h*h*h*h+2)+f},easeInSine:function(g,h,f,j,i){return -j*Math.cos(h/i*(Math.PI/2))+j+f},easeOutSine:function(g,h,f,j,i){return j*Math.sin(h/i*(Math.PI/2))+f},easeInOutSine:function(g,h,f,j,i){return -j/2*(Math.cos(Math.PI*h/i)-1)+f},easeInExpo:function(g,h,f,j,i){return(h==0)?f:j*Math.pow(2,10*(h/i-1))+f},easeOutExpo:function(g,h,f,j,i){return(h==i)?f+j:j*(-Math.pow(2,-10*h/i)+1)+f},easeInOutExpo:function(g,h,f,j,i){if(h==0){return f}if(h==i){return f+j}if((h/=i/2)<1){return j/2*Math.pow(2,10*(h-1))+f}return j/2*(-Math.pow(2,-10*--h)+2)+f},easeInCirc:function(g,h,f,j,i){return -j*(Math.sqrt(1-(h/=i)*h)-1)+f},easeOutCirc:function(g,h,f,j,i){return j*Math.sqrt(1-(h=h/i-1)*h)+f},easeInOutCirc:function(g,h,f,j,i){if((h/=i/2)<1){return -j/2*(Math.sqrt(1-h*h)-1)+f}return j/2*(Math.sqrt(1-(h-=2)*h)+1)+f},easeInElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l)==1){return f+m}if(!k){k=l*0.3}if(h").css({position:"absolute",visibility:"visible",left:-d*(g/e),top:-f*(c/k)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/e,height:c/k,left:l.left+d*(g/e)+(b.options.mode=="show"?(d-Math.floor(e/2))*(g/e):0),top:l.top+f*(c/k)+(b.options.mode=="show"?(f-Math.floor(k/2))*(c/k):0),opacity:b.options.mode=="show"?0:1}).animate({left:l.left+d*(g/e)+(b.options.mode=="show"?0:(d-Math.floor(e/2))*(g/e)),top:l.top+f*(c/k)+(b.options.mode=="show"?0:(f-Math.floor(k/2))*(c/k)),opacity:b.options.mode=="show"?1:0},b.duration||500)}}setTimeout(function(){b.options.mode=="show"?h.css({visibility:"visible"}):h.css({visibility:"visible"}).hide();if(b.callback){b.callback.apply(h[0])}h.dequeue();a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);;/* + * jQuery UI Effects Fold 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Fold + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.fold=function(b){return this.queue(function(){var e=a(this),k=["position","top","left"];var h=a.effects.setMode(e,b.options.mode||"hide");var o=b.options.size||15;var n=!(!b.options.horizFirst);var g=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(e,k);e.show();var d=a.effects.createWrapper(e).css({overflow:"hidden"});var i=((h=="show")!=n);var f=i?["width","height"]:["height","width"];var c=i?[d.width(),d.height()]:[d.height(),d.width()];var j=/([0-9]+)%/.exec(o);if(j){o=parseInt(j[1],10)/100*c[h=="hide"?0:1]}if(h=="show"){d.css(n?{height:0,width:o}:{height:o,width:0})}var m={},l={};m[f[0]]=h=="show"?c[0]:o;l[f[1]]=h=="show"?c[1]:0;d.animate(m,g,b.options.easing).animate(l,g,b.options.easing,function(){if(h=="hide"){e.hide()}a.effects.restore(e,k);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(e[0],arguments)}e.dequeue()})})}})(jQuery);;/* + * jQuery UI Effects Highlight 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Highlight + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.highlight=function(b){return this.queue(function(){var e=a(this),d=["backgroundImage","backgroundColor","opacity"];var h=a.effects.setMode(e,b.options.mode||"show");var c=b.options.color||"#ffff99";var g=e.css("backgroundColor");a.effects.save(e,d);e.show();e.css({backgroundImage:"none",backgroundColor:c});var f={backgroundColor:g};if(h=="hide"){f.opacity=0}e.animate(f,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(h=="hide"){e.hide()}a.effects.restore(e,d);if(h=="show"&&a.browser.msie){this.style.removeAttribute("filter")}if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;/* + * jQuery UI Effects Pulsate 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Pulsate + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.pulsate=function(b){return this.queue(function(){var d=a(this);var g=a.effects.setMode(d,b.options.mode||"show");var f=b.options.times||5;var e=b.duration?b.duration/2:a.fx.speeds._default/2;if(g=="hide"){f--}if(d.is(":hidden")){d.css("opacity",0);d.show();d.animate({opacity:1},e,b.options.easing);f=f-2}for(var c=0;c').appendTo(document.body).addClass(b.options.className).css({top:d.top,left:d.left,height:f.innerHeight(),width:f.innerWidth(),position:"absolute"}).animate(g,b.duration,b.options.easing,function(){c.remove();(b.callback&&b.callback.apply(f[0],arguments));f.dequeue()})})}})(jQuery);; \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/js/vendor/jquery.disable.text.select.js b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/js/vendor/jquery.disable.text.select.js new file mode 100644 index 00000000..2e06f673 --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/js/vendor/jquery.disable.text.select.js @@ -0,0 +1,62 @@ +/** + * .disableTextSelect - Disable Text Select Plugin + * + * Version: 1.1 + * Updated: 2007-11-28 + * + * Used to stop users from selecting text + * + * Copyright (c) 2007 James Dempster (letssurf@gmail.com, http://www.jdempster.com/category/jquery/disabletextselect/) + * + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + **/ + +/** + * Requirements: + * - jQuery (John Resig, http://www.jquery.com/) + **/ +(function($) { + if ($.browser.mozilla) { + $.fn.disableTextSelect = function() { + return this.each(function() { + $(this).css({ + 'MozUserSelect' : 'none' + }); + }); + }; + $.fn.enableTextSelect = function() { + return this.each(function() { + $(this).css({ + 'MozUserSelect' : '' + }); + }); + }; + } else if ($.browser.msie) { + $.fn.disableTextSelect = function() { + return this.each(function() { + $(this).bind('selectstart.disableTextSelect', function() { + return false; + }); + }); + }; + $.fn.enableTextSelect = function() { + return this.each(function() { + $(this).unbind('selectstart.disableTextSelect'); + }); + }; + } else { + $.fn.disableTextSelect = function() { + return this.each(function() { + $(this).bind('mousedown.disableTextSelect', function() { + return false; + }); + }); + }; + $.fn.enableTextSelect = function() { + return this.each(function() { + $(this).unbind('mousedown.disableTextSelect'); + }); + }; + } +})(jQuery); \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/js/vendor/jquery.easing.1.2.js b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/js/vendor/jquery.easing.1.2.js new file mode 100644 index 00000000..749b2d56 --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/legacy/js/vendor/jquery.easing.1.2.js @@ -0,0 +1,140 @@ +/* + * jQuery EasIng v1.1.2 - http://gsgd.co.uk/sandbox/jquery.easIng.php + * + * Uses the built In easIng capabilities added In jQuery 1.1 + * to offer multiple easIng options + * + * Copyright (c) 2007 George Smith + * Licensed under the MIT License: + * http://www.opensource.org/licenses/mit-license.php + */ + +// t: current time, b: begInnIng value, c: change In value, d: duration + +jQuery.extend( jQuery.easing, +{ + easeInQuad: function (x, t, b, c, d) { + return c*(t/=d)*t + b; + }, + easeOutQuad: function (x, t, b, c, d) { + return -c *(t/=d)*(t-2) + b; + }, + easeInOutQuad: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t + b; + return -c/2 * ((--t)*(t-2) - 1) + b; + }, + easeInCubic: function (x, t, b, c, d) { + return c*(t/=d)*t*t + b; + }, + easeOutCubic: function (x, t, b, c, d) { + return c*((t=t/d-1)*t*t + 1) + b; + }, + easeInOutCubic: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t + b; + return c/2*((t-=2)*t*t + 2) + b; + }, + easeInQuart: function (x, t, b, c, d) { + return c*(t/=d)*t*t*t + b; + }, + easeOutQuart: function (x, t, b, c, d) { + return -c * ((t=t/d-1)*t*t*t - 1) + b; + }, + easeInOutQuart: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t*t + b; + return -c/2 * ((t-=2)*t*t*t - 2) + b; + }, + easeInQuint: function (x, t, b, c, d) { + return c*(t/=d)*t*t*t*t + b; + }, + easeOutQuint: function (x, t, b, c, d) { + return c*((t=t/d-1)*t*t*t*t + 1) + b; + }, + easeInOutQuint: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; + return c/2*((t-=2)*t*t*t*t + 2) + b; + }, + easeInSine: function (x, t, b, c, d) { + return -c * Math.cos(t/d * (Math.PI/2)) + c + b; + }, + easeOutSine: function (x, t, b, c, d) { + return c * Math.sin(t/d * (Math.PI/2)) + b; + }, + easeInOutSine: function (x, t, b, c, d) { + return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; + }, + easeInExpo: function (x, t, b, c, d) { + return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; + }, + easeOutExpo: function (x, t, b, c, d) { + return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; + }, + easeInOutExpo: function (x, t, b, c, d) { + if (t==0) return b; + if (t==d) return b+c; + if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; + return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; + }, + easeInCirc: function (x, t, b, c, d) { + return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; + }, + easeOutCirc: function (x, t, b, c, d) { + return c * Math.sqrt(1 - (t=t/d-1)*t) + b; + }, + easeInOutCirc: function (x, t, b, c, d) { + if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; + return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; + }, + easeInElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; + }, + easeOutElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; + }, + easeInOutElastic: function (x, t, b, c, d) { + var s=1.70158;var p=0;var a=c; + if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); + if (a < Math.abs(c)) { a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (c/a); + if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; + return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; + }, + easeInBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + return c*(t/=d)*t*((s+1)*t - s) + b; + }, + easeOutBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; + }, + easeInOutBack: function (x, t, b, c, d, s) { + if (s == undefined) s = 1.70158; + if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; + return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; + }, + easeInBounce: function (x, t, b, c, d) { + return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; + }, + easeOutBounce: function (x, t, b, c, d) { + if ((t/=d) < (1/2.75)) { + return c*(7.5625*t*t) + b; + } else if (t < (2/2.75)) { + return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; + } else if (t < (2.5/2.75)) { + return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; + } else { + return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; + } + }, + easeInOutBounce: function (x, t, b, c, d) { + if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; + return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; + } +}); \ No newline at end of file diff --git a/resources/library/applications/Calculator.wgt/Calculator.wgt/package.json b/resources/library/applications/Calculator.wgt/Calculator.wgt/package.json new file mode 100644 index 00000000..afd16e76 --- /dev/null +++ b/resources/library/applications/Calculator.wgt/Calculator.wgt/package.json @@ -0,0 +1,20 @@ +{ + "author": "Alti-TCS", + "name": "Calculatrice.wgt", + "version": "2.3.0RC-32-g426c891", + "repository": { + "type": "git", + "url": "ssh://devalti@VM-REPO/home/devalti/projets/opensankore/Sankore-3.1.git" + }, + "dependencies": {}, + "devDependencies": { + "grunt": "~0.4.2", + "grunt-contrib-concat": "~0.3.0", + "grunt-contrib-uglify": "~0.3.2", + "grunt-contrib-watch": "~0.5.3" + }, + "optionalDependencies": {}, + "engines": { + "node": "*" + } +} diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/._Calculator.wgt b/resources/library/applications/Calculator.wgt/__MACOSX/._Calculator.wgt new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/._Calculator.wgt differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._.gitignore b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._.gitignore new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._.gitignore differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._Gruntfile.js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._Gruntfile.js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._Gruntfile.js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._config.xml b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._config.xml new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._config.xml differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._css b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._css new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._css differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._dist b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._dist new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._dist differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._icon.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._icon.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._icon.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._index.html b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._index.html new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._index.html differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._legacy b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._legacy new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._legacy differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._package.json b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._package.json new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/._package.json differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/css/._calculator.css b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/css/._calculator.css new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/css/._calculator.css differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/dist/._calculator.js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/dist/._calculator.js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/dist/._calculator.js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/._sankore.js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/._sankore.js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/._sankore.js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/._src b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/._src new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/._src differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/._Sankore b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/._Sankore new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/._Sankore differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._Button.js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._Button.js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._Button.js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._Calculator.js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._Calculator.js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._Calculator.js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._Calculus b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._Calculus new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._Calculus differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._Command.js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._Command.js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._Command.js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._Editor b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._Editor new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._Editor differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._KeystrokeLine.js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._KeystrokeLine.js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._KeystrokeLine.js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._Text.js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._Text.js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._Text.js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._UI b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._UI new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._UI differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._Util b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._Util new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._Util differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._klass.js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._klass.js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/._klass.js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Calculus/._Engine.js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Calculus/._Engine.js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Calculus/._Engine.js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Calculus/._Expression.js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Calculus/._Expression.js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Calculus/._Expression.js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Editor/._Editor.js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Editor/._Editor.js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Editor/._Editor.js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Editor/._Layout.js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Editor/._Layout.js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Editor/._Layout.js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/UI/._EditorInterface.js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/UI/._EditorInterface.js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/UI/._EditorInterface.js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/UI/._MainInterface.js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/UI/._MainInterface.js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/UI/._MainInterface.js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Util/._Error.js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Util/._Error.js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Util/._Error.js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Util/._EventDispatcher.js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Util/._EventDispatcher.js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Util/._EventDispatcher.js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Util/._Hash.js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Util/._Hash.js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Util/._Hash.js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Util/._I18N.js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Util/._I18N.js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Util/._I18N.js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Util/._i18n b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Util/._i18n new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Util/._i18n differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Util/i18n/._messages.en.js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Util/i18n/._messages.en.js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Util/i18n/._messages.en.js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Util/i18n/._messages.fr.js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Util/i18n/._messages.fr.js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/js/src/Sankore/Util/i18n/._messages.fr.js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/._css b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/._css new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/._css differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/._images b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/._images new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/._images differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/._js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/._js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/._js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/css/._ubwidget.css b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/css/._ubwidget.css new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/css/._ubwidget.css differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._arrows_out b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._arrows_out new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._arrows_out differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._arrows_over b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._arrows_over new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._arrows_over differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._back.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._back.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._back.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._back_small.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._back_small.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._back_small.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._button_out-copie.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._button_out-copie.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._button_out-copie.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._button_out.gif b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._button_out.gif new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._button_out.gif differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._button_out.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._button_out.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._button_out.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._button_out_dark.gif b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._button_out_dark.gif new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._button_out_dark.gif differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._button_out_dark.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._button_out_dark.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._button_out_dark.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._button_over.gif b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._button_over.gif new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._button_over.gif differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._button_toggle.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._button_toggle.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._button_toggle.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._button_toggle_invert.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._button_toggle_invert.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._button_toggle_invert.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._buttons_shadow b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._buttons_shadow new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._buttons_shadow differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._calculator b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._calculator new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._calculator differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._display copy.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._display copy.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._display copy.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._display.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._display.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._display.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._historyback.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._historyback.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._historyback.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._historytab.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._historytab.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._historytab.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._historytabOver.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._historytabOver.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._historytabOver.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._inspector.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._inspector.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._inspector.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche0.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche0.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche0.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche0_over.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche0_over.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche0_over.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche0_over_down.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche0_over_down.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche0_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche1.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche1.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche1.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche1_over.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche1_over.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche1_over.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche1_over_down.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche1_over_down.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche1_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche2.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche2.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche2.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche2_over.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche2_over.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche2_over.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche2_over_down.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche2_over_down.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche2_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche3.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche3.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche3.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche3_over.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche3_over.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche3_over.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche3_over_down.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche3_over_down.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche3_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche4.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche4.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche4.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche4_over.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche4_over.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche4_over.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche4_over_down.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche4_over_down.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche4_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche5.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche5.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche5.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche5_over.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche5_over.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche5_over.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche5_over_down.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche5_over_down.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche5_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche6.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche6.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche6.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche6_over.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche6_over.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche6_over.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche6_over_down.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche6_over_down.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche6_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche7.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche7.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche7.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche7_over.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche7_over.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche7_over.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche7_over_down.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche7_over_down.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche7_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche8.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche8.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche8.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche8_over.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche8_over.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche8_over.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche8_over_down.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche8_over_down.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche8_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche9.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche9.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche9.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche9_over.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche9_over.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche9_over.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche9_over_down.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche9_over_down.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touche9_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchec.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchec.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchec.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchec_over.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchec_over.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchec_over.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchec_over_down.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchec_over_down.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchec_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchediv.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchediv.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchediv.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchediv_over.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchediv_over.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchediv_over.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchediv_over_down.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchediv_over_down.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchediv_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchedot.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchedot.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchedot.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchedot_over.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchedot_over.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchedot_over.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchedot_over_down.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchedot_over_down.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchedot_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._toucheeq.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._toucheeq.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._toucheeq.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._toucheeq_over.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._toucheeq_over.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._toucheeq_over.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._toucheeq_over_down.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._toucheeq_over_down.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._toucheeq_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchef.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchef.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchef.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchef_over.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchef_over.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchef_over.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchef_over_down.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchef_over_down.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchef_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchem.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchem.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchem.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchem_over.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchem_over.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchem_over.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchem_over_down.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchem_over_down.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchem_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchep.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchep.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchep.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchep_over.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchep_over.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchep_over.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchep_over_down.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchep_over_down.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchep_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchepd.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchepd.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchepd.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchepd_over.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchepd_over.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchepd_over.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchepd_over_down.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchepd_over_down.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchepd_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchepg.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchepg.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchepg.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchepg_over.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchepg_over.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchepg_over.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchepg_over_down.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchepg_over_down.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/._touchepg_over_down.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/arrows_out/._bottom.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/arrows_out/._bottom.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/arrows_out/._bottom.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/arrows_out/._left.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/arrows_out/._left.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/arrows_out/._left.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/arrows_out/._right.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/arrows_out/._right.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/arrows_out/._right.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/arrows_out/._top.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/arrows_out/._top.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/arrows_out/._top.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/arrows_over/._button_arrow_bottom.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/arrows_over/._button_arrow_bottom.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/arrows_over/._button_arrow_bottom.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/arrows_over/._button_arrow_left.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/arrows_over/._button_arrow_left.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/arrows_over/._button_arrow_left.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/arrows_over/._button_arrow_right.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/arrows_over/._button_arrow_right.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/arrows_over/._button_arrow_right.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/arrows_over/._button_arrow_top.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/arrows_over/._button_arrow_top.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/arrows_over/._button_arrow_top.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/buttons_shadow/._back.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/buttons_shadow/._back.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/buttons_shadow/._back.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/buttons_shadow/._bottom.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/buttons_shadow/._bottom.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/buttons_shadow/._bottom.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/buttons_shadow/._cbottomleft.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/buttons_shadow/._cbottomleft.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/buttons_shadow/._cbottomleft.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/buttons_shadow/._cbottomright.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/buttons_shadow/._cbottomright.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/buttons_shadow/._cbottomright.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/buttons_shadow/._ctopleft.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/buttons_shadow/._ctopleft.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/buttons_shadow/._ctopleft.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/buttons_shadow/._ctopright.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/buttons_shadow/._ctopright.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/buttons_shadow/._ctopright.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/buttons_shadow/._left.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/buttons_shadow/._left.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/buttons_shadow/._left.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/buttons_shadow/._right.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/buttons_shadow/._right.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/buttons_shadow/._right.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/buttons_shadow/._top.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/buttons_shadow/._top.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/buttons_shadow/._top.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._pi.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._pi.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._pi.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._pi.psd b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._pi.psd new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._pi.psd differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._pi_click.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._pi_click.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._pi_click.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._pi_over.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._pi_over.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._pi_over.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._pow.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._pow.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._pow.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._pow.psd b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._pow.psd new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._pow.psd differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._sq.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._sq.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._sq.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._sq.psd b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._sq.psd new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._sq.psd differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._sq_click.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._sq_click.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._sq_click.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._sq_over.png b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._sq_over.png new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/images/calculator/._sq_over.png differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/js/._src b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/js/._src new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/js/._src differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/js/._vendor b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/js/._vendor new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/js/._vendor differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/js/src/._calculate.js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/js/src/._calculate.js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/js/src/._calculate.js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/js/src/._jquery.ubwidget.js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/js/src/._jquery.ubwidget.js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/js/src/._jquery.ubwidget.js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/js/src/._ubw-main.js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/js/src/._ubw-main.js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/js/src/._ubw-main.js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/js/vendor/._jquery-1.3.2.min.js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/js/vendor/._jquery-1.3.2.min.js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/js/vendor/._jquery-1.3.2.min.js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/js/vendor/._jquery-ui-1.7.2.custom.min.js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/js/vendor/._jquery-ui-1.7.2.custom.min.js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/js/vendor/._jquery-ui-1.7.2.custom.min.js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/js/vendor/._jquery.disable.text.select.js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/js/vendor/._jquery.disable.text.select.js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/js/vendor/._jquery.disable.text.select.js differ diff --git a/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/js/vendor/._jquery.easing.1.2.js b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/js/vendor/._jquery.easing.1.2.js new file mode 100644 index 00000000..69f214be Binary files /dev/null and b/resources/library/applications/Calculator.wgt/__MACOSX/Calculator.wgt/legacy/js/vendor/._jquery.easing.1.2.js differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Grapheur.html b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Grapheur.html new file mode 100644 index 00000000..23232fff --- /dev/null +++ b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Grapheur.html @@ -0,0 +1,921 @@ + + + + + + + + GraphMe + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    +
    + + + + GraphMe + + + + + Functions + + + + + Display + + + + + Help + + +
    + + +
    + 3D +
    + + +
    +
    S
    +
    ^
    + +
    +
    + + +
    + +
    +
    +
    +
    + +
    + f(x) = + + +
    + +
    +
    + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    -
    +
    +
    + +
    +
    ·
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +

    ------- Error -------

    +
    + Cannot draw function ... +

    + Invalid character or expression :
    + +

    + +
    + + +
    +

    ------- Error -------

    + Check the function and try to draw it again. +

    + Error message : . +

    + You can find examples of various drawable functions in the help menu. +
    + + +
    + + + + + + + + +
    +
    +

    ------- Error -------

    +

    + Update to latest version is not available because you already use the latest version. +


    + +
    + + +
    +
    +

    Preferences saved!

    +
    + +
    + + +
    +
    +

    Automatic update

    +

    + Do you really want to use the latest online widget version ? +


    + + +
    + + +
    +
    +
    +
    + + + + +
    +
    + + +
    +

    Display

    + + +
    +
    + + + +
    +
    + + + +
    +
    + + +
    + + +
    x
    +
    + + + + + +
    + + + + + + + + diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Guide_Utilisateur.html b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Guide_Utilisateur.html new file mode 100644 index 00000000..a6e2d64e --- /dev/null +++ b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Guide_Utilisateur.html @@ -0,0 +1,201 @@ + + + + + GraphMe - Guide utilisateur + + + +

    GraphMe

    + +

    Guide d'utilisation

    +
      +
    1. Introduction
    2. +
    3. Installation
    4. +
    5. Afficher le widget
    6. +
    7. Présentation de l'affichage
    8. +
    9. Dessiner une fonction
    10. +
    11. Se déplacer à travers la fonction
    12. +
    13. Le menu des options
    14. +
    15. Le menu des outils
    16. +
    17. Dessiner plusieurs fonctions
    18. +
    19. Mettre à jour GraphMe
    20. +
    21. Contact
    22. +
    +

    1. Introduction

    +

    + GraphMe est un traceur de fonctions mathématiques que j'ai programmé dans le cadre du travail de maturité gymnasiale. Il est codé en HTML, CSS et JavaScript. Ce grapheur est disponible sur un cd-rom accompagnant mon travail de maturité ainsi que sur internet à la page http://gyb.educanet2.ch/tm-widgets/.ws_gen/?15. Ce document a pour but d'expliquer comment utiliser GraphMe. Il présente ses différentes fonctions ainsi que quelques astuces utiles à l'utilisateur. +

    + +

    2. Installation

    +

    + Le widget que vous pouvez télécharger sur internet est compressé au format zip. Avant de l'utiliser, il est nécessaire de le décompresser. Si vous n'avez aucuns programmes permettant d'ouvrir les fichiers zip, vous pouvez télécharger 7zip sur http://www.7-zip.org/. GraphMe a été conçu pour s'utiliser dans un navigateur internet ou s'intégrer à Uniboard. Pour l'ajouter aux widgets d'Uniboard, il faut copier le dossier « GraphMe.wgt » dans « library/interactive/ ». Par exemple, sous Windows, le widget doit être dans : « C:/Program Files/Uniboard 4/library/interactive/GraphMe.wgt ». Si vous n'avez pas Uniboard, vous pouvez l'obtenir sur http://getuniboard.com/. +

    + +

    3. Afficher le widget

    +
    Image de GraphMe dans un navigateur internet
    +

    + A) Pour afficher le widget dans un navigateur, il faut simplement ouvrir le fichier « Grapheur.xhtml » qui se trouve dans le dossier « GraphMe.wgt » avec votre navigateur internet. Toutefois, certains navigateurs n'arrivent pas à afficher le widget. La liste suivante contient les navigateurs sur lesquels le widget a été testé : +

    +
      +
    • Mozilla Firefox (3.5) : tout fonctionne très bien.
    • +
    • Internet Explorer (8.0) : impossible d'ouvrir le widget, le format .xhtml n'est pas reconnu.
    • +
    • Internet Explorer (pré-version 9.0) : le widget est ouvrable mais seul l'affichage utilisant SVG fonctionne, « canvas » n'est toujours pas supporté.
    • +
    • Konqueror (4.3.4) : le widget s'ouvre mais il y a quelques problèmes d'affichage. Il est quand même utilisable en sélectionnant la méthode d'affichage « canvas » dans les options.
    • +
    • Rekonq (0.5) : le widget fonctionne très bien avec « canvas » mais est un peut lent en utilisant SVG.
    • +
    • Opera (10.51) : le widget est parfaitement utilisable
    • +
    • Google Chrome (4.1) : tout fonctionne également. L'affichage 3D est même très rapide comparé à d'autres navigateurs.
    • +
    +

    + B) Pour ouvrir le widget dans Uniboard, il faut tout d'abord cliquer sur le bouton « Bibliothèque » en haut de la fenêtre. Ensuite, allez dans l'onglet « Interactif » ou autrement, selon les version d'Uniboard, dans l'onglet « Applications ». Cliquez sur l'icône correspondant à « Traceur de fonctions mathématiques » et finalement sur « Ajouter à la page ». +

    +
    Image de GraphMe dans Uniboard
    + + +

    4. Présentation de l'affichage

    +
      +
    1. Champ permettant de définir la fonction à afficher.
    2. +
    3. Bouton affichant la fonction.
    4. +
    5. Bouton servant à ajouter une nouvelle fonction ou à accéder à l'historique des fonctions.
    6. +
    7. Zone d'affichage.
    8. +
    9. Options d'affichage permettant de définir la partie de la fonction à afficher.
    10. +
    11. Boutons de zoom.
    12. +
    13. Bouton servant à changer la couleur.
    14. +
    15. Boutons accédant aux différents menus.
    16. +
    17. Onglet choisissant entre les fonctions 2D et 3D.
    18. +
    19. Bouton de maximisation du widget.
    20. +
    + + +

    5. Dessiner une fonction

    +

    + Pour dessiner une fonction mathématique, il suffit d'entrer celle-ci dans le champ en haut du widget et de cliquer sur le bouton « Afficher ». On peut utiliser différentes fonctions et constantes prédéfinies: +

    +

    Les opérations de base

    +
      +
    • l'addition → +
    • +
    • la soustraction → -
    • +
    • la multiplication → *
    • +
    • la division → /
    • +
    • le modulo → %
    • +
    +

    Les fonctions trigonométriques

    +
      +
    • sin(x), cos(x), tan(x), cot(x)
    • +
    • asin(x), acos(x), atan(x), acot(x) ( ou arcsin(x), arccos(x), arctan(x), arccot(x) )
    • +
    +

    Les racines et les puissances

    +
      +
    • sqrt(x) fait la racine carrée de x
    • +
    • pow(x, y) élève un nombre x à une puissance y, par exemple :
      x² → pow(x, 2)
      (x+3)⁵ → pow((x+3), 5)
    • +
    • root(x, y) fait la racine yème d'un nombre x
    • +
    +

    Les exponentielles et logarithmes

    +
      +
    • exp(x)
    • +
    • ln(x) est le logarithme naturel
    • +
    • log(x) est le logarithme de base 10
    • +
    +

    Les arrondis

    +
      +
    • round(x) → arrondit à l'entier le plus proche
    • +
    • ceil(x) → arrondit à l'entier supérieur
    • +
    • floor(x) → arrondit à l'entier inférieur
    • +
    +

    Autres fonctions prédéfinies

    +
      +
    • abs(x) → la valeur absolue d'un nombre
    • +
    • random() → retourne un nombre aléatoire entre 0 et 1
    • +
    +

    Les constantes

    +
      +
    • pi = 4 * atan(1) ≈ 3.141592653589793
    • +
    • e = exp(1) ≈ 2.718281828459045
    • +
    +

    + Il n'est pas toujours facile de comprendre comment écrire la fonction désirée. En effet, une petite faute et elle ne s'affichera pas. De plus, il ne faut pas oublier de mettre un « * » entre les thermes à multiplier et d'utiliser le point « . » pour écrire des nombres à virgule. +

    +

    + Les fonctions en deux dimensions s'écrivent sous la forme : y=[...] et les fonctions en trois dimensions sous la forme : z=[...]. D'autres exemples sont disponibles dans le menu « aide » du widget si vous avez de la peine à entrer une fonction. +

    + +

    6. Se déplacer à travers la fonction

    +

    + Parfois, lorsqu'on dessine une fonction, la zone visible n'est pas très intéressante. Pour cela, il est utile de déplacer l'affichage ou de définir soi-même la zone à afficher. +

    + +

    + Pour déplacer la fonction, il suffit d'utiliser les flèches de navigation situées dans les quatre bords de l'affichage ou l'outil de déplacement à la souris (dans le menu « Outils »). +

    +

    + Pour définir la zone à afficher, il faut entrer des valeurs personnalisées dans les champs à gauche du widget. La valeur de gauche doit obligatoirement être plus petite que la valeur de droite. Dans le cas contraire, la fonction ne se dessinera pas. +

    +

    + Il est possible de zoomer ou dé-zoomer l'affichage en utilisant les boutons du menu de gauche pour voir une plus grande partie de la fonction. Le zoom peut être réinitialisé dans les options. On peut également cliquer deux fois sur le graphique pour zoomer ainsi que dé-zoomer en maintenant la touche « ctrl » appuyée et en cliquant deux fois. +

    + +

    + Cliquez sur le bouton « Options » à gauche du widget pour ouvrir ce menu. En cliquant à nouveau sur le bouton, cela ferme le menu. Plusieurs onglets permettent de naviguer entre les différentes options. Description des options : +

    +
      +
    • Le thème du widget change l'image de fond ainsi que différentes couleurs. Dans Uniboard, changer le thème permet de rendre le widget plus visible selon qu'il se trouve sur un fond noir ou un fond blanc.
    • +
    • La méthode d'affichage permet de définir la façon dont le graphique de la fonction sera dessiné. Il y a le choix entre six possibilités :
      +
        +
      1. SVG est un format d'image vectoriel qui peut être intégré dans une page HTML. Il est compatible dans la plupart des navigateurs Internet et est très bien supporté par Uniboard, c'est pourquoi il est choisi par défaut.
      2. +
      3. « SVG (une image) » ne présente que peu de différence avec la méthode d'affichage « SVG ». A moins d'un problème de compatibilité, il n'est pas très utile de la choisir.
      4. +
      5. Canvas est une nouvelle balise présente depuis HTML 5.0. Elle permet de définir une zone dans laquelle on peut faire des dessins. Cette méthode d'affichage est plus rapide que d'utiliser du SVG, cependant, elle n'est pas complètement compatible dans Uniboard. Il est conseillé de choisir cette option si vous utilisez le widget ailleurs que dans Uniboard.
      6. +
      7. Canvas (point) utilise aussi canvas, mais dessine des points à la place de lignes.
      8. +
      9. XPM est un format d'image très peu connu. De ce fait, il est compatible qu'avec une minorité de navigateur.
      10. +
      11. La méthode d'affichage « Uniboard » permet de dessiner directement sur la page d'Uniboard avec les outils de dessins.
      12. +
      + +
    • +
    • Le zoom par défaut ainsi que le bouton « réinitialiser le zoom » permettent de remettre l'affichage à l'état qu'il était à l'ouverture du widget. Cela permet aussi de centrer l'affichage sur l'origine.
    • +
    • Les options d'affichage permettent d'afficher ou non la grille, les axes ainsi que l'échelle. Elles sont utiles pour rendre l'affichage plus lisible. Il est également possible de modifier l'épaisseur du trait de la fonction.
    • +
    • Le décalage du graphique n'a en principe pas besoin d'être utilisé. Il permet de déplacer tout l'affichage dans un sens ou dans l'autre, s'il n'est pas centré à la bonne place. Cela peut arriver avec certains navigateurs Internet.
    • +
    • La précision des calculs du graphique permet d'augmenter ou de diminuer le nombre de points calculés. Plus le nombre est petit, plus la précision est grande. Il est utile de mettre cette valeur à « 0.01 » si vous dessinez des fonctions ressemblant à 0.5*sin(10*x*x).
    • +
    • Dans les options 3D, le style d'affichage permet de choisir comment la fonction est dessinée : avec des petits points ou avec des polygones (surfaces). La plupart des fonctions sont plus jolies en dessinant la surface entre les points calculés. Toutefois, c'est mieux de dessiner des points pour des fonctions comme la demi-sphère : sqrt(12-x*x-y*y).
    • +
    • Dans le dernier onglet, vous pouvez modifier d'autres options 3D, comme la précision des calculs ainsi que la couleur de la fonction.
    • +
    + +

    + Ce menu permet tout d'abord de choisir l'action de la souris sur le graphique. Il y a le choix entre trois possibilités : +

    +
      +
    • L'outil sélectionné par défaut est le point. En bougeant la souris, un point se déplace sur la fonction et les coordonnées de ce point sont indiquées en haut à gauche de l'affichage.
    • +
    • Le deuxième outil est le déplacement. Il permet de déplacer le graphique avec la souris. Il suffit de tenir cliqué sur l'affichage et de bouger la souris. Malheureusement, cet outil peut être lent sur certains navigateurs.
    • +
    • Le troisième outil est la tangente. Cet outil dessine la tangente à la fonction au point où se trouve la souris.
    • +
    +

    + Ensuite, ce menu permet aussi de calculer un point de la fonction. Il faut simplement entrer la coordonnée « x » du point dont on veut trouver la coordonnée « y », et appuyer sur le bouton « Évaluer ». Par exemple, si la fonction est « x*x » et qu'on défini « x=2 », alors le point dont la coordonnée sur l'axe des X est « 2 » aura comme coordonnée sur l'axe des Y « 4 ». +

    +

    + Un autre outil très utile est l'étude de fonction. Pour étudier la fonction entrée dans le champ en haut du widget, cliquez sur « démarrer l'étude ». Les études de fonction de ce widget ne sont pas fiables à 100% mais servent de complément à une étude de fonction que l'on fait soi-même. Il se peut que cet outil soit amélioré dans une prochaine version du widget. +

    +

    + Dans ce menu, on trouve également des tests d'affichage. Ils permettent d'essayer les différentes méthodes d'affichage et de voir si elles fonctionnent sur le navigateur internet utilisé. +

    +

    9. Dessiner plusieurs fonctions

    +

    + Pour dessiner plusieurs fonctions simultanément, cliquez sur le petit bouton « + » qui se situe à droite du bouton « Afficher » (point 1). Ensuite, un menu apparaît. +

    + +

    + Dans ce menu, des onglets permettent d'aller à l'historique ou aux fonctions supplémentaires (point 2). Pour ajouter une fonction, cliquez sur le bouton à droite de la fonction actuelle (point 3). En dessous, une liste contient toutes les fonctions affichées (point 4). Pour supprimer une fonction, il faut simplement cliquer sur le bouton « - » à coté de celle-ci. Il est également possible de modifier la couleur de chaque fonction séparément. +

    +

    + L'historique permet de revoir toutes les fonctions qui ont déjà été dessinées. Lorsque l'on clique sur une fonction de l'historique, celle qui est dessinée actuellement est remplacée par la fonction de l'historique. +

    +

    + Dessiner plusieurs fonctions simultanément est uniquement possible avec la méthode d'affichage « canvas » en deux dimensions. Par contre, l'historique est utilisable avec toutes les méthodes d'affichage. +

    +

    10. Mettre à jour GraphMe

    +

    + La dernière version du widget est téléchargeable sur la page suivante : http://gyb.educanet2.ch/tm-widgets/.ws_gen/?15. Pour mettre à jour GraphMe, vous pouvez aussi cliquer sur le bouton "Mise à jour" dans le menu des options. +

    +

    11. Contact

    +

    + Si vous voulez rapporter un bug, avez une suggestion par rapport au widget ou voulez simplement poser une question, merci de me contacter par e-mail à l'adresse : yannick.vessaz@gmail.com. +

    + + \ No newline at end of file diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/GraphMe.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/GraphMe.png new file mode 100644 index 00000000..e9a1740b Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/GraphMe.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/Guide_AjouterWidget.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/Guide_AjouterWidget.png new file mode 100644 index 00000000..d500ab64 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/Guide_AjouterWidget.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/Guide_Deplacement.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/Guide_Deplacement.png new file mode 100644 index 00000000..bb954e7f Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/Guide_Deplacement.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/Guide_Navigateur.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/Guide_Navigateur.png new file mode 100644 index 00000000..7947c9ec Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/Guide_Navigateur.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/Guide_Options.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/Guide_Options.png new file mode 100644 index 00000000..fb028187 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/Guide_Options.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/Guide_Plus.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/Guide_Plus.png new file mode 100644 index 00000000..f32b1399 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/Guide_Plus.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/Guide_Presentation.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/Guide_Presentation.png new file mode 100644 index 00000000..071a50af Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/Guide_Presentation.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/Guide_Uniboard.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/Guide_Uniboard.png new file mode 100644 index 00000000..6139040b Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/Guide_Uniboard.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/black/bottom-left.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/black/bottom-left.png new file mode 100644 index 00000000..8423b59b Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/black/bottom-left.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/black/bottom-right.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/black/bottom-right.png new file mode 100644 index 00000000..915abc13 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/black/bottom-right.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/black/bottom.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/black/bottom.png new file mode 100644 index 00000000..d61623c7 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/black/bottom.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/black/center.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/black/center.png new file mode 100644 index 00000000..8ce90552 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/black/center.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/black/left.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/black/left.png new file mode 100644 index 00000000..eeb45738 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/black/left.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/black/right.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/black/right.png new file mode 100644 index 00000000..ca19f467 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/black/right.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/black/top-left.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/black/top-left.png new file mode 100644 index 00000000..01fa7a62 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/black/top-left.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/black/top-right.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/black/top-right.png new file mode 100644 index 00000000..0fd81158 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/black/top-right.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/black/top.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/black/top.png new file mode 100644 index 00000000..1b2978ff Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/black/top.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/blue/bottom-left.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/blue/bottom-left.png new file mode 100644 index 00000000..59bd3d46 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/blue/bottom-left.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/blue/bottom-right.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/blue/bottom-right.png new file mode 100644 index 00000000..850fb3cf Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/blue/bottom-right.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/blue/bottom.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/blue/bottom.png new file mode 100644 index 00000000..0ff3f4a5 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/blue/bottom.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/blue/center.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/blue/center.png new file mode 100644 index 00000000..6b984a2f Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/blue/center.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/blue/left.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/blue/left.png new file mode 100644 index 00000000..81b692b1 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/blue/left.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/blue/right.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/blue/right.png new file mode 100644 index 00000000..db5ed624 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/blue/right.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/blue/top-left.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/blue/top-left.png new file mode 100644 index 00000000..e5f38e7d Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/blue/top-left.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/blue/top-right.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/blue/top-right.png new file mode 100644 index 00000000..b27b6ec9 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/blue/top-right.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/blue/top.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/blue/top.png new file mode 100644 index 00000000..9538dd53 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/blue/top.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/cursor.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/cursor.png new file mode 100644 index 00000000..3170b04a Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/cursor.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/darkblue/bottom-left.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/darkblue/bottom-left.png new file mode 100644 index 00000000..cd121e50 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/darkblue/bottom-left.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/darkblue/bottom-right.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/darkblue/bottom-right.png new file mode 100644 index 00000000..7c32bb8a Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/darkblue/bottom-right.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/darkblue/bottom.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/darkblue/bottom.png new file mode 100644 index 00000000..c9e7b15f Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/darkblue/bottom.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/darkblue/center.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/darkblue/center.png new file mode 100644 index 00000000..20e73707 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/darkblue/center.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/darkblue/left.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/darkblue/left.png new file mode 100644 index 00000000..d88f7bea Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/darkblue/left.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/darkblue/right.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/darkblue/right.png new file mode 100644 index 00000000..c3994ad0 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/darkblue/right.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/darkblue/top-left.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/darkblue/top-left.png new file mode 100644 index 00000000..8b03ecca Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/darkblue/top-left.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/darkblue/top-right.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/darkblue/top-right.png new file mode 100644 index 00000000..9db3c018 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/darkblue/top-right.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/darkblue/top.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/darkblue/top.png new file mode 100644 index 00000000..7b068448 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/darkblue/top.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/gradient.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/gradient.png new file mode 100755 index 00000000..5fceffec Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/gradient.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/gradient1.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/gradient1.png new file mode 100755 index 00000000..2b4ba137 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/gradient1.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/gradient2.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/gradient2.png new file mode 100644 index 00000000..57d0779c Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/gradient2.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/gradient3.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/gradient3.png new file mode 100644 index 00000000..441ccf51 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/gradient3.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/gradient4.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/gradient4.png new file mode 100644 index 00000000..c3449f77 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/gradient4.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/mini_icon.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/mini_icon.png new file mode 100644 index 00000000..bddfac5d Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/mini_icon.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/move.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/move.png new file mode 100644 index 00000000..045554aa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/move.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/onglet1.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/onglet1.png new file mode 100644 index 00000000..1439a8c0 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/onglet1.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/onglet2.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/onglet2.png new file mode 100644 index 00000000..5f1dd669 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/onglet2.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/tangent.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/tangent.png new file mode 100644 index 00000000..f08c37d8 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/tangent.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/white/bottom-left.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/white/bottom-left.png new file mode 100644 index 00000000..8e8312e3 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/white/bottom-left.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/white/bottom-right.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/white/bottom-right.png new file mode 100644 index 00000000..4e691af1 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/white/bottom-right.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/white/bottom.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/white/bottom.png new file mode 100644 index 00000000..43ddff4f Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/white/bottom.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/white/center.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/white/center.png new file mode 100644 index 00000000..4068e6f1 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/white/center.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/white/left.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/white/left.png new file mode 100644 index 00000000..b2116a17 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/white/left.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/white/right.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/white/right.png new file mode 100644 index 00000000..c6e32ad4 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/white/right.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/white/top-left.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/white/top-left.png new file mode 100644 index 00000000..7c3a5766 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/white/top-left.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/white/top-right.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/white/top-right.png new file mode 100644 index 00000000..037ffc80 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/white/top-right.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/white/top.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/white/top.png new file mode 100644 index 00000000..1bd3bf4d Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Images/white/top.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Affichage.js b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Affichage.js new file mode 100644 index 00000000..9407063d --- /dev/null +++ b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Affichage.js @@ -0,0 +1,386 @@ + +// Convertir une coordonnée sur le graphique en position relative à l'affichage (ou à l'écran si ecran = true) +function coordToPosX(x, ecran){ + if(ecran){ + return coordToPosX(x, false)+affichage.offsetLeft; + } + else{ + return (x - affichage.xGauche) * affichage.multX; + } +} +function coordToPosY(y, ecran){ + if(ecran){ + return coordToPosY(y, false)+affichage.offsetTop; + } + else{ + return affichage.hauteur - (y - affichage.yBas) * affichage.multY; + } +} + +var affichage = { + // Options + id : "affichage", + largeur : 640, // Set by init + hauteur : 430, // Set by init + couleurFond : "rgba(0,0,0,0)", + + // Bornes (zone d'affichage) + xGauche : -5.5, // Set by init + xDroite : 5.5, // Set by init + yBas : -3.7, + yHaut : 3.7, + + multX : 1, + multY : 1, + + // Axes + axes : true, + couleurAxes : "rgba(0,0,0,0.5)", + widthAxes : 2, + // Grille + grille : true, + couleurGrille : "rgba(255,255,255,0.1)", + widthGrille : 2, + // Echelle + echelle : true, + couleurEchelle : "rgba(255,255,255,1)", + + // Précision + precision : 100, + precisionAmelioree : true, // false = fonction plus jolie lorsqu'on dé-zoom, true = affichage plus rapide lors du dé-zoom. + + // Méthode et style + methode : "canvas", + style : "continu", + + // Variable définies lors de l'initialisation + canvas : null, + ctx : null, + object : null, + offsetTop : null, // Position de l'affichage par rapport à la page + offsetLeft : null, + + init : function(element, width, height){ + this.setBornes(); + + // Supprimer le contenu de l'affichage + if(!element){ + element = document.getElementById(this.id); + } + if(element.hasChildNodes()){ + while(element.childNodes.length >= 1 ){ + element.removeChild(element.firstChild); + } + } + + // Définir la taille + this.largeur = width || element.clientWidth; + this.hauteur = height || element.clientHeight; + + // Set left and right proportionally to width, height, top and bottom + var centerX = this.xGauche + (this.xDroite - this.xGauche)/2; + var centerY = this.yBas + (this.yHaut - this.yBas)/2; + var dx = ((this.yHaut - this.yBas) / 2) * this.largeur / this.hauteur; + this.xGauche = Math.round((centerX - dx)*100)/100; + this.xDroite= Math.round((centerX + dx)*100)/100; + this.setBornes(); + + // Récupérer la position + var boundingClientRect = element.getBoundingClientRect(); + this.offsetTop = boundingClientRect.top; + this.offsetLeft = boundingClientRect.left; + + // Sélectionner la méthode d'affichage + if(this.methode == "svg"){ +// this.object = document.createElement("embed"); +// this.object.type = "image/svg+xml"; +// this.object.src = "AffichageSVG.svg"; + this.object = document.getElementById("embedSVG"); + this.object.width = this.largeur; + this.object.height = this.hauteur; + this.object.style.top = this.offsetTop +1 +"px"; + this.object.style.left = this.offsetLeft +1 +"px"; + this.object.style.display = "block"; +// element.appendChild(this.object); + +// affichage.ctx = svg; +// affichage.dessiner(); +// // Exécuter this.dessiner() maintenant ne va pas car svg n'est pas +// // encore défini dans cette fonction, il faut en lancer un nouvelle... + setTimeout("affichage.ctx = svg", 50); + setTimeout("affichage.dessiner()", 100); + } + else if(this.methode == "uniboard"){ + if(window.uniboard || window.sankore){ + try{ + initUniboard(); + this.ctx = uniboard; + this.dessiner(); + } + catch(err){ + alert(err.message); + } + } + else{ + this.methode = "canvas"; + this.setOptions(); + this.init(); + } + } + else{ + document.getElementById("embedSVG").style.display = "none"; + + this.canvas = document.createElement("canvas"); + this.canvas.width = this.largeur; + this.canvas.height = this.hauteur; + element.appendChild(this.canvas); + + this.ctx = this.canvas.getContext("2d"); + + this.dessiner(); + } + + // Événements + if(window.addEventListener){ + element = document.getElementById("eventAffichage"); + element.addEventListener('DOMMouseScroll', souris.wheel, false); + element.onmousewheel = souris.wheel; + element.oncontextmenu = ctxMenu.ouvrir; + } + }, + + calculer : function(){ + this.getBornes(); + this.getOptions(); + if(fonction3D){ + display3D.draw() + } + else{ + this.dessiner(); + } + saveOptions(); + }, + + dessiner : function(){ + try{ +// var ti = new Date().getTime(); + var precision; + if(this.precisionAmelioree){ + precision = 10/this.precision; + } + else{ + precision = Math.abs(this.xDroite - this.xGauche)/this.precision; + } + this.multX = this.largeur/Math.abs(this.xDroite - this.xGauche); + this.multY = this.hauteur/Math.abs(this.yHaut - this.yBas); + + var ctx = new Object(); + ctx = this.ctx; + ctx.clearRect(0,0,this.largeur,this.hauteur); + + ctx.fillStyle = this.couleurFond; + ctx.fillRect(0,0,this.largeur,this.hauteur); + + ctx.strokeOpacity = 1; // svg + + // Couleur pour l'aire sous la fonction + ctx.fillStyle = "rgba(0,180,255,0.3)"; + + // Fonctions + for(var i=0; i x : ajouter = 0.5") + } + + this.xGauche -= ajouter; + this.xDroite += ajouter; + + // Vertical + diffBornes = Math.abs(this.yHaut - this.yBas); + ajouter = Math.round(diffBornes * (facteur-1)*2)/4; + if(ajouter == 0){ + ajouter = 0.25; +// log("affichage.zoom -> y : ajouter = 0.5") + } + + this.yBas -= ajouter; + this.yHaut += ajouter; + + this.dessiner(); + this.setBornes(); + + saveOptions(); + } +}; diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Affichage3D.js b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Affichage3D.js new file mode 100755 index 00000000..9cf88b63 --- /dev/null +++ b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Affichage3D.js @@ -0,0 +1,407 @@ + +var fonction3D = false; +var outilPrecedent = ""; + +function activer3D(){ + if(fonction3D){ // Si activé alors on le désative + fonction3D = false; + outil.choisir(outilPrecedent); + document.getElementById('onglet3D').innerHTML = "3D"; + document.getElementById('zoomButtons').style.display = "block"; + document.getElementById('toolButtons').style.display = "block"; + affichage.init(); + outil.init(); + affichage.initZoom2(document.getElementById('zoomDefaut').value); + } + else{ // Sinon on l'active + fonction3D = true; + outilPrecedent = outil.actuel; + outil.choisir("deplacement"); + document.getElementById('onglet3D').innerHTML = "2D"; + document.getElementById('zoomButtons').style.display = "none"; + document.getElementById('toolButtons').style.display = "none"; + display3D.init(); + outil.liste = []; + outil.init(); + message.supprimer(); + } + cacherMenu(); + if(fonction3D){ + if(document.getElementById('input3D').value == ""){ + afficherMenu('menuFonctions3D'); + } + else{ + display3D.draw(); + } + } + saveOptions(); +} + +var display3D = { + canvas: null, + ctx: null, + width: 0, + height: 0, + centerX: 0, + centerY: 0, + scale: 50, + linePrecision: 0.02, + functionPrecision: 0.2, + angle: Math.PI/8, + zoomValue: 1, + left: -6.5, + right: 6.5, + rouge3D: 0, + vert3D: 1, + bleu3D: 2, + couleurGenerale: 0, + background: "rgba(0, 0, 0, 0.5)", + + init: function(width, height){ + var displayElement = document.getElementById("affichage"); + + // Clear displayElement content + if(displayElement.hasChildNodes()){ + while(displayElement.childNodes.length >= 1 ){ + displayElement.removeChild(displayElement.firstChild); + } + } + + // Setup sizes + this.width = width || displayElement.clientWidth; + this.height = height || displayElement.clientHeight; + this.centerX = this.width / 2; + this.centerY = this.height / 2; + + // Create canvas + this.canvas = document.createElement("canvas"); + this.canvas.width = this.width; + this.canvas.height = this.height; + displayElement.appendChild(this.canvas); + + this.ctx = this.canvas.getContext('2d'); + this.clear(); + }, + + clear: function(){ + var ctx = this.ctx; + ctx.clearRect(0, 0, this.width, this.height); + ctx.fillStyle = this.background; + ctx.fillRect(0, 0, this.width, this.height); + this.axes(); + }, + + draw: function(){ + // var ti = new Date().getTime(); + // this.init(); + this.clear(); + + var txtFct = fct.remplacer(fct.verifier(document.getElementById("input3D").value)); + if(txtFct == ""){ + return; + } + + var func = new CartesianFunction(txtFct); + + if(document.getElementById("selectAffichage3D").value == "points"){ + var coordX, coordY, coordZ; + for(var x=this.left; xthis.left; x1-=this.functionPrecision){ + for(var y1=this.right; y1>this.left; y1-=this.functionPrecision){ + x = x1; + y = y1; + z1 = func.f(x,y); + x2 = x1 - this.functionPrecision; + y2 = y1; + x = x2; + //y = y2; + z2 = func.f(x,y); + x3 = x2; + y3 = y2 - this.functionPrecision; + //x = x3; + y = y3; + z3 = func.f(x,y); + x4 = x3 + this.functionPrecision; + y4 = y3; + x = x4; + //y = y4; + z4 = func.f(x,y); + if(isNaN(z1)||isNaN(z2)||isNaN(z3)||isNaN(z4)){ + continue; + } + this.polygone3D(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4); + } + } + } + } + // var tf = new Date().getTime(); + // window.console.log(tf-ti); + }, + + // Dessine un point à la position (x, y, z) + point3D: function(x, y, z){ + var posX = (Math.sin(this.angle)*x + Math.cos(this.angle)*y)*this.scale; + var posZ = -(z - Math.cos(this.angle)*x/2.6 + Math.sin(this.angle)*y/2.6)*this.scale; + + var opacity = Math.round((1-((5+y*Math.sin(this.angle)-x*Math.cos(this.angle)) / 450)*this.scale)*1000)/1000; + var couleur = new Array(); + couleur[0] = Math.round((5+z)*this.scale); + couleur[1] = Math.round(510 - (5+z)*this.scale); + couleur[2] = this.couleurGenerale; + if(opacity > 1){ opacity = 1; } + if(opacity < 0){ opacity = 0; } + if(couleur[0] > 255){ couleur[0] = 255; } + if(couleur[0] < 0){ couleur[0] = 0; } + if(couleur[1] > 255){ couleur[1] = 255; } + if(couleur[1] < 0){ couleur[1] = 0; } + + var ctx = this.ctx; + ctx.save(); + ctx.translate(this.centerX, this.centerY); + ctx.scale(this.zoomValue, this.zoomValue); + ctx.fillStyle = "rgba("+couleur[this.rouge3D]+","+couleur[this.vert3D]+", "+couleur[this.bleu3D]+", "+opacity+")"; + ctx.fillRect(posX-1, posZ-1, 2, 2); + ctx.restore(); + }, + + // Dessine un polygone qui a comme sommets : (x1, y1, z1) , (x2, y2, z2), (x3, y3, z3) et (x4, y4, z4) + polygone3D: function(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4){ + var ctx = this.ctx; + ctx.save(); + ctx.translate(this.centerX, this.centerY); + ctx.scale(this.zoomValue, this.zoomValue); + ctx.beginPath(); + ctx.moveTo((Math.sin(this.angle)*x1 + Math.cos(this.angle)*y1)*this.scale , -(z1 - Math.cos(this.angle)*x1/2.6 + Math.sin(this.angle)*y1/2.6)*this.scale); + ctx.lineTo((Math.sin(this.angle)*x2 + Math.cos(this.angle)*y2)*this.scale , -(z2 - Math.cos(this.angle)*x2/2.6 + Math.sin(this.angle)*y2/2.6)*this.scale); + ctx.lineTo((Math.sin(this.angle)*x3 + Math.cos(this.angle)*y3)*this.scale , -(z3 - Math.cos(this.angle)*x3/2.6 + Math.sin(this.angle)*y3/2.6)*this.scale); + ctx.lineTo((Math.sin(this.angle)*x4 + Math.cos(this.angle)*y4)*this.scale , -(z4 - Math.cos(this.angle)*x4/2.6 + Math.sin(this.angle)*y4/2.6)*this.scale); + + var opacity = Math.round((1-((5+y1*Math.sin(this.angle)-x1*Math.cos(this.angle)) / 450)*this.scale)*1000)/1000; + var couleur = new Array(); + couleur[0] = Math.round((5+z1)*this.scale); + couleur[1] = Math.round(510 - (5+z1)*this.scale); + couleur[2] = this.couleurGenerale; + if(opacity > 1){ opacity = 1; } + if(opacity < 0){ opacity = 0; } + + // for(var i=0; i 255){ couleur[0] = 255; } + if(couleur[0] < 0){ couleur[0] = 0; } + if(couleur[1] > 255){ couleur[1] = 255; } + if(couleur[1] < 0){ couleur[1] = 0; } + + ctx.fillStyle = "rgba("+couleur[this.rouge3D]+","+couleur[this.vert3D]+", "+couleur[this.bleu3D]+", "+opacity+")"; + ctx.strokeStyle = "rgba(0,0,0,0.1)"; + ctx.closePath(); + ctx.fill(); + ctx.stroke(); + ctx.restore(); + }, + + // Dessine les axes + axes: function(){ + for(var i=-5; i<5; i+=this.linePrecision){ + this.point3D(0, 0, i); + } + for(var i=-5.5; i<5.5; i+=this.linePrecision){ + this.point3D(i, 0, 0); + } + for(var i=-5.5; i<5.5; i+=this.linePrecision){ + this.point3D(0, i, 0); + } + }, + + cube: function(x, y, z, r){ + // Face de devant + for(var i=0; i 255){ + this.couleurGenerale = 255; + } + switch(document.getElementById("selectRouge3D").value){ + case "plus": + this.rouge3D = 0; + rouge = 255; + sensRouge = -1; + break; + case "moins": + this.rouge3D = 1; + rouge = 0; + sensRouge = 1; + break; + case "tout": + this.rouge3D = 2; + rouge = this.couleurGenerale; + sensRouge = 0; + break; + } + switch(document.getElementById("selectVert3D").value){ + case "plus": + this.vert3D = 0; + vert = 255; + sensVert = -1; + break; + case "moins": + this.vert3D = 1; + vert = 0; + sensVert = 1; + break; + case "tout": + this.vert3D = 2; + vert = this.couleurGenerale; + sensVert = 0; + break; + } + switch(document.getElementById("selectBleu3D").value){ + case "plus": + this.bleu3D = 0; + bleu = 255; + sensBleu = -1; + break; + case "moins": + this.bleu3D = 1; + bleu = 0; + sensBleu = 1; + break; + case "tout": + this.bleu3D = 2; + bleu = this.couleurGenerale; + sensBleu = 0; + break; + } + document.getElementById("apercuCouleur3D").innerHTML = "."; + for(var i=0; i.
    "; + } + if(this.ctx){ + this.draw(); + } + }, + + zoom: function(value){ + if(!fonction3D){ + return; + } + this.zoomValue *= value; + this.left /= value; + this.right /= value; + this.functionPrecision /= value; + this.linePrecision /= value; + //alert(this.zoomValue+" ; "+this.left+" ; "+this.right+" ; "+this.functionPrecision+" ; "+this.linePrecision); + this.draw(); + }, + + move: function(value){ + this.angle += Math.PI/32 * value; + this.draw(); + }, + + initZoom: function(){ + this.angle = Math.PI/8; + this.zoomValue = 1; + this.left = -6.5; + this.right = 6.5; + this.draw(); + } +}; + diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/AffichageSVG.svg b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/AffichageSVG.svg new file mode 100644 index 00000000..ac73b17a --- /dev/null +++ b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/AffichageSVG.svg @@ -0,0 +1,100 @@ + + + + + + + \ No newline at end of file diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/AffichageUniboard.js b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/AffichageUniboard.js new file mode 100755 index 00000000..11b3d0ea --- /dev/null +++ b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/AffichageUniboard.js @@ -0,0 +1,299 @@ +// -------------------- Uniboard -------------------- +// Ces fonctions permettent de dessiner le graphique directement dans Uniboard. + +function colorToHex(color) { + var addZero = function(myString){ + if (myString.length == 1) return "0" + myString; + else return myString; + } + + var digits = /(.*?)rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(color); + if (digits == null){ + digits = /(.*?)rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(color); + } + if(digits == null){ + return ""; + } + var red = parseInt(digits[2]); + var green = parseInt(digits[3]); + var blue = parseInt(digits[4]); + var hexcode = addZero(red.toString(16)) + addZero(green.toString(16)) + addZero(blue.toString(16)); + return '#' + hexcode.toUpperCase(); +} + +function initUniboard(){ + if(!window.uniboard && window.sankore){ + uniboard = sankore; + } + uniboard.centerOn(337,245); +// uniboard.setTool("pen"); + + // Paramètres par défaut + uniboard.lineWidth = 1; + uniboard.fillStyle = "black"; + uniboard.strokeStyle = "black"; + + // Position du curseur pour écrire des nombres + uniboard.cursorX = 0; + uniboard.cursorY = 0; + + // Fonctions + uniboard.strokeColor = function(){ + this.setPenColor(colorToHex(this.strokeStyle)); + }; + + uniboard.fillColor = function(){ + this.setPenColor(colorToHex(this.fillStyle)); + }; + + uniboard.lineTo = function(x, y){ + if(y>-20 && y0){ + nonDefini--; + ctx.moveTo(pointX, pointY); + } + else{ + if(this.style == "continu"){ + ctx.lineTo(pointX, pointY); + } + else if(this.style == "points"){ + ctx.beginPath(); + ctx.arc(pointX, pointY, this.width, 0, 2*Math.PI, true); + ctx.fill(); + } + else{ + ctx.lineTo(pointX, pointY); + nonDefini = 1; + } + } + } + else{ + nonDefini = 2; + } + } + if(this.style != "points"){ + ctx.stroke(); + } + } + + // Dérivée seconde + if(this.derivee2){ + ctx.beginPath(); + ctx.strokeStyle = this.couleurDerivee2; + ctx.fillStyle = this.couleurDerivee2; + ctx.moveTo(-100,-100); + nonDefini = 1; + var pente, pente2; + var x0 = affichage.xGauche-precision; + var y0 = this.f(x0); + var p0 = 0; + + for(x = affichage.xGauche-precision*3; x <= affichage.xDroite+precision; x+=precision){ + // Evaluer la valeur y du point x + y = this.f(x); + if(!isNaN(y)){ + // Transformation des coordonnées + p = (y-y0)/precision; + pente = (p-p0)/precision; + pointX = (x-precision/2 - affichage.xGauche) * affichage.multX; + pointY = affichage.hauteur - (pente - affichage.yBas) * affichage.multY; + y0 = y; + p0 = p; + + // Dessiner la dérivée seconde + if(nonDefini>0){ + nonDefini--; + ctx.moveTo(pointX, pointY); + } + else{ + if(this.style == "continu"){ + ctx.lineTo(pointX, pointY); + } + else if(this.style == "points"){ + ctx.beginPath(); + ctx.arc(pointX, pointY, this.width, 0, 2*Math.PI, true); + ctx.fill(); + } + else{ + ctx.lineTo(pointX, pointY); + nonDefini = 1; + } + } + } + else{ + nonDefini = 3; + } + } + if(this.style != "points"){ + ctx.stroke(); + } + } + + // Primitive première + if(this.primitive1){ + ctx.beginPath(); + ctx.strokeStyle = this.couleurPrimitive1; + ctx.fillStyle = this.couleurPrimitive1; + ctx.moveTo(-affichage.xGauche*affichage.multX,affichage.hauteur-(this.conditionInitiale-affichage.yBas)*affichage.multY); + nonDefini = 0; + var pente, y0; + var conditionInitiale = this.conditionInitiale; +// precision /= 4; + + // Partie droite + y0 = conditionInitiale; + for(x = precision; x <= affichage.xDroite+precision; x+=precision){ + // Evaluer la valeur y du point x + pente = this.f(x); + if(!isNaN(pente)){ + // Transformation des coordonnées + y = y0 + pente * precision; + + pointX = (x - affichage.xGauche) * affichage.multX; + pointY = affichage.hauteur - (y - affichage.yBas) * affichage.multY; + y0 = y; + + // Dessiner la primitive + if(nonDefini>0){ + nonDefini--; + ctx.moveTo(pointX, pointY); + } + else{ + if(this.style == "continu"){ + ctx.lineTo(pointX, pointY); + } + else if(this.style == "points"){ + ctx.beginPath(); + ctx.arc(pointX, pointY, this.width, 0, 2*Math.PI, true); + ctx.fill(); + } + else{ + ctx.lineTo(pointX, pointY); + nonDefini = 1; + } + } + } + else{ + nonDefini = 2; + } + } + if(this.style != "points"){ + ctx.stroke(); + } + // Partie gauche + ctx.beginPath(); + ctx.moveTo(-affichage.xGauche*affichage.multX,affichage.hauteur-(this.conditionInitiale-affichage.yBas)*affichage.multY); + nonDefini = 0; + y0 = conditionInitiale; + for(x = -precision; x >= affichage.xGauche-precision; x-=precision){ + // Evaluer la valeur y du point x + pente = this.f(x); + if(!isNaN(pente)){ + // Transformation des coordonnées + y = y0 - pente * precision; + + pointX = (x - affichage.xGauche) * affichage.multX; + pointY = affichage.hauteur - (y - affichage.yBas) * affichage.multY; + y0 = y; + + // Dessiner la primitive + if(nonDefini>0){ + nonDefini--; + ctx.moveTo(pointX, pointY); + } + else{ + if(this.style == "continu"){ + ctx.lineTo(pointX, pointY); + } + else if(this.style == "points"){ + ctx.beginPath(); + ctx.arc(pointX, pointY, this.width, 0, 2*Math.PI, true); + ctx.fill(); + } + else{ + ctx.lineTo(pointX, pointY); + nonDefini = 1; + } + } + } + else{ + nonDefini = 2; + } + } + if(this.style != "points"){ + ctx.stroke(); + } + } + + // Fonction + ctx.beginPath(); + ctx.lineWidth = this.width; + if(affichage.methode == "uniboard"){ + ctx.lineWidth *= 3; + } + ctx.strokeStyle = this.couleur; + ctx.fillStyle = this.couleur; + ctx.moveTo(-100,-100); + nonDefini = true; + for(x = affichage.xGauche-precision; x <= affichage.xDroite+precision; x+=precision){ + // Evaluer la valeur y du point x + y = this.f(x); + if(!isNaN(y) && y <= affichage.yHaut+Math.abs(affichage.yHaut) && y >= affichage.yBas-Math.abs(affichage.yBas)){ + // Transformation des coordonnées + pointX = (x - affichage.xGauche) * affichage.multX; + pointY = affichage.hauteur - (y - affichage.yBas) * affichage.multY; + + // Dessiner la fonction + if(nonDefini){ + nonDefini = false; + ctx.moveTo(pointX, pointY); + } + else{ + if(this.style == "continu"){ + ctx.lineTo(pointX, pointY); + } + else if(this.style == "points"){ + ctx.beginPath(); + ctx.arc(pointX, pointY, this.width, 0, 2*Math.PI, true); + ctx.fill(); + } + else{ + ctx.lineTo(pointX, pointY); + nonDefini = true; + } + } + + // Dessiner l'aire sous la fonction + if(this.aire){ + var zero = affichage.hauteur + affichage.yBas * affichage.multY; + var l = precision*affichage.multX; + ctx.fillStyle = "rgba(0,180,255,0.3)"; + ctx.fillRect(pointX-l/2, zero, l , pointY-zero); + ctx.fillStyle = this.couleur; + } + } + else{ + nonDefini = true; + } + } + if(this.style != "points"){ + ctx.stroke(); + } + + if(this.style == "points"){ + precision /= 2; + } + }; +} diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/ColorPicker.js b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/ColorPicker.js new file mode 100644 index 00000000..ac4383ef --- /dev/null +++ b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/ColorPicker.js @@ -0,0 +1,580 @@ + +// -------------------- Color Picker -------------------- + +var idColor = ""; + +// Différentes fonctions nécessaire au Color Picker (menu du choix de la couleur) + +var colorPicker = { + // Configuration + idSV : "canvasSV", // id du canvas affichant la saturation et la valeur + idT : "canvasT", // id du canvas affichant la teinte + idO : "canvasO", // id du canvas affichant l'opacité + width : 250, // largeur + height : 250, // hauteur + rayonRonds : 5, // rayon des ronds + ombreActive : "0px 0px 3px rgba(150,200,255,1), 0px 0px 8px rgba(64,190,255,1)", + ombreInactive : "0px 0px 5px rgba(64,64,64,0.4)", + + // Variables définies lors de l'initialisation + canvasSV : null, + canvasT : null, + canvasO : null, + ctxSV : null, + ctxT : null, + ctxO : null, + lingradS : null, + lingradV : null, + lingradT : null, + + // Couleurs + backgroundColor : "rgb(193,255,0)", + saturation : 100, + valeur : 100, + teinte : 75, + rouge : 193, + vert : 255, + bleu : 0, + opacity: 1, + // Couleurs RGB sans application de la saturation et de la valeur + r : 255, + g : 0, + b : 0, + + // Autres variables + sourisDown : false, // Indique si on clique sur le colorPicker ou pas + sourisDehors : true, // Indique si la souris est en-dehors du colorPicker lors d'un clique + idColor : null, + + // Fonction d'initialisation + init : function(id){ + // Récupérer les éléments + this.canvasSV = document.getElementById(this.idSV); + this.canvasT = document.getElementById(this.idT); + this.canvasO = document.getElementById(this.idO); + + // Définir la taille + this.canvasSV.width = this.width; + this.canvasSV.height = this.height; + this.canvasSV.style.width = this.width + "px"; + this.canvasSV.style.height = this.height + "px"; + + this.canvasT.width = this.width/10; + this.canvasT.height = this.height; + this.canvasT.style.width = this.width/10 + "px"; + this.canvasT.style.height = this.height + "px"; + + this.canvasO.width = this.width*1.15; + this.canvasO.height = this.height/10; + this.canvasO.style.width = this.width*1.15 + "px"; + this.canvasO.style.height = this.height/10 + "px"; + + // Initialisation canvas + this.ctxSV = this.canvasSV.getContext("2d"); + this.ctxT = this.canvasT.getContext("2d"); + this.ctxO = this.canvasO.getContext("2d"); + + // Création des dégradés + this.lingradV = this.ctxSV.createLinearGradient(0, 0, 0, this.height); + this.lingradV.addColorStop(0, 'rgba(255,255,255,0)'); + this.lingradV.addColorStop(1, 'rgba(255,255,255,1)'); + + this.lingradS = this.ctxSV.createLinearGradient(0, 0, this.width, 0); + this.lingradS.addColorStop(0, 'rgba(0,0,0,1)'); + this.lingradS.addColorStop(1, 'rgba(0,0,0,0)'); + + this.lingradT = this.ctxT.createLinearGradient(0, 0, 0, this.height); + this.lingradT.addColorStop(0, 'rgb(255,0,0)'); + this.lingradT.addColorStop(1/6, 'rgb(255,255,0)'); + this.lingradT.addColorStop(2/6, 'rgb(0,255,0)'); + this.lingradT.addColorStop(3/6, 'rgb(0,255,255)'); + this.lingradT.addColorStop(4/6, 'rgb(0,0,255)'); + this.lingradT.addColorStop(5/6, 'rgb(255,0,255)'); + this.lingradT.addColorStop(1, 'rgb(255,0,0)'); + + // Événements roulette (initialisé seulement une fois) + if(window.addEventListener && !this.idColor){ + this.canvasSV.addEventListener('DOMMouseScroll', function(event){colorPicker.eventWheel(event, colorPicker.idSV)}, false); + this.canvasSV.onmousewheel = function(event){colorPicker.eventWheel(event, colorPicker.idSV)}; + this.canvasT.addEventListener('DOMMouseScroll', function(event){colorPicker.eventWheel(event, colorPicker.idT)}, false); + this.canvasT.onmousewheel = function(event){colorPicker.eventWheel(event, colorPicker.idT)}; + this.canvasO.addEventListener('DOMMouseScroll', function(event){colorPicker.eventWheel(event, colorPicker.idO)}, false); + this.canvasO.onmousewheel = function(event){colorPicker.eventWheel(event, colorPicker.idO)}; + } + + // Définir la couleur + this.idColor = id; + var couleur = eval(document.getElementById(this.idColor).title); +// alert(id+" ; "+couleur) + document.getElementById("apercuCouleur").style.backgroundColor = couleur; + document.getElementById("apercuCouleur2").style.backgroundColor = couleur; + this.definirCouleur(couleur); + + // Dessiner + this.dessiner(); + this.dessinerApercu(); + + // Définir les valeurs des inputs + this.definirInputs(); + + // Définir le style de l'ombre + this.sourisOut(); + + }, + + definirCouleur : function(colorRGB){ + var table = /(.*?)rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(colorRGB); + if (table == null){ + table = /(.*?)rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(colorRGB); + } + if(table == null){ + return ""; + } + this.rouge = parseInt(table[2]); + this.vert = parseInt(table[3]); + this.bleu = parseInt(table[4]); + this.RGB_SVT(); + }, + + sourisClick : function(id){ + this.sourisDown = id; + if(id != this.idO){ + document.getElementById(id).style.boxShadow = this.ombreActive; + } + }, + + sourisOut : function(){ + this.canvasSV.style.boxShadow = this.ombreInactive; + this.canvasT.style.boxShadow = this.ombreInactive; + }, + + sourisOver : function(id){ + if(this.sourisDown == id && id != this.idO){ + document.getElementById(id).style.boxShadow = this.ombreActive; + } + }, + + sourisUp : function(){ + this.sourisDown = false; + this.canvasSV.style.boxShadow = this.ombreInactive; + this.canvasT.style.boxShadow = this.ombreInactive; + this.dessinerO(); + }, + + eventWheel : function(event, id){ + if(!event) event = window.event; + if(event.wheelDelta){ + if(event.wheelDelta < 0){ + colorPicker.sourisWheelUp(id); + } + else{ + colorPicker.sourisWheelDown(id); + } + } + else if(event.detail){ + if(event.detail > 0){ + colorPicker.sourisWheelUp(id); + } + else{ + colorPicker.sourisWheelDown(id); + } + } + }, + + sourisWheelUp : function(id){ + switch(id){ + case this.idT: + colorPicker.ajouterT(5); + break; + case this.idO: + colorPicker.ajouterO(0.1); + break; + case this.idSV: + colorPicker.ajouterS(-5); + break; + } + }, + + sourisWheelDown : function(id){ + switch(id){ + case this.idT: + colorPicker.ajouterT(-5); + break; + case this.idO: + colorPicker.ajouterO(-0.1); + break; + case this.idSV: + colorPicker.ajouterS(5); + break; + } + }, + + ajouterT : function(nbr){ + this.teinte += nbr; + if(this.teinte < 0){ + this.teinte = 0; + } + else if(this.teinte > 360){ + this.teinte = 360; + } + this.SVT_RGB(); + }, + + ajouterO : function(nbr){ + this.opacity = Math.round((this.opacity+nbr)*100)/100; + if(this.opacity < 0){ + this.opacity = 0; + } + else if(this.opacity > 1){ + this.opacity = 1; + } + this.SVT_RGB(); + }, + + ajouterS : function(nbr){ + this.saturation += nbr; + if(this.saturation < 0){ + this.saturation = 0; + } + else if(this.saturation > 100){ + this.saturation = 100; + } + this.SVT_RGB(); + }, + + // Lors du déplacement de la souris + moveSV : function(event){ + // Vérifie si on appuie sur la souris + if(this.sourisDown != this.idSV){ + return 0; + } + + var element = this.canvasSV; + var posDivY = 0; + var posDivX = 0; + + // Récupérer la position du canvas par rapport à la page + while(element){ + posDivY = posDivY + element.offsetTop; + posDivX = posDivX + element.offsetLeft; + element = element.offsetParent; + } + + // Définir la saturation et la valeur à partir de la position de la souris + this.saturation = 100-Math.round((event.clientY - posDivY -1)/(this.height+1)*100); + this.valeur = Math.round((event.clientX - posDivX -1)/(this.width+1)*100); + + this.SVT_RGB(); + }, + moveT : function(event){ + if(this.sourisDown != this.idT){ + return 0; + } + var element = this.canvasT; + var posDivY = 0; + + while(element){ + posDivY = posDivY + element.offsetTop; + element = element.offsetParent; + } + + this.teinte = Math.round( (event.clientY - posDivY -0) / (this.height+1)*360); + + this.SVT_RGB(); + }, + + SVT_RGB : function(){ + this.T_rgb(); + this.rouge = Math.round((this.r + (255-this.r) * (-1) * (this.saturation-100) / 100 )* this.valeur / 100); + this.vert = Math.round((this.g + (255-this.g) * (-1) * (this.saturation-100) / 100 )* this.valeur / 100); + this.bleu = Math.round((this.b + (255-this.b) * (-1) * (this.saturation-100) / 100 )* this.valeur / 100); + + this.definirInputs(); + this.dessinerApercu(); + this.dessiner(); + }, + + T_rgb : function(){ + var r,g,b = 0; + var T = this.teinte; + + if (T<60){ + r = 255; + g = T/60*255; + b = 0; + } + else if (T<120){ + r = (255-(T%60/60*255))%256; + g = 255; + b = 0; + } + else if (T<180){ + r = 0; + g = 255; + b = T%60/60*255; + } + else if (T<240){ + r = 0; + g = (255-(T%60/60*255))%256; + b = 255; + } + else if (T<300){ + r = T%60/60*255; + g = 0; + b = 255; + } + else if (T<360){ + r = 255; + g = 0; + b = (255-(T%60/60*255))%256; + } + else{ + r = 255; + g = 0; + b = 0; + } + + this.r = Math.round(r); + this.g = Math.round(g); + this.b = Math.round(b); + }, + + RGB_SVT : function(){ + // Voir http://fr.wikipedia.org/wiki/Teinte_Saturation_Valeur#Conversion_de_RVB_vers_TSV + var r = this.rouge/255; + var g = this.vert/255; + var b = this.bleu/255; + if(!isFinite(r)){ + r = 0; + } + if(!isFinite(g)){ + g = 0; + } + if(!isFinite(b)){ + b = 0; + } + var max = Math.max(r,g,b); + var min = Math.min(r,g,b); + var s, v, t; + // Teinte + switch(max){ + case r: + t = (60 * (g-b)/(max-min) + 360) % 360; + break; + case g: + t = 60 * (b-r)/(max-min) + 120; + break; + case b: + t = 60 * (r-g)/(max-min) + 240; + break; + default: /* case min: */ + t = 0; + break; + } + + // Saturation + if(max == 0){ + s = 0; + } + else{ + s = 1-(min/max); + } + + // Valeur + v = max; + + // Définir les variables + this.saturation = s*100; + this.valeur = v*100; + this.teinte = Math.round(t); + this.T_rgb(); + }, + + dessiner : function(){ + var ctxSV = this.ctxSV; + var ctxT = this.ctxT; + // Fond + ctxSV.fillStyle = "rgb("+this.r+","+this.g+","+this.b+")"; + ctxSV.fillRect(0, 0, this.width, this.height); + // Dégradés + ctxSV.fillStyle = this.lingradV; + ctxSV.fillRect(0, 0, this.width, this.height); + ctxSV.fillStyle = this.lingradS; + ctxSV.fillRect(0, 0, this.width, this.height); + // Souris + var x = Math.round(this.width*this.valeur/100); + var y = Math.round(this.height-this.height*this.saturation/100); + ctxSV.beginPath(); + ctxSV.arc(x, y, this.rayonRonds, 0, 2*Math.PI, true); + ctxSV.strokeStyle = "rgba(255,255,255,0.8)"; + ctxSV.shadowOffsetX = 1; + ctxSV.shadowOffsetY = 1; + ctxSV.shadowColor = "rgba(0,0,0,1)"; + ctxSV.shadowBlur = 2; + ctxSV.lineWidth = 1.5; + ctxSV.stroke(); + + // Fond Teinte + ctxT.fillStyle = this.lingradT; + ctxT.fillRect(0, 0, this.width/10, this.height); + // Souris Teinte + var pos = Math.round(0.99*this.height*this.teinte/360); + ctxT.fillStyle = "rgba(255,255,255,0.8)"; + ctxT.shadowOffsetX = 0; + ctxT.shadowOffsetY = 0; + ctxT.shadowColor = "rgba(0,0,0,1)"; + ctxT.shadowBlur = 3; + ctxT.fillRect(0, pos, this.width/10, 2); + + // Désactiver les ombres + ctxSV.shadowColor = "rgba(0,0,0,0)"; + ctxT.shadowColor = "rgba(0,0,0,0)"; + + this.dessinerO(); + }, + + dessinerApercu : function(){ + document.getElementById("apercuCouleur").style.backgroundColor = "rgba("+this.rouge+","+this.vert+","+this.bleu+","+this.opacity+")"; + }, + + definirInputs : function(){ + document.getElementById("inputValeur").value = this.valeur; + document.getElementById("inputSaturation").value = this.saturation; + document.getElementById("inputTeinte").value = this.teinte; + document.getElementById("inputRouge").value = this.rouge; + document.getElementById("inputVert").value = this.vert; + document.getElementById("inputBleu").value = this.bleu; + document.getElementById("inputOpacity").value = this.opacity; + }, + + recupererInputs : function(){ + this.valeur = parseInt(document.getElementById("inputValeur").value); + this.saturation = parseInt(document.getElementById("inputSaturation").value); + this.teinte = parseInt(document.getElementById("inputTeinte").value); + this.opacity = parseFloat(document.getElementById("inputOpacity").value); + this.SVT_RGB(); + + this.definirInputs(); + this.dessinerApercu(); + this.dessiner(); + }, + recupererInputs2 : function(){ + this.rouge = parseInt(document.getElementById("inputRouge").value); + this.vert = parseInt(document.getElementById("inputVert").value); + this.bleu = parseInt(document.getElementById("inputBleu").value); + this.RGB_SVT(); + + this.definirInputs(); + this.dessinerApercu(); + this.dessiner(); + }, + + moveO : function(event){ + if(this.sourisDown != this.idO){ + return 0; + } + + var element = this.canvasO; + var posDivX = 0; + while(element){ + posDivX = posDivX + element.offsetLeft; + element = element.offsetParent; + } + + this.opacity = Math.round( (event.clientX - posDivX -this.width/10) / (this.width*0.9)*100)/100; + if(this.opacity < 0){ + this.opacity = 0; + } + else if(this.opacity > 1){ + this.opacity = 1; + } + this.dessinerO(); + this.definirInputs(); + this.dessinerApercu(); + }, + + dessinerO : function(){ + var ctx = this.ctxO; + + ctx.shadowBlur = 2; + + // Ligne + if(this.sourisDown == this.idO){ + ctx.shadowColor = "rgba(0,50,100,1)"; + } + else{ + ctx.shadowColor = "rgba(0,0,0,1)"; + } + ctx.globalAlpha = 1; + ctx.shadowOffsetX = 0; + ctx.shadowOffsetY = 0; + ctx.fillStyle = "rgba("+this.rouge+","+this.vert+","+this.bleu+",1)"; + ctx.clearRect(0,0,this.width*1.15,this.height); + ctx.fillRect(this.width/10, this.height/20-1, this.width*0.9, 3); + + // Rond + var x = this.width/10 + this.width*0.9*this.opacity-1; + var y = this.height/20; + if(this.sourisDown == this.idO){ + ctx.fillStyle = "rgba(0,40,80,1)"; + ctx.strokeStyle = "rgba(230,250,255,0.8)"; + } + else{ + ctx.fillStyle = "rgba(0,0,0,1)"; + ctx.strokeStyle = "rgba(255,255,255,0.8)"; + } + ctx.globalAlpha = 0.1+this.opacity*0.9; + ctx.beginPath(); + ctx.arc(x, y, this.rayonRonds+1, 0, 2*Math.PI, true); + ctx.shadowColor = "rgba(0,0,0,1)"; + ctx.shadowOffsetX = 1; + ctx.shadowOffsetY = 1; + ctx.lineWidth = 1; + ctx.fill(); + ctx.stroke(); + + // Petits ronds + ctx.globalAlpha = 1; + ctx.shadowColor = "rgba(0,0,0,1)"; + + ctx.beginPath(); + ctx.arc(8, this.height/20+0.5, this.rayonRonds, 0, 2*Math.PI, true); + ctx.strokeStyle = "rgba(0,0,0,0.5)"; + ctx.shadowOffsetX = 0; + ctx.shadowOffsetY = 0; + ctx.lineWidth = 1; + ctx.stroke(); + + ctx.beginPath(); + ctx.arc(this.width*1.08, this.height/20+0.5, this.rayonRonds, 0, 2*Math.PI, true); + ctx.strokeStyle = "rgba(0,0,0,0.8)"; + ctx.fillStyle = "rgba(0,0,0,0.6)"; + ctx.shadowOffsetX = 0; + ctx.shadowOffsetY = 0; + ctx.lineWidth = 1; + ctx.stroke(); + ctx.fill(); + }, + + exporterCouleur : function(){ + eval(document.getElementById(this.idColor).title+' = "rgba(" + this.rouge +", " + this.vert + ", " + this.bleu +", "+this.opacity+")"'); + document.getElementById(this.idColor).style.backgroundColor = eval(document.getElementById(this.idColor).title); + }, + + fermer : function(){ + colorPicker.exporterCouleur(); + if(colorPicker.idColor == 'buttonColor'){ + cacherMenu(); + } + else if(dernierMenu == "menuFonctions"){ + editeur.getOptions(); + afficherMenu(dernierMenu); + } + else{ + cacherMenu(); + } + actualiserGraph(); + } +}; + + diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Editeur.js b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Editeur.js new file mode 100644 index 00000000..ee9017d0 --- /dev/null +++ b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Editeur.js @@ -0,0 +1,216 @@ + +var editeur = { + idFct : 0, + fct : { + fct : "", + fctX : "", + fctY : "", + from : 0, + to : 2*Math.PI, + couleur : "", + couleurD1 : "", + couleurD2 : "", + couleurP1 : "", + width : 2, + style : "continu", + aire : false, + derivee1 : false, + derivee2 : false, + primitive1 : false, + conditionInitiale : 0 + }, + editer : function(id){ + this.idFct = id; + if(fct.list[this.idFct]){ + document.getElementById("editeurFonction").style.visibility = "visible"; + this.setOptions(); + } + else{ + document.getElementById("editeurFonction").style.visibility = "hidden"; + } + fct.updateList(); + }, + couleur : function(id){ + colorPicker.init(id); + afficherMenu('menuCouleur'); + }, + getOptions : function(){ + this.fct.fct = document.getElementById("editeurInput").value; + this.fct.fctX = document.getElementById("editeurFctX").value; + this.fct.fctY = document.getElementById("editeurFctY").value; + this.fct.from = document.getElementById("editeurFrom").value; + this.fct.to = document.getElementById("editeurTo").value; + this.fct.width = document.getElementById("editeurWidth").value; + this.fct.style = document.getElementById("editeurStyle").value; + this.fct.aire = document.getElementById("editeurAire").checked ? true : false; + this.fct.derivee1 = document.getElementById("editeurD1").checked ? true : false; + this.fct.derivee2 = document.getElementById("editeurD2").checked ? true : false; + this.fct.primitive1 = document.getElementById("editeurP1").checked ? true : false; + if(this.fct.primitive1){ + document.getElementById("editeurConditionInitiale").disabled = ""; + document.getElementById("editeurTexteConditionInitiale").style.color = "rgb(0,0,0)" + } + else{ + document.getElementById("editeurConditionInitiale").disabled = "disabled"; + document.getElementById("editeurTexteConditionInitiale").style.color = "rgb(128,128,128)" + } + this.fct.conditionInitiale = parseFloat(document.getElementById("editeurConditionInitiale").value); + + fct.list[this.idFct].set(this.fct); + + fct.updateList(); + historique.ajouter(fct.list[this.idFct]); + this.apercu(); + }, + setOptions : function(){ + var f = fct.list[this.idFct].get(); + for(var i in f){ + this.fct[i] = f[i]; + } + + this.setDisplayStyle(); + + document.getElementById("editeurInput").value = this.fct.fct; + document.getElementById("editeurFctX").value = this.fct.fctX; + document.getElementById("editeurFctY").value = this.fct.fctY; + document.getElementById("editeurFrom").value = this.fct.from; + document.getElementById("editeurTo").value = this.fct.to; + document.getElementById("editeurCouleur").style.backgroundColor = this.fct.couleur; + document.getElementById("editeurCouleurD1").style.backgroundColor = this.fct.couleurD1; + document.getElementById("editeurCouleurD2").style.backgroundColor = this.fct.couleurD2; + document.getElementById("editeurCouleurP1").style.backgroundColor = this.fct.couleurP1; + document.getElementById("editeurWidth").value = this.fct.width; + document.getElementById("editeurStyle").value = this.fct.style; + document.getElementById("editeurAire").checked = this.fct.aire ? "checked" : ""; + document.getElementById("editeurD1").checked = this.fct.derivee1 ? "checked" : ""; + document.getElementById("editeurD2").checked = this.fct.derivee2 ? "checked" : ""; + document.getElementById("editeurP1").checked = this.fct.primitive1 ? "checked" : ""; + if(this.fct.primitive1){ + document.getElementById("editeurConditionInitiale").disabled = ""; + document.getElementById("editeurTexteConditionInitiale").style.color = "rgb(0,0,0)" + } + else{ + document.getElementById("editeurConditionInitiale").disabled = "disabled"; + document.getElementById("editeurTexteConditionInitiale").style.color = "rgb(128,128,128)" + } + document.getElementById("editeurConditionInitiale").value = this.fct.conditionInitiale; + + document.getElementById("outputX").innerHTML = " "; + document.getElementById("outputAire").innerHTML = " "; + this.apercu(); + }, + setDisplayStyle : function(){ + if(fct.list[this.idFct] instanceof CartesianFunction){ + document.getElementById("editeurFctPrefix").textContent = "f(x) = "; + document.getElementById("editeurFctDiv").style.display = "block"; + document.getElementById("editeurFctXYDiv").style.display = "none"; + document.getElementById("editeurRangeDiv").style.display = "none"; + document.getElementById("editeurDeriveesDiv").style.display = "block"; + document.getElementById("editeurStyleDiv").style.display = "block"; + document.getElementById("editeurAireDiv").style.display = "block"; + } + else if(fct.list[this.idFct] instanceof ImplicitFunction){ + document.getElementById("editeurFctPrefix").textContent = ""; + document.getElementById("editeurFctDiv").style.display = "block"; + document.getElementById("editeurFctXYDiv").style.display = "none"; + document.getElementById("editeurRangeDiv").style.display = "none"; + document.getElementById("editeurDeriveesDiv").style.display = "none"; + document.getElementById("editeurStyleDiv").style.display = "none"; + document.getElementById("editeurAireDiv").style.display = "none"; + } + else if(fct.list[this.idFct] instanceof PolarFunction){ + document.getElementById("editeurFctPrefix").textContent = "r(t) = "; + document.getElementById("editeurFctDiv").style.display = "block"; + document.getElementById("editeurFctXYDiv").style.display = "none"; + document.getElementById("editeurRangeDiv").style.display = "block"; + document.getElementById("editeurDeriveesDiv").style.display = "none"; + document.getElementById("editeurStyleDiv").style.display = "block"; + document.getElementById("editeurAireDiv").style.display = "none"; + } + else if(fct.list[this.idFct] instanceof ParametricFunction){ + document.getElementById("editeurFctDiv").style.display = "none"; + document.getElementById("editeurFctXYDiv").style.display = "block"; + document.getElementById("editeurRangeDiv").style.display = "block"; + document.getElementById("editeurDeriveesDiv").style.display = "none"; + document.getElementById("editeurStyleDiv").style.display = "block"; + document.getElementById("editeurAireDiv").style.display = "none"; + } + }, + etudier : function(){ + fct.etudier(this.idFct); + }, + supprimer : function(){ + fct.enlever(this.idFct); + if(!fct.list[this.idFct]){ + this.editer(this.idFct - 1); + } + else{ + this.editer(this.idFct); + } + }, + dupliquer : function(){ + fct.dupliquer(this.idFct); + this.editer(this.idFct + 1); + }, + apercu : function(){ + editorPreview.drawFunction(fct.list[this.idFct]); + } +}; + + +var editorPreview = { + id : "editeurApercu", + + xGauche : -5, + xDroite : 5, + yBas : -4, + yHaut : 4, + + largeur : 0, + hauteur : 0, + multX : 1, + multY : 1, + + ctx: null, + + init : function(){ + var canvas = document.getElementById("editeurApercu"); + this.ctx = canvas.getContext("2d"); + this.largeur = canvas.width; + this.hauteur = canvas.height; + this.multX = this.largeur/Math.abs(this.xDroite - this.xGauche); + this.multY = this.hauteur/Math.abs(this.yHaut - this.yBas); + this.precision = Math.abs(this.xDroite - this.xGauche)/50; + }, + + drawFunction : function(func){ + var x, y, pointX, pointY; + var ctx = this.ctx; + ctx.clearRect(0,0,100,80); + ctx.globalAlpha = 0.7; + ctx.fillStyle = "rgba(0,0,0,0.5)" + ctx.fillRect(0,39.5, 100, 1); + ctx.fillRect(49.5,0, 1, 80); + ctx.beginPath(); +// ctx.lineWidth = func.width/1.8; +// ctx.strokeStyle = func.couleur; +// ctx.moveTo(-100,-100); +// for(x = -5; x <= 5; x+=0.2){ +// // Evaluer la valeur y du point x +// try{ +// y = func.f(x); +// } +// catch(e){} +// if(!isNaN(y)){ +// // Transformation des coordonnées +// pointX = x * 10 + 50; +// pointY = 40 - y * 10; +// +// // Dessiner la fonction +// ctx.lineTo(pointX, pointY); +// } +// } + func.plot(ctx, this.precision, this); +// ctx.stroke(); + } +}; diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Etudes.js b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Etudes.js new file mode 100644 index 00000000..ade1cf4f --- /dev/null +++ b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Etudes.js @@ -0,0 +1,520 @@ + +// -------------------- Etudes de fonctions -------------------- + +function consoleInfos(){ + var table = []; + for(var i in arguments){ + table.push(arguments[i]); + } + document.getElementById("infos").innerHTML += table +"
    "; +} + +Array.prototype.first = function(){ + return this[0]; +} +Array.prototype.last = function(){ + return this[this.length-1]; +} +Array.prototype.removeDoubles = function(){ + // Sort numerically + this.sort(function(nbr1,nbr2){return nbr1-nbr2}); + // Remove doubles + for(var i=1; i' + } + else{ + txtSigne += ''+listeNbr[i][0]+'' + } + switch(b){ + case -1: + txtSigne += "-"; + dernierSigne = "-"; + break; + case 1: + txtSigne += "+"; + dernierSigne = "+"; + break; + } + } + document.getElementById("etudeSigneRow").innerHTML = txtSigne; +// consoleInfos(""+txtSigne+"
    Signe :
    "); + }, + + asymptotesNum : function(){ + var f = this.f; + // Verticales + var texteA = ""; + for(var i=0; i0){ + if(txtMinMax != ""){ + txtMinMax += "
    "; + } + txtMinMax += "Min("+this.listeX[i]+";"+this.round(this.listeY[i])+")"; + } + else if(a>0 && b<0){ + if(txtMinMax != ""){ + txtMinMax += "
    "; + } + txtMinMax += "Max("+this.listeX[i]+";"+this.round(this.listeY[i])+")"; + } + } +// consoleInfos(txtMinMax); + if(txtMinMax == ""){ + txtMinMax = "none"; + try{ + txtMinMax = languages.getText("none_m"); + } + catch(e){} + } + document.getElementById("etudeMinMax").innerHTML = txtMinMax; + }, + + pointI : function(){ + // Rechercher des zéros dans les points calculés + var listeID = []; +// for(var i=1; i("+this.listeX[i]+";"+this.round(this.listeY[i])+")"; + } +// consoleInfos(txtI); + if(txtI == ""){ + txtI = "none"; + try{ + txtI = languages.getText("none_m"); + } + catch(e){} + } + document.getElementById("etudeI").innerHTML = txtI; + }, + +} diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Fonction.js b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Fonction.js new file mode 100644 index 00000000..91e65de5 --- /dev/null +++ b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Fonction.js @@ -0,0 +1,226 @@ + +var fct = { + list : [], + couleur : "rgba(193,255,0,1)", + colorsList : ["rgba(255,0,0,1)","rgba(255,128,0,1)","rgba(255,255,0,1)","rgba(128,255,0,1)","rgba(0,255,0,1)","rgba(0,255,128,1)","rgba(0,255,255,1)","rgba(0,128,255,1)","rgba(0,0,255,1)","rgba(128,0,255,1)","rgba(255,0,255,1)","rgba(255,0,128,1)"], + interdit : [";", "interdit", "'", '"', "eval", "new", "uniboard", "sankore", "=", "document", "window", "alert", "fct", "affichage", "colorPicker", "languages"], + + functionFromObject: function(f){ + if(f.type == "cartesian"){ + return new CartesianFunction().set(f); + } + else if(f.type == "implicit"){ + return new ImplicitFunction().set(f); + } + else if(f.type == "polar"){ + return new PolarFunction().set(f); + } + else if(f.type == "parametric"){ + return new ParametricFunction().set(f); + } + console.err("Unknown function:", f); + }, + + addCartesian : function(txt){ + var txtFct = this.remplacer(this.verifier(txt)); + if(txtFct == ""){ + return false; + } + + var f = new CartesianFunction(txtFct); + this.add(f, true); + + return true; + }, + + addImplicit : function(txtFct){ + var equalPos = txtFct.indexOf("="); + if(equalPos >= 0){ + txtFct = txtFct.replace("=", "-(") + ")"; + } + txtFct = this.remplacer(this.verifier(txtFct)); + if(txtFct == ""){ + return false; + } + + var f = new ImplicitFunction(txtFct); + this.add(f, true); + + return true; + }, + + addPolar : function(txt){ + var txtFct = this.remplacer(this.verifier(txt)); + if(txtFct == ""){ + return false; + } + + var f = new PolarFunction(txtFct); + this.add(f, true); + + return true; + }, + + addParametric : function(txtX, txtY){ + var fctX = this.remplacer(this.verifier(txtX)); + var fctY = this.remplacer(this.verifier(txtY)); + if(fctX == "" || fctY == ""){ + return false; + } + + var f = new ParametricFunction(fctX, fctY); + this.add(f, true); + + return true; + }, + + add : function(f, useRandomColor){ + this.list.unshift(f); + if(useRandomColor){ + f.couleur = this.colorsList[alea(0,this.colorsList.length-1)]; + } + historique.ajouter(f); + this.updateList(); + editeur.editer(0); + }, + + ajouter : function(){ + var type = document.getElementById("functionType").value; + if(type == "cartesian"){ + var input = document.getElementById("input"); + if(this.addCartesian(input.value)){ + input.value = ""; + } + } + else if(type == "implicit"){ + var input = document.getElementById("implicitInput"); + if(this.addImplicit(input.value)){ + input.value = ""; + } + } + else if(type == "polar"){ + var input = document.getElementById("polarInput"); + if(this.addPolar(input.value)){ + input.value = ""; + } + } + else if(type == "parametric"){ + var inputX = document.getElementById("parametricInputX"); + var inputY = document.getElementById("parametricInputY"); + if(this.addParametric(inputX.value, inputY.value)){ + inputX.value = ""; + inputY.value = ""; + } + } + }, + + changeType : function(type){ + document.getElementById("cartesianDiv").style.display = "none"; + document.getElementById("implicitDiv").style.display = "none"; + document.getElementById("polarDiv").style.display = "none"; + document.getElementById("parametricDiv").style.display = "none"; + document.getElementById(type+"Div").style.display = "initial"; + }, + + enlever : function(id){ + this.list.splice(id, 1); + this.updateList(); + }, + + dupliquer : function(id){ + var newFct = this.functionFromObject(this.list[id].get()); + newFct.couleur = this.colorsList[alea(0,this.colorsList.length-1)]; + this.list.splice(id+1, 0, newFct); + this.updateList(); + }, + + etudier : function(id){ + etude.etudier(this.list[id].fct); + afficherMenu("menuEtude"); + }, + + updateList : function(){ + var texteFctSupp = ""; + for(var i=0; i'+this.list[i].fct+''; + } + document.getElementById("fonctionsSupp").innerHTML = texteFctSupp; + affichage.dessiner(); + saveOptions(); + }, + + verifier : function(txtFonction){ + for(var i=0; i 0){ + editeur.editer(0); + } + } +}; diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/ImplicitFunction.js b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/ImplicitFunction.js new file mode 100644 index 00000000..4fcb90b5 --- /dev/null +++ b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/ImplicitFunction.js @@ -0,0 +1,79 @@ + +function ImplicitFunction(txtFct){ + + this.setFct = function(txt){ + this.fct = txt; + this.f = new Function("x", "y", "return "+this.fct); + } + + if(txtFct){ + this.setFct(txtFct); + } + this.couleur = fct.couleur; + this.width = document.getElementById("inputTaille").value; + this.style = document.getElementById("selectStyle").value; + + this.getX = function(x){ + return x; + }; + + this.getY = function(x){ + return -1000000; + }; + + this.set = function(f){ + var equalPos = f.fct.indexOf("="); + if(equalPos >= 0){ + f.fct = f.fct.replace("=", "-(") + ")"; + } + this.setFct(fct.remplacer(fct.verifier(f.fct))); + this.couleur = f.couleur; + this.width = f.width; + this.style = f.style; + return this; + }; + + this.get = function(){ + var f = {}; + f.type = "implicit"; + f.fct = this.fct; + f.couleur = this.couleur; + f.width = this.width; + f.style = this.style; + return f; + }; + + this.readableText = function(){ + return this.fct + " = 0"; + }; + + this.plot = function(ctx, precision, affichage){ + var epsilon = 0.01; + var width2 = this.width / 2; + precision /= 20; + + ctx.beginPath(); + ctx.lineWidth = this.width; + ctx.strokeStyle = this.couleur; + ctx.fillStyle = this.couleur; + ctx.moveTo(-100,-100); + for(var x = affichage.xGauche-precision; x <= affichage.xDroite+precision; x+=precision){ + for(var y = affichage.yBas-precision; y <= affichage.yHaut+precision; y+=precision){ + // Compute function for current (x, y) position + z = this.f(x, y); + // Check condition f(x, y) = 0 + if(!isNaN(z) && Math.abs(z) < epsilon){ + // Transform coordinates + var pointX = (x - affichage.xGauche) * affichage.multX; + var pointY = affichage.hauteur - (y - affichage.yBas) * affichage.multY; + + ctx.fillRect(pointX-width2, pointY-width2, this.width, this.width); +// ctx.beginPath(); +// ctx.arc(pointX, pointY, this.width, 0, 2*Math.PI, true); +// ctx.fill(); + } + } + } +// ctx.stroke(); + }; +} diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Interface.js b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Interface.js new file mode 100644 index 00000000..e90111e5 --- /dev/null +++ b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Interface.js @@ -0,0 +1,274 @@ + +// -------------------- Fonctions de l'interface -------------------- + + +var menuActuel = "divInputRapide" +var dernierMenu = "" + +var pleinEcran = false +var maximise = true +var tailleFenetreX = window.innerWidth +var tailleFenetreY = window.innerHeight +var AncienneMethodeAffichage = 0 + +// Cette fonction permet d'afficher le menu désiré. +// Il faut lui donner l'id du menu à afficher. +function afficherMenu(id){ + if (menuActuel == id){ + cacherMenu() + dernierMenu = false; + } + else { + if (menuActuel != ""){ + dernierMenu = menuActuel; + cacherMenu() + } + menuActuel = id + document.getElementById(id).style.display = "block" + message.supprimer(); + } +} + +// Permet de cacher le menu actuellement affiché +function cacherMenu(){ + if(menuActuel != ""){ + document.getElementById(menuActuel).style.display = "none" + menuActuel = "" + } +} + +// Affiche un message d'erreur +function afficherErreur(message){ + document.getElementById("spanErreurFct").innerHTML = message; + afficherMenu("erreurFct"); +} + +// Messages d'info + +var message = { + liste : [], + ajouter : function(x, y, contenu){ + var newDiv = document.createElement("div"); + newDiv.style.left = x + "px"; + newDiv.style.top = y + "px"; + + var textDiv = document.createElement("span"); + textDiv.innerHTML = contenu; + newDiv.appendChild(textDiv); + + document.getElementById("divMessages").appendChild(newDiv); + }, + supprimer : function(){ + var div = document.getElementById("divMessages"); + div.innerHTML = ""; + } +}; + + +// ---- Minimiser ou Maximiser le widget (pour Uniboard) ---- +function miniMax(){ + if (maximise){ + maximise = false + document.getElementById('affichage').style.display = "none" + document.getElementById('gauche').style.display = "none" + document.getElementById('miniMax').innerHTML = "+" + window.resizeTo(400,50) + AncienneMethodeAffichage = document.getElementById("selectMethodeAffichage").selectedIndex + document.getElementById("selectMethodeAffichage").selectedIndex = "3" + } + else{ + maximise = true + document.getElementById('affichage').style.display = "block" + document.getElementById('gauche').style.display = "block" + document.getElementById('miniMax').innerHTML = "-" + window.resizeTo(tailleFenetreX,tailleFenetreY) + document.getElementById("selectMethodeAffichage").selectedIndex = AncienneMethodeAffichage + } +} + +// Affiche le menu + +function menuFonctions(){ + if(fonction3D){ + afficherMenu('menuHistorique'); + } + else{ + afficherMenu('menuFonctions'); + editeur.editer(0); + } +} + +// Action des petits bouton + et - dans les options +function boutonPlus(id, nombre){ + var element = document.getElementById(id) + var valeurActuelle = Number(element.value) + element.value = valeurActuelle + nombre +} +function boutonMoins(id, nombre){ + var element = document.getElementById(id) + var valeurActuelle = Number(element.value) + if(valeurActuelle>=nombre*2){ + element.value = valeurActuelle - nombre + } +} + +// Changer de thème +function changerTheme(theme){ + var positions = [ + "top-left", + "top", + "top-right", + "right", + "bottom-right", + "bottom", + "bottom-left", + "left", + "center" + ]; + for(var i=0; i'; +// txtHTML += ''; +// txtHTML += ''; + } + document.getElementById("newVersion").innerHTML = txtHTML; + + afficherMenu("mAj"); +} + +function checkboxMaJ(){ + if(versionOnline()){ + afficherMenu('erreurMaJ') + document.getElementById("checkMaJ").checked = false + } + else{ + if(document.getElementById("checkMaJ").checked){ + loadOptions() + document.getElementById("checkMaJ").checked = true + saveOptions() + } + else{ + loadOptions() + document.getElementById("checkMaJ").checked = false + saveOptions() + } + } +} + +function majAuto(){ +// var audio = new Audio(); +// audio.src = "version.ogg"; +// audio.load(); +// setTimeout(function(){ +// window.console.log(" "+audio.duration); +// }, 0) + if(versionOnline()){ + document.getElementById("cacheMaJ").style.display = "block"; + document.getElementById("checkMaJ").disabled = true; + document.getElementById("checkMaJ").checked = true; + } + else{ + if(document.getElementById("checkMaJ").checked){ + afficherMenu('demandeMaJ'); + } + } +} +function majAccept(){ +// document.location.href='http://gyb.educanet2.ch/tm-widgets/yannick/GraphMe.wgt/Grapheur.html'; + for(var i=0; i' + window.open(lien, "_blank") +} diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Languages.js b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Languages.js new file mode 100644 index 00000000..ad5f9f04 --- /dev/null +++ b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Languages.js @@ -0,0 +1,508 @@ + +var languages = { + current: "en", + + init: function(){ + var lang = this.navigatorLanguage(); + if(lang){ + lang = lang.substr(0,2); + this.set(lang); + } + }, + + navigatorLanguage: function(){ + if(window.sankore){ + return sankore.locale(); + } + return navigator.language || navigator.userLanguage; + }, + + set: function(lang){ + if(lang in langTexts){ + this.current = lang; + this.setTexts(langTexts[lang]); + } + }, + + getText: function(id){ + return langTexts[this.current][id]; + }, + + setTexts: function(texts){ + this.id("graphMeButton").textContent = texts.widgetName; + this.id("functionsButton").textContent = texts.functions; + this.id("displayButton").textContent = texts.display; + this.id("helpButton").textContent = texts.help; + + this.id("boutonAgrandir").title = texts.fullscreen; + this.id("boutonSaveGraph").title = texts.save; + this.id("inputRapideButton").value = texts.displayAction; + + this.id("pointTool").title = texts.pointTool; + this.id("moveTool").title = texts.moveTool; + this.id("tangentTool").title = texts.tangentTool; + + this.id("menuExempleCloseButton").value = texts.close; + + this.id("menuGraphMeOptionsTab").textContent = texts.options; + this.id("menuGraphMeAboutTab").textContent = texts.about; + this.id("widgetOptions").textContent = texts.widgetOptions; + this.id("widgetTheme").textContent = texts.widgetTheme; + this.id("selectThemeDarkBlue").textContent = texts.darkBlue; + this.id("selectThemeBlack").textContent = texts.black; + this.id("selectThemeBlue").textContent = texts.blue; + this.id("selectThemeWhite").textContent = texts.white; + this.id("resetWidgetButton").value = texts.resetWidget; + this.id("checkForUpdateButton").value = texts.checkForUpdate; + this.id("menuGraphMeCloseButton").value = texts.close; + + this.id("menuCreditsOptionsTab").textContent = texts.options; + this.id("menuCreditsAboutTab").textContent = texts.about; + this.id("widgetDevelopedBy").textContent = texts.widgetDevelopedBy; + this.id("widgetContactInfo").textContent = texts.widgetContactInfo; + this.id("widgetBackgroundSource").textContent = texts.widgetBackgroundSource; + this.id("changelogButton").textContent = texts.changelogButton; + this.id("menuCreditsCloseButton").value = texts.close; + + this.id("changelogTitle").textContent = texts.changelogTitle; + this.id("menuChangelogBackButton").value = texts.back; + this.id("menuChangelogCloseButton").value = texts.close; + + this.id("menuAffichageDisplayParametersTab").textContent = texts.displayParameters; + this.id("menuAffichageFunctionsParametersTab").textContent = texts.functionsParameters; + this.id("plotRange").textContent = texts.plotRange; + this.id("xAxis").textContent = texts.xAxis; + this.id("yAxis").textContent = texts.yAxis; + this.id("xAxisTo").textContent = texts.to; + this.id("yAxisTo").textContent = texts.to; + this.id("defaultZoom").textContent = texts.defaultZoom; + this.id("defaultDisplayParameters").value = texts.defaultDisplayParameters; + this.id("displayOptions").textContent = texts.options; + this.id("displayMethod").textContent = texts.displayMethod; + this.id("showGrid").textContent = texts.showGrid; + this.id("showAxis").textContent = texts.showAxis; + this.id("showScale").textContent = texts.showScale; + this.id("graphAccuracy").textContent = texts.graphAccuracy; + this.id("improveAccuracy").textContent = texts.improveAccuracy; + this.id("menuAffichageOkButton").value = texts.ok; + + this.id("menuFunctionParametersDisplayParametersTab").textContent = texts.displayParameters; + this.id("menuFunctionParametersFunctionsParametersTab").textContent = texts.functionsParameters; + this.id("defaultFunctionParameters").textContent = texts.defaultFunctionParameters; + this.id("thickness").textContent = texts.thickness; + this.id("drawDerivativeAndPrimitive").textContent = texts.drawDerivativeAndPrimitive; + this.id("drawArea").textContent = texts.drawArea; + this.id("lineStyle").textContent = texts.lineStyle; + this.id("selectStyleLine").textContent = texts.styleLine; + this.id("selectStyleDotted").textContent = texts.styleDotted; + this.id("selectStyleDashed").textContent = texts.styleDashed; + this.id("menuFunctionParametersCloseButton").value = texts.close; + + this.id("display3D").textContent = texts.display3D; + this.id("displayStyle").textContent = texts.displayStyle; + this.id("displayStyleSurfaces").textContent = texts.styleSurfaces; + this.id("displayStyleDotted").textContent = texts.styleDotted; + this.id("resetDisplay3D").value = texts.resetDisplay; + this.id("graphAccuracy3D").textContent = texts.graphAccuracy; + this.id("colorsConfig").textContent = texts.colorsConfig; + this.id("useRedFor").textContent = texts.useRedFor; + this.id("useGreenFor").textContent = texts.useGreenFor; + this.id("useBlueFor").textContent = texts.useBlueFor; + this.id("redPositive").textContent = texts.positiveValues; + this.id("redNegative").textContent = texts.negativeValues; + this.id("redAlways").textContent = texts.always; + this.id("greenPositive").textContent = texts.positiveValues; + this.id("greenNegative").textContent = texts.negativeValues; + this.id("greenAlways").textContent = texts.always; + this.id("bluePositive").textContent = texts.positiveValues; + this.id("blueNegative").textContent = texts.negativeValues; + this.id("blueAlways").textContent = texts.always; + this.id("globalValue").textContent = texts.globalValue; + this.id("globalValueRange").textContent = texts.globalValueRange; + this.id("menuAffichage3dOk").value = texts.ok; + + this.id("menuAideUsageTab").textContent = texts.usage; + this.id("menuAideExamplesTab").textContent = texts.examples; + this.id("howItWorks").textContent = texts.howItWorks; + this.id("howItWorksText").textContent = texts.howItWorksText; + this.id("availableFunctionsText").textContent = texts.availableFunctionsText; + this.id("basicOperations").textContent = texts.basicOperations; + this.id("plus").textContent = texts.plus; + this.id("minus").textContent = texts.minus; + this.id("multiplication").textContent = texts.multiplication; + this.id("division").textContent = texts.division; + this.id("modulus").textContent = texts.modulus; + this.id("trigonometricFunctions").textContent = texts.trigonometricFunctions; + this.id("sine").textContent = texts.sine; + this.id("cosine").textContent = texts.cosine; + this.id("tangent").textContent = texts.tangent; + this.id("cotangent").textContent = texts.cotangent; + this.id("secant").textContent = texts.secant; + this.id("cosecant").textContent = texts.cosecant; + this.id("arcSine").textContent = texts.arcSine; + this.id("arcCosine").textContent = texts.arcCosine; + this.id("arcTangent").textContent = texts.arcTangent; + this.id("arcCotangent").textContent = texts.arcCotangent; + this.id("hyperbolicFunctions").textContent = texts.hyperbolicFunctions; + this.id("hypSine").textContent = texts.hypSine; + this.id("hypCosine").textContent = texts.hypCosine; + this.id("hypTangent").textContent = texts.hypTangent; + this.id("hypCotangent").textContent = texts.hypCotangent; + this.id("hypSecant").textContent = texts.hypSecant; + this.id("hypCosecant").textContent = texts.hypCosecant; + this.id("hypArcSine").textContent = texts.hypArcSine; + this.id("hypArcCosine").textContent = texts.hypArcCosine; + this.id("hypArcTangent").textContent = texts.hypArcTangent; + this.id("hypArcCotangent").textContent = texts.hypArcCotangent; + this.id("powerAndRoot").textContent = texts.powerAndRoot; + this.id("squareRoot").textContent = texts.squareRoot; + this.id("power").textContent = texts.power; + this.id("xPowY").textContent = texts.xPowY; + this.id("root").textContent = texts.root; + this.id("rootText").textContent = texts.rootText; + this.id("expAndLog").textContent = texts.expAndLog; + this.id("naturalLog").textContent = texts.naturalLog; + this.id("decimalLog").textContent = texts.decimalLog; + this.id("absValue").textContent = texts.absValue; + this.id("rounding").textContent = texts.rounding; + this.id("roundText").textContent = texts.roundText; + this.id("ceilText").textContent = texts.ceilText; + this.id("floorText").textContent = texts.floorText; + this.id("constants").textContent = texts.constants; + this.id("keyboardShortcuts").textContent = texts.keyboardShortcuts; + this.id("moveLeft").textContent = texts.moveLeft; + this.id("moveTop").textContent = texts.moveTop; + this.id("moveRight").textContent = texts.moveRight; + this.id("moveBottom").textContent = texts.moveBottom; + this.id("menuAideCloseButton").value = texts.close; + + this.id("menuAideExemplesUsageTab").textContent = texts.usage; + this.id("menuAideExemplesExamplesTab").textContent = texts.examples; + this.id("examplesText").textContent = texts.examplesText; + this.id("functions2d").textContent = texts.functions2d; + this.id("functions3d").textContent = texts.functions3d; + this.id("menuAideExemplesCloseButton").value = texts.close; + + this.id("functionStudyTitle").textContent = texts.functionStudy; + this.id("domainOfDefinition").textContent = texts.domainOfDefinition; + this.id("symmetry").textContent = texts.symmetry; + this.id("zeros").textContent = texts.zeros; + this.id("sign").textContent = texts.sign; + this.id("asymptotes").textContent = texts.asymptotes; + this.id("extremums").textContent = texts.extremums; + this.id("inflexionPoints").textContent = texts.inflexionPoints; + this.id("functionStudyText").textContent = texts.functionStudyText; + this.id("menuEtudeBackButton").value = texts.back; + this.id("menuEtudeCloseButton").value = texts.close; + + this.id("menuFonctionsFunctionsTab").textContent = texts.functions; + this.id("menuFonctionsHistoryTab").textContent = texts.history; + this.id("newFunction").textContent = texts.newFunction; + this.id("functionTypeCartesian").textContent = texts.cartesian; + this.id("functionTypeImplicit").textContent = texts.implicit; + this.id("functionTypePolar").textContent = texts.polar; + this.id("functionTypeParametric").textContent = texts.parametric; + this.id("addFunctionButton").value = texts.add; + this.id("functionsListText").textContent = texts.functionsListText; + + this.id("editorEditPageEditTab").textContent = texts.edit; + this.id("editorEditPageToolsTab").textContent = texts.tools; + this.id("editorRangeFrom").textContent = texts.from; + this.id("editorRangeTo").textContent = texts.to; + this.id("editorThickness").textContent = texts.thickness; + this.id("editorColor").textContent = texts.color; + this.id("editorDerivatives").textContent = texts.derivatives; + this.id("editorPrimitive").textContent = texts.primitive; + this.id("editorLineStyle").textContent = texts.lineStyle; + this.id("editorStyleLine").textContent = texts.styleLine; + this.id("editorStyleDotted").textContent = texts.styleDotted; + this.id("editorStyleDashed").textContent = texts.styleDashed; + this.id("editorDrawArea").textContent = texts.drawArea; + this.id("editorDuplicate").value = texts.duplicate; + this.id("editorRemove").value = texts.remove; + + this.id("editorToolsPageEditTab").textContent = texts.edit; + this.id("editorToolsPageToolsTab").textContent = texts.tools; + this.id("computePoint").textContent = texts.computePoint; + this.id("computePointButton").value = texts.compute; + this.id("computeArea").textContent = texts.computeArea; + this.id("areaFrom").textContent = texts.from; + this.id("areaTo").textContent = texts.to; + this.id("computeAreaButton").value = texts.compute; + this.id("functionStudy").textContent = texts.functionStudy; + this.id("functionStudyButton").value = texts.startStudy; + this.id("editorToolsDuplicate").value = texts.duplicate; + this.id("editorToolsRemove").value = texts.remove; + this.id("menuFonctionsCloseButton").value = texts.close; + + this.id("input3dDisplayButton").value = texts.displayAction; + + this.id("menuHistoriqueFunctionsTab").textContent = texts.functions; + this.id("menuHistoriqueHistoryTab").textContent = texts.history; + this.id("latestDisplayedFunctions").textContent = texts.latestDisplayedFunctions; + this.id("menuHistoriqueCloseButton").value = texts.close; + + this.id("chooseColor").textContent = texts.chooseColor; + this.id("colorPickerColor").textContent = texts.color; + this.id("colorPickerValue").textContent = texts.value; + this.id("colorPickerSaturation").textContent = texts.saturation; + this.id("colorPickerRed").textContent = texts.red; + this.id("colorPickerGreen").textContent = texts.green; + this.id("colorPickerBlue").textContent = texts.blue; + this.id("inputOpacity").textContent = texts.opacity; + this.id("apercuCouleur").title = texts.newColor; + this.id("apercuCouleur2").title = texts.oldColor; + this.id("colorPickerCancelButton").value = texts.cancel; + this.id("colorPickerOkButton").value = texts.ok; + + this.id("blackListError").textContent = texts.error; + this.id("cannotDrawFunction").textContent = texts.cannotDrawFunction; + this.id("invalidExpression").textContent = texts.invalidExpression; + this.id("blackListErrorOkButton").value = texts.ok; + this.id("fctError").textContent = texts.error; + this.id("checkTheFunction").textContent = texts.checkTheFunction; + this.id("errorMessage").textContent = texts.errorMessage; + this.id("youCanFindExamples").textContent = texts.youCanFindExamples; + this.id("fctErrorHelpButton").value = texts.help; + this.id("fctErrorOkButton").value = texts.ok; + + this.id("menuSaveGraphTitle").textContent = texts.saveGraph; + this.id("saveWidthText").textContent = texts.width; + this.id("saveHeightText").textContent = texts.height; + this.id("saveBackgroundColor").textContent = texts.backgroundColor; + this.id("imageFormat").textContent = texts.imageFormat; + this.id("menuSaveGraphCancelButton").value = texts.cancel; + this.id("menuSaveGraphOkButton").value = texts.ok; + + this.id("saveImageTitle").textContent = texts.saveImageTitle; + this.id("saveImageText").textContent = texts.saveImageText; + this.id("menuSaveImageCloseButton").value = texts.close; + + this.id("updateTitle").textContent = texts.update; + this.id("currentVersion").textContent = texts.currentVersion; + this.id("latestVersionAvailable").textContent = texts.latestVersionAvailable; +// this.id("useLatestVersionText").textContent = texts.useLatestVersionText; +// this.id("useLatestVersion").value = texts.useLatestVersion; + this.id("updateBackButton").value = texts.back; + this.id("updateOkButton").value = texts.ok; + + this.id("updateErrorTitle").textContent = texts.error; + this.id("updateErrorText").textContent = texts.updateErrorText; + this.id("updateErrorOkButton").value = texts.ok; + + this.id("ctxMenuDisplay").textContent = texts.display; + this.id("ctxMenuAxes").textContent = texts.axes; + this.id("ctxMenuScale").textContent = texts.scale; + this.id("ctxMenuGrid").textContent = texts.grid; + this.id("ctxMenuReset").value = texts.reset; + this.id("ctxMenuSave").value = texts.save; + }, + + class: function(className){ + return document.getElementsByClassName(className); + }, + + id: function(id){ + return document.getElementById(id); + } +}; + + +var langTexts = { + "fr": { + "widgetName": "GraphMe", + "functions": "Fonctions", + "display": "Affichage", + "help": "Aide", + "close": "Fermer", + "back": "Retour", + "ok": "Ok", + "fullscreen": "Plein écran", + "save": "Sauvegarder", + "displayAction": "Afficher", + "pointTool": "Outil point", + "moveTool": "Outil déplacement", + "tangentTool": "Outil tangente", + "options": "Options", + "about": "À propos", + "darkBlue": "Bleu foncé", + "black": "Noir", + "blue": "Bleu", + "white": "Blanc", + "widgetOptions": "Options du widget", + "widgetTheme": "Thème du widget", + "resetWidget": "Réinitialiser le widget", + "checkForUpdate": "Vérifier les mises à jour", + "widgetDevelopedBy": "Widget réalisé par", + "widgetContactInfo": "Si vous voulez rapporter un bug, avez une suggestion par rapport au widget ou voulez simplement poser une question, merci de me contacter par e-mail à l'adresse suivante", + "widgetBackgroundSource": "Les images d'arrière-plan viennent de l'environnement de bureau KDE", + "changelogButton": "qu'est-ce qui a changé?", + "changelogTitle": "Notes de version", + "displayParameters": "Paramètres d'affichage", + "functionsParameters": "Paramètres des fonctions", + "plotRange": "Zone d'affichage", + "xAxis": "Axe des X", + "yAxis": "Axe des Y", + "to": "à", + "defaultZoom": "Zoom par défaut", + "defaultDisplayParameters": "Réinitialiser l'affichage", + "displayMethod": "Méthode d'affichage du graphique", + "showGrid": "Afficher la grille", + "showAxis": "Afficher les axes", + "showScale": "Afficher l'échelle", + "graphAccuracy": "Précision du graphique, points calculés", + "improveAccuracy": "Améliorer la précision lors d'un zoom arrière (plus lent)", + "defaultFunctionParameters": "Paramètres par défaut des fonctions", + "thickness": "Épaisseur", + "drawDerivativeAndPrimitive": "Dessiner les dérivées et primitives", + "drawArea": "Dessiner l'aire sous la fonction", + "lineStyle": "Style de ligne", + "styleLine": "continu", + "styleDotted": "points", + "styleDashed": "traits", + "display3D": "Affichage 3D", + "displayStyle": "Style d'affichage", + "styleSurfaces": "surfaces", + "resetDisplay": "Réinitialiser l'affichage", + "colorsConfig": "Configuration des couleurs", + "useRedFor": "utiliser le rouge pour", + "useGreenFor": "utiliser le vert pour", + "useBlueFor": "utiliser le bleu pour", + "positiveValues": "valeur positive", + "negativeValues": "valeur négative", + "always": "toujours", + "globalValue": "Valeur générale", + "globalValueRange": "(entre 0 et 255)", + "usage": "Utilisation", + "examples": "Exemples", + "howItWorks": "Fonctionnement", + "howItWorksText": "Ce widget vous permet de dessiner des fonctions mathématiques. Entrez une première fonction dans le champ en haut du widget et cliquez sur le bouton \"Afficher\". Ouvrez le menu \"Fonctions\" pour modifier votre fonction ou en ajouter une nouvelle.", + "availableFunctionsText": "Vous pouvez saisir les fonctions mathématiques suivantes", + "basicOperations": "Les opérations de base", + "plus": "Addition", + "minus": "Soustraction", + "multiplication": "Multiplication", + "division": "Division", + "modulus": "Modulo", + "trigonometricFunctions": "Les fonctions trigonométriques", + "sine": "Sinus", + "cosine": "Cosinus", + "tangent": "Tangente", + "cotangent": "Cotangente", + "secant": "Secante", + "cosecant": "Cosecante", + "arcSine": "Arcsinus", + "arcCosine": "Arccosinus", + "arcTangent": "Arctangente", + "arcCotangent": "Arccotangente", + "hyperbolicFunctions": "Les fonctions hyperboliques", + "hypSine": "Sinus hyp", + "hypCosine": "Cosinus hyp", + "hypTangent": "Tangente hyp", + "hypCotangent": "Cotangente hyp", + "hypSecant": "Secante hyp", + "hypCosecant": "Cosecante hyp", + "hypArcSine": "Arcsinus hyp", + "hypArcCosine": "Arccosinus hyp", + "hypArcTangent": "Arctangente hyp", + "hypArcCotangent": "Arccotangente hyp", + "powerAndRoot": "Les racines et les puissances", + "squareRoot": "Racine carrée", + "power": "Puissances", + "xPowY": "Élève x à une puissance y", + "root": "Racines", + "rootText": "Racine y d'un nombre x", + "expAndLog": "Les exponentielles et logarithmes", + "naturalLog": "logarithme naturel", + "decimalLog": "logarithme de base", + "absValue": "La valeur absolue d'un nombre", + "rounding": "Les arrondis", + "roundText": "arrondit à l'entier le plus proche", + "ceilText": "arrondit à l'entier supérieur", + "floorText": "arrondit à l'entier inférieur", + "constants": "Constantes", + "keyboardShortcuts": "Raccourcis clavier", + "moveLeft": "déplacer le graphique à gauche", + "moveTop": "déplacer le graphique en haut", + "moveRight": "déplacer le graphique à droite", + "moveBottom": "déplacer le graphique en bas", + "examplesText": "(Vous pouvez cliquer sur un exemple pour l'afficher. Pensez à ajuster la précision du graphique dans les options si nécessaire.)", + "functions2d": "Fonctions 2D", + "functions3d": "Fonctions 3D", + "saveGraph": "Enregistrer le graphique", + "functionStudy": "Étude de fonction", + "domainOfDefinition": "Ensemble de définition", + "symmetry": "Parité", + "zeros": "Zéros de la fonction", + "sign": "Signe", + "asymptotes": "Asymptotes", + "extremums": "Extremums", + "inflexionPoints": "Points d'inflexion", + "functionStudyText": "L'outil permettant d'étudier les fonctions n'est pas fiable à 100%. Pensez à vérifier les résultats de l'étude avant d'en faire une quelconque utilisation.", + "history": "Historique", + "newFunction": "Nouvelle fonction", + "cartesian": "Cartésienne", + "implicit": "Implicite", + "polar": "Polaire", + "parametric": "Paramétrique", + "add": "Ajouter", + "functionsListText": "Fonction dessinées", + "edit": "Modifier", + "tools": "Outils", + "from": "de", + "to": "à", + "color": "Couleur", + "derivatives": "Dérivées", + "primitive": "Primitive", + "duplicate": "Dupliquer", + "remove": "Supprimer", + "computePoint": "Calculer un point de la fonction", + "compute": "Calculer", + "computeArea": "Calculer l'aire sous la fonction", + "startStudy": "Démarrer l'étude", + "latestDisplayedFunctions": "Dernières fonctions dessinées", + "chooseColor": "Choix de la couleur", + "value": "Valeur", + "saturation": "Saturation", + "red": "Rouge", + "green": "Vert", + "blue": "Bleu", + "opacity": "Opacité", + "oldColor": "Ancienne Couleur", + "newColor": "Nouvelle Couleur", + "cancel": "Annuler", + "error": "Erreur", + "cannotDrawFunction": "Impossible de dessiner la fonction", + "invalidExpression": "Expression ou caractère invalide", + "checkTheFunction": "Vérifiez la fonction que vous vouliez dessiner", + "errorMessage": "Message d'erreur", + "youCanFindExamples": "Une description ainsi que des exemples des différentes fonctions que vous pouvez dessiner se trouvent dans l'aide", + "width": "Largeur", + "height": "Hauteur", + "backgroundColor": "Couleur de fond", + "imageFormat": "Format de l'image", + "update": "Mise à jour", + "currentVersion": "Version en cours d'utilisation", + "latestVersionAvailable": "Dernière version disponible en ligne", + "useLatestVersionText": "Vous pouvez remplacer la version en cours d'utilisation par une version du widget en ligne. Notez que ceci ne met pas à jour le widget. Il faudra réitérer cette procédure la prochaine fois que vous l'utiliserez.", + "useLatestVersion": "Utiliser la dernière version", + "updateErrorText": "Il est impossible de mettre à jour le widget vers la version en ligne car vous utilisez déjà la version en ligne", + "axes": "Axes", + "scale": "Échelle", + "grid": "Grille", + "reset": "Réinitialiser", + "saveImageTitle": "Sauvegarder l'image", + "saveImageText": "Cliquez avec le bouton de droite sur l'image et sélectionnez \"Enregistrer l'image\". Il est aussi possible de choisir \"Copier l'image\" et ensuite la coller dans une autre application.", + + /* Inside code */ + "even": "paire", + "odd": "impaire", + "none_f": "aucune", + "none_m": "aucun", + "clickHereToModify": "Cliquez ici pour modifier les fonctions ou en ajouter une nouvelle.", + "enterFunction": "Entrez une fonction à dessiner", + "needHelp": "Consulter l'aide", + "unableLoadParameters": "Impossible de charger les paramètres enregistrés..." + } +}; + diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Outils.js b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Outils.js new file mode 100755 index 00000000..82f9aa91 --- /dev/null +++ b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Outils.js @@ -0,0 +1,550 @@ + +// -------------------- Fonctions des outils -------------------- + + +// Permet d'afficher la valeur en "y" pour un point donné en "x" +function calculerPoint() { + x = document.getElementById("inputX").value; + document.getElementById("outputX").innerHTML = " f(x) = "+fct.list[editeur.idFct].f(x)+""; + //alert("Si x = "+x+" \nf(x) = "+eval(fonction)+"") +} + + +// Historique + +var historique = { + liste : [], + + actualiser : function(){ + var texteHistorique = "" + for(var i=0; i'; + texteHistorique += this.liste[i].readableText(); + texteHistorique += '
    '; + } + document.getElementById("spanHistorique").innerHTML = texteHistorique + document.getElementById("divHistorique").scrollTop = 0 + }, + + use : function(index){ + fct.add(this.liste[index]); + }, + + ajouter : function(func){ + if(func.fct == ""){ + return; + } + for(var i=0; i= 1 ){ + element.removeChild(element.firstChild); + } + } + + this.width = width || element.clientWidth; + this.height = height || element.clientHeight; + +// element.style.width = affichage.largeur +"px"; +// element.style.height = affichage.hauteur +"px"; +// element.style.left = document.getElementById(affichage.id).offsetLeft+1 +"px"; +// element.style.top = document.getElementById(affichage.id).offsetTop+1 +"px"; + + this.canvas = document.createElement("canvas"); + this.canvas.width = this.width; + this.canvas.height = this.height; + element.appendChild(this.canvas); + this.ctx = this.canvas.getContext('2d'); + }, + + // Permet de changer d'outil et de faire différentes actions lors du choix de l'outil + choisir : function(nom){ + document.getElementById("pointTool").className = "toolButton"; + document.getElementById("moveTool").className = "toolButton"; + document.getElementById("tangentTool").className = "toolButton"; + switch(nom){ + case 'point': + document.getElementById("pointTool").className += " selectedTool"; + break; + case 'deplacement': + document.getElementById("moveTool").className += " selectedTool"; + break; + case 'tangente': + document.getElementById("tangentTool").className += " selectedTool"; + break; + } + if(nom == 'deplacement'){ + document.getElementById("eventAffichage").style.cursor = "move"; + } + else{ + document.getElementById("eventAffichage").style.cursor = "auto"; + } + this.dessinerListe(); + this.actuel = nom; + saveOptions(); + }, + + // Gestion des événements reçus de l'objet souris + move : function(x, y, xInit, yInit, active){ + switch(this.actuel){ + case "deplacement": + if(active){ + this.deplacement(x, y, xInit, yInit); + } + break; + case "point": + this.point(x, y); + break; + case "tangente": + this.tangente(x, y); + break; + } + }, + + down : function(x, y){ + switch(this.actuel){ + case "point": + this.point(x, y, true) + break; + case "tangente": + this.tangente(x, y, true); + break; + } + }, + + // Fonctions des outils + deplacement : function(x, y, xInit, yInit){ + var valeurX = (x-xInit)/affichage.multX; + var valeurY = (yInit-y)/affichage.multY; + if(Math.round(Math.abs(valeurX)) > 0){ + if(fonction3D){ + affichage.deplacerX(Math.round(2*valeurX)/2); + } + else{ + affichage.deplacerX(-Math.round(2*valeurX)/2); + } + souris.xInit = x; + } + if(Math.round(Math.abs(valeurY)) > 0){ + affichage.deplacerY(-Math.round(2*valeurY)/2); + souris.yInit = y; + } + }, + + point : function(sourisX, sourisY, ajouterDansListe){ + var ctx = new Object(); + ctx = this.ctx; + + // Dessiner les points et tangentes supplémentaires + this.dessinerListe(); + + for(var i=0; i func.endAngle){ + continue; + } + } + var x = func.getX(t); + var y = func.getY(t); + + // Afficher les coordonnées et le point sous la souris + if(!isNaN(x) && !isNaN(y)){ + if(ajouterDansListe){ + this.ajouterPoint(x, y, func.couleur); + } + this.dessinerPoint(x, y, func.couleur); + } + } + }, + dessinerPoint : function(x, y, couleur){ + var ctx = new Object(); + ctx = this.ctx; + + // Conversion des coordonnées + var posX = coordToPosX(x) + 1; + var posY = coordToPosY(y) + 1; + + ctx.shadowColor = couleur; + ctx.shadowBlur = 4; + + // Texte + var txtPos = "("+Math.round(x*100)/100+";"+Math.round(y*100)/100+")"; + ctx.fillStyle = "rgba(255,255,255,0.5)"; + try{ + ctx.bulle(posX+7, posY-7, txtPos.length*5.5, 20); + } + catch(err){ + ctx.fillRect(posX+7, posY-27, txtPos.length*5.5, 20); + } + + ctx.fillStyle = "black"; + ctx.shadowColor = "black"; + ctx.shadowOffsetX = 1; + ctx.shadowOffsetY = 1; + ctx.shadowBlur = 2; + ctx.fillText(txtPos, posX+8+txtPos.length/4, posY-13); + + // Rond + ctx.beginPath(); + ctx.arc(posX, posY, 4, 0, 2*Math.PI, true); + + ctx.shadowColor = couleur; + ctx.shadowOffsetX = 0; + ctx.shadowOffsetY = 0; + ctx.shadowBlur = 4; + + ctx.fillStyle = "rgba(0,0,0,1)"; + ctx.strokeStyle = "rgba(255,255,255,0.8)"; + ctx.lineWidth = 1; + ctx.fill() + ctx.stroke(); + }, + + tangente : function(sourisX, sourisY, ajouterDansListe){ + var delta = 0.001; + + var ctx = new Object(); + ctx = this.ctx; + + // Dessiner les points et tangentes supplémentaires + this.dessinerListe(); + + // Dessiner les tangentes des fonctions + for(var i=0; i func.endAngle){ + continue; + } + } + var t1 = t + delta; + var x = func.getX(t); + var x1 = func.getX(t1); + // Calcul de deux valeurs y et de la pente + var y = func.getY(t); + var y1 = func.getY(t1); + var pente; + if(x1 != x){ + pente = (y1-y)/(x1-x); + } + else{ + pente = Number.POSITIVE_INFINITY; + } + + // Dessiner la pente; + if(!isNaN(x) && !isNaN(y) && !isNaN(y1)){ + if(ajouterDansListe){ + this.ajouterTangente(x, y, pente, func.couleur); + } + this.dessinerTangente(x, y, pente, func.couleur); + } + } + }, + dessinerTangente : function(x, y, pente, couleur){ + var ctx = new Object(); + ctx = this.ctx; + + // Conversion des coordonnées + var posX = coordToPosX(x) + 1; + var posY = coordToPosY(y) + 1; + + // Carré + ctx.shadowColor = couleur; + ctx.shadowBlur = 4; + + ctx.fillStyle = "white"; + ctx.fillRect(posX-3, posY-3, 6, 6); + + // Pente + ctx.strokeStyle = "white"; + ctx.lineWidth = 2; + ctx.beginPath(); + var pente2 = pente * (affichage.hauteur/affichage.largeur) * (affichage.xDroite-affichage.xGauche)/(affichage.yHaut-affichage.yBas); + ctx.moveTo(0, posY+posX*pente2); + ctx.lineTo(affichage.largeur, posY+posX*pente2-affichage.largeur*pente2); + ctx.stroke(); + + // Texte + var txtPente; + if(isFinite(pente)){ + txtPente = pente.toFixed(2); + } + else{ + txtPente = "∞" + } + ctx.fillStyle = "rgba(255,255,255,0.5)"; + try{ + ctx.bulle(posX+7, posY-7, txtPente.length*5.5+1, 20); + } + catch(err){ + ctx.fillRect(posX+7, posY-27, txtPente.length*5.5, 20); + } + + ctx.fillStyle = "black"; + ctx.shadowColor = "black"; + ctx.shadowOffsetX = 1; + ctx.shadowOffsetY = 1; + ctx.shadowBlur = 2; + ctx.fillText(txtPente, posX+8+txtPente.length/4, posY-13); + }, + + ajouterPoint : function(x, y, couleur){ + var newPoint = { + x : x, + y : y, + couleur : couleur, + dessiner : function(){ + outil.dessinerPoint(this.x, this.y, this.couleur); + } + }; + this.liste.push(newPoint); + }, + ajouterTangente : function(x, y, pente, couleur){ + var newTangente = { + x : x, + y : y, + pente : pente, + couleur : couleur, + dessiner : function(){ + outil.dessinerTangente(this.x, this.y, this.pente, this.couleur); + } + }; + this.liste.push(newTangente); + }, + dessinerListe : function(){ + if(!this.ctx){ + return; + } + this.ctx.clearRect(0,0,affichage.largeur*2,affichage.hauteur*2); + for(var i=0; i affichage.largeur+affichage.offsetLeft || posX < affichage.offsetLeft || posY > affichage.hauteur+affichage.offsetTop || posX < affichage.offsetTop){ + continue; + } + var txt = '
    '; + afficherMenu('menuSaveImage'); + + display3D.background = background; + setTimeout(function(){ + display3D.init(); + display3D.draw(); + }, 1); + } + else{ + if(affichage.methode == "canvas"){ + var l = affichage.largeur; + var h = affichage.hauteur; + var c = affichage.couleurFond; + + affichage.largeur = parseInt(document.getElementById("saveWidth").value); + affichage.hauteur = parseInt(document.getElementById("saveHeight").value); + affichage.couleurFond = backgroundSauvegarde; + + var newDiv = document.createElement("div"); + affichage.init(newDiv, userWidth, userHeight); + + outil.init(); + outil.dessinerListe(); + affichage.ctx.drawImage(outil.canvas,0,0); + + var dataURL; + if(document.getElementById("selectSaveType").value == "jpg"){ + dataURL = affichage.canvas.toDataURL("image/jpeg"); + } + else{ + dataURL = affichage.canvas.toDataURL(); + } + document.getElementById("saveImageContent").innerHTML = ''; + afficherMenu('menuSaveImage'); + + affichage.largeur = l; + affichage.hauteur = h; + affichage.couleurFond = c; + affichage.init(); + outil.init(); + } + else if(affichage.methode == "svg"){ + window.open("JavaScript/AffichageSVG.svg"); + } + } +} diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/ParametricFunction.js b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/ParametricFunction.js new file mode 100644 index 00000000..30ed4271 --- /dev/null +++ b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/ParametricFunction.js @@ -0,0 +1,116 @@ + + +function ParametricFunction(fctX, fctY){ + + this.setFct = function(fctX, fctY){ + this.fct = "x(t) = " + fctX + " ; y(t) = " + fctY; + this.fctX = fctX; + this.fctY = fctY; + this.fx = new Function("t", "return "+this.fctX); + this.fy = new Function("t", "return "+this.fctY); + } + + if(fctX && fctY){ + this.setFct(fctX, fctY); + } + this.couleur = fct.couleur; + this.width = document.getElementById("inputTaille").value; + this.startAngle = 0; + this.endAngle = 2*Math.PI; + this.from = "0"; + this.to = "2*pi"; + this.style = document.getElementById("selectStyle").value; + + this.getX = function(t){ + return this.fx(t); + }; + + this.getY = function(t){ + return this.fy(t); + }; + + this.set = function(f){ + var fctX = fct.remplacer(fct.verifier(f.fctX)); + var fctY = fct.remplacer(fct.verifier(f.fctY)); + this.setFct(fctX, fctY); + this.couleur = f.couleur; + this.width = f.width; + this.style = f.style; + this.from = f.from; + this.to = f.to; + this.startAngle = eval(fct.remplacer(fct.verifier(f.from))); + this.endAngle = eval(fct.remplacer(fct.verifier(f.to))); + return this; + }; + + this.get = function(){ + var f = {}; + f.type = "parametric"; + f.fctX = this.fctX; + f.fctY = this.fctY; + f.couleur = this.couleur; + f.width = this.width; + f.style = this.style; + f.from = this.from; + f.to = this.to; + return f; + }; + + this.readableText = function(){ + return "x(t) = " + this.fctX + "; y(t) = " + this.fctY; + }; + + this.setStartEnd = function(start, end){ + if(start > end){ + var tmp = start; + start = end; + end = start; + } + this.startAngle = start; + this.endAngle = end; + }; + + this.plot = function(ctx, precision, affichage){ + if(this.style == "points"){ + precision *= 2; + } + + ctx.beginPath(); + ctx.lineWidth = this.width; + ctx.strokeStyle = this.couleur; + ctx.fillStyle = this.couleur; + notDefined = true; + for(var t = this.startAngle; t <= this.endAngle; t+=precision){ + var x = this.fx(t); + var y = this.fy(t); + if(!isNaN(x) && !isNaN(y)){ + // Transform coordinates + var pointX = (x - affichage.xGauche) * affichage.multX; + var pointY = affichage.hauteur - (y - affichage.yBas) * affichage.multY; + + // Draw point + if(notDefined){ + notDefined = false; + ctx.moveTo(pointX, pointY); + } + else{ + if(this.style == "continu"){ + ctx.lineTo(pointX, pointY); + } + else if(this.style == "points"){ + ctx.beginPath(); + ctx.arc(pointX, pointY, this.width, 0, 2*Math.PI, true); + ctx.fill(); + } + else{ + ctx.lineTo(pointX, pointY); + notDefined = true; + } + } + } + } + if(this.style != "points"){ + ctx.stroke(); + } + }; +} diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/PolarFunction.js b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/PolarFunction.js new file mode 100644 index 00000000..52dd7e79 --- /dev/null +++ b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/PolarFunction.js @@ -0,0 +1,112 @@ + +function PolarFunction(txtFct){ + + this.setFct = function(txt){ + this.fct = txt; + this.f = new Function("t", "return "+this.fct); + }; + + if(txtFct){ + this.setFct(txtFct); + } + this.couleur = fct.couleur; + this.width = document.getElementById("inputTaille").value; + this.startAngle = 0; + this.endAngle = 2*Math.PI; + this.from = "0"; + this.to = "2*pi"; + this.style = document.getElementById("selectStyle").value; + + this.getX = function(t){ + var r = this.f(t); + return r * Math.cos(t); + }; + + this.getY = function(t){ + var r = this.f(t); + return r * Math.sin(t); + }; + + this.set = function(f){ + this.setFct(fct.remplacer(fct.verifier(f.fct))); + this.couleur = f.couleur; + this.width = f.width; + this.style = f.style; + this.from = f.from; + this.to = f.to; + this.startAngle = eval(fct.remplacer(fct.verifier(f.from))); + this.endAngle = eval(fct.remplacer(fct.verifier(f.to))); + return this; + }; + + this.get = function(){ + var f = {}; + f.type = "polar"; + f.fct = this.fct; + f.couleur = this.couleur; + f.width = this.width; + f.style = this.style; + f.from = this.from; + f.to = this.to; + return f; + }; + + this.readableText = function(){ + return "r(t) = " + this.fct; + }; + + this.setStartEnd = function(start, end){ + if(start > end){ + var tmp = start; + start = end; + end = start; + } + this.startAngle = start; + this.endAngle = end; + }; + + this.plot = function(ctx, precision, affichage){ + if(this.style == "points"){ + precision *= 2; + } + + ctx.beginPath(); + ctx.lineWidth = this.width; + ctx.strokeStyle = this.couleur; + ctx.fillStyle = this.couleur; + notDefined = true; + for(var t = this.startAngle; t <= this.endAngle; t+=precision){ + var r = this.f(t); + if(!isNaN(r)){ + // Transform coordinates + var x = r * Math.cos(t); + var y = r * Math.sin(t); + var pointX = (x - affichage.xGauche) * affichage.multX; + var pointY = affichage.hauteur - (y - affichage.yBas) * affichage.multY; + + // Draw point + if(notDefined){ + notDefined = false; + ctx.moveTo(pointX, pointY); + } + else{ + if(this.style == "continu"){ + ctx.lineTo(pointX, pointY); + } + else if(this.style == "points"){ + ctx.beginPath(); + ctx.arc(pointX, pointY, this.width, 0, 2*Math.PI, true); + ctx.fill(); + } + else{ + ctx.lineTo(pointX, pointY); + notDefined = true; + } + } + } + } + if(this.style != "points"){ + ctx.stroke(); + } + }; +} diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Sauvegardes.js b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Sauvegardes.js new file mode 100644 index 00000000..54b3829d --- /dev/null +++ b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Sauvegardes.js @@ -0,0 +1,106 @@ +// Fonctions permettant de sauvegarder les options + +var optionsLoaded = false; + +function setCookie(nom,valeur){ + var jours = 545; // Durée de validité des cookies + var date = new Date(); + date.setDate(date.getDate()+jours); + document.cookie = nom + "=" + escape(valeur) + "; expires="+date.toGMTString(); +} + +function getCookie(nom){ + var start = 0; + var end = 0; + if(document.cookie.length>0){ + start = document.cookie.indexOf(nom + "="); + if(start!=-1){ + start = start + nom.length+1; + end = document.cookie.indexOf(";",start); + if(end==-1){ + end = document.cookie.length; + } + return unescape(document.cookie.substring(start,end)); + } + } + return ""; +} + +function delCookie(nom){ + var date = new Date(); + date.setDate(date.getDate()-1); + document.cookie = nom + "=; expires="+date.toGMTString(); +} + +function saveOptions(){ + if(!optionsLoaded){ + return; + } + var state = JSON.stringify(widget.getState()); + if(window.sankore){ + sankore.setPreference("state", state); + } + else if(navigator.cookieEnabled){ + setCookie("state", state); + } +} + +function loadOptions(){ + var state; + if(window.sankore){ + state = sankore.preference("state", null); + } + else if(navigator.cookieEnabled){ + state = getCookie("state"); + } + if(!state){ + optionsLoaded = true; + return; + } + var stateObject = JSON.parse(state); + var goodState = widget.getState(); + if(!checkState(stateObject, goodState)){ + loadOptionsFailed(); + } + try{ + widget.setState(stateObject); + optionsLoaded = true; + } + catch(e){ + loadOptionsFailed(); + } +} + +function loadOptionsFailed(){ + var text = "Unable to load the saved parameters..."; + try{ + text = languages.getText("unableLoadParameters"); + } + catch(e){} + alert(text); + delOptions(); +} + +function checkState(state, goodState){ + for(var i in goodState){ + if(! i in state){ + return false; + } + } + return true; +} + +function delOptions(){ + if(window.sankore){ + sankore.setPreference("state", ""); + } + else if(navigator.cookieEnabled){ + delCookie("state"); + } +} + +function alertOptions(){ +// alert("Options actuellement sauvegardées\n------------------------------------------------------------\n"+document.cookie); + document.getElementById("divAlertCookies").innerHTML = document.cookie; + afficherMenu("menuAlertCookies"); +} diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Souris.js b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Souris.js new file mode 100644 index 00000000..3f1c211f --- /dev/null +++ b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Souris.js @@ -0,0 +1,92 @@ + +var souris = { + active : false, + xInit : 0, + yInit : 0, + + down : function(event){ + var x = event.clientX; + var y = event.clientY; + this.active = true; + this.xInit = x; + this.yInit = y; + if(event.button != 2 && !ctxMenu.ouvert){ + outil.down(x, y); + } + ctxMenu.fermer(); + }, + up : function(){ + this.active = false; + }, + move : function(event){ + var x = event.clientX; + var y = event.clientY; + outil.move(x, y, souris.xInit, souris.yInit, souris.active); + }, + out : function(event){ + outil.dessinerListe(); + if(event.relatedTarget && event.relatedTarget.className != "flecheDeplacement"){ + this.active = false; + } + }, + wheel : function(event){ + if(!event) event = window.event; + if(event.wheelDelta){ + if(event.wheelDelta < 0){ + affichage.zoom(1.25); + } + else{ + affichage.zoom(0.8); + } + } + else if(event.detail){ + if(event.detail > 0){ + affichage.zoom(1.25); + } + else{ + affichage.zoom(0.8); + } + } + }, + dblClick : function(event){ + if(event.ctrlKey){ + affichage.zoom(1.25) + display3D.zoom(1.25) + } + else{ + affichage.zoom(0.8) + display3D.zoom(0.8) + } + } +} + +var ctxMenu = { + id : "ctxMenu", + ouvert : false, + + ouvrir : function(){ + if(!fonction3D){ + ctxMenu.ouvert = true; + + var element = document.getElementById("ctxMenu"); + var x = souris.xInit; + var y = souris.yInit; + // var x = 300; + // var y = 300; + element.style.display = "block"; + element.style.left = (x+1)+"px"; + element.style.top = (y+1)+"px"; + + // Désactive le menu du navigateur + return false; + } + }, + + fermer : function(){ + ctxMenu.ouvert = false; + + var element = document.getElementById("ctxMenu"); + element.style.display = "none"; + } +} + diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Utils.js b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Utils.js new file mode 100644 index 00000000..f7dcbf7c --- /dev/null +++ b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Utils.js @@ -0,0 +1,228 @@ + +// Lance la procédure pour dessiner la fonction qui se trouve dans l'input en haut du widget. +// Permet aussi d'actualiser le graphique. +function actualiserGraph(){ + affichage.calculer(); +} + +// Retourne l'index du dernier endroit où se trouve listCharacter dans une chaîne de caractère. +String.prototype.getLastIndexOf = function(listCharacter, minPos, maxPos){ + var count = 0; + var parenthese = false; + if(!maxPos){ + maxPos = this.length; + } + for(var i=maxPos; i>=minPos; i--){ + if(this.charAt(i) == ")"){ + count++; + parenthese = true; + } + else if(this.charAt(i) == "("){ + count--; + } +// window.console.log(this.charAt(i)+" ; "+count); + for(var j=0; j0){ + return 1; + } + else{ + return undefined; + } +} + +function round(valeur){ + return Math.round(valeur); +} +function ceil(valeur){ + return Math.ceil(valeur); +} +function floor(valeur){ + return Math.floor(valeur); +} +function random(){ + return Math.random(); +} diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Widget.js b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Widget.js new file mode 100644 index 00000000..100d109a --- /dev/null +++ b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/JavaScript/Widget.js @@ -0,0 +1,186 @@ +var listeServeurs = [ + 'http://yannick.vessaz.net/GraphMe/GraphMe.wgt/' + /*'http://gyb.educanet2.ch/tm-widgets/yannick/GraphMe.wgt/'*/ +]; + +var widget = { + init: function(){ +// try{ + document.getElementById('inputRapide').value = ""; + document.getElementById('selectTheme').value = "darkblue"; + affichage.setOptions(); + document.getElementById('zoomDefaut').value = "3.7"; + document.getElementById('functionType').value = "cartesian"; + document.getElementById('inputTaille').value = "3"; + document.getElementById('checkDerivee1').checked = false; + document.getElementById('checkDerivee2').checked = false; + document.getElementById('checkPrimitive1').checked = false; + document.getElementById('checkAire').checked = false; + document.getElementById('selectStyle').value = "continu"; + document.getElementById('input3D').value = ""; + document.getElementById('inputPrecision3D').value = "0.2"; + document.getElementById('selectAffichage3D').value = "surfaces"; + document.getElementById('selectRouge3D').value = "plus"; + document.getElementById('selectVert3D').value = "moins"; + document.getElementById('selectBleu3D').value = "tout"; + document.getElementById('couleur3Dgenerale').value = "0"; + + affichage.init(); + outil.init(); + editorPreview.init(); + display3D.checkCouleurs3D(); + loadOptions(); + + if(!fonction3D){ + if(fct.list.length == 0){ + this.displayStartInput(); + } + else if(!window.sankore){ + this.displayFunctionsHelp(); + } + } +// } +// catch(err){ +// alert(err+'\n'+err.stack); +// } + }, + + displayStartInput: function(){ + document.getElementById('divInputRapide').style.display = "block"; + var textEnterFunction = "Enter a cartesian function"; + try{ + textEnterFunction = languages.getText("enterFunction"); + } + catch(e){} + var textNeedHelp = "Need help ?"; + try{ + textNeedHelp = languages.getText("needHelp"); + } + catch(e){} + + var text = textEnterFunction + '. '+ textNeedHelp +'' + + message.ajouter(275,75,text); + setTimeout(message.supprimer, 15000); + + document.getElementById('inputRapide').focus(); + }, + + addStartFunction: function(){ + message.supprimer(); + document.getElementById('divInputRapide').style.display = 'none'; + document.getElementById('input').value = document.getElementById('inputRapide').value; + fct.ajouter(); + this.displayFunctionsHelp(); + }, + + displayFunctionsHelp: function(){ + var text = "Click here to modify the functions or add a new function."; + try{ + text = languages.getText("clickHereToModify"); + } + catch(e){} + setTimeout(function(){message.ajouter(220,35,text)}, 50); + setTimeout(message.supprimer, 5000); + }, + + resize: function(){ + if(fonction3D){ + display3D.init(); + display3D.draw(); + } + else{ + affichage.init(); + } + outil.init(); + }, + + reset: function(){ + delOptions(); + window.location.reload(); + }, + + getState: function(){ + var state = { + theme: document.getElementById("selectTheme").value, + displayMethod: document.getElementById("selectMethodeAffichage").value, + defaultZoom: document.getElementById("zoomDefaut").value, + displayGrid: document.getElementById("checkGrille").checked, + displayAxes: document.getElementById("checkAxes").checked, + displayScale: document.getElementById("checkEchelle").checked, + accuracy: document.getElementById("inputPrecision").value, + improvedAccuracy: document.getElementById("checkPrecision").checked, + thickness: document.getElementById("inputTaille").value, + lineStyle: document.getElementById("selectStyle").value, + derivative1: document.getElementById("checkDerivee1").checked, + derivative2: document.getElementById("checkDerivee2").checked, + primitive: document.getElementById("checkPrimitive1").checked, + drawArea: document.getElementById("checkAire").checked, + lineStyle3D: document.getElementById("selectAffichage3D").value, + accuracy3D: document.getElementById("inputPrecision3D").value, + plotHistory: historique.get(), + functions: fct.get(), + display3D: fonction3D, + input3D: document.getElementById('input3D').value, + currentTool: outil.actuel + }; + if(window.sankore){ + state.fullScreen = pleinEcran; + state.displayLeft = affichage.xGauche; + state.displayRight = affichage.xDroite; + state.displayUp = affichage.yHaut; + state.displayDown = affichage.yBas; + } + return state; + }, + + setState: function(state){ + document.getElementById("selectTheme").value = state.theme; + document.getElementById("selectMethodeAffichage").value = state.displayMethod; + document.getElementById("zoomDefaut").value = state.defaultZoom; + document.getElementById("checkGrille").checked = state.displayGrid; + document.getElementById("checkAxes").checked = state.displayAxes; + document.getElementById("checkEchelle").checked = state.displayScale; + document.getElementById("inputPrecision").value = state.accuracy; + document.getElementById("checkPrecision").checked = state.improvedAccuracy; + document.getElementById("inputTaille").value = state.thickness; + document.getElementById("selectStyle").value = state.lineStyle; + document.getElementById("checkDerivee1").checked = state.derivative1; + document.getElementById("checkDerivee2").checked = state.derivative2; + document.getElementById("checkPrimitive1").checked = state.primitive; + document.getElementById("checkAire").checked = state.drawArea; + document.getElementById("selectAffichage3D").value = state.lineStyle3D; + document.getElementById("inputPrecision3D").value = state.accuracy3D; + historique.set(state.plotHistory); + fct.set(state.functions); + document.getElementById('input3D').value = state.input3D || ""; + if(state.display3D){ + activer3D(); + } + + if(window.sankore){ + if(state.fullScreen){ + agrandirAffichage(); + } + affichage.xGauche = state.displayLeft; + affichage.xDroite = state.displayRight; + affichage.yHaut = state.displayUp; + affichage.yBas = state.displayDown; + affichage.setBornes(); + } + + affichage.getOptions(); + if(!window.sankore){ + affichage.initZoom2(document.getElementById('zoomDefaut').value); + } + changerTheme(document.getElementById("selectTheme").value); + if(state.display3D){ + display3D.draw(); + } + else{ + affichage.dessiner(); + } + + outil.choisir(state.currentTool); + } +}; diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Style/ColorPicker.css b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Style/ColorPicker.css new file mode 100644 index 00000000..8ec2103b --- /dev/null +++ b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Style/ColorPicker.css @@ -0,0 +1,56 @@ +/* ColorPicker */ +#canvasSV{ + width: 250px; + height: 250px; + border: 1px solid black; +} +#canvasT{ + width: 25px; + height: 250px; + border: 1px solid black; + position: relative; + left: 10px; +} +#canvasO{ + width: 290px; + height: 25px; + position: relative; + top: 5px; +} + +/* Valeurs de la couleur dans le ColorPicker */ +#colorValues{ + position: relative; + left: 10px; + font-size: 11px; + float: right; +} +#colorValues td{ + vertical-align: middle; + text-align: right; +} + +/* Aperçus dans le ColorPicker */ +#apercuCouleur{ + position: absolute; + right: 20px; + bottom: 40px; + width: 40px; + height: 30px; + border: 1px white solid; + border-radius: 5px; + -webkit-border-radius: 5px; + background-color: rgb(193,255,0); +} + +#apercuCouleur2{ + position: absolute; + right: 65px; + bottom: 40px; + width: 40px; + height: 30px; + border: 1px white solid; + border-radius: 5px; + -webkit-border-radius: 5px; + background-color: rgb(193,255,0); +} diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Style/Guide_Utilisateur.css b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Style/Guide_Utilisateur.css new file mode 100644 index 00000000..166f2cfc --- /dev/null +++ b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Style/Guide_Utilisateur.css @@ -0,0 +1,41 @@ +body{ + background-color: rgba(255,255,255,0.6); +} +h1{ + font-size: 250%; + text-align: center; + text-decoration: underline; +} +h2{ + margin-top: 40px; +} +h4{ + margin-top: 20px; + margin-bottom: 0px; +} +img{ + display: block; + margin-left: auto; + margin-right: auto; +} +p{ + text-align: justify; +} +li{ + text-align: justify; +} +.droite{ + float: right; + font-size: 80%; + font-style: italic; + margin: 5px; +} +.gauche{ + float: left; + font-size: 80%; + font-style: italic; +} +#Sommaire{ + margin-top: 100px; + margin-bottom: 100px; +} \ No newline at end of file diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Style/Haut.css b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Style/Haut.css new file mode 100644 index 00000000..329a839f --- /dev/null +++ b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Style/Haut.css @@ -0,0 +1,341 @@ +/* Boutons qui sont en haut du widget */ +#haut{ + position: absolute; + top: 0px; + left: 8px; + right: 0px; + height: 30px; + z-index: 2; + pointer-events: none; +} + +#haut > *{ + pointer-events: auto; +} + +/* Onglets */ +.ongletHaut{ +/* background-color: rgba(255, 255, 255, 0.3); */ + background-image: url('../Images/gradient2.png'); + border-color: rgba(255, 255, 255, 0.2); + border-style: none solid solid solid; + border-bottom-left-radius: 6px; + border-bottom-right-radius: 6px; + border-width: 1px; + box-shadow: 0px 0px 2px rgba(0,0,0,0.5); + color: white; + font-size: 16px; + text-align: center; + display: inline-block; + min-width: 90px; + height: 19px; + margin-right: 5px; + padding: 2px 8px; + opacity: 0.9; + cursor: pointer; + vertical-align: bottom; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.ongletHaut:hover{ + background-color: rgba(0,180,255,0.3); +/* border-color: rgba(255, 255, 255, 0.6); */ + box-shadow:0px 0px 6px rgba(0,180,255,1), 0px 0px 3px rgba(0,0,0,1); + opacity: 1; +} +.ongletHaut:active{ + background-color: rgba(0,90,128,0.3); + box-shadow:0px 0px 6px rgba(0,90,128,1), 0px 0px 3px rgba(0,0,0,1); + position: relative; + color: rgba(255,255,255,0.8); + padding-top: 1px; + bottom: 1px; +} +.premierOngletHaut{ + font-weight: bold; + background-color: rgba(255,160,0,0.3); +} +.premierOngletHaut:hover{ + background-color: rgba(255,160,0,0.5); + box-shadow:0px 0px 6px rgba(255,160,0,1), 0px 0px 3px rgba(0,0,0,1); +} +.premierOngletHaut:active{ + background-color: rgba(128,80,0,0.5); + box-shadow:0px 0px 6px rgba(128,80,0,1), 0px 0px 3px rgba(0,0,0,1); +/* position: relative; */ +/* bottom: 1px; */ +} + +/* Bouton qui sert à choisir entre l'affichage 3D et 2D */ +#onglet3D{ + position: absolute; + top: 8px; + left: 538px; + width: 40px; + height: 19px; + padding-top: 2px; + color: white; + font-size: 16px; + text-align: center; + background-color: rgba(255,255,255,0); + background-image: url('../Images/gradient2.png'); +/* background-image: url("../Images/onglet1.png"); */ + border: 1px solid rgba(255,255,255,0.2); + border-bottom: none; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + box-shadow: 0px 0px 2px rgba(0,0,0,0.2); + cursor: pointer; + opacity: 0.8; + z-index: 3; +} +#onglet3D:hover{ + background-color: rgba(255, 255, 255, 0.2); + box-shadow: 0px 0px 4px rgba(255,255,255,1); + opacity: 1; +} +#onglet3D:active{ + background-color: rgba(255, 255, 255, 0.1); + box-shadow: 0px 0px 4px rgba(255,255,255,0.5); + top: 9px; + color: rgba(255,255,255,0.8); +} + +/* Petits boutons en haut à droite du widget */ +#topRightButtons{ + position: absolute; + right: 10px; + top: 3px; + z-index: 4; +} +.miniBouton{ + display: inline-block; + width: 12px; + height: 12px; + color: white; + font-size: 12px; + text-align: center; + background-color: rgba(255,255,255,0); + background-image: url('../Images/gradient.png'); + background-position: 0px 0px; + border: 1px solid rgba(255,255,255,0.5); + border-radius: 6px; + -webkit-border-radius: 6px; + box-shadow: 0px 0px 2px rgba(0,0,0,1); + cursor: pointer; + opacity: 0.5; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.miniBouton:hover{ + opacity: 1; + box-shadow: 0px 0px 4px rgba(255,255,255,1); +} +.miniBouton:active{ + box-shadow: 0px 0px 4px rgba(255,255,255,0.5); + border: 1px solid rgba(255,255,255,0.4); + width: 11px; + height: 11px; + font-size: 11px; + margin-left: 1px; +} + +/* Bouton permettant de minimiser et maximiser le widget */ +/* Non utilisé pour le moment...*/ +#miniMax{ + position: absolute; + left: 564px; + top: 3px; + z-index: 3; +} + +/* Boutons pour changer l'action de la souris*/ +#zoomButtons{ + position: absolute; + left: 13px; + top: 70px; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +#toolButtons{ + position: absolute; + left: 23px; + top: 103px; + padding: 2px; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +#toolButtons .toolButton{ + margin-bottom: 5px; + margin-top: 0px; +} +#toolButtons .toolButton:active{ + margin-bottom: 7px; +} + +.toolButton{ + margin-left: auto; + margin-right: auto; + width: 16px; + height: 16px; + color: white; + font-size: 14px; + text-align: center; + font-weight: bold; + background-color: rgba(255,255,255,0); + background-image: url('../Images/gradient.png'); + background-position: 0px 0px; + border: 1px solid rgba(255,255,255,0.5); + border-radius: 100%; + -webkit-border-radius: 10px; + box-shadow: 0px 0px 2px rgba(0,0,0,1); + cursor: pointer; + opacity: 0.5; +} +.toolButton:hover{ + opacity: 1; + box-shadow: 0px 0px 4px rgba(255,255,255,1); +} +.toolButton:active{ + box-shadow: 0px 0px 4px rgba(255,255,255,0.5); + border: 1px solid rgba(255,255,255,0.4); + width: 14px; + height: 14px; + font-size: 12px; + position: relative; + top: 1px; +} + +.toolButton.selectedTool{ +/* background-color: rgba(255,255,255,0); */ + background-color: rgba(0,180,255,0.3); + box-shadow:0px 0px 6px rgba(0,180,255,1), 0px 0px 3px rgba(0,0,0,1); + opacity: 0.7; +} + +.zoomButton{ + display: inline-block; + width: 22px; + height: 22px; + border-radius: 6px; + box-sizing: border-box; + padding: 2px; +} +.zoomButton:active{ + width: 20px; + height: 20px; + top: 0px; +} + +#zoomOut{ + border-top-right-radius: 0px; + border-bottom-right-radius: 0px; +} +#zoomOut:active{ + margin-left: 2px; +} + +#zoomIn{ + border-top-left-radius: 0px; + border-bottom-left-radius: 0px; +} + +.toolButton > .icon{ + background-size: 100%; + width: 100%; + height: 100%; +} + +#moveTool > .icon{ + background-image: url('../Images/move.png'); +} + +#tangentTool> .icon{ + background-image: url('../Images/tangent.png'); +} + +/* Joystick de déplacement */ +#zoneJoystick{ + position: absolute; + left: 8px; + top: 8px; + width: 50px; + height: 50px; + padding-left: 6px; + padding-top: 6px; +/* border: 1px solid green; */ + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + +} + +#joystick{ + width: 40px; + height: 40px; + color: white; + font-size: 14px; + text-align: center; + font-weight: bold; + background-color: rgba(255,255,255,0.2); + background-image: url('../Images/gradient4.png'); + background-position: 0px 0px; + border: 1px solid rgba(255,255,255,0.5); + border-radius: 25px; /*100% bug dans uniboard*/ + -webkit-border-radius: 25px; + box-shadow: 0px 0px 2px rgba(0,0,0,1); + cursor: pointer; + opacity: 0.5; +} +#joystick:hover{ + opacity: 1; + box-shadow: 0px 0px 2px rgba(255,255,255,1); +} +#joystick:active{ +/* box-shadow: 0px 0px 4px rgba(255,255,255,0.5); */ +/* border: 1px solid rgba(255,255,255,0.4); */ +/* width: 38px; */ +/* height: 38px; */ +/* font-size: 12px; */ +/* position: relative; */ +/* top: 1px; */ +/* left: 1px; */ +/* margin-bottom: 7px; */ +} +#joystick table{ + border-collapse: collapse; + width: 40px; + height: 40px; + font-size: 11px; +} +#joystick table tr td{ + padding: 0px; + text-shadow: 0px 0px 5px black; +/* border: 1px solid orange; */ + opacity: 0.5; +} +#joystick table tr td:hover{ + text-shadow: 0px 0px 3px white; + opacity: 1; +} +#joystick table tr td:active{ + opacity: 0.8; +} diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Style/Menus.css b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Style/Menus.css new file mode 100644 index 00000000..5a04ab64 --- /dev/null +++ b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Style/Menus.css @@ -0,0 +1,238 @@ +/* Style pour les menus */ +.menu{ + position: absolute; + top: 0%; + width: 100%; + max-width: 800px; + min-height: 411px; + max-height: 100%; + overflow: auto; + background-color: rgba(255, 255, 255, 0.7); + border-style: none; + border-width: 1px; + border-color: rgba(0,70,128, 0.9); + border-radius: 4px; + -webkit-border-radius: 4px; + z-index: 2; + display: none; + box-sizing: border-box; +} +.barreBasMenu{ + position: absolute; + bottom: 0px; +/* right: 0px; */ +} +.barreBasMenu > div{ + position: fixed; + width: 100%; + max-width: 800px; + box-sizing: border-box; + /* right: 0px; */ +/* bottom: 14px; */ +} +.barreBasMenu > div > div{ + position: absolute; + bottom: 0px; + right: 0px; + width: 100%; + box-sizing: border-box; + padding-right: 28px; +/* background-color: rgba(255,0,0,0.3); */ + text-align: right; +} +.contenuMenu{ + font-size: 14px; + padding: 15px; + padding-top: 40px; +/* overflow: auto; */ +/* height: 100%; */ +/* position: absolute; */ +/* top: 0px; */ +/* bottom: 0px; */ +} +.avecBordures{ +/* border-top: 1px solid rgba(255, 255, 255, 0.4); */ +/* height: 80% */ +} +.ongletMenu{ + position: fixed; +/* top: 0px; */ + width: 100%; + max-width: 800px; +/* height: 50px; */ +/* background-color: rgba(255,0,0,0.3); */ +/* border-spacing: 15px; */ + box-sizing: border-box; + padding-right: 14px; + text-align: center; + z-index: 1; +} +.ongletMenu > div{ +/* position: fixed; */ +/* width: inherit; */ +/* top: 0px; */ +/* left: 0px; */ +/* right: 0px; */ +} +.deuxOnglets span{ + width: 44%; +} +.troisOnglets span{ + width: 28%; +} +.ongletMenu span{ + display: inline-block; + min-width: 150px; + padding: 5px; + margin: 0px 7px; + text-align: center; + font-weight: normal; + background-color: rgba(255, 255, 255, 0.8); + background-image: url('../Images/gradient3.png'); + border: 1px solid rgba(255, 255, 255, 0.9); + border-top: none; + border-bottom-left-radius: 6px; + border-bottom-right-radius: 6px; + -webkit-border-bottom-left-radius: 6px; + -webkit-border-bottom-right-radius: 6px; + box-shadow: 0px 0px 3px rgba(0,0,0,0.5); + opacity: 0.7; + cursor: pointer; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.ongletMenu span.ongletMenuActuel{ + opacity: 0.9; + font-weight: bold; + background-color: rgba(255, 255, 255, 0.9); +} +.ongletMenu span:hover{ + opacity: 1; + box-shadow:0px 0px 3px rgba(0,0,0,0.5), 0px 0px 7px rgba(255,255,255,1); +} +.ongletMenu span:active{ + opacity: 0.7; + font-weight: bold; + box-shadow:0px 0px 3px rgba(0,0,0,0.5), 0px 0px 7px rgba(255,255,255,0.5); +} +.menu table.colonnes tr td{ + vertical-align: top; +} +.menu table.colonnes tr td{ + border-left: 1px solid rgba(255,255,255,0.5); + padding-left: 4px; +} +.menu table.colonnes tr td.premiereColonne{ + border: none; + padding-right: 4px; +} + + +.miniMenu{ + position: absolute; + top: 45%; + left: 50%; + margin-left: -160px; + margin-top: -120px; + width: 320px; + min-height: 240px; + padding: 5px; + text-align: center; + font-size: 14px; + overflow: auto; + background-color: rgba(255, 255, 255, 0.6); + background-image: url('../Images/gradient2.png'); + background-size: 100% 100%; + box-shadow: 0px 0px 5px rgba(0,0,0,0.5); + border-style: solid; + border-width: 1px; + border-color: rgba(255,255,255, 0.5); + border-radius: 8px; + -webkit-border-radius: 8px; + z-index: 2; + display: none; +} +.alertMenu{ + position: absolute; + top: 126px; + left: 206px; + width: 220px; + height: 140px; + padding: 10px; + text-align: center; + font-size: 14px; + overflow: auto; + background-color: rgba(255, 255, 255, 0.9); + background-image: url('../Images/gradient2.png'); + background-size: 100% 100%; + border-style: solid; + border-width: 1px; + border-color: rgba(0,70,128, 0.9); + border-radius: 15px; + -webkit-border-radius: 15px; + z-index: 3; + display: none; +} +.miniMenu select{ +/* width: 65px; */ +} +.miniMenu input{ + width: 45%; + height: 32px; +} +.miniMenu input.smallInput{ + width: 45%; + height: 16px; +} +.alertMenu input{ + width: 45%; + height: 32px; +} + + +/* Menu "à propos" */ +#credits{ + width: 80%; + margin: auto; + margin-top: 10px; +} +#credits tr td{ + padding: 10px; + width: 100%; + height: 150px; + text-align: center; + text-shadow: 2px 2px 6px rgba(255,255,255,1); + vertical-align: middle; + background-color: rgba(255,220,150,0.5); + background-image: url('../Images/gradient2.png'); + background-size: 100% 100%; + border: 1px solid rgba(255,230,150,0.6); + border-radius: 10px; + -webkit-border-radius: 10px; + box-shadow: 0px 0px 8px rgba(140,70,0,0.5) ; +} +#credits tr td img{ + float: left; + margin-top: 20px; + margin-bottom: 20px; +} +#credits tr td a{ + font-size: 80%; +} +#credits tr td h3{ + text-align:center; +} + +#saveImageContent{ + width: 100%; + height: 100%; + box-sizing: border-box; + padding-bottom: 30px; +} +#saveImageContent img{ + max-width: 100%; + max-height: 100%; +} diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Style/Widget.css b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Style/Widget.css new file mode 100644 index 00000000..ae120352 --- /dev/null +++ b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/Style/Widget.css @@ -0,0 +1,659 @@ +body{ + background-color: transparent; + font-family: Sans-Serif; +} +table tr td{ + padding: 0px; +} + +/* Widget background */ +html, body{ + height: 100%; + margin: 0px; +} + +#background{ + width: 100%; + height: 100%; + border-spacing: 0; + border-collapse: collapse; +} +.background-border-x{ + height: 14px; + padding: 0px; + background-color: "black"; +} +.background-border-y{ + width: 14px; + padding: 0px; + background-color: "black"; +} +#background-top-left{ + background-image: url('../Images/darkblue/top-left.png'); + background-size: 100% 100%; +} +#background-top{ + background-image: url('../Images/darkblue/top.png'); + background-size: 100% 100%; +} +#background-top-right{ + background-image: url('../Images/darkblue/top-right.png'); + background-size: 100% 100%; +} +#background-bottom-left{ + background-image: url('../Images/darkblue/bottom-left.png'); + background-size: 100% 100%; +} +#background-bottom{ + background-image: url('../Images/darkblue/bottom.png'); + background-size: 100% 100%; +} +#background-bottom-right{ + background-image: url('../Images/darkblue/bottom-right.png'); + background-size: 100% 100%; +} +#background-left{ + background-image: url('../Images/darkblue/left.png'); + background-size: 100% 100%; +} +#background-right{ + background-image: url('../Images/darkblue/right.png'); + background-size: 100% 100%; +} +#background-center{ + background-image: url('../Images/darkblue/center.png'); + background-size: 100% 100%; + height: 100%; + padding-top: 30px; + position: relative; +} + +/* Widget center */ +#widgetCenter{ + height: 100%; + position: relative; +} + +/* Zone d'affichage des fonctions */ +#eventAffichage{ + height: 100%; + position: relative; +} +#eventAffichage canvas{ + display: block; +} +#affichage{ + height: 100%; + box-sizing: border-box; + overflow: hidden; + border: 1px solid rgba(255,255,255,0.5); + border-radius: 5px; + -webkit-border-radius: 5px; +} +#affichageOutils{ + position: absolute; + top: 0px; + box-sizing: border-box; + height: 100%; + width: 100%; +} + +#divInputRapide{ + display: none; + position: absolute; + top: 11px; + left: 108px; + padding: 3px; + color: white; + text-align: center; + border: 1px solid rgba(255,255,255,0.2); + border-radius: 5px; + -webkit-border-radius: 5px; + box-shadow: 0px 0px 2px rgba(0,0,0,0.5); + background-image: url('../Images/gradient3.png'); + background-color: rgba(255,255,255,0.1); + background-size: 100% 100%; + z-index: 2; +} +#inputRapide{ + width: 270px; +} + +#menuFonctions3D{ + position: absolute; + top: 11px; + left: 108px; + padding: 3px; + color: white; + text-align: center; + border: 1px solid rgba(255,255,255,0.2); + border-radius: 5px; + -webkit-border-radius: 5px; + box-shadow: 0px 0px 2px rgba(0,0,0,0.5); + background-image: url('../Images/gradient3.png'); + background-color: rgba(255,255,255,0.1); + background-size: 100% 100%; + z-index: 2; +} +#input3D{ + width: 265px; +} + +/* Messages */ +#divMessages div{ + position: absolute; + background-image: url('../Images/cursor.png'); + background-repeat: no-repeat; + z-index: 4; + pointer-events: none; + min-height: 24px; +} +#divMessages div span{ + position: relative; + left: 19px; + top: 20px; + padding: 2px; + color: white; + font-size: 11px; + text-align: center; + border: 1px solid rgba(255,255,255,0.2); + border-radius: 5px; + -webkit-border-radius: 5px; + box-shadow: 0px 0px 2px rgba(0,0,0,0.5); + text-shadow: 0px 0px 3px rgba(0,165,255,0.7); + background-image: url('../Images/gradient2.png'); + background-color: rgba(0,86,134,0.6); + pointer-events: auto; +} +#divMessages div span a{ + color : rgb(135,210,255); + cursor: pointer; +} +#divMessages div span a:hover{ + color : rgb(110,200,255); + text-decoration: underline; + text-decoration-style: dotted; +} + + +/* Taille standard des boutons*/ +.bouton{ + /*width: 100px;*/ + height: 25px; + font-size: 12px; +} + +/* Boutons qui sont dans la partie gauche et qui ouvrent les différents menus */ +.boutonGauche{ + width: 100%; + height: 32px; + text-align: center; +} + +/* Aperçu couleur 3D*/ +#apercuCouleur3D{ + border: 1px solid rgba(0, 0, 0, 0.7); + border-radius: 4px; + -webkit-border-radius: 4px; +} + +/* Taille des champs contenant seulement 2 ou 3 caractères */ +.smallInput{ + width: 35px; +} +.mediumInput{ + width: 45px; +} + + +/* Boutons qui ouvrent le ColorPicker */ +.boutonCouleur{ + position: relative; + left: 2px; + top: 4px; + width: 15px; + height: 15px; + border: 1px solid rgba(0,0,0,0.5); + border-radius: 5px; + -webkit-border-radius: 5px; + background-color: rgba(0,128,255,0.8); + display: inline-block; + cursor:pointer; + opacity: 0.7; +} +.boutonCouleur:hover{ + box-shadow: 0px 0px 2px rgba(0,128,255,1); + opacity: 1; +} + +/* Texte d'information (plus petit) */ +.texteSecondaire{ + font-size: 11px; + color: rgba(0,0,0,0.5); + margin-left: 10px; +} + +/* Style pour le texte où on peut cliquer dessus */ +.survol{ + cursor: pointer; + color: rgb(0,70,120); +} +.survol:hover{ + color: rgb(0,110,150); + opacity: 0.7; +/* text-shadow: 0px 0px 3px white; */ +} + +/* Texte en gras */ +.gras{ + font-weight: bold; +} + +/* Flèches permettant de deplacer l'affichage */ +.flecheDeplacement{ + color: black; + text-shadow: 0px 0px 20px rgba(255,255,255,1); + opacity: 0; + font-size: 56px; + text-align: center; + cursor: pointer; + z-index: 1; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.flecheDeplacement:hover{ + opacity: 0.4; +} +.flecheDeplacement:active{ + opacity: 0.3; +} +#flecheHaut{ + position: absolute; + top: 15px; + left: 50%; + margin-left: -35px; + width: 70px; + height: 55px; +} +#flecheBas{ + position: absolute; + bottom: 20px; + left: 50%; + margin-left: -35px; + width: 70px; + height: 55px; +} +#flecheGauche{ + position: absolute; + top: 50%; + margin-top: -36px; + left: 15px; + width: 55px; + height: 70px; +} +#flecheDroite{ + position: absolute; + top: 50%; + margin-top: -36px; + right: 15px; + width: 55px; + height: 70px; +} + + +/* Boutons permettant de choisir l'action de la souris dans le menu des outils */ +.choixOutil{ + width: 125px; + height: 40px; + font-size: 14px; + cursor: pointer; +} + + +/* Petits boutons plus et moins dans les options */ +.boutonPlus{ + position: relative; + top: -7px; + left: -5px; + width: 10px; + height: 10px; + font-size: 9px; + text-align: center; + background-color: rgba(0, 140, 255, 0.2); + border: 1px rgba(0,0,0,0.5) solid; + border-radius: 3px; + -webkit-border-radius: 3px; + cursor: pointer; + display: inline-block; +} +.boutonMoins{ + position: relative; + top: 6px; + left: -17px; + width: 10px; + height: 10px; + font-size: 9px; + text-align: center; + background-color: rgba(0, 140, 255, 0.2); + border: 1px rgba(0,0,0,0.5) solid; + border-radius: 3px; + -webkit-border-radius: 3px; + cursor: pointer; + display: inline-block; +} +.boutonPlus:hover{ + border: 1px rgba(0,0,0,0.7) solid; + background-color: rgba(0, 140, 255, 0.5); +} +.boutonMoins:hover{ + border: 1px rgba(0,0,0,0.7) solid; + background-color: rgba(0, 140, 255, 0.5); +} + + + +/* Menu etudes fonctions*/ +#menuEtude p{ + margin-top: 7px; + margin-bottom: 0px; +/* font-weight: bold; */ +} +#menuEtude span{ +/* font-weight : normal; */ +} +/* Tableau du signe dans le menu d'étude de la fonction*/ +#etudeSigne{ +/* border-collapse: collapse; */ + border-spacing: 0px; +} +#etudeSigne td{ + min-width: 25px; + text-align: center; + padding: 0px; +} +#etudeSigne td.premier{ + font-weight: bold; +} +#etudeSigne td.bordure{ + border: 1px solid black; + border-radius: 3px; + -webkit-border-radius: 3px; +} +#etudeSigne td.fondNoir{ + background-color: rgba(0,0,0,0.5); +} + +/* Titres des menus */ +h1{ + font-size: 16px; + font-weight: 600; + text-align: center; + /*font-style: italic;*/ + margin-top: 15px; + margin-bottom: 25px; +} +h2{ + font-size: 14px; + font-weight: normal; + font-style: italic; + margin-top: 30px; +} +h3{ + font-size: 16px; + font-weight: 600; + text-align: left; + /*font-style: italic;*/ + margin-top: 7px; + margin-bottom: 20px; +} +h4{ + font-size: 16px; + font-weight: 600; + text-align: center; + /*font-style: italic;*/ + margin-top: 15px; + margin-bottom: 10px; +} + + +/* Menu Mise à Jour */ +#mAj{ + text-align: center; + font-size: 14px; +} +#mAj h1{ + font-size: 22px; + margin-top: 5px; + margin-bottom: 15px; +} +#mAj span object{ + position: relative; + bottom: 4px; + width: 150px; + height: 27px; + overflow: hidden; +} +#mAj input{ + min-height: 27px; +} + +.boutonSauvegarde{ + width: 100px; + height: 32px; +} +#cacheCookies{ + position: absolute; + top: 150px; + left: 10px; + width: 93%; + height: 150px; + background-color: rgba(255,255,255,0.7); + border: 1px rgba(255,255,255,0.8) solid; + border-radius: 3px; + -webkit-border-radius: 3px; + text-align: center; + display: none; +} +#cacheMaJ{ + position: absolute; + padding-top: 20px; + padding-bottom: 10px; + top: 250px; + left: 14px; + width: 93%; + height: 25px; + background-color: rgba(255,255,255,0.8); + border: 1px rgba(255,255,255,0.8) solid; + border-radius: 3px; + -webkit-border-radius: 3px; + text-align: center; + font-weight: bold; + display: none; +} + +/* Menu clique droite sur le graphique */ +#ctxMenu{ + position: absolute; + border: 1px solid black; + border-radius: 5px; + background-color: rgba(255,255,255,0.8); + box-shadow: 0px 0px 5px rgba(0,64,126,0.5); + font-size: 12px; + padding: 2px; + z-index: 2; + display: none; +} +#ctxMenu input.bouton{ + width: 140px; + height: 25px; +} +#ctxMenu h1{ + font-size: 14px; + text-align: center; + text-decoration: underline; + text-shadow: 0px 0px 4px rgba(0,100,200,0.7); + margin: 3px; +} +#ctxMenu div.fermer{ + position: absolute; + right: 0px; + top: 0px; + width: 10px; + height: 10px; + font-size: 10px; + cursor: pointer; + opacity: 0.7; +} +#ctxMenu div.fermer:hover{ + text-shadow: 0px 0px 2px rgba(0,128,255,1); + opacity: 1; +} +.miniCouleur{ + display: inline-block; + width: 10px; + height: 10px; + border: 1px solid rgba(0,0,0,0.5); + border-radius: 3px; + background-color: rgba(0,128,255,0.8); + cursor: pointer; + opacity: 0.7; +} +.miniCouleur:hover{ + box-shadow: 0px 0px 2px rgba(0,128,255,1); + opacity: 1; +} + +/* Editeur de fonctions dans le menu + */ +#functionMenuRight{ + position: absolute; + right: 15px; + width: 45%; + box-sizing: border-box; +} +#functionMenuLeft{ + max-width: 50%; +/* min-height: 400px; */ + box-sizing: border-box; +} +#fonctionsSupp{ + width: 100%; + min-height: 305px; +/* height: 245px; */ +/* border: 1px solid blue; */ + overflow: auto; +} +.spanFonction{ +/* width: 320px; */ + border: 1px solid rgba(0,0,0,0.3); + border-radius: 5px; + background-color: rgba(255,255,255,0.2); + background-image: url('../Images/gradient2.png'); + background-position: 0px -2px; + box-shadow: 0px 0px 4px rgba(0,64,126,0.2); + padding: 2px; + margin: 4px; + font-weight: bold; + text-align: center; + overflow: hidden; + cursor: pointer; +} +.spanFonction:hover{ + background-color: rgba(164,228,255,0.2); + box-shadow: 0px 0px 2px rgba(0,150,255,0.6); +} +.spanFonctionSelect{ + background-color: rgba(118,214,255,0.4); + border-color: rgba(0,63,126,0.3); +} +.spanFonctionSelect:hover{ + background-color: rgba(118,214,255,0.6); +} +#editeurFonction{ +/* position: absolute; */ +/* right: 15px; */ +/* top: 45px; */ + min-width: 300px; +/* height: 75%; */ + border: 1px solid rgba(255,255,255,0.7); +/* border-top: 1px solid rgba(255,255,255,0.3); */ + border-radius: 5px; + background-color: rgba(255,255,255,0.2); + background-image: url('../Images/gradient2.png'); + background-size: 100% 100%; + box-shadow: 0px 0px 4px rgba(0,64,126,0.2); + font-size: 12px; + padding: 2px; +} +#editeurApercu{ + position: relative; + display : block; + margin : auto; + width: 100px; + height : 80px; + border: 1px solid white; + border-radius: 3px; + background-color: rgba(255,255,255,0.8); + box-shadow: 0px 0px 2px rgba(0,64,126,0.5); + font-size: 12px; + padding: 2px; +} +.editeurOnglets{ + position: relative; + bottom: 3px; + width: 100%; + text-align: center; +} +.editeurOnglets span{ + display: inline-block; + min-width: 70px; + width: 40%; + padding: 5px; + margin: 0px 2px; + text-align: center; + font-weight: normal; + background-color: rgba(255, 255, 255, 0.7); + background-image: url('../Images/gradient3.png'); + border: 1px solid rgba(255, 255, 255, 0.9); + border-top: 1px solid white; + border-bottom-left-radius: 6px; + border-bottom-right-radius: 6px; + -webkit-border-bottom-left-radius: 6px; + -webkit-border-bottom-right-radius: 6px; + box-shadow: 0px 0px 3px rgba(0,0,0,0.5); + opacity: 0.5; + cursor: pointer; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.editeurOnglets span.ongletActuel{ + opacity: 0.8; + font-weight: bold; +} +.editeurOnglets span:hover{ + opacity: 1; + box-shadow:0px 0px 3px rgba(0,0,0,0.5), 0px 0px 7px rgba(255,255,255,1); +} +.editeurOnglets span:active{ + opacity: 0.7; + font-weight: bold; + box-shadow:0px 0px 3px rgba(0,0,0,0.5), 0px 0px 7px rgba(255,255,255,0.5); +} + +#divSuppOutil div{ + position: absolute; + width: 10px; + height: 10px; + font-size: 10px; + cursor: pointer; + opacity: 1; + z-index: 1; +} +#divSuppOutil div:hover{ + color: rgb(200,0,0); +} diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/config.xml b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/config.xml new file mode 100755 index 00000000..dcac2d1a --- /dev/null +++ b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/config.xml @@ -0,0 +1,10 @@ + + + Mathematical function plotter + + diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/icon.png b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/icon.png new file mode 100644 index 00000000..57e41ab8 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/icon.png differ diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/version.html b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/version.html new file mode 100644 index 00000000..1f113fd2 --- /dev/null +++ b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/version.html @@ -0,0 +1,11 @@ + + + + + + GraphMe - Version + + + 2.1.0 (2018-06-04) + + diff --git a/resources/library/applications/GraphMe.wgt/GraphMe.wgt/version.txt b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/version.txt new file mode 100644 index 00000000..17984092 --- /dev/null +++ b/resources/library/applications/GraphMe.wgt/GraphMe.wgt/version.txt @@ -0,0 +1,294 @@ + + ██████ ███ ███ + ██ ██████ █████ ██████ ██ ██ ████ ████ ███████ + ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██ ██ + ██ ███ ███████ ███████ ██████ ███████ ██ ██ ██ █████ + ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ + ██████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ███████ + + +---- 2.1 ---- + +Général: + - Résolution de bugs avec l'historique des fonctions + - Reprogrammation de la liste des fonctions + - Gestion des erreurs lors de la restauration de l'état sauvegardé + - Sauvegarde du mode d'affichage en cours, 3D ou 2D + - Sauvegarde de l'état de la liste des fonctions + - Sauvegarde de l'outil sélectionné + - Icône du widget amélioré pour OpenBoard + +Interface: + - Amélioration de l'interface pour le changelog et l'aide + - Masquage des boutons de l'affichage en plein à écran avec OpenBoard + - Amélioration de l'affichage des fonctions dans l'historique + - Message d'info au chargement du widget en cas de fonctions restaurées + - Thème bleu foncé avec les coins carrés + +Outils: + - Correction des outils décalés par rapport à la souris + + +---- 2.0.x ---- + + - (2.0.2) Amélioration de la sauvegarde du graphique en image: + affichage de l'image générée dans un menu + - (2.0.1) Cacher les nouveaux boutons de zoom en mode affichage 3D + - Bug: Impossible de changer de thème avec OpenBoard + - Bug: Les fonctions d'exemple ne fonctionnent pas si un autre type + que cartésien est sélectionné dans l'interface des fonctions + + +---- 2.0 ---- + +Général: + - Nouvelle interface adaptive selon la taille de la fenêtre + - Bug: Passer de 3D à 2D essaie de dessiner la fonction 3D en 2D + - Mettre en évidence l'outil sélectionné + - Boutons de zoom + - Historique des dernières fonctions pour tous les types de fonction + - Réinitialisation des inputs quand la page est actualisée + - Sauvegarde de l'état des inputs et de l'historique + + +---- 1.6 ---- + +Fonctions: + - Fonctions implicites (Par exemple un cercle: y^2 + x^2 = 9) + - Fonctions polaires (Par exemple une spirale: r(t) = t) + - Fonctions paramétriques (Par exemple un cercle: x(t) = cos(t) et y(t) = sin(t)) + +Interface: + - Traduction anglais/français selon la langue du navigateur + - Police d'écriture sans-serif + - Aperçu des fonctions implicites, polaires et paramétriques + - Dans la liste des fonctions, afficher la fonction ouverte dans l'éditeur + - Bug: L'éditeur permet d'éditer une fonction alors que la liste est vide + - Bug: Le choix du style de ligne par défaut ne fonctionne pas + - Bug: Bouton non cliquable près d'un message d'aide + +Outils: + - Outil point et tangente pour les fonctions polaires et paramétriques. + + +---- 1.5.x ---- + + - (1.5.1) Sauvegarde du graphique 3D + - Amélioration du menu des mises à jour, prise en compte de tous les serveur + - Menu pour afficher les options sauvegardées dans les cookies + - Correction des problèmes de l'échelle et de la grille du graphique + - Bug: L'outil déplacement est stoppé quand on passe sur une flèche de déplacement + + +---- 1.5 ---- + +Fonction: + - Pouvoir changer le style de chaque fonction (ligne, points, traits) + - Bug: l'outil déplacement est toujours actif quand on sort du graphique + - Bug: le bouton dupliquer dans l'éditeur fonctionne mal + - Condition initiale de la primitive à coté de F(x) dans l'éditeur + (utilisation de disabled="disabled" lorsque F(x) n'est pas coché) + - Bug: impossible de modifier la fonction principale avec l'éditeur de fonctions + - Nouveau menu pour modifier les valeurs par défaut des fonctions + +Affichage 3D: + - La partie de la fonction éloignée est maintenant dessinée après la partie proche + - La grille est plus visible + +Outils: + - Suppression du menu des outils + - Outils pour chaque fonction dans le menu "fonctions" + +Interface: + - Nouvelle interface. Onglets en haut du widget. Boutons "animés" + - Modifier l'aide pour qu'elle corresponde à la nouvelle interface + - Suppression de la sélection du texte sur les boutons et les onglets + - Joystick de déplacement en haut à gauche de l'affichage + - Choix des outils à la souris plus facile (ajout de boutons à gauche de l'affichage) + - Zone de texte au millieu de l'écran pour écrire facilement la première fonction + Focus automatique sur la zone + - Bulles d'aide + + +---- 1.4.x ---- + + - (1.4.3) ColorPicker: Récupérer la bonne couleur lors de l'ouverture + - ColorPicker: Pouvoir changer la couleur à partir des inputs + - ColorPicker: Choisir la couleur avec la roulette de la souris + - (1.4.2) Amélioration de la qualité et de la rapidité des études de fonction + - Pouvoir choisir la fonction à étudier + - Bug: impossible de modifier les fonctions depuis l'éditeur + - (1.4.1) Choisir la taille et la couleur de fond du graphique sauvegardé + - L'utilisation de ^ dans les fonctions n'est possible qu'avec un chiffre. + Il faudrait pouvoir écrire 2^x ou 4^(x+2) + - Bug: fermer le menu clique droit ajoute un point sur le graphique + + +---- 1.4 ---- + +Fonctions: + - Affichages canvas, svg et uniboard complétement refaits + - Grande amélioration des perfomances d'affichage 2D et 3D en définissant + les fonctions avec "new Function()" + - Amélioration des fonctions supplémentaires + - Suppression de la méthode d'affichage xpm + - Style de la fonction (continu, points, traits) + - Bug: la fonction 3D "sin(x)+cos(y)" afficher l'erreur "y is not defined"; + - Couleur aléatoire pour les nouvelles fonctions supplémentaires + +Interface: + - Menu clique droite sur le graphique + - Fenêtre d'édition des fonctions supplémentaires + - Désactiver le bouton de mise à jour automatique lorsqu'on utilise la version online du widget + (utiliser disabled="disabled") + +Outils: + - Outils pour le nouvel affichage + - Outil point refait avec canvas + - Déplacer les informations des outils (point et tangente) à coté de la souris + - Bug: le déplacement de l'affichage 3D à la souris va dans le mauvais sens + - Cliquer permet de conserver le point ou la tangente actuelle + - Tous les outils fonctionnent en plein écran + - Outils sur plusieurs fonctions + +ColorPicker: + - Bug: mauvaise couleur lorsque la teinte est à 240 ou 120 + +Général: + - Abandon du format xhtml pour passer à l'html5 + - Sauvegardes pour les nouvelles options + - Amélioration des messages d'erreur + - Amélioration du système de mise à jour + + +---- 1.3.x ---- + + - (1.3.4) ColorPicker: Slide barre permettant de changer la transparence + - ColorPicker: Reprogrammer en canvas + - (1.3.3) Sauvegarde du graphique + - Remplacer les ^ par pow() pour pouvoir écrire des fonctions plus facilement, + comme x^2 ou (4-x)^5 + - La couleur des fonctions supplémentaires n'est pas toujours juste + - (1.3.2) Modification de la taille des boutons + - (1.3.1) Mise à jour automatique + + +---- 1.3 ---- + +Fonctions: + - Amélioration des études de fonctions + - Pouvoir dessiner la dérivée seconde + - Corriger la tangente lorsque la zone d'affichage est modifiée + - Corriger l'échelle lors du déplacement de la fonction + - Ajout des fonctions sec, csc, arcsec, arccsc, sinh, cosh, tanh, coth, sech, csch + ainsi que arcsinh, arccosh, arctanh et arccoth + - Supprimer les traits où la fonction n'est pas définie + - Corriger l'outil point sur certaines fonctions (root(x,4)) + (problème lié à la fonction non-définie) + - Aire sous la fonction + - Corrigé bug canvas lors de l'agrandissement + - Les outils de la souris ne fonctionnent pas au survol des flèches de déplacement + +Interface: + - Sauvegarder les options + - Explication de la sauvegarde du graphique dans l'aide + - Guide d'utilisation + - Corrections dans l'aide + +ColorPicker: + - Aperçu de la couleur + +Autres: + - Modification de la précision par défaut + + +---- 1.2 ---- + +Fonctions: + - Dessiner plusieurs fonctions + - Historique + - Bug: certaines fonctions ne s'affichent pas correctement + exemples: pow(1-x*x*x, 1/3) , pow(x*x*x-3*x, 1/3) , pow(x*x*x-3*x+2, 1/3) + - Corriger l'affichage de la dérivée lorsqu'on change la précision d'affichage + - Corriger l'affichage des coordonnées + - Gestion des erreurs avec try and catch + - Outil tangente + +Interface: + - Défilement des menus + - Tests d'affichage + - Bouton de maximisation du widget + - Mise à Jour + + +Affichage 3D: + - Zoom + + + +------------------------------- + Idées d'améliorations futures +------------------------------- + +Fonctions: + - Ajouter les fonctions arcsech et arccsch + - Détecter et mettre en évidence les AV + - Progression pendant le calcul des fonctions 3D + - Progression pendant l'étude de fonction + - Écrire le nom de la fonction sur le graphique + - Récupérer la fonction à partir de l'URL, pour pouvoir + envoyer le lien d'une fonction à qqn + - Bug: la puissance de la fonction sin(x)*cos(x)^2 n'est pas remplacée juste + - Sauvegarder l'historique + - Afficher le type de fonction dans l'éditeur + - Ne pas choisir aléatoirement la même couleur qu'une couleur déjà utilisée + - Amélioration du dessin des fonctions implicites + - Aperçu des fonctions d'exemple avant de les ajouter au graphique + +Fonction 3D: + - Amélioration du choix de la couleur (interpolation entre 2 couleurs) + - Affichage 3D avec WebGL + +Outils: + - Outils point et tangente pour les fonctions implicites + - Personnalisation de la sauvegarde du graphique + - Magnétisme de l'outil point + - Calculer le volume du corps de rotation de la fonction + - Outil affichant le cercle tangent à la courbe (selon la seconde dérivée) + - Utiliser le point de la fonction le plus proche de la position de la souris + +Affichage: + - Style de grille: quadrillée, polaire, aucune + - Mode "trigonomètrique" pour que l'échelle soit affichée sur des multiples de PI + - Mode d'affichage ASCII + +Affichage uniboard: + - Finir de coder + - Choisir où placer le graphique + - Uniboard 3D + +Interface: + - Option pour redimensionner le widget dans OpenBoard / Sankoré + - Bulles d'aide + - Scroll dans uniboard + - Menu clique droit dans uniboard + - Le bouton actualiser dans le menu étude n'actualise pas forcément la bonne fonction + - Icone du bouton sauvegarder + - Cacher le joystick et les boutons des outils en mode plein écran après 5s + +ColorPicker: + - Dessiner avec svg lorsqu'on choisit svg dans les options + - Vérifier les valeurs entrées dans les inputs + - Annuler le choix de la couleur ne revient pas au menu précédent + +Général: + - Récupérer le numéro de la version en ligne pour comparer les versions + - Multithreading +!- Rendu des dessins progressivement de plus en plus précis + - Sauvegarder les options automatiquement, bouton reset dans le menu GraphMe + +Script portable: + - Créer un script pour intégrer le widget à n'importe quelle page web + - Personnalisation de la taille du widget portable + - Déplacement du widget comme une fenêtre + diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/._GraphMe.wgt b/resources/library/applications/GraphMe.wgt/__MACOSX/._GraphMe.wgt new file mode 100644 index 00000000..9737ab1e Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/._GraphMe.wgt differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/._Grapheur.html b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/._Grapheur.html new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/._Grapheur.html differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/._Guide_Utilisateur.html b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/._Guide_Utilisateur.html new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/._Guide_Utilisateur.html differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/._Images b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/._Images new file mode 100644 index 00000000..9737ab1e Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/._Images differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/._JavaScript b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/._JavaScript new file mode 100644 index 00000000..9737ab1e Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/._JavaScript differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/._Style b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/._Style new file mode 100644 index 00000000..9737ab1e Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/._Style differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/._config.xml b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/._config.xml new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/._config.xml differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/._icon.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/._icon.png new file mode 100644 index 00000000..ffec2812 Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/._icon.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/._version.html b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/._version.html new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/._version.html differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/._version.txt b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/._version.txt new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/._version.txt differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._.directory b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._.directory new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._.directory differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._GraphMe.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._GraphMe.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._GraphMe.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._Guide_AjouterWidget.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._Guide_AjouterWidget.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._Guide_AjouterWidget.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._Guide_Deplacement.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._Guide_Deplacement.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._Guide_Deplacement.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._Guide_Navigateur.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._Guide_Navigateur.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._Guide_Navigateur.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._Guide_Options.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._Guide_Options.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._Guide_Options.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._Guide_Plus.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._Guide_Plus.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._Guide_Plus.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._Guide_Presentation.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._Guide_Presentation.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._Guide_Presentation.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._Guide_Uniboard.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._Guide_Uniboard.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._Guide_Uniboard.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._black b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._black new file mode 100644 index 00000000..9737ab1e Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._black differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._blue b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._blue new file mode 100644 index 00000000..9737ab1e Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._blue differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._cursor.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._cursor.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._cursor.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._darkblue b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._darkblue new file mode 100644 index 00000000..9737ab1e Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._darkblue differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._gradient.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._gradient.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._gradient.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._gradient1.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._gradient1.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._gradient1.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._gradient2.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._gradient2.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._gradient2.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._gradient3.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._gradient3.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._gradient3.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._gradient4.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._gradient4.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._gradient4.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._mini_icon.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._mini_icon.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._mini_icon.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._move.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._move.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._move.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._onglet1.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._onglet1.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._onglet1.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._onglet2.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._onglet2.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._onglet2.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._tangent.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._tangent.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._tangent.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._white b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._white new file mode 100644 index 00000000..9737ab1e Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/._white differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/black/._bottom-left.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/black/._bottom-left.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/black/._bottom-left.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/black/._bottom-right.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/black/._bottom-right.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/black/._bottom-right.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/black/._bottom.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/black/._bottom.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/black/._bottom.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/black/._center.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/black/._center.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/black/._center.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/black/._left.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/black/._left.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/black/._left.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/black/._right.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/black/._right.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/black/._right.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/black/._top-left.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/black/._top-left.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/black/._top-left.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/black/._top-right.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/black/._top-right.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/black/._top-right.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/black/._top.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/black/._top.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/black/._top.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/blue/._bottom-left.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/blue/._bottom-left.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/blue/._bottom-left.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/blue/._bottom-right.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/blue/._bottom-right.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/blue/._bottom-right.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/blue/._bottom.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/blue/._bottom.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/blue/._bottom.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/blue/._center.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/blue/._center.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/blue/._center.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/blue/._left.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/blue/._left.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/blue/._left.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/blue/._right.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/blue/._right.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/blue/._right.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/blue/._top-left.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/blue/._top-left.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/blue/._top-left.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/blue/._top-right.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/blue/._top-right.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/blue/._top-right.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/blue/._top.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/blue/._top.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/blue/._top.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/darkblue/._bottom-left.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/darkblue/._bottom-left.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/darkblue/._bottom-left.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/darkblue/._bottom-right.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/darkblue/._bottom-right.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/darkblue/._bottom-right.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/darkblue/._bottom.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/darkblue/._bottom.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/darkblue/._bottom.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/darkblue/._center.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/darkblue/._center.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/darkblue/._center.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/darkblue/._left.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/darkblue/._left.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/darkblue/._left.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/darkblue/._right.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/darkblue/._right.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/darkblue/._right.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/darkblue/._top-left.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/darkblue/._top-left.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/darkblue/._top-left.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/darkblue/._top-right.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/darkblue/._top-right.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/darkblue/._top-right.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/darkblue/._top.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/darkblue/._top.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/darkblue/._top.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/white/._bottom-left.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/white/._bottom-left.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/white/._bottom-left.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/white/._bottom-right.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/white/._bottom-right.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/white/._bottom-right.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/white/._bottom.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/white/._bottom.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/white/._bottom.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/white/._center.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/white/._center.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/white/._center.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/white/._left.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/white/._left.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/white/._left.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/white/._right.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/white/._right.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/white/._right.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/white/._top-left.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/white/._top-left.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/white/._top-left.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/white/._top-right.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/white/._top-right.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/white/._top-right.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/white/._top.png b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/white/._top.png new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Images/white/._top.png differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._.directory b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._.directory new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._.directory differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Affichage.js b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Affichage.js new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Affichage.js differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Affichage3D.js b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Affichage3D.js new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Affichage3D.js differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._AffichageSVG.svg b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._AffichageSVG.svg new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._AffichageSVG.svg differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._AffichageUniboard.js b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._AffichageUniboard.js new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._AffichageUniboard.js differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._CartesianFunction.js b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._CartesianFunction.js new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._CartesianFunction.js differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._ColorPicker.js b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._ColorPicker.js new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._ColorPicker.js differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Editeur.js b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Editeur.js new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Editeur.js differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Etudes.js b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Etudes.js new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Etudes.js differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Fonction.js b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Fonction.js new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Fonction.js differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._ImplicitFunction.js b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._ImplicitFunction.js new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._ImplicitFunction.js differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Interface.js b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Interface.js new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Interface.js differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Languages.js b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Languages.js new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Languages.js differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Outils.js b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Outils.js new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Outils.js differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._ParametricFunction.js b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._ParametricFunction.js new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._ParametricFunction.js differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._PolarFunction.js b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._PolarFunction.js new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._PolarFunction.js differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Sauvegardes.js b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Sauvegardes.js new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Sauvegardes.js differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Souris.js b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Souris.js new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Souris.js differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Utils.js b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Utils.js new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Utils.js differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Widget.js b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Widget.js new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/JavaScript/._Widget.js differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Style/._ColorPicker.css b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Style/._ColorPicker.css new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Style/._ColorPicker.css differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Style/._Guide_Utilisateur.css b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Style/._Guide_Utilisateur.css new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Style/._Guide_Utilisateur.css differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Style/._Haut.css b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Style/._Haut.css new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Style/._Haut.css differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Style/._Menus.css b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Style/._Menus.css new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Style/._Menus.css differ diff --git a/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Style/._Widget.css b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Style/._Widget.css new file mode 100644 index 00000000..c6f58eaa Binary files /dev/null and b/resources/library/applications/GraphMe.wgt/__MACOSX/GraphMe.wgt/Style/._Widget.css differ diff --git a/resources/library/applications/QR-Code.wgt/config.xml b/resources/library/applications/QR-Code.wgt/config.xml new file mode 100644 index 00000000..12637bab --- /dev/null +++ b/resources/library/applications/QR-Code.wgt/config.xml @@ -0,0 +1,20 @@ + + + QR-Code + QR-Code erzeugen + + + Basil Stotz + + Creative Commons ShareAlike 3.0 + http://creativecommons.org/licenses/by-sa/3.0/ + + + + + diff --git a/resources/library/applications/QR-Code.wgt/design.css b/resources/library/applications/QR-Code.wgt/design.css new file mode 100644 index 00000000..cb60af93 --- /dev/null +++ b/resources/library/applications/QR-Code.wgt/design.css @@ -0,0 +1,23 @@ + +*{ + margin: 0; + padding: 0 ; +} + + + +img{ + width:200px; +} + +.hidden{ + display:none; +} + +.grey{ + background:lightgrey; +} + +.center{ + margin:auto; +} \ No newline at end of file diff --git a/resources/library/applications/QR-Code.wgt/icon.png b/resources/library/applications/QR-Code.wgt/icon.png new file mode 100644 index 00000000..5386b863 Binary files /dev/null and b/resources/library/applications/QR-Code.wgt/icon.png differ diff --git a/resources/library/applications/QR-Code.wgt/index.html b/resources/library/applications/QR-Code.wgt/index.html new file mode 100644 index 00000000..e3ef14d6 --- /dev/null +++ b/resources/library/applications/QR-Code.wgt/index.html @@ -0,0 +1,26 @@ + + + + + + + + + + QR-Code + + + + +
    +
    +
    +
    + + + + + diff --git a/resources/library/applications/QR-Code.wgt/js/jquery-3.2.1.min.js b/resources/library/applications/QR-Code.wgt/js/jquery-3.2.1.min.js new file mode 100644 index 00000000..644d35e2 --- /dev/null +++ b/resources/library/applications/QR-Code.wgt/js/jquery-3.2.1.min.js @@ -0,0 +1,4 @@ +/*! jQuery v3.2.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.2.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext;function B(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()}var C=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,D=/^.[^:#\[\.,]*$/;function E(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):D.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(E(this,a||[],!1))},not:function(a){return this.pushStack(E(this,a||[],!0))},is:function(a){return!!E(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var F,G=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,H=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||F,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:G.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),C.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};H.prototype=r.fn,F=r(d);var I=/^(?:parents|prev(?:Until|All))/,J={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function K(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return K(a,"nextSibling")},prev:function(a){return K(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return B(a,"iframe")?a.contentDocument:(B(a,"template")&&(a=a.content||a),r.merge([],a.childNodes))}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(J[a]||r.uniqueSort(e),I.test(a)&&e.reverse()),this.pushStack(e)}});var L=/[^\x20\t\r\n\f]+/g;function M(a){var b={};return r.each(a.match(L)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?M(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=e||a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function N(a){return a}function O(a){throw a}function P(a,b,c,d){var e;try{a&&r.isFunction(e=a.promise)?e.call(a).done(b).fail(c):a&&r.isFunction(e=a.then)?e.call(a,b,c):b.apply(void 0,[a].slice(d))}catch(a){c.apply(void 0,[a])}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b=f&&(d!==O&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:N,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:N)),c[2][3].add(g(0,a,r.isFunction(d)?d:O))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(P(a,g.done(h(c)).resolve,g.reject,!b),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)P(e[c],h(c),g.reject);return g.promise()}});var Q=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&Q.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var R=r.Deferred();r.fn.ready=function(a){return R.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||R.resolveWith(d,[r]))}}),r.ready.then=R.then;function S(){d.removeEventListener("DOMContentLoaded",S), +a.removeEventListener("load",S),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",S),a.addEventListener("load",S));var T=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)T(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h1,null,!0)},removeData:function(a){return this.each(function(){X.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=W.get(a,b),c&&(!d||Array.isArray(c)?d=W.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return W.get(a,c)||W.access(a,c,{empty:r.Callbacks("once memory").add(function(){W.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length\x20\t\r\n\f]+)/i,la=/^$|\/(?:java|ecma)script/i,ma={option:[1,""],thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};ma.optgroup=ma.option,ma.tbody=ma.tfoot=ma.colgroup=ma.caption=ma.thead,ma.th=ma.td;function na(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&B(a,b)?r.merge([a],c):c}function oa(a,b){for(var c=0,d=a.length;c-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=na(l.appendChild(f),"script"),j&&oa(g),c){k=0;while(f=g[k++])la.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var ra=d.documentElement,sa=/^key/,ta=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ua=/^([^.]*)(?:\.(.+)|)/;function va(){return!0}function wa(){return!1}function xa(){try{return d.activeElement}catch(a){}}function ya(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ya(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=wa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(ra,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(L)||[""],j=b.length;while(j--)h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.hasData(a)&&W.get(a);if(q&&(i=q.events)){b=(b||"").match(L)||[""],j=b.length;while(j--)if(h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&W.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(W.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i\x20\t\r\n\f]*)[^>]*)\/>/gi,Aa=/\s*$/g;function Ea(a,b){return B(a,"table")&&B(11!==b.nodeType?b:b.firstChild,"tr")?r(">tbody",a)[0]||a:a}function Fa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ga(a){var b=Ca.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ha(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(W.hasData(a)&&(f=W.access(a),g=W.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c1&&"string"==typeof q&&!o.checkClone&&Ba.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ja(f,b,c,d)});if(m&&(e=qa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(na(e,"script"),Fa),i=h.length;l")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=na(h),f=na(a),d=0,e=f.length;d0&&oa(g,!i&&na(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(U(c)){if(b=c[W.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[W.expando]=void 0}c[X.expando]&&(c[X.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ka(this,a,!0)},remove:function(a){return Ka(this,a)},text:function(a){return T(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.appendChild(a)}})},prepend:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(na(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return T(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!Aa.test(a)&&!ma[(ka.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c1)}});function _a(a,b,c,d,e){return new _a.prototype.init(a,b,c,d,e)}r.Tween=_a,_a.prototype={constructor:_a,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=_a.propHooks[this.prop];return a&&a.get?a.get(this):_a.propHooks._default.get(this)},run:function(a){var b,c=_a.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):_a.propHooks._default.set(this),this}},_a.prototype.init.prototype=_a.prototype,_a.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},_a.propHooks.scrollTop=_a.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=_a.prototype.init,r.fx.step={};var ab,bb,cb=/^(?:toggle|show|hide)$/,db=/queueHooks$/;function eb(){bb&&(d.hidden===!1&&a.requestAnimationFrame?a.requestAnimationFrame(eb):a.setTimeout(eb,r.fx.interval),r.fx.tick())}function fb(){return a.setTimeout(function(){ab=void 0}),ab=r.now()}function gb(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=ca[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function hb(a,b,c){for(var d,e=(kb.tweeners[b]||[]).concat(kb.tweeners["*"]),f=0,g=e.length;f1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?lb:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b), +null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&B(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(L);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),lb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=mb[b]||r.find.attr;mb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=mb[g],mb[g]=e,e=null!=c(a,b,d)?g:null,mb[g]=f),e}});var nb=/^(?:input|select|textarea|button)$/i,ob=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return T(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):nb.test(a.nodeName)||ob.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function pb(a){var b=a.match(L)||[];return b.join(" ")}function qb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,qb(this)))});if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,qb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,qb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(L)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=qb(this),b&&W.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":W.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+pb(qb(c))+" ").indexOf(b)>-1)return!0;return!1}});var rb=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":Array.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:pb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(Array.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var sb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!sb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,sb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(W.get(h,"events")||{})[b.type]&&W.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&U(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!U(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=W.access(d,b);e||d.addEventListener(a,c,!0),W.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=W.access(d,b)-1;e?W.access(d,b,e):(d.removeEventListener(a,c,!0),W.remove(d,b))}}});var tb=a.location,ub=r.now(),vb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(Array.isArray(b))r.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(Array.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!ja.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:Array.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}});var Bb=/%20/g,Cb=/#.*$/,Db=/([?&])_=[^&]*/,Eb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Fb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Gb=/^(?:GET|HEAD)$/,Hb=/^\/\//,Ib={},Jb={},Kb="*/".concat("*"),Lb=d.createElement("a");Lb.href=tb.href;function Mb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(L)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Nb(a,b,c,d){var e={},f=a===Jb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Ob(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Pb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Qb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:tb.href,type:"GET",isLocal:Fb.test(tb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Ob(Ob(a,r.ajaxSettings),b):Ob(r.ajaxSettings,a)},ajaxPrefilter:Mb(Ib),ajaxTransport:Mb(Jb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Eb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||tb.href)+"").replace(Hb,tb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(L)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Lb.protocol+"//"+Lb.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Nb(Ib,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Gb.test(o.type),f=o.url.replace(Cb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(Bb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(vb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Db,"$1"),n=(vb.test(f)?"&":"?")+"_="+ub++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Kb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Nb(Jb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Pb(o,y,d)),v=Qb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Rb={0:200,1223:204},Sb=r.ajaxSettings.xhr();o.cors=!!Sb&&"withCredentials"in Sb,o.ajax=Sb=!!Sb,r.ajaxTransport(function(b){var c,d;if(o.cors||Sb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Rb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r("