diff --git a/.bowerrc b/.bowerrc deleted file mode 100644 index ba0accc5..00000000 --- a/.bowerrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "directory": "app/bower_components" -} diff --git a/.editorconfig b/.editorconfig index c2cdfb8a..8a80734f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,7 +9,7 @@ root = true # Change these settings to your own preference indent_style = space -indent_size = 2 +indent_size = 4 # We recommend you to keep these unchanged end_of_line = lf diff --git a/.gitignore b/.gitignore index 353a62c2..1fcd8ad0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,24 @@ -node_modules -dist +# Folders +.idea .tmp .sass-cache +.vagrant +*.sublime-project +*.sublime-workspace + app/bower_components +app/scripts/main.js +app/bundle.js app/media -.idea -.vagrant +dist +nbproject/* +node_modules +tags + +# Files +*.iml +.DS_Store +# Ottemo Specific +app/scripts/config.js dashboard.iml diff --git a/.jsbeautifyrc b/.jsbeautifyrc new file mode 100644 index 00000000..5d845da0 --- /dev/null +++ b/.jsbeautifyrc @@ -0,0 +1,51 @@ +{ + // Details: https://github.com/victorporof/Sublime-HTMLPrettify#using-your-own-jsbeautifyrc-options + // Documentation: https://github.com/einars/js-beautify/ + "html": { + "allowed_file_extensions": ["htm", "html", "xhtml", "shtml", "xml", "svg"], + "brace_style": "collapse", // [collapse|expand|end-expand|none] Put braces on the same line as control statements (default), or put braces on own line (Allman / ANSI style), or just put end braces on own line, or attempt to keep them where they are + "end_with_newline": true, // End output with newline + "indent_char": " ", // Indentation character + "indent_handlebars": false, // e.g. {{#foo}}, {{/foo}} + "indent_inner_html": false, // Indent and sections + "indent_scripts": "keep", // [keep|separate|normal] + "indent_size": 4, // Indentation size + "max_preserve_newlines": 2, // Maximum number of line breaks to be preserved in one chunk (0 disables) + "preserve_newlines": true, // Whether existing line breaks before elements should be preserved (only works before elements, not inside tags or for text) + "unformatted": ["a", "span", "img", "code", "pre", "sub", "sup", "em", "strong", "b", "i", "u", "strike", "big", "small", "pre", "h1", "h2", "h3", "h4", "h5", "h6"], // List of tags that should not be reformatted + "wrap_line_length": 250, // Lines should wrap at next opportunity after this number of characters (0 disables) + "wrap_attributes": "force", + "wrap_attributes_indent_size": 4 + }, + "css": { + "allowed_file_extensions": ["css", "scss", "sass", "less"], + "end_with_newline": false, // End output with newline + "indent_char": " ", // Indentation character + "indent_size": 4, // Indentation size + "newline_between_rules": true, // Add a new line after every css rule + "selector_separator": " ", + "selector_separator_newline": true // Separate selectors with newline or not (e.g. "a,\nbr" or "a, br") + }, + "js": { + "allowed_file_extensions": ["js", "json", "jshintrc", "jsbeautifyrc"], + "brace_style": "collapse", // [collapse|expand|end-expand|none] Put braces on the same line as control statements (default), or put braces on own line (Allman / ANSI style), or just put end braces on own line, or attempt to keep them where they are + "break_chained_methods": false, // Break chained method calls across subsequent lines + "e4x": false, // Pass E4X xml literals through untouched + "end_with_newline": true, // End output with newline + "indent_char": " ", // Indentation character + "indent_level": 0, // Initial indentation level + "indent_size": 4, // Indentation size + "indent_with_tabs": false, // Indent with tabs, overrides `indent_size` and `indent_char` + "jslint_happy": false, // If true, then jslint-stricter mode is enforced + "keep_array_indentation": false, // Preserve array indentation + "keep_function_indentation": false, // Preserve function indentation + "max_preserve_newlines": 2, // Maximum number of line breaks to be preserved in one chunk (0 disables) + "preserve_newlines": true, // Whether existing line breaks should be preserved + "space_after_anon_function": false, // Should the space before an anonymous function's parens be added, "function()" vs "function ()" + "space_before_conditional": true, // Should the space before conditional statement be added, "if(true)" vs "if (true)" + "space_in_empty_paren": false, // Add padding spaces within empty paren, "f()" vs "f( )" + "space_in_paren": false, // Add padding spaces within paren, ie. f( a, b ) + "unescape_strings": false, // Should printable characters in strings encoded in \xNN notation be unescaped, "example" vs "\x65\x78\x61\x6d\x70\x6c\x65" + "wrap_line_length": 130 // Lines should wrap at next opportunity after this number of characters (0 disables) + } +} diff --git a/.jshintrc b/.jshintrc index 4095f80b..bdeb58fa 100644 --- a/.jshintrc +++ b/.jshintrc @@ -24,7 +24,8 @@ "regexp": true, "undef": true, "unused": true, - "strict": true, + "strict": false, // we don't do this currently, the errors litter our hint "sub": true, - "trailing": true + "trailing": true, + "predef": [ "angular", "JSON", "Highcharts" ] } diff --git a/Dockerfile b/Dockerfile index 48ded2d0..161cf1a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,13 +7,13 @@ FROM ubuntu:latest RUN apt-get update -RUN apt-get install -y nginx git curl python-software-properties python software-properties-common +RUN apt-get install -y openssh-server nginx git curl python-software-properties python software-properties-common RUN add-apt-repository ppa:chris-lea/node.js RUN apt-get update RUN apt-get install -y nodejs -RUN npm update -g npm +RUN git clone https://github.com/ottemo/dash.git -b develop /opt/dashboard WORKDIR /opt/dashboard -RUN git clone https://ottemo-dev:freshbox111222333@github.com/ottemo/dashboard.git -b develop /opt/dashboard +RUN npm update -g npm RUN npm install RUN npm install -g bower RUN bower install --allow-root @@ -24,5 +24,3 @@ ADD ./config/dashboard.conf /etc/nginx/conf.d/ RUN echo "daemon off;" >> /etc/nginx/nginx.conf EXPOSE 80 - -CMD service nginx start diff --git a/INSTALL.md b/INSTALL.md index 32bf3774..a0d8798b 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,4 +1,4 @@ -## Developer Installation Instructions +## Installation Instructions for Local Development ### Install NPM Gulp and Bower @@ -25,7 +25,29 @@ npm install bower install -### Initialize Git Flow +### Build project using Gulp + gulp build + +### Run Client in Development Mode with Browser Reload + gulp build && gulp dev + or + gulp build && gulp serve + +Note: The password to login to the dashboard will be whatever was set in the ['gulp build' step](https://github.com/ottemo/store-ng/blob/develop/INSTALL.md#build-ottemo-store-ng) for store-ng. By default this is: +``` +username: admin +password: admin +``` + +## How to set up Git Flow on Mac/Linux + +#### OSX + brew install git-flow + +#### Linux + sudo apt-get install git-flow + +### Initialize Git Flow in cloned Repository git checkout master git checkout develop git flow init -d @@ -33,14 +55,10 @@ ### Start a Feature Branch git flow feature start -### Build - gulp build - -### Run Unit Tests - Not configured yet +### Issue a pull request on github + $ git push -u origin + # if you have git aliased to hub otherwise use the github web interface + $ git pull-request -b develop -### Run Client in Development Mode - gulp build && gulp dev - -### Issue Pull Request on Github - git push -u origin +### Delete the local branch + $ git branch -d diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 00000000..a07ee588 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,7 @@ +## Copyright © 2015 + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index 05e0db2c..de9eff96 100644 --- a/README.md +++ b/README.md @@ -3,71 +3,32 @@ Dashboard [![wercker status](https://app.wercker.com/status/0d1dbce7b17a8fc14016760e30709afc/m "wercker status")](https://app.wercker.com/project/bykey/0d1dbce7b17a8fc14016760e30709afc) - -## Workflow with gulp - -### Build -Builds project and moves files on the destination folder. Makes concat and minify css and JS. Compiling SASS to css. Checks JS on errors using JSHint - - gulp build - -### Run Client in Development Mode -Moves images, bower-files into destination folder. Compiling sass. Adds watcher on a changes in css, scss, js, html and images. After a change these files browser automatically will be update content - - gulp build && gulp dev - or - gulp build && gulp serve - -### Run Unit Tests -Not configured yet. Will be realized in the near future - - gulp test - -### Also useful are the following commands - gulp jshint // check js on errors - gulp sass // Makes compilation sass to css - gulp clean // Removes the _dist_ folder - -### How start with Vagrantfile -Clone ottemo/dashboard github repo. The vagrant instance will start with nginx available at http://localhost:9999 - You can use gulp serve as well and will be available at http://localhost:9000 - - vagrant up - vagrant ssh - sudo su - - cd /vagrant - gulp serve (this will take a few minutes to start) - -### How to run ottemo/dashboard docker container -Pull latest image from docker hub - - docker pull ottemo/dashboard - -Start the container and access locally access at http://localhost:9999 - - docker run -d -p 9999:80 -t ottemo/dashboard +[Link to our HipChat Room for Support](https://www.hipchat.com/g3BoK1Gqr) ## Contribute to Ottemo Dashboard development +Clone the repository and send us a Pull Request. There is a mini quickstart if you are new to git-flow in [INSTALL.md](INSTALL.md) + We use git-flow internally, but if you do not like git-flow you may use [this document](CONTRIBUTOR.md) as an alternative. -Below is a mini quickstart if you are new to git-flow and can't wait to jump into the code. +## Installation +There are several different ways to install and run Ottemo. + +* Clone the repository, install gulp/bower, run in dev mode with `gulp serve` +* Use our Vagrant & Docker files to build a development vm -### Initialize git-flow +## License - # fork or clone ottemo like below - $ git clone https://github.com/ottemo/ottemo-go.git +[MIT License](LICENSE.md) Copyright 2015, Ottemo, Inc - # init git-flow, (git-flow must be installed for your OS locally) - $ git checkout master - $ git checkout develop - $ git flow init -d +## Terms and Conditions -### Start a feature branch - $ git flow feature start +All Submissions you make to Ottemo, Inc. (“Ottemo”) through GitHub are subject +to the following terms and conditions: -### Issue a pull request on github - $ git push -u origin - # if you have git aliased to hub otherwise use the github web interface - $ git pull-request -b develop +1. You grant Ottemo a perpetual, worldwide, non-exclusive, no charge, royalty +free, irrevocable license under your applicable copyrights and patents to +reproduce, prepare derivative works of, display, publically perform, sublicense +and distribute any feedback, ideas, code, or other information (“Submission”) +you submit through GitHub. -### Delete the local branch - $ git branch -d +2. Your Submission is an original work of authorship and you are the owner or are legally entitled to grant the license stated above. diff --git a/Vagrantfile b/Vagrantfile deleted file mode 100644 index 7b84dc51..00000000 --- a/Vagrantfile +++ /dev/null @@ -1,21 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! -VAGRANTFILE_API_VERSION = "2" - -Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - # All Vagrant configuration is done here. The most common configuration - # options are documented and commented below. For a complete reference, - # please see the online documentation at vagrantup.com. - - # Every Vagrant virtual environment requires a box to build off of. - config.vm.box = "ubuntu/trusty64" - - # accessing "localhost:9999" will access port 9999 on the guest machine. - config.vm.network "forwarded_port", guest: 9000, host: 9000 - config.vm.network "forwarded_port", guest: 9999, host: 9999 - - config.vm.provision "shell", path: "./bootstrap.sh", privileged: true, binary: false - -end \ No newline at end of file diff --git a/app/index.html b/app/index.html index b2a763df..3e3fdeb6 100644 --- a/app/index.html +++ b/app/index.html @@ -4,88 +4,33 @@ - - - - - + + Ottemo Dashboard - - - - - + + + + - - + -
-
-
-
-
-
- -
- -
- - - - + - - - - - - - - - - -
- + + + + - diff --git a/app/lib/angular-animate.min.js b/app/lib/angular-animate.min.js new file mode 100644 index 00000000..a99eac13 --- /dev/null +++ b/app/lib/angular-animate.min.js @@ -0,0 +1,52 @@ +/* + AngularJS v1.4.3 + (c) 2010-2015 Google, Inc. http://angularjs.org + License: MIT +*/ +(function(F,t,W){'use strict';function ua(a,b,c){if(!a)throw ngMinErr("areq",b||"?",c||"required");return a}function va(a,b){if(!a&&!b)return"";if(!a)return b;if(!b)return a;X(a)&&(a=a.join(" "));X(b)&&(b=b.join(" "));return a+" "+b}function Ea(a){var b={};a&&(a.to||a.from)&&(b.to=a.to,b.from=a.from);return b}function ba(a,b,c){var d="";a=X(a)?a:a&&U(a)&&a.length?a.split(/\s+/):[];u(a,function(a,s){a&&0=F&&b>=J&&(C=!0,m())}if(!K)if(g.parentNode){var x,p=[],k=function(a){if(C)D&&a&&(D=!1,m());else if(D=!a,y.animationDuration)if(a= +ma(g,D),D)l.push(a);else{var b=l,c=b.indexOf(a);0<=a&&b.splice(c,1)}},r=0=c;d--)f.end&&f.end(e[d]);e.length=c}}"string"!==typeof a&&(a=null===a||"undefined"===typeof a?"":""+a);var b,k,e=[],m=a,l;for(e.last=function(){return e[e.length-1]};a;){l="";k=!0;if(e.last()&&w[e.last()])a=a.replace(new RegExp("([\\W\\w]*)<\\s*\\/\\s*"+e.last()+"[^>]*>","i"),function(a,b){b=b.replace(H,"$1").replace(I,"$1");f.chars&&f.chars(q(b));return""}),c("",e.last());else{if(0===a.indexOf("\x3c!--"))b=a.indexOf("--",4),0<=b&&a.lastIndexOf("--\x3e", +b)===b&&(f.comment&&f.comment(a.substring(4,b)),a=a.substring(b+3),k=!1);else if(x.test(a)){if(b=a.match(x))a=a.replace(b[0],""),k=!1}else if(J.test(a)){if(b=a.match(y))a=a.substring(b[0].length),b[0].replace(y,c),k=!1}else K.test(a)&&((b=a.match(z))?(b[4]&&(a=a.substring(b[0].length),b[0].replace(z,d)),k=!1):(l+="<",a=a.substring(1)));k&&(b=a.indexOf("<"),l+=0>b?a:a.substring(0,b),a=0>b?"":a.substring(b),f.chars&&f.chars(q(l)))}if(a==m)throw L("badparse",a);m=a}c()}function q(a){if(!a)return"";A.innerHTML= +a.replace(//g,">")}function r(a,f){var d=!1,c=h.bind(a,a.push);return{start:function(a,k,e){a=h.lowercase(a);!d&&w[a]&&(d=a);d||!0!==C[a]||(c("<"),c(a),h.forEach(k,function(d,e){var k=h.lowercase(e),g="img"===a&&"src"===k|| +"background"===k;!0!==O[k]||!0===D[k]&&!f(d,g)||(c(" "),c(e),c('="'),c(B(d)),c('"'))}),c(e?"/>":">"))},end:function(a){a=h.lowercase(a);d||!0!==C[a]||(c(""));a==d&&(d=!1)},chars:function(a){d||c(B(a))}}}var L=h.$$minErr("$sanitize"),z=/^<((?:[a-zA-Z])[\w:-]*)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*(>?)/,y=/^<\/\s*([\w:-]+)[^>]*>/,G=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,K=/^]*?)>/i, +I=/"\u201d\u2019]/i,d=/^mailto:/i;return function(c,b){function k(a){a&&g.push(E(a))}function e(a, +c){g.push("');k(c);g.push("")}if(!c)return c;for(var m,l=c,g=[],n,p;m=l.match(f);)n=m[0],m[2]||m[4]||(n=(m[3]?"http://":"mailto:")+n),p=m.index,k(l.substr(0,p)),e(n,m[0].replace(d,"")),l=l.substring(p+m[0].length);k(l);return a(g.join(""))}}])})(window,window.angular); +//# sourceMappingURL=angular-sanitize.min.js.map diff --git a/app/lib/angular.min.js b/app/lib/angular.min.js new file mode 100644 index 00000000..2c28ef96 --- /dev/null +++ b/app/lib/angular.min.js @@ -0,0 +1,290 @@ +/* + AngularJS v1.4.3 + (c) 2010-2015 Google, Inc. http://angularjs.org + License: MIT +*/ +(function(O,U,t){'use strict';function J(b){return function(){var a=arguments[0],c;c="["+(b?b+":":"")+a+"] http://errors.angularjs.org/1.4.3/"+(b?b+"/":"")+a;for(a=1;a").append(b).html();try{return b[0].nodeType===Na?M(c):c.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+M(b)})}catch(d){return M(c)}}function yc(b){try{return decodeURIComponent(b)}catch(a){}}function zc(b){var a={},c,d;m((b||"").split("&"),function(b){b&&(c=b.replace(/\+/g, +"%20").split("="),d=yc(c[0]),w(d)&&(b=w(c[1])?yc(c[1]):!0,Xa.call(a,d)?G(a[d])?a[d].push(b):a[d]=[a[d],b]:a[d]=b))});return a}function Qb(b){var a=[];m(b,function(b,d){G(b)?m(b,function(b){a.push(ma(d,!0)+(!0===b?"":"="+ma(b,!0)))}):a.push(ma(d,!0)+(!0===b?"":"="+ma(b,!0)))});return a.length?a.join("&"):""}function ob(b){return ma(b,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function ma(b,a){return encodeURIComponent(b).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g, +"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,a?"%20":"+")}function Yd(b,a){var c,d,e=Oa.length;for(d=0;d/,">"));}a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",b)}]);c.debugInfoEnabled&&a.push(["$compileProvider",function(a){a.debugInfoEnabled(!0)}]);a.unshift("ng");d=eb(a,c.strictDi);d.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return d},e= +/^NG_ENABLE_DEBUG_INFO!/,f=/^NG_DEFER_BOOTSTRAP!/;O&&e.test(O.name)&&(c.debugInfoEnabled=!0,O.name=O.name.replace(e,""));if(O&&!f.test(O.name))return d();O.name=O.name.replace(f,"");ca.resumeBootstrap=function(b){m(b,function(b){a.push(b)});return d()};z(ca.resumeDeferredBootstrap)&&ca.resumeDeferredBootstrap()}function $d(){O.name="NG_ENABLE_DEBUG_INFO!"+O.name;O.location.reload()}function ae(b){b=ca.element(b).injector();if(!b)throw Fa("test");return b.get("$$testability")}function Bc(b,a){a=a|| +"_";return b.replace(be,function(b,d){return(d?a:"")+b.toLowerCase()})}function ce(){var b;if(!Cc){var a=pb();la=O.jQuery;w(a)&&(la=null===a?t:O[a]);la&&la.fn.on?(y=la,P(la.fn,{scope:Pa.scope,isolateScope:Pa.isolateScope,controller:Pa.controller,injector:Pa.injector,inheritedData:Pa.inheritedData}),b=la.cleanData,la.cleanData=function(a){var d;if(Rb)Rb=!1;else for(var e=0,f;null!=(f=a[e]);e++)(d=la._data(f,"events"))&&d.$destroy&&la(f).triggerHandler("$destroy");b(a)}):y=Q;ca.element=y;Cc=!0}}function Sb(b, +a,c){if(!b)throw Fa("areq",a||"?",c||"required");return b}function Qa(b,a,c){c&&G(b)&&(b=b[b.length-1]);Sb(z(b),a,"not a function, got "+(b&&"object"===typeof b?b.constructor.name||"Object":typeof b));return b}function Ra(b,a){if("hasOwnProperty"===b)throw Fa("badname",a);}function Dc(b,a,c){if(!a)return b;a=a.split(".");for(var d,e=b,f=a.length,g=0;g")+d[2];for(d=d[0];d--;)c=c.lastChild;f=cb(f,c.childNodes);c=e.firstChild;c.textContent=""}else f.push(a.createTextNode(b));e.textContent="";e.innerHTML="";m(f,function(a){e.appendChild(a)});return e}function Q(b){if(b instanceof Q)return b;var a;L(b)&&(b=R(b),a=!0);if(!(this instanceof Q)){if(a&&"<"!=b.charAt(0))throw Ub("nosel");return new Q(b)}if(a){a=U; +var c;b=(c=Cf.exec(b))?[a.createElement(c[1])]:(c=Nc(b,a))?c.childNodes:[]}Oc(this,b)}function Vb(b){return b.cloneNode(!0)}function tb(b,a){a||ub(b);if(b.querySelectorAll)for(var c=b.querySelectorAll("*"),d=0,e=c.length;dk&&this.remove(s.key);return b}},get:function(a){if(k").parent()[0])});var f=S(a,b,a,c,d,e);Z.$$addScopeClass(a); +var g=null;return function(b,c,d){Sb(b,"scope");d=d||{};var e=d.parentBoundTranscludeFn,h=d.transcludeControllers;d=d.futureParentElement;e&&e.$$boundTransclude&&(e=e.$$boundTransclude);g||(g=(d=d&&d[0])?"foreignobject"!==ta(d)&&d.toString().match(/SVG/)?"svg":"html":"html");d="html"!==g?y(Yb(g,y("
").append(a).html())):c?Pa.clone.call(a):a;if(h)for(var k in h)d.data("$"+k+"Controller",h[k].instance);Z.$$addScopeInfo(d,b);c&&c(d,b);f&&f(b,d,d,e);return d}}function S(a,b,c,d,e,f){function g(a, +c,d,e){var f,k,l,s,n,B,C;if(p)for(C=Array(c.length),s=0;sE.priority)break;if(v=E.scope)E.templateUrl|| +(H(v)?(O("new/isolated scope",u||$,E,ba),u=E):O("new/isolated scope",u,E,ba)),$=$||E;w=E.name;!E.templateUrl&&E.controller&&(v=E.controller,N=N||ga(),O("'"+w+"' controller",N[w],E,ba),N[w]=E);if(v=E.transclude)K=!0,E.$$tlb||(O("transclusion",m,E,ba),m=E),"element"==v?(q=!0,F=E.priority,v=ba,ba=d.$$element=y(U.createComment(" "+w+": "+d[w]+" ")),b=ba[0],T(f,za.call(v,0),b),A=Z(v,e,F,g&&g.name,{nonTlbTranscludeDirective:m})):(v=y(Vb(b)).contents(),ba.empty(),A=Z(v,e));if(E.template)if(I=!0,O("template", +D,E,ba),D=E,v=z(E.template)?E.template(ba,d):E.template,v=fa(v),E.replace){g=E;v=Tb.test(v)?$c(Yb(E.templateNamespace,R(v))):[];b=v[0];if(1!=v.length||b.nodeType!==qa)throw ea("tplrt",w,"");T(f,ba,b);Ta={$attr:{}};v=ha(b,[],Ta);var Q=a.splice(xa+1,a.length-(xa+1));u&&ad(v);a=a.concat(v).concat(Q);J(d,Ta);Ta=a.length}else ba.html(v);if(E.templateUrl)I=!0,O("template",D,E,ba),D=E,E.replace&&(g=E),S=Lf(a.splice(xa,a.length-xa),ba,d,f,K&&A,h,k,{controllerDirectives:N,newScopeDirective:$!==E&&$,newIsolateScopeDirective:u, +templateDirective:D,nonTlbTranscludeDirective:m}),Ta=a.length;else if(E.compile)try{Aa=E.compile(ba,d,A),z(Aa)?n(null,Aa,M,P):Aa&&n(Aa.pre,Aa.post,M,P)}catch(Kf){c(Kf,ua(ba))}E.terminal&&(S.terminal=!0,F=Math.max(F,E.priority))}S.scope=$&&!0===$.scope;S.transcludeOnThisElement=K;S.templateOnThisElement=I;S.transclude=A;s.hasElementTranscludeDirective=q;return S}function ad(a){for(var b=0,c=a.length;bn.priority)&&-1!=n.restrict.indexOf(f)&&(k&&(n=Ob(n,{$$start:k,$$end:l})),b.push(n),h=n)}catch(x){c(x)}}return h}function A(b){if(e.hasOwnProperty(b))for(var c=a.get(b+"Directive"),d=0,f=c.length;d"+b+"";return c.childNodes[0].childNodes;default:return b}}function Q(a,b){if("srcdoc"==b)return I.HTML;var c=ta(a);if("xlinkHref"==b||"form"==c&&"action"==b||"img"!=c&&("src"==b|| +"ngSrc"==b))return I.RESOURCE_URL}function V(a,c,d,e,f){var g=Q(a,e);f=h[e]||f;var l=b(d,!0,g,f);if(l){if("multiple"===e&&"select"===ta(a))throw ea("selmulti",ua(a));c.push({priority:100,compile:function(){return{pre:function(a,c,h){c=h.$$observers||(h.$$observers={});if(k.test(e))throw ea("nodomevents");var s=h[e];s!==d&&(l=s&&b(s,!0,g,f),d=s);l&&(h[e]=l(a),(c[e]||(c[e]=[])).$$inter=!0,(h.$$observers&&h.$$observers[e].$$scope||a).$watch(l,function(a,b){"class"===e&&a!=b?h.$updateClass(a,b):h.$set(e, +a)}))}}}})}}function T(a,b,c){var d=b[0],e=b.length,f=d.parentNode,g,h;if(a)for(g=0,h=a.length;g=a)return b;for(;a--;)8=== +b[a].nodeType&&Mf.call(b,a,1);return b}function Xe(){var b={},a=!1;this.register=function(a,d){Ra(a,"controller");H(a)?P(b,a):b[a]=d};this.allowGlobals=function(){a=!0};this.$get=["$injector","$window",function(c,d){function e(a,b,c,d){if(!a||!H(a.$scope))throw J("$controller")("noscp",d,b);a.$scope[b]=c}return function(f,g,h,l){var k,n,r;h=!0===h;l&&L(l)&&(r=l);if(L(f)){l=f.match(Xc);if(!l)throw Nf("ctrlfmt",f);n=l[1];r=r||l[3];f=b.hasOwnProperty(n)?b[n]:Dc(g.$scope,n,!0)||(a?Dc(d,n,!0):t);Qa(f, +n,!0)}if(h)return h=(G(f)?f[f.length-1]:f).prototype,k=Object.create(h||null),r&&e(g,r,k,n||f.name),P(function(){var a=c.invoke(f,k,g,n);a!==k&&(H(a)||z(a))&&(k=a,r&&e(g,r,k,n||f.name));return k},{instance:k,identifier:r});k=c.instantiate(f,g,n);r&&e(g,r,k,n||f.name);return k}}]}function Ye(){this.$get=["$window",function(b){return y(b.document)}]}function Ze(){this.$get=["$log",function(b){return function(a,c){b.error.apply(b,arguments)}}]}function Zb(b){return H(b)?aa(b)?b.toISOString():db(b):b} +function cf(){this.$get=function(){return function(b){if(!b)return"";var a=[];oc(b,function(b,d){null===b||A(b)||(G(b)?m(b,function(b,c){a.push(ma(d)+"="+ma(Zb(b)))}):a.push(ma(d)+"="+ma(Zb(b))))});return a.join("&")}}}function df(){this.$get=function(){return function(b){function a(b,e,f){null===b||A(b)||(G(b)?m(b,function(b){a(b,e+"[]")}):H(b)&&!aa(b)?oc(b,function(b,c){a(b,e+(f?"":"[")+c+(f?"":"]"))}):c.push(ma(e)+"="+ma(Zb(b))))}if(!b)return"";var c=[];a(b,"",!0);return c.join("&")}}}function $b(b, +a){if(L(b)){var c=b.replace(Of,"").trim();if(c){var d=a("Content-Type");(d=d&&0===d.indexOf(cd))||(d=(d=c.match(Pf))&&Qf[d[0]].test(c));d&&(b=wc(c))}}return b}function dd(b){var a=ga(),c;L(b)?m(b.split("\n"),function(b){c=b.indexOf(":");var e=M(R(b.substr(0,c)));b=R(b.substr(c+1));e&&(a[e]=a[e]?a[e]+", "+b:b)}):H(b)&&m(b,function(b,c){var f=M(c),g=R(b);f&&(a[f]=a[f]?a[f]+", "+g:g)});return a}function ed(b){var a;return function(c){a||(a=dd(b));return c?(c=a[M(c)],void 0===c&&(c=null),c):a}}function fd(b, +a,c,d){if(z(d))return d(b,a,c);m(d,function(d){b=d(b,a,c)});return b}function bf(){var b=this.defaults={transformResponse:[$b],transformRequest:[function(a){return H(a)&&"[object File]"!==sa.call(a)&&"[object Blob]"!==sa.call(a)&&"[object FormData]"!==sa.call(a)?db(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},post:ia(ac),put:ia(ac),patch:ia(ac)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",paramSerializer:"$httpParamSerializer"},a=!1;this.useApplyAsync=function(b){return w(b)? +(a=!!b,this):a};var c=this.interceptors=[];this.$get=["$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector",function(d,e,f,g,h,l){function k(a){function c(a){var b=P({},a);b.data=a.data?fd(a.data,a.headers,a.status,e.transformResponse):a.data;a=a.status;return 200<=a&&300>a?b:h.reject(b)}function d(a,b){var c,e={};m(a,function(a,d){z(a)?(c=a(b),null!=c&&(e[d]=c)):e[d]=a});return e}if(!ca.isObject(a))throw J("$http")("badreq",a);var e=P({method:"get",transformRequest:b.transformRequest, +transformResponse:b.transformResponse,paramSerializer:b.paramSerializer},a);e.headers=function(a){var c=b.headers,e=P({},a.headers),f,g,h,c=P({},c.common,c[M(a.method)]);a:for(f in c){g=M(f);for(h in e)if(M(h)===g)continue a;e[f]=c[f]}return d(e,ia(a))}(a);e.method=rb(e.method);e.paramSerializer=L(e.paramSerializer)?l.get(e.paramSerializer):e.paramSerializer;var f=[function(a){var d=a.headers,e=fd(a.data,ed(d),t,a.transformRequest);A(e)&&m(d,function(a,b){"content-type"===M(b)&&delete d[b]});A(a.withCredentials)&& +!A(b.withCredentials)&&(a.withCredentials=b.withCredentials);return n(a,e).then(c,c)},t],g=h.when(e);for(m(x,function(a){(a.request||a.requestError)&&f.unshift(a.request,a.requestError);(a.response||a.responseError)&&f.push(a.response,a.responseError)});f.length;){a=f.shift();var k=f.shift(),g=g.then(a,k)}g.success=function(a){Qa(a,"fn");g.then(function(b){a(b.data,b.status,b.headers,e)});return g};g.error=function(a){Qa(a,"fn");g.then(null,function(b){a(b.data,b.status,b.headers,e)});return g};return g} +function n(c,f){function l(b,c,d,e){function f(){n(c,b,d,e)}N&&(200<=b&&300>b?N.put(S,[b,c,dd(d),e]):N.remove(S));a?g.$applyAsync(f):(f(),g.$$phase||g.$apply())}function n(a,b,d,e){b=Math.max(b,0);(200<=b&&300>b?I.resolve:I.reject)({data:a,status:b,headers:ed(d),config:c,statusText:e})}function x(a){n(a.data,a.status,ia(a.headers()),a.statusText)}function m(){var a=k.pendingRequests.indexOf(c);-1!==a&&k.pendingRequests.splice(a,1)}var I=h.defer(),B=I.promise,N,D,q=c.headers,S=r(c.url,c.paramSerializer(c.params)); +k.pendingRequests.push(c);B.then(m,m);!c.cache&&!b.cache||!1===c.cache||"GET"!==c.method&&"JSONP"!==c.method||(N=H(c.cache)?c.cache:H(b.cache)?b.cache:s);N&&(D=N.get(S),w(D)?D&&z(D.then)?D.then(x,x):G(D)?n(D[1],D[0],ia(D[2]),D[3]):n(D,200,{},"OK"):N.put(S,B));A(D)&&((D=gd(c.url)?e()[c.xsrfCookieName||b.xsrfCookieName]:t)&&(q[c.xsrfHeaderName||b.xsrfHeaderName]=D),d(c.method,S,f,l,q,c.timeout,c.withCredentials,c.responseType));return B}function r(a,b){0=l&&(u.resolve(C),x(p.$$intervalId),delete f[p.$$intervalId]);F||b.$apply()},h);f[p.$$intervalId]=u;return p}var f={};e.cancel=function(b){return b&&b.$$intervalId in f?(f[b.$$intervalId].reject("canceled"),a.clearInterval(b.$$intervalId),delete f[b.$$intervalId],!0):!1};return e}]}function ge(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".", +GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"\u00a4",posSuf:"",negPre:"(\u00a4",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January February March April May June July August September October November December".split(" "),SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "), +SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a",ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"]},pluralCat:function(b){return 1===b?"one":"other"}}}}function bc(b){b=b.split("/");for(var a=b.length;a--;)b[a]=ob(b[a]);return b.join("/")}function hd(b,a){var c=Ba(b);a.$$protocol=c.protocol; +a.$$host=c.hostname;a.$$port=W(c.port)||Tf[c.protocol]||null}function id(b,a){var c="/"!==b.charAt(0);c&&(b="/"+b);var d=Ba(b);a.$$path=decodeURIComponent(c&&"/"===d.pathname.charAt(0)?d.pathname.substring(1):d.pathname);a.$$search=zc(d.search);a.$$hash=decodeURIComponent(d.hash);a.$$path&&"/"!=a.$$path.charAt(0)&&(a.$$path="/"+a.$$path)}function ya(b,a){if(0===a.indexOf(b))return a.substr(b.length)}function Ja(b){var a=b.indexOf("#");return-1==a?b:b.substr(0,a)}function Bb(b){return b.replace(/(#.+)|#$/, +"$1")}function cc(b){return b.substr(0,Ja(b).lastIndexOf("/")+1)}function dc(b,a){this.$$html5=!0;a=a||"";var c=cc(b);hd(b,this);this.$$parse=function(a){var b=ya(c,a);if(!L(b))throw Cb("ipthprfx",a,c);id(b,this);this.$$path||(this.$$path="/");this.$$compose()};this.$$compose=function(){var a=Qb(this.$$search),b=this.$$hash?"#"+ob(this.$$hash):"";this.$$url=bc(this.$$path)+(a?"?"+a:"")+b;this.$$absUrl=c+this.$$url.substr(1)};this.$$parseLinkUrl=function(d,e){if(e&&"#"===e[0])return this.hash(e.slice(1)), +!0;var f,g;(f=ya(b,d))!==t?(g=f,g=(f=ya(a,f))!==t?c+(ya("/",f)||f):b+g):(f=ya(c,d))!==t?g=c+f:c==d+"/"&&(g=c);g&&this.$$parse(g);return!!g}}function ec(b,a){var c=cc(b);hd(b,this);this.$$parse=function(d){var e=ya(b,d)||ya(c,d),f;A(e)||"#"!==e.charAt(0)?this.$$html5?f=e:(f="",A(e)&&(b=d,this.replace())):(f=ya(a,e),A(f)&&(f=e));id(f,this);d=this.$$path;var e=b,g=/^\/[A-Z]:(\/.*)/;0===f.indexOf(e)&&(f=f.replace(e,""));g.exec(f)||(d=(f=g.exec(d))?f[1]:d);this.$$path=d;this.$$compose()};this.$$compose= +function(){var c=Qb(this.$$search),e=this.$$hash?"#"+ob(this.$$hash):"";this.$$url=bc(this.$$path)+(c?"?"+c:"")+e;this.$$absUrl=b+(this.$$url?a+this.$$url:"")};this.$$parseLinkUrl=function(a,c){return Ja(b)==Ja(a)?(this.$$parse(a),!0):!1}}function jd(b,a){this.$$html5=!0;ec.apply(this,arguments);var c=cc(b);this.$$parseLinkUrl=function(d,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;b==Ja(d)?f=d:(g=ya(c,d))?f=b+a+g:c===d+"/"&&(f=c);f&&this.$$parse(f);return!!f};this.$$compose=function(){var c= +Qb(this.$$search),e=this.$$hash?"#"+ob(this.$$hash):"";this.$$url=bc(this.$$path)+(c?"?"+c:"")+e;this.$$absUrl=b+a+this.$$url}}function Db(b){return function(){return this[b]}}function kd(b,a){return function(c){if(A(c))return this[b];this[b]=a(c);this.$$compose();return this}}function ff(){var b="",a={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(a){return w(a)?(b=a,this):b};this.html5Mode=function(b){return ab(b)?(a.enabled=b,this):H(b)?(ab(b.enabled)&&(a.enabled=b.enabled), +ab(b.requireBase)&&(a.requireBase=b.requireBase),ab(b.rewriteLinks)&&(a.rewriteLinks=b.rewriteLinks),this):a};this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(c,d,e,f,g){function h(a,b,c){var e=k.url(),f=k.$$state;try{d.url(a,b,c),k.$$state=d.state()}catch(g){throw k.url(e),k.$$state=f,g;}}function l(a,b){c.$broadcast("$locationChangeSuccess",k.absUrl(),a,k.$$state,b)}var k,n;n=d.baseHref();var r=d.url(),s;if(a.enabled){if(!n&&a.requireBase)throw Cb("nobase");s=r.substring(0, +r.indexOf("/",r.indexOf("//")+2))+(n||"/");n=e.history?dc:jd}else s=Ja(r),n=ec;k=new n(s,"#"+b);k.$$parseLinkUrl(r,r);k.$$state=d.state();var x=/^\s*(javascript|mailto):/i;f.on("click",function(b){if(a.rewriteLinks&&!b.ctrlKey&&!b.metaKey&&!b.shiftKey&&2!=b.which&&2!=b.button){for(var e=y(b.target);"a"!==ta(e[0]);)if(e[0]===f[0]||!(e=e.parent())[0])return;var h=e.prop("href"),l=e.attr("href")||e.attr("xlink:href");H(h)&&"[object SVGAnimatedString]"===h.toString()&&(h=Ba(h.animVal).href);x.test(h)|| +!h||e.attr("target")||b.isDefaultPrevented()||!k.$$parseLinkUrl(h,l)||(b.preventDefault(),k.absUrl()!=d.url()&&(c.$apply(),g.angular["ff-684208-preventDefault"]=!0))}});Bb(k.absUrl())!=Bb(r)&&d.url(k.absUrl(),!0);var C=!0;d.onUrlChange(function(a,b){c.$evalAsync(function(){var d=k.absUrl(),e=k.$$state,f;k.$$parse(a);k.$$state=b;f=c.$broadcast("$locationChangeStart",a,d,b,e).defaultPrevented;k.absUrl()===a&&(f?(k.$$parse(d),k.$$state=e,h(d,!1,e)):(C=!1,l(d,e)))});c.$$phase||c.$digest()});c.$watch(function(){var a= +Bb(d.url()),b=Bb(k.absUrl()),f=d.state(),g=k.$$replace,n=a!==b||k.$$html5&&e.history&&f!==k.$$state;if(C||n)C=!1,c.$evalAsync(function(){var b=k.absUrl(),d=c.$broadcast("$locationChangeStart",b,a,k.$$state,f).defaultPrevented;k.absUrl()===b&&(d?(k.$$parse(a),k.$$state=f):(n&&h(b,g,f===k.$$state?null:k.$$state),l(a,f)))});k.$$replace=!1});return k}]}function gf(){var b=!0,a=this;this.debugEnabled=function(a){return w(a)?(b=a,this):b};this.$get=["$window",function(c){function d(a){a instanceof Error&& +(a.stack?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=c.console||{},e=b[a]||b.log||v;a=!1;try{a=!!e.apply}catch(l){}return a?function(){var a=[];m(arguments,function(b){a.push(d(b))});return e.apply(b,a)}:function(a,b){e(a,null==b?"":b)}}return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){b&&c.apply(a,arguments)}}()}}]} +function Ca(b,a){if("__defineGetter__"===b||"__defineSetter__"===b||"__lookupGetter__"===b||"__lookupSetter__"===b||"__proto__"===b)throw da("isecfld",a);return b}function oa(b,a){if(b){if(b.constructor===b)throw da("isecfn",a);if(b.window===b)throw da("isecwindow",a);if(b.children&&(b.nodeName||b.prop&&b.attr&&b.find))throw da("isecdom",a);if(b===Object)throw da("isecobj",a);}return b}function ld(b,a){if(b){if(b.constructor===b)throw da("isecfn",a);if(b===Uf||b===Vf||b===Wf)throw da("isecff",a); +}}function Xf(b,a){return"undefined"!==typeof b?b:a}function md(b,a){return"undefined"===typeof b?a:"undefined"===typeof a?b:b+a}function T(b,a){var c,d;switch(b.type){case q.Program:c=!0;m(b.body,function(b){T(b.expression,a);c=c&&b.expression.constant});b.constant=c;break;case q.Literal:b.constant=!0;b.toWatch=[];break;case q.UnaryExpression:T(b.argument,a);b.constant=b.argument.constant;b.toWatch=b.argument.toWatch;break;case q.BinaryExpression:T(b.left,a);T(b.right,a);b.constant=b.left.constant&& +b.right.constant;b.toWatch=b.left.toWatch.concat(b.right.toWatch);break;case q.LogicalExpression:T(b.left,a);T(b.right,a);b.constant=b.left.constant&&b.right.constant;b.toWatch=b.constant?[]:[b];break;case q.ConditionalExpression:T(b.test,a);T(b.alternate,a);T(b.consequent,a);b.constant=b.test.constant&&b.alternate.constant&&b.consequent.constant;b.toWatch=b.constant?[]:[b];break;case q.Identifier:b.constant=!1;b.toWatch=[b];break;case q.MemberExpression:T(b.object,a);b.computed&&T(b.property,a); +b.constant=b.object.constant&&(!b.computed||b.property.constant);b.toWatch=[b];break;case q.CallExpression:c=b.filter?!a(b.callee.name).$stateful:!1;d=[];m(b.arguments,function(b){T(b,a);c=c&&b.constant;b.constant||d.push.apply(d,b.toWatch)});b.constant=c;b.toWatch=b.filter&&!a(b.callee.name).$stateful?d:[b];break;case q.AssignmentExpression:T(b.left,a);T(b.right,a);b.constant=b.left.constant&&b.right.constant;b.toWatch=[b];break;case q.ArrayExpression:c=!0;d=[];m(b.elements,function(b){T(b,a);c= +c&&b.constant;b.constant||d.push.apply(d,b.toWatch)});b.constant=c;b.toWatch=d;break;case q.ObjectExpression:c=!0;d=[];m(b.properties,function(b){T(b.value,a);c=c&&b.value.constant;b.value.constant||d.push.apply(d,b.value.toWatch)});b.constant=c;b.toWatch=d;break;case q.ThisExpression:b.constant=!1,b.toWatch=[]}}function nd(b){if(1==b.length){b=b[0].expression;var a=b.toWatch;return 1!==a.length?a:a[0]!==b?a:t}}function od(b){return b.type===q.Identifier||b.type===q.MemberExpression}function pd(b){if(1=== +b.body.length&&od(b.body[0].expression))return{type:q.AssignmentExpression,left:b.body[0].expression,right:{type:q.NGValueParameter},operator:"="}}function qd(b){return 0===b.body.length||1===b.body.length&&(b.body[0].expression.type===q.Literal||b.body[0].expression.type===q.ArrayExpression||b.body[0].expression.type===q.ObjectExpression)}function rd(b,a){this.astBuilder=b;this.$filter=a}function sd(b,a){this.astBuilder=b;this.$filter=a}function Eb(b,a,c,d){oa(b,d);a=a.split(".");for(var e,f=0;1< +a.length;f++){e=Ca(a.shift(),d);var g=oa(b[e],d);g||(g={},b[e]=g);b=g}e=Ca(a.shift(),d);oa(b[e],d);return b[e]=c}function Fb(b){return"constructor"==b}function fc(b){return z(b.valueOf)?b.valueOf():Yf.call(b)}function hf(){var b=ga(),a=ga();this.$get=["$filter","$sniffer",function(c,d){function e(a,b){return null==a||null==b?a===b:"object"===typeof a&&(a=fc(a),"object"===typeof a)?!1:a===b||a!==a&&b!==b}function f(a,b,c,d,f){var g=d.inputs,h;if(1===g.length){var k=e,g=g[0];return a.$watch(function(a){var b= +g(a);e(b,k)||(h=d(a,t,t,[b]),k=b&&fc(b));return h},b,c,f)}for(var l=[],n=[],r=0,m=g.length;r=this.promise.$$state.status&&d&&d.length&&b(function(){for(var b,e,f=0,g=d.length;fa)for(b in l++,f)e.hasOwnProperty(b)|| +(m--,delete f[b])}else f!==e&&(f=e,l++);return l}}c.$stateful=!0;var d=this,e,f,g,k=1m&&(E=4-m,u[E]||(u[E]=[]),u[E].push({msg:z(b.exp)?"fn: "+(b.exp.name||b.exp.toString()):b.exp,newVal:f,oldVal:h}));else if(b===d){s=!1;break a}}catch(A){g(A)}if(!(k=x.$$watchersCount&&x.$$childHead||x!==this&&x.$$nextSibling))for(;x!== +this&&!(k=x.$$nextSibling);)x=x.$parent}while(x=k);if((s||t.length)&&!m--)throw p.$$phase=null,c("infdig",a,u);}while(s||t.length);for(p.$$phase=null;w.length;)try{w.shift()()}catch(y){g(y)}},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy");this.$$destroyed=!0;this===p&&l.$$applicationDestroyed();s(this,-this.$$watchersCount);for(var b in this.$$listenerCount)x(this,this.$$listenerCount[b],b);a&&a.$$childHead==this&&(a.$$childHead=this.$$nextSibling);a&&a.$$childTail== +this&&(a.$$childTail=this.$$prevSibling);this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling);this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling);this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=v;this.$on=this.$watch=this.$watchGroup=function(){return v};this.$$listeners={};this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=this.$root=this.$$watchers=null}},$eval:function(a,b){return h(a)(this,b)}, +$evalAsync:function(a,b){p.$$phase||t.length||l.defer(function(){t.length&&p.$digest()});t.push({scope:this,expression:a,locals:b})},$$postDigest:function(a){w.push(a)},$apply:function(a){try{return r("$apply"),this.$eval(a)}catch(b){g(b)}finally{p.$$phase=null;try{p.$digest()}catch(c){throw g(c),c;}}},$applyAsync:function(a){function b(){c.$eval(a)}var c=this;a&&I.push(b);u()},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=c=[]);c.push(b);var d=this;do d.$$listenerCount[a]|| +(d.$$listenerCount[a]=0),d.$$listenerCount[a]++;while(d=d.$parent);var e=this;return function(){var d=c.indexOf(b);-1!==d&&(c[d]=null,x(e,1,a))}},$emit:function(a,b){var c=[],d,e=this,f=!1,h={name:a,targetScope:e,stopPropagation:function(){f=!0},preventDefault:function(){h.defaultPrevented=!0},defaultPrevented:!1},k=cb([h],arguments,1),l,n;do{d=e.$$listeners[a]||c;h.currentScope=e;l=0;for(n=d.length;lUa)throw Da("iequirks");var d=ia(pa);d.isEnabled=function(){return b};d.trustAs=c.trustAs;d.getTrusted=c.getTrusted;d.valueOf=c.valueOf;b||(d.trustAs= +d.getTrusted=function(a,b){return b},d.valueOf=Ya);d.parseAs=function(b,c){var e=a(c);return e.literal&&e.constant?e:a(c,function(a){return d.getTrusted(b,a)})};var e=d.parseAs,f=d.getTrusted,g=d.trustAs;m(pa,function(a,b){var c=M(b);d[hb("parse_as_"+c)]=function(b){return e(a,b)};d[hb("get_trusted_"+c)]=function(b){return f(a,b)};d[hb("trust_as_"+c)]=function(b){return g(a,b)}});return d}]}function of(){this.$get=["$window","$document",function(b,a){var c={},d=W((/android (\d+)/.exec(M((b.navigator|| +{}).userAgent))||[])[1]),e=/Boxee/i.test((b.navigator||{}).userAgent),f=a[0]||{},g,h=/^(Moz|webkit|ms)(?=[A-Z])/,l=f.body&&f.body.style,k=!1,n=!1;if(l){for(var r in l)if(k=h.exec(r)){g=k[0];g=g.substr(0,1).toUpperCase()+g.substr(1);break}g||(g="WebkitOpacity"in l&&"webkit");k=!!("transition"in l||g+"Transition"in l);n=!!("animation"in l||g+"Animation"in l);!d||k&&n||(k=L(l.webkitTransition),n=L(l.webkitAnimation))}return{history:!(!b.history||!b.history.pushState||4>d||e),hasEvent:function(a){if("input"=== +a&&11>=Ua)return!1;if(A(c[a])){var b=f.createElement("div");c[a]="on"+a in b}return c[a]},csp:fb(),vendorPrefix:g,transitions:k,animations:n,android:d}}]}function qf(){this.$get=["$templateCache","$http","$q","$sce",function(b,a,c,d){function e(f,g){e.totalPendingRequests++;L(f)&&b.get(f)||(f=d.getTrustedResourceUrl(f));var h=a.defaults&&a.defaults.transformResponse;G(h)?h=h.filter(function(a){return a!==$b}):h===$b&&(h=null);return a.get(f,{cache:b,transformResponse:h})["finally"](function(){e.totalPendingRequests--}).then(function(a){b.put(f, +a.data);return a.data},function(a){if(!g)throw ea("tpload",f,a.status,a.statusText);return c.reject(a)})}e.totalPendingRequests=0;return e}]}function rf(){this.$get=["$rootScope","$browser","$location",function(b,a,c){return{findBindings:function(a,b,c){a=a.getElementsByClassName("ng-binding");var g=[];m(a,function(a){var d=ca.element(a).data("$binding");d&&m(d,function(d){c?(new RegExp("(^|\\s)"+ud(b)+"(\\s|\\||$)")).test(d)&&g.push(a):-1!=d.indexOf(b)&&g.push(a)})});return g},findModels:function(a, +b,c){for(var g=["ng-","data-ng-","ng\\:"],h=0;hb;b=Math.abs(b);var g=Infinity===b;if(!g&&!isFinite(b))return"";var h=b+"",l="",k=!1,n=[];g&&(l="\u221e"); +if(!g&&-1!==h.indexOf("e")){var r=h.match(/([\d\.]+)e(-?)(\d+)/);r&&"-"==r[2]&&r[3]>e+1?b=0:(l=h,k=!0)}if(g||k)0b&&(l=b.toFixed(e),b=parseFloat(l));else{g=(h.split(Dd)[1]||"").length;A(e)&&(e=Math.min(Math.max(a.minFrac,g),a.maxFrac));b=+(Math.round(+(b.toString()+"e"+e)).toString()+"e"+-e);var g=(""+b).split(Dd),h=g[0],g=g[1]||"",r=0,s=a.lgSize,m=a.gSize;if(h.length>=s+m)for(r=h.length-s,k=0;kb&&(d="-",b=-b);for(b=""+b;b.length-c)e+=c;0===e&&-12==c&&(e=12);return Gb(e,a,d)}}function Hb(b,a){return function(c,d){var e=c["get"+b](),f=rb(a?"SHORT"+b:b);return d[f][e]}}function Ed(b){var a= +(new Date(b,0,1)).getDay();return new Date(b,0,(4>=a?5:12)-a)}function Fd(b){return function(a){var c=Ed(a.getFullYear());a=+new Date(a.getFullYear(),a.getMonth(),a.getDate()+(4-a.getDay()))-+c;a=1+Math.round(a/6048E5);return Gb(a,b)}}function jc(b,a){return 0>=b.getFullYear()?a.ERAS[0]:a.ERAS[1]}function zd(b){function a(a){var b;if(b=a.match(c)){a=new Date(0);var f=0,g=0,h=b[8]?a.setUTCFullYear:a.setFullYear,l=b[8]?a.setUTCHours:a.setHours;b[9]&&(f=W(b[9]+b[10]),g=W(b[9]+b[11]));h.call(a,W(b[1]), +W(b[2])-1,W(b[3]));f=W(b[4]||0)-f;g=W(b[5]||0)-g;h=W(b[6]||0);b=Math.round(1E3*parseFloat("0."+(b[7]||0)));l.call(a,f,g,h,b)}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,e,f){var g="",h=[],l,k;e=e||"mediumDate";e=b.DATETIME_FORMATS[e]||e;L(c)&&(c=fg.test(c)?W(c):a(c));V(c)&&(c=new Date(c));if(!aa(c)||!isFinite(c.getTime()))return c;for(;e;)(k=gg.exec(e))?(h=cb(h,k,1),e=h.pop()):(h.push(e),e=null);var n=c.getTimezoneOffset(); +f&&(n=xc(f,c.getTimezoneOffset()),c=Pb(c,f,!0));m(h,function(a){l=hg[a];g+=l?l(c,b.DATETIME_FORMATS,n):a.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function ag(){return function(b,a){A(a)&&(a=2);return db(b,a)}}function bg(){return function(b,a,c){a=Infinity===Math.abs(Number(a))?Number(a):W(a);if(isNaN(a))return b;V(b)&&(b=b.toString());if(!G(b)&&!L(b))return b;c=!c||isNaN(c)?0:W(c);c=0>c&&c>=-b.length?b.length+c:c;return 0<=a?b.slice(c,c+a):0===c?b.slice(a,b.length):b.slice(Math.max(0, +c+a),c)}}function Bd(b){function a(a,c){c=c?-1:1;return a.map(function(a){var d=1,h=Ya;if(z(a))h=a;else if(L(a)){if("+"==a.charAt(0)||"-"==a.charAt(0))d="-"==a.charAt(0)?-1:1,a=a.substring(1);if(""!==a&&(h=b(a),h.constant))var l=h(),h=function(a){return a[l]}}return{get:h,descending:d*c}})}function c(a){switch(typeof a){case "number":case "boolean":case "string":return!0;default:return!1}}return function(b,e,f){if(!Ea(b))return b;G(e)||(e=[e]);0===e.length&&(e=["+"]);var g=a(e,f);b=Array.prototype.map.call(b, +function(a,b){return{value:a,predicateValues:g.map(function(d){var e=d.get(a);d=typeof e;if(null===e)d="string",e="null";else if("string"===d)e=e.toLowerCase();else if("object"===d)a:{if("function"===typeof e.valueOf&&(e=e.valueOf(),c(e)))break a;if(rc(e)&&(e=e.toString(),c(e)))break a;e=b}return{value:e,type:d}})}});b.sort(function(a,b){for(var c=0,d=0,e=g.length;db||37<=b&&40>=b||n(a,this,this.value)});if(e.hasEvent("paste"))a.on("paste cut",n)}a.on("change",l);d.$render=function(){a.val(d.$isEmpty(d.$viewValue)?"":d.$viewValue)}}function Kb(b,a){return function(c,d){var e,f;if(aa(c))return c;if(L(c)){'"'==c.charAt(0)&&'"'==c.charAt(c.length-1)&&(c=c.substring(1,c.length-1)); +if(ig.test(c))return new Date(c);b.lastIndex=0;if(e=b.exec(c))return e.shift(),f=d?{yyyy:d.getFullYear(),MM:d.getMonth()+1,dd:d.getDate(),HH:d.getHours(),mm:d.getMinutes(),ss:d.getSeconds(),sss:d.getMilliseconds()/1E3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},m(e,function(b,c){c=F};g.$observe("min",function(a){F=s(a);h.$validate()})}if(w(g.max)||g.ngMax){var u; +h.$validators.max=function(a){return!r(a)||A(u)||c(a)<=u};g.$observe("max",function(a){u=s(a);h.$validate()})}}}function Id(b,a,c,d){(d.$$hasNativeValidators=H(a[0].validity))&&d.$parsers.push(function(b){var c=a.prop("validity")||{};return c.badInput&&!c.typeMismatch?t:b})}function Jd(b,a,c,d,e){if(w(d)){b=b(d);if(!b.constant)throw J("ngModel")("constexpr",c,d);return b(a)}return e}function lc(b,a){b="ngClass"+b;return["$animate",function(c){function d(a,b){var c=[],d=0;a:for(;d(?:<\/\1>|)$/,Tb=/<|&#?\w+;/,Af=/<([\w:]+)/,Bf=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,na={option:[1,'"],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};na.optgroup=na.option;na.tbody=na.tfoot=na.colgroup=na.caption=na.thead; +na.th=na.td;var Pa=Q.prototype={ready:function(b){function a(){c||(c=!0,b())}var c=!1;"complete"===U.readyState?setTimeout(a):(this.on("DOMContentLoaded",a),Q(O).on("load",a))},toString:function(){var b=[];m(this,function(a){b.push(""+a)});return"["+b.join(", ")+"]"},eq:function(b){return 0<=b?y(this[b]):y(this[this.length+b])},length:0,push:kg,sort:[].sort,splice:[].splice},Ab={};m("multiple selected checked disabled readOnly required open".split(" "),function(b){Ab[M(b)]=b});var Tc={};m("input select option textarea button form details".split(" "), +function(b){Tc[b]=!0});var Uc={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern"};m({data:Wb,removeData:ub,hasData:function(b){for(var a in ib[b.ng339])return!0;return!1}},function(b,a){Q[a]=b});m({data:Wb,inheritedData:zb,scope:function(b){return y.data(b,"$scope")||zb(b.parentNode||b,["$isolateScope","$scope"])},isolateScope:function(b){return y.data(b,"$isolateScope")||y.data(b,"$isolateScopeNoTemplate")},controller:Qc,injector:function(b){return zb(b, +"$injector")},removeAttr:function(b,a){b.removeAttribute(a)},hasClass:wb,css:function(b,a,c){a=hb(a);if(w(c))b.style[a]=c;else return b.style[a]},attr:function(b,a,c){var d=b.nodeType;if(d!==Na&&2!==d&&8!==d)if(d=M(a),Ab[d])if(w(c))c?(b[a]=!0,b.setAttribute(a,d)):(b[a]=!1,b.removeAttribute(d));else return b[a]||(b.attributes.getNamedItem(a)||v).specified?d:t;else if(w(c))b.setAttribute(a,c);else if(b.getAttribute)return b=b.getAttribute(a,2),null===b?t:b},prop:function(b,a,c){if(w(c))b[a]=c;else return b[a]}, +text:function(){function b(a,b){if(A(b)){var d=a.nodeType;return d===qa||d===Na?a.textContent:""}a.textContent=b}b.$dv="";return b}(),val:function(b,a){if(A(a)){if(b.multiple&&"select"===ta(b)){var c=[];m(b.options,function(a){a.selected&&c.push(a.value||a.text)});return 0===c.length?null:c}return b.value}b.value=a},html:function(b,a){if(A(a))return b.innerHTML;tb(b,!0);b.innerHTML=a},empty:Rc},function(b,a){Q.prototype[a]=function(a,d){var e,f,g=this.length;if(b!==Rc&&(2==b.length&&b!==wb&&b!==Qc? +a:d)===t){if(H(a)){for(e=0;e <= >= && || ! = |".split(" "),function(a){Mb[a]=!0});var qg={n:"\n",f:"\f",r:"\r", +t:"\t",v:"\v","'":"'",'"':'"'},gc=function(a){this.options=a};gc.prototype={constructor:gc,lex:function(a){this.text=a;this.index=0;for(this.tokens=[];this.index=a&&"string"===typeof a},isWhitespace:function(a){return" "===a||"\r"===a|| +"\t"===a||"\n"===a||"\v"===a||"\u00a0"===a},isIdent:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,c,d){d=d||this.index;c=w(c)?"s "+c+"-"+this.index+" ["+this.text.substring(c,d)+"]":" "+d;throw da("lexerr",a,c,this.text);},readNumber:function(){for(var a="",c=this.index;this.index","<=",">=");)a={type:q.BinaryExpression,operator:c.text,left:a,right:this.additive()};return a},additive:function(){for(var a=this.multiplicative(),c;c=this.expect("+","-");)a={type:q.BinaryExpression,operator:c.text,left:a,right:this.multiplicative()};return a},multiplicative:function(){for(var a=this.unary(),c;c=this.expect("*","/","%");)a={type:q.BinaryExpression,operator:c.text, +left:a,right:this.unary()};return a},unary:function(){var a;return(a=this.expect("+","-","!"))?{type:q.UnaryExpression,operator:a.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var a;this.expect("(")?(a=this.filterChain(),this.consume(")")):this.expect("[")?a=this.arrayDeclaration():this.expect("{")?a=this.object():this.constants.hasOwnProperty(this.peek().text)?a=fa(this.constants[this.consume().text]):this.peek().identifier?a=this.identifier():this.peek().constant?a=this.constant(): +this.throwError("not a primary expression",this.peek());for(var c;c=this.expect("(","[",".");)"("===c.text?(a={type:q.CallExpression,callee:a,arguments:this.parseArguments()},this.consume(")")):"["===c.text?(a={type:q.MemberExpression,object:a,property:this.expression(),computed:!0},this.consume("]")):"."===c.text?a={type:q.MemberExpression,object:a,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return a},filter:function(a){a=[a];for(var c={type:q.CallExpression,callee:this.identifier(), +arguments:a,filter:!0};this.expect(":");)a.push(this.expression());return c},parseArguments:function(){var a=[];if(")"!==this.peekToken().text){do a.push(this.expression());while(this.expect(","))}return a},identifier:function(){var a=this.consume();a.identifier||this.throwError("is not a valid identifier",a);return{type:q.Identifier,name:a.text}},constant:function(){return{type:q.Literal,value:this.consume().value}},arrayDeclaration:function(){var a=[];if("]"!==this.peekToken().text){do{if(this.peek("]"))break; +a.push(this.expression())}while(this.expect(","))}this.consume("]");return{type:q.ArrayExpression,elements:a}},object:function(){var a=[],c;if("}"!==this.peekToken().text){do{if(this.peek("}"))break;c={type:q.Property,kind:"init"};this.peek().constant?c.key=this.constant():this.peek().identifier?c.key=this.identifier():this.throwError("invalid key",this.peek());this.consume(":");c.value=this.expression();a.push(c)}while(this.expect(","))}this.consume("}");return{type:q.ObjectExpression,properties:a}}, +throwError:function(a,c){throw da("syntax",c.text,a,c.index+1,this.text,this.text.substring(c.index));},consume:function(a){if(0===this.tokens.length)throw da("ueoe",this.text);var c=this.expect(a);c||this.throwError("is unexpected, expecting ["+a+"]",this.peek());return c},peekToken:function(){if(0===this.tokens.length)throw da("ueoe",this.text);return this.tokens[0]},peek:function(a,c,d,e){return this.peekAhead(0,a,c,d,e)},peekAhead:function(a,c,d,e,f){if(this.tokens.length>a){a=this.tokens[a]; +var g=a.text;if(g===c||g===d||g===e||g===f||!(c||d||e||f))return a}return!1},expect:function(a,c,d,e){return(a=this.peek(a,c,d,e))?(this.tokens.shift(),a):!1},constants:{"true":{type:q.Literal,value:!0},"false":{type:q.Literal,value:!1},"null":{type:q.Literal,value:null},undefined:{type:q.Literal,value:t},"this":{type:q.ThisExpression}}};rd.prototype={compile:function(a,c){var d=this,e=this.astBuilder.ast(a);this.state={nextId:0,filters:{},expensiveChecks:c,fn:{vars:[],body:[],own:{}},assign:{vars:[], +body:[],own:{}},inputs:[]};T(e,d.$filter);var f="",g;this.stage="assign";if(g=pd(e))this.state.computing="assign",f=this.nextId(),this.recurse(g,f),f="fn.assign="+this.generateFunction("assign","s,v,l");g=nd(e.body);d.stage="inputs";m(g,function(a,c){var e="fn"+c;d.state[e]={vars:[],body:[],own:{}};d.state.computing=e;var f=d.nextId();d.recurse(a,f);d.return_(f);d.state.inputs.push(e);a.watchId=c});this.state.computing="fn";this.stage="main";this.recurse(e);f='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+ +"var fn="+this.generateFunction("fn","s,l,a,i")+f+this.watchFns()+"return fn;";f=(new Function("$filter","ensureSafeMemberName","ensureSafeObject","ensureSafeFunction","ifDefined","plus","text",f))(this.$filter,Ca,oa,ld,Xf,md,a);this.state=this.stage=t;f.literal=qd(e);f.constant=e.constant;return f},USE:"use",STRICT:"strict",watchFns:function(){var a=[],c=this.state.inputs,d=this;m(c,function(c){a.push("var "+c+"="+d.generateFunction(c,"s"))});c.length&&a.push("fn.inputs=["+c.join(",")+"];");return a.join("")}, +generateFunction:function(a,c){return"function("+c+"){"+this.varsPrefix(a)+this.body(a)+"};"},filterPrefix:function(){var a=[],c=this;m(this.state.filters,function(d,e){a.push(d+"=$filter("+c.escape(e)+")")});return a.length?"var "+a.join(",")+";":""},varsPrefix:function(a){return this.state[a].vars.length?"var "+this.state[a].vars.join(",")+";":""},body:function(a){return this.state[a].body.join("")},recurse:function(a,c,d,e,f,g){var h,l,k=this,n,r;e=e||v;if(!g&&w(a.watchId))c=c||this.nextId(),this.if_("i", +this.lazyAssign(c,this.computedMember("i",a.watchId)),this.lazyRecurse(a,c,d,e,f,!0));else switch(a.type){case q.Program:m(a.body,function(c,d){k.recurse(c.expression,t,t,function(a){l=a});d!==a.body.length-1?k.current().body.push(l,";"):k.return_(l)});break;case q.Literal:r=this.escape(a.value);this.assign(c,r);e(r);break;case q.UnaryExpression:this.recurse(a.argument,t,t,function(a){l=a});r=a.operator+"("+this.ifDefined(l,0)+")";this.assign(c,r);e(r);break;case q.BinaryExpression:this.recurse(a.left, +t,t,function(a){h=a});this.recurse(a.right,t,t,function(a){l=a});r="+"===a.operator?this.plus(h,l):"-"===a.operator?this.ifDefined(h,0)+a.operator+this.ifDefined(l,0):"("+h+")"+a.operator+"("+l+")";this.assign(c,r);e(r);break;case q.LogicalExpression:c=c||this.nextId();k.recurse(a.left,c);k.if_("&&"===a.operator?c:k.not(c),k.lazyRecurse(a.right,c));e(c);break;case q.ConditionalExpression:c=c||this.nextId();k.recurse(a.test,c);k.if_(c,k.lazyRecurse(a.alternate,c),k.lazyRecurse(a.consequent,c));e(c); +break;case q.Identifier:c=c||this.nextId();d&&(d.context="inputs"===k.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",a.name)+"?l:s"),d.computed=!1,d.name=a.name);Ca(a.name);k.if_("inputs"===k.stage||k.not(k.getHasOwnProperty("l",a.name)),function(){k.if_("inputs"===k.stage||"s",function(){f&&1!==f&&k.if_(k.not(k.nonComputedMember("s",a.name)),k.lazyAssign(k.nonComputedMember("s",a.name),"{}"));k.assign(c,k.nonComputedMember("s",a.name))})},c&&k.lazyAssign(c,k.nonComputedMember("l", +a.name)));(k.state.expensiveChecks||Fb(a.name))&&k.addEnsureSafeObject(c);e(c);break;case q.MemberExpression:h=d&&(d.context=this.nextId())||this.nextId();c=c||this.nextId();k.recurse(a.object,h,t,function(){k.if_(k.notNull(h),function(){if(a.computed)l=k.nextId(),k.recurse(a.property,l),k.addEnsureSafeMemberName(l),f&&1!==f&&k.if_(k.not(k.computedMember(h,l)),k.lazyAssign(k.computedMember(h,l),"{}")),r=k.ensureSafeObject(k.computedMember(h,l)),k.assign(c,r),d&&(d.computed=!0,d.name=l);else{Ca(a.property.name); +f&&1!==f&&k.if_(k.not(k.nonComputedMember(h,a.property.name)),k.lazyAssign(k.nonComputedMember(h,a.property.name),"{}"));r=k.nonComputedMember(h,a.property.name);if(k.state.expensiveChecks||Fb(a.property.name))r=k.ensureSafeObject(r);k.assign(c,r);d&&(d.computed=!1,d.name=a.property.name)}},function(){k.assign(c,"undefined")});e(c)},!!f);break;case q.CallExpression:c=c||this.nextId();a.filter?(l=k.filter(a.callee.name),n=[],m(a.arguments,function(a){var c=k.nextId();k.recurse(a,c);n.push(c)}),r=l+ +"("+n.join(",")+")",k.assign(c,r),e(c)):(l=k.nextId(),h={},n=[],k.recurse(a.callee,l,h,function(){k.if_(k.notNull(l),function(){k.addEnsureSafeFunction(l);m(a.arguments,function(a){k.recurse(a,k.nextId(),t,function(a){n.push(k.ensureSafeObject(a))})});h.name?(k.state.expensiveChecks||k.addEnsureSafeObject(h.context),r=k.member(h.context,h.name,h.computed)+"("+n.join(",")+")"):r=l+"("+n.join(",")+")";r=k.ensureSafeObject(r);k.assign(c,r)},function(){k.assign(c,"undefined")});e(c)}));break;case q.AssignmentExpression:l= +this.nextId();h={};if(!od(a.left))throw da("lval");this.recurse(a.left,t,h,function(){k.if_(k.notNull(h.context),function(){k.recurse(a.right,l);k.addEnsureSafeObject(k.member(h.context,h.name,h.computed));r=k.member(h.context,h.name,h.computed)+a.operator+l;k.assign(c,r);e(c||r)})},1);break;case q.ArrayExpression:n=[];m(a.elements,function(a){k.recurse(a,k.nextId(),t,function(a){n.push(a)})});r="["+n.join(",")+"]";this.assign(c,r);e(r);break;case q.ObjectExpression:n=[];m(a.properties,function(a){k.recurse(a.value, +k.nextId(),t,function(c){n.push(k.escape(a.key.type===q.Identifier?a.key.name:""+a.key.value)+":"+c)})});r="{"+n.join(",")+"}";this.assign(c,r);e(r);break;case q.ThisExpression:this.assign(c,"s");e("s");break;case q.NGValueParameter:this.assign(c,"v"),e("v")}},getHasOwnProperty:function(a,c){var d=a+"."+c,e=this.current().own;e.hasOwnProperty(d)||(e[d]=this.nextId(!1,a+"&&("+this.escape(c)+" in "+a+")"));return e[d]},assign:function(a,c){if(a)return this.current().body.push(a,"=",c,";"),a},filter:function(a){this.state.filters.hasOwnProperty(a)|| +(this.state.filters[a]=this.nextId(!0));return this.state.filters[a]},ifDefined:function(a,c){return"ifDefined("+a+","+this.escape(c)+")"},plus:function(a,c){return"plus("+a+","+c+")"},return_:function(a){this.current().body.push("return ",a,";")},if_:function(a,c,d){if(!0===a)c();else{var e=this.current().body;e.push("if(",a,"){");c();e.push("}");d&&(e.push("else{"),d(),e.push("}"))}},not:function(a){return"!("+a+")"},notNull:function(a){return a+"!=null"},nonComputedMember:function(a,c){return a+ +"."+c},computedMember:function(a,c){return a+"["+c+"]"},member:function(a,c,d){return d?this.computedMember(a,c):this.nonComputedMember(a,c)},addEnsureSafeObject:function(a){this.current().body.push(this.ensureSafeObject(a),";")},addEnsureSafeMemberName:function(a){this.current().body.push(this.ensureSafeMemberName(a),";")},addEnsureSafeFunction:function(a){this.current().body.push(this.ensureSafeFunction(a),";")},ensureSafeObject:function(a){return"ensureSafeObject("+a+",text)"},ensureSafeMemberName:function(a){return"ensureSafeMemberName("+ +a+",text)"},ensureSafeFunction:function(a){return"ensureSafeFunction("+a+",text)"},lazyRecurse:function(a,c,d,e,f,g){var h=this;return function(){h.recurse(a,c,d,e,f,g)}},lazyAssign:function(a,c){var d=this;return function(){d.assign(a,c)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)},escape:function(a){if(L(a))return"'"+a.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(V(a))return a.toString();if(!0===a)return"true"; +if(!1===a)return"false";if(null===a)return"null";if("undefined"===typeof a)return"undefined";throw da("esc");},nextId:function(a,c){var d="v"+this.state.nextId++;a||this.current().vars.push(d+(c?"="+c:""));return d},current:function(){return this.state[this.state.computing]}};sd.prototype={compile:function(a,c){var d=this,e=this.astBuilder.ast(a);this.expression=a;this.expensiveChecks=c;T(e,d.$filter);var f,g;if(f=pd(e))g=this.recurse(f);f=nd(e.body);var h;f&&(h=[],m(f,function(a,c){var e=d.recurse(a); +a.input=e;h.push(e);a.watchId=c}));var l=[];m(e.body,function(a){l.push(d.recurse(a.expression))});f=0===e.body.length?function(){}:1===e.body.length?l[0]:function(a,c){var d;m(l,function(e){d=e(a,c)});return d};g&&(f.assign=function(a,c,d){return g(a,d,c)});h&&(f.inputs=h);f.literal=qd(e);f.constant=e.constant;return f},recurse:function(a,c,d){var e,f,g=this,h;if(a.input)return this.inputs(a.input,a.watchId);switch(a.type){case q.Literal:return this.value(a.value,c);case q.UnaryExpression:return f= +this.recurse(a.argument),this["unary"+a.operator](f,c);case q.BinaryExpression:return e=this.recurse(a.left),f=this.recurse(a.right),this["binary"+a.operator](e,f,c);case q.LogicalExpression:return e=this.recurse(a.left),f=this.recurse(a.right),this["binary"+a.operator](e,f,c);case q.ConditionalExpression:return this["ternary?:"](this.recurse(a.test),this.recurse(a.alternate),this.recurse(a.consequent),c);case q.Identifier:return Ca(a.name,g.expression),g.identifier(a.name,g.expensiveChecks||Fb(a.name), +c,d,g.expression);case q.MemberExpression:return e=this.recurse(a.object,!1,!!d),a.computed||(Ca(a.property.name,g.expression),f=a.property.name),a.computed&&(f=this.recurse(a.property)),a.computed?this.computedMember(e,f,c,d,g.expression):this.nonComputedMember(e,f,g.expensiveChecks,c,d,g.expression);case q.CallExpression:return h=[],m(a.arguments,function(a){h.push(g.recurse(a))}),a.filter&&(f=this.$filter(a.callee.name)),a.filter||(f=this.recurse(a.callee,!0)),a.filter?function(a,d,e,g){for(var m= +[],q=0;q":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)>c(e,f,g,h);return d?{value:e}:e}},"binary<=":function(a,c,d){return function(e, +f,g,h){e=a(e,f,g,h)<=c(e,f,g,h);return d?{value:e}:e}},"binary>=":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)>=c(e,f,g,h);return d?{value:e}:e}},"binary&&":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)&&c(e,f,g,h);return d?{value:e}:e}},"binary||":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)||c(e,f,g,h);return d?{value:e}:e}},"ternary?:":function(a,c,d,e){return function(f,g,h,l){f=a(f,g,h,l)?c(f,g,h,l):d(f,g,h,l);return e?{value:f}:f}},value:function(a,c){return function(){return c? +{context:t,name:t,value:a}:a}},identifier:function(a,c,d,e,f){return function(g,h,l,k){g=h&&a in h?h:g;e&&1!==e&&g&&!g[a]&&(g[a]={});h=g?g[a]:t;c&&oa(h,f);return d?{context:g,name:a,value:h}:h}},computedMember:function(a,c,d,e,f){return function(g,h,l,k){var n=a(g,h,l,k),m,s;null!=n&&(m=c(g,h,l,k),Ca(m,f),e&&1!==e&&n&&!n[m]&&(n[m]={}),s=n[m],oa(s,f));return d?{context:n,name:m,value:s}:s}},nonComputedMember:function(a,c,d,e,f,g){return function(h,l,k,n){h=a(h,l,k,n);f&&1!==f&&h&&!h[c]&&(h[c]={}); +l=null!=h?h[c]:t;(d||Fb(c))&&oa(l,g);return e?{context:h,name:c,value:l}:l}},inputs:function(a,c){return function(d,e,f,g){return g?g[c]:a(d,e,f)}}};var hc=function(a,c,d){this.lexer=a;this.$filter=c;this.options=d;this.ast=new q(this.lexer);this.astCompiler=d.csp?new sd(this.ast,c):new rd(this.ast,c)};hc.prototype={constructor:hc,parse:function(a){return this.astCompiler.compile(a,this.options.expensiveChecks)}};ga();ga();var Yf=Object.prototype.valueOf,Da=J("$sce"),pa={HTML:"html",CSS:"css",URL:"url", +RESOURCE_URL:"resourceUrl",JS:"js"},ea=J("$compile"),X=U.createElement("a"),wd=Ba(O.location.href);xd.$inject=["$document"];Lc.$inject=["$provide"];yd.$inject=["$locale"];Ad.$inject=["$locale"];var Dd=".",hg={yyyy:Y("FullYear",4),yy:Y("FullYear",2,0,!0),y:Y("FullYear",1),MMMM:Hb("Month"),MMM:Hb("Month",!0),MM:Y("Month",2,1),M:Y("Month",1,1),dd:Y("Date",2),d:Y("Date",1),HH:Y("Hours",2),H:Y("Hours",1),hh:Y("Hours",2,-12),h:Y("Hours",1,-12),mm:Y("Minutes",2),m:Y("Minutes",1),ss:Y("Seconds",2),s:Y("Seconds", +1),sss:Y("Milliseconds",3),EEEE:Hb("Day"),EEE:Hb("Day",!0),a:function(a,c){return 12>a.getHours()?c.AMPMS[0]:c.AMPMS[1]},Z:function(a,c,d){a=-1*d;return a=(0<=a?"+":"")+(Gb(Math[0=a.getFullYear()?c.ERANAMES[0]:c.ERANAMES[1]}},gg=/((?:[^yMdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,fg=/^\-?\d+$/;zd.$inject=["$locale"];var cg=ra(M),dg=ra(rb);Bd.$inject= +["$parse"];var ie=ra({restrict:"E",compile:function(a,c){if(!c.href&&!c.xlinkHref)return function(a,c){if("a"===c[0].nodeName.toLowerCase()){var f="[object SVGAnimatedString]"===sa.call(c.prop("href"))?"xlink:href":"href";c.on("click",function(a){c.attr(f)||a.preventDefault()})}}}}),sb={};m(Ab,function(a,c){function d(a,d,f){a.$watch(f[e],function(a){f.$set(c,!!a)})}if("multiple"!=a){var e=wa("ng-"+c),f=d;"checked"===a&&(f=function(a,c,f){f.ngModel!==f[e]&&d(a,c,f)});sb[e]=function(){return{restrict:"A", +priority:100,link:f}}}});m(Uc,function(a,c){sb[c]=function(){return{priority:100,link:function(a,e,f){if("ngPattern"===c&&"/"==f.ngPattern.charAt(0)&&(e=f.ngPattern.match(jg))){f.$set("ngPattern",new RegExp(e[1],e[2]));return}a.$watch(f[c],function(a){f.$set(c,a)})}}}});m(["src","srcset","href"],function(a){var c=wa("ng-"+a);sb[c]=function(){return{priority:99,link:function(d,e,f){var g=a,h=a;"href"===a&&"[object SVGAnimatedString]"===sa.call(e.prop("href"))&&(h="xlinkHref",f.$attr[h]="xlink:href", +g=null);f.$observe(c,function(c){c?(f.$set(h,c),Ua&&g&&e.prop(g,f[h])):"href"===a&&f.$set(h,null)})}}}});var Ib={$addControl:v,$$renameControl:function(a,c){a.$name=c},$removeControl:v,$setValidity:v,$setDirty:v,$setPristine:v,$setSubmitted:v};Gd.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var Od=function(a){return["$timeout",function(c){return{name:"form",restrict:a?"EAC":"E",controller:Gd,compile:function(d,e){d.addClass(Va).addClass(mb);var f=e.name?"name":a&&e.ngForm?"ngForm": +!1;return{pre:function(a,d,e,k){if(!("action"in e)){var n=function(c){a.$apply(function(){k.$commitViewValue();k.$setSubmitted()});c.preventDefault()};d[0].addEventListener("submit",n,!1);d.on("$destroy",function(){c(function(){d[0].removeEventListener("submit",n,!1)},0,!1)})}var m=k.$$parentForm;f&&(Eb(a,k.$name,k,k.$name),e.$observe(f,function(c){k.$name!==c&&(Eb(a,k.$name,t,k.$name),m.$$renameControl(k,c),Eb(a,k.$name,k,k.$name))}));d.on("$destroy",function(){m.$removeControl(k);f&&Eb(a,e[f],t, +k.$name);P(k,Ib)})}}}}}]},je=Od(),we=Od(!0),ig=/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/,rg=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,sg=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,tg=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,Pd=/^(\d{4})-(\d{2})-(\d{2})$/,Qd=/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,mc=/^(\d{4})-W(\d\d)$/,Rd=/^(\d{4})-(\d\d)$/, +Sd=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Td={text:function(a,c,d,e,f,g){kb(a,c,d,e,f,g);kc(e)},date:lb("date",Pd,Kb(Pd,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":lb("datetimelocal",Qd,Kb(Qd,"yyyy MM dd HH mm ss sss".split(" ")),"yyyy-MM-ddTHH:mm:ss.sss"),time:lb("time",Sd,Kb(Sd,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:lb("week",mc,function(a,c){if(aa(a))return a;if(L(a)){mc.lastIndex=0;var d=mc.exec(a);if(d){var e=+d[1],f=+d[2],g=d=0,h=0,l=0,k=Ed(e),f=7*(f-1);c&&(d=c.getHours(),g= +c.getMinutes(),h=c.getSeconds(),l=c.getMilliseconds());return new Date(e,0,k.getDate()+f,d,g,h,l)}}return NaN},"yyyy-Www"),month:lb("month",Rd,Kb(Rd,["yyyy","MM"]),"yyyy-MM"),number:function(a,c,d,e,f,g){Id(a,c,d,e);kb(a,c,d,e,f,g);e.$$parserName="number";e.$parsers.push(function(a){return e.$isEmpty(a)?null:tg.test(a)?parseFloat(a):t});e.$formatters.push(function(a){if(!e.$isEmpty(a)){if(!V(a))throw Lb("numfmt",a);a=a.toString()}return a});if(w(d.min)||d.ngMin){var h;e.$validators.min=function(a){return e.$isEmpty(a)|| +A(h)||a>=h};d.$observe("min",function(a){w(a)&&!V(a)&&(a=parseFloat(a,10));h=V(a)&&!isNaN(a)?a:t;e.$validate()})}if(w(d.max)||d.ngMax){var l;e.$validators.max=function(a){return e.$isEmpty(a)||A(l)||a<=l};d.$observe("max",function(a){w(a)&&!V(a)&&(a=parseFloat(a,10));l=V(a)&&!isNaN(a)?a:t;e.$validate()})}},url:function(a,c,d,e,f,g){kb(a,c,d,e,f,g);kc(e);e.$$parserName="url";e.$validators.url=function(a,c){var d=a||c;return e.$isEmpty(d)||rg.test(d)}},email:function(a,c,d,e,f,g){kb(a,c,d,e,f,g);kc(e); +e.$$parserName="email";e.$validators.email=function(a,c){var d=a||c;return e.$isEmpty(d)||sg.test(d)}},radio:function(a,c,d,e){A(d.name)&&c.attr("name",++nb);c.on("click",function(a){c[0].checked&&e.$setViewValue(d.value,a&&a.type)});e.$render=function(){c[0].checked=d.value==e.$viewValue};d.$observe("value",e.$render)},checkbox:function(a,c,d,e,f,g,h,l){var k=Jd(l,a,"ngTrueValue",d.ngTrueValue,!0),n=Jd(l,a,"ngFalseValue",d.ngFalseValue,!1);c.on("click",function(a){e.$setViewValue(c[0].checked,a&& +a.type)});e.$render=function(){c[0].checked=e.$viewValue};e.$isEmpty=function(a){return!1===a};e.$formatters.push(function(a){return ka(a,k)});e.$parsers.push(function(a){return a?k:n})},hidden:v,button:v,submit:v,reset:v,file:v},Fc=["$browser","$sniffer","$filter","$parse",function(a,c,d,e){return{restrict:"E",require:["?ngModel"],link:{pre:function(f,g,h,l){l[0]&&(Td[M(h.type)]||Td.text)(f,g,h,l[0],c,a,d,e)}}}}],ug=/^(true|false|\d+)$/,Oe=function(){return{restrict:"A",priority:100,compile:function(a, +c){return ug.test(c.ngValue)?function(a,c,f){f.$set("value",a.$eval(f.ngValue))}:function(a,c,f){a.$watch(f.ngValue,function(a){f.$set("value",a)})}}}},oe=["$compile",function(a){return{restrict:"AC",compile:function(c){a.$$addBindingClass(c);return function(c,e,f){a.$$addBindingInfo(e,f.ngBind);e=e[0];c.$watch(f.ngBind,function(a){e.textContent=a===t?"":a})}}}}],qe=["$interpolate","$compile",function(a,c){return{compile:function(d){c.$$addBindingClass(d);return function(d,f,g){d=a(f.attr(g.$attr.ngBindTemplate)); +c.$$addBindingInfo(f,d.expressions);f=f[0];g.$observe("ngBindTemplate",function(a){f.textContent=a===t?"":a})}}}}],pe=["$sce","$parse","$compile",function(a,c,d){return{restrict:"A",compile:function(e,f){var g=c(f.ngBindHtml),h=c(f.ngBindHtml,function(a){return(a||"").toString()});d.$$addBindingClass(e);return function(c,e,f){d.$$addBindingInfo(e,f.ngBindHtml);c.$watch(h,function(){e.html(a.getTrustedHtml(g(c))||"")})}}}}],Ne=ra({restrict:"A",require:"ngModel",link:function(a,c,d,e){e.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}), +re=lc("",!0),te=lc("Odd",0),se=lc("Even",1),ue=Ma({compile:function(a,c){c.$set("ngCloak",t);a.removeClass("ng-cloak")}}),ve=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],Kc={},vg={blur:!0,focus:!0};m("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(a){var c=wa("ng-"+a);Kc[c]=["$parse","$rootScope",function(d,e){return{restrict:"A",compile:function(f,g){var h= +d(g[c],null,!0);return function(c,d){d.on(a,function(d){var f=function(){h(c,{$event:d})};vg[a]&&e.$$phase?c.$evalAsync(f):c.$apply(f)})}}}}]});var ye=["$animate",function(a){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(c,d,e,f,g){var h,l,k;c.$watch(e.ngIf,function(c){c?l||g(function(c,f){l=f;c[c.length++]=U.createComment(" end ngIf: "+e.ngIf+" ");h={clone:c};a.enter(c,d.parent(),d)}):(k&&(k.remove(),k=null),l&&(l.$destroy(),l=null),h&&(k= +qb(h.clone),a.leave(k).then(function(){k=null}),h=null))})}}}],ze=["$templateRequest","$anchorScroll","$animate",function(a,c,d){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:ca.noop,compile:function(e,f){var g=f.ngInclude||f.src,h=f.onload||"",l=f.autoscroll;return function(e,f,m,s,q){var t=0,F,u,p,v=function(){u&&(u.remove(),u=null);F&&(F.$destroy(),F=null);p&&(d.leave(p).then(function(){u=null}),u=p,p=null)};e.$watch(g,function(g){var m=function(){!w(l)||l&&!e.$eval(l)|| +c()},r=++t;g?(a(g,!0).then(function(a){if(r===t){var c=e.$new();s.template=a;a=q(c,function(a){v();d.enter(a,null,f).then(m)});F=c;p=a;F.$emit("$includeContentLoaded",g);e.$eval(h)}},function(){r===t&&(v(),e.$emit("$includeContentError",g))}),e.$emit("$includeContentRequested",g)):(v(),s.template=null)})}}}}],Qe=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(c,d,e,f){/SVG/.test(d[0].toString())?(d.empty(),a(Nc(f.template,U).childNodes)(c,function(a){d.append(a)}, +{futureParentElement:d})):(d.html(f.template),a(d.contents())(c))}}}],Ae=Ma({priority:450,compile:function(){return{pre:function(a,c,d){a.$eval(d.ngInit)}}}}),Me=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(a,c,d,e){var f=c.attr(d.$attr.ngList)||", ",g="false"!==d.ngTrim,h=g?R(f):f;e.$parsers.push(function(a){if(!A(a)){var c=[];a&&m(a.split(h),function(a){a&&c.push(g?R(a):a)});return c}});e.$formatters.push(function(a){return G(a)?a.join(f):t});e.$isEmpty=function(a){return!a|| +!a.length}}}},mb="ng-valid",Kd="ng-invalid",Va="ng-pristine",Jb="ng-dirty",Md="ng-pending",Lb=new J("ngModel"),wg=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$rootScope","$q","$interpolate",function(a,c,d,e,f,g,h,l,k,n){this.$modelValue=this.$viewValue=Number.NaN;this.$$rawModelValue=t;this.$validators={};this.$asyncValidators={};this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$untouched=!0;this.$touched=!1;this.$pristine=!0;this.$dirty= +!1;this.$valid=!0;this.$invalid=!1;this.$error={};this.$$success={};this.$pending=t;this.$name=n(d.name||"",!1)(a);var r=f(d.ngModel),s=r.assign,q=r,C=s,F=null,u,p=this;this.$$setOptions=function(a){if((p.$options=a)&&a.getterSetter){var c=f(d.ngModel+"()"),g=f(d.ngModel+"($$$p)");q=function(a){var d=r(a);z(d)&&(d=c(a));return d};C=function(a,c){z(r(a))?g(a,{$$$p:p.$modelValue}):s(a,p.$modelValue)}}else if(!r.assign)throw Lb("nonassign",d.ngModel,ua(e));};this.$render=v;this.$isEmpty=function(a){return A(a)|| +""===a||null===a||a!==a};var K=e.inheritedData("$formController")||Ib,y=0;Hd({ctrl:this,$element:e,set:function(a,c){a[c]=!0},unset:function(a,c){delete a[c]},parentForm:K,$animate:g});this.$setPristine=function(){p.$dirty=!1;p.$pristine=!0;g.removeClass(e,Jb);g.addClass(e,Va)};this.$setDirty=function(){p.$dirty=!0;p.$pristine=!1;g.removeClass(e,Va);g.addClass(e,Jb);K.$setDirty()};this.$setUntouched=function(){p.$touched=!1;p.$untouched=!0;g.setClass(e,"ng-untouched","ng-touched")};this.$setTouched= +function(){p.$touched=!0;p.$untouched=!1;g.setClass(e,"ng-touched","ng-untouched")};this.$rollbackViewValue=function(){h.cancel(F);p.$viewValue=p.$$lastCommittedViewValue;p.$render()};this.$validate=function(){if(!V(p.$modelValue)||!isNaN(p.$modelValue)){var a=p.$$rawModelValue,c=p.$valid,d=p.$modelValue,e=p.$options&&p.$options.allowInvalid;p.$$runValidators(a,p.$$lastCommittedViewValue,function(f){e||c===f||(p.$modelValue=f?a:t,p.$modelValue!==d&&p.$$writeModelToScope())})}};this.$$runValidators= +function(a,c,d){function e(){var d=!0;m(p.$validators,function(e,f){var h=e(a,c);d=d&&h;g(f,h)});return d?!0:(m(p.$asyncValidators,function(a,c){g(c,null)}),!1)}function f(){var d=[],e=!0;m(p.$asyncValidators,function(f,h){var k=f(a,c);if(!k||!z(k.then))throw Lb("$asyncValidators",k);g(h,t);d.push(k.then(function(){g(h,!0)},function(a){e=!1;g(h,!1)}))});d.length?k.all(d).then(function(){h(e)},v):h(!0)}function g(a,c){l===y&&p.$setValidity(a,c)}function h(a){l===y&&d(a)}y++;var l=y;(function(){var a= +p.$$parserName||"parse";if(u===t)g(a,null);else return u||(m(p.$validators,function(a,c){g(c,null)}),m(p.$asyncValidators,function(a,c){g(c,null)})),g(a,u),u;return!0})()?e()?f():h(!1):h(!1)};this.$commitViewValue=function(){var a=p.$viewValue;h.cancel(F);if(p.$$lastCommittedViewValue!==a||""===a&&p.$$hasNativeValidators)p.$$lastCommittedViewValue=a,p.$pristine&&this.$setDirty(),this.$$parseAndValidate()};this.$$parseAndValidate=function(){var c=p.$$lastCommittedViewValue;if(u=A(c)?t:!0)for(var d= +0;df||e.$isEmpty(c)||c.length<=f}}}}},Ic=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){if(e){var f=0;d.$observe("minlength",function(a){f=W(a)||0;e.$validate()});e.$validators.minlength=function(a,c){return e.$isEmpty(c)||c.length>=f}}}}};O.angular.bootstrap?console.log("WARNING: Tried to load angular more than once."):(ce(),ee(ca),y(U).ready(function(){Zd(U,Ac)}))})(window,document);!window.angular.$$csp()&&window.angular.element(document.head).prepend(''); +//# sourceMappingURL=angular.min.js.map diff --git a/app/lib/angular/angular-animate.min.js b/app/lib/angular/angular-animate.min.js deleted file mode 100644 index 931b6d0f..00000000 --- a/app/lib/angular/angular-animate.min.js +++ /dev/null @@ -1,25 +0,0 @@ -/* - AngularJS v1.2.11 - (c) 2010-2014 Google, Inc. http://angularjs.org - License: MIT -*/ -(function(v,k,t){'use strict';k.module("ngAnimate",["ng"]).factory("$$animateReflow",["$window","$timeout",function(k,B){var d=k.requestAnimationFrame||k.webkitRequestAnimationFrame||function(d){return B(d,10,!1)},q=k.cancelAnimationFrame||k.webkitCancelAnimationFrame||function(d){return B.cancel(d)};return function(p){var k=d(p);return function(){q(k)}}}]).config(["$provide","$animateProvider",function(R,B){function d(d){for(var k=0;k=u&&a>=p&&h()}var f=b.data(n),g=d(b);if(-1!=g.className.indexOf(a)&&f){var l=f.timings,m=f.stagger,p=f.maxDuration,r=f.activeClassName,u=Math.max(l.transitionDelay, -l.animationDelay)*x,w=Date.now(),v=T+" "+S,t=f.itemIndex,q="",s=[];if(0 - * describe('$exceptionHandlerProvider', function() { - * - * it('should capture log messages and exceptions', function() { - * - * module(function($exceptionHandlerProvider) { - * $exceptionHandlerProvider.mode('log'); - * }); - * - * inject(function($log, $exceptionHandler, $timeout) { - * $timeout(function() { $log.log(1); }); - * $timeout(function() { $log.log(2); throw 'banana peel'; }); - * $timeout(function() { $log.log(3); }); - * expect($exceptionHandler.errors).toEqual([]); - * expect($log.assertEmpty()); - * $timeout.flush(); - * expect($exceptionHandler.errors).toEqual(['banana peel']); - * expect($log.log.logs).toEqual([[1], [2], [3]]); - * }); - * }); - * }); - * - */ - -angular.mock.$ExceptionHandlerProvider = function() { - var handler; - - /** - * @ngdoc method - * @name ngMock.$exceptionHandlerProvider#mode - * @methodOf ngMock.$exceptionHandlerProvider - * - * @description - * Sets the logging mode. - * - * @param {string} mode Mode of operation, defaults to `rethrow`. - * - * - `rethrow`: If any errors are passed into the handler in tests, it typically - * means that there is a bug in the application or test, so this mock will - * make these tests fail. - * - `log`: Sometimes it is desirable to test that an error is thrown, for this case the `log` - * mode stores an array of errors in `$exceptionHandler.errors`, to allow later - * assertion of them. See {@link ngMock.$log#assertEmpty assertEmpty()} and - * {@link ngMock.$log#reset reset()} - */ - this.mode = function(mode) { - switch(mode) { - case 'rethrow': - handler = function(e) { - throw e; - }; - break; - case 'log': - var errors = []; - - handler = function(e) { - if (arguments.length == 1) { - errors.push(e); - } else { - errors.push([].slice.call(arguments, 0)); - } - }; - - handler.errors = errors; - break; - default: - throw new Error("Unknown mode '" + mode + "', only 'log'/'rethrow' modes are allowed!"); - } - }; - - this.$get = function() { - return handler; - }; - - this.mode('rethrow'); -}; - - -/** - * @ngdoc service - * @name ngMock.$log - * - * @description - * Mock implementation of {@link ng.$log} that gathers all logged messages in arrays - * (one array per logging level). These arrays are exposed as `logs` property of each of the - * level-specific log function, e.g. for level `error` the array is exposed as `$log.error.logs`. - * - */ -angular.mock.$LogProvider = function() { - var debug = true; - - function concat(array1, array2, index) { - return array1.concat(Array.prototype.slice.call(array2, index)); - } - - this.debugEnabled = function(flag) { - if (angular.isDefined(flag)) { - debug = flag; - return this; - } else { - return debug; - } - }; - - this.$get = function () { - var $log = { - log: function() { $log.log.logs.push(concat([], arguments, 0)); }, - warn: function() { $log.warn.logs.push(concat([], arguments, 0)); }, - info: function() { $log.info.logs.push(concat([], arguments, 0)); }, - error: function() { $log.error.logs.push(concat([], arguments, 0)); }, - debug: function() { - if (debug) { - $log.debug.logs.push(concat([], arguments, 0)); - } - } - }; - - /** - * @ngdoc method - * @name ngMock.$log#reset - * @methodOf ngMock.$log - * - * @description - * Reset all of the logging arrays to empty. - */ - $log.reset = function () { - /** - * @ngdoc property - * @name ngMock.$log#log.logs - * @propertyOf ngMock.$log - * - * @description - * Array of messages logged using {@link ngMock.$log#log}. - * - * @example - *
-       * $log.log('Some Log');
-       * var first = $log.log.logs.unshift();
-       * 
- */ - $log.log.logs = []; - /** - * @ngdoc property - * @name ngMock.$log#info.logs - * @propertyOf ngMock.$log - * - * @description - * Array of messages logged using {@link ngMock.$log#info}. - * - * @example - *
-       * $log.info('Some Info');
-       * var first = $log.info.logs.unshift();
-       * 
- */ - $log.info.logs = []; - /** - * @ngdoc property - * @name ngMock.$log#warn.logs - * @propertyOf ngMock.$log - * - * @description - * Array of messages logged using {@link ngMock.$log#warn}. - * - * @example - *
-       * $log.warn('Some Warning');
-       * var first = $log.warn.logs.unshift();
-       * 
- */ - $log.warn.logs = []; - /** - * @ngdoc property - * @name ngMock.$log#error.logs - * @propertyOf ngMock.$log - * - * @description - * Array of messages logged using {@link ngMock.$log#error}. - * - * @example - *
-       * $log.error('Some Error');
-       * var first = $log.error.logs.unshift();
-       * 
- */ - $log.error.logs = []; - /** - * @ngdoc property - * @name ngMock.$log#debug.logs - * @propertyOf ngMock.$log - * - * @description - * Array of messages logged using {@link ngMock.$log#debug}. - * - * @example - *
-       * $log.debug('Some Error');
-       * var first = $log.debug.logs.unshift();
-       * 
- */ - $log.debug.logs = []; - }; - - /** - * @ngdoc method - * @name ngMock.$log#assertEmpty - * @methodOf ngMock.$log - * - * @description - * Assert that the all of the logging methods have no logged messages. If messages present, an - * exception is thrown. - */ - $log.assertEmpty = function() { - var errors = []; - angular.forEach(['error', 'warn', 'info', 'log', 'debug'], function(logLevel) { - angular.forEach($log[logLevel].logs, function(log) { - angular.forEach(log, function (logItem) { - errors.push('MOCK $log (' + logLevel + '): ' + String(logItem) + '\n' + - (logItem.stack || '')); - }); - }); - }); - if (errors.length) { - errors.unshift("Expected $log to be empty! Either a message was logged unexpectedly, or "+ - "an expected log message was not checked and removed:"); - errors.push(''); - throw new Error(errors.join('\n---------\n')); - } - }; - - $log.reset(); - return $log; - }; -}; - - -/** - * @ngdoc service - * @name ngMock.$interval - * - * @description - * Mock implementation of the $interval service. - * - * Use {@link ngMock.$interval#methods_flush `$interval.flush(millis)`} to - * move forward by `millis` milliseconds and trigger any functions scheduled to run in that - * time. - * - * @param {function()} fn A function that should be called repeatedly. - * @param {number} delay Number of milliseconds between each function call. - * @param {number=} [count=0] Number of times to repeat. If not set, or 0, will repeat - * indefinitely. - * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise - * will invoke `fn` within the {@link ng.$rootScope.Scope#methods_$apply $apply} block. - * @returns {promise} A promise which will be notified on each iteration. - */ -angular.mock.$IntervalProvider = function() { - this.$get = ['$rootScope', '$q', - function($rootScope, $q) { - var repeatFns = [], - nextRepeatId = 0, - now = 0; - - var $interval = function(fn, delay, count, invokeApply) { - var deferred = $q.defer(), - promise = deferred.promise, - iteration = 0, - skipApply = (angular.isDefined(invokeApply) && !invokeApply); - - count = (angular.isDefined(count)) ? count : 0, - promise.then(null, null, fn); - - promise.$$intervalId = nextRepeatId; - - function tick() { - deferred.notify(iteration++); - - if (count > 0 && iteration >= count) { - var fnIndex; - deferred.resolve(iteration); - - angular.forEach(repeatFns, function(fn, index) { - if (fn.id === promise.$$intervalId) fnIndex = index; - }); - - if (fnIndex !== undefined) { - repeatFns.splice(fnIndex, 1); - } - } - - if (!skipApply) $rootScope.$apply(); - } - - repeatFns.push({ - nextTime:(now + delay), - delay: delay, - fn: tick, - id: nextRepeatId, - deferred: deferred - }); - repeatFns.sort(function(a,b){ return a.nextTime - b.nextTime;}); - - nextRepeatId++; - return promise; - }; - - $interval.cancel = function(promise) { - var fnIndex; - - angular.forEach(repeatFns, function(fn, index) { - if (fn.id === promise.$$intervalId) fnIndex = index; - }); - - if (fnIndex !== undefined) { - repeatFns[fnIndex].deferred.reject('canceled'); - repeatFns.splice(fnIndex, 1); - return true; - } - - return false; - }; - - /** - * @ngdoc method - * @name ngMock.$interval#flush - * @methodOf ngMock.$interval - * @description - * - * Runs interval tasks scheduled to be run in the next `millis` milliseconds. - * - * @param {number=} millis maximum timeout amount to flush up until. - * - * @return {number} The amount of time moved forward. - */ - $interval.flush = function(millis) { - now += millis; - while (repeatFns.length && repeatFns[0].nextTime <= now) { - var task = repeatFns[0]; - task.fn(); - task.nextTime += task.delay; - repeatFns.sort(function(a,b){ return a.nextTime - b.nextTime;}); - } - return millis; - }; - - return $interval; - }]; -}; - - -/* jshint -W101 */ -/* The R_ISO8061_STR regex is never going to fit into the 100 char limit! - * This directive should go inside the anonymous function but a bug in JSHint means that it would - * not be enacted early enough to prevent the warning. - */ -var R_ISO8061_STR = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?:\:?(\d\d)(?:\:?(\d\d)(?:\.(\d{3}))?)?)?(Z|([+-])(\d\d):?(\d\d)))?$/; - -function jsonStringToDate(string) { - var match; - if (match = string.match(R_ISO8061_STR)) { - var date = new Date(0), - tzHour = 0, - tzMin = 0; - if (match[9]) { - tzHour = int(match[9] + match[10]); - tzMin = int(match[9] + match[11]); - } - date.setUTCFullYear(int(match[1]), int(match[2]) - 1, int(match[3])); - date.setUTCHours(int(match[4]||0) - tzHour, - int(match[5]||0) - tzMin, - int(match[6]||0), - int(match[7]||0)); - return date; - } - return string; -} - -function int(str) { - return parseInt(str, 10); -} - -function padNumber(num, digits, trim) { - var neg = ''; - if (num < 0) { - neg = '-'; - num = -num; - } - num = '' + num; - while(num.length < digits) num = '0' + num; - if (trim) - num = num.substr(num.length - digits); - return neg + num; -} - - -/** - * @ngdoc object - * @name angular.mock.TzDate - * @description - * - * *NOTE*: this is not an injectable instance, just a globally available mock class of `Date`. - * - * Mock of the Date type which has its timezone specified via constructor arg. - * - * The main purpose is to create Date-like instances with timezone fixed to the specified timezone - * offset, so that we can test code that depends on local timezone settings without dependency on - * the time zone settings of the machine where the code is running. - * - * @param {number} offset Offset of the *desired* timezone in hours (fractions will be honored) - * @param {(number|string)} timestamp Timestamp representing the desired time in *UTC* - * - * @example - * !!!! WARNING !!!!! - * This is not a complete Date object so only methods that were implemented can be called safely. - * To make matters worse, TzDate instances inherit stuff from Date via a prototype. - * - * We do our best to intercept calls to "unimplemented" methods, but since the list of methods is - * incomplete we might be missing some non-standard methods. This can result in errors like: - * "Date.prototype.foo called on incompatible Object". - * - *
- * var newYearInBratislava = new TzDate(-1, '2009-12-31T23:00:00Z');
- * newYearInBratislava.getTimezoneOffset() => -60;
- * newYearInBratislava.getFullYear() => 2010;
- * newYearInBratislava.getMonth() => 0;
- * newYearInBratislava.getDate() => 1;
- * newYearInBratislava.getHours() => 0;
- * newYearInBratislava.getMinutes() => 0;
- * newYearInBratislava.getSeconds() => 0;
- * 
- * - */ -angular.mock.TzDate = function (offset, timestamp) { - var self = new Date(0); - if (angular.isString(timestamp)) { - var tsStr = timestamp; - - self.origDate = jsonStringToDate(timestamp); - - timestamp = self.origDate.getTime(); - if (isNaN(timestamp)) - throw { - name: "Illegal Argument", - message: "Arg '" + tsStr + "' passed into TzDate constructor is not a valid date string" - }; - } else { - self.origDate = new Date(timestamp); - } - - var localOffset = new Date(timestamp).getTimezoneOffset(); - self.offsetDiff = localOffset*60*1000 - offset*1000*60*60; - self.date = new Date(timestamp + self.offsetDiff); - - self.getTime = function() { - return self.date.getTime() - self.offsetDiff; - }; - - self.toLocaleDateString = function() { - return self.date.toLocaleDateString(); - }; - - self.getFullYear = function() { - return self.date.getFullYear(); - }; - - self.getMonth = function() { - return self.date.getMonth(); - }; - - self.getDate = function() { - return self.date.getDate(); - }; - - self.getHours = function() { - return self.date.getHours(); - }; - - self.getMinutes = function() { - return self.date.getMinutes(); - }; - - self.getSeconds = function() { - return self.date.getSeconds(); - }; - - self.getMilliseconds = function() { - return self.date.getMilliseconds(); - }; - - self.getTimezoneOffset = function() { - return offset * 60; - }; - - self.getUTCFullYear = function() { - return self.origDate.getUTCFullYear(); - }; - - self.getUTCMonth = function() { - return self.origDate.getUTCMonth(); - }; - - self.getUTCDate = function() { - return self.origDate.getUTCDate(); - }; - - self.getUTCHours = function() { - return self.origDate.getUTCHours(); - }; - - self.getUTCMinutes = function() { - return self.origDate.getUTCMinutes(); - }; - - self.getUTCSeconds = function() { - return self.origDate.getUTCSeconds(); - }; - - self.getUTCMilliseconds = function() { - return self.origDate.getUTCMilliseconds(); - }; - - self.getDay = function() { - return self.date.getDay(); - }; - - // provide this method only on browsers that already have it - if (self.toISOString) { - self.toISOString = function() { - return padNumber(self.origDate.getUTCFullYear(), 4) + '-' + - padNumber(self.origDate.getUTCMonth() + 1, 2) + '-' + - padNumber(self.origDate.getUTCDate(), 2) + 'T' + - padNumber(self.origDate.getUTCHours(), 2) + ':' + - padNumber(self.origDate.getUTCMinutes(), 2) + ':' + - padNumber(self.origDate.getUTCSeconds(), 2) + '.' + - padNumber(self.origDate.getUTCMilliseconds(), 3) + 'Z'; - }; - } - - //hide all methods not implemented in this mock that the Date prototype exposes - var unimplementedMethods = ['getUTCDay', - 'getYear', 'setDate', 'setFullYear', 'setHours', 'setMilliseconds', - 'setMinutes', 'setMonth', 'setSeconds', 'setTime', 'setUTCDate', 'setUTCFullYear', - 'setUTCHours', 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth', 'setUTCSeconds', - 'setYear', 'toDateString', 'toGMTString', 'toJSON', 'toLocaleFormat', 'toLocaleString', - 'toLocaleTimeString', 'toSource', 'toString', 'toTimeString', 'toUTCString', 'valueOf']; - - angular.forEach(unimplementedMethods, function(methodName) { - self[methodName] = function() { - throw new Error("Method '" + methodName + "' is not implemented in the TzDate mock"); - }; - }); - - return self; -}; - -//make "tzDateInstance instanceof Date" return true -angular.mock.TzDate.prototype = Date.prototype; -/* jshint +W101 */ - -// TODO(matias): remove this IMMEDIATELY once we can properly detect the -// presence of a registered module -var animateLoaded; -try { - angular.module('ngAnimate'); - animateLoaded = true; -} catch(e) {} - -if(animateLoaded) { - angular.module('ngAnimate').config(['$provide', function($provide) { - var reflowQueue = []; - $provide.value('$$animateReflow', function(fn) { - reflowQueue.push(fn); - return angular.noop; - }); - $provide.decorator('$animate', function($delegate) { - $delegate.triggerReflow = function() { - if(reflowQueue.length === 0) { - throw new Error('No animation reflows present'); - } - angular.forEach(reflowQueue, function(fn) { - fn(); - }); - reflowQueue = []; - }; - return $delegate; - }); - }]); -} - -angular.mock.animate = angular.module('mock.animate', ['ng']) - - .config(['$provide', function($provide) { - - $provide.decorator('$animate', function($delegate) { - var animate = { - queue : [], - enabled : $delegate.enabled, - flushNext : function(name) { - var tick = animate.queue.shift(); - - if (!tick) throw new Error('No animation to be flushed'); - if(tick.method !== name) { - throw new Error('The next animation is not "' + name + - '", but is "' + tick.method + '"'); - } - tick.fn(); - return tick; - } - }; - - angular.forEach(['enter','leave','move','addClass','removeClass'], function(method) { - animate[method] = function() { - var params = arguments; - animate.queue.push({ - method : method, - params : params, - element : angular.isElement(params[0]) && params[0], - parent : angular.isElement(params[1]) && params[1], - after : angular.isElement(params[2]) && params[2], - fn : function() { - $delegate[method].apply($delegate, params); - } - }); - }; - }); - - return animate; - }); - - }]); - - -/** - * @ngdoc function - * @name angular.mock.dump - * @description - * - * *NOTE*: this is not an injectable instance, just a globally available function. - * - * Method for serializing common angular objects (scope, elements, etc..) into strings, useful for - * debugging. - * - * This method is also available on window, where it can be used to display objects on debug - * console. - * - * @param {*} object - any object to turn into string. - * @return {string} a serialized string of the argument - */ -angular.mock.dump = function(object) { - return serialize(object); - - function serialize(object) { - var out; - - if (angular.isElement(object)) { - object = angular.element(object); - out = angular.element('
'); - angular.forEach(object, function(element) { - out.append(angular.element(element).clone()); - }); - out = out.html(); - } else if (angular.isArray(object)) { - out = []; - angular.forEach(object, function(o) { - out.push(serialize(o)); - }); - out = '[ ' + out.join(', ') + ' ]'; - } else if (angular.isObject(object)) { - if (angular.isFunction(object.$eval) && angular.isFunction(object.$apply)) { - out = serializeScope(object); - } else if (object instanceof Error) { - out = object.stack || ('' + object.name + ': ' + object.message); - } else { - // TODO(i): this prevents methods being logged, - // we should have a better way to serialize objects - out = angular.toJson(object, true); - } - } else { - out = String(object); - } - - return out; - } - - function serializeScope(scope, offset) { - offset = offset || ' '; - var log = [offset + 'Scope(' + scope.$id + '): {']; - for ( var key in scope ) { - if (Object.prototype.hasOwnProperty.call(scope, key) && !key.match(/^(\$|this)/)) { - log.push(' ' + key + ': ' + angular.toJson(scope[key])); - } - } - var child = scope.$$childHead; - while(child) { - log.push(serializeScope(child, offset + ' ')); - child = child.$$nextSibling; - } - log.push('}'); - return log.join('\n' + offset); - } -}; - -/** - * @ngdoc object - * @name ngMock.$httpBackend - * @description - * Fake HTTP backend implementation suitable for unit testing applications that use the - * {@link ng.$http $http service}. - * - * *Note*: For fake HTTP backend implementation suitable for end-to-end testing or backend-less - * development please see {@link ngMockE2E.$httpBackend e2e $httpBackend mock}. - * - * During unit testing, we want our unit tests to run quickly and have no external dependencies so - * we don’t want to send {@link https://developer.mozilla.org/en/xmlhttprequest XHR} or - * {@link http://en.wikipedia.org/wiki/JSONP JSONP} requests to a real server. All we really need is - * to verify whether a certain request has been sent or not, or alternatively just let the - * application make requests, respond with pre-trained responses and assert that the end result is - * what we expect it to be. - * - * This mock implementation can be used to respond with static or dynamic responses via the - * `expect` and `when` apis and their shortcuts (`expectGET`, `whenPOST`, etc). - * - * When an Angular application needs some data from a server, it calls the $http service, which - * sends the request to a real server using $httpBackend service. With dependency injection, it is - * easy to inject $httpBackend mock (which has the same API as $httpBackend) and use it to verify - * the requests and respond with some testing data without sending a request to real server. - * - * There are two ways to specify what test data should be returned as http responses by the mock - * backend when the code under test makes http requests: - * - * - `$httpBackend.expect` - specifies a request expectation - * - `$httpBackend.when` - specifies a backend definition - * - * - * # Request Expectations vs Backend Definitions - * - * Request expectations provide a way to make assertions about requests made by the application and - * to define responses for those requests. The test will fail if the expected requests are not made - * or they are made in the wrong order. - * - * Backend definitions allow you to define a fake backend for your application which doesn't assert - * if a particular request was made or not, it just returns a trained response if a request is made. - * The test will pass whether or not the request gets made during testing. - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Request expectationsBackend definitions
Syntax.expect(...).respond(...).when(...).respond(...)
Typical usagestrict unit testsloose (black-box) unit testing
Fulfills multiple requestsNOYES
Order of requests mattersYESNO
Request requiredYESNO
Response requiredoptional (see below)YES
- * - * In cases where both backend definitions and request expectations are specified during unit - * testing, the request expectations are evaluated first. - * - * If a request expectation has no response specified, the algorithm will search your backend - * definitions for an appropriate response. - * - * If a request didn't match any expectation or if the expectation doesn't have the response - * defined, the backend definitions are evaluated in sequential order to see if any of them match - * the request. The response from the first matched definition is returned. - * - * - * # Flushing HTTP requests - * - * The $httpBackend used in production always responds to requests with responses asynchronously. - * If we preserved this behavior in unit testing we'd have to create async unit tests, which are - * hard to write, understand, and maintain. However, the testing mock can't respond - * synchronously because that would change the execution of the code under test. For this reason the - * mock $httpBackend has a `flush()` method, which allows the test to explicitly flush pending - * requests and thus preserve the async api of the backend while allowing the test to execute - * synchronously. - * - * - * # Unit testing with mock $httpBackend - * The following code shows how to setup and use the mock backend when unit testing a controller. - * First we create the controller under test: - * -
-  // The controller code
-  function MyController($scope, $http) {
-    var authToken;
-
-    $http.get('/auth.py').success(function(data, status, headers) {
-      authToken = headers('A-Token');
-      $scope.user = data;
-    });
-
-    $scope.saveMessage = function(message) {
-      var headers = { 'Authorization': authToken };
-      $scope.status = 'Saving...';
-
-      $http.post('/add-msg.py', message, { headers: headers } ).success(function(response) {
-        $scope.status = '';
-      }).error(function() {
-        $scope.status = 'ERROR!';
-      });
-    };
-  }
-  
- * - * Now we setup the mock backend and create the test specs: - * -
-    // testing controller
-    describe('MyController', function() {
-       var $httpBackend, $rootScope, createController;
-
-       beforeEach(inject(function($injector) {
-         // Set up the mock http service responses
-         $httpBackend = $injector.get('$httpBackend');
-         // backend definition common for all tests
-         $httpBackend.when('GET', '/auth.py').respond({userId: 'userX'}, {'A-Token': 'xxx'});
-
-         // Get hold of a scope (i.e. the root scope)
-         $rootScope = $injector.get('$rootScope');
-         // The $controller service is used to create instances of controllers
-         var $controller = $injector.get('$controller');
-
-         createController = function() {
-           return $controller('MyController', {'$scope' : $rootScope });
-         };
-       }));
-
-
-       afterEach(function() {
-         $httpBackend.verifyNoOutstandingExpectation();
-         $httpBackend.verifyNoOutstandingRequest();
-       });
-
-
-       it('should fetch authentication token', function() {
-         $httpBackend.expectGET('/auth.py');
-         var controller = createController();
-         $httpBackend.flush();
-       });
-
-
-       it('should send msg to server', function() {
-         var controller = createController();
-         $httpBackend.flush();
-
-         // now you don’t care about the authentication, but
-         // the controller will still send the request and
-         // $httpBackend will respond without you having to
-         // specify the expectation and response for this request
-
-         $httpBackend.expectPOST('/add-msg.py', 'message content').respond(201, '');
-         $rootScope.saveMessage('message content');
-         expect($rootScope.status).toBe('Saving...');
-         $httpBackend.flush();
-         expect($rootScope.status).toBe('');
-       });
-
-
-       it('should send auth header', function() {
-         var controller = createController();
-         $httpBackend.flush();
-
-         $httpBackend.expectPOST('/add-msg.py', undefined, function(headers) {
-           // check if the header was send, if it wasn't the expectation won't
-           // match the request and the test will fail
-           return headers['Authorization'] == 'xxx';
-         }).respond(201, '');
-
-         $rootScope.saveMessage('whatever');
-         $httpBackend.flush();
-       });
-    });
-   
- */ -angular.mock.$HttpBackendProvider = function() { - this.$get = ['$rootScope', createHttpBackendMock]; -}; - -/** - * General factory function for $httpBackend mock. - * Returns instance for unit testing (when no arguments specified): - * - passing through is disabled - * - auto flushing is disabled - * - * Returns instance for e2e testing (when `$delegate` and `$browser` specified): - * - passing through (delegating request to real backend) is enabled - * - auto flushing is enabled - * - * @param {Object=} $delegate Real $httpBackend instance (allow passing through if specified) - * @param {Object=} $browser Auto-flushing enabled if specified - * @return {Object} Instance of $httpBackend mock - */ -function createHttpBackendMock($rootScope, $delegate, $browser) { - var definitions = [], - expectations = [], - responses = [], - responsesPush = angular.bind(responses, responses.push), - copy = angular.copy; - - function createResponse(status, data, headers) { - if (angular.isFunction(status)) return status; - - return function() { - return angular.isNumber(status) - ? [status, data, headers] - : [200, status, data]; - }; - } - - // TODO(vojta): change params to: method, url, data, headers, callback - function $httpBackend(method, url, data, callback, headers, timeout, withCredentials) { - var xhr = new MockXhr(), - expectation = expectations[0], - wasExpected = false; - - function prettyPrint(data) { - return (angular.isString(data) || angular.isFunction(data) || data instanceof RegExp) - ? data - : angular.toJson(data); - } - - function wrapResponse(wrapped) { - if (!$browser && timeout && timeout.then) timeout.then(handleTimeout); - - return handleResponse; - - function handleResponse() { - var response = wrapped.response(method, url, data, headers); - xhr.$$respHeaders = response[2]; - callback(copy(response[0]), copy(response[1]), xhr.getAllResponseHeaders()); - } - - function handleTimeout() { - for (var i = 0, ii = responses.length; i < ii; i++) { - if (responses[i] === handleResponse) { - responses.splice(i, 1); - callback(-1, undefined, ''); - break; - } - } - } - } - - if (expectation && expectation.match(method, url)) { - if (!expectation.matchData(data)) - throw new Error('Expected ' + expectation + ' with different data\n' + - 'EXPECTED: ' + prettyPrint(expectation.data) + '\nGOT: ' + data); - - if (!expectation.matchHeaders(headers)) - throw new Error('Expected ' + expectation + ' with different headers\n' + - 'EXPECTED: ' + prettyPrint(expectation.headers) + '\nGOT: ' + - prettyPrint(headers)); - - expectations.shift(); - - if (expectation.response) { - responses.push(wrapResponse(expectation)); - return; - } - wasExpected = true; - } - - var i = -1, definition; - while ((definition = definitions[++i])) { - if (definition.match(method, url, data, headers || {})) { - if (definition.response) { - // if $browser specified, we do auto flush all requests - ($browser ? $browser.defer : responsesPush)(wrapResponse(definition)); - } else if (definition.passThrough) { - $delegate(method, url, data, callback, headers, timeout, withCredentials); - } else throw new Error('No response defined !'); - return; - } - } - throw wasExpected ? - new Error('No response defined !') : - new Error('Unexpected request: ' + method + ' ' + url + '\n' + - (expectation ? 'Expected ' + expectation : 'No more request expected')); - } - - /** - * @ngdoc method - * @name ngMock.$httpBackend#when - * @methodOf ngMock.$httpBackend - * @description - * Creates a new backend definition. - * - * @param {string} method HTTP method. - * @param {string|RegExp} url HTTP url. - * @param {(string|RegExp|function(string))=} data HTTP request body or function that receives - * data string and returns true if the data is as expected. - * @param {(Object|function(Object))=} headers HTTP headers or function that receives http header - * object and returns true if the headers match the current definition. - * @returns {requestHandler} Returns an object with `respond` method that controls how a matched - * request is handled. - * - * - respond – - * `{function([status,] data[, headers])|function(function(method, url, data, headers)}` - * – The respond method takes a set of static data to be returned or a function that can return - * an array containing response status (number), response data (string) and response headers - * (Object). - */ - $httpBackend.when = function(method, url, data, headers) { - var definition = new MockHttpExpectation(method, url, data, headers), - chain = { - respond: function(status, data, headers) { - definition.response = createResponse(status, data, headers); - } - }; - - if ($browser) { - chain.passThrough = function() { - definition.passThrough = true; - }; - } - - definitions.push(definition); - return chain; - }; - - /** - * @ngdoc method - * @name ngMock.$httpBackend#whenGET - * @methodOf ngMock.$httpBackend - * @description - * Creates a new backend definition for GET requests. For more info see `when()`. - * - * @param {string|RegExp} url HTTP url. - * @param {(Object|function(Object))=} headers HTTP headers. - * @returns {requestHandler} Returns an object with `respond` method that control how a matched - * request is handled. - */ - - /** - * @ngdoc method - * @name ngMock.$httpBackend#whenHEAD - * @methodOf ngMock.$httpBackend - * @description - * Creates a new backend definition for HEAD requests. For more info see `when()`. - * - * @param {string|RegExp} url HTTP url. - * @param {(Object|function(Object))=} headers HTTP headers. - * @returns {requestHandler} Returns an object with `respond` method that control how a matched - * request is handled. - */ - - /** - * @ngdoc method - * @name ngMock.$httpBackend#whenDELETE - * @methodOf ngMock.$httpBackend - * @description - * Creates a new backend definition for DELETE requests. For more info see `when()`. - * - * @param {string|RegExp} url HTTP url. - * @param {(Object|function(Object))=} headers HTTP headers. - * @returns {requestHandler} Returns an object with `respond` method that control how a matched - * request is handled. - */ - - /** - * @ngdoc method - * @name ngMock.$httpBackend#whenPOST - * @methodOf ngMock.$httpBackend - * @description - * Creates a new backend definition for POST requests. For more info see `when()`. - * - * @param {string|RegExp} url HTTP url. - * @param {(string|RegExp|function(string))=} data HTTP request body or function that receives - * data string and returns true if the data is as expected. - * @param {(Object|function(Object))=} headers HTTP headers. - * @returns {requestHandler} Returns an object with `respond` method that control how a matched - * request is handled. - */ - - /** - * @ngdoc method - * @name ngMock.$httpBackend#whenPUT - * @methodOf ngMock.$httpBackend - * @description - * Creates a new backend definition for PUT requests. For more info see `when()`. - * - * @param {string|RegExp} url HTTP url. - * @param {(string|RegExp|function(string))=} data HTTP request body or function that receives - * data string and returns true if the data is as expected. - * @param {(Object|function(Object))=} headers HTTP headers. - * @returns {requestHandler} Returns an object with `respond` method that control how a matched - * request is handled. - */ - - /** - * @ngdoc method - * @name ngMock.$httpBackend#whenJSONP - * @methodOf ngMock.$httpBackend - * @description - * Creates a new backend definition for JSONP requests. For more info see `when()`. - * - * @param {string|RegExp} url HTTP url. - * @returns {requestHandler} Returns an object with `respond` method that control how a matched - * request is handled. - */ - createShortMethods('when'); - - - /** - * @ngdoc method - * @name ngMock.$httpBackend#expect - * @methodOf ngMock.$httpBackend - * @description - * Creates a new request expectation. - * - * @param {string} method HTTP method. - * @param {string|RegExp} url HTTP url. - * @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that - * receives data string and returns true if the data is as expected, or Object if request body - * is in JSON format. - * @param {(Object|function(Object))=} headers HTTP headers or function that receives http header - * object and returns true if the headers match the current expectation. - * @returns {requestHandler} Returns an object with `respond` method that control how a matched - * request is handled. - * - * - respond – - * `{function([status,] data[, headers])|function(function(method, url, data, headers)}` - * – The respond method takes a set of static data to be returned or a function that can return - * an array containing response status (number), response data (string) and response headers - * (Object). - */ - $httpBackend.expect = function(method, url, data, headers) { - var expectation = new MockHttpExpectation(method, url, data, headers); - expectations.push(expectation); - return { - respond: function(status, data, headers) { - expectation.response = createResponse(status, data, headers); - } - }; - }; - - - /** - * @ngdoc method - * @name ngMock.$httpBackend#expectGET - * @methodOf ngMock.$httpBackend - * @description - * Creates a new request expectation for GET requests. For more info see `expect()`. - * - * @param {string|RegExp} url HTTP url. - * @param {Object=} headers HTTP headers. - * @returns {requestHandler} Returns an object with `respond` method that control how a matched - * request is handled. See #expect for more info. - */ - - /** - * @ngdoc method - * @name ngMock.$httpBackend#expectHEAD - * @methodOf ngMock.$httpBackend - * @description - * Creates a new request expectation for HEAD requests. For more info see `expect()`. - * - * @param {string|RegExp} url HTTP url. - * @param {Object=} headers HTTP headers. - * @returns {requestHandler} Returns an object with `respond` method that control how a matched - * request is handled. - */ - - /** - * @ngdoc method - * @name ngMock.$httpBackend#expectDELETE - * @methodOf ngMock.$httpBackend - * @description - * Creates a new request expectation for DELETE requests. For more info see `expect()`. - * - * @param {string|RegExp} url HTTP url. - * @param {Object=} headers HTTP headers. - * @returns {requestHandler} Returns an object with `respond` method that control how a matched - * request is handled. - */ - - /** - * @ngdoc method - * @name ngMock.$httpBackend#expectPOST - * @methodOf ngMock.$httpBackend - * @description - * Creates a new request expectation for POST requests. For more info see `expect()`. - * - * @param {string|RegExp} url HTTP url. - * @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that - * receives data string and returns true if the data is as expected, or Object if request body - * is in JSON format. - * @param {Object=} headers HTTP headers. - * @returns {requestHandler} Returns an object with `respond` method that control how a matched - * request is handled. - */ - - /** - * @ngdoc method - * @name ngMock.$httpBackend#expectPUT - * @methodOf ngMock.$httpBackend - * @description - * Creates a new request expectation for PUT requests. For more info see `expect()`. - * - * @param {string|RegExp} url HTTP url. - * @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that - * receives data string and returns true if the data is as expected, or Object if request body - * is in JSON format. - * @param {Object=} headers HTTP headers. - * @returns {requestHandler} Returns an object with `respond` method that control how a matched - * request is handled. - */ - - /** - * @ngdoc method - * @name ngMock.$httpBackend#expectPATCH - * @methodOf ngMock.$httpBackend - * @description - * Creates a new request expectation for PATCH requests. For more info see `expect()`. - * - * @param {string|RegExp} url HTTP url. - * @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that - * receives data string and returns true if the data is as expected, or Object if request body - * is in JSON format. - * @param {Object=} headers HTTP headers. - * @returns {requestHandler} Returns an object with `respond` method that control how a matched - * request is handled. - */ - - /** - * @ngdoc method - * @name ngMock.$httpBackend#expectJSONP - * @methodOf ngMock.$httpBackend - * @description - * Creates a new request expectation for JSONP requests. For more info see `expect()`. - * - * @param {string|RegExp} url HTTP url. - * @returns {requestHandler} Returns an object with `respond` method that control how a matched - * request is handled. - */ - createShortMethods('expect'); - - - /** - * @ngdoc method - * @name ngMock.$httpBackend#flush - * @methodOf ngMock.$httpBackend - * @description - * Flushes all pending requests using the trained responses. - * - * @param {number=} count Number of responses to flush (in the order they arrived). If undefined, - * all pending requests will be flushed. If there are no pending requests when the flush method - * is called an exception is thrown (as this typically a sign of programming error). - */ - $httpBackend.flush = function(count) { - $rootScope.$digest(); - if (!responses.length) throw new Error('No pending request to flush !'); - - if (angular.isDefined(count)) { - while (count--) { - if (!responses.length) throw new Error('No more pending request to flush !'); - responses.shift()(); - } - } else { - while (responses.length) { - responses.shift()(); - } - } - $httpBackend.verifyNoOutstandingExpectation(); - }; - - - /** - * @ngdoc method - * @name ngMock.$httpBackend#verifyNoOutstandingExpectation - * @methodOf ngMock.$httpBackend - * @description - * Verifies that all of the requests defined via the `expect` api were made. If any of the - * requests were not made, verifyNoOutstandingExpectation throws an exception. - * - * Typically, you would call this method following each test case that asserts requests using an - * "afterEach" clause. - * - *
-   *   afterEach($httpBackend.verifyNoOutstandingExpectation);
-   * 
- */ - $httpBackend.verifyNoOutstandingExpectation = function() { - $rootScope.$digest(); - if (expectations.length) { - throw new Error('Unsatisfied requests: ' + expectations.join(', ')); - } - }; - - - /** - * @ngdoc method - * @name ngMock.$httpBackend#verifyNoOutstandingRequest - * @methodOf ngMock.$httpBackend - * @description - * Verifies that there are no outstanding requests that need to be flushed. - * - * Typically, you would call this method following each test case that asserts requests using an - * "afterEach" clause. - * - *
-   *   afterEach($httpBackend.verifyNoOutstandingRequest);
-   * 
- */ - $httpBackend.verifyNoOutstandingRequest = function() { - if (responses.length) { - throw new Error('Unflushed requests: ' + responses.length); - } - }; - - - /** - * @ngdoc method - * @name ngMock.$httpBackend#resetExpectations - * @methodOf ngMock.$httpBackend - * @description - * Resets all request expectations, but preserves all backend definitions. Typically, you would - * call resetExpectations during a multiple-phase test when you want to reuse the same instance of - * $httpBackend mock. - */ - $httpBackend.resetExpectations = function() { - expectations.length = 0; - responses.length = 0; - }; - - return $httpBackend; - - - function createShortMethods(prefix) { - angular.forEach(['GET', 'DELETE', 'JSONP'], function(method) { - $httpBackend[prefix + method] = function(url, headers) { - return $httpBackend[prefix](method, url, undefined, headers); - }; - }); - - angular.forEach(['PUT', 'POST', 'PATCH'], function(method) { - $httpBackend[prefix + method] = function(url, data, headers) { - return $httpBackend[prefix](method, url, data, headers); - }; - }); - } -} - -function MockHttpExpectation(method, url, data, headers) { - - this.data = data; - this.headers = headers; - - this.match = function(m, u, d, h) { - if (method != m) return false; - if (!this.matchUrl(u)) return false; - if (angular.isDefined(d) && !this.matchData(d)) return false; - if (angular.isDefined(h) && !this.matchHeaders(h)) return false; - return true; - }; - - this.matchUrl = function(u) { - if (!url) return true; - if (angular.isFunction(url.test)) return url.test(u); - return url == u; - }; - - this.matchHeaders = function(h) { - if (angular.isUndefined(headers)) return true; - if (angular.isFunction(headers)) return headers(h); - return angular.equals(headers, h); - }; - - this.matchData = function(d) { - if (angular.isUndefined(data)) return true; - if (data && angular.isFunction(data.test)) return data.test(d); - if (data && angular.isFunction(data)) return data(d); - if (data && !angular.isString(data)) return angular.equals(data, angular.fromJson(d)); - return data == d; - }; - - this.toString = function() { - return method + ' ' + url; - }; -} - -function createMockXhr() { - return new MockXhr(); -} - -function MockXhr() { - - // hack for testing $http, $httpBackend - MockXhr.$$lastInstance = this; - - this.open = function(method, url, async) { - this.$$method = method; - this.$$url = url; - this.$$async = async; - this.$$reqHeaders = {}; - this.$$respHeaders = {}; - }; - - this.send = function(data) { - this.$$data = data; - }; - - this.setRequestHeader = function(key, value) { - this.$$reqHeaders[key] = value; - }; - - this.getResponseHeader = function(name) { - // the lookup must be case insensitive, - // that's why we try two quick lookups first and full scan last - var header = this.$$respHeaders[name]; - if (header) return header; - - name = angular.lowercase(name); - header = this.$$respHeaders[name]; - if (header) return header; - - header = undefined; - angular.forEach(this.$$respHeaders, function(headerVal, headerName) { - if (!header && angular.lowercase(headerName) == name) header = headerVal; - }); - return header; - }; - - this.getAllResponseHeaders = function() { - var lines = []; - - angular.forEach(this.$$respHeaders, function(value, key) { - lines.push(key + ': ' + value); - }); - return lines.join('\n'); - }; - - this.abort = angular.noop; -} - - -/** - * @ngdoc function - * @name ngMock.$timeout - * @description - * - * This service is just a simple decorator for {@link ng.$timeout $timeout} service - * that adds a "flush" and "verifyNoPendingTasks" methods. - */ - -angular.mock.$TimeoutDecorator = function($delegate, $browser) { - - /** - * @ngdoc method - * @name ngMock.$timeout#flush - * @methodOf ngMock.$timeout - * @description - * - * Flushes the queue of pending tasks. - * - * @param {number=} delay maximum timeout amount to flush up until - */ - $delegate.flush = function(delay) { - $browser.defer.flush(delay); - }; - - /** - * @ngdoc method - * @name ngMock.$timeout#verifyNoPendingTasks - * @methodOf ngMock.$timeout - * @description - * - * Verifies that there are no pending tasks that need to be flushed. - */ - $delegate.verifyNoPendingTasks = function() { - if ($browser.deferredFns.length) { - throw new Error('Deferred tasks to flush (' + $browser.deferredFns.length + '): ' + - formatPendingTasksAsString($browser.deferredFns)); - } - }; - - function formatPendingTasksAsString(tasks) { - var result = []; - angular.forEach(tasks, function(task) { - result.push('{id: ' + task.id + ', ' + 'time: ' + task.time + '}'); - }); - - return result.join(', '); - } - - return $delegate; -}; - -/** - * - */ -angular.mock.$RootElementProvider = function() { - this.$get = function() { - return angular.element('
'); - }; -}; - -/** - * @ngdoc overview - * @name ngMock - * @description - * - * # ngMock - * - * The `ngMock` module providers support to inject and mock Angular services into unit tests. - * In addition, ngMock also extends various core ng services such that they can be - * inspected and controlled in a synchronous manner within test code. - * - * {@installModule mock} - * - *
- * - */ -angular.module('ngMock', ['ng']).provider({ - $browser: angular.mock.$BrowserProvider, - $exceptionHandler: angular.mock.$ExceptionHandlerProvider, - $log: angular.mock.$LogProvider, - $interval: angular.mock.$IntervalProvider, - $httpBackend: angular.mock.$HttpBackendProvider, - $rootElement: angular.mock.$RootElementProvider -}).config(['$provide', function($provide) { - $provide.decorator('$timeout', angular.mock.$TimeoutDecorator); -}]); - -/** - * @ngdoc overview - * @name ngMockE2E - * @description - * - * The `ngMockE2E` is an angular module which contains mocks suitable for end-to-end testing. - * Currently there is only one mock present in this module - - * the {@link ngMockE2E.$httpBackend e2e $httpBackend} mock. - */ -angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) { - $provide.decorator('$httpBackend', angular.mock.e2e.$httpBackendDecorator); -}]); - -/** - * @ngdoc object - * @name ngMockE2E.$httpBackend - * @description - * Fake HTTP backend implementation suitable for end-to-end testing or backend-less development of - * applications that use the {@link ng.$http $http service}. - * - * *Note*: For fake http backend implementation suitable for unit testing please see - * {@link ngMock.$httpBackend unit-testing $httpBackend mock}. - * - * This implementation can be used to respond with static or dynamic responses via the `when` api - * and its shortcuts (`whenGET`, `whenPOST`, etc) and optionally pass through requests to the - * real $httpBackend for specific requests (e.g. to interact with certain remote apis or to fetch - * templates from a webserver). - * - * As opposed to unit-testing, in an end-to-end testing scenario or in scenario when an application - * is being developed with the real backend api replaced with a mock, it is often desirable for - * certain category of requests to bypass the mock and issue a real http request (e.g. to fetch - * templates or static files from the webserver). To configure the backend with this behavior - * use the `passThrough` request handler of `when` instead of `respond`. - * - * Additionally, we don't want to manually have to flush mocked out requests like we do during unit - * testing. For this reason the e2e $httpBackend automatically flushes mocked out requests - * automatically, closely simulating the behavior of the XMLHttpRequest object. - * - * To setup the application to run with this http backend, you have to create a module that depends - * on the `ngMockE2E` and your application modules and defines the fake backend: - * - *
- *   myAppDev = angular.module('myAppDev', ['myApp', 'ngMockE2E']);
- *   myAppDev.run(function($httpBackend) {
- *     phones = [{name: 'phone1'}, {name: 'phone2'}];
- *
- *     // returns the current list of phones
- *     $httpBackend.whenGET('/phones').respond(phones);
- *
- *     // adds a new phone to the phones array
- *     $httpBackend.whenPOST('/phones').respond(function(method, url, data) {
- *       phones.push(angular.fromJson(data));
- *     });
- *     $httpBackend.whenGET(/^\/templates\//).passThrough();
- *     //...
- *   });
- * 
- * - * Afterwards, bootstrap your app with this new module. - */ - -/** - * @ngdoc method - * @name ngMockE2E.$httpBackend#when - * @methodOf ngMockE2E.$httpBackend - * @description - * Creates a new backend definition. - * - * @param {string} method HTTP method. - * @param {string|RegExp} url HTTP url. - * @param {(string|RegExp)=} data HTTP request body. - * @param {(Object|function(Object))=} headers HTTP headers or function that receives http header - * object and returns true if the headers match the current definition. - * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that - * control how a matched request is handled. - * - * - respond – - * `{function([status,] data[, headers])|function(function(method, url, data, headers)}` - * – The respond method takes a set of static data to be returned or a function that can return - * an array containing response status (number), response data (string) and response headers - * (Object). - * - passThrough – `{function()}` – Any request matching a backend definition with `passThrough` - * handler, will be pass through to the real backend (an XHR request will be made to the - * server. - */ - -/** - * @ngdoc method - * @name ngMockE2E.$httpBackend#whenGET - * @methodOf ngMockE2E.$httpBackend - * @description - * Creates a new backend definition for GET requests. For more info see `when()`. - * - * @param {string|RegExp} url HTTP url. - * @param {(Object|function(Object))=} headers HTTP headers. - * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that - * control how a matched request is handled. - */ - -/** - * @ngdoc method - * @name ngMockE2E.$httpBackend#whenHEAD - * @methodOf ngMockE2E.$httpBackend - * @description - * Creates a new backend definition for HEAD requests. For more info see `when()`. - * - * @param {string|RegExp} url HTTP url. - * @param {(Object|function(Object))=} headers HTTP headers. - * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that - * control how a matched request is handled. - */ - -/** - * @ngdoc method - * @name ngMockE2E.$httpBackend#whenDELETE - * @methodOf ngMockE2E.$httpBackend - * @description - * Creates a new backend definition for DELETE requests. For more info see `when()`. - * - * @param {string|RegExp} url HTTP url. - * @param {(Object|function(Object))=} headers HTTP headers. - * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that - * control how a matched request is handled. - */ - -/** - * @ngdoc method - * @name ngMockE2E.$httpBackend#whenPOST - * @methodOf ngMockE2E.$httpBackend - * @description - * Creates a new backend definition for POST requests. For more info see `when()`. - * - * @param {string|RegExp} url HTTP url. - * @param {(string|RegExp)=} data HTTP request body. - * @param {(Object|function(Object))=} headers HTTP headers. - * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that - * control how a matched request is handled. - */ - -/** - * @ngdoc method - * @name ngMockE2E.$httpBackend#whenPUT - * @methodOf ngMockE2E.$httpBackend - * @description - * Creates a new backend definition for PUT requests. For more info see `when()`. - * - * @param {string|RegExp} url HTTP url. - * @param {(string|RegExp)=} data HTTP request body. - * @param {(Object|function(Object))=} headers HTTP headers. - * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that - * control how a matched request is handled. - */ - -/** - * @ngdoc method - * @name ngMockE2E.$httpBackend#whenPATCH - * @methodOf ngMockE2E.$httpBackend - * @description - * Creates a new backend definition for PATCH requests. For more info see `when()`. - * - * @param {string|RegExp} url HTTP url. - * @param {(string|RegExp)=} data HTTP request body. - * @param {(Object|function(Object))=} headers HTTP headers. - * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that - * control how a matched request is handled. - */ - -/** - * @ngdoc method - * @name ngMockE2E.$httpBackend#whenJSONP - * @methodOf ngMockE2E.$httpBackend - * @description - * Creates a new backend definition for JSONP requests. For more info see `when()`. - * - * @param {string|RegExp} url HTTP url. - * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that - * control how a matched request is handled. - */ -angular.mock.e2e = {}; -angular.mock.e2e.$httpBackendDecorator = - ['$rootScope', '$delegate', '$browser', createHttpBackendMock]; - - -angular.mock.clearDataCache = function() { - var key, - cache = angular.element.cache; - - for(key in cache) { - if (Object.prototype.hasOwnProperty.call(cache,key)) { - var handle = cache[key].handle; - - handle && angular.element(handle.elem).off(); - delete cache[key]; - } - } -}; - - -if(window.jasmine || window.mocha) { - - var currentSpec = null, - isSpecRunning = function() { - return !!currentSpec; - }; - - - beforeEach(function() { - currentSpec = this; - }); - - afterEach(function() { - var injector = currentSpec.$injector; - - currentSpec.$injector = null; - currentSpec.$modules = null; - currentSpec = null; - - if (injector) { - injector.get('$rootElement').off(); - injector.get('$browser').pollFns.length = 0; - } - - angular.mock.clearDataCache(); - - // clean up jquery's fragment cache - angular.forEach(angular.element.fragments, function(val, key) { - delete angular.element.fragments[key]; - }); - - MockXhr.$$lastInstance = null; - - angular.forEach(angular.callbacks, function(val, key) { - delete angular.callbacks[key]; - }); - angular.callbacks.counter = 0; - }); - - /** - * @ngdoc function - * @name angular.mock.module - * @description - * - * *NOTE*: This function is also published on window for easy access.
- * - * This function registers a module configuration code. It collects the configuration information - * which will be used when the injector is created by {@link angular.mock.inject inject}. - * - * See {@link angular.mock.inject inject} for usage example - * - * @param {...(string|Function|Object)} fns any number of modules which are represented as string - * aliases or as anonymous module initialization functions. The modules are used to - * configure the injector. The 'ng' and 'ngMock' modules are automatically loaded. If an - * object literal is passed they will be register as values in the module, the key being - * the module name and the value being what is returned. - */ - window.module = angular.mock.module = function() { - var moduleFns = Array.prototype.slice.call(arguments, 0); - return isSpecRunning() ? workFn() : workFn; - ///////////////////// - function workFn() { - if (currentSpec.$injector) { - throw new Error('Injector already created, can not register a module!'); - } else { - var modules = currentSpec.$modules || (currentSpec.$modules = []); - angular.forEach(moduleFns, function(module) { - if (angular.isObject(module) && !angular.isArray(module)) { - modules.push(function($provide) { - angular.forEach(module, function(value, key) { - $provide.value(key, value); - }); - }); - } else { - modules.push(module); - } - }); - } - } - }; - - /** - * @ngdoc function - * @name angular.mock.inject - * @description - * - * *NOTE*: This function is also published on window for easy access.
- * - * The inject function wraps a function into an injectable function. The inject() creates new - * instance of {@link AUTO.$injector $injector} per test, which is then used for - * resolving references. - * - * - * ## Resolving References (Underscore Wrapping) - * Often, we would like to inject a reference once, in a `beforeEach()` block and reuse this - * in multiple `it()` clauses. To be able to do this we must assign the reference to a variable - * that is declared in the scope of the `describe()` block. Since we would, most likely, want - * the variable to have the same name of the reference we have a problem, since the parameter - * to the `inject()` function would hide the outer variable. - * - * To help with this, the injected parameters can, optionally, be enclosed with underscores. - * These are ignored by the injector when the reference name is resolved. - * - * For example, the parameter `_myService_` would be resolved as the reference `myService`. - * Since it is available in the function body as _myService_, we can then assign it to a variable - * defined in an outer scope. - * - * ``` - * // Defined out reference variable outside - * var myService; - * - * // Wrap the parameter in underscores - * beforeEach( inject( function(_myService_){ - * myService = _myService_; - * })); - * - * // Use myService in a series of tests. - * it('makes use of myService', function() { - * myService.doStuff(); - * }); - * - * ``` - * - * See also {@link angular.mock.module angular.mock.module} - * - * ## Example - * Example of what a typical jasmine tests looks like with the inject method. - *
-   *
-   *   angular.module('myApplicationModule', [])
-   *       .value('mode', 'app')
-   *       .value('version', 'v1.0.1');
-   *
-   *
-   *   describe('MyApp', function() {
-   *
-   *     // You need to load modules that you want to test,
-   *     // it loads only the "ng" module by default.
-   *     beforeEach(module('myApplicationModule'));
-   *
-   *
-   *     // inject() is used to inject arguments of all given functions
-   *     it('should provide a version', inject(function(mode, version) {
-   *       expect(version).toEqual('v1.0.1');
-   *       expect(mode).toEqual('app');
-   *     }));
-   *
-   *
-   *     // The inject and module method can also be used inside of the it or beforeEach
-   *     it('should override a version and test the new version is injected', function() {
-   *       // module() takes functions or strings (module aliases)
-   *       module(function($provide) {
-   *         $provide.value('version', 'overridden'); // override version here
-   *       });
-   *
-   *       inject(function(version) {
-   *         expect(version).toEqual('overridden');
-   *       });
-   *     });
-   *   });
-   *
-   * 
- * - * @param {...Function} fns any number of functions which will be injected using the injector. - */ - - - - var ErrorAddingDeclarationLocationStack = function(e, errorForStack) { - this.message = e.message; - this.name = e.name; - if (e.line) this.line = e.line; - if (e.sourceId) this.sourceId = e.sourceId; - if (e.stack && errorForStack) - this.stack = e.stack + '\n' + errorForStack.stack; - if (e.stackArray) this.stackArray = e.stackArray; - }; - ErrorAddingDeclarationLocationStack.prototype.toString = Error.prototype.toString; - - window.inject = angular.mock.inject = function() { - var blockFns = Array.prototype.slice.call(arguments, 0); - var errorForStack = new Error('Declaration Location'); - return isSpecRunning() ? workFn() : workFn; - ///////////////////// - function workFn() { - var modules = currentSpec.$modules || []; - - modules.unshift('ngMock'); - modules.unshift('ng'); - var injector = currentSpec.$injector; - if (!injector) { - injector = currentSpec.$injector = angular.injector(modules); - } - for(var i = 0, ii = blockFns.length; i < ii; i++) { - try { - /* jshint -W040 *//* Jasmine explicitly provides a `this` object when calling functions */ - injector.invoke(blockFns[i] || angular.noop, this); - /* jshint +W040 */ - } catch (e) { - if (e.stack && errorForStack) { - throw new ErrorAddingDeclarationLocationStack(e, errorForStack); - } - throw e; - } finally { - errorForStack = null; - } - } - } - }; -} - - -})(window, window.angular); diff --git a/app/lib/angular/angular-resource.min.js b/app/lib/angular/angular-resource.min.js deleted file mode 100644 index 480a5750..00000000 --- a/app/lib/angular/angular-resource.min.js +++ /dev/null @@ -1,13 +0,0 @@ -/* - AngularJS v1.2.11 - (c) 2010-2014 Google, Inc. http://angularjs.org - License: MIT -*/ -(function(H,a,A){'use strict';function D(p,g){g=g||{};a.forEach(g,function(a,c){delete g[c]});for(var c in p)p.hasOwnProperty(c)&&("$"!==c.charAt(0)&&"$"!==c.charAt(1))&&(g[c]=p[c]);return g}var v=a.$$minErr("$resource"),C=/^(\.[a-zA-Z_$][0-9a-zA-Z_$]*)+$/;a.module("ngResource",["ng"]).factory("$resource",["$http","$q",function(p,g){function c(a,c){this.template=a;this.defaults=c||{};this.urlParams={}}function t(n,w,l){function r(h,d){var e={};d=x({},w,d);s(d,function(b,d){u(b)&&(b=b());var k;if(b&& -b.charAt&&"@"==b.charAt(0)){k=h;var a=b.substr(1);if(null==a||""===a||"hasOwnProperty"===a||!C.test("."+a))throw v("badmember",a);for(var a=a.split("."),f=0,c=a.length;f=c;d--)e.end&&e.end(f[d]);f.length=c}}var b,g,f=[],l=a;for(f.last=function(){return f[f.length-1]};a;){g=!0;if(f.last()&&x[f.last()])a=a.replace(RegExp("(.*)<\\s*\\/\\s*"+f.last()+"[^>]*>","i"),function(b,a){a=a.replace(H,"$1").replace(I,"$1");e.chars&&e.chars(r(a));return""}),c("",f.last());else{if(0===a.indexOf("\x3c!--"))b=a.indexOf("--",4),0<=b&&a.lastIndexOf("--\x3e",b)===b&&(e.comment&&e.comment(a.substring(4,b)),a=a.substring(b+3),g=!1);else if(y.test(a)){if(b=a.match(y))a= -a.replace(b[0],""),g=!1}else if(J.test(a)){if(b=a.match(z))a=a.substring(b[0].length),b[0].replace(z,c),g=!1}else K.test(a)&&(b=a.match(A))&&(a=a.substring(b[0].length),b[0].replace(A,d),g=!1);g&&(b=a.indexOf("<"),g=0>b?a:a.substring(0,b),a=0>b?"":a.substring(b),e.chars&&e.chars(r(g)))}if(a==l)throw L("badparse",a);l=a}c()}function r(a){if(!a)return"";var e=M.exec(a);a=e[1];var d=e[3];if(e=e[2])n.innerHTML=e.replace(//g,">")}function s(a,e){var d=!1,c=h.bind(a,a.push);return{start:function(a,g,f){a=h.lowercase(a);!d&&x[a]&&(d=a);d||!0!==C[a]||(c("<"),c(a),h.forEach(g,function(d,f){var g=h.lowercase(f),k="img"===a&&"src"===g||"background"===g;!0!==O[g]||!0===D[g]&&!e(d,k)||(c(" "),c(f),c('="'),c(B(d)),c('"'))}),c(f?"/>":">"))},end:function(a){a=h.lowercase(a);d||!0!==C[a]||(c(""));a==d&&(d=!1)},chars:function(a){d|| -c(B(a))}}}var L=h.$$minErr("$sanitize"),A=/^<\s*([\w:-]+)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*>/,z=/^<\s*\/\s*([\w:-]+)[^>]*>/,G=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,K=/^]*?)>/i,I=/]/,d=/^mailto:/;return function(c,b){function g(a){a&&m.push(E(a))}function f(a,c){m.push("');g(c);m.push("")}if(!c)return c;for(var l,k=c,m=[],n,p;l=k.match(e);)n=l[0],l[2]==l[3]&&(n="mailto:"+n),p=l.index,g(k.substr(0,p)),f(n,l[0].replace(d,"")),k=k.substring(p+l[0].length);g(k);return a(m.join(""))}}])})(window,window.angular); -//# sourceMappingURL=angular-sanitize.min.js.map diff --git a/app/lib/angular/angular-sanitize.min.js.map b/app/lib/angular/angular-sanitize.min.js.map deleted file mode 100644 index 80a88892..00000000 --- a/app/lib/angular/angular-sanitize.min.js.map +++ /dev/null @@ -1,8 +0,0 @@ -{ -"version":3, -"file":"angular-sanitize.min.js", -"lineCount":15, -"mappings":"A;;;;;aAKC,SAAQ,CAACA,CAAD,CAASC,CAAT,CAAkBC,CAAlB,CAA6B,CAkJtCC,QAASA,EAAY,CAACC,CAAD,CAAQ,CAC3B,IAAIC,EAAM,EACGC,EAAAC,CAAmBF,CAAnBE,CAAwBN,CAAAO,KAAxBD,CACbH,MAAA,CAAaA,CAAb,CACA,OAAOC,EAAAI,KAAA,CAAS,EAAT,CAJoB,CAmG7BC,QAASA,EAAO,CAACC,CAAD,CAAM,CAAA,IAChBC,EAAM,EAAIC,EAAAA,CAAQF,CAAAG,MAAA,CAAU,GAAV,CAAtB,KAAsCC,CACtC,KAAKA,CAAL,CAAS,CAAT,CAAYA,CAAZ,CAAgBF,CAAAG,OAAhB,CAA8BD,CAAA,EAA9B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CAQA,CARM9E,CAAA,CAAM,CAAN,CAQN,CANKA,CAAA,CAAM,CAAN,CAML,EANkBA,CAAA,CAAM,CAAN,CAMlB,GALE8E,CAKF,EALS9E,CAAA,CAAM,CAAN,CAAA,CAAW,SAAX,CAAuB,SAKhC,EAL6C8E,CAK7C,EAHApG,CAGA,CAHIsB,CAAAS,MAGJ,CAFAmE,CAAA,CAAQI,CAAAC,OAAA,CAAW,CAAX,CAAcvG,CAAd,CAAR,CAEA,CADAmG,CAAA,CAAQC,CAAR,CAAa9E,CAAA,CAAM,CAAN,CAAAF,QAAA,CAAiB4E,CAAjB,CAAgC,EAAhC,CAAb,CACA,CAAAM,CAAA,CAAMA,CAAA5D,UAAA,CAAc1C,CAAd,CAAkBsB,CAAA,CAAM,CAAN,CAAArB,OAAlB,CAERiG,EAAA,CAAQI,CAAR,CACA,OAAOR,EAAA,CAAU3F,CAAAT,KAAA,CAAU,EAAV,CAAV,CApBqB,CAL+C,CAAlC,CAA7C,CA/mBsC,CAArC,CAAD,CAkqBGT,MAlqBH,CAkqBWA,MAAAC,QAlqBX;", -"sources":["angular-sanitize.js"], -"names":["window","angular","undefined","sanitizeText","chars","buf","htmlSanitizeWriter","writer","noop","join","makeMap","str","obj","items","split","i","length","htmlParser","html","handler","parseStartTag","tag","tagName","rest","unary","lowercase","blockElements","stack","last","inlineElements","parseEndTag","optionalEndTagElements","voidElements","push","attrs","replace","ATTR_REGEXP","match","name","doubleQuotedValue","singleQuotedValue","unquotedValue","decodeEntities","start","pos","end","index","text","stack.last","specialElements","RegExp","all","COMMENT_REGEXP","CDATA_REGEXP","indexOf","lastIndexOf","comment","substring","DOCTYPE_REGEXP","test","BEGING_END_TAGE_REGEXP","END_TAG_REGEXP","BEGIN_TAG_REGEXP","START_TAG_REGEXP","$sanitizeMinErr","value","parts","spaceRe","exec","spaceBefore","spaceAfter","content","hiddenPre","innerHTML","textContent","innerText","encodeEntities","SURROGATE_PAIR_REGEXP","hi","charCodeAt","low","NON_ALPHANUMERIC_REGEXP","uriValidator","ignore","out","bind","validElements","forEach","key","lkey","isImage","validAttrs","uriAttrs","$$minErr","optionalEndTagBlockElements","optionalEndTagInlineElements","extend","svgElements","htmlAttrs","svgAttrs","document","createElement","module","provider","$SanitizeProvider","$get","$$sanitizeUri","uri","filter","$sanitize","LINKY_URL_REGEXP","MAILTO_REGEXP","target","addText","addLink","url","isDefined","raw","substr"] -} diff --git a/app/lib/angular/angular.min.js b/app/lib/angular/angular.min.js deleted file mode 100644 index 0c26c6a9..00000000 --- a/app/lib/angular/angular.min.js +++ /dev/null @@ -1,202 +0,0 @@ -/* - AngularJS v1.2.11 - (c) 2010-2014 Google, Inc. http://angularjs.org - License: MIT -*/ -(function(Q,S,s){'use strict';function t(b){return function(){var a=arguments[0],c,a="["+(b?b+":":"")+a+"] http://errors.angularjs.org/1.2.11/"+(b?b+"/":"")+a;for(c=1;c").append(b).html();try{return 3===b[0].nodeType?v(c):c.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/, -function(a,b){return"<"+v(b)})}catch(d){return v(c)}}function Ub(b){try{return decodeURIComponent(b)}catch(a){}}function Vb(b){var a={},c,d;q((b||"").split("&"),function(b){b&&(c=b.split("="),d=Ub(c[0]),C(d)&&(b=C(c[1])?Ub(c[1]):!0,a[d]?K(a[d])?a[d].push(b):a[d]=[a[d],b]:a[d]=b))});return a}function Wb(b){var a=[];q(b,function(b,d){K(b)?q(b,function(b){a.push(va(d,!0)+(!0===b?"":"="+va(b,!0)))}):a.push(va(d,!0)+(!0===b?"":"="+va(b,!0)))});return a.length?a.join("&"):""}function sb(b){return va(b, -!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function va(b,a){return encodeURIComponent(b).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,a?"%20":"+")}function Sc(b,a){function c(a){a&&d.push(a)}var d=[b],e,g,f=["ng:app","ng-app","x-ng-app","data-ng-app"],h=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;q(f,function(a){f[a]=!0;c(S.getElementById(a));a=a.replace(":","\\:");b.querySelectorAll&&(q(b.querySelectorAll("."+a),c),q(b.querySelectorAll("."+ -a+"\\:"),c),q(b.querySelectorAll("["+a+"]"),c))});q(d,function(a){if(!e){var b=h.exec(" "+a.className+" ");b?(e=a,g=(b[2]||"").replace(/\s+/g,",")):q(a.attributes,function(b){!e&&f[b.name]&&(e=a,g=b.value)})}});e&&a(e,g?[g]:[])}function Xb(b,a){var c=function(){b=A(b);if(b.injector()){var c=b[0]===S?"document":fa(b);throw Na("btstrpd",c);}a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",b)}]);a.unshift("ng");c=Yb(a);c.invoke(["$rootScope","$rootElement","$compile","$injector","$animate", -function(a,b,c,d,e){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return c},d=/^NG_DEFER_BOOTSTRAP!/;if(Q&&!d.test(Q.name))return c();Q.name=Q.name.replace(d,"");Ba.resumeBootstrap=function(b){q(b,function(b){a.push(b)});c()}}function cb(b,a){a=a||"_";return b.replace(Tc,function(b,d){return(d?a:"")+b.toLowerCase()})}function tb(b,a,c){if(!b)throw Na("areq",a||"?",c||"required");return b}function Pa(b,a,c){c&&K(b)&&(b=b[b.length-1]);tb(L(b),a,"not a function, got "+(b&&"object"==typeof b? -b.constructor.name||"Object":typeof b));return b}function wa(b,a){if("hasOwnProperty"===b)throw Na("badname",a);}function Zb(b,a,c){if(!a)return b;a=a.split(".");for(var d,e=b,g=a.length,f=0;f 
"+b;a.removeChild(a.firstChild);xb(this,a.childNodes);A(S.createDocumentFragment()).append(this)}else xb(this, -b)}function yb(b){return b.cloneNode(!0)}function Da(b){$b(b);var a=0;for(b=b.childNodes||[];a=M?(c.preventDefault=null,c.stopPropagation=null,c.isDefaultPrevented=null):(delete c.preventDefault,delete c.stopPropagation,delete c.isDefaultPrevented)};c.elem=b;return c}function Ea(b){var a=typeof b,c;"object"==a&&null!==b?"function"==typeof(c=b.$$hashKey)?c=b.$$hashKey():c=== -s&&(c=b.$$hashKey=Za()):c=b;return a+":"+c}function Sa(b){q(b,this.put,this)}function gc(b){var a,c;"function"==typeof b?(a=b.$inject)||(a=[],b.length&&(c=b.toString().replace(Zc,""),c=c.match($c),q(c[1].split(ad),function(b){b.replace(bd,function(b,c,d){a.push(d)})})),b.$inject=a):K(b)?(c=b.length-1,Pa(b[c],"fn"),a=b.slice(0,c)):Pa(b,"fn",!0);return a}function Yb(b){function a(a){return function(b,c){if(X(b))q(b,Ob(a));else return a(b,c)}}function c(a,b){wa(a,"service");if(L(b)||K(b))b=n.instantiate(b); -if(!b.$get)throw Ta("pget",a);return l[a+h]=b}function d(a,b){return c(a,{$get:b})}function e(a){var b=[],c,d,g,h;q(a,function(a){if(!k.get(a)){k.put(a,!0);try{if(D(a))for(c=Ua(a),b=b.concat(e(c.requires)).concat(c._runBlocks),d=c._invokeQueue,g=0,h=d.length;g 4096 bytes)!"));else{if(m.cookie!==J)for(J=m.cookie,d=J.split("; "),V={},g=0;gk&&this.remove(p.key),b},get:function(a){var b=l[a];if(b)return e(b),m[a]},remove:function(a){var b=l[a];b&&(b==n&&(n=b.p),b==p&&(p=b.n),g(b.n,b.p),delete l[a],delete m[a],f--)},removeAll:function(){m={};f=0;l={};n=p=null},destroy:function(){l=h=m=null;delete a[b]},info:function(){return y({},h,{size:f})}}}var a={};b.info=function(){var b={};q(a,function(a,e){b[e]=a.info()});return b};b.get=function(b){return a[b]}; -return b}}function gd(){this.$get=["$cacheFactory",function(b){return b("templates")}]}function ic(b,a){var c={},d="Directive",e=/^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/,g=/(([\d\w\-_]+)(?:\:([^;]+))?;?)/,f=/^(on[a-z]+|formaction)$/;this.directive=function m(a,e){wa(a,"directive");D(a)?(tb(e,"directiveFactory"),c.hasOwnProperty(a)||(c[a]=[],b.factory(a+d,["$injector","$exceptionHandler",function(b,d){var e=[];q(c[a],function(c,g){try{var f=b.invoke(c);L(f)?f={compile:Z(f)}:!f.compile&&f.link&&(f.compile= -Z(f.link));f.priority=f.priority||0;f.index=g;f.name=f.name||a;f.require=f.require||f.controller&&f.name;f.restrict=f.restrict||"A";e.push(f)}catch(m){d(m)}});return e}])),c[a].push(e)):q(a,Ob(m));return this};this.aHrefSanitizationWhitelist=function(b){return C(b)?(a.aHrefSanitizationWhitelist(b),this):a.aHrefSanitizationWhitelist()};this.imgSrcSanitizationWhitelist=function(b){return C(b)?(a.imgSrcSanitizationWhitelist(b),this):a.imgSrcSanitizationWhitelist()};this.$get=["$injector","$interpolate", -"$exceptionHandler","$http","$templateCache","$parse","$controller","$rootScope","$document","$sce","$animate","$$sanitizeUri",function(a,b,l,n,p,r,E,z,F,u,R,H){function x(a,b,c,d,e){a instanceof A||(a=A(a));q(a,function(b,c){3==b.nodeType&&b.nodeValue.match(/\S+/)&&(a[c]=A(b).wrap("").parent()[0])});var g=N(a,b,a,c,d,e);ka(a,"ng-scope");return function(b,c,d){tb(b,"scope");var e=c?Fa.clone.call(a):a;q(d,function(a,b){e.data("$"+b+"Controller",a)});d=0;for(var f=e.length;darguments.length&&(b=a, -a=s);B&&(c=ba);return p(a,b,c)}var I,x,N,u,O,J,ba={},gb;I=c===g?d:Rb(d,new Db(A(g),d.$attr));x=I.$$element;if(H){var t=/^\s*([@=&])(\??)\s*(\w*)\s*$/;f=A(g);J=e.$new(!0);ga&&ga===H.$$originalDirective?f.data("$isolateScope",J):f.data("$isolateScopeNoTemplate",J);ka(f,"ng-isolate-scope");q(H.scope,function(a,c){var d=a.match(t)||[],g=d[3]||c,f="?"==d[2],d=d[1],m,l,n,p;J.$$isolateBindings[c]=d+g;switch(d){case "@":I.$observe(g,function(a){J[c]=a});I.$$observers[g].$$scope=e;I[g]&&(J[c]=b(I[g])(e)); -break;case "=":if(f&&!I[g])break;l=r(I[g]);p=l.literal?ta:function(a,b){return a===b};n=l.assign||function(){m=J[c]=l(e);throw ha("nonassign",I[g],H.name);};m=J[c]=l(e);J.$watch(function(){var a=l(e);p(a,J[c])||(p(a,m)?n(e,a=J[c]):J[c]=a);return m=a},null,l.literal);break;case "&":l=r(I[g]);J[c]=function(a){return l(e,a)};break;default:throw ha("iscp",H.name,c,a);}})}gb=p&&z;V&&q(V,function(a){var b={$scope:a===H||a.$$isolateScope?J:e,$element:x,$attrs:I,$transclude:gb},c;O=a.controller;"@"==O&&(O= -I[a.name]);c=E(O,b);ba[a.name]=c;B||x.data("$"+a.name+"Controller",c);a.controllerAs&&(b.$scope[a.controllerAs]=c)});f=0;for(N=m.length;fG.priority)break;if(t=G.scope)u=u||G,G.templateUrl||(v("new/isolated scope",H,G,y),X(t)&&(H=G));ca=G.name;!G.templateUrl&&G.controller&&(t=G.controller,V=V||{},v("'"+ca+"' controller",V[ca],G,y),V[ca]=G);if(t=G.transclude)T=!0,G.$$tlb||(v("transclusion",p,G,y),p=G),"element"==t?(B=!0,N=G.priority,t=ba(c,Va,U), -y=d.$$element=A(S.createComment(" "+ca+": "+d[ca]+" ")),c=y[0],hb(g,A(ua.call(t,0)),c),Q=x(t,e,N,f&&f.name,{nonTlbTranscludeDirective:p})):(t=A(yb(c)).contents(),y.empty(),Q=x(t,e));if(G.template)if(v("template",ga,G,y),ga=G,t=L(G.template)?G.template(y,d):G.template,t=W(t),G.replace){f=G;t=A("
"+aa(t)+"
").contents();c=t[0];if(1!=t.length||1!==c.nodeType)throw ha("tplrt",ca,"");hb(g,y,c);ma={$attr:{}};t=J(c,[],ma);var Y=a.splice(M+1,a.length-(M+1));H&&hc(t);a=a.concat(t).concat(Y);C(d,ma); -ma=a.length}else y.html(t);if(G.templateUrl)v("template",ga,G,y),ga=G,G.replace&&(f=G),F=w(a.splice(M,a.length-M),y,d,g,Q,m,n,{controllerDirectives:V,newIsolateScopeDirective:H,templateDirective:ga,nonTlbTranscludeDirective:p}),ma=a.length;else if(G.compile)try{P=G.compile(y,d,Q),L(P)?z(null,P,Va,U):P&&z(P.pre,P.post,Va,U)}catch(Z){l(Z,fa(y))}G.terminal&&(F.terminal=!0,N=Math.max(N,G.priority))}F.scope=u&&!0===u.scope;F.transclude=T&&Q;return F}function hc(a){for(var b=0,c=a.length;bp.priority)&&-1!=p.restrict.indexOf(g)&&(r&&(p=Qb(p,{$$start:r,$$end:n})),b.push(p),k=p)}catch(R){l(R)}}return k}function C(a,b){var c=b.$attr,d=a.$attr,e=a.$$element;q(a,function(d,e){"$"!=e.charAt(0)&&(b[e]&&(d+=("style"===e?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});q(b,function(b,g){"class"==g?(ka(e,b),a["class"]=(a["class"]?a["class"]+ -" ":"")+b):"style"==g?(e.attr("style",e.attr("style")+";"+b),a.style=(a.style?a.style+";":"")+b):"$"==g.charAt(0)||a.hasOwnProperty(g)||(a[g]=b,d[g]=c[g])})}function w(a,b,c,d,e,g,f,k){var m=[],r,l,E=b[0],z=a.shift(),R=y({},z,{templateUrl:null,transclude:null,replace:null,$$originalDirective:z}),x=L(z.templateUrl)?z.templateUrl(b,c):z.templateUrl;b.empty();n.get(u.getTrustedResourceUrl(x),{cache:p}).success(function(n){var p,F;n=W(n);if(z.replace){n=A("
"+aa(n)+"
").contents();p=n[0];if(1!= -n.length||1!==p.nodeType)throw ha("tplrt",z.name,x);n={$attr:{}};hb(d,b,p);var u=J(p,[],n);X(z.scope)&&hc(u);a=u.concat(a);C(c,n)}else p=E,b.html(n);a.unshift(R);r=ga(a,p,c,e,b,z,g,f,k);q(d,function(a,c){a==p&&(d[c]=b[0])});for(l=N(b[0].childNodes,e);m.length;){n=m.shift();F=m.shift();var H=m.shift(),O=m.shift(),u=b[0];if(F!==E){var ba=F.className,u=yb(p);hb(H,A(F),u);ka(A(u),ba)}F=r.transclude?V(n,r.transclude):O;r(l,n,u,d,F)}m=null}).error(function(a,b,c,d){throw ha("tpload",d.url);});return function(a, -b,c,d,e){m?(m.push(b),m.push(c),m.push(d),m.push(e)):r(l,b,c,d,e)}}function B(a,b){var c=b.priority-a.priority;return 0!==c?c:a.name!==b.name?a.namea.status?b:n.reject(b)}var d={transformRequest:e.transformRequest,transformResponse:e.transformResponse},g=function(a){function b(a){var c; -q(a,function(b,d){L(b)&&(c=b(),null!=c?a[d]=c:delete a[d])})}var c=e.headers,d=y({},a.headers),g,f,c=y({},c.common,c[v(a.method)]);b(c);b(d);a:for(g in c){a=v(g);for(f in d)if(v(f)===a)continue a;d[g]=c[g]}return d}(a);y(d,a);d.headers=g;d.method=Ha(d.method);(a=Eb(d.url)?b.cookies()[d.xsrfCookieName||e.xsrfCookieName]:s)&&(g[d.xsrfHeaderName||e.xsrfHeaderName]=a);var f=[function(a){g=a.headers;var b=nc(a.data,mc(g),a.transformRequest);B(a.data)&&q(g,function(a,b){"content-type"===v(b)&&delete g[b]}); -B(a.withCredentials)&&!B(e.withCredentials)&&(a.withCredentials=e.withCredentials);return E(a,b,g).then(c,c)},s],k=n.when(d);for(q(u,function(a){(a.request||a.requestError)&&f.unshift(a.request,a.requestError);(a.response||a.responseError)&&f.push(a.response,a.responseError)});f.length;){a=f.shift();var h=f.shift(),k=k.then(a,h)}k.success=function(a){k.then(function(b){a(b.data,b.status,b.headers,d)});return k};k.error=function(a){k.then(null,function(b){a(b.data,b.status,b.headers,d)});return k}; -return k}function E(b,c,g){function f(a,b,c){u&&(200<=a&&300>a?u.put(s,[a,b,lc(c)]):u.remove(s));m(b,a,c);d.$$phase||d.$apply()}function m(a,c,d){c=Math.max(c,0);(200<=c&&300>c?p.resolve:p.reject)({data:a,status:c,headers:mc(d),config:b})}function k(){var a=ab(r.pendingRequests,b);-1!==a&&r.pendingRequests.splice(a,1)}var p=n.defer(),E=p.promise,u,q,s=z(b.url,b.params);r.pendingRequests.push(b);E.then(k,k);(b.cache||e.cache)&&(!1!==b.cache&&"GET"==b.method)&&(u=X(b.cache)?b.cache:X(e.cache)?e.cache: -F);if(u)if(q=u.get(s),C(q)){if(q.then)return q.then(k,k),q;K(q)?m(q[1],q[0],$(q[2])):m(q,200,{})}else u.put(s,E);B(q)&&a(b.method,s,c,f,g,b.timeout,b.withCredentials,b.responseType);return E}function z(a,b){if(!b)return a;var c=[];Oc(b,function(a,b){null===a||B(a)||(K(a)||(a=[a]),q(a,function(a){X(a)&&(a=pa(a));c.push(va(b)+"="+va(a))}))});return a+(-1==a.indexOf("?")?"?":"&")+c.join("&")}var F=c("$http"),u=[];q(g,function(a){u.unshift(D(a)?p.get(a):p.invoke(a))});q(f,function(a,b){var c=D(a)?p.get(a): -p.invoke(a);u.splice(b,0,{response:function(a){return c(n.when(a))},responseError:function(a){return c(n.reject(a))}})});r.pendingRequests=[];(function(a){q(arguments,function(a){r[a]=function(b,c){return r(y(c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){q(arguments,function(a){r[a]=function(b,c,d){return r(y(d||{},{method:a,url:b,data:c}))}})})("post","put");r.defaults=e;return r}]}function md(b){if(8>=M&&(!b.match(/^(get|post|head|put|delete|options)$/i)||!Q.XMLHttpRequest))return new Q.ActiveXObject("Microsoft.XMLHTTP"); -if(Q.XMLHttpRequest)return new Q.XMLHttpRequest;throw t("$httpBackend")("noxhr");}function nd(){this.$get=["$browser","$window","$document",function(b,a,c){return od(b,md,b.defer,a.angular.callbacks,c[0])}]}function od(b,a,c,d,e){function g(a,b){var c=e.createElement("script"),d=function(){c.onreadystatechange=c.onload=c.onerror=null;e.body.removeChild(c);b&&b()};c.type="text/javascript";c.src=a;M&&8>=M?c.onreadystatechange=function(){/loaded|complete/.test(c.readyState)&&d()}:c.onload=c.onerror= -function(){d()};e.body.appendChild(c);return d}var f=-1;return function(e,m,k,l,n,p,r,E){function z(){u=f;H&&H();x&&x.abort()}function F(a,d,e,g){s&&c.cancel(s);H=x=null;d=0===d?e?200:404:d;a(1223==d?204:d,e,g);b.$$completeOutstandingRequest(w)}var u;b.$$incOutstandingRequestCount();m=m||b.url();if("jsonp"==v(e)){var R="_"+(d.counter++).toString(36);d[R]=function(a){d[R].data=a};var H=g(m.replace("JSON_CALLBACK","angular.callbacks."+R),function(){d[R].data?F(l,200,d[R].data):F(l,u||-2);d[R]=Ba.noop})}else{var x= -a(e);x.open(e,m,!0);q(n,function(a,b){C(a)&&x.setRequestHeader(b,a)});x.onreadystatechange=function(){if(x&&4==x.readyState){var a=null,b=null;u!==f&&(a=x.getAllResponseHeaders(),b="response"in x?x.response:x.responseText);F(l,u||x.status,b,a)}};r&&(x.withCredentials=!0);E&&(x.responseType=E);x.send(k||null)}if(0=h&&(n.resolve(r), -l(p.$$intervalId),delete e[p.$$intervalId]);E||b.$apply()},f);e[p.$$intervalId]=n;return p}var e={};d.cancel=function(a){return a&&a.$$intervalId in e?(e[a.$$intervalId].reject("canceled"),clearInterval(a.$$intervalId),delete e[a.$$intervalId],!0):!1};return d}]}function rd(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"\u00a4", -posSuf:"",negPre:"(\u00a4",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January February March April May June July August September October November December".split(" "),SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y", -mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a"},pluralCat:function(b){return 1===b?"one":"other"}}}}function pc(b){b=b.split("/");for(var a=b.length;a--;)b[a]=sb(b[a]);return b.join("/")}function qc(b,a,c){b=xa(b,c);a.$$protocol=b.protocol;a.$$host=b.hostname;a.$$port=W(b.port)||sd[b.protocol]||null}function rc(b,a,c){var d="/"!==b.charAt(0);d&&(b="/"+b);b=xa(b,c);a.$$path=decodeURIComponent(d&&"/"===b.pathname.charAt(0)?b.pathname.substring(1):b.pathname);a.$$search= -Vb(b.search);a.$$hash=decodeURIComponent(b.hash);a.$$path&&"/"!=a.$$path.charAt(0)&&(a.$$path="/"+a.$$path)}function na(b,a){if(0===a.indexOf(b))return a.substr(b.length)}function Wa(b){var a=b.indexOf("#");return-1==a?b:b.substr(0,a)}function Fb(b){return b.substr(0,Wa(b).lastIndexOf("/")+1)}function sc(b,a){this.$$html5=!0;a=a||"";var c=Fb(b);qc(b,this,b);this.$$parse=function(a){var e=na(c,a);if(!D(e))throw Gb("ipthprfx",a,c);rc(e,this,b);this.$$path||(this.$$path="/");this.$$compose()};this.$$compose= -function(){var a=Wb(this.$$search),b=this.$$hash?"#"+sb(this.$$hash):"";this.$$url=pc(this.$$path)+(a?"?"+a:"")+b;this.$$absUrl=c+this.$$url.substr(1)};this.$$rewrite=function(d){var e;if((e=na(b,d))!==s)return d=e,(e=na(a,e))!==s?c+(na("/",e)||e):b+d;if((e=na(c,d))!==s)return c+e;if(c==d+"/")return c}}function Hb(b,a){var c=Fb(b);qc(b,this,b);this.$$parse=function(d){var e=na(b,d)||na(c,d),e="#"==e.charAt(0)?na(a,e):this.$$html5?e:"";if(!D(e))throw Gb("ihshprfx",d,a);rc(e,this,b);d=this.$$path;var g= -/^\/?.*?:(\/.*)/;0===e.indexOf(b)&&(e=e.replace(b,""));g.exec(e)||(d=(e=g.exec(d))?e[1]:d);this.$$path=d;this.$$compose()};this.$$compose=function(){var c=Wb(this.$$search),e=this.$$hash?"#"+sb(this.$$hash):"";this.$$url=pc(this.$$path)+(c?"?"+c:"")+e;this.$$absUrl=b+(this.$$url?a+this.$$url:"")};this.$$rewrite=function(a){if(Wa(b)==Wa(a))return a}}function tc(b,a){this.$$html5=!0;Hb.apply(this,arguments);var c=Fb(b);this.$$rewrite=function(d){var e;if(b==Wa(d))return d;if(e=na(c,d))return b+a+e; -if(c===d+"/")return c}}function ib(b){return function(){return this[b]}}function uc(b,a){return function(c){if(B(c))return this[b];this[b]=a(c);this.$$compose();return this}}function td(){var b="",a=!1;this.hashPrefix=function(a){return C(a)?(b=a,this):b};this.html5Mode=function(b){return C(b)?(a=b,this):a};this.$get=["$rootScope","$browser","$sniffer","$rootElement",function(c,d,e,g){function f(a){c.$broadcast("$locationChangeSuccess",h.absUrl(),a)}var h,m=d.baseHref(),k=d.url();a?(m=k.substring(0, -k.indexOf("/",k.indexOf("//")+2))+(m||"/"),e=e.history?sc:tc):(m=Wa(k),e=Hb);h=new e(m,"#"+b);h.$$parse(h.$$rewrite(k));g.on("click",function(a){if(!a.ctrlKey&&!a.metaKey&&2!=a.which){for(var b=A(a.target);"a"!==v(b[0].nodeName);)if(b[0]===g[0]||!(b=b.parent())[0])return;var e=b.prop("href");X(e)&&"[object SVGAnimatedString]"===e.toString()&&(e=xa(e.animVal).href);var f=h.$$rewrite(e);e&&(!b.attr("target")&&f&&!a.isDefaultPrevented())&&(a.preventDefault(),f!=d.url()&&(h.$$parse(f),c.$apply(),Q.angular["ff-684208-preventDefault"]= -!0))}});h.absUrl()!=k&&d.url(h.absUrl(),!0);d.onUrlChange(function(a){h.absUrl()!=a&&(c.$evalAsync(function(){var b=h.absUrl();h.$$parse(a);c.$broadcast("$locationChangeStart",a,b).defaultPrevented?(h.$$parse(b),d.url(b)):f(b)}),c.$$phase||c.$digest())});var l=0;c.$watch(function(){var a=d.url(),b=h.$$replace;l&&a==h.absUrl()||(l++,c.$evalAsync(function(){c.$broadcast("$locationChangeStart",h.absUrl(),a).defaultPrevented?h.$$parse(a):(d.url(h.absUrl(),b),f(a))}));h.$$replace=!1;return l});return h}]} -function ud(){var b=!0,a=this;this.debugEnabled=function(a){return C(a)?(b=a,this):b};this.$get=["$window",function(c){function d(a){a instanceof Error&&(a.stack?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=c.console||{},e=b[a]||b.log||w;a=!1;try{a=!!e.apply}catch(m){}return a?function(){var a=[];q(arguments,function(b){a.push(d(b))});return e.apply(b,a)}:function(a,b){e(a, -null==b?"":b)}}return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){b&&c.apply(a,arguments)}}()}}]}function da(b,a){if("constructor"===b)throw ya("isecfld",a);return b}function Xa(b,a){if(b){if(b.constructor===b)throw ya("isecfn",a);if(b.document&&b.location&&b.alert&&b.setInterval)throw ya("isecwindow",a);if(b.children&&(b.nodeName||b.on&&b.find))throw ya("isecdom",a);}return b}function jb(b,a,c,d,e){e=e||{};a=a.split(".");for(var g, -f=0;1e?vc(d[0],d[1],d[2],d[3],d[4],c,a):function(b,g){var f=0,h;do h=vc(d[f++],d[f++],d[f++],d[f++],d[f++],c,a)(b,g),g=s,b=h;while(fa)for(b in f++,d)d.hasOwnProperty(b)&&!e.hasOwnProperty(b)&&(l--,delete d[b])}else d!== -e&&(d=e,f++);return f},function(){b(e,d,c)})},$digest:function(){var d,f,g,h,k=this.$$asyncQueue,l=this.$$postDigestQueue,q,x,s=b,N,V=[],J,t,O;m("$digest");c=null;do{x=!1;for(N=this;k.length;){try{O=k.shift(),O.scope.$eval(O.expression)}catch(A){p.$$phase=null,e(A)}c=null}a:do{if(h=N.$$watchers)for(q=h.length;q--;)try{if(d=h[q])if((f=d.get(N))!==(g=d.last)&&!(d.eq?ta(f,g):"number"==typeof f&&"number"==typeof g&&isNaN(f)&&isNaN(g)))x=!0,c=d,d.last=d.eq?$(f):f,d.fn(f,g===n?f:g,N),5>s&&(J=4-s,V[J]|| -(V[J]=[]),t=L(d.exp)?"fn: "+(d.exp.name||d.exp.toString()):d.exp,t+="; newVal: "+pa(f)+"; oldVal: "+pa(g),V[J].push(t));else if(d===c){x=!1;break a}}catch(C){p.$$phase=null,e(C)}if(!(h=N.$$childHead||N!==this&&N.$$nextSibling))for(;N!==this&&!(h=N.$$nextSibling);)N=N.$parent}while(N=h);if((x||k.length)&&!s--)throw p.$$phase=null,a("infdig",b,pa(V));}while(x||k.length);for(p.$$phase=null;l.length;)try{l.shift()()}catch(y){e(y)}},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy"); -this.$$destroyed=!0;this!==p&&(q(this.$$listenerCount,bb(null,l,this)),a.$$childHead==this&&(a.$$childHead=this.$$nextSibling),a.$$childTail==this&&(a.$$childTail=this.$$prevSibling),this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling),this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling),this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null)}},$eval:function(a,b){return g(a)(this,b)},$evalAsync:function(a){p.$$phase||p.$$asyncQueue.length|| -f.defer(function(){p.$$asyncQueue.length&&p.$digest()});this.$$asyncQueue.push({scope:this,expression:a})},$$postDigest:function(a){this.$$postDigestQueue.push(a)},$apply:function(a){try{return m("$apply"),this.$eval(a)}catch(b){e(b)}finally{p.$$phase=null;try{p.$digest()}catch(c){throw e(c),c;}}},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=c=[]);c.push(b);var d=this;do d.$$listenerCount[a]||(d.$$listenerCount[a]=0),d.$$listenerCount[a]++;while(d=d.$parent);var e=this;return function(){c[ab(c, -b)]=null;l(e,1,a)}},$emit:function(a,b){var c=[],d,f=this,g=!1,h={name:a,targetScope:f,stopPropagation:function(){g=!0},preventDefault:function(){h.defaultPrevented=!0},defaultPrevented:!1},k=[h].concat(ua.call(arguments,1)),m,l;do{d=f.$$listeners[a]||c;h.currentScope=f;m=0;for(l=d.length;mc.msieDocumentMode)throw ra("iequirks");var e=$(ea);e.isEnabled=function(){return b};e.trustAs=d.trustAs;e.getTrusted=d.getTrusted;e.valueOf=d.valueOf;b||(e.trustAs=e.getTrusted=function(a,b){return b},e.valueOf=Aa);e.parseAs=function(b,c){var d=a(c);return d.literal&&d.constant?d:function(a,c){return e.getTrusted(b,d(a,c))}};var g=e.parseAs, -f=e.getTrusted,h=e.trustAs;q(ea,function(a,b){var c=v(b);e[Qa("parse_as_"+c)]=function(b){return g(a,b)};e[Qa("get_trusted_"+c)]=function(b){return f(a,b)};e[Qa("trust_as_"+c)]=function(b){return h(a,b)}});return e}]}function Fd(){this.$get=["$window","$document",function(b,a){var c={},d=W((/android (\d+)/.exec(v((b.navigator||{}).userAgent))||[])[1]),e=/Boxee/i.test((b.navigator||{}).userAgent),g=a[0]||{},f=g.documentMode,h,m=/^(Moz|webkit|O|ms)(?=[A-Z])/,k=g.body&&g.body.style,l=!1,n=!1;if(k){for(var p in k)if(l= -m.exec(p)){h=l[0];h=h.substr(0,1).toUpperCase()+h.substr(1);break}h||(h="WebkitOpacity"in k&&"webkit");l=!!("transition"in k||h+"Transition"in k);n=!!("animation"in k||h+"Animation"in k);!d||l&&n||(l=D(g.body.style.webkitTransition),n=D(g.body.style.webkitAnimation))}return{history:!(!b.history||!b.history.pushState||4>d||e),hashchange:"onhashchange"in b&&(!f||7b;b=Math.abs(b);var f=b+"",h="",m=[],k=!1;if(-1!==f.indexOf("e")){var l=f.match(/([\d\.]+)e(-?)(\d+)/);l&&"-"==l[2]&&l[3]>e+1?f="0":(h=f,k=!0)}if(k)0b)&&(h=b.toFixed(e));else{f=(f.split(Gc)[1]||"").length;B(e)&&(e=Math.min(Math.max(a.minFrac,f),a.maxFrac));f=Math.pow(10,e);b=Math.round(b*f)/f;b=(""+b).split(Gc);f=b[0];b=b[1]|| -"";var l=0,n=a.lgSize,p=a.gSize;if(f.length>=n+p)for(l=f.length-n,k=0;kb&&(d="-",b=-b);for(b=""+b;b.length-c)e+=c;0===e&&-12==c&&(e=12);return Kb(e,a,d)}}function kb(b,a){return function(c,d){var e=c["get"+b](),g=Ha(a?"SHORT"+b:b);return d[g][e]}}function Cc(b){function a(a){var b;if(b=a.match(c)){a=new Date(0);var g=0,f=0,h=b[8]?a.setUTCFullYear:a.setFullYear,m=b[8]?a.setUTCHours:a.setHours;b[9]&&(g=W(b[9]+b[10]),f=W(b[9]+b[11]));h.call(a,W(b[1]),W(b[2])-1,W(b[3]));g=W(b[4]||0)-g;f=W(b[5]||0)-f;h=W(b[6]||0);b=Math.round(1E3*parseFloat("0."+(b[7]||0)));m.call(a,g,f,h,b)}return a}var c= -/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,e){var g="",f=[],h,m;e=e||"mediumDate";e=b.DATETIME_FORMATS[e]||e;D(c)&&(c=Nd.test(c)?W(c):a(c));rb(c)&&(c=new Date(c));if(!Ka(c))return c;for(;e;)(m=Od.exec(e))?(f=f.concat(ua.call(m,1)),e=f.pop()):(f.push(e),e=null);q(f,function(a){h=Pd[a];g+=h?h(c,b.DATETIME_FORMATS):a.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function Jd(){return function(b){return pa(b,!0)}}function Kd(){return function(b, -a){if(!K(b)&&!D(b))return b;a=W(a);if(D(b))return a?0<=a?b.slice(0,a):b.slice(a,b.length):"";var c=[],d,e;a>b.length?a=b.length:a<-b.length&&(a=-b.length);0a||37<=a&&40>=a)||k()});if(e.hasEvent("paste"))a.on("paste cut",k)}a.on("change",h);d.$render=function(){a.val(d.$isEmpty(d.$viewValue)?"":d.$viewValue)};var l=c.ngPattern; -l&&((e=l.match(/^\/(.*)\/([gim]*)$/))?(l=RegExp(e[1],e[2]),e=function(a){return oa(d,"pattern",d.$isEmpty(a)||l.test(a),a)}):e=function(c){var e=b.$eval(l);if(!e||!e.test)throw t("ngPattern")("noregexp",l,e,fa(a));return oa(d,"pattern",d.$isEmpty(c)||e.test(c),c)},d.$formatters.push(e),d.$parsers.push(e));if(c.ngMinlength){var n=W(c.ngMinlength);e=function(a){return oa(d,"minlength",d.$isEmpty(a)||a.length>=n,a)};d.$parsers.push(e);d.$formatters.push(e)}if(c.ngMaxlength){var p=W(c.ngMaxlength);e= -function(a){return oa(d,"maxlength",d.$isEmpty(a)||a.length<=p,a)};d.$parsers.push(e);d.$formatters.push(e)}}function Lb(b,a){b="ngClass"+b;return function(){return{restrict:"AC",link:function(c,d,e){function g(b){if(!0===a||c.$index%2===a){var d=f(b||"");h?ta(b,h)||e.$updateClass(d,f(h)):e.$addClass(d)}h=$(b)}function f(a){if(K(a))return a.join(" ");if(X(a)){var b=[];q(a,function(a,c){a&&b.push(c)});return b.join(" ")}return a}var h;c.$watch(e[b],g,!0);e.$observe("class",function(a){g(c.$eval(e[b]))}); -"ngClass"!==b&&c.$watch("$index",function(d,g){var h=d&1;if(h!==g&1){var n=f(c.$eval(e[b]));h===a?e.$addClass(n):e.$removeClass(n)}})}}}}var v=function(b){return D(b)?b.toLowerCase():b},Ha=function(b){return D(b)?b.toUpperCase():b},M,A,Ca,ua=[].slice,Qd=[].push,La=Object.prototype.toString,Na=t("ng"),Ba=Q.angular||(Q.angular={}),Ua,Ga,ia=["0","0","0"];M=W((/msie (\d+)/.exec(v(navigator.userAgent))||[])[1]);isNaN(M)&&(M=W((/trident\/.*; rv:(\d+)/.exec(v(navigator.userAgent))||[])[1]));w.$inject=[]; -Aa.$inject=[];var aa=function(){return String.prototype.trim?function(b){return D(b)?b.trim():b}:function(b){return D(b)?b.replace(/^\s\s*/,"").replace(/\s\s*$/,""):b}}();Ga=9>M?function(b){b=b.nodeName?b:b[0];return b.scopeName&&"HTML"!=b.scopeName?Ha(b.scopeName+":"+b.nodeName):b.nodeName}:function(b){return b.nodeName?b.nodeName:b[0].nodeName};var Tc=/[A-Z]/g,Rd={full:"1.2.11",major:1,minor:2,dot:11,codeName:"cryptocurrency-hyperdeflation"},Ra=P.cache={},db=P.expando="ng-"+(new Date).getTime(), -Xc=1,Ic=Q.document.addEventListener?function(b,a,c){b.addEventListener(a,c,!1)}:function(b,a,c){b.attachEvent("on"+a,c)},zb=Q.document.removeEventListener?function(b,a,c){b.removeEventListener(a,c,!1)}:function(b,a,c){b.detachEvent("on"+a,c)},Vc=/([\:\-\_]+(.))/g,Wc=/^moz([A-Z])/,wb=t("jqLite"),Fa=P.prototype={ready:function(b){function a(){c||(c=!0,b())}var c=!1;"complete"===S.readyState?setTimeout(a):(this.on("DOMContentLoaded",a),P(Q).on("load",a))},toString:function(){var b=[];q(this,function(a){b.push(""+ -a)});return"["+b.join(", ")+"]"},eq:function(b){return 0<=b?A(this[b]):A(this[this.length+b])},length:0,push:Qd,sort:[].sort,splice:[].splice},fb={};q("multiple selected checked disabled readOnly required open".split(" "),function(b){fb[v(b)]=b});var fc={};q("input select option textarea button form details".split(" "),function(b){fc[Ha(b)]=!0});q({data:bc,inheritedData:eb,scope:function(b){return A(b).data("$scope")||eb(b.parentNode||b,["$isolateScope","$scope"])},isolateScope:function(b){return A(b).data("$isolateScope")|| -A(b).data("$isolateScopeNoTemplate")},controller:cc,injector:function(b){return eb(b,"$injector")},removeAttr:function(b,a){b.removeAttribute(a)},hasClass:Ab,css:function(b,a,c){a=Qa(a);if(C(c))b.style[a]=c;else{var d;8>=M&&(d=b.currentStyle&&b.currentStyle[a],""===d&&(d="auto"));d=d||b.style[a];8>=M&&(d=""===d?s:d);return d}},attr:function(b,a,c){var d=v(a);if(fb[d])if(C(c))c?(b[a]=!0,b.setAttribute(a,d)):(b[a]=!1,b.removeAttribute(d));else return b[a]||(b.attributes.getNamedItem(a)||w).specified? -d:s;else if(C(c))b.setAttribute(a,c);else if(b.getAttribute)return b=b.getAttribute(a,2),null===b?s:b},prop:function(b,a,c){if(C(c))b[a]=c;else return b[a]},text:function(){function b(b,d){var e=a[b.nodeType];if(B(d))return e?b[e]:"";b[e]=d}var a=[];9>M?(a[1]="innerText",a[3]="nodeValue"):a[1]=a[3]="textContent";b.$dv="";return b}(),val:function(b,a){if(B(a)){if("SELECT"===Ga(b)&&b.multiple){var c=[];q(b.options,function(a){a.selected&&c.push(a.value||a.text)});return 0===c.length?null:c}return b.value}b.value= -a},html:function(b,a){if(B(a))return b.innerHTML;for(var c=0,d=b.childNodes;c":function(a,c,d,e){return d(a,c)>e(a,c)},"<=":function(a,c,d,e){return d(a,c)<=e(a,c)},">=":function(a,c,d,e){return d(a, -c)>=e(a,c)},"&&":function(a,c,d,e){return d(a,c)&&e(a,c)},"||":function(a,c,d,e){return d(a,c)||e(a,c)},"&":function(a,c,d,e){return d(a,c)&e(a,c)},"|":function(a,c,d,e){return e(a,c)(a,c,d(a,c))},"!":function(a,c,d){return!d(a,c)}},Vd={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},Jb=function(a){this.options=a};Jb.prototype={constructor:Jb,lex:function(a){this.text=a;this.index=0;this.ch=s;this.lastCh=":";this.tokens=[];var c;for(a=[];this.index=a},isWhitespace:function(a){return" "===a||"\r"===a||"\t"===a||"\n"===a||"\v"===a||"\u00a0"===a},isIdent:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,c,d){d=d||this.index;c=C(c)?"s "+c+"-"+this.index+" ["+this.text.substring(c,d)+ -"]":" "+d;throw ya("lexerr",a,c,this.text);},readNumber:function(){for(var a="",c=this.index;this.index","<=",">="))a=this.binaryFn(a,c.fn,this.relational());return a},additive:function(){for(var a=this.multiplicative(),c;c=this.expect("+","-");)a=this.binaryFn(a,c.fn,this.multiplicative());return a},multiplicative:function(){for(var a=this.unary(),c;c=this.expect("*", -"/","%");)a=this.binaryFn(a,c.fn,this.unary());return a},unary:function(){var a;return this.expect("+")?this.primary():(a=this.expect("-"))?this.binaryFn(Ya.ZERO,a.fn,this.unary()):(a=this.expect("!"))?this.unaryFn(a.fn,this.unary()):this.primary()},fieldAccess:function(a){var c=this,d=this.expect().text,e=wc(d,this.options,this.text);return y(function(c,d,h){return e(h||a(c,d))},{assign:function(e,f,h){return jb(a(e,h),d,f,c.text,c.options)}})},objectIndex:function(a){var c=this,d=this.expression(); -this.consume("]");return y(function(e,g){var f=a(e,g),h=d(e,g),m;if(!f)return s;(f=Xa(f[h],c.text))&&(f.then&&c.options.unwrapPromises)&&(m=f,"$$v"in f||(m.$$v=s,m.then(function(a){m.$$v=a})),f=f.$$v);return f},{assign:function(e,g,f){var h=d(e,f);return Xa(a(e,f),c.text)[h]=g}})},functionCall:function(a,c){var d=[];if(")"!==this.peekToken().text){do d.push(this.expression());while(this.expect(","))}this.consume(")");var e=this;return function(g,f){for(var h=[],m=c?c(g,f):g,k=0;ka.getHours()?c.AMPMS[0]:c.AMPMS[1]},Z:function(a){a=-1*a.getTimezoneOffset();return a=(0<=a?"+":"")+(Kb(Math[0=M&&(c.href||c.name||c.$set("href",""),a.append(S.createComment("IE fix")));if(!c.href&&!c.xlinkHref&&!c.name)return function(a,c){var g="[object SVGAnimatedString]"===La.call(c.prop("href"))?"xlink:href":"href";c.on("click",function(a){c.attr(g)||a.preventDefault()})}}}), -Mb={};q(fb,function(a,c){if("multiple"!=a){var d=la("ng-"+c);Mb[d]=function(){return{priority:100,link:function(a,g,f){a.$watch(f[d],function(a){f.$set(c,!!a)})}}}}});q(["src","srcset","href"],function(a){var c=la("ng-"+a);Mb[c]=function(){return{priority:99,link:function(d,e,g){g.$observe(c,function(c){c&&(g.$set(a,c),M&&e.prop(a,g[a]))})}}}});var nb={$addControl:w,$removeControl:w,$setValidity:w,$setDirty:w,$setPristine:w};Hc.$inject=["$element","$attrs","$scope"];var Jc=function(a){return["$timeout", -function(c){return{name:"form",restrict:a?"EAC":"E",controller:Hc,compile:function(){return{pre:function(a,e,g,f){if(!g.action){var h=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1};Ic(e[0],"submit",h);e.on("$destroy",function(){c(function(){zb(e[0],"submit",h)},0,!1)})}var m=e.parent().controller("form"),k=g.name||g.ngForm;k&&jb(a,k,f,k);if(m)e.on("$destroy",function(){m.$removeControl(f);k&&jb(a,k,s,k);y(f,nb)})}}}}}]},Xd=Jc(),Yd=Jc(!0),Zd=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/, -$d=/^[a-z0-9!#$%&'*+/=?^_`{|}~.-]+@[a-z0-9-]+(\.[a-z0-9-]+)*$/i,ae=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,Kc={text:pb,number:function(a,c,d,e,g,f){pb(a,c,d,e,g,f);e.$parsers.push(function(a){var c=e.$isEmpty(a);if(c||ae.test(a))return e.$setValidity("number",!0),""===a?null:c?a:parseFloat(a);e.$setValidity("number",!1);return s});e.$formatters.push(function(a){return e.$isEmpty(a)?"":""+a});d.min&&(a=function(a){var c=parseFloat(d.min);return oa(e,"min",e.$isEmpty(a)||a>=c,a)},e.$parsers.push(a),e.$formatters.push(a)); -d.max&&(a=function(a){var c=parseFloat(d.max);return oa(e,"max",e.$isEmpty(a)||a<=c,a)},e.$parsers.push(a),e.$formatters.push(a));e.$formatters.push(function(a){return oa(e,"number",e.$isEmpty(a)||rb(a),a)})},url:function(a,c,d,e,g,f){pb(a,c,d,e,g,f);a=function(a){return oa(e,"url",e.$isEmpty(a)||Zd.test(a),a)};e.$formatters.push(a);e.$parsers.push(a)},email:function(a,c,d,e,g,f){pb(a,c,d,e,g,f);a=function(a){return oa(e,"email",e.$isEmpty(a)||$d.test(a),a)};e.$formatters.push(a);e.$parsers.push(a)}, -radio:function(a,c,d,e){B(d.name)&&c.attr("name",Za());c.on("click",function(){c[0].checked&&a.$apply(function(){e.$setViewValue(d.value)})});e.$render=function(){c[0].checked=d.value==e.$viewValue};d.$observe("value",e.$render)},checkbox:function(a,c,d,e){var g=d.ngTrueValue,f=d.ngFalseValue;D(g)||(g=!0);D(f)||(f=!1);c.on("click",function(){a.$apply(function(){e.$setViewValue(c[0].checked)})});e.$render=function(){c[0].checked=e.$viewValue};e.$isEmpty=function(a){return a!==g};e.$formatters.push(function(a){return a=== -g});e.$parsers.push(function(a){return a?g:f})},hidden:w,button:w,submit:w,reset:w},Lc=["$browser","$sniffer",function(a,c){return{restrict:"E",require:"?ngModel",link:function(d,e,g,f){f&&(Kc[v(g.type)]||Kc.text)(d,e,g,f,c,a)}}}],mb="ng-valid",lb="ng-invalid",Ia="ng-pristine",ob="ng-dirty",be=["$scope","$exceptionHandler","$attrs","$element","$parse",function(a,c,d,e,g){function f(a,c){c=c?"-"+cb(c,"-"):"";e.removeClass((a?lb:mb)+c).addClass((a?mb:lb)+c)}this.$modelValue=this.$viewValue=Number.NaN; -this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$name=d.name;var h=g(d.ngModel),m=h.assign;if(!m)throw t("ngModel")("nonassign",d.ngModel,fa(e));this.$render=w;this.$isEmpty=function(a){return B(a)||""===a||null===a||a!==a};var k=e.inheritedData("$formController")||nb,l=0,n=this.$error={};e.addClass(Ia);f(!0);this.$setValidity=function(a,c){n[a]!==!c&&(c?(n[a]&&l--,l||(f(!0),this.$valid=!0,this.$invalid=!1)):(f(!1), -this.$invalid=!0,this.$valid=!1,l++),n[a]=!c,f(c,a),k.$setValidity(a,c,this))};this.$setPristine=function(){this.$dirty=!1;this.$pristine=!0;e.removeClass(ob).addClass(Ia)};this.$setViewValue=function(d){this.$viewValue=d;this.$pristine&&(this.$dirty=!0,this.$pristine=!1,e.removeClass(Ia).addClass(ob),k.$setDirty());q(this.$parsers,function(a){d=a(d)});this.$modelValue!==d&&(this.$modelValue=d,m(a,d),q(this.$viewChangeListeners,function(a){try{a()}catch(d){c(d)}}))};var p=this;a.$watch(function(){var c= -h(a);if(p.$modelValue!==c){var d=p.$formatters,e=d.length;for(p.$modelValue=c;e--;)c=d[e](c);p.$viewValue!==c&&(p.$viewValue=c,p.$render())}return c})}],ce=function(){return{require:["ngModel","^?form"],controller:be,link:function(a,c,d,e){var g=e[0],f=e[1]||nb;f.$addControl(g);a.$on("$destroy",function(){f.$removeControl(g)})}}},de=Z({require:"ngModel",link:function(a,c,d,e){e.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),Mc=function(){return{require:"?ngModel",link:function(a,c, -d,e){if(e){d.required=!0;var g=function(a){if(d.required&&e.$isEmpty(a))e.$setValidity("required",!1);else return e.$setValidity("required",!0),a};e.$formatters.push(g);e.$parsers.unshift(g);d.$observe("required",function(){g(e.$viewValue)})}}}},ee=function(){return{require:"ngModel",link:function(a,c,d,e){var g=(a=/\/(.*)\//.exec(d.ngList))&&RegExp(a[1])||d.ngList||",";e.$parsers.push(function(a){if(!B(a)){var c=[];a&&q(a.split(g),function(a){a&&c.push(aa(a))});return c}});e.$formatters.push(function(a){return K(a)? -a.join(", "):s});e.$isEmpty=function(a){return!a||!a.length}}}},fe=/^(true|false|\d+)$/,ge=function(){return{priority:100,compile:function(a,c){return fe.test(c.ngValue)?function(a,c,g){g.$set("value",a.$eval(g.ngValue))}:function(a,c,g){a.$watch(g.ngValue,function(a){g.$set("value",a)})}}}},he=sa(function(a,c,d){c.addClass("ng-binding").data("$binding",d.ngBind);a.$watch(d.ngBind,function(a){c.text(a==s?"":a)})}),ie=["$interpolate",function(a){return function(c,d,e){c=a(d.attr(e.$attr.ngBindTemplate)); -d.addClass("ng-binding").data("$binding",c);e.$observe("ngBindTemplate",function(a){d.text(a)})}}],je=["$sce","$parse",function(a,c){return function(d,e,g){e.addClass("ng-binding").data("$binding",g.ngBindHtml);var f=c(g.ngBindHtml);d.$watch(function(){return(f(d)||"").toString()},function(c){e.html(a.getTrustedHtml(f(d))||"")})}}],ke=Lb("",!0),le=Lb("Odd",0),me=Lb("Even",1),ne=sa({compile:function(a,c){c.$set("ngCloak",s);a.removeClass("ng-cloak")}}),oe=[function(){return{scope:!0,controller:"@", -priority:500}}],Nc={};q("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(a){var c=la("ng-"+a);Nc[c]=["$parse",function(d){return{compile:function(e,g){var f=d(g[c]);return function(c,d,e){d.on(v(a),function(a){c.$apply(function(){f(c,{$event:a})})})}}}}]});var pe=["$animate",function(a){return{transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(c,d,e,g,f){var h, -m;c.$watch(e.ngIf,function(g){Oa(g)?m||(m=c.$new(),f(m,function(c){c[c.length++]=S.createComment(" end ngIf: "+e.ngIf+" ");h={clone:c};a.enter(c,d.parent(),d)})):(m&&(m.$destroy(),m=null),h&&(a.leave(ub(h.clone)),h=null))})}}}],qe=["$http","$templateCache","$anchorScroll","$animate","$sce",function(a,c,d,e,g){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:Ba.noop,compile:function(f,h){var m=h.ngInclude||h.src,k=h.onload||"",l=h.autoscroll;return function(f,h,q,s,z){var t= -0,u,A,H=function(){u&&(u.$destroy(),u=null);A&&(e.leave(A),A=null)};f.$watch(g.parseAsResourceUrl(m),function(g){var m=function(){!C(l)||l&&!f.$eval(l)||d()},q=++t;g?(a.get(g,{cache:c}).success(function(a){if(q===t){var c=f.$new();s.template=a;a=z(c,function(a){H();e.enter(a,null,h,m)});u=c;A=a;u.$emit("$includeContentLoaded");f.$eval(k)}}).error(function(){q===t&&H()}),f.$emit("$includeContentRequested")):(H(),s.template=null)})}}}}],re=["$compile",function(a){return{restrict:"ECA",priority:-400, -require:"ngInclude",link:function(c,d,e,g){d.html(g.template);a(d.contents())(c)}}}],se=sa({priority:450,compile:function(){return{pre:function(a,c,d){a.$eval(d.ngInit)}}}}),te=sa({terminal:!0,priority:1E3}),ue=["$locale","$interpolate",function(a,c){var d=/{}/g;return{restrict:"EA",link:function(e,g,f){var h=f.count,m=f.$attr.when&&g.attr(f.$attr.when),k=f.offset||0,l=e.$eval(m)||{},n={},p=c.startSymbol(),r=c.endSymbol(),s=/^when(Minus)?(.+)$/;q(f,function(a,c){s.test(c)&&(l[v(c.replace("when","").replace("Minus", -"-"))]=g.attr(f.$attr[c]))});q(l,function(a,e){n[e]=c(a.replace(d,p+h+"-"+k+r))});e.$watch(function(){var c=parseFloat(e.$eval(h));if(isNaN(c))return"";c in l||(c=a.pluralCat(c-k));return n[c](e,g,!0)},function(a){g.text(a)})}}}],ve=["$parse","$animate",function(a,c){var d=t("ngRepeat");return{transclude:"element",priority:1E3,terminal:!0,$$tlb:!0,link:function(e,g,f,h,m){var k=f.ngRepeat,l=k.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),n,p,r,s,z,t,u={$id:Ea};if(!l)throw d("iexp", -k);f=l[1];h=l[2];(l=l[3])?(n=a(l),p=function(a,c,d){t&&(u[t]=a);u[z]=c;u.$index=d;return n(e,u)}):(r=function(a,c){return Ea(c)},s=function(a){return a});l=f.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/);if(!l)throw d("iidexp",f);z=l[3]||l[1];t=l[2];var C={};e.$watchCollection(h,function(a){var f,h,l=g[0],n,u={},y,O,B,D,T,w,v=[];if(qb(a))T=a,n=p||r;else{n=p||s;T=[];for(B in a)a.hasOwnProperty(B)&&"$"!=B.charAt(0)&&T.push(B);T.sort()}y=T.length;h=v.length=T.length;for(f=0;fv;)x.pop().element.remove()}for(;y.length> -I;)y.pop()[0].element.remove()}var k;if(!(k=t.match(d)))throw Ee("iexp",t,fa(f));var l=c(k[2]||k[1]),m=k[4]||k[6],n=k[5],p=c(k[3]||""),q=c(k[2]?k[1]:m),A=c(k[7]),w=k[8]?c(k[8]):null,y=[[{element:f,label:""}]];z&&(a(z)(e),z.removeClass("ng-scope"),z.remove());f.empty();f.on("change",function(){e.$apply(function(){var a,c=A(e)||[],d={},h,k,l,p,t,u,v;if(r)for(k=[],p=0,u=y.length;p@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide{display:none !important;}ng\\:form{display:block;}'); -//# sourceMappingURL=angular.min.js.map diff --git a/app/lib/angular/angular.min.js.map b/app/lib/angular/angular.min.js.map deleted file mode 100644 index aee17a54..00000000 --- a/app/lib/angular/angular.min.js.map +++ /dev/null @@ -1,8 +0,0 @@ -{ -"version":3, -"file":"angular.min.js", -"lineCount":249, -"mappings":"A;;;;;aAKC,SAAQ,CAACA,CAAD,CAASC,CAAT,CAAmBC,CAAnB,CAA8B,CAgCvCC,QAAAA,EAAAA,CAAAA,CAAAA,CAAAA,CAAAA,MAAAA,SAAAA,EAAAA,CAAAA,IAAAA,EAAAA,SAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,EAAAA,CAAAA,GAAAA,EAAAA,CAAAA,CAAAA,CAAAA,CAAAA,GAAAA,CAAAA,EAAAA,EAAAA,CAAAA,CAAAA,sCAAAA,EAAAA,CAAAA,CAAAA,CAAAA,CAAAA,GAAAA,CAAAA,EAAAA,EAAAA,CAAAA,KAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,SAAAA,OAAAA,CAAAA,CAAAA,EAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,EAAAA,CAAAA,EAAAA,CAAAA,CAAAA,GAAAA,CAAAA,GAAAA,EAAAA,GAAAA,EAAAA,CAAAA,CAAAA,CAAAA,EAAAA,GAAAA,KAAAA,EAAAA,kBAAAA,CAAAA,CAAAA,EAAAA,CAAAA,SAAAA,CAAAA,CAAAA,CAAAA,EAAAA,CAAAA,UAAAA,EAAAA,MAAAA,EAAAA,CAAAA,CAAAA,SAAAA,EAAAA,QAAAA,CAAAA,aAAAA,CAAAA,EAAAA,CAAAA,CAAAA,WAAAA,EAAAA,MAAAA,EAAAA,CAAAA,WAAAA,CAAAA,QAAAA,EAAAA,MAAAA,EAAAA,CAAAA,IAAAA,UAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,EAAAA,E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,8MAAtD;", -"sources":["angular.js"], -"names":["window","document","undefined","minErr","isArrayLike","obj","isWindow","length","nodeType","NODE_TYPE_ELEMENT","isString","isArray","forEach","iterator","context","key","isFunction","hasOwnProperty","call","isPrimitive","forEachSorted","keys","Object","sort","i","reverseParams","iteratorFn","value","nextUid","uid","setHashKey","h","$$hashKey","extend","dst","ii","arguments","j","jj","int","str","parseInt","noop","identity","$","valueFn","isUndefined","isDefined","isObject","isNumber","isDate","toString","isRegExp","isScope","$evalAsync","$watch","isBoolean","isElement","node","nodeName","prop","attr","find","makeMap","items","split","nodeName_","element","lowercase","arrayRemove","array","index","indexOf","splice","copy","source","destination","stackSource","stackDest","ngMinErr","push","result","Date","getTime","RegExp","match","lastIndex","emptyObject","create","getPrototypeOf","shallowCopy","src","charAt","equals","o1","o2","t1","t2","keySet","concat","array1","array2","slice","bind","self","fn","curryArgs","startIndex","apply","toJsonReplacer","val","toJson","pretty","JSON","stringify","fromJson","json","parse","startingTag","jqLite","clone","empty","e","elemHtml","append","html","NODE_TYPE_TEXT","replace","tryDecodeURIComponent","decodeURIComponent","parseKeyValue","keyValue","key_value","toKeyValue","parts","arrayValue","encodeUriQuery","join","encodeUriSegment","pctEncodeSpaces","encodeURIComponent","getNgAttribute","ngAttr","ngAttrPrefixes","angularInit","bootstrap","appElement","module","config","prefix","name","hasAttribute","getAttribute","candidate","querySelector","strictDi","modules","defaultConfig","doBootstrap","injector","tag","unshift","$provide","debugInfoEnabled","$compileProvider","createInjector","invoke","bootstrapApply","scope","compile","$apply","data","NG_ENABLE_DEBUG_INFO","NG_DEFER_BOOTSTRAP","test","angular","resumeBootstrap","angular.resumeBootstrap","extraModules","reloadWithDebugInfo","location","reload","getTestability","rootElement","get","snake_case","separator","SNAKE_CASE_REGEXP","letter","pos","toLowerCase","bindJQuery","originalCleanData","bindJQueryFired","jQuery","on","JQLitePrototype","isolateScope","controller","inheritedData","cleanData","jQuery.cleanData","elems","events","skipDestroyOnNextJQueryCleanData","elem","_data","$destroy","triggerHandler","JQLite","assertArg","arg","reason","assertArgFn","acceptArrayAnnotation","constructor","assertNotHasOwnProperty","getter","path","bindFnToScope","lastInstance","len","getBlockNodes","nodes","endNode","blockNodes","nextSibling","createMap","setupModuleLoader","ensure","factory","$injectorMinErr","$$minErr","requires","configFn","invokeLater","provider","method","insertMethod","queue","invokeQueue","moduleInstance","configBlocks","runBlocks","_invokeQueue","_configBlocks","_runBlocks","service","constant","animation","filter","directive","run","block","publishExternalAPI","version","uppercase","counter","csp","angularModule","$LocaleProvider","ngModule","$$sanitizeUri","$$SanitizeUriProvider","$CompileProvider","a","htmlAnchorDirective","input","inputDirective","textarea","form","formDirective","script","scriptDirective","select","selectDirective","style","styleDirective","option","optionDirective","ngBind","ngBindDirective","ngBindHtml","ngBindHtmlDirective","ngBindTemplate","ngBindTemplateDirective","ngClass","ngClassDirective","ngClassEven","ngClassEvenDirective","ngClassOdd","ngClassOddDirective","ngCloak","ngCloakDirective","ngController","ngControllerDirective","ngForm","ngFormDirective","ngHide","ngHideDirective","ngIf","ngIfDirective","ngInclude","ngIncludeDirective","ngInit","ngInitDirective","ngNonBindable","ngNonBindableDirective","ngPluralize","ngPluralizeDirective","ngRepeat","ngRepeatDirective","ngShow","ngShowDirective","ngStyle","ngStyleDirective","ngSwitch","ngSwitchDirective","ngSwitchWhen","ngSwitchWhenDirective","ngSwitchDefault","ngSwitchDefaultDirective","ngOptions","ngOptionsDirective","ngTransclude","ngTranscludeDirective","ngModel","ngModelDirective","ngList","ngListDirective","ngChange","ngChangeDirective","pattern","patternDirective","ngPattern","required","requiredDirective","ngRequired","minlength","minlengthDirective","ngMinlength","maxlength","maxlengthDirective","ngMaxlength","ngValue","ngValueDirective","ngModelOptions","ngModelOptionsDirective","ngIncludeFillContentDirective","ngAttributeAliasDirectives","ngEventDirectives","$anchorScroll","$AnchorScrollProvider","$animate","$AnimateProvider","$browser","$BrowserProvider","$cacheFactory","$CacheFactoryProvider","$controller","$ControllerProvider","$document","$DocumentProvider","$exceptionHandler","$ExceptionHandlerProvider","$filter","$FilterProvider","$interpolate","$InterpolateProvider","$interval","$IntervalProvider","$http","$HttpProvider","$httpBackend","$HttpBackendProvider","$location","$LocationProvider","$log","$LogProvider","$parse","$ParseProvider","$rootScope","$RootScopeProvider","$q","$QProvider","$$q","$$QProvider","$sce","$SceProvider","$sceDelegate","$SceDelegateProvider","$sniffer","$SnifferProvider","$templateCache","$TemplateCacheProvider","$templateRequest","$TemplateRequestProvider","$$testability","$$TestabilityProvider","$timeout","$TimeoutProvider","$window","$WindowProvider","$$rAF","$$RAFProvider","$$asyncCallback","$$AsyncCallbackProvider","$$jqLite","$$jqLiteProvider","camelCase","SPECIAL_CHARS_REGEXP","_","offset","toUpperCase","MOZ_HACK_REGEXP","jqLiteAcceptsData","NODE_TYPE_DOCUMENT","jqLiteBuildFragment","tmp","fragment","createDocumentFragment","HTML_REGEXP","appendChild","createElement","TAG_NAME_REGEXP","exec","wrap","wrapMap","_default","innerHTML","XHTML_TAG_REGEXP","lastChild","childNodes","firstChild","textContent","createTextNode","argIsString","trim","jqLiteMinErr","parsed","SINGLE_TAG_REGEXP","jqLiteAddNodes","jqLiteClone","cloneNode","jqLiteDealoc","onlyDescendants","jqLiteRemoveData","querySelectorAll","descendants","l","jqLiteOff","type","unsupported","expandoStore","jqLiteExpandoStore","handle","listenerFns","removeEventListener","expandoId","ng339","jqCache","createIfNecessary","jqId","jqLiteData","isSimpleSetter","isSimpleGetter","massGetter","jqLiteHasClass","selector","jqLiteRemoveClass","cssClasses","setAttribute","cssClass","jqLiteAddClass","existingClasses","root","elements","jqLiteController","jqLiteInheritedData","documentElement","names","parentNode","NODE_TYPE_DOCUMENT_FRAGMENT","host","jqLiteEmpty","removeChild","jqLiteRemove","keepData","parent","jqLiteDocumentLoaded","action","win","readyState","setTimeout","getBooleanAttrName","booleanAttr","BOOLEAN_ATTR","BOOLEAN_ELEMENTS","getAliasedAttrName","ALIASED_ATTR","createEventHandler","eventHandler","event","isDefaultPrevented","event.isDefaultPrevented","defaultPrevented","eventFns","eventFnsLength","immediatePropagationStopped","originalStopImmediatePropagation","stopImmediatePropagation","event.stopImmediatePropagation","stopPropagation","isImmediatePropagationStopped","event.isImmediatePropagationStopped","$get","this.$get","hasClass","classes","addClass","removeClass","hashKey","nextUidFn","objType","HashMap","isolatedUid","this.nextUid","put","anonFn","args","fnText","STRIP_COMMENTS","FN_ARGS","annotate","$inject","argDecl","FN_ARG_SPLIT","FN_ARG","all","underscore","last","modulesToLoad","supportObject","delegate","provider_","providerInjector","instantiate","providerCache","providerSuffix","enforceReturnValue","enforcedReturnValue","instanceInjector","factoryFn","enforce","loadModules","moduleFn","runInvokeQueue","invokeArgs","loadedModules","message","stack","createInternalInjector","cache","getService","serviceName","caller","INSTANTIATING","err","shift","locals","Type","instance","prototype","returnedValue","has","$injector","instanceCache","decorator","decorFn","origProvider","orig$get","origProvider.$get","origInstance","$delegate","autoScrollingEnabled","disableAutoScrolling","this.disableAutoScrolling","getFirstAnchor","list","Array","some","scrollTo","scrollIntoView","scroll","yOffset","getComputedStyle","position","getBoundingClientRect","bottom","elemTop","top","scrollBy","hash","elm","getElementById","getElementsByName","autoScrollWatch","autoScrollWatchAction","newVal","oldVal","supported","Browser","completeOutstandingRequest","outstandingRequestCount","outstandingRequestCallbacks","pop","error","startPoller","interval","check","pollFns","pollFn","pollTimeout","cacheStateAndFireUrlChange","cacheState","fireUrlChange","cachedState","history","state","lastCachedState","lastBrowserUrl","url","lastHistoryState","urlChangeListeners","listener","safeDecodeURIComponent","rawDocument","clearTimeout","pendingDeferIds","isMock","$$completeOutstandingRequest","$$incOutstandingRequestCount","self.$$incOutstandingRequestCount","notifyWhenNoOutstandingRequests","self.notifyWhenNoOutstandingRequests","callback","addPollFn","self.addPollFn","href","baseElement","reloadLocation","self.url","sameState","sameBase","stripHash","substr","self.state","urlChangeInit","onUrlChange","self.onUrlChange","$$checkUrlChange","baseHref","self.baseHref","lastCookies","lastCookieString","cookiePath","cookies","self.cookies","cookieLength","cookie","warn","cookieArray","substring","defer","self.defer","delay","timeoutId","cancel","self.defer.cancel","deferId","cacheFactory","cacheId","options","refresh","entry","freshEnd","staleEnd","n","link","p","nextEntry","prevEntry","caches","size","stats","id","capacity","Number","MAX_VALUE","lruHash","lruEntry","remove","removeAll","destroy","info","cacheFactory.info","cacheFactory.get","$$sanitizeUriProvider","parseIsolateBindings","directiveName","LOCAL_REGEXP","bindings","definition","scopeName","$compileMinErr","mode","collection","optional","attrName","hasDirectives","COMMENT_DIRECTIVE_REGEXP","CLASS_DIRECTIVE_REGEXP","ALL_OR_NOTHING_ATTRS","REQUIRE_PREFIX_REGEXP","EVENT_HANDLER_ATTR_REGEXP","this.directive","registerDirective","directiveFactory","Suffix","directives","priority","require","restrict","$$isolateBindings","aHrefSanitizationWhitelist","this.aHrefSanitizationWhitelist","regexp","imgSrcSanitizationWhitelist","this.imgSrcSanitizationWhitelist","this.debugInfoEnabled","enabled","safeAddClass","$element","className","$compileNodes","transcludeFn","maxPriority","ignoreDirective","previousCompileContext","nodeValue","compositeLinkFn","compileNodes","$$addScopeClass","namespace","publicLinkFn","cloneConnectFn","parentBoundTranscludeFn","transcludeControllers","futureParentElement","$$boundTransclude","$linkNode","wrapTemplate","controllerName","$$addScopeInfo","nodeList","$rootElement","childLinkFn","childScope","childBoundTranscludeFn","stableNodeList","nodeLinkFnFound","linkFns","idx","nodeLinkFn","$new","transcludeOnThisElement","createBoundTranscludeFn","transclude","elementTranscludeOnThisElement","templateOnThisElement","attrs","linkFnFound","Attributes","collectDirectives","applyDirectivesToNode","$$element","terminal","previousBoundTranscludeFn","elementTransclusion","boundTranscludeFn","transcludedScope","cloneFn","controllers","containingScope","$$transcluded","attrsMap","$attr","addDirective","directiveNormalize","isNgAttr","nAttrs","attributes","attrStartName","attrEndName","ngAttrName","NG_ATTR_BINDING","PREFIX_REGEXP","directiveNName","directiveIsMultiElement","nName","addAttrInterpolateDirective","addTextInterpolateDirective","NODE_TYPE_COMMENT","byPriority","groupScan","attrStart","attrEnd","depth","groupElementsLinkFnWrapper","linkFn","compileNode","templateAttrs","jqCollection","originalReplaceDirective","preLinkFns","postLinkFns","addLinkFns","pre","post","newIsolateScopeDirective","$$isolateScope","cloneAndAnnotateFn","getControllers","elementControllers","retrievalMethod","$searchElement","linkNode","controllersBoundTransclude","cloneAttachFn","hasElementTranscludeDirective","scopeToChild","controllerDirectives","$scope","$attrs","$transclude","controllerInstance","controllerAs","templateDirective","$$originalDirective","isolateScopeController","isolateBindingContext","identifier","bindToController","lastValue","parentGet","parentSet","compare","$observe","$$observers","$$scope","literal","b","assign","parentValueWatch","parentValue","$stateful","unwatch","$watchCollection","$on","invokeLinkFn","template","templateUrl","terminalPriority","newScopeDirective","nonTlbTranscludeDirective","hasTranscludeDirective","hasTemplate","$compileNode","$template","childTranscludeFn","$$start","$$end","directiveValue","assertNoDuplicate","$$tlb","createComment","replaceWith","replaceDirective","contents","denormalizeTemplate","removeComments","templateNamespace","newTemplateAttrs","templateDirectives","unprocessedDirectives","markDirectivesAsIsolate","mergeTemplateAttributes","compileTemplateUrl","Math","max","extra","tDirectives","startAttrName","endAttrName","multiElement","srcAttr","dstAttr","$set","tAttrs","linkQueue","afterTemplateNodeLinkFn","afterTemplateChildLinkFn","beforeTemplateCompileNode","origAsyncDirective","derivedSyncDirective","getTrustedResourceUrl","then","content","tempTemplateAttrs","beforeTemplateLinkNode","linkRootElement","$$destroyed","oldClasses","delayedNodeLinkFn","ignoreChildLinkFn","diff","what","previousDirective","text","interpolateFn","textInterpolateCompileFn","templateNode","templateNodeParent","hasCompileParent","$$addBindingClass","textInterpolateLinkFn","$$addBindingInfo","expressions","interpolateFnWatchAction","wrapper","getTrustedContext","attrNormalizedName","HTML","RESOURCE_URL","allOrNothing","trustedContext","attrInterpolatePreLinkFn","newValue","$$inter","oldValue","$updateClass","elementsToRemove","newNode","firstElementToRemove","removeCount","j2","replaceChild","expando","k","kk","annotation","attributesToCopy","$normalize","$addClass","classVal","$removeClass","newClasses","toAdd","tokenDifference","toRemove","writeAttr","booleanKey","aliasedKey","observer","trimmedSrcset","srcPattern","rawUris","nbrUrisWith2parts","floor","innerIdx","lastTuple","removeAttr","listeners","startSymbol","endSymbol","binding","isolated","noTemplate","dataName","str1","str2","values","tokens1","tokens2","token","jqNodes","globals","CNTRL_REG","register","this.register","allowGlobals","this.allowGlobals","addIdentifier","expression","later","ident","controllerPrototype","exception","cause","defaultHttpResponseTransform","headers","tempData","JSON_PROTECTION_PREFIX","contentType","jsonStart","JSON_START","JSON_ENDS","parseHeaders","line","headersGetter","headersObj","transformData","status","fns","defaults","transformResponse","transformRequest","d","common","CONTENT_TYPE_APPLICATION_JSON","patch","xsrfCookieName","xsrfHeaderName","useApplyAsync","this.useApplyAsync","interceptorFactories","interceptors","requestConfig","response","resp","reject","executeHeaderFns","headerContent","processedHeaders","headerFn","header","mergeHeaders","defHeaders","reqHeaders","defHeaderName","reqHeaderName","lowercaseDefHeaderName","chain","serverRequest","reqData","withCredentials","sendReq","promise","when","reversedInterceptors","interceptor","request","requestError","responseError","thenFn","rejectFn","success","promise.success","promise.error","done","headersString","statusText","resolveHttpPromise","resolvePromise","$applyAsync","$$phase","deferred","resolve","resolvePromiseWithResult","removePendingReq","pendingRequests","cachedResp","buildUrl","params","defaultCache","xsrfValue","urlIsSameOrigin","timeout","responseType","v","toISOString","interceptorFactory","createShortMethods","createShortMethodsWithData","createXhr","XMLHttpRequest","createHttpBackend","callbacks","$browserDefer","jsonpReq","callbackId","async","body","called","addEventListener","timeoutRequest","jsonpDone","xhr","abort","completeRequest","open","setRequestHeader","onload","xhr.onload","responseText","urlResolve","protocol","getAllResponseHeaders","onerror","onabort","send","this.startSymbol","this.endSymbol","escape","ch","mustHaveExpression","unescapeText","escapedStartRegexp","escapedEndRegexp","parseStringifyInterceptor","getTrusted","valueOf","newErr","$interpolateMinErr","endIndex","parseFns","textLength","expressionPositions","startSymbolLength","exp","endSymbolLength","compute","interpolationFn","$$watchDelegate","objectEquality","$watchGroup","interpolateFnWatcher","oldValues","currValue","$interpolate.startSymbol","$interpolate.endSymbol","count","invokeApply","setInterval","clearInterval","iteration","skipApply","$$intervalId","tick","notify","intervals","interval.cancel","NUMBER_FORMATS","DECIMAL_SEP","GROUP_SEP","PATTERNS","minInt","minFrac","maxFrac","posPre","posSuf","negPre","negSuf","gSize","lgSize","CURRENCY_SYM","DATETIME_FORMATS","MONTH","SHORTMONTH","DAY","SHORTDAY","AMPMS","medium","fullDate","longDate","mediumDate","shortDate","mediumTime","shortTime","pluralCat","num","encodePath","segments","parseAbsoluteUrl","absoluteUrl","locationObj","parsedUrl","$$protocol","$$host","hostname","$$port","port","DEFAULT_PORTS","parseAppUrl","relativeUrl","prefixed","$$path","pathname","$$search","search","$$hash","beginsWith","begin","whole","trimEmptyHash","stripFile","lastIndexOf","LocationHtml5Url","appBase","basePrefix","$$html5","appBaseNoFile","$$parse","this.$$parse","pathUrl","$locationMinErr","$$compose","this.$$compose","$$url","$$absUrl","$$parseLinkUrl","this.$$parseLinkUrl","relHref","appUrl","prevAppUrl","rewrittenUrl","LocationHashbangUrl","hashPrefix","withoutBaseUrl","withoutHashUrl","windowsFilePathExp","firstPathSegmentMatch","LocationHashbangInHtml5Url","locationGetter","property","locationGetterSetter","preprocess","html5Mode","requireBase","rewriteLinks","this.hashPrefix","this.html5Mode","setBrowserUrlWithFallback","oldUrl","oldState","$$state","afterLocationChange","$broadcast","absUrl","LocationMode","initialUrl","IGNORE_URI_REGEXP","ctrlKey","metaKey","which","target","absHref","animVal","preventDefault","initializing","newUrl","newState","$digest","$locationWatch","currentReplace","$$replace","urlOrStateChanged","debug","debugEnabled","this.debugEnabled","flag","formatError","Error","sourceURL","consoleLog","console","logFn","log","hasApply","arg1","arg2","ensureSafeMemberName","fullExpression","$parseMinErr","ensureSafeObject","children","isConstant","setter","setValue","fullExp","propertyObj","isPossiblyDangerousMemberName","cspSafeGetterFn","key0","key1","key2","key3","key4","expensiveChecks","eso","o","eso0","eso1","eso2","eso3","eso4","cspSafeGetter","pathVal","getterFnWithEnsureSafeObject","s","getterFn","getterFnCache","getterFnCacheExpensive","getterFnCacheDefault","pathKeys","pathKeysLength","code","needsEnsureSafeObject","lookupJs","evaledFnGetter","Function","sharedGetter","fn.assign","getValueOf","objectValueOf","cacheDefault","cacheExpensive","wrapSharedExpression","wrapped","collectExpressionInputs","inputs","expressionInputDirtyCheck","oldValueOfValue","inputsWatchDelegate","parsedExpression","inputExpressions","$$inputs","lastResult","oldInputValue","expressionInputWatch","newInputValue","oldInputValueOfValues","expressionInputsWatch","changed","oneTimeWatchDelegate","oneTimeWatch","oneTimeListener","old","$$postDigest","oneTimeLiteralWatchDelegate","isAllDefined","allDefined","constantWatchDelegate","constantWatch","constantListener","addInterceptor","interceptorFn","watchDelegate","regularInterceptedExpression","oneTimeInterceptedExpression","$parseOptions","$parseOptionsExpensive","oneTime","cacheKey","parseOptions","lexer","Lexer","parser","Parser","qFactory","nextTick","exceptionHandler","callOnce","resolveFn","Promise","simpleBind","scheduleProcessQueue","processScheduled","pending","Deferred","$qMinErr","TypeError","onFulfilled","onRejected","progressBack","catch","finally","handleCallback","$$reject","$$resolve","progress","makePromise","resolved","isResolved","callbackOutput","errback","$Q","Q","resolver","promises","results","requestAnimationFrame","webkitRequestAnimationFrame","cancelAnimationFrame","webkitCancelAnimationFrame","webkitCancelRequestAnimationFrame","rafSupported","raf","timer","TTL","$rootScopeMinErr","lastDirtyWatch","applyAsyncId","digestTtl","this.digestTtl","Scope","$id","$parent","$$watchers","$$nextSibling","$$prevSibling","$$childHead","$$childTail","$root","$$listeners","$$listenerCount","beginPhase","phase","decrementListenerCount","current","initWatchVal","flushApplyAsync","applyAsyncQueue","scheduleApplyAsync","isolate","destroyChild","child","$$ChildScope","this.$$ChildScope","watchExp","watcher","eq","deregisterWatch","watchExpressions","watchGroupAction","changeReactionScheduled","firstRun","newValues","deregisterFns","shouldCall","deregisterWatchGroup","expr","unwatchFn","watchGroupSubAction","$watchCollectionInterceptor","_value","bothNaN","newItem","oldItem","internalArray","oldLength","changeDetected","newLength","internalObject","veryOldValue","trackVeryOldValue","changeDetector","initRun","$watchCollectionAction","watch","watchers","dirty","ttl","watchLog","logIdx","asyncTask","asyncQueue","$eval","isNaN","msg","next","postDigestQueue","eventName","this.$watchGroup","$applyAsyncExpression","namedListeners","indexOfListener","$emit","targetScope","listenerArgs","currentScope","$$asyncQueue","$$postDigestQueue","$$applyAsyncQueue","sanitizeUri","uri","isImage","regex","normalizedVal","adjustMatcher","matcher","$sceMinErr","escapeForRegexp","adjustMatchers","matchers","adjustedMatchers","SCE_CONTEXTS","resourceUrlWhitelist","resourceUrlBlacklist","this.resourceUrlWhitelist","this.resourceUrlBlacklist","matchUrl","generateHolderType","Base","holderType","trustedValue","$$unwrapTrustedValue","this.$$unwrapTrustedValue","holderType.prototype.valueOf","holderType.prototype.toString","htmlSanitizer","trustedValueHolderBase","byType","CSS","URL","JS","trustAs","Constructor","maybeTrusted","allowed","this.enabled","msie","sce","isEnabled","sce.isEnabled","sce.getTrusted","parseAs","sce.parseAs","enumValue","lName","eventSupport","android","userAgent","navigator","boxee","vendorPrefix","vendorRegex","bodyStyle","transitions","animations","webkitTransition","webkitAnimation","pushState","hasEvent","divElm","handleRequestFn","tpl","ignoreRequestError","totalPendingRequests","transformer","httpOptions","handleError","testability","testability.findBindings","opt_exactMatch","getElementsByClassName","matches","dataBinding","bindingName","testability.findModels","prefixes","attributeEquals","testability.getLocation","testability.setLocation","testability.whenStable","deferreds","$$timeoutId","timeout.cancel","urlParsingNode","requestUrl","originUrl","filters","suffix","currencyFilter","dateFilter","filterFilter","jsonFilter","limitToFilter","lowercaseFilter","numberFilter","orderByFilter","uppercaseFilter","comparator","matchAgainstAnyProp","predicateFn","createPredicateFn","actual","expected","item","deepCompare","actualType","expectedType","expectedVal","keyIsDollar","actualVal","$locale","formats","amount","currencySymbol","fractionSize","formatNumber","number","groupSep","decimalSep","isFinite","isNegative","abs","numStr","formatedText","hasExponent","toFixed","parseFloat","fractionLen","min","round","fraction","lgroup","group","padNumber","digits","neg","dateGetter","date","dateStrGetter","shortForm","getFirstThursdayOfYear","year","dayOfWeekOnFirst","getDay","weekGetter","firstThurs","getFullYear","thisThurs","getMonth","getDate","jsonStringToDate","string","R_ISO8601_STR","tzHour","tzMin","dateSetter","setUTCFullYear","setFullYear","timeSetter","setUTCHours","setHours","m","ms","format","timezone","NUMBER_STRING","DATE_FORMATS_SPLIT","setMinutes","getMinutes","getTimezoneOffset","DATE_FORMATS","object","spacing","limit","Infinity","out","sortPredicate","reverseOrder","reverseComparator","comp","descending","objectToString","v1","v2","map","predicate","ngDirective","FormController","controls","parentForm","$$parentForm","nullFormCtrl","$error","$$success","$pending","$name","$dirty","$pristine","$valid","$invalid","$submitted","$addControl","$rollbackViewValue","form.$rollbackViewValue","control","$commitViewValue","form.$commitViewValue","form.$addControl","$$renameControl","form.$$renameControl","newName","oldName","$removeControl","form.$removeControl","$setValidity","addSetValidityMethod","ctrl","set","unset","$setDirty","form.$setDirty","PRISTINE_CLASS","DIRTY_CLASS","$setPristine","form.$setPristine","setClass","SUBMITTED_CLASS","$setUntouched","form.$setUntouched","$setSubmitted","form.$setSubmitted","stringBasedInputType","$formatters","$isEmpty","baseInputType","composing","ev","ngTrim","$viewValue","$$hasNativeValidators","$setViewValue","deferListener","origValue","keyCode","$render","ctrl.$render","createDateParser","mapping","iso","ISO_DATE_REGEXP","yyyy","MM","dd","HH","getHours","mm","ss","getSeconds","sss","getMilliseconds","part","NaN","createDateInputType","parseDate","dynamicDateInputType","isValidDate","parseObservedDateValue","badInputChecker","$options","previousDate","$$parserName","$parsers","parsedDate","$ngModelMinErr","timezoneOffset","ngMin","minVal","$validators","ctrl.$validators.min","$validate","ngMax","maxVal","ctrl.$validators.max","validity","VALIDITY_STATE_PROPERTY","badInput","typeMismatch","parseConstantExpr","fallback","parseFn","cachedToggleClass","switchValue","classCache","toggleValidationCss","validationErrorKey","isValid","VALID_CLASS","INVALID_CLASS","setValidity","isObjectEmpty","PENDING_CLASS","combinedState","classDirective","arrayDifference","arrayClasses","digestClassCounts","classCounts","classesToUpdate","ngClassWatchAction","$index","old$index","mod","REGEX_STRING_REGEXP","documentMode","isActive_","active","full","major","minor","dot","codeName","JQLite._data","MOUSE_EVENT_MAP","mouseleave","mouseenter","optgroup","tbody","tfoot","colgroup","caption","thead","th","td","ready","trigger","fired","removeData","removeAttribute","css","lowercasedName","specified","getNamedItem","ret","getText","$dv","multiple","selected","nodeCount","jqLiteOn","types","related","relatedTarget","contains","off","one","onFn","replaceNode","insertBefore","contentDocument","prepend","wrapNode","detach","after","newElement","toggleClass","condition","classCondition","nextElementSibling","getElementsByTagName","extraParameters","dummyEvent","handlerArgs","eventFnsCopy","arg3","unbind","$$annotate","$animateMinErr","$$selectors","classNameFilter","this.classNameFilter","$$classNameFilter","runAnimationPostDigest","cancelFn","$$cancelFn","defer.promise.$$cancelFn","ngAnimatePostDigest","ngAnimateNotifyComplete","resolveElementClasses","hasClasses","cachedClassManipulation","op","asyncPromise","currentDefer","applyStyles","styles","from","to","animate","enter","leave","move","$$addClassImmediately","$$removeClassImmediately","add","createdCache","STORAGE_KEY","$$setClassImmediately","APPLICATION_JSON","PATH_MATCH","locationPrototype","paramValue","Location","Location.prototype.state","CALL","APPLY","BIND","CONSTANTS","null","true","false","constantGetter","OPERATORS","+","-","*","/","%","===","!==","==","!=","<",">","<=",">=","&&","||","!","ESCAPE","lex","tokens","readString","peek","readNumber","isIdent","readIdent","is","isWhitespace","ch2","ch3","op2","op3","op1","operator","throwError","chars","isExpOperator","start","end","colStr","peekCh","quote","rawString","hex","String","fromCharCode","rep","ZERO","statements","primary","expect","filterChain","consume","arrayDeclaration","functionCall","objectIndex","fieldAccess","peekToken","e1","e2","e3","e4","peekAhead","t","unaryFn","right","$parseUnaryFn","binaryFn","left","isBranching","$parseBinaryFn","$parseConstant","$parseStatements","inputFn","argsFn","$parseFilter","every","assignment","ternary","$parseAssignment","logicalOR","middle","$parseTernary","logicalAND","equality","relational","additive","multiplicative","unary","$parseFieldAccess","indexFn","$parseObjectIndex","fnGetter","contextGetter","expressionText","$parseFunctionCall","elementFns","$parseArrayLiteral","valueFns","$parseObjectLiteral","yy","y","MMMM","MMM","M","H","hh","EEEE","EEE","ampmGetter","Z","timeZoneGetter","zone","paddedZone","ww","w","xlinkHref","propName","normalized","ngBooleanAttrWatchAction","htmlAttr","ngAttrAliasWatchAction","nullFormRenameControl","formDirectiveFactory","isNgForm","ngFormCompile","formElement","ngFormPreLink","handleFormSubmission","parentFormCtrl","alias","URL_REGEXP","EMAIL_REGEXP","NUMBER_REGEXP","DATE_REGEXP","DATETIMELOCAL_REGEXP","WEEK_REGEXP","MONTH_REGEXP","TIME_REGEXP","DEFAULT_REGEXP","inputType","textInputType","weekParser","isoWeek","existingDate","week","minutes","hours","seconds","milliseconds","addDays","numberInputType","urlInputType","ctrl.$validators.url","modelValue","viewValue","emailInputType","email","ctrl.$validators.email","radioInputType","checked","checkboxInputType","trueValue","ngTrueValue","falseValue","ngFalseValue","ctrl.$isEmpty","ctrls","NgModelController","$modelValue","$$rawModelValue","$asyncValidators","$viewChangeListeners","$untouched","$touched","parsedNgModel","parsedNgModelAssign","ngModelGet","ngModelSet","pendingDebounce","$$setOptions","this.$$setOptions","getterSetter","invokeModelGetter","invokeModelSetter","$$$p","this.$isEmpty","currentValidationRunId","this.$setPristine","this.$setDirty","this.$setUntouched","UNTOUCHED_CLASS","TOUCHED_CLASS","$setTouched","this.$setTouched","this.$rollbackViewValue","$$lastCommittedViewValue","this.$validate","prevValid","prevModelValue","allowInvalid","$$runValidators","parserValid","allValid","$$writeModelToScope","this.$$runValidators","parseValid","doneCallback","processSyncValidators","syncValidatorsValid","validator","processAsyncValidators","validatorPromises","validationDone","localValidationRunId","processParseErrors","errorKey","this.$commitViewValue","$$parseAndValidate","this.$$parseAndValidate","this.$$writeModelToScope","this.$setViewValue","updateOnDefault","$$debounceViewValueCommit","this.$$debounceViewValueCommit","debounceDelay","debounce","ngModelWatch","formatters","ngModelCompile","ngModelPreLink","modelCtrl","formCtrl","ngModelPostLink","updateOn","ctrl.$validators.required","patternExp","ctrl.$validators.pattern","intVal","ctrl.$validators.maxlength","ctrl.$validators.minlength","trimValues","CONSTANT_VALUE_REGEXP","tplAttr","ngValueConstantLink","ngValueLink","valueWatchAction","that","$compile","ngBindCompile","templateElement","ngBindLink","ngBindWatchAction","ngBindTemplateCompile","ngBindTemplateLink","ngBindHtmlCompile","tElement","ngBindHtmlGetter","ngBindHtmlWatch","getStringValue","ngBindHtmlLink","ngBindHtmlWatchAction","getTrustedHtml","forceAsyncEvents","ngEventHandler","$event","previousElements","ngIfWatchAction","newScope","srcExp","onloadExp","autoScrollExp","autoscroll","changeCounter","previousElement","currentElement","cleanupLastIncludeContent","parseAsResourceUrl","ngIncludeWatchAction","afterAnimation","thisChangeId","namespaceAdaptedClone","BRACE","IS_WHEN","updateElementText","newText","numberExp","whenExp","whens","whensExpFns","braceReplacement","watchRemover","lastCount","attributeName","tmpMatch","whenKey","ngPluralizeWatchAction","countIsNaN","ngRepeatMinErr","updateScope","valueIdentifier","keyIdentifier","arrayLength","$first","$last","$middle","$odd","$even","ngRepeatCompile","ngRepeatEndComment","lhs","rhs","aliasAs","trackByExp","trackByExpGetter","trackByIdExpFn","trackByIdArrayFn","trackByIdObjFn","hashFnLocals","ngRepeatLink","lastBlockMap","ngRepeatAction","previousNode","nextNode","nextBlockMap","collectionLength","trackById","collectionKeys","nextBlockOrder","trackByIdFn","itemKey","blockKey","ngRepeatTransclude","ngShowWatchAction","NG_HIDE_CLASS","tempClasses","NG_HIDE_IN_PROGRESS_CLASS","ngHideWatchAction","ngStyleWatchAction","newStyles","oldStyles","ngSwitchController","cases","selectedTranscludes","selectedElements","previousLeaveAnimations","selectedScopes","spliceFactory","ngSwitchWatchAction","selectedTransclude","caseElement","selectedScope","anchor","ngOptionsMinErr","NG_OPTIONS_REGEXP","nullModelCtrl","optionsMap","ngModelCtrl","unknownOption","databound","init","self.init","ngModelCtrl_","nullOption_","unknownOption_","addOption","self.addOption","removeOption","self.removeOption","hasOption","renderUnknownOption","self.renderUnknownOption","unknownVal","self.hasOption","setupAsSingle","selectElement","selectCtrl","ngModelCtrl.$render","emptyOption","setupAsMultiple","lastView","selectMultipleWatch","setupAsOptions","callExpression","exprFn","valueName","keyName","createIsSelectedFn","selectedSet","trackFn","trackIndex","isSelected","compareValueFn","selectAsFn","scheduleRendering","renderScheduled","render","updateLabelMap","labelMap","label","added","optionGroups","optionGroupNames","optionGroupName","optionGroup","existingParent","existingOptions","existingOption","valuesFn","anySelected","optionId","trackKeysCache","groupByFn","displayFn","nullOption","groupIndex","groupLength","optionGroupsCache","optGroupTemplate","lastElement","optionTemplate","optionsExp","selectAs","track","selectionChanged","selectedKey","viewValueFn","getLabels","toDisplay","ngModelCtrl.$isEmpty","nullSelectCtrl","selectCtrlName","interpolateWatchAction","$$csp"] -} diff --git a/app/lib/bootstrap.js b/app/lib/bootstrap.min.js similarity index 100% rename from app/lib/bootstrap.js rename to app/lib/bootstrap.min.js diff --git a/app/lib/highcharts-ng.min.js b/app/lib/highcharts-ng.min.js new file mode 100644 index 00000000..5aa1de5a --- /dev/null +++ b/app/lib/highcharts-ng.min.js @@ -0,0 +1,8 @@ +/** + * highcharts-ng + * @version v0.0.9-dev - 2015-02-25 + * @link https://github.com/pablojim/highcharts-ng + * @author Barry Fitzgerald <> + * @license MIT License, http://www.opensource.org/licenses/MIT + */ +"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="highcharts-ng"),function(){"use strict";function a(){return{indexOf:function(a,b,c){void 0===c&&(c=0),0>c&&(c+=a.length),0>c&&(c=0);for(var d=a.length;d>c;c++)if(c in a&&a[c]===b)return c;return-1},prependMethod:function(a,b,c){var d=a[b];a[b]=function(){var a=Array.prototype.slice.call(arguments);return c.apply(this,a),d?d.apply(this,a):void 0}},deepExtend:function a(b,c){if(angular.isArray(c)){b=angular.isArray(b)?b:[];for(var d=0;d",scope:{config:"=",disableDataWatch:"="},link:function(c,f){var l={},m=function(b){var e,f=[];if(b){var g=d(b);if(g)return!1;if(angular.forEach(b,function(a){f.push(a.id);var b=n.get(a.id);b?angular.equals(l[a.id],j(a))?(void 0!==a.visible&&b.visible!==a.visible&&b.setVisible(a.visible,!1),b.setData(angular.copy(a.data),!1)):b.update(angular.copy(a),!1):n.addSeries(angular.copy(a),!1),l[a.id]=j(a)}),c.config.noData){var h=!1;for(e=0;e0){h=!0;break}h?n.hideLoading():n.showLoading(c.config.noData)}}for(e=n.series.length-1;e>=0;e--){var i=n.series[e];"highcharts-navigator-series"!==i.options.id&&a.indexOf(f,i.options.id)<0&&i.remove(!1)}return!0},n=!1,o=function(){n&&n.destroy(),l={};var a=c.config||{},b=g(c,f,a),d=a.func||void 0,h=k(c);n=new Highcharts[h](b,d);for(var j=0;j-1?h.thousandsSep:""))):e=Oa(f,e)}j.push(e);a=a.slice(c+1);c=(d=!d)?"}":"{"}j.push(a);return j.join("")}function ob(a){return V.pow(10,U(V.log(a)/V.LN10))}function pb(a,b,c,d,e){var f,g=a,c=p(c,1);f=a/c;b||(b=[1,2,2.5,5,10],d===!1&&(c=== +1?b=[1,2,5,10]:c<=0.1&&(b=[1/c])));for(d=0;d=a||!e&&f<=(b[d]+(b[d+1]||b[d]))/2)break;g*=c;return g}function qb(a,b){var c=a.length,d,e;for(e=0;ec&&(c=a[b]);return c}function Qa(a,b){for(var c in a)a[c]&&a[c]!==b&&a[c].destroy&&a[c].destroy(), +delete a[c]}function Ra(a){fb||(fb=Z(Ka));a&&fb.appendChild(a);fb.innerHTML=""}function ka(a,b){var c="Highcharts error #"+a+": www.highcharts.com/errors/"+a;if(b)throw c;H.console&&console.log(c)}function da(a){return parseFloat(a.toPrecision(14))}function Sa(a,b){za=p(a,b.animation)}function Cb(){var a=P.global,b=a.useUTC,c=b?"getUTC":"get",d=b?"setUTC":"set";Aa=a.Date||window.Date;nb=b&&a.timezoneOffset;eb=b&&a.getTimezoneOffset;gb=function(a,c,d,h,i,j){var k;b?(k=Aa.UTC.apply(0,arguments),k+= +Wa(k)):k=(new Aa(a,c,p(d,1),p(h,0),p(i,0),p(j,0))).getTime();return k};rb=c+"Minutes";sb=c+"Hours";tb=c+"Day";Xa=c+"Date";Ya=c+"Month";Za=c+"FullYear";Db=d+"Milliseconds";Eb=d+"Seconds";Fb=d+"Minutes";Gb=d+"Hours";ub=d+"Date";vb=d+"Month";wb=d+"FullYear"}function K(){}function Ta(a,b,c,d){this.axis=a;this.pos=b;this.type=c||"";this.isNew=!0;!c&&!d&&this.addLabel()}function Hb(a,b,c,d,e){var f=a.chart.inverted;this.axis=a;this.isNegative=c;this.options=b;this.x=d;this.total=null;this.points={};this.stack= +e;this.alignOptions={align:b.align||(f?c?"left":"right":"center"),verticalAlign:b.verticalAlign||(f?"middle":c?"bottom":"top"),y:p(b.y,f?4:c?14:-6),x:p(b.x,f?c?-6:6:0)};this.textAlign=b.textAlign||(f?c?"right":"left":"center")}var u,A=document,H=window,V=Math,x=V.round,U=V.floor,sa=V.ceil,t=V.max,I=V.min,O=V.abs,W=V.cos,$=V.sin,la=V.PI,ga=la*2/360,Ba=navigator.userAgent,Ib=H.opera,ya=/(msie|trident)/i.test(Ba)&&!Ib,hb=A.documentMode===8,xb=/AppleWebKit/.test(Ba),La=/Firefox/.test(Ba),Jb=/(Mobile|Android|Windows Phone)/.test(Ba), +Ca="http://www.w3.org/2000/svg",ba=!!A.createElementNS&&!!A.createElementNS(Ca,"svg").createSVGRect,Nb=La&&parseInt(Ba.split("Firefox/")[1],10)<4,ea=!ba&&!ya&&!!A.createElement("canvas").getContext,$a,ab,Kb={},yb=0,fb,P,Oa,za,zb,G,ma=function(){return u},X=[],bb=0,Ka="div",R="none",Ob=/^[0-9]+$/,ib=["plotTop","marginRight","marginBottom","plotLeft"],Pb="stroke-width",Aa,gb,nb,eb,rb,sb,tb,Xa,Ya,Za,Db,Eb,Fb,Gb,ub,vb,wb,J={},w;w=H.Highcharts=H.Highcharts?ka(16,!0):{};w.seriesTypes=J;var r=w.extend=function(a, +b){var c;a||(a={});for(c in b)a[c]=b[c];return a},p=w.pick=function(){var a=arguments,b,c,d=a.length;for(b=0;b3?c.length%3:0;return e+(g?c.substr(0,g)+d:"")+c.substr(g).replace(/(\d{3})(?=\d)/g,"$1"+d)+(f?b+O(a-c).toFixed(f).slice(2):"")};zb={init:function(a,b,c){var b=b||"",d=a.shift,e=b.indexOf("C")>-1,f=e?7:3,g,b=b.split(" "),c=[].concat(c),h,i,j=function(a){for(g=a.length;g--;)a[g]==="M"&&a.splice(g+ +1,0,a[g+1],a[g+2],a[g+1],a[g+2])};e&&(j(b),j(c));a.isArea&&(h=b.splice(b.length-6,6),i=c.splice(c.length-6,6));if(d<=c.length/f&&b.length===c.length)for(;d--;)c=[].concat(c).splice(0,f).concat(c);a.shift=0;if(b.length)for(a=c.length;b.length{point.key}
',pointFormat:'\u25CF {series.name}: {point.y}
', +shadow:!0,snap:Jb?25:10,style:{color:"#333333",cursor:"default",fontSize:"12px",padding:"8px",whiteSpace:"nowrap"}},credits:{enabled:!0,text:"Highcharts.com",href:"http://www.highcharts.com",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#909090",fontSize:"9px"}}};var aa=P.plotOptions,T=aa.line;Cb();var Tb=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/,Ub=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/, +Vb=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/,na=function(a){var b=[],c,d;(function(a){a&&a.stops?d=Ua(a.stops,function(a){return na(a[1])}):(c=Tb.exec(a))?b=[B(c[1]),B(c[2]),B(c[3]),parseFloat(c[4],10)]:(c=Ub.exec(a))?b=[B(c[1],16),B(c[2],16),B(c[3],16),1]:(c=Vb.exec(a))&&(b=[B(c[1]),B(c[2]),B(c[3]),1])})(a);return{get:function(c){var f;d?(f=z(a),f.stops=[].concat(f.stops),m(d,function(a,b){f.stops[b]=[f.stops[b][0],a.get(c)]})):f=b&&!isNaN(b[0])?c==="rgb"?"rgb("+b[0]+","+ +b[1]+","+b[2]+")":c==="a"?b[3]:"rgba("+b.join(",")+")":a;return f},brighten:function(a){if(d)m(d,function(b){b.brighten(a)});else if(qa(a)&&a!==0){var c;for(c=0;c<3;c++)b[c]+=B(a*255),b[c]<0&&(b[c]=0),b[c]>255&&(b[c]=255)}return this},rgba:b,setOpacity:function(a){b[3]=a;return this},raw:a}};K.prototype={opacity:1,textProps:"fontSize,fontWeight,fontFamily,fontStyle,color,lineHeight,width,textDecoration,textShadow".split(","),init:function(a,b){this.element=b==="span"?Z(b):A.createElementNS(Ca,b); +this.renderer=a},animate:function(a,b,c){b=p(b,za,!0);db(this);if(b){b=z(b,{});if(c)b.complete=c;lb(this,a,b)}else this.attr(a),c&&c();return this},colorGradient:function(a,b,c){var d=this.renderer,e,f,g,h,i,j,k,l,n,o,q=[];a.linearGradient?f="linearGradient":a.radialGradient&&(f="radialGradient");if(f){g=a[f];h=d.gradients;j=a.stops;n=c.radialReference;Ha(g)&&(a[f]=g={x1:g[0],y1:g[1],x2:g[2],y2:g[3],gradientUnits:"userSpaceOnUse"});f==="radialGradient"&&n&&!s(g.gradientUnits)&&(g=z(g,{cx:n[0]-n[2]/ +2+g.cx*n[2],cy:n[1]-n[2]/2+g.cy*n[2],r:g.r*n[2],gradientUnits:"userSpaceOnUse"}));for(o in g)o!=="id"&&q.push(o,g[o]);for(o in j)q.push(j[o]);q=q.join(",");h[q]?a=h[q].attr("id"):(g.id=a="highcharts-"+yb++,h[q]=i=d.createElement(f).attr(g).add(d.defs),i.stops=[],m(j,function(a){a[1].indexOf("rgba")===0?(e=na(a[1]),k=e.get("rgb"),l=e.get("a")):(k=a[1],l=1);a=d.createElement("stop").attr({offset:a[0],"stop-color":k,"stop-opacity":l}).add(i);i.stops.push(a)}));c.setAttribute(b,"url("+d.url+"#"+a+")")}}, +applyTextShadow:function(a){var b=this.element,c,d=a.indexOf("contrast")!==-1,e=this.renderer.forExport||b.style.textShadow!==u&&!ya;d&&(a=a.replace(/contrast/g,this.renderer.getContrast(b.style.fill)));e?d&&F(b,{textShadow:a}):(this.fakeTS=!0,this.ySetter=this.xSetter,c=[].slice.call(b.getElementsByTagName("tspan")),m(a.split(/\s?,\s?/g),function(a){var d=b.firstChild,e,i,a=a.split(" ");e=a[a.length-1];(i=a[a.length-2])&&m(c,function(a,c){var f;c===0&&(a.setAttribute("x",b.getAttribute("x")),c=b.getAttribute("y"), +a.setAttribute("y",c||0),c===null&&b.setAttribute("y",0));f=a.cloneNode(1);L(f,{"class":"highcharts-text-shadow",fill:e,stroke:e,"stroke-opacity":1/t(B(i),3),"stroke-width":i,"stroke-linejoin":"round"});b.insertBefore(f,d)})}))},attr:function(a,b){var c,d,e=this.element,f,g=this,h;typeof a==="string"&&b!==u&&(c=a,a={},a[c]=b);if(typeof a==="string")g=(this[a+"Getter"]||this._defaultGetter).call(this,a,e);else{for(c in a){d=a[c];h=!1;this.symbolName&&/^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(c)&& +(f||(this.symbolAttr(a),f=!0),h=!0);if(this.rotation&&(c==="x"||c==="y"))this.doTransform=!0;h||(this[c+"Setter"]||this._defaultSetter).call(this,d,c,e);this.shadows&&/^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(c)&&this.updateShadows(c,d)}if(this.doTransform)this.updateTransform(),this.doTransform=!1}return g},updateShadows:function(a,b){for(var c=this.shadows,d=c.length;d--;)c[d].setAttribute(a,a==="height"?t(b-(c[d].cutHeight||0),0):a==="d"?this.d:b)},addClass:function(a){var b=this.element, +c=L(b,"class")||"";c.indexOf(a)===-1&&L(b,"class",c+" "+a);return this},symbolAttr:function(a){var b=this;m("x,y,r,start,end,width,height,innerR,anchorX,anchorY".split(","),function(c){b[c]=p(a[c],b[c])});b.attr({d:b.renderer.symbols[b.symbolName](b.x,b.y,b.width,b.height,b)})},clip:function(a){return this.attr("clip-path",a?"url("+this.renderer.url+"#"+a.id+")":R)},crisp:function(a){var b,c={},d,e=a.strokeWidth||this.strokeWidth||0;d=x(e)%2/2;a.x=U(a.x||this.x||0)+d;a.y=U(a.y||this.y||0)+d;a.width= +U((a.width||this.width||0)-2*d);a.height=U((a.height||this.height||0)-2*d);a.strokeWidth=e;for(b in a)this[b]!==a[b]&&(this[b]=c[b]=a[b]);return c},css:function(a){var b=this.styles,c={},d=this.element,e,f,g="";e=!b;if(a&&a.color)a.fill=a.color;if(b)for(f in a)a[f]!==b[f]&&(c[f]=a[f],e=!0);if(e){e=this.textWidth=a&&a.width&&d.nodeName.toLowerCase()==="text"&&B(a.width)||this.textWidth;b&&(a=r(b,c));this.styles=a;e&&(ea||!ba&&this.renderer.forExport)&&delete a.width;if(ya&&!ba)F(this.element,a);else{b= +function(a,b){return"-"+b.toLowerCase()};for(f in a)g+=f.replace(/([A-Z])/g,b)+":"+a[f]+";";L(d,"style",g)}e&&this.added&&this.renderer.buildText(this)}return this},on:function(a,b){var c=this,d=c.element;ab&&a==="click"?(d.ontouchstart=function(a){c.touchEventFired=Aa.now();a.preventDefault();b.call(d,a)},d.onclick=function(a){(Ba.indexOf("Android")===-1||Aa.now()-(c.touchEventFired||0)>1100)&&b.call(d,a)}):d["on"+a]=b;return this},setRadialReference:function(a){this.element.radialReference=a;return this}, +translate:function(a,b){return this.attr({translateX:a,translateY:b})},invert:function(){this.inverted=!0;this.updateTransform();return this},updateTransform:function(){var a=this.translateX||0,b=this.translateY||0,c=this.scaleX,d=this.scaleY,e=this.inverted,f=this.rotation,g=this.element;e&&(a+=this.attr("width"),b+=this.attr("height"));a=["translate("+a+","+b+")"];e?a.push("rotate(90) scale(-1,1)"):f&&a.push("rotate("+f+" "+(g.getAttribute("x")||0)+" "+(g.getAttribute("y")||0)+")");(s(c)||s(d))&& +a.push("scale("+p(c,1)+" "+p(d,1)+")");a.length&&g.setAttribute("transform",a.join(" "))},toFront:function(){var a=this.element;a.parentNode.appendChild(a);return this},align:function(a,b,c){var d,e,f,g,h={};e=this.renderer;f=e.alignedObjects;if(a){if(this.alignOptions=a,this.alignByTranslate=b,!c||Da(c))this.alignTo=d=c||"renderer",ia(f,this),f.push(this),c=null}else a=this.alignOptions,b=this.alignByTranslate,d=this.alignTo;c=p(c,e[d],e);d=a.align;e=a.verticalAlign;f=(c.x||0)+(a.x||0);g=(c.y||0)+ +(a.y||0);if(d==="right"||d==="center")f+=(c.width-(a.width||0))/{right:1,center:2}[d];h[b?"translateX":"x"]=x(f);if(e==="bottom"||e==="middle")g+=(c.height-(a.height||0))/({bottom:1,middle:2}[e]||1);h[b?"translateY":"y"]=x(g);this[this.placed?"animate":"attr"](h);this.placed=!0;this.alignAttr=h;return this},getBBox:function(a){var b,c=this.renderer,d,e=this.rotation,f=this.element,g=this.styles,h=e*ga;d=this.textStr;var i,j=f.style,k,l;d!==u&&(l=["",e||0,g&&g.fontSize,f.style.width].join(","),l=d=== +""||Ob.test(d)?"num:"+d.toString().length+l:d+l);l&&!a&&(b=c.cache[l]);if(!b){if(f.namespaceURI===Ca||c.forExport){try{k=this.fakeTS&&function(a){m(f.querySelectorAll(".highcharts-text-shadow"),function(b){b.style.display=a})},La&&j.textShadow?(i=j.textShadow,j.textShadow=""):k&&k(R),b=f.getBBox?r({},f.getBBox()):{width:f.offsetWidth,height:f.offsetHeight},i?j.textShadow=i:k&&k("")}catch(n){}if(!b||b.width<0)b={width:0,height:0}}else b=this.htmlGetBBox();if(c.isSVG){a=b.width;d=b.height;if(ya&&g&& +g.fontSize==="11px"&&d.toPrecision(3)==="16.9")b.height=d=14;if(e)b.width=O(d*$(h))+O(a*W(h)),b.height=O(d*W(h))+O(a*$(h))}c.cache[l]=b}return b},show:function(a){a&&this.element.namespaceURI===Ca?this.element.removeAttribute("visibility"):this.attr({visibility:a?"inherit":"visible"});return this},hide:function(){return this.attr({visibility:"hidden"})},fadeOut:function(a){var b=this;b.animate({opacity:0},{duration:a||150,complete:function(){b.attr({y:-9999})}})},add:function(a){var b=this.renderer, +c=this.element,d;if(a)this.parentGroup=a;this.parentInverted=a&&a.inverted;this.textStr!==void 0&&b.buildText(this);this.added=!0;if(!a||a.handleZ||this.zIndex)d=this.zIndexSetter();d||(a?a.element:b.box).appendChild(c);if(this.onAdd)this.onAdd();return this},safeRemoveChild:function(a){var b=a.parentNode;b&&b.removeChild(a)},destroy:function(){var a=this,b=a.element||{},c=a.shadows,d=a.renderer.isSVG&&b.nodeName==="SPAN"&&a.parentGroup,e,f;b.onclick=b.onmouseout=b.onmouseover=b.onmousemove=b.point= +null;db(a);if(a.clipPath)a.clipPath=a.clipPath.destroy();if(a.stops){for(f=0;f]*>/g, +"")},textSetter:function(a){if(a!==this.textStr)delete this.bBox,this.textStr=a,this.added&&this.renderer.buildText(this)},fillSetter:function(a,b,c){typeof a==="string"?c.setAttribute(b,a):a&&this.colorGradient(a,b,c)},zIndexSetter:function(a,b){var c=this.renderer,d=this.parentGroup,c=(d||c).element||c.box,e,f,g=this.element,h;e=this.added;var i;s(a)&&(g.setAttribute(b,a),a=+a,this[b]===a&&(e=!1),this[b]=a);if(e){if((a=this.zIndex)&&d)d.handleZ=!0;d=c.childNodes;for(i=0;ia||!s(a)&&s(f)))c.insertBefore(g,e),h=!0;h||c.appendChild(g)}return h},_defaultSetter:function(a,b,c){c.setAttribute(b,a)}};K.prototype.yGetter=K.prototype.xGetter;K.prototype.translateXSetter=K.prototype.translateYSetter=K.prototype.rotationSetter=K.prototype.verticalAlignSetter=K.prototype.scaleXSetter=K.prototype.scaleYSetter=function(a,b){this[b]=a;this.doTransform=!0};K.prototype["stroke-widthSetter"]=K.prototype.strokeSetter=function(a,b,c){this[b]=a;if(this.stroke&& +this["stroke-width"])this.strokeWidth=this["stroke-width"],K.prototype.fillSetter.call(this,this.stroke,"stroke",c),c.setAttribute("stroke-width",this["stroke-width"]),this.hasStroke=!0;else if(b==="stroke-width"&&a===0&&this.hasStroke)c.removeAttribute("stroke"),this.hasStroke=!1};var ta=function(){this.init.apply(this,arguments)};ta.prototype={Element:K,init:function(a,b,c,d,e){var f=location,g,d=this.createElement("svg").attr({version:"1.1"}).css(this.getStyle(d));g=d.element;a.appendChild(g); +a.innerHTML.indexOf("xmlns")===-1&&L(g,"xmlns",Ca);this.isSVG=!0;this.box=g;this.boxWrapper=d;this.alignedObjects=[];this.url=(La||xb)&&A.getElementsByTagName("base").length?f.href.replace(/#.*?$/,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"";this.createElement("desc").add().element.appendChild(A.createTextNode("Created with Highcharts 4.1.5"));this.defs=this.createElement("defs").add();this.forExport=e;this.gradients={};this.cache={};this.setSize(b,c,!1);var h;if(La&&a.getBoundingClientRect)this.subPixelFix= +b=function(){F(a,{left:0,top:0});h=a.getBoundingClientRect();F(a,{left:sa(h.left)-h.left+"px",top:sa(h.top)-h.top+"px"})},b(),N(H,"resize",b)},getStyle:function(a){return this.style=r({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},a)},isHidden:function(){return!this.boxWrapper.getBBox().width},destroy:function(){var a=this.defs;this.box=null;this.boxWrapper=this.boxWrapper.destroy();Qa(this.gradients||{});this.gradients=null;if(a)this.defs=a.destroy(); +this.subPixelFix&&Y(H,"resize",this.subPixelFix);return this.alignedObjects=null},createElement:function(a){var b=new this.Element;b.init(this,a);return b},draw:function(){},buildText:function(a){for(var b=a.element,c=this,d=c.forExport,e=p(a.textStr,"").toString(),f=e.indexOf("<")!==-1,g=b.childNodes,h,i,j=L(b,"x"),k=a.styles,l=a.textWidth,n=k&&k.lineHeight,o=k&&k.textShadow,q=k&&k.textOverflow==="ellipsis",y=g.length,S=l&&!a.added&&this.box,C=function(a){return n?B(n):c.fontMetrics(/(px|em)$/.test(a&& +a.style.fontSize)?a.style.fontSize:k&&k.fontSize||c.style.fontSize||12,a).h},v=function(a){return a.replace(/</g,"<").replace(/>/g,">")};y--;)b.removeChild(g[y]);!f&&!o&&!q&&e.indexOf(" ")===-1?b.appendChild(A.createTextNode(v(e))):(h=/<.*style="([^"]+)".*>/,i=/<.*href="(http[^"]+)".*>/,S&&S.appendChild(b),e=f?e.replace(/<(b|strong)>/g,'').replace(/<(i|em)>/g,'').replace(//g,"").split(//g): +[e],e[e.length-1]===""&&e.pop(),m(e,function(e,f){var g,n=0,e=e.replace(//g,"|||");g=e.split("|||");m(g,function(e){if(e!==""||g.length===1){var o={},y=A.createElementNS(Ca,"tspan"),p;h.test(e)&&(p=e.match(h)[1].replace(/(;| |^)color([ :])/,"$1fill$2"),L(y,"style",p));i.test(e)&&!d&&(L(y,"onclick",'location.href="'+e.match(i)[1]+'"'),F(y,{cursor:"pointer"}));e=v(e.replace(/<(.|\n)*?>/g,"")||" ");if(e!==" "){y.appendChild(A.createTextNode(e));if(n)o.dx=0; +else if(f&&j!==null)o.x=j;L(y,o);b.appendChild(y);!n&&f&&(!ba&&d&&F(y,{display:"block"}),L(y,"dy",C(y)));if(l){for(var o=e.replace(/([^\^])-/g,"$1- ").split(" "),m=g.length>1||f||o.length>1&&k.whiteSpace!=="nowrap",S,s,ua,u=[],t=C(y),x=1,r=a.rotation,z=e,w=z.length;(m||q)&&(o.length||u.length);)a.rotation=0,S=a.getBBox(!0),ua=S.width,!ba&&c.forExport&&(ua=c.measureSpanWidth(y.firstChild.data,a.styles)),S=ua>l,s===void 0&&(s=S),q&&s?(w/=2,z===""||!S&&w<0.5?o=[]:(S&&(s=!0),z=e.substring(0,z.length+ +(S?-1:1)*sa(w)),o=[z+"…"],y.removeChild(y.firstChild))):!S||o.length===1?(o=u,u=[],o.length&&(x++,y=A.createElementNS(Ca,"tspan"),L(y,{dy:t,x:j}),p&&L(y,"style",p),b.appendChild(y)),ua>l&&(l=ua)):(y.removeChild(y.firstChild),u.unshift(o.pop())),o.length&&y.appendChild(A.createTextNode(o.join(" ").replace(/- /g,"-")));s&&a.attr("title",a.textStr);a.rotation=r}n++}}})}),S&&S.removeChild(b),o&&a.applyTextShadow&&a.applyTextShadow(o))},getContrast:function(a){a=na(a).rgba;return a[0]+a[1]+a[2]>384?"#000": +"#FFF"},button:function(a,b,c,d,e,f,g,h,i){var j=this.label(a,b,c,i,null,null,null,null,"button"),k=0,l,n,o,q,y,p,a={x1:0,y1:0,x2:0,y2:1},e=z({"stroke-width":1,stroke:"#CCCCCC",fill:{linearGradient:a,stops:[[0,"#FEFEFE"],[1,"#F6F6F6"]]},r:2,padding:5,style:{color:"black"}},e);o=e.style;delete e.style;f=z(e,{stroke:"#68A",fill:{linearGradient:a,stops:[[0,"#FFF"],[1,"#ACF"]]}},f);q=f.style;delete f.style;g=z(e,{stroke:"#68A",fill:{linearGradient:a,stops:[[0,"#9BD"],[1,"#CDF"]]}},g);y=g.style;delete g.style; +h=z(e,{style:{color:"#CCC"}},h);p=h.style;delete h.style;N(j.element,ya?"mouseover":"mouseenter",function(){k!==3&&j.attr(f).css(q)});N(j.element,ya?"mouseout":"mouseleave",function(){k!==3&&(l=[e,f,g][k],n=[o,q,y][k],j.attr(l).css(n))});j.setState=function(a){(j.state=k=a)?a===2?j.attr(g).css(y):a===3&&j.attr(h).css(p):j.attr(e).css(o)};return j.on("click",function(){k!==3&&d.call(j)}).attr(e).css(r({cursor:"default"},o))},crispLine:function(a,b){a[1]===a[4]&&(a[1]=a[4]=x(a[1])-b%2/2);a[2]===a[5]&& +(a[2]=a[5]=x(a[2])+b%2/2);return a},path:function(a){var b={fill:R};Ha(a)?b.d=a:ca(a)&&r(b,a);return this.createElement("path").attr(b)},circle:function(a,b,c){a=ca(a)?a:{x:a,y:b,r:c};b=this.createElement("circle");b.xSetter=function(a){this.element.setAttribute("cx",a)};b.ySetter=function(a){this.element.setAttribute("cy",a)};return b.attr(a)},arc:function(a,b,c,d,e,f){if(ca(a))b=a.y,c=a.r,d=a.innerR,e=a.start,f=a.end,a=a.x;a=this.symbol("arc",a||0,b||0,c||0,c||0,{innerR:d||0,start:e||0,end:f||0}); +a.r=c;return a},rect:function(a,b,c,d,e,f){var e=ca(a)?a.r:e,g=this.createElement("rect"),a=ca(a)?a:a===u?{}:{x:a,y:b,width:t(c,0),height:t(d,0)};if(f!==u)a.strokeWidth=f,a=g.crisp(a);if(e)a.r=e;g.rSetter=function(a){L(this.element,{rx:a,ry:a})};return g.attr(a)},setSize:function(a,b,c){var d=this.alignedObjects,e=d.length;this.width=a;this.height=b;for(this.boxWrapper[p(c,!0)?"animate":"attr"]({width:a,height:b});e--;)d[e].align()},g:function(a){var b=this.createElement("g");return s(a)?b.attr({"class":"highcharts-"+ +a}):b},image:function(a,b,c,d,e){var f={preserveAspectRatio:R};arguments.length>1&&r(f,{x:b,y:c,width:d,height:e});f=this.createElement("image").attr(f);f.element.setAttributeNS?f.element.setAttributeNS("http://www.w3.org/1999/xlink","href",a):f.element.setAttribute("hc-svg-href",a);return f},symbol:function(a,b,c,d,e,f){var g,h=this.symbols[a],h=h&&h(x(b),x(c),d,e,f),i=/^url\((.*?)\)$/,j,k;if(h)g=this.path(h),r(g,{symbolName:a,x:b,y:c,width:d,height:e}),f&&r(g,f);else if(i.test(a))k=function(a,b){a.element&& +(a.attr({width:b[0],height:b[1]}),a.alignByTranslate||a.translate(x((d-b[0])/2),x((e-b[1])/2)))},j=a.match(i)[1],a=Kb[j]||f&&f.width&&f.height&&[f.width,f.height],g=this.image(j).attr({x:b,y:c}),g.isImg=!0,a?k(g,a):(g.attr({width:0,height:0}),Z("img",{onload:function(){k(g,Kb[j]=[this.width,this.height])},src:j}));return g},symbols:{circle:function(a,b,c,d){var e=0.166*c;return["M",a+c/2,b,"C",a+c+e,b,a+c+e,b+d,a+c/2,b+d,"C",a-e,b+d,a-e,b,a+c/2,b,"Z"]},square:function(a,b,c,d){return["M",a,b,"L", +a+c,b,a+c,b+d,a,b+d,"Z"]},triangle:function(a,b,c,d){return["M",a+c/2,b,"L",a+c,b+d,a,b+d,"Z"]},"triangle-down":function(a,b,c,d){return["M",a,b,"L",a+c,b,a+c/2,b+d,"Z"]},diamond:function(a,b,c,d){return["M",a+c/2,b,"L",a+c,b+d/2,a+c/2,b+d,a,b+d/2,"Z"]},arc:function(a,b,c,d,e){var f=e.start,c=e.r||c||d,g=e.end-0.001,d=e.innerR,h=e.open,i=W(f),j=$(f),k=W(g),g=$(g),e=e.end-fc&&i>b+g&&ib+g&&id&&h>a+g&&ha+g&&hn&&/[ \-]/.test(b.textContent||b.innerText))F(b,{width:n+"px",display:"block",whiteSpace:j&&j.whiteSpace||"normal"}),i=n;this.getSpanCorrection(i,l,h,k,g)}F(b,{left:e+(this.xCorr||0)+"px",top:f+(this.yCorr||0)+"px"});if(xb)l=b.offsetHeight;this.cTT=o}}else this.alignOnAdd=!0},setSpanRotation:function(a,b,c){var d={},e=ya?"-ms-transform":xb?"-webkit-transform":La?"MozTransform":Ib?"-o-transform":"";d[e]=d.transform="rotate("+a+"deg)"; +d[e+(La?"Origin":"-origin")]=d.transformOrigin=b*100+"% "+c+"px";F(this.element,d)},getSpanCorrection:function(a,b,c){this.xCorr=-a*c;this.yCorr=-b}});r(ta.prototype,{html:function(a,b,c){var d=this.createElement("span"),e=d.element,f=d.renderer;d.textSetter=function(a){a!==e.innerHTML&&delete this.bBox;e.innerHTML=this.textStr=a};d.xSetter=d.ySetter=d.alignSetter=d.rotationSetter=function(a,b){b==="align"&&(b="textAlign");d[b]=a;d.htmlUpdateTransform()};d.attr({text:a,x:x(b),y:x(c)}).css({position:"absolute", +fontFamily:this.style.fontFamily,fontSize:this.style.fontSize});e.style.whiteSpace="nowrap";d.css=d.htmlCss;if(f.isSVG)d.add=function(a){var b,c=f.box.parentNode,j=[];if(this.parentGroup=a){if(b=a.div,!b){for(;a;)j.push(a),a=a.parentGroup;m(j.reverse(),function(a){var d;b=a.div=a.div||Z(Ka,{className:L(a.element,"class")},{position:"absolute",left:(a.translateX||0)+"px",top:(a.translateY||0)+"px"},b||c);d=b.style;r(a,{translateXSetter:function(b,c){d.left=b+"px";a[c]=b;a.doTransform=!0},translateYSetter:function(b, +c){d.top=b+"px";a[c]=b;a.doTransform=!0},visibilitySetter:function(a,b){d[b]=a}})})}}else b=c;b.appendChild(e);d.added=!0;d.alignOnAdd&&d.htmlUpdateTransform();return d};return d}});if(!ba&&!ea){D={init:function(a,b){var c=["<",b,' filled="f" stroked="f"'],d=["position: ","absolute",";"],e=b===Ka;(b==="shape"||e)&&d.push("left:0;top:0;width:1px;height:1px;");d.push("visibility: ",e?"hidden":"visible");c.push(' style="',d.join(""),'"/>');if(b)c=e||b==="span"||b==="img"?c.join(""):a.prepVML(c),this.element= +Z(c);this.renderer=a},add:function(a){var b=this.renderer,c=this.element,d=b.box,d=a?a.element||a:d;a&&a.inverted&&b.invertChild(c,d);d.appendChild(c);this.added=!0;this.alignOnAdd&&!this.deferUpdateTransform&&this.updateTransform();if(this.onAdd)this.onAdd();return this},updateTransform:K.prototype.htmlUpdateTransform,setSpanRotation:function(){var a=this.rotation,b=W(a*ga),c=$(a*ga);F(this.element,{filter:a?["progid:DXImageTransform.Microsoft.Matrix(M11=",b,", M12=",-c,", M21=",c,", M22=",b,", sizingMethod='auto expand')"].join(""): +R})},getSpanCorrection:function(a,b,c,d,e){var f=d?W(d*ga):1,g=d?$(d*ga):0,h=p(this.elemHeight,this.element.offsetHeight),i;this.xCorr=f<0&&-a;this.yCorr=g<0&&-h;i=f*g<0;this.xCorr+=g*b*(i?1-c:c);this.yCorr-=f*b*(d?i?c:1-c:1);e&&e!=="left"&&(this.xCorr-=a*c*(f<0?-1:1),d&&(this.yCorr-=h*c*(g<0?-1:1)),F(this.element,{textAlign:e}))},pathToVML:function(a){for(var b=a.length,c=[];b--;)if(qa(a[b]))c[b]=x(a[b]*10)-5;else if(a[b]==="Z")c[b]="x";else if(c[b]=a[b],a.isArc&&(a[b]==="wa"||a[b]==="at"))c[b+5]=== +c[b+7]&&(c[b+7]+=a[b+7]>a[b+5]?1:-1),c[b+6]===c[b+8]&&(c[b+8]+=a[b+8]>a[b+6]?1:-1);return c.join(" ")||"x"},clip:function(a){var b=this,c;a?(c=a.members,ia(c,b),c.push(b),b.destroyClip=function(){ia(c,b)},a=a.getCSS(b)):(b.destroyClip&&b.destroyClip(),a={clip:hb?"inherit":"rect(auto)"});return b.css(a)},css:K.prototype.htmlCss,safeRemoveChild:function(a){a.parentNode&&Ra(a)},destroy:function(){this.destroyClip&&this.destroyClip();return K.prototype.destroy.apply(this)},on:function(a,b){this.element["on"+ +a]=function(){var a=H.event;a.target=a.srcElement;b(a)};return this},cutOffPath:function(a,b){var c,a=a.split(/[ ,]/);c=a.length;if(c===9||c===11)a[c-4]=a[c-2]=B(a[c-2])-10*b;return a.join(" ")},shadow:function(a,b,c){var d=[],e,f=this.element,g=this.renderer,h,i=f.style,j,k=f.path,l,n,o,q;k&&typeof k.value!=="string"&&(k="x");n=k;if(a){o=p(a.width,3);q=(a.opacity||0.15)/o;for(e=1;e<=3;e++){l=o*2+1-2*e;c&&(n=this.cutOffPath(k.value,l+0.5));j=[''];h=Z(g.prepVML(j),null,{left:B(i.left)+p(a.offsetX,1),top:B(i.top)+p(a.offsetY,1)});if(c)h.cutOff=l+1;j=[''];Z(g.prepVML(j),null,null,h);b?b.element.appendChild(h):f.parentNode.insertBefore(h,f);d.push(h)}this.shadows=d}return this},updateShadows:ma,setAttr:function(a,b){hb?this.element[a]=b:this.element.setAttribute(a,b)},classSetter:function(a){this.element.className=a},dashstyleSetter:function(a, +b,c){(c.getElementsByTagName("stroke")[0]||Z(this.renderer.prepVML([""]),null,null,c))[b]=a||"solid";this[b]=a},dSetter:function(a,b,c){var d=this.shadows,a=a||[];this.d=a.join&&a.join(" ");c.path=a=this.pathToVML(a);if(d)for(c=d.length;c--;)d[c].path=d[c].cutOff?this.cutOffPath(a,d[c].cutOff):a;this.setAttr(b,a)},fillSetter:function(a,b,c){var d=c.nodeName;if(d==="SPAN")c.style.color=a;else if(d!=="IMG")c.filled=a!==R,this.setAttr("fillcolor",this.renderer.color(a,c,b,this))},opacitySetter:ma, +rotationSetter:function(a,b,c){c=c.style;this[b]=c[b]=a;c.left=-x($(a*ga)+1)+"px";c.top=x(W(a*ga))+"px"},strokeSetter:function(a,b,c){this.setAttr("strokecolor",this.renderer.color(a,c,b))},"stroke-widthSetter":function(a,b,c){c.stroked=!!a;this[b]=a;qa(a)&&(a+="px");this.setAttr("strokeweight",a)},titleSetter:function(a,b){this.setAttr(b,a)},visibilitySetter:function(a,b,c){a==="inherit"&&(a="visible");this.shadows&&m(this.shadows,function(c){c.style[b]=a});c.nodeName==="DIV"&&(a=a==="hidden"?"-999em": +0,hb||(c.style[b]=a?"visible":"hidden"),b="top");c.style[b]=a},xSetter:function(a,b,c){this[b]=a;b==="x"?b="left":b==="y"&&(b="top");this.updateClipping?(this[b]=a,this.updateClipping()):c.style[b]=a},zIndexSetter:function(a,b,c){c.style[b]=a}};w.VMLElement=D=ja(K,D);D.prototype.ySetter=D.prototype.widthSetter=D.prototype.heightSetter=D.prototype.xSetter;var Na={Element:D,isIE8:Ba.indexOf("MSIE 8.0")>-1,init:function(a,b,c,d){var e;this.alignedObjects=[];d=this.createElement(Ka).css(r(this.getStyle(d), +{position:"relative"}));e=d.element;a.appendChild(d.element);this.isVML=!0;this.box=e;this.boxWrapper=d;this.cache={};this.setSize(b,c,!1);if(!A.namespaces.hcv){A.namespaces.add("hcv","urn:schemas-microsoft-com:vml");try{A.createStyleSheet().cssText="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}catch(f){A.styleSheets[0].cssText+="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}}}, +isHidden:function(){return!this.box.offsetWidth},clipRect:function(a,b,c,d){var e=this.createElement(),f=ca(a);return r(e,{members:[],count:0,left:(f?a.x:a)+1,top:(f?a.y:b)+1,width:(f?a.width:c)-1,height:(f?a.height:d)-1,getCSS:function(a){var b=a.element,c=b.nodeName,a=a.inverted,d=this.top-(c==="shape"?b.offsetTop:0),e=this.left,b=e+this.width,f=d+this.height,d={clip:"rect("+x(a?e:d)+"px,"+x(a?f:b)+"px,"+x(a?b:f)+"px,"+x(a?d:e)+"px)"};!a&&hb&&c==="DIV"&&r(d,{width:b+"px",height:f+"px"});return d}, +updateClipping:function(){m(e.members,function(a){a.element&&a.css(e.getCSS(a))})}})},color:function(a,b,c,d){var e=this,f,g=/^rgba/,h,i,j=R;a&&a.linearGradient?i="gradient":a&&a.radialGradient&&(i="pattern");if(i){var k,l,n=a.linearGradient||a.radialGradient,o,q,y,p,C,v="",a=a.stops,s,fa=[],t=function(){h=[''];Z(e.prepVML(h),null,null,b)};o=a[0];s=a[a.length-1];o[0]>0&&a.unshift([0,o[1]]); +s[0]<1&&a.push([1,s[1]]);m(a,function(a,b){g.test(a[1])?(f=na(a[1]),k=f.get("rgb"),l=f.get("a")):(k=a[1],l=1);fa.push(a[0]*100+"% "+k);b?(y=l,p=k):(q=l,C=k)});if(c==="fill")if(i==="gradient")c=n.x1||n[0]||0,a=n.y1||n[1]||0,o=n.x2||n[2]||0,n=n.y2||n[3]||0,v='angle="'+(90-V.atan((n-a)/(o-c))*180/la)+'"',t();else{var j=n.r,u=j*2,x=j*2,r=n.cx,E=n.cy,z=b.radialReference,w,j=function(){z&&(w=d.getBBox(),r+=(z[0]-w.x)/w.width-0.5,E+=(z[1]-w.y)/w.height-0.5,u*=z[2]/w.width,x*=z[2]/w.height);v='src="'+P.global.VMLRadialGradientURL+ +'" size="'+u+","+x+'" origin="0.5,0.5" position="'+r+","+E+'" color2="'+C+'" ';t()};d.added?j():d.onAdd=j;j=p}else j=k}else if(g.test(a)&&b.tagName!=="IMG")f=na(a),h=["<",c,' opacity="',f.get("a"),'"/>'],Z(this.prepVML(h),null,null,b),j=f.get("rgb");else{j=b.getElementsByTagName(c);if(j.length)j[0].opacity=1,j[0].type="solid";j=a}return j},prepVML:function(a){var b=this.isIE8,a=a.join("");b?(a=a.replace("/>",' xmlns="urn:schemas-microsoft-com:vml" />'),a=a.indexOf('style="')===-1?a.replace("/>",' style="display:inline-block;behavior:url(#default#VML);" />'): +a.replace('style="','style="display:inline-block;behavior:url(#default#VML);')):a=a.replace("<","1&&f.attr({x:b,y:c,width:d,height:e});return f},createElement:function(a){return a==="rect"?this.symbol(a):ta.prototype.createElement.call(this,a)},invertChild:function(a,b){var c=this,d=b.style,e=a.tagName==="IMG"&&a.style;F(a,{flip:"x",left:B(d.width)-(e?B(e.top):1),top:B(d.height)-(e?B(e.left):1),rotation:-90});m(a.childNodes,function(b){c.invertChild(b,a)})},symbols:{arc:function(a,b,c,d,e){var f=e.start,g=e.end,h=e.r||c|| +d,c=e.innerR,d=W(f),i=$(f),j=W(g),k=$(g);if(g-f===0)return["x"];f=["wa",a-h,b-h,a+h,b+h,a+h*d,b+h*i,a+h*j,b+h*k];e.open&&!c&&f.push("e","M",a,b);f.push("at",a-c,b-c,a+c,b+c,a+c*j,b+c*k,a+c*d,b+c*i,"x","e");f.isArc=!0;return f},circle:function(a,b,c,d,e){e&&(c=d=2*e.r);e&&e.isCircle&&(a-=c/2,b-=d/2);return["wa",a,b,a+c,b+d,a+c,b+d/2,a+c,b+d/2,"e"]},rect:function(a,b,c,d,e){return ta.prototype.symbols[!s(e)||!e.r?"square":"callout"].call(0,a,b,c,d,e)}}};w.VMLRenderer=D=function(){this.init.apply(this, +arguments)};D.prototype=z(ta.prototype,Na);$a=D}ta.prototype.measureSpanWidth=function(a,b){var c=A.createElement("span"),d;d=A.createTextNode(a);c.appendChild(d);F(c,b);this.box.appendChild(c);d=c.offsetWidth;Ra(c);return d};var Lb;if(ea)w.CanVGRenderer=D=function(){Ca="http://www.w3.org/1999/xhtml"},D.prototype.symbols={},Lb=function(){function a(){var a=b.length,d;for(d=0;d0&&c+i*j>e&&(l=x((d-c)/W(h*ga)));else{d=c-i*j;c+=i*j;if(de)k-=c-e,a.x=e,g.attr({align:"right"});if(j>k||b.autoRotation&&g.styles.width)l=k}l&&g.css({width:l,textOverflow:"ellipsis"})},getPosition:function(a,b,c,d){var e=this.axis,f=e.chart,g=d&&f.oldChartHeight||f.chartHeight;return{x:a?e.translate(b+c,null,null,d)+e.transB:e.left+e.offset+(e.opposite?(d&&f.oldChartWidth||f.chartWidth)-e.right-e.left:0),y:a?g-e.bottom+e.offset-(e.opposite?e.height:0):g-e.translate(b+c,null,null,d)-e.transB}},getLabelPosition:function(a,b,c,d,e,f,g,h){var i=this.axis, +j=i.transA,k=i.reversed,l=i.staggerLines,n=i.tickRotCorr||{x:0,y:0},c=p(e.y,n.y+(i.side===2?8:-(c.getBBox().height/2))),a=a+e.x+n.x-(f&&d?f*j*(k?-1:1):0),b=b+c-(f&&!d?f*j*(k?1:-1):0);l&&(b+=g/(h||1)%l*(i.labelOffset/l));return{x:a,y:x(b)}},getMarkPath:function(a,b,c,d,e,f){return f.crispLine(["M",a,b,"L",a+(e?0:-c),b+(e?c:0)],d)},render:function(a,b,c){var d=this.axis,e=d.options,f=d.chart.renderer,g=d.horiz,h=this.type,i=this.label,j=this.pos,k=e.labels,l=this.gridLine,n=h?h+"Grid":"grid",o=h?h+ +"Tick":"tick",q=e[n+"LineWidth"],y=e[n+"LineColor"],m=e[n+"LineDashStyle"],C=e[o+"Length"],n=e[o+"Width"]||0,v=e[o+"Color"],s=e[o+"Position"],o=this.mark,fa=k.step,t=!0,x=d.tickmarkOffset,r=this.getPosition(g,j,x,b),w=r.x,r=r.y,z=g&&w===d.pos+d.len||!g&&r===d.pos?-1:1,c=p(c,1);this.isActive=!0;if(q){j=d.getPlotLinePath(j+x,q*z,b,!0);if(l===u){l={stroke:y,"stroke-width":q};if(m)l.dashstyle=m;if(!h)l.zIndex=1;if(b)l.opacity=0;this.gridLine=l=q?f.path(j).attr(l).add(d.gridGroup):null}if(!b&&l&&j)l[this.isNew? +"attr":"animate"]({d:j,opacity:c})}if(n&&C)s==="inside"&&(C=-C),d.opposite&&(C=-C),h=this.getMarkPath(w,r,C,n*z,g,f),o?o.animate({d:h,opacity:c}):this.mark=f.path(h).attr({stroke:v,"stroke-width":n,opacity:c}).add(d.axisGroup);if(i&&!isNaN(w))i.xy=r=this.getLabelPosition(w,r,i,g,k,x,a,fa),this.isFirst&&!this.isLast&&!p(e.showFirstLabel,1)||this.isLast&&!this.isFirst&&!p(e.showLastLabel,1)?t=!1:g&&!d.isRadial&&!k.step&&!k.rotation&&!b&&c!==0&&this.handleOverflow(r),fa&&a%fa&&(t=!1),t&&!isNaN(r.y)? +(r.opacity=c,i[this.isNew?"attr":"animate"](r),this.isNew=!1):i.attr("y",-9999)},destroy:function(){Qa(this,this.axis)}};w.PlotLineOrBand=function(a,b){this.axis=a;if(b)this.options=b,this.id=b.id};w.PlotLineOrBand.prototype={render:function(){var a=this,b=a.axis,c=b.horiz,d=a.options,e=d.label,f=a.label,g=d.width,h=d.to,i=d.from,j=s(i)&&s(h),k=d.value,l=d.dashStyle,n=a.svgElem,o=[],q,y=d.color,p=d.zIndex,m=d.events,v={},t=b.chart.renderer;b.isLog&&(i=Ea(i),h=Ea(h),k=Ea(k));if(g){if(o=b.getPlotLinePath(k, +g),v={stroke:y,"stroke-width":g},l)v.dashstyle=l}else if(j){o=b.getPlotBandPath(i,h,d);if(y)v.fill=y;if(d.borderWidth)v.stroke=d.borderColor,v["stroke-width"]=d.borderWidth}else return;if(s(p))v.zIndex=p;if(n)if(o)n.animate({d:o},null,n.onGetPath);else{if(n.hide(),n.onGetPath=function(){n.show()},f)a.label=f=f.destroy()}else if(o&&o.length&&(a.svgElem=n=t.path(o).attr(v).add(),m))for(q in d=function(b){n.on(b,function(c){m[b].apply(a,[c])})},m)d(q);if(e&&s(e.text)&&o&&o.length&&b.width>0&&b.height> +0){e=z({align:c&&j&&"center",x:c?!j&&4:10,verticalAlign:!c&&j&&"middle",y:c?j?16:10:j?6:-4,rotation:c&&!j&&90},e);if(!f){v={align:e.textAlign||e.align,rotation:e.rotation};if(s(p))v.zIndex=p;a.label=f=t.text(e.text,0,0,e.useHTML).attr(v).css(e.style).add()}b=[o[1],o[4],j?o[6]:o[1]];j=[o[2],o[5],j?o[7]:o[2]];o=Pa(b);c=Pa(j);f.align(e,!1,{x:o,y:c,width:Fa(b)-o,height:Fa(j)-c});f.show()}else f&&f.hide();return a},destroy:function(){ia(this.axis.plotLinesAndBands,this);delete this.axis;Qa(this)}};var va= +w.Axis=function(){this.init.apply(this,arguments)};va.prototype={defaultOptions:{dateTimeLabelFormats:{millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e. %b",week:"%e. %b",month:"%b '%y",year:"%Y"},endOnTick:!1,gridLineColor:"#D8D8D8",labels:{enabled:!0,style:{color:"#606060",cursor:"default",fontSize:"11px"},x:0,y:15},lineColor:"#C0D0E0",lineWidth:1,minPadding:0.01,maxPadding:0.01,minorGridLineColor:"#E0E0E0",minorGridLineWidth:1,minorTickColor:"#A0A0A0",minorTickLength:2, +minorTickPosition:"outside",startOfWeek:1,startOnTick:!1,tickColor:"#C0D0E0",tickLength:10,tickmarkPlacement:"between",tickPixelInterval:100,tickPosition:"outside",tickWidth:1,title:{align:"middle",style:{color:"#707070"}},type:"linear"},defaultYAxisOptions:{endOnTick:!0,gridLineWidth:1,tickPixelInterval:72,showLastLabel:!0,labels:{x:-8,y:3},lineWidth:0,maxPadding:0.05,minPadding:0.05,startOnTick:!0,tickWidth:0,title:{rotation:270,text:"Values"},stackLabels:{enabled:!1,formatter:function(){return w.numberFormat(this.total, +-1)},style:z(aa.line.dataLabels.style,{color:"#000000"})}},defaultLeftAxisOptions:{labels:{x:-15,y:null},title:{rotation:270}},defaultRightAxisOptions:{labels:{x:15,y:null},title:{rotation:90}},defaultBottomAxisOptions:{labels:{autoRotation:[-45],x:0,y:null},title:{rotation:0}},defaultTopAxisOptions:{labels:{autoRotation:[-45],x:0,y:-15},title:{rotation:0}},init:function(a,b){var c=b.isX;this.horiz=a.inverted?!c:c;this.coll=(this.isXAxis=c)?"xAxis":"yAxis";this.opposite=b.opposite;this.side=b.side|| +(this.horiz?this.opposite?0:2:this.opposite?1:3);this.setOptions(b);var d=this.options,e=d.type;this.labelFormatter=d.labels.formatter||this.defaultLabelFormatter;this.userOptions=b;this.minPixelPadding=0;this.chart=a;this.reversed=d.reversed;this.zoomEnabled=d.zoomEnabled!==!1;this.categories=d.categories||e==="category";this.names=this.names||[];this.isLog=e==="logarithmic";this.isDatetimeAxis=e==="datetime";this.isLinked=s(d.linkedTo);this.ticks={};this.labelEdge=[];this.minorTicks={};this.plotLinesAndBands= +[];this.alternateBands={};this.len=0;this.minRange=this.userMinRange=d.minRange||d.maxZoom;this.range=d.range;this.offset=d.offset||0;this.stacks={};this.oldStacks={};this.min=this.max=null;this.crosshair=p(d.crosshair,ra(a.options.tooltip.crosshairs)[c?0:1],!1);var f,d=this.options.events;Ma(this,a.axes)===-1&&(c&&!this.isColorAxis?a.axes.splice(a.xAxis.length,0,this):a.axes.push(this),a[this.coll].push(this));this.series=this.series||[];if(a.inverted&&c&&this.reversed===u)this.reversed=!0;this.removePlotLine= +this.removePlotBand=this.removePlotBandOrLine;for(f in d)N(this,f,d[f]);if(this.isLog)this.val2lin=Ea,this.lin2val=ha},setOptions:function(a){this.options=z(this.defaultOptions,this.isXAxis?{}:this.defaultYAxisOptions,[this.defaultTopAxisOptions,this.defaultRightAxisOptions,this.defaultBottomAxisOptions,this.defaultLeftAxisOptions][this.side],z(P[this.coll],a))},defaultLabelFormatter:function(){var a=this.axis,b=this.value,c=a.categories,d=this.dateTimeLabelFormat,e=P.lang.numericSymbols,f=e&&e.length, +g,h=a.options.labels.format,a=a.isLog?b:a.tickInterval;if(h)g=Ja(h,this);else if(c)g=b;else if(d)g=Oa(d,b);else if(f&&a>=1E3)for(;f--&&g===u;)c=Math.pow(1E3,f+1),a>=c&&e[f]!==null&&(g=w.numberFormat(b/c,-1)+e[f]);g===u&&(g=O(b)>=1E4?w.numberFormat(b,0):w.numberFormat(b,-1,u,""));return g},getSeriesExtremes:function(){var a=this,b=a.chart;a.hasVisibleSeries=!1;a.dataMin=a.dataMax=a.ignoreMinPadding=a.ignoreMaxPadding=null;a.buildStacks&&a.buildStacks();m(a.series,function(c){if(c.visible||!b.options.chart.ignoreHiddenSeries){var d; +d=c.options.threshold;var e;a.hasVisibleSeries=!0;a.isLog&&d<=0&&(d=null);if(a.isXAxis){if(d=c.xData,d.length)a.dataMin=I(p(a.dataMin,d[0]),Pa(d)),a.dataMax=t(p(a.dataMax,d[0]),Fa(d))}else{c.getExtremes();e=c.dataMax;c=c.dataMin;if(s(c)&&s(e))a.dataMin=I(p(a.dataMin,c),c),a.dataMax=t(p(a.dataMax,e),e);if(s(d))if(a.dataMin>=d)a.dataMin=d,a.ignoreMinPadding=!0;else if(a.dataMaxc)d?a=I(t(b,a),c):n=!0;return a},e=p(e,this.translate(a,null,null,c)),a=c=x(e+i);i=j=x(k-e-i);isNaN(e)?n=!0:this.horiz?(i=h,j=k-this.bottom,a=c=o(a,g,g+this.width)):(a=g,c=l-this.right,i=j=o(i,h,h+this.height));return n&&!d?null:f.renderer.crispLine(["M",a,i,"L",c,j],b||1)},getLinearTickPositions:function(a, +b,c){var d,e=da(U(b/a)*a),f=da(sa(c/a)*a),g=[];if(b===c&&qa(b))return[b];for(b=e;b<=f;){g.push(b);b=da(b+a);if(b===d)break;d=b}return g},getMinorTickPositions:function(){var a=this.options,b=this.tickPositions,c=this.minorTickInterval,d=[],e,f=this.min;e=this.max;var g=e-f;if(g&&g/c=this.minRange,f,g,h,i,j;if(this.isXAxis&&this.minRange===u&&!this.isLog)s(a.min)||s(a.max)?this.minRange=null:(m(this.series,function(a){i=a.xData;for(g=j=a.xIncrement?1:i.length-1;g>0;g--)if(h=i[g]-i[g-1],f===u||hc&&(h=0);d=t(d,h);b.single||(f=t(f,Da(j)?0:h/2),g=t(g,j==="on"?0:h));!a.noSharedTooltip&&s(q)&&(e=s(e)?I(e,q):q)}),h=b.ordinalSlope&&e?b.ordinalSlope/e:1,b.minPointOffset=f*=h,b.pointRangePadding=g*=h,b.pointRange=I(d,c),k)b.closestPointRange=e;if(a)b.oldTransA=j;b.translationSlope=b.transA=j=b.len/(c+g||1);b.transB=b.horiz?b.left:b.bottom;b.minPixelPadding=j*f},setTickInterval:function(a){var b=this,c=b.chart,d=b.options,e=b.isLog,f=b.isDatetimeAxis,g=b.isXAxis,h=b.isLinked,i=d.maxPadding,j=d.minPadding, +k=d.tickInterval,l=d.tickPixelInterval,n=b.categories;!f&&!n&&!h&&this.getTickAmount();h?(b.linkedParent=c[b.coll][d.linkedTo],c=b.linkedParent.getExtremes(),b.min=p(c.min,c.dataMin),b.max=p(c.max,c.dataMax),d.type!==b.linkedParent.options.type&&ka(11,1)):(b.min=p(b.userMin,d.min,b.dataMin),b.max=p(b.userMax,d.max,b.dataMax));if(e)!a&&I(b.min,p(b.dataMin,b.min))<=0&&ka(10,1),b.min=da(Ea(b.min)),b.max=da(Ea(b.max));if(b.range&&s(b.max))b.userMin=b.min=t(b.min,b.max-b.range),b.userMax=b.max,b.range= +null;b.beforePadding&&b.beforePadding();b.adjustForMinRange();if(!n&&!b.axisPointRange&&!b.usePercentage&&!h&&s(b.min)&&s(b.max)&&(c=b.max-b.min)){if(!s(d.min)&&!s(b.userMin)&&j&&(b.dataMin<0||!b.ignoreMinPadding))b.min-=c*j;if(!s(d.max)&&!s(b.userMax)&&i&&(b.dataMax>0||!b.ignoreMaxPadding))b.max+=c*i}if(qa(d.floor))b.min=t(b.min,d.floor);if(qa(d.ceiling))b.max=I(b.max,d.ceiling);b.tickInterval=b.min===b.max||b.min===void 0||b.max===void 0?1:h&&!k&&l===b.linkedParent.options.tickPixelInterval?b.linkedParent.tickInterval: +p(k,this.tickAmount?(b.max-b.min)/t(this.tickAmount-1,1):void 0,n?1:(b.max-b.min)*l/t(b.len,l));g&&!a&&m(b.series,function(a){a.processData(b.min!==b.oldMin||b.max!==b.oldMax)});b.setAxisTranslation(!0);b.beforeSetTickPositions&&b.beforeSetTickPositions();if(b.postProcessTickInterval)b.tickInterval=b.postProcessTickInterval(b.tickInterval);if(b.pointRange)b.tickInterval=t(b.pointRange,b.tickInterval);a=p(d.minTickInterval,b.isDatetimeAxis&&b.closestPointRange);if(!k&&b.tickInterval0.5&&b.tickInterval<5&&b.max>1E3&&b.max<9999)),!!this.tickAmount);if(!this.tickAmount&&this.len)b.tickInterval=b.unsquish();this.setTickPositions()},setTickPositions:function(){var a=this.options,b,c=a.tickPositions,d=a.tickPositioner,e=a.startOnTick,f=a.endOnTick,g;this.tickmarkOffset=this.categories&&a.tickmarkPlacement==="between"&&this.tickInterval===1?0.5:0;this.minorTickInterval=a.minorTickInterval=== +"auto"&&this.tickInterval?this.tickInterval/5:a.minorTickInterval;this.tickPositions=b=a.tickPositions&&a.tickPositions.slice();if(!b&&(this.tickPositions=b=this.isDatetimeAxis?this.getTimeTicks(this.normalizeTimeTickInterval(this.tickInterval,a.units),this.min,this.max,a.startOfWeek,this.ordinalPositions,this.closestPointRange,!0):this.isLog?this.getLogTickPositions(this.tickInterval,this.min,this.max):this.getLinearTickPositions(this.tickInterval,this.min,this.max),d&&(d=d.apply(this,[this.min, +this.max]))))this.tickPositions=b=d;if(!this.isLinked)this.trimTicks(b,e,f),this.min===this.max&&s(this.min)&&!this.tickAmount&&(g=!0,this.min-=0.5,this.max+=0.5),this.single=g,!c&&!d&&this.adjustTickAmount()},trimTicks:function(a,b,c){var d=a[0],e=a[a.length-1],f=this.minPointOffset||0;b?this.min=d:this.min-f>d&&a.shift();c?this.max=e:this.max+fc&&(this.tickInterval*=2,this.setTickPositions());if(s(d)){for(a=c=b.length;a--;)(d===3&&a%2===1||d<=2&&a>0&&a=t(d,p(e.max,d))&&(b=u));this.displayBtn=a!==u||b!==u;this.setExtremes(a,b,!1,u,{trigger:"zoom"});return!0},setAxisSize:function(){var a=this.chart,b=this.options,c=b.offsetLeft|| +0,d=this.horiz,e=p(b.width,a.plotWidth-c+(b.offsetRight||0)),f=p(b.height,a.plotHeight),g=p(b.top,a.plotTop),b=p(b.left,a.plotLeft+c),c=/%$/;c.test(f)&&(f=parseFloat(f)/100*a.plotHeight);c.test(g)&&(g=parseFloat(g)/100*a.plotHeight+a.plotTop);this.left=b;this.top=g;this.width=e;this.height=f;this.bottom=a.chartHeight-f-g;this.right=a.chartWidth-e-b;this.len=t(d?e:f,0);this.pos=d?b:g},getExtremes:function(){var a=this.isLog;return{min:a?da(ha(this.min)):this.min,max:a?da(ha(this.max)):this.max,dataMin:this.dataMin, +dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},getThreshold:function(a){var b=this.isLog,c=b?ha(this.min):this.min,b=b?ha(this.max):this.max;c>a||a===null?a=c:b15&&a<165?"right":a>195&&a<345?"left":"center"},unsquish:function(){var a=this.ticks,b=this.options.labels,c=this.horiz,d=this.tickInterval,e=d,f=this.len/(((this.categories?1:0)+this.max-this.min)/d),g,h=b.rotation, +i=this.chart.renderer.fontMetrics(b.style.fontSize,a[0]&&a[0].label),j,k=Number.MAX_VALUE,l,n=function(a){a/=f||1;a=a>1?sa(a):1;return a*d};c?(l=s(h)?[h]:f=-90&&a<=90)j=n(O(i.h/$(ga*a))),b=j+O(a/360),bl)l=a.labelLength}),l>i&&l>g.h?j.rotation=this.labelRotation:this.labelRotation=0;else if(h){k={width:i+"px",textOverflow:"clip"};for(h=c.length;!f&& +h--;)if(i=c[h],i=d[i].label)if(i.styles.textOverflow==="ellipsis"&&i.css({textOverflow:"clip"}),i.getBBox().height>this.len/c.length-(g.h-g.f))i.specCss={textOverflow:"ellipsis"}}j.rotation&&(k={width:(l>a.chartHeight*0.5?a.chartHeight*0.33:a.chartHeight)+"px",textOverflow:"ellipsis"});this.labelAlign=j.align=e.align||this.autoLabelAlign(this.labelRotation);m(c,function(a){var b=(a=d[a])&&a.label;if(b)k&&b.css(z(k,b.specCss)),delete b.specCss,b.attr(j),a.rotation=j.rotation});this.tickRotCorr=b.rotCorr(g.b, +this.labelRotation||0,this.side===2)},getOffset:function(){var a=this,b=a.chart,c=b.renderer,d=a.options,e=a.tickPositions,f=a.ticks,g=a.horiz,h=a.side,i=b.inverted?[1,0,3,2][h]:h,j,k,l=0,n,o=0,q=d.title,y=d.labels,S=0,C=b.axisOffset,b=b.clipOffset,v=[-1,1,1,-1][h],r;a.hasData=j=a.hasVisibleSeries||s(a.min)&&s(a.max)&&!!e;a.showAxis=k=j||p(d.showEmpty,!0);a.staggerLines=a.horiz&&y.staggerLines;if(!a.axisGroup)a.gridGroup=c.g("grid").attr({zIndex:d.gridZIndex||1}).add(),a.axisGroup=c.g("axis").attr({zIndex:d.zIndex|| +2}).add(),a.labelGroup=c.g("axis-labels").attr({zIndex:y.zIndex||7}).addClass("highcharts-"+a.coll.toLowerCase()+"-labels").add();if(j||a.isLinked){if(m(e,function(b){f[b]?f[b].addLabel():f[b]=new Ta(a,b)}),a.renderUnsquish(),m(e,function(b){if(h===0||h===2||{1:"left",3:"right"}[h]===a.labelAlign)S=t(f[b].getLabelSize(),S)}),a.staggerLines)S*=a.staggerLines,a.labelOffset=S}else for(r in f)f[r].destroy(),delete f[r];if(q&&q.text&&q.enabled!==!1){if(!a.axisTitle)a.axisTitle=c.text(q.text,0,0,q.useHTML).attr({zIndex:7, +rotation:q.rotation||0,align:q.textAlign||{low:"left",middle:"center",high:"right"}[q.align]}).addClass("highcharts-"+this.coll.toLowerCase()+"-title").css(q.style).add(a.axisGroup),a.axisTitle.isNew=!0;if(k)l=a.axisTitle.getBBox()[g?"height":"width"],n=q.offset,o=s(n)?0:p(q.margin,g?5:10);a.axisTitle[k?"show":"hide"]()}a.offset=v*p(d.offset,C[h]);a.tickRotCorr=a.tickRotCorr||{x:0,y:0};c=h===2?a.tickRotCorr.y:0;g=S+o+(S&&v*(g?p(y.y,a.tickRotCorr.y+8):y.x)-c);a.axisTitleMargin=p(n,g);C[h]=t(C[h],a.axisTitleMargin+ +l+v*a.offset,g);b[i]=t(b[i],U(d.lineWidth/2)*2)},getLinePath:function(a){var b=this.chart,c=this.opposite,d=this.offset,e=this.horiz,f=this.left+(c?this.width:0)+d,d=b.chartHeight-this.bottom-(c?this.height:0)+d;c&&(a*=-1);return b.renderer.crispLine(["M",e?this.left:f,e?d:this.top,"L",e?b.chartWidth-this.right:f,e?d:b.chartHeight-this.bottom],a)},getTitlePosition:function(){var a=this.horiz,b=this.left,c=this.top,d=this.len,e=this.options.title,f=a?b:c,g=this.opposite,h=this.offset,i=B(e.style.fontSize|| +12),d={low:f+(a?0:d),middle:f+d/2,high:f+(a?d:0)}[e.align],b=(a?c+this.height:b)+(a?1:-1)*(g?-1:1)*this.axisTitleMargin+(this.side===2?i:0);return{x:a?d:b+(g?this.width:0)+h+(e.x||0),y:a?b-(g?this.height:0)+h:d+(e.y||0)}},render:function(){var a=this,b=a.chart,c=b.renderer,d=a.options,e=a.isLog,f=a.isLinked,g=a.tickPositions,h=a.axisTitle,i=a.ticks,j=a.minorTicks,k=a.alternateBands,l=d.stackLabels,n=d.alternateGridColor,o=a.tickmarkOffset,q=d.lineWidth,y,p=b.hasRendered&&s(a.oldMin)&&!isNaN(a.oldMin); +y=a.hasData;var C=a.showAxis,v,r;a.labelEdge.length=0;a.overlap=!1;m([i,j,k],function(a){for(var b in a)a[b].isActive=!1});if(y||f){a.minorTickInterval&&!a.categories&&m(a.getMinorTickPositions(),function(b){j[b]||(j[b]=new Ta(a,b,"minor"));p&&j[b].isNew&&j[b].render(null,!0);j[b].render(null,!1,1)});if(g.length&&(m(g,function(b,c){if(!f||b>=a.min&&b<=a.max)i[b]||(i[b]=new Ta(a,b)),p&&i[b].isNew&&i[b].render(c,!0,0.1),i[b].render(c)}),o&&(a.min===0||a.single)))i[-1]||(i[-1]=new Ta(a,-1,null,!0)), +i[-1].render(-1);n&&m(g,function(b,c){if(c%2===0&&b=G.second?0:k*U(i.getMilliseconds()/k));if(j>=G.second)i[Eb](j>=G.minute?0:k*U(i.getSeconds()/k));if(j>=G.minute)i[Fb](j>=G.hour?0:k*U(i[rb]()/k));if(j>=G.hour)i[Gb](j>=G.day?0:k*U(i[sb]()/k));if(j>=G.day)i[ub](j>=G.month?1:k*U(i[Xa]()/k));j>=G.month&&(i[vb](j>=G.year?0:k*U(i[Ya]()/k)),h=i[Za]());j>=G.year&&(h-=h%k,i[wb](h));if(j===G.week)i[ub](i[Xa]()-i[tb]()+p(d,1));b=1;if(nb||eb)i=i.getTime(),i=new Aa(i+ +Wa(i));h=i[Za]();for(var d=i.getTime(),l=i[Ya](),n=i[Xa](),o=(G.day+(g?Wa(i):i.getTimezoneOffset()*6E4))%G.day;d=0.5)a=x(a),g=this.getLinearTickPositions(a,b,c);else if(a>=0.08)for(var f=U(b),h,i,j,k,l,e=a>0.3?[1,2,4]:a>0.15?[1,2,4,6,8]:[1,2,3,4,5,6,7,8,9];fb&&(!d||k<=c)&&k!==u&&g.push(k),k>c&&(l=!0),k=j}else if(b=ha(b),c=ha(c),a=e[d?"minorTickInterval":"tickInterval"],a=p(a==="auto"?null:a,this._minorAutoInterval,(c-b)*(e.tickPixelInterval/(d?5:1))/((d?f/this.tickPositions.length:f)||1)),a=pb(a,null,ob(a)),g=Ua(this.getLinearTickPositions(a, +b,c),Ea),!d)this._minorAutoInterval=a/5;if(!d)this.tickInterval=a;return g};var Mb=w.Tooltip=function(){this.init.apply(this,arguments)};Mb.prototype={init:function(a,b){var c=b.borderWidth,d=b.style,e=B(d.padding);this.chart=a;this.options=b;this.crosshairs=[];this.now={x:0,y:0};this.isHidden=!0;this.label=a.renderer.label("",0,0,b.shape||"callout",null,null,b.useHTML,null,"tooltip").attr({padding:e,fill:b.backgroundColor,"stroke-width":c,r:b.borderRadius,zIndex:8}).css(d).css({padding:0}).add().attr({y:-9999}); +ea||this.label.shadow(b.shadow);this.shared=b.shared},destroy:function(){if(this.label)this.label=this.label.destroy();clearTimeout(this.hideTimer);clearTimeout(this.tooltipTimeout)},move:function(a,b,c,d){var e=this,f=e.now,g=e.options.animation!==!1&&!e.isHidden&&(O(a-f.x)>1||O(b-f.y)>1),h=e.followPointer||e.len>1;r(f,{x:g?(2*f.x+a)/3:a,y:g?(f.y+b)/2:b,anchorX:h?u:g?(2*f.anchorX+c)/3:c,anchorY:h?u:g?(f.anchorY+d)/2:d});e.label.attr(f);if(g)clearTimeout(this.tooltipTimeout),this.tooltipTimeout=setTimeout(function(){e&& +e.move(a,b,c,d)},32)},hide:function(a){var b=this,c;clearTimeout(this.hideTimer);if(!this.isHidden)c=this.chart.hoverPoints,this.hideTimer=setTimeout(function(){b.label.fadeOut();b.isHidden=!0},p(a,this.options.hideDelay,500)),c&&m(c,function(a){a.setState()}),this.chart.hoverPoints=null,this.chart.hoverSeries=null},getAnchor:function(a,b){var c,d=this.chart,e=d.inverted,f=d.plotTop,g=d.plotLeft,h=0,i=0,j,k,a=ra(a);c=a[0].tooltipPos;this.followPointer&&b&&(b.chartX===u&&(b=d.pointer.normalize(b)), +c=[b.chartX-d.plotLeft,b.chartY-f]);c||(m(a,function(a){j=a.series.yAxis;k=a.series.xAxis;h+=a.plotX+(!e&&k?k.left-g:0);i+=(a.plotLow?(a.plotLow+a.plotHigh)/2:a.plotY)+(!e&&j?j.top-f:0)}),h/=a.length,i/=a.length,c=[e?d.plotWidth-i:h,this.shared&&!e&&a.length>1&&b?b.chartY-f:e?d.plotHeight-h:i]);return Ua(c,x)},getPosition:function(a,b,c){var d=this.chart,e=this.distance,f={},g=c.h,h,i=["y",d.chartHeight,b,c.plotY+d.plotTop],j=["x",d.chartWidth,a,c.plotX+d.plotLeft],k=p(c.ttBelow,d.inverted&&!c.negative|| +!d.inverted&&c.negative),l=function(a,b,c,d){var h=cb?d:d+g;else return!1},n=function(a,b,c,d){if(db-e)return!1;else f[a]=db-c/2?b-c-2:d-c/2},o=function(a){var b=i;i=j;j=b;h=a},q=function(){l.apply(0,i)!==!1?n.apply(0,j)===!1&&!h&&(o(!0),q()):h?f.x=f.y=0:(o(!0),q())};(d.inverted||this.len>1)&&o();q();return f},defaultFormatter:function(a){var b=this.points||ra(this),c;c=[a.tooltipFooterHeaderFormatter(b[0])]; +c=c.concat(a.bodyFormatter(b));c.push(a.tooltipFooterHeaderFormatter(b[0],!0));return c.join("")},refresh:function(a,b){var c=this.chart,d=this.label,e=this.options,f,g,h={},i,j=[];i=e.formatter||this.defaultFormatter;var h=c.hoverPoints,k,l=this.shared;clearTimeout(this.hideTimer);this.followPointer=ra(a)[0].series.tooltipOptions.followPointer;g=this.getAnchor(a,b);f=g[0];g=g[1];l&&(!a.series||!a.series.noSharedTooltip)?(c.hoverPoints=a,h&&m(h,function(a){a.setState()}),m(a,function(a){a.setState("hover"); +j.push(a.getLabelConfig())}),h={x:a[0].category,y:a[0].y},h.points=j,this.len=j.length,a=a[0]):h=a.getLabelConfig();i=i.call(h,this);h=a.series;this.distance=p(h.tooltipOptions.distance,16);i===!1?this.hide():(this.isHidden&&(db(d),d.attr("opacity",1).show()),d.attr({text:i}),k=e.borderColor||a.color||h.color||"#606060",d.attr({stroke:k}),this.updatePosition({plotX:f,plotY:g,negative:a.negative,ttBelow:a.ttBelow,h:a.shapeArgs&&a.shapeArgs.height||0}),this.isHidden=!1);M(c,"tooltipRefresh",{text:i, +x:f+c.plotLeft,y:g+c.plotTop,borderColor:k})},updatePosition:function(a){var b=this.chart,c=this.label,c=(this.options.positioner||this.getPosition).call(this,c.width,c.height,a);this.move(x(c.x),x(c.y),a.plotX+b.plotLeft,a.plotY+b.plotTop)},getXDateFormat:function(a,b,c){var d,b=b.dateTimeLabelFormats,e=c&&c.closestPointRange,f,g={millisecond:15,second:12,minute:9,hour:6,day:3},h,i;if(e){h=Oa("%m-%d %H:%M:%S.%L",a.x);for(f in G){if(e===G.week&&+Oa("%w",a.x)===c.options.startOfWeek&&h.substr(6)=== +"00:00:00.000"){f="week";break}else if(G[f]>e){f=i;break}else if(g[f]&&h.substr(g[f])!=="01-01 00:00:00.000".substr(g[f]))break;f!=="week"&&(i=f)}f&&(d=b[f])}else d=b.day;return d||b.year},tooltipFooterHeaderFormatter:function(a,b){var c=b?"footer":"header",d=a.series,e=d.tooltipOptions,f=e.xDateFormat,g=d.xAxis,h=g&&g.options.type==="datetime"&&qa(a.key),c=e[c+"Format"];h&&!f&&(f=this.getXDateFormat(a,e,g));h&&f&&(c=c.replace("{point.key}","{point.key:"+f+"}"));return Ja(c,{point:a,series:d})},bodyFormatter:function(a){return Ua(a, +function(a){var c=a.series.tooltipOptions;return(c.pointFormatter||a.point.tooltipFormatter).call(a.point,c.pointFormat)})}};var oa;ab=A.documentElement.ontouchstart!==u;var Va=w.Pointer=function(a,b){this.init(a,b)};Va.prototype={init:function(a,b){var c=b.chart,d=c.events,e=ea?"":c.zoomType,c=a.inverted,f;this.options=b;this.chart=a;this.zoomX=f=/x/.test(e);this.zoomY=e=/y/.test(e);this.zoomHor=f&&!c||e&&c;this.zoomVert=e&&!c||f&&c;this.hasZoom=f||e;this.runChartClick=d&&!!d.click;this.pinchDown= +[];this.lastValidTouch={};if(w.Tooltip&&b.tooltip.enabled)a.tooltip=new Mb(a,b.tooltip),this.followTouchMove=p(b.tooltip.followTouchMove,!0);this.setDOMEvents()},normalize:function(a,b){var c,d,a=a||window.event,a=Sb(a);if(!a.target)a.target=a.srcElement;d=a.touches?a.touches.length?a.touches.item(0):a.changedTouches[0]:a;if(!b)this.chartPosition=b=Rb(this.chart.container);d.pageX===u?(c=t(a.x,a.clientX-b.left),d=a.y):(c=d.pageX-b.left,d=d.pageY-b.top);return r(a,{chartX:x(c),chartY:x(d)})},getCoordinates:function(a){var b= +{xAxis:[],yAxis:[]};m(this.chart.axes,function(c){b[c.isXAxis?"xAxis":"yAxis"].push({axis:c,value:c.toValue(a[c.horiz?"chartX":"chartY"])})});return b},runPointActions:function(a){var b=this.chart,c=b.series,d=b.tooltip,e=d?d.shared:!1,f=b.hoverPoint,g=b.hoverSeries,h,i=b.chartWidth,j=b.chartWidth,k,l=[],n,o;if(!e&&!g)for(h=0;h1)&&a.dist.distRh+j&&(d=h+j);ei+k&&(e=i+k);this.hasDragged=Math.sqrt(Math.pow(n-d,2)+Math.pow(o-e,2));if(this.hasDragged>10){l=b.isInsidePlot(n-h,o-i);if(b.hasCartesianSeries&&(this.zoomX||this.zoomY)&&l&&!q&&!this.selectionMarker)this.selectionMarker=b.renderer.rect(h,i,f?1:j,g?1:k,0).attr({fill:c.selectionMarkerFill||"rgba(69,114,167,0.25)",zIndex:7}).add();this.selectionMarker&&f&&(d-=n,this.selectionMarker.attr({width:O(d),x:(d>0?0:d)+n}));this.selectionMarker&& +g&&(d=e-o,this.selectionMarker.attr({height:O(d),y:(d>0?0:d)+o}));l&&!this.selectionMarker&&c.panning&&b.pan(a,c.panning)}},drop:function(a){var b=this,c=this.chart,d=this.hasPinched;if(this.selectionMarker){var e={xAxis:[],yAxis:[],originalEvent:a.originalEvent||a},f=this.selectionMarker,g=f.attr?f.attr("x"):f.x,h=f.attr?f.attr("y"):f.y,i=f.attr?f.attr("width"):f.width,j=f.attr?f.attr("height"):f.height,k;if(this.hasDragged||d)m(c.axes,function(c){if(c.zoomEnabled&&s(c.min)&&(d||b[{xAxis:"zoomX", +yAxis:"zoomY"}[c.coll]])){var f=c.horiz,o=a.type==="touchend"?c.minPixelPadding:0,q=c.toValue((f?g:h)+o),f=c.toValue((f?g+i:h+j)-o);e[c.coll].push({axis:c,min:I(q,f),max:t(q,f)});k=!0}}),k&&M(c,"selection",e,function(a){c.zoom(r(a,d?{animation:!1}:null))});this.selectionMarker=this.selectionMarker.destroy();d&&this.scaleGroups()}if(c)F(c.container,{cursor:c._cursor}),c.cancelClick=this.hasDragged>10,c.mouseIsDown=this.hasDragged=this.hasPinched=!1,this.pinchDown=[]},onContainerMouseDown:function(a){a= +this.normalize(a);a.preventDefault&&a.preventDefault();this.dragStart(a)},onDocumentMouseUp:function(a){X[oa]&&X[oa].pointer.drop(a)},onDocumentMouseMove:function(a){var b=this.chart,c=this.chartPosition,a=this.normalize(a,c);c&&!this.inClass(a.target,"highcharts-tracker")&&!b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)&&this.reset()},onContainerMouseLeave:function(){var a=X[oa];if(a)a.pointer.reset(),a.pointer.chartPosition=null},onContainerMouseMove:function(a){var b=this.chart;oa=b.index; +a=this.normalize(a);a.returnValue=!1;b.mouseIsDown==="mousedown"&&this.drag(a);(this.inClass(a.target,"highcharts-tracker")||b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop))&&!b.openMenu&&this.runPointActions(a)},inClass:function(a,b){for(var c;a;){if(c=L(a,"class"))if(c.indexOf(b)!==-1)return!0;else if(c.indexOf("highcharts-container")!==-1)return!1;a=a.parentNode}},onTrackerMouseOut:function(a){var b=this.chart.hoverSeries,c=(a=a.relatedTarget||a.toElement)&&a.point&&a.point.series;if(b&& +!b.options.stickyTracking&&!this.inClass(a,"highcharts-tooltip")&&c!==b)b.onMouseOut()},onContainerClick:function(a){var b=this.chart,c=b.hoverPoint,d=b.plotLeft,e=b.plotTop,a=this.normalize(a);a.originalEvent=a;a.cancelBubble=!0;b.cancelClick||(c&&this.inClass(a.target,"highcharts-tracker")?(M(c.series,"click",r(a,{point:c})),b.hoverPoint&&c.firePointEvent("click",a)):(r(a,this.getCoordinates(a)),b.isInsidePlot(a.chartX-d,a.chartY-e)&&M(b,"click",a)))},setDOMEvents:function(){var a=this,b=a.chart.container; +b.onmousedown=function(b){a.onContainerMouseDown(b)};b.onmousemove=function(b){a.onContainerMouseMove(b)};b.onclick=function(b){a.onContainerClick(b)};N(b,"mouseleave",a.onContainerMouseLeave);bb===1&&N(A,"mouseup",a.onDocumentMouseUp);if(ab)b.ontouchstart=function(b){a.onContainerTouchStart(b)},b.ontouchmove=function(b){a.onContainerTouchMove(b)},bb===1&&N(A,"touchend",a.onDocumentTouchEnd)},destroy:function(){var a;Y(this.chart.container,"mouseleave",this.onContainerMouseLeave);bb||(Y(A,"mouseup", +this.onDocumentMouseUp),Y(A,"touchend",this.onDocumentTouchEnd));clearInterval(this.tooltipTimeout);for(a in this)this[a]=null}};r(w.Pointer.prototype,{pinchTranslate:function(a,b,c,d,e,f){(this.zoomHor||this.pinchHor)&&this.pinchTranslateDirection(!0,a,b,c,d,e,f);(this.zoomVert||this.pinchVert)&&this.pinchTranslateDirection(!1,a,b,c,d,e,f)},pinchTranslateDirection:function(a,b,c,d,e,f,g,h){var i=this.chart,j=a?"x":"y",k=a?"X":"Y",l="chart"+k,n=a?"width":"height",o=i["plot"+(a?"Left":"Top")],q,p, +m=h||1,C=i.inverted,v=i.bounds[a?"h":"v"],s=b.length===1,r=b[0][l],t=c[0][l],u=!s&&b[1][l],x=!s&&c[1][l],w,c=function(){!s&&O(r-u)>20&&(m=h||O(t-x)/O(r-u));p=(o-t)/m+r;q=i["plot"+(a?"Width":"Height")]/m};c();b=p;bv.max&&(b=v.max-q,w=!0);w?(t-=0.8*(t-g[j][0]),s||(x-=0.8*(x-g[j][1])),c()):g[j]=[t,x];C||(f[j]=p-o,f[n]=q);f=C?1/m:m;e[n]=q;e[j]=b;d[C?a?"scaleY":"scaleX":"scale"+k]=m;d["translate"+k]=f*o+(t-f*r)},pinch:function(a){var b=this,c=b.chart,d=b.pinchDown,e=a.touches, +f=e.length,g=b.lastValidTouch,h=b.hasZoom,i=b.selectionMarker,j={},k=f===1&&(b.inClass(a.target,"highcharts-tracker")&&c.runTrackerClick||b.runChartClick),l={};h&&!k&&a.preventDefault();Ua(e,function(a){return b.normalize(a)});if(a.type==="touchstart")m(e,function(a,b){d[b]={chartX:a.chartX,chartY:a.chartY}}),g.x=[d[0].chartX,d[1]&&d[1].chartX],g.y=[d[0].chartY,d[1]&&d[1].chartY],m(c.axes,function(a){if(a.zoomEnabled){var b=c.bounds[a.horiz?"h":"v"],d=a.minPixelPadding,e=a.toPixels(p(a.options.min, +a.dataMin)),f=a.toPixels(p(a.options.max,a.dataMax)),g=I(e,f),e=t(e,f);b.min=I(a.pos,g-d);b.max=t(a.pos+a.len,e+d)}}),b.res=!0;else if(d.length){if(!i)b.selectionMarker=i=r({destroy:ma},c.plotBox);b.pinchTranslate(d,e,j,i,l,g);b.hasPinched=h;b.scaleGroups(j,l);if(!h&&b.followTouchMove&&f===1)this.runPointActions(b.normalize(a));else if(b.res)b.res=!1,this.reset(!1,0)}},onContainerTouchStart:function(a){var b=this.chart;oa=b.index;a.touches.length===1?(a=this.normalize(a),b.isInsidePlot(a.chartX-b.plotLeft, +a.chartY-b.plotTop)&&!b.openMenu?(this.runPointActions(a),this.pinch(a)):this.reset()):a.touches.length===2&&this.pinch(a)},onContainerTouchMove:function(a){(a.touches.length===1||a.touches.length===2)&&this.pinch(a)},onDocumentTouchEnd:function(a){X[oa]&&X[oa].pointer.drop(a)}});if(H.PointerEvent||H.MSPointerEvent){var wa={},Ab=!!H.PointerEvent,Wb=function(){var a,b=[];b.item=function(a){return this[a]};for(a in wa)wa.hasOwnProperty(a)&&b.push({pageX:wa[a].pageX,pageY:wa[a].pageY,target:wa[a].target}); +return b},Bb=function(a,b,c,d){a=a.originalEvent||a;if((a.pointerType==="touch"||a.pointerType===a.MSPOINTER_TYPE_TOUCH)&&X[oa])d(a),d=X[oa].pointer,d[b]({type:c,target:a.currentTarget,preventDefault:ma,touches:Wb()})};r(Va.prototype,{onContainerPointerDown:function(a){Bb(a,"onContainerTouchStart","touchstart",function(a){wa[a.pointerId]={pageX:a.pageX,pageY:a.pageY,target:a.currentTarget}})},onContainerPointerMove:function(a){Bb(a,"onContainerTouchMove","touchmove",function(a){wa[a.pointerId]={pageX:a.pageX, +pageY:a.pageY};if(!wa[a.pointerId].target)wa[a.pointerId].target=a.currentTarget})},onDocumentPointerUp:function(a){Bb(a,"onDocumentTouchEnd","touchend",function(a){delete wa[a.pointerId]})},batchMSEvents:function(a){a(this.chart.container,Ab?"pointerdown":"MSPointerDown",this.onContainerPointerDown);a(this.chart.container,Ab?"pointermove":"MSPointerMove",this.onContainerPointerMove);a(A,Ab?"pointerup":"MSPointerUp",this.onDocumentPointerUp)}});cb(Va.prototype,"init",function(a,b,c){a.call(this,b, +c);this.hasZoom&&F(b.container,{"-ms-touch-action":R,"touch-action":R})});cb(Va.prototype,"setDOMEvents",function(a){a.apply(this);(this.hasZoom||this.followTouchMove)&&this.batchMSEvents(N)});cb(Va.prototype,"destroy",function(a){this.batchMSEvents(Y);a.call(this)})}var mb=w.Legend=function(a,b){this.init(a,b)};mb.prototype={init:function(a,b){var c=this,d=b.itemStyle,e=b.itemMarginTop||0;this.options=b;if(b.enabled)c.itemStyle=d,c.itemHiddenStyle=z(d,b.itemHiddenStyle),c.itemMarginTop=e,c.padding= +d=p(b.padding,8),c.initialItemX=d,c.initialItemY=d-5,c.maxItemWidth=0,c.chart=a,c.itemHeight=0,c.symbolWidth=p(b.symbolWidth,16),c.pages=[],c.render(),N(c.chart,"endResize",function(){c.positionCheckboxes()})},colorizeItem:function(a,b){var c=this.options,d=a.legendItem,e=a.legendLine,f=a.legendSymbol,g=this.itemHiddenStyle.color,c=b?c.itemStyle.color:g,h=b?a.legendColor||a.color||"#CCC":g,g=a.options&&a.options.marker,i={fill:h},j;d&&d.css({fill:c,color:c});e&&e.attr({stroke:h});if(f){if(g&&f.isMarker)for(j in i.stroke= +h,g=a.convertAttribs(g),g)d=g[j],d!==u&&(i[j]=d);f.attr(i)}},positionItem:function(a){var b=this.options,c=b.symbolPadding,b=!b.rtl,d=a._legendItemPos,e=d[0],d=d[1],f=a.checkbox;a.legendGroup&&a.legendGroup.translate(b?e:this.legendWidth-e-2*c-4,d);if(f)f.x=e,f.y=d},destroyItem:function(a){var b=a.checkbox;m(["legendItem","legendLine","legendSymbol","legendGroup"],function(b){a[b]&&(a[b]=a[b].destroy())});b&&Ra(a.checkbox)},clearItems:function(){var a=this;m(a.getAllItems(),function(b){a.destroyItem(b)})}, +destroy:function(){var a=this.group,b=this.box;if(b)this.box=b.destroy();if(a)this.group=a.destroy()},positionCheckboxes:function(a){var b=this.group.alignAttr,c,d=this.clipHeight||this.legendHeight;if(b)c=b.translateY,m(this.allItems,function(e){var f=e.checkbox,g;f&&(g=c+f.y+(a||0)+3,F(f,{left:b.translateX+e.checkboxOffset+f.x-20+"px",top:g+"px",display:g>c-6&&g(n||b.chartWidth-2*j-y-d.x))this.itemX=y,this.itemY+=q+this.lastLineHeight+o,this.lastLineHeight=0;this.maxItemWidth=t(this.maxItemWidth,f);this.lastItemY=q+this.itemY+o;this.lastLineHeight= +t(g,this.lastLineHeight);a._legendItemPos=[this.itemX,this.itemY];e?this.itemX+=f:(this.itemY+=q+g+o,this.lastLineHeight=g);this.offsetWidth=n||t((e?this.itemX-y-k:f)+j,this.offsetWidth)},getAllItems:function(){var a=[];m(this.chart.series,function(b){var c=b.options;if(p(c.showInLegend,!s(c.linkedTo)?u:!1,!0))a=a.concat(b.legendItems||(c.legendType==="point"?b.data:b))});return a},adjustMargins:function(a,b){var c=this.chart,d=this.options,e=d.align[0]+d.verticalAlign[0]+d.layout[0];this.display&& +!d.floating&&m([/(lth|ct|rth)/,/(rtv|rm|rbv)/,/(rbh|cb|lbh)/,/(lbv|lm|ltv)/],function(f,g){f.test(e)&&!s(a[g])&&(c[ib[g]]=t(c[ib[g]],c.legend[(g+1)%2?"legendHeight":"legendWidth"]+[1,-1,-1,1][g]*d[g%2?"x":"y"]+p(d.margin,12)+b[g]))})},render:function(){var a=this,b=a.chart,c=b.renderer,d=a.group,e,f,g,h,i=a.box,j=a.options,k=a.padding,l=j.borderWidth,n=j.backgroundColor;a.itemX=a.initialItemX;a.itemY=a.initialItemY;a.offsetWidth=0;a.lastItemY=0;if(!d)a.group=d=c.g("legend").attr({zIndex:7}).add(), +a.contentGroup=c.g().attr({zIndex:1}).add(d),a.scrollGroup=c.g().add(a.contentGroup);a.renderTitle();e=a.getAllItems();qb(e,function(a,b){return(a.options&&a.options.legendIndex||0)-(b.options&&b.options.legendIndex||0)});j.reversed&&e.reverse();a.allItems=e;a.display=f=!!e.length;a.lastLineHeight=0;m(e,function(b){a.renderItem(b)});g=(j.width||a.offsetWidth)+k;h=a.lastItemY+a.lastLineHeight+a.titleHeight;h=a.handleOverflow(h);h+=k;if(l||n){if(i){if(g>0&&h>0)i[i.isNew?"attr":"animate"](i.crisp({width:g, +height:h})),i.isNew=!1}else a.box=i=c.rect(0,0,g,h,j.borderRadius,l||0).attr({stroke:j.borderColor,"stroke-width":l||0,fill:n||R}).add(d).shadow(j.shadow),i.isNew=!0;i[f?"show":"hide"]()}a.legendWidth=g;a.legendHeight=h;m(e,function(b){a.positionItem(b)});f&&d.align(r({width:g,height:h},j),!0,"spacingBox");b.isResizing||this.positionCheckboxes()},handleOverflow:function(a){var b=this,c=this.chart,d=c.renderer,e=this.options,f=e.y,f=c.spacingBox.height+(e.verticalAlign==="top"?-f:f)-this.padding,g= +e.maxHeight,h,i=this.clipRect,j=e.navigation,k=p(j.animation,!0),l=j.arrowSize||12,n=this.nav,o=this.pages,q,y=this.allItems;e.layout==="horizontal"&&(f/=2);g&&(f=I(f,g));o.length=0;if(a>f&&!e.useHTML){this.clipHeight=h=t(f-20-this.titleHeight-this.padding,0);this.currentPage=p(this.currentPage,1);this.fullHeight=a;m(y,function(a,b){var c=a._legendItemPos[1],d=x(a.legendItem.getBBox().height),e=o.length;if(!e||c-o[e-1]>h&&(q||c)!==o[e-1])o.push(q||c),e++;b===y.length-1&&c+d-o[e-1]>h&&o.push(c);c!== +q&&(q=c)});if(!i)i=b.clipRect=d.clipRect(0,this.padding,9999,0),b.contentGroup.clip(i);i.attr({height:h});if(!n)this.nav=n=d.g().attr({zIndex:1}).add(this.group),this.up=d.symbol("triangle",0,0,l,l).on("click",function(){b.scroll(-1,k)}).add(n),this.pager=d.text("",15,10).css(j.style).add(n),this.down=d.symbol("triangle-down",0,0,l,l).on("click",function(){b.scroll(1,k)}).add(n);b.scroll(0);a=f}else if(n)i.attr({height:c.chartHeight}),n.hide(),this.scrollGroup.attr({translateY:1}),this.clipHeight= +0;return a},scroll:function(a,b){var c=this.pages,d=c.length,e=this.currentPage+a,f=this.clipHeight,g=this.options.navigation,h=g.activeColor,g=g.inactiveColor,i=this.pager,j=this.padding;e>d&&(e=d);if(e>0)b!==u&&Sa(b,this.chart),this.nav.attr({translateX:j,translateY:f+this.padding+7+this.titleHeight,visibility:"visible"}),this.up.attr({fill:e===1?g:h}).css({cursor:e===1?"default":"pointer"}),i.attr({text:e+"/"+d}),this.down.attr({x:18+this.pager.getBBox().width,fill:e===d?g:h}).css({cursor:e=== +d?"default":"pointer"}),c=-c[e-1]+this.initialItemY,this.scrollGroup.animate({translateY:c}),this.currentPage=e,this.positionCheckboxes(c)}};Na=w.LegendSymbolMixin={drawRectangle:function(a,b){var c=a.options.symbolHeight||a.fontMetrics.f;b.legendSymbol=this.chart.renderer.rect(0,a.baseline-c+1,a.symbolWidth,c,a.options.symbolRadius||0).attr({zIndex:3}).add(b.legendGroup)},drawLineMarker:function(a){var b=this.options,c=b.marker,d;d=a.symbolWidth;var e=this.chart.renderer,f=this.legendGroup,a=a.baseline- +x(a.fontMetrics.b*0.3),g;if(b.lineWidth){g={"stroke-width":b.lineWidth};if(b.dashStyle)g.dashstyle=b.dashStyle;this.legendLine=e.path(["M",0,a,"L",d,a]).attr(g).add(f)}if(c&&c.enabled!==!1)b=c.radius,this.legendSymbol=d=e.symbol(this.symbol,d/2-b,a-b,2*b,2*b).add(f),d.isMarker=!0}};(/Trident\/7\.0/.test(Ba)||La)&&cb(mb.prototype,"positionItem",function(a,b){var c=this,d=function(){b._legendItemPos&&a.call(c,b)};d();setTimeout(d)});D=w.Chart=function(){this.init.apply(this,arguments)};D.prototype= +{callbacks:[],init:function(a,b){var c,d=a.series;a.series=null;c=z(P,a);c.series=a.series=d;this.userOptions=a;d=c.chart;this.margin=this.splashArray("margin",d);this.spacing=this.splashArray("spacing",d);var e=d.events;this.bounds={h:{},v:{}};this.callback=b;this.isResizing=0;this.options=c;this.axes=[];this.series=[];this.hasCartesianSeries=d.showAxes;var f=this,g;f.index=X.length;X.push(f);bb++;d.reflow!==!1&&N(f,"load",function(){f.initReflow()});if(e)for(g in e)N(f,g,e[g]);f.xAxis=[];f.yAxis= +[];f.animation=ea?!1:p(d.animation,!0);f.pointCount=f.colorCounter=f.symbolCounter=0;f.firstRender()},initSeries:function(a){var b=this.options.chart;(b=J[a.type||b.type||b.defaultSeriesType])||ka(17,!0);b=new b;b.init(this,a);return b},isInsidePlot:function(a,b,c){var d=c?b:a,a=c?a:b;return d>=0&&d<=this.plotWidth&&a>=0&&a<=this.plotHeight},redraw:function(a){var b=this.axes,c=this.series,d=this.pointer,e=this.legend,f=this.isDirtyLegend,g,h,i=this.hasCartesianSeries,j=this.isDirtyBox,k=c.length, +l=k,n=this.renderer,o=n.isHidden(),q=[];Sa(a,this);o&&this.cloneRenderTo();for(this.layOutTitles();l--;)if(a=c[l],a.options.stacking&&(g=!0,a.isDirty)){h=!0;break}if(h)for(l=k;l--;)if(a=c[l],a.options.stacking)a.isDirty=!0;m(c,function(a){a.isDirty&&a.options.legendType==="point"&&(f=!0)});if(f&&e.options.enabled)e.render(),this.isDirtyLegend=!1;g&&this.getStacks();if(i&&!this.isResizing)this.maxTicks=null,m(b,function(a){a.setScale()});this.getMargins();i&&(m(b,function(a){a.isDirty&&(j=!0)}),m(b, +function(a){if(a.isDirtyExtremes)a.isDirtyExtremes=!1,q.push(function(){M(a,"afterSetExtremes",r(a.eventArgs,a.getExtremes()));delete a.eventArgs});(j||g)&&a.redraw()}));j&&this.drawChartBox();m(c,function(a){a.isDirty&&a.visible&&(!a.isCartesian||a.xAxis)&&a.redraw()});d&&d.reset(!0);n.draw();M(this,"redraw");o&&this.cloneRenderTo(!0);m(q,function(a){a.call()})},get:function(a){var b=this.axes,c=this.series,d,e;for(d=0;d19?this.containerHeight:400))},cloneRenderTo:function(a){var b=this.renderToClone,c=this.container;a?b&&(this.renderTo.appendChild(c),Ra(b),delete this.renderToClone):(c&&c.parentNode===this.renderTo&&this.renderTo.removeChild(c),this.renderToClone=b=this.renderTo.cloneNode(0),F(b,{position:"absolute",top:"-9999px",display:"block"}),b.style.setProperty&&b.style.setProperty("display","block","important"),A.body.appendChild(b),c&&b.appendChild(c))}, +getContainer:function(){var a,b=this.options.chart,c,d,e;this.renderTo=a=b.renderTo;e="highcharts-"+yb++;if(Da(a))this.renderTo=a=A.getElementById(a);a||ka(13,!0);c=B(L(a,"data-highcharts-chart"));!isNaN(c)&&X[c]&&X[c].hasRendered&&X[c].destroy();L(a,"data-highcharts-chart",this.index);a.innerHTML="";!b.skipClone&&!a.offsetWidth&&this.cloneRenderTo();this.getChartSize();c=this.chartWidth;d=this.chartHeight;this.container=a=Z(Ka,{className:"highcharts-container"+(b.className?" "+b.className:""),id:e}, +r({position:"relative",overflow:"hidden",width:c+"px",height:d+"px",textAlign:"left",lineHeight:"normal",zIndex:0,"-webkit-tap-highlight-color":"rgba(0,0,0,0)"},b.style),this.renderToClone||a);this._cursor=a.style.cursor;this.renderer=b.forExport?new ta(a,c,d,b.style,!0):new $a(a,c,d,b.style);ea&&this.renderer.create(this,a,c,d);this.renderer.chartIndex=this.index},getMargins:function(a){var b=this.spacing,c=this.margin,d=this.titleOffset;this.resetMargins();if(d&&!s(c[0]))this.plotTop=t(this.plotTop, +d+this.options.title.margin+b[0]);this.legend.adjustMargins(c,b);this.extraBottomMargin&&(this.marginBottom+=this.extraBottomMargin);this.extraTopMargin&&(this.plotTop+=this.extraTopMargin);a||this.getAxisMargins()},getAxisMargins:function(){var a=this,b=a.axisOffset=[0,0,0,0],c=a.margin;a.hasCartesianSeries&&m(a.axes,function(a){a.getOffset()});m(ib,function(d,e){s(c[e])||(a[d]+=b[e])});a.setChartSize()},reflow:function(a){var b=this,c=b.options.chart,d=b.renderTo,e=c.width||jb(d,"width"),f=c.height|| +jb(d,"height"),c=a?a.target:H,d=function(){if(b.container)b.setSize(e,f,!1),b.hasUserSize=null};if(!b.hasUserSize&&!b.isPrinting&&e&&f&&(c===H||c===A)){if(e!==b.containerWidth||f!==b.containerHeight)clearTimeout(b.reflowTimeout),a?b.reflowTimeout=setTimeout(d,100):d();b.containerWidth=e;b.containerHeight=f}},initReflow:function(){var a=this,b=function(b){a.reflow(b)};N(H,"resize",b);N(a,"destroy",function(){Y(H,"resize",b)})},setSize:function(a,b,c){var d=this,e,f,g;d.isResizing+=1;g=function(){d&& +M(d,"endResize",null,function(){d.isResizing-=1})};Sa(c,d);d.oldChartHeight=d.chartHeight;d.oldChartWidth=d.chartWidth;if(s(a))d.chartWidth=e=t(0,x(a)),d.hasUserSize=!!e;if(s(b))d.chartHeight=f=t(0,x(b));(za?lb:F)(d.container,{width:e+"px",height:f+"px"},za);d.setChartSize(!0);d.renderer.setSize(e,f,c);d.maxTicks=null;m(d.axes,function(a){a.isDirty=!0;a.setScale()});m(d.series,function(a){a.isDirty=!0});d.isDirtyLegend=!0;d.isDirtyBox=!0;d.layOutTitles();d.getMargins();d.redraw(c);d.oldChartHeight= +null;M(d,"resize");za===!1?g():setTimeout(g,za&&za.duration||500)},setChartSize:function(a){var b=this.inverted,c=this.renderer,d=this.chartWidth,e=this.chartHeight,f=this.options.chart,g=this.spacing,h=this.clipOffset,i,j,k,l;this.plotLeft=i=x(this.plotLeft);this.plotTop=j=x(this.plotTop);this.plotWidth=k=t(0,x(d-i-this.marginRight));this.plotHeight=l=t(0,x(e-j-this.marginBottom));this.plotSizeX=b?l:k;this.plotSizeY=b?k:l;this.plotBorderWidth=f.plotBorderWidth||0;this.spacingBox=c.spacingBox={x:g[3], +y:g[0],width:d-g[3]-g[1],height:e-g[0]-g[2]};this.plotBox=c.plotBox={x:i,y:j,width:k,height:l};d=2*U(this.plotBorderWidth/2);b=sa(t(d,h[3])/2);c=sa(t(d,h[0])/2);this.clipBox={x:b,y:c,width:U(this.plotSizeX-t(d,h[1])/2-b),height:t(0,U(this.plotSizeY-t(d,h[2])/2-c))};a||m(this.axes,function(a){a.setAxisSize();a.setAxisTranslation()})},resetMargins:function(){var a=this;m(ib,function(b,c){a[b]=p(a.margin[c],a.spacing[c])});a.axisOffset=[0,0,0,0];a.clipOffset=[0,0,0,0]},drawChartBox:function(){var a= +this.options.chart,b=this.renderer,c=this.chartWidth,d=this.chartHeight,e=this.chartBackground,f=this.plotBackground,g=this.plotBorder,h=this.plotBGImage,i=a.borderWidth||0,j=a.backgroundColor,k=a.plotBackgroundColor,l=a.plotBackgroundImage,n=a.plotBorderWidth||0,o,q=this.plotLeft,p=this.plotTop,m=this.plotWidth,s=this.plotHeight,v=this.plotBox,r=this.clipRect,t=this.clipBox;o=i+(a.shadow?8:0);if(i||j)if(e)e.animate(e.crisp({width:c-o,height:d-o}));else{e={fill:j||R};if(i)e.stroke=a.borderColor,e["stroke-width"]= +i;this.chartBackground=b.rect(o/2,o/2,c-o,d-o,a.borderRadius,i).attr(e).addClass("highcharts-background").add().shadow(a.shadow)}if(k)f?f.animate(v):this.plotBackground=b.rect(q,p,m,s,0).attr({fill:k}).add().shadow(a.plotShadow);if(l)h?h.animate(v):this.plotBGImage=b.image(l,q,p,m,s).add();r?r.animate({width:t.width,height:t.height}):this.clipRect=b.clipRect(t);if(n)g?g.animate(g.crisp({x:q,y:p,width:m,height:s,strokeWidth:-n})):this.plotBorder=b.rect(q,p,m,s,0,-n).attr({stroke:a.plotBorderColor, +"stroke-width":n,fill:R,zIndex:1}).add();this.isDirtyBox=!1},propFromSeries:function(){var a=this,b=a.options.chart,c,d=a.options.series,e,f;m(["inverted","angular","polar"],function(g){c=J[b.type||b.defaultSeriesType];f=a[g]||b[g]||c&&c.prototype[g];for(e=d&&d.length;!f&&e--;)(c=J[d[e].type])&&c.prototype[g]&&(f=!0);a[g]=f})},linkSeries:function(){var a=this,b=a.series;m(b,function(a){a.linkedSeries.length=0});m(b,function(b){var d=b.options.linkedTo;if(Da(d)&&(d=d===":previous"?a.series[b.index- +1]:a.get(d)))d.linkedSeries.push(b),b.linkedParent=d})},renderSeries:function(){m(this.series,function(a){a.translate();a.render()})},renderLabels:function(){var a=this,b=a.options.labels;b.items&&m(b.items,function(c){var d=r(b.style,c.style),e=B(d.left)+a.plotLeft,f=B(d.top)+a.plotTop+12;delete d.left;delete d.top;a.renderer.text(c.html,e,f).attr({zIndex:2}).css(d).add()})},render:function(){var a=this.axes,b=this.renderer,c=this.options,d,e,f,g;this.setTitle();this.legend=new mb(this,c.legend); +this.getStacks();this.getMargins(!0);this.setChartSize();d=this.plotWidth;e=this.plotHeight-=13;m(a,function(a){a.setScale()});this.getAxisMargins();f=d/this.plotWidth>1.1;g=e/this.plotHeight>1.1;if(f||g)this.maxTicks=null,m(a,function(a){(a.horiz&&f||!a.horiz&&g)&&a.setTickInterval(!0)}),this.getMargins();this.drawChartBox();this.hasCartesianSeries&&m(a,function(a){a.render()});if(!this.seriesGroup)this.seriesGroup=b.g("series-group").attr({zIndex:3}).add();this.renderSeries();this.renderLabels(); +this.showCredits(c.credits);this.hasRendered=!0},showCredits:function(a){if(a.enabled&&!this.credits)this.credits=this.renderer.text(a.text,0,0).on("click",function(){if(a.href)location.href=a.href}).attr({align:a.position.align,zIndex:8}).css(a.style).add().align(a.position)},destroy:function(){var a=this,b=a.axes,c=a.series,d=a.container,e,f=d&&d.parentNode;M(a,"destroy");X[a.index]=u;bb--;a.renderTo.removeAttribute("data-highcharts-chart");Y(a);for(e=b.length;e--;)b[e]=b[e].destroy();for(e=c.length;e--;)c[e]= +c[e].destroy();m("title,subtitle,chartBackground,plotBackground,plotBGImage,plotBorder,seriesGroup,clipRect,credits,pointer,scroller,rangeSelector,legend,resetZoomButton,tooltip,renderer".split(","),function(b){var c=a[b];c&&c.destroy&&(a[b]=c.destroy())});if(d)d.innerHTML="",Y(d),f&&Ra(d);for(e in a)delete a[e]},isReadyToRender:function(){var a=this;return!ba&&H==H.top&&A.readyState!=="complete"||ea&&!H.canvg?(ea?Lb.push(function(){a.firstRender()},a.options.global.canvasToolsURL):A.attachEvent("onreadystatechange", +function(){A.detachEvent("onreadystatechange",a.firstRender);A.readyState==="complete"&&a.firstRender()}),!1):!0},firstRender:function(){var a=this,b=a.options,c=a.callback;if(a.isReadyToRender()){a.getContainer();M(a,"init");a.resetMargins();a.setChartSize();a.propFromSeries();a.getAxes();m(b.series||[],function(b){a.initSeries(b)});a.linkSeries();M(a,"beforeRender");if(w.Pointer)a.pointer=new Va(a,b);a.render();a.renderer.draw();c&&c.apply(a,[a]);m(a.callbacks,function(b){a.index!==u&&b.apply(a, +[a])});M(a,"load");a.cloneRenderTo(!0)}},splashArray:function(a,b){var c=b[a],c=ca(c)?c:[c,c,c,c];return[p(b[a+"Top"],c[0]),p(b[a+"Right"],c[1]),p(b[a+"Bottom"],c[2]),p(b[a+"Left"],c[3])]}};var Xb=w.CenteredSeriesMixin={getCenter:function(){var a=this.options,b=this.chart,c=2*(a.slicedOffset||0),d=b.plotWidth-2*c,b=b.plotHeight-2*c,e=a.center,e=[p(e[0],"50%"),p(e[1],"50%"),a.size||"100%",a.innerSize||0],f=I(d,b),g,h,i;for(h=0;h<4;++h)i=e[h],g=/%$/.test(i),a=h<2||h===2&&g,e[h]=(g?[d,b,f,e[2]][h]*B(i)/ +100:B(i))+(a?c:0);return e}},Ga=function(){};Ga.prototype={init:function(a,b,c){this.series=a;this.color=a.color;this.applyOptions(b,c);this.pointAttr={};if(a.options.colorByPoint&&(b=a.options.colors||a.chart.options.colors,this.color=this.color||b[a.colorCounter++],a.colorCounter===b.length))a.colorCounter=0;a.chart.pointCount++;return this},applyOptions:function(a,b){var c=this.series,d=c.options.pointValKey||c.pointValKey,a=Ga.prototype.optionsToObject.call(this,a);r(this,a);this.options=this.options? +r(this.options,a):a;if(d)this.y=this[d];if(this.x===u&&c)this.x=b===u?c.autoIncrement():b;return this},optionsToObject:function(a){var b={},c=this.series,d=c.options.keys,e=d||c.pointArrayMap||["y"],f=e.length,g=0,h=0;if(typeof a==="number"||a===null)b[e[0]]=a;else if(Ha(a)){if(!d&&a.length>f){c=typeof a[0];if(c==="string")b.name=a[0];else if(c==="number")b.x=a[0];g++}for(;ha+1&&b.push(d.slice(a+1,g)),a=g):g===e-1&&b.push(d.slice(a+1,g+1))});this.segments=b},setOptions:function(a){var b=this.chart,c=b.options.plotOptions,b=b.userOptions||{},d=b.plotOptions||{},e=c[this.type];this.userOptions=a;c=z(e,c.series,a);this.tooltipOptions=z(P.tooltip,P.plotOptions[this.type].tooltip,b.tooltip,d.series&&d.series.tooltip,d[this.type]&&d[this.type].tooltip,a.tooltip);e.marker===null&&delete c.marker; +this.zoneAxis=c.zoneAxis;a=this.zones=(c.zones||[]).slice();if((c.negativeColor||c.negativeFillColor)&&!c.zones)a.push({value:c[this.zoneAxis+"Threshold"]||c.threshold||0,color:c.negativeColor,fillColor:c.negativeFillColor});a.length&&s(a[a.length-1].value)&&a.push({color:this.color,fillColor:this.fillColor});return c},getCyclic:function(a,b,c){var d=this.userOptions,e="_"+a+"Index",f=a+"Counter";b||(s(d[e])?b=d[e]:(d[e]=b=this.chart[f]%c.length,this.chart[f]+=1),b=c[b]);this[a]=b},getColor:function(){this.options.colorByPoint|| +this.getCyclic("color",this.options.color||aa[this.type].color,this.chart.options.colors)},getSymbol:function(){var a=this.options.marker;this.getCyclic("symbol",a.symbol,this.chart.options.symbols);if(/^url/.test(this.symbol))a.radius=0},drawLegendSymbol:Na.drawLineMarker,setData:function(a,b,c,d){var e=this,f=e.points,g=f&&f.length||0,h,i=e.options,j=e.chart,k=null,l=e.xAxis,n=l&&!!l.categories,o=i.turboThreshold,q=this.xData,y=this.yData,s=(h=e.pointArrayMap)&&h.length,a=a||[];h=a.length;b=p(b, +!0);if(d!==!1&&h&&g===h&&!e.cropped&&!e.hasGroupedData&&e.visible)m(a,function(a,b){f[b].update(a,!1,null,!1)});else{e.xIncrement=null;e.pointRange=n?1:i.pointRange;e.colorCounter=0;m(this.parallelArrays,function(a){e[a+"Data"].length=0});if(o&&h>o){for(c=0;k===null&&ci||this.forceCrop))if(b[d-1]n)b=[],c=[];else if(b[0]n)e=this.cropData(this.xData,this.yData,l,n),b=e.xData,c=e.yData,e=e.start,f=!0;for(i=b.length-1;i>=0;i--)d=b[i]-b[i-1],d>0&&(g===u||d=c){f=t(0,i-h);break}for(;id){g=i+h;break}return{xData:a.slice(f,g),yData:b.slice(f,g),start:f,end:g}},generatePoints:function(){var a=this.options.data,b=this.data,c,d=this.processedXData,e=this.processedYData,f=this.pointClass,g=d.length,h=this.cropStart||0,i,j=this.hasGroupedData,k,l=[],n;if(!b&&!j)b=[],b.length=a.length,b=this.data=b;for(n=0;n0),j=this.getExtremesFromAll||this.cropped||(c[l+1]||j)>=g&&(c[l-1]||j)<=h,i&&j)if(i=k.length)for(;i--;)k[i]!==null&&(e[f++]=k[i]);else e[f++]=k;this.dataMin=Pa(e);this.dataMax=Fa(e)},translate:function(){this.processedXData||this.processData();this.generatePoints();for(var a=this.options,b=a.stacking,c=this.xAxis,d=c.categories,e=this.yAxis,f=this.points,g=f.length,h=!!this.modifyValue,i=a.pointPlacement,j=i==="between"||qa(i),k=a.threshold,l,n,o,q=Number.MAX_VALUE,a=0;a=0&&n<=e.len&&l>=0&&l<=c.len;m.clientX=j?c.translate(r,0,0,0,1):l;m.negative=m.y<(k||0);m.category=d&&d[m.x]!==u?d[m.x]:m.x;a&&(q=I(q,O(l-o)));o=l}this.closestPointRangePx=q;this.getSegments()},setClip:function(a){var b=this.chart,c=b.renderer,d=b.inverted,e=this.clipBox,f=e||b.clipBox,g=this.sharedClipKey||["_sharedClip",a&&a.duration,a&&a.easing,f.height].join(","),h=b[g],i=b[g+"m"];if(!h){if(a)f.width= +0,b[g+"m"]=i=c.clipRect(-99,d?-b.plotLeft:-b.plotTop,99,d?b.chartWidth:b.chartHeight);b[g]=h=c.clipRect(f)}a&&(h.count+=1);if(this.options.clip!==!1)this.group.clip(a||e?h:b.clipRect),this.markerGroup.clip(i),this.sharedClipKey=g;a||(h.count-=1,h.count<=0&&g&&b[g]&&(e||(b[g]=b[g].destroy()),b[g+"m"]&&(b[g+"m"]=b[g+"m"].destroy())))},animate:function(a){var b=this.chart,c=this.options.animation,d;if(c&&!ca(c))c=aa[this.type].animation;a?this.setClip(c):(d=this.sharedClipKey,(a=b[d])&&a.animate({width:b.plotSizeX}, +c),b[d+"m"]&&b[d+"m"].animate({width:b.plotSizeX+99},c),this.animate=null)},afterAnimate:function(){this.setClip();M(this,"afterAnimate")},drawPoints:function(){var a,b=this.points,c=this.chart,d,e,f,g,h,i,j,k,l=this.options.marker,n=this.pointAttr[""],o,q,m,s=this.markerGroup,t=p(l.enabled,this.xAxis.isRadial,this.closestPointRangePx>2*l.radius);if(l.enabled!==!1||this._hasPointMarkers)for(f=b.length;f--;)if(g=b[f],d=U(g.plotX),e=g.plotY,k=g.graphic,o=g.marker||{},q=!!g.marker,a=t&&o.enabled===u|| +o.enabled,m=g.isInside,a&&e!==u&&!isNaN(e)&&g.y!==null)if(a=g.pointAttr[g.selected?"select":""]||n,h=a.r,i=p(o.symbol,this.symbol),j=i.indexOf("url")===0,k)k[m?"show":"hide"](!0).animate(r({x:d-h,y:e-h},k.symbolName?{width:2*h,height:2*h}:{}));else{if(m&&(h>0||j))g.graphic=c.renderer.symbol(i,d-h,e-h,2*h,2*h,q?o:l).attr(a).add(s)}else if(k)g.graphic=k.destroy()},convertAttribs:function(a,b,c,d){var e=this.pointAttrToOptions,f,g,h={},a=a||{},b=b||{},c=c||{},d=d||{};for(f in e)g=e[f],h[f]=p(a[g],b[f], +c[f],d[f]);return h},getAttribs:function(){var a=this,b=a.options,c=aa[a.type].marker?b.marker:b,d=c.states,e=d.hover,f,g=a.color,h=a.options.negativeColor;f={stroke:g,fill:g};var i=a.points||[],j,k=[],l,n=a.pointAttrToOptions;l=a.hasPointSpecificOptions;var o=c.lineColor,q=c.fillColor;j=b.turboThreshold;var p=a.zones,t=a.zoneAxis||"y",C;b.marker?(e.radius=e.radius||c.radius+e.radiusPlus,e.lineWidth=e.lineWidth||c.lineWidth+e.lineWidthPlus):(e.color=e.color||na(e.color||g).brighten(e.brightness).get(), +e.negativeColor=e.negativeColor||na(e.negativeColor||h).brighten(e.brightness).get());k[""]=a.convertAttribs(c,f);m(["hover","select"],function(b){k[b]=a.convertAttribs(d[b],k[""])});a.pointAttr=k;g=i.length;if(!j||g=f.value;)f=p[++l];j.color=j.fillColor=f.color}l=b.colorByPoint||j.color;if(j.options)for(C in n)s(c[n[C]])&&(l=!0);if(l){c=c||{};l=[];d=c.states||{};f=d.hover= +d.hover||{};if(!b.marker)f.color=f.color||!j.options.color&&e[j.negative&&h?"negativeColor":"color"]||na(j.color).brighten(f.brightness||e.brightness).get();f={color:j.color};if(!q)f.fillColor=j.color;if(!o)f.lineColor=j.color;c.hasOwnProperty("color")&&!c.color&&delete c.color;l[""]=a.convertAttribs(r(f,c),k[""]);l.hover=a.convertAttribs(d.hover,k.hover,l[""]);l.select=a.convertAttribs(d.select,k.select,l[""])}else l=k;j.pointAttr=l}},destroy:function(){var a=this,b=a.chart,c=/AppleWebKit\/533/.test(Ba), +d,e=a.data||[],f,g,h;M(a,"destroy");Y(a);m(a.axisTypes||[],function(b){if(h=a[b])ia(h.series,a),h.isDirty=h.forceRedraw=!0});a.legendItem&&a.chart.legend.destroyItem(a);for(d=e.length;d--;)(f=e[d])&&f.destroy&&f.destroy();a.points=null;clearTimeout(a.animationTimeout);for(g in a)a[g]instanceof K&&!a[g].survive&&(d=c&&g==="group"?"hide":"destroy",a[g][d]());if(b.hoverSeries===a)b.hoverSeries=null;ia(b.series,a);for(g in a)delete a[g]},getSegmentPath:function(a){var b=this,c=[],d=b.options.step;m(a, +function(e,f){var g=e.plotX,h=e.plotY,i;b.getPointSpline?c.push.apply(c,b.getPointSpline(a,e,f)):(c.push(f?"L":"M"),d&&f&&(i=a[f-1],d==="right"?c.push(i.plotX,h):d==="center"?c.push((i.plotX+g)/2,i.plotY,(i.plotX+g)/2,h):c.push(g,i.plotY)),c.push(e.plotX,e.plotY))});return c},getGraphPath:function(){var a=this,b=[],c,d=[];m(a.segments,function(e){c=a.getSegmentPath(e);e.length>1?b=b.concat(c):d.push(e[0])});a.singlePoints=d;return a.graphPath=b},drawGraph:function(){var a=this,b=this.options,c=[["graph", +b.lineColor||this.color,b.dashStyle]],d=b.lineWidth,e=b.linecap!=="square",f=this.getGraphPath(),g=this.fillGraph&&this.color||R;m(this.zones,function(d,e){c.push(["zoneGraph"+e,d.color||a.color,d.dashStyle||b.dashStyle])});m(c,function(c,i){var j=c[0],k=a[j];if(k)db(k),k.animate({d:f});else if((d||g)&&f.length)k={stroke:c[1],"stroke-width":d,fill:g,zIndex:1},c[2]?k.dashstyle=c[2]:e&&(k["stroke-linecap"]=k["stroke-linejoin"]="round"),a[j]=a.chart.renderer.path(f).attr(k).add(a.group).shadow(i<2&& +b.shadow)})},applyZones:function(){var a=this,b=this.chart,c=b.renderer,d=this.zones,e,f,g=this.clips||[],h,i=this.graph,j=this.area,k=t(b.chartWidth,b.chartHeight),l=this[(this.zoneAxis||"y")+"Axis"],n=l.reversed,o=l.horiz,q=!1;if(d.length&&(i||j))i&&i.hide(),j&&j.hide(),m(d,function(d,m){e=p(f,n?o?b.plotWidth:0:o?0:l.toPixels(l.min));f=x(l.toPixels(p(d.value,l.max),!0));e=l.isXAxis?e>f?f:e:el.max}),this.clips=g},invertGroups:function(){function a(){var a={width:b.yAxis.len,height:b.xAxis.len};m(["group","markerGroup"],function(c){b[c]&&b[c].attr(a).invert()})} +var b=this,c=b.chart;if(b.xAxis)N(c,"resize",a),N(b,"destroy",function(){Y(c,"resize",a)}),a(),b.invertGroups=a},plotGroup:function(a,b,c,d,e){var f=this[a],g=!f;g&&(this[a]=f=this.chart.renderer.g(b).attr({visibility:c,zIndex:d||0.1}).add(e));f[g?"attr":"animate"](this.getPlotBox());return f},getPlotBox:function(){var a=this.chart,b=this.xAxis,c=this.yAxis;if(a.inverted)b=c,c=this.xAxis;return{translateX:b?b.left:a.plotLeft,translateY:c?c.top:a.plotTop,scaleX:1,scaleY:1}},render:function(){var a= +this,b=a.chart,c,d=a.options,e=(c=d.animation)&&!!a.animate&&b.renderer.isSVG&&p(c.duration,500)||0,f=a.visible?"visible":"hidden",g=d.zIndex,h=a.hasRendered,i=b.seriesGroup;c=a.plotGroup("group","series",f,g,i);a.markerGroup=a.plotGroup("markerGroup","markers",f,g,i);e&&a.animate(!0);a.getAttribs();c.inverted=a.isCartesian?b.inverted:!1;a.drawGraph&&(a.drawGraph(),a.applyZones());m(a.points,function(a){a.redraw&&a.redraw()});a.drawDataLabels&&a.drawDataLabels();a.visible&&a.drawPoints();a.drawTracker&& +a.options.enableMouseTracking!==!1&&a.drawTracker();b.inverted&&a.invertGroups();d.clip!==!1&&!a.sharedClipKey&&!h&&c.clip(b.clipRect);e&&a.animate();if(!h)e?a.animationTimeout=setTimeout(function(){a.afterAnimate()},e):a.afterAnimate();a.isDirty=a.isDirtyData=!1;a.hasRendered=!0},redraw:function(){var a=this.chart,b=this.isDirtyData,c=this.isDirty,d=this.group,e=this.xAxis,f=this.yAxis;d&&(a.inverted&&d.attr({width:a.plotWidth,height:a.plotHeight}),d.animate({translateX:p(e&&e.left,a.plotLeft),translateY:p(f&& +f.top,a.plotTop)}));this.translate();this.render();b&&M(this,"updatedData");(c||b)&&delete this.kdTree},kdDimensions:1,kdTree:null,kdAxisArray:["clientX","plotY"],kdComparer:"distX",searchPoint:function(a){var b=this.xAxis,c=this.yAxis,d=this.chart.inverted;return this.searchKDTree({clientX:d?b.len-a.chartY+b.pos:a.chartX-b.pos,plotY:d?c.len-a.chartX+c.pos:a.chartY-c.pos})},buildKDTree:function(){function a(b,d,g){var h,i;if(i=b&&b.length)return h=c.kdAxisArray[d%g],b.sort(function(a,b){return a[h]- +b[h]}),i=Math.floor(i/2),{point:b[i],left:a(b.slice(0,i),d+1,g),right:a(b.slice(i+1),d+1,g)}}function b(){var b=kb(c.points,function(a){return a.y!==null});c.kdTree=a(b,d,d)}var c=this,d=c.kdDimensions;delete c.kdTree;c.options.kdSync?b():setTimeout(b)},searchKDTree:function(a){function b(a,h,i,j){var k=h.point,l=c.kdAxisArray[i%j],n,o=k;n=s(a[e])&&s(k[e])?Math.pow(a[e]-k[e],2):null;var m=s(a[f])&&s(k[f])?Math.pow(a[f]-k[f],2):null,p=(n||0)+(m||0);n={distX:s(n)?Math.sqrt(n):Number.MAX_VALUE,distY:s(m)? +Math.sqrt(m):Number.MAX_VALUE,distR:s(p)?Math.sqrt(p):Number.MAX_VALUE};k.dist=n;l=a[l]-k[l];n=l<0?"left":"right";h[n]&&(n=b(a,h[n],i+1,j),o=n.dist[d]n;)d--;e.updateParallelArrays(i,"splice",d,0,0);e.updateParallelArrays(i,d);if(k&&i.name)k[n]=i.name;h.splice(d,0,a);o&&(e.data.splice(d,0,null),e.processData());f.legendType==="point"&&e.generatePoints();c&&(g[0]&&g[0].remove?g[0].remove(!1):(g.shift(),e.updateParallelArrays(i,"shift"),h.shift()));e.isDirty=!0;e.isDirtyData=!0;b&&(e.getAttribs(),j.redraw())},removePoint:function(a, +b,c){var d=this,e=d.data,f=e[a],g=d.points,h=d.chart,i=function(){e.length===g.length&&g.splice(a,1);e.splice(a,1);d.options.data.splice(a,1);d.updateParallelArrays(f||{series:d},"splice",a,1);f&&f.destroy();d.isDirty=!0;d.isDirtyData=!0;b&&h.redraw()};Sa(c,h);b=p(b,!0);f?f.firePointEvent("remove",null,i):i()},remove:function(a,b){var c=this,d=c.chart,a=p(a,!0);if(!c.isRemoving)c.isRemoving=!0,M(c,"remove",null,function(){c.destroy();d.isDirtyLegend=d.isDirtyBox=!0;d.linkSeries();a&&d.redraw(b)}); +c.isRemoving=!1},update:function(a,b){var c=this,d=this.chart,e=this.userOptions,f=this.type,g=J[f].prototype,h=["group","markerGroup","dataLabelsGroup"],i;if(a.type&&a.type!==f||a.zIndex!==void 0)h.length=0;m(h,function(a){h[a]=c[a];delete c[a]});a=z(e,{animation:!1,index:this.index,pointStart:this.xData[0]},{data:this.options.data},a);this.remove(!1);for(i in g)this[i]=u;r(this,J[a.type||f].prototype);m(h,function(a){c[a]=h[a]});this.init(d,a);d.linkSeries();p(b,!0)&&d.redraw(!1)}});r(va.prototype, +{update:function(a,b){var c=this.chart,a=c.options[this.coll][this.options.index]=z(this.userOptions,a);this.destroy(!0);this._addedPlotLB=u;this.init(c,r(a,{events:u}));c.isDirtyBox=!0;p(b,!0)&&c.redraw()},remove:function(a){for(var b=this.chart,c=this.coll,d=this.series,e=d.length;e--;)d[e]&&d[e].remove(!1);ia(b.axes,this);ia(b[c],this);b.options[c].splice(this.options.index,1);m(b[c],function(a,b){a.options.index=b});this.destroy();b.isDirtyBox=!0;p(a,!0)&&b.redraw()},setTitle:function(a,b){this.update({title:a}, +b)},setCategories:function(a,b){this.update({categories:a},b)}});var xa=ja(Q);J.line=xa;aa.area=z(T,{threshold:0});var pa=ja(Q,{type:"area",getSegments:function(){var a=this,b=[],c=[],d=[],e=this.xAxis,f=this.yAxis,g=f.stacks[this.stackKey],h={},i,j,k=this.points,l=this.options.connectNulls,n,o;if(this.options.stacking&&!this.cropped){for(n=0;n=0;d--)g=p(a[d].yBottom,f),da&&i>e? +(i=t(a,e),k=2*e-i):ig&&k>e?(k=t(g,e),i=2*e-k):kg?d-g:f-(w?g:0)));c.barX=m;c.pointWidth=i;c.tooltipPos=b.inverted?[e.len+e.pos-b.plotLeft-h,a.xAxis.len-m-s/2]:[m+s/2, +h+e.pos-b.plotTop];s=x(m+s)+l;m=x(m)+l;s-=m;d=O(r)<0.5;u=I(x(r+u)+n,9E4);r=x(r)+n;u-=r;d&&(r-=1,u+=1);c.shapeType="rect";c.shapeArgs={x:m,y:r,width:s,height:u}})},getSymbol:ma,drawLegendSymbol:Na.drawRectangle,drawGraph:ma,drawPoints:function(){var a=this,b=this.chart,c=a.options,d=b.renderer,e=c.animationLimit||250,f,g;m(a.points,function(h){var i=h.plotY,j=h.graphic;if(i!==u&&!isNaN(i)&&h.y!==null)f=h.shapeArgs,i=s(a.borderWidth)?{"stroke-width":a.borderWidth}:{},g=h.pointAttr[h.selected?"select": +""]||a.pointAttr[""],j?(db(j),j.attr(i)[b.pointCount\u25CF {series.name}
',pointFormat:"x: {point.x}
y: {point.y}
"}}); +pa=ja(Q,{type:"scatter",sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group","markerGroup","dataLabelsGroup"],takeOrdinalPosition:!1,kdDimensions:2,kdComparer:"distR",drawGraph:function(){this.options.lineWidth&&Q.prototype.drawGraph.call(this)}});J.scatter=pa;aa.pie=z(T,{borderColor:"#FFFFFF",borderWidth:1,center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{distance:30,enabled:!0,formatter:function(){return this.point.name},x:0},ignoreHiddenPoint:!0,legendType:"point",marker:null, +size:null,showInLegend:!1,slicedOffset:10,states:{hover:{brightness:0.1,shadow:!1}},stickyTracking:!1,tooltip:{followPointer:!0}});T={type:"pie",isCartesian:!1,pointClass:ja(Ga,{init:function(){Ga.prototype.init.apply(this,arguments);var a=this,b;r(a,{visible:a.visible!==!1,name:p(a.name,"Slice")});b=function(b){a.slice(b.type==="select")};N(a,"select",b);N(a,"unselect",b);return a},setVisible:function(a,b){var c=this,d=c.series,e=d.chart,f=!d.isDirty&&d.options.ignoreHiddenPoint;if(a!==c.visible|| +b)if(c.visible=c.options.visible=a=a===u?!c.visible:a,d.options.data[Ma(c,d.data)]=c.options,m(["graphic","dataLabel","connector","shadowGroup"],function(b){if(c[b])c[b][a?"show":"hide"](!0)}),c.legendItem&&(e.hasRendered&&(d.updateTotals(),e.legend.clearItems(),f||e.legend.render()),e.legend.colorizeItem(c,a)),f)d.isDirty=!0,e.redraw()},slice:function(a,b,c){var d=this.series;Sa(c,d.chart);p(b,!0);this.sliced=this.options.sliced=a=s(a)?a:!this.sliced;d.options.data[Ma(this,d.data)]=this.options; +a=a?this.slicedTranslation:{translateX:0,translateY:0};this.graphic.animate(a);this.shadowGroup&&this.shadowGroup.animate(a)},haloPath:function(a){var b=this.shapeArgs,c=this.series.chart;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(c.plotLeft+b.x,c.plotTop+b.y,b.r+a,b.r+a,{innerR:this.shapeArgs.r,start:b.start,end:b.end})}}),requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group","dataLabelsGroup"],axisTypes:[],pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth", +fill:"color"},getColor:ma,animate:function(a){var b=this,c=b.points,d=b.startAngleRad;if(!a)m(c,function(a){var c=a.graphic,g=a.shapeArgs;c&&(c.attr({r:a.startR||b.center[3]/2,start:d,end:d}),c.animate({r:g.r,start:g.start,end:g.end},b.options.animation))}),b.animate=null},setData:function(a,b,c,d){Q.prototype.setData.call(this,a,!1,c,d);this.processData();this.generatePoints();p(b,!0)&&this.chart.redraw(c)},updateTotals:function(){var a,b=0,c,d,e,f=this.options.ignoreHiddenPoint;c=this.points;d= +c.length;for(a=0;a0&&(e.visible||!f)?e.y/b*100:0,e.total=b},generatePoints:function(){Q.prototype.generatePoints.call(this);this.updateTotals()},translate:function(a){this.generatePoints();var b=0,c=this.options,d=c.slicedOffset,e=d+c.borderWidth,f,g,h,i=c.startAngle||0,j=this.startAngleRad=la/180*(i-90),i=(this.endAngleRad=la/180*(p(c.endAngle,i+360)-90))-j,k=this.points,l=c.dataLabels.distance, +c=c.ignoreHiddenPoint,n,m=k.length,q;if(!a)this.center=a=this.getCenter();this.getX=function(b,c){h=V.asin(I((b-a[1])/(a[2]/2+l),1));return a[0]+(c?-1:1)*W(h)*(a[2]/2+l)};for(n=0;n1.5*la?h-=2*la:h<-la/2&&(h+=2*la);q.slicedTranslation={translateX:x(W(h)*d),translateY:x($(h)*d)};f=W(h)*a[2]/2;g=$(h)*a[2]/2;q.tooltipPos= +[a[0]+f*0.7,a[1]+g*0.7];q.half=h<-la/2||h>la/2?1:0;q.angle=h;e=I(e,l/2);q.labelPos=[a[0]+f+W(h)*l,a[1]+g+$(h)*l,a[0]+f+W(h)*e,a[1]+g+$(h)*e,a[0]+f,a[1]+g,l<0?"center":q.half?"right":"left",h]}},drawGraph:null,drawPoints:function(){var a=this,b=a.chart.renderer,c,d,e=a.options.shadow,f,g;if(e&&!a.shadowGroup)a.shadowGroup=b.g("shadow").add(a.group);m(a.points,function(h){var i=h.options.visible;d=h.graphic;g=h.shapeArgs;f=h.shadowGroup;if(e&&!f)f=h.shadowGroup=b.g("shadow").add(a.shadowGroup);c=h.sliced? +h.slicedTranslation:{translateX:0,translateY:0};f&&f.attr(c);d?d.animate(r(g,c)):h.graphic=d=b[h.shapeType](g).setRadialReference(a.center).attr(h.pointAttr[h.selected?"select":""]).attr({"stroke-linejoin":"round"}).attr(c).add(a.group).shadow(e,f);i!==void 0&&h.setVisible(i,!0)})},searchPoint:ma,sortByAngle:function(a,b){a.sort(function(a,d){return a.angle!==void 0&&(d.angle-a.angle)*b})},drawLegendSymbol:Na.drawRectangle,getCenter:Xb.getCenter,getSymbol:ma};T=ja(Q,T);J.pie=T;Q.prototype.drawDataLabels= +function(){var a=this,b=a.options,c=b.cursor,d=b.dataLabels,e=a.points,f,g,h=a.hasRendered||0,i,j,k=a.chart.renderer;if(d.enabled||a._hasPointLabels)a.dlProcessOptions&&a.dlProcessOptions(d),j=a.plotGroup("dataLabelsGroup","data-labels",d.defer?"hidden":"visible",d.zIndex||6),p(d.defer,!0)&&(j.attr({opacity:+h}),h||N(a,"afterAnimate",function(){a.visible&&j.show();j[b.animation?"animate":"attr"]({opacity:1},{duration:200})})),g=d,m(e,function(e){var h,m=e.dataLabel,q,t,x=e.connector,w=!0,v,A={};f= +e.dlOptions||e.options&&e.options.dataLabels;h=p(f&&f.enabled,g.enabled);if(m&&!h)e.dataLabel=m.destroy();else if(h){d=z(g,f);v=d.style;h=d.rotation;q=e.getLabelConfig();i=d.format?Ja(d.format,q):d.formatter.call(q,d);v.color=p(d.color,v.color,a.color,"black");if(m)if(s(i))m.attr({text:i}),w=!1;else{if(e.dataLabel=m=m.destroy(),x)e.connector=x.destroy()}else if(s(i)){m={fill:d.backgroundColor,stroke:d.borderColor,"stroke-width":d.borderWidth,r:d.borderRadius||0,rotation:h,padding:d.padding,zIndex:1}; +if(v.color==="contrast")A.color=d.inside||d.distance<0||b.stacking?k.getContrast(e.color||a.color):"#000000";if(c)A.cursor=c;for(t in m)m[t]===u&&delete m[t];m=e.dataLabel=k[h?"text":"label"](i,0,-999,d.shape,null,null,d.useHTML).attr(m).css(r(v,A)).add(j).shadow(d.shadow)}m&&a.alignDataLabel(e,m,d,null,w)}})};Q.prototype.alignDataLabel=function(a,b,c,d,e){var f=this.chart,g=f.inverted,h=p(a.plotX,-999),i=p(a.plotY,-999),j=b.getBBox(),k=f.renderer.fontMetrics(c.style.fontSize).b,l=this.visible&&(a.series.forceDL|| +f.isInsidePlot(h,x(i),g)||d&&f.isInsidePlot(h,g?d.x+1:d.y+d.height-1,g));if(l)d=r({x:g?f.plotWidth-i:h,y:x(g?f.plotHeight-h:i),width:0,height:0},d),r(c,{width:j.width,height:j.height}),c.rotation?(a=f.renderer.rotCorr(k,c.rotation),b[e?"attr":"animate"]({x:d.x+c.x+d.width/2+a.x,y:d.y+c.y+d.height/2}).attr({align:c.align})):(b.align(c,null,d),g=b.alignAttr,p(c.overflow,"justify")==="justify"?this.justifyDataLabel(b,c,g,j,d,e):p(c.crop,!0)&&(l=f.isInsidePlot(g.x,g.y)&&f.isInsidePlot(g.x+j.width,g.y+ +j.height)),c.shape&&b.attr({anchorX:a.plotX,anchorY:a.plotY}));if(!l)b.attr({y:-999}),b.placed=!1};Q.prototype.justifyDataLabel=function(a,b,c,d,e,f){var g=this.chart,h=b.align,i=b.verticalAlign,j,k,l=a.box?0:a.padding||0;j=c.x+l;if(j<0)h==="right"?b.align="left":b.x=-j,k=!0;j=c.x+d.width-l;if(j>g.plotWidth)h==="left"?b.align="right":b.x=g.plotWidth-j,k=!0;j=c.y+l;if(j<0)i==="bottom"?b.verticalAlign="top":b.y=-j,k=!0;j=c.y+d.height-l;if(j>g.plotHeight)i==="top"?b.verticalAlign="bottom":b.y=g.plotHeight- +j,k=!0;if(k)a.placed=!f,a.align(b,null,e)};if(J.pie)J.pie.prototype.drawDataLabels=function(){var a=this,b=a.data,c,d=a.chart,e=a.options.dataLabels,f=p(e.connectorPadding,10),g=p(e.connectorWidth,1),h=d.plotWidth,i=d.plotHeight,j,k,l=p(e.softConnector,!0),n=e.distance,o=a.center,q=o[2]/2,r=o[1],s=n>0,u,v,w,z=[[],[]],A,B,D,G,E,F=[0,0,0,0],M=function(a,b){return b.y-a.y};if(a.visible&&(e.enabled||a._hasPointLabels)){Q.prototype.drawDataLabels.apply(a);m(b,function(a){a.dataLabel&&a.visible&&z[a.half].push(a)}); +for(G=2;G--;){var J=[],N=[],H=z[G],L=H.length,K;if(L){a.sortByAngle(H,G-0.5);for(E=b=0;!b&&H[E];)b=H[E]&&H[E].dataLabel&&(H[E].dataLabel.getBBox().height||21),E++;if(n>0){v=I(r+q+n,d.plotHeight);for(E=t(0,r-q-n);E<=v;E+=b)J.push(E);v=J.length;if(L>v){c=[].concat(H);c.sort(M);for(E=L;E--;)c[E].rank=E;for(E=L;E--;)H[E].rank>=v&&H.splice(E,1);L=H.length}for(E=0;E0){if(v=N.pop(),K=v.i,B=v.y,c>B&&J[K+1]!==null||ch-f&&(F[1]=t(x(A+v-h+f),F[1])),B-b/2<0?F[0]=t(x(-B+b/2),F[0]):B+b/2>i&&(F[2]=t(x(B+b/2-i),F[2]))}}}if(Fa(F)===0||this.verifyDataLabelOverflow(F))this.placeDataLabels(),s&&g&&m(this.points,function(b){j=b.connector;w=b.labelPos;if((u=b.dataLabel)&&u._pos)D=u._attr.visibility,A=u.connX,B=u.connY,k=l?["M",A+(w[6]==="left"?5:-5),B,"C",A,B,2*w[2]-w[4],2*w[3]-w[5],w[2],w[3],"L",w[4],w[5]]:["M",A+(w[6]==="left"?5:-5),B,"L",w[2],w[3],"L",w[4],w[5]],j?(j.animate({d:k}),j.attr("visibility",D)): +b.connector=j=a.chart.renderer.path(k).attr({"stroke-width":g,stroke:e.connectorColor||b.color||"#606060",visibility:D}).add(a.dataLabelsGroup);else if(j)b.connector=j.destroy()})}},J.pie.prototype.placeDataLabels=function(){m(this.points,function(a){var a=a.dataLabel,b;if(a)(b=a._pos)?(a.attr(a._attr),a[a.moved?"animate":"attr"](b),a.moved=!0):a&&a.attr({y:-999})})},J.pie.prototype.alignDataLabel=ma,J.pie.prototype.verifyDataLabelOverflow=function(a){var b=this.center,c=this.options,d=c.center,e= +c=c.minSize||80,f;d[0]!==null?e=t(b[2]-t(a[1],a[3]),c):(e=t(b[2]-a[1]-a[3],c),b[0]+=(a[3]-a[1])/2);d[1]!==null?e=t(I(e,b[2]-t(a[0],a[2])),c):(e=t(I(e,b[2]-a[0]-a[2]),c),b[1]+=(a[0]-a[2])/2);ep(this.translatedThreshold, +g.yAxis.len),j=p(c.inside,!!this.options.stacking);if(h&&(d=z(h),f&&(d={x:g.yAxis.len-d.y-d.height,y:g.xAxis.len-d.x-d.width,width:d.height,height:d.width}),!j))f?(d.x+=i?0:d.width,d.width=0):(d.y+=i?d.height:0,d.height=0);c.align=p(c.align,!f||j?"center":i?"right":"left");c.verticalAlign=p(c.verticalAlign,f||j?"middle":i?"top":"bottom");Q.prototype.alignDataLabel.call(this,a,b,c,d,e)};(function(a){var b=a.Chart,c=a.each,d=HighchartsAdapter.addEvent;b.prototype.callbacks.push(function(a){function b(){var d= +[];c(a.series,function(a){var b=a.options.dataLabels;(b.enabled||a._hasPointLabels)&&!b.allowOverlap&&a.visible&&c(a.points,function(a){if(a.dataLabel)a.dataLabel.labelrank=a.labelrank,d.push(a.dataLabel)})});a.hideOverlappingLabels(d)}b();d(a,"redraw",b)});b.prototype.hideOverlappingLabels=function(a){var b=a.length,c,d,i,j;for(d=0;di.alignAttr.x+i.width||j.alignAttr.x+j.widthi.alignAttr.y+i.height||j.alignAttr.y+j.heightd;if(h.series.length&&(i||l>I(k.dataMin,k.min))&&(!i||jarticle,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}"; -c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode|| -"undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",version:"3.6.2pre",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);if(g)return a.createDocumentFragment(); -for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d0)for(c in Fc)d=Fc[c],e=b[d],"undefined"!=typeof e&&(a[d]=e);return a}function n(b){m(this,b),this._d=new Date(+b._d),Gc===!1&&(Gc=!0,a.updateOffset(this),Gc=!1)}function o(a){return a instanceof n||null!=a&&null!=a._isAMomentObject}function p(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=b>=0?Math.floor(b):Math.ceil(b)),c}function q(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&p(a[d])!==p(b[d]))&&g++;return g+f}function r(){}function s(a){return a?a.toLowerCase().replace("_","-"):a}function t(a){for(var b,c,d,e,f=0;f0;){if(d=u(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&q(e,c,!0)>=b-1)break;b--}f++}return null}function u(a){var b=null;if(!Hc[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=Ec._abbr,require("./locale/"+a),v(b)}catch(c){}return Hc[a]}function v(a,b){var c;return a&&(c="undefined"==typeof b?x(a):w(a,b),c&&(Ec=c)),Ec._abbr}function w(a,b){return null!==b?(b.abbr=a,Hc[a]||(Hc[a]=new r),Hc[a].set(b),v(a),Hc[a]):(delete Hc[a],null)}function x(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return Ec;if(!c(a)){if(b=u(a))return b;a=[a]}return t(a)}function y(a,b){var c=a.toLowerCase();Ic[c]=Ic[c+"s"]=Ic[b]=a}function z(a){return"string"==typeof a?Ic[a]||Ic[a.toLowerCase()]:void 0}function A(a){var b,c,d={};for(c in a)f(a,c)&&(b=z(c),b&&(d[b]=a[c]));return d}function B(b,c){return function(d){return null!=d?(D(this,b,d),a.updateOffset(this,c),this):C(this,b)}}function C(a,b){return a._d["get"+(a._isUTC?"UTC":"")+b]()}function D(a,b,c){return a._d["set"+(a._isUTC?"UTC":"")+b](c)}function E(a,b){var c;if("object"==typeof a)for(c in a)this.set(c,a[c]);else if(a=z(a),"function"==typeof this[a])return this[a](b);return this}function F(a,b,c){for(var d=""+Math.abs(a),e=a>=0;d.lengthb;b++)Mc[d[b]]?d[b]=Mc[d[b]]:d[b]=H(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function J(a,b){return a.isValid()?(b=K(b,a.localeData()),Lc[b]||(Lc[b]=I(b)),Lc[b](a)):a.localeData().invalidDate()}function K(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(Kc.lastIndex=0;d>=0&&Kc.test(a);)a=a.replace(Kc,c),Kc.lastIndex=0,d-=1;return a}function L(a,b,c){_c[a]="function"==typeof b?b:function(a){return a&&c?c:b}}function M(a,b){return f(_c,a)?_c[a](b._strict,b._locale):new RegExp(N(a))}function N(a){return a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function O(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),"number"==typeof b&&(d=function(a,c){c[b]=p(a)}),c=0;cd;d++){if(e=h([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}}function V(a,b){var c;return"string"==typeof b&&(b=a.localeData().monthsParse(b),"number"!=typeof b)?a:(c=Math.min(a.date(),R(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a)}function W(b){return null!=b?(V(this,b),a.updateOffset(this,!0),this):C(this,"Month")}function X(){return R(this.year(),this.month())}function Y(a){var b,c=a._a;return c&&-2===j(a).overflow&&(b=c[cd]<0||c[cd]>11?cd:c[dd]<1||c[dd]>R(c[bd],c[cd])?dd:c[ed]<0||c[ed]>24||24===c[ed]&&(0!==c[fd]||0!==c[gd]||0!==c[hd])?ed:c[fd]<0||c[fd]>59?fd:c[gd]<0||c[gd]>59?gd:c[hd]<0||c[hd]>999?hd:-1,j(a)._overflowDayOfYear&&(bd>b||b>dd)&&(b=dd),j(a).overflow=b),a}function Z(b){a.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+b)}function $(a,b){var c=!0,d=a+"\n"+(new Error).stack;return g(function(){return c&&(Z(d),c=!1),b.apply(this,arguments)},b)}function _(a,b){kd[a]||(Z(b),kd[a]=!0)}function aa(a){var b,c,d=a._i,e=ld.exec(d);if(e){for(j(a).iso=!0,b=0,c=md.length;c>b;b++)if(md[b][1].exec(d)){a._f=md[b][0]+(e[6]||" ");break}for(b=0,c=nd.length;c>b;b++)if(nd[b][1].exec(d)){a._f+=nd[b][0];break}d.match(Yc)&&(a._f+="Z"),ta(a)}else a._isValid=!1}function ba(b){var c=od.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(aa(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}function ca(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 1970>a&&h.setFullYear(a),h}function da(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function ea(a){return fa(a)?366:365}function fa(a){return a%4===0&&a%100!==0||a%400===0}function ga(){return fa(this.year())}function ha(a,b,c){var d,e=c-b,f=c-a.day();return f>e&&(f-=7),e-7>f&&(f+=7),d=Aa(a).add(f,"d"),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function ia(a){return ha(a,this._week.dow,this._week.doy).week}function ja(){return this._week.dow}function ka(){return this._week.doy}function la(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function ma(a){var b=ha(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")}function na(a,b,c,d,e){var f,g,h=da(a,0,1).getUTCDay();return h=0===h?7:h,c=null!=c?c:e,f=e-h+(h>d?7:0)-(e>h?7:0),g=7*(b-1)+(c-e)+f+1,{year:g>0?a:a-1,dayOfYear:g>0?g:ea(a-1)+g}}function oa(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function pa(a,b,c){return null!=a?a:null!=b?b:c}function qa(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:[b.getFullYear(),b.getMonth(),b.getDate()]}function ra(a){var b,c,d,e,f=[];if(!a._d){for(d=qa(a),a._w&&null==a._a[dd]&&null==a._a[cd]&&sa(a),a._dayOfYear&&(e=pa(a._a[bd],d[bd]),a._dayOfYear>ea(e)&&(j(a)._overflowDayOfYear=!0),c=da(e,0,a._dayOfYear),a._a[cd]=c.getUTCMonth(),a._a[dd]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];for(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];24===a._a[ed]&&0===a._a[fd]&&0===a._a[gd]&&0===a._a[hd]&&(a._nextDay=!0,a._a[ed]=0),a._d=(a._useUTC?da:ca).apply(null,f),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[ed]=24)}}function sa(a){var b,c,d,e,f,g,h;b=a._w,null!=b.GG||null!=b.W||null!=b.E?(f=1,g=4,c=pa(b.GG,a._a[bd],ha(Aa(),1,4).year),d=pa(b.W,1),e=pa(b.E,1)):(f=a._locale._week.dow,g=a._locale._week.doy,c=pa(b.gg,a._a[bd],ha(Aa(),f,g).year),d=pa(b.w,1),null!=b.d?(e=b.d,f>e&&++d):e=null!=b.e?b.e+f:f),h=na(c,d,e,g,f),a._a[bd]=h.year,a._dayOfYear=h.dayOfYear}function ta(b){if(b._f===a.ISO_8601)return void aa(b);b._a=[],j(b).empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,k=0;for(e=K(b._f,b._locale).match(Jc)||[],c=0;c0&&j(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),k+=d.length),Mc[f]?(d?j(b).empty=!1:j(b).unusedTokens.push(f),Q(f,d,b)):b._strict&&!d&&j(b).unusedTokens.push(f);j(b).charsLeftOver=i-k,h.length>0&&j(b).unusedInput.push(h),j(b).bigHour===!0&&b._a[ed]<=12&&b._a[ed]>0&&(j(b).bigHour=void 0),b._a[ed]=ua(b._locale,b._a[ed],b._meridiem),ra(b),Y(b)}function ua(a,b,c){var d;return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&12>b&&(b+=12),d||12!==b||(b=0),b):b}function va(a){var b,c,d,e,f;if(0===a._f.length)return j(a).invalidFormat=!0,void(a._d=new Date(0/0));for(e=0;ef)&&(d=f,c=b));g(a,c||b)}function wa(a){if(!a._d){var b=A(a._i);a._a=[b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],ra(a)}}function xa(a){var b,e=a._i,f=a._f;return a._locale=a._locale||x(a._l),null===e||void 0===f&&""===e?l({nullInput:!0}):("string"==typeof e&&(a._i=e=a._locale.preparse(e)),o(e)?new n(Y(e)):(c(f)?va(a):f?ta(a):d(e)?a._d=e:ya(a),b=new n(Y(a)),b._nextDay&&(b.add(1,"d"),b._nextDay=void 0),b))}function ya(b){var f=b._i;void 0===f?b._d=new Date:d(f)?b._d=new Date(+f):"string"==typeof f?ba(b):c(f)?(b._a=e(f.slice(0),function(a){return parseInt(a,10)}),ra(b)):"object"==typeof f?wa(b):"number"==typeof f?b._d=new Date(f):a.createFromInputFallback(b)}function za(a,b,c,d,e){var f={};return"boolean"==typeof c&&(d=c,c=void 0),f._isAMomentObject=!0,f._useUTC=f._isUTC=e,f._l=c,f._i=a,f._f=b,f._strict=d,xa(f)}function Aa(a,b,c,d){return za(a,b,c,d,!1)}function Ba(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return Aa();for(d=b[0],e=1;ea&&(a=-a,c="-"),c+F(~~(a/60),2)+b+F(~~a%60,2)})}function Ha(a){var b=(a||"").match(Yc)||[],c=b[b.length-1]||[],d=(c+"").match(td)||["-",0,0],e=+(60*d[1])+p(d[2]);return"+"===d[0]?e:-e}function Ia(b,c){var e,f;return c._isUTC?(e=c.clone(),f=(o(b)||d(b)?+b:+Aa(b))-+e,e._d.setTime(+e._d+f),a.updateOffset(e,!1),e):Aa(b).local();return c._isUTC?Aa(b).zone(c._offset||0):Aa(b).local()}function Ja(a){return 15*-Math.round(a._d.getTimezoneOffset()/15)}function Ka(b,c){var d,e=this._offset||0;return null!=b?("string"==typeof b&&(b=Ha(b)),Math.abs(b)<16&&(b=60*b),!this._isUTC&&c&&(d=Ja(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,"m"),e!==b&&(!c||this._changeInProgress?$a(this,Va(b-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?e:Ja(this)}function La(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Ma(a){return this.utcOffset(0,a)}function Na(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Ja(this),"m")),this}function Oa(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Ha(this._i)),this}function Pa(a){return a=a?Aa(a).utcOffset():0,(this.utcOffset()-a)%60===0}function Qa(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ra(){if(this._a){var a=this._isUTC?h(this._a):Aa(this._a);return this.isValid()&&q(this._a,a.toArray())>0}return!1}function Sa(){return!this._isUTC}function Ta(){return this._isUTC}function Ua(){return this._isUTC&&0===this._offset}function Va(a,b){var c,d,e,g=a,h=null;return Fa(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(g={},b?g[b]=a:g.milliseconds=a):(h=ud.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:p(h[dd])*c,h:p(h[ed])*c,m:p(h[fd])*c,s:p(h[gd])*c,ms:p(h[hd])*c}):(h=vd.exec(a))?(c="-"===h[1]?-1:1,g={y:Wa(h[2],c),M:Wa(h[3],c),d:Wa(h[4],c),h:Wa(h[5],c),m:Wa(h[6],c),s:Wa(h[7],c),w:Wa(h[8],c)}):null==g?g={}:"object"==typeof g&&("from"in g||"to"in g)&&(e=Ya(Aa(g.from),Aa(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=new Ea(g),Fa(a)&&f(a,"_locale")&&(d._locale=a._locale),d}function Wa(a,b){var c=a&&parseFloat(a.replace(",","."));return(isNaN(c)?0:c)*b}function Xa(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function Ya(a,b){var c;return b=Ia(b,a),a.isBefore(b)?c=Xa(a,b):(c=Xa(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c}function Za(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(_(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=Va(c,d),$a(this,e,a),this}}function $a(b,c,d,e){var f=c._milliseconds,g=c._days,h=c._months;e=null==e?!0:e,f&&b._d.setTime(+b._d+f*d),g&&D(b,"Date",C(b,"Date")+g*d),h&&V(b,C(b,"Month")+h*d),e&&a.updateOffset(b,g||h)}function _a(a){var b=a||Aa(),c=Ia(b,this).startOf("day"),d=this.diff(c,"days",!0),e=-6>d?"sameElse":-1>d?"lastWeek":0>d?"lastDay":1>d?"sameDay":2>d?"nextDay":7>d?"nextWeek":"sameElse";return this.format(this.localeData().calendar(e,this,Aa(b)))}function ab(){return new n(this)}function bb(a,b){var c;return b=z("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=o(a)?a:Aa(a),+this>+a):(c=o(a)?+a:+Aa(a),c<+this.clone().startOf(b))}function cb(a,b){var c;return b=z("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=o(a)?a:Aa(a),+a>+this):(c=o(a)?+a:+Aa(a),+this.clone().endOf(b)a?Math.ceil(a):Math.floor(a)}function gb(a,b,c){var d,e,f=Ia(a,this),g=6e4*(f.utcOffset()-this.utcOffset());return b=z(b),"year"===b||"month"===b||"quarter"===b?(e=hb(this,f),"quarter"===b?e/=3:"year"===b&&(e/=12)):(d=this-f,e="second"===b?d/1e3:"minute"===b?d/6e4:"hour"===b?d/36e5:"day"===b?(d-g)/864e5:"week"===b?(d-g)/6048e5:d),c?e:fb(e)}function hb(a,b){var c,d,e=12*(b.year()-a.year())+(b.month()-a.month()),f=a.clone().add(e,"months");return 0>b-f?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)}function ib(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function jb(){var a=this.clone().utc();return 0b;b++)if(this._weekdaysParse[b]||(c=Aa([2e3,1]).day(b),d="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,""),this._weekdaysParse[b]=new RegExp(d.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b}function Mb(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=Hb(a,this.localeData()),this.add(a-b,"d")):b}function Nb(a){var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function Ob(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)}function Pb(a,b){G(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}function Qb(a,b){return b._meridiemParse}function Rb(a){return"p"===(a+"").toLowerCase().charAt(0)}function Sb(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function Tb(a){G(0,[a,3],0,"millisecond")}function Ub(){return this._isUTC?"UTC":""}function Vb(){return this._isUTC?"Coordinated Universal Time":""}function Wb(a){return Aa(1e3*a)}function Xb(){return Aa.apply(null,arguments).parseZone()}function Yb(a,b,c){var d=this._calendar[a];return"function"==typeof d?d.call(b,c):d}function Zb(a){var b=this._longDateFormat[a];return!b&&this._longDateFormat[a.toUpperCase()]&&(b=this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a]=b),b}function $b(){return this._invalidDate}function _b(a){return this._ordinal.replace("%d",a)}function ac(a){return a}function bc(a,b,c,d){var e=this._relativeTime[c];return"function"==typeof e?e(a,b,c,d):e.replace(/%d/i,a)}function cc(a,b){var c=this._relativeTime[a>0?"future":"past"];return"function"==typeof c?c(b):c.replace(/%s/i,b)}function dc(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function ec(a,b,c,d){var e=x(),f=h().set(d,b);return e[c](f,a)}function fc(a,b,c,d,e){if("number"==typeof a&&(b=a,a=void 0),a=a||"",null!=b)return ec(a,b,c,e);var f,g=[];for(f=0;d>f;f++)g[f]=ec(a,f,c,e);return g}function gc(a,b){return fc(a,b,"months",12,"month")}function hc(a,b){return fc(a,b,"monthsShort",12,"month")}function ic(a,b){return fc(a,b,"weekdays",7,"day")}function jc(a,b){return fc(a,b,"weekdaysShort",7,"day")}function kc(a,b){return fc(a,b,"weekdaysMin",7,"day")}function lc(){var a=this._data;return this._milliseconds=Rd(this._milliseconds),this._days=Rd(this._days),this._months=Rd(this._months),a.milliseconds=Rd(a.milliseconds),a.seconds=Rd(a.seconds),a.minutes=Rd(a.minutes),a.hours=Rd(a.hours),a.months=Rd(a.months),a.years=Rd(a.years),this}function mc(a,b,c,d){var e=Va(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()}function nc(a,b){return mc(this,a,b,1)}function oc(a,b){return mc(this,a,b,-1)}function pc(){var a,b,c,d=this._milliseconds,e=this._days,f=this._months,g=this._data,h=0;return g.milliseconds=d%1e3,a=fb(d/1e3),g.seconds=a%60,b=fb(a/60),g.minutes=b%60,c=fb(b/60),g.hours=c%24,e+=fb(c/24),h=fb(qc(e)),e-=fb(rc(h)),f+=fb(e/30),e%=30,h+=fb(f/12),f%=12,g.days=e,g.months=f,g.years=h,this}function qc(a){return 400*a/146097}function rc(a){return 146097*a/400}function sc(a){var b,c,d=this._milliseconds;if(a=z(a),"month"===a||"year"===a)return b=this._days+d/864e5,c=this._months+12*qc(b),"month"===a?c:c/12;switch(b=this._days+Math.round(rc(this._months/12)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3;case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}}function tc(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*p(this._months/12)}function uc(a){return function(){return this.as(a)}}function vc(a){return a=z(a),this[a+"s"]()}function wc(a){return function(){return this._data[a]}}function xc(){return fb(this.days()/7)}function yc(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function zc(a,b,c){var d=Va(a).abs(),e=fe(d.as("s")),f=fe(d.as("m")),g=fe(d.as("h")),h=fe(d.as("d")),i=fe(d.as("M")),j=fe(d.as("y")),k=e0,k[4]=c,yc.apply(null,k)}function Ac(a,b){return void 0===ge[a]?!1:void 0===b?ge[a]:(ge[a]=b,!0)}function Bc(a){var b=this.localeData(),c=zc(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function Cc(){var a=he(this.years()),b=he(this.months()),c=he(this.days()),d=he(this.hours()),e=he(this.minutes()),f=he(this.seconds()+this.milliseconds()/1e3),g=this.asSeconds();return g?(0>g?"-":"")+"P"+(a?a+"Y":"")+(b?b+"M":"")+(c?c+"D":"")+(d||e||f?"T":"")+(d?d+"H":"")+(e?e+"M":"")+(f?f+"S":""):"P0D"}var Dc,Ec,Fc=a.momentProperties=[],Gc=!1,Hc={},Ic={},Jc=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|x|X|zz?|ZZ?|.)/g,Kc=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Lc={},Mc={},Nc=/\d/,Oc=/\d\d/,Pc=/\d{3}/,Qc=/\d{4}/,Rc=/[+-]?\d{6}/,Sc=/\d\d?/,Tc=/\d{1,3}/,Uc=/\d{1,4}/,Vc=/[+-]?\d{1,6}/,Wc=/\d+/,Xc=/[+-]?\d+/,Yc=/Z|[+-]\d\d:?\d\d/gi,Zc=/[+-]?\d+(\.\d{1,3})?/,$c=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,_c={},ad={},bd=0,cd=1,dd=2,ed=3,fd=4,gd=5,hd=6;G("M",["MM",2],"Mo",function(){return this.month()+1}),G("MMM",0,0,function(a){return this.localeData().monthsShort(this,a)}),G("MMMM",0,0,function(a){return this.localeData().months(this,a)}),y("month","M"),L("M",Sc),L("MM",Sc,Oc),L("MMM",$c),L("MMMM",$c),O(["M","MM"],function(a,b){b[cd]=p(a)-1}),O(["MMM","MMMM"],function(a,b,c,d){var e=c._locale.monthsParse(a,d,c._strict);null!=e?b[cd]=e:j(c).invalidMonth=a});var id="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),jd="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),kd={};a.suppressDeprecationWarnings=!1;var ld=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,md=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],nd=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],od=/^\/?Date\((\-?\d+)/i;a.createFromInputFallback=$("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}),G(0,["YY",2],0,function(){return this.year()%100}),G(0,["YYYY",4],0,"year"),G(0,["YYYYY",5],0,"year"),G(0,["YYYYYY",6,!0],0,"year"),y("year","y"),L("Y",Xc),L("YY",Sc,Oc),L("YYYY",Uc,Qc),L("YYYYY",Vc,Rc),L("YYYYYY",Vc,Rc),O(["YYYY","YYYYY","YYYYYY"],bd),O("YY",function(b,c){c[bd]=a.parseTwoDigitYear(b)}),a.parseTwoDigitYear=function(a){return p(a)+(p(a)>68?1900:2e3)};var pd=B("FullYear",!1);G("w",["ww",2],"wo","week"),G("W",["WW",2],"Wo","isoWeek"),y("week","w"),y("isoWeek","W"),L("w",Sc),L("ww",Sc,Oc),L("W",Sc),L("WW",Sc,Oc),P(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=p(a)});var qd={dow:0,doy:6};G("DDD",["DDDD",3],"DDDo","dayOfYear"),y("dayOfYear","DDD"),L("DDD",Tc),L("DDDD",Pc),O(["DDD","DDDD"],function(a,b,c){c._dayOfYear=p(a)}),a.ISO_8601=function(){};var rd=$("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var a=Aa.apply(null,arguments);return this>a?this:a}),sd=$("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var a=Aa.apply(null,arguments);return a>this?this:a});Ga("Z",":"),Ga("ZZ",""),L("Z",Yc),L("ZZ",Yc),O(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=Ha(a)});var td=/([\+\-]|\d\d)/gi;a.updateOffset=function(){};var ud=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,vd=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Va.fn=Ea.prototype;var wd=Za(1,"add"),xd=Za(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var yd=$("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)});G(0,["gg",2],0,function(){return this.weekYear()%100}),G(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ab("gggg","weekYear"),Ab("ggggg","weekYear"),Ab("GGGG","isoWeekYear"),Ab("GGGGG","isoWeekYear"),y("weekYear","gg"),y("isoWeekYear","GG"),L("G",Xc),L("g",Xc),L("GG",Sc,Oc),L("gg",Sc,Oc),L("GGGG",Uc,Qc),L("gggg",Uc,Qc),L("GGGGG",Vc,Rc),L("ggggg",Vc,Rc),P(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=p(a)}),P(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}),G("Q",0,0,"quarter"),y("quarter","Q"),L("Q",Nc),O("Q",function(a,b){b[cd]=3*(p(a)-1)}),G("D",["DD",2],"Do","date"),y("date","D"),L("D",Sc),L("DD",Sc,Oc),L("Do",function(a,b){return a?b._ordinalParse:b._ordinalParseLenient}),O(["D","DD"],dd),O("Do",function(a,b){b[dd]=p(a.match(Sc)[0],10)});var zd=B("Date",!0);G("d",0,"do","day"),G("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),G("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),G("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),G("e",0,0,"weekday"),G("E",0,0,"isoWeekday"),y("day","d"),y("weekday","e"),y("isoWeekday","E"),L("d",Sc),L("e",Sc),L("E",Sc),L("dd",$c),L("ddd",$c),L("dddd",$c),P(["dd","ddd","dddd"],function(a,b,c){var d=c._locale.weekdaysParse(a);null!=d?b.d=d:j(c).invalidWeekday=a}),P(["d","e","E"],function(a,b,c,d){b[d]=p(a)});var Ad="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Bd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Cd="Su_Mo_Tu_We_Th_Fr_Sa".split("_");G("H",["HH",2],0,"hour"),G("h",["hh",2],0,function(){return this.hours()%12||12}),Pb("a",!0),Pb("A",!1),y("hour","h"),L("a",Qb),L("A",Qb),L("H",Sc),L("h",Sc),L("HH",Sc,Oc),L("hh",Sc,Oc),O(["H","HH"],ed),O(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),O(["h","hh"],function(a,b,c){b[ed]=p(a),j(c).bigHour=!0});var Dd=/[ap]\.?m?\.?/i,Ed=B("Hours",!0);G("m",["mm",2],0,"minute"),y("minute","m"),L("m",Sc),L("mm",Sc,Oc),O(["m","mm"],fd);var Fd=B("Minutes",!1);G("s",["ss",2],0,"second"),y("second","s"),L("s",Sc),L("ss",Sc,Oc),O(["s","ss"],gd);var Gd=B("Seconds",!1);G("S",0,0,function(){return~~(this.millisecond()/100)}),G(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),Tb("SSS"),Tb("SSSS"),y("millisecond","ms"),L("S",Tc,Nc),L("SS",Tc,Oc),L("SSS",Tc,Pc),L("SSSS",Wc),O(["S","SS","SSS","SSSS"],function(a,b){b[hd]=p(1e3*("0."+a))});var Hd=B("Milliseconds",!1);G("z",0,0,"zoneAbbr"),G("zz",0,0,"zoneName");var Id=n.prototype;Id.add=wd,Id.calendar=_a,Id.clone=ab,Id.diff=gb,Id.endOf=sb,Id.format=kb,Id.from=lb,Id.fromNow=mb,Id.to=nb,Id.toNow=ob,Id.get=E,Id.invalidAt=zb,Id.isAfter=bb,Id.isBefore=cb,Id.isBetween=db,Id.isSame=eb,Id.isValid=xb,Id.lang=yd,Id.locale=pb,Id.localeData=qb,Id.max=sd,Id.min=rd,Id.parsingFlags=yb,Id.set=E,Id.startOf=rb,Id.subtract=xd,Id.toArray=wb,Id.toDate=vb,Id.toISOString=jb,Id.toJSON=jb,Id.toString=ib,Id.unix=ub,Id.valueOf=tb,Id.year=pd,Id.isLeapYear=ga,Id.weekYear=Cb,Id.isoWeekYear=Db,Id.quarter=Id.quarters=Gb,Id.month=W,Id.daysInMonth=X,Id.week=Id.weeks=la,Id.isoWeek=Id.isoWeeks=ma,Id.weeksInYear=Fb,Id.isoWeeksInYear=Eb,Id.date=zd,Id.day=Id.days=Mb,Id.weekday=Nb,Id.isoWeekday=Ob,Id.dayOfYear=oa,Id.hour=Id.hours=Ed,Id.minute=Id.minutes=Fd,Id.second=Id.seconds=Gd,Id.millisecond=Id.milliseconds=Hd,Id.utcOffset=Ka,Id.utc=Ma,Id.local=Na,Id.parseZone=Oa,Id.hasAlignedHourOffset=Pa,Id.isDST=Qa,Id.isDSTShifted=Ra,Id.isLocal=Sa,Id.isUtcOffset=Ta,Id.isUtc=Ua,Id.isUTC=Ua,Id.zoneAbbr=Ub,Id.zoneName=Vb,Id.dates=$("dates accessor is deprecated. Use date instead.",zd),Id.months=$("months accessor is deprecated. Use month instead",W),Id.years=$("years accessor is deprecated. Use year instead",pd),Id.zone=$("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",La);var Jd=Id,Kd={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Ld={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY LT",LLLL:"dddd, MMMM D, YYYY LT"},Md="Invalid date",Nd="%d",Od=/\d{1,2}/,Pd={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour", +hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Qd=r.prototype;Qd._calendar=Kd,Qd.calendar=Yb,Qd._longDateFormat=Ld,Qd.longDateFormat=Zb,Qd._invalidDate=Md,Qd.invalidDate=$b,Qd._ordinal=Nd,Qd.ordinal=_b,Qd._ordinalParse=Od,Qd.preparse=ac,Qd.postformat=ac,Qd._relativeTime=Pd,Qd.relativeTime=bc,Qd.pastFuture=cc,Qd.set=dc,Qd.months=S,Qd._months=id,Qd.monthsShort=T,Qd._monthsShort=jd,Qd.monthsParse=U,Qd.week=ia,Qd._week=qd,Qd.firstDayOfYear=ka,Qd.firstDayOfWeek=ja,Qd.weekdays=Ib,Qd._weekdays=Ad,Qd.weekdaysMin=Kb,Qd._weekdaysMin=Cd,Qd.weekdaysShort=Jb,Qd._weekdaysShort=Bd,Qd.weekdaysParse=Lb,Qd.isPM=Rb,Qd._meridiemParse=Dd,Qd.meridiem=Sb,v("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===p(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.lang=$("moment.lang is deprecated. Use moment.locale instead.",v),a.langData=$("moment.langData is deprecated. Use moment.localeData instead.",x);var Rd=Math.abs,Sd=uc("ms"),Td=uc("s"),Ud=uc("m"),Vd=uc("h"),Wd=uc("d"),Xd=uc("w"),Yd=uc("M"),Zd=uc("y"),$d=wc("milliseconds"),_d=wc("seconds"),ae=wc("minutes"),be=wc("hours"),ce=wc("days"),de=wc("months"),ee=wc("years"),fe=Math.round,ge={s:45,m:45,h:22,d:26,M:11},he=Math.abs,ie=Ea.prototype;ie.abs=lc,ie.add=nc,ie.subtract=oc,ie.as=sc,ie.asMilliseconds=Sd,ie.asSeconds=Td,ie.asMinutes=Ud,ie.asHours=Vd,ie.asDays=Wd,ie.asWeeks=Xd,ie.asMonths=Yd,ie.asYears=Zd,ie.valueOf=tc,ie._bubble=pc,ie.get=vc,ie.milliseconds=$d,ie.seconds=_d,ie.minutes=ae,ie.hours=be,ie.days=ce,ie.weeks=xc,ie.months=de,ie.years=ee,ie.humanize=Bc,ie.toISOString=Cc,ie.toString=Cc,ie.toJSON=Cc,ie.locale=pb,ie.localeData=qb,ie.toIsoString=$("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Cc),ie.lang=yd,G("X",0,0,"unix"),G("x",0,0,"valueOf"),L("x",Xc),L("X",Zc),O("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),O("x",function(a,b,c){c._d=new Date(p(a))}),a.version="2.10.3",b(Aa),a.fn=Jd,a.min=Ca,a.max=Da,a.utc=h,a.unix=Wb,a.months=gc,a.isDate=d,a.locale=v,a.invalid=l,a.duration=Va,a.isMoment=o,a.weekdays=ic,a.parseZone=Xb,a.localeData=x,a.isDuration=Fa,a.monthsShort=hc,a.weekdaysMin=kc,a.defineLocale=w,a.weekdaysShort=jc,a.normalizeUnits=z,a.relativeTimeThreshold=Ac;var je=a;return je}); \ No newline at end of file diff --git a/app/lib/odometer.min.js b/app/lib/odometer.min.js new file mode 100644 index 00000000..2c08ad76 --- /dev/null +++ b/app/lib/odometer.min.js @@ -0,0 +1,2 @@ +/*! odometer 0.4.7 */ +(function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G=[].slice;q='',n=''+q+"",d='8'+n+"",g='',c="(,ddd).dd",h=/^\(?([^)]*)\)?(?:(.)(d+))?$/,i=30,f=2e3,a=20,j=2,e=.5,k=1e3/i,b=1e3/a,o="transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",y=document.createElement("div").style,p=null!=y.transition||null!=y.webkitTransition||null!=y.mozTransition||null!=y.oTransition,w=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,l=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,s=function(a){var b;return b=document.createElement("div"),b.innerHTML=a,b.children[0]},v=function(a,b){return a.className=a.className.replace(new RegExp("(^| )"+b.split(" ").join("|")+"( |$)","gi")," ")},r=function(a,b){return v(a,b),a.className+=" "+b},z=function(a,b){var c;return null!=document.createEvent?(c=document.createEvent("HTMLEvents"),c.initEvent(b,!0,!0),a.dispatchEvent(c)):void 0},u=function(){var a,b;return null!=(a=null!=(b=window.performance)&&"function"==typeof b.now?b.now():void 0)?a:+new Date},x=function(a,b){return null==b&&(b=0),b?(a*=Math.pow(10,b),a+=.5,a=Math.floor(a),a/=Math.pow(10,b)):Math.round(a)},A=function(a){return 0>a?Math.ceil(a):Math.floor(a)},t=function(a){return a-x(a)},C=!1,(B=function(){var a,b,c,d,e;if(!C&&null!=window.jQuery){for(C=!0,d=["html","text"],e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(function(a){var b;return b=window.jQuery.fn[a],window.jQuery.fn[a]=function(a){var c;return null==a||null==(null!=(c=this[0])?c.odometer:void 0)?b.apply(this,arguments):this[0].odometer.update(a)}}(a));return e}})(),setTimeout(B,0),m=function(){function a(b){var c,d,e,g,h,i,l,m,n,o,p=this;if(this.options=b,this.el=this.options.el,null!=this.el.odometer)return this.el.odometer;this.el.odometer=this,m=a.options;for(d in m)g=m[d],null==this.options[d]&&(this.options[d]=g);null==(h=this.options).duration&&(h.duration=f),this.MAX_VALUES=this.options.duration/k/j|0,this.resetFormat(),this.value=this.cleanValue(null!=(n=this.options.value)?n:""),this.renderInside(),this.render();try{for(o=["innerHTML","innerText","textContent"],i=0,l=o.length;l>i;i++)e=o[i],null!=this.el[e]&&!function(a){return Object.defineProperty(p.el,a,{get:function(){var b;return"innerHTML"===a?p.inside.outerHTML:null!=(b=p.inside.innerText)?b:p.inside.textContent},set:function(a){return p.update(a)}})}(e)}catch(q){c=q,this.watchForMutations()}}return a.prototype.renderInside=function(){return this.inside=document.createElement("div"),this.inside.className="odometer-inside",this.el.innerHTML="",this.el.appendChild(this.inside)},a.prototype.watchForMutations=function(){var a,b=this;if(null!=l)try{return null==this.observer&&(this.observer=new l(function(){var a;return a=b.el.innerText,b.renderInside(),b.render(b.value),b.update(a)})),this.watchMutations=!0,this.startWatchingMutations()}catch(c){a=c}},a.prototype.startWatchingMutations=function(){return this.watchMutations?this.observer.observe(this.el,{childList:!0}):void 0},a.prototype.stopWatchingMutations=function(){var a;return null!=(a=this.observer)?a.disconnect():void 0},a.prototype.cleanValue=function(a){var b;return"string"==typeof a&&(a=a.replace(null!=(b=this.format.radix)?b:".",""),a=a.replace(/[.,]/g,""),a=a.replace("","."),a=parseFloat(a,10)||0),x(a,this.format.precision)},a.prototype.bindTransitionEnd=function(){var a,b,c,d,e,f,g=this;if(!this.transitionEndBound){for(this.transitionEndBound=!0,b=!1,e=o.split(" "),f=[],c=0,d=e.length;d>c;c++)a=e[c],f.push(this.el.addEventListener(a,function(){return b?!0:(b=!0,setTimeout(function(){return g.render(),b=!1,z(g.el,"odometerdone")},0),!0)},!1));return f}},a.prototype.resetFormat=function(){var a,b,d,e,f,g,i,j;if(a=null!=(i=this.options.format)?i:c,a||(a="d"),d=h.exec(a),!d)throw new Error("Odometer: Unparsable digit format");return j=d.slice(1,4),g=j[0],f=j[1],b=j[2],e=(null!=b?b.length:void 0)||0,this.format={repeating:g,radix:f,precision:e}},a.prototype.render=function(a){var b,c,d,e,f,g,h;for(null==a&&(a=this.value),this.stopWatchingMutations(),this.resetFormat(),this.inside.innerHTML="",f=this.options.theme,b=this.el.className.split(" "),e=[],g=0,h=b.length;h>g;g++)c=b[g],c.length&&((d=/^odometer-theme-(.+)$/.exec(c))?f=d[1]:/^odometer(-|$)/.test(c)||e.push(c));return e.push("odometer"),p||e.push("odometer-no-transitions"),e.push(f?"odometer-theme-"+f:"odometer-auto-theme"),this.el.className=e.join(" "),this.ribbons={},this.formatDigits(a),this.startWatchingMutations()},a.prototype.formatDigits=function(a){var b,c,d,e,f,g,h,i,j,k;if(this.digits=[],this.options.formatFunction)for(d=this.options.formatFunction(a),j=d.split("").reverse(),f=0,h=j.length;h>f;f++)c=j[f],c.match(/0-9/)?(b=this.renderDigit(),b.querySelector(".odometer-value").innerHTML=c,this.digits.push(b),this.insertDigit(b)):this.addSpacer(c);else for(e=!this.format.precision||!t(a)||!1,k=a.toString().split("").reverse(),g=0,i=k.length;i>g;g++)b=k[g],"."===b&&(e=!0),this.addDigit(b,e)},a.prototype.update=function(a){var b,c=this;return a=this.cleanValue(a),(b=a-this.value)?(v(this.el,"odometer-animating-up odometer-animating-down odometer-animating"),b>0?r(this.el,"odometer-animating-up"):r(this.el,"odometer-animating-down"),this.stopWatchingMutations(),this.animate(a),this.startWatchingMutations(),setTimeout(function(){return c.el.offsetHeight,r(c.el,"odometer-animating")},0),this.value=a):void 0},a.prototype.renderDigit=function(){return s(d)},a.prototype.insertDigit=function(a,b){return null!=b?this.inside.insertBefore(a,b):this.inside.children.length?this.inside.insertBefore(a,this.inside.children[0]):this.inside.appendChild(a)},a.prototype.addSpacer=function(a,b,c){var d;return d=s(g),d.innerHTML=a,c&&r(d,c),this.insertDigit(d,b)},a.prototype.addDigit=function(a,b){var c,d,e,f;if(null==b&&(b=!0),"-"===a)return this.addSpacer(a,null,"odometer-negation-mark");if("."===a)return this.addSpacer(null!=(f=this.format.radix)?f:".",null,"odometer-radix-mark");if(b)for(e=!1;;){if(!this.format.repeating.length){if(e)throw new Error("Bad odometer format without digits");this.resetFormat(),e=!0}if(c=this.format.repeating[this.format.repeating.length-1],this.format.repeating=this.format.repeating.substring(0,this.format.repeating.length-1),"d"===c)break;this.addSpacer(c)}return d=this.renderDigit(),d.querySelector(".odometer-value").innerHTML=a,this.digits.push(d),this.insertDigit(d)},a.prototype.animate=function(a){return p&&"count"!==this.options.animation?this.animateSlide(a):this.animateCount(a)},a.prototype.animateCount=function(a){var c,d,e,f,g,h=this;if(d=+a-this.value)return f=e=u(),c=this.value,(g=function(){var i,j,k;return u()-f>h.options.duration?(h.value=a,h.render(),void z(h.el,"odometerdone")):(i=u()-e,i>b&&(e=u(),k=i/h.options.duration,j=d*k,c+=j,h.render(Math.round(c))),null!=w?w(g):setTimeout(g,b))})()},a.prototype.getDigitCount=function(){var a,b,c,d,e,f;for(d=1<=arguments.length?G.call(arguments,0):[],a=e=0,f=d.length;f>e;a=++e)c=d[a],d[a]=Math.abs(c);return b=Math.max.apply(Math,d),Math.ceil(Math.log(b+1)/Math.log(10))},a.prototype.getFractionalDigitCount=function(){var a,b,c,d,e,f,g;for(e=1<=arguments.length?G.call(arguments,0):[],b=/^\-?\d*\.(\d*?)0*$/,a=f=0,g=e.length;g>f;a=++f)d=e[a],e[a]=d.toString(),c=b.exec(e[a]),e[a]=null==c?0:c[1].length;return Math.max.apply(Math,e)},a.prototype.resetDigits=function(){return this.digits=[],this.ribbons=[],this.inside.innerHTML="",this.resetFormat()},a.prototype.animateSlide=function(a){var b,c,d,f,g,h,i,j,k,l,m,n,o,p,q,s,t,u,v,w,x,y,z,B,C,D,E;if(s=this.value,j=this.getFractionalDigitCount(s,a),j&&(a*=Math.pow(10,j),s*=Math.pow(10,j)),d=a-s){for(this.bindTransitionEnd(),f=this.getDigitCount(s,a),g=[],b=0,m=v=0;f>=0?f>v:v>f;m=f>=0?++v:--v){if(t=A(s/Math.pow(10,f-m-1)),i=A(a/Math.pow(10,f-m-1)),h=i-t,Math.abs(h)>this.MAX_VALUES){for(l=[],n=h/(this.MAX_VALUES+this.MAX_VALUES*b*e),c=t;h>0&&i>c||0>h&&c>i;)l.push(Math.round(c)),c+=n;l[l.length-1]!==i&&l.push(i),b++}else l=function(){E=[];for(var a=t;i>=t?i>=a:a>=i;i>=t?a++:a--)E.push(a);return E}.apply(this);for(m=w=0,y=l.length;y>w;m=++w)k=l[m],l[m]=Math.abs(k%10);g.push(l)}for(this.resetDigits(),D=g.reverse(),m=x=0,z=D.length;z>x;m=++x)for(l=D[m],this.digits[m]||this.addDigit(" ",m>=j),null==(u=this.ribbons)[m]&&(u[m]=this.digits[m].querySelector(".odometer-ribbon-inner")),this.ribbons[m].innerHTML="",0>d&&(l=l.reverse()),o=C=0,B=l.length;B>C;o=++C)k=l[o],q=document.createElement("div"),q.className="odometer-value",q.innerHTML=k,this.ribbons[m].appendChild(q),o===l.length-1&&r(q,"odometer-last-value"),0===o&&r(q,"odometer-first-value");return 0>t&&this.addDigit("-"),p=this.inside.querySelector(".odometer-radix-mark"),null!=p&&p.parent.removeChild(p),j?this.addSpacer(this.format.radix,this.digits[j-1],"odometer-radix-mark"):void 0}},a}(),m.options=null!=(E=window.odometerOptions)?E:{},setTimeout(function(){var a,b,c,d,e;if(window.odometerOptions){d=window.odometerOptions,e=[];for(a in d)b=d[a],e.push(null!=(c=m.options)[a]?(c=m.options)[a]:c[a]=b);return e}},0),m.init=function(){var a,b,c,d,e,f;if(null!=document.querySelectorAll){for(b=document.querySelectorAll(m.options.selector||".odometer"),f=[],c=0,d=b.length;d>c;c++)a=b[c],f.push(a.odometer=new m({el:a,value:null!=(e=a.innerText)?e:a.textContent}));return f}},null!=(null!=(F=document.documentElement)?F.doScroll:void 0)&&null!=document.createEventObject?(D=document.onreadystatechange,document.onreadystatechange=function(){return"complete"===document.readyState&&m.options.auto!==!1&&m.init(),null!=D?D.apply(this,arguments):void 0}):document.addEventListener("DOMContentLoaded",function(){return m.options.auto!==!1?m.init():void 0},!1),"function"==typeof define&&define.amd?define(["jquery"],function(){return m}):"undefined"!=typeof exports&&null!==exports?module.exports=m:window.Odometer=m}).call(this); \ No newline at end of file diff --git a/app/lib/require.js b/app/lib/require.js deleted file mode 100644 index 7f31fa20..00000000 --- a/app/lib/require.js +++ /dev/null @@ -1,2076 +0,0 @@ -/** vim: et:ts=4:sw=4:sts=4 - * @license RequireJS 2.1.14 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ -//Not using strict: uneven strict support in browsers, #392, and causes -//problems with requirejs.exec()/transpiler plugins that may not be strict. -/*jslint regexp: true, nomen: true, sloppy: true */ -/*global window, navigator, document, importScripts, setTimeout, opera */ - -var requirejs, require, define; -(function (global) { - var req, s, head, baseElement, dataMain, src, - interactiveScript, currentlyAddingScript, mainScript, subPath, - version = '2.1.14', - commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg, - cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g, - jsSuffixRegExp = /\.js$/, - currDirRegExp = /^\.\//, - op = Object.prototype, - ostring = op.toString, - hasOwn = op.hasOwnProperty, - ap = Array.prototype, - apsp = ap.splice, - isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document), - isWebWorker = !isBrowser && typeof importScripts !== 'undefined', - //PS3 indicates loaded and complete, but need to wait for complete - //specifically. Sequence is 'loading', 'loaded', execution, - // then 'complete'. The UA check is unfortunate, but not sure how - //to feature test w/o causing perf issues. - readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ? - /^complete$/ : /^(complete|loaded)$/, - defContextName = '_', - //Oh the tragedy, detecting opera. See the usage of isOpera for reason. - isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]', - contexts = {}, - cfg = {}, - globalDefQueue = [], - useInteractive = false; - - function isFunction(it) { - return ostring.call(it) === '[object Function]'; - } - - function isArray(it) { - return ostring.call(it) === '[object Array]'; - } - - /** - * Helper function for iterating over an array. If the func returns - * a true value, it will break out of the loop. - */ - function each(ary, func) { - if (ary) { - var i; - for (i = 0; i < ary.length; i += 1) { - if (ary[i] && func(ary[i], i, ary)) { - break; - } - } - } - } - - /** - * Helper function for iterating over an array backwards. If the func - * returns a true value, it will break out of the loop. - */ - function eachReverse(ary, func) { - if (ary) { - var i; - for (i = ary.length - 1; i > -1; i -= 1) { - if (ary[i] && func(ary[i], i, ary)) { - break; - } - } - } - } - - function hasProp(obj, prop) { - return hasOwn.call(obj, prop); - } - - function getOwn(obj, prop) { - return hasProp(obj, prop) && obj[prop]; - } - - /** - * Cycles over properties in an object and calls a function for each - * property value. If the function returns a truthy value, then the - * iteration is stopped. - */ - function eachProp(obj, func) { - var prop; - for (prop in obj) { - if (hasProp(obj, prop)) { - if (func(obj[prop], prop)) { - break; - } - } - } - } - - /** - * Simple function to mix in properties from source into target, - * but only if target does not already have a property of the same name. - */ - function mixin(target, source, force, deepStringMixin) { - if (source) { - eachProp(source, function (value, prop) { - if (force || !hasProp(target, prop)) { - if (deepStringMixin && typeof value === 'object' && value && - !isArray(value) && !isFunction(value) && - !(value instanceof RegExp)) { - - if (!target[prop]) { - target[prop] = {}; - } - mixin(target[prop], value, force, deepStringMixin); - } else { - target[prop] = value; - } - } - }); - } - return target; - } - - //Similar to Function.prototype.bind, but the 'this' object is specified - //first, since it is easier to read/figure out what 'this' will be. - function bind(obj, fn) { - return function () { - return fn.apply(obj, arguments); - }; - } - - function scripts() { - return document.getElementsByTagName('script'); - } - - function defaultOnError(err) { - throw err; - } - - //Allow getting a global that is expressed in - //dot notation, like 'a.b.c'. - function getGlobal(value) { - if (!value) { - return value; - } - var g = global; - each(value.split('.'), function (part) { - g = g[part]; - }); - return g; - } - - /** - * Constructs an error with a pointer to an URL with more information. - * @param {String} id the error ID that maps to an ID on a web page. - * @param {String} message human readable error. - * @param {Error} [err] the original error, if there is one. - * - * @returns {Error} - */ - function makeError(id, msg, err, requireModules) { - var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id); - e.requireType = id; - e.requireModules = requireModules; - if (err) { - e.originalError = err; - } - return e; - } - - if (typeof define !== 'undefined') { - //If a define is already in play via another AMD loader, - //do not overwrite. - return; - } - - if (typeof requirejs !== 'undefined') { - if (isFunction(requirejs)) { - //Do not overwrite an existing requirejs instance. - return; - } - cfg = requirejs; - requirejs = undefined; - } - - //Allow for a require config object - if (typeof require !== 'undefined' && !isFunction(require)) { - //assume it is a config object. - cfg = require; - require = undefined; - } - - function newContext(contextName) { - var inCheckLoaded, Module, context, handlers, - checkLoadedTimeoutId, - config = { - //Defaults. Do not set a default for map - //config to speed up normalize(), which - //will run faster if there is no default. - waitSeconds: 7, - baseUrl: './', - paths: {}, - bundles: {}, - pkgs: {}, - shim: {}, - config: {} - }, - registry = {}, - //registry of just enabled modules, to speed - //cycle breaking code when lots of modules - //are registered, but not activated. - enabledRegistry = {}, - undefEvents = {}, - defQueue = [], - defined = {}, - urlFetched = {}, - bundlesMap = {}, - requireCounter = 1, - unnormalizedCounter = 1; - - /** - * Trims the . and .. from an array of path segments. - * It will keep a leading path segment if a .. will become - * the first path segment, to help with module name lookups, - * which act like paths, but can be remapped. But the end result, - * all paths that use this function should look normalized. - * NOTE: this method MODIFIES the input array. - * @param {Array} ary the array of path segments. - */ - function trimDots(ary) { - var i, part; - for (i = 0; i < ary.length; i++) { - part = ary[i]; - if (part === '.') { - ary.splice(i, 1); - i -= 1; - } else if (part === '..') { - // If at the start, or previous value is still .., - // keep them so that when converted to a path it may - // still work when converted to a path, even though - // as an ID it is less than ideal. In larger point - // releases, may be better to just kick out an error. - if (i === 0 || (i == 1 && ary[2] === '..') || ary[i - 1] === '..') { - continue; - } else if (i > 0) { - ary.splice(i - 1, 2); - i -= 2; - } - } - } - } - - /** - * Given a relative module name, like ./something, normalize it to - * a real name that can be mapped to a path. - * @param {String} name the relative name - * @param {String} baseName a real name that the name arg is relative - * to. - * @param {Boolean} applyMap apply the map config to the value. Should - * only be done if this normalization is for a dependency ID. - * @returns {String} normalized name - */ - function normalize(name, baseName, applyMap) { - var pkgMain, mapValue, nameParts, i, j, nameSegment, lastIndex, - foundMap, foundI, foundStarMap, starI, normalizedBaseParts, - baseParts = (baseName && baseName.split('/')), - map = config.map, - starMap = map && map['*']; - - //Adjust any relative paths. - if (name) { - name = name.split('/'); - lastIndex = name.length - 1; - - // If wanting node ID compatibility, strip .js from end - // of IDs. Have to do this here, and not in nameToUrl - // because node allows either .js or non .js to map - // to same file. - if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) { - name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, ''); - } - - // Starts with a '.' so need the baseName - if (name[0].charAt(0) === '.' && baseParts) { - //Convert baseName to array, and lop off the last part, - //so that . matches that 'directory' and not name of the baseName's - //module. For instance, baseName of 'one/two/three', maps to - //'one/two/three.js', but we want the directory, 'one/two' for - //this normalization. - normalizedBaseParts = baseParts.slice(0, baseParts.length - 1); - name = normalizedBaseParts.concat(name); - } - - trimDots(name); - name = name.join('/'); - } - - //Apply map config if available. - if (applyMap && map && (baseParts || starMap)) { - nameParts = name.split('/'); - - outerLoop: for (i = nameParts.length; i > 0; i -= 1) { - nameSegment = nameParts.slice(0, i).join('/'); - - if (baseParts) { - //Find the longest baseName segment match in the config. - //So, do joins on the biggest to smallest lengths of baseParts. - for (j = baseParts.length; j > 0; j -= 1) { - mapValue = getOwn(map, baseParts.slice(0, j).join('/')); - - //baseName segment has config, find if it has one for - //this name. - if (mapValue) { - mapValue = getOwn(mapValue, nameSegment); - if (mapValue) { - //Match, update name to the new value. - foundMap = mapValue; - foundI = i; - break outerLoop; - } - } - } - } - - //Check for a star map match, but just hold on to it, - //if there is a shorter segment match later in a matching - //config, then favor over this star map. - if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) { - foundStarMap = getOwn(starMap, nameSegment); - starI = i; - } - } - - if (!foundMap && foundStarMap) { - foundMap = foundStarMap; - foundI = starI; - } - - if (foundMap) { - nameParts.splice(0, foundI, foundMap); - name = nameParts.join('/'); - } - } - - // If the name points to a package's name, use - // the package main instead. - pkgMain = getOwn(config.pkgs, name); - - return pkgMain ? pkgMain : name; - } - - function removeScript(name) { - if (isBrowser) { - each(scripts(), function (scriptNode) { - if (scriptNode.getAttribute('data-requiremodule') === name && - scriptNode.getAttribute('data-requirecontext') === context.contextName) { - scriptNode.parentNode.removeChild(scriptNode); - return true; - } - }); - } - } - - function hasPathFallback(id) { - var pathConfig = getOwn(config.paths, id); - if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) { - //Pop off the first array value, since it failed, and - //retry - pathConfig.shift(); - context.require.undef(id); - - //Custom require that does not do map translation, since - //ID is "absolute", already mapped/resolved. - context.makeRequire(null, { - skipMap: true - })([id]); - - return true; - } - } - - //Turns a plugin!resource to [plugin, resource] - //with the plugin being undefined if the name - //did not have a plugin prefix. - function splitPrefix(name) { - var prefix, - index = name ? name.indexOf('!') : -1; - if (index > -1) { - prefix = name.substring(0, index); - name = name.substring(index + 1, name.length); - } - return [prefix, name]; - } - - /** - * Creates a module mapping that includes plugin prefix, module - * name, and path. If parentModuleMap is provided it will - * also normalize the name via require.normalize() - * - * @param {String} name the module name - * @param {String} [parentModuleMap] parent module map - * for the module name, used to resolve relative names. - * @param {Boolean} isNormalized: is the ID already normalized. - * This is true if this call is done for a define() module ID. - * @param {Boolean} applyMap: apply the map config to the ID. - * Should only be true if this map is for a dependency. - * - * @returns {Object} - */ - function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) { - var url, pluginModule, suffix, nameParts, - prefix = null, - parentName = parentModuleMap ? parentModuleMap.name : null, - originalName = name, - isDefine = true, - normalizedName = ''; - - //If no name, then it means it is a require call, generate an - //internal name. - if (!name) { - isDefine = false; - name = '_@r' + (requireCounter += 1); - } - - nameParts = splitPrefix(name); - prefix = nameParts[0]; - name = nameParts[1]; - - if (prefix) { - prefix = normalize(prefix, parentName, applyMap); - pluginModule = getOwn(defined, prefix); - } - - //Account for relative paths if there is a base name. - if (name) { - if (prefix) { - if (pluginModule && pluginModule.normalize) { - //Plugin is loaded, use its normalize method. - normalizedName = pluginModule.normalize(name, function (name) { - return normalize(name, parentName, applyMap); - }); - } else { - // If nested plugin references, then do not try to - // normalize, as it will not normalize correctly. This - // places a restriction on resourceIds, and the longer - // term solution is not to normalize until plugins are - // loaded and all normalizations to allow for async - // loading of a loader plugin. But for now, fixes the - // common uses. Details in #1131 - normalizedName = name.indexOf('!') === -1 ? - normalize(name, parentName, applyMap) : - name; - } - } else { - //A regular module. - normalizedName = normalize(name, parentName, applyMap); - - //Normalized name may be a plugin ID due to map config - //application in normalize. The map config values must - //already be normalized, so do not need to redo that part. - nameParts = splitPrefix(normalizedName); - prefix = nameParts[0]; - normalizedName = nameParts[1]; - isNormalized = true; - - url = context.nameToUrl(normalizedName); - } - } - - //If the id is a plugin id that cannot be determined if it needs - //normalization, stamp it with a unique ID so two matching relative - //ids that may conflict can be separate. - suffix = prefix && !pluginModule && !isNormalized ? - '_unnormalized' + (unnormalizedCounter += 1) : - ''; - - return { - prefix: prefix, - name: normalizedName, - parentMap: parentModuleMap, - unnormalized: !!suffix, - url: url, - originalName: originalName, - isDefine: isDefine, - id: (prefix ? - prefix + '!' + normalizedName : - normalizedName) + suffix - }; - } - - function getModule(depMap) { - var id = depMap.id, - mod = getOwn(registry, id); - - if (!mod) { - mod = registry[id] = new context.Module(depMap); - } - - return mod; - } - - function on(depMap, name, fn) { - var id = depMap.id, - mod = getOwn(registry, id); - - if (hasProp(defined, id) && - (!mod || mod.defineEmitComplete)) { - if (name === 'defined') { - fn(defined[id]); - } - } else { - mod = getModule(depMap); - if (mod.error && name === 'error') { - fn(mod.error); - } else { - mod.on(name, fn); - } - } - } - - function onError(err, errback) { - var ids = err.requireModules, - notified = false; - - if (errback) { - errback(err); - } else { - each(ids, function (id) { - var mod = getOwn(registry, id); - if (mod) { - //Set error on module, so it skips timeout checks. - mod.error = err; - if (mod.events.error) { - notified = true; - mod.emit('error', err); - } - } - }); - - if (!notified) { - req.onError(err); - } - } - } - - /** - * Internal method to transfer globalQueue items to this context's - * defQueue. - */ - function takeGlobalQueue() { - //Push all the globalDefQueue items into the context's defQueue - if (globalDefQueue.length) { - //Array splice in the values since the context code has a - //local var ref to defQueue, so cannot just reassign the one - //on context. - apsp.apply(defQueue, - [defQueue.length, 0].concat(globalDefQueue)); - globalDefQueue = []; - } - } - - handlers = { - 'require': function (mod) { - if (mod.require) { - return mod.require; - } else { - return (mod.require = context.makeRequire(mod.map)); - } - }, - 'exports': function (mod) { - mod.usingExports = true; - if (mod.map.isDefine) { - if (mod.exports) { - return (defined[mod.map.id] = mod.exports); - } else { - return (mod.exports = defined[mod.map.id] = {}); - } - } - }, - 'module': function (mod) { - if (mod.module) { - return mod.module; - } else { - return (mod.module = { - id: mod.map.id, - uri: mod.map.url, - config: function () { - return getOwn(config.config, mod.map.id) || {}; - }, - exports: mod.exports || (mod.exports = {}) - }); - } - } - }; - - function cleanRegistry(id) { - //Clean up machinery used for waiting modules. - delete registry[id]; - delete enabledRegistry[id]; - } - - function breakCycle(mod, traced, processed) { - var id = mod.map.id; - - if (mod.error) { - mod.emit('error', mod.error); - } else { - traced[id] = true; - each(mod.depMaps, function (depMap, i) { - var depId = depMap.id, - dep = getOwn(registry, depId); - - //Only force things that have not completed - //being defined, so still in the registry, - //and only if it has not been matched up - //in the module already. - if (dep && !mod.depMatched[i] && !processed[depId]) { - if (getOwn(traced, depId)) { - mod.defineDep(i, defined[depId]); - mod.check(); //pass false? - } else { - breakCycle(dep, traced, processed); - } - } - }); - processed[id] = true; - } - } - - function checkLoaded() { - var err, usingPathFallback, - waitInterval = config.waitSeconds * 1000, - //It is possible to disable the wait interval by using waitSeconds of 0. - expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(), - noLoads = [], - reqCalls = [], - stillLoading = false, - needCycleCheck = true; - - //Do not bother if this call was a result of a cycle break. - if (inCheckLoaded) { - return; - } - - inCheckLoaded = true; - - //Figure out the state of all the modules. - eachProp(enabledRegistry, function (mod) { - var map = mod.map, - modId = map.id; - - //Skip things that are not enabled or in error state. - if (!mod.enabled) { - return; - } - - if (!map.isDefine) { - reqCalls.push(mod); - } - - if (!mod.error) { - //If the module should be executed, and it has not - //been inited and time is up, remember it. - if (!mod.inited && expired) { - if (hasPathFallback(modId)) { - usingPathFallback = true; - stillLoading = true; - } else { - noLoads.push(modId); - removeScript(modId); - } - } else if (!mod.inited && mod.fetched && map.isDefine) { - stillLoading = true; - if (!map.prefix) { - //No reason to keep looking for unfinished - //loading. If the only stillLoading is a - //plugin resource though, keep going, - //because it may be that a plugin resource - //is waiting on a non-plugin cycle. - return (needCycleCheck = false); - } - } - } - }); - - if (expired && noLoads.length) { - //If wait time expired, throw error of unloaded modules. - err = makeError('timeout', 'Load timeout for modules: ' + noLoads, null, noLoads); - err.contextName = context.contextName; - return onError(err); - } - - //Not expired, check for a cycle. - if (needCycleCheck) { - each(reqCalls, function (mod) { - breakCycle(mod, {}, {}); - }); - } - - //If still waiting on loads, and the waiting load is something - //other than a plugin resource, or there are still outstanding - //scripts, then just try back later. - if ((!expired || usingPathFallback) && stillLoading) { - //Something is still waiting to load. Wait for it, but only - //if a timeout is not already in effect. - if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) { - checkLoadedTimeoutId = setTimeout(function () { - checkLoadedTimeoutId = 0; - checkLoaded(); - }, 50); - } - } - - inCheckLoaded = false; - } - - Module = function (map) { - this.events = getOwn(undefEvents, map.id) || {}; - this.map = map; - this.shim = getOwn(config.shim, map.id); - this.depExports = []; - this.depMaps = []; - this.depMatched = []; - this.pluginMaps = {}; - this.depCount = 0; - - /* this.exports this.factory - this.depMaps = [], - this.enabled, this.fetched - */ - }; - - Module.prototype = { - init: function (depMaps, factory, errback, options) { - options = options || {}; - - //Do not do more inits if already done. Can happen if there - //are multiple define calls for the same module. That is not - //a normal, common case, but it is also not unexpected. - if (this.inited) { - return; - } - - this.factory = factory; - - if (errback) { - //Register for errors on this module. - this.on('error', errback); - } else if (this.events.error) { - //If no errback already, but there are error listeners - //on this module, set up an errback to pass to the deps. - errback = bind(this, function (err) { - this.emit('error', err); - }); - } - - //Do a copy of the dependency array, so that - //source inputs are not modified. For example - //"shim" deps are passed in here directly, and - //doing a direct modification of the depMaps array - //would affect that config. - this.depMaps = depMaps && depMaps.slice(0); - - this.errback = errback; - - //Indicate this module has be initialized - this.inited = true; - - this.ignore = options.ignore; - - //Could have option to init this module in enabled mode, - //or could have been previously marked as enabled. However, - //the dependencies are not known until init is called. So - //if enabled previously, now trigger dependencies as enabled. - if (options.enabled || this.enabled) { - //Enable this module and dependencies. - //Will call this.check() - this.enable(); - } else { - this.check(); - } - }, - - defineDep: function (i, depExports) { - //Because of cycles, defined callback for a given - //export can be called more than once. - if (!this.depMatched[i]) { - this.depMatched[i] = true; - this.depCount -= 1; - this.depExports[i] = depExports; - } - }, - - fetch: function () { - if (this.fetched) { - return; - } - this.fetched = true; - - context.startTime = (new Date()).getTime(); - - var map = this.map; - - //If the manager is for a plugin managed resource, - //ask the plugin to load it now. - if (this.shim) { - context.makeRequire(this.map, { - enableBuildCallback: true - })(this.shim.deps || [], bind(this, function () { - return map.prefix ? this.callPlugin() : this.load(); - })); - } else { - //Regular dependency. - return map.prefix ? this.callPlugin() : this.load(); - } - }, - - load: function () { - var url = this.map.url; - - //Regular dependency. - if (!urlFetched[url]) { - urlFetched[url] = true; - context.load(this.map.id, url); - } - }, - - /** - * Checks if the module is ready to define itself, and if so, - * define it. - */ - check: function () { - if (!this.enabled || this.enabling) { - return; - } - - var err, cjsModule, - id = this.map.id, - depExports = this.depExports, - exports = this.exports, - factory = this.factory; - - if (!this.inited) { - this.fetch(); - } else if (this.error) { - this.emit('error', this.error); - } else if (!this.defining) { - //The factory could trigger another require call - //that would result in checking this module to - //define itself again. If already in the process - //of doing that, skip this work. - this.defining = true; - - if (this.depCount < 1 && !this.defined) { - if (isFunction(factory)) { - //If there is an error listener, favor passing - //to that instead of throwing an error. However, - //only do it for define()'d modules. require - //errbacks should not be called for failures in - //their callbacks (#699). However if a global - //onError is set, use that. - if ((this.events.error && this.map.isDefine) || - req.onError !== defaultOnError) { - try { - exports = context.execCb(id, factory, depExports, exports); - } catch (e) { - err = e; - } - } else { - exports = context.execCb(id, factory, depExports, exports); - } - - // Favor return value over exports. If node/cjs in play, - // then will not have a return value anyway. Favor - // module.exports assignment over exports object. - if (this.map.isDefine && exports === undefined) { - cjsModule = this.module; - if (cjsModule) { - exports = cjsModule.exports; - } else if (this.usingExports) { - //exports already set the defined value. - exports = this.exports; - } - } - - if (err) { - err.requireMap = this.map; - err.requireModules = this.map.isDefine ? [this.map.id] : null; - err.requireType = this.map.isDefine ? 'define' : 'require'; - return onError((this.error = err)); - } - - } else { - //Just a literal value - exports = factory; - } - - this.exports = exports; - - if (this.map.isDefine && !this.ignore) { - defined[id] = exports; - - if (req.onResourceLoad) { - req.onResourceLoad(context, this.map, this.depMaps); - } - } - - //Clean up - cleanRegistry(id); - - this.defined = true; - } - - //Finished the define stage. Allow calling check again - //to allow define notifications below in the case of a - //cycle. - this.defining = false; - - if (this.defined && !this.defineEmitted) { - this.defineEmitted = true; - this.emit('defined', this.exports); - this.defineEmitComplete = true; - } - - } - }, - - callPlugin: function () { - var map = this.map, - id = map.id, - //Map already normalized the prefix. - pluginMap = makeModuleMap(map.prefix); - - //Mark this as a dependency for this plugin, so it - //can be traced for cycles. - this.depMaps.push(pluginMap); - - on(pluginMap, 'defined', bind(this, function (plugin) { - var load, normalizedMap, normalizedMod, - bundleId = getOwn(bundlesMap, this.map.id), - name = this.map.name, - parentName = this.map.parentMap ? this.map.parentMap.name : null, - localRequire = context.makeRequire(map.parentMap, { - enableBuildCallback: true - }); - - //If current map is not normalized, wait for that - //normalized name to load instead of continuing. - if (this.map.unnormalized) { - //Normalize the ID if the plugin allows it. - if (plugin.normalize) { - name = plugin.normalize(name, function (name) { - return normalize(name, parentName, true); - }) || ''; - } - - //prefix and name should already be normalized, no need - //for applying map config again either. - normalizedMap = makeModuleMap(map.prefix + '!' + name, - this.map.parentMap); - on(normalizedMap, - 'defined', bind(this, function (value) { - this.init([], function () { return value; }, null, { - enabled: true, - ignore: true - }); - })); - - normalizedMod = getOwn(registry, normalizedMap.id); - if (normalizedMod) { - //Mark this as a dependency for this plugin, so it - //can be traced for cycles. - this.depMaps.push(normalizedMap); - - if (this.events.error) { - normalizedMod.on('error', bind(this, function (err) { - this.emit('error', err); - })); - } - normalizedMod.enable(); - } - - return; - } - - //If a paths config, then just load that file instead to - //resolve the plugin, as it is built into that paths layer. - if (bundleId) { - this.map.url = context.nameToUrl(bundleId); - this.load(); - return; - } - - load = bind(this, function (value) { - this.init([], function () { return value; }, null, { - enabled: true - }); - }); - - load.error = bind(this, function (err) { - this.inited = true; - this.error = err; - err.requireModules = [id]; - - //Remove temp unnormalized modules for this module, - //since they will never be resolved otherwise now. - eachProp(registry, function (mod) { - if (mod.map.id.indexOf(id + '_unnormalized') === 0) { - cleanRegistry(mod.map.id); - } - }); - - onError(err); - }); - - //Allow plugins to load other code without having to know the - //context or how to 'complete' the load. - load.fromText = bind(this, function (text, textAlt) { - /*jslint evil: true */ - var moduleName = map.name, - moduleMap = makeModuleMap(moduleName), - hasInteractive = useInteractive; - - //As of 2.1.0, support just passing the text, to reinforce - //fromText only being called once per resource. Still - //support old style of passing moduleName but discard - //that moduleName in favor of the internal ref. - if (textAlt) { - text = textAlt; - } - - //Turn off interactive script matching for IE for any define - //calls in the text, then turn it back on at the end. - if (hasInteractive) { - useInteractive = false; - } - - //Prime the system by creating a module instance for - //it. - getModule(moduleMap); - - //Transfer any config to this other module. - if (hasProp(config.config, id)) { - config.config[moduleName] = config.config[id]; - } - - try { - req.exec(text); - } catch (e) { - return onError(makeError('fromtexteval', - 'fromText eval for ' + id + - ' failed: ' + e, - e, - [id])); - } - - if (hasInteractive) { - useInteractive = true; - } - - //Mark this as a dependency for the plugin - //resource - this.depMaps.push(moduleMap); - - //Support anonymous modules. - context.completeLoad(moduleName); - - //Bind the value of that module to the value for this - //resource ID. - localRequire([moduleName], load); - }); - - //Use parentName here since the plugin's name is not reliable, - //could be some weird string with no path that actually wants to - //reference the parentName's path. - plugin.load(map.name, localRequire, load, config); - })); - - context.enable(pluginMap, this); - this.pluginMaps[pluginMap.id] = pluginMap; - }, - - enable: function () { - enabledRegistry[this.map.id] = this; - this.enabled = true; - - //Set flag mentioning that the module is enabling, - //so that immediate calls to the defined callbacks - //for dependencies do not trigger inadvertent load - //with the depCount still being zero. - this.enabling = true; - - //Enable each dependency - each(this.depMaps, bind(this, function (depMap, i) { - var id, mod, handler; - - if (typeof depMap === 'string') { - //Dependency needs to be converted to a depMap - //and wired up to this module. - depMap = makeModuleMap(depMap, - (this.map.isDefine ? this.map : this.map.parentMap), - false, - !this.skipMap); - this.depMaps[i] = depMap; - - handler = getOwn(handlers, depMap.id); - - if (handler) { - this.depExports[i] = handler(this); - return; - } - - this.depCount += 1; - - on(depMap, 'defined', bind(this, function (depExports) { - this.defineDep(i, depExports); - this.check(); - })); - - if (this.errback) { - on(depMap, 'error', bind(this, this.errback)); - } - } - - id = depMap.id; - mod = registry[id]; - - //Skip special modules like 'require', 'exports', 'module' - //Also, don't call enable if it is already enabled, - //important in circular dependency cases. - if (!hasProp(handlers, id) && mod && !mod.enabled) { - context.enable(depMap, this); - } - })); - - //Enable each plugin that is used in - //a dependency - eachProp(this.pluginMaps, bind(this, function (pluginMap) { - var mod = getOwn(registry, pluginMap.id); - if (mod && !mod.enabled) { - context.enable(pluginMap, this); - } - })); - - this.enabling = false; - - this.check(); - }, - - on: function (name, cb) { - var cbs = this.events[name]; - if (!cbs) { - cbs = this.events[name] = []; - } - cbs.push(cb); - }, - - emit: function (name, evt) { - each(this.events[name], function (cb) { - cb(evt); - }); - if (name === 'error') { - //Now that the error handler was triggered, remove - //the listeners, since this broken Module instance - //can stay around for a while in the registry. - delete this.events[name]; - } - } - }; - - function callGetModule(args) { - //Skip modules already defined. - if (!hasProp(defined, args[0])) { - getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]); - } - } - - function removeListener(node, func, name, ieName) { - //Favor detachEvent because of IE9 - //issue, see attachEvent/addEventListener comment elsewhere - //in this file. - if (node.detachEvent && !isOpera) { - //Probably IE. If not it will throw an error, which will be - //useful to know. - if (ieName) { - node.detachEvent(ieName, func); - } - } else { - node.removeEventListener(name, func, false); - } - } - - /** - * Given an event from a script node, get the requirejs info from it, - * and then removes the event listeners on the node. - * @param {Event} evt - * @returns {Object} - */ - function getScriptData(evt) { - //Using currentTarget instead of target for Firefox 2.0's sake. Not - //all old browsers will be supported, but this one was easy enough - //to support and still makes sense. - var node = evt.currentTarget || evt.srcElement; - - //Remove the listeners once here. - removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange'); - removeListener(node, context.onScriptError, 'error'); - - return { - node: node, - id: node && node.getAttribute('data-requiremodule') - }; - } - - function intakeDefines() { - var args; - - //Any defined modules in the global queue, intake them now. - takeGlobalQueue(); - - //Make sure any remaining defQueue items get properly processed. - while (defQueue.length) { - args = defQueue.shift(); - if (args[0] === null) { - return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1])); - } else { - //args are id, deps, factory. Should be normalized by the - //define() function. - callGetModule(args); - } - } - } - - context = { - config: config, - contextName: contextName, - registry: registry, - defined: defined, - urlFetched: urlFetched, - defQueue: defQueue, - Module: Module, - makeModuleMap: makeModuleMap, - nextTick: req.nextTick, - onError: onError, - - /** - * Set a configuration for the context. - * @param {Object} cfg config object to integrate. - */ - configure: function (cfg) { - //Make sure the baseUrl ends in a slash. - if (cfg.baseUrl) { - if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') { - cfg.baseUrl += '/'; - } - } - - //Save off the paths since they require special processing, - //they are additive. - var shim = config.shim, - objs = { - paths: true, - bundles: true, - config: true, - map: true - }; - - eachProp(cfg, function (value, prop) { - if (objs[prop]) { - if (!config[prop]) { - config[prop] = {}; - } - mixin(config[prop], value, true, true); - } else { - config[prop] = value; - } - }); - - //Reverse map the bundles - if (cfg.bundles) { - eachProp(cfg.bundles, function (value, prop) { - each(value, function (v) { - if (v !== prop) { - bundlesMap[v] = prop; - } - }); - }); - } - - //Merge shim - if (cfg.shim) { - eachProp(cfg.shim, function (value, id) { - //Normalize the structure - if (isArray(value)) { - value = { - deps: value - }; - } - if ((value.exports || value.init) && !value.exportsFn) { - value.exportsFn = context.makeShimExports(value); - } - shim[id] = value; - }); - config.shim = shim; - } - - //Adjust packages if necessary. - if (cfg.packages) { - each(cfg.packages, function (pkgObj) { - var location, name; - - pkgObj = typeof pkgObj === 'string' ? { name: pkgObj } : pkgObj; - - name = pkgObj.name; - location = pkgObj.location; - if (location) { - config.paths[name] = pkgObj.location; - } - - //Save pointer to main module ID for pkg name. - //Remove leading dot in main, so main paths are normalized, - //and remove any trailing .js, since different package - //envs have different conventions: some use a module name, - //some use a file name. - config.pkgs[name] = pkgObj.name + '/' + (pkgObj.main || 'main') - .replace(currDirRegExp, '') - .replace(jsSuffixRegExp, ''); - }); - } - - //If there are any "waiting to execute" modules in the registry, - //update the maps for them, since their info, like URLs to load, - //may have changed. - eachProp(registry, function (mod, id) { - //If module already has init called, since it is too - //late to modify them, and ignore unnormalized ones - //since they are transient. - if (!mod.inited && !mod.map.unnormalized) { - mod.map = makeModuleMap(id); - } - }); - - //If a deps array or a config callback is specified, then call - //require with those args. This is useful when require is defined as a - //config object before require.js is loaded. - if (cfg.deps || cfg.callback) { - context.require(cfg.deps || [], cfg.callback); - } - }, - - makeShimExports: function (value) { - function fn() { - var ret; - if (value.init) { - ret = value.init.apply(global, arguments); - } - return ret || (value.exports && getGlobal(value.exports)); - } - return fn; - }, - - makeRequire: function (relMap, options) { - options = options || {}; - - function localRequire(deps, callback, errback) { - var id, map, requireMod; - - if (options.enableBuildCallback && callback && isFunction(callback)) { - callback.__requireJsBuild = true; - } - - if (typeof deps === 'string') { - if (isFunction(callback)) { - //Invalid call - return onError(makeError('requireargs', 'Invalid require call'), errback); - } - - //If require|exports|module are requested, get the - //value for them from the special handlers. Caveat: - //this only works while module is being defined. - if (relMap && hasProp(handlers, deps)) { - return handlers[deps](registry[relMap.id]); - } - - //Synchronous access to one module. If require.get is - //available (as in the Node adapter), prefer that. - if (req.get) { - return req.get(context, deps, relMap, localRequire); - } - - //Normalize module name, if it contains . or .. - map = makeModuleMap(deps, relMap, false, true); - id = map.id; - - if (!hasProp(defined, id)) { - return onError(makeError('notloaded', 'Module name "' + - id + - '" has not been loaded yet for context: ' + - contextName + - (relMap ? '' : '. Use require([])'))); - } - return defined[id]; - } - - //Grab defines waiting in the global queue. - intakeDefines(); - - //Mark all the dependencies as needing to be loaded. - context.nextTick(function () { - //Some defines could have been added since the - //require call, collect them. - intakeDefines(); - - requireMod = getModule(makeModuleMap(null, relMap)); - - //Store if map config should be applied to this require - //call for dependencies. - requireMod.skipMap = options.skipMap; - - requireMod.init(deps, callback, errback, { - enabled: true - }); - - checkLoaded(); - }); - - return localRequire; - } - - mixin(localRequire, { - isBrowser: isBrowser, - - /** - * Converts a module name + .extension into an URL path. - * *Requires* the use of a module name. It does not support using - * plain URLs like nameToUrl. - */ - toUrl: function (moduleNamePlusExt) { - var ext, - index = moduleNamePlusExt.lastIndexOf('.'), - segment = moduleNamePlusExt.split('/')[0], - isRelative = segment === '.' || segment === '..'; - - //Have a file extension alias, and it is not the - //dots from a relative path. - if (index !== -1 && (!isRelative || index > 1)) { - ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length); - moduleNamePlusExt = moduleNamePlusExt.substring(0, index); - } - - return context.nameToUrl(normalize(moduleNamePlusExt, - relMap && relMap.id, true), ext, true); - }, - - defined: function (id) { - return hasProp(defined, makeModuleMap(id, relMap, false, true).id); - }, - - specified: function (id) { - id = makeModuleMap(id, relMap, false, true).id; - return hasProp(defined, id) || hasProp(registry, id); - } - }); - - //Only allow undef on top level require calls - if (!relMap) { - localRequire.undef = function (id) { - //Bind any waiting define() calls to this context, - //fix for #408 - takeGlobalQueue(); - - var map = makeModuleMap(id, relMap, true), - mod = getOwn(registry, id); - - removeScript(id); - - delete defined[id]; - delete urlFetched[map.url]; - delete undefEvents[id]; - - //Clean queued defines too. Go backwards - //in array so that the splices do not - //mess up the iteration. - eachReverse(defQueue, function(args, i) { - if(args[0] === id) { - defQueue.splice(i, 1); - } - }); - - if (mod) { - //Hold on to listeners in case the - //module will be attempted to be reloaded - //using a different config. - if (mod.events.defined) { - undefEvents[id] = mod.events; - } - - cleanRegistry(id); - } - }; - } - - return localRequire; - }, - - /** - * Called to enable a module if it is still in the registry - * awaiting enablement. A second arg, parent, the parent module, - * is passed in for context, when this method is overridden by - * the optimizer. Not shown here to keep code compact. - */ - enable: function (depMap) { - var mod = getOwn(registry, depMap.id); - if (mod) { - getModule(depMap).enable(); - } - }, - - /** - * Internal method used by environment adapters to complete a load event. - * A load event could be a script load or just a load pass from a synchronous - * load call. - * @param {String} moduleName the name of the module to potentially complete. - */ - completeLoad: function (moduleName) { - var found, args, mod, - shim = getOwn(config.shim, moduleName) || {}, - shExports = shim.exports; - - takeGlobalQueue(); - - while (defQueue.length) { - args = defQueue.shift(); - if (args[0] === null) { - args[0] = moduleName; - //If already found an anonymous module and bound it - //to this name, then this is some other anon module - //waiting for its completeLoad to fire. - if (found) { - break; - } - found = true; - } else if (args[0] === moduleName) { - //Found matching define call for this script! - found = true; - } - - callGetModule(args); - } - - //Do this after the cycle of callGetModule in case the result - //of those calls/init calls changes the registry. - mod = getOwn(registry, moduleName); - - if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) { - if (config.enforceDefine && (!shExports || !getGlobal(shExports))) { - if (hasPathFallback(moduleName)) { - return; - } else { - return onError(makeError('nodefine', - 'No define call for ' + moduleName, - null, - [moduleName])); - } - } else { - //A script that does not call define(), so just simulate - //the call for it. - callGetModule([moduleName, (shim.deps || []), shim.exportsFn]); - } - } - - checkLoaded(); - }, - - /** - * Converts a module name to a file path. Supports cases where - * moduleName may actually be just an URL. - * Note that it **does not** call normalize on the moduleName, - * it is assumed to have already been normalized. This is an - * internal API, not a public one. Use toUrl for the public API. - */ - nameToUrl: function (moduleName, ext, skipExt) { - var paths, syms, i, parentModule, url, - parentPath, bundleId, - pkgMain = getOwn(config.pkgs, moduleName); - - if (pkgMain) { - moduleName = pkgMain; - } - - bundleId = getOwn(bundlesMap, moduleName); - - if (bundleId) { - return context.nameToUrl(bundleId, ext, skipExt); - } - - //If a colon is in the URL, it indicates a protocol is used and it is just - //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?) - //or ends with .js, then assume the user meant to use an url and not a module id. - //The slash is important for protocol-less URLs as well as full paths. - if (req.jsExtRegExp.test(moduleName)) { - //Just a plain path, not module name lookup, so just return it. - //Add extension if it is included. This is a bit wonky, only non-.js things pass - //an extension, this method probably needs to be reworked. - url = moduleName + (ext || ''); - } else { - //A module that needs to be converted to a path. - paths = config.paths; - - syms = moduleName.split('/'); - //For each module name segment, see if there is a path - //registered for it. Start with most specific name - //and work up from it. - for (i = syms.length; i > 0; i -= 1) { - parentModule = syms.slice(0, i).join('/'); - - parentPath = getOwn(paths, parentModule); - if (parentPath) { - //If an array, it means there are a few choices, - //Choose the one that is desired - if (isArray(parentPath)) { - parentPath = parentPath[0]; - } - syms.splice(0, i, parentPath); - break; - } - } - - //Join the path parts together, then figure out if baseUrl is needed. - url = syms.join('/'); - url += (ext || (/^data\:|\?/.test(url) || skipExt ? '' : '.js')); - url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url; - } - - return config.urlArgs ? url + - ((url.indexOf('?') === -1 ? '?' : '&') + - config.urlArgs) : url; - }, - - //Delegates to req.load. Broken out as a separate function to - //allow overriding in the optimizer. - load: function (id, url) { - req.load(context, id, url); - }, - - /** - * Executes a module callback function. Broken out as a separate function - * solely to allow the build system to sequence the files in the built - * layer in the right sequence. - * - * @private - */ - execCb: function (name, callback, args, exports) { - return callback.apply(exports, args); - }, - - /** - * callback for script loads, used to check status of loading. - * - * @param {Event} evt the event from the browser for the script - * that was loaded. - */ - onScriptLoad: function (evt) { - //Using currentTarget instead of target for Firefox 2.0's sake. Not - //all old browsers will be supported, but this one was easy enough - //to support and still makes sense. - if (evt.type === 'load' || - (readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) { - //Reset interactive script so a script node is not held onto for - //to long. - interactiveScript = null; - - //Pull out the name of the module and the context. - var data = getScriptData(evt); - context.completeLoad(data.id); - } - }, - - /** - * Callback for script errors. - */ - onScriptError: function (evt) { - var data = getScriptData(evt); - if (!hasPathFallback(data.id)) { - return onError(makeError('scripterror', 'Script error for: ' + data.id, evt, [data.id])); - } - } - }; - - context.require = context.makeRequire(); - return context; - } - - /** - * Main entry point. - * - * If the only argument to require is a string, then the module that - * is represented by that string is fetched for the appropriate context. - * - * If the first argument is an array, then it will be treated as an array - * of dependency string names to fetch. An optional function callback can - * be specified to execute when all of those dependencies are available. - * - * Make a local req variable to help Caja compliance (it assumes things - * on a require that are not standardized), and to give a short - * name for minification/local scope use. - */ - req = requirejs = function (deps, callback, errback, optional) { - - //Find the right context, use default - var context, config, - contextName = defContextName; - - // Determine if have config object in the call. - if (!isArray(deps) && typeof deps !== 'string') { - // deps is a config object - config = deps; - if (isArray(callback)) { - // Adjust args if there are dependencies - deps = callback; - callback = errback; - errback = optional; - } else { - deps = []; - } - } - - if (config && config.context) { - contextName = config.context; - } - - context = getOwn(contexts, contextName); - if (!context) { - context = contexts[contextName] = req.s.newContext(contextName); - } - - if (config) { - context.configure(config); - } - - return context.require(deps, callback, errback); - }; - - /** - * Support require.config() to make it easier to cooperate with other - * AMD loaders on globally agreed names. - */ - req.config = function (config) { - return req(config); - }; - - /** - * Execute something after the current tick - * of the event loop. Override for other envs - * that have a better solution than setTimeout. - * @param {Function} fn function to execute later. - */ - req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) { - setTimeout(fn, 4); - } : function (fn) { fn(); }; - - /** - * Export require as a global, but only if it does not already exist. - */ - if (!require) { - require = req; - } - - req.version = version; - - //Used to filter out dependencies that are already paths. - req.jsExtRegExp = /^\/|:|\?|\.js$/; - req.isBrowser = isBrowser; - s = req.s = { - contexts: contexts, - newContext: newContext - }; - - //Create default context. - req({}); - - //Exports some context-sensitive methods on global require. - each([ - 'toUrl', - 'undef', - 'defined', - 'specified' - ], function (prop) { - //Reference from contexts instead of early binding to default context, - //so that during builds, the latest instance of the default context - //with its config gets used. - req[prop] = function () { - var ctx = contexts[defContextName]; - return ctx.require[prop].apply(ctx, arguments); - }; - }); - - if (isBrowser) { - head = s.head = document.getElementsByTagName('head')[0]; - //If BASE tag is in play, using appendChild is a problem for IE6. - //When that browser dies, this can be removed. Details in this jQuery bug: - //http://dev.jquery.com/ticket/2709 - baseElement = document.getElementsByTagName('base')[0]; - if (baseElement) { - head = s.head = baseElement.parentNode; - } - } - - /** - * Any errors that require explicitly generates will be passed to this - * function. Intercept/override it if you want custom error handling. - * @param {Error} err the error object. - */ - req.onError = defaultOnError; - - /** - * Creates the node for the load command. Only used in browser envs. - */ - req.createNode = function (config, moduleName, url) { - var node = config.xhtml ? - document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') : - document.createElement('script'); - node.type = config.scriptType || 'text/javascript'; - node.charset = 'utf-8'; - node.async = true; - return node; - }; - - /** - * Does the request to load a module for the browser case. - * Make this a separate function to allow other environments - * to override it. - * - * @param {Object} context the require context to find state. - * @param {String} moduleName the name of the module. - * @param {Object} url the URL to the module. - */ - req.load = function (context, moduleName, url) { - var config = (context && context.config) || {}, - node; - if (isBrowser) { - //In the browser so use a script tag - node = req.createNode(config, moduleName, url); - - node.setAttribute('data-requirecontext', context.contextName); - node.setAttribute('data-requiremodule', moduleName); - - //Set up load listener. Test attachEvent first because IE9 has - //a subtle issue in its addEventListener and script onload firings - //that do not match the behavior of all other browsers with - //addEventListener support, which fire the onload event for a - //script right after the script execution. See: - //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution - //UNFORTUNATELY Opera implements attachEvent but does not follow the script - //script execution mode. - if (node.attachEvent && - //Check if node.attachEvent is artificially added by custom script or - //natively supported by browser - //read https://github.com/jrburke/requirejs/issues/187 - //if we can NOT find [native code] then it must NOT natively supported. - //in IE8, node.attachEvent does not have toString() - //Note the test for "[native code" with no closing brace, see: - //https://github.com/jrburke/requirejs/issues/273 - !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) && - !isOpera) { - //Probably IE. IE (at least 6-8) do not fire - //script onload right after executing the script, so - //we cannot tie the anonymous define call to a name. - //However, IE reports the script as being in 'interactive' - //readyState at the time of the define call. - useInteractive = true; - - node.attachEvent('onreadystatechange', context.onScriptLoad); - //It would be great to add an error handler here to catch - //404s in IE9+. However, onreadystatechange will fire before - //the error handler, so that does not help. If addEventListener - //is used, then IE will fire error before load, but we cannot - //use that pathway given the connect.microsoft.com issue - //mentioned above about not doing the 'script execute, - //then fire the script load event listener before execute - //next script' that other browsers do. - //Best hope: IE10 fixes the issues, - //and then destroys all installs of IE 6-9. - //node.attachEvent('onerror', context.onScriptError); - } else { - node.addEventListener('load', context.onScriptLoad, false); - node.addEventListener('error', context.onScriptError, false); - } - node.src = url; - - //For some cache cases in IE 6-8, the script executes before the end - //of the appendChild execution, so to tie an anonymous define - //call to the module name (which is stored on the node), hold on - //to a reference to this node, but clear after the DOM insertion. - currentlyAddingScript = node; - if (baseElement) { - head.insertBefore(node, baseElement); - } else { - head.appendChild(node); - } - currentlyAddingScript = null; - - return node; - } else if (isWebWorker) { - try { - //In a web worker, use importScripts. This is not a very - //efficient use of importScripts, importScripts will block until - //its script is downloaded and evaluated. However, if web workers - //are in play, the expectation that a build has been done so that - //only one script needs to be loaded anyway. This may need to be - //reevaluated if other use cases become common. - importScripts(url); - - //Account for anonymous modules - context.completeLoad(moduleName); - } catch (e) { - context.onError(makeError('importscripts', - 'importScripts failed for ' + - moduleName + ' at ' + url, - e, - [moduleName])); - } - } - }; - - function getInteractiveScript() { - if (interactiveScript && interactiveScript.readyState === 'interactive') { - return interactiveScript; - } - - eachReverse(scripts(), function (script) { - if (script.readyState === 'interactive') { - return (interactiveScript = script); - } - }); - return interactiveScript; - } - - //Look for a data-main script attribute, which could also adjust the baseUrl. - if (isBrowser && !cfg.skipDataMain) { - //Figure out baseUrl. Get it from the script tag with require.js in it. - eachReverse(scripts(), function (script) { - //Set the 'head' where we can append children by - //using the script's parent. - if (!head) { - head = script.parentNode; - } - - //Look for a data-main attribute to set main script for the page - //to load. If it is there, the path to data main becomes the - //baseUrl, if it is not already set. - dataMain = script.getAttribute('data-main'); - if (dataMain) { - //Preserve dataMain in case it is a path (i.e. contains '?') - mainScript = dataMain; - - //Set final baseUrl if there is not already an explicit one. - if (!cfg.baseUrl) { - //Pull off the directory of data-main for use as the - //baseUrl. - src = mainScript.split('/'); - mainScript = src.pop(); - subPath = src.length ? src.join('/') + '/' : './'; - - cfg.baseUrl = subPath; - } - - //Strip off any trailing .js since mainScript is now - //like a module name. - mainScript = mainScript.replace(jsSuffixRegExp, ''); - - //If mainScript is still a path, fall back to dataMain - if (req.jsExtRegExp.test(mainScript)) { - mainScript = dataMain; - } - - //Put the data-main script in the files to load. - cfg.deps = cfg.deps ? cfg.deps.concat(mainScript) : [mainScript]; - - return true; - } - }); - } - - /** - * The function that handles definitions of modules. Differs from - * require() in that a string for the module should be the first argument, - * and the function to execute after dependencies are loaded should - * return a value to define the module corresponding to the first argument's - * name. - */ - define = function (name, deps, callback) { - var node, context; - - //Allow for anonymous modules - if (typeof name !== 'string') { - //Adjust args appropriately - callback = deps; - deps = name; - name = null; - } - - //This module may not have dependencies - if (!isArray(deps)) { - callback = deps; - deps = null; - } - - //If no name, and callback is a function, then figure out if it a - //CommonJS thing with dependencies. - if (!deps && isFunction(callback)) { - deps = []; - //Remove comments from the callback string, - //look for require calls, and pull them into the dependencies, - //but only if there are function args. - if (callback.length) { - callback - .toString() - .replace(commentRegExp, '') - .replace(cjsRequireRegExp, function (match, dep) { - deps.push(dep); - }); - - //May be a CommonJS thing even without require calls, but still - //could use exports, and module. Avoid doing exports and module - //work though if it just needs require. - //REQUIRES the function to expect the CommonJS variables in the - //order listed below. - deps = (callback.length === 1 ? ['require'] : ['require', 'exports', 'module']).concat(deps); - } - } - - //If in IE 6-8 and hit an anonymous define() call, do the interactive - //work. - if (useInteractive) { - node = currentlyAddingScript || getInteractiveScript(); - if (node) { - if (!name) { - name = node.getAttribute('data-requiremodule'); - } - context = contexts[node.getAttribute('data-requirecontext')]; - } - } - - //Always save off evaluating the def call until the script onload handler. - //This allows multiple modules to be in a file without prematurely - //tracing dependencies, and allows for anonymous module support, - //where the module name is not known until the script onload event - //occurs. If no context, use the global queue, and get it processed - //in the onscript load callback. - (context ? context.defQueue : globalDefQueue).push([name, deps, callback]); - }; - - define.amd = { - jQuery: true - }; - - - /** - * Executes the text. Normally just uses eval, but can be modified - * to use a better, environment-specific call. Only used for transpiling - * loader plugins, not for plain JS modules. - * @param {String} text the text to execute/evaluate. - */ - req.exec = function (text) { - /*jslint evil: true */ - return eval(text); - }; - - //Set up with config info. - req(cfg); -}(this)); diff --git a/app/lib/tinymce/langs/readme.md b/app/lib/tinymce/langs/readme.md deleted file mode 100644 index a52bf03f..00000000 --- a/app/lib/tinymce/langs/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -This is where language files should be placed. - -Please DO NOT translate these directly use this service: https://www.transifex.com/projects/p/tinymce/ diff --git a/app/lib/tinymce/license.txt b/app/lib/tinymce/license.txt deleted file mode 100644 index 1837b0ac..00000000 --- a/app/lib/tinymce/license.txt +++ /dev/null @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/app/lib/tinymce/plugins/advlist/plugin.min.js b/app/lib/tinymce/plugins/advlist/plugin.min.js deleted file mode 100644 index e734b1a0..00000000 --- a/app/lib/tinymce/plugins/advlist/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("advlist",function(t){function e(t,e){var n=[];return tinymce.each(e.split(/[ ,]/),function(t){n.push({text:t.replace(/\-/g," ").replace(/\b\w/g,function(t){return t.toUpperCase()}),data:"default"==t?"":t})}),n}function n(e,n){var o,l=t.dom,a=t.selection;o=l.getParent(a.getNode(),"ol,ul"),o&&o.nodeName==e&&n!==!1||t.execCommand("UL"==e?"InsertUnorderedList":"InsertOrderedList"),n=n===!1?i[e]:n,i[e]=n,o=l.getParent(a.getNode(),"ol,ul"),o&&n&&(l.setStyle(o,"listStyleType",n),o.removeAttribute("data-mce-style")),t.focus()}function o(e){var n=t.dom.getStyle(t.dom.getParent(t.selection.getNode(),"ol,ul"),"listStyleType")||"";e.control.items().each(function(t){t.active(t.settings.data===n)})}var l,a,i={};l=e("OL",t.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman")),a=e("UL",t.getParam("advlist_bullet_styles","default,circle,disc,square")),t.addButton("numlist",{type:"splitbutton",tooltip:"Numbered list",menu:l,onshow:o,onselect:function(t){n("OL",t.control.settings.data)},onclick:function(){n("OL",!1)}}),t.addButton("bullist",{type:"splitbutton",tooltip:"Bullet list",menu:a,onshow:o,onselect:function(t){n("UL",t.control.settings.data)},onclick:function(){n("UL",!1)}})}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/anchor/plugin.min.js b/app/lib/tinymce/plugins/anchor/plugin.min.js deleted file mode 100644 index fec2a76f..00000000 --- a/app/lib/tinymce/plugins/anchor/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("anchor",function(n){function e(){var e=n.selection.getNode(),t="";"A"==e.tagName&&(t=e.name||e.id||""),n.windowManager.open({title:"Anchor",body:{type:"textbox",name:"name",size:40,label:"Name",value:t},onsubmit:function(e){n.execCommand("mceInsertContent",!1,n.dom.createHTML("a",{id:e.data.name}))}})}n.addButton("anchor",{icon:"anchor",tooltip:"Anchor",onclick:e,stateSelector:"a:not([href])"}),n.addMenuItem("anchor",{icon:"anchor",text:"Anchor",context:"insert",onclick:e})}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/autolink/plugin.min.js b/app/lib/tinymce/plugins/autolink/plugin.min.js deleted file mode 100644 index 10bc7173..00000000 --- a/app/lib/tinymce/plugins/autolink/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("autolink",function(n){function t(n){o(n,-1,"(",!0)}function e(n){o(n,0,"",!0)}function i(n){o(n,-1,"",!1)}function o(n,t,e){function i(n,t){if(0>t&&(t=0),3==n.nodeType){var e=n.data.length;t>e&&(t=e)}return t}function o(n,t){f.setStart(n,i(n,t))}function r(n,t){f.setEnd(n,i(n,t))}var f,d,a,s,c,l,u,g,h,C;if(f=n.selection.getRng(!0).cloneRange(),f.startOffset<5){if(g=f.endContainer.previousSibling,!g){if(!f.endContainer.firstChild||!f.endContainer.firstChild.nextSibling)return;g=f.endContainer.firstChild.nextSibling}if(h=g.length,o(g,h),r(g,h),f.endOffset<5)return;d=f.endOffset,s=g}else{if(s=f.endContainer,3!=s.nodeType&&s.firstChild){for(;3!=s.nodeType&&s.firstChild;)s=s.firstChild;3==s.nodeType&&(o(s,0),r(s,s.nodeValue.length))}d=1==f.endOffset?2:f.endOffset-1-t}a=d;do o(s,d>=2?d-2:0),r(s,d>=1?d-1:0),d-=1,C=f.toString();while(" "!=C&&""!==C&&160!=C.charCodeAt(0)&&d-2>=0&&C!=e);f.toString()==e||160==f.toString().charCodeAt(0)?(o(s,d),r(s,a),d+=1):0===f.startOffset?(o(s,0),r(s,a)):(o(s,d),r(s,a)),l=f.toString(),"."==l.charAt(l.length-1)&&r(s,a-1),l=f.toString(),u=l.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i),u&&("www."==u[1]?u[1]="http://www.":/@$/.test(u[1])&&!/^mailto:/.test(u[1])&&(u[1]="mailto:"+u[1]),c=n.selection.getBookmark(),n.selection.setRng(f),n.execCommand("createlink",!1,u[1]+u[2]),n.selection.moveToBookmark(c),n.nodeChanged())}var r;return n.on("keydown",function(t){return 13==t.keyCode?i(n):void 0}),tinymce.Env.ie?void n.on("focus",function(){if(!r){r=!0;try{n.execCommand("AutoUrlDetect",!1,!0)}catch(t){}}}):(n.on("keypress",function(e){return 41==e.keyCode?t(n):void 0}),void n.on("keyup",function(t){return 32==t.keyCode?e(n):void 0}))}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/autoresize/plugin.min.js b/app/lib/tinymce/plugins/autoresize/plugin.min.js deleted file mode 100644 index dc88d852..00000000 --- a/app/lib/tinymce/plugins/autoresize/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("autoresize",function(e){function t(){return e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen()}function i(o){var r,s,g,m,l,d,u,h,f,c,_,p,y=tinymce.DOM;if(s=e.getDoc()){if(g=s.body,m=s.documentElement,l=n.autoresize_min_height,!g||o&&"setcontent"===o.type&&o.initial||t())return void(g&&m&&(g.style.overflowY="auto",m.style.overflowY="auto"));u=e.dom.getStyle(g,"margin-top",!0),h=e.dom.getStyle(g,"margin-bottom",!0),f=e.dom.getStyle(g,"padding-top",!0),c=e.dom.getStyle(g,"padding-bottom",!0),_=e.dom.getStyle(g,"border-top-width",!0),p=e.dom.getStyle(g,"border-bottom-width",!0),d=g.offsetHeight+parseInt(u,10)+parseInt(h,10)+parseInt(f,10)+parseInt(c,10)+parseInt(_,10)+parseInt(p,10),(isNaN(d)||0>=d)&&(d=tinymce.Env.ie?g.scrollHeight:tinymce.Env.webkit&&0===g.clientHeight?0:g.offsetHeight),d>n.autoresize_min_height&&(l=d),n.autoresize_max_height&&d>n.autoresize_max_height?(l=n.autoresize_max_height,g.style.overflowY="auto",m.style.overflowY="auto"):(g.style.overflowY="hidden",m.style.overflowY="hidden",g.scrollTop=0),l!==a&&(r=l-a,y.setStyle(e.iframeElement,"height",l+"px"),a=l,tinymce.isWebKit&&0>r&&i(o))}}function o(e,t,n){setTimeout(function(){i({}),e--?o(e,t,n):n&&n()},t)}var n=e.settings,a=0;e.settings.inline||(n.autoresize_min_height=parseInt(e.getParam("autoresize_min_height",e.getElement().offsetHeight),10),n.autoresize_max_height=parseInt(e.getParam("autoresize_max_height",0),10),e.on("init",function(){var t=e.getParam("autoresize_overflow_padding",1);e.dom.setStyles(e.getBody(),{paddingBottom:e.getParam("autoresize_bottom_margin",50),paddingLeft:t,paddingRight:t})}),e.on("nodechange setcontent keyup FullscreenStateChanged",i),e.getParam("autoresize_on_init",!0)&&e.on("init",function(){o(20,100,function(){o(5,1e3)})}),e.addCommand("mceAutoResize",i))}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/autosave/plugin.min.js b/app/lib/tinymce/plugins/autosave/plugin.min.js deleted file mode 100644 index fbd07811..00000000 --- a/app/lib/tinymce/plugins/autosave/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce._beforeUnloadHandler=function(){var e;return tinymce.each(tinymce.editors,function(t){t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&t.getParam("autosave_ask_before_unload",!0)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))}),e},tinymce.PluginManager.add("autosave",function(e){function t(e,t){var n={s:1e3,m:6e4};return e=/^(\d+)([ms]?)$/.exec(""+(e||t)),(e[2]?n[e[2]]:1)*parseInt(e,10)}function n(){var e=parseInt(v.getItem(c+"time"),10)||0;return(new Date).getTime()-e>m.autosave_retention?(a(!1),!1):!0}function a(t){v.removeItem(c+"draft"),v.removeItem(c+"time"),t!==!1&&e.fire("RemoveDraft")}function r(){!f()&&e.isDirty()&&(v.setItem(c+"draft",e.getContent({format:"raw",no_events:!0})),v.setItem(c+"time",(new Date).getTime()),e.fire("StoreDraft"))}function o(){n()&&(e.setContent(v.getItem(c+"draft"),{format:"raw"}),e.fire("RestoreDraft"))}function i(){d||(setInterval(function(){e.removed||r()},m.autosave_interval),d=!0)}function s(){var t=this;t.disabled(!n()),e.on("StoreDraft RestoreDraft RemoveDraft",function(){t.disabled(!n())}),i()}function u(){e.undoManager.beforeChange(),o(),a(),e.undoManager.add()}function f(t){var n=e.settings.forced_root_block;return t=tinymce.trim("undefined"==typeof t?e.getBody().innerHTML:t),""===t||new RegExp("^<"+n+"[^>]*>((\xa0| |[ ]|]*>)+?|)|
$","i").test(t)}var c,d,m=e.settings,v=tinymce.util.LocalStorage;c=m.autosave_prefix||"tinymce-autosave-{path}{query}-{id}-",c=c.replace(/\{path\}/g,document.location.pathname),c=c.replace(/\{query\}/g,document.location.search),c=c.replace(/\{id\}/g,e.id),m.autosave_interval=t(m.autosave_interval,"30s"),m.autosave_retention=t(m.autosave_retention,"20m"),e.addButton("restoredraft",{title:"Restore last draft",onclick:u,onPostRender:s}),e.addMenuItem("restoredraft",{text:"Restore last draft",onclick:u,onPostRender:s,context:"file"}),e.settings.autosave_restore_when_empty!==!1&&(e.on("init",function(){n()&&f()&&o()}),e.on("saveContent",function(){a()})),window.onbeforeunload=tinymce._beforeUnloadHandler,this.hasDraft=n,this.storeDraft=r,this.restoreDraft=o,this.removeDraft=a,this.isEmpty=f}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/bbcode/plugin.min.js b/app/lib/tinymce/plugins/bbcode/plugin.min.js deleted file mode 100644 index 78c37cd1..00000000 --- a/app/lib/tinymce/plugins/bbcode/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(o){var e=this,t=o.getParam("bbcode_dialect","punbb").toLowerCase();o.on("beforeSetContent",function(o){o.content=e["_"+t+"_bbcode2html"](o.content)}),o.on("postProcess",function(o){o.set&&(o.content=e["_"+t+"_bbcode2html"](o.content)),o.get&&(o.content=e["_"+t+"_html2bbcode"](o.content))})},getInfo:function(){return{longname:"BBCode Plugin",author:"Moxiecode Systems AB",authorurl:"http://www.tinymce.com",infourl:"http://www.tinymce.com/wiki.php/Plugin:bbcode"}},_punbb_html2bbcode:function(o){function e(e,t){o=o.replace(e,t)}return o=tinymce.trim(o),e(/(.*?)<\/a>/gi,"[url=$1]$2[/url]"),e(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),e(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),e(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),e(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),e(/(.*?)<\/span>/gi,"[color=$1]$2[/color]"),e(/(.*?)<\/font>/gi,"[color=$1]$2[/color]"),e(/(.*?)<\/span>/gi,"[size=$1]$2[/size]"),e(/(.*?)<\/font>/gi,"$1"),e(//gi,"[img]$1[/img]"),e(/(.*?)<\/span>/gi,"[code]$1[/code]"),e(/(.*?)<\/span>/gi,"[quote]$1[/quote]"),e(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),e(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),e(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),e(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),e(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),e(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),e(/<\/(strong|b)>/gi,"[/b]"),e(/<(strong|b)>/gi,"[b]"),e(/<\/(em|i)>/gi,"[/i]"),e(/<(em|i)>/gi,"[i]"),e(/<\/u>/gi,"[/u]"),e(/(.*?)<\/span>/gi,"[u]$1[/u]"),e(//gi,"[u]"),e(/]*>/gi,"[quote]"),e(/<\/blockquote>/gi,"[/quote]"),e(/
/gi,"\n"),e(//gi,"\n"),e(/
/gi,"\n"),e(/

/gi,""),e(/<\/p>/gi,"\n"),e(/ |\u00a0/gi," "),e(/"/gi,'"'),e(/</gi,"<"),e(/>/gi,">"),e(/&/gi,"&"),o},_punbb_bbcode2html:function(o){function e(e,t){o=o.replace(e,t)}return o=tinymce.trim(o),e(/\n/gi,"
"),e(/\[b\]/gi,""),e(/\[\/b\]/gi,""),e(/\[i\]/gi,""),e(/\[\/i\]/gi,""),e(/\[u\]/gi,""),e(/\[\/u\]/gi,""),e(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'
$2'),e(/\[url\](.*?)\[\/url\]/gi,'$1'),e(/\[img\](.*?)\[\/img\]/gi,''),e(/\[color=(.*?)\](.*?)\[\/color\]/gi,'$2'),e(/\[code\](.*?)\[\/code\]/gi,'$1 '),e(/\[quote.*?\](.*?)\[\/quote\]/gi,'$1 '),o}}),tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)}(); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/charmap/plugin.min.js b/app/lib/tinymce/plugins/charmap/plugin.min.js deleted file mode 100644 index 46fce44b..00000000 --- a/app/lib/tinymce/plugins/charmap/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("charmap",function(e){function a(){function a(e){for(;e;){if("TD"==e.nodeName)return e;e=e.parentNode}}var t,r,o,n;t='';var l=25;for(o=0;10>o;o++){for(t+="",r=0;l>r;r++){var s=i[o*l+r];t+='"}t+=""}t+="";var c={type:"container",html:t,onclick:function(a){var i=a.target;"TD"==i.tagName&&(i=i.firstChild),"DIV"==i.tagName&&(e.execCommand("mceInsertContent",!1,i.firstChild.data),a.ctrlKey||n.close())},onmouseover:function(e){var i=a(e.target);i&&n.find("#preview").text(i.firstChild.firstChild.data)}};n=e.windowManager.open({title:"Special character",spacing:10,padding:10,items:[c,{type:"label",name:"preview",text:" ",style:"font-size: 40px; text-align: center",border:1,minWidth:100,minHeight:80}],buttons:[{text:"Close",onclick:function(){n.close()}}]})}var i=[["160","no-break space"],["38","ampersand"],["34","quotation mark"],["162","cent sign"],["8364","euro sign"],["163","pound sign"],["165","yen sign"],["169","copyright sign"],["174","registered sign"],["8482","trade mark sign"],["8240","per mille sign"],["181","micro sign"],["183","middle dot"],["8226","bullet"],["8230","three dot leader"],["8242","minutes / feet"],["8243","seconds / inches"],["167","section sign"],["182","paragraph sign"],["223","sharp s / ess-zed"],["8249","single left-pointing angle quotation mark"],["8250","single right-pointing angle quotation mark"],["171","left pointing guillemet"],["187","right pointing guillemet"],["8216","left single quotation mark"],["8217","right single quotation mark"],["8220","left double quotation mark"],["8221","right double quotation mark"],["8218","single low-9 quotation mark"],["8222","double low-9 quotation mark"],["60","less-than sign"],["62","greater-than sign"],["8804","less-than or equal to"],["8805","greater-than or equal to"],["8211","en dash"],["8212","em dash"],["175","macron"],["8254","overline"],["164","currency sign"],["166","broken bar"],["168","diaeresis"],["161","inverted exclamation mark"],["191","turned question mark"],["710","circumflex accent"],["732","small tilde"],["176","degree sign"],["8722","minus sign"],["177","plus-minus sign"],["247","division sign"],["8260","fraction slash"],["215","multiplication sign"],["185","superscript one"],["178","superscript two"],["179","superscript three"],["188","fraction one quarter"],["189","fraction one half"],["190","fraction three quarters"],["402","function / florin"],["8747","integral"],["8721","n-ary sumation"],["8734","infinity"],["8730","square root"],["8764","similar to"],["8773","approximately equal to"],["8776","almost equal to"],["8800","not equal to"],["8801","identical to"],["8712","element of"],["8713","not an element of"],["8715","contains as member"],["8719","n-ary product"],["8743","logical and"],["8744","logical or"],["172","not sign"],["8745","intersection"],["8746","union"],["8706","partial differential"],["8704","for all"],["8707","there exists"],["8709","diameter"],["8711","backward difference"],["8727","asterisk operator"],["8733","proportional to"],["8736","angle"],["180","acute accent"],["184","cedilla"],["170","feminine ordinal indicator"],["186","masculine ordinal indicator"],["8224","dagger"],["8225","double dagger"],["192","A - grave"],["193","A - acute"],["194","A - circumflex"],["195","A - tilde"],["196","A - diaeresis"],["197","A - ring above"],["198","ligature AE"],["199","C - cedilla"],["200","E - grave"],["201","E - acute"],["202","E - circumflex"],["203","E - diaeresis"],["204","I - grave"],["205","I - acute"],["206","I - circumflex"],["207","I - diaeresis"],["208","ETH"],["209","N - tilde"],["210","O - grave"],["211","O - acute"],["212","O - circumflex"],["213","O - tilde"],["214","O - diaeresis"],["216","O - slash"],["338","ligature OE"],["352","S - caron"],["217","U - grave"],["218","U - acute"],["219","U - circumflex"],["220","U - diaeresis"],["221","Y - acute"],["376","Y - diaeresis"],["222","THORN"],["224","a - grave"],["225","a - acute"],["226","a - circumflex"],["227","a - tilde"],["228","a - diaeresis"],["229","a - ring above"],["230","ligature ae"],["231","c - cedilla"],["232","e - grave"],["233","e - acute"],["234","e - circumflex"],["235","e - diaeresis"],["236","i - grave"],["237","i - acute"],["238","i - circumflex"],["239","i - diaeresis"],["240","eth"],["241","n - tilde"],["242","o - grave"],["243","o - acute"],["244","o - circumflex"],["245","o - tilde"],["246","o - diaeresis"],["248","o slash"],["339","ligature oe"],["353","s - caron"],["249","u - grave"],["250","u - acute"],["251","u - circumflex"],["252","u - diaeresis"],["253","y - acute"],["254","thorn"],["255","y - diaeresis"],["913","Alpha"],["914","Beta"],["915","Gamma"],["916","Delta"],["917","Epsilon"],["918","Zeta"],["919","Eta"],["920","Theta"],["921","Iota"],["922","Kappa"],["923","Lambda"],["924","Mu"],["925","Nu"],["926","Xi"],["927","Omicron"],["928","Pi"],["929","Rho"],["931","Sigma"],["932","Tau"],["933","Upsilon"],["934","Phi"],["935","Chi"],["936","Psi"],["937","Omega"],["945","alpha"],["946","beta"],["947","gamma"],["948","delta"],["949","epsilon"],["950","zeta"],["951","eta"],["952","theta"],["953","iota"],["954","kappa"],["955","lambda"],["956","mu"],["957","nu"],["958","xi"],["959","omicron"],["960","pi"],["961","rho"],["962","final sigma"],["963","sigma"],["964","tau"],["965","upsilon"],["966","phi"],["967","chi"],["968","psi"],["969","omega"],["8501","alef symbol"],["982","pi symbol"],["8476","real part symbol"],["978","upsilon - hook symbol"],["8472","Weierstrass p"],["8465","imaginary part"],["8592","leftwards arrow"],["8593","upwards arrow"],["8594","rightwards arrow"],["8595","downwards arrow"],["8596","left right arrow"],["8629","carriage return"],["8656","leftwards double arrow"],["8657","upwards double arrow"],["8658","rightwards double arrow"],["8659","downwards double arrow"],["8660","left right double arrow"],["8756","therefore"],["8834","subset of"],["8835","superset of"],["8836","not a subset of"],["8838","subset of or equal to"],["8839","superset of or equal to"],["8853","circled plus"],["8855","circled times"],["8869","perpendicular"],["8901","dot operator"],["8968","left ceiling"],["8969","right ceiling"],["8970","left floor"],["8971","right floor"],["9001","left-pointing angle bracket"],["9002","right-pointing angle bracket"],["9674","lozenge"],["9824","black spade suit"],["9827","black club suit"],["9829","black heart suit"],["9830","black diamond suit"],["8194","en space"],["8195","em space"],["8201","thin space"],["8204","zero width non-joiner"],["8205","zero width joiner"],["8206","left-to-right mark"],["8207","right-to-left mark"],["173","soft hyphen"]];e.addButton("charmap",{icon:"charmap",tooltip:"Special character",onclick:a}),e.addMenuItem("charmap",{icon:"charmap",text:"Special character",onclick:a,context:"insert"})}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/code/plugin.min.js b/app/lib/tinymce/plugins/code/plugin.min.js deleted file mode 100644 index 6aaecd9a..00000000 --- a/app/lib/tinymce/plugins/code/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("code",function(e){function o(){var o=e.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:e.getParam("code_dialog_width",600),minHeight:e.getParam("code_dialog_height",Math.min(tinymce.DOM.getViewPort().h-200,500)),spellcheck:!1,style:"direction: ltr; text-align: left"},onSubmit:function(o){e.focus(),e.undoManager.transact(function(){e.setContent(o.data.code)}),e.selection.setCursorLocation(),e.nodeChanged()}});o.find("#code").value(e.getContent({source_view:!0}))}e.addCommand("mceCodeEditor",o),e.addButton("code",{icon:"code",tooltip:"Source code",onclick:o}),e.addMenuItem("code",{icon:"code",text:"Source code",context:"tools",onclick:o})}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/colorpicker/plugin.min.js b/app/lib/tinymce/plugins/colorpicker/plugin.min.js deleted file mode 100644 index d50c7cc4..00000000 --- a/app/lib/tinymce/plugins/colorpicker/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("colorpicker",function(e){function n(n,a){function i(e){var n=new tinymce.util.Color(e),a=n.toRgb();l.fromJSON({r:a.r,g:a.g,b:a.b,hex:n.toHex().substr(1)}),t(n.toHex())}function t(e){l.find("#preview")[0].getEl().style.background=e}var l=e.windowManager.open({title:"Color",items:{type:"container",layout:"flex",direction:"row",align:"stretch",padding:5,spacing:10,items:[{type:"colorpicker",value:a,onchange:function(){var e=this.rgb();l&&(l.find("#r").value(e.r),l.find("#g").value(e.g),l.find("#b").value(e.b),l.find("#hex").value(this.value().substr(1)),t(this.value()))}},{type:"form",padding:0,labelGap:5,defaults:{type:"textbox",size:7,value:"0",flex:1,spellcheck:!1,onchange:function(){var e,n,a=l.find("colorpicker")[0];return e=this.name(),n=this.value(),"hex"==e?(n="#"+n,i(n),void a.value(n)):(n={r:l.find("#r").value(),g:l.find("#g").value(),b:l.find("#b").value()},a.value(n),void i(n))}},items:[{name:"r",label:"R",autofocus:1},{name:"g",label:"G"},{name:"b",label:"B"},{name:"hex",label:"#",value:"000000"},{name:"preview",type:"container",border:1}]}]},onSubmit:function(){n("#"+this.toJSON().hex)}});i(a)}e.settings.color_picker_callback||(e.settings.color_picker_callback=n)}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/contextmenu/plugin.min.js b/app/lib/tinymce/plugins/contextmenu/plugin.min.js deleted file mode 100644 index e21978e8..00000000 --- a/app/lib/tinymce/plugins/contextmenu/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("contextmenu",function(e){var t,n=e.settings.contextmenu_never_use_native;e.on("contextmenu",function(o){var i,c=e.getDoc();if(!o.ctrlKey||n){if(o.preventDefault(),tinymce.Env.mac&&tinymce.Env.webkit&&2==o.button&&c.caretRangeFromPoint&&e.selection.setRng(c.caretRangeFromPoint(o.x,o.y)),i=e.settings.contextmenu||"link image inserttable | cell row column deletetable",t)t.show();else{var a=[];tinymce.each(i.split(/[ ,]/),function(t){var n=e.menuItems[t];"|"==t&&(n={text:t}),n&&(n.shortcut="",a.push(n))});for(var r=0;r'}),t+=""}),t+=""}var i=[["cool","cry","embarassed","foot-in-mouth"],["frown","innocent","kiss","laughing"],["money-mouth","sealed","smile","surprised"],["tongue-out","undecided","wink","yell"]];t.addButton("emoticons",{type:"panelbutton",panel:{role:"application",autohide:!0,html:a,onclick:function(e){var a=t.dom.getParent(e.target,"a");a&&(t.insertContent(''+a.getAttribute('),this.hide())}},tooltip:"Emoticons"})}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/example/dialog.html b/app/lib/tinymce/plugins/example/dialog.html deleted file mode 100644 index 565f06f5..00000000 --- a/app/lib/tinymce/plugins/example/dialog.html +++ /dev/null @@ -1,8 +0,0 @@ - - - -

Custom dialog

- Input some text: - - - \ No newline at end of file diff --git a/app/lib/tinymce/plugins/example/plugin.min.js b/app/lib/tinymce/plugins/example/plugin.min.js deleted file mode 100644 index 00a262ef..00000000 --- a/app/lib/tinymce/plugins/example/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("example",function(t,e){t.addButton("example",{text:"My button",icon:!1,onclick:function(){t.windowManager.open({title:"Example plugin",body:[{type:"textbox",name:"title",label:"Title"}],onsubmit:function(e){t.insertContent("Title: "+e.data.title)}})}}),t.addMenuItem("example",{text:"Example plugin",context:"tools",onclick:function(){t.windowManager.open({title:"TinyMCE site",url:e+"/dialog.html",width:600,height:400,buttons:[{text:"Insert",onclick:function(){var e=t.windowManager.getWindows()[0];t.insertContent(e.getContentWindow().document.getElementById("content").value),e.close()}},{text:"Close",onclick:"close"}]})}})}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/example_dependency/plugin.min.js b/app/lib/tinymce/plugins/example_dependency/plugin.min.js deleted file mode 100644 index e61bf473..00000000 --- a/app/lib/tinymce/plugins/example_dependency/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("example_dependency",function(){},["example"]); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/fullpage/plugin.min.js b/app/lib/tinymce/plugins/fullpage/plugin.min.js deleted file mode 100644 index c0dfa2d3..00000000 --- a/app/lib/tinymce/plugins/fullpage/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("fullpage",function(e){function t(){var t=n();e.windowManager.open({title:"Document properties",data:t,defaults:{type:"textbox",size:40},body:[{name:"title",label:"Title"},{name:"keywords",label:"Keywords"},{name:"description",label:"Description"},{name:"robots",label:"Robots"},{name:"author",label:"Author"},{name:"docencoding",label:"Encoding"}],onSubmit:function(e){l(tinymce.extend(t,e.data))}})}function n(){function t(e,t){var n=e.attr(t);return n||""}var n,l,a=i(),r={};return r.fontface=e.getParam("fullpage_default_fontface",""),r.fontsize=e.getParam("fullpage_default_fontsize",""),n=a.firstChild,7==n.type&&(r.xml_pi=!0,l=/encoding="([^"]+)"/.exec(n.value),l&&(r.docencoding=l[1])),n=a.getAll("#doctype")[0],n&&(r.doctype=""),n=a.getAll("title")[0],n&&n.firstChild&&(r.title=n.firstChild.value),s(a.getAll("meta"),function(e){var t,n=e.attr("name"),l=e.attr("http-equiv");n?r[n.toLowerCase()]=e.attr("content"):"Content-Type"==l&&(t=/charset\s*=\s*(.*)\s*/gi.exec(e.attr("content")),t&&(r.docencoding=t[1]))}),n=a.getAll("html")[0],n&&(r.langcode=t(n,"lang")||t(n,"xml:lang")),r.stylesheets=[],tinymce.each(a.getAll("link"),function(e){"stylesheet"==e.attr("rel")&&r.stylesheets.push(e.attr("href"))}),n=a.getAll("body")[0],n&&(r.langdir=t(n,"dir"),r.style=t(n,"style"),r.visited_color=t(n,"vlink"),r.link_color=t(n,"link"),r.active_color=t(n,"alink")),r}function l(t){function n(e,t,n){e.attr(t,n?n:void 0)}function l(e){r.firstChild?r.insert(e,r.firstChild):r.append(e)}var a,r,o,d,u,g=e.dom;a=i(),r=a.getAll("head")[0],r||(d=a.getAll("html")[0],r=new m("head",1),d.firstChild?d.insert(r,d.firstChild,!0):d.append(r)),d=a.firstChild,t.xml_pi?(u='version="1.0"',t.docencoding&&(u+=' encoding="'+t.docencoding+'"'),7!=d.type&&(d=new m("xml",7),a.insert(d,a.firstChild,!0)),d.value=u):d&&7==d.type&&d.remove(),d=a.getAll("#doctype")[0],t.doctype?(d||(d=new m("#doctype",10),t.xml_pi?a.insert(d,a.firstChild):l(d)),d.value=t.doctype.substring(9,t.doctype.length-1)):d&&d.remove(),d=null,s(a.getAll("meta"),function(e){"Content-Type"==e.attr("http-equiv")&&(d=e)}),t.docencoding?(d||(d=new m("meta",1),d.attr("http-equiv","Content-Type"),d.shortEnded=!0,l(d)),d.attr("content","text/html; charset="+t.docencoding)):d&&d.remove(),d=a.getAll("title")[0],t.title?(d?d.empty():(d=new m("title",1),l(d)),d.append(new m("#text",3)).value=t.title):d&&d.remove(),s("keywords,description,author,copyright,robots".split(","),function(e){var n,i,r=a.getAll("meta"),o=t[e];for(n=0;n"))}function i(){return new tinymce.html.DomParser({validate:!1,root_name:"#document"}).parse(c)}function a(t){function n(e){return e.replace(/<\/?[A-Z]+/g,function(e){return e.toLowerCase()})}var l,a,o,m,u=t.content,g="",f=e.dom;if(!t.selection&&!("raw"==t.format&&c||t.source_view&&e.getParam("fullpage_hide_in_source_view"))){0!==u.length||t.source_view||(u=tinymce.trim(c)+"\n"+tinymce.trim(u)+"\n"+tinymce.trim(d)),u=u.replace(/<(\/?)BODY/gi,"<$1body"),l=u.indexOf("",l),c=n(u.substring(0,l+1)),a=u.indexOf("\n"),o=i(),s(o.getAll("style"),function(e){e.firstChild&&(g+=e.firstChild.value)}),m=o.getAll("body")[0],m&&f.setAttribs(e.getBody(),{style:m.attr("style")||"",dir:m.attr("dir")||"",vLink:m.attr("vlink")||"",link:m.attr("link")||"",aLink:m.attr("alink")||""}),f.remove("fullpage_styles");var y=e.getDoc().getElementsByTagName("head")[0];g&&(f.add(y,"style",{id:"fullpage_styles"},g),m=f.get("fullpage_styles"),m.styleSheet&&(m.styleSheet.cssText=g));var h={};tinymce.each(y.getElementsByTagName("link"),function(e){"stylesheet"==e.rel&&e.getAttribute("data-mce-fullpage")&&(h[e.href]=e)}),tinymce.each(o.getAll("link"),function(e){var t=e.attr("href");h[t]||"stylesheet"!=e.attr("rel")||f.add(y,"link",{rel:"stylesheet",text:"text/css",href:t,"data-mce-fullpage":"1"}),delete h[t]}),tinymce.each(h,function(e){e.parentNode.removeChild(e)})}}function r(){var t,n="",l="";return e.getParam("fullpage_default_xml_pi")&&(n+='\n'),n+=e.getParam("fullpage_default_doctype",""),n+="\n\n\n",(t=e.getParam("fullpage_default_title"))&&(n+=""+t+"\n"),(t=e.getParam("fullpage_default_encoding"))&&(n+='\n'),(t=e.getParam("fullpage_default_font_family"))&&(l+="font-family: "+t+";"),(t=e.getParam("fullpage_default_font_size"))&&(l+="font-size: "+t+";"),(t=e.getParam("fullpage_default_text_color"))&&(l+="color: "+t+";"),n+="\n\n"}function o(t){t.selection||t.source_view&&e.getParam("fullpage_hide_in_source_view")||(t.content=tinymce.trim(c)+"\n"+tinymce.trim(t.content)+"\n"+tinymce.trim(d))}var c,d,s=tinymce.each,m=tinymce.html.Node;e.addCommand("mceFullPageProperties",t),e.addButton("fullpage",{title:"Document properties",cmd:"mceFullPageProperties"}),e.addMenuItem("fullpage",{text:"Document properties",cmd:"mceFullPageProperties",context:"file"}),e.on("BeforeSetContent",a),e.on("GetContent",o)}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/fullscreen/plugin.min.js b/app/lib/tinymce/plugins/fullscreen/plugin.min.js deleted file mode 100644 index 1bb1940d..00000000 --- a/app/lib/tinymce/plugins/fullscreen/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("fullscreen",function(e){function t(){var e,t,n=window,i=document,l=i.body;return l.offsetWidth&&(e=l.offsetWidth,t=l.offsetHeight),n.innerWidth&&n.innerHeight&&(e=n.innerWidth,t=n.innerHeight),{w:e,h:t}}function n(){function n(){d.setStyle(a,"height",t().h-(h.clientHeight-a.clientHeight))}var u,h,a,f,m=document.body,g=document.documentElement;s=!s,h=e.getContainer(),u=h.style,a=e.getContentAreaContainer().firstChild,f=a.style,s?(i=f.width,l=f.height,f.width=f.height="100%",c=u.width,o=u.height,u.width=u.height="",d.addClass(m,"mce-fullscreen"),d.addClass(g,"mce-fullscreen"),d.addClass(h,"mce-fullscreen"),d.bind(window,"resize",n),n(),r=n):(f.width=i,f.height=l,c&&(u.width=c),o&&(u.height=o),d.removeClass(m,"mce-fullscreen"),d.removeClass(g,"mce-fullscreen"),d.removeClass(h,"mce-fullscreen"),d.unbind(window,"resize",r)),e.fire("FullscreenStateChanged",{state:s})}var i,l,r,c,o,s=!1,d=tinymce.DOM;return e.settings.inline?void 0:(e.on("init",function(){e.addShortcut("Ctrl+Alt+F","",n)}),e.on("remove",function(){r&&d.unbind(window,"resize",r)}),e.addCommand("mceFullScreen",n),e.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Ctrl+Alt+F",selectable:!0,onClick:n,onPostRender:function(){var t=this;e.on("FullscreenStateChanged",function(e){t.active(e.state)})},context:"view"}),e.addButton("fullscreen",{tooltip:"Fullscreen",shortcut:"Ctrl+Alt+F",onClick:n,onPostRender:function(){var t=this;e.on("FullscreenStateChanged",function(e){t.active(e.state)})}}),{isFullscreen:function(){return s}})}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/hr/plugin.min.js b/app/lib/tinymce/plugins/hr/plugin.min.js deleted file mode 100644 index e5ff6f31..00000000 --- a/app/lib/tinymce/plugins/hr/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("hr",function(n){n.addCommand("InsertHorizontalRule",function(){n.execCommand("mceInsertContent",!1,"
")}),n.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),n.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/image/plugin.min.js b/app/lib/tinymce/plugins/image/plugin.min.js deleted file mode 100644 index 856b2ab4..00000000 --- a/app/lib/tinymce/plugins/image/plugin.min.js +++ /dev/null @@ -1,121 +0,0 @@ -tinymce.PluginManager.add("image", function (e) { - function t(e, t) { - function i(e, i) { - n.parentNode && n.parentNode.removeChild(n), t({width: e, height: i}) - } - - var n = document.createElement("img"); - n.onload = function () { - i(n.clientWidth, n.clientHeight) - }, n.onerror = function () { - i() - }; - var a = n.style; - a.visibility = "hidden", a.position = "fixed", a.bottom = a.left = 0, a.width = a.height = "auto", document.body.appendChild(n), n.src = e - } - - function i(e, t, i) { - function n(e, i) { - return i = i || [], tinymce.each(e, function (e) { - var a = {text: e.text || e.title}; - e.menu ? a.menu = n(e.menu) : (a.value = e.value, t(a)), i.push(a) - }), i - } - - return n(e, i || []) - } - - function n(t) { - return function () { - var i = e.settings.image_list; - "string" == typeof i ? tinymce.util.XHR.send({url: i, success: function (e) { - t(tinymce.util.JSON.parse(e)) - }}) : "function" == typeof i ? i(t) : t(i) - } - } - - function a(n) { - function a() { - var e, t, i, n; - e = c.find("#width")[0], t = c.find("#height")[0], e && t && (i = e.value(), n = t.value(), c.find("#constrain")[0].checked() && d && u && i && n && (d != i ? (n = Math.round(i / d * n), t.value(n)) : (i = Math.round(n / u * i), e.value(i))), d = i, u = n) - } - - function l() { - function t(t) { - function i() { - t.onload = t.onerror = null, e.selection && (e.selection.select(t), e.nodeChanged()) - } - - t.onload = function () { - m.width || m.height || !y || p.setAttribs(t, {width: t.clientWidth, height: t.clientHeight}), i() - }, t.onerror = i - } - - s(), a(), m = tinymce.extend(m, c.toJSON()), m.alt || (m.alt = ""), "" === m.width && (m.width = null), "" === m.height && (m.height = null), m.style || (m.style = null), m = {src: m.src, alt: m.alt, width: m.width, height: m.height, style: m.style, "class": m["class"]}, e.undoManager.transact(function () { - return m.src ? (f ? p.setAttribs(f, m) : (m.id = "__mcenew", e.focus(), e.selection.setContent(p.createHTML("img", m)), f = p.get("__mcenew"), p.setAttrib(f, "id", null)), void t(f)) : void(f && (p.remove(f), e.focus(), e.nodeChanged())) - }) - } - - function o(e) { - return e && (e = e.replace(/px$/, "")), e - } - - function r(i) { - var n = i.meta || {}; - g && g.value(e.convertURL(this.value(), "src")), tinymce.each(n, function (e, t) { - c.find("#" + t).value(e) - }), n.width || n.height || t(this.value(), function (e) { - e.width && e.height && y && (d = e.width, u = e.height, c.find("#width").value(d), c.find("#height").value(u)) - }) - } - - function s() { - function t(e) { - return e.length > 0 && /^[0-9]+$/.test(e) && (e += "px"), e - } - - if (e.settings.image_advtab) { - var i = c.toJSON(), n = p.parseStyle(i.style); - delete n.margin, n["margin-top"] = n["margin-bottom"] = t(i.vspace), n["margin-left"] = n["margin-right"] = t(i.hspace), n["border-width"] = t(i.border), c.find("#style").value(p.serializeStyle(p.parseStyle(p.serializeStyle(n)))) - } - } - - var c, d, u, g, h, m = {}, p = e.dom, f = e.selection.getNode(), y = e.settings.image_dimensions !== !1; - d = p.getAttrib(f, "width"), u = p.getAttrib(f, "height"), "IMG" != f.nodeName || f.getAttribute("data-mce-object") || f.getAttribute("data-mce-placeholder") ? f = null : m = {src: p.getAttrib(f, "src"), alt: p.getAttrib(f, "alt"), "class": p.getAttrib(f, "class"), width: d, height: u}, n && (g = {type: "listbox", label: "Image list", values: i(n, function (t) { - t.value = e.convertURL(t.value || t.url, "src") - }, [ - {text: "None", value: ""} - ]), value: m.src && e.convertURL(m.src, "src"), onselect: function (e) { - var t = c.find("#alt"); - (!t.value() || e.lastControl && t.value() == e.lastControl.text()) && t.value(e.control.text()), c.find("#src").value(e.control.value()).fire("change") - }, onPostRender: function () { - g = this - }}), e.settings.image_class_list && (h = {name: "class", type: "listbox", label: "Class", values: i(e.settings.image_class_list, function (t) { - t.value && (t.textStyle = function () { - return e.formatter.getCssText({inline: "img", classes: [t.value]}) - }) - })}); - var b = [ - {name: "src", type: "filepicker", filetype: "image", label: "Source", autofocus: !0, onchange: r}, - g - ]; - e.settings.image_description !== !1 && b.push({name: "alt", type: "textbox", label: "Image description"}), y && b.push({type: "container", label: "Dimensions", layout: "flex", direction: "row", align: "center", spacing: 5, items: [ - {name: "width", type: "textbox", maxLength: 5, size: 3, onchange: a, ariaLabel: "Width"}, - {type: "label", text: "x"}, - {name: "height", type: "textbox", maxLength: 5, size: 3, onchange: a, ariaLabel: "Height"}, - {name: "constrain", type: "checkbox", checked: !0, text: "Constrain proportions"} - ]}), b.push(h), e.settings.image_advtab ? (f && (m.hspace = o(f.style.marginLeft || f.style.marginRight), m.vspace = o(f.style.marginTop || f.style.marginBottom), m.border = o(f.style.borderWidth), m.style = e.dom.serializeStyle(e.dom.parseStyle(e.dom.getAttrib(f, "style")))), c = e.windowManager.open({title: "Insert/edit image", data: m, bodyType: "tabpanel", body: [ - {title: "General", type: "form", items: b}, - {title: "Advanced", type: "form", pack: "start", items: [ - {label: "Style", name: "style", type: "textbox"}, - {type: "form", layout: "grid", packV: "start", columns: 2, padding: 0, alignH: ["left", "right"], defaults: {type: "textbox", maxWidth: 50, onchange: s}, items: [ - {label: "Vertical space", name: "vspace"}, - {label: "Horizontal space", name: "hspace"}, - {label: "Border", name: "border"} - ]} - ]} - ], onSubmit: l})) : c = e.windowManager.open({title: "Insert/edit image", data: m, body: b, onSubmit: l}) - } - - e.addButton("image", {icon: "image", tooltip: "Insert/edit image", onclick: n(a), stateSelector: "img:not([data-mce-object],[data-mce-placeholder])"}), e.addMenuItem("image", {icon: "image", text: "Insert image", onclick: n(a), context: "insert", prependToContext: !0}), e.addCommand("mceImage", n(a)) -}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/importcss/plugin.min.js b/app/lib/tinymce/plugins/importcss/plugin.min.js deleted file mode 100644 index 5dd1d443..00000000 --- a/app/lib/tinymce/plugins/importcss/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("importcss",function(t){function e(t){return"string"==typeof t?function(e){return-1!==e.indexOf(t)}:t instanceof RegExp?function(e){return t.test(e)}:t}function n(e,n){function i(t,e){var c,o=t.href;if(o&&n(o,e)){s(t.imports,function(t){i(t,!0)});try{c=t.cssRules||t.rules}catch(a){}s(c,function(t){t.styleSheet?i(t.styleSheet,!0):t.selectorText&&s(t.selectorText.split(","),function(t){r.push(tinymce.trim(t))})})}}var r=[],c={};s(t.contentCSS,function(t){c[t]=!0}),n||(n=function(t,e){return e||c[t]});try{s(e.styleSheets,function(t){i(t)})}catch(o){}return r}function i(e){var n,i=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(e);if(i){var r=i[1],s=i[2].substr(1).split(".").join(" "),c=tinymce.makeMap("a,img");return i[1]?(n={title:e},t.schema.getTextBlockElements()[r]?n.block=r:t.schema.getBlockElements()[r]||c[r.toLowerCase()]?n.selector=r:n.inline=r):i[2]&&(n={inline:"span",title:e.substr(1),classes:s}),t.settings.importcss_merge_classes!==!1?n.classes=s:n.attributes={"class":s},n}}var r=this,s=tinymce.each;t.on("renderFormatsMenu",function(c){var o=t.settings,a={},l=o.importcss_selector_converter||i,f=e(o.importcss_selector_filter),m=c.control;t.settings.importcss_append||m.items().remove();var u=[];tinymce.each(o.importcss_groups,function(t){t=tinymce.extend({},t),t.filter=e(t.filter),u.push(t)}),s(n(c.doc||t.getDoc(),e(o.importcss_file_filter)),function(e){if(-1===e.indexOf(".mce-")&&!a[e]&&(!f||f(e))){var n,i=l.call(r,e);if(i){var s=i.name||tinymce.DOM.uniqueId();if(u)for(var c=0;c'+n+"";var i=e.dom.getParent(e.selection.getStart(),"time");if(i)return void e.dom.setOuterHTML(i,n)}e.insertContent(n)}var n,r,i="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),d="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),c="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),m="January February March April May June July August September October November December".split(" "),u=[];e.addCommand("mceInsertDate",function(){a(e.getParam("insertdatetime_dateformat",e.translate("%Y-%m-%d")))}),e.addCommand("mceInsertTime",function(){a(e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S")))}),e.addButton("insertdatetime",{type:"splitbutton",title:"Insert date/time",onclick:function(){a(n||r)},menu:u}),tinymce.each(e.settings.insertdatetime_formats||["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"],function(e){r||(r=e),u.push({text:t(e),onclick:function(){n=e,a(e)}})}),e.addMenuItem("insertdatetime",{icon:"date",text:"Insert date/time",menu:u,context:"insert"})}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/layer/plugin.min.js b/app/lib/tinymce/plugins/layer/plugin.min.js deleted file mode 100644 index f1002927..00000000 --- a/app/lib/tinymce/plugins/layer/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("layer",function(e){function t(e){do if(e.className&&-1!=e.className.indexOf("mceItemLayer"))return e;while(e=e.parentNode)}function o(t){var o=e.dom;tinymce.each(o.select("div,p",t),function(e){/^(absolute|relative|fixed)$/i.test(e.style.position)&&(e.hasVisual?o.addClass(e,"mceItemVisualAid"):o.removeClass(e,"mceItemVisualAid"),o.addClass(e,"mceItemLayer"))})}function d(o){var d,n,a=[],i=t(e.selection.getNode()),s=-1,l=-1;for(n=[],tinymce.walk(e.getBody(),function(e){1==e.nodeType&&/^(absolute|relative|static)$/i.test(e.style.position)&&n.push(e)},"childNodes"),d=0;ds&&n[d]==i&&(s=d);if(0>o){for(d=0;d-1?(n[s].style.zIndex=a[l],n[l].style.zIndex=a[s]):a[s]>0&&(n[s].style.zIndex=a[s]-1)}else{for(d=0;da[s]){l=d;break}l>-1?(n[s].style.zIndex=a[l],n[l].style.zIndex=a[s]):n[s].style.zIndex=a[s]+1}e.execCommand("mceRepaint")}function n(){var t=e.dom,o=t.getPos(t.getParent(e.selection.getNode(),"*")),d=e.getBody();e.dom.add(d,"div",{style:{position:"absolute",left:o.x,top:o.y>20?o.y:20,width:100,height:100},"class":"mceItemVisualAid mceItemLayer"},e.selection.getContent()||e.getLang("layer.content")),tinymce.Env.ie&&t.setHTML(d,d.innerHTML)}function a(){var o=t(e.selection.getNode());o||(o=e.dom.getParent(e.selection.getNode(),"DIV,P,IMG")),o&&("absolute"==o.style.position.toLowerCase()?(e.dom.setStyles(o,{position:"",left:"",top:"",width:"",height:""}),e.dom.removeClass(o,"mceItemVisualAid"),e.dom.removeClass(o,"mceItemLayer")):(o.style.left||(o.style.left="20px"),o.style.top||(o.style.top="20px"),o.style.width||(o.style.width=o.width?o.width+"px":"100px"),o.style.height||(o.style.height=o.height?o.height+"px":"100px"),o.style.position="absolute",e.dom.setAttrib(o,"data-mce-style",""),e.addVisual(e.getBody())),e.execCommand("mceRepaint"),e.nodeChanged())}e.addCommand("mceInsertLayer",n),e.addCommand("mceMoveForward",function(){d(1)}),e.addCommand("mceMoveBackward",function(){d(-1)}),e.addCommand("mceMakeAbsolute",function(){a()}),e.addButton("moveforward",{title:"layer.forward_desc",cmd:"mceMoveForward"}),e.addButton("movebackward",{title:"layer.backward_desc",cmd:"mceMoveBackward"}),e.addButton("absolute",{title:"layer.absolute_desc",cmd:"mceMakeAbsolute"}),e.addButton("insertlayer",{title:"layer.insertlayer_desc",cmd:"mceInsertLayer"}),e.on("init",function(){tinymce.Env.ie&&e.getDoc().execCommand("2D-Position",!1,!0)}),e.on("mouseup",function(o){var d=t(o.target);d&&e.dom.setAttrib(d,"data-mce-style","")}),e.on("mousedown",function(o){var d,n=o.target,a=e.getDoc();tinymce.Env.gecko&&(t(n)?"on"!==a.designMode&&(a.designMode="on",n=a.body,d=n.parentNode,d.removeChild(n),d.appendChild(n)):"on"==a.designMode&&(a.designMode="off"))}),e.on("NodeChange",o)}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/legacyoutput/plugin.min.js b/app/lib/tinymce/plugins/legacyoutput/plugin.min.js deleted file mode 100644 index f2002165..00000000 --- a/app/lib/tinymce/plugins/legacyoutput/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e){e.on("AddEditor",function(e){e.editor.settings.inline_styles=!1}),e.PluginManager.add("legacyoutput",function(t,n,i){t.on("init",function(){var n="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",i=e.explode(t.settings.font_size_style_values),a=t.schema;t.formatter.register({alignleft:{selector:n,attributes:{align:"left"}},aligncenter:{selector:n,attributes:{align:"center"}},alignright:{selector:n,attributes:{align:"right"}},alignjustify:{selector:n,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(t){return e.inArray(i,t.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}}),e.each("b,i,u,strike".split(","),function(e){a.addValidElements(e+"[*]")}),a.getElementRule("font")||a.addValidElements("font[face|size|color|style]"),e.each(n.split(","),function(e){var t=a.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))})}),t.addButton("fontsizeselect",function(){var e=[],n="8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7",i=t.settings.fontsize_formats||n;return t.$.each(i.split(" "),function(t,n){var i=n,a=n,o=n.split("=");o.length>1&&(i=o[0],a=o[1]),e.push({text:i,value:a})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:e,fixedWidth:!0,onPostRender:function(){var e=this;t.on("NodeChange",function(){var n;n=t.dom.getParent(t.selection.getNode(),"font"),e.value(n?n.size:"")})},onclick:function(e){e.control.settings.value&&t.execCommand("FontSize",!1,e.control.settings.value)}}}),t.addButton("fontselect",function(){function e(e){e=e.replace(/;$/,"").split(";");for(var t=e.length;t--;)e[t]=e[t].split("=");return e}var n="Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",a=[],o=e(t.settings.font_formats||n);return i.each(o,function(e,t){a.push({text:{raw:t[0]},value:t[1],textStyle:-1==t[1].indexOf("dings")?"font-family:"+t[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:a,fixedWidth:!0,onPostRender:function(){var e=this;t.on("NodeChange",function(){var n;n=t.dom.getParent(t.selection.getNode(),"font"),e.value(n?n.face:"")})},onselect:function(e){e.control.settings.value&&t.execCommand("FontName",!1,e.control.settings.value)}}})})}(tinymce); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/link/plugin.min.js b/app/lib/tinymce/plugins/link/plugin.min.js deleted file mode 100644 index 6797b5b4..00000000 --- a/app/lib/tinymce/plugins/link/plugin.min.js +++ /dev/null @@ -1,108 +0,0 @@ -tinymce.PluginManager.add("link", function (t) { - function e(e) { - return function () { - var n = t.settings.link_list; - "string" == typeof n ? tinymce.util.XHR.send({url: n, success: function (t) { - e(tinymce.util.JSON.parse(t)) - }}) : "function" == typeof n ? n(e) : e(n) - } - } - - function n(t, e, n) { - function i(t, n) { - return n = n || [], tinymce.each(t, function (t) { - var l = {text: t.text || t.title}; - t.menu ? l.menu = i(t.menu) : (l.value = t.value, e && e(l)), n.push(l) - }), n - } - - return i(t, n || []) - } - - function i(e) { - function i(t) { - var e = f.find("#text"); - (!e.value() || t.lastControl && e.value() == t.lastControl.text()) && e.value(t.control.text()), f.find("#href").value(t.control.value()) - } - - function l(e) { - var n = []; - return tinymce.each(t.dom.select("a:not([href])"), function (t) { - var i = t.name || t.id; - i && n.push({text: i, value: "#" + i, selected: -1 != e.indexOf("#" + i)}) - }), n.length ? (n.unshift({text: "None", value: ""}), {name: "anchor", type: "listbox", label: "Anchors", values: n, onselect: i}) : void 0 - } - - function a() { - !c && 0 === y.text.length && d && this.parent().parent().find("#text")[0].value(this.value()) - } - - function o(e) { - var n = e.meta || {}; - x && x.value(t.convertURL(this.value(), "href")), tinymce.each(e.meta, function (t, e) { - f.find("#" + e).value(t) - }), n.text || a.call(this) - } - - function r(t) { - var e = b.getContent(); - if (/]+>[^<]+<\/a>$/.test(e) || -1 == e.indexOf("href=")))return!1; - if (t) { - var n, i = t.childNodes; - if (0 === i.length)return!1; - for (n = i.length - 1; n >= 0; n--)if (3 != i[n].nodeType)return!1 - } - return!0 - } - - var s, u, c, f, d, g, x, v, h, m, p, k, y = {}, b = t.selection, _ = t.dom; - s = b.getNode(), u = _.getParent(s, "a[href]"), d = r(), y.text = c = u ? u.innerText || u.textContent : b.getContent({format: "text"}), y.href = u ? _.getAttrib(u, "href") : "", (k = _.getAttrib(u, "target")) ? y.target = k : t.settings.default_link_target && (y.target = t.settings.default_link_target), (k = _.getAttrib(u, "rel")) && (y.rel = k), (k = _.getAttrib(u, "class")) && (y["class"] = k), (k = _.getAttrib(u, "title")) && (y.title = k), d && (g = {name: "text", type: "textbox", size: 40, label: "Text to display", onchange: function () { - y.text = this.value() - }}), e && (x = {type: "listbox", label: "Link list", values: n(e, function (e) { - e.value = t.convertURL(e.value || e.url, "href") - }, [ - {text: "None", value: ""} - ]), onselect: i, value: t.convertURL(y.href, "href"), onPostRender: function () { - x = this - }}), t.settings.target_list !== !1 && (t.settings.target_list || (t.settings.target_list = [ - {text: "None", value: ""}, - {text: "New window", value: "_blank"} - ]), h = {name: "target", type: "listbox", label: "Target", values: n(t.settings.target_list)}), t.settings.rel_list && (v = {name: "rel", type: "listbox", label: "Rel", values: n(t.settings.rel_list)}), t.settings.link_class_list && (m = {name: "class", type: "listbox", label: "Class", values: n(t.settings.link_class_list, function (e) { - e.value && (e.textStyle = function () { - return t.formatter.getCssText({inline: "a", classes: [e.value]}) - }) - })}), t.settings.link_title !== !1 && (p = {name: "title", type: "textbox", label: "Title", value: y.title}), f = t.windowManager.open({title: "Insert link", data: y, body: [ - {name: "href", type: "filepicker", filetype: "file", size: 40, autofocus: !0, label: "Url", onchange: o, onkeyup: a}, - g, - p, - l(y.href), - x, - v, - h, - m - ], onSubmit: function (e) { - function n(e, n) { - var i = t.selection.getRng(); - window.setTimeout(function () { - t.windowManager.confirm(e, function (e) { - t.selection.setRng(i), n(e) - }) - }, 0) - } - - function i() { - var e = {href: l, target: y.target ? y.target : null, rel: y.rel ? y.rel : null, "class": y["class"] ? y["class"] : null, title: y.title ? y.title : null}; - u ? (t.focus(), d && y.text != c && ("innerText"in u ? u.innerText = y.text : u.textContent = y.text), _.setAttribs(u, e), b.select(u), t.undoManager.add()) : d ? t.insertContent(_.createHTML("a", e, _.encode(y.text))) : t.execCommand("mceInsertLink", !1, e) - } - - var l; - return y = tinymce.extend(y, e.data), (l = y.href) ? l.indexOf("@") > 0 && -1 == l.indexOf("//") && -1 == l.indexOf("mailto:") ? void n("The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?", function (t) { - t && (l = "mailto:" + l), i() - }) : /^\s*www\./i.test(l) ? void n("The URL you entered seems to be an external link. Do you want to add the required http:// prefix?", function (t) { - t && (l = "http://" + l), i() - }) : void i() : void t.execCommand("unlink") - }}) - } - - t.addButton("link", {icon: "link", tooltip: "Insert/edit link", shortcut: "Ctrl+K", onclick: e(i), stateSelector: "a[href]"}), t.addButton("unlink", {icon: "unlink", tooltip: "Remove link", cmd: "unlink", stateSelector: "a[href]"}), t.addShortcut("Ctrl+K", "", e(i)), t.addCommand("mceLink", e(i)), this.showDialog = i, t.addMenuItem("link", {icon: "link", text: "Insert link", shortcut: "Ctrl+K", onclick: e(i), stateSelector: "a[href]", context: "insert", prependToContext: !0}) -}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/lists/plugin.min.js b/app/lib/tinymce/plugins/lists/plugin.min.js deleted file mode 100644 index 38e3a870..00000000 --- a/app/lib/tinymce/plugins/lists/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("lists",function(e){function t(e){return e&&/^(OL|UL|DL)$/.test(e.nodeName)}function n(e){return e.parentNode.firstChild==e}function r(e){return e.parentNode.lastChild==e}function a(t){return t&&!!e.schema.getTextBlockElements()[t.nodeName]}var o=this;e.on("init",function(){function i(e){function t(t){var r,a,o;a=e[t?"startContainer":"endContainer"],o=e[t?"startOffset":"endOffset"],1==a.nodeType&&(r=L.create("span",{"data-mce-type":"bookmark"}),a.hasChildNodes()?(o=Math.min(o,a.childNodes.length-1),t?a.insertBefore(r,a.childNodes[o]):L.insertAfter(r,a.childNodes[o])):a.appendChild(r),a=r,o=0),n[t?"startContainer":"endContainer"]=a,n[t?"startOffset":"endOffset"]=o}var n={};return t(!0),e.collapsed||t(),n}function d(e){function t(t){function n(e){for(var t=e.parentNode.firstChild,n=0;t;){if(t==e)return n;(1!=t.nodeType||"bookmark"!=t.getAttribute("data-mce-type"))&&n++,t=t.nextSibling}return-1}var r,a,o;r=o=e[t?"startContainer":"endContainer"],a=e[t?"startOffset":"endOffset"],r&&(1==r.nodeType&&(a=n(r),r=r.parentNode,L.remove(o)),e[t?"startContainer":"endContainer"]=r,e[t?"startOffset":"endOffset"]=a)}t(!0),t();var n=L.createRng();n.setStart(e.startContainer,e.startOffset),e.endContainer&&n.setEnd(e.endContainer,e.endOffset),k.setRng(n)}function s(t,n){var r,a,o,i=L.createFragment(),d=e.schema.getBlockElements();if(e.settings.forced_root_block&&(n=n||e.settings.forced_root_block),n&&(a=L.create(n),a.tagName===e.settings.forced_root_block&&L.setAttribs(a,e.settings.forced_root_block_attrs),i.appendChild(a)),t)for(;r=t.firstChild;){var s=r.nodeName;o||"SPAN"==s&&"bookmark"==r.getAttribute("data-mce-type")||(o=!0),d[s]?(i.appendChild(r),a=null):n?(a||(a=L.create(n),i.appendChild(a)),a.appendChild(r)):i.appendChild(r)}return e.settings.forced_root_block?o||tinymce.Env.ie&&!(tinymce.Env.ie>10)||a.appendChild(L.create("br",{"data-mce-bogus":"1"})):i.appendChild(L.create("br")),i}function f(){return tinymce.grep(k.getSelectedBlocks(),function(e){return/^(LI|DT|DD)$/.test(e.nodeName)})}function l(e,t,n){var r,a,o=L.select('span[data-mce-type="bookmark"]',e);n=n||s(t),r=L.createRng(),r.setStartAfter(t),r.setEndAfter(e),a=r.extractContents(),L.isEmpty(a)||L.insertAfter(a,e),L.insertAfter(n,e),L.isEmpty(t.parentNode)&&(tinymce.each(o,function(e){t.parentNode.parentNode.insertBefore(e,t.parentNode)}),L.remove(t.parentNode)),L.remove(t)}function c(e){var n,r;if(n=e.nextSibling,n&&t(n)&&n.nodeName==e.nodeName){for(;r=n.firstChild;)e.appendChild(r);L.remove(n)}if(n=e.previousSibling,n&&t(n)&&n.nodeName==e.nodeName){for(;r=n.firstChild;)e.insertBefore(r,e.firstChild);L.remove(n)}}function p(e){tinymce.each(tinymce.grep(L.select("ol,ul",e)),function(e){var n,r=e.parentNode;"LI"==r.nodeName&&r.firstChild==e&&(n=r.previousSibling,n&&"LI"==n.nodeName&&(n.appendChild(e),L.isEmpty(r)&&L.remove(r))),t(r)&&(n=r.previousSibling,n&&"LI"==n.nodeName&&n.appendChild(e))})}function m(e){function a(e){L.isEmpty(e)&&L.remove(e)}var o,i=e.parentNode,d=i.parentNode;return"DD"==e.nodeName?(L.rename(e,"DT"),!0):n(e)&&r(e)?("LI"==d.nodeName?(L.insertAfter(e,d),a(d),L.remove(i)):t(d)?L.remove(i,!0):(d.insertBefore(s(e),i),L.remove(i)),!0):n(e)?("LI"==d.nodeName?(L.insertAfter(e,d),e.appendChild(i),a(d)):t(d)?d.insertBefore(e,i):(d.insertBefore(s(e),i),L.remove(e)),!0):r(e)?("LI"==d.nodeName?L.insertAfter(e,d):t(d)?L.insertAfter(e,i):(L.insertAfter(s(e),i),L.remove(e)),!0):("LI"==d.nodeName?(i=d,o=s(e,"LI")):o=t(d)?s(e,"LI"):s(e),l(i,e,o),p(i.parentNode),!0)}function u(e){function n(n,r){var a;if(t(n)){for(;a=e.lastChild.firstChild;)r.appendChild(a);L.remove(n)}}var r,a;return"DT"==e.nodeName?(L.rename(e,"DD"),!0):(r=e.previousSibling,r&&t(r)?(r.appendChild(e),!0):r&&"LI"==r.nodeName&&t(r.lastChild)?(r.lastChild.appendChild(e),n(e.lastChild,r.lastChild),!0):(r=e.nextSibling,r&&t(r)?(r.insertBefore(e,r.firstChild),!0):r&&"LI"==r.nodeName&&t(e.lastChild)?!1:(r=e.previousSibling,r&&"LI"==r.nodeName?(a=L.create(e.parentNode.nodeName),r.appendChild(a),a.appendChild(e),n(e.lastChild,a),!0):!1)))}function h(){var t=f();if(t.length){for(var n=i(k.getRng(!0)),r=0;r0))return o;for(r=e.schema.getNonEmptyElements(),a=new tinymce.dom.TreeWalker(t.startContainer);o=a[n?"next":"prev"]();){if("LI"==o.nodeName&&!o.hasChildNodes())return o;if(r[o.nodeName])return o;if(3==o.nodeType&&o.data.length>0)return o}}function a(e,n){var r,a,o=e.parentNode;if(t(n.lastChild)&&(a=n.lastChild),r=n.lastChild,r&&"BR"==r.nodeName&&e.hasChildNodes()&&L.remove(r),L.isEmpty(n)&&L.$(n).empty(),!L.isEmpty(e))for(;r=e.firstChild;)n.appendChild(r);a&&n.appendChild(a),L.remove(e),L.isEmpty(o)&&L.remove(o)}if(k.isCollapsed()){var o=L.getParent(k.getStart(),"LI");if(o){var s=k.getRng(!0),f=L.getParent(r(s,n),"LI");if(f&&f!=o){var l=i(s);return n?a(f,o):a(o,f),d(l),!0}if(!f&&!n&&g(o.parentNode.nodeName))return!0}}},e.addCommand("Indent",function(){return h()?void 0:!0}),e.addCommand("Outdent",function(){return C()?void 0:!0}),e.addCommand("InsertUnorderedList",function(){N("UL")}),e.addCommand("InsertOrderedList",function(){N("OL")}),e.addCommand("InsertDefinitionList",function(){N("DL")}),e.addQueryStateHandler("InsertUnorderedList",y("UL")),e.addQueryStateHandler("InsertOrderedList",y("OL")),e.addQueryStateHandler("InsertDefinitionList",y("DL")),e.on("keydown",function(t){9==t.keyCode&&e.dom.getParent(e.selection.getStart(),"LI,DT,DD")&&(t.preventDefault(),t.shiftKey?C():h())})}),e.addButton("indent",{icon:"indent",title:"Increase indent",cmd:"Indent",onPostRender:function(){var t=this;e.on("nodechange",function(){for(var r=e.selection.getSelectedBlocks(),a=!1,o=0,i=r.length;!a&&i>o;o++){var d=r[o].nodeName;a="LI"==d&&n(r[o])||"UL"==d||"OL"==d||"DD"==d}t.disabled(a)})}}),e.on("keydown",function(e){e.keyCode==tinymce.util.VK.BACKSPACE?o.backspaceDelete()&&e.preventDefault():e.keyCode==tinymce.util.VK.DELETE&&o.backspaceDelete(!0)&&e.preventDefault()})}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/media/moxieplayer.swf b/app/lib/tinymce/plugins/media/moxieplayer.swf deleted file mode 100644 index 19c771be..00000000 Binary files a/app/lib/tinymce/plugins/media/moxieplayer.swf and /dev/null differ diff --git a/app/lib/tinymce/plugins/media/plugin.min.js b/app/lib/tinymce/plugins/media/plugin.min.js deleted file mode 100644 index 3b7cd5c8..00000000 --- a/app/lib/tinymce/plugins/media/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("media",function(e,t){function i(e){return-1!=e.indexOf(".mp3")?"audio/mpeg":-1!=e.indexOf(".wav")?"audio/wav":-1!=e.indexOf(".mp4")?"video/mp4":-1!=e.indexOf(".webm")?"video/webm":-1!=e.indexOf(".ogg")?"video/ogg":-1!=e.indexOf(".swf")?"application/x-shockwave-flash":""}function r(t){var i=e.settings.media_scripts;if(i)for(var r=0;r=0;o--)t[r]==i[o]&&i.splice(o,1);e.selection.select(i[0]),e.nodeChanged()}})}function a(){var t=e.selection.getNode();return t.getAttribute("data-mce-object")?e.selection.getContent():void 0}function c(o){var a="";if(!o.source1&&(tinymce.extend(o,n(o.embed)),!o.source1))return"";if(o.source2||(o.source2=""),o.poster||(o.poster=""),o.source1=e.convertURL(o.source1,"source"),o.source2=e.convertURL(o.source2,"source"),o.source1mime=i(o.source1),o.source2mime=i(o.source2),o.poster=e.convertURL(o.poster,"poster"),o.flashPlayerUrl=e.convertURL(t+"/moxieplayer.swf","movie"),tinymce.each(d,function(e){var t,i,r;if(t=e.regex.exec(o.source1)){for(r=e.url,i=0;t[i];i++)r=r.replace("$"+i,function(){return t[i]});o.source1=r,o.type=e.type,o.width=o.width||e.w,o.height=o.height||e.h}}),o.embed)a=u(o.embed,o,!0);else{var c=r(o.source1);c&&(o.type="script",o.width=c.width,o.height=c.height),o.width=o.width||300,o.height=o.height||150,tinymce.each(o,function(t,i){o[i]=e.dom.encode(t)}),"iframe"==o.type?a+='':"application/x-shockwave-flash"==o.source1mime?(a+='',o.poster&&(a+=''),a+=""):-1!=o.source1mime.indexOf("audio")?e.settings.audio_template_callback?a=e.settings.audio_template_callback(o):a+='":"script"==o.type?a+='':a=e.settings.video_template_callback?e.settings.video_template_callback(o):'"}return a}function n(e){var t={};return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!0,special:"script,noscript",start:function(e,i){if(t.source1||"param"!=e||(t.source1=i.map.movie),("iframe"==e||"object"==e||"embed"==e||"video"==e||"audio"==e)&&(t.type||(t.type=e),t=tinymce.extend(i.map,t)),"script"==e){var o=r(i.map.src);if(!o)return;t={type:"script",source1:i.map.src,width:o.width,height:o.height}}"source"==e&&(t.source1?t.source2||(t.source2=i.map.src):t.source1=i.map.src),"img"!=e||t.poster||(t.poster=i.map.src)}}).parse(e),t.source1=t.source1||t.src||t.data,t.source2=t.source2||"",t.poster=t.poster||"",t}function s(t){return t.getAttribute("data-mce-object")?n(e.serializer.serialize(t,{selection:!0})):{}}function m(t){if(e.settings.media_filter_html===!1)return t;var i=new tinymce.html.Writer;return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!1,special:"script,noscript",comment:function(e){i.comment(e)},cdata:function(e){i.cdata(e)},text:function(e,t){i.text(e,t)},start:function(e,t,r){if("script"!=e&&"noscript"!=e){for(var o=0;o=c&&(r(n,{src:t["source"+c],type:t["source"+c+"mime"]}),!t["source"+c]))return;break;case"img":if(!t.poster)return;o=!0}a.start(e,n,s)},end:function(e){if("video"==e&&i)for(var n=1;2>=n;n++)if(t["source"+n]){var s=[];s.map={},n>c&&(r(s,{src:t["source"+n],type:t["source"+n+"mime"]}),a.start("source",s,!0))}if(t.poster&&"object"==e&&i&&!o){var m=[];m.map={},r(m,{src:t.poster,width:t.width,height:t.height}),a.start("img",m,!0)}a.end(e)}},new tinymce.html.Schema({})).parse(e),a.getContent()}var d=[{regex:/youtu\.be\/([\w\-.]+)/,type:"iframe",w:425,h:350,url:"//www.youtube.com/embed/$1"},{regex:/youtube\.com(.+)v=([^&]+)/,type:"iframe",w:425,h:350,url:"//www.youtube.com/embed/$2"},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc"},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$2?title=0&byline=0"},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'//maps.google.com/maps/ms?msid=$2&output=embed"'}],l=tinymce.Env.ie&&tinymce.Env.ie<=8?"onChange":"onInput";e.on("ResolveName",function(e){var t;1==e.target.nodeType&&(t=e.target.getAttribute("data-mce-object"))&&(e.name=t)}),e.on("preInit",function(){var t=e.schema.getSpecialElements();tinymce.each("video audio iframe object".split(" "),function(e){t[e]=new RegExp("]*>","gi")});var i=e.schema.getBoolAttrs();tinymce.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(e){i[e]={}}),e.parser.addNodeFilter("iframe,video,audio,object,embed,script",function(t,i){for(var o,a,c,n,s,m,u,d,l=t.length;l--;)if(a=t[l],a.parent&&("script"!=a.name||(d=r(a.attr("src"))))){for(c=new tinymce.html.Node("img",1),c.shortEnded=!0,d&&(d.width&&a.attr("width",d.width.toString()),d.height&&a.attr("height",d.height.toString())),m=a.attributes,o=m.length;o--;)n=m[o].name,s=m[o].value,"width"!==n&&"height"!==n&&"style"!==n&&(("data"==n||"src"==n)&&(s=e.convertURL(s,n)),c.attr("data-mce-p-"+n,s));u=a.firstChild&&a.firstChild.value,u&&(c.attr("data-mce-html",escape(u)),c.firstChild=null),c.attr({width:a.attr("width")||"300",height:a.attr("height")||("audio"==i?"30":"150"),style:a.attr("style"),src:tinymce.Env.transparentSrc,"data-mce-object":i,"class":"mce-object mce-object-"+i}),a.replace(c)}}),e.serializer.addAttributeFilter("data-mce-object",function(e,t){for(var i,r,o,a,c,n,s,u=e.length;u--;)if(i=e[u],i.parent){for(s=i.attr(t),r=new tinymce.html.Node(s,1),"audio"!=s&&"script"!=s&&r.attr({width:i.attr("width"),height:i.attr("height")}),r.attr({style:i.attr("style")}),a=i.attributes,o=a.length;o--;){var d=a[o].name;0===d.indexOf("data-mce-p-")&&r.attr(d.substr(11),a[o].value)}"script"==s&&r.attr("type","text/javascript"),c=i.attr("data-mce-html"),c&&(n=new tinymce.html.Node("#text",3),n.raw=!0,n.value=m(unescape(c)),r.append(n)),i.replace(r)}})}),e.on("ObjectSelected",function(e){var t=e.target.getAttribute("data-mce-object");("audio"==t||"script"==t)&&e.preventDefault()}),e.on("objectResized",function(e){var t,i=e.target;i.getAttribute("data-mce-object")&&(t=i.getAttribute("data-mce-html"),t&&(t=unescape(t),i.setAttribute("data-mce-html",escape(u(t,{width:e.width,height:e.height})))))}),e.addButton("media",{tooltip:"Insert/edit video",onclick:o,stateSelector:["img[data-mce-object=video]","img[data-mce-object=iframe]"]}),e.addMenuItem("media",{icon:"media",text:"Insert video",onclick:o,context:"insert",prependToContext:!0})}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/nonbreaking/plugin.min.js b/app/lib/tinymce/plugins/nonbreaking/plugin.min.js deleted file mode 100644 index 4bef21aa..00000000 --- a/app/lib/tinymce/plugins/nonbreaking/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("nonbreaking",function(n){var e=n.getParam("nonbreaking_force_tab");if(n.addCommand("mceNonBreaking",function(){n.insertContent(n.plugins.visualchars&&n.plugins.visualchars.state?' ':" "),n.dom.setAttrib(n.dom.select("span.mce-nbsp"),"data-mce-bogus","1")}),n.addButton("nonbreaking",{title:"Nonbreaking space",cmd:"mceNonBreaking"}),n.addMenuItem("nonbreaking",{text:"Nonbreaking space",cmd:"mceNonBreaking",context:"insert"}),e){var a=+e>1?+e:3;n.on("keydown",function(e){if(9==e.keyCode){if(e.shiftKey)return;e.preventDefault();for(var t=0;a>t;t++)n.execCommand("mceNonBreaking")}})}}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/noneditable/plugin.min.js b/app/lib/tinymce/plugins/noneditable/plugin.min.js deleted file mode 100644 index 048207f5..00000000 --- a/app/lib/tinymce/plugins/noneditable/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("noneditable",function(e){function t(e){var t;if(1===e.nodeType){if(t=e.getAttribute(u),t&&"inherit"!==t)return t;if(t=e.contentEditable,"inherit"!==t)return t}return null}function n(e){for(var n;e;){if(n=t(e))return"false"===n?e:null;e=e.parentNode}}function r(){function r(e){for(;e;){if(e.id===g)return e;e=e.parentNode}}function a(e){var t;if(e)for(t=new f(e,e),e=t.current();e;e=t.next())if(3===e.nodeType)return e}function i(n,r){var a,i;return"false"===t(n)&&u.isBlock(n)?void s.select(n):(i=u.createRng(),"true"===t(n)&&(n.firstChild||n.appendChild(e.getDoc().createTextNode("\xa0")),n=n.firstChild,r=!0),a=u.create("span",{id:g,"data-mce-bogus":!0},m),r?n.parentNode.insertBefore(a,n):u.insertAfter(a,n),i.setStart(a.firstChild,1),i.collapse(!0),s.setRng(i),a)}function o(e){var t,n,i,o;if(e)t=s.getRng(!0),t.setStartBefore(e),t.setEndBefore(e),n=a(e),n&&n.nodeValue.charAt(0)==m&&(n=n.deleteData(0,1)),u.remove(e,!0),s.setRng(t);else for(i=r(s.getStart());(e=u.get(g))&&e!==o;)i!==e&&(n=a(e),n&&n.nodeValue.charAt(0)==m&&(n=n.deleteData(0,1)),u.remove(e,!0)),o=e}function l(){function e(e,n){var r,a,i,o,l;if(r=d.startContainer,a=d.startOffset,3==r.nodeType){if(l=r.nodeValue.length,a>0&&l>a||(n?a==l:0===a))return}else{if(!(a0?a-1:a;r=r.childNodes[u],r.hasChildNodes()&&(r=r.firstChild)}for(i=new f(r,e);o=i[n?"prev":"next"]();){if(3===o.nodeType&&o.nodeValue.length>0)return;if("true"===t(o))return o}return e}var r,a,l,d,u;o(),l=s.isCollapsed(),r=n(s.getStart()),a=n(s.getEnd()),(r||a)&&(d=s.getRng(!0),l?(r=r||a,(u=e(r,!0))?i(u,!0):(u=e(r,!1))?i(u,!1):s.select(r)):(d=s.getRng(!0),r&&d.setStartBefore(r),a&&d.setEndAfter(a),s.setRng(d)))}function d(a){function i(e,t){for(;e=e[t?"previousSibling":"nextSibling"];)if(3!==e.nodeType||e.nodeValue.length>0)return e}function d(e,t){s.select(e),s.collapse(t)}function g(a){function i(e){for(var t=d;t;){if(t===e)return;t=t.parentNode}u.remove(e),l()}function o(){var r,o,l=e.schema.getNonEmptyElements();for(o=new tinymce.dom.TreeWalker(d,e.getBody());(r=a?o.prev():o.next())&&!l[r.nodeName.toLowerCase()]&&!(3===r.nodeType&&tinymce.trim(r.nodeValue).length>0);)if("false"===t(r))return i(r),!0;return n(r)?!0:!1}var f,d,c,g;if(s.isCollapsed()){if(f=s.getRng(!0),d=f.startContainer,c=f.startOffset,d=r(d)||d,g=n(d))return i(g),!1;if(3==d.nodeType&&(a?c>0:ch||h>124)&&h!=c.DELETE&&h!=c.BACKSPACE){if((tinymce.isMac?a.metaKey:a.ctrlKey)&&(67==h||88==h||86==h))return;if(a.preventDefault(),h==c.LEFT||h==c.RIGHT){var y=h==c.LEFT;if(e.dom.isBlock(m)){var T=y?m.previousSibling:m.nextSibling,C=new f(T,T),b=y?C.prev():C.next();d(b,!y)}else d(m,y)}}else if(h==c.LEFT||h==c.RIGHT||h==c.BACKSPACE||h==c.DELETE){if(p=r(v)){if(h==c.LEFT||h==c.BACKSPACE)if(m=i(p,!0),m&&"false"===t(m)){if(a.preventDefault(),h!=c.LEFT)return void u.remove(m);d(m,!0)}else o(p);if(h==c.RIGHT||h==c.DELETE)if(m=i(p),m&&"false"===t(m)){if(a.preventDefault(),h!=c.RIGHT)return void u.remove(m);d(m,!1)}else o(p)}if((h==c.BACKSPACE||h==c.DELETE)&&!g(h==c.BACKSPACE))return a.preventDefault(),!1}}var u=e.dom,s=e.selection,g="mce_noneditablecaret",m="\ufeff";e.on("mousedown",function(n){var r=e.selection.getNode();"false"===t(r)&&r==n.target&&l()}),e.on("mouseup keyup",l),e.on("keydown",d)}function a(t){var n=l.length,r=t.content,a=tinymce.trim(o);if("raw"!=t.format){for(;n--;)r=r.replace(l[n],function(t){var n=arguments,i=n[n.length-2];return i>0&&'"'==r.charAt(i-1)?t:''+e.dom.encode("string"==typeof n[1]?n[1]:n[0])+""});t.content=r}}var i,o,l,f=tinymce.dom.TreeWalker,d="contenteditable",u="data-mce-"+d,c=tinymce.util.VK;i=" "+tinymce.trim(e.getParam("noneditable_editable_class","mceEditable"))+" ",o=" "+tinymce.trim(e.getParam("noneditable_noneditable_class","mceNonEditable"))+" ",l=e.getParam("noneditable_regexp"),l&&!l.length&&(l=[l]),e.on("PreInit",function(){r(),l&&e.on("BeforeSetContent",a),e.parser.addAttributeFilter("class",function(e){for(var t,n,r=e.length;r--;)n=e[r],t=" "+n.attr("class")+" ",-1!==t.indexOf(i)?n.attr(u,"true"):-1!==t.indexOf(o)&&n.attr(u,"false")}),e.serializer.addAttributeFilter(u,function(e){for(var t,n=e.length;n--;)t=e[n],l&&t.attr("data-mce-content")?(t.name="#text",t.type=3,t.raw=!0,t.value=t.attr("data-mce-content")):(t.attr(d,null),t.attr(u,null))}),e.parser.addAttributeFilter(d,function(e){for(var t,n=e.length;n--;)t=e[n],t.attr(u,t.attr(d)),t.attr(d,null)})}),e.on("drop",function(e){n(e.target)&&e.preventDefault()})}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/pagebreak/plugin.min.js b/app/lib/tinymce/plugins/pagebreak/plugin.min.js deleted file mode 100644 index e232c05d..00000000 --- a/app/lib/tinymce/plugins/pagebreak/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("pagebreak",function(e){var a="mce-pagebreak",t=e.getParam("pagebreak_separator",""),n=new RegExp(t.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(e){return"\\"+e}),"gi"),r='';e.addCommand("mcePageBreak",function(){e.insertContent(e.settings.pagebreak_split_block?"

"+r+"

":r)}),e.addButton("pagebreak",{title:"Page break",cmd:"mcePageBreak"}),e.addMenuItem("pagebreak",{text:"Page break",icon:"pagebreak",cmd:"mcePageBreak",context:"insert"}),e.on("ResolveName",function(t){"IMG"==t.target.nodeName&&e.dom.hasClass(t.target,a)&&(t.name="pagebreak")}),e.on("click",function(t){t=t.target,"IMG"===t.nodeName&&e.dom.hasClass(t,a)&&e.selection.select(t)}),e.on("BeforeSetContent",function(e){e.content=e.content.replace(n,r)}),e.on("PreInit",function(){e.serializer.addNodeFilter("img",function(a){for(var n,r,c=a.length;c--;)if(n=a[c],r=n.attr("class"),r&&-1!==r.indexOf("mce-pagebreak")){var o=n.parent;if(e.schema.getBlockElements()[o.name]&&e.settings.pagebreak_split_block){o.type=3,o.value=t,o.raw=!0,n.remove();continue}n.type=3,n.value=t,n.raw=!0}})})}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/paste/plugin.min.js b/app/lib/tinymce/plugins/paste/plugin.min.js deleted file mode 100644 index 5cf32dea..00000000 --- a/app/lib/tinymce/plugins/paste/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;i/g]),o(s.parse(i)),l}function o(e){function t(e,t,n){return t||n?"\xa0":" "}return e=r(e,[/^[\s\S]*]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g,/|/g,[/( ?)\u00a0<\/span>( ?)/g,t],/
$/i])}return{filter:r,innerText:i,trimHtml:o}}),r(f,[p,m,l],function(e,t,n){return function(r){function i(e){var t,n=r.dom;if(t=r.fire("BeforePastePreProcess",{content:e}),t=r.fire("PastePreProcess",t),e=t.content,!t.isDefaultPrevented()){if(r.hasEventListeners("PastePostProcess")&&!t.isDefaultPrevented()){var i=n.add(r.getBody(),"div",{style:"display:none"},e);t=r.fire("PastePostProcess",{node:i}),n.remove(i),e=t.node.innerHTML}t.isDefaultPrevented()||r.insertContent(e,{merge:r.settings.paste_merge_formats!==!1})}}function o(e){e=r.dom.encode(e).replace(/\r\n/g,"\n");var t=r.dom.getParent(r.selection.getStart(),r.dom.isBlock),o=r.settings.forced_root_block,a;o&&(a=r.dom.createHTML(o,r.settings.forced_root_block_attrs),a=a.substr(0,a.length-3)+">"),t&&/^(PRE|DIV)$/.test(t.nodeName)||!o?e=n.filter(e,[[/\n/g,"
"]]):(e=n.filter(e,[[/\n\n/g,"

"+a],[/^(.*<\/p>)(

)$/,a+"$1"],[/\n/g,"
"]]),-1!=e.indexOf("

")&&(e=a+e)),i(e)}function a(){function t(e){var t,r,i,o=e.startContainer;if(t=e.getClientRects(),t.length)return t[0];if(e.collapsed&&1==o.nodeType){for(i=o.childNodes[b.startOffset];i&&3==i.nodeType&&!i.data.length;)i=i.nextSibling;if(i)return"BR"==i.tagName&&(r=n.doc.createTextNode("\ufeff"),i.parentNode.insertBefore(r,i),e=n.createRng(),e.setStartBefore(r),e.setEndAfter(r),t=e.getClientRects(),n.remove(r)),t.length?t[0]:void 0}}var n=r.dom,i=r.getBody(),o=r.dom.getViewPort(r.getWin()),a=o.y,s=20,l;if(b=r.selection.getRng(),r.inline&&(l=r.selection.getScrollContainer(),l&&l.scrollTop>0&&(a=l.scrollTop)),b.getClientRects){var c=t(b);if(c)s=a+(c.top-n.getPos(i).y);else{s=a;var u=b.startContainer;u&&(3==u.nodeType&&u.parentNode!=i&&(u=u.parentNode),1==u.nodeType&&(s=n.getPos(u,l||i).y))}}y=n.add(r.getBody(),"div",{id:"mcepastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: absolute; top: "+s+"px;width: 10px; height: 10px; overflow: hidden; opacity: 0"},w),(e.ie||e.gecko)&&n.setStyle(y,"left","rtl"==n.getStyle(i,"direction",!0)?65535:-65535),n.bind(y,"beforedeactivate focusin focusout",function(e){e.stopPropagation()}),y.focus(),r.selection.select(y,!0)}function s(){if(y){for(var e;e=r.dom.get("mcepastebin");)r.dom.remove(e),r.dom.unbind(e);b&&r.selection.setRng(b)}y=b=null}function l(){var e="",t,n,i,o;for(t=r.dom.select("div[id=mcepastebin]"),n=0;n0&&(t["text/plain"]=n)}if(e.types)for(var r=0;r')}var a,s,l;if(n)for(a=0;a0}function h(e){return t.metaKeyPressed(e)&&86==e.keyCode||e.shiftKey&&45==e.keyCode}function g(){r.on("keydown",function(t){function n(e){h(e)&&!e.isDefaultPrevented()&&s()}if(h(t)&&!t.isDefaultPrevented()){if(_=t.shiftKey&&86==t.keyCode,_&&e.webkit&&-1!=navigator.userAgent.indexOf("Version/"))return;if(t.stopImmediatePropagation(),C=(new Date).getTime(),e.ie&&_)return t.preventDefault(),void r.fire("paste",{ieFake:!0});s(),a(),r.once("keyup",n),r.once("paste",function(){r.off("keyup",n)})}}),r.on("paste",function(t){var c=(new Date).getTime(),p=u(t),h=(new Date).getTime()-c,g=(new Date).getTime()-C-h<1e3,b="text"==v.pasteFormat||_;return _=!1,t.isDefaultPrevented()||f(t)?void s():d(t)?void s():(g||t.preventDefault(),!e.ie||g&&!t.ieFake||(a(),r.dom.bind(y,"paste",function(e){e.stopPropagation()}),r.getDoc().execCommand("Paste",!1,null),p["text/html"]=l()),void setTimeout(function(){var e;return m(p,"text/html")?e=p["text/html"]:(e=l(),e==w&&(b=!0)),e=n.trimHtml(e),y&&y.firstChild&&"mcepastebin"===y.firstChild.id&&(b=!0),s(),e.length||(b=!0),b&&(e=m(p,"text/plain")&&-1==e.indexOf("

")?p["text/plain"]:n.innerText(e)),e==w?void(g||r.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.")):void(b?o(e):i(e))},0))}),r.on("dragstart dragend",function(e){x="dragstart"==e.type}),r.on("drop",function(e){var t=p(e);if(!e.isDefaultPrevented()&&!x&&!d(e,t)&&t&&r.settings.paste_filter_drop!==!1){var a=c(e.dataTransfer),s=a["mce-internal"]||a["text/html"]||a["text/plain"];s&&(e.preventDefault(),r.undoManager.transact(function(){a["mce-internal"]&&r.execCommand("Delete"),r.selection.setRng(t),s=n.trimHtml(s),a["text/html"]?i(s):o(s)}))}}),r.on("dragover dragend",function(e){var t,n=e.dataTransfer;if(r.settings.paste_data_images&&n)for(t=0;ts?a&&(a=a.parent.parent):(c=a,a=null)),a&&a.name==t?a.append(e):(c=c||a,a=new i(t,1),o>1&&a.attr("start",""+o),e.wrap(a)),e.name="li",s>u&&c&&c.lastChild.append(a),u=s,r(e),n(e,/^\u00a0+/),n(e,/^\s*([\u2022\u00b7\u00a7\u00d8\u25CF]|\w+\.)/),n(e,/^\u00a0+/)}for(var a,c,u=1,d=e.getAll("p"),f=0;f/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\xa0"],[/([\s\u00a0]*)<\/span>/gi,function(e,t){return t.length>0?t.replace(/./," ").slice(Math.floor(t.length/2)).split("").join("\xa0"):""}]]);var v=u.paste_word_valid_elements;v||(v="-strong/b,-em/i,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-table[width],-tr,-td[colspan|rowspan|width],-th,-thead,-tfoot,-tbody,-a[href|name],sub,sup,strike,br,del");var y=new n({valid_elements:v,valid_children:"-li[p]"});e.each(y.elements,function(e){e.attributes["class"]||(e.attributes["class"]={},e.attributesOrder.push("class")),e.attributes.style||(e.attributes.style={},e.attributesOrder.push("style"))});var b=new t({},y);b.addAttributeFilter("style",function(e){for(var t=e.length,n;t--;)n=e[t],n.attr("style",p(n,n.attr("style"))),"span"==n.name&&n.parent&&!n.attributes.length&&n.unwrap()}),b.addAttributeFilter("class",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel|MsoCaption)$/i.test(r)&&n.remove(),n.attr("class",null)}),b.addNodeFilter("del",function(e){for(var t=e.length;t--;)e[t].remove()}),b.addNodeFilter("a",function(e){for(var t=e.length,n,r,i;t--;)if(n=e[t],r=n.attr("href"),i=n.attr("name"),r&&-1!=r.indexOf("#_msocom_"))n.remove();else if(r&&0===r.indexOf("file://")&&(r=r.split("#")[1],r&&(r="#"+r)),r||i){if(i&&!/^_?(?:toc|edn|ftn)/i.test(i)){n.unwrap();continue}n.attr({href:r,name:i})}else n.unwrap()});var C=b.parse(m);f(C),d.content=new r({},y).serialize(C)}})}return c.isWordContent=a,c}),r(y,[p,c,h,l],function(e,t,n,r){return function(i){function o(e){i.on("BeforePastePreProcess",function(t){t.content=e(t.content)})}function a(e){if(!n.isWordContent(e))return e;var o=[];t.each(i.schema.getBlockElements(),function(e,t){o.push(t)});var a=new RegExp("(?:
 [\\s\\r\\n]+|
)*(<\\/?("+o.join("|")+")[^>]*>)(?:
 [\\s\\r\\n]+|
)*","g");return e=r.filter(e,[[a,"$1"]]),e=r.filter(e,[[/

/g,"

"],[/
/g," "],[/

/g,"
"]])}function s(e){if(n.isWordContent(e))return e;var t=i.settings.paste_webkit_styles;if(i.settings.paste_remove_styles_if_webkit===!1||"all"==t)return e;if(t&&(t=t.split(/[, ]/)),t){var r=i.dom,o=i.selection.getNode();e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(e,n,i,a){var s=r.parseStyle(i,"span"),l={};if("none"===t)return n+a;for(var c=0;c]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return e=e.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(e,t,n,r){return t+' style="'+n+'"'+r})}e.webkit&&o(s),e.ie&&o(a)}}),r(b,[C,f,h,y],function(e,t,n,r){var i;e.add("paste",function(e){function o(){"text"==s.pasteFormat?(this.active(!1),s.pasteFormat="html"):(s.pasteFormat="text",this.active(!0),i||(e.windowManager.alert("Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off."),i=!0))}var a=this,s,l=e.settings;a.clipboard=s=new t(e),a.quirks=new r(e),a.wordFilter=new n(e),e.settings.paste_as_text&&(a.clipboard.pasteFormat="text"),l.paste_preprocess&&e.on("PastePreProcess",function(e){l.paste_preprocess.call(a,a,e)}),l.paste_postprocess&&e.on("PastePostProcess",function(e){l.paste_postprocess.call(a,a,e)}),e.addCommand("mceInsertClipboardContent",function(e,t){t.content&&a.clipboard.pasteHtml(t.content),t.text&&a.clipboard.pasteText(t.text)}),e.paste_block_drop&&e.on("dragend dragover draggesture dragdrop drop drag",function(e){e.preventDefault(),e.stopPropagation()}),e.settings.paste_data_images||e.on("drop",function(e){var t=e.dataTransfer;t&&t.files&&t.files.length>0&&e.preventDefault()}),e.addButton("pastetext",{icon:"pastetext",tooltip:"Paste as text",onclick:o,active:"text"==a.clipboard.pasteFormat}),e.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:s.pasteFormat,onclick:o})})}),a([l,h])}(this); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/preview/plugin.min.js b/app/lib/tinymce/plugins/preview/plugin.min.js deleted file mode 100644 index 23e70acb..00000000 --- a/app/lib/tinymce/plugins/preview/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("preview",function(e){var t=e.settings,i=!tinymce.Env.ie;e.addCommand("mcePreview",function(){e.windowManager.open({title:"Preview",width:parseInt(e.getParam("plugin_preview_width","650"),10),height:parseInt(e.getParam("plugin_preview_height","500"),10),html:'",buttons:{text:"Close",onclick:function(){this.parent().parent().close()}},onPostRender:function(){var n,a="";a+='',tinymce.each(e.contentCSS,function(t){a+=''});var r=t.body_id||"tinymce";-1!=r.indexOf("=")&&(r=e.getParam("body_id","","hash"),r=r[e.id]||r);var d=t.body_class||"";-1!=d.indexOf("=")&&(d=e.getParam("body_class","","hash"),d=d[e.id]||"");var o=e.settings.directionality?' dir="'+e.settings.directionality+'"':"";if(n=""+a+'"+e.getContent()+"",i)this.getEl("body").firstChild.src="data:text/html;charset=utf-8,"+encodeURIComponent(n);else{var s=this.getEl("body").firstChild.contentWindow.document;s.open(),s.write(n),s.close()}}})}),e.addButton("preview",{title:"Preview",cmd:"mcePreview"}),e.addMenuItem("preview",{text:"Preview",cmd:"mcePreview",context:"view"})}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/print/plugin.min.js b/app/lib/tinymce/plugins/print/plugin.min.js deleted file mode 100644 index abc37b5f..00000000 --- a/app/lib/tinymce/plugins/print/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("print",function(t){t.addCommand("mcePrint",function(){t.getWin().print()}),t.addButton("print",{title:"Print",cmd:"mcePrint"}),t.addShortcut("Ctrl+P","","mcePrint"),t.addMenuItem("print",{text:"Print",cmd:"mcePrint",icon:"print",shortcut:"Ctrl+P",context:"file"})}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/save/plugin.min.js b/app/lib/tinymce/plugins/save/plugin.min.js deleted file mode 100644 index 07fcb1bf..00000000 --- a/app/lib/tinymce/plugins/save/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("save",function(e){function a(){var a;return a=tinymce.DOM.getParent(e.id,"form"),!e.getParam("save_enablewhendirty",!0)||e.isDirty()?(tinymce.triggerSave(),e.getParam("save_onsavecallback")?void(e.execCallback("save_onsavecallback",e)&&(e.startContent=tinymce.trim(e.getContent({format:"raw"})),e.nodeChanged())):void(a?(e.isNotDirty=!0,(!a.onsubmit||a.onsubmit())&&("function"==typeof a.submit?a.submit():e.windowManager.alert("Error: Form submit field collision.")),e.nodeChanged()):e.windowManager.alert("Error: No form element found."))):void 0}function n(){var a=tinymce.trim(e.startContent);return e.getParam("save_oncancelcallback")?void e.execCallback("save_oncancelcallback",e):(e.setContent(a),e.undoManager.clear(),void e.nodeChanged())}function t(){var a=this;e.on("nodeChange",function(){a.disabled(e.getParam("save_enablewhendirty",!0)&&!e.isDirty())})}e.addCommand("mceSave",a),e.addCommand("mceCancel",n),e.addButton("save",{icon:"save",text:"Save",cmd:"mceSave",disabled:!0,onPostRender:t}),e.addButton("cancel",{text:"Cancel",icon:!1,cmd:"mceCancel",disabled:!0,onPostRender:t}),e.addShortcut("ctrl+s","","mceSave")}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/searchreplace/plugin.min.js b/app/lib/tinymce/plugins/searchreplace/plugin.min.js deleted file mode 100644 index 367c6bd0..00000000 --- a/app/lib/tinymce/plugins/searchreplace/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(){function e(e,t,n,a,r){function i(e,t){if(t=t||0,!e[0])throw"findAndReplaceDOMText cannot handle zero-length matches";var n=e.index;if(t>0){var a=e[t];if(!a)throw"Invalid capture group";n+=e[0].indexOf(a),e[0]=a}return[n,n+e[0].length,[e[0]]]}function d(e){var t;if(3===e.nodeType)return e.data;if(h[e.nodeName]&&!u[e.nodeName])return"";if(t="",(u[e.nodeName]||m[e.nodeName])&&(t+="\n"),e=e.firstChild)do t+=d(e);while(e=e.nextSibling);return t}function o(e,t,n){var a,r,i,d,o=[],l=0,c=e,s=t.shift(),f=0;e:for(;;){if((u[c.nodeName]||m[c.nodeName])&&l++,3===c.nodeType&&(!r&&c.length+l>=s[1]?(r=c,d=s[1]-l):a&&o.push(c),!a&&c.length+l>s[0]&&(a=c,i=s[0]-l),l+=c.length),a&&r){if(c=n({startNode:a,startNodeIndex:i,endNode:r,endNodeIndex:d,innerNodes:o,match:s[2],matchIndex:f}),l-=r.length-d,a=null,r=null,o=[],s=t.shift(),f++,!s)break}else{if((!h[c.nodeName]||u[c.nodeName])&&c.firstChild){c=c.firstChild;continue}if(c.nextSibling){c=c.nextSibling;continue}}for(;;){if(c.nextSibling){c=c.nextSibling;break}if(c.parentNode===e)break e;c=c.parentNode}}}function l(e){var t;if("function"!=typeof e){var n=e.nodeType?e:f.createElement(e);t=function(e,t){var a=n.cloneNode(!1);return a.setAttribute("data-mce-index",t),e&&a.appendChild(f.createTextNode(e)),a}}else t=e;return function(e){var n,a,r,i=e.startNode,d=e.endNode,o=e.matchIndex;if(i===d){var l=i;r=l.parentNode,e.startNodeIndex>0&&(n=f.createTextNode(l.data.substring(0,e.startNodeIndex)),r.insertBefore(n,l));var c=t(e.match[0],o);return r.insertBefore(c,l),e.endNodeIndexh;++h){var g=e.innerNodes[h],p=t(g.data,o);g.parentNode.replaceChild(p,g),u.push(p)}var x=t(d.data.substring(0,e.endNodeIndex),o);return r=i.parentNode,r.insertBefore(n,i),r.insertBefore(s,i),r.removeChild(i),r=d.parentNode,r.insertBefore(x,d),r.insertBefore(a,d),r.removeChild(d),x}}var c,s,f,u,h,m,g=[],p=0;if(f=t.ownerDocument,u=r.getBlockElements(),h=r.getWhiteSpaceElements(),m=r.getShortEndedElements(),s=d(t)){if(e.global)for(;c=e.exec(s);)g.push(i(c,a));else c=s.match(e),g.push(i(c,a));return g.length&&(p=g.length,o(t,g,l(n))),p}}function t(t){function n(){function e(){r.statusbar.find("#next").disabled(!d(s+1).length),r.statusbar.find("#prev").disabled(!d(s-1).length)}function n(){tinymce.ui.MessageBox.alert("Could not find the specified string.",function(){r.find("#find")[0].focus()})}var a={},r=tinymce.ui.Factory.create({type:"window",layout:"flex",pack:"center",align:"center",onClose:function(){t.focus(),c.done()},onSubmit:function(t){var i,o,l,f;return t.preventDefault(),o=r.find("#case").checked(),f=r.find("#words").checked(),l=r.find("#find").value(),l.length?a.text==l&&a.caseState==o&&a.wholeWord==f?0===d(s+1).length?void n():(c.next(),void e()):(i=c.find(l,o,f),i||n(),r.statusbar.items().slice(1).disabled(0===i),e(),void(a={text:l,caseState:o,wholeWord:f})):(c.done(!1),void r.statusbar.items().slice(1).disabled(!0))},buttons:[{text:"Find",onclick:function(){r.submit()}},{text:"Replace",disabled:!0,onclick:function(){c.replace(r.find("#replace").value())||(r.statusbar.items().slice(1).disabled(!0),s=-1,a={})}},{text:"Replace all",disabled:!0,onclick:function(){c.replace(r.find("#replace").value(),!0,!0),r.statusbar.items().slice(1).disabled(!0),a={}}},{type:"spacer",flex:1},{text:"Prev",name:"prev",disabled:!0,onclick:function(){c.prev(),e()}},{text:"Next",name:"next",disabled:!0,onclick:function(){c.next(),e()}}],title:"Find and replace",items:{type:"form",padding:20,labelGap:30,spacing:10,items:[{type:"textbox",name:"find",size:40,label:"Find",value:t.selection.getNode().src},{type:"textbox",name:"replace",size:40,label:"Replace with"},{type:"checkbox",name:"case",text:"Match case",label:" "},{type:"checkbox",name:"words",text:"Whole words",label:" "}]}}).renderTo().reflow()}function a(e){var t=e.getAttribute("data-mce-index");return"number"==typeof t?""+t:t}function r(n){var a,r;return r=t.dom.create("span",{"data-mce-bogus":1}),r.className="mce-match-marker",a=t.getBody(),c.done(!1),e(n,a,r,!1,t.schema)}function i(e){var t=e.parentNode;e.firstChild&&t.insertBefore(e.firstChild,e),e.parentNode.removeChild(e)}function d(e){var n,r=[];if(n=tinymce.toArray(t.getBody().getElementsByTagName("span")),n.length)for(var i=0;is&&f[o].setAttribute("data-mce-index",m-1)}return t.undoManager.add(),s=p,n?(g=d(p+1).length>0,c.next()):(g=d(p-1).length>0,c.prev()),!r&&g},c.done=function(e){var n,r,d,o;for(r=tinymce.toArray(t.getBody().getElementsByTagName("span")),n=0;n=u.end?(i=c,a=u.end-l):r&&s.push(c),!r&&c.length+l>u.start&&(r=c,o=u.start-l),l+=c.length),r&&i){if(c=n({startNode:r,startNodeIndex:o,endNode:i,endNodeIndex:a,innerNodes:s,match:u.text,matchIndex:d}),l-=i.length-a,r=null,i=null,s=[],u=t.shift(),d++,!u)break}else{if((!N[c.nodeName]||k[c.nodeName])&&c.firstChild){c=c.firstChild;continue}if(c.nextSibling){c=c.nextSibling;continue}}for(;;){if(c.nextSibling){c=c.nextSibling;break}if(c.parentNode===e)break e;c=c.parentNode}}}function o(e){function t(t,n){var r=x[n];r.stencil||(r.stencil=e(r));var i=r.stencil.cloneNode(!1);return i.setAttribute("data-mce-index",n),t&&i.appendChild(_.doc.createTextNode(t)),i}return function(e){var n,r,i,o=e.startNode,a=e.endNode,s=e.matchIndex,l=_.doc;if(o===a){var c=o;i=c.parentNode,e.startNodeIndex>0&&(n=l.createTextNode(c.data.substring(0,e.startNodeIndex)),i.insertBefore(n,c));var u=t(e.match,s);return i.insertBefore(u,c),e.endNodeIndexp;++p){var h=e.innerNodes[p],g=t(h.data,s);h.parentNode.replaceChild(g,h),f.push(g)}var v=t(a.data.substring(0,e.endNodeIndex),s);return i=o.parentNode,i.insertBefore(n,o),i.insertBefore(d,o),i.removeChild(o),i=a.parentNode,i.insertBefore(v,a),i.insertBefore(r,a),i.removeChild(a),v}}function a(e){var t=e.parentNode;t.insertBefore(e.firstChild,e),e.parentNode.removeChild(e)}function s(t){var n=e.getElementsByTagName("*"),r=[];t="number"==typeof t?""+t:null;for(var i=0;it&&e(x[t],t)!==!1;t++);return this}function d(t){return x.length&&i(e,x,o(t)),this}function f(e,t){if(w&&e.global)for(;C=e.exec(w);)x.push(n(C,t));return this}function p(e){var t,n=s(e?l(e):null);for(t=n.length;t--;)a(n[t]);return this}function m(e){return x[e.getAttribute("data-mce-index")]}function h(e){return s(l(e))[0]}function g(e,t,n){return x.push({start:e,end:e+t,text:w.substr(e,t),data:n}),this}function v(e){var n=s(l(e)),r=t.dom.createRng();return r.setStartBefore(n[0]),r.setEndAfter(n[n.length-1]),r}function y(e,n){var r=v(e);return r.deleteContents(),n.length>0&&r.insertNode(t.dom.doc.createTextNode(n)),r}function b(){return x.splice(0,x.length),p(),this}var C,x=[],w,_=t.dom,k,N,E;return k=t.schema.getBlockElements(),N=t.schema.getWhiteSpaceElements(),E=t.schema.getShortEndedElements(),w=r(e),{text:w,matches:x,each:u,filter:c,reset:b,matchFromElement:m,elementFromMatch:h,find:f,add:g,wrap:d,unwrap:p,replace:y,rangeFromMatch:v,indexOf:l}}}),r(c,[l,u,d,f,p,m,h,g],function(e,t,n,r,i,o,a,s){t.add("spellchecker",function(t,l){function c(){return E.textMatcher||(E.textMatcher=new e(t.getBody(),t)),E.textMatcher}function u(e,t){var r=[];return n.each(t,function(e){r.push({selectable:!0,text:e.name,data:e.value})}),r}function d(e){for(var t in e)return!1;return!0}function f(e,o){var a=[],s=S[e];n.each(s,function(e){a.push({text:e,onclick:function(){t.insertContent(t.dom.encode(e)),t.dom.remove(o),v()}})}),a.push({text:"-"}),B&&a.push({text:"Add to Dictionary",onclick:function(){y(e,o)}}),a.push.apply(a,[{text:"Ignore",onclick:function(){b(e,o)}},{text:"Ignore all",onclick:function(){b(e,o,!0)}}]),R=new r({items:a,context:"contextmenu",onautohide:function(e){-1!=e.target.className.indexOf("spellchecker")&&e.preventDefault()},onhide:function(){R.remove(),R=null}}),R.renderTo(document.body);var l=i.DOM.getPos(t.getContentAreaContainer()),c=t.dom.getPos(o[0]),u=t.dom.getRoot();"BODY"==u.nodeName?(c.x-=u.ownerDocument.documentElement.scrollLeft||u.scrollLeft,c.y-=u.ownerDocument.documentElement.scrollTop||u.scrollTop):(c.x-=u.scrollLeft,c.y-=u.scrollTop),l.x+=c.x,l.y+=c.y,R.moveTo(l.x,l.y+o[0].offsetHeight)}function p(){return t.getParam("spellchecker_wordchar_pattern")||new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`\xa7\xa9\xab\xae\xb1\xb6\xb7\xb8\xbb\xbc\xbd\xbe\xbf\xd7\xf7\xa4\u201d\u201c\u201e\xa0\u2002\u2003\u2009]+',"g")}function m(e,t,r,i){var c={method:e},u="";"spellcheck"==e&&(c.text=t,c.lang=A.spellchecker_language),"addToDictionary"==e&&(c.word=t),n.each(c,function(e,t){u&&(u+="&"),u+=t+"="+encodeURIComponent(e)}),o.send({url:new a(l).toAbsolute(A.spellchecker_rpc_url),type:"post",content_type:"application/x-www-form-urlencoded",data:u,success:function(e){e=s.parse(e),e?e.error?i(e.error):r(e):i("Sever response wasn't proper JSON.")},error:function(e,t){i("Spellchecker request error: "+t.status)}})}function h(e,t,n,r){var i=A.spellchecker_callback||m;i.call(E,e,t,n,r)}function g(){function e(e){t.windowManager.alert(e),t.setProgressState(!1),C()}return T?void C():(C(),t.setProgressState(!0),h("spellcheck",c().text,k,e),void t.focus())}function v(){t.dom.select("span.mce-spellchecker-word").length||C()}function y(e,n){t.setProgressState(!0),h("addToDictionary",e,function(){t.setProgressState(!1),t.dom.remove(n,!0),v()},function(e){t.windowManager.alert(e),t.setProgressState(!1)})}function b(e,r,i){t.selection.collapse(),i?n.each(t.dom.select("span.mce-spellchecker-word"),function(n){n.getAttribute("data-mce-word")==e&&t.dom.remove(n,!0)}):t.dom.remove(r,!0),v()}function C(){c().reset(),E.textMatcher=null,T&&(T=!1,t.fire("SpellcheckEnd"))}function x(e){var t=e.getAttribute("data-mce-index");return"number"==typeof t?""+t:t}function w(e){var r,i=[];if(r=n.toArray(t.getBody().getElementsByTagName("span")),r.length)for(var o=0;o0){var i=t.dom.createRng();i.setStartBefore(r[0]),i.setEndAfter(r[r.length-1]),t.selection.setRng(i),f(n.getAttribute("data-mce-word"),r)}}}),t.addMenuItem("spellchecker",{text:"Spellcheck",context:"tools",onclick:g,selectable:!0,onPostRender:function(){var e=this;e.active(T),t.on("SpellcheckStart SpellcheckEnd",function(){e.active(T)})}});var P={tooltip:"Spellcheck",onclick:g,onPostRender:function(){var e=this;t.on("SpellcheckStart SpellcheckEnd",function(){e.active(T)})}};N.length>1&&(P.type="splitbutton",P.menu=N,P.onshow=_,P.onselect=function(e){A.spellchecker_language=e.control.settings.data}),t.addButton("spellchecker",P),t.addCommand("mceSpellCheck",g),t.on("remove",function(){R&&(R.remove(),R=null)}),t.on("change",v),this.getTextMatcher=c,this.getWordCharPattern=p,this.markErrors=k,this.getLanguage=function(){return A.spellchecker_language},A.spellchecker_language=A.spellchecker_language||A.language||"en"})}),a([l])}(this); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/tabfocus/plugin.min.js b/app/lib/tinymce/plugins/tabfocus/plugin.min.js deleted file mode 100644 index a492e92d..00000000 --- a/app/lib/tinymce/plugins/tabfocus/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("tabfocus",function(e){function t(e){9!==e.keyCode||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()}function n(t){function n(n){function a(e){return"BODY"===e.nodeName||"hidden"!=e.type&&"none"!=e.style.display&&"hidden"!=e.style.visibility&&a(e.parentNode)}function c(e){return/INPUT|TEXTAREA|BUTTON/.test(e.tagName)&&tinymce.get(t.id)&&-1!=e.tabIndex&&a(e)}if(u=i.select(":input:enabled,*[tabindex]:not(iframe)"),o(u,function(t,n){return t.id==e.id?(r=n,!1):void 0}),n>0){for(d=r+1;d=0;d--)if(c(u[d]))return u[d];return null}var r,u,c,d;if(!(9!==t.keyCode||t.ctrlKey||t.altKey||t.metaKey||t.isDefaultPrevented())&&(c=a(e.getParam("tab_focus",e.getParam("tabfocus_elements",":prev,:next"))),1==c.length&&(c[1]=c[0],c[0]=":prev"),u=t.shiftKey?":prev"==c[0]?n(-1):i.get(c[0]):":next"==c[1]?n(1):i.get(c[1]))){var y=tinymce.get(u.id||u.name);u.id&&y?y.focus():window.setTimeout(function(){tinymce.Env.webkit||window.focus(),u.focus()},10),t.preventDefault()}}var i=tinymce.DOM,o=tinymce.each,a=tinymce.explode;e.on("init",function(){e.inline&&tinymce.DOM.setAttrib(e.getBody(),"tabIndex",null),e.on("keyup",t),tinymce.Env.gecko?e.on("keypress keydown",n):e.on("keydown",n)})}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/table/plugin.min.js b/app/lib/tinymce/plugins/table/plugin.min.js deleted file mode 100644 index 9b48a0d6..00000000 --- a/app/lib/tinymce/plugins/table/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;i "+t+" tr",a);i(n,function(n,o){o+=e,i(O.select("> td, > th",n),function(e,n){var i,a,s,l;if(B[o])for(;B[o][n];)n++;for(s=r(e,"rowspan"),l=r(e,"colspan"),a=o;o+s>a;a++)for(B[a]||(B[a]=[]),i=n;n+l>i;i++)B[a][i]={part:t,real:a==o&&i==n,elm:e,rowspan:s,colspan:l};D=Math.max(D,n+1)})}),e+=n.length})}function l(e,t){return e=e.cloneNode(t),e.removeAttribute("id"),e}function c(e,t){var n;return n=B[t],n?n[e]:void 0}function u(e,t,n){e&&(n=parseInt(n,10),1===n?e.removeAttribute(t,1):e.setAttribute(t,n,1))}function d(e){return e&&(O.hasClass(e.elm,"mce-item-selected")||e==H)}function f(){var e=[];return i(a.rows,function(t){i(t.cells,function(n){return O.hasClass(n,"mce-item-selected")||H&&n==H.elm?(e.push(t),!1):void 0})}),e}function p(){var e=O.createRng();e.setStartAfter(a),e.setEndAfter(a),L.setRng(e),O.remove(a)}function m(t){var r,a={};return o.settings.table_clone_elements!==!1&&(a=e.makeMap((o.settings.table_clone_elements||"strong em b i span font h1 h2 h3 h4 h5 h6 p div").toUpperCase(),/[ ,]/)),e.walk(t,function(e){var o;return 3==e.nodeType?(i(O.getParents(e.parentNode,null,t).reverse(),function(e){a[e.nodeName]&&(e=l(e,!1),r?o&&o.appendChild(e):r=o=e,o=e)}),o&&(o.innerHTML=n.ie?" ":'
'),!1):void 0},"childNodes"),t=l(t,!1),u(t,"rowSpan",1),u(t,"colSpan",1),r?t.appendChild(r):(!n.ie||n.ie>10)&&(t.innerHTML='
'),t}function h(){var e=O.createRng(),t;return i(O.select("tr",a),function(e){0===e.cells.length&&O.remove(e)}),0===O.select("tr",a).length?(e.setStartBefore(a),e.setEndBefore(a),L.setRng(e),void O.remove(a)):(i(O.select("thead,tbody,tfoot",a),function(e){0===e.rows.length&&O.remove(e)}),s(),void(P&&(t=B[Math.min(B.length-1,P.y)],t&&(L.select(t[Math.min(t.length-1,P.x)].elm,!0),L.collapse(!0)))))}function g(e,t,n,r){var i,o,a,s,l;for(i=B[t][e].elm.parentNode,a=1;n>=a;a++)if(i=O.getNext(i,"tr")){for(o=e;o>=0;o--)if(l=B[t+a][o].elm,l.parentNode==i){for(s=1;r>=s;s++)O.insertAfter(m(l),l);break}if(-1==o)for(s=1;r>=s;s++)i.insertBefore(m(i.cells[0]),i.cells[0])}}function v(){i(B,function(e,t){i(e,function(e,n){var i,o,a;if(d(e)&&(e=e.elm,i=r(e,"colspan"),o=r(e,"rowspan"),i>1||o>1)){for(u(e,"rowSpan",1),u(e,"colSpan",1),a=0;i-1>a;a++)O.insertAfter(m(e),e);g(n,t,o-1,i)}})})}function y(t,n,r){var o,a,l,f,p,m,g,y,b,C,x;if(t?(o=N(t),a=o.x,l=o.y,f=a+(n-1),p=l+(r-1)):(P=M=null,i(B,function(e,t){i(e,function(e,n){d(e)&&(P||(P={x:n,y:t}),M={x:n,y:t})})}),P&&(a=P.x,l=P.y,f=M.x,p=M.y)),y=c(a,l),b=c(f,p),y&&b&&y.part==b.part){for(v(),s(),y=c(a,l).elm,u(y,"colSpan",f-a+1),u(y,"rowSpan",p-l+1),g=l;p>=g;g++)for(m=a;f>=m;m++)B[g]&&B[g][m]&&(t=B[g][m].elm,t!=y&&(C=e.grep(t.childNodes),i(C,function(e){y.appendChild(e)}),C.length&&(C=e.grep(y.childNodes),x=0,i(C,function(e){"BR"==e.nodeName&&O.getAttrib(e,"data-mce-bogus")&&x++0&&B[n-1][s]&&(h=B[n-1][s].elm,g=r(h,"rowSpan"),g>1)){u(h,"rowSpan",g+1);continue}}else if(g=r(o,"rowspan"),g>1){u(o,"rowSpan",g+1);continue}p=m(o),u(p,"colSpan",o.colSpan),f.appendChild(p),a=o}f.hasChildNodes()&&(e?c.parentNode.insertBefore(f,c):O.insertAfter(f,c))}}function C(e){var t,n;i(B,function(n){return i(n,function(n,r){return d(n)&&(t=r,e)?!1:void 0}),e?!t:void 0}),i(B,function(i,o){var a,s,l;i[t]&&(a=i[t].elm,a!=n&&(l=r(a,"colspan"),s=r(a,"rowspan"),1==l?e?(a.parentNode.insertBefore(m(a),a),g(t,o,s-1,l)):(O.insertAfter(m(a),a),g(t,o,s-1,l)):u(a,"colSpan",a.colSpan+1),n=a))})}function x(){var t=[];i(B,function(n){i(n,function(n,o){d(n)&&-1===e.inArray(t,o)&&(i(B,function(e){var t=e[o].elm,n;n=r(t,"colSpan"),n>1?u(t,"colSpan",n-1):O.remove(t)}),t.push(o))})}),h()}function w(){function e(e){var t,n;i(e.cells,function(e){var n=r(e,"rowSpan");n>1&&(u(e,"rowSpan",n-1),t=N(e),g(t.x,t.y,1,1))}),t=N(e.cells[0]),i(B[t.y],function(e){var t;e=e.elm,e!=n&&(t=r(e,"rowSpan"),1>=t?O.remove(e):u(e,"rowSpan",t-1),n=e)})}var t;t=f(),i(t.reverse(),function(t){e(t)}),h()}function _(){var e=f();return O.remove(e),h(),e}function k(){var e=f();return i(e,function(t,n){e[n]=l(t,!0)}),e}function E(e,t){var n=f(),r=n[t?0:n.length-1],o=r.cells.length;e&&(i(B,function(e){var t;return o=0,i(e,function(e){e.real&&(o+=e.colspan),e.elm.parentNode==r&&(t=1)}),t?!1:void 0}),t||e.reverse(),i(e,function(e){var n,i=e.cells.length,a;for(n=0;i>n;n++)a=e.cells[n],u(a,"colSpan",1),u(a,"rowSpan",1);for(n=i;o>n;n++)e.appendChild(m(e.cells[i-1]));for(n=o;i>n;n++)O.remove(e.cells[n]);t?r.parentNode.insertBefore(e,r):O.insertAfter(e,r)}),O.removeClass(O.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"))}function N(e){var t;return i(B,function(n,r){return i(n,function(n,i){return n.elm==e?(t={x:i,y:r},!1):void 0}),!t}),t}function S(e){P=N(e)}function T(){var e,t;return e=t=0,i(B,function(n,r){i(n,function(n,i){var o,a;d(n)&&(n=B[r][i],i>e&&(e=i),r>t&&(t=r),n.real&&(o=n.colspan-1,a=n.rowspan-1,o&&i+o>e&&(e=i+o),a&&r+a>t&&(t=r+a)))})}),{x:e,y:t}}function R(e){var t,n,r,i,o,a,s,l,c,u;if(M=N(e),P&&M){for(t=Math.min(P.x,M.x),n=Math.min(P.y,M.y),r=Math.max(P.x,M.x),i=Math.max(P.y,M.y),o=r,a=i,u=n;a>=u;u++)e=B[u][t],e.real||t-(e.colspan-1)=c;c++)e=B[n][c],e.real||n-(e.rowspan-1)=u;u++)for(c=t;r>=c;c++)e=B[u][c],e.real&&(s=e.colspan-1,l=e.rowspan-1,s&&c+s>o&&(o=c+s),l&&u+l>a&&(a=u+l));for(O.removeClass(O.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),u=n;a>=u;u++)for(c=t;o>=c;c++)B[u][c]&&O.addClass(B[u][c].elm,"mce-item-selected")}}function A(e,t){var n,r,i;n=N(e),r=n.y*D+n.x;do{if(r+=t,i=c(r%D,Math.floor(r/D)),!i)break;if(i.elm!=e)return L.select(i.elm,!0),O.isEmpty(i.elm)&&L.collapse(!0),!0}while(i.elm==e);return!1}var B,D,P,M,H,L=o.selection,O=L.dom;a=a||O.getParent(L.getStart(),"table"),s(),H=O.getParent(L.getStart(),"th,td"),H&&(P=N(H),M=T(),H=c(P.x,P.y)),e.extend(this,{deleteTable:p,split:v,merge:y,insertRow:b,insertCol:C,deleteCols:x,deleteRows:w,cutRows:_,copyRows:k,pasteRows:E,getPos:N,setStartCell:S,setEndCell:R,moveRelIdx:A,refresh:s})}}),r(d,[f,u,c],function(e,t,n){function r(e,t){return parseInt(e.getAttribute(t)||1,10)}var i=n.each;return function(n){function o(){function t(t){function o(e,r){var i=e?"previousSibling":"nextSibling",o=n.dom.getParent(r,"tr"),s=o[i];if(s)return g(n,r,s,e),t.preventDefault(),!0;var u=n.dom.getParent(o,"table"),d=o.parentNode,f=d.nodeName.toLowerCase();if("tbody"===f||f===(e?"tfoot":"thead")){var p=a(e,u,d,"tbody");if(null!==p)return l(e,p,r)}return c(e,o,i,u)}function a(e,t,r,i){var o=n.dom.select(">"+i,t),a=o.indexOf(r);if(e&&0===a||!e&&a===o.length-1)return s(e,t);if(-1===a){var l="thead"===r.tagName.toLowerCase()?0:o.length-1;return o[l]}return o[a+(e?-1:1)]}function s(e,t){var r=e?"thead":"tfoot",i=n.dom.select(">"+r,t);return 0!==i.length?i[0]:null}function l(e,r,i){var o=u(r,e);return o&&g(n,i,o,e),t.preventDefault(),!0}function c(e,r,i,a){var s=a[i];if(s)return d(s),!0;var l=n.dom.getParent(a,"td,th");if(l)return o(e,l,t);var c=u(r,!e);return d(c),t.preventDefault(),!1}function u(e,t){var r=e&&e[t?"lastChild":"firstChild"];return r&&"BR"===r.nodeName?n.dom.getParent(r,"td,th"):r}function d(e){n.selection.setCursorLocation(e,0)}function f(){return b==e.UP||b==e.DOWN}function p(e){var t=e.selection.getNode(),n=e.dom.getParent(t,"tr");return null!==n}function m(e){for(var t=0,n=e;n.previousSibling;)n=n.previousSibling,t+=r(n,"colspan");return t}function h(e,t){var n=0,o=0;return i(e.children,function(e,i){return n+=r(e,"colspan"),o=i,n>t?!1:void 0}),o}function g(e,t,r,i){var o=m(n.dom.getParent(t,"td,th")),a=h(r,o),s=r.childNodes[a],l=u(s,i);d(l||s)}function v(e){var t=n.selection.getNode(),r=n.dom.getParent(t,"td,th"),i=n.dom.getParent(e,"td,th");return r&&r!==i&&y(r,i)}function y(e,t){return n.dom.getParent(e,"TABLE")===n.dom.getParent(t,"TABLE")}var b=t.keyCode;if(f()&&p(n)){var C=n.selection.getNode();setTimeout(function(){v(C)&&o(!t.shiftKey&&b===e.UP,C,t)},0)}}n.on("KeyDown",function(e){t(e)})}function a(){function e(e,t){var n=t.ownerDocument,r=n.createRange(),i;return r.setStartBefore(t),r.setEnd(e.endContainer,e.endOffset),i=n.createElement("body"),i.appendChild(r.cloneContents()),0===i.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length}n.on("KeyDown",function(t){var r,i,o=n.dom;(37==t.keyCode||38==t.keyCode)&&(r=n.selection.getRng(),i=o.getParent(r.startContainer,"table"),i&&n.getBody().firstChild==i&&e(r,i)&&(r=o.createRng(),r.setStartBefore(i),r.setEndBefore(i),n.selection.setRng(r),t.preventDefault()))})}function s(){n.on("KeyDown SetContent VisualAid",function(){var e;for(e=n.getBody().lastChild;e;e=e.previousSibling)if(3==e.nodeType){if(e.nodeValue.length>0)break}else if(1==e.nodeType&&("BR"==e.tagName||!e.getAttribute("data-mce-bogus")))break;e&&"TABLE"==e.nodeName&&(n.settings.forced_root_block?n.dom.add(n.getBody(),n.settings.forced_root_block,n.settings.forced_root_block_attrs,t.ie&&t.ie<11?" ":'
'):n.dom.add(n.getBody(),"br",{"data-mce-bogus":"1"}))}),n.on("PreProcess",function(e){var t=e.node.lastChild;t&&("BR"==t.nodeName||1==t.childNodes.length&&("BR"==t.firstChild.nodeName||"\xa0"==t.firstChild.nodeValue))&&t.previousSibling&&"TABLE"==t.previousSibling.nodeName&&n.dom.remove(t)})}function l(){function e(e,t,n,r){var i=3,o=e.dom.getParent(t.startContainer,"TABLE"),a,s,l;return o&&(a=o.parentNode),s=t.startContainer.nodeType==i&&0===t.startOffset&&0===t.endOffset&&r&&("TR"==n.nodeName||n==a),l=("TD"==n.nodeName||"TH"==n.nodeName)&&!r,s||l}function t(){var t=n.selection.getRng(),r=n.selection.getNode(),i=n.dom.getParent(t.startContainer,"TD,TH");if(e(n,t,r,i)){i||(i=r);for(var o=i.lastChild;o.lastChild;)o=o.lastChild;3==o.nodeType&&(t.setEnd(o,o.data.length),n.selection.setRng(t))}}n.on("KeyDown",function(){t()}),n.on("MouseDown",function(e){2!=e.button&&t()})}function c(){n.on("keydown",function(t){if((t.keyCode==e.DELETE||t.keyCode==e.BACKSPACE)&&!t.isDefaultPrevented()){var r=n.dom.getParent(n.selection.getStart(),"table");if(r){for(var i=n.dom.select("td,th",r),o=i.length;o--;)if(!n.dom.hasClass(i[o],"mce-item-selected"))return;t.preventDefault(),n.execCommand("mceTableDelete")}}})}c(),t.webkit&&(o(),l()),t.gecko&&(a(),s()),t.ie>10&&(a(),s())}}),r(p,[l,m,c],function(e,t,n){return function(r){function i(e){r.getBody().style.webkitUserSelect="",(e||u)&&(r.dom.removeClass(r.dom.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),u=!1)}function o(t){var n,i,o=t.target;if(!d&&l&&(s||o!=l)&&("TD"==o.nodeName||"TH"==o.nodeName)){i=a.getParent(o,"table"),i==c&&(s||(s=new e(r,i),s.setStartCell(l),r.getBody().style.webkitUserSelect="none"),s.setEndCell(o),u=!0),n=r.selection.getSel();try{n.removeAllRanges?n.removeAllRanges():n.empty()}catch(f){}t.preventDefault()}}var a=r.dom,s,l,c,u=!0,d;return r.on("MouseDown",function(e){2==e.button||d||(i(),l=a.getParent(e.target,"td,th"),c=a.getParent(l,"table"))}),r.on("mouseover",o),r.on("remove",function(){a.unbind(r.getDoc(),"mouseover",o)}),r.on("MouseUp",function(){function e(e,r){var o=new t(e,e);do{if(3==e.nodeType&&0!==n.trim(e.nodeValue).length)return void(r?i.setStart(e,0):i.setEnd(e,e.nodeValue.length));if("BR"==e.nodeName)return void(r?i.setStartBefore(e):i.setEndBefore(e))}while(e=r?o.next():o.prev())}var i,o=r.selection,u,d,f,p;if(l){if(s&&(r.getBody().style.webkitUserSelect=""),u=a.select("td.mce-item-selected,th.mce-item-selected"),u.length>0){i=a.createRng(),f=u[0],i.setStartBefore(f),i.setEndAfter(f),e(f,1),d=new t(f,a.getParent(u[0],"table"));do if("TD"==f.nodeName||"TH"==f.nodeName){if(!a.hasClass(f,"mce-item-selected"))break;p=f}while(f=d.next());e(p),o.setRng(i)}r.nodeChanged(),l=s=c=null}}),r.on("KeyUp Drop SetContent",function(e){i("setcontent"==e.type),l=s=c=null,d=!1}),r.on("ObjectResizeStart ObjectResized",function(e){d="objectresized"!=e.type}),{clear:i}}}),r(h,[c,u],function(e,t){var n=e.each;return function(r){function i(){var e=r.settings.color_picker_callback;return e?function(){var t=this;e.call(r,function(e){t.value(e).fire("change")},t.value())}:void 0}function o(e){return{title:"Advanced",type:"form",defaults:{onchange:function(){d(e,this.parents().reverse()[0],"style"==this.name())}},items:[{label:"Style",name:"style",type:"textbox"},{type:"form",padding:0,formItemDefaults:{layout:"grid",alignH:["start","right"]},defaults:{size:7},items:[{label:"Border color",type:"colorbox",name:"borderColor",onaction:i()},{label:"Background color",type:"colorbox",name:"backgroundColor",onaction:i()}]}]}}function a(e){return e?e.replace(/px$/,""):""}function s(e){return/^[0-9]+$/.test(e)&&(e+="px"),e}function l(e){n("left center right".split(" "),function(t){r.formatter.remove("align"+t,{},e)})}function c(e){n("top middle bottom".split(" "),function(t){r.formatter.remove("valign"+t,{},e)})}function u(t,n,r){function i(t,r){return r=r||[],e.each(t,function(e){var t={text:e.text||e.title};e.menu?t.menu=i(e.menu):(t.value=e.value,n&&n(t)),r.push(t)}),r}return i(t,r||[])}function d(e,t,n){var r=t.toJSON(),i=e.parseStyle(r.style);n?(t.find("#borderColor").value(i["border-color"]||"")[0].fire("change"),t.find("#backgroundColor").value(i["background-color"]||"")[0].fire("change")):(i["border-color"]=r.borderColor,i["background-color"]=r.backgroundColor),t.find("#style").value(e.serializeStyle(e.parseStyle(e.serializeStyle(i))))}function f(e,t,n){var r=e.parseStyle(e.getAttrib(n,"style"));r["border-color"]&&(t.borderColor=r["border-color"]),r["background-color"]&&(t.backgroundColor=r["background-color"]),t.style=e.serializeStyle(r)}var p=this;p.tableProps=function(){p.table(!0)},p.table=function(i){function c(){var n;d(p,this),y=e.extend(y,this.toJSON()),e.each("backgroundColor borderColor".split(" "),function(e){delete y[e]}),y["class"]===!1&&delete y["class"],r.undoManager.transact(function(){m||(m=r.plugins.table.insertTable(y.cols||1,y.rows||1)),r.dom.setAttribs(m,{cellspacing:y.cellspacing,cellpadding:y.cellpadding,border:y.border,style:y.style,"class":y["class"]}),p.getAttrib(m,"width")?p.setAttrib(m,"width",a(y.width)):p.setStyle(m,"width",s(y.width)),p.setStyle(m,"height",s(y.height)),n=p.select("caption",m)[0],n&&!y.caption&&p.remove(n),!n&&y.caption&&(n=p.create("caption"),n.innerHTML=t.ie?"\xa0":'
',m.insertBefore(n,m.firstChild)),l(m),y.align&&r.formatter.apply("align"+y.align,{},m),r.focus(),r.addVisual()})}var p=r.dom,m,h,g,v,y={},b;i===!0?(m=p.getParent(r.selection.getStart(),"table"),m&&(y={width:a(p.getStyle(m,"width")||p.getAttrib(m,"width")),height:a(p.getStyle(m,"height")||p.getAttrib(m,"height")),cellspacing:m?p.getAttrib(m,"cellspacing"):"",cellpadding:m?p.getAttrib(m,"cellpadding"):"",border:m?p.getAttrib(m,"border"):"",caption:!!p.select("caption",m)[0],"class":p.getAttrib(m,"class")},n("left center right".split(" "),function(e){r.formatter.matchNode(m,"align"+e)&&(y.align=e)}))):(h={label:"Cols",name:"cols"},g={label:"Rows",name:"rows"}),r.settings.table_class_list&&(y["class"]&&(y["class"]=y["class"].replace(/\s*mce\-item\-table\s*/g,"")),v={name:"class",type:"listbox",label:"Class",values:u(r.settings.table_class_list,function(e){e.value&&(e.textStyle=function(){return r.formatter.getCssText({block:"table",classes:[e.value]})})})}),b={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",labelGapCalc:!1,padding:0,layout:"grid",columns:2,defaults:{type:"textbox",maxWidth:50},items:[h,g,{label:"Width",name:"width"},{label:"Height",name:"height"},{label:"Cell spacing",name:"cellspacing"},{label:"Cell padding",name:"cellpadding"},{label:"Border",name:"border"},{label:"Caption",name:"caption",type:"checkbox"}]},{label:"Alignment",name:"align",type:"listbox",text:"None",values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},v]},r.settings.table_advtab!==!1?(f(p,y,m),r.windowManager.open({title:"Table properties",data:y,bodyType:"tabpanel",body:[{title:"General",type:"form",items:b},o(p)],onsubmit:c})):r.windowManager.open({title:"Table properties",data:y,body:b,onsubmit:c})},p.merge=function(e,t){r.windowManager.open({title:"Merge cells",body:[{label:"Cols",name:"cols",type:"textbox",value:"1",size:10},{label:"Rows",name:"rows",type:"textbox",value:"1",size:10}],onsubmit:function(){var n=this.toJSON();r.undoManager.transact(function(){e.merge(t,n.cols,n.rows)})}})},p.cell=function(){function t(){d(i,this),m=e.extend(m,this.toJSON()),r.undoManager.transact(function(){n(g,function(e){r.dom.setAttribs(e,{scope:m.scope,style:m.style,"class":m["class"]}),r.dom.setStyles(e,{width:s(m.width),height:s(m.height)}),m.type&&e.nodeName.toLowerCase()!=m.type&&(e=i.rename(e,m.type)),l(e),m.align&&r.formatter.apply("align"+m.align,{},e),c(e),m.valign&&r.formatter.apply("valign"+m.valign,{},e)}),r.focus()})}var i=r.dom,p,m,h,g=[];if(g=r.dom.select("td.mce-item-selected,th.mce-item-selected"),p=r.dom.getParent(r.selection.getStart(),"td,th"),!g.length&&p&&g.push(p),p=p||g[0]){m={width:a(i.getStyle(p,"width")||i.getAttrib(p,"width")),height:a(i.getStyle(p,"height")||i.getAttrib(p,"height")),scope:i.getAttrib(p,"scope"),"class":i.getAttrib(p,"class")},m.type=p.nodeName.toLowerCase(),n("left center right".split(" "),function(e){r.formatter.matchNode(p,"align"+e)&&(m.align=e)}),n("top middle bottom".split(" "),function(e){r.formatter.matchNode(p,"valign"+e)&&(m.valign=e)}),r.settings.table_cell_class_list&&(h={name:"class",type:"listbox",label:"Class",values:u(r.settings.table_cell_class_list,function(e){e.value&&(e.textStyle=function(){return r.formatter.getCssText({block:"td",classes:[e.value]})})})});var v={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",layout:"grid",columns:2,labelGapCalc:!1,padding:0,defaults:{type:"textbox",maxWidth:50},items:[{label:"Width",name:"width"},{label:"Height",name:"height"},{label:"Cell type",name:"type",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{label:"Scope",name:"scope",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{label:"H Align",name:"align",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"V Align",name:"valign",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}]},h]};r.settings.table_cell_advtab!==!1?(f(i,m,p),r.windowManager.open({title:"Cell properties",bodyType:"tabpanel",data:m,body:[{title:"General",type:"form",items:v},o(i)],onsubmit:t})):r.windowManager.open({title:"Cell properties",data:m,body:v,onsubmit:t})}},p.row=function(){function t(){var t,o,a;d(i,this),g=e.extend(g,this.toJSON()),r.undoManager.transact(function(){var e=g.type;n(v,function(n){r.dom.setAttribs(n,{scope:g.scope,style:g.style,"class":g["class"]}),r.dom.setStyles(n,{height:s(g.height)}),e!=n.parentNode.nodeName.toLowerCase()&&(t=i.getParent(n,"table"),o=n.parentNode,a=i.select(e,t)[0],a||(a=i.create(e),t.firstChild?t.insertBefore(a,t.firstChild):t.appendChild(a)),a.appendChild(n),o.hasChildNodes()||i.remove(o)),l(n),g.align&&r.formatter.apply("align"+g.align,{},n)}),r.focus()})}var i=r.dom,c,p,m,h,g,v=[],y;c=r.dom.getParent(r.selection.getStart(),"table"),p=r.dom.getParent(r.selection.getStart(),"td,th"),n(c.rows,function(e){n(e.cells,function(t){return i.hasClass(t,"mce-item-selected")||t==p?(v.push(e),!1):void 0})}),m=v[0],m&&(g={height:a(i.getStyle(m,"height")||i.getAttrib(m,"height")),scope:i.getAttrib(m,"scope"),"class":i.getAttrib(m,"class")},g.type=m.parentNode.nodeName.toLowerCase(),n("left center right".split(" "),function(e){r.formatter.matchNode(m,"align"+e)&&(g.align=e)}),r.settings.table_row_class_list&&(h={name:"class",type:"listbox",label:"Class",values:u(r.settings.table_row_class_list,function(e){e.value&&(e.textStyle=function(){return r.formatter.getCssText({block:"tr",classes:[e.value]})})})}),y={type:"form",columns:2,padding:0,defaults:{type:"textbox"},items:[{type:"listbox",name:"type",label:"Row type",text:"None",maxWidth:null,values:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"listbox",name:"align",label:"Alignment",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height"},h]},r.settings.table_row_advtab!==!1?(f(i,g,m),r.windowManager.open({title:"Row properties",data:g,bodyType:"tabpanel",body:[{title:"General",type:"form",items:y},o(i)],onsubmit:t})):r.windowManager.open({title:"Row properties",data:g,body:y,onsubmit:t}))}}}),r(g,[l,d,p,h,c,m,u,v],function(e,t,n,r,i,o,a,s){function l(i){function o(e){return function(){i.execCommand(e)}}function s(e,t){var n,r,o,s;for(o='',n=0;t>n;n++){for(o+="",r=0;e>r;r++)o+="";o+=""}return o+="
"+(a.ie?" ":"
")+"
",i.undoManager.transact(function(){i.insertContent(o),s=i.dom.get("__mce"),i.dom.setAttrib(s,"id",null),i.dom.setAttribs(s,i.settings.table_default_attributes||{}),i.dom.setStyles(s,i.settings.table_default_styles||{})}),s}function l(e,t){function n(){e.disabled(!i.dom.getParent(i.selection.getStart(),t)),i.selection.selectorChanged(t,function(t){e.disabled(!t)})}i.initialized?n():i.on("init",n)}function u(){l(this,"table")}function d(){l(this,"td,th")}function f(){var e="";e='';for(var t=0;10>t;t++){e+="";for(var n=0;10>n;n++)e+='';e+=""}return e+="
",e+=''}function p(e,t,n){var r=n.getEl().getElementsByTagName("table")[0],o,a,s,l,c,u=n.isRtl()||"tl-tr"==n.parent().rel;for(r.nextSibling.innerHTML=e+1+" x "+(t+1),u&&(e=9-e),a=0;10>a;a++)for(o=0;10>o;o++)l=r.rows[a].childNodes[o].firstChild,c=(u?o>=e:e>=o)&&t>=a,i.dom.toggleClass(l,"mce-active",c),c&&(s=l);return s.parentNode}var m,h=this,g=new r(i);i.settings.table_grid===!1?i.addMenuItem("inserttable",{text:"Insert table",icon:"table",context:"table",onclick:g.table}):i.addMenuItem("inserttable",{text:"Insert table",icon:"table",context:"table",ariaHideMenu:!0,onclick:function(e){e.aria&&(this.parent().hideAll(),e.stopImmediatePropagation(),g.table())},onshow:function(){p(0,0,this.menu.items()[0])},onhide:function(){var e=this.menu.items()[0].getEl().getElementsByTagName("a");i.dom.removeClass(e,"mce-active"),i.dom.addClass(e[0],"mce-active")},menu:[{type:"container",html:f(),onPostRender:function(){this.lastX=this.lastY=0},onmousemove:function(e){var t=e.target,n,r;"A"==t.tagName.toUpperCase()&&(n=parseInt(t.getAttribute("data-mce-x"),10),r=parseInt(t.getAttribute("data-mce-y"),10),(this.isRtl()||"tl-tr"==this.parent().rel)&&(n=9-n),(n!==this.lastX||r!==this.lastY)&&(p(n,r,e.control),this.lastX=n,this.lastY=r))},onclick:function(e){var t=this;"A"==e.target.tagName.toUpperCase()&&(e.preventDefault(),e.stopPropagation(),t.parent().cancel(),i.undoManager.transact(function(){s(t.lastX+1,t.lastY+1)}),i.addVisual())}}]}),i.addMenuItem("tableprops",{text:"Table properties",context:"table",onPostRender:u,onclick:g.tableProps}),i.addMenuItem("deletetable",{text:"Delete table",context:"table",onPostRender:u,cmd:"mceTableDelete"}),i.addMenuItem("cell",{separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:o("mceTableCellProps"),onPostRender:d},{text:"Merge cells",onclick:o("mceTableMergeCells"),onPostRender:d},{text:"Split cell",onclick:o("mceTableSplitCells"),onPostRender:d}]}),i.addMenuItem("row",{text:"Row",context:"table",menu:[{text:"Insert row before",onclick:o("mceTableInsertRowBefore"),onPostRender:d},{text:"Insert row after",onclick:o("mceTableInsertRowAfter"),onPostRender:d},{text:"Delete row",onclick:o("mceTableDeleteRow"),onPostRender:d},{text:"Row properties",onclick:o("mceTableRowProps"),onPostRender:d},{text:"-"},{text:"Cut row",onclick:o("mceTableCutRow"),onPostRender:d},{text:"Copy row",onclick:o("mceTableCopyRow"),onPostRender:d},{text:"Paste row before",onclick:o("mceTablePasteRowBefore"),onPostRender:d},{text:"Paste row after",onclick:o("mceTablePasteRowAfter"),onPostRender:d}]}),i.addMenuItem("column",{text:"Column",context:"table",menu:[{text:"Insert column before",onclick:o("mceTableInsertColBefore"),onPostRender:d},{text:"Insert column after",onclick:o("mceTableInsertColAfter"),onPostRender:d},{text:"Delete column",onclick:o("mceTableDeleteCol"),onPostRender:d}]});var v=[];c("inserttable tableprops deletetable | cell row column".split(" "),function(e){v.push("|"==e?{text:"-"}:i.menuItems[e])}),i.addButton("table",{type:"menubutton",title:"Table",menu:v}),a.isIE||i.on("click",function(e){e=e.target,"TABLE"===e.nodeName&&(i.selection.select(e),i.nodeChanged())}),h.quirks=new t(i),i.on("Init",function(){h.cellSelection=new n(i)}),c({mceTableSplitCells:function(e){e.split()},mceTableMergeCells:function(e){var t;t=i.dom.getParent(i.selection.getStart(),"th,td"),i.dom.select("td.mce-item-selected,th.mce-item-selected").length?e.merge():g.merge(e,t)},mceTableInsertRowBefore:function(e){e.insertRow(!0)},mceTableInsertRowAfter:function(e){e.insertRow()},mceTableInsertColBefore:function(e){e.insertCol(!0)},mceTableInsertColAfter:function(e){e.insertCol()},mceTableDeleteCol:function(e){e.deleteCols()},mceTableDeleteRow:function(e){e.deleteRows()},mceTableCutRow:function(e){m=e.cutRows()},mceTableCopyRow:function(e){m=e.copyRows()},mceTablePasteRowBefore:function(e){e.pasteRows(m,!0)},mceTablePasteRowAfter:function(e){e.pasteRows(m)},mceTableDelete:function(e){e.deleteTable()}},function(t,n){i.addCommand(n,function(){var n=new e(i);n&&(t(n),i.execCommand("mceRepaint"),h.cellSelection.clear())})}),c({mceInsertTable:g.table,mceTableProps:function(){g.table(!0)},mceTableRowProps:g.row,mceTableCellProps:g.cell},function(e,t){i.addCommand(t,function(t,n){e(n)})}),i.settings.table_tab_navigation!==!1&&i.on("keydown",function(t){var n,r,o;9==t.keyCode&&(n=i.dom.getParent(i.selection.getStart(),"th,td"),n&&(t.preventDefault(),r=new e(i),o=t.shiftKey?-1:1,i.undoManager.transact(function(){!r.moveRelIdx(n,o)&&o>0&&(r.insertRow(),r.refresh(),r.moveRelIdx(n,o))})))}),h.insertTable=s}var c=i.each;s.add("table",l)}),a([])}(this); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/template/plugin.min.js b/app/lib/tinymce/plugins/template/plugin.min.js deleted file mode 100644 index b514cdb6..00000000 --- a/app/lib/tinymce/plugins/template/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("template",function(e){function t(t){return function(){var a=e.settings.templates;"string"==typeof a?tinymce.util.XHR.send({url:a,success:function(e){t(tinymce.util.JSON.parse(e))}}):t(a)}}function a(t){function a(t){function a(t){if(-1==t.indexOf("")){var a="";tinymce.each(e.contentCSS,function(t){a+=''}),t=""+a+""+t+""}t=r(t,"template_preview_replace_values");var l=n.find("iframe")[0].getEl().contentWindow.document;l.open(),l.write(t),l.close()}var c=t.control.value();c.url?tinymce.util.XHR.send({url:c.url,success:function(e){l=e,a(l)}}):(l=c.content,a(l)),n.find("#description")[0].text(t.control.value().description)}var n,l,i=[];return t&&0!==t.length?(tinymce.each(t,function(e){i.push({selected:!i.length,text:e.title,value:{url:e.url,content:e.content,description:e.description}})}),n=e.windowManager.open({title:"Insert template",layout:"flex",direction:"column",align:"stretch",padding:15,spacing:10,items:[{type:"form",flex:0,padding:0,items:[{type:"container",label:"Templates",items:{type:"listbox",label:"Templates",name:"template",values:i,onselect:a}}]},{type:"label",name:"description",label:"Description",text:"\xa0"},{type:"iframe",flex:1,border:1}],onsubmit:function(){c(!1,l)},width:e.getParam("template_popup_width",600),height:e.getParam("template_popup_height",500)}),void n.find("listbox")[0].fire("select")):void e.windowManager.alert("No templates defined")}function n(t,a){function n(e,t){if(e=""+e,e.length0&&(o=p.create("div",null),o.appendChild(s[0].cloneNode(!0))),i(p.select("*",o),function(t){c(t,e.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))&&(t.innerHTML=n(e.getParam("template_cdate_format",e.getLang("template.cdate_format")))),c(t,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(t.innerHTML=n(e.getParam("template_mdate_format",e.getLang("template.mdate_format")))),c(t,e.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))&&(t.innerHTML=m)}),l(o),e.execCommand("mceInsertContent",!1,o.innerHTML),e.addVisual()}var i=tinymce.each;e.addCommand("mceInsertTemplate",c),e.addButton("template",{title:"Insert template",onclick:t(a)}),e.addMenuItem("template",{text:"Insert template",onclick:t(a),context:"insert"}),e.on("PreProcess",function(t){var a=e.dom;i(a.select("div",t.node),function(t){a.hasClass(t,"mceTmpl")&&(i(a.select("*",t),function(t){a.hasClass(t,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(t.innerHTML=n(e.getParam("template_mdate_format",e.getLang("template.mdate_format"))))}),l(t))})})}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/textcolor/plugin.min.js b/app/lib/tinymce/plugins/textcolor/plugin.min.js deleted file mode 100644 index e9513475..00000000 --- a/app/lib/tinymce/plugins/textcolor/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("textcolor",function(t){function e(e){var o;return t.dom.getParents(t.selection.getStart(),function(t){var r;(r=t.style["forecolor"==e?"color":"background-color"])&&(o=r)}),o}function o(){var e,o,r=[];for(o=t.settings.textcolor_map||["000000","Black","993300","Burnt orange","333300","Dark olive","003300","Dark green","003366","Dark azure","000080","Navy Blue","333399","Indigo","333333","Very dark gray","800000","Maroon","FF6600","Orange","808000","Olive","008000","Green","008080","Teal","0000FF","Blue","666699","Grayish blue","808080","Gray","FF0000","Red","FF9900","Amber","99CC00","Yellow green","339966","Sea green","33CCCC","Turquoise","3366FF","Royal blue","800080","Purple","999999","Medium gray","FF00FF","Magenta","FFCC00","Gold","FFFF00","Yellow","00FF00","Lime","00FFFF","Aqua","00CCFF","Sky blue","993366","Red violet","FFFFFF","White","FF99CC","Pink","FFCC99","Peach","FFFF99","Light yellow","CCFFCC","Pale green","CCFFFF","Pale cyan","99CCFF","Light sky blue","CC99FF","Plum"],e=0;e
'+(o?"×":"")+"
"}var r,l,a,n,c,d,u,g=this,m=g._id,F=0;for(r=o(),r.push({text:tinymce.translate("No color"),color:"transparent"}),a='',n=r.length-1,d=0;s>d;d++){for(a+="",c=0;i>c;c++)u=d*i+c,u>n?a+="":(l=r[u],a+=e(l.color,l.text));a+=""}if(t.settings.color_picker_callback){for(a+='",a+="",c=0;i>c;c++)a+=e("","Custom color");a+=""}return a+="
"}function l(e,o){t.focus(),t.formatter.apply(e,{value:o}),t.nodeChanged()}function a(e){t.focus(),t.formatter.remove(e,{value:null},null,!0),t.nodeChanged()}function n(o){function r(t){s.hidePanel(),s.color(t),l(s.settings.format,t)}function n(t,e){t.style.background=e,t.setAttribute("data-mce-color",e)}var c,s=this.parent();if(tinymce.DOM.getParent(o.target,".mce-custom-color-btn")&&(s.hidePanel(),t.settings.color_picker_callback.call(t,function(t){var e,o,l,a=s.panel.getEl().getElementsByTagName("table")[0];for(e=tinymce.map(a.rows[a.rows.length-1].childNodes,function(t){return t.firstChild}),l=0;ll;l++)n(e[l],e[l+1].getAttribute("data-mce-color"));n(o,t),r(t)},e(s.settings.format))),c=o.target.getAttribute("data-mce-color")){if(this.lastId&&document.getElementById(this.lastId).setAttribute("aria-selected",!1),o.target.setAttribute("aria-selected",!0),this.lastId=o.target.id,"transparent"==c)return a(s.settings.format),void s.hidePanel();r(c)}else null!==c&&s.hidePanel()}function c(){var t=this;t._color&&l(t.settings.format,t._color)}var i,s;s=t.settings.textcolor_rows||5,i=t.settings.textcolor_cols||8,t.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",format:"forecolor",panel:{role:"application",ariaRemember:!0,html:r,onclick:n},onclick:c}),t.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",format:"hilitecolor",panel:{role:"application",ariaRemember:!0,html:r,onclick:n},onclick:c})}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/textpattern/plugin.min.js b/app/lib/tinymce/plugins/textpattern/plugin.min.js deleted file mode 100644 index dca21362..00000000 --- a/app/lib/tinymce/plugins/textpattern/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("textpattern",function(t){function e(){return l&&(i.sort(function(t,e){return t.start.length>e.start.length?-1:t.start.length$1
'),c=e.dom.create("div",null,r);t=c.lastChild;)e.dom.insertAfter(t,s[i]);e.dom.remove(s[i])}else for(s=e.dom.select("span.mce-nbsp",l),i=s.length-1;i>=0;i--)e.dom.remove(s[i],1);m.moveToBookmark(d)}function t(){var a=this;e.on("VisualChars",function(e){a.active(e.state)})}var n,o=this;e.addCommand("mceVisualChars",a),e.addButton("visualchars",{title:"Show invisible characters",cmd:"mceVisualChars",onPostRender:t}),e.addMenuItem("visualchars",{text:"Show invisible characters",cmd:"mceVisualChars",onPostRender:t,selectable:!0,context:"view",prependToContext:!0}),e.on("beforegetcontent",function(e){n&&"raw"!=e.format&&!e.draft&&(n=!0,a(!1))})}); \ No newline at end of file diff --git a/app/lib/tinymce/plugins/wordcount/plugin.min.js b/app/lib/tinymce/plugins/wordcount/plugin.min.js deleted file mode 100644 index 1fd1518c..00000000 --- a/app/lib/tinymce/plugins/wordcount/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("wordcount",function(e){function t(){e.theme.panel.find("#wordcount").text(["Words: {0}",a.getCount()])}var n,o,a=this;n=e.getParam("wordcount_countregex",/[\w\u2019\x27\-\u00C0-\u1FFF]+/g),o=e.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\x27\x22_+=\\\/\-]*/g),e.on("init",function(){var n=e.theme.panel&&e.theme.panel.find("#statusbar")[0];n&&window.setTimeout(function(){n.insert({type:"label",name:"wordcount",text:["Words: {0}",a.getCount()],classes:"wordcount",disabled:e.settings.readonly},0),e.on("setcontent beforeaddundo",t),e.on("keyup",function(e){32==e.keyCode&&t()})},0)}),a.getCount=function(){var t=e.getContent({format:"raw"}),a=0;if(t){t=t.replace(/\.\.\./g," "),t=t.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," "),t=t.replace(/(\w+)(&#?[a-z0-9]+;)+(\w+)/i,"$1$3").replace(/&.+?;/g," "),t=t.replace(o,"");var r=t.match(n);r&&(a=r.length)}return a}}); \ No newline at end of file diff --git a/app/lib/tinymce/skins/lightgray/content.inline.min.css b/app/lib/tinymce/skins/lightgray/content.inline.min.css deleted file mode 100644 index 9f194f6a..00000000 --- a/app/lib/tinymce/skins/lightgray/content.inline.min.css +++ /dev/null @@ -1 +0,0 @@ -.mce-object{border:1px dotted #3A3A3A;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0px}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp{background:#AAA}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{border-bottom:2px solid #F00;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid #008000;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#3399ff !important}.mce-edit-focus{outline:1px dotted #333} \ No newline at end of file diff --git a/app/lib/tinymce/skins/lightgray/content.min.css b/app/lib/tinymce/skins/lightgray/content.min.css deleted file mode 100644 index ea08c689..00000000 --- a/app/lib/tinymce/skins/lightgray/content.min.css +++ /dev/null @@ -1 +0,0 @@ -body{background-color:#FFFFFF;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;scrollbar-3dlight-color:#F0F0EE;scrollbar-arrow-color:#676662;scrollbar-base-color:#F0F0EE;scrollbar-darkshadow-color:#DDDDDD;scrollbar-face-color:#E0E0DD;scrollbar-highlight-color:#F0F0EE;scrollbar-shadow-color:#F0F0EE;scrollbar-track-color:#F5F5F5}td,th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px}.mce-object{border:1px dotted #3A3A3A;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0px}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp{background:#AAA}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{border-bottom:2px solid #F00;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid #008000;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#3399ff !important}.mce-edit-focus{outline:1px dotted #333} \ No newline at end of file diff --git a/app/lib/tinymce/skins/lightgray/fonts/readme.md b/app/lib/tinymce/skins/lightgray/fonts/readme.md deleted file mode 100644 index fa5d6394..00000000 --- a/app/lib/tinymce/skins/lightgray/fonts/readme.md +++ /dev/null @@ -1 +0,0 @@ -Icons are generated and provided by the http://icomoon.io service. diff --git a/app/lib/tinymce/skins/lightgray/fonts/tinymce-small.dev.svg b/app/lib/tinymce/skins/lightgray/fonts/tinymce-small.dev.svg deleted file mode 100644 index 578b8695..00000000 --- a/app/lib/tinymce/skins/lightgray/fonts/tinymce-small.dev.svg +++ /dev/null @@ -1,175 +0,0 @@ - - - - -This is a custom SVG font generated by IcoMoon. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/lib/tinymce/skins/lightgray/fonts/tinymce-small.eot b/app/lib/tinymce/skins/lightgray/fonts/tinymce-small.eot deleted file mode 100644 index 60e2d2e5..00000000 Binary files a/app/lib/tinymce/skins/lightgray/fonts/tinymce-small.eot and /dev/null differ diff --git a/app/lib/tinymce/skins/lightgray/fonts/tinymce-small.svg b/app/lib/tinymce/skins/lightgray/fonts/tinymce-small.svg deleted file mode 100644 index 930c48dc..00000000 --- a/app/lib/tinymce/skins/lightgray/fonts/tinymce-small.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - -Generated by IcoMoon - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/lib/tinymce/skins/lightgray/fonts/tinymce-small.ttf b/app/lib/tinymce/skins/lightgray/fonts/tinymce-small.ttf deleted file mode 100644 index afc6ec45..00000000 Binary files a/app/lib/tinymce/skins/lightgray/fonts/tinymce-small.ttf and /dev/null differ diff --git a/app/lib/tinymce/skins/lightgray/fonts/tinymce-small.woff b/app/lib/tinymce/skins/lightgray/fonts/tinymce-small.woff deleted file mode 100644 index fa72c74b..00000000 Binary files a/app/lib/tinymce/skins/lightgray/fonts/tinymce-small.woff and /dev/null differ diff --git a/app/lib/tinymce/skins/lightgray/fonts/tinymce.dev.svg b/app/lib/tinymce/skins/lightgray/fonts/tinymce.dev.svg deleted file mode 100644 index c87b8cd1..00000000 --- a/app/lib/tinymce/skins/lightgray/fonts/tinymce.dev.svg +++ /dev/null @@ -1,153 +0,0 @@ - - - - -This is a custom SVG font generated by IcoMoon. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/lib/tinymce/skins/lightgray/fonts/tinymce.eot b/app/lib/tinymce/skins/lightgray/fonts/tinymce.eot deleted file mode 100644 index c1085bfd..00000000 Binary files a/app/lib/tinymce/skins/lightgray/fonts/tinymce.eot and /dev/null differ diff --git a/app/lib/tinymce/skins/lightgray/fonts/tinymce.svg b/app/lib/tinymce/skins/lightgray/fonts/tinymce.svg deleted file mode 100644 index feb9ba38..00000000 --- a/app/lib/tinymce/skins/lightgray/fonts/tinymce.svg +++ /dev/null @@ -1,63 +0,0 @@ - - - -Generated by IcoMoon - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/lib/tinymce/skins/lightgray/fonts/tinymce.ttf b/app/lib/tinymce/skins/lightgray/fonts/tinymce.ttf deleted file mode 100644 index 58103c2b..00000000 Binary files a/app/lib/tinymce/skins/lightgray/fonts/tinymce.ttf and /dev/null differ diff --git a/app/lib/tinymce/skins/lightgray/fonts/tinymce.woff b/app/lib/tinymce/skins/lightgray/fonts/tinymce.woff deleted file mode 100644 index ad1ae396..00000000 Binary files a/app/lib/tinymce/skins/lightgray/fonts/tinymce.woff and /dev/null differ diff --git a/app/lib/tinymce/skins/lightgray/img/anchor.gif b/app/lib/tinymce/skins/lightgray/img/anchor.gif deleted file mode 100644 index 606348c7..00000000 Binary files a/app/lib/tinymce/skins/lightgray/img/anchor.gif and /dev/null differ diff --git a/app/lib/tinymce/skins/lightgray/img/loader.gif b/app/lib/tinymce/skins/lightgray/img/loader.gif deleted file mode 100644 index c69e9372..00000000 Binary files a/app/lib/tinymce/skins/lightgray/img/loader.gif and /dev/null differ diff --git a/app/lib/tinymce/skins/lightgray/img/object.gif b/app/lib/tinymce/skins/lightgray/img/object.gif deleted file mode 100644 index cccd7f02..00000000 Binary files a/app/lib/tinymce/skins/lightgray/img/object.gif and /dev/null differ diff --git a/app/lib/tinymce/skins/lightgray/img/trans.gif b/app/lib/tinymce/skins/lightgray/img/trans.gif deleted file mode 100644 index 38848651..00000000 Binary files a/app/lib/tinymce/skins/lightgray/img/trans.gif and /dev/null differ diff --git a/app/lib/tinymce/skins/lightgray/skin.ie7.min.css b/app/lib/tinymce/skins/lightgray/skin.ie7.min.css deleted file mode 100644 index f2ca5b92..00000000 --- a/app/lib/tinymce/skins/lightgray/skin.ie7.min.css +++ /dev/null @@ -1 +0,0 @@ -.mce-container,.mce-container *,.mce-widget,.mce-widget *,.mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:#333;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;-webkit-tap-highlight-color:transparent;line-height:normal;font-weight:normal;text-align:left;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-widget button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.mce-container *[unselectable]{-moz-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}.mce-fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.mce-fade.mce-in{opacity:1}.mce-tinymce{visibility:inherit !important;position:relative}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;height:100%;z-index:100}div.mce-fullscreen{position:fixed;top:0;left:0;width:100%;height:auto}.mce-tinymce{display:block;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.mce-wordcount{position:absolute;top:0;right:0;padding:8px}div.mce-edit-area{background:#FFF;filter:none}.mce-statusbar{position:relative}.mce-statusbar .mce-container-body{position:relative}.mce-fullscreen .mce-resizehandle{display:none}.mce-charmap{border-collapse:collapse}.mce-charmap td{cursor:default;border:1px solid #9e9e9e;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:middle;padding:2px}.mce-charmap td div{text-align:center}.mce-charmap td:hover{background:#d9d9d9}.mce-grid td.mce-grid-cell div{border:1px solid #d6d6d6;width:15px;height:15px;margin:0px;cursor:pointer}.mce-grid td.mce-grid-cell div:focus{border-color:#a1a1a1}.mce-grid td.mce-grid-cell div[disabled]{cursor:not-allowed}.mce-grid{border-spacing:2px;border-collapse:separate}.mce-grid a{display:block;border:1px solid transparent}.mce-grid a:hover,.mce-grid a:focus{border-color:#a1a1a1}.mce-grid-border{margin:0 4px 0 4px}.mce-grid-border a{border-color:#d6d6d6;width:13px;height:13px}.mce-grid-border a:hover,.mce-grid-border a.mce-active{border-color:#a1a1a1;background:#c8def4}.mce-text-center{text-align:center}div.mce-tinymce-inline{width:100%;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-colorbtn-trans div{text-align:center;vertical-align:middle;font-weight:bold;font-size:20px;line-height:16px;color:#707070}.mce-toolbar-grp{padding-bottom:2px}.mce-toolbar-grp .mce-flow-layout-item{margin-bottom:0}.mce-rtl .mce-wordcount{left:0;right:auto}.mce-container,.mce-container-body{display:block}.mce-autoscroll{overflow:hidden}.mce-scrollbar{position:absolute;width:7px;height:100%;top:2px;right:2px;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-scrollbar-h{top:auto;right:auto;left:2px;bottom:2px;width:100%;height:7px}.mce-scrollbar-thumb{position:absolute;background-color:#000;border:1px solid #888;border-color:rgba(85,85,85,0.6);width:5px;height:100%;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scrollbar-h .mce-scrollbar-thumb{width:100%;height:5px}.mce-scrollbar:hover,.mce-scrollbar.mce-active{background-color:#AAA;opacity:.6;filter:alpha(opacity=60);zoom:1;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scroll{position:relative}.mce-panel{border:0 solid #9e9e9e;background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fdfdfd, #ddd);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fdfdfd), to(#ddd));background-image:-webkit-linear-gradient(top, #fdfdfd, #ddd);background-image:-o-linear-gradient(top, #fdfdfd, #ddd);background-image:linear-gradient(to bottom, #fdfdfd, #ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd', endColorstr='#ffdddddd', GradientType=0);zoom:1}.mce-floatpanel{position:absolute;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2)}.mce-floatpanel.mce-fixed{position:fixed}.mce-floatpanel .mce-arrow,.mce-floatpanel .mce-arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.mce-floatpanel .mce-arrow{border-width:11px}.mce-floatpanel .mce-arrow:after{border-width:10px;content:""}.mce-floatpanel.mce-popover{filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);top:0;left:0;background:#fff;border:1px solid #9e9e9e;border:1px solid rgba(0,0,0,0.25)}.mce-floatpanel.mce-popover.mce-bottom{margin-top:10px;*margin-top:0}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#9e9e9e;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow:after{top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.mce-floatpanel.mce-popover.mce-bottom.mce-start{margin-left:-22px}.mce-floatpanel.mce-popover.mce-bottom.mce-start>.mce-arrow{left:20px}.mce-floatpanel.mce-popover.mce-bottom.mce-end{margin-left:22px}.mce-floatpanel.mce-popover.mce-bottom.mce-end>.mce-arrow{right:10px;left:auto}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;background:#fff;height:100%}div.mce-fullscreen{position:fixed;top:0;left:0}#mce-modal-block{opacity:0;filter:alpha(opacity=0);zoom:1;position:fixed;left:0;top:0;width:100%;height:100%;background:#000}#mce-modal-block.mce-in{opacity:.3;filter:alpha(opacity=30);zoom:1}.mce-window-move{cursor:move}.mce-window{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;background:#fff;position:fixed;top:0;left:0;opacity:0;-webkit-transition:opacity 150ms ease-in;transition:opacity 150ms ease-in}.mce-window.mce-in{opacity:1}.mce-window-head{padding:9px 15px;border-bottom:1px solid #c5c5c5;position:relative}.mce-window-head .mce-close{position:absolute;right:15px;top:9px;font-size:20px;font-weight:bold;line-height:20px;color:#858585;cursor:pointer;height:20px;overflow:hidden}.mce-close:hover{color:#adadad}.mce-window-head .mce-title{line-height:20px;font-size:20px;font-weight:bold;text-rendering:optimizelegibility;padding-right:10px}.mce-window .mce-container-body{display:block}.mce-foot{display:block;background-color:#fff;border-top:1px solid #c5c5c5;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.mce-window-head .mce-dragh{position:absolute;top:0;left:0;cursor:move;width:90%;height:100%}.mce-window iframe{width:100%;height:100%}.mce-window.mce-fullscreen,.mce-window.mce-fullscreen .mce-foot{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-rtl .mce-window-head .mce-close{position:absolute;right:auto;left:15px}.mce-rtl .mce-window-head .mce-dragh{left:auto;right:0}.mce-rtl .mce-window-head .mce-title{direction:rtl;text-align:right}.mce-abs-layout{position:relative}body .mce-abs-layout-item,.mce-abs-end{position:absolute}.mce-abs-end{width:1px;height:1px}.mce-container-body.mce-abs-layout{overflow:hidden}.mce-tooltip{position:absolute;padding:5px;opacity:.8;filter:alpha(opacity=80);zoom:1}.mce-tooltip-inner{font-size:11px;background-color:#000;color:#fff;max-width:200px;padding:5px 8px 4px 8px;text-align:center;white-space:normal}.mce-tooltip-inner{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-tooltip-inner{-webkit-box-shadow:0 0 5px #000000;-moz-box-shadow:0 0 5px #000000;box-shadow:0 0 5px #000000}.mce-tooltip-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.mce-tooltip-arrow-n{border-bottom-color:#000}.mce-tooltip-arrow-s{border-top-color:#000}.mce-tooltip-arrow-e{border-left-color:#000}.mce-tooltip-arrow-w{border-right-color:#000}.mce-tooltip-nw,.mce-tooltip-sw{margin-left:-14px}.mce-tooltip-n .mce-tooltip-arrow{top:0px;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-s .mce-tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-e .mce-tooltip-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:none;border-top-color:transparent;border-bottom-color:transparent}.mce-tooltip-w .mce-tooltip-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:none;border-top-color:transparent;border-bottom-color:transparent}.mce-btn{border:1px solid #b1b1b1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25) rgba(0,0,0,0.25);position:relative;text-shadow:0 1px 1px rgba(255,255,255,0.75);display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fff, #d9d9d9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#d9d9d9));background-image:-webkit-linear-gradient(top, #fff, #d9d9d9);background-image:-o-linear-gradient(top, #fff, #d9d9d9);background-image:linear-gradient(to bottom, #fff, #d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffd9d9d9', GradientType=0);zoom:1}.mce-btn:hover,.mce-btn:focus{color:#333;background-color:#e3e3e3;background-image:-moz-linear-gradient(top, #f2f2f2, #ccc);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#ccc));background-image:-webkit-linear-gradient(top, #f2f2f2, #ccc);background-image:-o-linear-gradient(top, #f2f2f2, #ccc);background-image:linear-gradient(to bottom, #f2f2f2, #ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffcccccc', GradientType=0);zoom:1}.mce-btn.mce-disabled button,.mce-btn.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover{background-color:#d6d6d6;background-image:-moz-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#c0c0c0));background-image:-webkit-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-o-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:linear-gradient(to bottom, #e6e6e6, #c0c0c0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-btn:active{background-color:#d6d6d6;background-image:-moz-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#c0c0c0));background-image:-webkit-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-o-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:linear-gradient(to bottom, #e6e6e6, #c0c0c0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-btn button{padding:4px 10px;font-size:14px;line-height:20px;*line-height:16px;cursor:pointer;color:#333;text-align:center;overflow:visible;-webkit-appearance:none}.mce-btn button::-moz-focus-inner{border:0;padding:0}.mce-btn i{text-shadow:1px 1px #fff}.mce-primary{min-width:50px;color:#fff;border:1px solid #b1b1b1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25) rgba(0,0,0,0.25);background-color:#006dcc;background-image:-moz-linear-gradient(top, #08c, #04c);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#04c));background-image:-webkit-linear-gradient(top, #08c, #04c);background-image:-o-linear-gradient(top, #08c, #04c);background-image:linear-gradient(to bottom, #08c, #04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);zoom:1}.mce-primary:hover,.mce-primary:focus{background-color:#005fb3;background-image:-moz-linear-gradient(top, #0077b3, #003cb3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0077b3), to(#003cb3));background-image:-webkit-linear-gradient(top, #0077b3, #003cb3);background-image:-o-linear-gradient(top, #0077b3, #003cb3);background-image:linear-gradient(to bottom, #0077b3, #003cb3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0077b3', endColorstr='#ff003cb3', GradientType=0);zoom:1}.mce-primary.mce-disabled button,.mce-primary.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-primary.mce-active,.mce-primary.mce-active:hover,.mce-primary:not(.mce-disabled):active{background-color:#005299;background-image:-moz-linear-gradient(top, #069, #039);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#069), to(#039));background-image:-webkit-linear-gradient(top, #069, #039);background-image:-o-linear-gradient(top, #069, #039);background-image:linear-gradient(to bottom, #069, #039);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff006699', endColorstr='#ff003399', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-primary button,.mce-primary button i{color:#fff;text-shadow:1px 1px #333}.mce-btn-large button{padding:9px 14px;font-size:16px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.mce-btn-large i{margin-top:2px}.mce-btn-small button{padding:1px 5px;font-size:12px;*padding-bottom:2px}.mce-btn-small i{line-height:20px;vertical-align:top;*line-height:18px}.mce-btn .mce-caret{margin-top:8px;margin-left:0}.mce-btn-small .mce-caret{margin-top:8px;margin-left:0}.mce-caret{display:inline-block;*display:inline;*zoom:1;width:0;height:0;vertical-align:top;border-top:4px solid #333;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#aaa}.mce-caret.mce-up{border-bottom:4px solid #333;border-top:0}.mce-btn-flat{border:0;background:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:none}.mce-btn-flat:hover,.mce-btn-flat.mce-active,.mce-btn-flat:focus,.mce-btn-flat:active{border:0;background:#e6e6e6;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-rtl .mce-btn button{direction:rtl}.mce-btn-group .mce-btn{border-width:1px 0 1px 0;margin:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-btn-group .mce-first{border-left:1px solid #b1b1b1;border-left:1px solid rgba(0,0,0,0.25);-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.mce-btn-group .mce-last{border-right:1px solid #b1b1b1;border-right:1px solid rgba(0,0,0,0.1);-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.mce-btn-group .mce-first.mce-last{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-btn-group .mce-btn.mce-flow-layout-item{margin:0}.mce-checkbox{cursor:pointer}i.mce-i-checkbox{margin:0 3px 0 0;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fff, #d9d9d9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#d9d9d9));background-image:-webkit-linear-gradient(top, #fff, #d9d9d9);background-image:-o-linear-gradient(top, #fff, #d9d9d9);background-image:linear-gradient(to bottom, #fff, #d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffd9d9d9', GradientType=0);zoom:1;text-indent:-10em;*font-size:0;*line-height:0;*text-indent:0;overflow:hidden}.mce-checked i.mce-i-checkbox{color:#333;font-size:16px;line-height:16px;text-indent:0}.mce-checkbox:focus i.mce-i-checkbox,.mce-checkbox.mce-focus i.mce-i-checkbox{border:1px solid rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65)}.mce-checkbox.mce-disabled .mce-label,.mce-checkbox.mce-disabled i.mce-i-checkbox{color:#acacac}.mce-rtl .mce-checkbox{direction:rtl;text-align:right}.mce-rtl i.mce-i-checkbox{margin:0 0 0 3px}.mce-combobox{display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);*height:32px}.mce-combobox input{border:1px solid #c5c5c5;border-right-color:#c5c5c5;height:28px}.mce-combobox.mce-disabled input{color:#adadad}.mce-combobox.mce-has-open input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.mce-combobox .mce-btn{border-left:0;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.mce-combobox button{padding-right:8px;padding-left:8px}.mce-combobox.mce-disabled .mce-btn button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-colorbox i{border:1px solid #c5c5c5;width:14px;height:14px}.mce-colorbutton .mce-ico{position:relative}.mce-colorbutton-grid{margin:4px}.mce-colorbutton button{padding-right:4px}.mce-colorbutton .mce-preview{padding-right:3px;display:block;position:absolute;left:50%;top:50%;margin-left:-14px;margin-top:7px;background:gray;width:13px;height:2px;overflow:hidden}.mce-colorbutton.mce-btn-small .mce-preview{margin-left:-16px;padding-right:0;width:16px}.mce-colorbutton .mce-open{padding-left:4px;border-left:1px solid transparent;border-right:1px solid transparent}.mce-colorbutton:hover .mce-open{border-left-color:#bdbdbd;border-right-color:#bdbdbd}.mce-colorbutton.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-colorbutton{direction:rtl}.mce-rtl .mce-colorbutton .mce-preview{margin-left:0;padding-right:0;padding-left:4px;margin-right:-14px}.mce-rtl .mce-colorbutton.mce-btn-small .mce-preview{margin-left:0;padding-right:0;margin-right:-17px;padding-left:0}.mce-rtl .mce-colorbutton button{padding-right:10px;padding-left:10px}.mce-rtl .mce-colorbutton .mce-open{padding-left:4px;padding-right:4px}.mce-colorpicker{position:relative;width:250px;height:220px}.mce-colorpicker-sv{position:absolute;top:0;left:0;width:90%;height:100%;border:1px solid #c5c5c5;cursor:crosshair;overflow:hidden}.mce-colorpicker-h-chunk{width:100%}.mce-colorpicker-overlay1,.mce-colorpicker-overlay2{width:100%;height:100%;position:absolute;top:0;left:0}.mce-colorpicker-overlay1{filter:progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr='#ffffff', endColorstr='#00ffffff');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff')";background:linear-gradient(to right, #fff, rgba(255,255,255,0))}.mce-colorpicker-overlay2{filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#00000000', endColorstr='#000000');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000')";background:linear-gradient(to bottom, rgba(0,0,0,0), #000)}.mce-colorpicker-selector1{background:none;position:absolute;width:12px;height:12px;margin:-8px 0 0 -8px;border:1px solid black;border-radius:50%}.mce-colorpicker-selector2{position:absolute;width:10px;height:10px;border:1px solid white;border-radius:50%}.mce-colorpicker-h{position:absolute;top:0;right:0;width:6.5%;height:100%;border:1px solid #c5c5c5;cursor:crosshair}.mce-colorpicker-h-marker{margin-top:-4px;position:absolute;top:0;left:-1px;width:100%;border:1px solid #333;background:#fff;height:4px;z-index:100}.mce-path{display:inline-block;*display:inline;*zoom:1;padding:8px;white-space:normal}.mce-path .mce-txt{display:inline-block;padding-right:3px}.mce-path .mce-path-body{display:inline-block}.mce-path-item{display:inline-block;*display:inline;*zoom:1;cursor:pointer;color:#333}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:#666;color:#fff}.mce-path .mce-divider{display:inline}.mce-disabled .mce-path-item{color:#aaa}.mce-rtl .mce-path{direction:rtl}.mce-fieldset{border:0 solid #9E9E9E;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-fieldset>.mce-container-body{margin-top:-15px}.mce-fieldset-title{margin-left:5px;padding:0 5px 0 5px}.mce-fit-layout{display:inline-block;*display:inline;*zoom:1}.mce-fit-layout-item{position:absolute}.mce-flow-layout-item{display:inline-block;*display:inline;*zoom:1}.mce-flow-layout-item{margin:2px 0 2px 2px}.mce-flow-layout-item.mce-last{margin-right:2px}.mce-flow-layout{white-space:normal}.mce-tinymce-inline .mce-flow-layout{white-space:nowrap}.mce-rtl .mce-flow-layout{text-align:right;direction:rtl}.mce-rtl .mce-flow-layout-item{margin:2px 2px 2px 0}.mce-rtl .mce-flow-layout-item.mce-last{margin-left:2px}.mce-iframe{border:0 solid #9e9e9e;width:100%;height:100%}.mce-label{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label.mce-disabled{color:#aaa}.mce-label.mce-multiline{white-space:pre-wrap}.mce-label.mce-error{color:#a00}.mce-rtl .mce-label{text-align:right;direction:rtl}.mce-menubar .mce-menubtn{border-color:transparent;background:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:none}.mce-menubar{border:1px solid #c4c4c4}.mce-menubar .mce-menubtn button span{color:#333}.mce-menubar .mce-caret{border-top-color:#333}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus{border-color:transparent;background:#e6e6e6;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-menubtn span{color:#333;margin-right:2px;line-height:20px;*line-height:16px}.mce-menubtn.mce-btn-small span{font-size:12px}.mce-menubtn.mce-fixed-width span{display:inline-block;overflow-x:hidden;text-overflow:ellipsis;width:90px}.mce-menubtn.mce-fixed-width.mce-btn-small span{width:70px}.mce-menubtn .mce-caret{*margin-top:6px}.mce-rtl .mce-menubtn button{direction:rtl;text-align:right}.mce-listbox button{text-align:left;padding-right:20px;position:relative}.mce-listbox .mce-caret{position:absolute;margin-top:-2px;right:8px;top:50%}.mce-rtl .mce-listbox .mce-caret{right:auto;left:8px}.mce-rtl .mce-listbox button{padding-right:10px;padding-left:20px}.mce-menu-item{display:block;padding:6px 15px 6px 12px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap;cursor:pointer;line-height:normal;border-left:4px solid transparent;margin-bottom:1px}.mce-menu-item .mce-ico,.mce-menu-item .mce-text{color:#333}.mce-menu-item.mce-disabled .mce-text,.mce-menu-item.mce-disabled .mce-ico{color:#adadad}.mce-menu-item:hover .mce-text,.mce-menu-item.mce-selected .mce-text,.mce-menu-item:focus .mce-text{color:#fff}.mce-menu-item:hover .mce-ico,.mce-menu-item.mce-selected .mce-ico,.mce-menu-item:focus .mce-ico{color:#fff}.mce-menu-item.mce-disabled:hover{background:#ccc}.mce-menu-shortcut{display:inline-block;color:#adadad}.mce-menu-shortcut{display:inline-block;*display:inline;*zoom:1;padding:0 15px 0 20px}.mce-menu-item:hover .mce-menu-shortcut,.mce-menu-item.mce-selected .mce-menu-shortcut,.mce-menu-item:focus .mce-menu-shortcut{color:#fff}.mce-menu-item .mce-caret{margin-top:4px;*margin-top:3px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #333}.mce-menu-item.mce-selected .mce-caret,.mce-menu-item:focus .mce-caret,.mce-menu-item:hover .mce-caret{border-left-color:#fff}.mce-menu-align .mce-menu-shortcut{*margin-top:-2px}.mce-menu-align .mce-menu-shortcut,.mce-menu-align .mce-caret{position:absolute;right:0}.mce-menu-item.mce-active i{visibility:visible}.mce-menu-item-normal.mce-active{background-color:#c8def4}.mce-menu-item-preview.mce-active{border-left:5px solid #aaa}.mce-menu-item-normal.mce-active .mce-text{color:#333}.mce-menu-item-normal.mce-active:hover .mce-text,.mce-menu-item-normal.mce-active:hover .mce-ico{color:#fff}.mce-menu-item-normal.mce-active:focus .mce-text,.mce-menu-item-normal.mce-active:focus .mce-ico{color:#fff}.mce-menu-item:hover,.mce-menu-item.mce-selected,.mce-menu-item:focus{text-decoration:none;color:#fff;background-color:#0081c2;background-image:-moz-linear-gradient(top, #08c, #0077b3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#0077b3));background-image:-webkit-linear-gradient(top, #08c, #0077b3);background-image:-o-linear-gradient(top, #08c, #0077b3);background-image:linear-gradient(to bottom, #08c, #0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);zoom:1}div.mce-menu .mce-menu-item-sep,.mce-menu-item-sep:hover{border:0;padding:0;height:1px;margin:9px 1px;overflow:hidden;background:#cbcbcb;border-bottom:1px solid #fff;cursor:default;filter:none}.mce-menu.mce-rtl{direction:rtl}.mce-rtl .mce-menu-item{text-align:right;direction:rtl;padding:6px 12px 6px 15px}.mce-menu-align.mce-rtl .mce-menu-shortcut,.mce-menu-align.mce-rtl .mce-caret{right:auto;left:0}.mce-rtl .mce-menu-item .mce-caret{margin-left:6px;margin-right:0;border-right:4px solid #333;border-left:0}.mce-rtl .mce-menu-item.mce-selected .mce-caret,.mce-rtl .mce-menu-item:focus .mce-caret,.mce-rtl .mce-menu-item:hover .mce-caret{border-left-color:transparent;border-right-color:#fff}.mce-menu{position:absolute;left:0;top:0;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;z-index:1000;padding:5px 0 5px 0;margin:2px 0 0;min-width:160px;background:#fff;border:1px solid #989898;border:1px solid rgba(0,0,0,0.2);z-index:1002;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);max-height:400px;overflow:auto;overflow-x:hidden}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block;*display:inline}.mce-menu-sub-tr-tl{margin:-6px 0 0 -1px}.mce-menu-sub-br-bl{margin:6px 0 0 -1px}.mce-menu-sub-tl-tr{margin:-6px 0 0 1px}.mce-menu-sub-bl-br{margin:6px 0 0 1px}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-container-body .mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#333}.mce-spacer{visibility:hidden}.mce-splitbtn .mce-open{border-left:1px solid transparent;border-right:1px solid transparent}.mce-splitbtn:hover .mce-open{border-left-color:#bdbdbd;border-right-color:#bdbdbd}.mce-splitbtn button{padding-right:4px}.mce-splitbtn .mce-open{padding-left:4px}.mce-splitbtn .mce-open.mce-active{-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-splitbtn.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-splitbtn{direction:rtl;text-align:right}.mce-rtl .mce-splitbtn button{padding-right:10px;padding-left:10px}.mce-rtl .mce-splitbtn .mce-open{padding-left:4px;padding-right:4px}.mce-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #c5c5c5}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #c5c5c5;border-width:0 1px 0 0;background:#e3e3e3;padding:8px;text-shadow:0 1px 1px rgba(255,255,255,0.75);height:13px;cursor:pointer}.mce-tab:hover{background:#fdfdfd}.mce-tab.mce-active{background:#fdfdfd;border-bottom-color:transparent;margin-bottom:-1px;height:14px}.mce-rtl .mce-tabs{text-align:right;direction:rtl}.mce-rtl .mce-tab{border-width:0 0 0 1px}.mce-textbox{background:#fff;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);display:inline-block;-webkit-transition:border linear .2s, box-shadow linear .2s;transition:border linear .2s, box-shadow linear .2s;height:28px;resize:none;padding:0 4px 0 4px;white-space:pre-wrap;*white-space:pre;color:#333}.mce-textbox:focus,.mce-textbox.mce-focus{border-color:rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65)}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px}.mce-textbox.mce-disabled{color:#adadad}.mce-rtl .mce-textbox{text-align:right;direction:rtl}.mce-throbber{position:absolute;top:0;left:0;width:100%;height:100%;opacity:.6;filter:alpha(opacity=60);zoom:1;background:#fff url('img/loader.gif') no-repeat center center}.mce-throbber-inline{position:static;height:50px}@font-face{font-family:'tinymce';src:url('fonts/tinymce.eot');src:url('fonts/tinymce.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce.woff') format('woff'),url('fonts/tinymce.ttf') format('truetype'),url('fonts/tinymce.svg#tinymce') format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'tinymce-small';src:url('fonts/tinymce-small.eot');src:url('fonts/tinymce-small.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce-small.woff') format('woff'),url('fonts/tinymce-small.ttf') format('truetype'),url('fonts/tinymce-small.svg#tinymce') format('svg');font-weight:normal;font-style:normal}.mce-ico{font-family:'tinymce';font-style:normal;font-weight:normal;font-size:16px;line-height:16px;vertical-align:text-top;-webkit-font-smoothing:antialiased;display:inline-block;background:transparent center center;width:16px;height:16px;color:#333;-ie7-icon:' '}.mce-btn-small .mce-ico{font-family:'tinymce-small'}.mce-ico,i.mce-i-checkbox{zoom:expression(this.runtimeStyle['zoom'] = '1', this.innerHTML = this.currentStyle['-ie7-icon'].substr(1, 1) + ' ')}.mce-i-save{-ie7-icon:"\e000"}.mce-i-newdocument{-ie7-icon:"\e001"}.mce-i-fullpage{-ie7-icon:"\e002"}.mce-i-alignleft{-ie7-icon:"\e003"}.mce-i-aligncenter{-ie7-icon:"\e004"}.mce-i-alignright{-ie7-icon:"\e005"}.mce-i-alignjustify{-ie7-icon:"\e006"}.mce-i-cut{-ie7-icon:"\e007"}.mce-i-paste{-ie7-icon:"\e008"}.mce-i-searchreplace{-ie7-icon:"\e009"}.mce-i-bullist{-ie7-icon:"\e00a"}.mce-i-numlist{-ie7-icon:"\e00b"}.mce-i-indent{-ie7-icon:"\e00c"}.mce-i-outdent{-ie7-icon:"\e00d"}.mce-i-blockquote{-ie7-icon:"\e00e"}.mce-i-undo{-ie7-icon:"\e00f"}.mce-i-redo{-ie7-icon:"\e010"}.mce-i-link{-ie7-icon:"\e011"}.mce-i-unlink{-ie7-icon:"\e012"}.mce-i-anchor{-ie7-icon:"\e013"}.mce-i-image{-ie7-icon:"\e014"}.mce-i-media{-ie7-icon:"\e015"}.mce-i-help{-ie7-icon:"\e016"}.mce-i-code{-ie7-icon:"\e017"}.mce-i-insertdatetime{-ie7-icon:"\e018"}.mce-i-preview{-ie7-icon:"\e019"}.mce-i-forecolor{-ie7-icon:"\e01a"}.mce-i-backcolor{-ie7-icon:"\e01a"}.mce-i-table{-ie7-icon:"\e01b"}.mce-i-hr{-ie7-icon:"\e01c"}.mce-i-removeformat{-ie7-icon:"\e01d"}.mce-i-subscript{-ie7-icon:"\e01e"}.mce-i-superscript{-ie7-icon:"\e01f"}.mce-i-charmap{-ie7-icon:"\e020"}.mce-i-emoticons{-ie7-icon:"\e021"}.mce-i-print{-ie7-icon:"\e022"}.mce-i-fullscreen{-ie7-icon:"\e023"}.mce-i-spellchecker{-ie7-icon:"\e024"}.mce-i-nonbreaking{-ie7-icon:"\e025"}.mce-i-template{-ie7-icon:"\e026"}.mce-i-pagebreak{-ie7-icon:"\e027"}.mce-i-restoredraft{-ie7-icon:"\e028"}.mce-i-untitled{-ie7-icon:"\e029"}.mce-i-bold{-ie7-icon:"\e02a"}.mce-i-italic{-ie7-icon:"\e02b"}.mce-i-underline{-ie7-icon:"\e02c"}.mce-i-strikethrough{-ie7-icon:"\e02d"}.mce-i-visualchars{-ie7-icon:"\e02e"}.mce-i-ltr{-ie7-icon:"\e02f"}.mce-i-rtl{-ie7-icon:"\e030"}.mce-i-copy{-ie7-icon:"\e031"}.mce-i-resize{-ie7-icon:"\e032"}.mce-i-browse{-ie7-icon:"\e034"}.mce-i-pastetext{-ie7-icon:"\e035"}.mce-i-checkbox,.mce-i-selected{-ie7-icon:"\e033"}.mce-i-selected{visibility:hidden}.mce-i-backcolor{background:#BBB} \ No newline at end of file diff --git a/app/lib/tinymce/skins/lightgray/skin.min.css b/app/lib/tinymce/skins/lightgray/skin.min.css deleted file mode 100644 index b67b4a1e..00000000 --- a/app/lib/tinymce/skins/lightgray/skin.min.css +++ /dev/null @@ -1,2061 +0,0 @@ -.mce-container, .mce-container *, .mce-widget, .mce-widget *, .mce-reset { - margin: 0; - padding: 0; - border: 0; - outline: 0; - vertical-align: top; - background: transparent; - text-decoration: none; - color: #333; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 14px; - text-shadow: none; - float: none; - position: static; - width: auto; - height: auto; - white-space: nowrap; - cursor: inherit; - -webkit-tap-highlight-color: transparent; - line-height: normal; - font-weight: normal; - text-align: left; - -moz-box-sizing: content-box; - -webkit-box-sizing: content-box; - box-sizing: content-box; - direction: ltr; - max-width: none -} - -.mce-widget button { - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box -} - -.mce-container *[unselectable] { - -moz-user-select: none; - -webkit-user-select: none; - -o-user-select: none; - user-select: none -} - -.mce-fade { - opacity: 0; - -webkit-transition: opacity .15s linear; - transition: opacity .15s linear -} - -.mce-fade.mce-in { - opacity: 1 -} - -.mce-tinymce { - visibility: inherit !important; - position: relative -} - -.mce-fullscreen { - border: 0; - padding: 0; - margin: 0; - overflow: hidden; - height: 100%; - z-index: 100 -} - -div.mce-fullscreen { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: auto -} - -.mce-tinymce { - display: block; - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - border-radius: 2px -} - -.mce-wordcount { - position: absolute; - top: 0; - right: 0; - padding: 8px -} - -div.mce-edit-area { - background: #FFF; - filter: none -} - -.mce-statusbar { - position: relative -} - -.mce-statusbar .mce-container-body { - position: relative -} - -.mce-fullscreen .mce-resizehandle { - display: none -} - -.mce-charmap { - border-collapse: collapse -} - -.mce-charmap td { - cursor: default; - border: 1px solid #9e9e9e; - width: 20px; - height: 20px; - line-height: 20px; - text-align: center; - vertical-align: middle; - padding: 2px -} - -.mce-charmap td div { - text-align: center -} - -.mce-charmap td:hover { - background: #d9d9d9 -} - -.mce-grid td.mce-grid-cell div { - border: 1px solid #d6d6d6; - width: 15px; - height: 15px; - margin: 0px; - cursor: pointer -} - -.mce-grid td.mce-grid-cell div:focus { - border-color: #a1a1a1 -} - -.mce-grid td.mce-grid-cell div[disabled] { - cursor: not-allowed -} - -.mce-grid { - border-spacing: 2px; - border-collapse: separate -} - -.mce-grid a { - display: block; - border: 1px solid transparent -} - -.mce-grid a:hover, .mce-grid a:focus { - border-color: #a1a1a1 -} - -.mce-grid-border { - margin: 0 4px 0 4px -} - -.mce-grid-border a { - border-color: #d6d6d6; - width: 13px; - height: 13px -} - -.mce-grid-border a:hover, .mce-grid-border a.mce-active { - border-color: #a1a1a1; - background: #c8def4 -} - -.mce-text-center { - text-align: center -} - -div.mce-tinymce-inline { - width: 100%; - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none -} - -.mce-colorbtn-trans div { - text-align: center; - vertical-align: middle; - font-weight: bold; - font-size: 20px; - line-height: 16px; - color: #707070 -} - -.mce-toolbar-grp { - padding-bottom: 2px -} - -.mce-toolbar-grp .mce-flow-layout-item { - margin-bottom: 0 -} - -.mce-rtl .mce-wordcount { - left: 0; - right: auto -} - -.mce-container, .mce-container-body { - display: block -} - -.mce-autoscroll { - overflow: hidden -} - -.mce-scrollbar { - position: absolute; - width: 7px; - height: 100%; - top: 2px; - right: 2px; - opacity: .4; - filter: alpha(opacity=40); - zoom: 1 -} - -.mce-scrollbar-h { - top: auto; - right: auto; - left: 2px; - bottom: 2px; - width: 100%; - height: 7px -} - -.mce-scrollbar-thumb { - position: absolute; - background-color: #000; - border: 1px solid #888; - border-color: rgba(85, 85, 85, 0.6); - width: 5px; - height: 100%; - -webkit-border-radius: 7px; - -moz-border-radius: 7px; - border-radius: 7px -} - -.mce-scrollbar-h .mce-scrollbar-thumb { - width: 100%; - height: 5px -} - -.mce-scrollbar:hover, .mce-scrollbar.mce-active { - background-color: #AAA; - opacity: .6; - filter: alpha(opacity=60); - zoom: 1; - -webkit-border-radius: 7px; - -moz-border-radius: 7px; - border-radius: 7px -} - -.mce-scroll { - position: relative -} - -.mce-panel { - border: 0 solid #9e9e9e; - background-color: #f0f0f0; - background-image: -moz-linear-gradient(top, #fdfdfd, #ddd); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fdfdfd), to(#ddd)); - background-image: -webkit-linear-gradient(top, #fdfdfd, #ddd); - background-image: -o-linear-gradient(top, #fdfdfd, #ddd); - background-image: linear-gradient(to bottom, #fdfdfd, #ddd); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd', endColorstr='#ffdddddd', GradientType=0); - zoom: 1 -} - -.mce-floatpanel { - position: absolute; - -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2) -} - -.mce-floatpanel.mce-fixed { - position: fixed -} - -.mce-floatpanel .mce-arrow, .mce-floatpanel .mce-arrow:after { - position: absolute; - display: block; - width: 0; - height: 0; - border-color: transparent; - border-style: solid -} - -.mce-floatpanel .mce-arrow { - border-width: 11px -} - -.mce-floatpanel .mce-arrow:after { - border-width: 10px; - content: "" -} - -.mce-floatpanel.mce-popover { - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); - background: transparent; - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; - -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - top: 0; - left: 0; - background: #fff; - border: 1px solid #9e9e9e; - border: 1px solid rgba(0, 0, 0, 0.25) -} - -.mce-floatpanel.mce-popover.mce-bottom { - margin-top: 10px; - *margin-top: 0 -} - -.mce-floatpanel.mce-popover.mce-bottom > .mce-arrow { - left: 50%; - margin-left: -11px; - border-top-width: 0; - border-bottom-color: #9e9e9e; - border-bottom-color: rgba(0, 0, 0, 0.25); - top: -11px -} - -.mce-floatpanel.mce-popover.mce-bottom > .mce-arrow:after { - top: 1px; - margin-left: -10px; - border-top-width: 0; - border-bottom-color: #fff -} - -.mce-floatpanel.mce-popover.mce-bottom.mce-start { - margin-left: -22px -} - -.mce-floatpanel.mce-popover.mce-bottom.mce-start > .mce-arrow { - left: 20px -} - -.mce-floatpanel.mce-popover.mce-bottom.mce-end { - margin-left: 22px -} - -.mce-floatpanel.mce-popover.mce-bottom.mce-end > .mce-arrow { - right: 10px; - left: auto -} - -.mce-fullscreen { - border: 0; - padding: 0; - margin: 0; - overflow: hidden; - background: #fff; - height: 100% -} - -div.mce-fullscreen { - position: fixed; - top: 0; - left: 0 -} - -#mce-modal-block { - opacity: 0; - filter: alpha(opacity=0); - zoom: 1; - position: fixed; - left: 0; - top: 0; - width: 100%; - height: 100%; - background: #000 -} - -#mce-modal-block.mce-in { - opacity: .3; - filter: alpha(opacity=30); - zoom: 1 -} - -.mce-window-move { - cursor: move -} - -.mce-window { - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; - -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); - -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); - box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); - background: transparent; - background: #fff; - position: fixed; - top: 0; - left: 0; - opacity: 0; - -webkit-transition: opacity 150ms ease-in; - transition: opacity 150ms ease-in -} - -.mce-window.mce-in { - opacity: 1 -} - -.mce-window-head { - padding: 9px 15px; - border-bottom: 1px solid #c5c5c5; - position: relative -} - -.mce-window-head .mce-close { - position: absolute; - right: 15px; - top: 9px; - font-size: 20px; - font-weight: bold; - line-height: 20px; - color: #858585; - cursor: pointer; - height: 20px; - overflow: hidden -} - -.mce-close:hover { - color: #adadad -} - -.mce-window-head .mce-title { - line-height: 20px; - font-size: 20px; - font-weight: bold; - text-rendering: optimizelegibility; - padding-right: 10px -} - -.mce-window .mce-container-body { - display: block -} - -.mce-foot { - display: block; - background-color: #fff; - border-top: 1px solid #c5c5c5; - -webkit-border-radius: 0 0 6px 6px; - -moz-border-radius: 0 0 6px 6px; - border-radius: 0 0 6px 6px -} - -.mce-window-head .mce-dragh { - position: absolute; - top: 0; - left: 0; - cursor: move; - width: 90%; - height: 100% -} - -.mce-window iframe { - width: 100%; - height: 100% -} - -.mce-window.mce-fullscreen, .mce-window.mce-fullscreen .mce-foot { - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0 -} - -.mce-rtl .mce-window-head .mce-close { - position: absolute; - right: auto; - left: 15px -} - -.mce-rtl .mce-window-head .mce-dragh { - left: auto; - right: 0 -} - -.mce-rtl .mce-window-head .mce-title { - direction: rtl; - text-align: right -} - -.mce-abs-layout { - position: relative -} - -body .mce-abs-layout-item, .mce-abs-end { - position: absolute -} - -.mce-abs-end { - width: 1px; - height: 1px -} - -.mce-container-body.mce-abs-layout { - overflow: hidden -} - -.mce-tooltip { - position: absolute; - padding: 5px; - opacity: .8; - filter: alpha(opacity=80); - zoom: 1 -} - -.mce-tooltip-inner { - font-size: 11px; - background-color: #000; - color: #fff; - max-width: 200px; - padding: 5px 8px 4px 8px; - text-align: center; - white-space: normal -} - -.mce-tooltip-inner { - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px -} - -.mce-tooltip-inner { - -webkit-box-shadow: 0 0 5px #000000; - -moz-box-shadow: 0 0 5px #000000; - box-shadow: 0 0 5px #000000 -} - -.mce-tooltip-arrow { - position: absolute; - width: 0; - height: 0; - line-height: 0; - border: 5px dashed #000 -} - -.mce-tooltip-arrow-n { - border-bottom-color: #000 -} - -.mce-tooltip-arrow-s { - border-top-color: #000 -} - -.mce-tooltip-arrow-e { - border-left-color: #000 -} - -.mce-tooltip-arrow-w { - border-right-color: #000 -} - -.mce-tooltip-nw, .mce-tooltip-sw { - margin-left: -14px -} - -.mce-tooltip-n .mce-tooltip-arrow { - top: 0px; - left: 50%; - margin-left: -5px; - border-bottom-style: solid; - border-top: none; - border-left-color: transparent; - border-right-color: transparent -} - -.mce-tooltip-nw .mce-tooltip-arrow { - top: 0; - left: 10px; - border-bottom-style: solid; - border-top: none; - border-left-color: transparent; - border-right-color: transparent -} - -.mce-tooltip-ne .mce-tooltip-arrow { - top: 0; - right: 10px; - border-bottom-style: solid; - border-top: none; - border-left-color: transparent; - border-right-color: transparent -} - -.mce-tooltip-s .mce-tooltip-arrow { - bottom: 0; - left: 50%; - margin-left: -5px; - border-top-style: solid; - border-bottom: none; - border-left-color: transparent; - border-right-color: transparent -} - -.mce-tooltip-sw .mce-tooltip-arrow { - bottom: 0; - left: 10px; - border-top-style: solid; - border-bottom: none; - border-left-color: transparent; - border-right-color: transparent -} - -.mce-tooltip-se .mce-tooltip-arrow { - bottom: 0; - right: 10px; - border-top-style: solid; - border-bottom: none; - border-left-color: transparent; - border-right-color: transparent -} - -.mce-tooltip-e .mce-tooltip-arrow { - right: 0; - top: 50%; - margin-top: -5px; - border-left-style: solid; - border-right: none; - border-top-color: transparent; - border-bottom-color: transparent -} - -.mce-tooltip-w .mce-tooltip-arrow { - left: 0; - top: 50%; - margin-top: -5px; - border-right-style: solid; - border-left: none; - border-top-color: transparent; - border-bottom-color: transparent -} - -.mce-btn { - border: 1px solid #b1b1b1; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25) rgba(0, 0, 0, 0.25); - position: relative; - text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); - display: inline-block; - *display: inline; - *zoom: 1; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; - -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); - -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); - background-color: #f0f0f0; - background-image: -moz-linear-gradient(top, #fff, #d9d9d9); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#d9d9d9)); - background-image: -webkit-linear-gradient(top, #fff, #d9d9d9); - background-image: -o-linear-gradient(top, #fff, #d9d9d9); - background-image: linear-gradient(to bottom, #fff, #d9d9d9); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffd9d9d9', GradientType=0); - zoom: 1 -} - -.mce-btn:hover, .mce-btn:focus { - color: #333; - background-color: #e3e3e3; - background-image: -moz-linear-gradient(top, #f2f2f2, #ccc); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#ccc)); - background-image: -webkit-linear-gradient(top, #f2f2f2, #ccc); - background-image: -o-linear-gradient(top, #f2f2f2, #ccc); - background-image: linear-gradient(to bottom, #f2f2f2, #ccc); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffcccccc', GradientType=0); - zoom: 1 -} - -.mce-btn.mce-disabled button, .mce-btn.mce-disabled:hover button { - cursor: default; - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; - opacity: .4; - filter: alpha(opacity=40); - zoom: 1 -} - -.mce-btn.mce-active, .mce-btn.mce-active:hover { - background-color: #d6d6d6; - background-image: -moz-linear-gradient(top, #e6e6e6, #c0c0c0); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#c0c0c0)); - background-image: -webkit-linear-gradient(top, #e6e6e6, #c0c0c0); - background-image: -o-linear-gradient(top, #e6e6e6, #c0c0c0); - background-image: linear-gradient(to bottom, #e6e6e6, #c0c0c0); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0); - zoom: 1; - -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); - -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); - box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05) -} - -.mce-btn:active { - background-color: #d6d6d6; - background-image: -moz-linear-gradient(top, #e6e6e6, #c0c0c0); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#c0c0c0)); - background-image: -webkit-linear-gradient(top, #e6e6e6, #c0c0c0); - background-image: -o-linear-gradient(top, #e6e6e6, #c0c0c0); - background-image: linear-gradient(to bottom, #e6e6e6, #c0c0c0); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0); - zoom: 1; - -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); - -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); - box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05) -} - -.mce-btn button { - padding: 4px 10px; - font-size: 14px; - line-height: 20px; - *line-height: 16px; - cursor: pointer; - color: #333; - text-align: center; - overflow: visible; - -webkit-appearance: none -} - -.mce-btn button::-moz-focus-inner { - border: 0; - padding: 0 -} - -.mce-btn i { - text-shadow: 1px 1px #fff -} - -.mce-primary { - min-width: 50px; - color: #fff; - border: 1px solid #b1b1b1; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25) rgba(0, 0, 0, 0.25); - background-color: #006dcc; - background-image: -moz-linear-gradient(top, #08c, #04c); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#04c)); - background-image: -webkit-linear-gradient(top, #08c, #04c); - background-image: -o-linear-gradient(top, #08c, #04c); - background-image: linear-gradient(to bottom, #08c, #04c); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0); - zoom: 1 -} - -.mce-primary:hover, .mce-primary:focus { - background-color: #005fb3; - background-image: -moz-linear-gradient(top, #0077b3, #003cb3); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0077b3), to(#003cb3)); - background-image: -webkit-linear-gradient(top, #0077b3, #003cb3); - background-image: -o-linear-gradient(top, #0077b3, #003cb3); - background-image: linear-gradient(to bottom, #0077b3, #003cb3); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0077b3', endColorstr='#ff003cb3', GradientType=0); - zoom: 1 -} - -.mce-primary.mce-disabled button, .mce-primary.mce-disabled:hover button { - cursor: default; - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; - opacity: .4; - filter: alpha(opacity=40); - zoom: 1 -} - -.mce-primary.mce-active, .mce-primary.mce-active:hover, .mce-primary:not(.mce-disabled):active { - background-color: #005299; - background-image: -moz-linear-gradient(top, #069, #039); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#069), to(#039)); - background-image: -webkit-linear-gradient(top, #069, #039); - background-image: -o-linear-gradient(top, #069, #039); - background-image: linear-gradient(to bottom, #069, #039); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff006699', endColorstr='#ff003399', GradientType=0); - zoom: 1; - -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); - -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); - box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05) -} - -.mce-primary button, .mce-primary button i { - color: #fff; - text-shadow: 1px 1px #333 -} - -.mce-btn-large button { - padding: 9px 14px; - font-size: 16px; - line-height: normal; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px -} - -.mce-btn-large i { - margin-top: 2px -} - -.mce-btn-small button { - padding: 1px 5px; - font-size: 12px; - *padding-bottom: 2px -} - -.mce-btn-small i { - line-height: 20px; - vertical-align: top; - *line-height: 18px -} - -.mce-btn .mce-caret { - margin-top: 8px; - margin-left: 0 -} - -.mce-btn-small .mce-caret { - margin-top: 8px; - margin-left: 0 -} - -.mce-caret { - display: inline-block; - *display: inline; - *zoom: 1; - width: 0; - height: 0; - vertical-align: top; - border-top: 4px solid #333; - border-right: 4px solid transparent; - border-left: 4px solid transparent; - content: "" -} - -.mce-disabled .mce-caret { - border-top-color: #aaa -} - -.mce-caret.mce-up { - border-bottom: 4px solid #333; - border-top: 0 -} - -.mce-btn-flat { - border: 0; - background: transparent; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; - filter: none -} - -.mce-btn-flat:hover, .mce-btn-flat.mce-active, .mce-btn-flat:focus, .mce-btn-flat:active { - border: 0; - background: #e6e6e6; - filter: none; - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none -} - -.mce-rtl .mce-btn button { - direction: rtl -} - -.mce-btn-group .mce-btn { - border-width: 1px 0 1px 0; - margin: 0; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0 -} - -.mce-btn-group .mce-first { - border-left: 1px solid #b1b1b1; - border-left: 1px solid rgba(0, 0, 0, 0.25); - -webkit-border-radius: 3px 0 0 3px; - -moz-border-radius: 3px 0 0 3px; - border-radius: 3px 0 0 3px -} - -.mce-btn-group .mce-last { - border-right: 1px solid #b1b1b1; - border-right: 1px solid rgba(0, 0, 0, 0.1); - -webkit-border-radius: 0 3px 3px 0; - -moz-border-radius: 0 3px 3px 0; - border-radius: 0 3px 3px 0 -} - -.mce-btn-group .mce-first.mce-last { - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px -} - -.mce-btn-group .mce-btn.mce-flow-layout-item { - margin: 0 -} - -.mce-checkbox { - cursor: pointer -} - -i.mce-i-checkbox { - margin: 0 3px 0 0; - border: 1px solid #c5c5c5; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; - -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); - -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); - background-color: #f0f0f0; - background-image: -moz-linear-gradient(top, #fff, #d9d9d9); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#d9d9d9)); - background-image: -webkit-linear-gradient(top, #fff, #d9d9d9); - background-image: -o-linear-gradient(top, #fff, #d9d9d9); - background-image: linear-gradient(to bottom, #fff, #d9d9d9); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffd9d9d9', GradientType=0); - zoom: 1; - text-indent: -10em; - *font-size: 0; - *line-height: 0; - *text-indent: 0; - overflow: hidden -} - -.mce-checked i.mce-i-checkbox { - color: #333; - font-size: 16px; - line-height: 16px; - text-indent: 0 -} - -.mce-checkbox:focus i.mce-i-checkbox, .mce-checkbox.mce-focus i.mce-i-checkbox { - border: 1px solid rgba(82, 168, 236, 0.8); - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65) -} - -.mce-checkbox.mce-disabled .mce-label, .mce-checkbox.mce-disabled i.mce-i-checkbox { - color: #acacac -} - -.mce-rtl .mce-checkbox { - direction: rtl; - text-align: right -} - -.mce-rtl i.mce-i-checkbox { - margin: 0 0 0 3px -} - -.mce-combobox { - display: inline-block; - *display: inline; - *zoom: 1; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - *height: 32px -} - -.mce-combobox input { - border: 1px solid #c5c5c5; - border-right-color: #c5c5c5; - height: 28px -} - -.mce-combobox.mce-disabled input { - color: #adadad -} - -.mce-combobox.mce-has-open input { - -webkit-border-radius: 4px 0 0 4px; - -moz-border-radius: 4px 0 0 4px; - border-radius: 4px 0 0 4px -} - -.mce-combobox .mce-btn { - border-left: 0; - -webkit-border-radius: 0 4px 4px 0; - -moz-border-radius: 0 4px 4px 0; - border-radius: 0 4px 4px 0 -} - -.mce-combobox button { - padding-right: 8px; - padding-left: 8px -} - -.mce-combobox.mce-disabled .mce-btn button { - cursor: default; - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; - opacity: .4; - filter: alpha(opacity=40); - zoom: 1 -} - -.mce-colorbox i { - border: 1px solid #c5c5c5; - width: 14px; - height: 14px -} - -.mce-colorbutton .mce-ico { - position: relative -} - -.mce-colorbutton-grid { - margin: 4px -} - -.mce-colorbutton button { - padding-right: 4px -} - -.mce-colorbutton .mce-preview { - padding-right: 3px; - display: block; - position: absolute; - left: 50%; - top: 50%; - margin-left: -14px; - margin-top: 7px; - background: gray; - width: 13px; - height: 2px; - overflow: hidden -} - -.mce-colorbutton.mce-btn-small .mce-preview { - margin-left: -16px; - padding-right: 0; - width: 16px -} - -.mce-colorbutton .mce-open { - padding-left: 4px; - border-left: 1px solid transparent; - border-right: 1px solid transparent -} - -.mce-colorbutton:hover .mce-open { - border-left-color: #bdbdbd; - border-right-color: #bdbdbd -} - -.mce-colorbutton.mce-btn-small .mce-open { - padding: 0 3px 0 3px -} - -.mce-rtl .mce-colorbutton { - direction: rtl -} - -.mce-rtl .mce-colorbutton .mce-preview { - margin-left: 0; - padding-right: 0; - padding-left: 4px; - margin-right: -14px -} - -.mce-rtl .mce-colorbutton.mce-btn-small .mce-preview { - margin-left: 0; - padding-right: 0; - margin-right: -17px; - padding-left: 0 -} - -.mce-rtl .mce-colorbutton button { - padding-right: 10px; - padding-left: 10px -} - -.mce-rtl .mce-colorbutton .mce-open { - padding-left: 4px; - padding-right: 4px -} - -.mce-colorpicker { - position: relative; - width: 250px; - height: 220px -} - -.mce-colorpicker-sv { - position: absolute; - top: 0; - left: 0; - width: 90%; - height: 100%; - border: 1px solid #c5c5c5; - cursor: crosshair; - overflow: hidden -} - -.mce-colorpicker-h-chunk { - width: 100% -} - -.mce-colorpicker-overlay1, .mce-colorpicker-overlay2 { - width: 100%; - height: 100%; - position: absolute; - top: 0; - left: 0 -} - -.mce-colorpicker-overlay1 { - filter: progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr='#ffffff', endColorstr='#00ffffff'); - -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff')"; - background: linear-gradient(to right, #fff, rgba(255, 255, 255, 0)) -} - -.mce-colorpicker-overlay2 { - filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#00000000', endColorstr='#000000'); - -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000')"; - background: linear-gradient(to bottom, rgba(0, 0, 0, 0), #000) -} - -.mce-colorpicker-selector1 { - background: none; - position: absolute; - width: 12px; - height: 12px; - margin: -8px 0 0 -8px; - border: 1px solid black; - border-radius: 50% -} - -.mce-colorpicker-selector2 { - position: absolute; - width: 10px; - height: 10px; - border: 1px solid white; - border-radius: 50% -} - -.mce-colorpicker-h { - position: absolute; - top: 0; - right: 0; - width: 6.5%; - height: 100%; - border: 1px solid #c5c5c5; - cursor: crosshair -} - -.mce-colorpicker-h-marker { - margin-top: -4px; - position: absolute; - top: 0; - left: -1px; - width: 100%; - border: 1px solid #333; - background: #fff; - height: 4px; - z-index: 100 -} - -.mce-path { - display: inline-block; - *display: inline; - *zoom: 1; - padding: 8px; - white-space: normal -} - -.mce-path .mce-txt { - display: inline-block; - padding-right: 3px -} - -.mce-path .mce-path-body { - display: inline-block -} - -.mce-path-item { - display: inline-block; - *display: inline; - *zoom: 1; - cursor: pointer; - color: #333 -} - -.mce-path-item:hover { - text-decoration: underline -} - -.mce-path-item:focus { - background: #666; - color: #fff -} - -.mce-path .mce-divider { - display: inline -} - -.mce-disabled .mce-path-item { - color: #aaa -} - -.mce-rtl .mce-path { - direction: rtl -} - -.mce-fieldset { - border: 0 solid #9E9E9E; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px -} - -.mce-fieldset > .mce-container-body { - margin-top: -15px -} - -.mce-fieldset-title { - margin-left: 5px; - padding: 0 5px 0 5px -} - -.mce-fit-layout { - display: inline-block; - *display: inline; - *zoom: 1 -} - -.mce-fit-layout-item { - position: absolute -} - -.mce-flow-layout-item { - display: inline-block; - *display: inline; - *zoom: 1 -} - -.mce-flow-layout-item { - margin: 2px 0 2px 2px -} - -.mce-flow-layout-item.mce-last { - margin-right: 2px -} - -.mce-flow-layout { - white-space: normal -} - -.mce-tinymce-inline .mce-flow-layout { - white-space: nowrap -} - -.mce-rtl .mce-flow-layout { - text-align: right; - direction: rtl -} - -.mce-rtl .mce-flow-layout-item { - margin: 2px 2px 2px 0 -} - -.mce-rtl .mce-flow-layout-item.mce-last { - margin-left: 2px -} - -.mce-iframe { - border: 0 solid #9e9e9e; - width: 100%; - height: 100% -} - -.mce-label { - display: inline-block; - *display: inline; - *zoom: 1; - text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); - overflow: hidden -} - -.mce-label.mce-autoscroll { - overflow: auto -} - -.mce-label.mce-disabled { - color: #aaa -} - -.mce-label.mce-multiline { - white-space: pre-wrap -} - -.mce-label.mce-error { - color: #a00 -} - -.mce-rtl .mce-label { - text-align: right; - direction: rtl -} - -.mce-menubar .mce-menubtn { - border-color: transparent; - background: transparent; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; - filter: none -} - -.mce-menubar { - border: 1px solid #c4c4c4 -} - -.mce-menubar .mce-menubtn button span { - color: #333 -} - -.mce-menubar .mce-caret { - border-top-color: #333 -} - -.mce-menubar .mce-menubtn:hover, .mce-menubar .mce-menubtn.mce-active, .mce-menubar .mce-menubtn:focus { - border-color: transparent; - background: #e6e6e6; - filter: none; - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none -} - -.mce-menubtn span { - color: #333; - margin-right: 2px; - line-height: 20px; - *line-height: 16px -} - -.mce-menubtn.mce-btn-small span { - font-size: 12px -} - -.mce-menubtn.mce-fixed-width span { - display: inline-block; - overflow-x: hidden; - text-overflow: ellipsis; - width: 90px -} - -.mce-menubtn.mce-fixed-width.mce-btn-small span { - width: 70px -} - -.mce-menubtn .mce-caret { - *margin-top: 6px -} - -.mce-rtl .mce-menubtn button { - direction: rtl; - text-align: right -} - -.mce-listbox button { - text-align: left; - padding-right: 20px; - position: relative -} - -.mce-listbox .mce-caret { - position: absolute; - margin-top: -2px; - right: 8px; - top: 50% -} - -.mce-rtl .mce-listbox .mce-caret { - right: auto; - left: 8px -} - -.mce-rtl .mce-listbox button { - padding-right: 10px; - padding-left: 20px -} - -.mce-menu-item { - display: block; - padding: 6px 15px 6px 12px; - clear: both; - font-weight: normal; - line-height: 20px; - color: #333; - white-space: nowrap; - cursor: pointer; - line-height: normal; - border-left: 4px solid transparent; - margin-bottom: 1px -} - -.mce-menu-item .mce-ico, .mce-menu-item .mce-text { - color: #333 -} - -.mce-menu-item.mce-disabled .mce-text, .mce-menu-item.mce-disabled .mce-ico { - color: #adadad -} - -.mce-menu-item:hover .mce-text, .mce-menu-item.mce-selected .mce-text, .mce-menu-item:focus .mce-text { - color: #fff -} - -.mce-menu-item:hover .mce-ico, .mce-menu-item.mce-selected .mce-ico, .mce-menu-item:focus .mce-ico { - color: #fff -} - -.mce-menu-item.mce-disabled:hover { - background: #ccc -} - -.mce-menu-shortcut { - display: inline-block; - color: #adadad -} - -.mce-menu-shortcut { - display: inline-block; - *display: inline; - *zoom: 1; - padding: 0 15px 0 20px -} - -.mce-menu-item:hover .mce-menu-shortcut, .mce-menu-item.mce-selected .mce-menu-shortcut, .mce-menu-item:focus .mce-menu-shortcut { - color: #fff -} - -.mce-menu-item .mce-caret { - margin-top: 4px; - *margin-top: 3px; - margin-right: 6px; - border-top: 4px solid transparent; - border-bottom: 4px solid transparent; - border-left: 4px solid #333 -} - -.mce-menu-item.mce-selected .mce-caret, .mce-menu-item:focus .mce-caret, .mce-menu-item:hover .mce-caret { - border-left-color: #fff -} - -.mce-menu-align .mce-menu-shortcut { - *margin-top: -2px -} - -.mce-menu-align .mce-menu-shortcut, .mce-menu-align .mce-caret { - position: absolute; - right: 0 -} - -.mce-menu-item.mce-active i { - visibility: visible -} - -.mce-menu-item-normal.mce-active { - background-color: #c8def4 -} - -.mce-menu-item-preview.mce-active { - border-left: 5px solid #aaa -} - -.mce-menu-item-normal.mce-active .mce-text { - color: #333 -} - -.mce-menu-item-normal.mce-active:hover .mce-text, .mce-menu-item-normal.mce-active:hover .mce-ico { - color: #fff -} - -.mce-menu-item-normal.mce-active:focus .mce-text, .mce-menu-item-normal.mce-active:focus .mce-ico { - color: #fff -} - -.mce-menu-item:hover, .mce-menu-item.mce-selected, .mce-menu-item:focus { - text-decoration: none; - color: #fff; - background-color: #0081c2; - background-image: -moz-linear-gradient(top, #08c, #0077b3); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#0077b3)); - background-image: -webkit-linear-gradient(top, #08c, #0077b3); - background-image: -o-linear-gradient(top, #08c, #0077b3); - background-image: linear-gradient(to bottom, #08c, #0077b3); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0); - zoom: 1 -} - -div.mce-menu .mce-menu-item-sep, .mce-menu-item-sep:hover { - border: 0; - padding: 0; - height: 1px; - margin: 9px 1px; - overflow: hidden; - background: #cbcbcb; - border-bottom: 1px solid #fff; - cursor: default; - filter: none -} - -.mce-menu.mce-rtl { - direction: rtl -} - -.mce-rtl .mce-menu-item { - text-align: right; - direction: rtl; - padding: 6px 12px 6px 15px -} - -.mce-menu-align.mce-rtl .mce-menu-shortcut, .mce-menu-align.mce-rtl .mce-caret { - right: auto; - left: 0 -} - -.mce-rtl .mce-menu-item .mce-caret { - margin-left: 6px; - margin-right: 0; - border-right: 4px solid #333; - border-left: 0 -} - -.mce-rtl .mce-menu-item.mce-selected .mce-caret, .mce-rtl .mce-menu-item:focus .mce-caret, .mce-rtl .mce-menu-item:hover .mce-caret { - border-left-color: transparent; - border-right-color: #fff -} - -.mce-menu { - position: absolute; - left: 0; - top: 0; - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); - background: transparent; - z-index: 1000; - padding: 5px 0 5px 0; - margin: 2px 0 0; - min-width: 160px; - background: #fff; - border: 1px solid #989898; - border: 1px solid rgba(0, 0, 0, 0.2); - z-index: 1002; - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; - -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - max-height: 400px; - overflow: auto; - overflow-x: hidden -} - -.mce-menu i { - display: none -} - -.mce-menu-has-icons i { - display: inline-block; - *display: inline -} - -.mce-menu-sub-tr-tl { - margin: -6px 0 0 -1px -} - -.mce-menu-sub-br-bl { - margin: 6px 0 0 -1px -} - -.mce-menu-sub-tl-tr { - margin: -6px 0 0 1px -} - -.mce-menu-sub-bl-br { - margin: 6px 0 0 1px -} - -.mce-container-body .mce-resizehandle { - position: absolute; - right: 0; - bottom: 0; - width: 16px; - height: 16px; - visibility: visible; - cursor: s-resize; - margin: 0 -} - -.mce-container-body .mce-resizehandle-both { - cursor: se-resize -} - -i.mce-i-resize { - color: #333 -} - -.mce-spacer { - visibility: hidden -} - -.mce-splitbtn .mce-open { - border-left: 1px solid transparent; - border-right: 1px solid transparent -} - -.mce-splitbtn:hover .mce-open { - border-left-color: #bdbdbd; - border-right-color: #bdbdbd -} - -.mce-splitbtn button { - padding-right: 4px -} - -.mce-splitbtn .mce-open { - padding-left: 4px -} - -.mce-splitbtn .mce-open.mce-active { - -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); - -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); - box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05) -} - -.mce-splitbtn.mce-btn-small .mce-open { - padding: 0 3px 0 3px -} - -.mce-rtl .mce-splitbtn { - direction: rtl; - text-align: right -} - -.mce-rtl .mce-splitbtn button { - padding-right: 10px; - padding-left: 10px -} - -.mce-rtl .mce-splitbtn .mce-open { - padding-left: 4px; - padding-right: 4px -} - -.mce-stack-layout-item { - display: block -} - -.mce-tabs { - display: block; - border-bottom: 1px solid #c5c5c5 -} - -.mce-tab { - display: inline-block; - *display: inline; - *zoom: 1; - border: 1px solid #c5c5c5; - border-width: 0 1px 0 0; - background: #e3e3e3; - padding: 8px; - text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); - height: 13px; - cursor: pointer -} - -.mce-tab:hover { - background: #fdfdfd -} - -.mce-tab.mce-active { - background: #fdfdfd; - border-bottom-color: transparent; - margin-bottom: -1px; - height: 14px -} - -.mce-rtl .mce-tabs { - text-align: right; - direction: rtl -} - -.mce-rtl .mce-tab { - border-width: 0 0 0 1px -} - -.mce-textbox { - background: #fff; - border: 1px solid #c5c5c5; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - display: inline-block; - -webkit-transition: border linear .2s, box-shadow linear .2s; - transition: border linear .2s, box-shadow linear .2s; - height: 28px; - resize: none; - padding: 0 4px 0 4px; - white-space: pre-wrap; - *white-space: pre; - color: #333 -} - -.mce-textbox:focus, .mce-textbox.mce-focus { - border-color: rgba(82, 168, 236, 0.8); - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65) -} - -.mce-placeholder .mce-textbox { - color: #aaa -} - -.mce-textbox.mce-multiline { - padding: 4px -} - -.mce-textbox.mce-disabled { - color: #adadad -} - -.mce-rtl .mce-textbox { - text-align: right; - direction: rtl -} - -.mce-throbber { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - opacity: .6; - filter: alpha(opacity=60); - zoom: 1; - background: #fff url('img/loader.gif') no-repeat center center -} - -.mce-throbber-inline { - position: static; - height: 50px -} - -@font-face { - font-family: 'tinymce'; - src: url('fonts/tinymce.eot'); - src: url('fonts/tinymce.eot?#iefix') format('embedded-opentype'), url('fonts/tinymce.woff') format('woff'), url('fonts/tinymce.ttf') format('truetype'), url('fonts/tinymce.svg#tinymce') format('svg'); - font-weight: normal; - font-style: normal -} - -@font-face { - font-family: 'tinymce-small'; - src: url('fonts/tinymce-small.eot'); - src: url('fonts/tinymce-small.eot?#iefix') format('embedded-opentype'), url('fonts/tinymce-small.woff') format('woff'), url('fonts/tinymce-small.ttf') format('truetype'), url('fonts/tinymce-small.svg#tinymce') format('svg'); - font-weight: normal; - font-style: normal -} - -.mce-ico { - font-family: 'tinymce', Arial; - font-style: normal; - font-weight: normal; - font-variant: normal; - font-size: 16px; - line-height: 16px; - speak: none; - vertical-align: text-top; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - display: inline-block; - background: transparent center center; - background-size: cover; - width: 16px; - height: 16px; - color: #333 -} - -.mce-btn-small .mce-ico { - font-family: 'tinymce-small', Arial -} - -.mce-i-save:before { - content: "\e000" -} - -.mce-i-newdocument:before { - content: "\e001" -} - -.mce-i-fullpage:before { - content: "\e002" -} - -.mce-i-alignleft:before { - content: "\e003" -} - -.mce-i-aligncenter:before { - content: "\e004" -} - -.mce-i-alignright:before { - content: "\e005" -} - -.mce-i-alignjustify:before { - content: "\e006" -} - -.mce-i-cut:before { - content: "\e007" -} - -.mce-i-paste:before { - content: "\e008" -} - -.mce-i-searchreplace:before { - content: "\e009" -} - -.mce-i-bullist:before { - content: "\e00a" -} - -.mce-i-numlist:before { - content: "\e00b" -} - -.mce-i-indent:before { - content: "\e00c" -} - -.mce-i-outdent:before { - content: "\e00d" -} - -.mce-i-blockquote:before { - content: "\e00e" -} - -.mce-i-undo:before { - content: "\e00f" -} - -.mce-i-redo:before { - content: "\e010" -} - -.mce-i-link:before { - content: "\e011" -} - -.mce-i-unlink:before { - content: "\e012" -} - -.mce-i-anchor:before { - content: "\e013" -} - -.mce-i-image:before { - content: "\e014" -} - -.mce-i-media:before { - content: "\e015" -} - -.mce-i-help:before { - content: "\e016" -} - -.mce-i-code:before { - content: "\e017" -} - -.mce-i-insertdatetime:before { - content: "\e018" -} - -.mce-i-preview:before { - content: "\e019" -} - -.mce-i-forecolor:before { - content: "\e01a" -} - -.mce-i-backcolor:before { - content: "\e01a" -} - -.mce-i-table:before { - content: "\e01b" -} - -.mce-i-hr:before { - content: "\e01c" -} - -.mce-i-removeformat:before { - content: "\e01d" -} - -.mce-i-subscript:before { - content: "\e01e" -} - -.mce-i-superscript:before { - content: "\e01f" -} - -.mce-i-charmap:before { - content: "\e020" -} - -.mce-i-emoticons:before { - content: "\e021" -} - -.mce-i-print:before { - content: "\e022" -} - -.mce-i-fullscreen:before { - content: "\e023" -} - -.mce-i-spellchecker:before { - content: "\e024" -} - -.mce-i-nonbreaking:before { - content: "\e025" -} - -.mce-i-template:before { - content: "\e026" -} - -.mce-i-pagebreak:before { - content: "\e027" -} - -.mce-i-restoredraft:before { - content: "\e028" -} - -.mce-i-untitled:before { - content: "\e029" -} - -.mce-i-bold:before { - content: "\e02a" -} - -.mce-i-italic:before { - content: "\e02b" -} - -.mce-i-underline:before { - content: "\e02c" -} - -.mce-i-strikethrough:before { - content: "\e02d" -} - -.mce-i-visualchars:before { - content: "\e02e" -} - -.mce-i-visualblocks:before { - content: "\e02e" -} - -.mce-i-ltr:before { - content: "\e02f" -} - -.mce-i-rtl:before { - content: "\e030" -} - -.mce-i-copy:before { - content: "\e031" -} - -.mce-i-resize:before { - content: "\e032" -} - -.mce-i-browse:before { - content: "\e034" -} - -.mce-i-pastetext:before { - content: "\e035" -} - -.mce-i-checkbox:before, .mce-i-selected:before { - content: "\e033" -} - -.mce-i-selected { - visibility: hidden -} - -i.mce-i-backcolor { - text-shadow: none; - background: #bbb -} \ No newline at end of file diff --git a/app/lib/tinymce/themes/modern/theme.min.js b/app/lib/tinymce/themes/modern/theme.min.js deleted file mode 100644 index ea84b66b..00000000 --- a/app/lib/tinymce/themes/modern/theme.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.ThemeManager.add("modern",function(e){function t(){function t(t){var n,o=[];if(t)return d(t.split(/[ ,]/),function(t){function i(){var i=e.selection;"bullist"==r&&i.selectorChanged("ul > li",function(e,i){for(var n,o=i.parents.length;o--&&(n=i.parents[o].nodeName,"OL"!=n&&"UL"!=n););t.active(e&&"UL"==n)}),"numlist"==r&&i.selectorChanged("ol > li",function(e,i){for(var n,o=i.parents.length;o--&&(n=i.parents[o].nodeName,"OL"!=n&&"UL"!=n););t.active(e&&"OL"==n)}),t.settings.stateSelector&&i.selectorChanged(t.settings.stateSelector,function(e){t.active(e)},!0),t.settings.disabledStateSelector&&i.selectorChanged(t.settings.disabledStateSelector,function(e){t.disabled(e)})}var r;"|"==t?n=null:c.has(t)?(t={type:t},u.toolbar_items_size&&(t.size=u.toolbar_items_size),o.push(t),n=null):(n||(n={type:"buttongroup",items:[]},o.push(n)),e.buttons[t]&&(r=t,t=e.buttons[r],"function"==typeof t&&(t=t()),t.type=t.type||"button",u.toolbar_items_size&&(t.size=u.toolbar_items_size),t=c.create(t),n.items.push(t),e.initialized?i():e.on("init",i)))}),i.push({type:"toolbar",layout:"flow",items:o}),!0}var i=[];if(tinymce.isArray(u.toolbar)){if(0===u.toolbar.length)return;tinymce.each(u.toolbar,function(e,t){u["toolbar"+(t+1)]=e}),delete u.toolbar}for(var n=1;10>n&&t(u["toolbar"+n]);n++);return i.length||u.toolbar===!1||t(u.toolbar||f),i.length?{type:"panel",layout:"stack",classes:"toolbar-grp",ariaRoot:!0,ariaRemember:!0,items:i}:void 0}function i(){function t(t){var i;return"|"==t?{text:"|"}:i=e.menuItems[t]}function i(i){var n,o,r,a,s;if(s=tinymce.makeMap((u.removed_menuitems||"").split(/[ ,]/)),u.menu?(o=u.menu[i],a=!0):o=h[i],o){n={text:o.title},r=[],d((o.items||"").split(/[ ,]/),function(e){var i=t(e);i&&!s[e]&&r.push(t(e))}),a||d(e.menuItems,function(e){e.context==i&&("before"==e.separator&&r.push({text:"|"}),e.prependToContext?r.unshift(e):r.push(e),"after"==e.separator&&r.push({text:"|"}))});for(var l=0;lr;r++)if(o=n[r],o&&o.func.call(o.scope,e)===!1&&e.preventDefault(),e.isImmediatePropagationStopped())return}var a=this,s={},l,c,u,d,f;c=o+(+new Date).toString(32),d="onmouseenter"in document.documentElement,u="onfocusin"in document.documentElement,f={mouseenter:"mouseover",mouseleave:"mouseout"},l=1,a.domLoaded=!1,a.events=s,a.bind=function(t,o,p,h){function m(e){i(n(e||_.event),g)}var g,v,y,b,C,x,w,_=window;if(t&&3!==t.nodeType&&8!==t.nodeType){for(t[c]?g=t[c]:(g=l++,t[c]=g,s[g]={}),h=h||t,o=o.split(" "),y=o.length;y--;)b=o[y],x=m,C=w=!1,"DOMContentLoaded"===b&&(b="ready"),a.domLoaded&&"ready"===b&&"complete"==t.readyState?p.call(h,n({type:b})):(d||(C=f[b],C&&(x=function(e){var t,r;if(t=e.currentTarget,r=e.relatedTarget,r&&t.contains)r=t.contains(r);else for(;r&&r!==t;)r=r.parentNode;r||(e=n(e||_.event),e.type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,i(e,g))})),u||"focusin"!==b&&"focusout"!==b||(w=!0,C="focusin"===b?"focus":"blur",x=function(e){e=n(e||_.event),e.type="focus"===e.type?"focusin":"focusout",i(e,g)}),v=s[g][b],v?"ready"===b&&a.domLoaded?p({type:b}):v.push({func:p,scope:h}):(s[g][b]=v=[{func:p,scope:h}],v.fakeName=C,v.capture=w,v.nativeHandler=x,"ready"===b?r(t,x,a):e(t,C||b,x,w)));return t=v=0,p}},a.unbind=function(e,n,r){var i,o,l,u,d,f;if(!e||3===e.nodeType||8===e.nodeType)return a;if(i=e[c]){if(f=s[i],n){for(n=n.split(" "),l=n.length;l--;)if(d=n[l],o=f[d]){if(r)for(u=o.length;u--;)if(o[u].func===r){var p=o.nativeHandler,h=o.fakeName,m=o.capture;o=o.slice(0,u).concat(o.slice(u+1)),o.nativeHandler=p,o.fakeName=h,o.capture=m,f[d]=o}r&&0!==o.length||(delete f[d],t(e,o.fakeName||d,o.nativeHandler,o.capture))}}else{for(d in f)o=f[d],t(e,o.fakeName||d,o.nativeHandler,o.capture);f={}}for(d in f)return a;delete s[i];try{delete e[c]}catch(g){e[c]=null}}return a},a.fire=function(e,t,r){var o;if(!e||3===e.nodeType||8===e.nodeType)return a;r=n(null,r),r.type=t,r.target=e;do o=e[c],o&&i(r,o),e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow;while(e&&!r.isPropagationStopped());return a},a.clean=function(e){var t,n,r=a.unbind;if(!e||3===e.nodeType||8===e.nodeType)return a;if(e[c]&&r(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(r(e),n=e.getElementsByTagName("*"),t=n.length;t--;)e=n[t],e[c]&&r(e);return a},a.destroy=function(){s={}},a.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}}var o="mce-data-",a=/^(?:mouse|contextmenu)|click/,s={keyLocation:1,layerX:1,layerY:1,returnValue:1};return i.Event=new i,i.Event.bind(window,"ready",function(){}),i}),r(c,[],function(){function e(e,t,n,r){var i,o,a,s,l,c,d,p,h,m;if((t?t.ownerDocument||t:z)!==D&&B(t),t=t||D,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(H&&!r){if(i=vt.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&I(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return Z.apply(n,t.getElementsByTagName(e)),n;if((a=i[3])&&x.getElementsByClassName)return Z.apply(n,t.getElementsByClassName(a)),n}if(x.qsa&&(!M||!M.test(e))){if(p=d=F,h=t,m=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(c=N(e),(d=t.getAttribute("id"))?p=d.replace(bt,"\\$&"):t.setAttribute("id",p),p="[id='"+p+"'] ",l=c.length;l--;)c[l]=p+f(c[l]);h=yt.test(e)&&u(t.parentNode)||t,m=c.join(",")}if(m)try{return Z.apply(n,h.querySelectorAll(m)),n}catch(g){}finally{d||t.removeAttribute("id")}}}return S(e.replace(st,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")>w.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[F]=!0,e}function i(e){var t=D.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=e.length;r--;)w.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||K)-(~e.sourceIndex||K);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function u(e){return e&&typeof e.getElementsByTagName!==Y&&e}function d(){}function f(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function p(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=V++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,l,c=[W,o];if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i){if(l=t[F]||(t[F]={}),(s=l[r])&&s[0]===W&&s[1]===o)return c[2]=s[2];if(l[r]=c,c[2]=e(t,n,a))return!0}}}function h(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function m(t,n,r){for(var i=0,o=n.length;o>i;i++)e(t,n[i],r);return r}function g(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,c=null!=t;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),c&&t.push(s));return a}function v(e,t,n,i,o,a){return i&&!i[F]&&(i=v(i)),o&&!o[F]&&(o=v(o,a)),r(function(r,a,s,l){var c,u,d,f=[],p=[],h=a.length,v=r||m(t||"*",s.nodeType?[s]:s,[]),y=!e||!r&&t?v:g(v,f,e,s,l),b=n?o||(r?e:h||i)?[]:a:y;if(n&&n(y,b,s,l),i)for(c=g(b,p),i(c,[],s,l),u=c.length;u--;)(d=c[u])&&(b[p[u]]=!(y[p[u]]=d));if(r){if(o||e){if(o){for(c=[],u=b.length;u--;)(d=b[u])&&c.push(y[u]=d);o(null,b=[],c,l)}for(u=b.length;u--;)(d=b[u])&&(c=o?tt.call(r,d):f[u])>-1&&(r[c]=!(a[c]=d))}}else b=g(b===a?b.splice(h,b.length):b),o?o(null,a,b,l):Z.apply(a,b)})}function y(e){for(var t,n,r,i=e.length,o=w.relative[e[0].type],a=o||w.relative[" "],s=o?1:0,l=p(function(e){return e===t},a,!0),c=p(function(e){return tt.call(t,e)>-1},a,!0),u=[function(e,n,r){return!o&&(r||n!==T)||((t=n).nodeType?l(e,n,r):c(e,n,r))}];i>s;s++)if(n=w.relative[e[s].type])u=[p(h(u),n)];else{if(n=w.filter[e[s].type].apply(null,e[s].matches),n[F]){for(r=++s;i>r&&!w.relative[e[r].type];r++);return v(s>1&&h(u),s>1&&f(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(st,"$1"),n,r>s&&y(e.slice(s,r)),i>r&&y(e=e.slice(r)),i>r&&f(e))}u.push(n)}return h(u)}function b(t,n){var i=n.length>0,o=t.length>0,a=function(r,a,s,l,c){var u,d,f,p=0,h="0",m=r&&[],v=[],y=T,b=r||o&&w.find.TAG("*",c),C=W+=null==y?1:Math.random()||.1,x=b.length;for(c&&(T=a!==D&&a);h!==x&&null!=(u=b[h]);h++){if(o&&u){for(d=0;f=t[d++];)if(f(u,a,s)){l.push(u);break}c&&(W=C)}i&&((u=!f&&u)&&p--,r&&m.push(u))}if(p+=h,i&&h!==p){for(d=0;f=n[d++];)f(m,v,a,s);if(r){if(p>0)for(;h--;)m[h]||v[h]||(v[h]=J.call(l));v=g(v)}Z.apply(l,v),c&&!r&&v.length>0&&p+n.length>1&&e.uniqueSort(l)}return c&&(W=C,T=y),m};return i?r(a):a}var C,x,w,_,E,N,k,S,T,R,A,B,D,L,H,M,P,O,I,F="sizzle"+-new Date,z=window.document,W=0,V=0,U=n(),$=n(),q=n(),j=function(e,t){return e===t&&(A=!0),0},Y=typeof t,K=1<<31,G={}.hasOwnProperty,X=[],J=X.pop,Q=X.push,Z=X.push,et=X.slice,tt=X.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},nt="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",rt="[\\x20\\t\\r\\n\\f]",it="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ot="\\["+rt+"*("+it+")(?:"+rt+"*([*^$|!~]?=)"+rt+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+it+"))|)"+rt+"*\\]",at=":("+it+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ot+")*)|.*)\\)|)",st=new RegExp("^"+rt+"+|((?:^|[^\\\\])(?:\\\\.)*)"+rt+"+$","g"),lt=new RegExp("^"+rt+"*,"+rt+"*"),ct=new RegExp("^"+rt+"*([>+~]|"+rt+")"+rt+"*"),ut=new RegExp("="+rt+"*([^\\]'\"]*?)"+rt+"*\\]","g"),dt=new RegExp(at),ft=new RegExp("^"+it+"$"),pt={ID:new RegExp("^#("+it+")"),CLASS:new RegExp("^\\.("+it+")"),TAG:new RegExp("^("+it+"|[*])"),ATTR:new RegExp("^"+ot),PSEUDO:new RegExp("^"+at),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+rt+"*(even|odd|(([+-]|)(\\d*)n|)"+rt+"*(?:([+-]|)"+rt+"*(\\d+)|))"+rt+"*\\)|)","i"),bool:new RegExp("^(?:"+nt+")$","i"),needsContext:new RegExp("^"+rt+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+rt+"*((?:-\\d)?\\d*)"+rt+"*\\)|)(?=[^-]|$)","i")},ht=/^(?:input|select|textarea|button)$/i,mt=/^h\d$/i,gt=/^[^{]+\{\s*\[native \w/,vt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,yt=/[+~]/,bt=/'|\\/g,Ct=new RegExp("\\\\([\\da-f]{1,6}"+rt+"?|("+rt+")|.)","ig"),xt=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{Z.apply(X=et.call(z.childNodes),z.childNodes),X[z.childNodes.length].nodeType}catch(wt){Z={apply:X.length?function(e,t){Q.apply(e,et.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}x=e.support={},E=e.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},B=e.setDocument=function(e){var t,n=e?e.ownerDocument||e:z,r=n.defaultView;return n!==D&&9===n.nodeType&&n.documentElement?(D=n,L=n.documentElement,H=!E(n),r&&r!==r.top&&(r.addEventListener?r.addEventListener("unload",function(){B()},!1):r.attachEvent&&r.attachEvent("onunload",function(){B()})),x.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),x.getElementsByTagName=i(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),x.getElementsByClassName=gt.test(n.getElementsByClassName),x.getById=i(function(e){return L.appendChild(e).id=F,!n.getElementsByName||!n.getElementsByName(F).length}),x.getById?(w.find.ID=function(e,t){if(typeof t.getElementById!==Y&&H){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},w.filter.ID=function(e){var t=e.replace(Ct,xt);return function(e){return e.getAttribute("id")===t}}):(delete w.find.ID,w.filter.ID=function(e){var t=e.replace(Ct,xt);return function(e){var n=typeof e.getAttributeNode!==Y&&e.getAttributeNode("id");return n&&n.value===t}}),w.find.TAG=x.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==Y?t.getElementsByTagName(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},w.find.CLASS=x.getElementsByClassName&&function(e,t){return H?t.getElementsByClassName(e):void 0},P=[],M=[],(x.qsa=gt.test(n.querySelectorAll))&&(i(function(e){e.innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&M.push("[*^$]="+rt+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||M.push("\\["+rt+"*(?:value|"+nt+")"),e.querySelectorAll(":checked").length||M.push(":checked")}),i(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&M.push("name"+rt+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||M.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),M.push(",.*:")})),(x.matchesSelector=gt.test(O=L.matches||L.webkitMatchesSelector||L.mozMatchesSelector||L.oMatchesSelector||L.msMatchesSelector))&&i(function(e){x.disconnectedMatch=O.call(e,"div"),O.call(e,"[s!='']:x"),P.push("!=",at)}),M=M.length&&new RegExp(M.join("|")),P=P.length&&new RegExp(P.join("|")),t=gt.test(L.compareDocumentPosition),I=t||gt.test(L.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return A=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r?r:(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&r||!x.sortDetached&&t.compareDocumentPosition(e)===r?e===n||e.ownerDocument===z&&I(z,e)?-1:t===n||t.ownerDocument===z&&I(z,t)?1:R?tt.call(R,e)-tt.call(R,t):0:4&r?-1:1)}:function(e,t){if(e===t)return A=!0,0;var r,i=0,o=e.parentNode,s=t.parentNode,l=[e],c=[t];if(!o||!s)return e===n?-1:t===n?1:o?-1:s?1:R?tt.call(R,e)-tt.call(R,t):0;if(o===s)return a(e,t);for(r=e;r=r.parentNode;)l.unshift(r);for(r=t;r=r.parentNode;)c.unshift(r);for(;l[i]===c[i];)i++;return i?a(l[i],c[i]):l[i]===z?-1:c[i]===z?1:0},n):D},e.matches=function(t,n){return e(t,null,null,n)},e.matchesSelector=function(t,n){if((t.ownerDocument||t)!==D&&B(t),n=n.replace(ut,"='$1']"),!(!x.matchesSelector||!H||P&&P.test(n)||M&&M.test(n)))try{var r=O.call(t,n);if(r||x.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(i){}return e(n,D,null,[t]).length>0},e.contains=function(e,t){return(e.ownerDocument||e)!==D&&B(e),I(e,t)},e.attr=function(e,n){(e.ownerDocument||e)!==D&&B(e);var r=w.attrHandle[n.toLowerCase()],i=r&&G.call(w.attrHandle,n.toLowerCase())?r(e,n,!H):t;return i!==t?i:x.attributes||!H?e.getAttribute(n):(i=e.getAttributeNode(n))&&i.specified?i.value:null},e.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},e.uniqueSort=function(e){var t,n=[],r=0,i=0;if(A=!x.detectDuplicates,R=!x.sortStable&&e.slice(0),e.sort(j),A){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return R=null,e},_=e.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=_(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=_(t);return n},w=e.selectors={cacheLength:50,createPseudo:r,match:pt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Ct,xt),e[3]=(e[3]||e[4]||e[5]||"").replace(Ct,xt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||e.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&e.error(t[0]),t},PSEUDO:function(e){var t,n=!e[6]&&e[2];return pt.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&dt.test(n)&&(t=N(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Ct,xt).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=U[e+" "];return t||(t=new RegExp("(^|"+rt+")"+e+"("+rt+"|$)"))&&U(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Y&&e.getAttribute("class")||"")})},ATTR:function(t,n,r){return function(i){var o=e.attr(i,t);return null==o?"!="===n:n?(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o+" ").indexOf(r)>-1:"|="===n?o===r||o.slice(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,f,p,h,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;h=m="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?g.firstChild:g.lastChild],a&&y){for(u=g[F]||(g[F]={}),c=u[e]||[],p=c[0]===W&&c[1],f=c[0]===W&&c[2],d=p&&g.childNodes[p];d=++p&&d&&d[m]||(f=p=0)||h.pop();)if(1===d.nodeType&&++f&&d===t){u[e]=[W,p,f];break}}else if(y&&(c=(t[F]||(t[F]={}))[e])&&c[0]===W)f=c[1];else for(;(d=++p&&d&&d[m]||(f=p=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++f||(y&&((d[F]||(d[F]={}))[e]=[W,f]),d!==t)););return f-=i,f===r||f%r===0&&f/r>=0}}},PSEUDO:function(t,n){var i,o=w.pseudos[t]||w.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return o[F]?o(n):o.length>1?(i=[t,t,"",n],w.setFilters.hasOwnProperty(t.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=tt.call(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=k(e.replace(st,"$1"));return i[F]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),!n.pop()}}),has:r(function(t){return function(n){return e(t,n).length>0}}),contains:r(function(e){return e=e.replace(Ct,xt),function(t){return(t.textContent||t.innerText||_(t)).indexOf(e)>-1}}),lang:r(function(t){return ft.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(Ct,xt).toLowerCase(),function(e){var n;do if(n=H?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return n=n.toLowerCase(),n===t||0===n.indexOf(t+"-");while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===L},focus:function(e){return e===D.activeElement&&(!D.hasFocus||D.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!w.pseudos.empty(e)},header:function(e){return mt.test(e.nodeName)},input:function(e){return ht.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;++r2&&"ID"===(a=o[0]).type&&x.getById&&9===t.nodeType&&H&&w.relative[o[1].type]){if(t=(w.find.ID(a.matches[0].replace(Ct,xt),t)||[])[0],!t)return n;c&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=pt.needsContext.test(e)?0:o.length;i--&&(a=o[i],!w.relative[s=a.type]);)if((l=w.find[s])&&(r=l(a.matches[0].replace(Ct,xt),yt.test(o[0].type)&&u(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&f(o),!e)return Z.apply(n,r),n;break}}return(c||k(e,d))(r,t,!H,n,yt.test(e)&&u(t.parentNode)||t),n},x.sortStable=F.split("").sort(j).join("")===F,x.detectDuplicates=!!A,B(),x.sortDetached=i(function(e){return 1&e.compareDocumentPosition(D.createElement("div"))}),i(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),x.attributes&&i(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(nt,function(e,t,n){var r;return n?void 0:e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),e}),r(u,[],function(){function e(e){return null===e||e===t?"":(""+e).replace(m,"")}function n(e,n){return n?"array"==n&&g(e)?!0:typeof e==n:e!==t}function r(e){var t=e,n,r;if(!g(e))for(t=[],n=0,r=e.length;r>n;n++)t[n]=e[n];return t}function i(e,t,n){var r;for(e=e||[],t=t||",","string"==typeof e&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n}function o(e,n,r){var i,o;if(!e)return 0;if(r=r||e,e.length!==t){for(i=0,o=e.length;o>i;i++)if(n.call(r,e[i],i,e)===!1)return 0}else for(i in e)if(e.hasOwnProperty(i)&&n.call(r,e[i],i,e)===!1)return 0;return 1}function a(e,t){var n=[];return o(e,function(e){n.push(t(e))}),n}function s(e,t){var n=[];return o(e,function(e){(!t||t(e))&&n.push(e)}),n}function l(e,t,n){var r=this,i,o,a,s,l,c=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),a=e[3].match(/(^|\.)(\w+)$/i)[2],o=r.createNS(e[3].replace(/\.\w+$/,""),n),!o[a]){if("static"==e[2])return o[a]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[a]));t[a]||(t[a]=function(){},c=1),o[a]=t[a],r.extend(o[a].prototype,t),e[5]&&(i=r.resolve(e[5]).prototype,s=e[5].match(/\.(\w+)$/i)[1],l=o[a],o[a]=c?function(){return i[s].apply(this,arguments)}:function(){return this.parent=i[s],l.apply(this,arguments)},o[a].prototype[a]=o[a],r.each(i,function(e,t){o[a].prototype[t]=i[t]}),r.each(t,function(e,t){i[t]?o[a].prototype[t]=function(){return this.parent=i[t],e.apply(this,arguments)}:t!=a&&(o[a].prototype[t]=e)})),r.each(t["static"],function(e,t){o[a][t]=e})}}function c(e,t){var n,r;if(e)for(n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}function u(e,n){var r,i,o,a=arguments,s;for(r=1,i=a.length;i>r;r++){n=a[r];for(o in n)n.hasOwnProperty(o)&&(s=n[o],s!==t&&(e[o]=s))}return e}function d(e,t,n,r){r=r||this,e&&(n&&(e=e[n]),o(e,function(e,i){return t.call(r,e,i,n)===!1?!1:void d(e,t,n,r)}))}function f(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;nn&&(t=t[e[n]],t);n++);return t}function h(t,r){return!t||n(t,"array")?t:a(t.split(r||","),e)}var m=/^\s*|\s*$/g,g=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return{trim:e,isArray:g,is:n,toArray:r,makeMap:i,each:o,map:a,grep:s,inArray:c,extend:u,create:l,walk:d,createNS:f,resolve:p,explode:h}}),r(d,[],function(){var e=navigator,t=e.userAgent,n,r,i,o,a,s,l;n=window.opera&&window.opera.buildNumber,r=/WebKit/.test(t),i=!r&&!n&&/MSIE/gi.test(t)&&/Explorer/gi.test(e.appName),i=i&&/MSIE (\w+)\./.exec(t)[1],o=-1==t.indexOf("Trident/")||-1==t.indexOf("rv:")&&-1==e.appName.indexOf("Netscape")?!1:11,i=i||o,a=!r&&!o&&/Gecko/.test(t),s=-1!=t.indexOf("Mac"),l=/(iPad|iPhone)/.test(t);var c=!l||t.match(/AppleWebKit\/(\d*)/)[1]>=534;return{opera:n,webkit:r,ie:i,gecko:a,mac:s,iOS:l,contentEditable:c,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!=i,range:window.getSelection&&"Range"in window,documentMode:i?document.documentMode||7:10}}),r(f,[l,c,u,d],function(e,n,r,i){function o(e){return"undefined"!=typeof e}function a(e){return"string"==typeof e}function s(e,t){var n,r,i;for(t=t||x,i=t.createElement("div"),n=t.createDocumentFragment(),i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return n}function l(e,t,n,r){var i;if(a(t))t=s(t,g(e[0]));else if(t.length&&!t.nodeType){if(t=d.makeArray(t),r)for(i=t.length-1;i>=0;i--)l(e,t[i],n,r);else for(i=0;ii&&(a=e[i],t.call(a,i,a)!==!1);i++);return e}function m(e,t){var n=[];return h(e,function(e,r){t(r,e)&&n.push(r)}),n}function g(e){return e?9==e.nodeType?e:e.ownerDocument:x}function v(e,n,r){var i=[],o=e[n];for("string"!=typeof r&&r instanceof d&&(r=r[0]);o&&9!==o.nodeType;){if(r!==t){if(o===r)break;if("string"==typeof r&&d(o).is(r))break}1===o.nodeType&&i.push(o),o=o[n]}return i}function y(e,n,r,i){var o=[];for(i instanceof d&&(i=i[0]);e;e=e[n])if(!r||e.nodeType===r){if(i!==t){if(e===i)break;if("string"==typeof i&&d(e).is(i))break}o.push(e)}return o}function b(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType==n)return e;return null}function C(e,t,n){h(n,function(n,r){e[n]=e[n]||{},e[n][t]=r})}var x=document,w=Array.prototype.push,_=Array.prototype.slice,E=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,N=e.Event,k,S=r.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),T=r.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),R={"for":"htmlFor","class":"className",readonly:"readOnly"},A={"float":"cssFloat"},B={},D={},L=/^\s*|\s*$/g;return d.fn=d.prototype={constructor:d,selector:"",context:null,length:0,init:function(e,t){var n=this,r,i;if(!e)return n;if(e.nodeType)return n.context=n[0]=e,n.length=1,n;if(t&&t.nodeType)n.context=t;else{if(t)return d(e).attr(t);n.context=t=document}if(a(e)){if(n.selector=e,r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:E.exec(e),!r)return d(t).find(e);if(r[1])for(i=s(e,g(t)).firstChild;i;)w.call(n,i),i=i.nextSibling;else{if(i=g(t).getElementById(r[2]),!i)return n;if(i.id!==r[2])return n.find(e);n.length=1,n[0]=i}}else this.add(e,!1);return n},toArray:function(){return r.toArray(this)},add:function(e,t){var n=this,r,i;if(a(e))return n.add(d(e));if(e.nodeType)return n.add([e]);if(t!==!1)for(r=d.unique(n.toArray().concat(d.makeArray(e))),n.length=r.length,i=0;it;t++)d.find(e,this[t],r);return d(r)},filter:function(e){return d("function"==typeof e?m(this.toArray(),function(t,n){return e(n,t)}):d.filter(e,this.toArray()))},closest:function(e){var t=[];return e instanceof d&&(e=e[0]),this.each(function(n,r){for(;r;){if("string"==typeof e&&d(r).is(e)){t.push(r);break}if(r==e){t.push(r);break}r=r.parentNode}}),d(t)},offset:function(e){var t,n,r,i=0,o=0,a;return e?this.css(e):(t=this[0],t&&(n=t.ownerDocument,r=n.documentElement,t.getBoundingClientRect&&(a=t.getBoundingClientRect(),i=a.left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,o=a.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:o})},push:w,sort:[].sort,splice:[].splice},r.extend(d,{extend:r.extend,makeArray:r.toArray,inArray:f,isArray:r.isArray,each:h,trim:p,grep:m,find:n,expr:n.selectors,unique:n.uniqueSort,text:n.getText,contains:n.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!=t[r].nodeType&&t.splice(r,1);return t=1===t.length?d.find.matchesSelector(t[0],e)?[t[0]]:[]:d.find.matches(e,t)}}),h({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return v(e,"parentNode")},next:function(e){return b(e,"nextSibling",1)},prev:function(e){return b(e,"previousSibling",1)},children:function(e){return y(e.firstChild,"nextSibling",1)},contents:function(e){return r.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,t){d.fn[e]=function(n){var r=this,i=[];return r.each(function(){var e=t.call(i,this,n,i);e&&(d.isArray(e)?i.push.apply(i,e):i.push(e))}),this.length>1&&(i=d.unique(i),0===e.indexOf("parents")&&(i=i.reverse())),i=d(i),n?i.filter(n):i}}),h({parentsUntil:function(e,t){return v(e,"parentNode",t)},nextUntil:function(e,t){return y(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return y(e,"previousSibling",1,t).slice(1)}},function(e,t){d.fn[e]=function(n,r){var i=this,o=[];return i.each(function(){var e=t.call(o,this,n,o);e&&(d.isArray(e)?o.push.apply(o,e):o.push(e))}),this.length>1&&(o=d.unique(o),(0===e.indexOf("parents")||"prevUntil"===e)&&(o=o.reverse())),o=d(o),r?o.filter(r):o}}),d.fn.is=function(e){return!!e&&this.filter(e).length>0},d.fn.init.prototype=d.fn,d.overrideDefaults=function(e){function t(r,i){return n=n||e(),0===arguments.length&&(r=n.element),i||(i=n.context),new t.fn.init(r,i)}var n;return d.extend(t,this),t},i.ie&&i.ie<8&&(C(B,"get",{maxlength:function(e){var t=e.maxLength;return 2147483647===t?k:t},size:function(e){var t=e.size;return 20===t?k:t},"class":function(e){return e.className},style:function(e){var t=e.style.cssText;return 0===t.length?k:t}}),C(B,"set",{"class":function(e,t){e.className=t},style:function(e,t){e.style.cssText=t}})),i.ie&&i.ie<9&&(A["float"]="styleFloat",C(D,"set",{opacity:function(e,t){var n=e.style;null===t||""===t?n.removeAttribute("filter"):(n.zoom=1,n.filter="alpha(opacity="+100*t+")")}})),d.attrHooks=B,d.cssHooks=D,d}),r(p,[],function(){return function(e,t){function n(e,t,n,r){function i(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+i(t)+i(n)+i(r)}var r=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,i=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,o=/\s*([^:]+):\s*([^;]+);?/g,a=/\s+$/,s,l,c={},u,d,f,p="\ufeff";for(e=e||{},t&&(d=t.getValidStyles(),f=t.getInvalidStyles()),u=("\\\" \\' \\; \\: ; : "+p).split(" "),l=0;l-1&&n||(m[e+t]=-1==l?s[0]:s.join(" "),delete m[e+"-top"+t],delete m[e+"-right"+t],delete m[e+"-bottom"+t],delete m[e+"-left"+t])}}function u(e){var t=m[e],n;if(t){for(t=t.split(" "),n=t.length;n--;)if(t[n]!==t[0])return!1;return m[e]=t[0],!0}}function d(e,t,n,r){u(t)&&u(n)&&u(r)&&(m[e]=m[t]+" "+m[n]+" "+m[r],delete m[t],delete m[n],delete m[r])}function f(e){return b=!0,c[e]}function p(e,t){return b&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return c[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e}function h(t,n,r,i,o,a){if(o=o||a)return o=p(o),"'"+o.replace(/\'/g,"\\'")+"'";if(n=p(n||r||i),!e.allow_script_urls){var s=n.replace(/[\s\r\n]+/,"");if(/(java|vb)script:/i.test(s))return"";if(!e.allow_svg_data_urls&&/^data:image\/svg/i.test(s))return""}return C&&(n=C.call(x,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"}var m={},g,v,y,b,C=e.url_converter,x=e.url_converter_scope||this;if(t){for(t=t.replace(/[\u0000-\u001F]/g,""),t=t.replace(/\\[\"\';:\uFEFF]/g,f).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,f)});g=o.exec(t);){if(v=g[1].replace(a,"").toLowerCase(),y=g[2].replace(a,""),y=y.replace(/\\[0-9a-f]+/g,function(e){return String.fromCharCode(parseInt(e.substr(1),16))}),v&&y.length>0){if(!e.allow_script_urls&&("behavior"==v||/expression\s*\(|\/\*|\*\//.test(y)))continue;"font-weight"===v&&"700"===y?y="bold":("color"===v||"background-color"===v)&&(y=y.toLowerCase()),y=y.replace(r,n),y=y.replace(i,h),m[v]=b?p(y,!0):y}o.lastIndex=g.index+g[0].length}s("border","",!0),s("border","-width"),s("border","-color"),s("border","-style"),s("padding",""),s("margin",""),d("border","border-width","border-style","border-color"),"medium none"===m.border&&delete m.border,"none"===m["border-image"]&&delete m["border-image"]}return m},serialize:function(e,t){function n(t){var n,r,o,a;if(n=d[t])for(r=0,o=n.length;o>r;r++)t=n[r],a=e[t],a!==s&&a.length>0&&(i+=(i.length>0?" ":"")+t+": "+a+";")}function r(e,t){var n;return n=f["*"],n&&n[e]?!1:(n=f[t],n&&n[e]?!1:!0)}var i="",o,a;if(t&&d)n("*"),n(t);else for(o in e)a=e[o],a!==s&&a.length>0&&(!f||r(o,t))&&(i+=(i.length>0?" ":"")+o+": "+a+";");return i}}}}),r(h,[],function(){return function(e,t){function n(e,n,r,i){var o,a;if(e){if(!i&&e[n])return e[n];if(e!=t){if(o=e[r])return o;for(a=e.parentNode;a&&a!=t;a=a.parentNode)if(o=a[r])return o}}}var r=e;this.current=function(){return r},this.next=function(e){return r=n(r,"firstChild","nextSibling",e)},this.prev=function(e){return r=n(r,"lastChild","previousSibling",e)}}}),r(m,[u],function(e){function t(n){function r(){return M.createDocumentFragment()}function i(e,t){_(F,e,t)}function o(e,t){_(z,e,t)}function a(e){i(e.parentNode,j(e))}function s(e){i(e.parentNode,j(e)+1)}function l(e){o(e.parentNode,j(e))}function c(e){o(e.parentNode,j(e)+1)}function u(e){e?(H[U]=H[V],H[$]=H[W]):(H[V]=H[U],H[W]=H[$]),H.collapsed=F}function d(e){a(e),c(e)}function f(e){i(e,0),o(e,1===e.nodeType?e.childNodes.length:e.nodeValue.length)}function p(e,t){var n=H[V],r=H[W],i=H[U],o=H[$],a=t.startContainer,s=t.startOffset,l=t.endContainer,c=t.endOffset;return 0===e?w(n,r,a,s):1===e?w(i,o,a,s):2===e?w(i,o,l,c):3===e?w(n,r,l,c):void 0}function h(){E(I)}function m(){return E(P)}function g(){return E(O)}function v(e){var t=this[V],r=this[W],i,o;3!==t.nodeType&&4!==t.nodeType||!t.nodeValue?(t.childNodes.length>0&&(o=t.childNodes[r]),o?t.insertBefore(e,o):3==t.nodeType?n.insertAfter(e,t):t.appendChild(e)):r?r>=t.nodeValue.length?n.insertAfter(e,t):(i=t.splitText(r),t.parentNode.insertBefore(e,i)):t.parentNode.insertBefore(e,t)}function y(e){var t=H.extractContents();H.insertNode(e),e.appendChild(t),H.selectNode(e)}function b(){return q(new t(n),{startContainer:H[V],startOffset:H[W],endContainer:H[U],endOffset:H[$],collapsed:H.collapsed,commonAncestorContainer:H.commonAncestorContainer})}function C(e,t){var n;if(3==e.nodeType)return e;if(0>t)return e;for(n=e.firstChild;n&&t>0;)--t,n=n.nextSibling;return n?n:e}function x(){return H[V]==H[U]&&H[W]==H[$]}function w(e,t,r,i){var o,a,s,l,c,u;if(e==r)return t==i?0:i>t?-1:1;for(o=r;o&&o.parentNode!=e;)o=o.parentNode;if(o){for(a=0,s=e.firstChild;s!=o&&t>a;)a++,s=s.nextSibling;return a>=t?-1:1}for(o=e;o&&o.parentNode!=r;)o=o.parentNode;if(o){for(a=0,s=r.firstChild;s!=o&&i>a;)a++,s=s.nextSibling;return i>a?-1:1}for(l=n.findCommonAncestor(e,r),c=e;c&&c.parentNode!=l;)c=c.parentNode;for(c||(c=l),u=r;u&&u.parentNode!=l;)u=u.parentNode;if(u||(u=l),c==u)return 0;for(s=l.firstChild;s;){if(s==c)return-1;if(s==u)return 1;s=s.nextSibling}}function _(e,t,r){var i,o;for(e?(H[V]=t,H[W]=r):(H[U]=t,H[$]=r),i=H[U];i.parentNode;)i=i.parentNode;for(o=H[V];o.parentNode;)o=o.parentNode;o==i?w(H[V],H[W],H[U],H[$])>0&&H.collapse(e):H.collapse(e),H.collapsed=x(),H.commonAncestorContainer=n.findCommonAncestor(H[V],H[U])}function E(e){var t,n=0,r=0,i,o,a,s,l,c;if(H[V]==H[U])return N(e);for(t=H[U],i=t.parentNode;i;t=i,i=i.parentNode){if(i==H[V])return k(t,e);++n}for(t=H[V],i=t.parentNode;i;t=i,i=i.parentNode){if(i==H[U])return S(t,e);++r}for(o=r-n,a=H[V];o>0;)a=a.parentNode,o--;for(s=H[U];0>o;)s=s.parentNode,o++;for(l=a.parentNode,c=s.parentNode;l!=c;l=l.parentNode,c=c.parentNode)a=l,s=c;return T(a,s,e)}function N(e){var t,n,i,o,a,s,l,c,u;if(e!=I&&(t=r()),H[W]==H[$])return t;if(3==H[V].nodeType){if(n=H[V].nodeValue,i=n.substring(H[W],H[$]),e!=O&&(o=H[V],c=H[W],u=H[$]-H[W],0===c&&u>=o.nodeValue.length-1?o.parentNode.removeChild(o):o.deleteData(c,u),H.collapse(F)),e==I)return;return i.length>0&&t.appendChild(M.createTextNode(i)),t}for(o=C(H[V],H[W]),a=H[$]-H[W];o&&a>0;)s=o.nextSibling,l=D(o,e),t&&t.appendChild(l),--a,o=s;return e!=O&&H.collapse(F),t}function k(e,t){var n,i,o,a,s,l;if(t!=I&&(n=r()),i=R(e,t),n&&n.appendChild(i),o=j(e),a=o-H[W],0>=a)return t!=O&&(H.setEndBefore(e),H.collapse(z)),n;for(i=e.previousSibling;a>0;)s=i.previousSibling,l=D(i,t),n&&n.insertBefore(l,n.firstChild),--a,i=s;return t!=O&&(H.setEndBefore(e),H.collapse(z)),n}function S(e,t){var n,i,o,a,s,l;for(t!=I&&(n=r()),o=A(e,t),n&&n.appendChild(o),i=j(e),++i,a=H[$]-i,o=e.nextSibling;o&&a>0;)s=o.nextSibling,l=D(o,t),n&&n.appendChild(l),--a,o=s;return t!=O&&(H.setStartAfter(e),H.collapse(F)),n}function T(e,t,n){var i,o,a,s,l,c,u;for(n!=I&&(o=r()),i=A(e,n),o&&o.appendChild(i),a=j(e),s=j(t),++a,l=s-a,c=e.nextSibling;l>0;)u=c.nextSibling,i=D(c,n),o&&o.appendChild(i),c=u,--l;return i=R(t,n),o&&o.appendChild(i),n!=O&&(H.setStartAfter(e),H.collapse(F)),o}function R(e,t){var n=C(H[U],H[$]-1),r,i,o,a,s,l=n!=H[U];if(n==e)return B(n,l,z,t);for(r=n.parentNode,i=B(r,z,z,t);r;){for(;n;)o=n.previousSibling,a=B(n,l,z,t),t!=I&&i.insertBefore(a,i.firstChild),l=F,n=o;if(r==e)return i;n=r.previousSibling,r=r.parentNode,s=B(r,z,z,t),t!=I&&s.appendChild(i),i=s}}function A(e,t){var n=C(H[V],H[W]),r=n!=H[V],i,o,a,s,l;if(n==e)return B(n,r,F,t);for(i=n.parentNode,o=B(i,z,F,t);i;){for(;n;)a=n.nextSibling,s=B(n,r,F,t),t!=I&&o.appendChild(s),r=F,n=a;if(i==e)return o;n=i.nextSibling,i=i.parentNode,l=B(i,z,F,t),t!=I&&l.appendChild(o),o=l}}function B(e,t,r,i){var o,a,s,l,c;if(t)return D(e,i);if(3==e.nodeType){if(o=e.nodeValue,r?(l=H[W],a=o.substring(l),s=o.substring(0,l)):(l=H[$],a=o.substring(0,l),s=o.substring(l)),i!=O&&(e.nodeValue=s),i==I)return;return c=n.clone(e,z),c.nodeValue=a,c}if(i!=I)return n.clone(e,z)}function D(e,t){return t!=I?t==O?n.clone(e,F):e:void e.parentNode.removeChild(e)}function L(){return n.create("body",null,g()).outerText}var H=this,M=n.doc,P=0,O=1,I=2,F=!0,z=!1,W="startOffset",V="startContainer",U="endContainer",$="endOffset",q=e.extend,j=n.nodeIndex;return q(H,{startContainer:M,startOffset:0,endContainer:M,endOffset:0,collapsed:F,commonAncestorContainer:M,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:i,setEnd:o,setStartBefore:a,setStartAfter:s,setEndBefore:l,setEndAfter:c,collapse:u,selectNode:d,selectNodeContents:f,compareBoundaryPoints:p,deleteContents:h,extractContents:m,cloneContents:g,insertNode:v,surroundContents:y,cloneRange:b,toStringIE:L}),H}return t.prototype.toString=function(){return this.toStringIE()},t}),r(g,[u],function(e){function t(e){var t;return t=document.createElement("div"),t.innerHTML=e,t.textContent||t.innerText||e}function n(e,t){var n,r,i,a={};if(e){for(e=e.split(","),t=t||10,n=0;n\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,l=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=/[<>&\"\']/g,u=/&(#x|#)?([\w]+);/g,d={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};o={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},a={"<":"<",">":">","&":"&",""":'"',"'":"'"},i=n("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);var f={encodeRaw:function(e,t){return e.replace(t?s:l,function(e){return o[e]||e})},encodeAllRaw:function(e){return(""+e).replace(c,function(e){return o[e]||e})},encodeNumeric:function(e,t){return e.replace(t?s:l,function(e){return e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":o[e]||"&#"+e.charCodeAt(0)+";"})},encodeNamed:function(e,t,n){return n=n||i,e.replace(t?s:l,function(e){return o[e]||n[e]||e})},getEncodeFunc:function(e,t){function a(e,n){return e.replace(n?s:l,function(e){return o[e]||t[e]||"&#"+e.charCodeAt(0)+";"||e})}function c(e,n){return f.encodeNamed(e,n,t)}return t=n(t)||i,e=r(e.replace(/\+/g,",")),e.named&&e.numeric?a:e.named?t?c:f.encodeNamed:e.numeric?f.encodeNumeric:f.encodeRaw},decode:function(e){return e.replace(u,function(e,n,r){return n?(r=parseInt(r,2===n.length?16:10),r>65535?(r-=65536,String.fromCharCode(55296+(r>>10),56320+(1023&r))):d[r]||String.fromCharCode(r)):a[e]||i[e]||t(e)})}};return f}),r(v,[],function(){return function(e,t){function n(t){e.getElementsByTagName("head")[0].appendChild(t)}function r(t,r,s){function l(){for(var e=v.passed,t=e.length;t--;)e[t]();v.status=2,v.passed=[],v.failed=[]}function c(){for(var e=v.failed,t=e.length;t--;)e[t]();v.status=3,v.passed=[],v.failed=[]}function u(){var e=navigator.userAgent.match(/WebKit\/(\d*)/);return!!(e&&e[1]<536)}function d(e,t){e()||((new Date).getTime()-g0)return m=e.createElement("style"),m.textContent='@import "'+t+'"',p(),void n(m);f()}n(h),h.href=t}}var i=0,o={},a;t=t||{},a=t.maxLoadTime||5e3,this.load=r}}),r(y,[c,f,p,l,h,m,g,d,u,v],function(e,n,r,i,o,a,s,l,c,u){function d(e,t){var n={},r=t.keep_values,i;return i={set:function(n,r,i){t.url_converter&&(r=t.url_converter.call(t.url_converter_scope||e,r,i,n[0])),n.attr("data-mce-"+i,r).attr(i,r)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}},n={style:{set:function(e,t){return null!==t&&"object"==typeof t?void e.css(t):(r&&e.attr("data-mce-style",t),void e.attr("style",t))},get:function(t){var n=t.attr("data-mce-style")||t.attr("style");return n=e.serializeStyle(e.parseStyle(n),t[0].nodeName)}}},r&&(n.href=n.src=i),n}function f(e,t){var o=this,a;o.doc=e,o.win=window,o.files={},o.counter=0,o.stdMode=!v||e.documentMode>=8,o.boxModel=!v||"CSS1Compat"==e.compatMode||o.stdMode,o.styleSheetLoader=new u(e),o.boundEvents=[],o.settings=t=t||{},o.schema=t.schema,o.styles=new r({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),o.fixDoc(e),o.events=t.ownEvents?new i(t.proxy):i.Event,o.attrHooks=d(o,t),a=t.schema?t.schema.getBlockElements():{},o.$=n.overrideDefaults(function(){return{context:e,element:o.getRoot()}}),o.isBlock=function(e){if(!e)return!1;var t=e.nodeType;return t?!(1!==t||!a[e.nodeName]):!!a[e]}}var p=c.each,h=c.is,m=c.grep,g=c.trim,v=l.ie,y=/^([a-z0-9],?)+$/i,b=/^[ \t\r\n]*$/;return f.prototype={$$:function(e){return"string"==typeof e&&(e=this.get(e)),this.$(e)},root:null,fixDoc:function(e){var t=this.settings,n;if(v&&t.schema){"abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video".replace(/\w+/g,function(t){e.createElement(t)});for(n in t.schema.getCustomElements())e.createElement(n)}},clone:function(e,t){var n=this,r,i;return!v||1!==e.nodeType||t?e.cloneNode(t):(i=n.doc,t?r.firstChild:(r=i.createElement(e.nodeName),p(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),r))},getRoot:function(){var e=this;return e.settings.root_element||e.doc.body},getViewPort:function(e){var t,n;return e=e?e:this.win,t=e.document,n=this.boxModel?t.documentElement:t.body,{x:e.pageXOffset||n.scrollLeft,y:e.pageYOffset||n.scrollTop,w:e.innerWidth||n.clientWidth,h:e.innerHeight||n.clientHeight}},getRect:function(e){var t=this,n,r;return e=t.get(e),n=t.getPos(e),r=t.getSize(e),{x:n.x,y:n.y,w:r.w,h:r.h}},getSize:function(e){var t=this,n,r;return e=t.get(e),n=t.getStyle(e,"width"),r=t.getStyle(e,"height"),-1===n.indexOf("px")&&(n=0),-1===r.indexOf("px")&&(r=0),{w:parseInt(n,10)||e.offsetWidth||e.clientWidth,h:parseInt(r,10)||e.offsetHeight||e.clientHeight}},getParent:function(e,t,n){return this.getParents(e,t,n,!1)},getParents:function(e,n,r,i){var o=this,a,s=[];for(e=o.get(e),i=i===t,r=r||("BODY"!=o.getRoot().nodeName?o.getRoot().parentNode:null),h(n,"string")&&(a=n,n="*"===n?function(e){return 1==e.nodeType}:function(e){return o.is(e,a)});e&&e!=r&&e.nodeType&&9!==e.nodeType;){if(!n||n(e)){if(!i)return e;s.push(e)}e=e.parentNode}return i?s:null},get:function(e){var t;return e&&this.doc&&"string"==typeof e&&(t=e,e=this.doc.getElementById(e),e&&e.id!==t)?this.doc.getElementsByName(t)[1]:e},getNext:function(e,t){return this._findSib(e,t,"nextSibling")},getPrev:function(e,t){return this._findSib(e,t,"previousSibling")},select:function(t,n){var r=this;return e(t,r.get(n)||r.settings.root_element||r.doc,[])},is:function(n,r){var i;if(n.length===t){if("*"===r)return 1==n.nodeType;if(y.test(r)){for(r=r.toLowerCase().split(/,/),n=n.nodeName.toLowerCase(),i=r.length-1;i>=0;i--)if(r[i]==n)return!0;return!1}}if(n.nodeType&&1!=n.nodeType)return!1;var o=n.nodeType?[n]:n;return e(r,o[0].ownerDocument||o[0],null,o).length>0},add:function(e,t,n,r,i){var o=this;return this.run(e,function(e){var a;return a=h(t,"string")?o.doc.createElement(t):t,o.setAttribs(a,n),r&&(r.nodeType?a.appendChild(r):o.setHTML(a,r)),i?a:e.appendChild(a)})},create:function(e,t,n){return this.add(this.doc.createElement(e),e,t,n,1)},createHTML:function(e,t,n){var r="",i;r+="<"+e;for(i in t)t.hasOwnProperty(i)&&null!==t[i]&&"undefined"!=typeof t[i]&&(r+=" "+i+'="'+this.encode(t[i])+'"');return"undefined"!=typeof n?r+">"+n+"":r+" />"},createFragment:function(e){var t,n,r=this.doc,i;for(i=r.createElement("div"),t=r.createDocumentFragment(),e&&(i.innerHTML=e);n=i.firstChild;)t.appendChild(n);return t},remove:function(e,t){return e=this.$$(e),t?e.each(function(){for(var e;e=this.firstChild;)3==e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}).remove():e.remove(),e.length>1?e.toArray():e[0]},setStyle:function(e,t,n){e=this.$$(e).css(t,n),this.settings.update_styles&&e.attr("data-mce-style",null)},getStyle:function(e,n,r){return e=this.$$(e),r?e.css(n):(n=n.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"float"==n&&(n=v?"styleFloat":"cssFloat"),e[0]&&e[0].style?e[0].style[n]:t)},setStyles:function(e,t){e=this.$$(e).css(t),this.settings.update_styles&&e.attr("data-mce-style",null)},removeAllAttribs:function(e){return this.run(e,function(e){var t,n=e.attributes;for(t=n.length-1;t>=0;t--)e.removeAttributeNode(n.item(t))})},setAttrib:function(e,t,n){var r=this,i,o,a=r.settings;""===n&&(n=null),e=r.$$(e),i=e.attr(t),e.length&&(o=r.attrHooks[t],o&&o.set?o.set(e,n,t):e.attr(t,n),i!=n&&a.onSetAttrib&&a.onSetAttrib({attrElm:e,attrName:t,attrValue:n}))},setAttribs:function(e,t){var n=this;n.$$(e).each(function(e,r){p(t,function(e,t){n.setAttrib(r,t,e)})})},getAttrib:function(e,t,n){var r=this,i,o;return e=r.$$(e),e.length&&(i=r.attrHooks[t],o=i&&i.get?i.get(e,t):e.attr(t)),"undefined"==typeof o&&(o=n||""),o},getPos:function(e,t){var r=this,i=0,o=0,a,s=r.doc,l=s.body,c;if(e=r.get(e),t=t||l,e){if(t===l&&e.getBoundingClientRect&&"static"===n(l).css("position"))return c=e.getBoundingClientRect(),t=r.boxModel?s.documentElement:l,i=c.left+(s.documentElement.scrollLeft||l.scrollLeft)-t.clientLeft,o=c.top+(s.documentElement.scrollTop||l.scrollTop)-t.clientTop,{x:i,y:o};for(a=e;a&&a!=t&&a.nodeType;)i+=a.offsetLeft||0,o+=a.offsetTop||0,a=a.offsetParent;for(a=e.parentNode;a&&a!=t&&a.nodeType;)i-=a.scrollLeft||0,o-=a.scrollTop||0,a=a.parentNode}return{x:i,y:o}},parseStyle:function(e){return this.styles.parse(e)},serializeStyle:function(e,t){return this.styles.serialize(e,t)},addStyle:function(e){var t=this,n=t.doc,r,i;if(t!==f.DOM&&n===document){var o=f.DOM.addedStyles;if(o=o||[],o[e])return;o[e]=!0,f.DOM.addedStyles=o}i=n.getElementById("mceDefaultStyles"),i||(i=n.createElement("style"),i.id="mceDefaultStyles",i.type="text/css",r=n.getElementsByTagName("head")[0],r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i)),i.styleSheet?i.styleSheet.cssText+=e:i.appendChild(n.createTextNode(e))},loadCSS:function(e){var t=this,n=t.doc,r;return t!==f.DOM&&n===document?void f.DOM.loadCSS(e):(e||(e=""),r=n.getElementsByTagName("head")[0],void p(e.split(","),function(e){var i;t.files[e]||(t.files[e]=!0,i=t.create("link",{rel:"stylesheet",href:e}),v&&n.documentMode&&n.recalc&&(i.onload=function(){n.recalc&&n.recalc(),i.onload=null}),r.appendChild(i))}))},addClass:function(e,t){this.$$(e).addClass(t)},removeClass:function(e,t){this.toggleClass(e,t,!1)},hasClass:function(e,t){return this.$$(e).hasClass(t)},toggleClass:function(e,t,r){this.$$(e).toggleClass(t,r).each(function(){""===this.className&&n(this).attr("class",null)})},show:function(e){this.$$(e).show()},hide:function(e){this.$$(e).hide()},isHidden:function(e){return"none"==this.$$(e).css("display")},uniqueId:function(e){return(e?e:"mce_")+this.counter++},setHTML:function(e,t){e=this.$$(e),v?e.each(function(e,r){if(r.canHaveHTML!==!1){for(;r.firstChild;)r.removeChild(r.firstChild);try{r.innerHTML="
"+t,r.removeChild(r.firstChild)}catch(i){n("
").html("
"+t).contents().slice(1).appendTo(r)}return t}}):e.html(t)},getOuterHTML:function(e){return e=this.get(e),1==e.nodeType?e.outerHTML:n("
").append(n(e).clone()).html()},setOuterHTML:function(e,t){var r=this;r.$$(e).each(function(){try{this.outerHTML=t}catch(e){r.remove(n(this).html(t),!0)}})},decode:s.decode,encode:s.encodeAllRaw,insertAfter:function(e,t){return t=this.get(t),this.run(e,function(e){var n,r;return n=t.parentNode,r=t.nextSibling,r?n.insertBefore(e,r):n.appendChild(e),e})},replace:function(e,t,n){var r=this;return r.run(t,function(t){return h(t,"array")&&(e=e.cloneNode(!0)),n&&p(m(t.childNodes),function(t){e.appendChild(t)}),t.parentNode.replaceChild(e,t)})},rename:function(e,t){var n=this,r;return e.nodeName!=t.toUpperCase()&&(r=n.create(t),p(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),n.replace(r,e,1)),r||e},findCommonAncestor:function(e,t){for(var n=e,r;n;){for(r=t;r&&n!=r;)r=r.parentNode;if(n==r)break;n=n.parentNode}return!n&&e.ownerDocument?e.ownerDocument.documentElement:n},toHex:function(e){return this.styles.toHex(c.trim(e))},run:function(e,t,n){var r=this,i;return"string"==typeof e&&(e=r.get(e)),e?(n=n||this,e.nodeType||!e.length&&0!==e.length?t.call(n,e):(i=[],p(e,function(e,o){e&&("string"==typeof e&&(e=r.get(e)),i.push(t.call(n,e,o)))}),i)):!1},getAttribs:function(e){var t;if(e=this.get(e),!e)return[];if(v){if(t=[],"OBJECT"==e.nodeName)return e.attributes;"OPTION"===e.nodeName&&this.getAttrib(e,"selected")&&t.push({specified:1,nodeName:"selected"});var n=/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi;return e.cloneNode(!1).outerHTML.replace(n,"").replace(/[\w:\-]+/gi,function(e){t.push({specified:1,nodeName:e})}),t}return e.attributes},isEmpty:function(e,t){var n=this,r,i,a,s,l,c=0;if(e=e.firstChild){s=new o(e,e.parentNode),t=t||(n.schema?n.schema.getNonEmptyElements():null);do{if(a=e.nodeType,1===a){if(e.getAttribute("data-mce-bogus"))continue;if(l=e.nodeName.toLowerCase(),t&&t[l]){if("br"===l){c++;continue}return!1}for(i=n.getAttribs(e),r=i.length;r--;)if(l=i[r].nodeName,"name"===l||"data-mce-bookmark"===l)return!1}if(8==a)return!1;if(3===a&&!b.test(e.nodeValue))return!1}while(e=s.next())}return 1>=c},createRng:function(){var e=this.doc;return e.createRange?e.createRange():new a(this)},nodeIndex:function(e,t){var n=0,r,i;if(e)for(r=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)i=e.nodeType,(!t||3!=i||i!=r&&e.nodeValue.length)&&(n++,r=i);return n},split:function(e,t,n){function r(e){function t(e){var t=e.previousSibling&&"SPAN"==e.previousSibling.nodeName,n=e.nextSibling&&"SPAN"==e.nextSibling.nodeName;return t&&n}var n,o=e.childNodes,a=e.nodeType;if(1!=a||"bookmark"!=e.getAttribute("data-mce-type")){for(n=o.length-1;n>=0;n--)r(o[n]);if(9!=a){if(3==a&&e.nodeValue.length>0){var s=g(e.nodeValue).length;if(!i.isBlock(e.parentNode)||s>0||0===s&&t(e))return}else if(1==a&&(o=e.childNodes,1==o.length&&o[0]&&1==o[0].nodeType&&"bookmark"==o[0].getAttribute("data-mce-type")&&e.parentNode.insertBefore(o[0],e),o.length||/^(br|hr|input|img)$/i.test(e.nodeName)))return; -i.remove(e)}return e}}var i=this,o=i.createRng(),a,s,l;return e&&t?(o.setStart(e.parentNode,i.nodeIndex(e)),o.setEnd(t.parentNode,i.nodeIndex(t)),a=o.extractContents(),o=i.createRng(),o.setStart(t.parentNode,i.nodeIndex(t)+1),o.setEnd(e.parentNode,i.nodeIndex(e)+1),s=o.extractContents(),l=e.parentNode,l.insertBefore(r(a),e),n?l.replaceChild(n,t):l.insertBefore(t,e),l.insertBefore(r(s),e),i.remove(e),n||t):void 0},bind:function(e,t,n,r){var i=this;if(c.isArray(e)){for(var o=e.length;o--;)e[o]=i.bind(e[o],t,n,r);return e}return!i.settings.collect||e!==i.doc&&e!==i.win||i.boundEvents.push([e,t,n,r]),i.events.bind(e,t,n,r||i)},unbind:function(e,t,n){var r=this,i;if(c.isArray(e)){for(i=e.length;i--;)e[i]=r.unbind(e[i],t,n);return e}if(r.boundEvents&&(e===r.doc||e===r.win))for(i=r.boundEvents.length;i--;){var o=r.boundEvents[i];e!=o[0]||t&&t!=o[1]||n&&n!=o[2]||this.events.unbind(o[0],o[1],o[2])}return this.events.unbind(e,t,n)},fire:function(e,t,n){return this.events.fire(e,t,n)},getContentEditable:function(e){var t;return e&&1==e.nodeType?(t=e.getAttribute("data-mce-contenteditable"),t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null):null},getContentEditableParent:function(e){for(var t=this.getRoot(),n=null;e&&e!==t&&(n=this.getContentEditable(e),null===n);e=e.parentNode);return n},destroy:function(){var t=this;if(t.boundEvents){for(var n=t.boundEvents.length;n--;){var r=t.boundEvents[n];this.events.unbind(r[0],r[1],r[2])}t.boundEvents=null}e.setDocument&&e.setDocument(),t.win=t.doc=t.root=t.events=t.frag=null},isChildOf:function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset},_findSib:function(e,t,n){var r=this,i=t;if(e)for("string"==typeof i&&(i=function(e){return r.is(e,t)}),e=e[n];e;e=e[n])if(i(e))return e;return null}},f.DOM=new f(document),f}),r(b,[y,u],function(e,t){function n(){function e(e,t){function n(){o.remove(s),a&&(a.onreadystatechange=a.onload=a=null),t()}function i(){"undefined"!=typeof console&&console.log&&console.log("Failed to load: "+e)}var o=r,a,s;s=o.uniqueId(),a=document.createElement("script"),a.id=s,a.type="text/javascript",a.src=e,"onreadystatechange"in a?a.onreadystatechange=function(){/loaded|complete/.test(a.readyState)&&n()}:a.onload=n,a.onerror=i,(document.getElementsByTagName("head")[0]||document.body).appendChild(a)}var t=0,n=1,a=2,s={},l=[],c={},u=[],d=0,f;this.isDone=function(e){return s[e]==a},this.markDone=function(e){s[e]=a},this.add=this.load=function(e,n,r){var i=s[e];i==f&&(l.push(e),s[e]=t),n&&(c[e]||(c[e]=[]),c[e].push({func:n,scope:r||this}))},this.loadQueue=function(e,t){this.loadScripts(l,e,t)},this.loadScripts=function(t,r,l){function p(e){i(c[e],function(e){e.func.call(e.scope)}),c[e]=f}var h;u.push({func:r,scope:l||this}),(h=function(){var r=o(t);t.length=0,i(r,function(t){return s[t]==a?void p(t):void(s[t]!=n&&(s[t]=n,d++,e(t,function(){s[t]=a,d--,p(t),h()})))}),d||(i(u,function(e){e.func.call(e.scope)}),u.length=0)})()}}var r=e.DOM,i=t.each,o=t.grep;return n.ScriptLoader=new n,n}),r(C,[b,u],function(e,n){function r(){var e=this;e.items=[],e.urls={},e.lookup={}}var i=n.each;return r.prototype={get:function(e){return this.lookup[e]?this.lookup[e].instance:t},dependencies:function(e){var t;return this.lookup[e]&&(t=this.lookup[e].dependencies),t||[]},requireLangPack:function(t,n){var i=r.language;if(i&&r.languageLoad!==!1){if(n)if(n=","+n+",",-1!=n.indexOf(","+i.substr(0,2)+","))i=i.substr(0,2);else if(-1==n.indexOf(","+i+","))return;e.ScriptLoader.add(this.urls[t]+"/langs/"+i+".js")}},add:function(e,t,n){return this.items.push(t),this.lookup[e]={instance:t,dependencies:n},t},createUrl:function(e,t){return"object"==typeof t?t:{prefix:e.prefix,resource:t,suffix:e.suffix}},addComponents:function(t,n){var r=this.urls[t];i(n,function(t){e.ScriptLoader.add(r+"/"+t)})},load:function(n,o,a,s){function l(){var r=c.dependencies(n);i(r,function(e){var n=c.createUrl(o,e);c.load(n.resource,n,t,t)}),a&&a.call(s?s:e)}var c=this,u=o;c.urls[n]||("object"==typeof o&&(u=o.prefix+o.resource+o.suffix),0!==u.indexOf("/")&&-1==u.indexOf("://")&&(u=r.baseURL+"/"+u),c.urls[n]=u.substring(0,u.lastIndexOf("/")),c.lookup[n]?l():e.ScriptLoader.add(u,l,s))}},r.PluginManager=new r,r.ThemeManager=new r,r}),r(x,[u,h],function(e,t){function n(e,t){var n=e.childNodes;return t--,t>n.length-1?t=n.length-1:0>t&&(t=0),n[t]||e}function r(e){this.walk=function(t,r){function o(e){var t;return t=e[0],3===t.nodeType&&t===c&&u>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===f&&e.length>0&&t===d&&3===t.nodeType&&e.splice(e.length-1,1),e}function a(e,t,n){for(var r=[];e&&e!=n;e=e[t])r.push(e);return r}function s(e,t){do{if(e.parentNode==t)return e;e=e.parentNode}while(e)}function l(e,t,n){var i=n?"nextSibling":"previousSibling";for(g=e,v=g.parentNode;g&&g!=t;g=v)v=g.parentNode,y=a(g==e?g:g[i],i),y.length&&(n||y.reverse(),r(o(y)))}var c=t.startContainer,u=t.startOffset,d=t.endContainer,f=t.endOffset,p,h,m,g,v,y,b;if(b=e.select("td.mce-item-selected,th.mce-item-selected"),b.length>0)return void i(b,function(e){r([e])});if(1==c.nodeType&&c.hasChildNodes()&&(c=c.childNodes[u]),1==d.nodeType&&d.hasChildNodes()&&(d=n(d,f)),c==d)return r(o([c]));for(p=e.findCommonAncestor(c,d),g=c;g;g=g.parentNode){if(g===d)return l(c,p,!0);if(g===p)break}for(g=d;g;g=g.parentNode){if(g===c)return l(d,p);if(g===p)break}h=s(c,p)||c,m=s(d,p)||d,l(c,h,!0),y=a(h==c?h:h.nextSibling,"nextSibling",m==d?m.nextSibling:m),y.length&&r(o(y)),l(d,m)},this.split=function(e){function t(e,t){return e.splitText(t)}var n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset;return n==i&&3==n.nodeType?r>0&&rr?(o-=r,n=i=t(i,o).previousSibling,o=i.nodeValue.length,r=0):o=0):(3==n.nodeType&&r>0&&r0&&o0)return c=p,u=n?p.nodeValue.length:0,void(i=!0);if(e.isBlock(p)||h[p.nodeName.toLowerCase()])return;s=p}o&&s&&(c=s,i=!0,u=0)}var c,u,d,f=e.getRoot(),p,h,m,g;if(c=n[(r?"start":"end")+"Container"],u=n[(r?"start":"end")+"Offset"],g=1==c.nodeType&&u===c.childNodes.length,h=e.schema.getNonEmptyElements(),m=r,1==c.nodeType&&u>c.childNodes.length-1&&(m=!1),9===c.nodeType&&(c=e.getRoot(),u=0),c===f){if(m&&(p=c.childNodes[u>0?u-1:0],p&&(h[p.nodeName]||"TABLE"==p.nodeName)))return;if(c.hasChildNodes()&&(u=Math.min(!m&&u>0?u-1:u,c.childNodes.length-1),c=c.childNodes[u],u=0,c.hasChildNodes()&&!/TABLE/.test(c.nodeName))){p=c,d=new t(c,f);do{if(3===p.nodeType&&p.nodeValue.length>0){u=m?0:p.nodeValue.length,c=p,i=!0;break}if(h[p.nodeName.toLowerCase()]){u=e.nodeIndex(p),c=p.parentNode,"IMG"!=p.nodeName||m||u++,i=!0;break}}while(p=m?d.next():d.prev())}}o&&(3===c.nodeType&&0===u&&l(!0),1===c.nodeType&&(p=c.childNodes[u],p||(p=c.childNodes[u-1]),!p||"BR"!==p.nodeName||s(p,"A")||a(p)||a(p,!0)||l(!0,p))),m&&!o&&3===c.nodeType&&u===c.nodeValue.length&&l(!1),i&&n["set"+(r?"Start":"End")](c,u)}var i,o;return o=n.collapsed,r(!0),o||r(),i&&o&&n.collapse(!0),i}}var i=e.each;return r.compareRanges=function(e,t){if(e&&t){if(!e.item&&!e.duplicate)return e.startContainer==t.startContainer&&e.startOffset==t.startOffset;if(e.item&&t.item&&e.item(0)===t.item(0))return!0;if(e.isEqual&&t.isEqual&&t.isEqual(e))return!0}return!1},r}),r(w,[x],function(e){return function(t){function n(e){var n,r;if(r=t.$(e).parentsUntil(t.getBody()).add(e),r.length===i.length){for(n=r.length;n>=0&&r[n]===i[n];n--);if(-1===n)return i=r,!0}return i=r,!1}var r,i=[];"onselectionchange"in t.getDoc()||t.on("NodeChange Click MouseUp KeyUp Focus",function(n){var i,o;i=t.selection.getRng(),o={startContainer:i.startContainer,startOffset:i.startOffset,endContainer:i.endContainer,endOffset:i.endOffset},"nodechange"!=n.type&&e.compareRanges(o,r)||t.fire("SelectionChange"),r=o}),t.on("contextmenu",function(){t.fire("SelectionChange")}),t.on("SelectionChange",function(){var e=t.selection.getStart(!0);t.selection.isCollapsed()||n(e)||!t.dom.isChildOf(e,t.getBody())||t.nodeChanged({selectionChange:!0})}),t.on("MouseUp",function(e){e.isDefaultPrevented()||setTimeout(function(){t.nodeChanged()},0)}),this.nodeChanged=function(e){var n=t.selection,r,i,o;t.initialized&&n&&!t.settings.disable_nodechange&&!t.settings.readonly&&(o=t.getBody(),r=n.getStart()||o,r=r.ownerDocument!=t.getDoc()?t.getBody():r,"IMG"==r.nodeName&&n.isCollapsed()&&(r=r.parentNode),i=[],t.dom.getParent(r,function(e){return e===o?!0:void i.push(e)}),e=e||{},e.element=r,e.parents=i,t.fire("NodeChange",e))}}}),r(_,[],function(){function e(e,t,n){var r,i,o=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[o])return e[o];if(e!==t){if(r=e[a])return r;for(i=e.parent;i&&i!==t;i=i.parent)if(r=i[a])return r}}function t(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}var n=/^[ \t\r\n]*$/,r={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};return t.prototype={replace:function(e){var t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t},attr:function(e,t){var n=this,r,i,o;if("string"!=typeof e){for(i in e)n.attr(i,e[i]);return n}if(r=n.attributes){if(t!==o){if(null===t){if(e in r.map)for(delete r.map[e],i=r.length;i--;)if(r[i].name===e)return r=r.splice(i,1),n;return n}if(e in r.map){for(i=r.length;i--;)if(r[i].name===e){r[i].value=t;break}}else r.push({name:e,value:t});return r.map[e]=t,n}return r.map[e]}},clone:function(){var e=this,n=new t(e.name,e.type),r,i,o,a,s;if(o=e.attributes){for(s=[],s.map={},r=0,i=o.length;i>r;r++)a=o[r],"id"!==a.name&&(s[s.length]={name:a.name,value:a.value},s.map[a.name]=a.value);n.attributes=s}return n.value=e.value,n.shortEnded=e.shortEnded,n},wrap:function(e){var t=this;return t.parent.insert(e,t),e.append(t),t},unwrap:function(){var e=this,t,n;for(t=e.firstChild;t;)n=t.next,e.insert(t,e,!0),t=n;e.remove()},remove:function(){var e=this,t=e.parent,n=e.next,r=e.prev;return t&&(t.firstChild===e?(t.firstChild=n,n&&(n.prev=null)):r.next=n,t.lastChild===e?(t.lastChild=r,r&&(r.next=null)):n.prev=r,e.parent=e.next=e.prev=null),e},append:function(e){var t=this,n;return e.parent&&e.remove(),n=t.lastChild,n?(n.next=e,e.prev=n,t.lastChild=e):t.lastChild=t.firstChild=e,e.parent=t,e},insert:function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,e.next=t,t.prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,e.prev=t,t.next=e),e.parent=r,e},getAll:function(t){var n=this,r,i=[];for(r=n.firstChild;r;r=e(r,n))r.name===t&&i.push(r);return i},empty:function(){var t=this,n,r,i;if(t.firstChild){for(n=[],i=t.firstChild;i;i=e(i,t))n.push(i);for(r=n.length;r--;)i=n[r],i.parent=i.firstChild=i.lastChild=i.next=i.prev=null}return t.firstChild=t.lastChild=null,t},isEmpty:function(t){var r=this,i=r.firstChild,o,a;if(i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(t[i.name])return!1;for(o=i.attributes.length;o--;)if(a=i.attributes[o].name,"name"===a||0===a.indexOf("data-mce-bookmark"))return!1}if(8===i.type)return!1;if(3===i.type&&!n.test(i.value))return!1}while(i=e(i,r));return!0},walk:function(t){return e(this,null,t)}},t.create=function(e,n){var i,o;if(i=new t(e,r[e]||1),n)for(o in n)i.attr(o,n[o]);return i},t}),r(E,[u],function(e){function t(e,t){return e?e.split(t||" "):[]}function n(e){function n(e,n,r){function i(e,t){var n={},r,i;for(r=0,i=e.length;i>r;r++)n[e[r]]=t||{};return n}var s,c,u,d=arguments;for(r=r||[],n=n||"","string"==typeof r&&(r=t(r)),c=3;co;o++)i.attributes[n[o]]={},i.attributesOrder.push(n[o])}var a={},l,c,u,d,f,p;return i[e]?i[e]:(l=t("id accesskey class dir lang style tabindex title"),c=t("address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul"),u=t("a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment"),"html4"!=e&&(l.push.apply(l,t("contenteditable contextmenu draggable dropzone hidden spellcheck translate")),c.push.apply(c,t("article aside details dialog figure header footer hgroup section nav")),u.push.apply(u,t("audio canvas command datalist mark meter output progress time wbr video ruby bdi keygen"))),"html5-strict"!=e&&(l.push("xml:lang"),p=t("acronym applet basefont big font strike tt"),u.push.apply(u,p),s(p,function(e){n(e,"",u)}),f=t("center dir isindex noframes"),c.push.apply(c,f),d=[].concat(c,u),s(f,function(e){n(e,"",d)})),d=d||[].concat(c,u),n("html","manifest","head body"),n("head","","base command link meta noscript script style title"),n("title hr noscript br"),n("base","href target"),n("link","href rel media hreflang type sizes hreflang"),n("meta","name http-equiv content charset"),n("style","media type scoped"),n("script","src async defer type charset"),n("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",d),n("address dt dd div caption","",d),n("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",u),n("blockquote","cite",d),n("ol","reversed start type","li"),n("ul","","li"),n("li","value",d),n("dl","","dt dd"),n("a","href target rel media hreflang type",u),n("q","cite",u),n("ins del","cite datetime",d),n("img","src alt usemap ismap width height"),n("iframe","src name width height",d),n("embed","src type width height"),n("object","data type typemustmatch name usemap form width height",d,"param"),n("param","name value"),n("map","name",d,"area"),n("area","alt coords shape href target rel media hreflang type"),n("table","border","caption colgroup thead tfoot tbody tr"+("html4"==e?" col":"")),n("colgroup","span","col"),n("col","span"),n("tbody thead tfoot","","tr"),n("tr","","td th"),n("td","colspan rowspan headers",d),n("th","colspan rowspan headers scope abbr",d),n("form","accept-charset action autocomplete enctype method name novalidate target",d),n("fieldset","disabled form name",d,"legend"),n("label","form for",u),n("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),n("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"==e?d:u),n("select","disabled form multiple name required size","option optgroup"),n("optgroup","disabled label","option"),n("option","disabled label selected value"),n("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),n("menu","type label",d,"li"),n("noscript","",d),"html4"!=e&&(n("wbr"),n("ruby","",u,"rt rp"),n("figcaption","",d),n("mark rt rp summary bdi","",u),n("canvas","width height",d),n("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",d,"track source"),n("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",d,"track source"),n("source","src type media"),n("track","kind src srclang label default"),n("datalist","",u,"option"),n("article section nav aside header footer","",d),n("hgroup","","h1 h2 h3 h4 h5 h6"),n("figure","",d,"figcaption"),n("time","datetime",u),n("dialog","open",d),n("command","type label icon disabled checked radiogroup command"),n("output","for form name",u),n("progress","value max",u),n("meter","value min max low high optimum",u),n("details","open",d,"summary"),n("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!=e&&(r("script","language xml:space"),r("style","xml:space"),r("object","declare classid code codebase codetype archive standby align border hspace vspace"),r("embed","align name hspace vspace"),r("param","valuetype type"),r("a","charset name rev shape coords"),r("br","clear"),r("applet","codebase archive code object alt name width height align hspace vspace"),r("img","name longdesc align border hspace vspace"),r("iframe","longdesc frameborder marginwidth marginheight scrolling align"),r("font basefont","size color face"),r("input","usemap align"),r("select","onchange"),r("textarea"),r("h1 h2 h3 h4 h5 h6 div p legend caption","align"),r("ul","type compact"),r("li","type"),r("ol dl menu dir","compact"),r("pre","width xml:space"),r("hr","align noshade size width"),r("isindex","prompt"),r("table","summary width frame rules cellspacing cellpadding align bgcolor"),r("col","width align char charoff valign"),r("colgroup","width align char charoff valign"),r("thead","align char charoff valign"),r("tr","align char charoff valign bgcolor"),r("th","axis align char charoff valign nowrap bgcolor width height"),r("form","accept"),r("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),r("tfoot","align char charoff valign"),r("tbody","align char charoff valign"),r("area","nohref"),r("body","background bgcolor text link vlink alink")),"html4"!=e&&(r("input button select textarea","autofocus"),r("input textarea","placeholder"),r("a","download"),r("link script img","crossorigin"),r("iframe","sandbox seamless allowfullscreen")),s(t("a form meter progress dfn"),function(e){a[e]&&delete a[e].children[e]}),delete a.caption.children.table,i[e]=a,a)}function r(e,t){var n;return e&&(n={},"string"==typeof e&&(e={"*":e}),s(e,function(e,r){n[r]="map"==t?a(e,/[, ]/):c(e,/[, ]/)})),n}var i={},o={},a=e.makeMap,s=e.each,l=e.extend,c=e.explode,u=e.inArray;return function(e){function o(t,n,r){var o=e[t];return o?o=a(o,/[, ]/,a(o.toUpperCase(),/[, ]/)):(o=i[t],o||(o=a(n," ",a(n.toUpperCase()," ")),o=l(o,r),i[t]=o)),o}function d(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")}function f(e){var n,r,i,o,s,l,c,f,p,h,m,g,v,b,x,w,_,E,N,k=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,S=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,T=/[*?+]/;if(e)for(e=t(e,","),y["@"]&&(w=y["@"].attributes,_=y["@"].attributesOrder),n=0,r=e.length;r>n;n++)if(s=k.exec(e[n])){if(b=s[1],p=s[2],x=s[3],f=s[5],g={},v=[],l={attributes:g,attributesOrder:v},"#"===b&&(l.paddEmpty=!0),"-"===b&&(l.removeEmpty=!0),"!"===s[4]&&(l.removeEmptyAttrs=!0),w){for(E in w)g[E]=w[E];v.push.apply(v,_)}if(f)for(f=t(f,"|"),i=0,o=f.length;o>i;i++)if(s=S.exec(f[i])){if(c={},m=s[1],h=s[2].replace(/::/g,":"),b=s[3],N=s[4],"!"===m&&(l.attributesRequired=l.attributesRequired||[],l.attributesRequired.push(h),c.required=!0),"-"===m){delete g[h],v.splice(u(v,h),1);continue}b&&("="===b&&(l.attributesDefault=l.attributesDefault||[],l.attributesDefault.push({name:h,value:N}),c.defaultValue=N),":"===b&&(l.attributesForced=l.attributesForced||[],l.attributesForced.push({name:h,value:N}),c.forcedValue=N),"<"===b&&(c.validValues=a(N,"?"))),T.test(h)?(l.attributePatterns=l.attributePatterns||[],c.pattern=d(h),l.attributePatterns.push(c)):(g[h]||v.push(h),g[h]=c)}w||"@"!=p||(w=g,_=v),x&&(l.outputName=p,y[x]=l),T.test(p)?(l.pattern=d(p),C.push(l)):y[p]=l}}function p(e){y={},C=[],f(e),s(_,function(e,t){b[t]=e.children})}function h(e){var n=/^(~)?(.+)$/;e&&(i.text_block_elements=i.block_elements=null,s(t(e,","),function(e){var t=n.exec(e),r="~"===t[1],i=r?"span":"div",o=t[2];if(b[o]=b[i],L[o]=i,r||(R[o.toUpperCase()]={},R[o]={}),!y[o]){var a=y[i];a=l({},a),delete a.removeEmptyAttrs,delete a.removeEmpty,y[o]=a}s(b,function(e,t){e[i]&&(b[t]=e=l({},b[t]),e[o]=e[i])})}))}function m(e){var n=/^([+\-]?)(\w+)\[([^\]]+)\]$/;e&&s(t(e,","),function(e){var r=n.exec(e),i,o;r&&(o=r[1],i=o?b[r[2]]:b[r[2]]={"#comment":{}},i=b[r[2]],s(t(r[3],"|"),function(e){"-"===o?(b[r[2]]=i=l({},b[r[2]]),delete i[e]):i[e]={}}))})}function g(e){var t=y[e],n;if(t)return t;for(n=C.length;n--;)if(t=C[n],t.pattern.test(e))return t}var v=this,y={},b={},C=[],x,w,_,E,N,k,S,T,R,A,B,D,L={},H={};e=e||{},_=n(e.schema),e.verify_html===!1&&(e.valid_elements="*[*]"),x=r(e.valid_styles),w=r(e.invalid_styles,"map"),T=r(e.valid_classes,"map"),E=o("whitespace_elements","pre script noscript style textarea video audio iframe object"),N=o("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),k=o("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),S=o("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),A=o("non_empty_elements","td th iframe video audio object script",k),B=o("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure"),R=o("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup",B),D=o("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp"),s((e.special||"script noscript style textarea").split(" "),function(e){H[e]=new RegExp("]*>","gi")}),e.valid_elements?p(e.valid_elements):(s(_,function(e,t){y[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},b[t]=e.children}),"html5"!=e.schema&&s(t("strong/b em/i"),function(e){e=t(e,"/"),y[e[1]].outputName=e[0]}),y.img.attributesDefault=[{name:"alt",value:""}],s(t("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){y[e]&&(y[e].removeEmpty=!0)}),s(t("p h1 h2 h3 h4 h5 h6 th td pre div address caption"),function(e){y[e].paddEmpty=!0}),s(t("span"),function(e){y[e].removeEmptyAttrs=!0})),h(e.custom_elements),m(e.valid_children),f(e.extended_valid_elements),m("+ol[ul|ol],+ul[ul|ol]"),e.invalid_elements&&s(c(e.invalid_elements),function(e){y[e]&&delete y[e]}),g("span")||f("span[!data-mce-type|*]"),v.children=b,v.getValidStyles=function(){return x},v.getInvalidStyles=function(){return w},v.getValidClasses=function(){return T},v.getBoolAttrs=function(){return S},v.getBlockElements=function(){return R},v.getTextBlockElements=function(){return B},v.getTextInlineElements=function(){return D},v.getShortEndedElements=function(){return k},v.getSelfClosingElements=function(){return N},v.getNonEmptyElements=function(){return A},v.getWhiteSpaceElements=function(){return E},v.getSpecialElements=function(){return H},v.isValidChild=function(e,t){var n=b[e];return!(!n||!n[t])},v.isValid=function(e,t){var n,r,i=g(e);if(i){if(!t)return!0;if(i.attributes[t])return!0;if(n=i.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},v.getElementRule=g,v.getCustomElements=function(){return L},v.addValidElements=f,v.setValidElements=p,v.addCustomElements=h,v.addValidChildren=m,v.elements=y}}),r(N,[E,g,u],function(e,t,n){function r(e,t,n){var r=1,i,o,a,s;for(s=e.getShortEndedElements(),a=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g,a.lastIndex=i=n;o=a.exec(t);){if(i=a.lastIndex,"/"===o[1])r--;else if(!o[1]){if(o[2]in s)continue;r++}if(0===r)break}return i}function i(i,a){function s(){}var l=this;i=i||{},l.schema=a=a||new e,i.fix_self_closing!==!1&&(i.fix_self_closing=!0),o("comment cdata text start end pi doctype".split(" "),function(e){e&&(l[e]=i[e]||s)}),l.parse=function(e){function o(e){var t,n;for(t=p.length;t--&&p[t].name!==e;);if(t>=0){for(n=p.length-1;n>=t;n--)e=p[n],e.valid&&l.end(e.name);p.length=t}}function s(e,t,n,r,o){var a,s,l=/[\s\u0000-\u001F]+/g;if(t=t.toLowerCase(),n=t in x?t:z(n||r||o||""),_&&!y&&0!==t.indexOf("data-")){if(a=T[t],!a&&R){for(s=R.length;s--&&(a=R[s],!a.pattern.test(t)););-1===s&&(a=null)}if(!a)return;if(a.validValues&&!(n in a.validValues))return}if(V[t]&&!i.allow_script_urls){var c=n.replace(l,"");try{c=decodeURIComponent(c)}catch(u){c=unescape(c)}if(U.test(c))return;if(!i.allow_html_data_urls&&$.test(c)&&!/^data:image\//i.test(c))return}h.map[t]=n,h.push({name:t,value:n})}var l=this,c,u=0,d,f,p=[],h,m,g,v,y,b,C,x,w,_,E,N,k,S,T,R,A,B,D,L,H,M,P,O,I,F=0,z=t.decode,W,V=n.makeMap("src,href,data,background,formaction,poster"),U=/((java|vb)script|mhtml):/i,$=/^data:/i;for(M=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-_\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),P=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,C=a.getShortEndedElements(),H=i.self_closing_elements||a.getSelfClosingElements(),x=a.getBoolAttrs(),_=i.validate,b=i.remove_internals,W=i.fix_self_closing,O=a.getSpecialElements();c=M.exec(e);){if(u0&&p[p.length-1].name===d&&o(d),!_||(E=a.getElementRule(d))){if(N=!0,_&&(T=E.attributes,R=E.attributePatterns),(S=c[8])?(y=-1!==S.indexOf("data-mce-type"),y&&b&&(N=!1),h=[],h.map={},S.replace(P,s)):(h=[],h.map={}),_&&!y){if(A=E.attributesRequired,B=E.attributesDefault,D=E.attributesForced,L=E.removeEmptyAttrs,L&&!h.length&&(N=!1),D)for(m=D.length;m--;)k=D[m],v=k.name,I=k.value,"{$uid}"===I&&(I="mce_"+F++),h.map[v]=I,h.push({name:v,value:I});if(B)for(m=B.length;m--;)k=B[m],v=k.name,v in h.map||(I=k.value,"{$uid}"===I&&(I="mce_"+F++),h.map[v]=I,h.push({name:v,value:I}));if(A){for(m=A.length;m--&&!(A[m]in h.map););-1===m&&(N=!1)}if(k=h.map["data-mce-bogus"]){if("all"===k){u=r(a,e,M.lastIndex),M.lastIndex=u;continue}N=!1}}N&&l.start(d,h,w)}else N=!1;if(f=O[d]){f.lastIndex=u=c.index+c[0].length,(c=f.exec(e))?(N&&(g=e.substr(u,c.index-u)),u=c.index+c[0].length):(g=e.substr(u),u=e.length),N&&(g.length>0&&l.text(g,!0),l.end(d)),M.lastIndex=u;continue}w||(S&&S.indexOf("/")==S.length-1?N&&l.end(d):p.push({name:d,valid:N}))}else(d=c[1])?(">"===d.charAt(0)&&(d=" "+d),i.allow_conditional_comments||"[if"!==d.substr(0,3)||(d=" "+d),l.comment(d)):(d=c[2])?l.cdata(d):(d=c[3])?l.doctype(d):(d=c[4])&&l.pi(d,c[5]);u=c.index+c[0].length}for(u=0;m--)d=p[m],d.valid&&l.end(d.name)}}var o=n.each;return i.findEndTag=r,i}),r(k,[_,E,N,u],function(e,t,n,r){var i=r.makeMap,o=r.each,a=r.explode,s=r.extend;return function(r,l){function c(t){var n,r,o,a,s,c,d,f,p,h,m,g,v,y;for(m=i("tr,td,th,tbody,thead,tfoot,table"),h=l.getNonEmptyElements(),g=l.getTextBlockElements(),n=0;n1){for(a.reverse(),s=c=u.filterNode(a[0].clone()),p=0;p0?(t.value=n,t=t.prev):(r=t.prev,t.remove(),t=r)}function g(e){var t,n={};for(t in e)"li"!==t&&"p"!=t&&(n[t]=e[t]);return n}var v,y,b,C,x,w,_,E,N,k,S,T,R,A=[],B,D,L,H,M,P,O,I;if(o=o||{},p={},h={},T=s(i("script,style,head,html,body,title,meta,param"),l.getBlockElements()),O=l.getNonEmptyElements(),P=l.children,S=r.validate,I="forced_root_block"in o?o.forced_root_block:r.forced_root_block,M=l.getWhiteSpaceElements(),R=/^[ \t\r\n]+/,D=/[ \t\r\n]+$/,L=/[ \t\r\n]+/g,H=/^[ \t\r\n]+$/,v=new n({validate:S,allow_script_urls:r.allow_script_urls,allow_conditional_comments:r.allow_conditional_comments,self_closing_elements:g(l.getSelfClosingElements()),cdata:function(e){b.append(u("#cdata",4)).value=e},text:function(e,t){var n;B||(e=e.replace(L," "),b.lastChild&&T[b.lastChild.name]&&(e=e.replace(R,""))),0!==e.length&&(n=u("#text",3),n.raw=!!t,b.append(n).value=e)},comment:function(e){b.append(u("#comment",8)).value=e},pi:function(e,t){b.append(u(e,7)).value=t,m(b)},doctype:function(e){var t;t=b.append(u("#doctype",10)),t.value=e,m(b)},start:function(e,t,n){var r,i,o,a,s;if(o=S?l.getElementRule(e):{}){for(r=u(o.outputName||e,1),r.attributes=t,r.shortEnded=n,b.append(r),s=P[b.name],s&&P[r.name]&&!s[r.name]&&A.push(r),i=f.length;i--;)a=f[i].name,a in t.map&&(N=h[a],N?N.push(r):h[a]=[r]);T[e]&&m(r),n||(b=r),!B&&M[e]&&(B=!0)}},end:function(t){var n,r,i,o,a;if(r=S?l.getElementRule(t):{}){if(T[t]&&!B){if(n=b.firstChild,n&&3===n.type)if(i=n.value.replace(R,""),i.length>0)n.value=i,n=n.next;else for(o=n.next,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.next,(0===i.length||H.test(i))&&(n.remove(),n=o),n=o;if(n=b.lastChild,n&&3===n.type)if(i=n.value.replace(D,""),i.length>0)n.value=i,n=n.prev;else for(o=n.prev,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.prev,(0===i.length||H.test(i))&&(n.remove(),n=o),n=o}if(B&&M[t]&&(B=!1),(r.removeEmpty||r.paddEmpty)&&b.isEmpty(O))if(r.paddEmpty)b.empty().append(new e("#text","3")).value="\xa0";else if(!b.attributes.map.name&&!b.attributes.map.id)return a=b.parent,T[b.name]?b.empty().remove():b.unwrap(),void(b=a);b=b.parent}}},l),y=b=new e(o.context||r.root_name,11),v.parse(t),S&&A.length&&(o.context?o.invalid=!0:c(A)),I&&("body"==y.name||o.isRootContent)&&a(),!o.invalid){for(k in p){for(N=d[k],C=p[k],_=C.length;_--;)C[_].parent||C.splice(_,1);for(x=0,w=N.length;w>x;x++)N[x](C,k,o) -}for(x=0,w=f.length;w>x;x++)if(N=f[x],N.name in h){for(C=h[N.name],_=C.length;_--;)C[_].parent||C.splice(_,1);for(_=0,E=N.callbacks.length;E>_;_++)N.callbacks[_](C,N.name,o)}}return y},r.remove_trailing_brs&&u.addNodeFilter("br",function(t){var n,r=t.length,i,o=s({},l.getBlockElements()),a=l.getNonEmptyElements(),c,u,d,f,p,h;for(o.body=1,n=0;r>n;n++)if(i=t[n],c=i.parent,o[i.parent.name]&&i===c.lastChild){for(d=i.prev;d;){if(f=d.name,"span"!==f||"bookmark"!==d.attr("data-mce-type")){if("br"!==f)break;if("br"===f){i=null;break}}d=d.prev}i&&(i.remove(),c.isEmpty(a)&&(p=l.getElementRule(c.name),p&&(p.removeEmpty?c.remove():p.paddEmpty&&(c.empty().append(new e("#text",3)).value="\xa0"))))}else{for(u=i;c&&c.firstChild===u&&c.lastChild===u&&(u=c,!o[c.name]);)c=c.parent;u===c&&(h=new e("#text",3),h.value="\xa0",i.replace(h))}}),r.allow_html_in_named_anchor||u.addAttributeFilter("id,name",function(e){for(var t=e.length,n,r,i,o;t--;)if(o=e[t],"a"===o.name&&o.firstChild&&!o.attr("href")){i=o.parent,n=o.lastChild;do r=n.prev,i.insert(n,o),n=r;while(n)}}),r.validate&&l.getValidClasses()&&u.addAttributeFilter("class",function(e){for(var t=e.length,n,r,i,o,a,s=l.getValidClasses(),c,u;t--;){for(n=e[t],r=n.attr("class").split(" "),a="",i=0;i0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n")),r.push("<",e),t)for(c=0,u=t.length;u>c;c++)d=t[c],r.push(" ",d.name,'="',s(d.value,!0),'"');r[r.length]=!n||l?">":" />",n&&i&&a[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n"))},end:function(e){var t;r.push(""),i&&a[e]&&r.length>0&&(t=r[r.length-1],t.length>0&&"\n"!==t&&r.push("\n"))},text:function(e,t){e.length>0&&(r[r.length]=t?e:s(e))},cdata:function(e){r.push("")},comment:function(e){r.push("")},pi:function(e,t){t?r.push(""):r.push(""),i&&r.push("\n")},doctype:function(e){r.push("",i?"\n":"")},reset:function(){r.length=0},getContent:function(){return r.join("").replace(/\n$/,"")}}}}),r(T,[S,E],function(e,t){return function(n,r){var i=this,o=new e(n);n=n||{},n.validate="validate"in n?n.validate:!0,i.schema=r=r||new t,i.writer=o,i.serialize=function(e){function t(e){var n=i[e.type],s,l,c,u,d,f,p,h,m;if(n)n(e);else{if(s=e.name,l=e.shortEnded,c=e.attributes,a&&c&&c.length>1){for(f=[],f.map={},m=r.getElementRule(e.name),p=0,h=m.attributesOrder.length;h>p;p++)u=m.attributesOrder[p],u in c.map&&(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));for(p=0,h=c.length;h>p;p++)u=c[p].name,u in f.map||(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));c=f}if(o.start(e.name,c,l),!l){if(e=e.firstChild)do t(e);while(e=e.next);o.end(s)}}}var i,a;return a=n.validate,i={3:function(e){o.text(e.value,e.raw)},8:function(e){o.comment(e.value)},7:function(e){o.pi(e.name,e.value)},10:function(e){o.doctype(e.value)},4:function(e){o.cdata(e.value)},11:function(e){if(e=e.firstChild)do t(e);while(e=e.next)}},o.reset(),1!=e.type||n.inner?i[11](e):t(e),o.getContent()}}}),r(R,[y,k,g,T,_,E,d,u],function(e,t,n,r,i,o,a,s){var l=s.each,c=s.trim,u=e.DOM;return function(e,i){var s,d,f;return i&&(s=i.dom,d=i.schema),s=s||u,d=d||new o(e),e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs="remove_trailing_brs"in e?e.remove_trailing_brs:!0,f=new t(e,d),f.addAttributeFilter("data-mce-tabindex",function(e,t){for(var n=e.length,r;n--;)r=e[n],r.attr("tabindex",r.attributes.map["data-mce-tabindex"]),r.attr(t,null)}),f.addAttributeFilter("src,href,style",function(t,n){for(var r=t.length,i,o,a="data-mce-"+n,l=e.url_converter,c=e.url_converter_scope,u;r--;)i=t[r],o=i.attributes.map[a],o!==u?(i.attr(n,o.length>0?o:null),i.attr(a,null)):(o=i.attributes.map[n],"style"===n?o=s.serializeStyle(s.parseStyle(o),i.name):l&&(o=l.call(c,o,n,i.name)),i.attr(n,o.length>0?o:null))}),f.addAttributeFilter("class",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("class"),r&&(r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null))}),f.addAttributeFilter("data-mce-type",function(e,t,n){for(var r=e.length,i;r--;)i=e[r],"bookmark"!==i.attributes.map["data-mce-type"]||n.cleanup||i.remove()}),f.addNodeFilter("noscript",function(e){for(var t=e.length,r;t--;)r=e[t].firstChild,r&&(r.value=n.decode(r.value))}),f.addNodeFilter("script,style",function(e,t){function n(e){return e.replace(/()/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}for(var r=e.length,i,o,a;r--;)i=e[r],o=i.firstChild?i.firstChild.value:"","script"===t?(a=i.attr("type"),a&&i.attr("type","mce-no/type"==a?null:a.replace(/^mce\-/,"")),o.length>0&&(i.firstChild.value="// ")):o.length>0&&(i.firstChild.value="")}),f.addNodeFilter("#comment",function(e){for(var t=e.length,n;t--;)n=e[t],0===n.value.indexOf("[CDATA[")?(n.name="#cdata",n.type=4,n.value=n.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===n.value.indexOf("mce:protected ")&&(n.name="#text",n.type=3,n.raw=!0,n.value=unescape(n.value).substr(14))}),f.addNodeFilter("xml:namespace,input",function(e,t){for(var n=e.length,r;n--;)r=e[n],7===r.type?r.remove():1===r.type&&("input"!==t||"type"in r.attributes.map||r.attr("type","text"))}),e.fix_list_elements&&f.addNodeFilter("ul,ol",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.parent,("ul"===r.name||"ol"===r.name)&&n.prev&&"li"===n.prev.name&&n.prev.append(n)}),f.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),{schema:d,addNodeFilter:f.addNodeFilter,addAttributeFilter:f.addAttributeFilter,serialize:function(t,n){var i=this,o,u,p,h,m;return a.ie&&s.select("script,style,select,map").length>0?(m=t.innerHTML,t=t.cloneNode(!1),s.setHTML(t,m)):t=t.cloneNode(!0),o=t.ownerDocument.implementation,o.createHTMLDocument&&(u=o.createHTMLDocument(""),l("BODY"==t.nodeName?t.childNodes:[t],function(e){u.body.appendChild(u.importNode(e,!0))}),t="BODY"!=t.nodeName?u.body.firstChild:u.body,p=s.doc,s.doc=u),n=n||{},n.format=n.format||"html",n.selection&&(n.forced_root_block=""),n.no_events||(n.node=t,i.onPreProcess(n)),h=new r(e,d),n.content=h.serialize(f.parse(c(n.getInner?t.innerHTML:s.getOuterHTML(t)),n)),n.cleanup||(n.content=n.content.replace(/\uFEFF/g,"")),n.no_events||i.onPostProcess(n),p&&(s.doc=p),n.node=null,n.content},addRules:function(e){d.addValidElements(e)},setRules:function(e){d.setValidElements(e)},onPreProcess:function(e){i&&i.fire("PreProcess",e)},onPostProcess:function(e){i&&i.fire("PostProcess",e)}}}}),r(A,[],function(){function e(e){function t(t,n){var r,i=0,o,a,s,l,c,u,d=-1,f;if(r=t.duplicate(),r.collapse(n),f=r.parentElement(),f.ownerDocument===e.dom.doc){for(;"false"===f.contentEditable;)f=f.parentNode;if(!f.hasChildNodes())return{node:f,inside:1};for(s=f.children,o=s.length-1;o>=i;)if(u=Math.floor((i+o)/2),l=s[u],r.moveToElementText(l),d=r.compareEndPoints(n?"StartToStart":"EndToEnd",t),d>0)o=u-1;else{if(!(0>d))return{node:l};i=u+1}if(0>d)for(l?r.collapse(!1):(r.moveToElementText(f),r.collapse(!0),l=f,a=!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",1)&&f==r.parentElement();)c++;else for(r.collapse(!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",-1)&&f==r.parentElement();)c++;return{node:l,position:d,offset:c,inside:a}}}function n(){function n(e){var n=t(o,e),r,i,s=0,l,c,u;if(r=n.node,i=n.offset,n.inside&&!r.hasChildNodes())return void a[e?"setStart":"setEnd"](r,0);if(i===c)return void a[e?"setStartBefore":"setEndAfter"](r);if(n.position<0){if(l=n.inside?r.firstChild:r.nextSibling,!l)return void a[e?"setStartAfter":"setEndAfter"](r);if(!i)return void(3==l.nodeType?a[e?"setStart":"setEnd"](l,0):a[e?"setStartBefore":"setEndBefore"](l));for(;l;){if(3==l.nodeType&&(u=l.nodeValue,s+=u.length,s>=i)){r=l,s-=i,s=u.length-s;break}l=l.nextSibling}}else{if(l=r.previousSibling,!l)return a[e?"setStartBefore":"setEndBefore"](r);if(!i)return void(3==r.nodeType?a[e?"setStart":"setEnd"](l,r.nodeValue.length):a[e?"setStartAfter":"setEndAfter"](l));for(;l;){if(3==l.nodeType&&(s+=l.nodeValue.length,s>=i)){r=l,s-=i;break}l=l.previousSibling}}a[e?"setStart":"setEnd"](r,s)}var o=e.getRng(),a=i.createRng(),s,l,c,u,d;if(s=o.item?o.item(0):o.parentElement(),s.ownerDocument!=i.doc)return a;if(l=e.isCollapsed(),o.item)return a.setStart(s.parentNode,i.nodeIndex(s)),a.setEnd(a.startContainer,a.startOffset+1),a;try{n(!0),l||n()}catch(f){if(-2147024809!=f.number)throw f;d=r.getBookmark(2),c=o.duplicate(),c.collapse(!0),s=c.parentElement(),l||(c=o.duplicate(),c.collapse(!1),u=c.parentElement(),u.innerHTML=u.innerHTML),s.innerHTML=s.innerHTML,r.moveToBookmark(d),o=e.getRng(),n(!0),l||n()}return a}var r=this,i=e.dom,o=!1;this.getBookmark=function(n){function r(e){var t,n,r,o,a=[];for(t=e.parentNode,n=i.getRoot().parentNode;t!=n&&9!==t.nodeType;){for(r=t.children,o=r.length;o--;)if(e===r[o]){a.push(o);break}e=t,t=t.parentNode}return a}function o(e){var n;return n=t(a,e),n?{position:n.position,offset:n.offset,indexes:r(n.node),inside:n.inside}:void 0}var a=e.getRng(),s={};return 2===n&&(a.item?s.start={ctrl:!0,indexes:r(a.item(0))}:(s.start=o(!0),e.isCollapsed()||(s.end=o()))),s},this.moveToBookmark=function(e){function t(e){var t,n,r,o;for(t=i.getRoot(),n=e.length-1;n>=0;n--)o=t.children,r=e[n],r<=o.length-1&&(t=o[r]);return t}function n(n){var i=e[n?"start":"end"],a,s,l,c;i&&(a=i.position>0,s=o.createTextRange(),s.moveToElementText(t(i.indexes)),c=i.offset,c!==l?(s.collapse(i.inside||a),s.moveStart("character",a?-c:c)):s.collapse(n),r.setEndPoint(n?"StartToStart":"EndToStart",s),n&&r.collapse(!0))}var r,o=i.doc.body;e.start&&(e.start.ctrl?(r=o.createControlRange(),r.addElement(t(e.start.indexes)),r.select()):(r=o.createTextRange(),n(!0),n(),r.select()))},this.addRange=function(t){function n(e){var t,n,a,d,h;a=i.create("a"),t=e?s:c,n=e?l:u,d=r.duplicate(),(t==f||t==f.documentElement)&&(t=p,n=0),3==t.nodeType?(t.parentNode.insertBefore(a,t),d.moveToElementText(a),d.moveStart("character",n),i.remove(a),r.setEndPoint(e?"StartToStart":"EndToEnd",d)):(h=t.childNodes,h.length?(n>=h.length?i.insertAfter(a,h[h.length-1]):t.insertBefore(a,h[n]),d.moveToElementText(a)):t.canHaveHTML&&(t.innerHTML="",a=t.firstChild,d.moveToElementText(a),d.collapse(o)),r.setEndPoint(e?"StartToStart":"EndToEnd",d),i.remove(a))}var r,a,s,l,c,u,d,f=e.dom.doc,p=f.body,h,m;if(s=t.startContainer,l=t.startOffset,c=t.endContainer,u=t.endOffset,r=p.createTextRange(),s==c&&1==s.nodeType){if(l==u&&!s.hasChildNodes()){if(s.canHaveHTML)return d=s.previousSibling,d&&!d.hasChildNodes()&&i.isBlock(d)?d.innerHTML="":d=null,s.innerHTML="",r.moveToElementText(s.lastChild),r.select(),i.doc.selection.clear(),s.innerHTML="",void(d&&(d.innerHTML=""));l=i.nodeIndex(s),s=s.parentNode}if(l==u-1)try{if(m=s.childNodes[l],a=p.createControlRange(),a.addElement(m),a.select(),h=e.getRng(),h.item&&m===h.item(0))return}catch(g){}}n(!0),n(),r.select()},this.getRangeAt=n}return e}),r(B,[d],function(e){return{BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey},metaKeyPressed:function(t){return e.mac?t.metaKey:t.ctrlKey&&!t.altKey}}}),r(D,[B,u,d],function(e,t,n){return function(r,i){function o(e){var t=i.settings.object_resizing;return t===!1||n.iOS?!1:("string"!=typeof t&&(t="table,img,div"),"false"===e.getAttribute("data-mce-resize")?!1:i.dom.is(e,t))}function a(t){var n,r,o,a,s;n=t.screenX-T,r=t.screenY-R,P=n*k[2]+D,O=r*k[3]+L,P=5>P?5:P,O=5>O?5:O,o="IMG"==w.nodeName&&i.settings.resize_img_proportional!==!1?!e.modifierPressed(t):e.modifierPressed(t)||"IMG"==w.nodeName&&k[2]*k[3]!==0,o&&(W(n)>W(r)?(O=V(P*H),P=V(O/H)):(P=V(O/H),O=V(P*H))),C.setStyles(_,{width:P,height:O}),a=k.startPos.x+n,s=k.startPos.y+r,a=a>0?a:0,s=s>0?s:0,C.setStyles(E,{left:a,top:s,display:"block"}),E.innerHTML=P+" × "+O,k[2]<0&&_.clientWidth<=P&&C.setStyle(_,"left",A+(D-P)),k[3]<0&&_.clientHeight<=O&&C.setStyle(_,"top",B+(L-O)),n=U.scrollWidth-$,r=U.scrollHeight-q,n+r!==0&&C.setStyles(E,{left:a-n,top:s-r}),M||(i.fire("ObjectResizeStart",{target:w,width:D,height:L}),M=!0)}function s(){function e(e,t){t&&(w.style[e]||!i.schema.isValid(w.nodeName.toLowerCase(),e)?C.setStyle(w,e,t):C.setAttrib(w,e,t))}M=!1,e("width",P),e("height",O),C.unbind(I,"mousemove",a),C.unbind(I,"mouseup",s),F!=I&&(C.unbind(F,"mousemove",a),C.unbind(F,"mouseup",s)),C.remove(_),C.remove(E),z&&"TABLE"!=w.nodeName||l(w),i.fire("ObjectResized",{target:w,width:P,height:O}),C.setAttrib(w,"style",C.getAttrib(w,"style")),i.nodeChanged()}function l(e,t,r){var l,u,d,f,p;g(),l=C.getPos(e,U),A=l.x,B=l.y,p=e.getBoundingClientRect(),u=p.width||p.right-p.left,d=p.height||p.bottom-p.top,w!=e&&(m(),w=e,P=O=0),f=i.fire("ObjectSelected",{target:e}),o(e)&&!f.isDefaultPrevented()?x(N,function(e,i){function o(t){T=t.screenX,R=t.screenY,D=w.clientWidth,L=w.clientHeight,H=L/D,k=e,e.startPos={x:u*e[0]+A,y:d*e[1]+B},$=U.scrollWidth,q=U.scrollHeight,_=w.cloneNode(!0),C.addClass(_,"mce-clonedresizable"),C.setAttrib(_,"data-mce-bogus","all"),_.contentEditable=!1,_.unSelectabe=!0,C.setStyles(_,{left:A,top:B,margin:0}),_.removeAttribute("data-mce-selected"),U.appendChild(_),C.bind(I,"mousemove",a),C.bind(I,"mouseup",s),F!=I&&(C.bind(F,"mousemove",a),C.bind(F,"mouseup",s)),E=C.add(U,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},D+" × "+L)}var l,c;return t?void(i==t&&o(r)):(l=C.get("mceResizeHandle"+i),l?C.show(l):(c=U,l=C.add(c,"div",{id:"mceResizeHandle"+i,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+i+"-resize; margin:0; padding:0"}),n.ie&&(l.contentEditable=!1)),e.elm||(C.bind(l,"mousedown",function(e){e.stopImmediatePropagation(),e.preventDefault(),o(e)}),e.elm=l),void C.setStyles(l,{left:u*e[0]+A-l.offsetWidth/2,top:d*e[1]+B-l.offsetHeight/2}))}):c(),w.setAttribute("data-mce-selected","1")}function c(){var e,t;g(),w&&w.removeAttribute("data-mce-selected");for(e in N)t=C.get("mceResizeHandle"+e),t&&(C.unbind(t),C.remove(t))}function u(e){function t(e,t){if(e)do if(e===t)return!0;while(e=e.parentNode)}var n,i;if(!M)return x(C.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),i="mousedown"==e.type?e.target:r.getNode(),i=C.$(i).closest(z?"table":"table,img,hr")[0],t(i,U)&&(v(),n=r.getStart(!0),t(n,i)&&t(r.getEnd(!0),i)&&(!z||i!=n&&"IMG"!==n.nodeName))?void l(i):void c()}function d(e,t,n){e&&e.attachEvent&&e.attachEvent("on"+t,n)}function f(e,t,n){e&&e.detachEvent&&e.detachEvent("on"+t,n)}function p(e){var t=e.srcElement,n,r,o,a,s,c,u;n=t.getBoundingClientRect(),c=S.clientX-n.left,u=S.clientY-n.top;for(r in N)if(o=N[r],a=t.offsetWidth*o[0],s=t.offsetHeight*o[1],W(a-c)<8&&W(s-u)<8){k=o;break}M=!0,i.fire("ObjectResizeStart",{target:w,width:w.clientWidth,height:w.clientHeight}),i.getDoc().selection.empty(),l(t,r,S)}function h(e){var t=e.srcElement;if(t!=w){if(i.fire("ObjectSelected",{target:t}),m(),0===t.id.indexOf("mceResizeHandle"))return void(e.returnValue=!1);("IMG"==t.nodeName||"TABLE"==t.nodeName)&&(c(),w=t,d(t,"resizestart",p))}}function m(){f(w,"resizestart",p)}function g(){for(var e in N){var t=N[e];t.elm&&(C.unbind(t.elm),delete t.elm)}}function v(){try{i.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}}function y(e){var t;if(z){t=I.body.createControlRange();try{return t.addElement(e),t.select(),!0}catch(n){}}}function b(){w=_=null,z&&(m(),f(U,"controlselect",h))}var C=i.dom,x=t.each,w,_,E,N,k,S,T,R,A,B,D,L,H,M,P,O,I=i.getDoc(),F=document,z=n.ie&&n.ie<11,W=Math.abs,V=Math.round,U=i.getBody(),$,q;N={n:[.5,0,0,-1],e:[1,.5,1,0],s:[.5,1,0,1],w:[0,.5,-1,0],nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var j=".mce-content-body";return i.contentStyles.push(j+" div.mce-resizehandle {position: absolute;border: 1px solid black;background: #FFF;width: 5px;height: 5px;z-index: 10000}"+j+" .mce-resizehandle:hover {background: #000}"+j+" img[data-mce-selected], hr[data-mce-selected] {outline: 1px solid black;resize: none}"+j+" .mce-clonedresizable {position: absolute;"+(n.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"+j+" .mce-resize-helper {background: #555;background: rgba(0,0,0,0.75);border-radius: 3px;border: 1px;color: white;display: none;font-family: sans-serif;font-size: 12px;white-space: nowrap;line-height: 14px;margin: 5px 10px;padding: 5px;position: absolute;z-index: 10001}"),i.on("init",function(){z?(i.on("ObjectResized",function(e){"TABLE"!=e.target.nodeName&&(c(),y(e.target))}),d(U,"controlselect",h),i.on("mousedown",function(e){S=e})):(v(),n.ie>=11&&(i.on("mouseup",function(e){var t=e.target.nodeName;!M&&/^(TABLE|IMG|HR)$/.test(t)&&(i.selection.select(e.target,"TABLE"==t),i.nodeChanged())}),i.dom.bind(U,"mscontrolselect",function(e){/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"==e.target.tagName&&window.setTimeout(function(){i.selection.select(e.target)},0))}))),i.on("nodechange ResizeEditor",u),i.on("keydown keyup",function(e){w&&"TABLE"==w.nodeName&&u(e)}),i.on("hide",c)}),i.on("remove",g),{isResizable:o,showResizeRect:l,hideResizeRect:c,updateResizeRect:u,controlSelect:y,destroy:b}}}),r(L,[d,u],function(e,t){function n(n){var r=n.dom;this.getBookmark=function(e,i){function o(e,n){var i=0;return t.each(r.select(e),function(e,t){e==n&&(i=t)}),i}function a(e){function t(t){var n,r,i,o=t?"start":"end";n=e[o+"Container"],r=e[o+"Offset"],1==n.nodeType&&"TR"==n.nodeName&&(i=n.childNodes,n=i[Math.min(t?r:r-1,i.length-1)],n&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r)))}return t(!0),t(),e}function s(){function e(e,t){var n=e[t?"startContainer":"endContainer"],a=e[t?"startOffset":"endOffset"],s=[],l,c,u=0;if(3==n.nodeType){if(i)for(l=n.previousSibling;l&&3==l.nodeType;l=l.previousSibling)a+=l.nodeValue.length;s.push(a)}else c=n.childNodes,a>=c.length&&c.length&&(u=1,a=Math.max(0,c.length-1)),s.push(r.nodeIndex(c[a],i)+u);for(;n&&n!=o;n=n.parentNode)s.push(r.nodeIndex(n,i));return s}var t=n.getRng(!0),o=r.getRoot(),a={};return a.start=e(t,!0),n.isCollapsed()||(a.end=e(t)),a}var l,c,u,d,f,p,h="",m;if(2==e)return p=n.getNode(),f=p?p.nodeName:null,"IMG"==f?{name:f,index:o(f,p)}:n.tridentSel?n.tridentSel.getBookmark(e):s();if(e)return{rng:n.getRng()};if(l=n.getRng(),u=r.uniqueId(),d=n.isCollapsed(),m="overflow:hidden;line-height:0px",l.duplicate||l.item){if(l.item)return p=l.item(0),f=p.nodeName,{name:f,index:o(f,p)};c=l.duplicate();try{l.collapse(),l.pasteHTML(''+h+""),d||(c.collapse(!1),l.moveToElementText(c.parentElement()),0===l.compareEndPoints("StartToEnd",c)&&c.move("character",-1),c.pasteHTML(''+h+""))}catch(g){return null}}else{if(p=n.getNode(),f=p.nodeName,"IMG"==f)return{name:f,index:o(f,p)};c=a(l.cloneRange()),d||(c.collapse(!1),c.insertNode(r.create("span",{"data-mce-type":"bookmark",id:u+"_end",style:m},h))),l=a(l),l.collapse(!0),l.insertNode(r.create("span",{"data-mce-type":"bookmark",id:u+"_start",style:m},h))}return n.moveToBookmark({id:u,keep:1}),{id:u}},this.moveToBookmark=function(i){function o(e){var t=i[e?"start":"end"],n,r,o,a;if(t){for(o=t[0],r=c,n=t.length-1;n>=1;n--){if(a=r.childNodes,t[n]>a.length-1)return;r=a[t[n]]}3===r.nodeType&&(o=Math.min(t[0],r.nodeValue.length)),1===r.nodeType&&(o=Math.min(t[0],r.childNodes.length)),e?l.setStart(r,o):l.setEnd(r,o)}return!0}function a(n){var o=r.get(i.id+"_"+n),a,s,l,c,h=i.keep;if(o&&(a=o.parentNode,"start"==n?(h?(a=o.firstChild,s=1):s=r.nodeIndex(o),u=d=a,f=p=s):(h?(a=o.firstChild,s=1):s=r.nodeIndex(o),d=a,p=s),!h)){for(c=o.previousSibling,l=o.nextSibling,t.each(t.grep(o.childNodes),function(e){3==e.nodeType&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});o=r.get(i.id+"_"+n);)r.remove(o,1);c&&l&&c.nodeType==l.nodeType&&3==c.nodeType&&!e.opera&&(s=c.nodeValue.length,c.appendData(l.nodeValue),r.remove(l),"start"==n?(u=d=c,f=p=s):(d=c,p=s))}}function s(t){return!r.isBlock(t)||t.innerHTML||e.ie||(t.innerHTML='
'),t}var l,c,u,d,f,p;if(i)if(i.start){if(l=r.createRng(),c=r.getRoot(),n.tridentSel)return n.tridentSel.moveToBookmark(i);o(!0)&&o()&&n.setRng(l)}else i.id?(a("start"),a("end"),u&&(l=r.createRng(),l.setStart(s(u),f),l.setEnd(s(d),p),n.setRng(l))):i.name?n.select(r.select(i.name)[i.index]):i.rng&&n.setRng(i.rng)}}return n.isBookmarkNode=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},n}),r(H,[h,A,D,x,L,d,u],function(e,n,r,i,o,a,s){function l(e,t,i,a){var s=this;s.dom=e,s.win=t,s.serializer=i,s.editor=a,s.bookmarkManager=new o(s),s.controlSelection=new r(s,a),s.win.getSelection||(s.tridentSel=new n(s))}var c=s.each,u=s.trim,d=a.ie;return l.prototype={setCursorLocation:function(e,t){var n=this,r=n.dom.createRng();e?(r.setStart(e,t),r.setEnd(e,t),n.setRng(r),n.collapse(!1)):(n._moveEndPoint(r,n.editor.getBody(),!0),n.setRng(r))},getContent:function(e){var n=this,r=n.getRng(),i=n.dom.create("body"),o=n.getSel(),a,s,l;return e=e||{},a=s="",e.get=!0,e.format=e.format||"html",e.selection=!0,n.editor.fire("BeforeGetContent",e),"text"==e.format?n.isCollapsed()?"":r.text||(o.toString?o.toString():""):(r.cloneContents?(l=r.cloneContents(),l&&i.appendChild(l)):r.item!==t||r.htmlText!==t?(i.innerHTML="
"+(r.item?r.item(0).outerHTML:r.htmlText),i.removeChild(i.firstChild)):i.innerHTML=r.toString(),/^\s/.test(i.innerHTML)&&(a=" "),/\s+$/.test(i.innerHTML)&&(s=" "),e.getInner=!0,e.content=n.isCollapsed()?"":a+n.serializer.serialize(i,e)+s,n.editor.fire("GetContent",e),e.content)},setContent:function(e,t){var n=this,r=n.getRng(),i,o=n.win.document,a,s;if(t=t||{format:"html"},t.set=!0,t.selection=!0,e=t.content=e,t.no_events||n.editor.fire("BeforeSetContent",t),e=t.content,r.insertNode){e+='_',r.startContainer==o&&r.endContainer==o?o.body.innerHTML=e:(r.deleteContents(),0===o.body.childNodes.length?o.body.innerHTML=e:r.createContextualFragment?r.insertNode(r.createContextualFragment(e)):(a=o.createDocumentFragment(),s=o.createElement("div"),a.appendChild(s),s.outerHTML=e,r.insertNode(a))),i=n.dom.get("__caret"),r=o.createRange(),r.setStartBefore(i),r.setEndBefore(i),n.setRng(r),n.dom.remove("__caret");try{n.setRng(r)}catch(l){}}else r.item&&(o.execCommand("Delete",!1,null),r=n.getRng()),/^\s+/.test(e)?(r.pasteHTML('_'+e),n.dom.remove("__mce_tmp")):r.pasteHTML(e);t.no_events||n.editor.fire("SetContent",t)},getStart:function(e){var t=this,n=t.getRng(),r,i,o,a;if(n.duplicate||n.item){if(n.item)return n.item(0);for(o=n.duplicate(),o.collapse(1),r=o.parentElement(),r.ownerDocument!==t.dom.doc&&(r=t.dom.getRoot()),i=a=n.parentElement();a=a.parentNode;)if(a==r){r=i;break}return r}return r=n.startContainer,1==r.nodeType&&r.hasChildNodes()&&(e&&n.collapsed||(r=r.childNodes[Math.min(r.childNodes.length-1,n.startOffset)])),r&&3==r.nodeType?r.parentNode:r},getEnd:function(e){var t=this,n=t.getRng(),r,i;return n.duplicate||n.item?n.item?n.item(0):(n=n.duplicate(),n.collapse(0),r=n.parentElement(),r.ownerDocument!==t.dom.doc&&(r=t.dom.getRoot()),r&&"BODY"==r.nodeName?r.lastChild||r:r):(r=n.endContainer,i=n.endOffset,1==r.nodeType&&r.hasChildNodes()&&(e&&n.collapsed||(r=r.childNodes[i>0?i-1:i])),r&&3==r.nodeType?r.parentNode:r)},getBookmark:function(e,t){return this.bookmarkManager.getBookmark(e,t)},moveToBookmark:function(e){return this.bookmarkManager.moveToBookmark(e)},select:function(e,t){var n=this,r=n.dom,i=r.createRng(),o;if(n.lastFocusBookmark=null,e){if(!t&&n.controlSelection.controlSelect(e))return;o=r.nodeIndex(e),i.setStart(e.parentNode,o),i.setEnd(e.parentNode,o+1),t&&(n._moveEndPoint(i,e,!0),n._moveEndPoint(i,e)),n.setRng(i)}return e},isCollapsed:function(){var e=this,t=e.getRng(),n=e.getSel();return!t||t.item?!1:t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!n||t.collapsed},collapse:function(e){var t=this,n=t.getRng(),r;n.item&&(r=n.item(0),n=t.win.document.body.createTextRange(),n.moveToElementText(r)),n.collapse(!!e),t.setRng(n)},getSel:function(){var e=this.win;return e.getSelection?e.getSelection():e.document.selection},getRng:function(e){function t(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}}var n=this,r,i,o,a=n.win.document,s;if(!e&&n.lastFocusBookmark){var l=n.lastFocusBookmark;return l.startContainer?(i=a.createRange(),i.setStart(l.startContainer,l.startOffset),i.setEnd(l.endContainer,l.endOffset)):i=l,i}if(e&&n.tridentSel)return n.tridentSel.getRangeAt(0);try{(r=n.getSel())&&(i=r.rangeCount>0?r.getRangeAt(0):r.createRange?r.createRange():a.createRange())}catch(c){}if(d&&i&&i.setStart&&a.selection){try{s=a.selection.createRange()}catch(c){}s&&s.item&&(o=s.item(0),i=a.createRange(),i.setStartBefore(o),i.setEndAfter(o))}return i||(i=a.createRange?a.createRange():a.body.createTextRange()),i.setStart&&9===i.startContainer.nodeType&&i.collapsed&&(o=n.dom.getRoot(),i.setStart(o,0),i.setEnd(o,0)),n.selectedRange&&n.explicitRange&&(0===t(i.START_TO_START,i,n.selectedRange)&&0===t(i.END_TO_END,i,n.selectedRange)?i=n.explicitRange:(n.selectedRange=null,n.explicitRange=null)),i},setRng:function(e,t){var n=this,r;if(e.select)try{e.select()}catch(i){}else if(n.tridentSel){if(e.cloneRange)try{return void n.tridentSel.addRange(e)}catch(i){}}else if(r=n.getSel()){n.explicitRange=e;try{r.removeAllRanges(),r.addRange(e)}catch(i){}t===!1&&r.extend&&(r.collapse(e.endContainer,e.endOffset),r.extend(e.startContainer,e.startOffset)),n.selectedRange=r.rangeCount>0?r.getRangeAt(0):null}},setNode:function(e){var t=this;return t.setContent(t.dom.getOuterHTML(e)),e},getNode:function(){function e(e,t){for(var n=e;e&&3===e.nodeType&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n}var t=this,n=t.getRng(),r,i=n.startContainer,o=n.endContainer,a=n.startOffset,s=n.endOffset,l=t.dom.getRoot();return n?n.setStart?(r=n.commonAncestorContainer,!n.collapsed&&(i==o&&2>s-a&&i.hasChildNodes()&&(r=i.childNodes[a]),3===i.nodeType&&3===o.nodeType&&(i=i.length===a?e(i.nextSibling,!0):i.parentNode,o=0===s?e(o.previousSibling,!1):o.parentNode,i&&i===o))?i:r&&3==r.nodeType?r.parentNode:r):(r=n.item?n.item(0):n.parentElement(),r.ownerDocument!==t.win.document&&(r=l),r):l},getSelectedBlocks:function(t,n){var r=this,i=r.dom,o,a,s=[];if(a=i.getRoot(),t=i.getParent(t||r.getStart(),i.isBlock),n=i.getParent(n||r.getEnd(),i.isBlock),t&&t!=a&&s.push(t),t&&n&&t!=n){o=t;for(var l=new e(t,a);(o=l.next())&&o!=n;)i.isBlock(o)&&s.push(o)}return n&&t!=n&&n!=a&&s.push(n),s},isForward:function(){var e=this.dom,t=this.getSel(),n,r;return t&&t.anchorNode&&t.focusNode?(n=e.createRng(),n.setStart(t.anchorNode,t.anchorOffset),n.collapse(!0),r=e.createRng(),r.setStart(t.focusNode,t.focusOffset),r.collapse(!0),n.compareBoundaryPoints(n.START_TO_START,r)<=0):!0},normalize:function(){var e=this,t=e.getRng();return!d&&new i(e.dom).normalize(t)&&e.setRng(t,e.isForward()),t},selectorChanged:function(e,t){var n=this,r;return n.selectorChangedData||(n.selectorChangedData={},r={},n.editor.on("NodeChange",function(e){var t=e.element,i=n.dom,o=i.getParents(t,null,i.getRoot()),a={};c(n.selectorChangedData,function(e,t){c(o,function(n){return i.is(n,t)?(r[t]||(c(e,function(e){e(!0,{node:n,selector:t,parents:o})}),r[t]=e),a[t]=e,!1):void 0})}),c(r,function(e,n){a[n]||(delete r[n],c(e,function(e){e(!1,{node:t,selector:n,parents:o})}))})})),n.selectorChangedData[e]||(n.selectorChangedData[e]=[]),n.selectorChangedData[e].push(t),n},getScrollContainer:function(){for(var e,t=this.dom.getRoot();t&&"BODY"!=t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e){function t(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}}var n,r,i=this,o=i.dom,a=o.getRoot(),s,l;if("BODY"!=a.nodeName){var c=i.getScrollContainer();if(c)return n=t(e).y-t(c).y,l=c.clientHeight,s=c.scrollTop,void((s>n||n+25>s+l)&&(c.scrollTop=s>n?n:n-l+25))}r=o.getViewPort(i.editor.getWin()),n=o.getPos(e).y,s=r.y,l=r.h,(ns+l)&&i.editor.getWin().scrollTo(0,s>n?n:n-l+25)},placeCaretAt:function(e,t){var n=this.editor.getDoc(),r,i;if(n.caretPositionFromPoint)i=n.caretPositionFromPoint(e,t),r=n.createRange(),r.setStart(i.offsetNode,i.offset),r.collapse(!0);else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(n.body.createTextRange){r=n.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(o){r.collapse(t=e;e++)a.addShortcut("ctrl+"+e,"",["FormatBlock",!1,"h"+e]);a.addShortcut("ctrl+7","",["FormatBlock",!1,"p"]),a.addShortcut("ctrl+8","",["FormatBlock",!1,"div"]),a.addShortcut("ctrl+9","",["FormatBlock",!1,"address"])}function f(e){return e?V[e]:V}function p(e,t){e&&("string"!=typeof e?at(e,function(e,t){p(t,e)}):(t=t.length?t:[t],at(t,function(e){e.deep===tt&&(e.deep=!e.selector),e.split===tt&&(e.split=!e.selector||e.inline),e.remove===tt&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),V[e]=t))}function h(e){return e&&V[e]&&delete V[e],V}function m(e){var t;return a.dom.getParent(e,function(e){return t=a.dom.getStyle(e,"text-decoration"),t&&"none"!==t}),t}function g(e){var t;1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType&&(t=m(e.parentNode),a.dom.getStyle(e,"color")&&t?a.dom.setStyle(e,"text-decoration",t):a.dom.getStyle(e,"textdecoration")===t&&a.dom.setStyle(e,"text-decoration",null))}function v(t,n,r){function i(e,t){if(t=t||d,e){if(t.onformat&&t.onformat(e,t,n,r),at(t.styles,function(t,r){U.setStyle(e,r,A(t,n))}),t.styles){var i=U.getAttrib(e,"style");i&&e.setAttribute("data-mce-style",i)}at(t.attributes,function(t,r){U.setAttrib(e,r,A(t,n))}),at(t.classes,function(t){t=A(t,n),U.hasClass(e,t)||U.addClass(e,t)})}}function o(){function t(t,n){var i=new e(n);for(r=i.current();r;r=i.prev())if(r.childNodes.length>1||r==t||"BR"==r.tagName)return r}var n=a.selection.getRng(),i=n.startContainer,o=n.endContainer;if(i!=o&&0===n.endOffset){var s=t(i,o),l=3==s.nodeType?s.length:s.childNodes.length;n.setEnd(s,l)}return n}function l(e,r,o){var a=[],l,f,p=!0;l=d.inline||d.block,f=U.create(l),i(f),q.walk(e,function(e){function r(e){var g,v,y,b,x;return x=p,g=e.nodeName.toLowerCase(),v=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&nt(e)&&(x=p,p="true"===nt(e),b=!0),S(g,"br")?(h=0,void(d.block&&U.remove(e))):d.wrapper&&C(e,t,n)?void(h=0):p&&!b&&d.block&&!d.wrapper&&s(g)&&j(v,l)?(e=U.rename(e,l),i(e),a.push(e),void(h=0)):d.selector&&(at(u,function(t){"collapsed"in t&&t.collapsed!==m||U.is(e,t.selector)&&!c(e)&&(i(e,t),y=!0)}),!d.inline||y)?void(h=0):void(!p||b||!j(l,g)||!j(v,l)||!o&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||c(e)||d.inline&&Y(e)?(h=0,at(st(e.childNodes),r),b&&(p=x),h=0):(h||(h=U.clone(f,Q),e.parentNode.insertBefore(h,e),a.push(h)),h.appendChild(e)))}var h;at(e,r)}),d.links===!0&&at(a,function(e){function t(e){"A"===e.nodeName&&i(e,d),at(st(e.childNodes),t)}t(e)}),at(a,function(e){function r(e){var t=0;return at(e.childNodes,function(e){B(e)||ot(e)||t++}),t}function o(e){var t,n;return at(e.childNodes,function(e){return 1!=e.nodeType||ot(e)||c(e)?void 0:(t=e,Q)}),t&&!ot(t)&&k(t,d)&&(n=U.clone(t,Q),i(n),U.replace(n,e,Z),U.remove(t,1)),n||e}var s;if(s=r(e),(a.length>1||!Y(e))&&0===s)return void U.remove(e,1);if(d.inline||d.wrapper){if(d.exact||1!==s||(e=o(e)),at(u,function(t){at(U.select(t.inline,e),function(e){ot(e)||M(t,n,e,t.exact?e:null)})}),C(e.parentNode,t,n))return U.remove(e,1),e=0,Z;d.merge_with_parents&&U.getParent(e.parentNode,function(r){return C(r,t,n)?(U.remove(e,1),e=0,Z):void 0}),e&&d.merge_siblings!==!1&&(e=I(O(e),e),e=I(e,O(e,Z)))}})}var u=f(t),d=u[0],p,h,m=!r&&$.isCollapsed();if(d)if(r)r.nodeType?(h=U.createRng(),h.setStartBefore(r),h.setEndAfter(r),l(L(h,u),null,!0)):l(r,null,!0);else if(m&&d.inline&&!U.select("td.mce-item-selected,th.mce-item-selected").length)z("apply",t,n);else{var y=a.selection.getNode();K||!u[0].defaultBlock||U.getParent(y,U.isBlock)||v(u[0].defaultBlock),a.selection.setRng(o()),p=$.getBookmark(),l(L($.getRng(Z),u),p),d.styles&&(d.styles.color||d.styles.textDecoration)&&(lt(y,g,"childNodes"),g(y)),$.moveToBookmark(p),W($.getRng(Z)),a.nodeChanged()}}function y(e,t,n,r){function i(e){var n,r,o,a,s;if(1===e.nodeType&&nt(e)&&(a=y,y="true"===nt(e),s=!0),n=st(e.childNodes),y&&!s)for(r=0,o=p.length;o>r&&!M(p[r],t,e,e);r++);if(h.deep&&n.length){for(r=0,o=n.length;o>r;r++)i(n[r]);s&&(y=a)}}function o(n){var i;return at(l(n.parentNode).reverse(),function(n){var o;i||"_start"==n.id||"_end"==n.id||(o=C(n,e,t,r),o&&o.split!==!1&&(i=n))}),i}function s(e,n,r,i){var o,a,s,l,c,u;if(e){for(u=e.parentNode,o=n.parentNode;o&&o!=u;o=o.parentNode){for(a=U.clone(o,Q),c=0;c=0;o--){if(a=t[o].selector,!a||t[o].defaultBlock)return Z;for(i=r.length-1;i>=0;i--)if(U.is(r[i],a))return Z}return Q}function E(e,t,n){var r;return et||(et={},r={},a.on("NodeChange",function(e){var t=l(e.element),n={};t=i.grep(t,function(e){return 1==e.nodeType&&!e.getAttribute("data-mce-bogus")}),at(et,function(e,i){at(t,function(o){return C(o,i,{},e.similar)?(r[i]||(at(e,function(e){e(!0,{node:o,format:i,parents:t})}),r[i]=e),n[i]=e,!1):void 0})}),at(r,function(i,o){n[o]||(delete r[o],at(i,function(n){n(!1,{node:e.element,format:o,parents:t})}))})})),at(e.split(","),function(e){et[e]||(et[e]=[],et[e].similar=n),et[e].push(t)}),this}function N(e){return o.getCssText(a,e)}function k(e,t){return S(e,t.inline)?Z:S(e,t.block)?Z:t.selector?1==e.nodeType&&U.is(e,t.selector):void 0}function S(e,t){return e=e||"",t=t||"",e=""+(e.nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()==t.toLowerCase()}function T(e,t){return R(U.getStyle(e,t),t)}function R(e,t){return("color"==t||"backgroundColor"==t)&&(e=U.toHex(e)),"fontWeight"==t&&700==e&&(e="bold"),"fontFamily"==t&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e}function A(e,t){return"string"!=typeof e?e=e(t):t&&(e=e.replace(/%(\w+)/g,function(e,n){return t[n]||e})),e}function B(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)}function D(e,t,n){var r=U.create(t,n);return e.parentNode.insertBefore(r,e),r.appendChild(e),r}function L(t,n,r){function i(e){function t(e){return"BR"==e.nodeName&&e.getAttribute("data-mce-bogus")&&!e.nextSibling}var r,i,o,a,s;if(r=i=e?g:y,a=e?"previousSibling":"nextSibling",s=U.getRoot(),3==r.nodeType&&!B(r)&&(e?v>0:bo?n:o,-1===n||r||n++):(n=a.indexOf(" ",t),o=a.indexOf("\xa0",t),n=-1!==n&&(-1===o||o>n)?n:o),n}var s,l,c,u;if(3===t.nodeType){if(c=o(t,n),-1!==c)return{container:t,offset:c};u=t}for(s=new e(t,U.getParent(t,Y)||a.getBody());l=s[i?"prev":"next"]();)if(3===l.nodeType){if(u=l,c=o(l),-1!==c)return{container:l,offset:c}}else if(Y(l))break;return u?(n=i?0:u.length,{container:u,offset:n}):void 0}function d(e,r){var i,o,a,s;for(3==e.nodeType&&0===e.nodeValue.length&&e[r]&&(e=e[r]),i=l(e),o=0;op?p:v],3==g.nodeType&&(v=0)),1==y.nodeType&&y.hasChildNodes()&&(p=y.childNodes.length-1,y=y.childNodes[b>p?p:b-1],3==y.nodeType&&(b=y.nodeValue.length)),g=c(g),y=c(y),(ot(g.parentNode)||ot(g))&&(g=ot(g)?g:g.parentNode,g=g.nextSibling||g,3==g.nodeType&&(v=0)),(ot(y.parentNode)||ot(y))&&(y=ot(y)?y:y.parentNode,y=y.previousSibling||y,3==y.nodeType&&(b=y.length)),n[0].inline&&(t.collapsed&&(m=u(g,v,!0),m&&(g=m.container,v=m.offset),m=u(y,b),m&&(y=m.container,b=m.offset)),h=o(y,b),h.node)){for(;h.node&&0===h.offset&&h.node.previousSibling;)h=o(h.node.previousSibling);h.node&&h.offset>0&&3===h.node.nodeType&&" "===h.node.nodeValue.charAt(h.offset-1)&&h.offset>1&&(y=h.node,y.splitText(h.offset-1))}return(n[0].inline||n[0].block_expand)&&(n[0].inline&&3==g.nodeType&&0!==v||(g=i(!0)),n[0].inline&&3==y.nodeType&&b!==y.nodeValue.length||(y=i())),n[0].selector&&n[0].expand!==Q&&!n[0].inline&&(g=d(g,"previousSibling"),y=d(y,"nextSibling")),(n[0].block||n[0].selector)&&(g=f(g,"previousSibling"),y=f(y,"nextSibling"),n[0].block&&(Y(g)||(g=i(!0)),Y(y)||(y=i()))),1==g.nodeType&&(v=G(g),g=g.parentNode),1==y.nodeType&&(b=G(y)+1,y=y.parentNode),{startContainer:g,startOffset:v,endContainer:y,endOffset:b}}function H(e,t){return t.links&&"A"==e.tagName}function M(e,t,n,r){var i,o,a;if(!k(n,e)&&!H(n,e))return Q;if("all"!=e.remove)for(at(e.styles,function(i,o){i=R(A(i,t),o),"number"==typeof o&&(o=i,r=0),(e.remove_similar||!r||S(T(r,o),i))&&U.setStyle(n,o,""),a=1}),a&&""===U.getAttrib(n,"style")&&(n.removeAttribute("style"),n.removeAttribute("data-mce-style")),at(e.attributes,function(e,i){var o;if(e=A(e,t),"number"==typeof i&&(i=e,r=0),!r||S(U.getAttrib(r,i),e)){if("class"==i&&(e=U.getAttrib(n,i),e&&(o="",at(e.split(/\s+/),function(e){/mce\w+/.test(e)&&(o+=(o?" ":"")+e)}),o)))return void U.setAttrib(n,i,o);"class"==i&&n.removeAttribute("className"),J.test(i)&&n.removeAttribute("data-mce-"+i),n.removeAttribute(i)}}),at(e.classes,function(e){e=A(e,t),(!r||U.hasClass(r,e))&&U.removeClass(n,e)}),o=U.getAttribs(n),i=0;io?o:i]),3===r.nodeType&&n&&i>=r.nodeValue.length&&(r=new e(r,a.getBody()).next()||r),3!==r.nodeType||n||0!==i||(r=new e(r,a.getBody()).prev()||r),r}function z(t,n,r,i){function o(e){var t=U.create("span",{id:g,"data-mce-bogus":!0,style:b?"color:red":""});return e&&t.appendChild(a.getDoc().createTextNode(X)),t}function l(e,t){for(;e;){if(3===e.nodeType&&e.nodeValue!==X||e.childNodes.length>1)return!1;t&&1===e.nodeType&&t.push(e),e=e.firstChild}return!0}function c(e){for(;e;){if(e.id===g)return e;e=e.parentNode}}function u(t){var n;if(t)for(n=new e(t,t),t=n.current();t;t=n.next())if(3===t.nodeType)return t}function d(e,t){var n,r;if(e)r=$.getRng(!0),l(e)?(t!==!1&&(r.setStartBefore(e),r.setEndBefore(e)),U.remove(e)):(n=u(e),n.nodeValue.charAt(0)===X&&(n.deleteData(0,1),r.startContainer==n&&r.startOffset>0&&r.setStart(n,r.startOffset-1),r.endContainer==n&&r.endOffset>0&&r.setEnd(n,r.endOffset-1)),U.remove(e,1)),$.setRng(r);else if(e=c($.getStart()),!e)for(;e=U.get(g);)d(e,!1)}function p(){var e,t,i,a,s,l,d;e=$.getRng(!0),a=e.startOffset,l=e.startContainer,d=l.nodeValue,t=c($.getStart()),t&&(i=u(t)),d&&a>0&&a=0;h--)u.appendChild(U.clone(p[h],!1)),u=u.firstChild;u.appendChild(U.doc.createTextNode(X)),u=u.firstChild;var g=U.getParent(d,s);g&&U.isEmpty(g)?d.parentNode.replaceChild(m,d):U.insertAfter(m,d),$.setCursorLocation(u,1),U.isEmpty(d)&&U.remove(d)}}function m(){var e;e=c($.getStart()),e&&!U.isEmpty(e)&<(e,function(e){1!=e.nodeType||e.id===g||U.isEmpty(e)||U.setAttrib(e,"data-mce-bogus",null)},"childNodes")}var g="_mce_caret",b=a.settings.caret_debug;a._hasCaretEvents||(it=function(){var e=[],t;if(l(c($.getStart()),e))for(t=e.length;t--;)U.setAttrib(e[t],"data-mce-bogus","1")},rt=function(e){var t=e.keyCode;d(),(8==t||37==t||39==t)&&d(c($.getStart())),m()},a.on("SetContent",function(e){e.selection&&m()}),a._hasCaretEvents=!0),"apply"==t?p():h()}function W(t){var n=t.startContainer,r=t.startOffset,i,o,a,s,l;if(3==n.nodeType&&r>=n.nodeValue.length&&(r=G(n),n=n.parentNode,i=!0),1==n.nodeType)for(s=n.childNodes,n=s[Math.min(r,s.length-1)],o=new e(n,U.getParent(n,U.isBlock)),(r>s.length-1||i)&&o.next(),a=o.current();a;a=o.next())if(3==a.nodeType&&!B(a))return l=U.create("a",{"data-mce-bogus":"all"},X),a.parentNode.insertBefore(l,a),t.setStart(a,0),$.setRng(t),void U.remove(l)}var V={},U=a.dom,$=a.selection,q=new t(U),j=a.schema.isValidChild,Y=U.isBlock,K=a.settings.forced_root_block,G=U.nodeIndex,X="\ufeff",J=/^(src|href|style)$/,Q=!1,Z=!0,et,tt,nt=U.getContentEditable,rt,it,ot=n.isBookmarkNode,at=i.each,st=i.grep,lt=i.walk,ct=i.extend;ct(this,{get:f,register:p,unregister:h,apply:v,remove:y,toggle:b,match:x,matchAll:w,matchNode:C,canApply:_,formatChanged:E,getCssText:N}),u(),d(),a.on("BeforeGetContent",function(e){it&&"raw"!=e.format&&it()}),a.on("mouseup keydown",function(e){rt&&rt(e)})}}),r(I,[d,u,N],function(e,t,n){var r=t.trim,i;return i=new RegExp(["]+data-mce-bogus[^>]+>[\u200b\ufeff]+<\\/span>",'\\s?data-mce-selected="[^"]+"'].join("|"),"gi"),function(t){function o(){var e=t.getContent({format:"raw",no_events:1}),o=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,a,s,l,c,u,d=t.schema;for(e=e.replace(i,""),u=d.getShortEndedElements();c=o.exec(e);)s=o.lastIndex,l=c[0].length,a=u[c[1]]?s:n.findEndTag(d,e,s),e=e.substring(0,s-l)+e.substring(a),o.lastIndex=s-l;return r(e)}function a(e){s.typing=!1,s.add({},e)}var s=this,l=0,c=[],u,d,f=0;return t.on("init",function(){s.add()}),t.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&s.beforeChange()}),t.on("ExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&a(e)}),t.on("ObjectResizeStart",function(){s.beforeChange()}),t.on("SaveContent ObjectResized blur",a),t.on("DragEnd",a),t.on("KeyUp",function(n){var r=n.keyCode;(r>=33&&36>=r||r>=37&&40>=r||45==r||13==r||n.ctrlKey)&&(a(),t.nodeChanged()),(46==r||8==r||e.mac&&(91==r||93==r))&&t.nodeChanged(),d&&s.typing&&(t.isDirty()||(t.isNotDirty=!c[0]||o()==c[0].content,t.isNotDirty||t.fire("change",{level:c[0],lastLevel:null})),t.fire("TypingUndo"),d=!1,t.nodeChanged())}),t.on("KeyDown",function(e){var t=e.keyCode;return t>=33&&36>=t||t>=37&&40>=t||45==t?void(s.typing&&a(e)):void((16>t||t>20)&&224!=t&&91!=t&&!s.typing&&(s.beforeChange(),s.typing=!0,s.add({},e),d=!0))}),t.on("MouseDown",function(e){s.typing&&a(e)}),t.addShortcut("ctrl+z","","Undo"),t.addShortcut("ctrl+y,ctrl+shift+z","","Redo"),t.on("AddUndo Undo Redo ClearUndos",function(e){e.isDefaultPrevented()||t.nodeChanged()}),s={data:c,typing:!1,beforeChange:function(){f||(u=t.selection.getBookmark(2,!0))},add:function(e,n){var r,i=t.settings,a;if(e=e||{},e.content=o(),f||t.removed)return null;if(a=c[l],t.fire("BeforeAddUndo",{level:e,lastLevel:a,originalEvent:n}).isDefaultPrevented())return null;if(a&&a.content==e.content)return null;if(c[l]&&(c[l].beforeBookmark=u),i.custom_undo_redo_levels&&c.length>i.custom_undo_redo_levels){for(r=0;r0&&(t.isNotDirty=!1,t.fire("change",s)),e},undo:function(){var e;return s.typing&&(s.add(),s.typing=!1),l>0&&(e=c[--l],0===l&&(t.isNotDirty=!0),t.setContent(e.content,{format:"raw"}),t.selection.moveToBookmark(e.beforeBookmark),t.fire("undo",{level:e})),e},redo:function(){var e;return l0||s.typing&&c[0]&&o()!=c[0].content},hasRedo:function(){return lB)&&(u=a.create("br"),t.parentNode.insertBefore(u,t)),l.setStartBefore(t),l.setEndBefore(t)):(l.setStartAfter(t),l.setEndAfter(t)):(l.setStart(t,0),l.setEnd(t,0));s.setRng(l),a.remove(u),s.scrollIntoView(t)}}function g(e){var t=l.forced_root_block;t&&t.toLowerCase()===e.tagName.toLowerCase()&&a.setAttribs(e,l.forced_root_block_attrs)}function v(e){var t=T,n,i,o,s=u.getTextInlineElements();if(e||"TABLE"==P?(n=a.create(e||I),g(n)):n=A.cloneNode(!1),o=n,l.keep_styles!==!1)do if(s[t.nodeName]){if("_mce_caret"==t.id)continue;i=t.cloneNode(!1),a.setAttrib(i,"id",""),n.hasChildNodes()?(i.appendChild(n.firstChild),n.appendChild(i)):(o=i,n.appendChild(i))}while(t=t.parentNode);return r||(o.innerHTML='
'),n}function y(t){var n,r,i;if(3==T.nodeType&&(t?R>0:RT.childNodes.length-1,T=T.childNodes[Math.min(R,T.childNodes.length-1)]||T,R=F&&3==T.nodeType?T.nodeValue.length:0),S=_(T)){if(c.beforeChange(),!a.isBlock(S)&&S!=a.getRoot())return void((!I||D)&&x());if((I&&!D||!I&&D)&&(T=b(T,R)),A=a.getParent(T,a.isBlock),M=A?a.getParent(A.parentNode,a.isBlock):null,P=A?A.nodeName.toUpperCase():"",O=M?M.nodeName.toUpperCase():"","LI"!=O||o.ctrlKey||(A=M,P=O),/^(LI|DT|DD)$/.test(P)){if(!I&&D)return void x();if(a.isEmpty(A))return void C()}if("PRE"==P&&l.br_in_pre!==!1){if(!D)return void x()}else if(!I&&!D&&"LI"!=P||I&&D)return void x();I&&A===i.getBody()||(I=I||"P",y()?(L=/^(H[1-6]|PRE|FIGURE)$/.test(P)&&"HGROUP"!=O?v(I):v(),l.end_container_on_empty_block&&f(M)&&a.isEmpty(A)?L=a.split(M,A):a.insertAfter(L,A),m(L)):y(!0)?(L=A.parentNode.insertBefore(v(),A),p(L),m(A)):(k=N.cloneRange(),k.setEndAfter(A),H=k.extractContents(),w(H),L=H.firstChild,a.insertAfter(H,A),h(L),E(A),m(L)),a.setAttrib(L,"id",""),i.fire("NewBlock",{newBlock:L}),c.add())}}}var a=i.dom,s=i.selection,l=i.settings,c=i.undoManager,u=i.schema,d=u.getNonEmptyElements();i.on("keydown",function(e){13==e.keyCode&&o(e)!==!1&&e.preventDefault()})}}),r(z,[],function(){return function(e){function t(){var t=i.getStart(),s=e.getBody(),l,c,u,d,f,p,h,m=-16777215,g,v,y,b,C;if(C=n.forced_root_block,t&&1===t.nodeType&&C){for(;t&&t!=s;){if(a[t.nodeName])return;t=t.parentNode}if(l=i.getRng(),l.setStart){c=l.startContainer,u=l.startOffset,d=l.endContainer,f=l.endOffset;try{v=e.getDoc().activeElement===s}catch(x){}}else l.item&&(t=l.item(0),l=e.getDoc().body.createTextRange(),l.moveToElementText(t)),v=l.parentElement().ownerDocument===e.getDoc(),y=l.duplicate(),y.collapse(!0),u=-1*y.move("character",m),y.collapsed||(y=l.duplicate(),y.collapse(!1),f=-1*y.move("character",m)-u);for(t=s.firstChild,b=s.nodeName.toLowerCase();t;)if((3===t.nodeType||1==t.nodeType&&!a[t.nodeName])&&o.isValidChild(b,C.toLowerCase())){if(3===t.nodeType&&0===t.nodeValue.length){h=t,t=t.nextSibling,r.remove(h);continue}p||(p=r.create(C,e.settings.forced_root_block_attrs),t.parentNode.insertBefore(p,t),g=!0),h=t,t=t.nextSibling,p.appendChild(h)}else p=null,t=t.nextSibling;if(g&&v){if(l.setStart)l.setStart(c,u),l.setEnd(d,f),i.setRng(l);else try{l=e.getDoc().body.createTextRange(),l.moveToElementText(s),l.collapse(!0),l.moveStart("character",u),f>0&&l.moveEnd("character",f),l.select()}catch(x){}e.nodeChanged()}}}var n=e.settings,r=e.dom,i=e.selection,o=e.schema,a=o.getBlockElements();n.forced_root_block&&e.on("NodeChange",t)}}),r(W,[T,d,u,M,x,h],function(e,n,r,i,o,a){var s=r.each,l=r.extend,c=r.map,u=r.inArray,d=r.explode,f=n.gecko,p=n.ie,h=n.ie&&n.ie<11,m=!0,g=!1;return function(r){function v(e,t,n){var r;return e=e.toLowerCase(),(r=T.exec[e])?(r(e,t,n),m):g}function y(e){var t;return e=e.toLowerCase(),(t=T.state[e])?t(e):-1}function b(e){var t;return e=e.toLowerCase(),(t=T.value[e])?t(e):g}function C(e,t){t=t||"exec",s(e,function(e,n){s(n.toLowerCase().split(","),function(n){T[t][n]=e})})}function x(e,n,i){return n===t&&(n=g),i===t&&(i=null),r.getDoc().execCommand(e,n,i)}function w(e){return A.match(e)}function _(e,n){A.toggle(e,n?{value:n}:t),r.nodeChanged()}function E(e){B=S.getBookmark(e)}function N(){S.moveToBookmark(B)}var k=r.dom,S=r.selection,T={state:{},exec:{},value:{}},R=r.settings,A=r.formatter,B;l(this,{execCommand:v,queryCommandState:y,queryCommandValue:b,addCommands:C}),C({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){r.undoManager.add()},"Cut,Copy,Paste":function(e){var t=r.getDoc(),i;try{x(e)}catch(o){i=m}if(i||!t.queryCommandSupported(e)){var a=r.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");n.mac&&(a=a.replace(/Ctrl\+/g,"\u2318+")),r.windowManager.alert(a)}},unlink:function(){if(S.isCollapsed()){var e=S.getNode();return void("A"==e.tagName&&r.dom.remove(e,!0))}A.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t=e.substring(7);"full"==t&&(t="justify"),s("left,center,right,justify".split(","),function(e){t!=e&&A.remove("align"+e)}),_("align"+t),v("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;x(e),t=k.getParent(S.getNode(),"ol,ul"),t&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(E(),k.split(n,t),N()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){_(e)},"ForeColor,HiliteColor,FontName":function(e,t,n){_(e,n)},FontSize:function(e,t,n){var r,i;n>=1&&7>=n&&(i=d(R.font_size_style_values),r=d(R.font_size_classes),n=r?r[n-1]||n:i[n-1]||n),_(e,n) -},RemoveFormat:function(e){A.remove(e)},mceBlockQuote:function(){_("blockquote")},FormatBlock:function(e,t,n){return _(n||"p")},mceCleanup:function(){var e=S.getBookmark();r.setContent(r.getContent({cleanup:m}),{cleanup:m}),S.moveToBookmark(e)},mceRemoveNode:function(e,t,n){var i=n||S.getNode();i!=r.getBody()&&(E(),r.dom.remove(i,m),N())},mceSelectNodeDepth:function(e,t,n){var i=0;k.getParent(S.getNode(),function(e){return 1==e.nodeType&&i++==n?(S.select(e),g):void 0},r.getBody())},mceSelectNode:function(e,t,n){S.select(n)},mceInsertContent:function(t,n,o){function a(e){function t(e){return r[e]&&3==r[e].nodeType}var n,r,i;return n=S.getRng(!0),r=n.startContainer,i=n.startOffset,3==r.nodeType&&(i>0?e=e.replace(/^ /," "):t("previousSibling")||(e=e.replace(/^ /," ")),i|)$/," "):t("nextSibling")||(e=e.replace(/( | )(
|)$/," "))),e}function l(e){if(w)for(b=e.firstChild;b;b=b.walk(!0))_[b.name]&&b.attr("data-mce-new","true")}function c(){if(w){var e=r.getBody(),t=new i(k);s(k.select("*[data-mce-new]"),function(n){n.removeAttribute("data-mce-new");for(var r=n.parentNode;r&&r!=e;r=r.parentNode)t.compare(r,n)&&k.remove(n,!0)})}}var u,d,f,h,m,g,v,y,b,C,x,w,_=r.schema.getTextInlineElements();"string"!=typeof o&&(w=o.merge,o=o.content),/^ | $/.test(o)&&(o=a(o)),u=r.parser,d=new e({},r.schema),x='​',g={content:o,format:"html",selection:!0},r.fire("BeforeSetContent",g),o=g.content,-1==o.indexOf("{$caret}")&&(o+="{$caret}"),o=o.replace(/\{\$caret\}/,x),y=S.getRng();var E=y.startContainer||(y.parentElement?y.parentElement():null),N=r.getBody();E===N&&S.isCollapsed()&&k.isBlock(N.firstChild)&&k.isEmpty(N.firstChild)&&(y=k.createRng(),y.setStart(N.firstChild,0),y.setEnd(N.firstChild,0),S.setRng(y)),S.isCollapsed()||r.getDoc().execCommand("Delete",!1,null),f=S.getNode();var T={context:f.nodeName.toLowerCase()};if(m=u.parse(o,T),l(m),b=m.lastChild,"mce_marker"==b.attr("id"))for(v=b,b=b.prev;b;b=b.walk(!0))if(3==b.type||!k.isBlock(b.name)){r.schema.isValidChild(b.parent.name,"span")&&b.parent.insert(v,b,"br"===b.name);break}if(T.invalid){for(S.setContent(x),f=S.getNode(),h=r.getBody(),9==f.nodeType?f=b=h:b=f;b!==h;)f=b,b=b.parentNode;o=f==h?h.innerHTML:k.getOuterHTML(f),o=d.serialize(u.parse(o.replace(//i,function(){return d.serialize(m)}))),f==h?k.setHTML(h,o):k.setOuterHTML(f,o)}else o=d.serialize(m),b=f.firstChild,C=f.lastChild,!b||b===C&&"BR"===b.nodeName?k.setHTML(f,o):S.setContent(o);c(),v=k.get("mce_marker"),S.scrollIntoView(v),y=k.createRng(),b=v.previousSibling,b&&3==b.nodeType?(y.setStart(b,b.nodeValue.length),p||(C=v.nextSibling,C&&3==C.nodeType&&(b.appendData(C.data),C.parentNode.removeChild(C)))):(y.setStartBefore(v),y.setEndBefore(v)),k.remove(v),S.setRng(y),r.fire("SetContent",g),r.addVisual()},mceInsertRawHTML:function(e,t,n){S.setContent("tiny_mce_marker"),r.setContent(r.getContent().replace(/tiny_mce_marker/g,function(){return n}))},mceToggleFormat:function(e,t,n){_(n)},mceSetContent:function(e,t,n){r.setContent(n)},"Indent,Outdent":function(e){var t,n,i;t=R.indentation,n=/[a-z%]+$/i.exec(t),t=parseInt(t,10),y("InsertUnorderedList")||y("InsertOrderedList")?x(e):(R.forced_root_block||k.getParent(S.getNode(),k.isBlock)||A.apply("div"),s(S.getSelectedBlocks(),function(o){if("LI"!=o.nodeName){var a=r.getParam("indent_use_margin",!1)?"margin":"padding";a+="rtl"==k.getStyle(o,"direction",!0)?"Right":"Left","outdent"==e?(i=Math.max(0,parseInt(o.style[a]||0,10)-t),k.setStyle(o,a,i?i+n:"")):(i=parseInt(o.style[a]||0,10)+t+n,k.setStyle(o,a,i))}}))},mceRepaint:function(){if(f)try{E(m),S.getSel()&&S.getSel().selectAllChildren(r.getBody()),S.collapse(m),N()}catch(e){}},InsertHorizontalRule:function(){r.execCommand("mceInsertContent",!1,"
")},mceToggleVisualAid:function(){r.hasVisual=!r.hasVisual,r.addVisual()},mceReplaceContent:function(e,t,n){r.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,S.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=k.getParent(S.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||A.remove("link"),n.href&&A.apply("link",n,r)},selectAll:function(){var e=k.getRoot(),t;S.getRng().setStart?(t=k.createRng(),t.setStart(e,0),t.setEnd(e,e.childNodes.length),S.setRng(t)):(t=S.getRng(),t.item||(t.moveToElementText(e),t.select()))},"delete":function(){x("Delete");var e=r.getBody();k.isEmpty(e)&&(r.setContent(""),e.firstChild&&k.isBlock(e.firstChild)?r.selection.setCursorLocation(e.firstChild,0):r.selection.setCursorLocation(e,0))},mceNewDocument:function(){r.setContent("")},InsertLineBreak:function(e,t,n){function i(){for(var e=new a(p,v),t,n=r.schema.getNonEmptyElements();t=e.next();)if(n[t.nodeName.toLowerCase()]||t.length>0)return!0}var s=n,l,c,u,d=S.getRng(!0);new o(k).normalize(d);var f=d.startOffset,p=d.startContainer;if(1==p.nodeType&&p.hasChildNodes()){var g=f>p.childNodes.length-1;p=p.childNodes[Math.min(f,p.childNodes.length-1)]||p,f=g&&3==p.nodeType?p.nodeValue.length:0}var v=k.getParent(p,k.isBlock),y=v?v.nodeName.toUpperCase():"",b=v?k.getParent(v.parentNode,k.isBlock):null,C=b?b.nodeName.toUpperCase():"",x=s&&s.ctrlKey;"LI"!=C||x||(v=b,y=C),p&&3==p.nodeType&&f>=p.nodeValue.length&&(h||i()||(l=k.create("br"),d.insertNode(l),d.setStartAfter(l),d.setEndAfter(l),c=!0)),l=k.create("br"),d.insertNode(l);var w=k.doc.documentMode;return h&&"PRE"==y&&(!w||8>w)&&l.parentNode.insertBefore(k.doc.createTextNode("\r"),l),u=k.create("span",{}," "),l.parentNode.insertBefore(u,l),S.scrollIntoView(u),k.remove(u),c?(d.setStartBefore(l),d.setEndBefore(l)):(d.setStartAfter(l),d.setEndAfter(l)),S.setRng(d),r.undoManager.add(),m}}),C({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t="align"+e.substring(7),n=S.isCollapsed()?[k.getParent(S.getNode(),k.isBlock)]:S.getSelectedBlocks(),r=c(n,function(e){return!!A.matchNode(e,t)});return-1!==u(r,m)},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return w(e)},mceBlockQuote:function(){return w("blockquote")},Outdent:function(){var e;if(R.inline_styles){if((e=k.getParent(S.getStart(),k.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return m;if((e=k.getParent(S.getEnd(),k.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return m}return y("InsertUnorderedList")||y("InsertOrderedList")||!R.inline_styles&&!!k.getParent(S.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=k.getParent(S.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),C({"FontSize,FontName":function(e){var t=0,n;return(n=k.getParent(S.getNode(),"span"))&&(t="fontsize"==e?n.style.fontSize:n.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()),t}},"value"),C({Undo:function(){r.undoManager.undo()},Redo:function(){r.undoManager.redo()}})}}),r(V,[u],function(e){function t(e,o){var a=this,s,l;if(e=r(e),o=a.settings=o||{},s=o.base_uri,/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))return void(a.source=e);var c=0===e.indexOf("//");0!==e.indexOf("/")||c||(e=(s?s.protocol||"http":"http")+"://mce_host"+e),/^[\w\-]*:?\/\//.test(e)||(l=o.base_uri?o.base_uri.path:new t(location.href).directory,""===o.base_uri.protocol?e="//mce_host"+a.toAbsPath(l,e):(e=/([^#?]*)([#?]?.*)/.exec(e),e=(s&&s.protocol||"http")+"://mce_host"+a.toAbsPath(l,e[1])+e[2])),e=e.replace(/@@/g,"(mce_at)"),e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e),n(i,function(t,n){var r=e[n];r&&(r=r.replace(/\(mce_at\)/g,"@@")),a[t]=r}),s&&(a.protocol||(a.protocol=s.protocol),a.userInfo||(a.userInfo=s.userInfo),a.port||"mce_host"!==a.host||(a.port=s.port),a.host&&"mce_host"!==a.host||(a.host=s.host),a.source=""),c&&(a.protocol="")}var n=e.each,r=e.trim,i="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),o={ftp:21,http:80,https:443,mailto:25};return t.prototype={setPath:function(e){var t=this;e=/^(.*?)\/?(\w+)?$/.exec(e),t.path=e[0],t.directory=e[1],t.file=e[2],t.source="",t.getURI()},toRelative:function(e){var n=this,r;if("./"===e)return e;if(e=new t(e,{base_uri:n}),"mce_host"!=e.host&&n.host!=e.host&&e.host||n.port!=e.port||n.protocol!=e.protocol&&""!==e.protocol)return e.getURI();var i=n.getURI(),o=e.getURI();return i==o||"/"==i.charAt(i.length-1)&&i.substr(0,i.length-1)==o?i:(r=n.toRelPath(n.path,e.path),e.query&&(r+="?"+e.query),e.anchor&&(r+="#"+e.anchor),r)},toAbsolute:function(e,n){return e=new t(e,{base_uri:this}),e.getURI(n&&this.isSameOrigin(e))},isSameOrigin:function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=o[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},toRelPath:function(e,t){var n,r=0,i="",o,a;if(e=e.substring(0,e.lastIndexOf("/")),e=e.split("/"),n=t.split("/"),e.length>=n.length)for(o=0,a=e.length;a>o;o++)if(o>=n.length||e[o]!=n[o]){r=o+1;break}if(e.lengtho;o++)if(o>=e.length||e[o]!=n[o]){r=o+1;break}if(1===r)return t;for(o=0,a=e.length-(r-1);a>o;o++)i+="../";for(o=r-1,a=n.length;a>o;o++)i+=o!=r-1?"/"+n[o]:n[o];return i},toAbsPath:function(e,t){var r,i=0,o=[],a,s;for(a=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),n(e,function(e){e&&o.push(e)}),e=o,r=t.length-1,o=[];r>=0;r--)0!==t[r].length&&"."!==t[r]&&(".."!==t[r]?i>0?i--:o.push(t[r]):i++);return r=e.length-i,s=0>=r?o.reverse().join("/"):e.slice(0,r).join("/")+"/"+o.reverse().join("/"),0!==s.indexOf("/")&&(s="/"+s),a&&s.lastIndexOf("/")!==s.length-1&&(s+=a),s},getURI:function(e){var t,n=this;return(!n.source||e)&&(t="",e||(t+=n.protocol?n.protocol+"://":"//",n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},t}),r(U,[u],function(e){function t(){}var n=e.each,r=e.extend,i,o;return t.extend=i=function(e){function t(){var e,t,n,r=this;if(!o&&(r.init&&r.init.apply(r,arguments),t=r.Mixins))for(e=t.length;e--;)n=t[e],n.init&&n.init.apply(r,arguments)}function a(){return this}function s(e,t){return function(){var n=this,r=n._super,i;return n._super=c[e],i=t.apply(n,arguments),n._super=r,i}}var l=this,c=l.prototype,u,d,f;o=!0,u=new l,o=!1,e.Mixins&&(n(e.Mixins,function(t){t=t;for(var n in t)"init"!==n&&(e[n]=t[n])}),c.Mixins&&(e.Mixins=c.Mixins.concat(e.Mixins))),e.Methods&&n(e.Methods.split(","),function(t){e[t]=a}),e.Properties&&n(e.Properties.split(","),function(t){var n="_"+t;e[t]=function(e){var t=this,r;return e!==r?(t[n]=e,t):t[n]}}),e.Statics&&n(e.Statics,function(e,n){t[n]=e}),e.Defaults&&c.Defaults&&(e.Defaults=r({},c.Defaults,e.Defaults));for(d in e)f=e[d],u[d]="function"==typeof f&&c[d]?s(d,f):f;return t.prototype=u,t.constructor=t,t.extend=i,t},t}),r($,[u],function(e){function t(e){function t(){return!1}function n(){return!0}function r(r,i){var a,s,l,d;if(r=r.toLowerCase(),i=i||{},i.type=r,i.target||(i.target=c),i.preventDefault||(i.preventDefault=function(){i.isDefaultPrevented=n},i.stopPropagation=function(){i.isPropagationStopped=n},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=n},i.isDefaultPrevented=t,i.isPropagationStopped=t,i.isImmediatePropagationStopped=t),e.beforeFire&&e.beforeFire(i),a=u[r])for(s=0,l=a.length;l>s;s++){if(a[s]=d=a[s],d.once&&o(r,d),i.isImmediatePropagationStopped())return i.stopPropagation(),i;if(d.call(c,i)===!1)return i.preventDefault(),i}return i}function i(e,n,r){var i,o,a;if(n===!1&&(n=t),n)for(o=e.toLowerCase().split(" "),a=o.length;a--;)e=o[a],i=u[e],i||(i=u[e]=[],d(e,!0)),r?i.unshift(n):i.push(n);return l}function o(e,t){var n,r,i,o,a;if(e)for(o=e.toLowerCase().split(" "),n=o.length;n--;){if(e=o[n],r=u[e],!e){for(i in u)d(i,!1),delete u[i];return l}if(r){if(t)for(a=r.length;a--;)r[a]===t&&(r=r.slice(0,a).concat(r.slice(a+1)),u[e]=r);else r.length=0;r.length||(d(e,!1),delete u[e])}}else{for(e in u)d(e,!1);u={}}return l}function a(e,t,n){return t.once=!0,i(e,t,n)}function s(e){return e=e.toLowerCase(),!(!u[e]||0===u[e].length)}var l=this,c,u={},d;e=e||{},c=e.scope||l,d=e.toggleEvent||t,l.fire=r,l.on=i,l.off=o,l.once=a,l.has=s}var n=e.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchend"," ");return t.isNative=function(e){return!!n[e.toLowerCase()]},t}),r(q,[U],function(e){function t(e){for(var t=[],n=e.length,r;n--;)r=e[n],r.__checked||(t.push(r),r.__checked=1);for(n=t.length;n--;)delete t[n].__checked;return t}var n=/^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,r=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i=/^\s*|\s*$/g,o,a=e.extend({init:function(e){function t(e){return e?(e=e.toLowerCase(),function(t){return"*"===e||t.type===e}):void 0}function o(e){return e?function(t){return t._name===e}:void 0}function a(e){return e?(e=e.split("."),function(t){for(var n=e.length;n--;)if(!t.hasClass(e[n]))return!1;return!0}):void 0}function s(e,t,n){return e?function(r){var i=r[e]?r[e]():"";return t?"="===t?i===n:"*="===t?i.indexOf(n)>=0:"~="===t?(" "+i+" ").indexOf(" "+n+" ")>=0:"!="===t?i!=n:"^="===t?0===i.indexOf(n):"$="===t?i.substr(i.length-n.length)===n:!1:!!n}:void 0}function l(e){var t;return e?(e=/(?:not\((.+)\))|(.+)/i.exec(e),e[1]?(t=u(e[1],[]),function(e){return!d(e,t)}):(e=e[2],function(t,n,r){return"first"===e?0===n:"last"===e?n===r-1:"even"===e?n%2===0:"odd"===e?n%2===1:t[e]?t[e]():!1})):void 0}function c(e,r,c){function u(e){e&&r.push(e)}var d;return d=n.exec(e.replace(i,"")),u(t(d[1])),u(o(d[2])),u(a(d[3])),u(s(d[4],d[5],d[6])),u(l(d[7])),r.psuedo=!!d[7],r.direct=c,r}function u(e,t){var n=[],i,o,a;do if(r.exec(""),o=r.exec(e),o&&(e=o[3],n.push(o[1]),o[2])){i=o[3];break}while(o);for(i&&u(i,t),e=[],a=0;a"!=n[a]&&e.push(c(n[a],[],">"===n[a-1]));return t.push(e),t}var d=this.match;this._selectors=u(e,[])},match:function(e,t){var n,r,i,o,a,s,l,c,u,d,f,p,h;for(t=t||this._selectors,n=0,r=t.length;r>n;n++){for(a=t[n],o=a.length,h=e,p=0,i=o-1;i>=0;i--)for(c=a[i];h;){if(c.psuedo)for(f=h.parent().items(),u=d=f.length;u--&&f[u]!==h;);for(s=0,l=c.length;l>s;s++)if(!c[s](h,u,d)){s=l+1;break}if(s===l){p++;break}if(i===o-1)break;h=h.parent()}if(p===o)return!0}return!1},find:function(e){function n(e,t,i){var o,a,s,l,c,u=t[i];for(o=0,a=e.length;a>o;o++){for(c=e[o],s=0,l=u.length;l>s;s++)if(!u[s](c,o,a)){s=l+1;break}if(s===l)i==t.length-1?r.push(c):c.items&&n(c.items(),t,i+1);else if(u.direct)return;c.items&&n(c.items(),t,i)}}var r=[],i,s,l=this._selectors;if(e.items){for(i=0,s=l.length;s>i;i++)n(e.items(),l[i],0);s>1&&(r=t(r))}return o||(o=a.Collection),new o(r)}});return a}),r(j,[u,q,U],function(e,t,n){var r,i,o=Array.prototype.push,a=Array.prototype.slice;return i={length:0,init:function(e){e&&this.add(e)},add:function(t){var n=this;return e.isArray(t)?o.apply(n,t):t instanceof r?n.add(t.toArray()):o.call(n,t),n},set:function(e){var t=this,n=t.length,r;for(t.length=0,t.add(e),r=t.length;n>r;r++)delete t[r];return t},filter:function(e){var n=this,i,o,a=[],s,l;for("string"==typeof e?(e=new t(e),l=function(t){return e.match(t)}):l=e,i=0,o=n.length;o>i;i++)s=n[i],l(s)&&a.push(s);return new r(a)},slice:function(){return new r(a.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},each:function(t){return e.each(this,t),this},toArray:function(){return e.toArray(this)},indexOf:function(e){for(var t=this,n=t.length;n--&&t[n]!==e;);return n},reverse:function(){return new r(e.toArray(this).reverse())},hasClass:function(e){return this[0]?this[0].hasClass(e):!1},prop:function(e,t){var n=this,r,i;return t!==r?(n.each(function(n){n[e]&&n[e](t)}),n):(i=n[0],i&&i[e]?i[e]():void 0)},exec:function(t){var n=this,r=e.toArray(arguments).slice(1);return n.each(function(e){e[t]&&e[t].apply(e,r)}),n},remove:function(){for(var e=this.length;e--;)this[e].remove();return this}},e.each("fire on off show hide addClass removeClass append prepend before after reflow".split(" "),function(t){i[t]=function(){var n=e.toArray(arguments);return this.each(function(e){t in e&&e[t].apply(e,n)}),this}}),e.each("text name disabled active selected checked visible parent value data".split(" "),function(e){i[e]=function(t){return this.prop(e,t)}}),r=n.extend(i),t.Collection=r,r}),r(Y,[u,y],function(e,t){var n=0;return{id:function(){return"mceu_"+n++},createFragment:function(e){return t.DOM.createFragment(e)},getWindowSize:function(){return t.DOM.getViewPort()},getSize:function(e){var t,n;if(e.getBoundingClientRect){var r=e.getBoundingClientRect();t=Math.max(r.width||r.right-r.left,e.offsetWidth),n=Math.max(r.height||r.bottom-r.bottom,e.offsetHeight)}else t=e.offsetWidth,n=e.offsetHeight;return{width:t,height:n}},getPos:function(e,n){return t.DOM.getPos(e,n)},getViewPort:function(e){return t.DOM.getViewPort(e)},get:function(e){return document.getElementById(e)},addClass:function(e,n){return t.DOM.addClass(e,n)},removeClass:function(e,n){return t.DOM.removeClass(e,n)},hasClass:function(e,n){return t.DOM.hasClass(e,n)},toggleClass:function(e,n,r){return t.DOM.toggleClass(e,n,r)},css:function(e,n,r){return t.DOM.setStyle(e,n,r)},getRuntimeStyle:function(e,n){return t.DOM.getStyle(e,n,!0)},on:function(e,n,r,i){return t.DOM.bind(e,n,r,i)},off:function(e,n,r){return t.DOM.unbind(e,n,r)},fire:function(e,n,r){return t.DOM.fire(e,n,r)},innerHtml:function(e,n){t.DOM.setHTML(e,n)}}}),r(K,[U,u,$,j,Y],function(e,t,n,r,i){function o(e){return e._eventDispatcher||(e._eventDispatcher=new n({scope:e,toggleEvent:function(t,r){r&&n.isNative(t)&&(e._nativeEvents||(e._nativeEvents={}),e._nativeEvents[t]=!0,e._rendered&&e.bindPendingEvents())}})),e._eventDispatcher}var a="onmousewheel"in document,s=!1,l="mce-",c=e.extend({Statics:{classPrefix:l},isRtl:function(){return c.rtl},classPrefix:l,init:function(e){var n=this,r,o;if(n.settings=e=t.extend({},n.Defaults,e),n._id=e.id||i.id(),n._text=n._name="",n._width=n._height=0,n._aria={role:e.role},this._elmCache={},r=e.classes)for(r=r.split(" "),r.map={},o=r.length;o--;)r.map[r[o]]=!0;n._classes=r||[],n.visible(!0),t.each("title text width height name classes visible disabled active value".split(" "),function(t){var r=e[t],i;r!==i?n[t](r):n["_"+t]===i&&(n["_"+t]=!1)}),n.on("click",function(){return n.disabled()?!1:void 0}),e.classes&&t.each(e.classes.split(" "),function(e){n.addClass(e)}),n.settings=e,n._borderBox=n.parseBox(e.border),n._paddingBox=n.parseBox(e.padding),n._marginBox=n.parseBox(e.margin),e.hidden&&n.hide()},Properties:"parent,title,text,width,height,disabled,active,name,value",Methods:"renderHtml",getContainerElm:function(){return document.body},getParentCtrl:function(e){for(var t,n=this.getRoot().controlIdLookup;e&&n&&!(t=n[e.id]);)e=e.parentNode;return t},parseBox:function(e){var t,n=10;if(e)return"number"==typeof e?(e=e||0,{top:e,left:e,bottom:e,right:e}):(e=e.split(" "),t=e.length,1===t?e[1]=e[2]=e[3]=e[0]:2===t?(e[2]=e[0],e[3]=e[1]):3===t&&(e[3]=e[1]),{top:parseInt(e[0],n)||0,right:parseInt(e[1],n)||0,bottom:parseInt(e[2],n)||0,left:parseInt(e[3],n)||0})},borderBox:function(){return this._borderBox},paddingBox:function(){return this._paddingBox},marginBox:function(){return this._marginBox},measureBox:function(e,t){function n(t){var n=document.defaultView;return n?(t=t.replace(/[A-Z]/g,function(e){return"-"+e}),n.getComputedStyle(e,null).getPropertyValue(t)):e.currentStyle[t]}function r(e){var t=parseFloat(n(e),10);return isNaN(t)?0:t}return{top:r(t+"TopWidth"),right:r(t+"RightWidth"),bottom:r(t+"BottomWidth"),left:r(t+"LeftWidth")}},initLayoutRect:function(){var e=this,t=e.settings,n,r,o=e.getEl(),a,s,l,c,u,d,f,p;n=e._borderBox=e._borderBox||e.measureBox(o,"border"),e._paddingBox=e._paddingBox||e.measureBox(o,"padding"),e._marginBox=e._marginBox||e.measureBox(o,"margin"),p=i.getSize(o),d=t.minWidth,f=t.minHeight,l=d||p.width,c=f||p.height,a=t.width,s=t.height,u=t.autoResize,u="undefined"!=typeof u?u:!a&&!s,a=a||l,s=s||c;var h=n.left+n.right,m=n.top+n.bottom,g=t.maxWidth||65535,v=t.maxHeight||65535;return e._layoutRect=r={x:t.x||0,y:t.y||0,w:a,h:s,deltaW:h,deltaH:m,contentW:a-h,contentH:s-m,innerW:a-h,innerH:s-m,startMinWidth:d||0,startMinHeight:f||0,minW:Math.min(l,g),minH:Math.min(c,v),maxW:g,maxH:v,autoResize:u,scrollW:0},e._lastLayoutRect={},r},layoutRect:function(e){var t=this,n=t._layoutRect,r,i,o,a,s,l;return n||(n=t.initLayoutRect()),e?(o=n.deltaW,a=n.deltaH,e.x!==s&&(n.x=e.x),e.y!==s&&(n.y=e.y),e.minW!==s&&(n.minW=e.minW),e.minH!==s&&(n.minH=e.minH),i=e.w,i!==s&&(i=in.maxW?n.maxW:i,n.w=i,n.innerW=i-o),i=e.h,i!==s&&(i=in.maxH?n.maxH:i,n.h=i,n.innerH=i-a),i=e.innerW,i!==s&&(i=in.maxW-o?n.maxW-o:i,n.innerW=i,n.w=i+o),i=e.innerH,i!==s&&(i=in.maxH-a?n.maxH-a:i,n.innerH=i,n.h=i+a),e.contentW!==s&&(n.contentW=e.contentW),e.contentH!==s&&(n.contentH=e.contentH),r=t._lastLayoutRect,(r.x!==n.x||r.y!==n.y||r.w!==n.w||r.h!==n.h)&&(l=c.repaintControls,l&&l.map&&!l.map[t._id]&&(l.push(t),l.map[t._id]=!0),r.x=n.x,r.y=n.y,r.w=n.w,r.h=n.h),t):n},repaint:function(){var e=this,t,n,r,i,o=0,a=0,s,l;l=document.createRange?function(e){return e}:Math.round,t=e.getEl().style,r=e._layoutRect,s=e._lastRepaintRect||{},i=e._borderBox,o=i.left+i.right,a=i.top+i.bottom,r.x!==s.x&&(t.left=l(r.x)+"px",s.x=r.x),r.y!==s.y&&(t.top=l(r.y)+"px",s.y=r.y),r.w!==s.w&&(t.width=l(r.w-o)+"px",s.w=r.w),r.h!==s.h&&(t.height=l(r.h-a)+"px",s.h=r.h),e._hasBody&&r.innerW!==s.innerW&&(n=e.getEl("body").style,n.width=l(r.innerW)+"px",s.innerW=r.innerW),e._hasBody&&r.innerH!==s.innerH&&(n=n||e.getEl("body").style,n.height=l(r.innerH)+"px",s.innerH=r.innerH),e._lastRepaintRect=s,e.fire("repaint",{},!1)},on:function(e,t){function n(e){var t,n;return"string"!=typeof e?e:function(i){return t||r.parentsAndSelf().each(function(r){var i=r.settings.callbacks;return i&&(t=i[e])?(n=r,!1):void 0}),t.call(n,i)}}var r=this;return o(r).on(e,n(t)),r},off:function(e,t){return o(this).off(e,t),this},fire:function(e,t,n){var r=this;if(t=t||{},t.control||(t.control=r),t=o(r).fire(e,t),n!==!1&&r.parent)for(var i=r.parent();i&&!t.isPropagationStopped();)i.fire(e,t,!1),i=i.parent();return t},hasEventListeners:function(e){return o(this).has(e)},parents:function(e){var t=this,n,i=new r;for(n=t.parent();n;n=n.parent())i.add(n);return e&&(i=i.filter(e)),i},parentsAndSelf:function(e){return new r(this).add(this.parents(e))},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},findCommonAncestor:function(e,t){for(var n;e;){for(n=t;n&&e!=n;)n=n.parent();if(e==n)break;e=e.parent()}return e},hasClass:function(e,t){var n=this._classes[t||"control"];return e=this.classPrefix+e,n&&!!n.map[e]},addClass:function(e,t){var n=this,r,i;return e=this.classPrefix+e,r=n._classes[t||"control"],r||(r=[],r.map={},n._classes[t||"control"]=r),r.map[e]||(r.map[e]=e,r.push(e),n._rendered&&(i=n.getEl(t),i&&(i.className=r.join(" ")))),n},removeClass:function(e,t){var n=this,r,i,o;if(e=this.classPrefix+e,r=n._classes[t||"control"],r&&r.map[e])for(delete r.map[e],i=r.length;i--;)r[i]===e&&r.splice(i,1);return n._rendered&&(o=n.getEl(t),o&&(o.className=r.join(" "))),n},toggleClass:function(e,t,n){var r=this;return t?r.addClass(e,n):r.removeClass(e,n),r},classes:function(e){var t=this._classes[e||"control"];return t?t.join(" "):""},innerHtml:function(e){return i.innerHtml(this.getEl(),e),this},getEl:function(e){var t=e?this._id+"-"+e:this._id;return this._elmCache[t]||(this._elmCache[t]=i.get(t)),this._elmCache[t]},visible:function(e){var t=this,n;return"undefined"!=typeof e?(t._visible!==e&&(t._rendered&&(t.getEl().style.display=e?"":"none"),t._visible=e,n=t.parent(),n&&(n._lastRect=null),t.fire(e?"show":"hide")),t):t._visible},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().blur(),this},aria:function(e,t){var n=this,r=n.getEl(n.ariaTarget);return"undefined"==typeof t?n._aria[e]:(n._aria[e]=t,n._rendered&&r.setAttribute("role"==e?e:"aria-"+e,t),n)},encode:function(e,t){return t!==!1&&(e=this.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},translate:function(e){return c.translate?c.translate(e):e},before:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t),!0),t},after:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t)),t},remove:function(){var e=this,t=e.getEl(),n=e.parent(),r,o;if(e.items){var a=e.items().toArray();for(o=a.length;o--;)a[o].remove()}n&&n.items&&(r=[],n.items().each(function(t){t!==e&&r.push(t)}),n.items().set(r),n._lastRect=null),e._eventsRoot&&e._eventsRoot==e&&i.off(t);var s=e.getRoot().controlIdLookup;return s&&delete s[e._id],t&&t.parentNode&&t.parentNode.removeChild(t),e._rendered=!1,e},renderBefore:function(e){var t=this;return e.parentNode.insertBefore(i.createFragment(t.renderHtml()),e),t.postRender(),t},renderTo:function(e){var t=this;return e=e||t.getContainerElm(),e.appendChild(i.createFragment(t.renderHtml())),t.postRender(),t},postRender:function(){var e=this,t=e.settings,n,r,o,a,s;for(a in t)0===a.indexOf("on")&&e.on(a.substr(2),t[a]);if(e._eventsRoot){for(o=e.parent();!s&&o;o=o.parent())s=o._eventsRoot;if(s)for(a in s._nativeEvents)e._nativeEvents[a]=!0}e.bindPendingEvents(),t.style&&(n=e.getEl(),n&&(n.setAttribute("style",t.style),n.style.cssText=t.style)),e._visible||i.css(e.getEl(),"display","none"),e.settings.border&&(r=e.borderBox(),i.css(e.getEl(),{"border-top-width":r.top,"border-right-width":r.right,"border-bottom-width":r.bottom,"border-left-width":r.left}));var l=e.getRoot();l.controlIdLookup||(l.controlIdLookup={}),l.controlIdLookup[e._id]=e;for(var c in e._aria)e.aria(c,e._aria[c]);e.fire("postrender",{},!1)},scrollIntoView:function(e){function t(e,t){var n,r,i=e;for(n=r=0;i&&i!=t&&i.nodeType;)n+=i.offsetLeft||0,r+=i.offsetTop||0,i=i.offsetParent;return{x:n,y:r}}var n=this.getEl(),r=n.parentNode,i,o,a,s,l,c,u=t(n,r);return i=u.x,o=u.y,a=n.offsetWidth,s=n.offsetHeight,l=r.clientWidth,c=r.clientHeight,"end"==e?(i-=l-a,o-=c-s):"center"==e&&(i-=l/2-a/2,o-=c/2-s/2),r.scrollLeft=i,r.scrollTop=o,this},bindPendingEvents:function(){function e(e){var t=o.getParentCtrl(e.target);t&&t.fire(e.type,e)}function t(){var e=d._lastHoverCtrl;e&&(e.fire("mouseleave",{target:e.getEl()}),e.parents().each(function(e){e.fire("mouseleave",{target:e.getEl()})}),d._lastHoverCtrl=null)}function n(e){var t=o.getParentCtrl(e.target),n=d._lastHoverCtrl,r=0,i,a,s;if(t!==n){if(d._lastHoverCtrl=t,a=t.parents().toArray().reverse(),a.push(t),n){for(s=n.parents().toArray().reverse(),s.push(n),r=0;r=r;i--)n=s[i],n.fire("mouseleave",{target:n.getEl()})}for(i=r;il;l++)d=u[l]._eventsRoot;for(d||(d=u[u.length-1]||o),o._eventsRoot=d,c=l,l=0;c>l;l++)u[l]._eventsRoot=d;var h=d._delegates;h||(h=d._delegates={});for(p in f){if(!f)return!1;"wheel"!==p||s?("mouseenter"===p||"mouseleave"===p?d._hasMouseEnter||(i.on(d.getEl(),"mouseleave",t),i.on(d.getEl(),"mouseover",n),d._hasMouseEnter=1):h[p]||(i.on(d.getEl(),p,e),h[p]=!0),f[p]=!1):a?i.on(o.getEl(),"mousewheel",r):i.on(o.getEl(),"DOMMouseScroll",r)}}},getRoot:function(){for(var e=this,t,n=[];e;){if(e.rootControl){t=e.rootControl;break}n.push(e),t=e,e=e.parent()}t||(t=this);for(var r=n.length;r--;)n[r].rootControl=t;return t},reflow:function(){return this.repaint(),this}});return c}),r(G,[],function(){var e={},t;return{add:function(t,n){e[t.toLowerCase()]=n},has:function(t){return!!e[t.toLowerCase()]},create:function(n,r){var i,o,a;if(!t){a=tinymce.ui;for(o in a)e[o.toLowerCase()]=a[o];t=!0}if("string"==typeof n?(r=r||{},r.type=n):(r=n,n=r.type),n=n.toLowerCase(),i=e[n],!i)throw new Error("Could not find control by type: "+n);return i=new i(r),i.type=n,i}}}),r(X,[],function(){return function(e){function t(e){return e=e||b,e&&e.getAttribute("role")}function n(e){for(var n,r=e||b;r=r.parentNode;)if(n=t(r))return n}function r(e){var t=b;return t?t.getAttribute("aria-"+e):void 0}function i(e){var t=e.tagName.toUpperCase();return"INPUT"==t||"TEXTAREA"==t}function o(e){return i(e)&&!e.hidden?!0:/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell)$/.test(t(e))?!0:!1}function a(e){function t(e){if(1==e.nodeType&&"none"!=e.style.display){o(e)&&n.push(e);for(var r=0;re?e=t.length-1:e>=t.length&&(e=0),t[e]&&t[e].focus(),e}function u(e,t){var n=-1,r=s();t=t||a(r.getEl());for(var i=0;i=0&&(n=t.getEl(),n&&n.parentNode.removeChild(n),n=e.getEl(),n&&n.parentNode.removeChild(n)),t.parent(this)},create:function(t){var n=this,i,a=[]; -return o.isArray(t)||(t=[t]),o.each(t,function(t){t&&(t instanceof e||("string"==typeof t&&(t={type:t}),i=o.extend({},n.settings.defaults,t),t.type=i.type=i.type||t.type||n.settings.defaultType||(i.defaults?i.defaults.type:null),t=r.create(i)),a.push(t))}),a},renderNew:function(){var e=this;return e.items().each(function(t,n){var r,i;t.parent(e),t._rendered||(r=e.getEl("body"),i=a.createFragment(t.renderHtml()),r.hasChildNodes()&&n<=r.childNodes.length-1?r.insertBefore(i,r.childNodes[n]):r.appendChild(i),t.postRender())}),e._layout.applyClasses(e),e._lastRect=null,e},append:function(e){return this.add(e).renderNew()},prepend:function(e){var t=this;return t.items().set(t.create(e).concat(t.items().toArray())),t.renderNew()},insert:function(e,t,n){var r=this,i,o,a;return e=r.create(e),i=r.items(),!n&&t=0&&t
'+(e.settings.html||"")+t.renderHtml(e)+"
"},postRender:function(){var e=this,t;return e.items().exec("postRender"),e._super(),e._layout.postRender(e),e._rendered=!0,e.settings.style&&a.css(e.getEl(),e.settings.style),e.settings.border&&(t=e.borderBox(),a.css(e.getEl(),{"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left})),e.parent()||(e.keyboardNav=new i({root:e})),e},initLayoutRect:function(){var e=this,t=e._super();return e._layout.recalc(e),t},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;return n&&n.w==t.w&&n.h==t.h?void 0:(e._layout.recalc(e),t=e.layoutRect(),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0)},reflow:function(){var t;if(this.visible()){for(e.repaintControls=[],e.repaintControls.map={},this.recalc(),t=e.repaintControls.length;t--;)e.repaintControls[t].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),e.repaintControls=[]}return this}})}),r(Q,[Y],function(e){function t(){var e=document,t,n,r,i,o,a,s,l,c=Math.max;return t=e.documentElement,n=e.body,r=c(t.scrollWidth,n.scrollWidth),i=c(t.clientWidth,n.clientWidth),o=c(t.offsetWidth,n.offsetWidth),a=c(t.scrollHeight,n.scrollHeight),s=c(t.clientHeight,n.clientHeight),l=c(t.offsetHeight,n.offsetHeight),{width:o>r?i:r,height:l>a?s:a}}return function(n,r){function i(){return a.getElementById(r.handle||n)}var o,a=document,s,l,c,u,d,f;r=r||{},l=function(n){var l=t(),p,h;n.preventDefault(),s=n.button,p=i(),d=n.screenX,f=n.screenY,h=window.getComputedStyle?window.getComputedStyle(p,null).getPropertyValue("cursor"):p.runtimeStyle.cursor,o=a.createElement("div"),e.css(o,{position:"absolute",top:0,left:0,width:l.width,height:l.height,zIndex:2147483647,opacity:1e-4,cursor:h}),a.body.appendChild(o),e.on(a,"mousemove",u),e.on(a,"mouseup",c),r.start(n)},u=function(e){return e.button!==s?c(e):(e.deltaX=e.screenX-d,e.deltaY=e.screenY-f,e.preventDefault(),void r.drag(e))},c=function(t){e.off(a,"mousemove",u),e.off(a,"mouseup",c),o.parentNode.removeChild(o),r.stop&&r.stop(t)},this.destroy=function(){e.off(i())},e.on(i(),"mousedown",l)}}),r(Z,[Y,Q],function(e,t){return{init:function(){var e=this;e.on("repaint",e.renderScroll)},renderScroll:function(){function n(){function t(t,a,s,l,c,u){var d,f,p,h,m,g,v,y,b;if(f=i.getEl("scroll"+t)){if(y=a.toLowerCase(),b=s.toLowerCase(),i.getEl("absend")&&e.css(i.getEl("absend"),y,i.layoutRect()[l]-1),!c)return void e.css(f,"display","none");e.css(f,"display","block"),d=i.getEl("body"),p=i.getEl("scroll"+t+"t"),h=d["client"+s]-2*o,h-=n&&r?f["client"+u]:0,m=d["scroll"+s],g=h/m,v={},v[y]=d["offset"+a]+o,v[b]=h,e.css(f,v),v={},v[y]=d["scroll"+a]*g,v[b]=h*g,e.css(p,v)}}var n,r,a;a=i.getEl("body"),n=a.scrollWidth>a.clientWidth,r=a.scrollHeight>a.clientHeight,t("h","Left","Width","contentW",n,"Height"),t("v","Top","Height","contentH",r,"Width")}function r(){function n(n,r,a,s,l){var c,u=i._id+"-scroll"+n,d=i.classPrefix;i.getEl().appendChild(e.createFragment('
')),i.draghelper=new t(u+"t",{start:function(){c=i.getEl("body")["scroll"+r],e.addClass(e.get(u),d+"active")},drag:function(e){var t,u,d,f,p=i.layoutRect();u=p.contentW>p.innerW,d=p.contentH>p.innerH,f=i.getEl("body")["client"+a]-2*o,f-=u&&d?i.getEl("scroll"+n)["client"+l]:0,t=f/i.getEl("body")["scroll"+a],i.getEl("body")["scroll"+r]=c+e["delta"+s]/t},stop:function(){e.removeClass(e.get(u),d+"active")}})}i.addClass("scroll"),n("v","Top","Height","Y","Width"),n("h","Left","Width","X","Height")}var i=this,o=2;i.settings.autoScroll&&(i._hasScroll||(i._hasScroll=!0,r(),i.on("wheel",function(e){var t=i.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,n()}),e.on(i.getEl("body"),"scroll",n)),n())}}}),r(et,[J,Z],function(e,t){return e.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[t],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),"undefined"==typeof n?n='
'+t.renderHtml(e)+"
":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'
'+(e._preBodyHtml||"")+n+"
"}})}),r(tt,[Y],function(e){function t(t,n,r){var i,o,a,s,l,c,u,d,f,p;return f=e.getViewPort(),o=e.getPos(n),a=o.x,s=o.y,t._fixed&&"static"==e.getRuntimeStyle(document.body,"position")&&(a-=f.x,s-=f.y),i=t.getEl(),p=e.getSize(i),l=p.width,c=p.height,p=e.getSize(n),u=p.width,d=p.height,r=(r||"").split(""),"b"===r[0]&&(s+=d),"r"===r[1]&&(a+=u),"c"===r[0]&&(s+=Math.round(d/2)),"c"===r[1]&&(a+=Math.round(u/2)),"b"===r[3]&&(s-=c),"r"===r[4]&&(a-=l),"c"===r[3]&&(s-=Math.round(c/2)),"c"===r[4]&&(a-=Math.round(l/2)),{x:a,y:s,w:l,h:c}}return{testMoveRel:function(n,r){for(var i=e.getViewPort(),o=0;o0&&a.x+a.w0&&a.y+a.hi.x&&a.x+a.wi.y&&a.y+a.he?0:e+n>t?(e=t-n,0>e?0:e):e}var i=this;if(i.settings.constrainToViewport){var o=e.getViewPort(window),a=i.layoutRect();t=r(t,o.w+o.x,a.w),n=r(n,o.h+o.y,a.h)}return i._rendered?i.layoutRect({x:t,y:n}).repaint():(i.settings.x=t,i.settings.y=n),i.fire("move",{x:t,y:n}),i}}}),r(nt,[Y],function(e){return{resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(t,n){if(1>=t||1>=n){var r=e.getWindowSize();t=1>=t?t*r.w:t,n=1>=n?n*r.h:n}return this._layoutRect.autoResize=!1,this.layoutRect({minW:t,minH:n,w:t,h:n}).reflow()},resizeBy:function(e,t){var n=this,r=n.layoutRect();return n.resizeTo(r.w+e,r.h+t)}}}),r(rt,[et,tt,nt,Y],function(e,t,n,r){function i(){function e(e,t){for(;e;){if(e==t)return!0;e=e.parent()}}u||(u=function(t){if(2!=t.button)for(var n=p.length;n--;){var r=p[n],i=r.getParentCtrl(t.target);if(r.settings.autohide){if(i&&(e(i,r)||r.parent()===i))continue;t=r.fire("autohide",{target:t.target}),t.isDefaultPrevented()||r.hide()}}},r.on(document,"click",u))}function o(){d||(d=function(){var e;for(e=p.length;e--;)s(p[e])},r.on(window,"scroll",d))}function a(){if(!f){var e=document.documentElement,t=e.clientWidth,n=e.clientHeight;f=function(){document.all&&t==e.clientWidth&&n==e.clientHeight||(t=e.clientWidth,n=e.clientHeight,g.hideAll())},r.on(window,"resize",f)}}function s(e){function t(t,n){for(var r,i=0;in&&(e.fixed(!1).layoutRect({y:e._autoFixY}).repaint(),t(!1,e._autoFixY-n)):(e._autoFixY=e.layoutRect().y,e._autoFixY
'),n=n.firstChild,t.getContainerElm().appendChild(n),setTimeout(function(){r.addClass(n,i+"in"),r.addClass(t.getEl(),i+"in")},0),m=!0),l(!0,t)}}),t.on("show",function(){t.parents().each(function(e){return e._fixed?(t.fixed(!0),!1):void 0})}),e.popover&&(t._preBodyHtml='
',t.addClass("popover").addClass("bottom").addClass(t.isRtl()?"end":"start"))},fixed:function(e){var t=this;if(t._fixed!=e){if(t._rendered){var n=r.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y}t.toggleClass("fixed",e),t._fixed=e}return t},show:function(){var e=this,t,n=e._super();for(t=p.length;t--&&p[t]!==e;);return-1===t&&p.push(e),n},hide:function(){return c(this),l(!1,this),this._super()},hideAll:function(){g.hideAll()},close:function(){var e=this;return e.fire("close").isDefaultPrevented()||(e.remove(),l(!1,e)),e},remove:function(){c(this),this._super()},postRender:function(){var e=this;return e.settings.bodyRole&&this.getEl("body").setAttribute("role",e.settings.bodyRole),e._super()}});return g.hideAll=function(){for(var e=p.length;e--;){var t=p[e];t&&t.settings.autohide&&(t.hide(),p.splice(e,1))}},g}),r(it,[rt,et,Y,Q],function(e,t,n,r){var i=e.extend({modal:!0,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(e){var n=this;n._super(e),n.isRtl()&&n.addClass("rtl"),n.addClass("window"),n._fixed=!0,e.buttons&&(n.statusbar=new t({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:n.isRtl()?"start":"end",defaults:{type:"button"},items:e.buttons}),n.statusbar.addClass("foot"),n.statusbar.parent(n)),n.on("click",function(e){-1!=e.target.className.indexOf(n.classPrefix+"close")&&n.close()}),n.on("cancel",function(){n.close()}),n.aria("describedby",n.describedBy||n._id+"-none"),n.aria("label",e.title),n._fullscreen=!1},recalc:function(){var e=this,t=e.statusbar,r,i,o,a;e._fullscreen&&(e.layoutRect(n.getWindowSize()),e.layoutRect().contentH=e.layoutRect().innerH),e._super(),r=e.layoutRect(),e.settings.title&&!e._fullscreen&&(i=r.headerW,i>r.w&&(o=r.x-Math.max(0,i/2),e.layoutRect({w:i,x:o}),a=!0)),t&&(t.layoutRect({w:e.layoutRect().innerW}).recalc(),i=t.layoutRect().minW+r.deltaW,i>r.w&&(o=r.x-Math.max(0,i-r.w),e.layoutRect({w:i,x:o}),a=!0)),a&&e.recalc()},initLayoutRect:function(){var e=this,t=e._super(),r=0,i;if(e.settings.title&&!e._fullscreen){i=e.getEl("head");var o=n.getSize(i);t.headerW=o.width,t.headerH=o.height,r+=t.headerH}e.statusbar&&(r+=e.statusbar.layoutRect().h),t.deltaH+=r,t.minH+=r,t.h+=r;var a=n.getWindowSize();return t.x=Math.max(0,a.w/2-t.w/2),t.y=Math.max(0,a.h/2-t.h/2),t},renderHtml:function(){var e=this,t=e._layout,n=e._id,r=e.classPrefix,i=e.settings,o="",a="",s=i.html;return e.preRender(),t.preRender(e),i.title&&(o='
'+e.encode(i.title)+'
'),i.url&&(s=''),"undefined"==typeof s&&(s=t.renderHtml(e)),e.statusbar&&(a=e.statusbar.renderHtml()),'
'+o+'
'+s+"
"+a+"
"},fullscreen:function(e){var t=this,r=document.documentElement,i,o=t.classPrefix,a;if(e!=t._fullscreen)if(n.on(window,"resize",function(){var e;if(t._fullscreen)if(i)t._timer||(t._timer=setTimeout(function(){var e=n.getWindowSize();t.moveTo(0,0).resizeTo(e.w,e.h),t._timer=0},50));else{e=(new Date).getTime();var r=n.getWindowSize();t.moveTo(0,0).resizeTo(r.w,r.h),(new Date).getTime()-e>50&&(i=!0)}}),a=t.layoutRect(),t._fullscreen=e,e){t._initial={x:a.x,y:a.y,w:a.w,h:a.h},t._borderBox=t.parseBox("0"),t.getEl("head").style.display="none",a.deltaH-=a.headerH+2,n.addClass(r,o+"fullscreen"),n.addClass(document.body,o+"fullscreen"),t.addClass("fullscreen");var s=n.getWindowSize();t.moveTo(0,0).resizeTo(s.w,s.h)}else t._borderBox=t.parseBox(t.settings.border),t.getEl("head").style.display="",a.deltaH+=a.headerH,n.removeClass(r,o+"fullscreen"),n.removeClass(document.body,o+"fullscreen"),t.removeClass("fullscreen"),t.moveTo(t._initial.x,t._initial.y).resizeTo(t._initial.w,t._initial.h);return t.reflow()},postRender:function(){var e=this,t;setTimeout(function(){e.addClass("in")},0),e._super(),e.statusbar&&e.statusbar.postRender(),e.focus(),this.dragHelper=new r(e._id+"-dragh",{start:function(){t={x:e.layoutRect().x,y:e.layoutRect().y}},drag:function(n){e.moveTo(t.x+n.deltaX,t.y+n.deltaY)}}),e.on("submit",function(t){t.isDefaultPrevented()||e.close()})},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e=this,t=e.classPrefix;e.dragHelper.destroy(),e._super(),e.statusbar&&this.statusbar.remove(),e._fullscreen&&(n.removeClass(document.documentElement,t+"fullscreen"),n.removeClass(document.body,t+"fullscreen"))},getContentWindow:function(){var e=this.getEl().getElementsByTagName("iframe")[0];return e?e.contentWindow:null}});return i}),r(ot,[it],function(e){var t=e.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(n){function r(e,t,n){return{type:"button",text:e,subtype:n?"primary":"",onClick:function(e){e.control.parents()[1].close(),o(t)}}}var i,o=n.callback||function(){};switch(n.buttons){case t.OK_CANCEL:i=[r("Ok",!0,!0),r("Cancel",!1)];break;case t.YES_NO:case t.YES_NO_CANCEL:i=[r("Yes",1,!0),r("No",0)],n.buttons==t.YES_NO_CANCEL&&i.push(r("Cancel",-1));break;default:i=[r("Ok",!0,!0)]}return new e({padding:20,x:n.x,y:n.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:i,title:n.title,role:"alertdialog",items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:n.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:n.onClose,onCancel:function(){o(!1)}}).renderTo(document.body).reflow()},alert:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,t.msgBox(e)},confirm:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,e.buttons=t.OK_CANCEL,t.msgBox(e)}}});return t}),r(at,[it,ot],function(e,t){return function(n){function r(){return o.length?o[o.length-1]:void 0}var i=this,o=[];i.windows=o,n.on("remove",function(){for(var e=o.length;e--;)o[e].close()}),i.open=function(t,r){var i;return n.editorManager.setActive(n),t.title=t.title||" ",t.url=t.url||t.file,t.url&&(t.width=parseInt(t.width||320,10),t.height=parseInt(t.height||240,10)),t.body&&(t.items={defaults:t.defaults,type:t.bodyType||"form",items:t.body}),t.url||t.buttons||(t.buttons=[{text:"Ok",subtype:"primary",onclick:function(){i.find("form")[0].submit()}},{text:"Cancel",onclick:function(){i.close()}}]),i=new e(t),o.push(i),i.on("close",function(){for(var e=o.length;e--;)o[e]===i&&o.splice(e,1);o.length||n.focus()}),t.data&&i.on("postRender",function(){this.find("*").each(function(e){var n=e.name();n in t.data&&e.value(t.data[n])})}),i.features=t||{},i.params=r||{},1===o.length&&n.nodeChanged(),i.renderTo().reflow()},i.alert=function(e,r,i){t.alert(e,function(){r?r.call(i||this):n.focus()})},i.confirm=function(e,n,r){t.confirm(e,function(e){n.call(r||this,e)})},i.close=function(){r()&&r().close()},i.getParams=function(){return r()?r().params:null},i.setParams=function(e){r()&&(r().params=e)},i.getWindows=function(){return o}}}),r(st,[B,x,_,g,d,u],function(e,t,n,r,i,o){return function(a){function s(e,t){try{a.getDoc().execCommand(e,!1,t)}catch(n){}}function l(){var e=a.getDoc().documentMode;return e?e:6}function c(e){return e.isDefaultPrevented()}function u(){function t(e){var t=new i(function(){});o.each(a.getBody().getElementsByTagName("*"),function(e){"SPAN"==e.tagName&&e.setAttribute("mce-data-marked",1),!e.hasAttribute("data-mce-style")&&e.hasAttribute("style")&&a.dom.setAttrib(e,"style",a.dom.getAttrib(e,"style"))}),t.observe(a.getDoc(),{childList:!0,attributes:!0,subtree:!0,attributeFilter:["style"]}),a.getDoc().execCommand(e?"ForwardDelete":"Delete",!1,null);var n=a.selection.getRng(),r=n.startContainer.parentNode;o.each(t.takeRecords(),function(e){if(q.isChildOf(e.target,a.getBody())){if("style"==e.attributeName){var t=e.target.getAttribute("data-mce-style");t?e.target.setAttribute("style",t):e.target.removeAttribute("style")}o.each(e.addedNodes,function(e){if("SPAN"==e.nodeName&&!e.getAttribute("mce-data-marked")){var t,i;e==r&&(t=n.startOffset,i=e.firstChild),q.remove(e,!0),i&&(n.setStart(i,t),n.setEnd(i,t),a.selection.setRng(n))}})}}),t.disconnect(),o.each(a.dom.select("span[mce-data-marked]"),function(e){e.removeAttribute("mce-data-marked")})}var n=a.getDoc(),r="data:text/mce-internal,",i=window.MutationObserver,s,l;i||(s=!0,i=function(){function e(e){var t=e.relatedNode||e.target;n.push({target:t,addedNodes:[t]})}function t(e){var t=e.relatedNode||e.target;n.push({target:t,attributeName:e.attrName})}var n=[],r;this.observe=function(n){r=n,r.addEventListener("DOMSubtreeModified",e,!1),r.addEventListener("DOMNodeInsertedIntoDocument",e,!1),r.addEventListener("DOMNodeInserted",e,!1),r.addEventListener("DOMAttrModified",t,!1)},this.disconnect=function(){r.removeEventListener("DOMSubtreeModified",e,!1),r.removeEventListener("DOMNodeInsertedIntoDocument",e,!1),r.removeEventListener("DOMNodeInserted",e,!1),r.removeEventListener("DOMAttrModified",t,!1)},this.takeRecords=function(){return n}}),a.on("keydown",function(n){var r=n.keyCode==$,i=e.metaKeyPressed(n);if(!c(n)&&(r||n.keyCode==U)){var o=a.selection.getRng(),s=o.startContainer,l=o.startOffset;if(!i&&o.collapsed&&3==s.nodeType&&(r?l0))return;n.preventDefault(),i&&a.selection.getSel().modify("extend",r?"forward":"backward","word"),t(r)}}),a.on("keypress",function(n){c(n)||j.isCollapsed()||!n.charCode||e.metaKeyPressed(n)||(n.preventDefault(),t(!0),a.selection.setContent(String.fromCharCode(n.charCode)))}),a.addCommand("Delete",function(){t()}),a.addCommand("ForwardDelete",function(){t(!0)}),s||(a.on("dragstart",function(e){var t;a.selection.isCollapsed()&&"IMG"==e.target.tagName&&j.select(e.target),l=j.getRng(),t=a.selection.getContent(),t.length>0&&e.dataTransfer.setData("URL","data:text/mce-internal,"+escape(t))}),a.on("drop",function(e){if(!c(e)){var i=e.dataTransfer.getData("URL");if(!i||-1==i.indexOf(r)||!n.caretRangeFromPoint)return;i=unescape(i.substr(r.length)),n.caretRangeFromPoint&&(e.preventDefault(),window.setTimeout(function(){var r=n.caretRangeFromPoint(e.x,e.y);l&&(j.setRng(l),l=null),t(),j.setRng(r),a.insertContent(i)},0))}}),a.on("cut",function(e){!c(e)&&e.clipboardData&&(e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/html",a.selection.getContent()),e.clipboardData.setData("text/plain",a.selection.getContent({format:"text"})),t(!0))}))}function d(){function e(e){var t=q.create("body"),n=e.cloneContents();return t.appendChild(n),j.serializer.serialize(t,{format:"html"})}function n(n){if(!n.setStart){if(n.item)return!1;var r=n.duplicate();return r.moveToElementText(a.getBody()),t.compareRanges(n,r)}var i=e(n),o=q.createRng();o.selectNode(a.getBody());var s=e(o);return i===s}a.on("keydown",function(e){var t=e.keyCode,r,i;if(!c(e)&&(t==$||t==U)){if(r=a.selection.isCollapsed(),i=a.getBody(),r&&!q.isEmpty(i))return;if(!r&&!n(a.selection.getRng()))return;e.preventDefault(),a.setContent(""),i.firstChild&&q.isBlock(i.firstChild)?a.selection.setCursorLocation(i.firstChild,0):a.selection.setCursorLocation(i,0),a.nodeChanged()}})}function f(){a.on("keydown",function(t){!c(t)&&65==t.keyCode&&e.metaKeyPressed(t)&&(t.preventDefault(),a.execCommand("SelectAll"))})}function p(){a.settings.content_editable||(q.bind(a.getDoc(),"focusin",function(){j.setRng(j.getRng())}),q.bind(a.getDoc(),"mousedown mouseup",function(e){e.target==a.getDoc().documentElement&&(a.getBody().focus(),"mousedown"==e.type?j.placeCaretAt(e.clientX,e.clientY):j.setRng(j.getRng()))}))}function h(){a.on("keydown",function(e){if(!c(e)&&e.keyCode===U){if(!a.getBody().getElementsByTagName("hr").length)return;if(j.isCollapsed()&&0===j.getRng(!0).startOffset){var t=j.getNode(),n=t.previousSibling;if("HR"==t.nodeName)return q.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(q.remove(n),e.preventDefault())}}})}function m(){window.Range.prototype.getClientRects||a.on("mousedown",function(e){if(!c(e)&&"HTML"===e.target.nodeName){var t=a.getBody();t.blur(),setTimeout(function(){t.focus()},0)}})}function g(){a.on("click",function(e){var t=e.target;/^(IMG|HR)$/.test(t.nodeName)&&(e.preventDefault(),j.getSel().setBaseAndExtent(t,0,t,1),a.nodeChanged()),"A"==t.nodeName&&q.hasClass(t,"mce-item-anchor")&&(e.preventDefault(),j.select(t))})}function v(){function e(){var e=q.getAttribs(j.getStart().cloneNode(!1));return function(){var t=j.getStart();t!==a.getBody()&&(q.setAttrib(t,"style",null),V(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}}function t(){return!j.isCollapsed()&&q.getParent(j.getStart(),q.isBlock)!=q.getParent(j.getEnd(),q.isBlock)}a.on("keypress",function(n){var r;return c(n)||8!=n.keyCode&&46!=n.keyCode||!t()?void 0:(r=e(),a.getDoc().execCommand("delete",!1,null),r(),n.preventDefault(),!1)}),q.bind(a.getDoc(),"cut",function(n){var r;!c(n)&&t()&&(r=e(),setTimeout(function(){r()},0))})}function y(){document.body.setAttribute("role","application")}function b(){a.on("keydown",function(e){if(!c(e)&&e.keyCode===U&&j.isCollapsed()&&0===j.getRng(!0).startOffset){var t=j.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})}function C(){l()>7||(s("RespectVisibilityInDesign",!0),a.contentStyles.push(".mceHideBrInPre pre br {display: none}"),q.addClass(a.getBody(),"mceHideBrInPre"),K.addNodeFilter("pre",function(e){for(var t=e.length,r,i,o,a;t--;)for(r=e[t].getAll("br"),i=r.length;i--;)o=r[i],a=o.prev,a&&3===a.type&&"\n"!=a.value.charAt(a.value-1)?a.value+="\n":o.parent.insert(new n("#text",3),o,!0).value="\n"}),G.addNodeFilter("pre",function(e){for(var t=e.length,n,r,i,o;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)i=n[r],o=i.prev,o&&3==o.type&&(o.value=o.value.replace(/\r?\n$/,""))}))}function x(){q.bind(a.getBody(),"mouseup",function(){var e,t=j.getNode();"IMG"==t.nodeName&&((e=q.getStyle(t,"width"))&&(q.setAttrib(t,"width",e.replace(/[^0-9%]+/g,"")),q.setStyle(t,"width","")),(e=q.getStyle(t,"height"))&&(q.setAttrib(t,"height",e.replace(/[^0-9%]+/g,"")),q.setStyle(t,"height","")))})}function w(){a.on("keydown",function(t){var n,r,i,o,s;if(!c(t)&&t.keyCode==e.BACKSPACE&&(n=j.getRng(),r=n.startContainer,i=n.startOffset,o=q.getRoot(),s=r,n.collapsed&&0===i)){for(;s&&s.parentNode&&s.parentNode.firstChild==s&&s.parentNode!=o;)s=s.parentNode;"BLOCKQUOTE"===s.tagName&&(a.formatter.toggle("blockquote",null,s),n=q.createRng(),n.setStart(r,0),n.setEnd(r,0),j.setRng(n))}})}function _(){function e(){a._refreshContentEditable(),s("StyleWithCSS",!1),s("enableInlineTableEditing",!1),Y.object_resizing||s("enableObjectResizing",!1)}Y.readonly||a.on("BeforeExecCommand MouseDown",e)}function E(){function e(){V(q.select("a"),function(e){var t=e.parentNode,n=q.getRoot();if(t.lastChild===e){for(;t&&!q.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}q.add(t,"br",{"data-mce-bogus":1})}})}a.on("SetContent ExecCommand",function(t){("setcontent"==t.type||"mceInsertLink"===t.command)&&e()})}function N(){Y.forced_root_block&&a.on("init",function(){s("DefaultParagraphSeparator",Y.forced_root_block)})}function k(){a.on("Undo Redo SetContent",function(e){e.initial||a.execCommand("mceRepaint")})}function S(){a.on("keydown",function(e){var t;c(e)||e.keyCode!=U||(t=a.getDoc().selection.createRange(),t&&t.item&&(e.preventDefault(),a.undoManager.beforeChange(),q.remove(t.item(0)),a.undoManager.add()))})}function T(){var e;l()>=10&&(e="",V("p div h1 h2 h3 h4 h5 h6".split(" "),function(t,n){e+=(n>0?",":"")+t+":empty"}),a.contentStyles.push(e+"{padding-right: 1px !important}"))}function R(){l()<9&&(K.addNodeFilter("noscript",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.firstChild,r&&n.attr("data-mce-innertext",r.value)}),G.addNodeFilter("noscript",function(e){for(var t=e.length,i,o,a;t--;)i=e[t],o=e[t].firstChild,o?o.value=r.decode(o.value):(a=i.attributes.map["data-mce-innertext"],a&&(i.attr("data-mce-innertext",null),o=new n("#text",3),o.value=a,o.raw=!0,i.append(o)))}))}function A(){function e(e,t){var n=i.createTextRange();try{n.moveToPoint(e,t)}catch(r){n=null}return n}function t(t){var r;t.button?(r=e(t.x,t.y),r&&(r.compareEndPoints("StartToStart",a)>0?r.setEndPoint("StartToStart",a):r.setEndPoint("EndToEnd",a),r.select())):n()}function n(){var e=r.selection.createRange();a&&!e.item&&0===e.compareEndPoints("StartToEnd",e)&&a.select(),q.unbind(r,"mouseup",n),q.unbind(r,"mousemove",t),a=o=0}var r=q.doc,i=r.body,o,a,s;r.documentElement.unselectable=!0,q.bind(r,"mousedown contextmenu",function(i){if("HTML"===i.target.nodeName){if(o&&n(),s=r.documentElement,s.scrollHeight>s.clientHeight)return;o=1,a=e(i.x,i.y),a&&(q.bind(r,"mouseup",n),q.bind(r,"mousemove",t),q.getRoot().focus(),a.select())}})}function B(){a.on("keyup focusin mouseup",function(t){65==t.keyCode&&e.metaKeyPressed(t)||j.normalize()},!0)}function D(){a.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function L(){a.inline||a.on("keydown",function(){document.activeElement==document.body&&a.getWin().focus()})}function H(){a.inline||(a.contentStyles.push("body {min-height: 150px}"),a.on("click",function(e){"HTML"==e.target.nodeName&&(a.getBody().focus(),a.selection.normalize(),a.nodeChanged())}))}function M(){i.mac&&a.on("keydown",function(t){!e.metaKeyPressed(t)||37!=t.keyCode&&39!=t.keyCode||(t.preventDefault(),a.selection.getSel().modify("move",37==t.keyCode?"backward":"forward","word"))})}function P(){s("AutoUrlDetect",!1)}function O(){a.inline||a.on("focus blur beforegetcontent",function(){var e=a.dom.create("br");a.getBody().appendChild(e),e.parentNode.removeChild(e)},!0)}function I(){a.on("click",function(e){var t=e.target;do if("A"===t.tagName)return void e.preventDefault();while(t=t.parentNode)}),a.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")}function F(){a.on("touchstart",function(e){var t,n,r,i;t=e.target,n=(new Date).getTime(),i=e.changedTouches,!i||i.length>1||(r=i[0],a.once("touchend",function(e){var i=e.changedTouches[0],o;(new Date).getTime()-n>500||Math.abs(r.clientX-i.clientX)>5||Math.abs(r.clientY-i.clientY)>5||(o={target:t},V("pageX pageY clientX clientY screenX screenY".split(" "),function(e){o[e]=i[e]}),o=a.fire("click",o),o.isDefaultPrevented()||(a.selection.placeCaretAt(i.clientX,i.clientY),a.nodeChanged()))}))})}function z(){a.on("init",function(){a.dom.bind(a.getBody(),"submit",function(e){e.preventDefault()})})}function W(){K.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"==e[t].attr("class")&&e[t].remove()})}var V=o.each,U=e.BACKSPACE,$=e.DELETE,q=a.dom,j=a.selection,Y=a.settings,K=a.parser,G=a.serializer,X=i.gecko,J=i.ie,Q=i.webkit;w(),d(),B(),Q&&(u(),p(),g(),N(),z(),b(),W(),F(),i.iOS?(L(),H(),I()):f()),J&&i.ie<11&&(h(),y(),C(),x(),S(),T(),R(),A()),i.ie>=11&&(H(),O(),b()),i.ie&&(f(),P()),X&&(h(),m(),v(),_(),E(),k(),D(),M(),b())}}),r(lt,[$],function(e){function t(t){return t._eventDispatcher||(t._eventDispatcher=new e({scope:t,toggleEvent:function(n,r){e.isNative(n)&&t.toggleNativeEvent&&t.toggleNativeEvent(n,r)}})),t._eventDispatcher}return{fire:function(e,n,r){var i=this;if(i.removed&&"remove"!==e)return n;if(n=t(i).fire(e,n,r),r!==!1&&i.parent)for(var o=i.parent();o&&!n.isPropagationStopped();)o.fire(e,n,!1),o=o.parent();return n},on:function(e,n,r){return t(this).on(e,n,r)},off:function(e,n){return t(this).off(e,n)},once:function(e,n){return t(this).once(e,n)},hasEventListeners:function(e){return t(this).has(e)}}}),r(ct,[lt,y,u],function(e,t,n){function r(e,t){return"selectionchange"==t?e.getDoc():!e.inline&&/^mouse|click|contextmenu|drop|dragover|dragend/.test(t)?e.getDoc().documentElement:e.settings.event_root?(e.eventRoot||(e.eventRoot=o.select(e.settings.event_root)[0]),e.eventRoot):e.getBody()}function i(e,t){var n=r(e,t),i;if(e.delegates||(e.delegates={}),!e.delegates[t])if(e.settings.event_root){if(a||(a={},e.editorManager.on("removeEditor",function(){var t;if(!e.editorManager.activeEditor&&a){for(t in a)e.dom.unbind(r(e,t));a=null}})),a[t])return;i=function(n){for(var r=n.target,i=e.editorManager.editors,a=i.length;a--;){var s=i[a].getBody();(s===r||o.isChildOf(r,s))&&(i[a].hidden||i[a].fire(t,n))}},a[t]=i,o.bind(n,t,i)}else i=function(n){e.hidden||e.fire(t,n)},o.bind(n,t,i),e.delegates[t]=i}var o=t.DOM,a,s={bindPendingEventDelegates:function(){var e=this;n.each(e._pendingNativeEvents,function(t){i(e,t)})},toggleNativeEvent:function(e,t){var n=this;n.settings.readonly||"focus"!=e&&"blur"!=e&&(t?n.initialized?i(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(r(n,e),e,n.delegates[e]),delete n.delegates[e]))},unbindAllNativeEvents:function(){var e=this,t;if(e.delegates){for(t in e.delegates)e.dom.unbind(r(e,t),t,e.delegates[t]);delete e.delegates}e.inline||(e.getBody().onload=null,e.dom.unbind(e.getWin()),e.dom.unbind(e.getDoc())),e.dom.unbind(e.getBody()),e.dom.unbind(e.getContainer())}};return s=n.extend({},e,s)}),r(ut,[u,d],function(e,t){var n=e.each,r=e.explode,i={f9:120,f10:121,f11:122};return function(o){var a=this,s={};o.on("keyup keypress keydown",function(e){(e.altKey||e.ctrlKey||e.metaKey)&&n(s,function(n){var r=t.mac?e.metaKey:e.ctrlKey;if(n.ctrl==r&&n.alt==e.altKey&&n.shift==e.shiftKey)return e.keyCode==n.keyCode||e.charCode&&e.charCode==n.charCode?(e.preventDefault(),"keydown"==e.type&&n.func.call(n.scope),!0):void 0})}),a.add=function(t,a,l,c){var u;return u=l,"string"==typeof l?l=function(){o.execCommand(u,!1,null)}:e.isArray(u)&&(l=function(){o.execCommand(u[0],u[1],u[2])}),n(r(t.toLowerCase()),function(e){var t={func:l,scope:c||o,desc:o.translate(a),alt:!1,ctrl:!1,shift:!1};n(r(e,"+"),function(e){switch(e){case"alt":case"ctrl":case"shift":t[e]=!0;break;default:/^[0-9]{2,}$/.test(e)?t.keyCode=parseInt(e,10):(t.charCode=e.charCodeAt(0),t.keyCode=i[e]||e.toUpperCase().charCodeAt(0)) -}}),s[(t.ctrl?"ctrl":"")+","+(t.alt?"alt":"")+","+(t.shift?"shift":"")+","+t.keyCode]=t}),!0}}}),r(dt,[y,f,C,w,_,R,T,H,O,I,F,z,W,V,b,l,at,E,k,st,d,u,ct,ut],function(e,n,r,i,o,a,s,l,c,u,d,f,p,h,m,g,v,y,b,C,x,w,_,E){function N(e,t,i){var o=this,a,s;a=o.documentBaseUrl=i.documentBaseURL,s=i.baseURI,o.settings=t=R({id:e,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:a,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,padd_empty_editor:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",validate:!0,entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o,ie7_compat:!0},t),r.language=t.language||"en",r.languageLoad=t.language_load,r.baseURL=i.baseURL,o.id=t.id=e,o.isNotDirty=!0,o.plugins={},o.documentBaseURI=new h(t.document_base_url||a,{base_uri:s}),o.baseURI=s,o.contentCSS=[],o.contentStyles=[],o.shortcuts=new E(o),o.execCommands={},o.queryStateCommands={},o.queryValueCommands={},o.loadedCSS={},t.target&&(o.targetElm=t.target),o.suffix=i.suffix,o.editorManager=i,o.inline=t.inline,i.fire("SetupEditor",o),o.execCallback("setup",o),o.$=n.overrideDefaults(function(){return{context:o.inline?o.getBody():o.getDoc(),element:o.getBody()}})}var k=e.DOM,S=r.ThemeManager,T=r.PluginManager,R=w.extend,A=w.each,B=w.explode,D=w.inArray,L=w.trim,H=w.resolve,M=g.Event,P=x.gecko,O=x.ie;return N.prototype={render:function(){function e(){k.unbind(window,"ready",e),n.render()}function t(){var e=m.ScriptLoader;if(r.language&&"en"!=r.language&&!r.language_url&&(r.language_url=n.editorManager.baseURL+"/langs/"+r.language+".js"),r.language_url&&e.add(r.language_url),r.theme&&"function"!=typeof r.theme&&"-"!=r.theme.charAt(0)&&!S.urls[r.theme]){var t=r.theme_url;t=t?n.documentBaseURI.toAbsolute(t):"themes/"+r.theme+"/theme"+o+".js",S.load(r.theme,t)}w.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),A(r.external_plugins,function(e,t){T.load(t,e),r.plugins+=" "+t}),A(r.plugins.split(/[ ,]/),function(e){if(e=L(e),e&&!T.urls[e])if("-"==e.charAt(0)){e=e.substr(1,e.length);var t=T.dependencies(e);A(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=T.createUrl(t,e),T.load(e.resource,e)})}else T.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),e.loadQueue(function(){n.removed||n.init()})}var n=this,r=n.settings,i=n.id,o=n.suffix;if(!M.domLoaded)return void k.bind(window,"ready",e);if(n.getElement()&&x.contentEditable){r.inline?n.inline=!0:(n.orgVisibility=n.getElement().style.visibility,n.getElement().style.visibility="hidden");var a=n.getElement().form||k.getParent(i,"form");a&&(n.formElement=a,r.hidden_input&&!/TEXTAREA|INPUT/i.test(n.getElement().nodeName)&&(k.insertAfter(k.create("input",{type:"hidden",name:i}),i),n.hasHiddenInput=!0),n.formEventDelegate=function(e){n.fire(e.type,e)},k.bind(a,"submit reset",n.formEventDelegate),n.on("reset",function(){n.setContent(n.startContent,{format:"raw"})}),!r.submit_patch||a.submit.nodeType||a.submit.length||a._mceOldSubmit||(a._mceOldSubmit=a.submit,a.submit=function(){return n.editorManager.triggerSave(),n.isNotDirty=!0,a._mceOldSubmit(a)})),n.windowManager=new v(n),"xml"==r.encoding&&n.on("GetContent",function(e){e.save&&(e.content=k.encode(e.content))}),r.add_form_submit_trigger&&n.on("submit",function(){n.initialized&&n.save()}),r.add_unload_trigger&&(n._beforeUnload=function(){!n.initialized||n.destroyed||n.isHidden()||n.save({format:"raw",no_events:!0,set_dirty:!1})},n.editorManager.on("BeforeUnload",n._beforeUnload)),t()}},init:function(){function e(n){var r=T.get(n),i,o;i=T.urls[n]||t.documentBaseUrl.replace(/\/$/,""),n=L(n),r&&-1===D(m,n)&&(A(T.dependencies(n),function(t){e(t)}),o=new r(t,i,t.$),t.plugins[n]=o,o.init&&(o.init(t,i),m.push(n)))}var t=this,n=t.settings,r=t.getElement(),i,o,a,s,l,c,u,d,f,p,h,m=[];if(t.rtl=this.editorManager.i18n.rtl,t.editorManager.add(t),n.aria_label=n.aria_label||k.getAttrib(r,"aria-label",t.getLang("aria.rich_text_area")),n.theme&&("function"!=typeof n.theme?(n.theme=n.theme.replace(/-/,""),c=S.get(n.theme),t.theme=new c(t,S.urls[n.theme]),t.theme.init&&t.theme.init(t,S.urls[n.theme]||t.documentBaseUrl.replace(/\/$/,""),t.$)):t.theme=n.theme),A(n.plugins.replace(/\-/g,"").split(/[ ,]/),e),n.render_ui&&t.theme&&(t.orgDisplay=r.style.display,"function"!=typeof n.theme?(i=n.width||r.style.width||r.offsetWidth,o=n.height||r.style.height||r.offsetHeight,a=n.min_height||100,p=/^[0-9\.]+(|px)$/i,p.test(""+i)&&(i=Math.max(parseInt(i,10),100)),p.test(""+o)&&(o=Math.max(parseInt(o,10),a)),l=t.theme.renderUI({targetNode:r,width:i,height:o,deltaWidth:n.delta_width,deltaHeight:n.delta_height}),n.content_editable||(o=(l.iframeHeight||o)+("number"==typeof o?l.deltaHeight||0:""),a>o&&(o=a))):(l=n.theme(t,r),l.editorContainer.nodeType&&(l.editorContainer=l.editorContainer.id=l.editorContainer.id||t.id+"_parent"),l.iframeContainer.nodeType&&(l.iframeContainer=l.iframeContainer.id=l.iframeContainer.id||t.id+"_iframecontainer"),o=l.iframeHeight||r.offsetHeight),t.editorContainer=l.editorContainer),n.content_css&&A(B(n.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),n.content_style&&t.contentStyles.push(n.content_style),n.content_editable)return r=s=l=null,t.initContentBody();for(t.iframeHTML=n.doctype+"",n.document_base_url!=t.documentBaseUrl&&(t.iframeHTML+=''),!x.caretAfter&&n.ie7_compat&&(t.iframeHTML+=''),t.iframeHTML+='',h=0;h',t.loadedCSS[g]=!0}d=n.body_id||"tinymce",-1!=d.indexOf("=")&&(d=t.getParam("body_id","","hash"),d=d[t.id]||d),f=n.body_class||"",-1!=f.indexOf("=")&&(f=t.getParam("body_class","","hash"),f=f[t.id]||""),n.content_security_policy&&(t.iframeHTML+=''),t.iframeHTML+='
';var v='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody(true);})()';document.domain!=location.hostname&&(u=v);var y=k.create("iframe",{id:t.id+"_ifr",frameBorder:"0",allowTransparency:"true",title:t.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),style:{width:"100%",height:o,display:"block"}});if(y.onload=function(){y.onload=null,t.fire("load")},k.setAttrib(y,"src",u||'javascript:""'),t.contentAreaContainer=l.iframeContainer,t.iframeElement=y,s=k.add(l.iframeContainer,y),O)try{t.getDoc()}catch(b){s.src=u=v}l.editorContainer&&(k.get(l.editorContainer).style.display=t.orgDisplay,t.hidden=k.isHidden(l.editorContainer)),t.getElement().style.display="none",k.setAttrib(t.id,"aria-hidden",!0),u||t.initContentBody(),r=s=l=null},initContentBody:function(t){var n=this,r=n.settings,s=n.getElement(),h=n.getDoc(),m,g;r.inline||(n.getElement().style.visibility=n.orgVisibility),t||r.content_editable||(h.open(),h.write(n.iframeHTML),h.close()),r.content_editable&&(n.on("remove",function(){var e=this.getBody();k.removeClass(e,"mce-content-body"),k.removeClass(e,"mce-edit-focus"),k.setAttrib(e,"contentEditable",null)}),k.addClass(s,"mce-content-body"),n.contentDocument=h=r.content_document||document,n.contentWindow=r.content_window||window,n.bodyElement=s,r.content_document=r.content_window=null,r.root_name=s.nodeName.toLowerCase()),m=n.getBody(),m.disabled=!0,r.readonly||(n.inline&&"static"==k.getStyle(m,"position",!0)&&(m.style.position="relative"),m.contentEditable=n.getParam("content_editable_state",!0)),m.disabled=!1,n.schema=new y(r),n.dom=new e(h,{keep_values:!0,url_converter:n.convertURL,url_converter_scope:n,hex_colors:r.force_hex_style_colors,class_filter:r.class_filter,update_styles:!0,root_element:n.inline?n.getBody():null,collect:r.content_editable,schema:n.schema,onSetAttrib:function(e){n.fire("SetAttrib",e)}}),n.parser=new b(r,n.schema),n.parser.addAttributeFilter("src,href,style,tabindex",function(e,t){for(var r=e.length,i,o=n.dom,a,s;r--;)i=e[r],a=i.attr(t),s="data-mce-"+t,i.attributes.map[s]||("style"===t?(a=o.serializeStyle(o.parseStyle(a),i.name),a.length||(a=null),i.attr(s,a),i.attr(t,a)):"tabindex"===t?(i.attr(s,a),i.attr(t,null)):i.attr(s,n.convertURL(a,t,i.name)))}),n.parser.addNodeFilter("script",function(e){for(var t=e.length,n;t--;)n=e[t],n.attr("type","mce-"+(n.attr("type")||"no/type"))}),n.parser.addNodeFilter("#cdata",function(e){for(var t=e.length,n;t--;)n=e[t],n.type=8,n.name="#comment",n.value="[CDATA["+n.value+"]]"}),n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t=e.length,r,i=n.schema.getNonEmptyElements();t--;)r=e[t],r.isEmpty(i)&&(r.append(new o("br",1)).shortEnded=!0)}),n.serializer=new a(r,n),n.selection=new l(n.dom,n.getWin(),n.serializer,n),n.formatter=new c(n),n.undoManager=new u(n),n.forceBlocks=new f(n),n.enterKey=new d(n),n.editorCommands=new p(n),n._nodeChangeDispatcher=new i(n),n.fire("PreInit"),r.browser_spellcheck||r.gecko_spellcheck||(h.body.spellcheck=!1,k.setAttrib(m,"spellcheck","false")),n.fire("PostRender"),n.quirks=new C(n),r.directionality&&(m.dir=r.directionality),r.nowrap&&(m.style.whiteSpace="nowrap"),r.protect&&n.on("BeforeSetContent",function(e){A(r.protect,function(t){e.content=e.content.replace(t,function(e){return""})})}),n.on("SetContent",function(){n.addVisual(n.getBody())}),r.padd_empty_editor&&n.on("PostProcess",function(e){e.content=e.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
[\r\n]*)$/,"")}),n.load({initial:!0,format:"html"}),n.startContent=n.getContent({format:"raw"}),n.initialized=!0,n.bindPendingEventDelegates(),n.fire("init"),n.focus(!0),n.nodeChanged({initial:!0}),n.execCallback("init_instance_callback",n),n.contentStyles.length>0&&(g="",A(n.contentStyles,function(e){g+=e+"\r\n"}),n.dom.addStyle(g)),A(n.contentCSS,function(e){n.loadedCSS[e]||(n.dom.loadCSS(e),n.loadedCSS[e]=!0)}),r.auto_focus&&setTimeout(function(){var e;e=r.auto_focus===!0?n:n.editorManager.get(r.auto_focus),e.focus()},100),s=h=m=null},focus:function(e){var t=this,n=t.selection,r=t.settings.content_editable,i,o,a=t.getDoc(),s;if(!e){if(i=n.getRng(),i.item&&(o=i.item(0)),t._refreshContentEditable(),r||(x.opera||t.getBody().focus(),t.getWin().focus()),P||r){if(s=t.getBody(),s.setActive)try{s.setActive()}catch(l){s.focus()}else s.focus();r&&n.normalize()}o&&o.ownerDocument==a&&(i=a.body.createControlRange(),i.addElement(o),i.select())}t.editorManager.setActive(t)},execCallback:function(e){var t=this,n=t.settings[e],r;if(n)return t.callbackLookup&&(r=t.callbackLookup[e])&&(n=r.func,r=r.scope),"string"==typeof n&&(r=n.replace(/\.\w+$/,""),r=r?H(r):0,n=H(n),t.callbackLookup=t.callbackLookup||{},t.callbackLookup[e]={func:n,scope:r}),n.apply(r||t,Array.prototype.slice.call(arguments,1))},translate:function(e){var t=this.settings.language||"en",n=this.editorManager.i18n;return e?n.data[t+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,r){return n.data[t+"."+r]||"{#"+r+"}"}):""},getLang:function(e,n){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(n!==t?n:"{#"+e+"}")},getParam:function(e,t,n){var r=e in this.settings?this.settings[e]:t,i;return"hash"===n?(i={},"string"==typeof r?A(r.split(r.indexOf("=")>0?/[;,](?![^=;,]*(?:[;,]|$))/:","),function(e){e=e.split("="),i[L(e[0])]=L(e.length>1?e[1]:e)}):i=r,i):r},nodeChanged:function(e){this._nodeChangeDispatcher.nodeChanged(e)},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.text||t.icon||(t.icon=e),n.buttons=n.buttons||{},t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems||{},n.menuItems[e]=t},addCommand:function(e,t,n){this.execCommands[e]={func:t,scope:n||this}},addQueryStateHandler:function(e,t,n){this.queryStateCommands[e]={func:t,scope:n||this}},addQueryValueHandler:function(e,t,n){this.queryValueCommands[e]={func:t,scope:n||this}},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){var i=this,o=0,a;if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)||r&&r.skip_focus||i.focus(),r=R({},r),r=i.fire("BeforeExecCommand",{command:e,ui:t,value:n}),r.isDefaultPrevented())return!1;if((a=i.execCommands[e])&&a.func.call(a.scope,t,n)!==!0)return i.fire("ExecCommand",{command:e,ui:t,value:n}),!0;if(A(i.plugins,function(r){return r.execCommand&&r.execCommand(e,t,n)?(i.fire("ExecCommand",{command:e,ui:t,value:n}),o=!0,!1):void 0}),o)return o;if(i.theme&&i.theme.execCommand&&i.theme.execCommand(e,t,n))return i.fire("ExecCommand",{command:e,ui:t,value:n}),!0;if(i.editorCommands.execCommand(e,t,n))return i.fire("ExecCommand",{command:e,ui:t,value:n}),!0;try{o=i.getDoc().execCommand(e,t,n)}catch(s){}return o?(i.fire("ExecCommand",{command:e,ui:t,value:n}),!0):!1},queryCommandState:function(e){var t=this,n,r;if(!t._isHidden()){if((n=t.queryStateCommands[e])&&(r=n.func.call(n.scope),r===!0||r===!1))return r;if(r=t.editorCommands.queryCommandState(e),-1!==r)return r;try{return t.getDoc().queryCommandState(e)}catch(i){}}},queryCommandValue:function(e){var n=this,r,i;if(!n._isHidden()){if((r=n.queryValueCommands[e])&&(i=r.func.call(r.scope),i!==!0))return i;if(i=n.editorCommands.queryCommandValue(e),i!==t)return i;try{return n.getDoc().queryCommandValue(e)}catch(o){}}},show:function(){var e=this;e.hidden&&(e.hidden=!1,e.inline?e.getBody().contentEditable=!0:(k.show(e.getContainer()),k.hide(e.id)),e.load(),e.fire("show"))},hide:function(){var e=this,t=e.getDoc();e.hidden||(O&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable=!1,e==e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(k.hide(e.getContainer()),k.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},isHidden:function(){return!!this.hidden},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var n=this,r=n.getElement(),i;return r?(e=e||{},e.load=!0,i=n.setContent(r.value!==t?r.value:r.innerHTML,e),e.element=r,e.no_events||n.fire("LoadContent",e),e.element=r=null,i):void 0},save:function(e){var t=this,n=t.getElement(),r,i;if(n&&t.initialized)return e=e||{},e.save=!0,e.element=n,r=e.content=t.getContent(e),e.no_events||t.fire("SaveContent",e),r=e.content,/TEXTAREA|INPUT/i.test(n.nodeName)?n.value=r:(t.inline||(n.innerHTML=r),(i=k.getParent(t.id,"form"))&&A(i.elements,function(e){return e.name==t.id?(e.value=r,!1):void 0})),e.element=n=null,e.set_dirty!==!1&&(t.isNotDirty=!0),r},setContent:function(e,t){var n=this,r=n.getBody(),i;return t=t||{},t.format=t.format||"html",t.set=!0,t.content=e,t.no_events||n.fire("BeforeSetContent",t),e=t.content,0===e.length||/^\s+$/.test(e)?(i=n.settings.forced_root_block,i&&n.schema.isValidChild(r.nodeName.toLowerCase(),i.toLowerCase())?(e=O&&11>O?"":'
',e=n.dom.createHTML(i,n.settings.forced_root_block_attrs,e)):O||(e='
'),n.dom.setHTML(r,e),n.fire("SetContent",t)):("raw"!==t.format&&(e=new s({},n.schema).serialize(n.parser.parse(e,{isRootContent:!0}))),t.content=L(e),n.dom.setHTML(r,t.content),t.no_events||n.fire("SetContent",t)),t.content},getContent:function(e){var t=this,n,r=t.getBody();return e=e||{},e.format=e.format||"html",e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),n="raw"==e.format?r.innerHTML:"text"==e.format?r.innerText||r.textContent:t.serializer.serialize(r,e),e.content="text"!=e.format?L(n):n,e.no_events||t.fire("GetContent",e),e.content},insertContent:function(e,t){t&&(e=R({content:e},t)),this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},getContainer:function(){var e=this;return e.container||(e.container=k.get(e.editorContainer||e.id+"_parent")),e.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=k.get(this.id)),this.targetElm},getWin:function(){var e=this,t;return e.contentWindow||(t=e.iframeElement,t&&(e.contentWindow=t.contentWindow)),e.contentWindow},getDoc:function(){var e=this,t;return e.contentDocument||(t=e.getWin(),t&&(e.contentDocument=t.document)),e.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(e,t,n){var r=this,i=r.settings;return i.urlconverter_callback?r.execCallback("urlconverter_callback",e,n,!0,t):!i.convert_urls||n&&"LINK"==n.nodeName||0===e.indexOf("file:")||0===e.length?e:i.relative_urls?r.documentBaseURI.toRelative(e):e=r.documentBaseURI.toAbsolute(e,i.remove_script_host)},addVisual:function(e){var n=this,r=n.settings,i=n.dom,o;e=e||n.getBody(),n.hasVisual===t&&(n.hasVisual=r.visual),A(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return o=r.visual_table_class||"mce-item-table",t=i.getAttrib(e,"border"),void(t&&"0"!=t||!n.hasVisual?i.removeClass(e,o):i.addClass(e,o));case"A":return void(i.getAttrib(e,"href",!1)||(t=i.getAttrib(e,"name")||e.id,o=r.visual_anchor_class||"mce-item-anchor",t&&n.hasVisual?i.addClass(e,o):i.removeClass(e,o)))}}),n.fire("VisualAid",{element:e,hasVisual:n.hasVisual})},remove:function(){var e=this;e.removed||(e.save(),e.removed=1,e.unbindAllNativeEvents(),e.hasHiddenInput&&k.remove(e.getElement().nextSibling),e.inline||(O&&10>O&&e.getDoc().execCommand("SelectAll",!1,null),k.setStyle(e.id,"display",e.orgDisplay),e.getBody().onload=null),e.fire("remove"),e.editorManager.remove(e),k.remove(e.getContainer()),e.destroy())},destroy:function(e){var t=this,n;if(!t.destroyed){if(!e&&!t.removed)return void t.remove();e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),t.selection.destroy(),t.dom.destroy()),n=t.formElement,n&&(n._mceOldSubmit&&(n.submit=n._mceOldSubmit,n._mceOldSubmit=null),k.unbind(n,"submit reset",t.formEventDelegate)),t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null),t.destroyed=1}},_refreshContentEditable:function(){var e=this,t,n;e._isHidden()&&(t=e.getBody(),n=t.parentNode,n.removeChild(t),n.appendChild(t),t.focus())},_isHidden:function(){var e;return P?(e=this.selection.getSel(),!e||!e.rangeCount||0===e.rangeCount):0}},R(N.prototype,_),N}),r(ft,[],function(){var e={};return{rtl:!1,add:function(t,n){for(var r in n)e[r]=n[r];this.rtl=this.rtl||"rtl"===e._dir},translate:function(t){if("undefined"==typeof t)return t;if("string"!=typeof t&&t.raw)return t.raw;if(t.push){var n=t.slice(1);t=(e[t[0]]||t[0]).replace(/\{([^\}]+)\}/g,function(e,t){return n[t]})}return e[t]||t},data:e}}),r(pt,[y,d],function(e,t){function n(e){function s(){try{return document.activeElement}catch(e){return document.body}}function l(e,t){if(t&&t.startContainer){if(!e.isChildOf(t.startContainer,e.getRoot())||!e.isChildOf(t.endContainer,e.getRoot()))return;return{startContainer:t.startContainer,startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset}}return t}function c(e,t){var n;return t.startContainer?(n=e.getDoc().createRange(),n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset)):n=t,n}function u(e){return!!a.getParent(e,n.isEditorUIElement)}function d(n){var d=n.editor;d.on("init",function(){(d.inline||t.ie)&&("onbeforedeactivate"in document&&t.ie<9?d.dom.bind(d.getBody(),"beforedeactivate",function(e){if(e.target==d.getBody())try{d.lastRng=d.selection.getRng()}catch(t){}}):d.on("nodechange mouseup keyup",function(e){var t=s();"nodechange"==e.type&&e.selectionChange||(t&&t.id==d.id+"_ifr"&&(t=d.getBody()),d.dom.isChildOf(t,d.getBody())&&(d.lastRng=d.selection.getRng()))}),t.webkit&&!r&&(r=function(){var t=e.activeEditor;if(t&&t.selection){var n=t.selection.getRng();n&&!n.collapsed&&(d.lastRng=n)}},a.bind(document,"selectionchange",r)))}),d.on("setcontent",function(){d.lastRng=null}),d.on("mousedown",function(){d.selection.lastFocusBookmark=null}),d.on("focusin",function(){var t=e.focusedEditor;d.selection.lastFocusBookmark&&(d.selection.setRng(c(d,d.selection.lastFocusBookmark)),d.selection.lastFocusBookmark=null),t!=d&&(t&&t.fire("blur",{focusedEditor:d}),e.setActive(d),e.focusedEditor=d,d.fire("focus",{blurredEditor:t}),d.focus(!0)),d.lastRng=null}),d.on("focusout",function(){window.setTimeout(function(){var t=e.focusedEditor;u(s())||t!=d||(d.fire("blur",{focusedEditor:null}),e.focusedEditor=null,d.selection&&(d.selection.lastFocusBookmark=null))},0)}),i||(i=function(t){var n=e.activeEditor;n&&t.target.ownerDocument==document&&(n.selection&&t.target!=n.getBody()&&(n.selection.lastFocusBookmark=l(n.dom,n.lastRng)),t.target==document.body||u(t.target)||e.focusedEditor!=n||(n.fire("blur",{focusedEditor:null}),e.focusedEditor=null))},a.bind(document,"focusin",i)),d.inline&&!o&&(o=function(t){var n=e.activeEditor;if(n.inline&&!n.dom.isChildOf(t.target,n.getBody())){var r=n.selection.getRng();r.collapsed||(n.lastRng=r)}},a.bind(document,"mouseup",o))}function f(t){e.focusedEditor==t.editor&&(e.focusedEditor=null),e.activeEditor||(a.unbind(document,"selectionchange",r),a.unbind(document,"focusin",i),a.unbind(document,"mouseup",o),r=i=o=null)}e.on("AddEditor",d),e.on("RemoveEditor",f)}var r,i,o,a=e.DOM;return n.isEditorUIElement=function(e){return-1!==e.className.toString().indexOf("mce-")},n}),r(ht,[dt,f,y,V,d,u,lt,ft,pt],function(e,t,n,r,i,o,a,s,l){function c(e){var t=v.editors,n;delete t[e.id];for(var r=0;r0&&p(f(e),function(e){var n;(n=d.get(e))?r(e,t,n):p(document.forms,function(n){p(n.elements,function(n){n.name===e&&(e="mce_editor_"+m++,d.setAttrib(n,"id",e),r(e,t,n))})})});break;case"textareas":case"specific_textareas":p(d.select("textarea"),function(e){t.editor_deselector&&o(e,t.editor_deselector)||(!t.editor_selector||o(e,t.editor_selector))&&r(n(e),t,e)})}t.oninit&&(e=s=0,p(l,function(t){s++,t.initialized?e++:t.on("init",function(){e++,e==s&&i("oninit")}),e==s&&i("oninit")}))}var s=this,l=[];s.settings=t,d.bind(window,"ready",a)},get:function(e){return arguments.length?e in this.editors?this.editors[e]:null:this.editors},add:function(e){var t=this,n=t.editors;return n[e.id]=e,n.push(e),t.activeEditor=e,t.fire("AddEditor",{editor:e}),g||(g=function(){t.fire("BeforeUnload")},d.bind(window,"beforeunload",g)),e},createEditor:function(t,n){return this.add(new e(t,n,this))},remove:function(e){var t=this,n,r=t.editors,i;{if(e)return"string"==typeof e?(e=e.selector||e,void p(d.select(e),function(e){i=r[e.id],i&&t.remove(i)})):(i=e,r[i.id]?(c(i)&&t.fire("RemoveEditor",{editor:i}),r.length||d.unbind(window,"beforeunload",g),i.remove(),i):null);for(n=r.length-1;n>=0;n--)t.remove(r[n])}},execCommand:function(t,n,r){var i=this,o=i.get(r);switch(t){case"mceAddEditor":return i.get(r)||new e(r,i.settings,i).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(i.execCommand("mceAddEditor",0,r),!0)}return i.activeEditor?i.activeEditor.execCommand(t,n,r):!1},triggerSave:function(){p(this.editors,function(e){e.save()})},addI18n:function(e,t){s.add(e,t)},translate:function(e){return s.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!=e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e}},h(v,a),v.setup(),window.tinymce=window.tinyMCE=v,v}),r(mt,[ht,u],function(e,t){var n=t.each,r=t.explode;e.on("AddEditor",function(e){var t=e.editor;t.on("preInit",function(){function e(e,t){n(t,function(t,n){t&&s.setStyle(e,n,t)}),s.rename(e,"span")}function i(e){s=t.dom,l.convert_fonts_to_spans&&n(s.select("font,u,strike",e.node),function(e){o[e.nodeName.toLowerCase()](s,e)})}var o,a,s,l=t.settings;l.inline_styles&&(a=r(l.font_size_legacy_values),o={font:function(t,n){e(n,{backgroundColor:n.style.backgroundColor,color:n.color,fontFamily:n.face,fontSize:a[parseInt(n.size,10)-1]})},u:function(t,n){e(n,{textDecoration:"underline"})},strike:function(t,n){e(n,{textDecoration:"line-through"})}},t.on("PreProcess SetContent",i))})})}),r(gt,[lt,u],function(e,t){var n={send:function(e){function t(){!e.async||4==r.readyState||i++>1e4?(e.success&&1e4>i&&200==r.status?e.success.call(e.success_scope,""+r.responseText,r,e):e.error&&e.error.call(e.error_scope,i>1e4?"TIMED_OUT":"GENERAL",r,e),r=null):setTimeout(t,10)}var r,i=0;if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=e.async===!1?!1:!0,e.data=e.data||"",r=new XMLHttpRequest){if(r.overrideMimeType&&r.overrideMimeType(e.content_type),r.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(r.withCredentials=!0),e.content_type&&r.setRequestHeader("Content-Type",e.content_type),r.setRequestHeader("X-Requested-With","XMLHttpRequest"),r=n.fire("beforeSend",{xhr:r,settings:e}).xhr,r.send(e.data),!e.async)return t();setTimeout(t,10)}}};return t.extend(n,e),n}),r(vt,[],function(){function e(t,n){var r,i,o,a;if(n=n||'"',null===t)return"null";if(o=typeof t,"string"==o)return i="\bb t\nn\ff\rr\"\"''\\\\",n+t.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=i.indexOf(t),r+1?"\\"+i.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e))})+n;if("object"==o){if(t.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(t)){for(r=0,i="[";r0?",":"")+e(t[r],n);return i+"]"}i="{";for(a in t)t.hasOwnProperty(a)&&(i+="function"!=typeof t[a]?(i.length>1?","+n:n)+a+n+":"+e(t[a],n):"");return i+"}"}return""+t}return{serialize:e,parse:function(e){try{return window[String.fromCharCode(101)+"val"]("("+e+")")}catch(t){}}}}),r(yt,[vt,gt,u],function(e,t,n){function r(e){this.settings=i({},e),this.count=0}var i=n.extend;return r.sendRPC=function(e){return(new r).send(e)},r.prototype={send:function(n){var r=n.error,o=n.success;n=i(this.settings,n),n.success=function(t,i){t=e.parse(t),"undefined"==typeof t&&(t={error:"JSON Parse error."}),t.error?r.call(n.error_scope||n.scope,t.error,i):o.call(n.success_scope||n.scope,t.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=e.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",t.send(n)}},r}),r(bt,[y],function(e){return{callbacks:{},count:0,send:function(n){var r=this,i=e.DOM,o=n.count!==t?n.count:r.count,a="tinymce_jsonp_"+o;r.callbacks[o]=function(e){i.remove(a),delete r.callbacks[o],n.callback(e)},i.add(i.doc.body,"script",{id:a,src:n.url,type:"text/javascript"}),r.count++}}}),r(Ct,[],function(){function e(){s=[];for(var e in a)s.push(e);i.length=s.length}function n(){function n(e){var n,r;return r=e!==t?u+e:i.indexOf(",",u),-1===r||r>i.length?null:(n=i.substring(u,r),u=r+1,n)}var r,i,s,u=0;if(a={},c){o.load(l),i=o.getAttribute(l)||"";do{var d=n();if(null===d)break;if(r=n(parseInt(d,32)||0),null!==r){if(d=n(),null===d)break;s=n(parseInt(d,32)||0),r&&(a[r]=s)}}while(null!==r);e()}}function r(){var t,n="";if(c){for(var r in a)t=a[r],n+=(n?",":"")+r.length.toString(32)+","+r+","+t.length.toString(32)+","+t;o.setAttribute(l,n);try{o.save(l)}catch(i){}e()}}var i,o,a,s,l,c;try{if(window.localStorage)return localStorage}catch(u){}return l="tinymce",o=document.documentElement,c=!!o.addBehavior,c&&o.addBehavior("#default#userData"),i={key:function(e){return s[e]},getItem:function(e){return e in a?a[e]:null},setItem:function(e,t){a[e]=""+t,r()},removeItem:function(e){delete a[e],r()},clear:function(){a={},r()}},n(),i}),r(xt,[y,l,b,C,u,d],function(e,t,n,r,i,o){var a=window.tinymce;return a.DOM=e.DOM,a.ScriptLoader=n.ScriptLoader,a.PluginManager=r.PluginManager,a.ThemeManager=r.ThemeManager,a.dom=a.dom||{},a.dom.Event=t.Event,i.each(i,function(e,t){a[t]=e}),i.each("isOpera isWebKit isIE isGecko isMac".split(" "),function(e){a[e]=o[e.substr(2).toLowerCase()]}),{}}),r(wt,[U,u],function(e,t){return e.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=t.extend({},this.Defaults,e)},preRender:function(e){e.addClass(this.settings.containerClass,"body")},applyClasses:function(e){var t=this,n=t.settings,r,i,o;r=e.items().filter(":visible"),i=n.firstControlClass,o=n.lastControlClass,r.each(function(e){e.removeClass(i).removeClass(o),n.controlClass&&e.addClass(n.controlClass)}),r.eq(0).addClass(i),r.eq(-1).addClass(o)},renderHtml:function(e){var t=this,n=t.settings,r,i="";return r=e.items(),r.eq(0).addClass(n.firstControlClass),r.eq(-1).addClass(n.lastControlClass),r.each(function(e){n.controlClass&&e.addClass(n.controlClass),i+=e.renderHtml()}),i},recalc:function(){},postRender:function(){}})}),r(_t,[wt],function(e){return e.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderHtml:function(e){return'
'+this._super(e) -}})}),r(Et,[K,tt],function(e,t){return e.extend({Mixins:[t],Defaults:{classes:"widget tooltip tooltip-n"},text:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t._rendered&&(t.getEl().lastChild.innerHTML=t.encode(e)),t):t._value},renderHtml:function(){var e=this,t=e.classPrefix;return'"},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(Nt,[K,Et],function(e,t){var n,r=e.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.canFocus=!0,e.tooltip&&r.tooltips!==!1&&(t.on("mouseenter",function(n){var r=t.tooltip().moveTo(-65535);if(n.control==t){var i=r.text(e.tooltip).show().testMoveRel(t.getEl(),["bc-tc","bc-tl","bc-tr"]);r.toggleClass("tooltip-n","bc-tc"==i),r.toggleClass("tooltip-nw","bc-tl"==i),r.toggleClass("tooltip-ne","bc-tr"==i),r.moveRel(t.getEl(),i)}else r.hide()}),t.on("mouseleave mousedown click",function(){t.tooltip().hide()})),t.aria("label",e.ariaLabel||e.tooltip)},tooltip:function(){return n||(n=new t({type:"tooltip"}),n.renderTo()),n},active:function(e){var t=this,n;return e!==n&&(t.aria("pressed",e),t.toggleClass("active",e)),t._super(e)},disabled:function(e){var t=this,n;return e!==n&&(t.aria("disabled",e),t.toggleClass("disabled",e)),t._super(e)},postRender:function(){var e=this,t=e.settings;e._rendered=!0,e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&e.focus()},remove:function(){this._super(),n&&(n.remove(),n=null)}});return r}),r(kt,[Nt],function(e){return e.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t=this,n;t.on("click mousedown",function(e){e.preventDefault()}),t._super(e),n=e.size,e.subtype&&t.addClass(e.subtype),n&&t.addClass("btn-"+n)},icon:function(e){var t=this,n=t.classPrefix;if("undefined"==typeof e)return t.settings.icon;if(t.settings.icon=e,e=e?n+"ico "+n+"i-"+t.settings.icon:"",t._rendered){var r=t.getEl().firstChild,i=r.getElementsByTagName("i")[0];e?(i&&i==r.firstChild||(i=document.createElement("i"),r.insertBefore(i,r.firstChild)),i.className=e):i&&r.removeChild(i),t.text(t._text)}return t},repaint:function(){var e=this.getEl().firstChild.style;e.width=e.height="100%",this._super()},text:function(e){var t=this;if(t._rendered){var n=t.getEl().lastChild.lastChild;n&&(n.data=t.translate(e))}return t._super(e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon,i;return i=e.settings.image,i?(r="none","string"!=typeof i&&(i=window.getSelection?i[0]:i[1]),i=" style=\"background-image: url('"+i+"')\""):i="",r=e.settings.icon?n+"ico "+n+"i-"+r:"",'
"}})}),r(St,[J],function(e){return e.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var e=this,t=e._layout;return e.addClass("btn-group"),e.preRender(),t.preRender(e),'
'+(e.settings.html||"")+t.renderHtml(e)+"
"}})}),r(Tt,[Nt],function(e){return e.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){var t=this;return"undefined"!=typeof e?(e?t.addClass("checked"):t.removeClass("checked"),t._checked=e,t.aria("checked",e),t):t._checked},value:function(e){return this.checked(e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'
'+e.encode(e._text)+"
"}})}),r(Rt,[Nt,G,Y],function(e,t,n){return e.extend({init:function(e){var t=this;t._super(e),t.addClass("combobox"),t.subinput=!0,t.ariaTarget="inp",e=t.settings,e.menu=e.menu||e.values,e.menu&&(e.icon="caret"),t.on("click",function(n){for(var r=n.target,i=t.getEl();r&&r!=i;)r.id&&-1!=r.id.indexOf("-open")&&(t.fire("action"),e.menu&&(t.showMenu(),n.aria&&t.menu.items()[0].focus())),r=r.parentNode}),t.on("keydown",function(e){"INPUT"==e.target.nodeName&&13==e.keyCode&&t.parents().reverse().each(function(n){return e.preventDefault(),t.fire("change"),n.hasEventListeners("submit")&&n.toJSON?(n.fire("submit",{data:n.toJSON()}),!1):void 0})}),e.placeholder&&(t.addClass("placeholder"),t.on("focusin",function(){t._hasOnChange||(n.on(t.getEl("inp"),"change",function(){t.fire("change")}),t._hasOnChange=!0),t.hasClass("placeholder")&&(t.getEl("inp").value="",t.removeClass("placeholder"))}),t.on("focusout",function(){0===t.value().length&&(t.getEl("inp").value=e.placeholder,t.addClass("placeholder"))}))},showMenu:function(){var e=this,n=e.settings,r;e.menu||(r=n.menu||[],r.length?r={type:"menu",items:r}:r.type=r.type||"menu",e.menu=t.create(r).parent(e).renderTo(e.getContainerElm()),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control===e.menu&&e.focus()}),e.menu.on("show hide",function(t){t.control.items().each(function(t){t.active(t.value()==e.value())})}).fire("show"),e.menu.on("select",function(t){e.value(t.control.value())}),e.on("focusin",function(t){"INPUT"==t.target.tagName.toUpperCase()&&e.menu.hide()}),e.aria("expanded",!0)),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},value:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t.removeClass("placeholder"),t._rendered&&(t.getEl("inp").value=e),t):t._rendered?(e=t.getEl("inp").value,e!=t.settings.placeholder?e:""):t._value},disabled:function(e){var t=this;return t._rendered&&"undefined"!=typeof e&&(t.getEl("inp").disabled=e),t._super(e)},focus:function(){this.getEl("inp").focus()},repaint:function(){var e=this,t=e.getEl(),r=e.getEl("open"),i=e.layoutRect(),o,a;o=r?i.w-n.getSize(r).width-10:i.w-10;var s=document;return s.all&&(!s.documentMode||s.documentMode<=8)&&(a=e.layoutRect().h-2+"px"),n.css(t.firstChild,{width:o,lineHeight:a}),e._super(),e},postRender:function(){var e=this;return n.on(this.getEl("inp"),"change",function(){e.fire("change")}),e._super()},remove:function(){n.off(this.getEl("inp")),this._super()},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.classPrefix,i=n.value||n.placeholder||"",o,a,s="",l="";return"spellcheck"in n&&(l+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(l+=' maxlength="'+n.maxLength+'"'),n.size&&(l+=' size="'+n.size+'"'),n.subtype&&(l+=' type="'+n.subtype+'"'),e.disabled()&&(l+=' disabled="disabled"'),o=n.icon,o&&"caret"!=o&&(o=r+"ico "+r+"i-"+n.icon),a=e._text,(o||a)&&(s='
",e.addClass("has-open")),'
"+s+"
"}})}),r(At,[Rt],function(e){return e.extend({init:function(e){var t=this;e.spellcheck=!1,e.onaction&&(e.icon="none"),t._super(e),t.addClass("colorbox"),t.on("change keyup postrender",function(){t.repaintColor(t.value())})},repaintColor:function(e){var t=this.getEl().getElementsByTagName("i")[0];if(t)try{t.style.background=e}catch(n){}},value:function(e){var t=this;return"undefined"!=typeof e&&t._rendered&&t.repaintColor(e),t._super(e)}})}),r(Bt,[kt,rt],function(e,t){return e.extend({showPanel:function(){var e=this,n=e.settings;if(e.active(!0),e.panel)e.panel.show();else{var r=n.panel;r.type&&(r={layout:"grid",items:r}),r.role=r.role||"dialog",r.popover=!0,r.autohide=!0,r.ariaRoot=!0,e.panel=new t(r).on("hide",function(){e.active(!1)}).on("cancel",function(t){t.stopPropagation(),e.focus(),e.hidePanel()}).parent(e).renderTo(e.getContainerElm()),e.panel.fire("show"),e.panel.reflow()}e.panel.moveRel(e.getEl(),n.popoverAlign||(e.isRtl()?["bc-tr","bc-tc"]:["bc-tl","bc-tc"]))},hidePanel:function(){var e=this;e.panel&&e.panel.hide()},postRender:function(){var e=this;return e.aria("haspopup",!0),e.on("click",function(t){t.control===e&&(e.panel&&e.panel.visible()?e.hidePanel():(e.showPanel(),e.panel.focus(!!t.aria)))}),e._super()},remove:function(){return this.panel&&(this.panel.remove(),this.panel=null),this._super()}})}),r(Dt,[Bt,y],function(e,t){var n=t.DOM;return e.extend({init:function(e){this._super(e),this.addClass("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",i=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"";return'
'},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(r){r.aria&&"down"==r.aria.key||r.control!=e||n.getParent(r.target,"."+e.classPrefix+"open")||(r.stopImmediatePropagation(),t.call(e,r))}),delete e.settings.onclick,e._super()}})}),r(Lt,[],function(){function e(e){function i(e,i,o){var a,s,l,c,u,d;return a=0,s=0,l=0,e/=255,i/=255,o/=255,u=t(e,t(i,o)),d=n(e,n(i,o)),u==d?(l=u,{h:0,s:0,v:100*l}):(c=e==u?i-o:o==u?e-i:o-e,a=e==u?3:o==u?1:5,a=60*(a-c/(d-u)),s=(d-u)/d,l=d,{h:r(a),s:r(100*s),v:r(100*l)})}function o(e,i,o){var a,s,l,c;if(e=(parseInt(e,10)||0)%360,i=parseInt(i,10)/100,o=parseInt(o,10)/100,i=n(0,t(i,1)),o=n(0,t(o,1)),0===i)return void(d=f=p=r(255*o));switch(a=e/60,s=o*i,l=s*(1-Math.abs(a%2-1)),c=o-s,Math.floor(a)){case 0:d=s,f=l,p=0;break;case 1:d=l,f=s,p=0;break;case 2:d=0,f=s,p=l;break;case 3:d=0,f=l,p=s;break;case 4:d=l,f=0,p=s;break;case 5:d=s,f=0,p=l;break;default:d=f=p=0}d=r(255*(d+c)),f=r(255*(f+c)),p=r(255*(p+c))}function a(){function e(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+e(d)+e(f)+e(p)}function s(){return{r:d,g:f,b:p}}function l(){return i(d,f,p)}function c(e){var t;return"object"==typeof e?"r"in e?(d=e.r,f=e.g,p=e.b):"v"in e&&o(e.h,e.s,e.v):(t=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(d=parseInt(t[1],10),f=parseInt(t[2],10),p=parseInt(t[3],10)):(t=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(d=parseInt(t[1],16),f=parseInt(t[2],16),p=parseInt(t[3],16)):(t=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(d=parseInt(t[1]+t[1],16),f=parseInt(t[2]+t[2],16),p=parseInt(t[3]+t[3],16)),d=0>d?0:d>255?255:d,f=0>f?0:f>255?255:f,p=0>p?0:p>255?255:p,u}var u=this,d=0,f=0,p=0;e&&c(e),u.toRgb=s,u.toHsv=l,u.toHex=a,u.parse=c}var t=Math.min,n=Math.max,r=Math.round;return e}),r(Ht,[Nt,Q,Y,Lt],function(e,t,n,r){return e.extend({Defaults:{classes:"widget colorpicker"},init:function(e){this._super(e)},postRender:function(){function e(e,t){var r=n.getPos(e),i,o;return i=t.pageX-r.x,o=t.pageY-r.y,i=Math.max(0,Math.min(i/e.clientWidth,1)),o=Math.max(0,Math.min(o/e.clientHeight,1)),{x:i,y:o}}function i(e,t){var i=(360-e.h)/360;n.css(d,{top:100*i+"%"}),t||n.css(p,{left:e.s+"%",top:100-e.v+"%"}),f.style.background=new r({s:100,v:100,h:e.h}).toHex(),s.color().parse({s:e.s,v:e.v,h:e.h})}function o(t){var n;n=e(f,t),c.s=100*n.x,c.v=100*(1-n.y),i(c),s.fire("change")}function a(t){var n;n=e(u,t),c=l.toHsv(),c.h=360*(1-n.y),i(c,!0),s.fire("change")}var s=this,l=s.color(),c,u,d,f,p;u=s.getEl("h"),d=s.getEl("hp"),f=s.getEl("sv"),p=s.getEl("svp"),s._repaint=function(){c=l.toHsv(),i(c)},s._super(),s._svdraghelper=new t(s._id+"-sv",{start:o,drag:o}),s._hdraghelper=new t(s._id+"-h",{start:a,drag:a}),s._repaint()},rgb:function(){return this.color().toRgb()},value:function(e){var t=this;return arguments.length?(t.color().parse(e),void(t._rendered&&t._repaint())):t.color().toHex()},color:function(){return this._color||(this._color=new r),this._color},renderHtml:function(){function e(){var e,t,n="",i,a;for(i="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=",a=o.split(","),e=0,t=a.length-1;t>e;e++)n+='
';return n}var t=this,n=t._id,r=t.classPrefix,i,o="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000",a="background: -ms-linear-gradient(top,"+o+");background: linear-gradient(to bottom,"+o+");";return i='
'+e()+'
','
'+i+"
"}})}),r(Mt,[Nt],function(e){return e.extend({init:function(e){var t=this;e.delimiter||(e.delimiter="\xbb"),t._super(e),t.addClass("path"),t.canFocus=!0,t.on("click",function(e){var n,r=e.target;(n=r.getAttribute("data-index"))&&t.fire("select",{value:t.data()[n],index:n})})},focus:function(){var e=this;return e.getEl().firstChild.focus(),e},data:function(e){var t=this;return"undefined"!=typeof e?(t._data=e,t.update(),t):t._data},update:function(){this.innerHtml(this._getPathHtml())},postRender:function(){var e=this;e._super(),e.data(e.settings.data)},renderHtml:function(){var e=this;return'
'+e._getPathHtml()+"
"},_getPathHtml:function(){var e=this,t=e._data||[],n,r,i="",o=e.classPrefix;for(n=0,r=t.length;r>n;n++)i+=(n>0?'":"")+'
'+t[n].name+"
";return i||(i='
\xa0
'),i}})}),r(Pt,[Mt,ht],function(e,t){return e.extend({postRender:function(){function e(e){if(1===e.nodeType){if("BR"==e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}var n=this,r=t.activeEditor;return n.on("select",function(e){r.focus(),r.selection.select(this.data()[e.index].element),r.nodeChanged()}),r.on("nodeChange",function(t){for(var i=[],o=t.parents,a=o.length;a--;)if(1==o[a].nodeType&&!e(o[a])){var s=r.fire("ResolveName",{name:o[a].nodeName.toLowerCase(),target:o[a]});if(s.isDefaultPrevented()||i.push({name:s.name,element:o[a]}),s.isPropagationStopped())break}n.data(i)}),n._super()}})}),r(Ot,[J],function(e){return e.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.addClass("formitem"),t.preRender(e),'
'+(e.settings.title?'
'+e.settings.title+"
":"")+'
'+(e.settings.html||"")+t.renderHtml(e)+"
"}})}),r(It,[J,Ot,u],function(e,t,n){return e.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:20,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var e=this,r=e.items();e.settings.formItemDefaults||(e.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}),r.each(function(r){var i,o=r.settings.label;o&&(i=new t(n.extend({items:{type:"label",id:r._id+"-l",text:o,flex:0,forId:r._id,disabled:r.disabled()}},e.settings.formItemDefaults)),i.type="formitem",r.aria("labelledby",r._id+"-l"),"undefined"==typeof r.settings.flex&&(r.settings.flex=1),e.replace(r,i),i.add(r))})},recalcLabels:function(){var e=this,t=0,n=[],r,i,o;if(e.settings.labelGapCalc!==!1)for(o="children"==e.settings.labelGapCalc?e.find("formitem"):e.items(),o.filter("formitem").each(function(e){var r=e.items()[0],i=r.getEl().clientWidth;t=i>t?i:t,n.push(r)}),i=e.settings.labelGap||0,r=n.length;r--;)n[r].settings.minWidth=t+i},visible:function(e){var t=this._super(e);return e===!0&&this._rendered&&this.recalcLabels(),t},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){var e=this;e._super(),e.recalcLabels(),e.fromJSON(e.settings.data)}})}),r(Ft,[It],function(e){return e.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'
'+(e.settings.title?''+e.settings.title+"":"")+'
'+(e.settings.html||"")+t.renderHtml(e)+"
"}})}),r(zt,[Rt,u],function(e,t){return e.extend({init:function(e){var n=this,r=tinymce.activeEditor,i=r.settings,o,a,s;e.spellcheck=!1,s=i.file_picker_types||i.file_browser_callback_types,s&&(s=t.makeMap(s,/[, ]/)),(!s||s[e.filetype])&&(a=i.file_picker_callback,!a||s&&!s[e.filetype]?(a=i.file_browser_callback,!a||s&&!s[e.filetype]||(o=function(){a(n.getEl("inp").id,n.value(),e.filetype,window)})):o=function(){var i=n.fire("beforecall").meta;i=t.extend({filetype:e.filetype},i),a.call(r,function(e,t){n.value(e).fire("change",{meta:t})},n.value(),i)}),o&&(e.icon="browse",e.onaction=o),n._super(e)}})}),r(Wt,[_t],function(e){return e.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox();e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()})}})}),r(Vt,[_t],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,p,h,m,g,v=[],y,b,C,x,w,_,E,N,k,S,T,R,A,B,D,L,H,M,P,O,I,F,z=Math.max,W=Math.min;for(r=e.items().filter(":visible"),i=e.layoutRect(),o=e._paddingBox,a=e.settings,f=e.isRtl()?a.direction||"row-reversed":a.direction,s=a.align,l=e.isRtl()?a.pack||"end":a.pack,c=a.spacing||0,("row-reversed"==f||"column-reverse"==f)&&(r=r.set(r.toArray().reverse()),f=f.split("-")[0]),"column"==f?(k="y",E="h",N="minH",S="maxH",R="innerH",T="top",A="deltaH",B="contentH",P="left",H="w",D="x",L="innerW",M="minW",O="right",I="deltaW",F="contentW"):(k="x",E="w",N="minW",S="maxW",R="innerW",T="left",A="deltaW",B="contentW",P="top",H="h",D="y",L="innerH",M="minH",O="bottom",I="deltaH",F="contentH"),d=i[R]-o[T]-o[T],_=u=0,t=0,n=r.length;n>t;t++)p=r[t],h=p.layoutRect(),m=p.settings,g=m.flex,d-=n-1>t?c:0,g>0&&(u+=g,h[S]&&v.push(p),h.flex=g),d-=h[N],y=o[P]+h[M]+o[O],y>_&&(_=y);if(x={},x[N]=0>d?i[N]-d+i[A]:i[R]-d+i[A],x[M]=_+i[I],x[B]=i[R]-d,x[F]=_,x.minW=W(x.minW,i.maxW),x.minH=W(x.minH,i.maxH),x.minW=z(x.minW,i.startMinWidth),x.minH=z(x.minH,i.startMinHeight),!i.autoResize||x.minW==i.minW&&x.minH==i.minH){for(C=d/u,t=0,n=v.length;n>t;t++)p=v[t],h=p.layoutRect(),b=h[S],y=h[N]+h.flex*C,y>b?(d-=h[S]-h[N],u-=h.flex,h.flex=0,h.maxFlexSize=b):h.maxFlexSize=0;for(C=d/u,w=o[T],x={},0===u&&("end"==l?w=d+o[T]:"center"==l?(w=Math.round(i[R]/2-(i[R]-d)/2)+o[T],0>w&&(w=o[T])):"justify"==l&&(w=o[T],c=Math.floor(d/(r.length-1)))),x[D]=o[P],t=0,n=r.length;n>t;t++)p=r[t],h=p.layoutRect(),y=h.maxFlexSize||h[N],"center"===s?x[D]=Math.round(i[L]/2-h[H]/2):"stretch"===s?(x[H]=z(h[M]||0,i[L]-o[P]-o[O]),x[D]=o[P]):"end"===s&&(x[D]=i[L]-h[H]-o.top),h.flex>0&&(y+=h.flex*C),x[E]=y,x[k]=w,p.layoutRect(x),p.recalc&&p.recalc(),w+=y+c}else if(x.w=x.minW,x.h=x.minH,e.layoutRect(x),this.recalc(e),null===e._lastRect){var V=e.parent();V&&(V._lastRect=null,V.recalc())}}})}),r(Ut,[wt],function(e){return e.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){e.recalc&&e.recalc()})}})}),r($t,[K,Nt,rt,u,ht,d],function(e,t,n,r,i,o){function a(e){function t(t,n){return function(){var r=this;e.on("nodeChange",function(i){var o=e.formatter,a=null;s(i.parents,function(e){return s(t,function(t){return n?o.matchNode(e,n,{value:t.value})&&(a=t.value):o.matchNode(e,t.value)&&(a=t.value),a?!1:void 0}),a?!1:void 0}),r.value(a)})}}function r(e){e=e.replace(/;$/,"").split(";");for(var t=e.length;t--;)e[t]=e[t].split("=");return e}function i(){function t(e){var n=[];if(e)return s(e,function(e){var o={text:e.title,icon:e.icon};if(e.items)o.menu=t(e.items);else{var a=e.format||"custom"+r++;e.format||(e.name=a,i.push(e)),o.format=a,o.cmd=e.cmd}n.push(o)}),n}function n(){var n;return n=t(e.settings.style_formats_merge?e.settings.style_formats?o.concat(e.settings.style_formats):o:e.settings.style_formats||o)}var r=0,i=[],o=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}];return e.on("init",function(){s(i,function(t){e.formatter.register(t.name,t)})}),{type:"menu",items:n(),onPostRender:function(t){e.fire("renderFormatsMenu",{control:t.control})},itemDefaults:{preview:!0,textStyle:function(){return this.settings.format?e.formatter.getCssText(this.settings.format):void 0},onPostRender:function(){var t=this;t.parent().on("show",function(){var n,r;n=t.settings.format,n&&(t.disabled(!e.formatter.canApply(n)),t.active(e.formatter.match(n))),r=t.settings.cmd,r&&t.active(e.queryCommandState(r))})},onclick:function(){this.settings.format&&l(this.settings.format),this.settings.cmd&&e.execCommand(this.settings.cmd)}}}}function o(t){return function(){function n(){return e.undoManager?e.undoManager[t]():!1}var r=this;t="redo"==t?"hasRedo":"hasUndo",r.disabled(!n()),e.on("Undo Redo AddUndo TypingUndo ClearUndos",function(){r.disabled(!n())})}}function a(){var t=this;e.on("VisualAid",function(e){t.active(e.hasVisual)}),t.active(e.hasVisual)}function l(t){t.control&&(t=t.control.value()),t&&e.execCommand("mceToggleFormat",!1,t)}var c;c=i(),s({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(t,n){e.addButton(n,{tooltip:t,onPostRender:function(){var t=this;e.formatter?e.formatter.formatChanged(n,function(e){t.active(e)}):e.on("init",function(){e.formatter.formatChanged(n,function(e){t.active(e)})})},onclick:function(){l(n)}})}),s({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1]})}),s({blockquote:["Blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1],onPostRender:function(){var t=this;e.formatter?e.formatter.formatChanged(n,function(e){t.active(e)}):e.on("init",function(){e.formatter.formatChanged(n,function(e){t.active(e)})})}})}),e.addButton("undo",{tooltip:"Undo",onPostRender:o("undo"),cmd:"undo"}),e.addButton("redo",{tooltip:"Redo",onPostRender:o("redo"),cmd:"redo"}),e.addMenuItem("newdocument",{text:"New document",shortcut:"Ctrl+N",icon:"newdocument",cmd:"mceNewDocument"}),e.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Ctrl+Z",onPostRender:o("undo"),cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Ctrl+Y",onPostRender:o("redo"),cmd:"redo"}),e.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:a,cmd:"mceToggleVisualAid"}),s({cut:["Cut","Cut","Ctrl+X"],copy:["Copy","Copy","Ctrl+C"],paste:["Paste","Paste","Ctrl+V"],selectall:["Select all","SelectAll","Ctrl+A"],bold:["Bold","Bold","Ctrl+B"],italic:["Italic","Italic","Ctrl+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(t,n){e.addMenuItem(n,{text:t[0],icon:n,shortcut:t[2],cmd:t[1]})}),e.on("mousedown",function(){n.hideAll()}),e.addButton("styleselect",{type:"menubutton",text:"Formats",menu:c}),e.addButton("formatselect",function(){var n=[],i=r(e.settings.block_formats||"Paragraph=p;Address=address;Pre=pre;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6");return s(i,function(t){n.push({text:t[0],value:t[1],textStyle:function(){return e.formatter.getCssText(t[1])}})}),{type:"listbox",text:i[0][0],values:n,fixedWidth:!0,onselect:l,onPostRender:t(n)}}),e.addButton("fontselect",function(){var n="Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",i=[],o=r(e.settings.font_formats||n);return s(o,function(e){i.push({text:{raw:e[0]},value:e[1],textStyle:-1==e[1].indexOf("dings")?"font-family:"+e[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:i,fixedWidth:!0,onPostRender:t(i,"fontname"),onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}}),e.addButton("fontsizeselect",function(){var n=[],r="8pt 10pt 12pt 14pt 18pt 24pt 36pt",i=e.settings.fontsize_formats||r;return s(i.split(" "),function(e){var t=e,r=e,i=e.split("=");i.length>1&&(t=i[0],r=i[1]),n.push({text:t,value:r})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:n,fixedWidth:!0,onPostRender:t(n,"fontsize"),onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}}),e.addMenuItem("formats",{text:"Formats",menu:c})}var s=r.each;i.on("AddEditor",function(t){t.editor.rtl&&(e.rtl=!0),a(t.editor)}),e.translate=function(e){return i.translate(e)},t.tooltips=!o.iOS}),r(qt,[_t],function(e){return e.extend({recalc:function(e){var t=e.settings,n,r,i,o,a,s,l,c,u,d,f,p,h,m,g,v,y,b,C,x,w,_,E=[],N=[],k,S,T,R,A,B;t=e.settings,i=e.items().filter(":visible"),o=e.layoutRect(),r=t.columns||Math.ceil(Math.sqrt(i.length)),n=Math.ceil(i.length/r),y=t.spacingH||t.spacing||0,b=t.spacingV||t.spacing||0,C=t.alignH||t.align,x=t.alignV||t.align,g=e._paddingBox,A="reverseRows"in t?t.reverseRows:e.isRtl(),C&&"string"==typeof C&&(C=[C]),x&&"string"==typeof x&&(x=[x]);for(d=0;r>d;d++)E.push(0);for(f=0;n>f;f++)N.push(0);for(f=0;n>f;f++)for(d=0;r>d&&(u=i[f*r+d],u);d++)c=u.layoutRect(),k=c.minW,S=c.minH,E[d]=k>E[d]?k:E[d],N[f]=S>N[f]?S:N[f];for(T=o.innerW-g.left-g.right,w=0,d=0;r>d;d++)w+=E[d]+(d>0?y:0),T-=(d>0?y:0)+E[d];for(R=o.innerH-g.top-g.bottom,_=0,f=0;n>f;f++)_+=N[f]+(f>0?b:0),R-=(f>0?b:0)+N[f];if(w+=g.left+g.right,_+=g.top+g.bottom,l={},l.minW=w+(o.w-o.innerW),l.minH=_+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW==o.minW&&l.minH==o.minH){o.autoResize&&(l=e.layoutRect(l),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH);var D;D="start"==t.packV?0:R>0?Math.floor(R/n):0;var L=0,H=t.flexWidths;if(H)for(d=0;dd;d++)E[d]+=H?H[d]*M:M;for(h=g.top,f=0;n>f;f++){for(p=g.left,s=N[f]+D,d=0;r>d&&(B=A?f*r+r-1-d:f*r+d,u=i[B],u);d++)m=u.settings,c=u.layoutRect(),a=Math.max(E[d],c.startMinWidth),c.x=p,c.y=h,v=m.alignH||(C?C[d]||C[0]:null),"center"==v?c.x=p+a/2-c.w/2:"right"==v?c.x=p+a-c.w:"stretch"==v&&(c.w=a),v=m.alignV||(x?x[d]||x[0]:null),"center"==v?c.y=h+s/2-c.h/2:"bottom"==v?c.y=h+s-c.h:"stretch"==v&&(c.h=s),u.layoutRect(c),p+=a+y,u.recalc&&u.recalc();h+=s+b}}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var P=e.parent();P&&(P._lastRect=null,P.recalc())}}})}),r(jt,[Nt],function(e){return e.extend({renderHtml:function(){var e=this;return e.addClass("iframe"),e.canFocus=!1,''},src:function(e){this.getEl().src=e},html:function(e,t){var n=this,r=this.getEl().contentWindow.document.body;return r?(r.innerHTML=e,t&&t()):setTimeout(function(){n.html(e)},0),this}})}),r(Yt,[Nt,Y],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t.addClass("widget"),t.addClass("label"),t.canFocus=!1,e.multiline&&t.addClass("autoscroll"),e.strong&&t.addClass("strong")},initLayoutRect:function(){var e=this,n=e._super();if(e.settings.multiline){var r=t.getSize(e.getEl());r.width>n.maxW&&(n.minW=n.maxW,e.addClass("multiline")),e.getEl().style.width=n.minW+"px",n.startMinH=n.h=n.minH=Math.min(n.maxH,t.getSize(e.getEl()).height)}return n},repaint:function(){var e=this;return e.settings.multiline||(e.getEl().style.lineHeight=e.layoutRect().h+"px"),e._super()},text:function(e){var t=this;return t._rendered&&e&&this.innerHtml(t.encode(e)),t._super(e)},renderHtml:function(){var e=this,t=e.settings.forId;return'"}})}),r(Kt,[J],function(e){return e.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){var t=this;t._super(e),t.addClass("toolbar")},postRender:function(){var e=this;return e.items().addClass("toolbar-item"),e._super()}})}),r(Gt,[Kt],function(e){return e.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}})}),r(Xt,[kt,G,Gt],function(e,t,n){function r(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}var i=e.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),t.addClass("menubtn"),e.fixedWidth&&t.addClass("fixed-width"),t.aria("haspopup",!0),t.hasPopup=!0 -},showMenu:function(){var e=this,n=e.settings,r;return e.menu&&e.menu.visible()?e.hideMenu():(e.menu||(r=n.menu||[],r.length?r={type:"menu",items:r}:r.type=r.type||"menu",e.menu=t.create(r).parent(e).renderTo(),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control.parent()===e.menu&&(t.stopPropagation(),e.focus(),e.hideMenu())}),e.menu.on("select",function(){e.focus()}),e.menu.on("show hide",function(t){t.control==e.menu&&e.activeMenu("show"==t.type),e.aria("expanded","show"==t.type)}).fire("show")),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),void e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]))},hideMenu:function(){var e=this;e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide())},activeMenu:function(e){this.toggleClass("active",e)},renderHtml:function(){var e=this,t=e._id,r=e.classPrefix,i=e.settings.icon,o;return o=e.settings.image,o?(i="none","string"!=typeof o&&(o=window.getSelection?o[0]:o[1]),o=" style=\"background-image: url('"+o+"')\""):o="",i=e.settings.icon?r+"ico "+r+"i-"+i:"",e.aria("role",e.parent()instanceof n?"menuitem":"button"),'
'},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&r(t.target,e.getEl())&&(e.showMenu(),t.aria&&e.menu.items()[0].focus())}),e.on("mouseenter",function(t){var n=t.control,r=e.parent(),o;n&&r&&n instanceof i&&n.parent()==r&&(r.items().filter("MenuButton").each(function(e){e.hideMenu&&e!=n&&(e.menu&&e.menu.visible()&&(o=!0),e.hideMenu())}),o&&(n.focus(),n.showMenu()))}),e._super()},text:function(e){var t=this,n,r;if(t._rendered)for(r=t.getEl("open").getElementsByTagName("span"),n=0;n0&&(o=r[0].text,n._value=r[0].value),e.menu=r),e.text=e.text||o||r[0].text,n._super(e),n.addClass("listbox"),n.on("select",function(t){var r=t.control;a&&(t.lastControl=a),e.multiple?r.active(!r.active()):n.value(t.control.settings.value),a=r})},value:function(e){function t(e,n){e.items().each(function(e){i=e.value()===n,i&&(o=o||e.text()),e.active(i),e.menu&&t(e.menu,n)})}function n(t){for(var r=0;r'+("-"!==o?'\xa0":"")+("-"!==o?''+o+"":"")+(l?'
'+l+"
":"")+(r.menu?'
':"")+""},postRender:function(){var e=this,t=e.settings,n=t.textStyle;if("function"==typeof n&&(n=n.call(this)),n){var r=e.getEl("text");r&&r.setAttribute("style",n)}return e.on("mouseenter click",function(n){n.control===e&&(t.menu||"click"!==n.type?(e.showMenu(),n.aria&&e.menu.focus(!0)):(e.fire("select"),e.parent().hideAll()))}),e._super(),e},active:function(e){return"undefined"!=typeof e&&this.aria("checked",e),this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}})}),r(Zt,[rt,Qt,u],function(e,t,n){var r=e.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(e){var t=this;if(e.autohide=!0,e.constrainToViewport=!0,e.itemDefaults)for(var r=e.items,i=r.length;i--;)r[i]=n.extend({},e.itemDefaults,r[i]);t._super(e),t.addClass("menu")},repaint:function(){return this.toggleClass("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){var e=this;e.hideAll(),e.fire("select")},hideAll:function(){var e=this;return this.find("menuitem").exec("hideMenu"),e._super()},preRender:function(){var e=this;return e.items().each(function(t){var n=t.settings;return n.icon||n.selectable?(e._hasIcons=!0,!1):void 0}),e._super()}});return r}),r(en,[Tt],function(e){return e.extend({Defaults:{classes:"radio",role:"radio"}})}),r(tn,[Nt,Q],function(e,t){return e.extend({renderHtml:function(){var e=this,t=e.classPrefix;return e.addClass("resizehandle"),"both"==e.settings.direction&&e.addClass("resizehandle-both"),e.canFocus=!1,'
'},postRender:function(){var e=this;e._super(),e.resizeDragHelper=new t(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){"both"!=e.settings.direction&&(t.deltaX=0),e.fire("Resize",t)},stop:function(){e.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}})}),r(nn,[Nt],function(e){return e.extend({renderHtml:function(){var e=this;return e.addClass("spacer"),e.canFocus=!1,'
'}})}),r(rn,[Xt,Y],function(e,t){return e.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var e=this,n=e.getEl(),r=e.layoutRect(),i,o;return e._super(),i=n.firstChild,o=n.lastChild,t.css(i,{width:r.w-t.getSize(o).width,height:r.h-2}),t.css(o,{height:r.h-2}),e},activeMenu:function(e){var n=this;t.toggleClass(n.getEl().lastChild,n.classPrefix+"active",e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r,i=e.settings.icon;return r=e.settings.image,r?(i="none","string"!=typeof r&&(r=window.getSelection?r[0]:r[1]),r=" style=\"background-image: url('"+r+"')\""):r="",i=e.settings.icon?n+"ico "+n+"i-"+i:"",'
'},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(e){var n=e.target;if(e.control==this)for(;n;){if(e.aria&&"down"!=e.aria.key||"BUTTON"==n.nodeName&&-1==n.className.indexOf("open"))return e.stopImmediatePropagation(),void t.call(this,e);n=n.parentNode}}),delete e.settings.onclick,e._super()}})}),r(on,[Ut],function(e){return e.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"}})}),r(an,[et,Y],function(e,t){return e.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(e){var n;this.activeTabId&&(n=this.getEl(this.activeTabId),t.removeClass(n,this.classPrefix+"active"),n.setAttribute("aria-selected","false")),this.activeTabId="t"+e,n=this.getEl("t"+e),n.setAttribute("aria-selected","true"),t.addClass(n,this.classPrefix+"active"),this.items()[e].show().fire("showtab"),this.reflow(),this.items().each(function(t,n){e!=n&&t.hide()})},renderHtml:function(){var e=this,t=e._layout,n="",r=e.classPrefix;return e.preRender(),t.preRender(e),e.items().each(function(t,i){var o=e._id+"-t"+i;t.aria("role","tabpanel"),t.aria("labelledby",o),n+='"}),'
'+n+'
'+t.renderHtml(e)+"
"},postRender:function(){var e=this;e._super(),e.settings.activeTab=e.settings.activeTab||0,e.activateTab(e.settings.activeTab),this.on("click",function(t){var n=t.target.parentNode;if(t.target.parentNode.id==e._id+"-head")for(var r=n.childNodes.length;r--;)n.childNodes[r]==t.target&&e.activateTab(r)})},initLayoutRect:function(){var e=this,n,r,i;r=t.getSize(e.getEl("head")).width,r=0>r?0:r,i=0,e.items().each(function(e){r=Math.max(r,e.layoutRect().minW),i=Math.max(i,e.layoutRect().minH)}),e.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=r,e.settings.h=i,e.layoutRect({x:0,y:0,w:r,h:i})});var o=t.getSize(e.getEl("head")).height;return e.settings.minWidth=r,e.settings.minHeight=i+o,n=e._super(),n.deltaH+=o,n.innerH=n.h-n.deltaH,n}})}),r(sn,[Nt,Y],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t._value=e.value||"",t.addClass("textbox"),e.multiline?t.addClass("multiline"):t.on("keydown",function(e){13==e.keyCode&&t.parents().reverse().each(function(t){return e.preventDefault(),t.hasEventListeners("submit")&&t.toJSON?(t.fire("submit",{data:t.toJSON()}),!1):void 0})})},disabled:function(e){var t=this;return t._rendered&&"undefined"!=typeof e&&(t.getEl().disabled=e),t._super(e)},value:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t._rendered&&(t.getEl().value=e),t):t._rendered?t.getEl().value:t._value},repaint:function(){var e=this,t,n,r,i=0,o=0,a;t=e.getEl().style,n=e._layoutRect,a=e._lastRepaintRect||{};var s=document;return!e.settings.multiline&&s.all&&(!s.documentMode||s.documentMode<=8)&&(t.lineHeight=n.h-o+"px"),r=e._borderBox,i=r.left+r.right+8,o=r.top+r.bottom+(e.settings.multiline?8:0),n.x!==a.x&&(t.left=n.x+"px",a.x=n.x),n.y!==a.y&&(t.top=n.y+"px",a.y=n.y),n.w!==a.w&&(t.width=n.w-i+"px",a.w=n.w),n.h!==a.h&&(t.height=n.h-o+"px",a.h=n.h),e._lastRepaintRect=a,e.fire("repaint",{},!1),e},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.encode(e._value,!1),i="";return"spellcheck"in n&&(i+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(i+=' maxlength="'+n.maxLength+'"'),n.size&&(i+=' size="'+n.size+'"'),n.subtype&&(i+=' type="'+n.subtype+'"'),e.disabled()&&(i+=' disabled="disabled"'),n.multiline?'":'"},postRender:function(){var e=this;return t.on(e.getEl(),"change",function(t){e.fire("change",t)}),e._super()},remove:function(){t.off(this.getEl()),this._super()}})}),r(ln,[Y,K],function(e,t){return function(n,r){var i=this,o,a=t.classPrefix;i.show=function(t){return i.hide(),o=!0,window.setTimeout(function(){o&&n.appendChild(e.createFragment('
'))},t||0),i},i.hide=function(){var e=n.lastChild;return e&&-1!=e.className.indexOf("throbber")&&e.parentNode.removeChild(e),o=!1,i}}}),a([l,c,u,d,f,p,h,m,g,y,b,C,_,E,N,k,S,T,R,A,B,D,L,H,M,O,I,F,z,W,V,U,$,q,j,Y,K,G,X,J,Q,Z,et,tt,nt,rt,it,ot,at,st,lt,ct,ut,dt,ft,pt,ht,mt,gt,vt,yt,bt,Ct,xt,wt,_t,Et,Nt,kt,St,Tt,Rt,At,Bt,Dt,Lt,Ht,Mt,Pt,Ot,It,Ft,zt,Wt,Vt,Ut,$t,qt,jt,Yt,Kt,Gt,Xt,Jt,Qt,Zt,en,tn,nn,rn,on,an,sn,ln])}(this); \ No newline at end of file diff --git a/app/lib/angular/ui-bootstrap-tpls.min.js b/app/lib/ui-bootstrap-tpls.min.js similarity index 100% rename from app/lib/angular/ui-bootstrap-tpls.min.js rename to app/lib/ui-bootstrap-tpls.min.js diff --git a/app/lib/angular/ui-bootstrap.min.js b/app/lib/ui-bootstrap.min.js similarity index 100% rename from app/lib/angular/ui-bootstrap.min.js rename to app/lib/ui-bootstrap.min.js diff --git a/app/lib/ui-odometer.min.js b/app/lib/ui-odometer.min.js new file mode 100644 index 00000000..418dd34d --- /dev/null +++ b/app/lib/ui-odometer.min.js @@ -0,0 +1,34 @@ +/** + * https://github.com/HubSpot/odometer + * https://github.com/wallin/angular-odometer + */ +angular.module('ui.odometer', []) +.provider('odometerOptions', function() { + var self; + self = this; + self.defaults = { + value: 0 + }; + this.$get = function() { + return angular.copy(self.defaults); + }; + return this; +}) +.directive('odometer', [ + 'odometerOptions', + function(odometerOptions) { + return { + restrict: 'A', + link: function(scope, elm, attrs) { + var odometer, opts; + opts = scope.$eval(attrs.odometerOptions) || {}; + angular.extend(opts, odometerOptions); + opts.el = elm[0]; + odometer = new Odometer(opts); + scope.$watch(attrs.odometer, function(newVal) { + odometer.update(newVal); + }); + } + }; + } +]); \ No newline at end of file diff --git a/app/robots.txt b/app/robots.txt index 94174950..13746138 100644 --- a/app/robots.txt +++ b/app/robots.txt @@ -1,3 +1,4 @@ # robotstxt.org User-agent: * +Disallow: / \ No newline at end of file diff --git a/app/scripts/category/controller/edit.js b/app/scripts/category/controller/edit.js index 562ff9ad..6f107ce0 100644 --- a/app/scripts/category/controller/edit.js +++ b/app/scripts/category/controller/edit.js @@ -1,360 +1,256 @@ -(function (define, $) { - "use strict"; - - define(["category/init"], function (categoryModule) { - categoryModule - .controller("categoryEditController", [ - "$scope", - "$routeParams", - "$location", - "$q", - "$categoryApiService", - "$designImageService", - "$dashboardUtilsService", - function ($scope, $routeParams, $location, $q, $categoryApiService, $designImageService, $dashboardUtilsService) { - var categoryId, rememberProducts, oldProducts, getDefaultCategory, addImageManagerAttribute; - - // Initialize SEO - if (typeof $scope.initSeo === "function") { - $scope.initSeo("category"); - } +angular.module("categoryModule") + +.controller("categoryEditController", [ +"$scope", +"$routeParams", +"$location", +"$q", +"$categoryApiService", +"$dashboardUtilsService", +function ($scope, $routeParams, $location, $q, $categoryApiService, $dashboardUtilsService) { + var categoryId, rememberProducts, oldProducts, getDefaultCategory; + + // Initialize SEO + if (typeof $scope.initSeo === "function") { + $scope.initSeo("category"); + } + + categoryId = $routeParams.id; + + if (!categoryId && categoryId !== "new") { + $location.path("/categories"); + } + + if (categoryId === "new") { + categoryId = null; + } + + oldProducts = []; + + getDefaultCategory = function () { + return { + name: "", + "parent_id": "", + "products": [] + }; + }; + + /** + * Current selected category + * + * @type {Object} + */ + $scope.category = {}; + + /** + * Gets list all attributes of category + */ + $categoryApiService.attributesInfo().$promise.then(function (response) { + var result = response.result || []; + $scope.attributes = result; + }); - categoryId = $routeParams.id; + if (null !== categoryId) { + $categoryApiService.getCategory({"categoryID": categoryId}).$promise.then(function (response) { + var result = response.result || {}; + $scope.category = result; + rememberProducts(); + $scope.category.parent = $scope.category['parent_id']; + }); + } - if (!categoryId && categoryId !== "new") { - $location.path("/categories"); - } + $scope.back = function () { + $location.path("/categories"); + }; - if (categoryId === "new") { - categoryId = null; - } + $scope.saveProducts = function () { + var defer, categoryId, addProduct, removeProduct; + defer = $q.defer(); - oldProducts = []; - - addImageManagerAttribute = function () { - if(typeof $scope.attributes !== "undefined" && typeof $scope.category._id !== "undefined") { - $scope.attributes.unshift({ - Attribute: "image", - Collection: "category", - Default: "", - Editors: "picture_manager", - Group: "Picture", - IsRequired: false, - IsStatic: false, - Label: "Image", - Model: "Category", - Options: "", - Type: "text" - }); - } - }; - - getDefaultCategory = function () { - return { - name: "", - "parent_id": "", - "products": [] - }; - }; - - /** - * Current selected category - * - * @type {Object} - */ - $scope.category = {}; - - /** - * Gets list all attributes of category - */ - $categoryApiService.attributesInfo().$promise.then(function (response) { - var result = response.result || []; - $scope.attributes = result; - addImageManagerAttribute(); - }); - - if (null !== categoryId) { - $categoryApiService.getCategory({"categoryID": categoryId}).$promise.then(function (response) { - var result = response.result || {}; - $scope.category = result; - rememberProducts(); - $scope.category.parent = $scope.category['parent_id']; - addImageManagerAttribute(); - }); - } + if (typeof $scope.category !== "undefined") { + categoryId = $scope.category.id || $scope.category._id; + } - $scope.back = function () { - $location.path("/categories"); - }; - $scope.saveProducts = function () { - var defer, categoryId, addProduct, removeProduct; - defer = $q.defer(); + addProduct = function () { + var _addProduct = function (index) { + var addDefer = $q.defer(); - if (typeof $scope.category !== "undefined") { - categoryId = $scope.category.id || $scope.category._id; - } + var prodId = $scope.category.products[index]; + if (typeof prodId === "object") { + prodId = prodId._id; + } - addProduct = function () { - var _addProduct = function (index) { - var addDefer = $q.defer(); - - var prodId = $scope.category.products[index]; - - if (typeof prodId === "object") { - prodId = prodId._id; - } - - if (oldProducts.indexOf(prodId) === -1) { - $categoryApiService.addProduct({ - categoryId: categoryId, - productId: prodId - }).$promise.then(function () { - addDefer.resolve(prodId); - } - ); - } - - return addDefer.promise; - }; - - var callback = function (prodId) { - oldProducts.push(prodId); - }; - - if ($scope.category.products instanceof Array) { - for (var i = 0; i < $scope.category.products.length; i += 1) { - _addProduct(i).then(callback); - } - } - - defer.resolve(true); - }; - - removeProduct = function (cb) { - var i, oldProdId, _remove, callback; - - var getProductIds = function (products) { - var ids = []; - - for (var i = 0; i < products.length; i += 1) { - if(typeof products[i] === "string"){ - ids.push(products[i]); - } else if(typeof products[i] === "object"){ - ids.push(products[i]._id); - } - } - - return ids; - }; - - callback = function (index) { - oldProducts.splice(index, 1); - }; - - _remove = function (index) { - var removeDefer = $q.defer(); - - oldProdId = oldProducts[index]; - - if (-1 === getProductIds($scope.category.products).indexOf(oldProdId)) { - $categoryApiService.removeProduct({ - categoryID: categoryId, - productID: oldProdId - }).$promise.then(function () { - removeDefer.resolve(index); - } - ); - } - - return removeDefer.promise; - }; - - for (i = 0; i < oldProducts.length; i += 1) { - _remove(i).then(callback); - } - cb(); - }; - - removeProduct(addProduct); - - return defer.promise; - }; - - /** - * Event handler to save the category data. - * Creates new category if ID in current category is empty OR updates current category if ID is set - */ - $scope.save = function () { - $('[ng-click="save()"]').addClass('disabled').append('').siblings('.btn').addClass('disabled'); - - var id, defer, saveSuccess, saveError, updateSuccess, updateError; - defer = $q.defer(); - - if (typeof $scope.category !== "undefined") { - id = $scope.category.id || $scope.category._id; + if (oldProducts.indexOf(prodId) === -1) { + $categoryApiService.addProduct({ + categoryId: categoryId, + productId: prodId + }).$promise.then(function () { + addDefer.resolve(prodId); } + ); + } - /** - * - * @param response - */ - saveSuccess = function (response) { - if (response.error === null) { - $scope.category = response.result || getDefaultCategory(); - $scope.message = $dashboardUtilsService.getMessage(null, 'success', 'Category was created successfully'); - addImageManagerAttribute(); - defer.resolve(true); - } - $('[ng-click="save()"]').removeClass('disabled').children('i').remove(); - $('[ng-click="save()"]').siblings('.btn').removeClass('disabled'); - }; - - /** - * - * @param response - */ - saveError = function () { - defer.resolve(false); - $('[ng-click="save()"]').removeClass('disabled').children('i').remove(); - $('[ng-click="save()"]').siblings('.btn').removeClass('disabled'); - }; - - /** - * - * @param response - */ - updateSuccess = function (response) { - if (response.error === null) { - $scope.category = response.result || getDefaultCategory(); - $scope.message = $dashboardUtilsService.getMessage(null, 'success', 'Product was updated successfully'); - defer.resolve(true); - $('[ng-click="save()"]').removeClass('disabled').children('i').remove(); - $('[ng-click="save()"]').siblings('.btn').removeClass('disabled'); - } - }; - - /** - * - * @param response - */ - updateError = function () { - defer.resolve(false); - $('[ng-click="save()"]').removeClass('disabled').children('i').remove(); - $('[ng-click="save()"]').siblings('.btn').removeClass('disabled'); - }; - - delete $scope.category.parent; - delete $scope.category.path; - - if (!id) { - if ($scope.category.name !== "") { - $categoryApiService.save($scope.category, saveSuccess, saveError); - } - } else { - $scope.category.id = id; - $scope.saveProducts().then(function () { - delete $scope.category.products; - $categoryApiService.update($scope.category, updateSuccess, updateError); - }); + return addDefer.promise; + }; - } + var callback = function (prodId) { + oldProducts.push(prodId); + }; - return defer.promise; - }; - - rememberProducts = function () { - var i, prod; - oldProducts = []; - if (typeof $scope.category !== "undefined" && - $scope.category.products instanceof Array && - $scope.category.products.length !== -1) { - for (i = 0; i < $scope.category.products.length; i += 1) { - prod = $scope.category.products[i]; - oldProducts.push(prod._id); - } - } - }; - - //----------------- - // IMAGE FUNCTIONS - //----------------- - $scope.reloadImages = function () { - if ($scope.category !== undefined && $scope.category._id !== undefined) { - // taking media patch for new category - $categoryApiService.getImagePath({"categoryID": $scope.category._id}).$promise.then( - function (response) { - $scope.imagesPath = response.result || ""; - }); - // taking registered images for category - $categoryApiService.listImages({"categoryID": $scope.category._id}).$promise.then( - function (response) { - $scope.productImages = response.result || []; - }); - $scope.category['default_image'] = $scope.category['image']; - } - }; - $scope.$watch("category", function () { - $scope.reloadImages(); - }); - /** - * Adds file to category - * - * @param fileElementId - */ - $scope.imageAdd = function (fileElementId) { - var file = document.getElementById(fileElementId); - var pid = $scope.category._id, mediaName = file.files[0].name; - var postData = new FormData(); - postData.append("file", file.files[0]); - if (pid !== undefined) { - $categoryApiService.addImage({"categoryID": pid, "mediaName": mediaName}, postData) - .$promise.then(function () { - $scope.reloadImages(); - }); - } - }; - /** - * Removes image from category (from category folder) and sends request to saves - * - * @param {string} selected - image name - */ - $scope.imageRemove = function (selected) { - var pid = $scope.category._id, mediaName = selected; - if (pid !== undefined && selected !== undefined) { - $categoryApiService.removeImage({"categoryID": pid, "mediaName": mediaName}) - .$promise.then(function () { - $scope.selectedImage = undefined; - $scope.reloadImages(); - $scope.category['image'] = ""; - $scope.save(); - }); - } - }; - /** - * Sets image as image default - * - * @param {string} selected - image name - */ - $scope.imageDefault = function (selected) { - $scope.category['image'] = selected; - }; - /** - * Returns full path to image - * - * @param {string} path - the destination path to category folder - * @param {string} image - image name - * @returns {string} - full path to image - */ - $scope.getImage = function (image) { - return $designImageService.getFullImagePath("", image); - }; + if ($scope.category.products instanceof Array) { + for (var i = 0; i < $scope.category.products.length; i += 1) { + _addProduct(i).then(callback); + } + } + + defer.resolve(true); + }; + + removeProduct = function (cb) { + var i, oldProdId, _remove, callback; + + var getProductIds = function (products) { + var ids = []; + for (var i = 0; i < products.length; i += 1) { + if(typeof products[i] === "string"){ + ids.push(products[i]); + } else if(typeof products[i] === "object"){ + ids.push(products[i]._id); + } } - ] - ); - return categoryModule; - }); -})(window.define, jQuery); + return ids; + }; + + callback = function (index) { + oldProducts.splice(index, 1); + }; + + _remove = function (index) { + var removeDefer = $q.defer(); + + oldProdId = oldProducts[index]; + + if (-1 === getProductIds($scope.category.products).indexOf(oldProdId)) { + $categoryApiService.removeProduct({ + categoryID: categoryId, + productID: oldProdId + }).$promise.then(function () { + removeDefer.resolve(index); + } + ); + } + + return removeDefer.promise; + }; + + for (i = 0; i < oldProducts.length; i += 1) { + _remove(i).then(callback); + } + cb(); + }; + + removeProduct(addProduct); + + return defer.promise; + }; + + /** + * Event handler to save the category data. + * Creates new category if ID in current category is empty OR updates current category if ID is set + */ + $scope.save = function () { + $('[ng-click="save()"]').addClass('disabled').append('').siblings('.btn').addClass('disabled'); + + var id, defer, saveSuccess, saveError, updateSuccess, updateError; + defer = $q.defer(); + + if (typeof $scope.category !== "undefined") { + id = $scope.category.id || $scope.category._id; + } + + /** + * + * @param response + */ + saveSuccess = function (response) { + if (response.error === null) { + $scope.category = response.result || getDefaultCategory(); + $scope.message = $dashboardUtilsService.getMessage(null, 'success', 'Category was created successfully'); + defer.resolve(true); + } + $('[ng-click="save()"]').removeClass('disabled').children('i').remove(); + $('[ng-click="save()"]').siblings('.btn').removeClass('disabled'); + }; + + /** + * + * @param response + */ + saveError = function () { + defer.resolve(false); + $('[ng-click="save()"]').removeClass('disabled').children('i').remove(); + $('[ng-click="save()"]').siblings('.btn').removeClass('disabled'); + }; + + /** + * + * @param response + */ + updateSuccess = function (response) { + if (response.error === null) { + $scope.category = response.result || getDefaultCategory(); + $scope.message = $dashboardUtilsService.getMessage(null, 'success', 'Product was updated successfully'); + defer.resolve(true); + $('[ng-click="save()"]').removeClass('disabled').children('i').remove(); + $('[ng-click="save()"]').siblings('.btn').removeClass('disabled'); + } + }; + + /** + * + * @param response + */ + updateError = function () { + defer.resolve(false); + $('[ng-click="save()"]').removeClass('disabled').children('i').remove(); + $('[ng-click="save()"]').siblings('.btn').removeClass('disabled'); + }; + + delete $scope.category.parent; + delete $scope.category.path; + + if (!id) { + if ($scope.category.name !== "") { + $categoryApiService.save($scope.category, saveSuccess, saveError); + } + } else { + $scope.category.id = id; + $scope.saveProducts().then(function () { + delete $scope.category.products; + $categoryApiService.update($scope.category, updateSuccess, updateError); + }); + + } + + return defer.promise; + }; + + // REFACTOR: this can't be right + rememberProducts = function () { + var i, prod; + oldProducts = []; + if (typeof $scope.category !== "undefined" && + $scope.category.products instanceof Array && + $scope.category.products.length !== -1) { + for (i = 0; i < $scope.category.products.length; i += 1) { + prod = $scope.category.products[i]; + oldProducts.push(prod._id); + } + } + }; + +}]); diff --git a/app/scripts/category/controller/list.js b/app/scripts/category/controller/list.js index ec267617..f59bbd76 100644 --- a/app/scripts/category/controller/list.js +++ b/app/scripts/category/controller/list.js @@ -1,179 +1,170 @@ -(function (define, $) { - "use strict"; - - define(["category/init"], function (categoryModule) { - categoryModule - .controller("categoryListController", [ - "$scope", - "$location", - "$routeParams", - "$q", - "$dashboardListService", - "$categoryApiService", - "COUNT_ITEMS_PER_PAGE", - function ($scope, $location, $routeParams, $q, DashboardListService, $categoryApiService, COUNT_ITEMS_PER_PAGE) { - var serviceList, getCategoriesList, getCategoryCount, getAttributeList, showColumns; - - // Initialize SEO - if (typeof $scope.initSeo === "function") { - $scope.initSeo("category"); +angular.module("categoryModule") + +.controller("categoryListController", [ +"$scope", +"$location", +"$routeParams", +"$q", +"$dashboardListService", +"$categoryApiService", +"COUNT_ITEMS_PER_PAGE", +function ($scope, $location, $routeParams, $q, DashboardListService, $categoryApiService, COUNT_ITEMS_PER_PAGE) { + var serviceList, getCategoriesList, getCategoryCount, getAttributeList, showColumns; + + // Initialize SEO + if (typeof $scope.initSeo === "function") { + $scope.initSeo("category"); + } + + serviceList = new DashboardListService(); + showColumns = { + 'name' : {'type' : 'select-link', 'label' : 'Name'}, + 'enabled' : {} + }; + + $scope.idsSelectedRows = {}; + + /** + * Gets list of categories + */ + getCategoriesList = function () { + var params = $location.search(); + params["extra"] = serviceList.getExtraFields(); + $categoryApiService.categoryList(params).$promise.then( + function (response) { + var result, i; + $scope.categoriesTmp = []; + result = response.result || []; + for (i = 0; i < result.length; i += 1) { + $scope.categoriesTmp.push(result[i]); + } + } + ); + }; + + /** + * Gets count of categories + */ + getCategoryCount = function () { + $categoryApiService.getCount($location.search()).$promise.then( + function (response) { + if (response.error === null) { + $scope.count = response.result; + } else { + $scope.count = 0; + } + } + ); + }; + + getAttributeList = function () { + $categoryApiService.attributesInfo().$promise.then( + function (response) { + var result = response.result || []; + serviceList.init('categories'); + $scope.attributes = result; + serviceList.setAttributes($scope.attributes); + $scope.fields = serviceList.getFields(showColumns); + getCategoriesList(); + } + ); + }; + + /** + * Handler event when selecting the category in the list + * + * @param id + */ + $scope.select = function (id) { + $location.path("/category/" + id); + + }; + + /** + * + */ + $scope.create = function () { + $location.path("/category/new"); + }; + + var hasSelectedRows = function () { + var result = false; + for (var _id in $scope.idsSelectedRows) { + if ($scope.idsSelectedRows.hasOwnProperty(_id) && $scope.idsSelectedRows[_id]) { + result = true; + } + } + return result; + }; + + /** + * Removes category by ID + * + */ + $scope.remove = function () { + + if (!hasSelectedRows()) { + return true; + } + + var i, answer, _remove; + answer = window.confirm("Please confirm you want to remove this category."); + _remove = function (id) { + var defer = $q.defer(); + + $categoryApiService.remove({"categoryID": id}, + function (response) { + if (response.result === "ok") { + defer.resolve(id); + } else { + defer.resolve(false); } - - serviceList = new DashboardListService(); - showColumns = { - 'name' : {'type' : 'select-link', 'label' : 'Name'}, - 'enabled' : {} - }; - - $scope.idsSelectedRows = {}; - - /** - * Gets list of categories - */ - getCategoriesList = function () { - var params = $location.search(); - params["extra"] = serviceList.getExtraFields(); - $categoryApiService.categoryList(params).$promise.then( - function (response) { - var result, i; - $scope.categoriesTmp = []; - result = response.result || []; - for (i = 0; i < result.length; i += 1) { - $scope.categoriesTmp.push(result[i]); - } - } - ); - }; - - /** - * Gets count of categories - */ - getCategoryCount = function () { - $categoryApiService.getCount($location.search()).$promise.then( - function (response) { - if (response.error === null) { - $scope.count = response.result; - } else { - $scope.count = 0; - } - } - ); - }; - - getAttributeList = function () { - $categoryApiService.attributesInfo().$promise.then( - function (response) { - var result = response.result || []; - serviceList.init('categories'); - $scope.attributes = result; - serviceList.setAttributes($scope.attributes); - $scope.fields = serviceList.getFields(showColumns); - getCategoriesList(); - } - ); - }; - - /** - * Handler event when selecting the category in the list - * - * @param id - */ - $scope.select = function (id) { - $location.path("/category/" + id); - - }; - - /** - * - */ - $scope.create = function () { - $location.path("/category/new"); - }; - - var hasSelectedRows = function () { - var result = false; - for (var _id in $scope.idsSelectedRows) { - if ($scope.idsSelectedRows.hasOwnProperty(_id) && $scope.idsSelectedRows[_id]) { - result = true; - } - } - return result; - }; - - /** - * Removes category by ID - * - */ - $scope.remove = function () { - - if (!hasSelectedRows()) { - return true; - } - - var i, answer, _remove; - answer = window.confirm("Please confirm you want to remove this category."); - _remove = function (id) { - var defer = $q.defer(); - - $categoryApiService.remove({"categoryID": id}, - function (response) { - if (response.result === "ok") { - defer.resolve(id); - } else { - defer.resolve(false); - } - } - ); - - return defer.promise; - }; - if (answer) { - $('[ng-click="parent.remove()"]').addClass('disabled').append('').siblings('.btn').addClass('disabled'); - var callback = function (response) { - if (response) { - for (i = 0; i < $scope.categories.length; i += 1) { - if ($scope.categories[i].ID === response) { - $scope.categories.splice(i, 1); - } - } - } - }; - - for (var id in $scope.idsSelectedRows) { - if ($scope.idsSelectedRows.hasOwnProperty(id) && true === $scope.idsSelectedRows[id]) { - _remove(id).then(callback); - } - } - } - $('[ng-click="parent.remove()"]').removeClass('disabled').children('i').remove(); - $('[ng-click="parent.remove()"]').siblings('.btn').removeClass('disabled'); - - }; - - $scope.$watch(function () { - if (typeof $scope.attributes !== "undefined" && typeof $scope.categoriesTmp !== "undefined") { - return true; - } - - return false; - }, function (isInitAll) { - if (isInitAll) { - $scope.categories = serviceList.getList($scope.categoriesTmp); - } - }); - - $scope.init = (function () { - if (JSON.stringify({}) === JSON.stringify($location.search())) { - $location.search("limit", "0," + COUNT_ITEMS_PER_PAGE); - return; + } + ); + + return defer.promise; + }; + if (answer) { + $('[ng-click="parent.remove()"]').addClass('disabled').append('').siblings('.btn').addClass('disabled'); + var callback = function (response) { + if (response) { + for (i = 0; i < $scope.categories.length; i += 1) { + if ($scope.categories[i].ID === response) { + $scope.categories.splice(i, 1); } - getCategoryCount(); - getAttributeList(); - })(); + } } - ] - ); + }; - return categoryModule; + for (var id in $scope.idsSelectedRows) { + if ($scope.idsSelectedRows.hasOwnProperty(id) && true === $scope.idsSelectedRows[id]) { + _remove(id).then(callback); + } + } + } + $('[ng-click="parent.remove()"]').removeClass('disabled').children('i').remove(); + $('[ng-click="parent.remove()"]').siblings('.btn').removeClass('disabled'); + + }; + + $scope.$watch(function () { + if (typeof $scope.attributes !== "undefined" && typeof $scope.categoriesTmp !== "undefined") { + return true; + } + + return false; + }, function (isInitAll) { + if (isInitAll) { + $scope.categories = serviceList.getList($scope.categoriesTmp); + } }); -})(window.define, jQuery); + + $scope.init = (function () { + if (JSON.stringify({}) === JSON.stringify($location.search())) { + $location.search("limit", "0," + COUNT_ITEMS_PER_PAGE); + return; + } + getCategoryCount(); + getAttributeList(); + })(); +}]); diff --git a/app/scripts/category/init.js b/app/scripts/category/init.js index 98ac0499..4acb6ee6 100644 --- a/app/scripts/category/init.js +++ b/app/scripts/category/init.js @@ -1,41 +1,16 @@ -(function (define) { - "use strict"; +angular.module("categoryModule", ["ngRoute", "ngResource", "designModule"]) - define([ - "angular", - "angular-route", - "angular-resource" - ], - function (angular) { - /* - * Angular "categoryModule" declaration - */ - angular.module.categoryModule = angular.module("categoryModule", ["ngRoute", "ngResource", "designModule"]) - - /* - * Basic routing configuration - */ - .config(["$routeProvider", function ($routeProvider) { - $routeProvider - .when("/categories", { - templateUrl: angular.getTheme("category/list.html"), - controller: "categoryListController" - }) - .when("/category/:id", { - templateUrl: angular.getTheme("category/edit.html"), - controller: "categoryEditController" - }); - }]) - - .run(["$designService", "$route", "$dashboardSidebarService", - function ($designService, $route, $dashboardSidebarService) { - - // Adds item in the left sidebar - $dashboardSidebarService.addItem("/categories", "Categories", "/categories", "fa fa-th-list", 6); - } - ]); - - return angular.module.categoryModule; +/* + * Basic routing configuration + */ +.config(["$routeProvider", function ($routeProvider) { + $routeProvider + .when("/categories", { + templateUrl: "/themes/views/category/list.html", + controller: "categoryListController" + }) + .when("/category/:id", { + templateUrl: "/themes/views/category/edit.html", + controller: "categoryEditController" }); - -})(window.define); \ No newline at end of file +}]); diff --git a/app/scripts/category/module.js b/app/scripts/category/module.js deleted file mode 100644 index a84778ee..00000000 --- a/app/scripts/category/module.js +++ /dev/null @@ -1,18 +0,0 @@ -(function (define) { - "use strict"; - - /* - * requireJS module entry point - * (to use that module you should include it to main.js) - */ - define([ - "category/service/api", - "category/controller/list", - "category/controller/edit" - ], - function (categoryModule) { - - return categoryModule; - }); - -})(window.define); \ No newline at end of file diff --git a/app/scripts/category/service/api.js b/app/scripts/category/service/api.js index 8f26036f..ec573933 100644 --- a/app/scripts/category/service/api.js +++ b/app/scripts/category/service/api.js @@ -1,92 +1,69 @@ -(function (define) { - "use strict"; +angular.module("categoryModule") +/* +* $productApiService interaction service +*/ +.service("$categoryApiService", ["$resource", "REST_SERVER_URI", function ($resource, REST_SERVER_URI) { + return $resource(REST_SERVER_URI, {}, { + "attributesInfo": { + method: "GET", + url: REST_SERVER_URI + "/categories/attributes" + }, + "getCategory": { + method: "GET", + url: REST_SERVER_URI + "/category/:categoryID" + }, + "categoryList": { + method: "GET", + url: REST_SERVER_URI + "/categories" + }, + "getCount": { + method: "GET", + params: { action: "count" }, + url: REST_SERVER_URI + "/categories" + }, + "save": { + method: "POST", + url: REST_SERVER_URI + "/category" + }, + "remove": { + method: "DELETE", + url: REST_SERVER_URI + "/category/:categoryID" + }, + "update": { + method: "PUT", + params: { categoryID: "@id" }, + url: REST_SERVER_URI + "/category/:categoryID" + }, + "removeImage": { + method: "DELETE", + url: REST_SERVER_URI + "/category/:categoryID/media/image/:mediaName" + }, + // http://stackoverflow.com/questions/13963022/angularjs-how-to-implement-a-simple-file-upload-with-multipart-form + "addImage": { + method: "POST", + params: { categoryID: "@categoryId", mediaName: "@mediaName" }, + url: REST_SERVER_URI + "/category/:categoryID/media/image/:mediaName", - /* - * HTML top page header manipulation stuff - */ - define(["category/init"], function (productModule) { - productModule - /* - * $productApiService interaction service - */ - .service("$categoryApiService", ["$resource", "REST_SERVER_URI", function ($resource, REST_SERVER_URI) { - return $resource(REST_SERVER_URI, {}, { - "attributesInfo": { - method: "GET", - url: REST_SERVER_URI + "/categories/attributes" - }, - "getCategory": { - method: "GET", - url: REST_SERVER_URI + "/category/:categoryID" - }, - "categoryList": { - method: "GET", - url: REST_SERVER_URI + "/categories" - }, - "getCount": { - method: "GET", - params: { action: "count" }, - url: REST_SERVER_URI + "/categories" - }, - "save": { - method: "POST", - url: REST_SERVER_URI + "/category" - }, - "remove": { - method: "DELETE", - url: REST_SERVER_URI + "/category/:categoryID" - }, - "update": { - method: "PUT", - params: { categoryID: "@id" }, - url: REST_SERVER_URI + "/category/:categoryID" - }, - "getImage": { - method: "GET", - url: REST_SERVER_URI + "/category/:categoryID/media/image/:mediaName" - }, - "getImagePath": { - method: "GET", - url: REST_SERVER_URI + "/category/:categoryID/mediapath/image" - }, - "listImages": { - method: "GET", - url: REST_SERVER_URI + "/category/:categoryID/media/image" - }, - "removeImage": { - method: "DELETE", - url: REST_SERVER_URI + "/category/:categoryID/media/image/:mediaName" - }, - "addImage": { // http://stackoverflow.com/questions/13963022/angularjs-how-to-implement-a-simple-file-upload-with-multipart-form - method: "POST", - params: { categoryID: "@categoryId", mediaName: "@mediaName" }, - url: REST_SERVER_URI + "/category/:categoryID/media/image/:mediaName", + headers: {"Content-Type": undefined }, + transformRequest: angular.identity // jshint ignore:line + }, - headers: {"Content-Type": undefined }, - transformRequest: angular.identity // jshint ignore:line - }, - - // Products - "addProduct": { - method: "POST", - params: { - categoryID: "@categoryId", - productID: "@productId" - }, - url: REST_SERVER_URI + "/category/:categoryID/product/:productID" - }, - "removeProduct": { - method: "DELETE", - url: REST_SERVER_URI + "/category/:categoryID/product/:productID" - }, - "getProducts": { - method: "GET", - url: REST_SERVER_URI + "/category/:categoryID/products" - } - }); - }]); - - return productModule; + // Products + "addProduct": { + method: "POST", + params: { + categoryID: "@categoryId", + productID: "@productId" + }, + url: REST_SERVER_URI + "/category/:categoryID/product/:productID" + }, + "removeProduct": { + method: "DELETE", + url: REST_SERVER_URI + "/category/:categoryID/product/:productID" + }, + "getProducts": { + method: "GET", + url: REST_SERVER_URI + "/category/:categoryID/products" + } }); - -})(window.define); +}]); diff --git a/app/scripts/cms/controller/blockEdit.js b/app/scripts/cms/controller/blockEdit.js index d9f10105..43588604 100644 --- a/app/scripts/cms/controller/blockEdit.js +++ b/app/scripts/cms/controller/blockEdit.js @@ -1,147 +1,127 @@ -(function (define, $) { - "use strict"; - - define(["cms/init"], function (cmsModule) { - cmsModule - .controller("cmsBlockEditController", [ - "$scope", - "$routeParams", - "$location", - "$q", - "$cmsApiService", - "$dashboardUtilsService", - function ($scope, $routeParams, $location, $q, $cmsApiService, $dashboardUtilsService) { - var blockId, getDefaultBlock; - - blockId = $routeParams.id; - - if (!blockId && blockId !== "new") { - $location.path("/cms/blocks"); - } - - if (blockId === "new") { - blockId = null; - } - - getDefaultBlock = function () { - return { - "id": "", - "url": "", - "identifier": "", - "content": "", - "created_at": "", - "updated_at": "" - }; - }; - - $scope.count = 100; - - /** - * Current selected cms - * - * @type {Object} - */ - $scope.block = getDefaultBlock(); - - /** - * Gets list all attributes of cms - */ - $cmsApiService.blockAttributes().$promise.then( - function (response) { - var result = response.result || []; - $scope.attributes = result; - } - ); - - if (null !== blockId) { - $cmsApiService.blockGet({"blockID": blockId}).$promise.then( - function (response) { - var result = response.result || {}; - $scope.block = result; - } - ); - } - - $scope.back = function () { - $location.path("/cms/blocks"); - }; - - /** - * Event handler to save the cms data. - * Creates new cms if ID in current cms is empty OR updates current cms if ID is set - */ - $scope.save = function () { - $('[ng-click="save()"]').addClass('disabled').append('').siblings('.btn').addClass('disabled'); - var id, defer, saveSuccess, saveError, updateSuccess, updateError; - defer = $q.defer(); - - if (typeof $scope.block !== "undefined") { - id = $scope.block.id || $scope.block._id; - } - - /** - * - * @param response - */ - saveSuccess = function (response) { - if (response.error === null) { - var result = response.result || getDefaultBlock(); - $scope.block._id = response.result._id; - $scope.message = $dashboardUtilsService.getMessage(null, 'success', 'Block was saved successfully'); - defer.resolve(result); - - $('[ng-click="save()"]').removeClass('disabled').children('i').remove(); - $('[ng-click="save()"]').siblings('.btn').removeClass('disabled'); - } - }; - - /** - * - */ - saveError = function () { - $('[ng-click="save()"]').removeClass('disabled').children('i').remove(); - $('[ng-click="save()"]').siblings('.btn').removeClass('disabled'); - defer.resolve(false); - }; - - /** - * - * @param response - */ - updateSuccess = function (response) { - if (response.error === null) { - var result = response.result || getDefaultBlock(); - $scope.message = $dashboardUtilsService.getMessage(null, 'success', 'Block was updated successfully'); - $('[ng-click="save()"]').removeClass('disabled').children('i').remove(); - $('[ng-click="save()"]').siblings('.btn').removeClass('disabled'); - defer.resolve(result); - } - }; - - /** - * - */ - updateError = function () { - $('[ng-click="save()"]').removeClass('disabled').children('i').remove(); - $('[ng-click="save()"]').siblings('.btn').removeClass('disabled'); - defer.resolve(false); - }; - - - if (!id) { - $cmsApiService.blockAdd($scope.block, saveSuccess, saveError); - } else { - $scope.block.id = id; - $cmsApiService.blockUpdate($scope.block, updateSuccess, updateError); - } - - return defer.promise; - }; - +angular.module("cmsModule") + +.controller("cmsBlockEditController", [ +"$scope", +"$routeParams", +"$location", +"$q", +"$cmsApiService", +"$dashboardUtilsService", +function ( + $scope, + $routeParams, + $location, + $q, + $cmsApiService, + $dashboardUtilsService +) { + + // Retrieve block id from url + var blockId = $routeParams.id; + + // Redirect to blocks list if no block id + if (!blockId) { + $location.path("/cms/blocks"); + } + + // Get block attributes + $cmsApiService.blockAttributes().$promise.then( + function (response) { + $scope.attributes = response.result; + } + ); + + // Default block values + function getDefaultBlock() { + return { + _id: null + }; + } + + // Init block + if (blockId === 'new') { + $scope.block = getDefaultBlock(); + } else { + $cmsApiService.blockGet({"blockID": blockId}).$promise.then( + function (response) { + // If we pass incorrect block ID + // we don't have an error from server + // instead we have empty block here (_id === '') + if (response.result._id !== '') { + $scope.block = response.result; + // so we redirect to new block page + } else { + $location.path('/cms/block/new') } - ] + } ); - - return cmsModule; - }); -})(window.define, jQuery); + } + + // Action Back + $scope.back = function () { + $location.path("/cms/blocks"); + }; + + // Action Save + $scope.save = function () { + + // Disable buttons while saving/updating + $('[ng-click="save()"]').addClass('disabled').append('').siblings('.btn').addClass('disabled'); + + var defer = $q.defer(); + + // If block._id !== null update existing block + if ($scope.block._id !== null) { + var promise = $cmsApiService.blockUpdate($scope.block).$promise; + + promise.then(updateSuccess, updateError); + // Enable buttons in any case + promise.finally(function() { + $('[ng-click="save()"]').removeClass('disabled').children('i').remove(); + $('[ng-click="save()"]').siblings('.btn').removeClass('disabled'); + }); + + // else save new block + } else { + var promise = $cmsApiService.blockAdd($scope.block).$promise; + + promise.then(saveSuccess, saveError); + // Enable buttons in any case + promise.finally(function() { + $('[ng-click="save()"]').removeClass('disabled').children('i').remove(); + $('[ng-click="save()"]').siblings('.btn').removeClass('disabled'); + }); + } + + return defer.promise; + + function updateSuccess(response) { + // Update block data + $scope.block = response.result; + // Show message + $scope.message = $dashboardUtilsService.getMessage(null, 'success', 'Block was updated successfully'); + + defer.resolve(response); + } + + function updateError(response) { + $scope.message = $dashboardUtilsService.getMessage(response); + defer.reject(response); + } + + function saveSuccess(response) { + // Update block data + $scope.block = response.result; + // Show message + $scope.message = $dashboardUtilsService.getMessage(null, 'success', 'Block was created successfully'); + + defer.resolve(response); + } + + function saveError(response) { + $scope.message = $dashboardUtilsService.getMessage(response); + defer.reject(response); + } + }; + +}]); diff --git a/app/scripts/cms/controller/blockList.js b/app/scripts/cms/controller/blockList.js index 410fa917..f8a15963 100644 --- a/app/scripts/cms/controller/blockList.js +++ b/app/scripts/cms/controller/blockList.js @@ -1,171 +1,162 @@ -(function (define, $) { - "use strict"; - - define(["cms/init"], function (cmsModule) { - cmsModule - .controller("cmsBlockListController", [ - "$scope", - "$location", - "$routeParams", - "$q", - "$dashboardListService", - "$cmsApiService", - "COUNT_ITEMS_PER_PAGE", - function ($scope, $location, $routeParams, $q, DashboardListService, $cmsApiService, COUNT_ITEMS_PER_PAGE) { - var serviceList, getBlockCount, getAttributeList, getBlocksList, showColumns; - serviceList = new DashboardListService(); - showColumns = { - 'identifier' : {'type' : 'select-link', 'label' : 'Name'}, - 'created_at' : {'label' : 'Creation Date'}, - 'updated_at' : {'label' : 'Last Updated'} - }; - - $scope.idsSelectedRows = {}; - - /** - * Gets list of blocks - */ - getBlocksList = function () { - var params = $location.search(); - params["extra"] = serviceList.getExtraFields(); - $cmsApiService.blockList(params).$promise.then( - function (response) { - var result, i; - $scope.blocksTmp = []; - result = response.result || []; - for (i = 0; i < result.length; i += 1) { - $scope.blocksTmp.push(result[i]); - } - } - ); - }; - - /** - * Gets list of blocks - */ - getBlockCount = function () { - $cmsApiService.blockCount($location.search()).$promise.then( - function (response) { - if (response.error === null) { - $scope.count = response.result; - } else { - $scope.count = 0; - } - } - ); - }; - - getAttributeList = function () { - $cmsApiService.blockAttributes().$promise.then( - function (response) { - var result = response.result || []; - serviceList.init('blocks'); - $scope.attributes = result; - serviceList.setAttributes($scope.attributes); - $scope.fields = serviceList.getFields(showColumns); - getBlocksList(); - } - ); - }; - - /** - * Handler event when selecting the cms in the list - * - * @param id - */ - $scope.select = function (id) { - $location.path("/cms/block/" + id); - }; - - /** - * - */ - $scope.create = function () { - $location.path("/cms/block/new"); - }; - - var hasSelectedRows = function () { - var result = false; - for (var _id in $scope.idsSelectedRows) { - if ($scope.idsSelectedRows.hasOwnProperty(_id) && $scope.idsSelectedRows[_id]) { - result = true; - } - } - return result; - }; - - /** - * Removes block by ID - * - */ - $scope.remove = function () { - if (!hasSelectedRows()) { - return true; - } - - var i, answer, _remove; - answer = window.confirm("You really want to remove this block(s)?"); - _remove = function (id) { - var defer = $q.defer(); - - $cmsApiService.blockRemove({"blockID": id}, - function (response) { - if (response.result === "ok") { - defer.resolve(id); - } else { - defer.resolve(false); - } - } - ); - - return defer.promise; - }; - if (answer) { - $('[ng-click="parent.remove()"]').addClass('disabled').append('').siblings('.btn').addClass('disabled'); - var callback = function (response) { - if (response) { - for (i = 0; i < $scope.blocks.length; i += 1) { - if ($scope.blocks[i].ID === response) { - $scope.blocks.splice(i, 1); - } - } - } - }; - - for (var id in $scope.idsSelectedRows) { - if ($scope.idsSelectedRows.hasOwnProperty(id) && true === $scope.idsSelectedRows[id]) { - _remove(id).then(callback); - } - } - } - $('[ng-click="parent.remove()"]').removeClass('disabled').children('i').remove(); - $('[ng-click="parent.remove()"]').siblings('.btn').removeClass('disabled'); - }; - - $scope.$watch(function () { - if (typeof $scope.attributes !== "undefined" && typeof $scope.blocksTmp !== "undefined") { - return true; - } - - return false; - }, function (isInitAll) { - if (isInitAll) { - $scope.blocks = serviceList.getList($scope.blocksTmp); - } - }); - - $scope.init = (function () { - if (JSON.stringify({}) === JSON.stringify($location.search())) { - $location.search("limit", "0," + COUNT_ITEMS_PER_PAGE); - return; - } - getBlockCount(); - getAttributeList(); - })(); +angular.module("cmsModule") + +.controller("cmsBlockListController", [ +"$scope", +"$location", +"$routeParams", +"$q", +"$dashboardListService", +"$cmsApiService", +"COUNT_ITEMS_PER_PAGE", +function ($scope, $location, $routeParams, $q, DashboardListService, $cmsApiService, COUNT_ITEMS_PER_PAGE) { + var serviceList, getBlockCount, getAttributeList, getBlocksList, showColumns; + serviceList = new DashboardListService(); + showColumns = { + 'identifier' : {'type' : 'select-link', 'label' : 'Name'}, + 'created_at' : {'label' : 'Creation Date', 'type' : 'date'}, + 'updated_at' : {'label' : 'Last Updated', 'type' : 'date'} + }; + + $scope.idsSelectedRows = {}; + + /** + * Gets list of blocks + */ + getBlocksList = function () { + var params = $location.search(); + params["extra"] = serviceList.getExtraFields(); + $cmsApiService.blockList(params).$promise.then( + function (response) { + var result, i; + $scope.blocksTmp = []; + result = response.result || []; + for (i = 0; i < result.length; i += 1) { + $scope.blocksTmp.push(result[i]); + } + } + ); + }; + + /** + * Gets list of blocks + */ + getBlockCount = function () { + $cmsApiService.blockCount($location.search()).$promise.then( + function (response) { + if (response.error === null) { + $scope.count = response.result; + } else { + $scope.count = 0; } - ] + } ); + }; + + getAttributeList = function () { + $cmsApiService.blockAttributes().$promise.then( + function (response) { + var result = response.result || []; + serviceList.init('blocks'); + $scope.attributes = result; + serviceList.setAttributes($scope.attributes); + $scope.fields = serviceList.getFields(showColumns); + getBlocksList(); + } + ); + }; + + /** + * Handler event when selecting the cms in the list + * + * @param id + */ + $scope.select = function (id) { + $location.path("/cms/block/" + id); + }; + + /** + * + */ + $scope.create = function () { + $location.path("/cms/block/new"); + }; + + var hasSelectedRows = function () { + var result = false; + for (var _id in $scope.idsSelectedRows) { + if ($scope.idsSelectedRows.hasOwnProperty(_id) && $scope.idsSelectedRows[_id]) { + result = true; + } + } + return result; + }; + + /** + * Removes block by ID + * + */ + $scope.remove = function () { + if (!hasSelectedRows()) { + return true; + } + + var i, answer, _remove; + answer = window.confirm("You really want to remove this block(s)?"); + _remove = function (id) { + var defer = $q.defer(); + + $cmsApiService.blockRemove({"blockID": id}, + function (response) { + if (response.result === "ok") { + defer.resolve(id); + } else { + defer.resolve(false); + } + } + ); + + return defer.promise; + }; + if (answer) { + $('[ng-click="parent.remove()"]').addClass('disabled').append('').siblings('.btn').addClass('disabled'); + var callback = function (response) { + if (response) { + for (i = 0; i < $scope.blocks.length; i += 1) { + if ($scope.blocks[i].ID === response) { + $scope.blocks.splice(i, 1); + } + } + } + }; - return cmsModule; + for (var id in $scope.idsSelectedRows) { + if ($scope.idsSelectedRows.hasOwnProperty(id) && true === $scope.idsSelectedRows[id]) { + _remove(id).then(callback); + } + } + } + $('[ng-click="parent.remove()"]').removeClass('disabled').children('i').remove(); + $('[ng-click="parent.remove()"]').siblings('.btn').removeClass('disabled'); + }; + + $scope.$watch(function () { + if (typeof $scope.attributes !== "undefined" && typeof $scope.blocksTmp !== "undefined") { + return true; + } + + return false; + }, function (isInitAll) { + if (isInitAll) { + $scope.blocks = serviceList.getList($scope.blocksTmp); + } }); -})(window.define, jQuery); + + $scope.init = (function () { + if (JSON.stringify({}) === JSON.stringify($location.search())) { + $location.search("limit", "0," + COUNT_ITEMS_PER_PAGE); + return; + } + getBlockCount(); + getAttributeList(); + })(); +}]); diff --git a/app/scripts/cms/controller/pageEdit.js b/app/scripts/cms/controller/pageEdit.js index 1193edf7..b50db65e 100644 --- a/app/scripts/cms/controller/pageEdit.js +++ b/app/scripts/cms/controller/pageEdit.js @@ -1,158 +1,131 @@ -(function (define, $) { - "use strict"; - - define(["cms/init"], function (cmsModule) { - cmsModule - .controller("cmsPageEditController", [ - "$scope", - "$routeParams", - "$location", - "$q", - "$cmsApiService", - "$dashboardUtilsService", - function ($scope, $routeParams, $location, $q, $cmsApiService, $dashboardUtilsService) { - var pageId, getDefaultPage; - - // Initialize SEO - if (typeof $scope.initSeo === "function") { - $scope.initSeo("page"); - } - - pageId = $routeParams.id; - - if (!pageId && pageId !== "new") { - $location.path("/cms/pages"); - } - - if (pageId === "new") { - pageId = null; - } - - getDefaultPage = function () { - return { - "id": "", - "url": "", - "identifier": "", - "title": "", - "content": "", - "meta_keywords": "", - "meta_description": "", - "created_at": "", - "updated_at": "" - }; - }; - - $scope.count = 100; - - /** - * Current selected cms - * - * @type {Object} - */ - $scope.page = getDefaultPage(); - - - /** - * Gets list all attributes of cms - */ - $cmsApiService.pageAttributes().$promise.then( - function (response) { - var result = response.result || []; - $scope.attributes = result; - } - ); - - if (null !== pageId) { - $cmsApiService.pageGet({"pageID": pageId}).$promise.then( - function (response) { - var result = response.result || {}; - $scope.page = result; - } - ); - } - - $scope.back = function () { - $location.path("/cms/pages"); - }; - - /** - * Event handler to save the cms data. - * Creates new cms if ID in current cms is empty OR updates current cms if ID is set - */ - $scope.save = function () { - //disable buttons - $('[ng-click="save()"]').addClass('disabled').append('').siblings('.btn').addClass('disabled'); - - var id, defer, saveSuccess, saveError, updateSuccess, updateError; - defer = $q.defer(); - if (typeof $scope.page !== "undefined") { - id = $scope.page.id || $scope.page._id; - } - - /** - * - * @param response - */ - saveSuccess = function (response) { - if (response.error === null) { - var result = response.result || getDefaultPage(); - $scope.page._id = response.result._id; - $scope.message = $dashboardUtilsService.getMessage(null, 'success', 'Page was created successfully'); - defer.resolve(result); - - $('[ng-click="save()"]').removeClass('disabled').children('i').remove(); - $('[ng-click="save()"]').siblings('.btn').removeClass('disabled'); - } - }; - - /** - * - * @param response - */ - saveError = function () { - $('[ng-click="save()"]').removeClass('disabled').children('i').remove(); - $('[ng-click="save()"]').siblings('.btn').removeClass('disabled'); - defer.resolve(false); - }; - - /** - * - * @param response - */ - updateSuccess = function (response) { - if (response.error === null) { - var result = response.result || getDefaultPage(); - $scope.message = $dashboardUtilsService.getMessage(null, 'success', 'Page was updated successfully'); - $('[ng-click="save()"]').removeClass('disabled').children('i').remove(); - $('[ng-click="save()"]').siblings('.btn').removeClass('disabled'); - defer.resolve(result); - } - }; - - /** - * - * @param response - */ - updateError = function () { - $('[ng-click="save()"]').removeClass('disabled').children('i').remove(); - $('[ng-click="save()"]').siblings('.btn').removeClass('disabled'); - defer.resolve(false); - }; - - if (!id) { - $cmsApiService.pageAdd($scope.page, saveSuccess, saveError); - } else { - $scope.page.id = id; - $cmsApiService.pageUpdate($scope.page, updateSuccess, updateError); - } - - return defer.promise; - }; +angular.module("cmsModule") + +.controller("cmsPageEditController", [ +"$scope", +"$routeParams", +"$location", +"$q", +"$cmsApiService", +"$dashboardUtilsService", +function ( + $scope, + $routeParams, + $location, + $q, + $cmsApiService, + $dashboardUtilsService +) { + + // Initialize SEO + $scope.initSeo("page"); + + // Retrieve page id from url + var pageId = $routeParams.id; + + // Redirect to pages list if no page id + if (!pageId) { + $location.path("/cms/pages"); + } + + // Get page attributes + $cmsApiService.pageAttributes().$promise.then( + function (response) { + $scope.attributes = response.result; + } + ); + + // Default page values + function getDefaultPage() { + return { + _id: null + }; + } + + // Init page + if (pageId === 'new') { + $scope.page = getDefaultPage(); + } else { + $cmsApiService.pageGet({"pageID": pageId}).$promise.then( + function (response) { + // If we pass incorrect page ID + // we don't have an error from server + // instead we have empty page here (_id === '') + if (response.result._id !== '') { + $scope.page = response.result; + // so we redirect to new page page + } else { + $location.path('/cms/page/new') } - ] + } ); - - return cmsModule; - }); -})(window.define, jQuery); + } + + // Action Back + $scope.back = function () { + $location.path("/cms/pages"); + }; + + // Action Save + $scope.save = function () { + + // Disable buttons while saving/updating + $('[ng-click="save()"]').addClass('disabled').append('').siblings('.btn').addClass('disabled'); + + var defer = $q.defer(); + + // If page._id !== null update existing page + if ($scope.page._id !== null) { + var promise = $cmsApiService.pageUpdate($scope.page).$promise; + + promise.then(updateSuccess, updateError); + // Enable buttons in any case + promise.finally(function() { + $('[ng-click="save()"]').removeClass('disabled').children('i').remove(); + $('[ng-click="save()"]').siblings('.btn').removeClass('disabled'); + }); + + // else save new page + } else { + var promise = $cmsApiService.pageAdd($scope.page).$promise; + + promise.then(saveSuccess, saveError); + // Enable buttons in any case + promise.finally(function() { + $('[ng-click="save()"]').removeClass('disabled').children('i').remove(); + $('[ng-click="save()"]').siblings('.btn').removeClass('disabled'); + }); + } + + return defer.promise; + + function updateSuccess(response) { + // Update page data + $scope.page = response.result; + // Show message + $scope.message = $dashboardUtilsService.getMessage(null, 'success', 'Page was updated successfully'); + + defer.resolve(response); + } + + function updateError(response) { + $scope.message = $dashboardUtilsService.getMessage(response); + defer.reject(response); + } + + function saveSuccess(response) { + // Update page data + $scope.page = response.result; + // Show message + $scope.message = $dashboardUtilsService.getMessage(null, 'success', 'Page was created successfully'); + + defer.resolve(response); + } + + function saveError(response) { + $scope.message = $dashboardUtilsService.getMessage(response); + defer.reject(response); + } + }; + +}]); diff --git a/app/scripts/cms/controller/pageList.js b/app/scripts/cms/controller/pageList.js index f3cc8ea8..88175460 100644 --- a/app/scripts/cms/controller/pageList.js +++ b/app/scripts/cms/controller/pageList.js @@ -1,178 +1,169 @@ -(function (define, $) { - "use strict"; - - define(["cms/init"], function (cmsModule) { - cmsModule - .controller("cmsPageListController", [ - "$scope", - "$location", - "$routeParams", - "$q", - "$dashboardListService", - "$cmsApiService", - "COUNT_ITEMS_PER_PAGE", - function ($scope, $location, $routeParams, $q, DashboardListService, $cmsApiService, COUNT_ITEMS_PER_PAGE) { - var serviceList, getPageCount, getAttributeList, getPagesList, showColumns; - serviceList = new DashboardListService(); - showColumns = { - 'identifier' : {'type' : 'select-link'}, - 'enabled' : {}, - 'pagetitle' : {'label' : 'Title of Page'} - }; - - // Initialize SEO - if (typeof $scope.initSeo === "function") { - $scope.initSeo("page"); +angular.module("cmsModule") + +.controller("cmsPageListController", [ +"$scope", +"$location", +"$routeParams", +"$q", +"$dashboardListService", +"$cmsApiService", +"COUNT_ITEMS_PER_PAGE", +function ($scope, $location, $routeParams, $q, DashboardListService, $cmsApiService, COUNT_ITEMS_PER_PAGE) { + var serviceList, getPageCount, getAttributeList, getPagesList, showColumns; + serviceList = new DashboardListService(); + showColumns = { + 'identifier' : {'type' : 'select-link'}, + 'enabled' : {}, + 'title' : {} + }; + + // Initialize SEO + if (typeof $scope.initSeo === "function") { + $scope.initSeo("page"); + } + + $scope.idsSelectedRows = {}; + + /** + * Gets list of pages + */ + getPagesList = function () { + var params = $location.search(); + params["extra"] = serviceList.getExtraFields(); + $cmsApiService.pageList(params).$promise.then( + function (response) { + var result, i; + $scope.pagesTmp = []; + result = response.result || []; + for (i = 0; i < result.length; i += 1) { + $scope.pagesTmp.push(result[i]); + } + } + ); + }; + + /** + * Gets list of pages + */ + getPageCount = function () { + $cmsApiService.pageCount($location.search()).$promise.then( + function (response) { + if (response.error === null) { + $scope.count = response.result; + } else { + $scope.count = 0; + } + } + ); + }; + + getAttributeList = function () { + $cmsApiService.pageAttributes().$promise.then( + function (response) { + var result = response.result || []; + serviceList.init('pages'); + + $scope.attributes = result; + serviceList.setAttributes($scope.attributes); + $scope.fields = serviceList.getFields(showColumns); + getPagesList(); + } + ); + }; + + /** + * Handler event when selecting the cms in the list + * + * @param id + */ + $scope.select = function (id) { + $location.path("/cms/page/" + id); + }; + + /** + * + */ + $scope.create = function () { + $location.path("/cms/page/new"); + }; + + var hasSelectedRows = function () { + var result = false; + for (var _id in $scope.idsSelectedRows) { + if ($scope.idsSelectedRows.hasOwnProperty(_id) && $scope.idsSelectedRows[_id]) { + result = true; + } + } + return result; + }; + + /** + * Removes page by ID + * + */ + $scope.remove = function () { + if (!hasSelectedRows()) { + return true; + } + + var i, answer, _remove; + answer = window.confirm("You really want to remove this page(s)?"); + _remove = function (id) { + var defer = $q.defer(); + + $cmsApiService.pageRemove({"pageID": id}, + function (response) { + if (response.result === "ok") { + defer.resolve(id); + } else { + defer.resolve(false); } - - $scope.idsSelectedRows = {}; - - /** - * Gets list of pages - */ - getPagesList = function () { - var params = $location.search(); - params["extra"] = serviceList.getExtraFields(); - $cmsApiService.pageList(params).$promise.then( - function (response) { - var result, i; - $scope.pagesTmp = []; - result = response.result || []; - for (i = 0; i < result.length; i += 1) { - $scope.pagesTmp.push(result[i]); - } - } - ); - }; - - /** - * Gets list of pages - */ - getPageCount = function () { - $cmsApiService.pageCount($location.search()).$promise.then( - function (response) { - if (response.error === null) { - $scope.count = response.result; - } else { - $scope.count = 0; - } - } - ); - }; - - getAttributeList = function () { - $cmsApiService.pageAttributes().$promise.then( - function (response) { - var result = response.result || []; - serviceList.init('pages'); - - $scope.attributes = result; - serviceList.setAttributes($scope.attributes); - $scope.fields = serviceList.getFields(showColumns); - getPagesList(); - } - ); - }; - - /** - * Handler event when selecting the cms in the list - * - * @param id - */ - $scope.select = function (id) { - $location.path("/cms/page/" + id); - }; - - /** - * - */ - $scope.create = function () { - $location.path("/cms/page/new"); - }; - - var hasSelectedRows = function () { - var result = false; - for (var _id in $scope.idsSelectedRows) { - if ($scope.idsSelectedRows.hasOwnProperty(_id) && $scope.idsSelectedRows[_id]) { - result = true; - } - } - return result; - }; - - /** - * Removes page by ID - * - */ - $scope.remove = function () { - if (!hasSelectedRows()) { - return true; - } - - var i, answer, _remove; - answer = window.confirm("You really want to remove this page(s)?"); - _remove = function (id) { - var defer = $q.defer(); - - $cmsApiService.pageRemove({"pageID": id}, - function (response) { - if (response.result === "ok") { - defer.resolve(id); - } else { - defer.resolve(false); - } - } - ); - - return defer.promise; - - }; - if (answer) { - $('[ng-click="parent.remove()"]').addClass('disabled').append('').siblings('.btn').addClass('disabled'); - var callback = function (response) { - if (response) { - for (i = 0; i < $scope.pages.length; i += 1) { - if ($scope.pages[i].ID === response) { - $scope.pages.splice(i, 1); - } - } - } - }; - - for (var id in $scope.idsSelectedRows) { - if ($scope.idsSelectedRows.hasOwnProperty(id) && true === $scope.idsSelectedRows[id]) { - _remove(id).then(callback); - } - } - } - $('[ng-click="parent.remove()"]').removeClass('disabled').children('i').remove(); - $('[ng-click="parent.remove()"]').siblings('.btn').removeClass('disabled'); - }; - - $scope.$watch(function () { - if (typeof $scope.attributes !== "undefined" && typeof $scope.pagesTmp !== "undefined") { - return true; - } - - return false; - }, function (isInitAll) { - if (isInitAll) { - $scope.pages = serviceList.getList($scope.pagesTmp); - } - }); - - $scope.init = (function () { - if (JSON.stringify({}) === JSON.stringify($location.search())) { - $location.search("limit", "0," + COUNT_ITEMS_PER_PAGE); - return; + } + ); + + return defer.promise; + + }; + if (answer) { + $('[ng-click="parent.remove()"]').addClass('disabled').append('').siblings('.btn').addClass('disabled'); + var callback = function (response) { + if (response) { + for (i = 0; i < $scope.pages.length; i += 1) { + if ($scope.pages[i].ID === response) { + $scope.pages.splice(i, 1); } - getPageCount(); - getAttributeList(); - })(); + } } - ] - ); + }; - return cmsModule; + for (var id in $scope.idsSelectedRows) { + if ($scope.idsSelectedRows.hasOwnProperty(id) && true === $scope.idsSelectedRows[id]) { + _remove(id).then(callback); + } + } + } + $('[ng-click="parent.remove()"]').removeClass('disabled').children('i').remove(); + $('[ng-click="parent.remove()"]').siblings('.btn').removeClass('disabled'); + }; + + $scope.$watch(function () { + if (typeof $scope.attributes !== "undefined" && typeof $scope.pagesTmp !== "undefined") { + return true; + } + + return false; + }, function (isInitAll) { + if (isInitAll) { + $scope.pages = serviceList.getList($scope.pagesTmp); + } }); -})(window.define, jQuery); + + $scope.init = (function () { + if (JSON.stringify({}) === JSON.stringify($location.search())) { + $location.search("limit", "0," + COUNT_ITEMS_PER_PAGE); + return; + } + getPageCount(); + getAttributeList(); + })(); +}]); diff --git a/app/scripts/cms/init.js b/app/scripts/cms/init.js index bc18fb3b..739509e1 100644 --- a/app/scripts/cms/init.js +++ b/app/scripts/cms/init.js @@ -1,58 +1,24 @@ -(function (define) { - "use strict"; - - define([ - "angular", - "angular-route", - "angular-resource" - ], - function (angular) { - /* - * Angular "cmsModule" declaration - */ - angular.module.cmsModule = angular.module("cmsModule", ["ngRoute", "ngResource", "designModule"]) - - /* - * Basic routing configuration - */ - .config(["$routeProvider", function ($routeProvider) { - $routeProvider - .when("/cms/pages", { - templateUrl: angular.getTheme("cms/page-list.html"), - controller: "cmsPageListController" - }) - .when("/cms/page/:id", { - templateUrl: angular.getTheme("cms/page-edit.html"), - controller: "cmsPageEditController" - }) - .when("/cms/blocks", { - templateUrl: angular.getTheme("cms/block-list.html"), - controller: "cmsBlockListController" - }) - .when("/cms/block/:id", { - templateUrl: angular.getTheme("cms/block-edit.html"), - controller: "cmsBlockEditController" - }); - }]) - - .run(["$designService", "$route", "$dashboardSidebarService", "$dashboardHeaderService", - - function ($designService, $route, $dashboardSidebarService, $dashboardHeaderService) { - - // NAVIGATION - // Adds item in the left top-menu - $dashboardHeaderService.addMenuItem("/cms", "CMS", null); - $dashboardHeaderService.addMenuItem("/cms/pages", "Pages", "/cms/pages"); - $dashboardHeaderService.addMenuItem("/cms/blocks", "Blocks", "/cms/blocks"); - - // Adds item in the left sidebar - $dashboardSidebarService.addItem("/cms", "CMS", null, "fa fa-indent", 60); - $dashboardSidebarService.addItem("/cms/pages", "Page", "/cms/pages", "", 2); - $dashboardSidebarService.addItem("/cms/blocks", "Block", "/cms/blocks", "", 1); - } - ]); - - return angular.module.cmsModule; - }); - -})(window.define); \ No newline at end of file +angular.module("cmsModule", ["ngRoute", "ngResource", "designModule"]) + +/* + * Basic routing configuration + */ +.config(["$routeProvider", function ($routeProvider) { + $routeProvider + .when("/cms/pages", { + templateUrl: "/themes/views/cms/page-list.html", + controller: "cmsPageListController" + }) + .when("/cms/page/:id", { + templateUrl: "/themes/views/cms/page-edit.html", + controller: "cmsPageEditController" + }) + .when("/cms/blocks", { + templateUrl: "/themes/views/cms/block-list.html", + controller: "cmsBlockListController" + }) + .when("/cms/block/:id", { + templateUrl: "/themes/views/cms/block-edit.html", + controller: "cmsBlockEditController" + }) +}]); diff --git a/app/scripts/cms/module.js b/app/scripts/cms/module.js deleted file mode 100644 index 4278965d..00000000 --- a/app/scripts/cms/module.js +++ /dev/null @@ -1,20 +0,0 @@ -(function (define) { - "use strict"; - - /* - * requireJS module entry point - * (to use that module you should include it to main.js) - */ - define([ - "cms/service/api", - "cms/controller/pageList", - "cms/controller/pageEdit", - "cms/controller/blockList", - "cms/controller/blockEdit" - ], - function (cmsModule) { - - return cmsModule; - }); - -})(window.define); \ No newline at end of file diff --git a/app/scripts/cms/service/api.js b/app/scripts/cms/service/api.js index 574cca04..2b77db1b 100644 --- a/app/scripts/cms/service/api.js +++ b/app/scripts/cms/service/api.js @@ -1,81 +1,92 @@ -(function (define) { - "use strict"; +angular.module("cmsModule") +/** +* +*/ +.service("$cmsApiService", ["$resource", "REST_SERVER_URI", function ($resource, REST_SERVER_URI) { + return $resource(REST_SERVER_URI, {}, { + // Products + "blockAdd": { + method: "POST", + url: REST_SERVER_URI + "/cms/block" + }, + "blockAttributes": { + method: "GET", + url: REST_SERVER_URI + "/cms/blocks/attributes" + }, + "blockCount": { + method: "GET", + params: { action: "count" }, + url: REST_SERVER_URI + "/cms/blocks" + }, + "blockRemove": { + method: "DELETE", + url: REST_SERVER_URI + "/cms/block/:blockID" + }, + "blockGet": { + method: "GET", + url: REST_SERVER_URI + "/cms/block/:blockID" + }, + "blockList": { + method: "GET", + url: REST_SERVER_URI + "/cms/blocks" + }, + "blockUpdate": { + method: "PUT", + params: { blockID: "@_id" }, + url: REST_SERVER_URI + "/cms/block/:blockID" + }, + "pageAdd": { + method: "POST", + url: REST_SERVER_URI + "/cms/page" + }, + "pageAttributes": { + method: "GET", + url: REST_SERVER_URI + "/cms/pages/attributes" + }, + "pageCount": { + method: "GET", + params: { action: "count" }, + url: REST_SERVER_URI + "/cms/pages" + }, + "pageRemove": { + method: "DELETE", + url: REST_SERVER_URI + "/cms/page/:pageID" + }, + "pageGet": { + method: "GET", + url: REST_SERVER_URI + "/cms/page/:pageID" + }, + "pageList": { + method: "GET", + url: REST_SERVER_URI + "/cms/pages" + }, + "pageUpdate": { + method: "PUT", + params: { pageID: "@_id" }, + url: REST_SERVER_URI + "/cms/page/:pageID" + }, - /** - * - */ - define(["cms/init"], function (cmsModule) { - cmsModule - /** - * - */ - .service("$cmsApiService", ["$resource", "REST_SERVER_URI", function ($resource, REST_SERVER_URI) { - return $resource(REST_SERVER_URI, {}, { - // Products - "blockAdd": { - method: "POST", - url: REST_SERVER_URI + "/cms/block" - }, - "blockAttributes": { - method: "GET", - url: REST_SERVER_URI + "/cms/blocks/attributes" - }, - "blockCount": { - method: "GET", - params: { action: "count" }, - url: REST_SERVER_URI + "/cms/blocks" - }, - "blockRemove": { - method: "DELETE", - url: REST_SERVER_URI + "/cms/block/:blockID" - }, - "blockGet": { - method: "GET", - url: REST_SERVER_URI + "/cms/block/:blockID" - }, - "blockList": { - method: "GET", - url: REST_SERVER_URI + "/cms/blocks" - }, - "blockUpdate": { - method: "PUT", - params: { blockID: "@id" }, - url: REST_SERVER_URI + "/cms/block/:blockID" - }, - "pageAdd": { - method: "POST", - url: REST_SERVER_URI + "/cms/page" - }, - "pageAttributes": { - method: "GET", - url: REST_SERVER_URI + "/cms/pages/attributes" - }, - "pageCount": { - method: "GET", - params: { action: "count" }, - url: REST_SERVER_URI + "/cms/pages" - }, - "pageRemove": { - method: "DELETE", - url: REST_SERVER_URI + "/cms/page/:pageID" - }, - "pageGet": { - method: "GET", - url: REST_SERVER_URI + "/cms/page/:pageID" - }, - "pageList": { - method: "GET", - url: REST_SERVER_URI + "/cms/pages" - }, - "pageUpdate": { - method: "PUT", - params: { pageID: "@id" }, - url: REST_SERVER_URI + "/cms/page/:pageID" - } - }); - }]); - - return cmsModule; + "galleryList": { + method: "GET", + url: REST_SERVER_URI + "/cms/gallery/images" + }, + "galleryPath": { + method: "GET", + url: REST_SERVER_URI + "/cms/gallery/path" + }, + "galleryGet": { + method: "GET", + url: REST_SERVER_URI + "/cms/gallery/image/:mediaName" + }, + "galleryAdd": { + method: "POST", + url: REST_SERVER_URI + "/cms/gallery/image/:mediaName", + headers: {"Content-Type": undefined }, + transformRequest: angular.identity // jshint ignore:line + }, + "galleryRemove": { + method: "DELETE", + url: REST_SERVER_URI + "/cms/gallery/image/:mediaName" + } }); - -})(window.define); \ No newline at end of file +}]); diff --git a/app/scripts/config.js b/app/scripts/config.js deleted file mode 100644 index 0a6291a9..00000000 --- a/app/scripts/config.js +++ /dev/null @@ -1,6 +0,0 @@ -require.iniConfig = { - "general.app.foundation_url": "http://foundation.ottemo.io", - "general.app.media_path": "media/", - "themes.list.active": "default", - "general.app.item_per_page": 15 -}; diff --git a/app/scripts/config/controller/configEdit.js b/app/scripts/config/controller/configEdit.js index 7d7ce485..46ffffe0 100644 --- a/app/scripts/config/controller/configEdit.js +++ b/app/scripts/config/controller/configEdit.js @@ -1,99 +1,81 @@ -(function (define) { - "use strict"; +angular.module("configModule") - define(["config/init"], function (configModule) { - configModule - .controller("configEditController", [ - "$scope", - "$routeParams", - "$configApiService", - "$configService", - "$dashboardUtilsService", - function ($scope, $routeParams, $configApiService, $configService, $dashboardUtilsService) { +.controller("configEditController", [ + "$scope", + "$routeParams", + "$configApiService", + "$configService", + "$dashboardUtilsService", + function ($scope, $routeParams, $configApiService, $configService, $dashboardUtilsService) { - $scope.currentGroup = null; - $scope.items = {}; - $scope.currentGroup = $routeParams.group; - $scope.currentPath = ""; - var activeTab; + $scope.items = {}; + $scope.currentGroup = $routeParams.group; + $scope.currentPath = ""; + var activeTab; - $scope.init = function () { - $configService.init().then( - function () { - var regExp, parts, tabs; - regExp = new RegExp("(\\w+)\\.(\\w+).*", "i"); - tabs = {}; - - $scope.sections = $configService.getConfigTabs($scope.currentGroup); + $scope.init = function () { + $configService.init().then( + function () { + var regExp, parts, tabs; + regExp = new RegExp("(\\w+)\\.(\\w+).*", "i"); + tabs = {}; - for (var i = 0; i < $scope.sections.length; i += 1) { - var attr = $scope.sections[i]; + $scope.sections = $configService.getConfigTabs($scope.currentGroup); - if (attr.Type === "group") { - if (typeof tabs[attr.Group] === "undefined") { - tabs[attr.Group] = []; - } - tabs[attr.Group].push(attr); - } - } - activeTab = Object.keys(tabs).sort()[0]; - parts = tabs[activeTab][0].Path.match(regExp); + for (var i = 0; i < $scope.sections.length; i += 1) { + var attr = $scope.sections[i]; - if (parts instanceof Array) { - $scope.currentPath = parts[2]; - $configService.load($scope.currentPath).then( - function () { - $scope.items = $configService.getItems($scope.currentPath); - } - ); - } + if (attr.Type === "group") { + if (typeof tabs[attr.Group] === "undefined") { + tabs[attr.Group] = []; } - ); - }; + tabs[attr.Group].push(attr); + } + } + activeTab = Object.keys(tabs)[0]; + parts = tabs[activeTab][0].Path.match(regExp); - $scope.selectTab = function (path) { - $scope.currentPath = path; + if (parts instanceof Array) { + $scope.currentPath = parts[2]; $configService.load($scope.currentPath).then( function () { $scope.items = $configService.getItems($scope.currentPath); } ); - }; - - $scope.save = function () { - $configService.save($scope.currentPath).then( - function () { - $scope.message = $dashboardUtilsService.getMessage(null, 'success', 'config was saved successfully'); - } - ); - }; - - $scope.getGroupName = function () { - return $scope.currentGroup !== null ? - $scope.currentGroup.charAt(0).toUpperCase() + $scope.currentGroup.slice(1) : - "Configuration"; - }; - - $scope.getGroupPath = function (attributes) { - var path, parts; - if (attributes instanceof Array) { - path = attributes[0].Path; - parts = path.split("."); - return parts[0] + "." + parts[1]; - } - }; + } + } + ); + }; - $scope.isThemeManager = function () { - if ("themes" === $scope.currentGroup && "themes_manager" === $scope.sections[0].Editor) { - return true; - } + $scope.selectTab = function (path) { + $scope.currentPath = path; + $configService.load($scope.currentPath).then( + function () { + $scope.items = $configService.getItems($scope.currentPath); + } + ); + }; - return false; - }; + $scope.save = function () { + $configService.save($scope.currentPath).then( + function () { + $scope.message = $dashboardUtilsService.getMessage(null, 'success', 'config was saved successfully'); } - ] - ); + ); + }; + + $scope.getGroupName = function () { + return $scope.currentGroup !== null ? + $scope.currentGroup.charAt(0).toUpperCase() + $scope.currentGroup.slice(1) : + "Configuration"; + }; - return configModule; - }); -})(window.define); \ No newline at end of file + $scope.getGroupPath = function (attributes) { + var path, parts; + if (attributes instanceof Array) { + path = attributes[0].Path; + parts = path.split("."); + return parts[0] + "." + parts[1]; + } + }; +}]); \ No newline at end of file diff --git a/app/scripts/config/directives/guiConfigEditorForm.js b/app/scripts/config/directives/guiConfigEditorForm.js index 7fa78760..385ec37e 100644 --- a/app/scripts/config/directives/guiConfigEditorForm.js +++ b/app/scripts/config/directives/guiConfigEditorForm.js @@ -1,102 +1,94 @@ -(function (define) { - "use strict"; +angular.module("designModule") - define(["design/init", "config/init"], function (designModule) { - designModule +/** +* Directive used for automatic attributes editor form creation +*/ +.directive("guiConfigEditorForm", ["$designService", function ($designService) { + return { + restrict: "E", + scope: { + "parent": "=object", + "item": "=item", + "attributes": "=attributesList" + }, + templateUrl: $designService.getTemplate("config/gui/configEditorForm.html"), + controller: function ($scope) { + var updateAttributes, addTab, addFields, sortFieldsInGroups; - /** - * Directive used for automatic attributes editor form creation - */ - .directive("guiConfigEditorForm", ["$designService", function ($designService) { - return { - restrict: "E", - scope: { - "parent": "=object", - "item": "=item", - "attributes": "=attributesList" - }, - templateUrl: $designService.getTemplate("config/gui/configEditorForm.html"), - controller: function ($scope) { - var updateAttributes, addTab, addFields, sortFieldsInGroups; + $scope.tabs = {}; + $scope.click = function (id) { + if (typeof $scope.parent.selectTab === "function") { + $scope.parent.selectTab(id); + } else { + return false; + } + }; - $scope.tabs = {}; - $scope.click = function (id) { - if (typeof $scope.parent.selectTab === "function") { - $scope.parent.selectTab(id); - } else { - return false; - } - }; - - addTab = function (attr) { - if (attr.Type === "group") { - if (typeof $scope.tabs[attr.Group] === "undefined") { - $scope.tabs[attr.Group] = []; - } - $scope.tabs[attr.Group].push(attr); - } - }; - - addFields = function (attr) { - if (typeof $scope.attributeGroups[attr.Group] === "undefined") { - $scope.attributeGroups[attr.Group] = []; - } - $scope.attributeGroups[attr.Group].push(attr); - }; - - sortFieldsInGroups = function () { - var sortByLabel, tab; - sortByLabel = function (a, b) { - if (a.Label.toString() < b.Label.toString()) { - return -1; - } - if (a.Label.toString() > b.Label.toString()) { - return 1; - } + addTab = function (attr) { + if (attr.Type === "group") { + if (typeof $scope.tabs[attr.Group] === "undefined") { + $scope.tabs[attr.Group] = []; + } + $scope.tabs[attr.Group].push(attr); + } + }; - return 0; - }; - for (tab in $scope.attributeGroups) { - if ($scope.attributeGroups.hasOwnProperty(tab)) { - $scope.attributeGroups[tab].sort(sortByLabel); - } - } - }; + addFields = function (attr) { + if (typeof $scope.attributeGroups[attr.Group] === "undefined") { + $scope.attributeGroups[attr.Group] = []; + } + $scope.attributeGroups[attr.Group].push(attr); + }; - updateAttributes = function () { - if ($scope.item === "undefined" || - JSON.stringify({}) === JSON.stringify($scope.item)) { - return true; - } - var i, attr, setAttrValue; - $scope.attributeGroups = {}; + sortFieldsInGroups = function () { + var sortByLabel, tab; + sortByLabel = function (a, b) { + if (a.Label.toString() < b.Label.toString()) { + return -1; + } + if (a.Label.toString() > b.Label.toString()) { + return 1; + } - setAttrValue = function (attr) { - if (typeof $scope.item !== "undefined") { - attr.Value = $scope.item[attr.Attribute] || ""; - } + return 0; + }; + for (tab in $scope.attributeGroups) { + if ($scope.attributeGroups.hasOwnProperty(tab)) { + $scope.attributeGroups[tab].sort(sortByLabel); + } + } + }; - return attr; - }; + updateAttributes = function () { + if ($scope.item === "undefined" || + JSON.stringify({}) === JSON.stringify($scope.item)) { + return true; + } + var i, attr, setAttrValue; + $scope.attributeGroups = {}; - if (typeof $scope.attributes !== "undefined") { - for (i = 0; i < $scope.attributes.length; i += 1) { - attr = setAttrValue($scope.attributes[i]); + setAttrValue = function (attr) { + if (typeof $scope.item !== "undefined") { + attr.Value = $scope.item[attr.Attribute] || ""; + } - addFields(attr); - addTab(attr); - } - } + return attr; + }; - sortFieldsInGroups(); - }; + if (typeof $scope.attributes !== "undefined") { + for (i = 0; i < $scope.attributes.length; i += 1) { + attr = setAttrValue($scope.attributes[i]); - $scope.$watchCollection("attributes", updateAttributes); - $scope.$watchCollection("item", updateAttributes); + addFields(attr); + addTab(attr); } - }; - }]); + } + + sortFieldsInGroups(); + }; - return designModule; - }); -})(window.define); + $scope.$watchCollection("attributes", updateAttributes); + $scope.$watchCollection("item", updateAttributes); + } + }; +}]); diff --git a/app/scripts/config/filters/storedate.js b/app/scripts/config/filters/storedate.js new file mode 100644 index 00000000..3845bfab --- /dev/null +++ b/app/scripts/config/filters/storedate.js @@ -0,0 +1,12 @@ +angular.module("configModule") + +.filter('otStoreDate', ['timezoneService', '$filter', + function(timezoneService, $filter) { + return function(input) { + if (!input) return ""; + + return $filter('date')(input, 'MM/dd/yyyy hh:mma', timezoneService.storeTz); + } + } +]); + diff --git a/app/scripts/config/init.js b/app/scripts/config/init.js index 7ca1f911..8e787da3 100644 --- a/app/scripts/config/init.js +++ b/app/scripts/config/init.js @@ -1,53 +1,16 @@ -(function (define) { - "use strict"; +/** + * Config Module + */ +angular.module("configModule", ["ngRoute", "ngResource", "designModule"]) - /** - * - */ - define([ - "angular", - "angular-route", - "angular-resource" - ], - function (angular) { - /** - * - */ - angular.module.configModule = angular.module("configModule", ["ngRoute", "ngResource", "designModule"]) - - /** - * Basic routing configuration - */ - .config(["$routeProvider", function ($routeProvider) { - $routeProvider - .when("/settings/:group", { - templateUrl: angular.getTheme("config/edit.html"), - controller: "configEditController" - }); - }]) - - .run([ - "$designService", - "$route", - "$dashboardSidebarService", - "$configService", - function ($designService, $route, $dashboardSidebarService, $configService) { - - // Adds item in the left sidebar - $dashboardSidebarService.addItem("/settings", "Settings", null, "fa fa-cogs", 2); - - $configService.init().then( - function () { - var sections = $configService.getConfigGroups(); - for (var i = 0; i < sections.length; i += 1) { - $dashboardSidebarService.addItem("/settings/" + sections[i].Id, sections[i].Name, "/settings/" + sections[i].Id, "", i); - } - } - ); - } - ]); - - return angular.module.configModule; +.config(["$routeProvider", function ($routeProvider) { + $routeProvider + .when("/settings/:group", { + templateUrl: "/themes/views/config/edit.html", + controller: "configEditController" }); +}]) -})(window.define); \ No newline at end of file +.run(['timezoneService', function (timezoneService) { + timezoneService.init(); +}]); \ No newline at end of file diff --git a/app/scripts/config/module.js b/app/scripts/config/module.js deleted file mode 100644 index be418c0a..00000000 --- a/app/scripts/config/module.js +++ /dev/null @@ -1,21 +0,0 @@ -(function (define) { - "use strict"; - - /** - * The module "productModule" is designed to work with products - * - * This file it"s start point modules. He includes all dependent files. - * (For adding this module to App, you should add this file to the require list) - */ - define([ - "config/service/api", - "config/service/config", - "config/directives/guiConfigEditorForm", - "config/controller/configEdit" - ], - function (configModule) { - - return configModule; - }); - -})(window.define); \ No newline at end of file diff --git a/app/scripts/config/service/api.js b/app/scripts/config/service/api.js index d64927b7..837ea2b5 100644 --- a/app/scripts/config/service/api.js +++ b/app/scripts/config/service/api.js @@ -1,44 +1,38 @@ -(function (define) { - "use strict"; +angular.module("configModule") - /** - * - */ - define(["config/init"], function (configModule) { - configModule - /** - * - * - */ - .service("$configApiService", ["$resource", "REST_SERVER_URI", function ($resource, REST_SERVER_URI) { - return $resource(REST_SERVER_URI, {}, { - "getGroups": { - method: "GET", - url: REST_SERVER_URI + "/config/groups" - }, - "getPath": { - method: "GET", - params: {"path": "@path"}, - url: REST_SERVER_URI + "/config/value/:path" - }, - "getInfo": { - method: "GET", - params: {"path": "@path"}, - url: REST_SERVER_URI + "/config/item/:path" - }, - "getList": { - method: "GET", - url: REST_SERVER_URI + "/config/values" - }, - "setPath": { - method: "PUT", - params: {"path": "@path"}, - url: REST_SERVER_URI + "/config/value/:path" - } - }); - }]); +.service("$configApiService", ["$resource", "REST_SERVER_URI", + function($resource, REST_SERVER_URI) { + return $resource(REST_SERVER_URI, {}, { + "getGroups": { + method: "GET", + url: REST_SERVER_URI + "/config/groups" + }, + "getPath": { + method: "GET", + params: { + "path": "@path" + }, + url: REST_SERVER_URI + "/config/value/:path" + }, + "getInfo": { + method: "GET", + params: { + "path": "@path" + }, + url: REST_SERVER_URI + "/config/item/:path" + }, + "getList": { + method: "GET", + url: REST_SERVER_URI + "/config/values" + }, + "setPath": { + method: "PUT", + params: { + "path": "@path" + }, + url: REST_SERVER_URI + "/config/value/:path" + } + }); + } +]); - return configModule; - }); - -})(window.define); diff --git a/app/scripts/config/service/config.js b/app/scripts/config/service/config.js index e2eed8aa..3b451017 100644 --- a/app/scripts/config/service/config.js +++ b/app/scripts/config/service/config.js @@ -1,244 +1,218 @@ -(function (define) { - "use strict"; - - /** - * - */ - define(["config/init"], function (configModule) { - configModule - /** - * - */ - .service("$configService", [ - "$configApiService", - "$q", - function ($configApiService, $q) { - - // Variables - var isInit, configGroups, configTabs, items, itemsOld, isLoaded; - - // Functions - var init, load, save, getConfigGroups, getConfigTabs, getItems, addTab, addGroup, checkOnDups; - - items = {}; - itemsOld = {}; - isLoaded = {}; - - getConfigGroups = function () { - return configGroups.sort(function(a, b){ - if (a.Name.toString() < b.Name.toString()) { - return 1; +angular.module("configModule") +/** +* +*/ +.service("$configService", [ + "$configApiService", + "$q", + function ($configApiService, $q) { + + // Variables + var isInit, configGroups, configTabs, items, itemsOld, isLoaded; + + // Functions + var init, load, save, getConfigTabs, getItems, addTab, addGroup, checkOnDups; + + items = {}; + itemsOld = {}; + isLoaded = {}; + + getConfigTabs = function (group) { + if (typeof group !== "undefined" && typeof configTabs[group] !== "undefined") { + return configTabs[group]; + } else if (typeof group === "undefined") { + return configTabs; + } + + return []; + }; + + getItems = function (path) { + if (typeof path !== "undefined" && typeof items[path] !== "undefined") { + return items[path]; + + } else if (typeof path === "undefined") { + return items; + } + return false; + }; + + addGroup = function (attr) { + var groupCode, isExist; + + isExist = function (group) { + var i; + for (i = 0; i < configGroups.length; i += 1) { + if (configGroups[i].Id === group) { + return true; + } + } + + return false; + }; + + groupCode = attr.Path.substr(0, (-1 === attr.Path.indexOf(".") ? attr.Path.length : attr.Path.indexOf("."))); + + if (!isExist(groupCode) && (-1 === attr.Path.indexOf("."))) { + configGroups.push({ + "Id": groupCode, + "Name": attr.Label + }); + + } + }; + + addTab = function (attr) { + var groupCode, regExp, parts; + regExp = new RegExp("(\\w+)\\.(\\w+).*", "i"); + + groupCode = attr.Path.substr(0, (-1 === attr.Path.indexOf(".") ? attr.Path.length : attr.Path.indexOf("."))); + if (typeof configTabs[groupCode] === "undefined") { + configTabs[groupCode] = []; + } + + if (-1 !== attr.Path.indexOf(".") && attr.Type === "group") { + parts = attr.Path.match(regExp); + if (typeof parts[2] !== "undefined") { + attr.Group = parts[2]; + configTabs[groupCode].push(attr); + } + } + }; + + init = function () { + if (isInit) { + return isInit.promise; + } + isInit = $q.defer(); + configTabs = {}; + configGroups = []; + + $configApiService.getGroups().$promise.then( + function (response) { + var result, attr; + result = response.result || []; + for (var i = 0; i < result.length; i += 1) { + attr = result[i]; + addGroup(attr); + addTab(attr); + } + isInit.resolve(true); + + } + ); + + return isInit.promise; + }; + + checkOnDups = function (group, path, force) { + if (force) { + for (var pos = 0; pos < configTabs[group].length; pos += 1) { + if (path === configTabs[group][pos].Path) { + configTabs[group].splice(pos, 1); + return pos; + } + } + } + }; + + load = function (path, force) { + var i, pos, regExp, parts, group, defer; + defer = $q.defer(); + regExp = new RegExp("(\\w+)\\.(\\w+).*", "i"); + + if ((typeof items[path] === "undefined" && !force) || force) { + items[path] = {}; + itemsOld[path] = {}; + } + + if ((typeof isLoaded[path] === "undefined" && !force) || force) { + $configApiService.getInfo({"path": path}).$promise.then( + function (response) { + + var addAttributeInTab = function (attr) { + pos = checkOnDups(group, attr.Path, true); + + if (pos) { + configTabs[group].splice(pos, 0, attr); + } else { + configTabs[group].push(attr); } - if (a.Name.toString() > b.Name.toString()) { - return -1; - } - - return 0; - }); - }; - - getConfigTabs = function (group) { - if (typeof group !== "undefined" && typeof configTabs[group] !== "undefined") { - return configTabs[group]; - } else if (typeof group === "undefined") { - return configTabs; - } - return []; - }; - - getItems = function (path) { - if (typeof path !== "undefined" && typeof items[path] !== "undefined") { - return items[path]; - - } else if (typeof path === "undefined") { - return items; - } - return false; - }; - - addGroup = function (attr) { - var groupCode, isExist; - - isExist = function (group) { - var i; - for (i = 0; i < configGroups.length; i += 1) { - if (configGroups[i].Id === group) { - return true; - } - } - - return false; }; - groupCode = attr.Path.substr(0, (-1 === attr.Path.indexOf(".") ? attr.Path.length : attr.Path.indexOf("."))); - - if (!isExist(groupCode) && (-1 === attr.Path.indexOf("."))) { - configGroups.push({ - "Id": groupCode, - "Name": attr.Label - }); + for (i = 0; i < response.result.length; i += 1) { + if (response.result[i].Type !== "group") { - } - }; + parts = response.result[i].Path.match(regExp); + group = parts[1]; - addTab = function (attr) { - var groupCode, regExp, parts; - regExp = new RegExp("(\\w+)\\.(\\w+).*", "i"); + response.result[i].Attribute = response.result[i].Path; + response.result[i].Group = parts[2]; + response.result[i].Editors = response.result[i].Editor; + delete response.result[i].Editor; - groupCode = attr.Path.substr(0, (-1 === attr.Path.indexOf(".") ? attr.Path.length : attr.Path.indexOf("."))); - if (typeof configTabs[groupCode] === "undefined") { - configTabs[groupCode] = []; - } + addAttributeInTab(response.result[i]); - if (-1 !== attr.Path.indexOf(".") && attr.Type === "group") { - parts = attr.Path.match(regExp); - if (typeof parts[2] !== "undefined") { - attr.Group = parts[2]; - configTabs[groupCode].push(attr); + items[path][response.result[i].Path] = response.result[i].Value.toString(); + itemsOld[path][response.result[i].Path] = response.result[i].Value.toString(); } } - }; - - init = function () { - if (isInit) { - return isInit.promise; - } - isInit = $q.defer(); - configTabs = {}; - configGroups = []; - - $configApiService.getGroups().$promise.then( - function (response) { - var result, attr; - result = response.result || []; - for (var i = 0; i < result.length; i += 1) { - attr = result[i]; - addGroup(attr); - addTab(attr); - } - isInit.resolve(true); - - } - ); - - return isInit.promise; - }; - - checkOnDups = function (group, path, force) { - if (force) { - for (var pos = 0; pos < configTabs[group].length; pos += 1) { - if (path === configTabs[group][pos].Path) { - configTabs[group].splice(pos, 1); - return pos; - } - } - } - }; - - load = function (path, force) { - var i, pos, regExp, parts, group, defer; - defer = $q.defer(); - regExp = new RegExp("(\\w+)\\.(\\w+).*", "i"); - - if ((typeof items[path] === "undefined" && !force) || force) { - items[path] = {}; - itemsOld[path] = {}; - } - - if ((typeof isLoaded[path] === "undefined" && !force) || force) { - $configApiService.getInfo({"path": path}).$promise.then( - function (response) { - - var addAttributeInTab = function (attr) { - pos = checkOnDups(group, attr.Path, true); - - if (pos) { - configTabs[group].splice(pos, 0, attr); - } else { - configTabs[group].push(attr); - } - - }; - - for (i = 0; i < response.result.length; i += 1) { - if (response.result[i].Type !== "group") { - - parts = response.result[i].Path.match(regExp); - group = parts[1]; - - response.result[i].Attribute = response.result[i].Path; - response.result[i].Group = parts[2]; - response.result[i].Editors = response.result[i].Editor; - delete response.result[i].Editor; - - addAttributeInTab(response.result[i]); - - items[path][response.result[i].Path] = response.result[i].Value.toString(); - itemsOld[path][response.result[i].Path] = response.result[i].Value.toString(); - } - } - isLoaded[path] = true; - defer.resolve(true); - } - ); - } else { - isLoaded[path] = true; - defer.resolve(true); - } - - return defer.promise; - }; - - save = function (path) { - var field, defer, qtyChangedItems, qtySavedItems; - qtyChangedItems = 0; - qtySavedItems = 0; - defer = $q.defer(); - - var _save = function (field) { - var defer = $q.defer(); - - $configApiService.setPath({ - "path": field, - "value": items[path][field] - }).$promise.then(function (response) { - qtySavedItems += 1; - if (response.error === null) { - itemsOld[path][field] = items[path][field]; - } - defer.resolve(response); - } - ); // jshint ignore:line - - return defer.promise; - }; - var callback = function () { - if (qtyChangedItems === qtySavedItems) { - defer.resolve(true); - } - }; - for (field in items[path]) { - if (items[path].hasOwnProperty(field) && items[path][field] !== itemsOld[path][field]) { - qtyChangedItems += 1; - _save(field).then(callback); - - } + isLoaded[path] = true; + defer.resolve(true); + } + ); + } else { + isLoaded[path] = true; + defer.resolve(true); + } + + return defer.promise; + }; + + save = function (path) { + var field, defer, qtyChangedItems, qtySavedItems; + qtyChangedItems = 0; + qtySavedItems = 0; + defer = $q.defer(); + + var _save = function (field) { + var defer = $q.defer(); + + $configApiService.setPath({ + "path": field, + "value": items[path][field] + }).$promise.then(function (response) { + qtySavedItems += 1; + if (response.error === null) { + itemsOld[path][field] = items[path][field]; } - return defer.promise; - }; - - return { - "init": init, - "load": load, - "save": save, - "getItems": getItems, - "getConfigGroups": getConfigGroups, - "getConfigTabs": getConfigTabs - }; - }]); - - return configModule; - }); - -})(window.define); + defer.resolve(response); + } + ); // jshint ignore:line + + return defer.promise; + }; + var callback = function () { + if (qtyChangedItems === qtySavedItems) { + defer.resolve(true); + } + }; + for (field in items[path]) { + if (items[path].hasOwnProperty(field) && items[path][field] !== itemsOld[path][field]) { + qtyChangedItems += 1; + _save(field).then(callback); + + } + } + return defer.promise; + }; + + return { + "init": init, + "load": load, + "save": save, + "getItems": getItems, + "getConfigTabs": getConfigTabs + }; + }]); diff --git a/app/scripts/config/service/timezone.js b/app/scripts/config/service/timezone.js new file mode 100644 index 00000000..c08551ce --- /dev/null +++ b/app/scripts/config/service/timezone.js @@ -0,0 +1,24 @@ +angular.module('configModule') + +.factory('timezoneService', ['$configApiService', '$q', + function($configApiService, $q) { + var service = { + init: init, + storeTz : 0 + }; + + return service; + + //////////////////////// + + function init() { + + // Cache the store tz + $configApiService.getPath({path: 'general.store.timezone'}).$promise + .then(function(response) { + service.storeTz = response.result.substr(3); + }); + } + } +]); + diff --git a/app/scripts/dashboard/controllers.js b/app/scripts/dashboard/controllers.js index b517010e..84720b24 100644 --- a/app/scripts/dashboard/controllers.js +++ b/app/scripts/dashboard/controllers.js @@ -1,379 +1,180 @@ -(function (define, $) { - "use strict"; - - define(["dashboard/init"], function (dashboardModule) { - - dashboardModule - /* - * HTML top page header manipulator (direct service mapping) - */ - .controller("dashboardHeaderController", ["$scope", "$dashboardHeaderService", function ($scope, $dashboardHeaderService) { - $scope.it = $dashboardHeaderService; - $scope.leftMenu = $dashboardHeaderService.getMenuLeft(); - $scope.rightMenu = $dashboardHeaderService.getMenuRight(); - }]) - - .controller("dashboardHeaderController", ["$scope", "$dashboardHeaderService", function ($scope, $dashboardHeaderService) { - $scope.it = $dashboardHeaderService; - $scope.leftMenu = $dashboardHeaderService.getMenuLeft(); - $scope.rightMenu = $dashboardHeaderService.getMenuRight(); - }]) - - .controller("dashboardSidebarController", ["$scope", "$dashboardSidebarService", function ($scope, $dashboardSidebarService) { - $scope.it = $dashboardSidebarService; - $scope.items = $dashboardSidebarService.getItems(); - }]) - - .controller("dashboardController", [ - "$scope", - "$location", - "$dashboardStatisticService", - "$designImageService", - "$dashboardUtilsService", - function ($scope, $location, $statistic, $designImageService, $dashboardUtilsService) { - $scope.x = "dashboardController"; - $scope.visitorsChartData = []; - $scope.visitsPeriod = 'week'; - $scope.salesChartData = []; - $scope.salesPeriod = 'week'; - - var renderVisitsChart = function (data) { - if ($scope.visitorsCharts) { - $scope.visitorsCharts.setData([data]); - $scope.visitorsCharts.setupGrid(); - $scope.visitorsCharts.draw(); - } - }; - - var renderSalesChart = function (data) { - if ($scope.salesCharts) { - $scope.salesCharts.setData([data]); - $scope.salesCharts.setupGrid(); - $scope.salesCharts.draw(); - } - }; - - - - // TOP REFERRERS - $statistic.getReferrers().then(function (data) { - $scope.referrers = $dashboardUtilsService.sortObjectsArrayByField(data, 'count', 'int', "DESC"); - }); - - // VISITS TODAY - $statistic.getVisits().then(function (data) { - $scope.visits = data; - }); - - // SALES TODAY - $statistic.getSales().then(function (data) { - $scope.sales = data; - }); - - // Website Conversions - $statistic.getConversions().then(function (data) { - $scope.conversions = data; - }); - - // TOP SELLERS - $statistic.getTopSellers().then(function (data) { - $scope.topSellers = $dashboardUtilsService.sortObjectsArrayByField(data, 'count', 'int', "DESC"); - }); - - // VISITORS ONLINE - $statistic.getVisitorsOnline().then(function (data) { - $scope.visitorsOnline = data; - }); - - $scope.initVisitorsChart = function () { - if (!$scope.visitorsCharts) { - $scope.visitorsCharts = $.plot( - $('#visitors-chart #visitors-container'), [ - { - data: $scope.visitorsChartData, - label: "Page View", - lines: { - fill: true - } - } - ], - { - series: { - lines: { - show: true, - fill: false - }, - points: { - show: true, - lineWidth: 2, - fill: true, - fillColor: "#ffffff", - symbol: "circle", - radius: 5 - }, - shadowSize: 0 - }, - grid: { - hoverable: true, - clickable: true, - tickColor: "#f9f9f9", - borderWidth: 1, - borderColor: "#eeeeee" - }, - colors: ["#65CEA7", "#424F63"], - tooltip: true, - tooltipOpts: { - defaultTheme: false - }, - xaxis: { - mode: "time", - tickLength: 5, - timezone: "browser" // "browser" for local to the client or timezone for timezone-js - } - } - ); - } - }; - - // VISITORS CHART - // BY DEFAULT LAST 7 DAYS - (function () { - var from, to, today, dd, mm, yyyy, month, tz; - - today = new Date(); - today.setDate(today.getDate() + 1); - dd = today.getDate().toString().length < 2 ? '0' + today.getDate() : today.getDate(); - month = today.getMonth() + 1; //January is 0! - mm = month.toString().length < 2 ? '0' + month : month; - yyyy = today.getFullYear(); - to = yyyy + "-" + mm + "-" + dd; - - today.setDate(today.getDate() - 7); - dd = today.getDate().toString().length < 2 ? '0' + today.getDate() : today.getDate(); - month = today.getMonth() + 1; //January is 0! - mm = month.toString().length < 2 ? '0' + month : month; - yyyy = today.getFullYear(); - from = yyyy + "-" + mm + "-" + dd; - tz = -today.getTimezoneOffset()/60; - - $statistic.getVisitsDetail(from, to, tz).then( - function (data) { - renderVisitsChart(data); - $scope.visitorsChartData = data; - } - ); - })(); - - $scope.initSalesChart = function () { - if (!$scope.salesCharts) { - $scope.salesCharts = $.plot( - $('#sales-chart #sales-container'), [ - { - data: $scope.salesChartData, - label: "Page View", - lines: { - fill: true - } - } - ], - { - series: { - lines: { - show: true, - fill: false - }, - points: { - show: true, - lineWidth: 2, - fill: true, - fillColor: "#ffffff", - symbol: "circle", - radius: 5 - }, - shadowSize: 0 - }, - grid: { - hoverable: true, - clickable: true, - tickColor: "#f9f9f9", - borderWidth: 1, - borderColor: "#eeeeee" - }, - colors: ["#65CEA7", "#424F63"], - tooltip: true, - tooltipOpts: { - defaultTheme: false - }, - xaxis: { - mode: "time", - tickLength: 5, - timezone: "browser" // "browser" for local to the client or timezone for timezone-js - } - } - ); - } - }; - - // SALES CHART - // BY DEFAULT LAST 7 DAYS - (function () { - var from, to, today, dd, mm, yyyy, month, tz; - - today = new Date(); - today.setDate(today.getDate() + 1); - dd = today.getDate().toString().length < 2 ? '0' + today.getDate() : today.getDate(); - month = today.getMonth() + 1; //January is 0! - mm = month.toString().length < 2 ? '0' + month : month; - yyyy = today.getFullYear(); - to = yyyy + "-" + mm + "-" + dd; - - today.setDate(today.getDate() - 7); - dd = today.getDate().toString().length < 2 ? '0' + today.getDate() : today.getDate(); - month = today.getMonth() + 1; //January is 0! - mm = month.toString().length < 2 ? '0' + month : month; - yyyy = today.getFullYear(); - from = yyyy + "-" + mm + "-" + dd; - tz = -today.getTimezoneOffset()/60; - - $statistic.getSalesDetail(from, to, tz).then( - function (data) { - renderSalesChart(data); - $scope.salesChartData = data; - } - ); - })(); - - $scope.updateVisitsChart = function (period) { - var from, to, today, delta, dd, mm, month, yyyy, tz; - - var getDeltaValueForPeriod = function (period) { - var delta = {}; - - switch (period) { - case "today": - $scope.visitsPeriod = 'today'; - delta["to"] = 1; - delta["from"] = 1; - break; - case "yesterday": - $scope.visitsPeriod = 'yesterday'; - delta["to"] = 0; - delta["from"] = 1; - break; - case "week": - $scope.visitsPeriod = 'week'; - delta["to"] = 1; - delta["from"] = 7; - break; - case "month": - $scope.visitsPeriod = 'month'; - delta["to"] = 1; - delta["from"] = 31; - break; - default: - $scope.visitsPeriod = 'week'; - delta["to"] = 1; - delta["from"] = 7; - } - - return delta; - }; - - delta = getDeltaValueForPeriod(period); - - today = new Date(); - today.setDate(today.getDate() + delta["to"]); - dd = today.getDate().toString().length < 2 ? '0' + today.getDate() : today.getDate(); - month = today.getMonth() + 1; //January is 0! - mm = month.toString().length < 2 ? '0' + month : month; - yyyy = today.getFullYear(); - to = yyyy + "-" + mm + "-" + dd; - - today.setDate(today.getDate() - delta["from"]); - dd = today.getDate().toString().length < 2 ? '0' + today.getDate() : today.getDate(); - month = today.getMonth() + 1; //January is 0! - mm = month.toString().length < 2 ? '0' + month : month; - yyyy = today.getFullYear(); - from = yyyy + "-" + mm + "-" + dd; - tz = -today.getTimezoneOffset()/60; - - $statistic.getVisitsDetail(from, to, tz).then( - function (data) { - renderVisitsChart(data); - $scope.visitorsChartData = data; - } - ); - }; - - $scope.updateSalesChart = function (period) { - var from, to, today, delta, dd, mm, month, yyyy, tz; +angular.module("dashboardModule") + +.controller("dashboardMenuController", ["$scope", "$menuService", "$loginLoginService", function ($scope, $menuService, $loginLoginService) { + $scope.avatar = $loginLoginService.getAvatar(); + $scope.userName = $loginLoginService.getFullName() || "root"; + $scope.items = $menuService; +}]) + +.controller("dashboardController", [ +"$scope", +"$location", +"$dashboardStatisticService", +"$designImageService", +"$dashboardUtilsService", +"$timeout", +"moment", +function ($scope, $location, $statistic, $designImageService, $dashboardUtilsService, $timeout, moment) { + + //TODO: delete this when images are attached to products + $scope.getProductImage = function (image) { + return $designImageService.getFullImagePath("", image); + }; + + /* + Static Data Points + */ + + // TOP REFERRERS + $statistic.getReferrers().then(function (data) { + if (angular.isArray(data)) { + $scope.referrers = data; + } + }); - var getDeltaValueForPeriod = function (period) { - var delta = {}; + // Website Conversions + $statistic.getConversions().then(function (data) { + $scope.conversions = data; + }); - switch (period) { - case "today": - $scope.salesPeriod = 'today'; - delta["to"] = 1; - delta["from"] = 1; - break; - case "yesterday": - $scope.salesPeriod = 'yesterday'; - delta["to"] = 0; - delta["from"] = 1; - break; - case "week": - $scope.salesPeriod = 'week'; - delta["to"] = 1; - delta["from"] = 7; - break; - case "month": - $scope.salesPeriod = 'month'; - delta["to"] = 1; - delta["from"] = 31; - break; - default: - $scope.salesPeriod = 'week'; - delta["to"] = 1; - delta["from"] = 7; - } + // TOP SELLERS + $statistic.getTopSellers().then(function (data) { + $scope.topSellers = data; + }); - return delta; - }; - delta = getDeltaValueForPeriod(period); + /* + Live Data Points + */ + var pollingRate = 10 * 1000; // 10s - today = new Date(); - today.setDate(today.getDate() + delta["to"]); - dd = today.getDate().toString().length < 2 ? '0' + today.getDate() : today.getDate(); - month = today.getMonth() + 1; //January is 0! - mm = month.toString().length < 2 ? '0' + month : month; - yyyy = today.getFullYear(); - to = yyyy + "-" + mm + "-" + dd; - today.setDate(today.getDate() - delta["from"]); - dd = today.getDate().toString().length < 2 ? '0' + today.getDate() : today.getDate(); - month = today.getMonth() + 1; //January is 0! - mm = month.toString().length < 2 ? '0' + month : month; - yyyy = today.getFullYear(); - from = yyyy + "-" + mm + "-" + dd; - tz = -today.getTimezoneOffset()/60; + // Visit Stats + (function tick(){ + $statistic.getVisits().then(function (data) { + $scope.visitStats = data; + $scope.visitTimeout = $timeout(tick, pollingRate); + }); + })(); + $scope.$on('$locationChangeStart', function() { + $timeout.cancel($scope.visitTimeout); + }); - $statistic.getSalesDetail(from, to, tz).then( - function (data) { - renderSalesChart(data); - $scope.salesChartData = data; - } - ); - }; + // Sales Stats + (function tick(){ + $statistic.getSales().then(function (data) { + $scope.salesStats = data; + $scope.salesTimeout = $timeout(tick, pollingRate); + }); + })(); + $scope.$on('$locationChangeStart', function() { + $timeout.cancel($scope.salesTimeout); + }); - $scope.getProductImage = function (image) { - return $designImageService.getFullImagePath("", image); - }; + // Highcharts settings that we can't adjust from ngHighcharts + Highcharts.setOptions({ + global: { + timezoneOffset: 0 //default + }, + chart: { + spacingLeft: 15, + spacingRight: 0, + backgroundColor: 'rgba(0,0,0,0)' + }, + plotOptions: { + series: { + marker: { + enabled: false + } + } + }, + yAxis: { + labels: { + style: { + color: '#98978B' + } + } + }, + colors: [ + '#325D88', + '#DFD7CA' + ], + legend: { enabled: false }, + tooltip: { + formatter: function() { + return this.series.name + ' @ ' + moment.utc(this.x).format('ha') + ': ' + this.y; + } + } + }); + var graphSettings = { + options: { + chart: { + events: { + load: function() { + var self = this; + setTimeout(function() { + self.reflow(); + }, 0); + } + }, + type: 'line', + style: { + width: '100%' } - ]); - - return dashboardModule; - }); -})(window.define, jQuery); + } + }, + xAxis: { + type: 'datetime', + tickInterval: moment.duration(2, 'hour').asMilliseconds(), + tickAmount: 24, + labels: { + formatter: function () { + // return moment(this.value).format('ha'); + // console.log('moment',this.value, moment(this.value).format('HH:mm') ); + return moment.utc(this.value).format('ha') + } + } + }, + yAxis: { + min: 0, + minRange: 3, + allowDecimals: false, + title: { enabled: false }, + }, + series: [], + title: { text: '' }, + loading: false, + size: { + height: 260 + } + } + + // Copy these settings over + $scope.salesGraph = angular.copy(graphSettings); + $scope.visitorGraph = angular.copy(graphSettings); + + // Sales is in dollars, so update that label + $scope.salesGraph.yAxis.labels = {format : '${value}'}; + + + // TODO: Poll for data, commented out for now until we are sure we are reporting on + // good data, maybe we want to only poll for today too... + + // (function tick(){ + $statistic.getSalesDetail().then(function(dataSets){ + $scope.salesGraph.series = dataSets; + // console.log('SALES DATA', dataSets); + // $timeout(tick, pollingRate); + }); + // })(); + + // (function tick(){ + $statistic.getVisitsDetail().then(function(dataSets){ + $scope.visitorGraph.series = dataSets; + // console.log('VISITOR DATA', dataSets); + // $timeout(tick, pollingRate); + }); + // })(); + +}]); diff --git a/app/scripts/dashboard/directives/content.js b/app/scripts/dashboard/directives/content.js new file mode 100644 index 00000000..0824294e --- /dev/null +++ b/app/scripts/dashboard/directives/content.js @@ -0,0 +1,10 @@ +angular.module("dashboardModule") + +.directive('content', [function () { + return { + restrict: 'E', + templateUrl: function(elem,attr){ + return attr.src || "/themes/views/index.html" + } + }; +}]) \ No newline at end of file diff --git a/app/scripts/dashboard/init.js b/app/scripts/dashboard/init.js index 09d1ffbd..12ee2129 100644 --- a/app/scripts/dashboard/init.js +++ b/app/scripts/dashboard/init.js @@ -1,84 +1,139 @@ -(function (define) { - "use strict"; - - /* - * Angular "dashboardModule" declaration - * (module internal files refers to this instance) - */ - define([ - "angular", - "angular-route", - "angular-sanitize" - - // "login/module" - ], - function (angular) { - /* - * Angular "dashboardModule" declaration - */ - angular.module.dashboardModule = angular.module("dashboardModule", ["ngRoute", "loginModule", "ngSanitize", "designModule"]) - - .constant("REST_SERVER_URI", angular.appConfigValue("general.app.foundation_url")) - .constant("COUNT_ITEMS_PER_PAGE", angular.appConfigValue("general.app.item_per_page")) - - /* - * Basic routing configuration - */ - .config(["$routeProvider", "$httpProvider", function ($routeProvider, $httpProvider) { - $httpProvider.interceptors.push(function ($q) { - return { - 'response': function (response) { - if (typeof response.data.error !== "undefined" && - response.data.error !== null && - response.data.error.code === "0bc07b3d-1443-4594-af82-9d15211ed179") { - location.replace('/'); - } - return response; - }, - 'responseError': function (rejection) { - switch (rejection.status) { - case 401: - location.reload(); - break; - case 404: - console.warn("The server is unable to process this request - " + rejection.config.url); - break; - } - return $q.reject(rejection); - } - }; - }); - $routeProvider - .when("/", { - templateUrl: angular.getTheme("dashboard/welcome.html"), - controller: "dashboardController" - }) - .when("/help", { templateUrl: angular.getTheme("help.html")}) - - .otherwise({ redirectTo: "/"}); - }]) - - .run([ - "$rootScope", - "$route", - "$http", - "$designService", - "$dashboardSidebarService", - "$dashboardListService", - function ($rootScope, $route, $http, $designService, $dashboardSidebarService, DashboardListService) { - // ajax cookies support fix - $http.defaults.withCredentials = true; - delete $http.defaults.headers.common["X-Requested-With"]; - - $dashboardSidebarService.addItem("/dashboard", "Dashboard", "", "fa fa-home", 100); - - $rootScope.$list = new DashboardListService(); - - $route.reload(); +angular.module("dashboardModule", [ + // Angular + "ngRoute", + "ngResource", + "ngSanitize", + "ngAnimate", + + // Lib + "ui.odometer", + "highcharts-ng", + "moment", + + // Ottemo + "categoryModule", + "cmsModule", + "configModule", + "designModule", + "discountsModule", + "impexModule", + "loginModule", + "orderModule", + "productModule", + "seoModule", + "visitorModule" +]) + +.constant("REST_SERVER_URI", angular.appConfigValue("general.app.foundation_url")) +.constant("COUNT_ITEMS_PER_PAGE", angular.appConfigValue("general.app.item_per_page")) + +/* + * Basic routing configuration + */ +.config(["$routeProvider", "$httpProvider",'$locationProvider','$sceDelegateProvider', + function ($routeProvider, $httpProvider, $locationProvider, $sceDelegateProvider) { + + var otInterceptor = ['$q', + function ($q) { + return { + response: function (response) { + if (typeof response.data.error !== "undefined" && + response.data.error !== null && + response.data.error.code === "0bc07b3d-1443-4594-af82-9d15211ed179") { + location.replace('/'); + } + return response; + }, + responseError: function (rejection) { + switch (rejection.status) { + case 401: + location.reload(); + break; + case 404: + console.warn("The server is unable to process this request - " + rejection.config.url); + break; + } + return $q.reject(rejection); } - ]); + }; + }]; + + $httpProvider.interceptors.push(otInterceptor); + + function checkLoggedIn($q,$log,$loginLoginService){ + var def = $q.defer(); + + $loginLoginService.init().then(function(auth){ + + if (auth) + def.resolve(auth) + else { + // $location.url('/login'); + $log.error('Authentication required. Redirect to login.'); + def.reject({ needsAuthentication: true }); + def.reject(); + } + }) + + return def.promise + } + - return angular.module.dashboardModule; + $routeProvider.whenAuthenticated = function(path,route){ + route.resolve = route.resolve || {}; + + angular.extend(route.resolve, { + isLoggedIn: ['$q','$log', '$loginLoginService', checkLoggedIn] + }) + + return $routeProvider.when(path,route); + } + + $sceDelegateProvider.resourceUrlWhitelist([ + 'self', + angular.appConfigValue("general.app.foundation_url") + '/**' + ]); + + $routeProvider + .whenAuthenticated("/", { + templateUrl: "/themes/views/dashboard/welcome.html", + controller: "dashboardController" + }) + .when("/help", { + templateUrl: "/themes/views/help.html" + }) + + .otherwise({ redirectTo: "/"}); + + $locationProvider.html5Mode(true); +}]) + +.run([ + "$rootScope", + "$route", + "$http", + "$dashboardListService", + "$location", + "$log", + function ($rootScope, $route, $http, DashboardListService,$location,$log) { + // ajax cookies support fix + $http.defaults.withCredentials = true; + delete $http.defaults.headers.common["X-Requested-With"]; + + $rootScope.$list = new DashboardListService(); + + $route.reload(); + + $rootScope.$on('$routeChangeError', function (ev, current, previous, rejection) { + if (rejection && rejection.needsAuthentication === true) { + // redirect to login page + $location.url('/login'); + } }); -})(window.define); + // content loaded handler + $rootScope.$on('$routeChangeSuccess', function(res){ + $rootScope.contentLoaded = true; + }); + } +]); diff --git a/app/scripts/dashboard/loading-bar/loading.interceptor.js b/app/scripts/dashboard/loading-bar/loading.interceptor.js new file mode 100644 index 00000000..20e76b15 --- /dev/null +++ b/app/scripts/dashboard/loading-bar/loading.interceptor.js @@ -0,0 +1,128 @@ +angular.module("dashboardModule") + + +.config(['$httpProvider', function ($httpProvider) { + + var interceptor = ['$q', '$cacheFactory', '$timeout', '$rootScope', '$log', 'LoadingBar', + function ($q, $cacheFactory, $timeout, $rootScope, $log, LoadingBar) { + + /** + * The total number of requests made + */ + var reqsTotal = 0; + + /** + * The number of requests completed (either successfully or not) + */ + var reqsCompleted = 0; + + /** + * The amount of time spent fetching before showing the loading bar + */ + var latencyThreshold = LoadingBar.latencyThreshold; + + /** + * $timeout handle for latencyThreshold + */ + var startTimeout; + + + /** + * calls LoadingBar.complete() which removes the + * loading bar from the DOM. + */ + function setComplete() { + $timeout.cancel(startTimeout); + LoadingBar.complete(); + reqsCompleted = 0; + reqsTotal = 0; + } + + /** + * Determine if the response has already been cached + * @param {Object} config the config option from the request + * @return {Boolean} retrns true if cached, otherwise false + */ + function isCached(config) { + var cache; + var defaultCache = $cacheFactory.get('$http'); + var defaults = $httpProvider.defaults; + + // Choose the proper cache source. Borrowed from angular: $http service + if ((config.cache || defaults.cache) && config.cache !== false && + (config.method === 'GET' || config.method === 'JSONP')) { + cache = angular.isObject(config.cache) ? config.cache + : angular.isObject(defaults.cache) ? defaults.cache + : defaultCache; + } + + var cached = cache !== undefined ? + cache.get(config.url) !== undefined : false; + + if (config.cached !== undefined && cached !== config.cached) { + return config.cached; + } + config.cached = cached; + return cached; + } + + + return { + 'request': function(config) { + // Check to make sure this request hasn't already been cached and that + // the requester didn't explicitly ask us to ignore this request: + if (!config.ignoreLoadingBar && !isCached(config)) { + $rootScope.$broadcast('LoadingBar:loading', {url: config.url}); + if (reqsTotal === 0) { + startTimeout = $timeout(function() { + LoadingBar.start(); + }, latencyThreshold); + } + reqsTotal++; + LoadingBar.set(reqsCompleted / reqsTotal); + } + return config; + }, + + 'response': function(response) { + if (!response || !response.config) { + $log.error('Broken interceptor detected: Config object not supplied in response:\n https://github.com/chieffancypants/angular-loading-bar/pull/50'); + return response; + } + + if (!response.config.ignoreLoadingBar && !isCached(response.config)) { + reqsCompleted++; + $rootScope.$broadcast('LoadingBar:loaded', {url: response.config.url, result: response}); + if (reqsCompleted >= reqsTotal) { + setComplete(); + } else { + LoadingBar.set(reqsCompleted / reqsTotal); + } + } + return response; + }, + + 'responseError': function(rejection) { + if (!rejection || !rejection.config) { + $log.error('Broken interceptor detected: Config object not supplied in rejection:\n https://github.com/chieffancypants/angular-loading-bar/pull/50'); + return $q.reject(rejection); + } + + if (!rejection.config.ignoreLoadingBar && !isCached(rejection.config)) { + reqsCompleted++; + $rootScope.$broadcast('LoadingBar:loaded', {url: rejection.config.url, result: rejection}); + if (reqsCompleted >= reqsTotal) { + setComplete(); + } else { + LoadingBar.set(reqsCompleted / reqsTotal); + } + } + return $q.reject(rejection); + } + }; + + }]; + + $httpProvider.interceptors.push(interceptor); + +}]); \ No newline at end of file diff --git a/app/scripts/dashboard/loading-bar/loading.provider.js b/app/scripts/dashboard/loading-bar/loading.provider.js new file mode 100644 index 00000000..07e098d9 --- /dev/null +++ b/app/scripts/dashboard/loading-bar/loading.provider.js @@ -0,0 +1,166 @@ +angular.module("dashboardModule") + +.provider('LoadingBar', function() { + + this.includeSpinner = false; + this.includeBar = true; + this.latencyThreshold = 100; + this.startSize = 0.02; + this.parentSelector = 'body'; + this.spinnerTemplate = '
'; + this.loadingBarTemplate = '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'; + + this.$get = ['$injector', '$document', '$timeout', '$rootScope', function ($injector, $document, $timeout, $rootScope) { + var $animate; + var $parentSelector = this.parentSelector, + loadingBarContainer = angular.element(this.loadingBarTemplate), + // loadingBar = loadingBarContainer.find('div').eq(0), + loadingBar = loadingBarContainer.find('div').eq(1), + spinner = angular.element(this.spinnerTemplate); + + var incTimeout, + completeTimeout, + started = false, + status = 0; + + var includeSpinner = this.includeSpinner; + var includeBar = this.includeBar; + var startSize = this.startSize; + + /** + * Inserts the loading bar element into the dom, and sets it to 2% + */ + function _start() { + if (!$animate) { + $animate = $injector.get('$animate'); + } + + var $parent = $document.find($parentSelector).eq(0); + $timeout.cancel(completeTimeout); + + // do not continually broadcast the started event: + if (started) { + return; + } + + $rootScope.$broadcast('LoadingBar:started'); + started = true; + + if (includeBar) { + $animate.enter(loadingBarContainer, $parent, angular.element($parent[0].lastChild)); + } + + if (includeSpinner) { + $animate.enter(spinner, $parent, angular.element($parent[0].lastChild)); + } + + _set(startSize); + } + + /** + * Set the loading bar's width to a certain percent. + * + * @param n any value between 0 and 1 + */ + function _set(n) { + if (!started) { + return; + } + var pct = (n * 100) + '%'; + loadingBar.css('width', pct); + status = n; + + // increment loadingbar to give the illusion that there is always + // progress but make sure to cancel the previous timeouts so we don't + // have multiple incs running at the same time. + $timeout.cancel(incTimeout); + incTimeout = $timeout(function() { + _inc(); + }, 250); + } + + /** + * Increments the loading bar by a random amount + * but slows down as it progresses + */ + function _inc() { + if (_status() >= 1) { + return; + } + + var rnd = 0; + + // TODO: do this mathmatically instead of through conditions + + var stat = _status(); + if (stat >= 0 && stat < 0.25) { + // Start out between 3 - 6% increments + rnd = (Math.random() * (5 - 3 + 1) + 3) / 100; + } else if (stat >= 0.25 && stat < 0.65) { + // increment between 0 - 3% + rnd = (Math.random() * 3) / 100; + } else if (stat >= 0.65 && stat < 0.9) { + // increment between 0 - 2% + rnd = (Math.random() * 2) / 100; + } else if (stat >= 0.9 && stat < 0.99) { + // finally, increment it .5 % + rnd = 0.005; + } else { + // after 99%, don't increment: + rnd = 0; + } + + var pct = _status() + rnd; + _set(pct); + } + + function _status() { + return status; + } + + function _completeAnimation() { + status = 0; + started = false; + } + + function _complete() { + if (!$animate) { + $animate = $injector.get('$animate'); + } + + $rootScope.$broadcast('LoadingBar:completed'); + _set(1); + + $timeout.cancel(completeTimeout); + + // Attempt to aggregate any start/complete calls within 500ms: + completeTimeout = $timeout(function() { + var promise = $animate.leave(loadingBarContainer, _completeAnimation); + if (promise && promise.then) { + promise.then(_completeAnimation); + } + $animate.leave(spinner); + }, 500); + } + + return { + start : _start, + set : _set, + status : _status, + inc : _inc, + complete : _complete, + includeSpinner : this.includeSpinner, + latencyThreshold : this.latencyThreshold, + parentSelector : this.parentSelector, + startSize : this.startSize + }; + + + }] // + +}); \ No newline at end of file diff --git a/app/scripts/dashboard/module.js b/app/scripts/dashboard/module.js deleted file mode 100644 index 5a263aaa..00000000 --- a/app/scripts/dashboard/module.js +++ /dev/null @@ -1,23 +0,0 @@ -(function (define) { - "use strict"; - - /* - * requireJS module entry point - * (to use that module you should include it to main.js) - */ - define([ - "dashboard/controllers", - - "dashboard/service/api", - "dashboard/service/header", - "dashboard/service/sidebar", - "dashboard/service/statistic", - "dashboard/service/utils", - "dashboard/service/list" - ], - function (dashboardModule) { - - return dashboardModule; - }); - -})(window.define); \ No newline at end of file diff --git a/app/scripts/dashboard/service/api.js b/app/scripts/dashboard/service/api.js index 22c934a9..4e4b9e67 100644 --- a/app/scripts/dashboard/service/api.js +++ b/app/scripts/dashboard/service/api.js @@ -1,61 +1,49 @@ -(function (define) { - "use strict"; - - /** - * - */ - define(["dashboard/init"], function (dashboardModule) { - dashboardModule - /** - * $dashboardApiService interaction service - */ - .service("$dashboardApiService", ["$resource", "REST_SERVER_URI", function ($resource, REST_SERVER_URI) { - return $resource(REST_SERVER_URI, {}, - { - "getReferrers": { - method: "GET", - url: REST_SERVER_URI + "/rts/referrers" - }, - "getVisits": { - method: "GET", - url: REST_SERVER_URI + "/rts/visits" - }, - "getConversions": { - method: "GET", - url: REST_SERVER_URI + "/rts/conversion" - }, - "getVisitsDetails": { - method: "GET", - params: { - "from": "@from", - "to": "@to" - }, - url: REST_SERVER_URI + "/rts/visits/detail/:from/:to" - }, - "getSales": { - method: "GET", - url: REST_SERVER_URI + "/rts/sales" - }, - "getSalesDetails": { - method: "GET", - params: { - "from": "@from", - "to": "@to" - }, - url: REST_SERVER_URI + "/rts/sales/detail/:from/:to" - }, - "getTopSellers": { - method: "GET", - url: REST_SERVER_URI + "/rts/bestsellers" - }, - "getVisitorsOnline": { - method: "GET", - url: REST_SERVER_URI + "/rts/visits/realtime" - } - }); - }]); - - return dashboardModule; - }); - -})(window.define); \ No newline at end of file +angular.module("dashboardModule") +/** +* $dashboardApiService interaction service +*/ +.service("$dashboardApiService", ["$resource", "REST_SERVER_URI", function ($resource, REST_SERVER_URI) { + return $resource(REST_SERVER_URI, {}, + { + "getReferrers": { + method: "GET", + url: REST_SERVER_URI + "/rts/referrers" + }, + "getVisits": { + method: "GET", + url: REST_SERVER_URI + "/rts/visits" + }, + "getConversions": { + method: "GET", + url: REST_SERVER_URI + "/rts/conversion" + }, + "getVisitsDetails": { + method: "GET", + params: { + "from": "@from", + "to": "@to" + }, + url: REST_SERVER_URI + "/rts/visits/detail/:from/:to" + }, + "getSales": { + method: "GET", + url: REST_SERVER_URI + "/rts/sales" + }, + "getSalesDetails": { + method: "GET", + params: { + "from": "@from", + "to": "@to" + }, + url: REST_SERVER_URI + "/rts/sales/detail/:from/:to" + }, + "getTopSellers": { + method: "GET", + url: REST_SERVER_URI + "/rts/bestsellers" + }, + "getVisitorsOnline": { + method: "GET", + url: REST_SERVER_URI + "/rts/visits/realtime" + } + }); +}]); \ No newline at end of file diff --git a/app/scripts/dashboard/service/header.js b/app/scripts/dashboard/service/header.js deleted file mode 100644 index 552bd5ac..00000000 --- a/app/scripts/dashboard/service/header.js +++ /dev/null @@ -1,150 +0,0 @@ -(function (define) { - "use strict"; - - /* - * HTML top page header manipulation stuff - */ - define([ - "dashboard/init" - ], - function (dashboardModule) { - - var getParentItem, parentItem, transformMenu, prepareLink; - getParentItem = function (data, field, value) { - for (var i in data) { - if (data.hasOwnProperty(i)) { - if (data[i][field] === value) { - parentItem = data[i]; - } - var $subList = data[i].items; - if ($subList) { - getParentItem($subList, field, value); - } - } - } - - return parentItem; - }; - - /** - * Transforms simple array with menu items to the object array which includes array subitems - * and returns this array - * - * @param menu - * @returns {Array} - */ - transformMenu = function (menu) {// jshint ignore:line - var i, item, parentPath, tmpMenu; - tmpMenu = []; - menu.sort(function (obj1, obj2) { - return obj2.path < obj1.path; - }); - - for (i in menu) { - if (menu.hasOwnProperty(i)) { - parentItem = undefined; - item = menu[i]; - /** - * Item belongs to the upper level. - * He has only one level in path - */ - if (item.path.split("/").length <= 2) { - tmpMenu.push(item); - } else { - /** - * Gets from path parent path - * Exaample: - * for this item with path - * /item_1/sub_item_1/sub_item_1_1 - * - * parent item should have path - * /item_1/sub_item_1 - * - * @type {string} - */ - parentPath = item.path.substr(0, item.path.lastIndexOf("/")); - if (getParentItem(menu, "path", parentPath)) { - if (typeof parentItem.items === "undefined") { - parentItem.items = []; - } - parentItem.items.push(item); - } - } - } - } - return tmpMenu; - }; - - prepareLink = function (link) { - var fullUrlRegex, href; - fullUrlRegex = new RegExp("^http|https.", "i"); - - if (fullUrlRegex.test(link)) { - href = link; - } else { - href = (link !== null ? "#" + link : null); - } - - return href; - }; - - dashboardModule - /* - * $pageHeaderService implementation - */ - .service("$dashboardHeaderService", ["$loginLoginService", function ($loginLoginService) { - - var it = { - menuLeft: [], - menuRight: [] - }; - - return { - - getUsername: function () { - return $loginLoginService.getFullName() || "root"; - }, - - getAvatar: function () { - return $loginLoginService.getAvatar(); - }, - - - /** - * Adds the item to the right(user) menu - * - * @param {string} path - * @param {string} label - * @param {string} link - */ - addMenuRightItem: function (path, label, link) { - var item = {path: path, label: label, link: prepareLink(link)}; - it.menuRight.push(item); - }, - - getMenuRight: function () { - return transformMenu(it.menuRight); - }, - - /** - * Adds the item to the top menu - * - * @param {string} path - * @param {string} label - * @param {string} link - */ - addMenuItem: function (path, label, link) { - var item = {path: path, label: label, link: prepareLink(link)}; - it.menuLeft.push(item); - }, - - getMenuLeft: function () { - return transformMenu(it.menuLeft); - } - }; - }]); - - return dashboardModule; - }); - -})(window.define); \ No newline at end of file diff --git a/app/scripts/dashboard/service/list.js b/app/scripts/dashboard/service/list.js index 5666582d..a297cbd6 100644 --- a/app/scripts/dashboard/service/list.js +++ b/app/scripts/dashboard/service/list.js @@ -1,263 +1,243 @@ -(function (define) { - "use strict"; - - /** - * - */ - define([ - "dashboard/init" - ], - function (dashboardModule) { - - dashboardModule - /** - * $dashboardListService implementation - */ - .service("$dashboardListService", ["$routeParams", function ($routeParams) { - return function () { - // Variables - var ID, filters, attributes, fields, isInitFields; - - // Functions - var init, getFilter, getFields, setAttributes, getAttributes, getList, getExtraFields; - - filters = { - "text": "text", - "line_text": "text", - "boolean": "select{'false':\"False\",'true':\"True\"}", - "select": "select", - "selector": "select", - "multi_select": "select", - "price": "range", - "numeric": "range" - }; - - isInitFields = false; - - init = function (_id) { - if (ID !== _id) { - isInitFields = false; - ID = _id; - } - }; - - setAttributes = function (attr) { - attributes = attr; - - return attributes; - }; - - getAttributes = function () { - return attributes; - }; +angular.module("dashboardModule") +/** +* $dashboardListService implementation +*/ +.service("$dashboardListService", ["$routeParams", function ($routeParams) { + return function () { + // Variables + var ID, filters, attributes, fields, isInitFields; + + // Functions + var init, getFilter, getFields, setAttributes, getAttributes, getList, getExtraFields; + + filters = { + "text": "text", + "line_text": "text", + "boolean": "select{'false':\"False\",'true':\"True\"}", + "select": "select", + "selector": "select", + "multi_select": "select", + "price": "range", + "numeric": "range", + "date_range": "date_range" + }; + + isInitFields = false; + + init = function (_id) { + if (ID !== _id) { + isInitFields = false; + ID = _id; + } + }; + + setAttributes = function (attr) { + attributes = attr; + + return attributes; + }; + + getAttributes = function () { + return attributes; + }; + + getFilter = function (attribute) { + + var editor = attribute.Editors; + if (-1 !== ["selector", "select", "multi_select"].indexOf(editor)) { + + try { + JSON.parse(attribute.Options.replace(/'/g, "\"")); + return filters[editor] + attribute.Options; - getFilter = function (attribute) { - var editor = attribute.Editors; - if (-1 !== ["selector", "select", "multi_select"].indexOf(editor)) { - - try { - JSON.parse(attribute.Options.replace(/'/g, "\"")); - return filters[editor] + attribute.Options; - } - catch (e) { - var options = {}; - var parts = attribute.Options.split(","); - for (var i = 0; i < parts.length; i += 1) { - options[parts[i]] = parts[i]; - } - return filters[editor] + JSON.stringify(options); + } + catch (e) { + var options = {}; + var parts = attribute.Options.split(","); + for (var i = 0; i < parts.length; i += 1) { + options[parts[i]] = parts[i]; + } + return filters[editor] + JSON.stringify(options); + } + } + + if (['datetime'].indexOf(attribute.Type) >= 0){ + return 'date_range'; + } + + return filters[editor]; + }; + + + /* showColumns Define set of attributes that will be added to fields list value + fields used to define persistence of columns in table. + showColumns object of objects that contains: + - key as an attribute name + - object: {} when no parameters + - key: custom parameters name + - value: it's value + + Attributes that can be specified: + "attribute" "visible" "type" "notDisable" + "label" "filter" "dataType" "filterValue" + + Example: showColumns = { + 'identifier' : {'type' : 'select-link','notDisable' : true}, + 'enabled' : {} + }; + If showColumns not specified fields will be filled by editable attributes. + */ + // TODO: Refactor, too complex + // also if we could pass in an array we could control the order of the fields + // from the request. + getFields = function (showColumns) { + + if (isInitFields) { + for (var j = 0; j < fields.length; j += 1) { + fields[j].filterValue = $routeParams[fields[j].attribute]; + } + return fields; + } + + fields = []; + + var prepareGroups = function () { + var j, attributeName; + + // use showColumns if it have specified attributes to show + if (showColumns && showColumns !== "null" && showColumns!== "undefined") { + for (j = 0; j < attributes.length; j += 1) { + attributeName = attributes[j].Attribute; + if (-1 !== Object.keys(showColumns).indexOf(attributeName) || (!attributes[j].IsStatic && -1 !== Object.keys(filters).indexOf(attributes[j].Editors))){ + // default set of params for object + var obj = { + "attribute": attributeName, + "type": "string", + "label": attributes[j].Label, + "dataType": attributes[j].Type, + "visible": true, + "notDisable": false, + "filter": getFilter(attributes[j]), + "filterValue": $routeParams[attributes[j].Attribute] + }; + // add properties defined in controller + for (var attributeKeys in showColumns[attributeName]) { + if ( obj.hasOwnProperty(attributeKeys) ) { + obj[attributeKeys] = showColumns[attributeName][attributeKeys]; } } - - return filters[editor]; - }; - - - /* showColumns Define set of attributes that will be added to fields list value - fields used to define persistence of columns in table. - showColumns object of objects that contains: - - key as an attribute name - - object: {} when no parameters - - key: custom parameters name - - value: it's value - - Attributes that can be specified: - "attribute" "visible" "type" "notDisable" - "label" "filter" "dataType" "filterValue" - - Example: showColumns = { - 'identifier' : {'type' : 'select-link','notDisable' : true}, - 'enabled' : {} - }; - If showColumns not specified fields will be filled by editable attributes. - */ - getFields = function (showColumns) { - /*jshint maxcomplexity:false */ - if (isInitFields) { - for (var j = 0; j < fields.length; j += 1) { - fields[j].filterValue = $routeParams[fields[j].attribute]; - } - return fields; + // check is it a main column type and it's persistence + if (obj['type'] !== "select-link"){ + fields.push(obj); + } else { + obj["visible"] = true; + obj["notDisable"] = true; + fields.unshift(obj); } + } + } + } + }; + + prepareGroups(); + isInitFields = true; + return fields; + }; + + getList = function (oldList) { + var getOptions, substituteKeyToValue, prepareList, regExp; + regExp = new RegExp("({.+})", "i"); + getOptions = function (opt) { + var options = {}; + + if (typeof opt === "string") { + try { + options = JSON.parse(opt.replace(/'/g, "\"")); + } + catch (e) { + var parts = opt.split(","); + for (var i = 0; i < parts.length; i += 1) { + options[parts[i]] = parts[i]; + } + } + } else { + options = opt; + } - fields = []; - - var prepareGroups = function () { - var hasMainColumn, j, attributeName; - - hasMainColumn = false; - // use showColumns if it have specified attributes to show - if (showColumns && showColumns !== "null" && showColumns!== "undefined") { - for (j = 0; j < attributes.length; j += 1) { - attributeName = attributes[j].Attribute; - if (-1 !== Object.keys(showColumns).indexOf(attributeName) || (!attributes[j].IsStatic && -1 !== Object.keys(filters).indexOf(attributes[j].Editors))){ - // default set of params for object - var obj = { - "attribute": attributeName, - "type": "string", - "label": attributes[j].Label, - "dataType": attributes[j].Type, - "visible": true, - "notDisable": false, - "filter": getFilter(attributes[j]), - "filterValue": $routeParams[attributes[j].Attribute] - }; - // add properties defined in controller - for (var attributeKeys in showColumns[attributeName]) { - if ( obj.hasOwnProperty(attributeKeys) ) { - obj[attributeKeys] = showColumns[attributeName][attributeKeys]; - } - } - // check is it a main column type and it's persistence - if (obj['type'] !== "select-link"){ - fields.push(obj); - } else { - obj["visible"] = true; - obj["notDisable"] = true; - fields.unshift(obj); - hasMainColumn = true; - } - } - } - } - // add column Name as default for non specified main column - if (!hasMainColumn) { - fields.unshift({ - "attribute": "Name", - "type": "select-link", - "dataType": "text", - "label": "Name", - "visible": true, - "notDisable": true - }); - } - }; - - prepareGroups(); - isInitFields = true; - return fields; - }; - - getList = function (oldList) { - var getOptions, substituteKeyToValue, prepareList, regExp; - regExp = new RegExp("({.+})", "i"); - getOptions = function (opt) { - var options = {}; - - if (typeof opt === "string") { - try { - options = JSON.parse(opt.replace(/'/g, "\"")); - } - catch (e) { - var parts = opt.split(","); - for (var i = 0; i < parts.length; i += 1) { - options[parts[i]] = parts[i]; - } - } - } else { - options = opt; - } - - return options; - }; + return options; + }; - substituteKeyToValue = function (attribute, jsonStr) { - var options = getOptions(jsonStr); - var replace = function (key) { - return options[key]; - }; + substituteKeyToValue = function (attribute, jsonStr) { + var options = getOptions(jsonStr); + var replace = function (key) { + return options[key]; + }; - for (var i = 0; i < oldList.length; i += 1) { - if (oldList[i].Extra === null) { - continue; - } - if (oldList[i].Extra[attribute] instanceof Array) { + for (var i = 0; i < oldList.length; i += 1) { + if (oldList[i].Extra === null) { + continue; + } + if (oldList[i].Extra[attribute] instanceof Array) { - oldList[i].Extra[attribute] = oldList[i].Extra[attribute].map(replace); - oldList[i].Extra[attribute] = oldList[i].Extra[attribute].join(", "); + oldList[i].Extra[attribute] = oldList[i].Extra[attribute].map(replace); + oldList[i].Extra[attribute] = oldList[i].Extra[attribute].join(", "); - } else if (typeof options[oldList[i].Extra[attribute]] !== "undefined") { - oldList[i].Extra[attribute] = options[oldList[i].Extra[attribute]]; - } - } - }; + } else if (typeof options[oldList[i].Extra[attribute]] !== "undefined") { + oldList[i].Extra[attribute] = options[oldList[i].Extra[attribute]]; + } + } + }; - prepareList = function () { - var i, j, getOptionsData; - - getOptionsData = function (field, attr) { - var match; - match = field.filter.match(regExp); - if (match === null) { - return attr.Options; - } else { - return match[1]; - } - }; - - for (i = 0; i < fields.length; i += 1) { - if (typeof fields[i].filter !== "undefined" && -1 !== fields[i].filter.indexOf("select")) { - - for (j = 0; j < attributes.length; j += 1) { - if (fields[i].attribute === attributes[j].Attribute) { - - substituteKeyToValue(fields[i].attribute, getOptionsData(fields[i], attributes[j])); - } - } - } - } + prepareList = function () { + var i, j, getOptionsData; - return oldList; - }; + getOptionsData = function (field, attr) { + var match; + match = field.filter.match(regExp); + if (match === null) { + return attr.Options; + } else { + return match[1]; + } + }; - return prepareList(); - }; + for (i = 0; i < fields.length; i += 1) { + if (typeof fields[i].filter !== "undefined" && -1 !== fields[i].filter.indexOf("select")) { - getExtraFields = function () { - var arr, i; - arr = []; + for (j = 0; j < attributes.length; j += 1) { + if (fields[i].attribute === attributes[j].Attribute) { - for (i = 0; i < fields.length; i += 1) { - if (fields[i].attribute !== "Name") { - arr.push(fields[i].attribute); - } + substituteKeyToValue(fields[i].attribute, getOptionsData(fields[i], attributes[j])); } - return arr.join(","); - }; - - return { - "init": init, - "getExtraFields": getExtraFields, - "setAttributes": setAttributes, - "getAttributes": getAttributes, - "getFields": getFields, - "getList": getList - }; - }; + } + } } - ]); - return dashboardModule; - }); + return oldList; + }; -})(window.define); + return prepareList(); + }; + + getExtraFields = function () { + var arr, i; + arr = []; + + for (i = 0; i < fields.length; i += 1) { + if (fields[i].attribute !== "Name") { + arr.push(fields[i].attribute); + } + } + return arr.join(","); + }; + + return { + "init": init, + "getExtraFields": getExtraFields, + "setAttributes": setAttributes, + "getAttributes": getAttributes, + "getFields": getFields, + "getList": getList + }; + }; +}]); diff --git a/app/scripts/dashboard/service/menu.js b/app/scripts/dashboard/service/menu.js new file mode 100644 index 00000000..291eb1ad --- /dev/null +++ b/app/scripts/dashboard/service/menu.js @@ -0,0 +1,120 @@ +// TODO: +// * monitor route change: +// * add "active:true" to matching menu item, instead of with $ +// * add "afix" class to body when menu is open, so that the body doesn't scroll +// * let the menu scroll +// +angular.module("dashboardModule") + +.service("$menuService", [function () { + + // We have these routes and pages floating around as well + + // { + // "title": "Gallery", + // "link": "/cms/gallery", + // "icon": "" + // } + + var menu = [ + { + "title": "Dashboard", + "link": "/", + "icon": "fa-home" + }, + { + "title": "Orders", + "link": "/orders", + "icon": "fa-list-alt" + }, + { + "title": "Products", + "link": null, + "icon": "fa-tags", + "children": [ + { + "title": "Products", + "link": "/products" + }, + { + "title": "Attributes", + "link": "/attributes" + } + ] + }, + { + "title": "Categories", + "link": "/categories", + "icon": "fa-list" + }, + { + "title": "Discounts", + "link": "/discounts", + "icon": "fa-scissors" + }, + { + "title": "Visitors", + "link": null, + "icon": "fa-users", + "children": [ + { + "title": "Visitors", + "link": "/visitors" + }, + { + "title": "Attributes", + "link": "/v/attributes" + }, + { + "title": "Email", + "link": "/emails" + }, + ] + }, + { + "title": "CMS", + "link": null, + "icon": "fa-file-text-o", + "children": [ + { + "title": "Page", + "link": "/cms/pages" + }, + { + "title": "Block", + "link": "/cms/blocks" + } + ] + }, + { + "title": "URL Rewrite", + "link": "/seo", + "icon": "fa-random" + }, + { + "title": "Settings", + "link": null, + "icon": "fa-cog", + "children": [ + { + "title": "General", + "link": "/settings/general" + }, + { + "title": "Payment", + "link": "/settings/payment" + }, + { + "title": "Shipping", + "link": "/settings/shipping" + }, + { + "title": "Import / Export", + "link": "/impex" + } + ] + } + ]; + + return menu; +}]); diff --git a/app/scripts/dashboard/service/sidebar.js b/app/scripts/dashboard/service/sidebar.js deleted file mode 100644 index 940afd76..00000000 --- a/app/scripts/dashboard/service/sidebar.js +++ /dev/null @@ -1,184 +0,0 @@ -(function (define) { - "use strict"; - - /* - * HTML top page header manipulation stuff - */ - define([ - "dashboard/init" - ], - function (dashboardModule) { - - var getParentItem, parentItem, transformMenu; - - getParentItem = function (data, field, value) { - for (var i in data) { - if (data.hasOwnProperty(i)) { - if (data[i][field] === value) { - parentItem = data[i]; - } - var $subList = data[i].items; - if ($subList) { - getParentItem($subList, field, value); - } - } - } - - return parentItem; - }; - - /** - * Transforms simple array with menu items to the object array which includes array subitems - * and returns this array - * - * @param menu - * @returns {Array} - */ - transformMenu = function (menu) {// jshint ignore:line - var i, item, parentPath, tmpMenu; - tmpMenu = []; - menu.sort(function (obj1, obj2) { - return obj2.path < obj1.path; - }); - - for (i in menu) { - if (menu.hasOwnProperty(i)) { - parentItem = undefined; - item = menu[i]; - /** - * Item belongs to the upper level. - * He has only one level in path - */ - if (item.path.split("/").length <= 2) { - tmpMenu.push(item); - } else { - /** - * Gets from path parent path - * Exaample: - * for this item with path - * /item_1/sub_item_1/sub_item_1_1 - * - * parent item should have path - * /item_1/sub_item_1 - * - * @type {string} - */ - parentPath = item.path.substr(0, item.path.lastIndexOf("/")); - if (getParentItem(menu, "path", parentPath)) { - if (typeof parentItem.items === "undefined") { - parentItem.items = []; - } - parentItem.items.push(item); - } - } - } - } - return tmpMenu; - }; - - dashboardModule - /* - * $pageSidebarService implementation - */ - .service("$dashboardSidebarService", [function () { - var addItem, getItems, getType, items, isImagePathRegex, transformedItems; - items = []; - transformedItems = null; - isImagePathRegex = new RegExp(".gif|png|jpg|ico$", "i"); - - /** - * Adds item in the left sidebar - * - * @param {string} title - * @param {string} link - * @param {string} _class - * @param {number} sort - The list will be displayed in descending order by this field - */ - addItem = function (path, title, link, icon, sort) { - var prepareLink; - - prepareLink = function (p) { - var result; - - if(null === p){ - return p; - } - - if ("/" !== p[0]) { - result = "#/" + p; - } else { - result = "#" + p; - } - - return result; - }; - - sort = ( sort || 0 ); - - items.push({ - "path": path, - "title": title, - "link": prepareLink(link), - "icon": icon, - "sort": sort}); - }; - - /** - * Gets items for left sidebar - * - * @returns {Array} - */ - getItems = function () { - if(transformedItems !== null){ - return transformedItems; - } - - transformedItems = transformMenu(items); - - var recursiveSort = function(arr){ - arr.sort(function (a, b) { - if(typeof a.items !== "undefined" && a.items.length > 0){ - recursiveSort(a.items); - } - if(typeof b.items !== "undefined" && b.items.length > 0){ - recursiveSort(b.items); - } - return a.sort < b.sort; - }); - }; - - recursiveSort(transformedItems); - - return transformedItems; - }; - - /** - * - * @param {string} icon - * @returns {string} - */ - getType = function (icon) { - var type; - type = "class"; - - if (isImagePathRegex.test(icon) === true) { - type = "image"; - } - if (icon.indexOf("glyphicon") !== -1) { - type = "glyphicon"; - } - - return type; - }; - - return { - addItem: addItem, - getItems: getItems, - getType: getType - }; - }]); - - return dashboardModule; - }); - -})(window.define); \ No newline at end of file diff --git a/app/scripts/dashboard/service/statistic.js b/app/scripts/dashboard/service/statistic.js index decdd905..9f00d251 100644 --- a/app/scripts/dashboard/service/statistic.js +++ b/app/scripts/dashboard/service/statistic.js @@ -1,296 +1,168 @@ -(function (define) { - "use strict"; - - /** - * - */ - define([ - "dashboard/init" - ], - function (dashboardModule) { - - dashboardModule - /** - * $dashboardStatisticService implementation - */ - .service("$dashboardStatisticService", [ - "$dashboardApiService", - "$q", - function ($api, $q) { - - var getVisitorsOnline, getTopSellers, getReferrers, getVisits, getSales, getVisitsDetail, getSalesDetail, getConversions; - - getReferrers = function () { - var defer; - defer = $q.defer(); - - $api.getReferrers().$promise.then(function (response) { - var result, url, referrers; - - result = response.result || []; - referrers = []; - - if (null === response.error) { - for (url in result) { - if (result.hasOwnProperty(url)) { - referrers.push({ - "url": url, - "count": result[url] - }); - } - } - referrers = referrers.sort(function (a, b) { - return a.count < b.count; - }); - defer.resolve(referrers); - } else { - defer.resolve(referrers); - } - }); - - return defer.promise; - }; - - getVisits = function () { - var defer, today, tz; - defer = $q.defer(); - today = new Date(); - tz = -today.getTimezoneOffset()/60; - - $api.getVisits({"tz": tz}).$promise.then(function (response) { - var result, visits; - - result = response.result || []; - visits = { - "visitsToday": 0, - "ratio": 0, - "higher": true, - "lower": false - }; - - if (null === response.error) { - visits = { - "visitsToday": result.visitsToday, - "ratio": Math.round((Math.abs(result.ratio) * 100) * 100) / 100, - "higher": result.ratio >= 0, - "lower": result.ratio < 0 - }; - - defer.resolve(visits); - } else { - defer.resolve(visits); - } - }); - - return defer.promise; - }; - - getSales = function () { - var defer, today, tz; - defer = $q.defer(); - today = new Date(); - tz = -today.getTimezoneOffset()/60; - - $api.getSales({"tz": tz}).$promise.then(function (response) { - var result, sales; - - result = response.result || []; - sales = { - "salesToday": 0, - "ratio": 0, - "higher": true, - "lower": false - }; - - if (null === response.error) { - sales = { - "salesToday": result.today, - "ratio": Math.round((Math.abs(result.ratio) * 100) * 100) / 100, - "higher": result.ratio >= 0, - "lower": result.ratio < 0 - }; - - defer.resolve(sales); - } else { - defer.resolve(sales); - } - }); - - return defer.promise; - }; - - getVisitsDetail = function (from, to, tz) { - var defer; - defer = $q.defer(); - - $api.getVisitsDetails({ - "from": from, - "to": to, - "tz": tz - }).$promise.then(function (response) { - var result, timestamp, dataChart; - - result = response.result || []; - dataChart = []; - - if (null === response.error) { - for (timestamp in result) { - if (result.hasOwnProperty(timestamp)) { - dataChart.push([timestamp * 1000, result[timestamp]]); - } - } - - defer.resolve(dataChart); - } else { - defer.resolve(dataChart); - } - }); - - return defer.promise; - }; - - getSalesDetail = function (from, to, tz) { - var defer; - defer = $q.defer(); - - $api.getSalesDetails({ - "from": from, - "to": to, - "tz": tz - }).$promise.then(function (response) { - var result, timestamp, dataChart; - - result = response.result || []; - dataChart = []; - - if (null === response.error) { - for (timestamp in result) { - if (result.hasOwnProperty(timestamp)) { - dataChart.push([timestamp * 1000, result[timestamp]]); - } - } - - defer.resolve(dataChart); - } else { - defer.resolve(dataChart); - } - }); - - return defer.promise; - }; - - getConversions = function () { - var defer, getPercents, today, tz; - defer = $q.defer(); - today = new Date(); - tz = -today.getTimezoneOffset()/60; - - getPercents = function (val, total) { - return Math.round((Math.abs(val/total) * 100) * 100) / 100 || 0; - }; - - $api.getConversions({"tz": tz}).$promise.then(function (response) { - var result, conversion; - - result = response.result || []; - conversion = {}; - - if (null === response.error) { - conversion.addedToCart = result["addedToCart"]; - conversion.addedToCartPercent = getPercents(result["addedToCart"], result["totalVisitors"]); - - conversion.purchased = result["purchased"]; - conversion.purchasedPercent = getPercents(result["purchased"], result["totalVisitors"]); - - conversion.reachedCheckout = result["reachedCheckout"]; - conversion.reachedCheckoutPercent = getPercents(result["reachedCheckout"], result["totalVisitors"]); - - conversion.totalVisitors = result["totalVisitors"]; - } - - defer.resolve(conversion); - }); - - return defer.promise; - }; - - getTopSellers = function () { - var defer; - defer = $q.defer(); - - $api.getTopSellers().$promise.then(function (response) { - var result, topSellers; - - result = response.result || []; - topSellers = []; - - if (null === response.error) { - for (var productId in result) { - if (result.hasOwnProperty(productId)) { - topSellers.push({ - "id": productId, - "name": result[productId]["Name"], - "image": result[productId]["Image"], - "count": result[productId]["Count"] - }); - } - } - topSellers = topSellers.sort(function (a, b) { - return (a.count < b.count); - }); - defer.resolve(topSellers); - } else { - defer.resolve(topSellers); - } - }); - - return defer.promise; - }; - - getVisitorsOnline = function () { - var defer; - defer = $q.defer(); - - $api.getVisitorsOnline().$promise.then(function (response) { - var result, visitorsDetail; - - result = response.result || []; - visitorsDetail = {}; - - if (null === response.error) { - - visitorsDetail["direct"] = result.Direct; - visitorsDetail["directRatio"] = (Math.abs(result.DirectRatio) * 100).toFixed(2); - visitorsDetail["online"] = result.Online; - visitorsDetail["onlineRatio"] = (Math.abs(result.OnlineRatio) * 100).toFixed(2); - visitorsDetail["search"] = result.Search; - visitorsDetail["searchRatio"] = (Math.abs(result.SearchRatio) * 100).toFixed(2); - visitorsDetail["site"] = result.Site; - visitorsDetail["siteRatio"] = (Math.abs(result.SiteRatio) * 100).toFixed(2); - - defer.resolve(visitorsDetail); - } else { - defer.resolve(visitorsDetail); - } - }); - - return defer.promise; - }; - return { - getReferrers: getReferrers, - getVisits: getVisits, - getVisitsDetail: getVisitsDetail, - getConversions: getConversions, - getSales: getSales, - getSalesDetail: getSalesDetail, - getTopSellers: getTopSellers, - getVisitorsOnline: getVisitorsOnline - }; - } - ] - ); - - return dashboardModule; +angular.module("dashboardModule") +/** +* $dashboardStatisticService implementation +*/ +.service("$dashboardStatisticService", [ +"$dashboardApiService", +"$q", +"moment", +function ($api, $q, moment) { + + + var getReferrers = function () { + return $api.getReferrers().$promise.then(function (response) { + return response.result; }); + }; -})(window.define); + var getVisits = function () { + + return $api.getVisits().$promise.then(function (response) { + + var defaults = { + // total: {today: 0, yesterday: 0, week: 0}, + total: {today: moment().milliseconds(), yesterday: 0, week: 0}, + unique: {today: 0, yesterday: 0, week: 0} + }; + // return defaults + return response.result || defaults; + }); + }; + + var getSales = function () { + + return $api.getSales().$promise.then(function (response) { + var defaults = { + // sales: {today: 0, yesterday: 0, week: 0}, + sales: {today: moment().milliseconds() * 102, yesterday: 0, week: 0}, + orders: {today: 0, yesterday: 0, week: 0} + }; + // return defaults + return response.result || defaults; + }); + }; + + var _processDetailResponse = function(points) { + + // Split into two sets + var set1 = points.splice(0,24).map(function(point){ + var pointTime = point[0]; + pointTime = moment.unix(pointTime).add(1,'day').valueOf(); + + return [pointTime, point[1]]; + }); + + var set2 = points.map(function(point){ + var pointTime = point[0]; + pointTime = moment.unix(pointTime).valueOf(); + + return [pointTime, point[1]]; + }); + + // z-index insures that today is on top + var dataSets = [ + {name: 'Today', data: set2, zIndex: 2}, + {name: 'Yesterday', data: set1, zIndex: 1}, + ]; + + return dataSets; + } + + var getVisitsDetail = function () { + + var options = { + "from": moment().subtract(1,'day').format('YYYY-MM-DD'), + "to": moment().add(1,'day').format('YYYY-MM-DD') + }; + + return $api.getVisitsDetails(options).$promise.then(function (response) { + return _processDetailResponse(response.result); + }); + }; + + var getSalesDetail = function () { + var options = { + "from": moment().subtract(1,'day').format('YYYY-MM-DD'), + "to": moment().add(1,'day').format('YYYY-MM-DD') + }; + + return $api.getSalesDetails(options).$promise.then(function (response) { + return _processDetailResponse(response.result); + }); + }; + + + var getConversions = function () { + + var getPercents = function (val, total) { + return Math.round((Math.abs(val/total) * 100) * 100) / 100 || 0; + }; + + return $api.getConversions().$promise.then(function (response) { + var result = response.result || []; + var conversion = {}; + + if (null === response.error) { + conversion.addedToCart = result["addedToCart"]; + conversion.addedToCartPercent = getPercents(result["addedToCart"], result["totalVisitors"]); + + conversion.purchased = result["purchased"]; + conversion.purchasedPercent = getPercents(result["purchased"], result["totalVisitors"]); + + conversion.reachedCheckout = result["visitCheckout"]; + conversion.reachedCheckoutPercent = getPercents(result["visitCheckout"], result["totalVisitors"]); + + conversion.totalVisitors = result["totalVisitors"]; + } + + return conversion; + }); + }; + + var getTopSellers = function () { + return $api.getTopSellers().$promise.then(function (response) { + return response.result; + }); + }; + + var getVisitorsOnline = function () { + var defer; + defer = $q.defer(); + + $api.getVisitorsOnline().$promise.then(function (response) { + var result, visitorsDetail; + + result = response.result || []; + visitorsDetail = {}; + + if (null === response.error) { + + visitorsDetail["direct"] = result.Direct; + visitorsDetail["directRatio"] = (Math.abs(result.DirectRatio) * 100).toFixed(2); + visitorsDetail["online"] = result.Online; + visitorsDetail["onlineRatio"] = (Math.abs(result.OnlineRatio) * 100).toFixed(2); + visitorsDetail["search"] = result.Search; + visitorsDetail["searchRatio"] = (Math.abs(result.SearchRatio) * 100).toFixed(2); + visitorsDetail["site"] = result.Site; + visitorsDetail["siteRatio"] = (Math.abs(result.SiteRatio) * 100).toFixed(2); + + defer.resolve(visitorsDetail); + } else { + defer.resolve(visitorsDetail); + } + }); + + return defer.promise; + }; + + return { + getReferrers: getReferrers, + getVisits: getVisits, + getVisitsDetail: getVisitsDetail, + getConversions: getConversions, + getSales: getSales, + getSalesDetail: getSalesDetail, + getTopSellers: getTopSellers, + getVisitorsOnline: getVisitorsOnline + }; +}]); diff --git a/app/scripts/dashboard/service/utils.js b/app/scripts/dashboard/service/utils.js index b995b1c7..7e2b315c 100644 --- a/app/scripts/dashboard/service/utils.js +++ b/app/scripts/dashboard/service/utils.js @@ -1,174 +1,121 @@ -(function (define) { - "use strict"; +angular.module("dashboardModule") + +.service("$dashboardUtilsService", function() { /** + * Extends String object * + * @param {string} charlist + * @returns {string} */ - define([ - "dashboard/init" - ], - function (dashboardModule) { - - /** - * Extends String object - * - * @param {string} charlist - * @returns {string} - */ - String.prototype.trimLeft = function (charlist) { - if (typeof charlist === "undefined") { - charlist = "\\s"; - } - - return this.replace(new RegExp("^[" + charlist + "]+"), ""); - }; - - /** - * Extends String object - * - * @param {string} charlist - * @returns {string} - */ - String.prototype.trimRight = function (charlist) { - if (typeof charlist === "undefined") { - charlist = "\\s"; - } - - return this.replace(new RegExp("[" + charlist + "]+$"), ""); - }; + String.prototype.trimLeft = function(charlist) { + if (typeof charlist === "undefined") { + charlist = "\\s"; + } - /** - * Extends String object - * - * @param {string} charlist - * @returns {string} - */ - String.prototype.trim = function (charlist) { - return this.trimLeft(charlist).trimRight(charlist); - }; + return this.replace(new RegExp("^[" + charlist + "]+"), ""); + }; - dashboardModule.service("$dashboardUtilsService", function () { - var clone, getMessage, getMessageByCode, isJson, sortObjectsArrayByField; - - clone = function (obj) { - if (null === obj || "object" !== typeof obj) { - return obj; - } - var copy = obj.constructor(); - for (var attr in obj) { - if (obj.hasOwnProperty(attr)) { - copy[attr] = obj[attr]; - } - } - return copy; - }; + /** + * Extends String object + * + * @param {string} charlist + * @returns {string} + */ + String.prototype.trimRight = function(charlist) { + if (typeof charlist === "undefined") { + charlist = "\\s"; + } - isJson = function (str) { - try { - JSON.parse(str); - } catch (e) { - return false; - } - return true; - }; + return this.replace(new RegExp("[" + charlist + "]+$"), ""); + }; - /** - * Sorts objects array by the field. By default sorting ascending a strings - * - * @param {object} array - [Object_1, Object_2...Object_N] - * @param {string} field - Field from object - * @param {string} type - Field type - * @param {string} order - Ыort order - * @returns {array} - */ - sortObjectsArrayByField = function (array, field, type, order) { - - /** - * Converts the value of the type - * - * @param {*} val - * @param {string} type - * @returns {*} - */ - var getInType = function (val, type) { - var integerTypes = ['int', 'integer', 'numeric', 'number']; - var floatTypes = ['float', 'real']; - var result = val.toString(); - - if (integerTypes.indexOf(type) >= 0) { - result = parseInt(val, 10); - } else if (floatTypes.indexOf(type) >= 0) { - result = parseFloat(val); - } - - return result; - }; - - - return array.sort(function (a, b) { - if (getInType(a[field], type) < getInType(b[field], type)) { - return order === "ASC" ? -1 : 1; - } - if (getInType(a[field], type) > getInType(b[field], type)) { - return order === "ASC" ? 1 : -1; - } - - return 0; - }); - }; + /** + * Extends String object + * + * @param {string} charlist + * @returns {string} + */ + String.prototype.trim = function(charlist) { + return this.trimLeft(charlist).trimRight(charlist); + }; + + var clone, getMessage, getMessageByCode, isJson; + + clone = function(obj) { + if (null === obj || "object" !== typeof obj) { + return obj; + } + var copy = obj.constructor(); + for (var attr in obj) { + if (obj.hasOwnProperty(attr)) { + copy[attr] = obj[attr]; + } + } + return copy; + }; + + isJson = function(str) { + try { + JSON.parse(str); + } catch (e) { + return false; + } + return true; + }; + /** + * Gets message text by code. If message by code not exist, returns default message from error object + * + * @param {object} error - should contain code and default message for error + * @returns {string} + */ + getMessageByCode = function(error) { + var msgList = {}; - /** - * Gets message text by code. If message by code not exist, returns default message from error object - * - * @param {object} error - should contain code and default message for error - * @returns {string} - */ - getMessageByCode = function (error) { - var msgList = {}; + return typeof msgList[error.code] !== "undefined" ? msgList[error.code].toString() : error.message; + }; - return typeof msgList[error.code] !== "undefined" ? msgList[error.code].toString() : error.message; + /** + * + * @param {object} response + * @param {string} type + * @param {string} message + * @param {int} timeout + */ + getMessage = function(response, type, message, timeout) { + var messageObj, error; + messageObj = {}; + error = {}; + + if (response !== null && response.error !== null) { + messageObj.type = "danger"; + if (typeof message === "undefined" || message === null) { + error = response.error; + } else { + error = { + "code": message, + "message": message }; + } + } else { + messageObj.type = type; + error = { + "code": message, + "message": message + }; + } - /** - * - * @param {object} response - * @param {string} type - * @param {string} message - * @param {int} timeout - */ - getMessage = function (response, type, message, timeout) { - var messageObj, error; - messageObj = {}; - error = {}; - - if (response !== null && response.error !== null) { - messageObj.type = "danger"; - if (typeof message === "undefined" || message === null) { - error = response.error; - } else { - error = {"code": message, "message": message}; - } - } else { - messageObj.type = type; - error = {"code": message, "message": message}; - } - - messageObj.message = getMessageByCode(error); - messageObj.timeout = timeout || null; - - return messageObj; - }; + messageObj.message = getMessageByCode(error); + messageObj.timeout = timeout || null; - return { - "clone": clone, - "getMessage": getMessage, - "isJson": isJson, - "sortObjectsArrayByField": sortObjectsArrayByField - }; - }); + return messageObj; + }; - return dashboardModule; - }); + return { + "clone": clone, + "getMessage": getMessage, + "isJson": isJson + }; -})(window.define); \ No newline at end of file +}); \ No newline at end of file diff --git a/app/scripts/design/directives/design.js b/app/scripts/design/directives/design.js deleted file mode 100644 index 67836033..00000000 --- a/app/scripts/design/directives/design.js +++ /dev/null @@ -1,116 +0,0 @@ -(function (define) { - "use strict"; - - define(["design/init"], function (designModule) { - designModule - /** - * Directive that allows to declare CSS inside module templates - * (TODO: not working currently as html creation going before) - */ - .directive("addCss", ["$designService", function ($designService) { - return { - restrict: "E", - link: function (scope, elem, attrs) { - var cssFile = attrs.src; - if (typeof cssFile !== "undefined" && cssFile !== "") { - $designService.addCss(cssFile); - } - } - }; - }]) - - /** - * Directive to solve browser auto-fill issue on model - */ - .directive("autoFillSync", ["$timeout", function ($timeout) { - return { - require: "ngModel", - link: function (scope, elem, attrs, ngModel) { - var origVal = elem.val(); - $timeout(function () { - var newVal = elem.val(); - if (ngModel.$pristine && origVal !== newVal) { - ngModel.$setViewValue(newVal); - } - }, 500); - } - }; - }]) - - /** - * Fix issue with the dynamic names fields in the form for validation form - */ - .directive('dynamicName', function ($compile, $parse) { - return { - restrict: 'A', - terminal: true, - priority: 100000, - link: function (scope, elem) { - var name = $parse(elem.attr('dynamic-name'))(scope); - elem.removeAttr('dynamic-name'); - elem.attr('name', name); - $compile(elem)(scope); - } - }; - }) - - /** - * jQuery layout directive - */ - .directive("jqLayout", function () { - return { - restrict: "A", - link: function (scope, elem) { - jQuery(elem).layout({ applyDefaultStyles: true }); - } - }; - }) - - .directive('ngEnter', function () { - return function (scope, element, attrs) { - element.bind("keydown keypress", function (event) { - if (event.which === 13) { - scope.$apply(function () { - scope.$eval(attrs.ngEnter); - }); - - event.preventDefault(); - } - }); - }; - }) - - .directive("otController", function () { - return { - scope: false, - controller: "@", - priority: 500 - }; - }) - - .directive("otInclude", ["$designService", function ($designService) { - return { - restrict: "E", - scope: false, - templateUrl: function (element, attr) { - return $designService.getTemplate(attr.src); - } - // controller: function (element, attr) { return attr.controller; } - }; - }]) - - .directive('errSrc', ["$rootScope", function ($rootScope) { - return { - link: function (scope, element, attrs) { - element.bind('error', function () { - if (attrs.src !== attrs.errSrc) { - attrs.$set('src', $rootScope.getImg(attrs.errSrc)); - } - }); - } - }; - }]); - - return designModule; - }); -})(window.define); \ No newline at end of file diff --git a/app/scripts/design/directives/editor/guiArrayModelSelector.js b/app/scripts/design/directives/editor/guiArrayModelSelector.js index f9b7084a..9aa5f0af 100644 --- a/app/scripts/design/directives/editor/guiArrayModelSelector.js +++ b/app/scripts/design/directives/editor/guiArrayModelSelector.js @@ -1,184 +1,178 @@ -(function (define, $) { - "use strict"; - - define(["design/init"], function (designModule) { - var options, parseOptions, getParams; - options = {}; - - /** - * Transforms the options string into object - * Example: - * in input - "model: Product; param_1: value_1" - * in output: { - * model: Product, - * param_1: value_1 - * } - * - * @param {string} optionsStr - * @returns {object} - */ - parseOptions = function (optionsStr) { - var i, optionsPairs, parts; - optionsPairs = optionsStr.split(/[,;]+/i) || []; - for (i = 0; i < optionsPairs.length; i += 1) { - parts = optionsPairs[i].split(/[:=]+/i); - options[parts[0].trim()] = parts[1].trim(); - } - return options; - }; - - /** - * Gets the parameters depending on the model - * - * @param {string} model - * @param {object} item - * @returns {object} - */ - getParams = function (model, item) { - var params; - params = {}; - switch (model) { - case "VisitorAddress": - params = { - "uri_4": item._id, - "uri_3": "list", - "uri_1": "visitor", - "uri_2": "address" - }; - break; - default: - params = { - "uri_1": model, - "uri_2": "list" - }; - } - return params; - }; - - designModule - /** - * Directive used for automatic attribute editor creation - */ - .directive("guiArrayModelSelector", [ - "$designService", - "$designApiService", - "$designImageService", - function ($designService, $designApiService, $designImageService) { - return { - restrict: "E", - templateUrl: $designService.getTemplate("design/gui/editor/arrayModelSelector.html"), - - scope: { - "attribute": "=editorScope", - "item": "=item" - }, - - controller: function ($scope) { - $scope.selection = []; - $scope.selected = []; - - $scope.toggleSelection = function (id, name) {// jshint ignore:line - var parentScope, names, idx, isExist; - parentScope = $scope.item[$scope.attribute.Attribute]; - - if (typeof parentScope !== "undefined") { - isExist = false; - for (var i = 0; i < parentScope.length; i += 1) { - if (typeof parentScope[i] === "object" && parentScope[i]._id === id) { - isExist = true; - idx = i; - } else if (parentScope[i] === id) { - isExist = true; - idx = i; - } - } - } else { - parentScope = []; +angular.module("designModule") +/** + * Directive used for automatic attribute editor creation + */ + .directive("guiArrayModelSelector", [ + "$designService", + "$designApiService", + "$designImageService", + function ($designService, $designApiService, $designImageService) { + return { + restrict: "E", + templateUrl: $designService.getTemplate("design/gui/editor/arrayModelSelector.html"), + + scope: { + "attribute": "=editorScope", + "item": "=item" + }, + + controller: function ($scope) { + + var options, parseOptions, getParams; + options = {}; + + /** + * Transforms the options string into object + * Example: + * in input - "model: Product; param_1: value_1" + * in output: { + * model: Product, + * param_1: value_1 + * } + * + * @param {string} optionsStr + * @returns {object} + */ + parseOptions = function (optionsStr) { + var i, optionsPairs, parts; + optionsPairs = optionsStr.split(/[,;]+/i) || []; + for (i = 0; i < optionsPairs.length; i += 1) { + parts = optionsPairs[i].split(/[:=]+/i); + options[parts[0].trim()] = parts[1].trim(); + } + return options; + }; + + /** + * Gets the parameters depending on the model + * + * @param {string} model + * @param {object} item + * @returns {object} + */ + getParams = function (model, item) { + var params; + params = {}; + switch (model) { + case "VisitorAddress": + params = { + "uri_4": item._id, + "uri_3": "list", + "uri_1": "visitor", + "uri_2": "address" + }; + break; + default: + params = { + "uri_1": model, + "uri_2": "list" + }; + } + return params; + }; + + + $scope.selection = []; + $scope.selected = []; + + $scope.toggleSelection = function (id, name) {// jshint ignore:line + var parentScope, names, idx, isExist; + parentScope = $scope.item[$scope.attribute.Attribute]; + + if (typeof parentScope !== "undefined") { + isExist = false; + for (var i = 0; i < parentScope.length; i += 1) { + if (typeof parentScope[i] === "object" && parentScope[i]._id === id) { + isExist = true; + idx = i; + } else if (parentScope[i] === id) { + isExist = true; + idx = i; } + } + } else { + parentScope = []; + } - if (typeof $scope.selected !== "undefined") { - names = $scope.selected.indexOf(name); - } else { - $scope.selected = []; - } + if (typeof $scope.selected !== "undefined") { + names = $scope.selected.indexOf(name); + } else { + $scope.selected = []; + } - if (isExist) { - parentScope.splice(idx, 1); - } else { - parentScope.push(id); - } + if (isExist) { + parentScope.splice(idx, 1); + } else { + parentScope.push(id); + } - if (names > -1) { - $scope.selected.splice(names, 1); - } else { - $scope.selected.push(name); - } - }; - - /** - * Gets count items - * - * @returns {number} - */ - $scope.getCountItems = function () { - var len = 0; - if (typeof $scope.item !== "undefined" && - typeof $scope.item[$scope.attribute.Attribute] !== "undefined" && - $scope.item[$scope.attribute.Attribute].length) { - len = $scope.item[$scope.attribute.Attribute].length; - } - return len; - }; + if (names > -1) { + $scope.selected.splice(names, 1); + } else { + $scope.selected.push(name); + } + }; - $scope.show = function (id) { - $("#" + id).modal("show"); - }; + /** + * Gets count items + * + * @returns {number} + */ + $scope.getCountItems = function () { + var len = 0; + if (typeof $scope.item !== "undefined" && + typeof $scope.item[$scope.attribute.Attribute] !== "undefined" && + $scope.item[$scope.attribute.Attribute].length) { + len = $scope.item[$scope.attribute.Attribute].length; + } + return len; + }; - $scope.hide = function (id) { - $("#" + id).modal("hide"); - }; + $scope.show = function (id) { + $("#" + id).modal("show"); + }; - $scope.$watch("item", function () { - $scope.selection = []; - $scope.selected = []; + $scope.hide = function (id) { + $("#" + id).modal("hide"); + }; - if (typeof $scope.item !== "undefined" && $scope.item._id) { + $scope.$watch("item", function () { + $scope.selection = []; + $scope.selected = []; - for (var i = 0; i < $scope.item[$scope.attribute.Attribute].length; i += 1) { - if (typeof $scope.item[$scope.attribute.Attribute] === "object") { + if (typeof $scope.item !== "undefined" && $scope.item._id) { - $scope.selection.push($scope.item[$scope.attribute.Attribute][i]._id); - $scope.selected.push($scope.item[$scope.attribute.Attribute][i].name); + for (var i = 0; i < $scope.item[$scope.attribute.Attribute].length; i += 1) { + if (typeof $scope.item[$scope.attribute.Attribute] === "object") { - } - } + $scope.selection.push($scope.item[$scope.attribute.Attribute][i]._id); + $scope.selected.push($scope.item[$scope.attribute.Attribute][i].name); } + } - parseOptions($scope.attribute.Options); - - $designApiService.attributesModel(getParams(options.model, $scope.item)).$promise.then( - function (response) { - var result = response.result || []; - $scope.items = result; - }); - }); + } - /** - * Returns full path to image - * - * @param {string} path - the destination path to product folder - * @param {string} image - image name - * @returns {string} - full path to image - */ - $scope.getImage = function (image) { - return $designImageService.getFullImagePath("", image); - }; + parseOptions($scope.attribute.Options); - } + $designApiService.attributesModel(getParams(options.model, $scope.item)).$promise.then( + function (response) { + var result = response.result || []; + $scope.items = result; + }); + }); + + /** + * Returns full path to image + * + * @param {string} path - the destination path to product folder + * @param {string} image - image name + * @returns {string} - full path to image + */ + $scope.getImage = function (image) { + return $designImageService.getFullImagePath("", image); }; - }]); - return designModule; - }); -})(window.define, jQuery); \ No newline at end of file + } + }; + }]); diff --git a/app/scripts/design/directives/editor/guiBoolean.js b/app/scripts/design/directives/editor/guiBoolean.js index 9df1af21..722291c8 100644 --- a/app/scripts/design/directives/editor/guiBoolean.js +++ b/app/scripts/design/directives/editor/guiBoolean.js @@ -1,75 +1,66 @@ -(function (define) { - "use strict"; +angular.module("designModule") +/** +* Directive used for automatic attribute editor creation +*/ +.directive("guiBoolean", ["$designService", function ($designService) { + return { + restrict: "E", + templateUrl: $designService.getTemplate("design/gui/editor/select.html"), - define(["design/init"], function (designModule) { + scope: { + "attribute": "=editorScope", + "item": "=item" + }, - designModule - /** - * Directive used for automatic attribute editor creation - */ - .directive("guiBoolean", ["$designService", function ($designService) { - return { - restrict: "E", - templateUrl: $designService.getTemplate("design/gui/editor/select.html"), + controller: function ($scope) { - scope: { - "attribute": "=editorScope", - "item": "=item" - }, + var init; - controller: function ($scope) { + init = function () { + if (typeof $scope.attribute === "undefined" || + typeof $scope.item === "undefined") { + return false; + } - var init; + if (typeof $scope.item[$scope.attribute.Attribute] === "boolean") { + $scope.options = [ + { + Desc: "", + Extra: null, + Id: false, + Image: "", + Name: "false" + }, + { + Desc: "", + Extra: null, + Id: true, + Image: "", + Name: "true" + } + ]; + } else { + $scope.options = [ + { + Desc: "", + Extra: null, + Id: "false", + Image: "", + Name: "false" + }, + { + Desc: "", + Extra: null, + Id: "true", + Image: "", + Name: "true" + } + ]; + } + }; - init = function () { - if (typeof $scope.attribute === "undefined" || - typeof $scope.item === "undefined") { - return false; - } - - if (typeof $scope.item[$scope.attribute.Attribute] === "boolean") { - $scope.options = [ - { - Desc: "", - Extra: null, - Id: false, - Image: "", - Name: "false" - }, - { - Desc: "", - Extra: null, - Id: true, - Image: "", - Name: "true" - } - ]; - } else { - $scope.options = [ - { - Desc: "", - Extra: null, - Id: "false", - Image: "", - Name: "false" - }, - { - Desc: "", - Extra: null, - Id: "true", - Image: "", - Name: "true" - } - ]; - } - }; - - $scope.$watch("item", init); - $scope.$watch("attribute", init); - } - }; - }]); - - return designModule; - }); -})(window.define); \ No newline at end of file + $scope.$watch("item", init); + $scope.$watch("attribute", init); + } + }; +}]); \ No newline at end of file diff --git a/app/scripts/design/directives/editor/guiCategorySelector.js b/app/scripts/design/directives/editor/guiCategorySelector.js index 911bbd73..032284f6 100644 --- a/app/scripts/design/directives/editor/guiCategorySelector.js +++ b/app/scripts/design/directives/editor/guiCategorySelector.js @@ -1,152 +1,143 @@ -(function (define, $) { - "use strict"; - - define(["design/init"], function (designModule) { - - designModule - /** - * Directive used for automatic attribute editor creation - */ - .directive("guiCategorySelector", [ - "$location", - "$routeParams", - "$designService", - "$dashboardListService", - "$categoryApiService", - function ($location, $routeParams, $designService, DashboardListService, $categoryApiService) { - var serviceList = new DashboardListService(), showColumns; - showColumns = { - 'name' : {'type' : 'select-link', 'label' : 'Name'}, - 'enabled' : {} - }; - - return { - restrict: "E", - templateUrl: $designService.getTemplate("design/gui/editor/categorySelector.html"), - - scope: { - "attribute": "=editorScope", - "item": "=item" - }, - - controller: function ($scope) { - var loadData; - - $scope.oldSearch = {}; - - /** - * Gets count items - * - * @returns {number} - */ - $scope.getParentName = function () { - var name = ""; - if (typeof $scope.item !== "undefined" && - typeof $scope.items !== "undefined" && - typeof $scope.item[$scope.attribute.Attribute] !== "undefined") { - - for (var i = 0; i < $scope.items.length; i += 1) { - - if ($scope.items[i].ID === $scope.item[$scope.attribute.Attribute] || - $scope.items[i].ID === $scope.item.parent) { - name = $scope.items[i].Name; - break; - } +angular.module("designModule") +/** +* Directive used for automatic attribute editor creation +*/ +.directive("guiCategorySelector", [ + "$location", + "$routeParams", + "$designService", + "$dashboardListService", + "$categoryApiService", + function ($location, $routeParams, $designService, DashboardListService, $categoryApiService) { + var serviceList = new DashboardListService(), showColumns; + showColumns = { + 'name' : {'type' : 'select-link', 'label' : 'Name'}, + 'enabled' : {} + }; + + return { + restrict: "E", + templateUrl: $designService.getTemplate("design/gui/editor/categorySelector.html"), + + scope: { + "attribute": "=editorScope", + "item": "=item" + }, + + controller: function ($scope) { + var loadData; + + $scope.oldSearch = {}; + + /** + * Gets count items + * + * @returns {number} + */ + $scope.getParentName = function () { + var name = ""; + if (typeof $scope.item !== "undefined" && + typeof $scope.items !== "undefined" && + typeof $scope.item[$scope.attribute.Attribute] !== "undefined") { + + for (var i = 0; i < $scope.items.length; i += 1) { + + if ($scope.items[i].ID === $scope.item[$scope.attribute.Attribute] || + $scope.items[i].ID === $scope.item.parent) { + name = $scope.items[i].Name; + break; + } + } + } + + return name; + }; + + $scope.select = function (id) { + $scope.item[$scope.attribute.Attribute] = id; + $scope.hide($scope.attribute.Attribute); + }; + + $scope.show = function (id) { + serviceList.init('categories'); + $("#" + id).modal("show"); + }; + + $scope.hide = function (id) { + $("#" + id).modal("hide"); + }; + + $scope.clear = function () { + $scope.item[$scope.attribute.Attribute] = ""; + $scope.item.parent = ""; + }; + + loadData = function () { + + if (typeof $scope.search === "undefined") { + $scope.search = {}; + } + + /** + * Gets list of categories + */ + var getCategoriesList = function () { + var params = $scope.search; + params["extra"] = serviceList.getExtraFields(); + $categoryApiService.categoryList(params).$promise.then( + function (response) { + var result, i; + $scope.categoriesTmp = []; + result = response.result || []; + for (i = 0; i < result.length; i += 1) { + if (result[i].ID !== $scope.item._id) { + $scope.categoriesTmp.push(result[i]); } } + } + ); + }; - return name; - }; - - $scope.select = function (id) { - $scope.item[$scope.attribute.Attribute] = id; - $scope.hide("parent_id"); - }; - - $scope.show = function (id) { - serviceList.init('categories'); - $("#" + id).modal("show"); - }; - - $scope.hide = function (id) { - $("#" + id).modal("hide"); - }; - - $scope.clear = function () { - $scope.item[$scope.attribute.Attribute] = ""; - $scope.item.parent = ""; - }; - - loadData = function () { - - if (typeof $scope.search === "undefined") { - $scope.search = {}; - } - - /** - * Gets list of categories - */ - var getCategoriesList = function () { - var params = $scope.search; - params["extra"] = serviceList.getExtraFields(); - $categoryApiService.categoryList(params).$promise.then( - function (response) { - var result, i; - $scope.categoriesTmp = []; - result = response.result || []; - for (i = 0; i < result.length; i += 1) { - if (result[i].ID !== $scope.item._id) { - $scope.categoriesTmp.push(result[i]); - } - } - } - ); - }; - - /** - * Gets count of categories - */ - $categoryApiService.getCount($scope.search).$promise.then( - function (response) { - if (response.error === null) { - $scope.count = response.result; - } else { - $scope.count = 0; - } - } - ); - - $categoryApiService.attributesInfo().$promise.then( - function (response) { - var result = response.result || []; - serviceList.init('categories'); - $scope.attributes = result; - serviceList.setAttributes($scope.attributes); - $scope.fields = serviceList.getFields(showColumns); - getCategoriesList(); - } - ); - - var prepareList = function () { - if (typeof $scope.attributes === "undefined" || typeof $scope.categoriesTmp === "undefined") { - return false; - } + /** + * Gets count of categories + */ + $categoryApiService.getCount($scope.search).$promise.then( + function (response) { + if (response.error === null) { + $scope.count = response.result; + } else { + $scope.count = 0; + } + } + ); + + $categoryApiService.attributesInfo().$promise.then( + function (response) { + var result = response.result || []; + serviceList.init('categories'); + $scope.attributes = result; + serviceList.setAttributes($scope.attributes); + $scope.fields = serviceList.getFields(showColumns); + getCategoriesList(); + } + ); - $scope.items = serviceList.getList($scope.categoriesTmp); - }; + var prepareList = function () { + if (typeof $scope.attributes === "undefined" || typeof $scope.categoriesTmp === "undefined") { + return false; + } - $scope.$watch("categoriesTmp", prepareList); - $scope.$watch("attributes", prepareList); - }; + $scope.items = serviceList.getList($scope.categoriesTmp); + }; - $scope.$watch("search", function () { - loadData(); - }); + $scope.$watch("categoriesTmp", prepareList); + $scope.$watch("attributes", prepareList); + }; - } - }; - }]); + $scope.$watch("search", function () { + loadData(); + }); - return designModule; - }); -})(window.define, jQuery); + } + }; + }]); diff --git a/app/scripts/design/directives/editor/guiDatetime.js b/app/scripts/design/directives/editor/guiDatetime.js index 4ca5be1b..736524c3 100644 --- a/app/scripts/design/directives/editor/guiDatetime.js +++ b/app/scripts/design/directives/editor/guiDatetime.js @@ -1,70 +1,63 @@ -(function (define) { - "use strict"; - - define(["design/init"], function (designModule) { - designModule - /** - * Directive used for automatic attribute editor creation - */ - .directive("guiDatetime", ["$designService", function ($designService) { - return { - restrict: "E", - scope: { - "attribute": "=editorScope", - "item": "=item" - }, - templateUrl: $designService.getTemplate("design/gui/editor/datetime.html"), - - controller: [ - "$scope", - function ($scope) { - - var isInit = false; - $scope.$watch("item", function () { - if (typeof $scope.item === "undefined") { - return false; - } - var date; - - if (typeof $scope.item[$scope.attribute.Attribute] === "undefined") { - date = new Date(); - } else { - date = new Date($scope.item[$scope.attribute.Attribute]); - } - - var month = date.getMonth().toString().length < 2 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1; - var day = date.getDate().toString().length < 2 ? '0' + date.getDate() : date.getDate(); - - $scope.value = month + "/" + day + '/' + date.getFullYear(); - - isInit = true; - }, true); - - $scope.changeValue = function () { - if (typeof $scope.value === "undefined") { - return false; - } - - try { - $scope.item[$scope.attribute.Attribute] = new Date($scope.value).toISOString(); - } catch (e) { - $scope.item[$scope.attribute.Attribute] = new Date().toISOString(); - } - }; - } - ] -// link: function ($scope, elm, attrs, ngModel) { -//// $scope.$watch("value", function(){ -// if (typeof $scope.value !== "undefined") { -// $scope.value.$setViewValue(elm.val()); -// $scope.changeValue(); -// } -//// }); -// -// } +angular.module("designModule") +/** +* Directive used for automatic attribute editor creation +*/ + +.directive("guiDatetime", ["$designService", function ($designService) { + return { + restrict: "E", + scope: { + "attribute": "=editorScope", + "item": "=item" + }, + templateUrl: $designService.getTemplate("design/gui/editor/datetime.html"), + + controller: [ + "$scope", + function ($scope) { + + var isInit = false; + $scope.$watch("item", function () { + if (typeof $scope.item === "undefined") { + return false; + } + var date; + + if (typeof $scope.item[$scope.attribute.Attribute] === "undefined") { + date = new Date(); + } else { + date = new Date($scope.item[$scope.attribute.Attribute]); + } + + var month = date.getMonth().toString().length < 2 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1; + var day = date.getDate().toString().length < 2 ? '0' + date.getDate() : date.getDate(); + + $scope.value = month + "/" + day + '/' + date.getFullYear(); + + isInit = true; + }, true); + + $scope.changeValue = function () { + if (typeof $scope.value === "undefined") { + return false; + } + + try { + $scope.item[$scope.attribute.Attribute] = new Date($scope.value).toISOString(); + } catch (e) { + $scope.item[$scope.attribute.Attribute] = new Date().toISOString(); + } }; - }]); - - return designModule; - }); -})(window.define); \ No newline at end of file + } + ] + // link: function ($scope, elm, attrs, ngModel) { + //// $scope.$watch("value", function(){ + // if (typeof $scope.value !== "undefined") { + // $scope.value.$setViewValue(elm.val()); + // $scope.changeValue(); + // } + //// }); + // + // } + }; +}]); \ No newline at end of file diff --git a/app/scripts/design/directives/editor/guiHtml.js b/app/scripts/design/directives/editor/guiHtml.js index ccc3a03d..d5b68f59 100644 --- a/app/scripts/design/directives/editor/guiHtml.js +++ b/app/scripts/design/directives/editor/guiHtml.js @@ -1,52 +1,14 @@ -(function (define) { - "use strict"; - - define(["design/init"], function (designModule) { - designModule - /** - * Directive used for automatic attribute editor creation - */ - .directive("guiHtml", ["$designService", function ($designService) { - return { - restrict: "E", - scope: { - "attribute": "=editorScope", - "item": "=item" - }, - templateUrl: $designService.getTemplate("design/gui/editor/html.html"), - - controller: ["$scope", function ($scope) { - $scope.type = 'html'; - - $scope.switchView = function (id, type) { - var parent; - if ('source' === type) { - document.getElementById(id).style.display = 'block'; - parent = document.getElementById(id).parentNode; - parent.getElementsByTagName("div")[0].style.display = 'none'; - - } else { - if ($scope.tinyInstance) { - $scope.tinyInstance.setContent(document.getElementById(id).value); - } - document.getElementById(id).style.display = 'none'; - parent = document.getElementById(id).parentNode; - parent.getElementsByTagName("div")[0].style.display = 'block'; - } - $scope.type = type; - }; - - $scope.isSource = function () { - return 'source' === $scope.type; - }; - - $scope.isHtml = function () { - return 'html' === $scope.type; - }; - }] - }; - }]); - - return designModule; - }); -})(window.define); \ No newline at end of file +angular.module("designModule") +/** +* Directive used for automatic attribute editor creation +*/ +.directive("guiHtml", ["$designService", function ($designService) { + return { + restrict: "E", + scope: { + "attribute": "=editorScope", + "item": "=item" + }, + templateUrl: $designService.getTemplate("design/gui/editor/html.html") + }; +}]); \ No newline at end of file diff --git a/app/scripts/design/directives/editor/guiJsonEditor.js b/app/scripts/design/directives/editor/guiJsonEditor.js index 423db715..863125c9 100644 --- a/app/scripts/design/directives/editor/guiJsonEditor.js +++ b/app/scripts/design/directives/editor/guiJsonEditor.js @@ -1,76 +1,72 @@ -(function (define, $) { - "use strict"; +angular.module("designModule") +/** +* Directive used for automatic attribute editor creation +*/ +.directive("guiJsonEditor", ["$designService", function ($designService) { + return { + restrict: "E", + scope: { + "data": "=data" + }, + templateUrl: $designService.getTemplate("design/gui/editor/json.html"), - define(["design/init"], function (designModule) { - designModule - /** - * Directive used for automatic attribute editor creation - */ - .directive("guiJsonEditor", ["$designService", function ($designService) { - return { - restrict: "E", - scope: { - "data": "=data" - }, - templateUrl: $designService.getTemplate("design/gui/editor/json.html"), + controller: ["$scope", function ($scope) { + $scope.items = [ + { "key": "", + "value": "" + } + ]; + $scope.show = function () { + $("#jsonEditor").modal("show"); + }; - controller: ["$scope", function ($scope) { - $scope.items = [ - { "key": "", - "value": "" - } - ]; - $scope.show = function () { - $("#jsonEditor").modal("show"); - }; + $scope.hide = function () { + var data; + data = {}; + for (var i = 0; i < $scope.items.length; i += 1) { + data[$scope.items[i].key] = $scope.items[i].value; + } + $scope.data = JSON.stringify(data); - $scope.hide = function () { - var data; - data = {}; - for (var i = 0; i < $scope.items.length; i += 1) { - data[$scope.items[i].key] = $scope.items[i].value; - } - $scope.data = JSON.stringify(data); + $("#jsonEditor").modal("hide"); + }; - $("#jsonEditor").modal("hide"); - }; + $scope.addItem = function () { + $scope.items.push({ + "key": "", + "value": "" + }); + }; - $scope.addItem = function () { - $scope.items.push({ - "key": "", - "value": "" - }); - }; + $scope.$watch("data", function () { - $scope.$watch("data", function () { + var obj, key; + if ($scope.data === "" || typeof $scope.data === "undefined") { + return false; + } + obj = JSON.parse($scope.data); + $scope.items = []; + for (key in obj) { + if (obj.hasOwnProperty(key)) { + $scope.items.push({ + "key": key, + "value": obj[key] + }); + } + } - var obj, key; - if ($scope.data === "" || typeof $scope.data === "undefined") { - return false; - } - obj = JSON.parse($scope.data); - $scope.items = []; - for (key in obj) { - if (obj.hasOwnProperty(key)) { - $scope.items.push({ - "key": key, - "value": obj[key] - }); - } - } + }, true); - }, true); + $scope.remove = function (key) { + for (var i = 0; i < $scope.items.length; i += 1) { + if (key === $scope.items[i].key) { + $scope.items.splice(i, 1); + break; + } + } + }; - $scope.remove = function (key) { - for (var i = 0; i < $scope.items.length; i += 1) { - if (key === $scope.items[i].key) { - $scope.items.splice(i, 1); - break; - } - } - }; - - $scope.$watch("items", function () { + $scope.$watch("items", function () { // var data; // data = {}; // for (var i = 0; i < $scope.items.length; i += 1) { @@ -78,11 +74,7 @@ // } //// console.log(data.toString()) // $scope.data = JSON.stringify(data); - }, true); - }] - }; - }]); - - return designModule; - }); -})(window.define, jQuery); \ No newline at end of file + }, true); + }] + }; +}]); \ No newline at end of file diff --git a/app/scripts/design/directives/editor/guiModelSelector.js b/app/scripts/design/directives/editor/guiModelSelector.js index d8764e59..5e15b424 100644 --- a/app/scripts/design/directives/editor/guiModelSelector.js +++ b/app/scripts/design/directives/editor/guiModelSelector.js @@ -1,118 +1,111 @@ -(function (define) { - "use strict"; - - define(["design/init"], function (designModule) { - var options, parseOptions, getParams; - options = {}; - - /** - * Transforms the options string into object - * Example: - * in input - "model: Product; param_1: value_1" - * in output: { - * model: Product, - * param_1: value_1 - * } - * - * @param {string} optionsStr - * @returns {object} - */ - parseOptions = function (optionsStr) { - var i, optionsPairs, parts; - optionsPairs = optionsStr.split(/[,;]+/i) || []; - for (i = 0; i < optionsPairs.length; i += 1) { - parts = optionsPairs[i].split(/[:=]+/i); - options[parts[0].trim()] = parts[1].trim(); - } - return options; - }; - - getParams = function (model, item) { - var params; - params = {}; - switch (model) { - case "VisitorAddress": - params = { - "uri_1": "visitor", - "uri_2": item._id, - "uri_3": "addresses", - "uri_4": null - }; - break; - case "payments": - - params = { - "uri_1": "checkout", - "uri_2": "shipping", - "uri_3": "methods" - }; - break; - case "shipping": - - params = { - "uri_1": "checkout", - "uri_2": "payment", - "uri_3": "methods" - }; - break; - default: - params = { - "uri_1": model + "s" - }; - } - return params; - }; +angular.module("designModule") + +/** + * Directive used for automatic attribute editor creation + */ + .directive("guiModelSelector", ["$designService", "$designApiService", function ($designService, $designApiService) { + return { + restrict: "E", + templateUrl: $designService.getTemplate("design/gui/editor/modelSelector.html"), + + scope: { + "attribute": "=editorScope", + "item": "=item" + }, + + controller: function ($scope) { + + var options, parseOptions, getParams; + options = {}; + + /** + * Transforms the options string into object + * Example: + * in input - "model: Product; param_1: value_1" + * in output: { + * model: Product, + * param_1: value_1 + * } + * + * @param {string} optionsStr + * @returns {object} + */ + parseOptions = function (optionsStr) { + var i, optionsPairs, parts; + optionsPairs = optionsStr.split(/[,;]+/i) || []; + for (i = 0; i < optionsPairs.length; i += 1) { + parts = optionsPairs[i].split(/[:=]+/i); + options[parts[0].trim()] = parts[1].trim(); + } + return options; + }; + + getParams = function (model, item) { + var params; + params = {}; + switch (model) { + case "VisitorAddress": + params = { + "uri_1": "visitor", + "uri_2": item._id, + "uri_3": "addresses", + "uri_4": null + }; + break; + case "payments": + + params = { + "uri_1": "checkout", + "uri_2": "shipping", + "uri_3": "methods" + }; + break; + case "shipping": + + params = { + "uri_1": "checkout", + "uri_2": "payment", + "uri_3": "methods" + }; + break; + default: + params = { + "uri_1": model + "s" + }; + } + return params; + }; + + $scope.$watch("item", function () { + $scope.options = []; + + parseOptions($scope.attribute.Options); + var params = getParams(options.model, $scope.item); + + if (params.hasOwnProperty("params") && typeof params.params === "undefined") { + return true; + } - designModule - /** - * Directive used for automatic attribute editor creation - */ - .directive("guiModelSelector", ["$designService", "$designApiService", function ($designService, $designApiService) { - return { - restrict: "E", - templateUrl: $designService.getTemplate("design/gui/editor/modelSelector.html"), - - scope: { - "attribute": "=editorScope", - "item": "=item" - }, - - controller: function ($scope) { - - $scope.$watch("item", function () { - $scope.options = []; - - parseOptions($scope.attribute.Options); - var params = getParams(options.model, $scope.item); - - if (params.hasOwnProperty("params") && typeof params.params === "undefined") { - return true; - } - - $designApiService.attributesModel(params).$promise.then( - function (response) { - try { - var result = response.result || []; - - result.unshift({ - Desc: "", - Extra: null, - ID: "", - Image: "", - Name: "" - }); - - $scope.item[$scope.attribute.Attribute] = $scope.item[$scope.attribute.Attribute] || result[0].ID; - - $scope.options = result; - } catch (e) {} + $designApiService.attributesModel(params).$promise.then( + function (response) { + try { + var result = response.result || []; + + result.unshift({ + Desc: "", + Extra: null, + ID: "", + Image: "", + Name: "" }); - }); - } - }; - }]); + $scope.item[$scope.attribute.Attribute] = $scope.item[$scope.attribute.Attribute] || result[0].ID; + + $scope.options = result; + } catch (e) {} + }); + }); - return designModule; - }); -})(window.define); \ No newline at end of file + } + }; + }]); diff --git a/app/scripts/design/directives/editor/guiMultiSelect.js b/app/scripts/design/directives/editor/guiMultiSelect.js index 438c3287..4b9999db 100644 --- a/app/scripts/design/directives/editor/guiMultiSelect.js +++ b/app/scripts/design/directives/editor/guiMultiSelect.js @@ -1,73 +1,64 @@ -(function (define) { - "use strict"; +angular.module("designModule") +/** +* Directive used for automatic attribute editor creation +*/ +.directive("guiMultiSelect", ["$designService", function ($designService) { + return { + restrict: "E", + templateUrl: $designService.getTemplate("design/gui/editor/multi-select.html"), - define(["design/init"], function (designModule) { + scope: { + "attribute": "=editorScope", + "item": "=item" + }, - designModule - /** - * Directive used for automatic attribute editor creation - */ - .directive("guiMultiSelect", ["$designService", function ($designService) { - return { - restrict: "E", - templateUrl: $designService.getTemplate("design/gui/editor/multi-select.html"), + controller: function ($scope) { + var isInit = false; + $scope.options = []; - scope: { - "attribute": "=editorScope", - "item": "=item" - }, + $scope.$watch("item", function () { + if (isInit) { + return false; + } + var getOptions, options, field; - controller: function ($scope) { - var isInit = false; - $scope.options = []; + $scope.options = []; - $scope.$watch("item", function () { - if (isInit) { - return false; - } - var getOptions, options, field; + getOptions = function (opt) { + var options = {}; - $scope.options = []; - - getOptions = function (opt) { - var options = {}; - - if (typeof $scope.attribute.Options === "string") { - try { - options = JSON.parse(opt.replace(/'/g, "\"")); - } catch(err) { - } - } else { - options = opt; - } + if (typeof $scope.attribute.Options === "string") { + try { + options = JSON.parse(opt.replace(/'/g, "\"")); + } catch(err) { + } + } else { + options = opt; + } - return options; - }; + return options; + }; - options = getOptions($scope.attribute.Options); + options = getOptions($scope.attribute.Options); - for (field in options) { - if (options.hasOwnProperty(field)) { - $scope.options.push({ - Desc: "", - Extra: null, - Id: field, - Image: "", - Name: options[field] - }); - } - } - if (typeof $scope.item[$scope.attribute.Attribute] === "string") { - var stringData = $scope.item[$scope.attribute.Attribute].trim('\\[\\]').replace(/['"\s]/g,''); - $scope.item[$scope.attribute.Attribute] = stringData.split(","); - } - isInit = true; + for (field in options) { + if (options.hasOwnProperty(field)) { + $scope.options.push({ + Desc: "", + Extra: null, + Id: field, + Image: "", + Name: options[field] }); - } - }; - }]); + } + if (typeof $scope.item[$scope.attribute.Attribute] === "string") { + var stringData = $scope.item[$scope.attribute.Attribute].trim('\\[\\]').replace(/['"\s]/g,''); + $scope.item[$scope.attribute.Attribute] = stringData.split(","); + } + isInit = true; + }); - return designModule; - }); -})(window.define); \ No newline at end of file + } + }; +}]); \ No newline at end of file diff --git a/app/scripts/design/directives/editor/guiMultilineText.js b/app/scripts/design/directives/editor/guiMultilineText.js index 8336185c..90a96c75 100644 --- a/app/scripts/design/directives/editor/guiMultilineText.js +++ b/app/scripts/design/directives/editor/guiMultilineText.js @@ -1,26 +1,14 @@ -(function (define) { - "use strict"; - - define(["design/init"], function (designModule) { - designModule - /** - * Directive used for automatic attribute editor creation - */ - .directive("guiMultilineText", ["$designService", function ($designService) { - return { - restrict: "E", - scope: { - "attribute": "=editorScope", - "item": "=item" - }, - templateUrl: $designService.getTemplate("design/gui/editor/multilineText.html"), - - controller: ["$scope", function() { - - }] - }; - }]); - - return designModule; - }); -})(window.define); \ No newline at end of file +angular.module("designModule") +/** + * Directive used for automatic attribute editor creation + */ +.directive("guiMultilineText", ["$designService", function ($designService) { + return { + restrict: "E", + scope: { + "attribute": "=editorScope", + "item": "=item" + }, + templateUrl: $designService.getTemplate("design/gui/editor/multilineText.html") + }; +}]); \ No newline at end of file diff --git a/app/scripts/design/directives/editor/guiNotEditable.js b/app/scripts/design/directives/editor/guiNotEditable.js index 2ecae47e..a30813ab 100644 --- a/app/scripts/design/directives/editor/guiNotEditable.js +++ b/app/scripts/design/directives/editor/guiNotEditable.js @@ -1,26 +1,18 @@ -(function (define) { - "use strict"; +angular.module("designModule") +/** + * Directive used for automatic attribute editor creation + */ +.directive("guiNotEditable", ["$designService", function ($designService) { + return { + restrict: "E", + scope: { + "attribute": "=editorScope", + "item": "=item" + }, + templateUrl: $designService.getTemplate("design/gui/editor/notEditable.html"), - define(["design/init"], function (designModule) { - designModule - /** - * Directive used for automatic attribute editor creation - */ - .directive("guiNotEditable", ["$designService", function ($designService) { - return { - restrict: "E", - scope: { - "attribute": "=editorScope", - "item": "=item" - }, - templateUrl: $designService.getTemplate("design/gui/editor/notEditable.html"), + controller: ["$scope", function() { - controller: ["$scope", function() { - - }] - }; - }]); - - return designModule; - }); -})(window.define); \ No newline at end of file + }] + }; +}]); \ No newline at end of file diff --git a/app/scripts/design/directives/editor/guiPageSelector.js b/app/scripts/design/directives/editor/guiPageSelector.js new file mode 100644 index 00000000..a064cdd6 --- /dev/null +++ b/app/scripts/design/directives/editor/guiPageSelector.js @@ -0,0 +1,143 @@ +angular.module("designModule") +/** +* Directive used for automatic attribute editor creation +*/ +.directive("guiPageSelector", [ + "$location", + "$routeParams", + "$designService", + "$dashboardListService", + "$cmsApiService", + function ($location, $routeParams, $designService, DashboardListService, $cmsApiService) { + var serviceList = new DashboardListService(), showColumns; + showColumns = { + 'identifier' : {'type' : 'select-link'}, + 'enabled' : {}, + 'title' : {} + }; + + return { + restrict: "E", + templateUrl: $designService.getTemplate("design/gui/editor/pageSelector.html"), + + scope: { + "attribute": "=editorScope", + "item": "=item" + }, + + controller: function ($scope) { + var loadData; + + $scope.oldSearch = {}; + + /** + * ?? + * + */ + $scope.getParentName = function () { + var name = ""; + if (typeof $scope.item !== "undefined" && + typeof $scope.items !== "undefined" && + typeof $scope.item[$scope.attribute.Attribute] !== "undefined") { + + for (var i = 0; i < $scope.items.length; i += 1) { + + if ($scope.items[i].ID === $scope.item[$scope.attribute.Attribute] || + $scope.items[i].ID === $scope.item.parent) { + name = $scope.items[i].Name; + break; + } + } + } + + return name; + }; + + $scope.select = function (id) { + $scope.item[$scope.attribute.Attribute] = id; + $scope.hide($scope.attribute.Attribute); + }; + + $scope.show = function (id) { + serviceList.init('pages'); + $("#" + id).modal("show"); + }; + + $scope.hide = function (id) { + $("#" + id).modal("hide"); + }; + + $scope.clear = function () { + $scope.item[$scope.attribute.Attribute] = ""; + $scope.item.parent = ""; + }; + + loadData = function () { + + if (typeof $scope.search === "undefined") { + $scope.search = {}; + } + + /** + * Gets list of pages + */ + var getPagesList = function () { + var params = $scope.search; + params["extra"] = serviceList.getExtraFields(); + $cmsApiService.pageList(params).$promise.then( + function (response) { + var result, i; + $scope.pagesTmp = []; + result = response.result || []; + for (i = 0; i < result.length; i += 1) { + if (result[i].ID !== $scope.item._id) { + $scope.pagesTmp.push(result[i]); + } + } + } + ); + }; + + /** + * Gets count of pages + */ + $cmsApiService.pageCount($scope.search).$promise.then( + function (response) { + if (response.error === null) { + $scope.count = response.result; + } else { + $scope.count = 0; + } + } + ); + + $cmsApiService.pageAttributes().$promise.then( + function (response) { + var result = response.result || []; + serviceList.init('pages'); + $scope.attributes = result; + serviceList.setAttributes($scope.attributes); + $scope.fields = serviceList.getFields(showColumns); + getPagesList(); + } + ); + + var prepareList = function () { + if (typeof $scope.attributes === "undefined" || typeof $scope.pagesTmp === "undefined") { + return false; + } + + $scope.items = serviceList.getList($scope.pagesTmp); + }; + + $scope.$watch("pagesTmp", prepareList); + $scope.$watch("attributes", prepareList); + }; + + $scope.$watch("search", function () { + loadData(); + }); + + } + }; + }]); diff --git a/app/scripts/design/directives/editor/guiPassword.js b/app/scripts/design/directives/editor/guiPassword.js index d3ec225a..439a1f50 100644 --- a/app/scripts/design/directives/editor/guiPassword.js +++ b/app/scripts/design/directives/editor/guiPassword.js @@ -1,102 +1,12 @@ -(function (define, $) { - "use strict"; +angular.module("designModule") + +.directive("guiPassword", ["$designService", function($designService) { + return { + restrict: "EA", + scope: { + "item": "=item" + }, + templateUrl: $designService.getTemplate("design/gui/editor/password.html") + }; +}]); - define(["design/init"], function (designModule) { - designModule - /** - * For activating a confirm field, attributes password should have property 'Confirm' = true - * Example: - * scope.attribute = { - * Attribute: "password" - * Collection: "visitor" - * Confirm: true // For this editor will be added a field confirm - * Default: "" - * Editors: "password" - * Group: "Password" - * IsLayered: false - * IsRequired: false - * IsStatic: true - * Label: "Password" - * Model: "Visitor" - * Options: "" - * Type: "text" - * Validators: "" - * } - */ - .directive("guiPassword", ["$designService", function ($designService) { - return { - restrict: "EA", - scope: { - "attribute": "=editorScope", - "item": "=item" - }, - templateUrl: $designService.getTemplate("design/gui/editor/password.html") - }; - }]) - - .directive('password', [function () { - var passwordDontMatch = "Passwords don't match."; - - return { - restrict: 'A', - require: '?ngModel', - link: function (scope, elem, attrs, ngModel) { - var firstPassword, confirmPassword; - - if (!scope.attribute.Confirm) { - return true; - } - - firstPassword = '#' + attrs.id; - confirmPassword = '#' + attrs.id + "_confirm"; - - elem.add(firstPassword).on('keyup', function () { - scope.$apply(function () { - var valid; - valid = elem.val() === $(confirmPassword).val(); - - if (!valid) { - ngModel.message = passwordDontMatch; - } - - ngModel.$setValidity("pwmatch", valid); - }); - }); - } - }; - }]) - - .directive('passwordConfirm', ["$parse", function ($parse) { - var passwordDontMatch = "Passwords don't match."; - - return { - restrict: 'A', - require: 'ngModel', - link: function (scope, elem, attrs, ngModel) { - var passwordId, firstPassword; - - passwordId = $parse(elem.attr('password-confirm'))(scope) || ""; - firstPassword = '#inp_' + passwordId; - - elem.add(firstPassword).on('keyup', function () { - scope.$apply(function () { - var valid; - - valid = elem.val() === $(firstPassword).val(); - - if (!valid) { - ngModel.message = passwordDontMatch; - scope.passwordForm[passwordId].message = passwordDontMatch; - } - - scope.passwordForm[passwordId].$setValidity("pwmatch", valid); - ngModel.$setValidity("pwmatch", valid); - }); - }); - } - }; - }]); - - return designModule; - }); -})(window.define, jQuery); \ No newline at end of file diff --git a/app/scripts/design/directives/editor/guiPictureManager.js b/app/scripts/design/directives/editor/guiPictureManager.js index 1cfaa8e6..e2e83cf6 100644 --- a/app/scripts/design/directives/editor/guiPictureManager.js +++ b/app/scripts/design/directives/editor/guiPictureManager.js @@ -1,73 +1,65 @@ -(function (define) { - "use strict"; - - define(["design/init"], function (designModule) { - designModule - /** - * Directive used for automatic attribute editor creation - */ - .directive("guiPictureManager", ["$designService", "$designImageService", function ($designService, $designImageService) { - return { - restrict: "E", +angular.module("designModule") +/** +* Directive used for automatic attribute editor creation +*/ +.directive("guiPictureManager", ["$designService", "$designImageService", function ($designService, $designImageService) { + return { + restrict: "E", // transclude: true, - templateUrl: $designService.getTemplate("design/gui/editor/pictureManager.html"), - - scope: { - "parent": "=parent", - "item": "=item" - }, + templateUrl: $designService.getTemplate("design/gui/editor/pictureManager.html"), - controller: function ($scope) { - // function to split array on rows by x-elements - var splitBy = function (arr, x) { - var result = [], row = [], i = 0; + scope: { + "parent": "=parent", + "item": "=item" + }, - for (var idx in arr) { - if (arr.hasOwnProperty(idx)) { - i += 1; - row.push(arr[idx]); - if (i % x === 0) { - result.push(row); - i = 0; - row = []; - } - } - } - if (i !== 0) { - result.push(row); - } + controller: function ($scope) { + // function to split array on rows by x-elements + var splitBy = function (arr, x) { + var result = [], row = [], i = 0; - return result; - }; + for (var idx in arr) { + if (arr.hasOwnProperty(idx)) { + i += 1; + row.push(arr[idx]); + if (i % x === 0) { + result.push(row); + i = 0; + row = []; + } + } + } + if (i !== 0) { + result.push(row); + } - $scope.$watch("parent.productImages", function () { - if(typeof $scope.parent.productImages !== "undefined") { - $scope.imagesPath = $scope.parent.imagesPath; - $scope.splitedImages = splitBy($scope.parent.productImages, 4); - } - }); + return result; + }; - $scope.getImage = function (filename) { - return $designImageService.getFullImagePath($scope.imagesPath, filename); - }; + $scope.$watch("parent.productImages", function () { + if(typeof $scope.parent.productImages !== "undefined") { + $scope.imagesPath = $scope.parent.imagesPath; + $scope.splitedImages = splitBy($scope.parent.productImages, 4); + } + }); - $scope.selectImage = function (filename) { - if (typeof filename !== "undefined" && filename !== "") { - $scope.parent.selectedImage = filename; - } - }; + $scope.getImage = function (filename) { + return $designImageService.getFullImagePath($scope.imagesPath, filename); + }; - $scope.isDefault = function (filename) { - var _class = " img-default "; - if (filename === $scope.defaultImg) { - return _class; - } - return ""; - }; - } - }; - }]); + $scope.selectImage = function (filename) { + if (typeof filename !== "undefined" && filename !== "") { + $scope.parent.selectedImage = filename; + } + }; - return designModule; - }); -})(window.define); + $scope.isDefault = function (filename) { + var _class = " img-default "; + if (filename === $scope.defaultImg) { + return _class; + } + return ""; + }; + } + }; +}]); \ No newline at end of file diff --git a/app/scripts/design/directives/editor/guiPrice.js b/app/scripts/design/directives/editor/guiPrice.js index 5bbc620c..0a5019b6 100644 --- a/app/scripts/design/directives/editor/guiPrice.js +++ b/app/scripts/design/directives/editor/guiPrice.js @@ -1,37 +1,29 @@ -(function (define) { - "use strict"; +angular.module("designModule") +/** +* Directive used for automatic attribute editor creation +*/ +.directive("guiPrice", ["$designService", function ($designService) { + return { + restrict: "E", + scope: { + "attribute": "=editorScope", + "item": "=item" + }, + templateUrl: $designService.getTemplate("design/gui/editor/text.html"), - define(["design/init"], function (designModule) { - designModule - /** - * Directive used for automatic attribute editor creation - */ - .directive("guiPrice", ["$designService", function ($designService) { - return { - restrict: "E", - scope: { - "attribute": "=editorScope", - "item": "=item" - }, - templateUrl: $designService.getTemplate("design/gui/editor/text.html"), + controller: ["$scope", function ($scope) { - controller: ["$scope", function ($scope) { + var priceRegExp = new RegExp("^\\d*\\.*\\d{0,2}$", ""); - var priceRegExp = new RegExp("^\\d*\\.*\\d{0,2}$", ""); + $scope.$watch("item", function (newVal, oldVal) { - $scope.$watch("item", function (newVal, oldVal) { + if(typeof newVal[$scope.attribute.Attribute] === "undefined") { + newVal[$scope.attribute.Attribute] = ""; + } else if (!priceRegExp.test(newVal[$scope.attribute.Attribute])) { + newVal[$scope.attribute.Attribute] = oldVal[$scope.attribute.Attribute]; + } - if(typeof newVal[$scope.attribute.Attribute] === "undefined") { - newVal[$scope.attribute.Attribute] = ""; - } else if (!priceRegExp.test(newVal[$scope.attribute.Attribute])) { - newVal[$scope.attribute.Attribute] = oldVal[$scope.attribute.Attribute]; - } - - }, true); - }] - }; - }]); - - return designModule; - }); -})(window.define); \ No newline at end of file + }, true); + }] + }; +}]); \ No newline at end of file diff --git a/app/scripts/design/directives/editor/guiProductSelector.js b/app/scripts/design/directives/editor/guiProductSelector.js index e35f4515..d5d6f9d5 100644 --- a/app/scripts/design/directives/editor/guiProductSelector.js +++ b/app/scripts/design/directives/editor/guiProductSelector.js @@ -1,231 +1,223 @@ -(function (define, $) { - "use strict"; - - define(["design/init"], function (designModule) { - var clone = function (obj) { - if (null === obj || "object" !== typeof obj) { - return obj; - } - var copy = obj.constructor(); - for (var attr in obj) { - if (obj.hasOwnProperty(attr)) { - copy[attr] = obj[attr]; +angular.module("designModule") +/** +* Directive used for automatic attribute editor creation +*/ +.directive("guiProductSelector", [ +"$location", +"$routeParams", +"$designService", +"$dashboardListService", +"$productApiService", +"$designImageService", +"COUNT_ITEMS_PER_PAGE", +function ($location, $routeParams, $designService, DashboardListService, $productApiService, $designImageService, COUNT_ITEMS_PER_PAGE) { + var serviceList = new DashboardListService(), showColumns; + showColumns = { + 'name' : {'type' : 'select-link', 'label' : 'Name'}, + 'enabled' : {}, + 'sku' : {}, + 'price' : {} + }; + + return { + restrict: "E", + templateUrl: $designService.getTemplate("design/gui/editor/productSelector.html"), + + scope: { + "attribute": "=editorScope", + "item": "=item", + "parent": "=parent" + }, + + controller: function ($scope) { + var loadData; + + $scope.oldSearch = {}; + $scope.selected = {}; + $scope.isExpand = false; + $scope.countSelected = 0; + + var oldWidth, getCountItems; + + var clone = function (obj) { + if (null === obj || "object" !== typeof obj) { + return obj; + } + var copy = obj.constructor(); + for (var attr in obj) { + if (obj.hasOwnProperty(attr)) { + copy[attr] = obj[attr]; + } + } + return copy; + }; + + /** + * Gets count items + * + * @returns {number} + */ + getCountItems = function () { + $scope.countSelected = 0; + if (typeof $scope.item !== "undefined" && + typeof $scope.item[$scope.attribute.Attribute] !== "undefined" && + $scope.item[$scope.attribute.Attribute].length) { + $scope.item[$scope.attribute.Attribute].map(function (val) { + if ("" !== val && typeof val !== "undefined") { + $scope.countSelected += 1; + } + }); + } + }; + + $scope.show = function (id) { + serviceList.init('products'); + $("#" + id).modal("show"); + }; + + $scope.hide = function (id) { + $("#" + id).modal("hide"); + }; + + loadData = function () { + $scope.fields = [ + { + "attribute": "Image", + "type": "image", + "label": "", + "visible": true + } + ]; + if (typeof $scope.search === "undefined") { + $scope.search = {}; + $scope.search.limit = "0," + COUNT_ITEMS_PER_PAGE; + } + if (typeof $scope.search.limit === "undefined") { + $scope.search.limit = "0," + COUNT_ITEMS_PER_PAGE; } - } - return copy; - }; - designModule - /** - * Directive used for automatic attribute editor creation - */ - .directive("guiProductSelector", [ - "$location", - "$routeParams", - "$designService", - "$dashboardListService", - "$productApiService", - "$designImageService", - "COUNT_ITEMS_PER_PAGE", - function ($location, $routeParams, $designService, DashboardListService, $productApiService, $designImageService, COUNT_ITEMS_PER_PAGE) { - var serviceList = new DashboardListService(), showColumns; - showColumns = { - 'name' : {'type' : 'select-link', 'label' : 'Name'}, - 'enabled' : {}, - 'sku' : {}, - 'price' : {}, - 'weight' : {} - }; - - return { - restrict: "E", - templateUrl: $designService.getTemplate("design/gui/editor/productSelector.html"), - - scope: { - "attribute": "=editorScope", - "item": "=item", - "parent": "=parent" - }, - - controller: function ($scope) { - var loadData; - - $scope.oldSearch = {}; - $scope.selected = {}; - $scope.isExpand = false; - $scope.countSelected = 0; - - var oldWidth, getCountItems; - - /** - * Gets count items - * - * @returns {number} - */ - getCountItems = function () { - $scope.countSelected = 0; - if (typeof $scope.item !== "undefined" && - typeof $scope.item[$scope.attribute.Attribute] !== "undefined" && - $scope.item[$scope.attribute.Attribute].length) { - $scope.item[$scope.attribute.Attribute].map(function (val) { - if ("" !== val && typeof val !== "undefined") { - $scope.countSelected += 1; - } - }); - } - }; - - $scope.show = function (id) { - serviceList.init('products'); - $("#" + id).modal("show"); - }; - - $scope.hide = function (id) { - $("#" + id).modal("hide"); - }; - - loadData = function () { - $scope.fields = [ - { - "attribute": "Image", - "type": "image", - "label": "", - "visible": true - } - ]; - if (typeof $scope.search === "undefined") { - $scope.search = {}; - $scope.search.limit = "0," + COUNT_ITEMS_PER_PAGE; - } - if (typeof $scope.search.limit === "undefined") { - $scope.search.limit = "0," + COUNT_ITEMS_PER_PAGE; - } - if (JSON.stringify($scope.oldSearch) === JSON.stringify($scope.search)) { - return false; - } + if (JSON.stringify($scope.oldSearch) === JSON.stringify($scope.search)) { + return false; + } - $scope.oldSearch = clone($scope.search); - - var getProductsList = function () { - var params = $scope.search; - params["extra"] = serviceList.getExtraFields(); - $productApiService.productList(params).$promise.then( - function (response) { - var result, i; - $scope.productsTmp = []; - result = response.result || []; - - for (i = 0; i < result.length; i += 1) { - if (typeof $scope.parent.excludeItems !== "undefined" && -1 !== $scope.parent.excludeItems.indexOf(result[i].ID)) { - continue; - } - result[i].Name = result[i].Extra.name; - result[i].sku = result[i].Extra.sku; - $scope.productsTmp.push(result[i]); - } - } - ); - }; - /** - * Gets list of products - */ - var getProductCount = function () { - $productApiService.getCount($scope.search, {}).$promise.then(function (response) { - if (response.error === null) { - $scope.count = response.result; - } else { - $scope.count = 0; - } - }); - }; - - var getAttributeList = function () { - $productApiService.attributesInfo().$promise.then(function (response) { - var result = response.result || []; - serviceList.init('products'); - $scope.attributes = result; - serviceList.setAttributes($scope.attributes); - $scope.fields = $scope.fields.concat(serviceList.getFields(showColumns)); - getProductsList(); - }); - }; - - $scope.$watch(function () { - if (typeof $scope.attributes !== "undefined" && typeof $scope.productsTmp !== "undefined") { - return true; - } - - return false; - }, function (isInitAll) { - if (isInitAll) { - $scope.items = serviceList.getList($scope.productsTmp); - } - }); - - $scope.init = (function () { - getProductCount(); - getAttributeList(); - })(); - }; - - $scope.$watch("item", function () { - $scope.selected = {}; - - if (typeof $scope.item !== "undefined" && - $scope.item._id && - $scope.item[$scope.attribute.Attribute] instanceof Array) { - for (var i = 0; i < $scope.item[$scope.attribute.Attribute].length; i += 1) { - if (typeof $scope.item[$scope.attribute.Attribute][i] === "object") { - $scope.selected[$scope.item[$scope.attribute.Attribute][i]._id] = true; - } else { - $scope.selected[$scope.item[$scope.attribute.Attribute][i]] = true; - } - } - getCountItems(); - } - }); - - $scope.$watch("search", function () { - delete $scope.productsTmp; - loadData(); - }); - - $scope.$watch("selected", function () { - var id; - $scope.item[$scope.attribute.Attribute] = []; - for (id in $scope.selected) { - if ($scope.selected.hasOwnProperty(id) && $scope.selected[id] === true) { - $scope.item[$scope.attribute.Attribute].push(id); - } + $scope.oldSearch = clone($scope.search); + + var getProductsList = function () { + var params = $scope.search; + params["extra"] = serviceList.getExtraFields(); + $productApiService.productList(params).$promise.then( + function (response) { + var result, i; + $scope.productsTmp = []; + result = response.result || []; + + for (i = 0; i < result.length; i += 1) { + if (typeof $scope.parent.excludeItems !== "undefined" && -1 !== $scope.parent.excludeItems.indexOf(result[i].ID)) { + continue; } - getCountItems(); - }, true); - - /** - * Returns full path to image - * - * @param {string} path - the destination path to product folder - * @param {string} image - image name - * @returns {string} - full path to image - */ - $scope.getImage = function (image) { - return $designImageService.getFullImagePath("", image); - }; - - $scope.expand = function () { - oldWidth = $('.modal-dialog').css("width"); - $('.modal-dialog').css("width", "90%"); - $scope.isExpand = true; - }; - - $scope.compress = function () { - $('.modal-dialog').css("width", oldWidth || "600px"); - $scope.isExpand = false; - }; + result[i].Name = result[i].Extra.name; + result[i].sku = result[i].Extra.sku; + $scope.productsTmp.push(result[i]); + } } - }; - }]); - - return designModule; - }); -})(window.define, jQuery); + ); + }; + /** + * Gets list of products + */ + var getProductCount = function () { + $productApiService.getCount($scope.search, {}).$promise.then(function (response) { + if (response.error === null) { + $scope.count = response.result; + } else { + $scope.count = 0; + } + }); + }; + + var getAttributeList = function () { + $productApiService.attributesInfo().$promise.then(function (response) { + var result = response.result || []; + serviceList.init('products'); + $scope.attributes = result; + serviceList.setAttributes($scope.attributes); + $scope.fields = $scope.fields.concat(serviceList.getFields(showColumns)); + getProductsList(); + }); + }; + + $scope.$watch(function () { + if (typeof $scope.attributes !== "undefined" && typeof $scope.productsTmp !== "undefined") { + return true; + } + + return false; + }, function (isInitAll) { + if (isInitAll) { + $scope.items = serviceList.getList($scope.productsTmp); + } + }); + + $scope.init = (function () { + getProductCount(); + getAttributeList(); + })(); + }; + + $scope.$watch("item", function () { + $scope.selected = {}; + + if (typeof $scope.item !== "undefined" && + $scope.item._id && + $scope.item[$scope.attribute.Attribute] instanceof Array) { + for (var i = 0; i < $scope.item[$scope.attribute.Attribute].length; i += 1) { + if (typeof $scope.item[$scope.attribute.Attribute][i] === "object") { + $scope.selected[$scope.item[$scope.attribute.Attribute][i]._id] = true; + } else { + $scope.selected[$scope.item[$scope.attribute.Attribute][i]] = true; + } + } + getCountItems(); + } + }); + + $scope.$watch("search", function () { + delete $scope.productsTmp; + loadData(); + }); + + $scope.$watch("selected", function () { + var id; + $scope.item[$scope.attribute.Attribute] = []; + for (id in $scope.selected) { + if ($scope.selected.hasOwnProperty(id) && $scope.selected[id] === true) { + $scope.item[$scope.attribute.Attribute].push(id); + } + } + getCountItems(); + }, true); + + /** + * Returns full path to image + * + * @param {string} path - the destination path to product folder + * @param {string} image - image name + * @returns {string} - full path to image + */ + $scope.getImage = function (image) { + return $designImageService.getFullImagePath("", image); + }; + + $scope.expand = function () { + oldWidth = $('.modal-dialog').css("width"); + $('.modal-dialog').css("width", "90%"); + $scope.isExpand = true; + }; + + $scope.compress = function () { + $('.modal-dialog').css("width", oldWidth || "600px"); + $scope.isExpand = false; + }; + } + }; +}]); diff --git a/app/scripts/design/directives/editor/guiProductsSelector.js b/app/scripts/design/directives/editor/guiProductsSelector.js new file mode 100644 index 00000000..4a193bd2 --- /dev/null +++ b/app/scripts/design/directives/editor/guiProductsSelector.js @@ -0,0 +1,214 @@ +angular.module("designModule") + +/** +* Directive used for automatic attribute editor creation +*/ +.directive("guiProductsSelector", [ +"$location", +"$routeParams", +"$designService", +"$dashboardListService", +"$productApiService", +"$designImageService", +"COUNT_ITEMS_PER_PAGE", +function ($location, $routeParams, $designService, DashboardListService, $productApiService, $designImageService, COUNT_ITEMS_PER_PAGE) { + var serviceList = new DashboardListService(), showColumns; + showColumns = { + 'name' : {'type' : 'select-link', 'label' : 'Name'}, + 'enabled' : {}, + 'sku' : {}, + 'price' : {} + }; + + return { + restrict: "E", + templateUrl: $designService.getTemplate("design/gui/editor/productsSelector.html"), + + scope: { + "attribute": "=editorScope", + "item": "=item", + "parent": "=parent" + }, + + controller: function ($scope) { + var loadData; + + $scope.oldSearch = {}; + $scope.selected = {}; + $scope.isExpand = false; + $scope.countSelected = 0; + + var oldWidth; + + var clone = function (obj) { + if (null === obj || "object" !== typeof obj) { + return obj; + } + var copy = obj.constructor(); + for (var attr in obj) { + if (obj.hasOwnProperty(attr)) { + copy[attr] = obj[attr]; + } + } + return copy; + }; + /** + * Get Name of selected object + * + * @returns string + */ + $scope.getParentName = function () { + var name = ""; + if (typeof $scope.item !== "undefined" && + typeof $scope.items !== "undefined" && + typeof $scope.item[$scope.attribute.Attribute] !== "undefined") { + + for (var i = 0; i < $scope.items.length; i += 1) { + + if ($scope.items[i].ID === $scope.item[$scope.attribute.Attribute] || + $scope.items[i].ID === $scope.item.parent) { + name = $scope.items[i].Name; + break; + } + } + } + + return name; + }; + + $scope.select = function (id) { + $scope.item[$scope.attribute.Attribute] = id; + $scope.hide($scope.attribute.Attribute); + }; + + $scope.show = function (id) { + serviceList.init('products'); + $("#" + id).modal("show"); + }; + + $scope.hide = function (id) { + $("#" + id).modal("hide"); + }; + + $scope.clear = function () { + $scope.item[$scope.attribute.Attribute] = ""; + $scope.item.parent = ""; + }; + + + loadData = function () { + $scope.fields = [ + { + "attribute": "Image", + "type": "image", + "label": "", + "visible": true + } + ]; + if (typeof $scope.search === "undefined") { + $scope.search = {}; + $scope.search.limit = "0," + COUNT_ITEMS_PER_PAGE; + } + if (typeof $scope.search.limit === "undefined") { + $scope.search.limit = "0," + COUNT_ITEMS_PER_PAGE; + } + + if (JSON.stringify($scope.oldSearch) === JSON.stringify($scope.search)) { + return false; + } + + $scope.oldSearch = clone($scope.search); + + var getProductsList = function () { + var params = $scope.search; + params["extra"] = serviceList.getExtraFields(); + $productApiService.productList(params).$promise.then( + function (response) { + var result, i; + $scope.productsTmp = []; + result = response.result || []; + + for (i = 0; i < result.length; i += 1) { + if (typeof $scope.parent.excludeItems !== "undefined" && -1 !== $scope.parent.excludeItems.indexOf(result[i].ID)) { + continue; + } + result[i].Name = result[i].Extra.name; + result[i].sku = result[i].Extra.sku; + $scope.productsTmp.push(result[i]); + } + } + ); + }; + /** + * Gets list of products + */ + var getProductCount = function () { + $productApiService.getCount($scope.search, {}).$promise.then(function (response) { + if (response.error === null) { + $scope.count = response.result; + } else { + $scope.count = 0; + } + }); + }; + + var getAttributeList = function () { + $productApiService.attributesInfo().$promise.then(function (response) { + var result = response.result || []; + serviceList.init('products'); + $scope.attributes = result; + serviceList.setAttributes($scope.attributes); + $scope.fields = $scope.fields.concat(serviceList.getFields(showColumns)); + getProductsList(); + }); + }; + + $scope.$watch(function () { + if (typeof $scope.attributes !== "undefined" && typeof $scope.productsTmp !== "undefined") { + return true; + } + + return false; + }, function (isInitAll) { + if (isInitAll) { + $scope.items = serviceList.getList($scope.productsTmp); + } + }); + + $scope.init = (function () { + getProductCount(); + getAttributeList(); + })(); + }; + + $scope.$watch("search", function () { + delete $scope.productsTmp; + loadData(); + }); + + + + /** + * Returns full path to image + * + * @param {string} path - the destination path to product folder + * @param {string} image - image name + * @returns {string} - full path to image + */ + $scope.getImage = function (image) { + return $designImageService.getFullImagePath("", image); + }; + + $scope.expand = function () { + oldWidth = $('.modal-dialog').css("width"); + $('.modal-dialog').css("width", "90%"); + $scope.isExpand = true; + }; + + $scope.compress = function () { + $('.modal-dialog').css("width", oldWidth || "600px"); + $scope.isExpand = false; + }; + } + }; +}]); diff --git a/app/scripts/design/directives/editor/guiSelect.js b/app/scripts/design/directives/editor/guiSelect.js index f3a921f4..abd34a78 100644 --- a/app/scripts/design/directives/editor/guiSelect.js +++ b/app/scripts/design/directives/editor/guiSelect.js @@ -1,81 +1,76 @@ -(function (define) { - "use strict"; +angular.module("designModule") +/** +* Directive used for automatic attribute editor creation +*/ - define(["design/init"], function (designModule) { +.directive("guiSelect", ["$designService", function ($designService) { + return { + restrict: "E", + templateUrl: $designService.getTemplate("design/gui/editor/select.html"), - designModule - /** - * Directive used for automatic attribute editor creation - */ - .directive("guiSelect", ["$designService", function ($designService) { - return { - restrict: "E", - templateUrl: $designService.getTemplate("design/gui/editor/select.html"), + scope: { + "attribute": "=editorScope", + "item": "=item" + }, - scope: { - "attribute": "=editorScope", - "item": "=item" - }, + controller: function ($scope) { + var getOptions; - controller: function ($scope) { - var getOptions; + $scope.options = []; - $scope.options = []; + getOptions = function (opt) { + var options = {}; - getOptions = function (opt) { - var options = {}; - - if (typeof $scope.attribute.Options === "string") { - try { - options = JSON.parse(opt.replace(/'/g, "\"")); - } - catch (e) { - var parts = $scope.attribute.Options.split(","); - for (var i = 0; i < parts.length; i += 1) { - options[parts[i]] = parts[i]; - } - } - } else { - options = opt; - } + if (typeof $scope.attribute.Options === "string") { + try { + options = JSON.parse(opt.replace(/'/g, "\"")); + } + catch (e) { + var parts = $scope.attribute.Options.split(","); + for (var i = 0; i < parts.length; i += 1) { + options[parts[i]] = parts[i]; + } + } + } else { + options = opt; + } - return options; - }; + return options; + }; - $scope.$watch("item", function () { - var options, field; + $scope.$watch("item", function () { + var options, field; - if (typeof $scope.item === "undefined") { - return false; - } + if (typeof $scope.item === "undefined") { + return false; + } - $scope.options = []; - options = getOptions($scope.attribute.Options); + $scope.options = []; + options = getOptions($scope.attribute.Options); - for (field in options) { - if (options.hasOwnProperty(field)) { - $scope.options.push({ - Desc: "", - Extra: null, - Id: field, - Image: "", - Name: options[field] - }); - } - } - $scope.options.unshift({ - Desc: "", - Extra: null, - Id: "", - Image: "", - Name: "" - }); + for (field in options) { + if (options.hasOwnProperty(field)) { + $scope.options.push({ + Desc: "", + Extra: null, + Id: field, + Image: "", + Name: options[field] }); } - }; - }]); + } - return designModule; - }); -})(window.define); \ No newline at end of file + if ($scope.attribute.Default === ""){ + $scope.options.unshift({ + Desc: "", + Extra: null, + Id: "", + Image: "", + Name: "" + }); + } + }); + } + }; +}]); diff --git a/app/scripts/design/directives/editor/guiText.js b/app/scripts/design/directives/editor/guiText.js index f0dfe9bb..e9213c3e 100644 --- a/app/scripts/design/directives/editor/guiText.js +++ b/app/scripts/design/directives/editor/guiText.js @@ -1,25 +1,19 @@ -(function (define) { - "use strict"; +angular.module("designModule") - define(["design/init"], function (designModule) { - designModule - /** - * Directive used for automatic attribute editor creation - */ - .directive("guiText", ["$designService", function ($designService) { - return { - restrict: "E", - scope: { - "attribute": "=editorScope", - "item": "=item" - }, - templateUrl: $designService.getTemplate("design/gui/editor/text.html"), +/** + * Directive used for automatic attribute editor creation + */ - controller: ["$scope", function() { - }] - }; - }]); +.directive("guiText", ["$designService", function ($designService) { + return { + restrict: "E", + scope: { + "attribute": "=editorScope", + "item": "=item" + }, + templateUrl: $designService.getTemplate("design/gui/editor/text.html"), - return designModule; - }); -})(window.define); \ No newline at end of file + controller: ["$scope", function() { + }] + }; +}]); \ No newline at end of file diff --git a/app/scripts/design/directives/editor/guiThemesManager.js b/app/scripts/design/directives/editor/guiThemesManager.js deleted file mode 100644 index 79f5c30b..00000000 --- a/app/scripts/design/directives/editor/guiThemesManager.js +++ /dev/null @@ -1,70 +0,0 @@ -(function (define) { - "use strict"; - - define(["design/init"], function (designModule) { - designModule - /** - * Directive used for automatic attribute editor creation - */ - .directive("guiThemesManager", [ - "$designService", - "$configApiService", - function ($designService, $configApiService) { - return { - restrict: "E", - scope: { - "attribute": "=editorScope", - "item": "=item" - }, - templateUrl: $designService.getTemplate("design/gui/editor/themesManager.html"), - - controller: [ - "$scope", - "$routeParams", - "$configService", - function ($scope, $routeParams, $configService) { - var storefrontUrl; - - - $scope.config = $configService; - $scope.currentPath = "themes.list.active"; - - $scope.init = function () { - $configApiService.getInfo({"path": "general.app.storefront_url"}).$promise.then( - function (response) { - storefrontUrl = response.result[0].Value; - } - ); - $configApiService.getInfo({"path": $scope.currentPath}).$promise.then( - function(response){ - $scope.themes = JSON.parse(response.result[0].Options.replace(/'/g, "\"")); - $scope.activeTheme = response.result[0].Value; - } - ); - }; - - $scope.getPreview = function (theme) { - if (typeof storefrontUrl === "undefined") { - return ""; - } - return storefrontUrl.replace(/\/$/, "") + "/themes/" + theme + "/preview.png"; - }; - - $scope.setActive = function(theme){ - $configApiService.setPath({ - "path": $scope.currentPath, - "value": theme - }).$promise.then( - function () { - $scope.activeTheme = theme; - } - ); - }; - } - ] - }; - }]); - - return designModule; - }); -})(window.define); \ No newline at end of file diff --git a/app/scripts/design/directives/editor/guiTinymce.js b/app/scripts/design/directives/editor/guiTinymce.js deleted file mode 100644 index 73a57d42..00000000 --- a/app/scripts/design/directives/editor/guiTinymce.js +++ /dev/null @@ -1,120 +0,0 @@ -(function (define) { - "use strict"; - - define(["angular", "design/init", "tinymce", "design/tinymce/blockSelector"], function (angular, designModule, tinymce) { - designModule - .value('uiTinymceConfig', { - "theme": "modern", - "plugins": [ - "blocks advlist autolink lists link image charmap preview hr anchor pagebreak", - "visualblocks visualchars code fullscreen", - "media nonbreaking save table contextmenu directionality", - "template paste textcolor colorpicker textpattern" - ], - "menubar": false, - "toolbar1": "blocks | insertfile undo redo | styleselect | bold italic | forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image", - "image_advtab": true - }) - .directive('guiTinymce', ['uiTinymceConfig', function (uiTinymceConfig) { - uiTinymceConfig = uiTinymceConfig || {}; - var generatedIds = 0; - return { - priority: 10, - require: 'ngModel', - link: function (scope, elm, attrs, ngModel) { - var expression, options, tinyInstance, - updateView = function () { - ngModel.$setViewValue(elm.val()); - if (!scope.$root.$$phase) { - scope.$apply(); - } - }; - - // generate an ID if not present - if (!attrs.id) { - attrs.$set('id', 'uiTinymce' + (generatedIds += 1)); - } - - if (attrs.uiTinymce) { - expression = scope.$eval(attrs.uiTinymce); - } else { - expression = {}; - } - - // make config'ed setup method available - if (expression.setup) { - var configSetup = expression.setup; - delete expression.setup; - } - - options = { - // Update model when calling setContent (such as from the source editor popup) - setup: function (ed) { - ed.on('init', function () { - ngModel.$render(); - ngModel.$setPristine(); - }); - // Update model on button click - ed.on('ExecCommand', function () { - ed.save(); - updateView(); - }); - // Update model on keypress - ed.on('KeyUp', function () { - ed.save(); - updateView(); - }); - // Update model on change, i.e. copy/pasted text, plugins altering content - ed.on('SetContent', function (e) { - if (!e.initial && ngModel.$viewValue !== e.content) { - ed.save(); - updateView(); - } - }); - ed.on('blur', function () { - elm.blur(); - }); - // Update model when an object has been resized (table, image) - ed.on('ObjectResized', function () { - ed.save(); - updateView(); - }); - if (configSetup) { - configSetup(ed); - } - }, - mode: 'exact', - elements: attrs.id - }; - // extend options with initial uiTinymceConfig and options from directive attribute value - angular.extend(options, uiTinymceConfig, expression); - setTimeout(function () { - tinymce.init(options); - }); - - ngModel.$render = function () { - if (!tinyInstance) { - tinyInstance = tinymce.get(attrs.id); - } - if (tinyInstance) { - tinyInstance.setContent(ngModel.$viewValue || ''); - } - - scope.tinyInstance = tinyInstance; - }; - - scope.$on('$destroy', function () { - if (!tinyInstance) { - tinyInstance = tinymce.get(attrs.id); - } - if (tinyInstance) { - tinyInstance.remove(); - tinyInstance = null; - } - }); - } - }; - }] - ); - }); -})(window.define); \ No newline at end of file diff --git a/app/scripts/design/directives/editor/guiVisitorSelector.js b/app/scripts/design/directives/editor/guiVisitorSelector.js index 72ec3cb2..738cd644 100644 --- a/app/scripts/design/directives/editor/guiVisitorSelector.js +++ b/app/scripts/design/directives/editor/guiVisitorSelector.js @@ -1,195 +1,187 @@ -(function (define, $) { - "use strict"; - - define(["design/init"], function (designModule) { - var clone = function (obj) { - if (null === obj || "object" !== typeof obj) { - return obj; - } - var copy = obj.constructor(); - for (var attr in obj) { - if (obj.hasOwnProperty(attr)) { - copy[attr] = obj[attr]; +angular.module("designModule") +/** +* Directive used for automatic attribute editor creation +*/ +.directive("guiVisitorSelector", [ +"$location", +"$routeParams", +"$designService", +"$dashboardListService", +"$visitorApiService", +"$designImageService", +"COUNT_ITEMS_PER_PAGE", +function ($location, $routeParams, $designService, DashboardListService, $visitorApiService, $designImageService, COUNT_ITEMS_PER_PAGE) { + var serviceList = new DashboardListService(), showColumns; + showColumns = { + 'name' : {'type' : 'select-link', 'label' : 'Name'}, + 'email' : {}, + 'first_name' : {}, + 'last_name' : {}, + 'is_admin' : {} + }; + + return { + restrict: "E", + templateUrl: $designService.getTemplate("design/gui/editor/visitorSelector.html"), + + scope: { + "attribute": "=editorScope", + "item": "=item" + }, + + controller: function ($scope) { + var loadData; + + $scope.oldSearch = {}; + $scope.selected = {}; + $scope.isExpand = false; + + var oldWidth; + + var clone = function (obj) { + if (null === obj || "object" !== typeof obj) { + return obj; + } + var copy = obj.constructor(); + for (var attr in obj) { + if (obj.hasOwnProperty(attr)) { + copy[attr] = obj[attr]; + } + } + return copy; + }; + /** + * Gets count items + * + * @returns {number} + */ + $scope.getCountItems = function () { + var len = 0; + if (typeof $scope.item !== "undefined" && + typeof $scope.item[$scope.attribute.Attribute] !== "undefined" && + $scope.item[$scope.attribute.Attribute].length) { + len = $scope.item[$scope.attribute.Attribute].length; } - } - return copy; - }; - designModule - /** - * Directive used for automatic attribute editor creation - */ - .directive("guiVisitorSelector", [ - "$location", - "$routeParams", - "$designService", - "$dashboardListService", - "$visitorApiService", - "$designImageService", - "COUNT_ITEMS_PER_PAGE", - function ($location, $routeParams, $designService, DashboardListService, $visitorApiService, $designImageService, COUNT_ITEMS_PER_PAGE) { - var serviceList = new DashboardListService(), showColumns; - showColumns = { - 'name' : {'type' : 'select-link', 'label' : 'Name'}, - 'email' : {}, - 'first_name' : {}, - 'last_name' : {}, - 'is_admin' : {} - }; - - return { - restrict: "E", - templateUrl: $designService.getTemplate("design/gui/editor/visitorSelector.html"), - - scope: { - "attribute": "=editorScope", - "item": "=item" - }, - - controller: function ($scope) { - var loadData; - - $scope.oldSearch = {}; - $scope.selected = {}; - $scope.isExpand = false; - - var oldWidth; - - /** - * Gets count items - * - * @returns {number} - */ - $scope.getCountItems = function () { - var len = 0; - if (typeof $scope.item !== "undefined" && - typeof $scope.item[$scope.attribute.Attribute] !== "undefined" && - $scope.item[$scope.attribute.Attribute].length) { - len = $scope.item[$scope.attribute.Attribute].length; - } - return len; - }; - - $scope.show = function (id) { - serviceList.init('visitors'); - $("#" + id).modal("show"); - }; - - $scope.hide = function (id) { - $("#" + id).modal("hide"); - }; - - loadData = function () { - - if (typeof $scope.search === "undefined") { - $scope.search = {}; - $scope.search.limit = "0," + COUNT_ITEMS_PER_PAGE; - } - if (typeof $scope.search.limit === "undefined") { - $scope.search.limit = "0," + COUNT_ITEMS_PER_PAGE; - } - - if (JSON.stringify($scope.oldSearch) === JSON.stringify($scope.search)) { - return false; - } - - $scope.oldSearch = clone($scope.search); - - /** - * Gets list of visitors - */ - var getVisitorsList = function () { - var params = $scope.search; - params["extra"] = serviceList.getExtraFields(); - $visitorApiService.visitorList(params).$promise.then( - function (response) { - var result, i; - $scope.visitorsTmp = []; - result = response.result || []; - for (i = 0; i < result.length; i += 1) { - $scope.visitorsTmp.push(result[i]); - } - } - ); - }; - - /** - * Gets list of visitors - */ - $visitorApiService.getCountVisitors($scope.search, {}).$promise.then( - function (response) { - if (response.error === null) { - $scope.count = response.result; - } else { - $scope.count = 0; - } - } - ); - - $visitorApiService.attributesInfo().$promise.then( - function (response) { - var result = response.result || []; - serviceList.init('visitors'); - $scope.attributes = result; - serviceList.setAttributes($scope.attributes); - $scope.fields = serviceList.getFields(showColumns); - getVisitorsList(); - } - ); - - var prepareList = function () { - if (typeof $scope.attributes === "undefined" || typeof $scope.visitorsTmp === "undefined") { - return false; - } - - $scope.items = serviceList.getList($scope.visitorsTmp); - }; - - $scope.$watch("visitorsTmp", prepareList); - $scope.$watch("attributes", prepareList); - }; - - $scope.$watch("item", function () { - $scope.selected = {}; - - if (typeof $scope.item !== "undefined" && $scope.item._id) { - - for (var i = 0; i < $scope.item[$scope.attribute.Attribute].length; i += 1) { - if (typeof $scope.item[$scope.attribute.Attribute] === "object") { - $scope.selected[$scope.item[$scope.attribute.Attribute][i]._id] = true; - } - } - } - }); - - $scope.$watch("search", function () { - loadData(); - }); - - $scope.$watch("selected", function () { - var id; - $scope.item[$scope.attribute.Attribute] = []; - for (id in $scope.selected) { - if ($scope.selected.hasOwnProperty(id) && $scope.selected[id] === true) { - $scope.item[$scope.attribute.Attribute].push(id); - } - } - - }, true); - - $scope.expand = function () { - oldWidth = $('.modal-dialog').css("width"); - $('.modal-dialog').css("width", "90%"); - $scope.isExpand = true; - }; - - $scope.compress = function () { - $('.modal-dialog').css("width", oldWidth || "600px"); - $scope.isExpand = false; - }; + return len; + }; + + $scope.show = function (id) { + serviceList.init('visitors'); + $("#" + id).modal("show"); + }; + + $scope.hide = function (id) { + $("#" + id).modal("hide"); + }; + + loadData = function () { + + if (typeof $scope.search === "undefined") { + $scope.search = {}; + $scope.search.limit = "0," + COUNT_ITEMS_PER_PAGE; + } + if (typeof $scope.search.limit === "undefined") { + $scope.search.limit = "0," + COUNT_ITEMS_PER_PAGE; + } + + if (JSON.stringify($scope.oldSearch) === JSON.stringify($scope.search)) { + return false; + } + + $scope.oldSearch = clone($scope.search); + + /** + * Gets list of visitors + */ + var getVisitorsList = function () { + var params = $scope.search; + params["extra"] = serviceList.getExtraFields(); + $visitorApiService.visitorList(params).$promise.then( + function (response) { + var result, i; + $scope.visitorsTmp = []; + result = response.result || []; + for (i = 0; i < result.length; i += 1) { + $scope.visitorsTmp.push(result[i]); + } + } + ); + }; + + /** + * Gets list of visitors + */ + $visitorApiService.getCountVisitors($scope.search, {}).$promise.then( + function (response) { + if (response.error === null) { + $scope.count = response.result; + } else { + $scope.count = 0; } - }; - }]); + } + ); + + $visitorApiService.attributesInfo().$promise.then( + function (response) { + var result = response.result || []; + serviceList.init('visitors'); + $scope.attributes = result; + serviceList.setAttributes($scope.attributes); + $scope.fields = serviceList.getFields(showColumns); + getVisitorsList(); + } + ); + + var prepareList = function () { + if (typeof $scope.attributes === "undefined" || typeof $scope.visitorsTmp === "undefined") { + return false; + } + + $scope.items = serviceList.getList($scope.visitorsTmp); + }; + + $scope.$watch("visitorsTmp", prepareList); + $scope.$watch("attributes", prepareList); + }; + + $scope.$watch("item", function () { + $scope.selected = {}; + + if (typeof $scope.item !== "undefined" && $scope.item._id) { + + for (var i = 0; i < $scope.item[$scope.attribute.Attribute].length; i += 1) { + if (typeof $scope.item[$scope.attribute.Attribute] === "object") { + $scope.selected[$scope.item[$scope.attribute.Attribute][i]._id] = true; + } + } + } + }); + + $scope.$watch("search", function () { + loadData(); + }); + + $scope.$watch("selected", function () { + var id; + $scope.item[$scope.attribute.Attribute] = []; + for (id in $scope.selected) { + if ($scope.selected.hasOwnProperty(id) && $scope.selected[id] === true) { + $scope.item[$scope.attribute.Attribute].push(id); + } + } - return designModule; - }); -})(window.define, jQuery); + }, true); + + $scope.expand = function () { + oldWidth = $('.modal-dialog').css("width"); + $('.modal-dialog').css("width", "90%"); + $scope.isExpand = true; + }; + + $scope.compress = function () { + $('.modal-dialog').css("width", oldWidth || "600px"); + $scope.isExpand = false; + }; + } + }; +}]); diff --git a/app/scripts/design/directives/filter/guiDateRange.js b/app/scripts/design/directives/filter/guiDateRange.js new file mode 100644 index 00000000..6fcf1485 --- /dev/null +++ b/app/scripts/design/directives/filter/guiDateRange.js @@ -0,0 +1,59 @@ +angular.module("designModule") + +.directive("guiFilterDateRange", ["$designService", function($designService) { + return { + restrict: "E", + scope: { + "parent": "=object", + "attribute": "=editorScope", + "item": "=item" + }, + templateUrl: $designService.getTemplate("design/gui/filter/dateRange.html"), + + controller: ["$scope", function($scope) { + $scope.highInvalid = false; + $scope.lowInvalid = false; + $scope.low; + $scope.high; + var isInit = false; + + $scope.submit = function() { + var targetAttribute = $scope.attribute.Attribute; + var newFilterValue = ''; + + $scope._low = $scope.low ? Math.round($scope.low / 1000) : ''; + $scope._high = $scope.high ? Math.round($scope.high / 1000) : ''; + + if ($scope._low || $scope._high) { + newFilterValue = $scope._low + ".." + $scope._high; + } + + $scope.item[targetAttribute] = newFilterValue; + $scope.parent.newFilters[targetAttribute] = $scope.item[targetAttribute]; + } + + $scope.$watch("item", function() { + if (typeof $scope.item === "undefined") { + return false; + } + if (isInit || typeof $scope.item[$scope.attribute.Attribute] === "undefined") { + return false; + } + + var value = $scope.item[$scope.attribute.Attribute]; + var regExp = new RegExp("(\\d*)\\.\\.(\\d*)$", "i"); + var values = value.match(regExp); + if (null !== values) { + $scope.low = new Date(values[1] * 1000); + $scope.high = new Date(values[2] * 1000); + isInit = true; + } + + $scope.parent.newFilters[$scope.attribute.Attribute] = $scope.item[$scope.attribute.Attribute]; + + }, true); + + }] + } +}]); + diff --git a/app/scripts/design/directives/filter/guiRange.js b/app/scripts/design/directives/filter/guiRange.js index bea01901..24bac6a1 100644 --- a/app/scripts/design/directives/filter/guiRange.js +++ b/app/scripts/design/directives/filter/guiRange.js @@ -1,87 +1,78 @@ -(function (define) { - "use strict"; +angular.module("designModule") - define(["design/init"], function (designModule) { - designModule - /** - * Directive used for automatic attribute editor creation - */ - .directive("guiFilterRange", ["$designService", function ($designService) { - return { - restrict: "E", - scope: { - "parent": "=object", - "attribute": "=editorScope", - "item": "=item" - }, - templateUrl: $designService.getTemplate("design/gui/filter/range.html"), +.directive("guiFilterRange", ["$designService", function($designService) { + return { + restrict: "E", + scope: { + "parent": "=object", + "attribute": "=editorScope", + "item": "=item" + }, + templateUrl: $designService.getTemplate("design/gui/filter/range.html"), - controller: ["$scope", function ($scope) { + controller: ["$scope", function($scope) { - $scope.hightInvalid = false; - $scope.lowInvalid = false; - $scope.low = ""; - $scope.hight = ""; - var regExpNumber = /^\s*[0-9]*\s*$/; - var isInit = false; + $scope.highInvalid = false; + $scope.lowInvalid = false; + $scope.low = ""; + $scope.high = ""; + var regExpNumber = /^\s*[0-9]*\s*$/; + var isInit = false; - var checkOnValid = function () { + var checkOnValid = function() { - if (!regExpNumber.test($scope.low)) { - $scope.lowInvalid = true; - } else { - $scope.lowInvalid = false; - } + if (!regExpNumber.test($scope.low)) { + $scope.lowInvalid = true; + } else { + $scope.lowInvalid = false; + } - if (!regExpNumber.test($scope.hight)) { - $scope.hightInvalid = true; - } else { - $scope.hightInvalid = false; - } - }; + if (!regExpNumber.test($scope.high)) { + $scope.highInvalid = true; + } else { + $scope.highInvalid = false; + } + }; - $scope.submit = function () { + $scope.submit = function() { + var targetAttribute = $scope.attribute.Attribute; + checkOnValid(); - checkOnValid(); + if (!$scope.lowInvalid && !$scope.highInvalid) { + var newFilterValue = ''; + $scope.low = $scope.low.trim(); + $scope.high = $scope.high.trim(); - if (!$scope.lowInvalid && !$scope.hightInvalid) { - $scope.low = $scope.low.trim(); - $scope.hight = $scope.hight.trim(); - if ("" === $scope.low && "" === $scope.hight) { - $scope.item[$scope.attribute.Attribute] = ""; - $scope.parent.newFilters[$scope.attribute.Attribute] = $scope.item[$scope.attribute.Attribute]; - } else { - $scope.item[$scope.attribute.Attribute] = ($scope.low || "") + ".." + ($scope.hight || ""); - $scope.parent.newFilters[$scope.attribute.Attribute] = $scope.item[$scope.attribute.Attribute]; - } + if ($scope.low || $scope.high) { + newFilterValue = $scope.low + ".." + $scope.high; + } - } - }; + $scope.item[targetAttribute] = newFilterValue + $scope.parent.newFilters[targetAttribute] = $scope.item[targetAttribute]; + } + }; - $scope.$watch("item", function () { - if (typeof $scope.item === "undefined") { - return false; - } - if (isInit || typeof $scope.item[$scope.attribute.Attribute] === "undefined") { - return false; - } + $scope.$watch("item", function() { + if (typeof $scope.item === "undefined") { + return false; + } + if (isInit || typeof $scope.item[$scope.attribute.Attribute] === "undefined") { + return false; + } - var value = $scope.item[$scope.attribute.Attribute]; - var regExp = new RegExp("(\\d*)\\.\\.(\\d*)$", "i"); - var values = value.match(regExp); - if (null !== values) { - $scope.low = values[1]; - $scope.hight = values[2]; - isInit = true; - } + var value = $scope.item[$scope.attribute.Attribute]; + var regExp = new RegExp("(\\d*)\\.\\.(\\d*)$", "i"); + var values = value.match(regExp); + if (null !== values) { + $scope.low = values[1]; + $scope.high = values[2]; + isInit = true; + } - $scope.parent.newFilters[$scope.attribute.Attribute] = $scope.item[$scope.attribute.Attribute]; + $scope.parent.newFilters[$scope.attribute.Attribute] = $scope.item[$scope.attribute.Attribute]; - }, true); - }] - }; - }]); + }, true); + }] + }; +}]); - return designModule; - }); -})(window.define); \ No newline at end of file diff --git a/app/scripts/design/directives/filter/guiSelect.js b/app/scripts/design/directives/filter/guiSelect.js index 57b4d4ba..6523b4f3 100644 --- a/app/scripts/design/directives/filter/guiSelect.js +++ b/app/scripts/design/directives/filter/guiSelect.js @@ -1,101 +1,92 @@ -(function (define) { - "use strict"; - - define(["design/init"], function (designModule) { - - designModule - /** - * Directive used for automatic attribute editor creation - */ - .directive("guiFilterSelect", ["$designService", function ($designService) { - return { - restrict: "E", - templateUrl: $designService.getTemplate("design/gui/filter/select.html"), - - scope: { - "parent": "=object", - "attribute": "=editorScope", - "item": "=item" - }, - - controller: function ($scope) { - var getOptions; - var isInit = false; - - $scope.options = []; - - getOptions = function (opt) { - var options = {}; - - if (typeof $scope.attribute.Options === "string") { - try { - options = JSON.parse(opt.replace(/'/g, "\"")); - - } - catch (e) { - var parts = $scope.attribute.Options.replace(/[{}]/g, "").split(","); - for (var i = 0; i < parts.length; i += 1) { - options[parts[i]] = parts[i]; - } - } - } else { - options = opt; - } - - return options; - }; - - $scope.submit = function (id) { - $scope.item[$scope.attribute.Attribute] = id; - $scope.parent.newFilters[$scope.attribute.Attribute.toLowerCase()] = id.split(" "); - if (-1 !== ['text', 'string'].indexOf($scope.item.dataType)) { - $scope.parent.newFilters[$scope.attribute.Attribute.toLowerCase()] = id.split(" "); - } else { - $scope.parent.newFilters[$scope.attribute.Attribute.toLowerCase()] = id; - } - }; - - $scope.$watch("item", function () { - if (typeof $scope.item === "undefined" || isInit) { - return false; - } - - var options, field, setNewFilterValues; - - setNewFilterValues = function () { - if (-1 !== ['text', 'string'].indexOf($scope.item.dataType)) { - $scope.item[$scope.attribute.Attribute] = $scope.item[$scope.attribute.Attribute].replace(/~/g, ""); - $scope.parent.newFilters[$scope.attribute.Attribute] = $scope.item[$scope.attribute.Attribute].replace(/~/g, "").split(" "); - } else { - $scope.item[$scope.attribute.Attribute] = $scope.item[$scope.attribute.Attribute].replace(/~/g, ""); - $scope.parent.newFilters[$scope.attribute.Attribute] = $scope.item[$scope.attribute.Attribute].replace(/~/g, ""); - } - - }; - - $scope.options = []; - options = getOptions($scope.attribute.Options); - - for (field in options) { - if (options.hasOwnProperty(field)) { - $scope.options.unshift({ - Desc: "", - Extra: null, - Id: field, - Image: "", - Name: options[field] - }); - } - } - - setNewFilterValues(); - - isInit = true; - }); +angular.module("designModule") +/** +* Directive used for automatic attribute editor creation +*/ +.directive("guiFilterSelect", ["$designService", function ($designService) { + return { + restrict: "E", + templateUrl: $designService.getTemplate("design/gui/filter/select.html"), + + scope: { + "parent": "=object", + "attribute": "=editorScope", + "item": "=item" + }, + + controller: function ($scope) { + var getOptions; + var isInit = false; + + $scope.options = []; + + getOptions = function (opt) { + var options = {}; + + if (typeof $scope.attribute.Options === "string") { + try { + options = JSON.parse(opt.replace(/'/g, "\"")); + + } + catch (e) { + var parts = $scope.attribute.Options.replace(/[{}]/g, "").split(","); + for (var i = 0; i < parts.length; i += 1) { + options[parts[i]] = parts[i]; + } } + } else { + options = opt; + } + + return options; + }; + + $scope.submit = function (id) { + $scope.item[$scope.attribute.Attribute] = id; + $scope.parent.newFilters[$scope.attribute.Attribute.toLowerCase()] = id.split(" "); + if (-1 !== ['text', 'string'].indexOf($scope.item.dataType)) { + $scope.parent.newFilters[$scope.attribute.Attribute.toLowerCase()] = id.split(" "); + } else { + $scope.parent.newFilters[$scope.attribute.Attribute.toLowerCase()] = id; + } + }; + + $scope.$watch("item", function () { + if (typeof $scope.item === "undefined" || isInit) { + return false; + } + + var options, field, setNewFilterValues; + + setNewFilterValues = function () { + if (-1 !== ['text', 'string'].indexOf($scope.item.dataType)) { + $scope.item[$scope.attribute.Attribute] = $scope.item[$scope.attribute.Attribute].replace(/~/g, ""); + $scope.parent.newFilters[$scope.attribute.Attribute] = $scope.item[$scope.attribute.Attribute].replace(/~/g, "").split(" "); + } else { + $scope.item[$scope.attribute.Attribute] = $scope.item[$scope.attribute.Attribute].replace(/~/g, ""); + $scope.parent.newFilters[$scope.attribute.Attribute] = $scope.item[$scope.attribute.Attribute].replace(/~/g, ""); + } + }; - }]); - return designModule; - }); -})(window.define); \ No newline at end of file + $scope.options = []; + options = getOptions($scope.attribute.Options); + + for (field in options) { + if (options.hasOwnProperty(field)) { + $scope.options.unshift({ + Desc: "", + Extra: null, + Id: field, + Image: "", + Name: options[field] + }); + } + } + + setNewFilterValues(); + + isInit = true; + }); + } + }; +}]); \ No newline at end of file diff --git a/app/scripts/design/directives/filter/guiText.js b/app/scripts/design/directives/filter/guiText.js index 3f65eebb..3e19c6bb 100644 --- a/app/scripts/design/directives/filter/guiText.js +++ b/app/scripts/design/directives/filter/guiText.js @@ -1,50 +1,42 @@ -(function (define) { - "use strict"; - - define(["design/init"], function (designModule) { - designModule - /** - * Directive used for automatic attribute editor creation - */ - .directive("guiFilterText", ["$designService", function ($designService) { - return { - restrict: "E", - scope: { - "parent": "=object", - "attribute": "=editorScope", - "item": "=item" - }, - templateUrl: $designService.getTemplate("design/gui/filter/text.html"), - - controller: ["$scope", - function ($scope) { - var isInit = false; - - $scope.submit = function () { - $scope.parent.newFilters[$scope.attribute.Attribute.toLowerCase()] = $scope.item[$scope.attribute.Attribute].split(" "); - $scope.item[$scope.attribute.Attribute] = $scope.item[$scope.attribute.Attribute].replace(" ", ","); - - isInit = false; - }; - - $scope.$watch("item", function () { - if (typeof $scope.item === "undefined") { - return false; - } - if (isInit || typeof $scope.item[$scope.attribute.Attribute] === "undefined") { - return false; - } - - $scope.item[$scope.attribute.Attribute] = $scope.item[$scope.attribute.Attribute].replace(/~/g, "").replace(/,/g, " "); - $scope.parent.newFilters[$scope.attribute.Attribute.toLowerCase()] = $scope.item[$scope.attribute.Attribute].split(" "); - isInit = true; - - }, true); - } - ] +angular.module("designModule") +/** +* Directive used for automatic attribute editor creation +*/ +.directive("guiFilterText", ["$designService", function ($designService) { + return { + restrict: "E", + scope: { + "parent": "=object", + "attribute": "=editorScope", + "item": "=item" + }, + templateUrl: $designService.getTemplate("design/gui/filter/text.html"), + + controller: ["$scope", + function ($scope) { + var isInit = false; + + $scope.submit = function () { + $scope.parent.newFilters[$scope.attribute.Attribute.toLowerCase()] = $scope.item[$scope.attribute.Attribute].split(" "); + $scope.item[$scope.attribute.Attribute] = $scope.item[$scope.attribute.Attribute].replace(" ", ","); + + isInit = false; }; - }]); - return designModule; - }); -})(window.define); \ No newline at end of file + $scope.$watch("item", function () { + if (typeof $scope.item === "undefined") { + return false; + } + if (isInit || typeof $scope.item[$scope.attribute.Attribute] === "undefined") { + return false; + } + + $scope.item[$scope.attribute.Attribute] = $scope.item[$scope.attribute.Attribute].replace(/~/g, "").replace(/,/g, " "); + $scope.parent.newFilters[$scope.attribute.Attribute.toLowerCase()] = $scope.item[$scope.attribute.Attribute].split(" "); + isInit = true; + + }, true); + } + ] + }; +}]); \ No newline at end of file diff --git a/app/scripts/design/directives/guiAttributesEditorForm.js b/app/scripts/design/directives/guiAttributesEditorForm.js index 1c4c7e6b..7a83b6a6 100644 --- a/app/scripts/design/directives/guiAttributesEditorForm.js +++ b/app/scripts/design/directives/guiAttributesEditorForm.js @@ -1,54 +1,45 @@ -(function (define) { - "use strict"; - - define(["design/init"], function (designModule) { - designModule - - /** - * Directive used for automatic attributes editor form creation - * - * Form to edit as accordion - */ - .directive("guiAttributesEditorForm", ["$designService", function ($designService) { - return { - restrict: "E", - scope: { - "parent": "=object", - "item": "=item", - "attributes": "=attributesList" - }, - templateUrl: $designService.getTemplate("design/gui/attributesEditorForm.html"), - controller: function ($scope) { - var updateAttributes; - updateAttributes = function () { - var i, groups, setAttrValue; - groups = {}; - setAttrValue = function(attr){ - if (typeof $scope.item !== "undefined") { - attr.Value = $scope.item[attr.Attribute] || ""; - } - - return attr; - }; - if (typeof $scope.attributes !== "undefined") { - for (i = 0; i < $scope.attributes.length; i += 1) { - var attr = $scope.attributes[i]; - attr= setAttrValue(attr); - if (typeof groups[attr.Group] === "undefined") { - groups[attr.Group] = []; - } - groups[attr.Group].push(attr); - } - } - $scope.attributeGroups = groups; - }; - - $scope.$watchCollection("attributes", updateAttributes); - $scope.$watchCollection("item", updateAttributes); +angular.module("designModule") +/** +* Directive used for automatic attributes editor form creation +* +* Form to edit as accordion +*/ +.directive("guiAttributesEditorForm", ["$designService", function ($designService) { + return { + restrict: "E", + scope: { + "parent": "=object", + "item": "=item", + "attributes": "=attributesList" + }, + templateUrl: $designService.getTemplate("design/gui/attributesEditorForm.html"), + controller: function ($scope) { + var updateAttributes; + updateAttributes = function () { + var i, groups, setAttrValue; + groups = {}; + setAttrValue = function(attr){ + if (typeof $scope.item !== "undefined") { + attr.Value = $scope.item[attr.Attribute] || ""; } + + return attr; }; - }]); + if (typeof $scope.attributes !== "undefined") { + for (i = 0; i < $scope.attributes.length; i += 1) { + var attr = $scope.attributes[i]; + attr= setAttrValue(attr); + if (typeof groups[attr.Group] === "undefined") { + groups[attr.Group] = []; + } + groups[attr.Group].push(attr); + } + } + $scope.attributeGroups = groups; + }; - return designModule; - }); -})(window.define); + $scope.$watchCollection("attributes", updateAttributes); + $scope.$watchCollection("item", updateAttributes); + } + }; +}]); diff --git a/app/scripts/design/directives/guiAttributesEditorFormTabs.js b/app/scripts/design/directives/guiAttributesEditorFormTabs.js index 88d4f8e6..63c28775 100644 --- a/app/scripts/design/directives/guiAttributesEditorFormTabs.js +++ b/app/scripts/design/directives/guiAttributesEditorFormTabs.js @@ -1,84 +1,85 @@ -(function (define) { - "use strict"; +angular.module("designModule") - define(["design/init"], function (designModule) { - designModule +/** +* Directive used for automatic attributes editor form creation +* +* Form to edit with tabs +*/ +.directive("guiAttributesEditorFormTabs", ["$designService", "$dashboardUtilsService", function ($designService, $dashboardUtilsService) { + return { + restrict: "E", + scope: { + "parent": "=object", + "item": "=item", + "attributes": "=attributesList" + }, + templateUrl: $designService.getTemplate("design/gui/attributesEditorFormTabs.html"), + controller: function ($scope) { + var updateAttributes; - /** - * Directive used for automatic attributes editor form creation - * - * Form to edit with tabs - */ - .directive("guiAttributesEditorFormTabs", ["$designService", "$dashboardUtilsService", function ($designService, $dashboardUtilsService) { - return { - restrict: "E", - scope: { - "parent": "=object", - "item": "=item", - "attributes": "=attributesList" - }, - templateUrl: $designService.getTemplate("design/gui/attributesEditorFormTabs.html"), - controller: function ($scope) { - var updateAttributes; + $scope.click = function (id) { + if (typeof $scope.parent.selectTab === "function") { + $scope.parent.selectTab(id); + } else { + return false; + } + }; - $scope.click = function (id) { - if (typeof $scope.parent.selectTab === "function") { - $scope.parent.selectTab(id); - } else { - return false; - } - }; + $scope.save = function () { + $scope.otEditForm.submitted = true; + if ($scope.otEditForm.$valid) { + $scope.parent.save(); + } else { + $scope.parent.message = $dashboardUtilsService.getMessage(null, "warning", "Form is invalid"); + } + }; - $scope.save = function () { - $scope.otEditForm.submitted = true; - if ($scope.otEditForm.$valid) { - $scope.parent.save(); - } else { - $scope.parent.message = $dashboardUtilsService.getMessage(null, "warning", "Form is invalid"); - } - }; + $scope.back = function () { + $scope.parent.back(); + }; - $scope.back = function () { - $scope.parent.back(); - }; + updateAttributes = function () { + var i, groups, setAttrValue; + groups = {}; + setAttrValue = function (attr) { + if (typeof $scope.item !== "undefined") { + attr.Value = $scope.item[attr.Attribute] || ""; + } - updateAttributes = function () { - var i, groups, setAttrValue; - groups = {}; - setAttrValue = function (attr) { - if (typeof $scope.item !== "undefined") { - attr.Value = $scope.item[attr.Attribute] || ""; - } + return attr; + }; + if (typeof $scope.attributes !== "undefined") { + for (i = 0; i < $scope.attributes.length; i += 1) { + var attr = $scope.attributes[i]; + attr = setAttrValue(attr); + if (typeof groups[attr.Group] === "undefined") { + groups[attr.Group] = []; + } + groups[attr.Group].push(attr); + } + } - return attr; - }; - if (typeof $scope.attributes !== "undefined") { - for (i = 0; i < $scope.attributes.length; i += 1) { - var attr = $scope.attributes[i]; - attr = setAttrValue(attr); - if (typeof groups[attr.Group] === "undefined") { - groups[attr.Group] = []; - } - groups[attr.Group].push(attr); - } - } - $scope.attributeGroups = groups; - }; + // Sort groups in alphabetical order + var sortedGroupNames = Object.keys(groups).sort(); + var sortedGroups = {}; + for (var i = 0; i < sortedGroupNames.length; i++) { + var groupName = sortedGroupNames[i]; + sortedGroups[groupName] = groups[groupName]; + } - $scope.$watchCollection("attributes", updateAttributes); - $scope.$watchCollection("item", updateAttributes); + $scope.attributeGroups = sortedGroups; + }; - $scope.$watch("editForm", function () { - $scope.parent.form = $scope.otEditForm; - }, true); + $scope.$watchCollection("attributes", updateAttributes); + $scope.$watchCollection("item", updateAttributes); - $scope.$watch("parent.message", function () { - $scope.message = $scope.parent.message; - }, true); - } - }; - }]); + $scope.$watch("editForm", function () { + $scope.parent.form = $scope.otEditForm; + }, true); - return designModule; - }); -})(window.define); + $scope.$watch("parent.message", function () { + $scope.message = $scope.parent.message; + }, true); + } + }; +}]); diff --git a/app/scripts/design/directives/guiFormBuilder.js b/app/scripts/design/directives/guiFormBuilder.js index 3c18be37..361af83c 100644 --- a/app/scripts/design/directives/guiFormBuilder.js +++ b/app/scripts/design/directives/guiFormBuilder.js @@ -1,28 +1,20 @@ -(function (define) { - "use strict"; - - define(["design/init"], function (designModule) { - designModule - - /** - * Directive used for automatic attributes editor form creation - * - */ - .directive("guiFormBuilder", ["$designService", function ($designService) { - return { - restrict: "E", - scope: { - "parent": "=object", - "item": "=item", - "attributes": "=attributes" - }, - templateUrl: $designService.getTemplate("design/gui/formBuilder.html"), - controller: ["$scope", - function () { - } - ] - }; - }]); - return designModule; - }); -})(window.define); +angular.module("designModule") +/** +* Directive used for automatic attributes editor form creation +* +*/ +.directive("guiFormBuilder", ["$designService", function ($designService) { + return { + restrict: "E", + scope: { + "parent": "=object", + "item": "=item", + "attributes": "=attributes" + }, + templateUrl: $designService.getTemplate("design/gui/formBuilder.html"), + controller: ["$scope", + function () { + } + ] + }; +}]); \ No newline at end of file diff --git a/app/scripts/design/directives/guiInputFile.js b/app/scripts/design/directives/guiInputFile.js new file mode 100644 index 00000000..a72b2fa7 --- /dev/null +++ b/app/scripts/design/directives/guiInputFile.js @@ -0,0 +1,43 @@ +angular.module('designModule') + +// Directive for file input value binding +// Hides file input and wraps it within button element +// to provide better possibilities for styling +.directive('guiInputFile', ['$designService', function ($designService) { + return { + restrict: 'E', + scope: { + 'file': '=', // bind file input value to outer scope + 'id': '=inputId', // file input id + 'name': '=inputName', // file input name attribute + 'onChange': '&' // On change event listener + }, + templateUrl: $designService.getTemplate("design/gui/inputFile.html"), + replace: true, + transclude: true, + + link: function(scope, element, attr, ctrl, transclude) { + var fileInput = element.find('input'); + + fileInput.on('change', function(event) { + scope.$apply(function() { + // Update scope.file when file input changes + scope.file = event.target.files[0]; + // Run onChange listener + if (scope.onChange) scope.onChange(); + }); + }); + + // Cancel event bubbling when file input click triggered + fileInput.on('click', function(e) { + e.stopPropagation(); + }); + + // Click event on button triggers click on file input + // to open file dialog + element.on('click', function() { + fileInput.trigger('click'); + }); + } + } +}]); \ No newline at end of file diff --git a/app/scripts/design/directives/guiListManager.js b/app/scripts/design/directives/guiListManager.js index 99515fed..b889b2e3 100644 --- a/app/scripts/design/directives/guiListManager.js +++ b/app/scripts/design/directives/guiListManager.js @@ -1,141 +1,131 @@ -(function (define) { - "use strict"; - - define(["design/init"], function (designModule) { - var assignMapping; - - assignMapping = function (mapping) { - var unsupportedAttr, supportedAttr, defaultMapping; +angular.module("designModule") + +/** +* Directive used for automatic attributes editor form creation +* +* guiListManager: +* +* Variables: +* items - array of items for list +* parent - should implement next functions +* - clearForm() - cleaning form +* - switchListView(type) - the switching the type of the list view +* - select(id) - selecting item of the list +* - delete(id) - deleting item from the list +* - getImage(path, filename) - returns full path to image +* mapping - mapping internal fields of list to the fields from item +* +* Functions: +* $scope.hasImage {boolean} - Returns an indication the list has images or not +* $scope.getListType {string} - Returns the necessary class for list +*/ + +.directive("guiListManager", ["$designService", function ($designService) { + return { + restrict: "E", + scope: { + "parent": "=object", + "items": "=items", + "addNewDisable": "=addNewDisable", + "mapping": "=mapping" + }, + templateUrl: $designService.getTemplate("design/gui/list.html"), + controller: function ($scope) { + + var assignMapping = function (mapping) { + var unsupportedAttr, supportedAttr, defaultMapping; + + /** + * Unsupported attributes + * + * @type {string[]} + */ + unsupportedAttr = []; + + /** + * supported attributes + * + * @type {string[]} + */ + supportedAttr = ["id", "name", "image", "shortDesc", "additionalName"]; + + /** + * Default mapping + * @type {object} + */ + defaultMapping = { + "id": "Id", + "name": "Name", + "image": "Image", + "shortDesc": "Desc", + "additionalName": "additional" + }; + + for (var field in mapping) { + if (mapping.hasOwnProperty(field)) { + if (typeof defaultMapping[field] !== "undefined") { + defaultMapping[field] = mapping[field]; + } else { + unsupportedAttr.push("'" + field + "'"); + } + } + } + if (unsupportedAttr.length > 0) { + console.warn("\nUnsupported attributes for list:\n " + unsupportedAttr.join("\n ") + + "\n" + "List of available attributes for setting:\n " + supportedAttr.join("\n ")); + } + + return defaultMapping; + }; + + $scope.map = assignMapping($scope.mapping); + + $scope.canAddNew = function () { + return $scope.addNewDisable; + }; /** - * Unsupported attributes + * Returns an indication the list has images or not * - * @type {string[]} + * @returns {boolean} */ - unsupportedAttr = []; + $scope.hasImage = function () { + var i, field, item; + + for (i = 0; i < $scope.items.length; i += 1) { + item = $scope.items[i]; + for (field in item) { + if (item.hasOwnProperty(field)) { + if (field === "Image" && item[field] !== "") { + return true; + } + } + } + } - /** - * supported attributes - * - * @type {string[]} - */ - supportedAttr = ["id", "name", "image", "shortDesc", "additionalName"]; + return false; + }; /** - * Default mapping - * @type {object} + * Returns the necessary class for list + * + * @returns {string} */ - defaultMapping = { - "id": "Id", - "name": "Name", - "image": "Image", - "shortDesc": "Desc", - "additionalName": "additional" - }; - - for (var field in mapping) { - if (mapping.hasOwnProperty(field)) { - if (typeof defaultMapping[field] !== "undefined") { - defaultMapping[field] = mapping[field]; - } else { - unsupportedAttr.push("'" + field + "'"); - } + $scope.getListType = function () { + var _class; + switch ($scope.parent.activeView) { + case "tile": + _class = " product-list tile"; + break; + case "list": + _class = " product-list"; + break; + default: + _class = " product-list"; } - } - if (unsupportedAttr.length > 0) { - console.warn("\nUnsupported attributes for list:\n " + unsupportedAttr.join("\n ") + - "\n" + "List of available attributes for setting:\n " + supportedAttr.join("\n ")); - } - - return defaultMapping; - }; - - designModule - - /** - * Directive used for automatic attributes editor form creation - * - * guiListManager: - * - * Variables: - * items - array of items for list - * parent - should implement next functions - * - clearForm() - cleaning form - * - switchListView(type) - the switching the type of the list view - * - select(id) - selecting item of the list - * - delete(id) - deleting item from the list - * - getImage(path, filename) - returns full path to image - * mapping - mapping internal fields of list to the fields from item - * - * Functions: - * $scope.hasImage {boolean} - Returns an indication the list has images or not - * $scope.getListType {string} - Returns the necessary class for list - */ - .directive("guiListManager", ["$designService", function ($designService) { - return { - restrict: "E", - scope: { - "parent": "=object", - "items": "=items", - "addNewDisable": "=addNewDisable", - "mapping": "=mapping" - }, - templateUrl: $designService.getTemplate("design/gui/list.html"), - controller: function ($scope) { - - $scope.map = assignMapping($scope.mapping); - - $scope.canAddNew = function () { - return $scope.addNewDisable; - }; - - /** - * Returns an indication the list has images or not - * - * @returns {boolean} - */ - $scope.hasImage = function () { - var i, field, item; - - for (i = 0; i < $scope.items.length; i += 1) { - item = $scope.items[i]; - for (field in item) { - if (item.hasOwnProperty(field)) { - if (field === "Image" && item[field] !== "") { - return true; - } - } - } - } - - return false; - }; - - /** - * Returns the necessary class for list - * - * @returns {string} - */ - $scope.getListType = function () { - var _class; - switch ($scope.parent.activeView) { - case "tile": - _class = " product-list tile"; - break; - case "list": - _class = " product-list"; - break; - default: - _class = " product-list"; - } - return _class; - }; - - } - }; - }] - ); + return _class; + }; - return designModule; - }); -})(window.define); + } + }; +}]); diff --git a/app/scripts/design/directives/guiMessageManager.js b/app/scripts/design/directives/guiMessageManager.js index cf44b3f0..571197a8 100644 --- a/app/scripts/design/directives/guiMessageManager.js +++ b/app/scripts/design/directives/guiMessageManager.js @@ -1,45 +1,41 @@ -(function (define) { - "use strict"; - - define(["design/init"], function (designModule) { - - designModule.directive("guiMessageManager", ["$designService", "$timeout", function ($designService, $timeout) { - return { - restrict: "E", - scope: { - "obj": "=item" - }, - templateUrl: $designService.getTemplate("design/gui/guiMessageManager.html"), - link: function ($scope) { - var timeout; - $scope.isShow = false; - $scope.$watch("obj", function () { - - if (typeof $scope.obj !== "undefined") { - - $scope.msg = $scope.obj.message; - $scope.type = $scope.obj.type || "success"; - $scope.isShow = true; - timeout = $scope.obj.timeout; - - if(timeout > 0) { - $timeout(function () { - $scope.close(); - }, 2000); - } - } - - }); - - $scope.close = function () { - $scope.isShow = false; - $scope.msg = false; - }; +angular.module("designModule") + +.directive("guiMessageManager", ["$designService", "$timeout", function ($designService, $timeout) { + + return { + restrict: "E", + scope: { + "obj": "=item" + }, + templateUrl: $designService.getTemplate("design/gui/guiMessageManager.html"), + link: function ($scope) { + var timeout; + $scope.isShow = false; + $scope.$watch("obj", function () { + + if (typeof $scope.obj !== "undefined") { + + $scope.msg = $scope.obj.message; + $scope.type = $scope.obj.type || "success"; + $scope.isShow = true; + timeout = $scope.obj.timeout; + + if(timeout > 0) { + $timeout(function () { + $scope.close(); + }, 2000); + } } + + }); + + $scope.close = function () { + $scope.isShow = false; + $scope.msg = false; }; - }]); - return designModule; - }); -})(window.define); + } + }; + +}]); diff --git a/app/scripts/design/directives/guiPaginator.js b/app/scripts/design/directives/guiPaginator.js index eb136f94..00fdde51 100644 --- a/app/scripts/design/directives/guiPaginator.js +++ b/app/scripts/design/directives/guiPaginator.js @@ -1,63 +1,47 @@ -(function (define) { - 'use strict'; - - define(['design/init'], function (designModule) { - - /** - * getClass(page) - * setPage(page) - * getPages() - */ - designModule.directive('guiPaginator', ['$location', '$designService', function ($location, $designService) { - return { - restrict: 'E', - scope: { - 'parent': '=object' - }, - templateUrl: $designService.getTemplate('design/gui/paginator.html'), - controller: ["$scope", - function ($scope) { - - $scope.pages = $scope.parent.getPages(); - - var countNeighbors = 2; - $scope.leftBreak = false; - $scope.rightBreak = false; - - $scope.isNeighbors = function (page) { - return Math.abs($scope.parent.paginator.page - page) <= countNeighbors; - }; - - $scope.hasLeftBreak = function () { - return $scope.leftBreak; - }; - - $scope.hasRightBreak = function () { - return $scope.rightBreak; - }; - - - $scope.$watch("parent.paginator.page", function () { - if (typeof $scope.parent.paginator === "undefined") { - return true; - } - - var leftBorder = $scope.parent.paginator.page - countNeighbors; - var rightBorder = $scope.parent.paginator.page + countNeighbors; - - if (leftBorder > $scope.parent.getPages()[0] + 1 ) { - $scope.leftBreak = true; - } - - if (rightBorder < $scope.parent.getPages()[$scope.parent.getPages().length-1]-1) { - $scope.rightBreak = true; - } - }, true); +/** + * getClass(page) + * setPage(page) + * getPages() + */ + +angular.module("designModule") + +.directive('guiPaginator', ['$location', '$designService', function ($location, $designService) { + return { + restrict: 'E', + scope: { + 'parent': '=object' + }, + templateUrl: $designService.getTemplate('design/gui/paginator.html'), + controller: ["$scope", + function ($scope) { + + var countNeighbors = 4; + $scope.leftBreak = false; + $scope.rightBreak = false; + + $scope.isNeighbors = function (page) { + return Math.abs($scope.parent.paginator.page - page) <= countNeighbors; + }; + + $scope.$watch("parent.paginator.page", function () { + if (typeof $scope.parent.paginator === "undefined") { + return true; } - ] - }; - }]); - return designModule; - }); -})(window.define); + var leftBorder = $scope.parent.paginator.page - countNeighbors; + var rightBorder = $scope.parent.paginator.page + countNeighbors; + + if (leftBorder > 2 ) { + $scope.leftBreak = true; + } + + if (rightBorder < $scope.parent.paginator.countPages - 1 ) { + $scope.rightBreak = true; + } + + }, true); + } + ] + }; +}]); diff --git a/app/scripts/design/directives/guiTableManager.js b/app/scripts/design/directives/guiTableManager.js index 7a1603b1..138514bd 100644 --- a/app/scripts/design/directives/guiTableManager.js +++ b/app/scripts/design/directives/guiTableManager.js @@ -1,478 +1,465 @@ -(function (define) { - "use strict"; - - define(["design/init"], function (designModule) { - var assignMapping; - - assignMapping = function (mapping) { - var defaultMapping; - - /** - * Default mapping - * @type {object} - */ - defaultMapping = { - "id": "ID", - "name": "Name", - "image": "Image", - "shortDesc": "Desc", - "additionalName": "additional" - }; - - for (var field in mapping) { - if (mapping.hasOwnProperty(field)) { - if (typeof defaultMapping[field] !== "undefined") { - defaultMapping[field] = mapping[field]; - } +angular.module("designModule") + +/** +* Directive used for automatic attributes editor form creation +* +*/ +.directive("guiTableManager", [ + "$location", + "$designService", + "COUNT_ITEMS_PER_PAGE", + function ($location, $designService, COUNT_ITEMS_PER_PAGE) { + return { + restrict: "E", + scope: { + "parent": "=object", + "items": "=items", + "buttonData": "=buttons", + "mapping": "=mapping" + }, + templateUrl: $designService.getTemplate("design/gui/table.html"), + controller: function ($scope) { + // Variables + var isInit, isSelectedAll, activeFilters; + + // Functions + var prepareFilters, getOptions, getFilterStr, compareFilters, saveCurrentActiveFilters, + getFilterDetails, getQueryStr, getLimitStr, getSortStr; + + isInit = false; + isSelectedAll = false; + activeFilters = {}; + + var assignMapping = function (mapping) { + var defaultMapping; + + /** + * Default mapping + * @type {object} + */ + defaultMapping = { + "id": "ID", + "name": "Name", + "image": "Image", + "shortDesc": "Desc", + "additionalName": "additional" + }; + + for (var field in mapping) { + if (mapping.hasOwnProperty(field)) { + if (typeof defaultMapping[field] !== "undefined") { + defaultMapping[field] = mapping[field]; + } + } + } + + return defaultMapping; + }; + + // Scope data + $scope.map = assignMapping($scope.mapping); + $scope.filters = []; + $scope.newFilters = {}; + $scope.buttons = { + // name: isActive + new: true, + delete: true } - } - return defaultMapping; - }; + // If we have any buttonData set on the directive, let it override our defaults + angular.forEach($scope.buttonData, function(isActive, btnName) { + $scope.buttons[btnName] = isActive; + }); - designModule - - /** - * Directive used for automatic attributes editor form creation - * - */ - .directive("guiTableManager", [ - "$location", - "$designService", - "COUNT_ITEMS_PER_PAGE", - function ($location, $designService, COUNT_ITEMS_PER_PAGE) { - return { - restrict: "E", - scope: { - "parent": "=object", - "items": "=items", - "buttonData": "=buttons", - "mapping": "=mapping" - }, - templateUrl: $designService.getTemplate("design/gui/table.html"), - controller: function ($scope) { - // Variables - var isInit, isSelectedAll, activeFilters, possibleButtons; - - // Functions - var prepareFilters, getOptions, getFilterStr, compareFilters, saveCurrentActiveFilters, - getFilterDetails, getQueryStr, getLimitStr, getSortStr; - - isInit = false; - isSelectedAll = false; - possibleButtons = ["new", "delete"]; - activeFilters = {}; - - // Scope data - $scope.map = assignMapping($scope.mapping); - $scope.filters = []; - $scope.newFilters = {}; - - $scope.init = function () { - var i, search; - search = $location.search(); - - // Init buttons - if (typeof $scope.buttons === "undefined") { - $scope.buttons = {}; - for (i = 0; i < possibleButtons.length; i += 1) { - $scope.buttons[possibleButtons[i]] = typeof $scope.buttonData !== "undefined" ? $scope.buttonData[possibleButtons[i]] : true; - } - } + var search = $location.search() + $scope.sort = { + "currentValue": search.sort, + "newValue": null + }; - // Init sorting - $scope.sort = { - "currentValue": search.sort, - "newValue": null - }; - }; + getOptions = function (opt) { + var options = {"": ""}; - getOptions = function (opt) { - var options = {"": ""}; + if (typeof opt === "string") { + try { + options = JSON.parse(opt.replace(/'/g, "\"")); + } + catch (e) { + var parts = opt.replace(/[{}]/g, "").split(","); + for (var i = 0; i < parts.length; i += 1) { + options[parts[i]] = parts[i]; + } + } + } else { + options = opt; + } - if (typeof opt === "string") { - try { - options = JSON.parse(opt.replace(/'/g, "\"")); - } - catch (e) { - var parts = opt.replace(/[{}]/g, "").split(","); - for (var i = 0; i < parts.length; i += 1) { - options[parts[i]] = parts[i]; - } - } - } else { - options = opt; - } + return options; + }; + + /** + * Save active filters + * + * @param {object} field + */ + saveCurrentActiveFilters = function (filterDetails) { + if (filterDetails.filterValue) { + //REFACTOR: dataType is actually assigned by a request for attribute information from the server, + // and apparently id is it's own type + if (-1 !== ['text', 'string', 'varchar', 'id'].indexOf(filterDetails.dataType)) { + activeFilters[filterDetails.attribute.toLowerCase()] = filterDetails.filterValue.replace(/~/g, "").split(","); + } else { + activeFilters[filterDetails.attribute.toLowerCase()] = filterDetails.filterValue.replace(/~/g, ""); + } + } + }; - return options; - }; - - /** - * Save active filters - * - * @param {object} field - */ - saveCurrentActiveFilters = function (filterDetails) { - if (filterDetails.filterValue) { - if (-1 !== ['text', 'string', 'varchar'].indexOf(filterDetails.dataType)) { - activeFilters[filterDetails.attribute.toLowerCase()] = filterDetails.filterValue.replace(/~/g, "").split(","); - } else { - activeFilters[filterDetails.attribute.toLowerCase()] = filterDetails.filterValue.replace(/~/g, ""); - } - } - }; + getFilterDetails = function (field) { + var filterInfo, parts, details; - getFilterDetails = function (field) { - var filterInfo, parts, details; + filterInfo = field.filter; + parts = filterInfo.match(/.+(\{.*\})/i); - filterInfo = field.filter; - parts = filterInfo.match(/.+(\{.*\})/i); + details = { + "options": parts === null ? {} : getOptions(parts[1]), + "type": filterInfo.substr(0, (-1 !== filterInfo.indexOf("{") ? filterInfo.indexOf("{") : filterInfo.length)), + "dataType": field.dataType, + "filterValue": field.filterValue, + "attribute": field.attribute, + "visible": field.visible + }; - details = { - "options": parts === null ? {} : getOptions(parts[1]), - "type": filterInfo.substr(0, (-1 !== filterInfo.indexOf("{") ? filterInfo.indexOf("{") : filterInfo.length)), - "dataType": field.dataType, - "filterValue": field.filterValue, - "attribute": field.attribute, - "visible": field.visible - }; + if ("select" === details.type) { + details.options[""] = ""; + } - if ("select" === details.type) { - details.options[""] = ""; - } + return details; + }; - return details; - }; + prepareFilters = function () { + var i, filterDetails, filter; - prepareFilters = function () { - var i, filterDetails, filter; + for (i = 0; i < $scope.parent.fields.length; i += 1) { - for (i = 0; i < $scope.parent.fields.length; i += 1) { + if (typeof $scope.parent.fields[i].filter === "undefined") { + $scope.filters.push({}); + continue; + } - if (typeof $scope.parent.fields[i].filter === "undefined") { - $scope.filters.push({}); - continue; - } + filterDetails = getFilterDetails($scope.parent.fields[i]); + filter = { + "type": filterDetails.type, + "dataType": filterDetails.dataType, + "visible": filterDetails.visible || false, + "attributes": { + "Attribute": filterDetails.attribute, + "Options": filterDetails.options + } + }; + + filter[filterDetails.attribute] = filterDetails.filterValue || ""; + saveCurrentActiveFilters(filterDetails); + + $scope.filters.push(filter); + } + }; + + /** + * Checks filters has the changes or not + * + * @returns {boolean} + */ + compareFilters = function () { + var checkActiveFilters, compareArrays, check; + + checkActiveFilters = function (key) { + if ($scope.newFilters[key] instanceof Array) { + if ("" !== $scope.newFilters[key].sort().join()) { + return false; + } + } else if ($scope.newFilters[key].trim() !== "") { + return false; + } - filterDetails = getFilterDetails($scope.parent.fields[i]); - filter = { - "type": filterDetails.type, - "dataType": filterDetails.dataType, - "visible": filterDetails.visible || false, - "attributes": { - "Attribute": filterDetails.attribute, - "Options": filterDetails.options - } - }; - - filter[filterDetails.attribute] = filterDetails.filterValue || ""; - saveCurrentActiveFilters(filterDetails); - - $scope.filters.push(filter); - } - }; - - /** - * Checks filters has the changes or not - * - * @returns {boolean} - */ - compareFilters = function () { - var checkActiveFilters, compareArrays, check; - - checkActiveFilters = function (key) { - if ($scope.newFilters[key] instanceof Array) { - if ("" !== $scope.newFilters[key].sort().join()) { - return false; - } - } else if ($scope.newFilters[key].trim() !== "") { - return false; - } + return true; + }; - return true; - }; - - compareArrays = function (key) { - if ($scope.newFilters[key] instanceof Array && typeof activeFilters[key] !== "undefined") { - if ($scope.newFilters[key].sort().join() !== activeFilters[key].sort().join()) { - return false; - } - } else { - if ($scope.newFilters[key] !== activeFilters[key]) { - return false; - } - } + compareArrays = function (key) { + if ($scope.newFilters[key] instanceof Array && typeof activeFilters[key] !== "undefined") { + if ($scope.newFilters[key].sort().join() !== activeFilters[key].sort().join()) { + return false; + } + } else { + if ($scope.newFilters[key] !== activeFilters[key]) { + return false; + } + } - return true; - }; + return true; + }; - check = function (key) { - if (typeof activeFilters[key] === "undefined") { - if (!checkActiveFilters(key)) { - return false; - } - return true; - } + check = function (key) { + if (typeof activeFilters[key] === "undefined") { + if (!checkActiveFilters(key)) { + return false; + } + return true; + } - if (!compareArrays(key)) { - return false; - } - return true; - }; - - for (var key in $scope.newFilters) { - if ($scope.newFilters.hasOwnProperty(key)) { - if (check(key)) { - continue; - } else { - return false; - } - } - } + if (!compareArrays(key)) { + return false; + } + return true; + }; - return true; - }; + for (var key in $scope.newFilters) { + if ($scope.newFilters.hasOwnProperty(key)) { + if (check(key)) { + continue; + } else { + return false; + } + } + } - /** PAGINATOR */ - $scope.getPages = function () { - if (typeof $scope.paginator === "undefined") { - return false; - } - var p, result; - result = []; + return true; + }; - for (p = 1; p <= $scope.paginator.countPages; p += 1) { - result.push(p); - } - return result; - }; + /** PAGINATOR */ + $scope.getPages = function () { + if (typeof $scope.paginator === "undefined") { + return false; + } + var p, result; + result = []; - $scope.setPage = function (page) { - if (typeof $scope.paginator === "undefined") { - return false; - } + for (p = 1; p <= $scope.paginator.countPages; p += 1) { + result.push(p); + } + return result; + }; - if ("prev" === page && $scope.paginator.page !== 1) { - $scope.paginator.page = $scope.paginator.page - 1; - } else if ("next" === page && $scope.paginator.page !== $scope.paginator.countPages) { - $scope.paginator.page = $scope.paginator.page + 1; - } else if (-1 === ["prev", "next"].indexOf(page)) { - $scope.paginator.page = page; - } + $scope.setPage = function (page) { + if (typeof $scope.paginator === "undefined") { + return false; + } - $location.search(getQueryStr()); - }; - - /** - * Gets class for item of paginator - * - * @param {string} page - * @returns {string} - */ - $scope.getClass = function (page) { - if (typeof $scope.paginator === "undefined") { - return ''; - } + if ("prev" === page && $scope.paginator.page !== 1) { + $scope.paginator.page = $scope.paginator.page - 1; + } else if ("next" === page && $scope.paginator.page !== $scope.paginator.countPages) { + $scope.paginator.page = $scope.paginator.page + 1; + } else if (-1 === ["prev", "next"].indexOf(page)) { + $scope.paginator.page = page; + } - var _class; - _class = ''; + $location.search(getQueryStr()); + }; + + /** + * Gets class for item of paginator + * + * @param {string} page + * @returns {string} + */ + $scope.getClass = function (page) { + if (typeof $scope.paginator === "undefined") { + return ''; + } - if (page === parseInt($scope.paginator.page, 10)) { - _class = 'active'; - } + var _class; + _class = ''; - if (("prev" === page && $scope.paginator.page === 1) || - ("next" === page && $scope.paginator.page >= $scope.paginator.countPages)) { - _class = 'disabled'; - } + if (page === parseInt($scope.paginator.page, 10)) { + _class = 'active'; + } - return _class; - }; + if (("prev" === page && $scope.paginator.page === 1) || + ("next" === page && $scope.paginator.page >= $scope.paginator.countPages)) { + _class = 'disabled'; + } - /** PAGINATOR END*/ + return _class; + }; - /** Sorting */ + /** PAGINATOR END*/ - $scope.getSortClass = function (attr) { - var _class = ""; - if (attr === $scope.sort.currentValue) { - _class = "fa fa-long-arrow-up"; - } else if (typeof $scope.sort.currentValue !== "undefined" && -1 !== $scope.sort.currentValue.indexOf(attr)) { - _class = "fa fa-long-arrow-down"; - } else { - _class = ""; - } + /** Sorting */ - return _class; - }; + $scope.getSortClass = function (attr) { + var _class = ""; + if (attr === $scope.sort.currentValue) { + _class = "fa fa-long-arrow-up"; + } else if (typeof $scope.sort.currentValue !== "undefined" && -1 !== $scope.sort.currentValue.indexOf(attr)) { + _class = "fa fa-long-arrow-down"; + } else { + _class = ""; + } - $scope.setSort = function (attr) { - $scope.sort.newValue = attr; - $location.search(getQueryStr()); - }; + return _class; + }; - $scope.selectAll = function () { - isSelectedAll = isSelectedAll ? false : true; - for (var i = 0; i < $scope.items.length; i += 1) { - $scope.parent.idsSelectedRows[$scope.items[i][$scope.map.id]] = isSelectedAll; - } - }; + $scope.setSort = function (attr) { + $scope.sort.newValue = attr; + $location.search(getQueryStr()); + }; - /** Sorting end*/ + $scope.selectAll = function () { + isSelectedAll = isSelectedAll ? false : true; + for (var i = 0; i < $scope.items.length; i += 1) { + $scope.parent.idsSelectedRows[$scope.items[i][$scope.map.id]] = isSelectedAll; + } + }; - getQueryStr = function (reset) { - var arr = []; + /** Sorting end*/ - getSortStr = function () { - if (JSON.stringify($scope.sort) === JSON.stringify({})) { - return ""; - } - var str; - - if ($scope.sort.newValue === $scope.sort.currentValue) { - str = "sort=^" + $scope.sort.newValue; - } else if (null !== $scope.sort.newValue) { - str = "sort=" + $scope.sort.newValue; - } else if (typeof $scope.sort.currentValue !== "undefined") { - str = "sort=" + $scope.sort.currentValue; - } + getQueryStr = function (reset) { + var arr = []; - return str; - }; + getSortStr = function () { + if (JSON.stringify($scope.sort) === JSON.stringify({})) { + return ""; + } + var str; + + if ($scope.sort.newValue === $scope.sort.currentValue) { + str = "sort=^" + $scope.sort.newValue; + } else if (null !== $scope.sort.newValue) { + str = "sort=" + $scope.sort.newValue; + } else if (typeof $scope.sort.currentValue !== "undefined") { + str = "sort=" + $scope.sort.currentValue; + } - getLimitStr = function (reset) { - var str = ""; - if (typeof $scope.paginator === "undefined") { - return str; - } + return str; + }; - if (reset) { - str = "limit=0," + $scope.paginator.countPerPage; - } else { - str = "limit=" + (($scope.paginator.page - 1) * $scope.paginator.countPerPage) + "," + $scope.paginator.countPerPage; - } + getLimitStr = function (reset) { + var str = ""; + if (typeof $scope.paginator === "undefined") { + return str; + } + + if (reset) { + str = "limit=0," + $scope.paginator.countPerPage; + } else { + str = "limit=" + (($scope.paginator.page - 1) * $scope.paginator.countPerPage) + "," + $scope.paginator.countPerPage; + } + + return str; + }; - return str; - }; - - /** - * Generates a query string for filters - * - * @param {array} filters - * @returns {string} - */ - getFilterStr = function (filters) { - var filtersArr = []; - - var removeEmpty = function (arr) { - for (var i = 0; i < arr.length; i += 1) { - if ("" === arr[i]) { - arr.splice(i, 1); - } - } - }; - for (var key in filters) { - if (filters.hasOwnProperty(key) && filters[key] !== "") { - if (filters[key] instanceof Array) { - removeEmpty(filters[key]); - if (filters[key].length > 0) { - filtersArr.push(key.toLowerCase() + '=~' + filters[key].join()); - } - } else { - filtersArr.push(key.toLowerCase() + '=' + filters[key]); - } - - } + /** + * Generates a query string for filters + * + * @param {array} filters + * @returns {string} + */ + getFilterStr = function (filters) { + var filtersArr = []; + + var removeEmpty = function (arr) { + for (var i = 0; i < arr.length; i += 1) { + if ("" === arr[i]) { + arr.splice(i, 1); + } + } + }; + for (var key in filters) { + if (filters.hasOwnProperty(key) && filters[key] !== "") { + if (filters[key] instanceof Array) { + removeEmpty(filters[key]); + if (filters[key].length > 0) { + filtersArr.push(key.toLowerCase() + '=~' + filters[key].join()); } + } else { + filtersArr.push(key.toLowerCase() + '=' + filters[key]); + } - return filtersArr.join("&"); - }; + } + } - arr.push(getFilterStr($scope.newFilters)); - arr.push(getSortStr()); - arr.push(getLimitStr(reset)); + return filtersArr.join("&"); + }; - return arr.join("&"); - }; + arr.push(getFilterStr($scope.newFilters)); + arr.push(getSortStr()); + arr.push(getLimitStr(reset)); - $scope.$watch("newFilters", function () { - if (typeof $scope.filters === "undefined") { - return false; - } + return arr.join("&"); + }; - if (!compareFilters()) { - $location.search(getQueryStr(true)); - } + $scope.$watch("newFilters", function () { + if (typeof $scope.filters === "undefined") { + return false; + } - }, true); + if (!compareFilters()) { + $location.search(getQueryStr(true)); + } - $scope.$watch("items", function () { - if (typeof $scope.items === "undefined") { - return false; - } - if (isInit) { - return false; - } + }, true); - var i, item, splitExtraData; + $scope.$watch("items", function () { + if (typeof $scope.items === "undefined") { + return false; + } + if (isInit) { + return false; + } - splitExtraData = function (item) { - var field; - for (field in item.Extra) { - if (item.Extra.hasOwnProperty(field)) { - item[field] = item.Extra[field]; - delete item.Extra[field]; - } - } - }; + var i, item, splitExtraData; - for (i = 0; i < $scope.items.length; i += 1) { - item = $scope.items[i]; - if (item.Extra !== null) { - splitExtraData(item); - } - } + splitExtraData = function (item) { + var field; + for (field in item.Extra) { + if (item.Extra.hasOwnProperty(field)) { + item[field] = item.Extra[field]; + delete item.Extra[field]; + } + } + }; - prepareFilters(); - isInit = true; - }, true); + for (i = 0; i < $scope.items.length; i += 1) { + item = $scope.items[i]; + if (item.Extra !== null) { + splitExtraData(item); + } + } - $scope.$watch("parent.count", function () { - if (typeof $scope.parent.count === "undefined") { - return false; - } + prepareFilters(); + isInit = true; + }, true); - var limit, search, page, parts, countPerPage; + $scope.$watch("parent.count", function () { + if (typeof $scope.parent.count === "undefined") { + return false; + } - page = 1; - countPerPage = COUNT_ITEMS_PER_PAGE; - search = $location.search(); - limit = search.limit; + var limit, search, page, parts, countPerPage; - if (limit) { - parts = limit.split(","); - page = Math.floor(parts[0] / countPerPage) + 1; - } - $scope.paginator = { - "page": page, - "countItems": $scope.parent.count, - "countPages": 0, - "countPerPage": countPerPage, - "limitStart": 0 - }; + page = 1; + countPerPage = COUNT_ITEMS_PER_PAGE; + search = $location.search(); + limit = search.limit; - $scope.paginator.countPages = Math.ceil($scope.paginator.countItems / $scope.paginator.countPerPage); + if (limit) { + parts = limit.split(","); + countPerPage = parts[1]; + page = Math.floor(parts[0] / countPerPage) + 1; + } - }, true); - } + $scope.paginator = { + "page": page, + "countItems": $scope.parent.count, + "countPages": 0, + "countPerPage": countPerPage, + "limitStart": 0 }; - } - ] - ) - ; - - return designModule; - }) - ; -}) -(window.define); + + $scope.paginator.countPages = Math.ceil($scope.paginator.countItems / $scope.paginator.countPerPage); + + }, true); + } + }; + } +]); + diff --git a/app/scripts/design/directives/guiTableManagerPopup.js b/app/scripts/design/directives/guiTableManagerPopup.js index bb871f4a..9758dec2 100644 --- a/app/scripts/design/directives/guiTableManagerPopup.js +++ b/app/scripts/design/directives/guiTableManagerPopup.js @@ -1,485 +1,475 @@ -(function (define, $) { - "use strict"; +angular.module("designModule") + +/** +* Directive used for automatic attributes editor form creation +* +*/ + +.directive("guiTableManagerPopup", [ + "$location", + "$designService", + "COUNT_ITEMS_PER_PAGE", + function ($location, $designService, COUNT_ITEMS_PER_PAGE) { + return { + restrict: "E", + scope: { + "parent": "=object", + "items": "=items", + "buttonData": "=buttons", + "mapping": "=mapping" + }, + templateUrl: $designService.getTemplate("design/gui/table-popup.html"), + controller: function ($scope) { + // Variables + var isInit, isSelectedAll, activeFilters; + + // Functions + var prepareFilters, getOptions, compareFilters, initPaginator; + + isInit = false; + isSelectedAll = false; + activeFilters = {}; + + var clone = function (obj) { + if (null === obj || "object" !== typeof obj) { + return obj; + } + var copy = obj.constructor(); + for (var attr in obj) { + if (obj.hasOwnProperty(attr)) { + copy[attr] = obj[attr]; + } + } + return copy; + }; + + var assignMapping = function (mapping) { + var defaultMapping; + + /** + * Default mapping + * @type {object} + */ + defaultMapping = { + "id": "ID", + "name": "Name", + "image": "Image", + "shortDesc": "Desc", + "additionalName": "additional" + }; + + for (var field in mapping) { + if (mapping.hasOwnProperty(field)) { + if (typeof defaultMapping[field] !== "undefined") { + defaultMapping[field] = mapping[field]; + } + } + } + + return defaultMapping; + }; + + // Scope data + $scope.map = assignMapping($scope.mapping); + $scope.filters = []; + $scope.newFilters = {}; + $scope.sort = {}; + + initPaginator = function () { + var limit, search, page, parts, countPerPage; + + page = 1; + countPerPage = COUNT_ITEMS_PER_PAGE; + search = $location.search(); + limit = search.limit; + + if (limit) { + parts = limit.split(","); + page = Math.floor(parts[0] / countPerPage) + 1; + } + $scope.paginator = { + "page": page, + "countItems": $scope.parent.count, + "countPages": 0, + "countPerPage": countPerPage, + "limitStart": 0 + }; - define(["design/init"], function (designModule) { - var assignMapping; + $scope.paginator.countPages = Math.ceil($scope.paginator.countItems / $scope.paginator.countPerPage); + }; + + $scope.init = function () { + var i, possibleButtons; + possibleButtons = ["new", "delete", "checkbox"]; + if (typeof $scope.buttons === "undefined") { + $scope.buttons = {}; + for (i = 0; i < possibleButtons.length; i += 1) { + if (typeof $scope.buttonData !== "undefined") { + if (typeof $scope.buttonData[possibleButtons[i]] !== "undefined") { + $scope.buttons[possibleButtons[i]] = $scope.buttonData[possibleButtons[i]]; + } else { + $scope.buttons[possibleButtons[i]] = true; + } + } else { + $scope.buttons[possibleButtons[i]] = true; + } + } + } + }; - var clone = function (obj) { - if (null === obj || "object" !== typeof obj) { - return obj; - } - var copy = obj.constructor(); - for (var attr in obj) { - if (obj.hasOwnProperty(attr)) { - copy[attr] = obj[attr]; - } - } - return copy; - }; + getOptions = function (opt) { + var options = {"": ""}; - assignMapping = function (mapping) { - var defaultMapping; - - /** - * Default mapping - * @type {object} - */ - defaultMapping = { - "id": "ID", - "name": "Name", - "image": "Image", - "shortDesc": "Desc", - "additionalName": "additional" - }; - - for (var field in mapping) { - if (mapping.hasOwnProperty(field)) { - if (typeof defaultMapping[field] !== "undefined") { - defaultMapping[field] = mapping[field]; + if (typeof opt === "string") { + try { + options = JSON.parse(opt.replace(/'/g, "\"")); + } + catch (e) { + var parts = opt.replace(/[{}]/g, "").split(","); + for (var i = 0; i < parts.length; i += 1) { + options[parts[i]] = parts[i]; + } + } + } else { + options = opt; } - } - } - return defaultMapping; - }; + return options; + }; + + prepareFilters = function () { + var i, filterDetails, filter, saveCurrentActiveFilters, getFilterDetails; + /** + * Save active filters + * + * @param {object} filterDetails + */ + saveCurrentActiveFilters = function (filterDetails) { + if (filterDetails.filterValue) { + if (-1 !== ['text', 'string'].indexOf(filterDetails.dataType)) { + activeFilters[filterDetails.attribute.toLowerCase()] = filterDetails.filterValue.replace(/~/g, "").split(","); + } else { + activeFilters[filterDetails.attribute.toLowerCase()] = filterDetails.filterValue.replace(/~/g, ""); + } + } + }; - designModule - - /** - * Directive used for automatic attributes editor form creation - * - */ - .directive("guiTableManagerPopup", [ - "$location", - "$designService", - "COUNT_ITEMS_PER_PAGE", - function ($location, $designService, COUNT_ITEMS_PER_PAGE) { - return { - restrict: "E", - scope: { - "parent": "=object", - "items": "=items", - "buttonData": "=buttons", - "mapping": "=mapping" - }, - templateUrl: $designService.getTemplate("design/gui/table-popup.html"), - controller: function ($scope) { - // Variables - var isInit, isSelectedAll, activeFilters; - - // Functions - var prepareFilters, getOptions, compareFilters, initPaginator; - - isInit = false; - isSelectedAll = false; - activeFilters = {}; - - // Scope data - $scope.map = assignMapping($scope.mapping); - $scope.filters = []; - $scope.newFilters = {}; - $scope.sort = {}; - - initPaginator = function () { - var limit, search, page, parts, countPerPage; - - page = 1; - countPerPage = COUNT_ITEMS_PER_PAGE; - search = $location.search(); - limit = search.limit; - - if (limit) { - parts = limit.split(","); - page = Math.floor(parts[0] / countPerPage) + 1; - } - $scope.paginator = { - "page": page, - "countItems": $scope.parent.count, - "countPages": 0, - "countPerPage": countPerPage, - "limitStart": 0 - }; - - $scope.paginator.countPages = Math.ceil($scope.paginator.countItems / $scope.paginator.countPerPage); - }; - - $scope.init = function () { - var i, possibleButtons; - possibleButtons = ["new", "delete", "checkbox"]; - if (typeof $scope.buttons === "undefined") { - $scope.buttons = {}; - for (i = 0; i < possibleButtons.length; i += 1) { - if (typeof $scope.buttonData !== "undefined") { - if (typeof $scope.buttonData[possibleButtons[i]] !== "undefined") { - $scope.buttons[possibleButtons[i]] = $scope.buttonData[possibleButtons[i]]; - } else { - $scope.buttons[possibleButtons[i]] = true; - } - } else { - $scope.buttons[possibleButtons[i]] = true; - } - } - } - }; - - getOptions = function (opt) { - var options = {"": ""}; - - if (typeof opt === "string") { - try { - options = JSON.parse(opt.replace(/'/g, "\"")); - } - catch (e) { - var parts = opt.replace(/[{}]/g, "").split(","); - for (var i = 0; i < parts.length; i += 1) { - options[parts[i]] = parts[i]; - } - } - } else { - options = opt; - } + getFilterDetails = function (field) { + var filterInfo, parts, details; - return options; - }; - - prepareFilters = function () { - var i, filterDetails, filter, saveCurrentActiveFilters, getFilterDetails; - /** - * Save active filters - * - * @param {object} filterDetails - */ - saveCurrentActiveFilters = function (filterDetails) { - if (filterDetails.filterValue) { - if (-1 !== ['text', 'string'].indexOf(filterDetails.dataType)) { - activeFilters[filterDetails.attribute.toLowerCase()] = filterDetails.filterValue.replace(/~/g, "").split(","); - } else { - activeFilters[filterDetails.attribute.toLowerCase()] = filterDetails.filterValue.replace(/~/g, ""); - } - } - }; - - getFilterDetails = function (field) { - var filterInfo, parts, details; - - filterInfo = field.filter; - parts = filterInfo.match(/.+(\{.*\})/i); - - details = { - "options": parts === null ? {} : getOptions(parts[1]), - "type": filterInfo.substr(0, (-1 !== filterInfo.indexOf("{") ? filterInfo.indexOf("{") : filterInfo.length)), - "dataType": field.dataType, - "filterValue": field.filterValue, - "attribute": field.attribute, - "visible": field.visible - }; - - if ("select" === details.type) { - details.options[""] = ""; - } - - return details; - }; - for (i = 0; i < $scope.parent.fields.length; i += 1) { - - if (typeof $scope.parent.fields[i].filter === "undefined") { - $scope.filters.push({}); - continue; - } - - filterDetails = getFilterDetails($scope.parent.fields[i]); - - filter = { - "type": filterDetails.type, - "dataType": filterDetails.dataType, - "visible": filterDetails.visible || false, - "attributes": { - "Attribute": filterDetails.attribute, - "Options": filterDetails.options - } - }; - - filter[filterDetails.attribute] = filterDetails.filterValue || ""; - saveCurrentActiveFilters(filterDetails); - - $scope.filters.push(filter); - } - }; - - /** - * Checks filters has the changes or not - * - * @returns {boolean} - */ - compareFilters = function () { - var checkActiveFilters, compareArrays, check; - - checkActiveFilters = function (key) { - if ($scope.newFilters[key] instanceof Array) { - if ("" !== $scope.newFilters[key].sort().join()) { - return false; - } - } else if ($scope.newFilters[key].trim() !== "") { - return false; - } - - return true; - }; - - compareArrays = function (key) { - if ($scope.newFilters[key] instanceof Array && typeof activeFilters[key] !== "undefined") { - if ($scope.newFilters[key].sort().join() !== activeFilters[key].sort().join()) { - return false; - } - } else { - if ($scope.newFilters[key] !== activeFilters[key]) { - return false; - } - } - - return true; - }; - - check = function (key) { - if (typeof activeFilters[key] === "undefined") { - if (!checkActiveFilters(key)) { - return false; - } - return true; - } - - if (!compareArrays(key)) { - return false; - } - return true; - }; - - for (var key in $scope.newFilters) { - if ($scope.newFilters.hasOwnProperty(key)) { - if (check(key)) { - continue; - } else { - return false; - } - } - } + filterInfo = field.filter; + parts = filterInfo.match(/.+(\{.*\})/i); - return true; - }; + details = { + "options": parts === null ? {} : getOptions(parts[1]), + "type": filterInfo.substr(0, (-1 !== filterInfo.indexOf("{") ? filterInfo.indexOf("{") : filterInfo.length)), + "dataType": field.dataType, + "filterValue": field.filterValue, + "attribute": field.attribute, + "visible": field.visible + }; - /** PAGINATOR */ + if ("select" === details.type) { + details.options[""] = ""; + } - $scope.getPages = function () { - if (typeof $scope.paginator === "undefined") { - return false; - } - var p, result; - result = []; + return details; + }; + for (i = 0; i < $scope.parent.fields.length; i += 1) { - for (p = 1; p <= $scope.paginator.countPages; p += 1) { - result.push(p); - } - return result; - }; + if (typeof $scope.parent.fields[i].filter === "undefined") { + $scope.filters.push({}); + continue; + } - $scope.setPage = function (page) { - if (typeof $scope.paginator === "undefined" || page === $scope.paginator.page) { - return false; - } + filterDetails = getFilterDetails($scope.parent.fields[i]); - var _setPage = function (page) { - if ("prev" === page && $scope.paginator.page !== 1) { - $scope.paginator.page = $scope.paginator.page - 1; - } else if ("next" === page && $scope.paginator.page !== $scope.paginator.countPages) { - $scope.paginator.page = $scope.paginator.page + 1; - } else if (-1 === ["prev", "next"].indexOf(page)) { - $scope.paginator.page = page; - } else { - return false; - } - - return true; - }; - - if (!_setPage(page)) { - return false; - } + filter = { + "type": filterDetails.type, + "dataType": filterDetails.dataType, + "visible": filterDetails.visible || false, + "attributes": { + "Attribute": filterDetails.attribute, + "Options": filterDetails.options + } + }; - $("#selectAll").removeAttr("checked"); - isSelectedAll = false; - - $scope.parent.search = getSearchObj(); - }; - - /** - * Gets class for item of paginator - * - * @param {string} page - * @returns {string} - */ - $scope.getClass = function (page) { - if (typeof $scope.paginator === "undefined") { - return ''; - } + filter[filterDetails.attribute] = filterDetails.filterValue || ""; + saveCurrentActiveFilters(filterDetails); - var _class; - _class = ''; + $scope.filters.push(filter); + } + }; + + /** + * Checks filters has the changes or not + * + * @returns {boolean} + */ + compareFilters = function () { + var checkActiveFilters, compareArrays, check; + + checkActiveFilters = function (key) { + if ($scope.newFilters[key] instanceof Array) { + if ("" !== $scope.newFilters[key].sort().join()) { + return false; + } + } else if ($scope.newFilters[key].trim() !== "") { + return false; + } - if (page === parseInt($scope.paginator.page, 10)) { - _class = 'active'; - } + return true; + }; - if (("prev" === page && $scope.paginator.page === 1) || - ("next" === page && $scope.paginator.page >= $scope.paginator.countPages)) { - _class = 'disabled'; - } + compareArrays = function (key) { + if ($scope.newFilters[key] instanceof Array && typeof activeFilters[key] !== "undefined") { + if ($scope.newFilters[key].sort().join() !== activeFilters[key].sort().join()) { + return false; + } + } else { + if ($scope.newFilters[key] !== activeFilters[key]) { + return false; + } + } - return _class; - }; + return true; + }; - /** PAGINATOR END*/ + check = function (key) { + if (typeof activeFilters[key] === "undefined") { + if (!checkActiveFilters(key)) { + return false; + } + return true; + } - /** Sorting */ + if (!compareArrays(key)) { + return false; + } + return true; + }; - $scope.getSortClass = function (attr) { - var _class = ""; + for (var key in $scope.newFilters) { + if ($scope.newFilters.hasOwnProperty(key)) { + if (check(key)) { + continue; + } else { + return false; + } + } + } - if (attr === $scope.sort.currentValue) { - _class = "fa fa-long-arrow-up"; - } else if (typeof $scope.sort.currentValue !== "undefined" && -1 !== $scope.sort.currentValue.indexOf(attr)) { - _class = "fa fa-long-arrow-down"; - } else { - _class = ""; - } + return true; + }; - return _class; - }; + /** PAGINATOR */ - $scope.setSort = function (attr) { - if (attr === $scope.sort.currentValue) { - $scope.sort.currentValue = "^" + attr; - } else if (null !== $scope.sort.newValue) { - $scope.sort.currentValue = attr; - } - $scope.parent.search = getSearchObj(); - }; - - /** Sorting end*/ - - var getSearchObj = function (reset) { - var addFilter, getPaginatorSearch, getSortSearch, removeEmpty, search; - - search = {}; - removeEmpty = function (arr) { - for (var i = 0; i < arr.length; i += 1) { - if ("" === arr[i].trim()) { - arr.splice(i, 1); - } - } - }; - - getPaginatorSearch = function (search, reset) { - if (reset) { - search.limit = "0," + $scope.paginator.countPerPage; - } else { - search.limit = (($scope.paginator.page - 1) * $scope.paginator.countPerPage) + "," + $scope.paginator.countPerPage; - } - - return search; - }; - - addFilter = function (key) { - if ($scope.newFilters[key] instanceof Array) { - removeEmpty($scope.newFilters[key]); - if ($scope.newFilters[key].length > 0) { - search[key.toLowerCase()] = '~' + $scope.newFilters[key].join(); - } - } else if ($scope.newFilters[key] !== "") { - search[key.toLowerCase()] = $scope.newFilters[key]; - } - }; - - getSortSearch = function (search) { - - search.sort = $scope.sort.currentValue; - - return search; - }; - - for (var key in $scope.newFilters) { - if ($scope.newFilters.hasOwnProperty(key)) { - addFilter(key); - } - } + $scope.getPages = function () { + if (typeof $scope.paginator === "undefined") { + return false; + } + var p, result; + result = []; - search = getPaginatorSearch(search, reset); - search = getSortSearch(search); + for (p = 1; p <= $scope.paginator.countPages; p += 1) { + result.push(p); + } + return result; + }; - return search; - }; + $scope.setPage = function (page) { + if (typeof $scope.paginator === "undefined" || page === $scope.paginator.page) { + return false; + } - $scope.selectAll = function () { - isSelectedAll = isSelectedAll ? false : true; - for (var i = 0; i < $scope.items.length; i += 1) { - $scope.parent.selected[$scope.items[i][$scope.map.id]] = isSelectedAll; - } - }; + var _setPage = function (page) { + if ("prev" === page && $scope.paginator.page !== 1) { + $scope.paginator.page = $scope.paginator.page - 1; + } else if ("next" === page && $scope.paginator.page !== $scope.paginator.countPages) { + $scope.paginator.page = $scope.paginator.page + 1; + } else if (-1 === ["prev", "next"].indexOf(page)) { + $scope.paginator.page = page; + } else { + return false; + } - $scope.$watch("newFilters", function () { - if (typeof $scope.filters === "undefined") { - return false; - } + return true; + }; - if (!compareFilters()) { - activeFilters = clone($scope.newFilters); - $scope.parent.search = getSearchObj(true); - } + if (!_setPage(page)) { + return false; + } - }, true); + $("#selectAll").removeAttr("checked"); + isSelectedAll = false; + + $scope.parent.search = getSearchObj(); + }; + + /** + * Gets class for item of paginator + * + * @param {string} page + * @returns {string} + */ + $scope.getClass = function (page) { + if (typeof $scope.paginator === "undefined") { + return ''; + } - $scope.$watch("items", function () { - if (typeof $scope.items === "undefined") { - return false; - } - var i, item, splitExtraData; - - splitExtraData = function (item) { - var field; - for (field in item.Extra) { - if (item.Extra.hasOwnProperty(field)) { - item[field] = item.Extra[field]; - delete item.Extra[field]; - } - } - }; - - for (i = 0; i < $scope.items.length; i += 1) { - item = $scope.items[i]; - if (item.Extra !== null) { - splitExtraData(item); - } - } + var _class; + _class = ''; - if (isInit) { - return false; - } - prepareFilters(); + if (page === parseInt($scope.paginator.page, 10)) { + _class = 'active'; + } - isInit = true; - }, true); + if (("prev" === page && $scope.paginator.page === 1) || + ("next" === page && $scope.paginator.page >= $scope.paginator.countPages)) { + _class = 'disabled'; + } - $scope.$watch("parent.count", function () { - if (typeof $scope.parent.count === "undefined") { - return false; - } - initPaginator(); - }, true); + return _class; + }; + + /** PAGINATOR END*/ + + /** Sorting */ + + $scope.getSortClass = function (attr) { + var _class = ""; + + if (attr === $scope.sort.currentValue) { + _class = "fa fa-long-arrow-up"; + } else if (typeof $scope.sort.currentValue !== "undefined" && -1 !== $scope.sort.currentValue.indexOf(attr)) { + _class = "fa fa-long-arrow-down"; + } else { + _class = ""; + } + + return _class; + }; + + $scope.setSort = function (attr) { + if (attr === $scope.sort.currentValue) { + $scope.sort.currentValue = "^" + attr; + } else if (null !== $scope.sort.newValue) { + $scope.sort.currentValue = attr; + } + $scope.parent.search = getSearchObj(); + }; + + /** Sorting end*/ + + var getSearchObj = function (reset) { + var addFilter, getPaginatorSearch, getSortSearch, removeEmpty, search; + + search = {}; + removeEmpty = function (arr) { + for (var i = 0; i < arr.length; i += 1) { + if ("" === arr[i].trim()) { + arr.splice(i, 1); + } + } + }; + + getPaginatorSearch = function (search, reset) { + if (reset) { + search.limit = "0," + $scope.paginator.countPerPage; + } else { + search.limit = (($scope.paginator.page - 1) * $scope.paginator.countPerPage) + "," + $scope.paginator.countPerPage; + } + + return search; + }; + + addFilter = function (key) { + if ($scope.newFilters[key] instanceof Array) { + removeEmpty($scope.newFilters[key]); + if ($scope.newFilters[key].length > 0) { + search[key.toLowerCase()] = '~' + $scope.newFilters[key].join(); + } + } else if ($scope.newFilters[key] !== "") { + search[key.toLowerCase()] = $scope.newFilters[key]; + } + }; + + getSortSearch = function (search) { + + search.sort = $scope.sort.currentValue; + + return search; + }; + + for (var key in $scope.newFilters) { + if ($scope.newFilters.hasOwnProperty(key)) { + addFilter(key); + } + } + + search = getPaginatorSearch(search, reset); + search = getSortSearch(search); + + return search; + }; + + $scope.selectAll = function () { + isSelectedAll = isSelectedAll ? false : true; + for (var i = 0; i < $scope.items.length; i += 1) { + $scope.parent.selected[$scope.items[i][$scope.map.id]] = isSelectedAll; + } + }; + + $scope.$watch("newFilters", function () { + if (typeof $scope.filters === "undefined") { + return false; + } + + if (!compareFilters()) { + activeFilters = clone($scope.newFilters); + $scope.parent.search = getSearchObj(true); + } + + }, true); + + $scope.$watch("items", function () { + if (typeof $scope.items === "undefined") { + return false; + } + var i, item, splitExtraData; + + splitExtraData = function (item) { + var field; + for (field in item.Extra) { + if (item.Extra.hasOwnProperty(field)) { + item[field] = item.Extra[field]; + delete item.Extra[field]; + } } }; - } - ] - ); - return designModule; - }); -})(window.define, jQuery); \ No newline at end of file + for (i = 0; i < $scope.items.length; i += 1) { + item = $scope.items[i]; + if (item.Extra !== null) { + splitExtraData(item); + } + } + + if (isInit) { + return false; + } + prepareFilters(); + + isInit = true; + }, true); + + $scope.$watch("parent.count", function () { + if (typeof $scope.parent.count === "undefined") { + return false; + } + initPaginator(); + }, true); + } + }; + } +]); diff --git a/app/scripts/design/directives/otApplyValidator.js b/app/scripts/design/directives/otApplyValidator.js index ab061215..bbe6a052 100644 --- a/app/scripts/design/directives/otApplyValidator.js +++ b/app/scripts/design/directives/otApplyValidator.js @@ -1,57 +1,52 @@ -(function (define) { - "use strict"; - define(["design/init"], function (designModule) { +angular.module("designModule") - designModule.directive("otApplyValidator", function ($parse, $compile) { +.directive("otApplyValidator", function ($parse, $compile) { - var addValidator, link; + var addValidator, link; - addValidator = function (elem, validator) { - var regExp, matches; - if (validator !== "") { - regExp = /(\w+)(\((.*)\))*/g; + addValidator = function (elem, validator) { + var regExp, matches; + if (validator !== "") { + regExp = /(\w+)(\((.*)\))*/g; - matches = regExp.exec(validator); + matches = regExp.exec(validator); - if (matches.length > 1 && typeof matches[3] !== "undefined") { - elem.attr("ot-" + matches[1], matches[3]); - } else { - elem.attr("ot-" + matches[1], "true"); - } + if (matches.length > 1 && typeof matches[3] !== "undefined") { + elem.attr("ot-" + matches[1], matches[3]); + } else { + elem.attr("ot-" + matches[1], "true"); } - }; + } + }; - link = function ($scope, elem) { + link = function ($scope, elem) { - var validatorStr = $parse(elem.attr('ot-apply-validator'))($scope) || ""; + var validatorStr = $parse(elem.attr('ot-apply-validator'))($scope) || ""; - if (typeof validatorStr !== "string" && validatorStr !== "") { - return true; - } - - var i, validatorList, validator; - validatorList = validatorStr.split(/[ ]/); + if (typeof validatorStr !== "string" && validatorStr !== "") { + return true; + } - for (i = 0; i < validatorList.length; i += 1) { - validator = validatorList[i]; - addValidator(elem, validator); + var i, validatorList, validator; + validatorList = validatorStr.split(/[ ]/); - } + for (i = 0; i < validatorList.length; i += 1) { + validator = validatorList[i]; + addValidator(elem, validator); - elem.removeAttr("ot-apply-validator"); - $compile(elem, null, 10000)($scope); - }; + } + elem.removeAttr("ot-apply-validator"); + $compile(elem, null, 10000)($scope); + }; - return({ - link: link, - priority: 10000, - restrict: "A", - terminal: true - }); + return({ + link: link, + priority: 10000, + restrict: "A", + terminal: true }); - }); -})(window.define); \ No newline at end of file + }); \ No newline at end of file diff --git a/app/scripts/design/directives/otRouteClass.js b/app/scripts/design/directives/otRouteClass.js new file mode 100644 index 00000000..74e1159f --- /dev/null +++ b/app/scripts/design/directives/otRouteClass.js @@ -0,0 +1,48 @@ +angular.module("designModule") + +.directive('otRouteClass', [function() { + return { + restrict: 'A', + link: function($scope, elem, iAttrs, controller) { + var cssPrefix = 'route__'; + var routeRegex = new RegExp(cssPrefix + ".*", "g"); + + $scope.$on('$routeChangeSuccess', function(e, current, previous) { + // console.log('current', current); + + // Remove all classes that this module applies + elem.removeClass(function(i, css) { + return (css.match(routeRegex) || []).join(' '); + }); + + // Adding Classes + // NOTE: there is a load initially that doesn't have route info + if (current.$$route) { + + // controller class + if (current.$$route.controller) { + var ctrl = current.$$route.controller + ctrl = ctrl.toLowerCase(); + ctrl = ctrl.replace('controller', ''); + + var newClass = cssPrefix + 'ctrl--'; + newClass += ctrl; + elem.addClass(newClass); + } + + // template class + if (current.$$route.templateUrl) { + var url = current.$$route.templateUrl + url = url.replace('/themes/views/', ''); // strip the dir + url = url.replace('.html', '') // strip the extension + url = url.replace('/', '-'); // replace the slashes + + var newClass = cssPrefix + 'tmpl--' + url; + elem.addClass(newClass); + } + } + }); + } + }; +}]); + diff --git a/app/scripts/design/directives/validator/between.js b/app/scripts/design/directives/validator/between.js index cbf248a5..6efaad8e 100644 --- a/app/scripts/design/directives/validator/between.js +++ b/app/scripts/design/directives/validator/between.js @@ -1,42 +1,36 @@ -(function (define) { - "use strict"; - define(["design/init"], function (designModule) { +angular.module("designModule") - var numberToLess = "The value is not within the specified range."; - var numberToMore = "The value is not within the specified range."; + .directive("otBetween", function () { + return { + restrict: 'A', + require: '?ngModel', + link: function (scope, elem, attrs, ngModel) { + var numberToLess = "The value is not within the specified range."; + var numberToMore = "The value is not within the specified range."; + var params = elem.attr('ot-between').split(","); - designModule - .directive("otBetween", function () { - return { - restrict: 'A', - require: '?ngModel', - link: function (scope, elem, attrs, ngModel) { - var params = elem.attr('ot-between').split(","); - - var validate = function (value) { - var valid; - if (typeof value !== "undefined" && - parseFloat(value) < parseFloat(params[0])) { - ngModel.message = numberToLess; - valid = false; - } else if (typeof value !== "undefined" && - parseFloat(value) > parseFloat(params[1])) { - ngModel.message = numberToMore; - valid = false; - } else { - valid = true; - } - - ngModel.$setValidity('ot-between', valid); - return valid ? value : undefined; - }; - - //For DOM -> model validation - ngModel.$parsers.unshift(validate); - //For model -> DOM validation - ngModel.$formatters.unshift(validate); + var validate = function (value) { + var valid; + if (typeof value !== "undefined" && + parseFloat(value) < parseFloat(params[0])) { + ngModel.message = numberToLess; + valid = false; + } else if (typeof value !== "undefined" && + parseFloat(value) > parseFloat(params[1])) { + ngModel.message = numberToMore; + valid = false; + } else { + valid = true; } + + ngModel.$setValidity('ot-between', valid); + return valid ? value : undefined; }; - }); + + //For DOM -> model validation + ngModel.$parsers.unshift(validate); + //For model -> DOM validation + ngModel.$formatters.unshift(validate); + } + }; }); -})(window.define); \ No newline at end of file diff --git a/app/scripts/design/directives/validator/date.js b/app/scripts/design/directives/validator/date.js index 6bd83f8c..3911cd4d 100644 --- a/app/scripts/design/directives/validator/date.js +++ b/app/scripts/design/directives/validator/date.js @@ -1,33 +1,27 @@ -(function (define) { - "use strict"; +angular.module("designModule") - define(["design/init"], function (designModule) { +.directive("otDate", function () { + return { + restrict: 'A', + require: '?ngModel', + link: function (scope, elem, attrs, ngModel) { + var dateNotValid = "Please enter a valid date (mm/dd/yyyy)"; - var dateNotValid = "Please enter a valid date (mm/dd/yyyy)"; - - designModule.directive("otDate", function () { - return { - restrict: 'A', - require: '?ngModel', - link: function (scope, elem, attrs, ngModel) { - - var validate = function (value) { - var date = new Date(value); - var valid = (!isNaN(date) && value.length === 10); - ngModel.$setValidity('ot-date', valid); - if (!valid) { - ngModel.message = dateNotValid; - } - - return value; - }; - - //For DOM -> model validation - ngModel.$parsers.unshift(validate); - //For model -> DOM validation - ngModel.$formatters.unshift(validate); + var validate = function (value) { + var date = new Date(value); + var valid = (!isNaN(date) && value.length === 10); + ngModel.$setValidity('ot-date', valid); + if (!valid) { + ngModel.message = dateNotValid; } + + return value; }; - }); - }); -})(window.define); \ No newline at end of file + + //For DOM -> model validation + ngModel.$parsers.unshift(validate); + //For model -> DOM validation + ngModel.$formatters.unshift(validate); + } + }; +}); diff --git a/app/scripts/design/directives/validator/email.js b/app/scripts/design/directives/validator/email.js index e3f9283d..64ca2e81 100644 --- a/app/scripts/design/directives/validator/email.js +++ b/app/scripts/design/directives/validator/email.js @@ -1,31 +1,27 @@ -(function (define) { - "use strict"; - define(["design/init"], function (designModule) { +angular.module("designModule") - var re = new RegExp("^(([^<>()[\\]\\.,;:\\s@\"]+(\\.[^<>()[\\]\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$", ""); - var emailNotValid = "Please enter a valid email address. For example johndoe@domain.com."; +.directive("otEmail", function () { + return { + restrict: 'EA', + require: '?ngModel', + link: function (scope, elem, attrs, ngModel) { + var re = new RegExp("^(([^<>()[\\]\\.,;:\\s@\"]+(\\.[^<>()[\\]\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$", ""); + var emailNotValid = "Please enter a valid email address. For example johndoe@domain.com."; - designModule.directive("otEmail", function () { - return { - restrict: 'EA', - require: '?ngModel', - link: function (scope, elem, attrs, ngModel) { - var validate = function (value) { - var valid = re.test(value); - ngModel.$setValidity('ot-email', valid); - if (!valid) { - ngModel.message = emailNotValid; - } - - return value; - }; - - //For DOM -> model validation - ngModel.$parsers.unshift(validate); - //For model -> DOM validation - ngModel.$formatters.unshift(validate); + var validate = function (value) { + var valid = re.test(value); + ngModel.$setValidity('ot-email', valid); + if (!valid) { + ngModel.message = emailNotValid; } + + return value; }; - }); - }); -})(window.define); \ No newline at end of file + + //For DOM -> model validation + ngModel.$parsers.unshift(validate); + //For model -> DOM validation + ngModel.$formatters.unshift(validate); + } + }; +}); diff --git a/app/scripts/design/directives/validator/len.js b/app/scripts/design/directives/validator/len.js index 852e5a32..55a2189d 100644 --- a/app/scripts/design/directives/validator/len.js +++ b/app/scripts/design/directives/validator/len.js @@ -1,41 +1,33 @@ -(function (define) { - "use strict"; - define(["design/init"], function (designModule) { +angular.module("designModule") - var stringToShort = "Text length does not satisfy specified text range."; - var stringToLong = "Text length does not satisfy specified text range."; +.directive("otLen", function () { + return { + restrict: 'A', + require: '?ngModel', + link: function (scope, elem, attrs, ngModel) { + var params = elem.attr('ot-len').split(","); - designModule - .directive("otLen", function () { - return { - restrict: 'A', - require: '?ngModel', - link: function (scope, elem, attrs, ngModel) { - var params = elem.attr('ot-len').split(","); + var validate = function (value) { + var valid; + if (typeof value !== "undefined" && + value.length < params[0]) { + ngModel.message = stringToShort; + valid = false; + } else if (typeof value !== "undefined" && value.length > params[1]) { + ngModel.message = stringToLong; + valid = false; + } else { + valid = true; + } - var validate = function (value) { - var valid; - if (typeof value !== "undefined" && - value.length < params[0]) { - ngModel.message = stringToShort; - valid = false; - } else if (typeof value !== "undefined" && value.length > params[1]) { - ngModel.message = stringToLong; - valid = false; - } else { - valid = true; - } + ngModel.$setValidity('ot-len', valid); + return valid ? value : undefined; + }; - ngModel.$setValidity('ot-len', valid); - return valid ? value : undefined; - }; - - //For DOM -> model validation - ngModel.$parsers.unshift(validate); - //For model -> DOM validation - ngModel.$formatters.unshift(validate); - } - }; - }); - }); -})(window.define); \ No newline at end of file + //For DOM -> model validation + ngModel.$parsers.unshift(validate); + //For model -> DOM validation + ngModel.$formatters.unshift(validate); + } + }; +}); \ No newline at end of file diff --git a/app/scripts/design/directives/validator/match.js b/app/scripts/design/directives/validator/match.js new file mode 100644 index 00000000..a4923443 --- /dev/null +++ b/app/scripts/design/directives/validator/match.js @@ -0,0 +1,54 @@ +/** + * https://github.com/TheSharpieOne/angular-validation-match + * attrs: + * ot-match="matchagainst" + * match-caseless + * not-match + */ +angular.module("designModule") + .directive("otMatch", ['$parse', function($parse) { + return { + restrict: 'A', + require: '?ngModel', + link: function(scope, elem, attrs, ctrl) { + if (!ctrl) { + if (console && console.warn) { + console.warn('Match validation requires ngModel to be on the element'); + } + return; + } + + var matchGetter = $parse(attrs.otMatch); + var caselessGetter = $parse(attrs.matchCaseless); + var noMatchGetter = $parse(attrs.notMatch); + + scope.$watch(getMatchValue, function() { + ctrl.$$parseAndValidate(); + }); + + ctrl.$validators.match = function() { + var match = getMatchValue(); + var notMatch = noMatchGetter(scope); + var value; + + if (caselessGetter(scope)) { + value = angular.lowercase(ctrl.$viewValue) === angular.lowercase(match); + } else { + value = ctrl.$viewValue === match; + } + value ^= notMatch; + + return !!value; + }; + + function getMatchValue() { + var match = matchGetter(scope); + if (angular.isObject(match) && match.hasOwnProperty('$viewValue')) { + match = match.$viewValue; + } + return match; + } + } + } + }]); + diff --git a/app/scripts/design/directives/validator/number.js b/app/scripts/design/directives/validator/number.js index 0a17643c..e474203b 100644 --- a/app/scripts/design/directives/validator/number.js +++ b/app/scripts/design/directives/validator/number.js @@ -1,34 +1,28 @@ -(function (define) { - "use strict"; +angular.module("designModule") - define(["design/init"], function (designModule) { +.directive("otNumber", function () { + return { + restrict: 'A', + require: '?ngModel', + link: function (scope, elem, attrs, ngModel) { + var re = new RegExp("^[\\-]*[\\d]+$", ""); + var integerNotValid = "Please enter a valid number in this field."; - var re = new RegExp("^[\\-]*[\\d]+$", ""); - var integerNotValid = "Please enter a valid number in this field."; - - designModule.directive("otNumber", function () { - return { - restrict: 'A', - require: '?ngModel', - link: function (scope, elem, attrs, ngModel) { - - var validate = function (value) { - var valid = re.test(value); - ngModel.$setValidity('ot-number', valid); - if (!valid) { - ngModel.message = integerNotValid; - } + var validate = function (value) { + var valid = re.test(value); + ngModel.$setValidity('ot-number', valid); + if (!valid) { + ngModel.message = integerNotValid; + } - return value; - }; + return value; + }; - //For DOM -> model validation - ngModel.$parsers.unshift(validate); - //For model -> DOM validation - ngModel.$formatters.unshift(validate); - } - }; - }); - }); -})(window.define); \ No newline at end of file + //For DOM -> model validation + ngModel.$parsers.unshift(validate); + //For model -> DOM validation + ngModel.$formatters.unshift(validate); + } + }; +}); diff --git a/app/scripts/design/directives/validator/password.js b/app/scripts/design/directives/validator/password.js index c4e84bd5..e8d4b3ad 100644 --- a/app/scripts/design/directives/validator/password.js +++ b/app/scripts/design/directives/validator/password.js @@ -1,77 +1,50 @@ -(function (define) { - "use strict"; - define(["design/init"], function (designModule) { - var minLen, minCountUppercase, minCountLowercase, minCountNumbers, minCountSymbols, passwordNotValidLength, - passwordNotEnoughLowercases, passwordNotEnoughUppercases, passwordNotEnoughNumbers, passwordNotEnoughSymbols; +angular.module("designModule") - minLen = 8; - minCountUppercase = 1; - minCountLowercase = 1; - minCountNumbers = 1; - minCountSymbols = 1; +.directive("otPassword", function() { + return { + restrict: 'EA', + require: '?ngModel', + link: function(scope, elem, attrs, ngModel) { - passwordNotValidLength = "password should have " + minLen + " char or more"; - passwordNotEnoughLowercases = "password should have not less " + minCountUppercase + " lowercase"; - passwordNotEnoughUppercases = "password should have not less " + minCountUppercase + " uppercase"; - passwordNotEnoughNumbers = "password should have not less " + minCountNumbers + " numbers"; - passwordNotEnoughSymbols = "password should have not less " + minCountSymbols + " symbols"; + var minLength = 6; + var commonPasswords = ['123456', 'password', '12345678', 'thunder', 'dragon', '696969', 'mustang', + 'letmein', 'baseball', 'master', 'michael', 'football', 'shadow', 'monkey', 'abc123', 'fuckme', + 'jordan', 'harley', 'ranger', 'iwantu', 'jennifer', 'hunter', 'batman', 'trustno1', 'thomas', + 'tigger', 'robert', 'access', 'buster', '1234567', 'soccer', 'hockey', 'killer', 'george', + 'andrew', 'charlie', 'superman', 'asshole', 'fuckyou', 'dallas', 'jessica', 'panties', 'pepper', + 'austin', 'william', 'cowboy', 'silver', 'richard', 'fucker', 'orange', 'merlin', 'michelle', + 'corvette', 'bigdog', 'cheese', 'matthew', '121212', 'patrick', 'martin', 'freedom', 'ginger', + 'blowjob', 'nicole', 'sparky', 'yellow', 'camaro', 'secret', 'falcon', 'taylor', '111111', + '131313', '123123' + ]; - designModule.directive("otPassword", function () { - return { - restrict: 'EA', - require: '?ngModel', - link: function (scope, elem, attrs, ngModel) { - var checkLowercases = function (value) { - var matches = value.match(/([a-z]+)/g); - return (matches === null || (matches !== null && matches.join("").length < minCountLowercase)); - }; - var checkUppercases = function (value) { - var matches = value.match(/([A-Z]+)/g); - return (matches === null || (matches !== null && matches.join("").length < minCountUppercase)); - }; - var checkNumbers = function (value) { - var matches = value.match(/([\d]+)/g); - return (matches === null || (matches !== null && matches.join("").length < minCountNumbers)); - }; - var checkSymbols = function (value) { - var matches = value.match(/([\!\@\#\\$\%\^\&\*\(\)\_\+\-\~]+)/g); - return (matches === null || (matches !== null && matches.join("").length < minCountSymbols)); - }; - var validate = function (value) { + var messages = { + minLength: 'The password should have ' + minLength + ' characters or more.', + common: 'You entered one of the fifty most common passwords, please try something stronger.' + }; + + var validate = function(value) { - if(!value) return value; - /*jshint maxcomplexity:6 */ - var valid = true; - if (value.length < minLen) { - valid = false; - ngModel.message2 = passwordNotValidLength; - } - if (checkLowercases(value)) { - valid = false; - ngModel.message2 = passwordNotEnoughLowercases; - } - if (checkUppercases(value)) { - valid = false; - ngModel.message2 = passwordNotEnoughUppercases; - } - if (checkNumbers(value)) { - valid = false; - ngModel.message2 = passwordNotEnoughNumbers; - } - if (checkSymbols(value)) { - valid = false; - ngModel.message2 = passwordNotEnoughSymbols; - } - ngModel.$setValidity('otpassword', valid); - return value; - }; + if (!value) return value; - //For DOM -> model validation - ngModel.$parsers.unshift(validate); - //For model -> DOM validation - ngModel.$formatters.unshift(validate); + var valid = true; + if (value.length < minLength) { + valid = false; + ngModel.message = messages.minLength; + } + if (commonPasswords.indexOf(value) >= 0) { + valid = false; + ngModel.message = messages.common; } + ngModel.$setValidity('ot-password', valid); + return value; }; - }); - }); -})(window.define); + + //For DOM -> model validation + ngModel.$parsers.unshift(validate); + //For model -> DOM validation + ngModel.$formatters.unshift(validate); + } + }; +}); + diff --git a/app/scripts/design/directives/validator/positive.js b/app/scripts/design/directives/validator/positive.js index 5d8fecb9..ebc0e416 100644 --- a/app/scripts/design/directives/validator/positive.js +++ b/app/scripts/design/directives/validator/positive.js @@ -1,46 +1,40 @@ -(function (define) { - "use strict"; - - define(["design/init"], function (designModule) { - - var re = new RegExp("^[\\-]*[\\d]+[\\.\\d]*$", ""); - var integerNotValid = "not valid number"; - var positiveNotValid = "value should be more than zero"; - - designModule.directive("otPositive", function () { - return { - restrict: 'A', - require: '?ngModel', - link: function (scope, elem, attrs, ngModel) { - - var validate = function (value) { - var valid; - valid = re.test(value); - if(!valid){ - ngModel.$setValidity('ot-positive', valid); - if (!valid) { - ngModel.message = integerNotValid; - } - - return value; - } +angular.module("designModule") + +.directive("otPositive", function () { + return { + restrict: 'A', + require: '?ngModel', + link: function (scope, elem, attrs, ngModel) { + var re = new RegExp("^[\\-]*[\\d]+[\\.\\d]*$", ""); + var integerNotValid = "not valid number"; + var positiveNotValid = "value should be more than zero"; + + var validate = function (value) { + var valid; + valid = re.test(value); + if(!valid){ + ngModel.$setValidity('ot-positive', valid); + if (!valid) { + ngModel.message = integerNotValid; + } + + return value; + } - valid = parseFloat(value) >= 0; - ngModel.$setValidity('ot-positive', valid); - if (!valid) { - ngModel.message = positiveNotValid; - } + valid = parseFloat(value) >= 0; + ngModel.$setValidity('ot-positive', valid); + if (!valid) { + ngModel.message = positiveNotValid; + } - return value; - }; + return value; + }; - //For DOM -> model validation - ngModel.$parsers.unshift(validate); - //For model -> DOM validation - ngModel.$formatters.unshift(validate); - } - }; - }); - }); -})(window.define); \ No newline at end of file + //For DOM -> model validation + ngModel.$parsers.unshift(validate); + //For model -> DOM validation + ngModel.$formatters.unshift(validate); + } + }; +}); diff --git a/app/scripts/design/directives/validator/price.js b/app/scripts/design/directives/validator/price.js index 415acd43..68c66d88 100644 --- a/app/scripts/design/directives/validator/price.js +++ b/app/scripts/design/directives/validator/price.js @@ -1,33 +1,27 @@ -(function (define) { - "use strict"; - define(["design/init"], function (designModule) { +angular.module("designModule") + .directive("otPrice", function () { + return { + restrict: 'A', + require: '?ngModel', + link: function (scope, elem, attrs, ngModel) { - var re = new RegExp("^\\d*\\.*\\d{0,2}$", ""); - var priceNotValid = "not valid price"; + var re = new RegExp("^\\d*\\.*\\d{0,2}$", ""); + var priceNotValid = "not valid price"; - designModule - .directive("otPrice", function () { - return { - restrict: 'A', - require: '?ngModel', - link: function (scope, elem, attrs, ngModel) { - - var validate = function (value) { - var valid = re.test(value); - ngModel.$setValidity('ot-price', valid); - if (!valid) { - ngModel.message = priceNotValid; - } - - return value; - }; - - //For DOM -> model validation - ngModel.$parsers.unshift(validate); - //For model -> DOM validation - ngModel.$formatters.unshift(validate); + var validate = function (value) { + var valid = re.test(value); + ngModel.$setValidity('ot-price', valid); + if (!valid) { + ngModel.message = priceNotValid; } + + return value; }; - }); + + //For DOM -> model validation + ngModel.$parsers.unshift(validate); + //For model -> DOM validation + ngModel.$formatters.unshift(validate); + } + }; }); -})(window.define); \ No newline at end of file diff --git a/app/scripts/design/directives/validator/regexp.js b/app/scripts/design/directives/validator/regexp.js index 44142bfd..1688adab 100644 --- a/app/scripts/design/directives/validator/regexp.js +++ b/app/scripts/design/directives/validator/regexp.js @@ -1,46 +1,39 @@ -(function (define) { - "use strict"; - - define(["design/init"], function (designModule) { - - var notValid = "The field is not valid"; - - designModule.directive("otRegexp", function () { - return { - restrict: 'A', - require: 'ngModel', - link: function (scope, elem, attrs, ngModel) { - var regexpValue = elem.attr('ot-regexp'); - - - var validate = function (value) { - try { - var params = regexpValue.split(/['"],['"]/); - var regExp; - - if (params.length > 1) { - regExp = new RegExp(params[0].trim("/,\""), params[1].trim("/,\"")); - - } else { - regExp = new RegExp(params[0].trim("/,\""), "g"); - } - - var valid = regExp.test(value); - ngModel.$setValidity('ot-regexp', valid); - if (!valid) { - ngModel.message = notValid; - } - } catch(e) { } - - return value; - }; - - //For DOM -> model validation - ngModel.$parsers.unshift(validate); - //For model -> DOM validation - ngModel.$formatters.unshift(validate); - } +angular.module("designModule") + +.directive("otRegexp", function () { + return { + restrict: 'A', + require: 'ngModel', + link: function (scope, elem, attrs, ngModel) { + var regexpValue = elem.attr('ot-regexp'); + var notValid = "The field is not valid"; + + var validate = function (value) { + try { + var params = regexpValue.split(/['"],['"]/); + var regExp; + + if (params.length > 1) { + regExp = new RegExp(params[0].trim("/,\""), params[1].trim("/,\"")); + + } else { + regExp = new RegExp(params[0].trim("/,\""), "g"); + } + + var valid = regExp.test(value); + ngModel.$setValidity('ot-regexp', valid); + if (!valid) { + ngModel.message = notValid; + } + } catch(e) { } + + return value; }; - }); - }); -})(window.define); \ No newline at end of file + + //For DOM -> model validation + ngModel.$parsers.unshift(validate); + //For model -> DOM validation + ngModel.$formatters.unshift(validate); + } + }; +}); diff --git a/app/scripts/design/directives/validator/sku.js b/app/scripts/design/directives/validator/sku.js index d51c6aca..4bac9c81 100644 --- a/app/scripts/design/directives/validator/sku.js +++ b/app/scripts/design/directives/validator/sku.js @@ -1,43 +1,37 @@ -(function (define) { - "use strict"; - - define(["design/init"], function (designModule) { - - var maxLength = 150; - var re = new RegExp("^[\\w\\d\\_\\-]{1," + maxLength + "}$", "i"); - var skuNotValid = "Please use only letters (a-z, A-Z), numbers (0-9) or underscore(_) in this field, first character should be a letter. Max length " + maxLength; - var skuTooMuchLong = "Please use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter. Max length " + maxLength; - - designModule.directive("otSku", function () { - return { - restrict: 'A', - require: '?ngModel', - link: function (scope, elem, attrs, ngModel) { - - var validate = function (value) { - if (typeof value !== "undefined" && value.length > maxLength) { - ngModel.$setValidity('ot-sku', false); - ngModel.message = skuTooMuchLong; - - return false; - } +angular.module("designModule") + +.directive("otSku", function () { + return { + restrict: 'A', + require: '?ngModel', + link: function (scope, elem, attrs, ngModel) { + var maxLength = 150; + var re = new RegExp("^[\\w\\d\\_\\-]{1," + maxLength + "}$", "i"); + var skuNotValid = "Please use only letters (a-z, A-Z), numbers (0-9) or underscore(_) in this field, first character should be a letter. Max length " + maxLength; + var skuTooMuchLong = "Please use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter. Max length " + maxLength; + + var validate = function (value) { + if (typeof value !== "undefined" && value.length > maxLength) { + ngModel.$setValidity('ot-sku', false); + ngModel.message = skuTooMuchLong; + + return false; + } - var valid = re.test(value); - ngModel.$setValidity('ot-sku', valid); - if (!valid) { - ngModel.message = skuNotValid; - } + var valid = re.test(value); + ngModel.$setValidity('ot-sku', valid); + if (!valid) { + ngModel.message = skuNotValid; + } - return value; - }; + return value; + }; - //For DOM -> model validation - ngModel.$parsers.unshift(validate); - //For model -> DOM validation - ngModel.$formatters.unshift(validate); - } - }; - }); - }); -})(window.define); \ No newline at end of file + //For DOM -> model validation + ngModel.$parsers.unshift(validate); + //For model -> DOM validation + ngModel.$formatters.unshift(validate); + } + }; +}); diff --git a/app/scripts/design/init.js b/app/scripts/design/init.js index 5f8a6124..17cd65dc 100644 --- a/app/scripts/design/init.js +++ b/app/scripts/design/init.js @@ -1,61 +1,27 @@ -(function (define) { - "use strict"; - - /* - * Angular "designModule" is very common module and responds for a top HTML page rendering stuff. - * It contains theming feature as well as ui editor controls directives. And even more. - * - * (check other modules dependency before exclude this module from include list) - * +/** +* Angular "designModule" allows to use themes +* +* default [themeName] is blank +* Usage: +* +* i.e. - getTemplate("someTemplate.html") = views/[themeName]/someTemplate.html +* +*/ + +angular.module("designModule",[]) + +.constant("MEDIA_BASE_PATH", angular.appConfigValue("general.app.media_path")) +.constant("PRODUCT_DEFAULT_IMG", "placeholder.png") + +/** + * Startup for designModule - registration globally visible functions + */ +.run(["$designService", "$rootScope", function ($designService, $rootScope) { + + /** + * Global functions you can use in any angular template */ - define(["angular"], function (angular) { - - angular.getTheme = function (path) { - - return function () { - var template, tpl; - tpl = "/views/" + path; - - if (angular.isExistFile) { - template = "themes/" + angular.appConfigValue("themes.list.active") + tpl; - } else { - template = "themes/default" + tpl; - } - - return template; - }; - }; - - /** - * Angular "designModule" allows to use themes - * - * default [themeName] is blank - * Usage: - * - * i.e. - getTemplate("someTemplate.html") = views/[themeName]/someTemplate.html - * - */ - angular.module.designModule = angular.module("designModule",[]) - - .constant("MEDIA_BASE_PATH", angular.appConfigValue("general.app.media_path")) - .constant("PRODUCT_DEFAULT_IMG", "placeholder.png") - - /** - * Startup for designModule - registration globally visible functions - */ - .run(["$designService", "$rootScope", function ($designService, $rootScope) { - - /** - * Global functions you can use in any angular template - */ - $rootScope.setTheme = $designService.setTheme; - $rootScope.getTemplate = $designService.getTemplate; - $rootScope.getTopPage = $designService.getTopPage; - $rootScope.getCss = $designService.getCssList; - $rootScope.getImg = $designService.getImage; - - }]); + $rootScope.getTemplate = $designService.getTemplate; + $rootScope.getImg = $designService.getImage; - return angular.module.designModule; - }); -})(window.define); +}]); diff --git a/app/scripts/design/module.js b/app/scripts/design/module.js deleted file mode 100644 index fb4d116b..00000000 --- a/app/scripts/design/module.js +++ /dev/null @@ -1,70 +0,0 @@ -(function (define) { - "use strict"; - - /** - * Module contains general purpose directives and services used to render HTML page - * (make sure module present in main.js requireJS list) - */ - define([ - "design/service/image", - "design/service/api", - "design/service/design", - - "design/directives/design", - "design/directives/guiPaginator", - "design/directives/guiFormBuilder", - "design/directives/guiAttributesEditorForm", - "design/directives/guiAttributesEditorFormTabs", - "design/directives/guiListManager", - "design/directives/guiTableManager", - "design/directives/guiTableManagerPopup", - "design/directives/guiMessageManager", - - // Table filters - "design/directives/filter/guiText", - "design/directives/filter/guiRange", - "design/directives/filter/guiSelect", - - // Validator - "design/directives/otApplyValidator", - "design/directives/validator/sku", - "design/directives/validator/email", - "design/directives/validator/price", - "design/directives/validator/len", - "design/directives/validator/between", - "design/directives/validator/number", - "design/directives/validator/positive", - "design/directives/validator/date", - "design/directives/validator/regexp", - "design/directives/validator/password", - - // Form fields - "design/directives/editor/guiHtml", - "design/directives/editor/guiTinymce", - "design/directives/editor/guiPictureManager", - "design/directives/editor/guiModelSelector", - "design/directives/editor/guiArrayModelSelector", - "design/directives/editor/guiVisitorSelector", - "design/directives/editor/guiProductSelector", - "design/directives/editor/guiCategorySelector", - "design/directives/editor/guiNotEditable", - "design/directives/editor/guiMultilineText", - "design/directives/editor/guiPassword", - "design/directives/editor/guiBoolean", - "design/directives/editor/guiSelect", - "design/directives/editor/guiMultiSelect", - "design/directives/editor/guiText", - "design/directives/editor/guiPrice", - "design/directives/editor/guiDatetime", - "design/directives/editor/guiJsonEditor", - "design/directives/editor/guiThemesManager", - "design/directives/editor/guiThemesManager", - - "design/tinymce/blockSelector" - ], - function (designModule) { - - return designModule; - }); - -})(window.define); \ No newline at end of file diff --git a/app/scripts/design/service/api.js b/app/scripts/design/service/api.js index 936aa893..6ee8efbc 100644 --- a/app/scripts/design/service/api.js +++ b/app/scripts/design/service/api.js @@ -1,40 +1,28 @@ -(function (define) { - "use strict"; - - /* - * HTML top page header manipulation stuff - */ - define(["design/init"], function (productModule) { - productModule - /* - * $productApiService interaction service - */ - .service("$designApiService", ["$resource", "REST_SERVER_URI", function ($resource, REST_SERVER_URI) { - return $resource(REST_SERVER_URI, {}, { - "attributesModel": { - method: "GET", - params: { - "uri_1": "@uri_1", - "uri_2": "@uri_2", - "uri_3": "@uri_3", - "uri_4": "@uri_4", - "uri_5": "@uri_5" - }, - url: REST_SERVER_URI + "/:uri_1/:uri_2/:uri_3/:uri_4/:uri_5" - }, - "productList": { - method: "GET", - url: REST_SERVER_URI + "/products" - }, - "getCount": { - method: "GET", - params: { action: "count" }, - url: REST_SERVER_URI + "/products" - } - }); - }]); - - return productModule; +angular.module("designModule") +/* + * $productApiService interaction service + */ +.service("$designApiService", ["$resource", "REST_SERVER_URI", function ($resource, REST_SERVER_URI) { + return $resource(REST_SERVER_URI, {}, { + "attributesModel": { + method: "GET", + params: { + "uri_1": "@uri_1", + "uri_2": "@uri_2", + "uri_3": "@uri_3", + "uri_4": "@uri_4", + "uri_5": "@uri_5" + }, + url: REST_SERVER_URI + "/:uri_1/:uri_2/:uri_3/:uri_4/:uri_5" + }, + "productList": { + method: "GET", + url: REST_SERVER_URI + "/products" + }, + "getCount": { + method: "GET", + params: { action: "count" }, + url: REST_SERVER_URI + "/products" + } }); - -})(window.define); \ No newline at end of file +}]); \ No newline at end of file diff --git a/app/scripts/design/service/design.js b/app/scripts/design/service/design.js index a9de9d81..0f2d6f4a 100644 --- a/app/scripts/design/service/design.js +++ b/app/scripts/design/service/design.js @@ -1,95 +1,15 @@ -(function (define) { - "use strict"; - - define(["angular", "design/init"], function (angular, designModule) { - designModule - /** - * $designService allows to do operations over very top HTML page - */ - .service("$designService", [function () { - - var data = { theme: angular.appConfigValue("themes.list.active"), topPage: "index.html", cssList: []}; - var isFullPathRegex = new RegExp("^http[s]?://", "i"); - var isCssRegex = new RegExp(".css$", "i"); - var themesDir = "themes/"; - - return { - getTheme: function () { - return data.theme; - }, - - setTheme: function (newTheme) { - data.theme = newTheme; - - angular.activeTheme = newTheme; - angular.appConfig["themes.list.active"] = newTheme; - data.cssList = []; - - return data.theme; - }, - - getTopPage: function () { - return this.getTemplate(data.topPage); - }, - - setTopPage: function (newTopPage) { - data.topPage = newTopPage; - - return data.topPage; - }, - - getTemplate: function (templateName) { - var template; - - template = angular.getTheme(templateName)(); - - return template; - }, - - addCss: function (cssName) { - var fileName; - - if (isFullPathRegex.test(cssName) === false && isCssRegex.test(cssName) === true) { - fileName = "/styles/" + cssName; - - if (angular.isExistFile(fileName)) { - cssName = (themesDir + data.theme + fileName).replace(/\/+/, "/"); - } else { - cssName = (themesDir + "default" + fileName).replace(/\/+/, "/"); - } - } - data.cssList.push(cssName); - - return cssName; - }, - - getCssList: function () { - var i, uniqueCss; - uniqueCss = []; - for (i = 0; i < data.cssList.length; i += 1) { - if (-1 === uniqueCss.indexOf(data.cssList[i])) { - uniqueCss.push(data.cssList[i]); - } - } - - return uniqueCss; - }, - - getImage: function (img) { - var image; - img = "/images/" + img; - - if (angular.isExistFile(img)) { - image = themesDir + data.theme + img; - } else { - image = themesDir + "default" + img; - } - - return image; - } - }; - }]); - - return designModule; - }); -})(window.define); \ No newline at end of file +angular.module("designModule") +/** +* $designService allows to do operations over very top HTML page +*/ +.service("$designService", [function () { + + return { + getTemplate: function (templateName) { + return '/themes/views/' + templateName; + }, + getImage: function (img) { + return "/themes/images/" + img; + } + } +}]); \ No newline at end of file diff --git a/app/scripts/design/service/image.js b/app/scripts/design/service/image.js index 9a791646..6e2e7327 100644 --- a/app/scripts/design/service/image.js +++ b/app/scripts/design/service/image.js @@ -1,45 +1,30 @@ -(function (define) { - "use strict"; - - /* - * HTML top page header manipulation stuff - */ - define(["design/init"], function (designModule) { - - designModule - /* - * $designImageService implementation - */ - .service("$designImageService", [ - "$designService", - "MEDIA_BASE_PATH", - "PRODUCT_DEFAULT_IMG", - function ($designService, MEDIA_BASE_PATH, PRODUCT_DEFAULT_IMG) { - var getFullImagePath; - - getFullImagePath = function (path, filename) { - var src, imgRegExp; - imgRegExp = new RegExp(".gif|png|jpg|jpeg|ico$", "i"); - - if (typeof path === "undefined" || typeof filename === "undefined" || filename === "" || !imgRegExp.test(filename)) { - src = $designService.getImage(PRODUCT_DEFAULT_IMG); - } else { - src = MEDIA_BASE_PATH + path + filename; - } - - - return src; - }; - - return { - getFullImagePath: getFullImagePath - }; - } - ] - ); - - - return designModule; - }); - -})(window.define); \ No newline at end of file +angular.module("designModule") +/* + * $designImageService implementation + */ +.service("$designImageService", [ + "$designService", + "MEDIA_BASE_PATH", + "PRODUCT_DEFAULT_IMG", + function ($designService, MEDIA_BASE_PATH, PRODUCT_DEFAULT_IMG) { + var getFullImagePath; + + getFullImagePath = function (path, filename) { + var src, imgRegExp; + imgRegExp = new RegExp(".gif|png|jpg|jpeg|ico$", "i"); + + if (typeof path === "undefined" || typeof filename === "undefined" || filename === "" || !imgRegExp.test(filename)) { + src = $designService.getImage(PRODUCT_DEFAULT_IMG); + } else { + src = MEDIA_BASE_PATH + path + filename; + } + + + return src; + }; + + return { + getFullImagePath: getFullImagePath + }; + } +]); \ No newline at end of file diff --git a/app/scripts/design/tinymce/blockSelector.js b/app/scripts/design/tinymce/blockSelector.js deleted file mode 100644 index cea31938..00000000 --- a/app/scripts/design/tinymce/blockSelector.js +++ /dev/null @@ -1,46 +0,0 @@ -(function (define) { - 'use strict'; - define(["angular", "tinymce"], function (angular, tinymce) { - - tinymce.PluginManager.add('blocks', function (editor) { - var onclick = function () { - var blocks = []; - angular.element.get(angular.appConfigValue("general.app.foundation_url") + "/cms/block/list", function (data) { - for (var i = 0; i < data.result.length; i += 1) { - blocks.push({ - "value": data.result[i].Name, - "text": data.result[i].Name - }); - } - editor.windowManager.open({ - "title": 'Blocks', - "body": [ - { - "type": 'listbox', - "name": 'block', - "label": 'Block', - "values": blocks - } - ], - "onsubmit": function (e) { - // Insert content when the window form is submitted - editor.insertContent('{{block("' + e.data.block + '")}}'); - } - }); - }); - }; - // Add a button that opens a window - editor.addButton('blocks', { - "text": 'Blocks', - "icon" : false, -// "icon" : true, -// "image": "/icon.png", - "onclick": onclick - }); - }); - - - return tinymce; - }); - -})(window.define); diff --git a/app/scripts/discounts/controller/edit.js b/app/scripts/discounts/controller/edit.js new file mode 100644 index 00000000..eded5d31 --- /dev/null +++ b/app/scripts/discounts/controller/edit.js @@ -0,0 +1,44 @@ +angular.module("discountsModule") + +.controller("editController", [ + "$scope", + "$discountsService", + "$routeParams", + "$location", + function($scope, $discountsService, $routeParams, $location){ + + // Defaults + $scope.discount = $discountsService.defaults; + + var isEditPage = !!$routeParams.id; + + if (isEditPage) { + // Edit Page + $discountsService.one($routeParams.id) + .then(function(discount) { + $scope.discount = discount; + }); + } + + $scope.clearDiscountValues = function() { + $scope.discount.amount = ''; + $scope.discount.percent = ''; + } + + $scope.save = function() { + if ($scope.discount.isNoLimit) { + $scope.discount.times = -1; + } + + if (isEditPage) { + $discountsService.put($scope.discount); + } else { + $discountsService.post($scope.discount, function(savedDiscount) { + // Navigate to our edit page + var id = savedDiscount._id; + $location.path('/discounts/' + id ); + }); + } + } + } +]); \ No newline at end of file diff --git a/app/scripts/discounts/controller/list.js b/app/scripts/discounts/controller/list.js new file mode 100644 index 00000000..4fbad248 --- /dev/null +++ b/app/scripts/discounts/controller/list.js @@ -0,0 +1,11 @@ +angular.module("discountsModule") + +.controller("listController", [ + "$scope", + "$discountsService", + function($scope, $discountsService){ + $discountsService.getList().then(function(discounts) { + $scope.discounts = discounts; + }); + } +]); \ No newline at end of file diff --git a/app/scripts/discounts/init.js b/app/scripts/discounts/init.js new file mode 100644 index 00000000..6d573025 --- /dev/null +++ b/app/scripts/discounts/init.js @@ -0,0 +1,23 @@ +angular.module("discountsModule", ["ngRoute", "moment"]) + +/* + * Basic routing configuration + */ +.config([ + "$routeProvider", + function ($routeProvider) { + $routeProvider + .when("/discounts", { + templateUrl: "/themes/views/discounts/list.html", + controller: "listController" + }) + .when("/discounts/new", { + templateUrl: "/themes/views/discounts/edit.html", + controller: "editController" + }) + .when("/discounts/:id", { + templateUrl: "/themes/views/discounts/edit.html", + controller: "editController" + }); + } +]); diff --git a/app/scripts/discounts/service/api.js b/app/scripts/discounts/service/api.js new file mode 100644 index 00000000..7894ba9f --- /dev/null +++ b/app/scripts/discounts/service/api.js @@ -0,0 +1,102 @@ +angular.module("discountsModule") + +/** + * code + * name + * until + * since + * amount + * percent + * times + */ +.service("$discountsService", [ + "$http", + "REST_SERVER_URI", + "moment", + "timezoneService", + function ($http, REST_SERVER_URI, moment, timezoneService) { + var _url = REST_SERVER_URI + '/coupons'; + + var defaults = { + isNoLimit: true, + times: -1, + type: 'amount' + }; + + var service = { + one: one, + post: post, + put: put, + getList: getList, + defaults: defaults + }; + + return service; + + //////////////////////////// + + function _transformResponse(discount) { + var _storeTz = timezoneService.storeTz; + + // Process the datetime, down to just a date + discount.sinceLocal = moment(discount.since).utcOffset(_storeTz).format('YYYY-MM-DD'); + discount.untilLocal = moment(discount.until).utcOffset(_storeTz).format('YYYY-MM-DD'); + + // Some helper methods + discount.type = discount.amount ? 'amount' : 'percent'; + discount.isNoLimit = (discount.times == -1); + + return discount; + } + + function _transformRequest(discount) { + var _storeTz = ' ' + timezoneService.storeTz; + + discount.since = moment(discount.sinceLocal + _storeTz, 'YYYY-MM-DD Z').toISOString(); + discount.until = moment(discount.untilLocal + _storeTz, 'YYYY-MM-DD Z').toISOString(); + + return discount; + } + + function one(id) { + return $http.get(_url + '/' + id).then(function(response){ + return _transformResponse(response.data.result); + }); + } + + function post(data) { + // processing the params can effect the source data, so we need to copy it out + var params = {}; + angular.copy(data, params); + + params = _transformRequest(params); + return $http.post(_url, params).then(function(response){ + return response.data.result; + }); + } + + function put(data) { + // processing the params can effect the source data, so we need to copy it out + var params = {}; + angular.copy(data, params); + + params = _transformRequest(params); + + return $http.put(_url +'/' + params._id, params).then(function(response){ + return response.data.result; + }); + } + + function getList() { + return $http.get(_url).then(function(response){ + var results = response.data.result || []; + results = results.map(function(discount) { + return _transformResponse(discount); + }); + + return results; + }); + } + + } +]); \ No newline at end of file diff --git a/app/scripts/impex/controller.js b/app/scripts/impex/controller.js index b01e6400..91aab5f1 100644 --- a/app/scripts/impex/controller.js +++ b/app/scripts/impex/controller.js @@ -1,182 +1,122 @@ -(function (define, $) { - "use strict"; - - define(["angular", "impex/init"], function (angular, impexModule) { - - impexModule - /** - * - */ - .controller("impexController", [ - "$scope", - "$timeout", - "$sce", - "$impexApiService", - "$dashboardUtilsService", - "REST_SERVER_URI", - function ($scope, $timeout, $sce, $impexApiService, $dashboardUtilsService, REST_SERVER_URI) { - - $scope.sendRequest = false; - $scope.modelImportSubmit = false; - $scope.modelExportSubmit = false; - $scope.batchSubmit = false; - - $scope.init = function () { - $impexApiService.getModels().$promise.then(function (response) { - if(response.error === null) { - $scope.modelList = response.result; - } else { - $scope.message = $dashboardUtilsService.getMessage(response.error); - } - }); - - $scope.checkStatus() - $scope.$on('$destroy', function(){ - $timeout.cancel($scope.activeProgressPromise); - }); - }; - - - $scope.checkStatus = function(){ - $impexApiService.importStatus().$promise.then(function (response) { - var run = response.result.position ? true : false - var timeLimit = (run) ? 1000 : 5000 - $scope.importProgress = (run) ? parseInt( parseInt(response.result.position) / parseInt(response.result.size) *100 ) : 0 - $scope.importFileName = response.result.name - var promise = $timeout(function(){ - $scope.checkStatus() - }, timeLimit); - $scope.activeProgressPromise = promise - }); - } - - $scope.importModel = function () { - $scope.modelImportSubmit = true; - - if ($scope.model === "" || typeof $scope.model === "undefined") { - return true; - } - - $scope.batchSubmit = true; - - if ($scope.file === "" || typeof $scope.file === "undefined") { - return true; - } - - var file, postData; - - $scope.sendRequest = true; - file = document.getElementById("file"); - postData = new FormData(); - postData.append("file", file.files[0]); - - $impexApiService.importModel({"model": $scope.model}, postData).$promise.then(function (response) { - $scope.modelImportSubmit = false; - $scope.sendRequest = false; - - try { - if (response.error === null) { - $scope.message = $dashboardUtilsService.getMessage(null, 'success', response.result); - } else { - $scope.message = $dashboardUtilsService.getMessage(response); - } - } catch(e) {} - - return true; - }); - }; - - $scope.exportModel = function () { - $scope.modelExportSubmit = true; - if ($scope.model === "" || typeof $scope.model === "undefined") { - return true; - } - $scope.exportFile = $sce.trustAsHtml(""); - }; - - $scope.importBatch = function () { - var file, postData; - $scope.batchSubmit = true; - - if ($scope.file === "" || typeof $scope.file === "undefined") { - return true; - } - - $scope.sendRequest = true; - file = document.getElementById("file"); - postData = new FormData(); - postData.append("file", file.files[0]); - - $impexApiService.importBatch({}, postData).$promise.then(function (response) { - $scope.batchSubmit = false; - $scope.sendRequest = false; - - try { - if (response.error === null) { - $scope.message = $dashboardUtilsService.getMessage(null, 'success', response.result); - } else { - $scope.message = $dashboardUtilsService.getMessage(response); - } - } catch(e) {} - - return true; - }); - }; - - - $scope.exportTax = function () { - $scope.exportFile = $sce.trustAsHtml(""); - }; - - $scope.exportDiscount = function () { - $scope.exportFile = $sce.trustAsHtml(""); - }; - - $scope.importTaxOrDiscount = function (functionName) { - $scope.taxSubmit = true; - - if ($scope.file === "" || typeof $scope.file === "undefined") { - return true; - } - - $('#processing').modal('show'); - var file, postData; - - $scope.sendRequest = true; - file = document.getElementById("file"); - postData = new FormData(); - postData.append("file", file.files[0]); - - $impexApiService[functionName]({}, postData).$promise.then(function (response) { - $scope.modelImportSubmit = false; - $scope.sendRequest = false; - $('#processing').modal('hide'); - // @todo: temporary fix with closing popup, while these methods not returns json in response - $scope.message = $dashboardUtilsService.getMessage(null, 'success', "Operation is finished"); - - try { - if (response.error === null) { - $scope.message = $dashboardUtilsService.getMessage(null, 'success', response.result); - } else { - $scope.message = $dashboardUtilsService.getMessage(response); - } - } catch(e) {} - - return true; - }); - }; - - $scope.importDiscount = function () { - $scope.importTaxOrDiscount('importDiscount'); - }; - - $scope.importTax = function () { - $scope.importTaxOrDiscount('importTax'); - }; - - - }]); - - return impexModule; +angular.module("impexModule") + +.controller("impexController", [ +"$scope", +"$timeout", +"$interval", +"$sce", +"$impexApiService", +"$dashboardUtilsService", +"REST_SERVER_URI", +function ($scope, $timeout, $interval, $sce, $impexApiService, $dashboardUtilsService, REST_SERVER_URI) { + +$scope.init = function () { + $impexApiService.getModels().$promise.then(function (response) { + if(response.error === null) { + $scope.modelList = response.result; + } else { + $scope.message = $dashboardUtilsService.getMessage(response.error); + } }); -})(window.define, jQuery); + + $scope.$on('$destroy', function(){ + $interval.cancel($scope.importTrackInterval); + $timeout.cancel($scope.importTrackTimeout); + }); +}; + +$scope.startImportTrack = function() { + $scope.isImportRun = true; + $scope.importProgress = 0; + + $scope.importTrackInterval = $interval(function() { + + $impexApiService.importStatus().$promise.then(function(response) { + if (!response.result.position) return; + + $scope.importProgress = Math.round(response.result.position / response.result.size * 100); + }); + + }, 1000); +}; + +$scope.cancelImportTrack = function() { + $interval.cancel($scope.importTrackInterval); + $scope.importProgress = 100; + + // Show progress bar at least for one second for small files + $scope.importTrackTimeout = $timeout(function() { + $scope.isImportRun = false; + }, 1000); +} + + +$scope.import = function(method) { + $scope.importMethod = method; + $scope.exportMethod = null; + + if (!$scope.file || + (method == 'model' && !$scope.model)) + return; + + var postData = new FormData(); + postData.append('file', $scope.file); + + var apiMethodName, + methodOptions = {}; + + switch (method) { + case 'model': + apiMethodName = 'importModel'; + methodOptions = { 'model': $scope.model }; + break; + case 'batch': + apiMethodName = 'importBatch'; + break; + case 'tax': + apiMethodName = 'importTax'; + break; + case 'discount': + apiMethodName = 'importDiscount'; + break; + } + + $scope.startImportTrack(); + + $impexApiService[apiMethodName](methodOptions, postData).$promise + .then(function(response) { + $scope.importMethod = null; + $scope.cancelImportTrack(); + + $scope.message = (response.error === null) ? + $dashboardUtilsService.getMessage(null, 'success', response.result) : + $dashboardUtilsService.getMessage(response); + }); +}; + +$scope.export = function(method) { + $scope.exportMethod = method; + $scope.importMethod = null; + + if (method == 'model' && !$scope.model) return; + + var apiUrl = ''; + + switch (method) { + case 'model': + apiUrl = '/impex/export/' + $scope.model; + break; + case 'tax': + apiUrl = '/taxes/csv'; + break; + case 'discount': + apiUrl = '/discounts/csv'; + break; + } + + $scope.exportFile = $sce.trustAsHtml("