From 45efd08ff05809660afcb4b192a74003c6912de5 Mon Sep 17 00:00:00 2001 From: Chrysostomos Kolovos Date: Wed, 2 Apr 2014 16:07:40 +0300 Subject: [PATCH] scheduler new version with angular --- plugins/scheduler2/__init__.py | 6 +- plugins/scheduler2/asdf.txt | 0 plugins/scheduler2/static/css/scheduler2.css | 48 ++- plugins/scheduler2/static/js/SchedulerCtrl.js | 102 ++++++ .../static/js/angular/angular.min.js | 211 ++++++++++++ .../scheduler2/static/js/scheduler-helpers.js | 63 +++- plugins/scheduler2/static/js/scheduler2.js | 247 +++++-------- .../scheduler2/static/js/scheduler2_old.js | 325 ++++++++++++++++++ .../scheduler2/static/js/table-selector.js | 4 +- plugins/scheduler2/templates/scheduler.html | 45 +-- 10 files changed, 843 insertions(+), 208 deletions(-) mode change 100644 => 100755 plugins/scheduler2/asdf.txt create mode 100755 plugins/scheduler2/static/js/SchedulerCtrl.js create mode 100755 plugins/scheduler2/static/js/angular/angular.min.js create mode 100755 plugins/scheduler2/static/js/scheduler2_old.js diff --git a/plugins/scheduler2/__init__.py b/plugins/scheduler2/__init__.py index 0be022cf..3566a018 100755 --- a/plugins/scheduler2/__init__.py +++ b/plugins/scheduler2/__init__.py @@ -32,14 +32,16 @@ class Scheduler2 (Plugin): def requirements (self): reqs = { 'js_files' : [ + 'js/angular/angular.min.js', 'js/scheduler2.js', - 'js/slider/jquery-ui-1.10.3.slider.min.js', + 'js/SchedulerCtrl.js', + #'js/slider/jquery-ui-1.10.3.slider.min.js', 'js/scheduler-helpers.js', 'js/table-selector.js', ], 'css_files': [ 'css/scheduler2.css', - 'css/slider/jquery-ui-1.10.3.slider.min.css', + #'css/slider/jquery-ui-1.10.3.slider.min.css', ] } return reqs diff --git a/plugins/scheduler2/asdf.txt b/plugins/scheduler2/asdf.txt old mode 100644 new mode 100755 diff --git a/plugins/scheduler2/static/css/scheduler2.css b/plugins/scheduler2/static/css/scheduler2.css index d58f6d86..e4de904a 100755 --- a/plugins/scheduler2/static/css/scheduler2.css +++ b/plugins/scheduler2/static/css/scheduler2.css @@ -82,7 +82,8 @@ } /** tables css **/ -#ShedulerNodes-scroll-container { + +/*#ShedulerNodes-scroll-container { float: left; overflow-x: scroll; overflow-y: hidden; @@ -94,7 +95,6 @@ max-width: 500px; width: 450px; margin-top: 6px !important; - /* margin-top:55px; */ } #ShedulerNodes th{ @@ -140,15 +140,10 @@ width: 100%; } -#scheduler-reservation-table tr{ - background-color: #A6C9E2 ; -} - -#scheduler-reservation-table tr.even{ - background-color: #E0E0E0 ; -} + */ /*background: url("../img/opened-lock-15.png") no-repeat scroll 50% 50% transparent;*/ +/* #scheduler-reservation-table td { border: 1px solid #FFFFFF; cursor: pointer; @@ -185,20 +180,39 @@ padding: 0 5px; width: 3px; } + +*/ +#scheduler-reservation-table { + margin-top: 0 !important; +} +#scheduler-reservation-table tbody tr { + border: none !important; +} +#scheduler-reservation-table tbody tr td{ + background-color: #A6C9E2 ; + border: 1px solid #111111; +} -#scheduler-reservation-table td.free { +#scheduler-reservation-table tbody tr.even td{ + background-color: #E0E0E0 ; } -#scheduler-reservation-table td.closed { +#scheduler-reservation-table tbody tr th::selection {color: #000000;background:transparent;} +#scheduler-reservation-table tbody tr th::-moz-selection {color: #000000;background:transparent;} + +#scheduler-reservation-table tbody tr td.free { +} + +#scheduler-reservation-table tbody tr td.reserved { background: url("../img/closed-lock-15.png") no-repeat scroll 50% 50% #DD4444; cursor: not-allowed; } -#scheduler-reservation-table td.maintenance { +#scheduler-reservation-table tbody tr td.maintenance { background: url("../img/tools-15.png") no-repeat scroll 50% 50% #EDA428; } -#scheduler-reservation-table td.free:hover ,#scheduler-reservation-table td.selected, #scheduler-reservation-table td.selected_tmp { +#scheduler-reservation-table tbody tr td.free:hover ,#scheduler-reservation-table tbody tr td.selected, #scheduler-reservation-table tbody tr td.selected_tmp { background: #25BA25; } @@ -245,3 +259,11 @@ td.no-image { .legend ol li.selected { background: #25BA25; } + +/* latest stuff */ +.sliderContainer { + margin: 10px 0; +} +.table-responsive{ + overflow: hidden !important; +} \ No newline at end of file diff --git a/plugins/scheduler2/static/js/SchedulerCtrl.js b/plugins/scheduler2/static/js/SchedulerCtrl.js new file mode 100755 index 00000000..da243787 --- /dev/null +++ b/plugins/scheduler2/static/js/SchedulerCtrl.js @@ -0,0 +1,102 @@ +var myApp = angular.module('myApp', []); +myApp.config(function ($interpolateProvider) { + $interpolateProvider.startSymbol('{[{').endSymbol('}]}'); +}); +myApp.factory('$exceptionHandler', function () { + return function (exception, cause) { + if (exception.message.contains('leases')) { + console.log(exception.message); + angular.element(document.getElementById('SchedulerCtrl')).scope().initSlots(_schedulerCurrentCellPosition, _schedulerCurrentCellPosition + SchedulerTotalVisibleCells); + } + + }; +}); + +// Create a private execution space for our controller. When +// executing this function expression, we're going to pass in +// the Angular reference and our application module. +(function (ng, app) { + + + // Define our Controller constructor. + function Controller($scope) { + + // Store the scope so we can reference it in our + // class methods + this.scope = $scope; + + // Set up the default scope value. + this.scope.errorMessage = null; + this.scope.name = ""; + + $scope.resources = SchedulerDataViewData; + $scope.slots = SchedulerSlotsViewData; + //$scope.msg = "hello"; + + angular.element(document).ready(function() { + //console.log('Hello World'); + //alert('Hello World'); + //afterAngularRendered(); + }); + + $scope.moveFrontSlot = function(from, to) { + $scope.slots.shift(); + $scope.slots.push(SchedulerSlots[to]); + for (var j = 0; j < $scope.resources.length; j++) { + $scope.resources[j].leases.shift(); + $scope.resources[j].leases.push(SchedulerData[j].leases[to]); + } + try { + $scope.$digest(); + //$scope.$apply(); + } catch (err) { + $scope.initSlots(from, to); + } + }; + + $scope.moveBackSlot = function(from, to) { + $scope.$apply(function() { + try { + $scope.slots.pop(); + $scope.slots.unshift(SchedulerSlots[from]); + for (var j = 0; j < $scope.resources.length; j++) { + $scope.resources[j].leases.pop(); + $scope.resources[j].leases.unshift(SchedulerData[j].leases[from]); + } + } catch (err) { + alert("error"); + } + }); + }; + + $scope.initSlots = function(from, to) { + //init + $scope.slots = []; + for (var k = 0; k < SchedulerData.length; k++) { + if ($scope.resources.length < SchedulerData.length) + $scope.resources.push(jQuery.extend(true, {}, SchedulerData[k])); + $scope.resources[k].leases = []; + } + //set + for (var i = from; i < to; i++) { + $scope.slots.push(SchedulerSlots[i]); + for (var j = 0; j < $scope.resources.length; j++) { + $scope.resources[j].leases.push(SchedulerData[j].leases[i]); + } + } + //apply + $scope.$apply(); + }; + + + // Return this object reference. + return (this); + + } + + + // Define the Controller as the constructor function. + app.controller("SchedulerCtrl", Controller); + + +})(angular, myApp); \ No newline at end of file diff --git a/plugins/scheduler2/static/js/angular/angular.min.js b/plugins/scheduler2/static/js/angular/angular.min.js new file mode 100755 index 00000000..a71d0c7d --- /dev/null +++ b/plugins/scheduler2/static/js/angular/angular.min.js @@ -0,0 +1,211 @@ +/* + AngularJS v1.3.0-beta.4 + (c) 2010-2014 Google, Inc. http://angularjs.org + License: MIT +*/ +(function(R,U,s){'use strict';function A(b){return function(){var a=arguments[0],c,a="["+(b?b+":":"")+a+"] http://errors.angularjs.org/1.3.0-beta.4/"+(b?b+"/":"")+a;for(c=1;c").append(b).html();try{return 3===b[0].nodeType?P(c):c.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/, +function(a,b){return"<"+P(b)})}catch(d){return P(c)}}function $b(b){try{return decodeURIComponent(b)}catch(a){}}function ac(b){var a={},c,d;r((b||"").split("&"),function(b){b&&(c=b.split("="),d=$b(c[0]),w(d)&&(b=w(c[1])?$b(c[1]):!0,a[d]?M(a[d])?a[d].push(b):a[d]=[a[d],b]:a[d]=b))});return a}function bc(b){var a=[];r(b,function(b,d){M(b)?r(b,function(b){a.push(ya(d,!0)+(!0===b?"":"="+ya(b,!0)))}):a.push(ya(d,!0)+(!0===b?"":"="+ya(b,!0)))});return a.length?a.join("&"):""}function Ab(b){return ya(b, +!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function ya(b,a){return encodeURIComponent(b).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,a?"%20":"+")}function cd(b,a){function c(a){a&&d.push(a)}var d=[b],e,f,h=["ng:app","ng-app","x-ng-app","data-ng-app"],g=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;r(h,function(a){h[a]=!0;c(U.getElementById(a));a=a.replace(":","\\:");b.querySelectorAll&&(r(b.querySelectorAll("."+a),c),r(b.querySelectorAll("."+ +a+"\\:"),c),r(b.querySelectorAll("["+a+"]"),c))});r(d,function(a){if(!e){var b=g.exec(" "+a.className+" ");b?(e=a,f=(b[2]||"").replace(/\s+/g,",")):r(a.attributes,function(b){!e&&h[b.name]&&(e=a,f=b.value)})}});e&&a(e,f?[f]:[])}function cc(b,a){var c=function(){b=v(b);if(b.injector()){var c=b[0]===U?"document":ga(b);throw Na("btstrpd",c);}a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",b)}]);a.unshift("ng");c=dc(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(R&&!d.test(R.name))return c();R.name=R.name.replace(d,"");Pa.resumeBootstrap=function(b){r(b,function(b){a.push(b)});c()}}function hb(b,a){a=a||"_";return b.replace(dd,function(b,d){return(d?a:"")+b.toLowerCase()})}function Bb(b,a,c){if(!b)throw Na("areq",a||"?",c||"required");return b}function Qa(b,a,c){c&&M(b)&&(b=b[b.length-1]);Bb(F(b),a,"not a function, got "+(b&&"object"==typeof b? +b.constructor.name||"Object":typeof b));return b}function za(b,a){if("hasOwnProperty"===b)throw Na("badname",a);}function ec(b,a,c){if(!a)return b;a=a.split(".");for(var d,e=b,f=a.length,h=0;h "+b;a.removeChild(a.firstChild);Gb(this,a.childNodes);v(U.createDocumentFragment()).append(this)}else Gb(this,b)}function Hb(b){return b.cloneNode(!0)}function Ga(b){kc(b);var a=0;for(b=b.childNodes||[];a=V?(c.preventDefault=null,c.stopPropagation=null,c.isDefaultPrevented=null):(delete c.preventDefault,delete c.stopPropagation,delete c.isDefaultPrevented)};c.elem=b;return c}function Ha(b){var a=typeof b,c;"object"==a&&null!==b?"function"==typeof(c=b.$$hashKey)?c=b.$$hashKey():c===s&&(c=b.$$hashKey=db()):c=b;return a+":"+c}function Va(b){r(b,this.put,this)}function rc(b){var a,c;"function"== +typeof b?(a=b.$inject)||(a=[],b.length&&(c=b.toString().replace(se,""),c=c.match(te),r(c[1].split(ue),function(b){b.replace(ve,function(b,c,d){a.push(d)})})),b.$inject=a):M(b)?(c=b.length-1,Qa(b[c],"fn"),a=b.slice(0,c)):Qa(b,"fn",!0);return a}function dc(b){function a(a){return function(b,c){if(W(b))r(b,Ub(a));else return a(b,c)}}function c(a,b){za(a,"service");if(F(b)||M(b))b=n.instantiate(b);if(!b.$get)throw Wa("pget",a);return l[a+g]=b}function d(a,b){return c(a,{$get:b})}function e(a){var b=[], +c,d,f,g;r(a,function(a){if(!k.get(a)){k.put(a,!0);try{if(C(a))for(c=Ra(a),b=b.concat(e(c.requires)).concat(c._runBlocks),d=c._invokeQueue,f=0,g=d.length;f 4096 bytes)!"));else{if(m.cookie!==Z)for(Z=m.cookie,d=Z.split("; "),N={},f=0;fk&&this.remove(q.key),b},get:function(a){if(k]*)?>/i,g=/^(on[a-z]+|formaction)$/;this.directive=function k(a,e){za(a,"directive");C(a)?(Bb(e,"directiveFactory"),c.hasOwnProperty(a)||(c[a]=[],b.factory(a+ +d,["$injector","$exceptionHandler",function(b,d){var e=[];r(c[a],function(c,f){try{var g=b.invoke(c);F(g)?g={compile:Y(g)}:!g.compile&&g.link&&(g.compile=Y(g.link));g.priority=g.priority||0;g.index=f;g.name=g.name||a;g.require=g.require||g.controller&&g.name;g.restrict=g.restrict||"A";e.push(g)}catch(h){d(h)}});return e}])),c[a].push(e)):r(a,Ub(k));return this};this.aHrefSanitizationWhitelist=function(b){return w(b)?(a.aHrefSanitizationWhitelist(b),this):a.aHrefSanitizationWhitelist()};this.imgSrcSanitizationWhitelist= +function(b){return w(b)?(a.imgSrcSanitizationWhitelist(b),this):a.imgSrcSanitizationWhitelist()};this.$get=["$injector","$interpolate","$exceptionHandler","$http","$templateCache","$parse","$controller","$rootScope","$document","$sce","$animate","$$sanitizeUri",function(a,b,n,q,p,u,I,D,y,H,J,x){function ca(a,b,c,d,e){a instanceof v||(a=v(a));r(a,function(b,c){3==b.nodeType&&b.nodeValue.match(/\S+/)&&(a[c]=v(b).wrap("").parent()[0])});var f=N(a,b,a,c,d,e);S(a,"ng-scope");return function(b, +c,d){Bb(b,"scope");var e=c?Ia.clone.call(a):a;r(d,function(a,b){e.data("$"+b+"Controller",a)});d=0;for(var g=e.length;darguments.length&&(b=a,a=s);Ka&&(c=da);return p(a,b,c)}var x,ba,y,B,ca,K,da={},w;x=c===f?d:Xb(d,new Jb(v(f),d.$attr));ba=x.$$element;if(N){var xe=/^\s*([@=&])(\??)\s*(\w*)\s*$/;g=v(f);K=e.$new(!0);Z&&Z===N.$$originalDirective?g.data("$isolateScope",K):g.data("$isolateScopeNoTemplate",K);S(g,"ng-isolate-scope");r(N.scope,function(a,c){var d=a.match(xe)||[],f=d[3]||c,g="?"==d[2],d=d[1], +h,k,n,p;K.$$isolateBindings[c]=d+f;switch(d){case "@":x.$observe(f,function(a){K[c]=a});x.$$observers[f].$$scope=e;x[f]&&(K[c]=b(x[f])(e));break;case "=":if(g&&!x[f])break;k=u(x[f]);p=k.literal?wa:function(a,b){return a===b};n=k.assign||function(){h=K[c]=k(e);throw ia("nonassign",x[f],N.name);};h=K[c]=k(e);K.$watch(function(){var a=k(e);p(a,K[c])||(p(a,h)?n(e,a=K[c]):K[c]=a);return h=a},null,k.literal);break;case "&":k=u(x[f]);K[c]=function(a){return k(e,a)};break;default:throw ia("iscp",N.name,c, +a);}})}w=p&&q;J&&r(J,function(a){var b={$scope:a===N||a.$$isolateScope?K:e,$element:ba,$attrs:x,$transclude:w},c;ca=a.controller;"@"==ca&&(ca=x[a.name]);c=I(ca,b);da[a.name]=c;Ka||ba.data("$"+a.name+"Controller",c);a.controllerAs&&(b.$scope[a.controllerAs]=c)});g=0;for(y=h.length;gG.priority)break;if(t=G.scope)y=y||G,G.templateUrl||(R("new/isolated scope",N,G,L),W(t)&&(N=G));ha=G.name;!G.templateUrl&&G.controller&& +(t=G.controller,J=J||{},R("'"+ha+"' controller",J[ha],G,L),J[ha]=G);if(t=G.transclude)Xa=!0,G.$$tlb||(R("transclusion",w,G,L),w=G),"element"==t?(Ka=!0,x=G.priority,t=B(c,T,V),L=d.$$element=v(U.createComment(" "+ha+": "+d[ha]+" ")),c=L[0],ob(f,v(xa.call(t,0)),c),A=ca(t,e,x,g&&g.name,{nonTlbTranscludeDirective:w})):(t=v(Hb(c)).contents(),L.empty(),A=ca(t,e));if(G.template)if(R("template",Z,G,L),Z=G,t=F(G.template)?G.template(L,d):G.template,t=tc(t),G.replace){g=G;t=E(t);c=t[0];if(1!=t.length||1!==c.nodeType)throw ia("tplrt", +ha,"");ob(f,L,c);Q={$attr:{}};t=da(c,[],Q);var X=a.splice(ma+1,a.length-(ma+1));N&&nb(t);a=a.concat(t).concat(X);z(d,Q);Q=a.length}else L.html(t);if(G.templateUrl)R("template",Z,G,L),Z=G,G.replace&&(g=G),H=P(a.splice(ma,a.length-ma),L,d,f,A,h,k,{controllerDirectives:J,newIsolateScopeDirective:N,templateDirective:Z,nonTlbTranscludeDirective:w}),Q=a.length;else if(G.compile)try{O=G.compile(L,d,A),F(O)?q(null,O,T,V):O&&q(O.pre,O.post,T,V)}catch(Y){n(Y,ga(L))}G.terminal&&(H.terminal=!0,x=Math.max(x,G.priority))}H.scope= +y&&!0===y.scope;H.transclude=Xa&&A;p.hasElementTranscludeDirective=Ka;return H}function nb(a){for(var b=0,c=a.length;bq.priority)&&-1!=q.restrict.indexOf(f)&&(l&&(q=Wb(q,{$$start:l,$$end:p})),b.push(q),h=q)}catch(x){n(x)}}return h}function z(a,b){var c=b.$attr,d=a.$attr,e=a.$$element;r(a,function(d,e){"$"!=e.charAt(0)&& +(b[e]&&(d+=("style"===e?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});r(b,function(b,f){"class"==f?(S(e,b),a["class"]=(a["class"]?a["class"]+" ":"")+b):"style"==f?(e.attr("style",e.attr("style")+";"+b),a.style=(a.style?a.style+";":"")+b):"$"==f.charAt(0)||a.hasOwnProperty(f)||(a[f]=b,d[f]=c[f])})}function E(a){var b;a=aa(a);if(b=h.exec(a)){b=b[1].toLowerCase();a=v(""+a+"
");if(/(thead|tbody|tfoot)/.test(b))return a.children(b);a=a.children("tbody");return"tr"===b?a.children("tr"):a.children("tr").contents()}return v("
"+ +a+"
").contents()}function P(a,b,c,d,e,f,g,h){var k=[],l,n,u=b[0],I=a.shift(),x=t({},I,{templateUrl:null,transclude:null,replace:null,$$originalDirective:I}),D=F(I.templateUrl)?I.templateUrl(b,c):I.templateUrl;b.empty();q.get(H.getTrustedResourceUrl(D),{cache:p}).success(function(p){var q,H;p=tc(p);if(I.replace){p=E(p);q=p[0];if(1!=p.length||1!==q.nodeType)throw ia("tplrt",I.name,D);p={$attr:{}};ob(d,b,q);var y=da(q,[],p);W(I.scope)&&nb(y);a=y.concat(a);z(c,p)}else q=u,b.html(p);a.unshift(x); +l=Xa(a,q,c,e,b,I,f,g,h);r(d,function(a,c){a==q&&(d[c]=b[0])});for(n=N(b[0].childNodes,e);k.length;){p=k.shift();H=k.shift();var B=k.shift(),J=k.shift(),y=b[0];if(H!==u){var K=H.className;h.hasElementTranscludeDirective&&I.replace||(y=Hb(q));ob(B,v(H),y);S(v(y),K)}H=l.transclude?Z(p,l.transclude):J;l(n,p,y,d,H)}k=null}).error(function(a,b,c,d){throw ia("tpload",d.url);});return function(a,b,c,d,e){k?(k.push(b),k.push(c),k.push(d),k.push(e)):l(n,b,c,d,e)}}function A(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={method:"get",transformRequest:e.transformRequest,transformResponse:e.transformResponse},f=function(a){function b(a){var c; +r(a,function(b,d){F(b)&&(c=b(),null!=c?a[d]=c:delete a[d])})}var c=e.headers,d=t({},a.headers),f,g,c=t({},c.common,c[P(a.method)]);b(c);b(d);a:for(f in c){a=P(f);for(g in d)if(P(g)===a)continue a;d[f]=c[f]}return d}(a);t(d,a);d.headers=f;d.method=Ea(d.method);(a=Kb(d.url)?b.cookies()[d.xsrfCookieName||e.xsrfCookieName]:s)&&(f[d.xsrfHeaderName||e.xsrfHeaderName]=a);var g=[function(a){f=a.headers;var b=xc(a.data,wc(f),a.transformRequest);E(a.data)&&r(f,function(a,b){"content-type"===P(b)&&delete f[b]}); +E(a.withCredentials)&&!E(e.withCredentials)&&(a.withCredentials=e.withCredentials);return u(a,b,f).then(c,c)},s],h=n.when(d);for(r(y,function(a){(a.request||a.requestError)&&g.unshift(a.request,a.requestError);(a.response||a.responseError)&&g.push(a.response,a.responseError)});g.length;){a=g.shift();var k=g.shift(),h=h.then(a,k)}h.success=function(a){h.then(function(b){a(b.data,b.status,b.headers,d)});return h};h.error=function(a){h.then(null,function(b){a(b.data,b.status,b.headers,d)});return h}; +return h}function u(b,c,f){function h(a,b,c,e){y&&(200<=a&&300>a?y.put(s,[a,b,vc(c),e]):y.remove(s));k(b,a,c,e);d.$$phase||d.$apply()}function k(a,c,d,e){c=Math.max(c,0);(200<=c&&300>c?q.resolve:q.reject)({data:a,status:c,headers:wc(d),config:b,statusText:e})}function m(){var a=fb(p.pendingRequests,b);-1!==a&&p.pendingRequests.splice(a,1)}var q=n.defer(),u=q.promise,y,r,s=I(b.url,b.params);p.pendingRequests.push(b);u.then(m,m);(b.cache||e.cache)&&(!1!==b.cache&&"GET"==b.method)&&(y=W(b.cache)?b.cache: +W(e.cache)?e.cache:D);if(y)if(r=y.get(s),w(r)){if(r.then)return r.then(m,m),r;M(r)?k(r[1],r[0],$(r[2]),r[3]):k(r,200,{},"OK")}else y.put(s,u);E(r)&&a(b.method,s,c,h,f,b.timeout,b.withCredentials,b.responseType);return u}function I(a,b){if(!b)return a;var c=[];Zc(b,function(a,b){null===a||E(a)||(M(a)||(a=[a]),r(a,function(a){W(a)&&(a=qa(a));c.push(ya(b)+"="+ya(a))}))});0=V&&(!b.match(/^(get|post|head|put|delete|options)$/i)|| +!R.XMLHttpRequest))return new R.ActiveXObject("Microsoft.XMLHTTP");if(R.XMLHttpRequest)return new R.XMLHttpRequest;throw A("$httpBackend")("noxhr");}function ae(){this.$get=["$browser","$window","$document",function(b,a,c){return Ae(b,ze,b.defer,a.angular.callbacks,c[0])}]}function Ae(b,a,c,d,e){function f(a,b,c){var f=e.createElement("script"),h=null;f.type="text/javascript";f.src=a;f.async=!0;h=function(a){Ta(f,"load",h);Ta(f,"error",h);e.body.removeChild(f);f=null;var g=-1,u="unknown";a&&("load"!== +a.type||d[b].called||(a={type:"error"}),u=a.type,g="error"===a.type?404:200);c&&c(g,u)};pb(f,"load",h);pb(f,"error",h);e.body.appendChild(f);return h}var h=-1;return function(e,m,k,l,n,q,p,u){function I(){y=h;J&&J();x&&x.abort()}function D(a,d,e,f,g){S&&c.cancel(S);J=x=null;0===d&&(d=e?200:"file"==ra(m).protocol?404:0);a(1223===d?204:d,e,f,g||"");b.$$completeOutstandingRequest(z)}var y;b.$$incOutstandingRequestCount();m=m||b.url();if("jsonp"==P(e)){var H="_"+(d.counter++).toString(36);d[H]=function(a){d[H].data= +a;d[H].called=!0};var J=f(m.replace("JSON_CALLBACK","angular.callbacks."+H),H,function(a,b){D(l,a,d[H].data,"",b);d[H]=z})}else{var x=a(e);x.open(e,m,!0);r(n,function(a,b){w(a)&&x.setRequestHeader(b,a)});x.onreadystatechange=function(){if(x&&4==x.readyState){var a=null,b=null;y!==h&&(a=x.getAllResponseHeaders(),b="response"in x?x.response:x.responseText);D(l,y||x.status,b,a,x.statusText||"")}};p&&(x.withCredentials=!0);if(u)try{x.responseType=u}catch(s){if("json"!==u)throw s;}x.send(k||null)}if(0< +q)var S=c(I,q);else q&&q.then&&q.then(I)}}function Yd(){var b="{{",a="}}";this.startSymbol=function(a){return a?(b=a,this):b};this.endSymbol=function(b){return b?(a=b,this):a};this.$get=["$parse","$exceptionHandler","$sce",function(c,d,e){function f(f,k,l){for(var n,q,p=0,u=[],I=f.length,D=!1,y=[];p=g&&(n.resolve(p),l(q.$$intervalId),delete e[q.$$intervalId]);u||b.$apply()},h);e[q.$$intervalId]=n;return q}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 hd(){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 zc(b){b=b.split("/");for(var a=b.length;a--;)b[a]=Ab(b[a]);return b.join("/")}function Ac(b,a,c){b=ra(b,c);a.$$protocol=b.protocol;a.$$host=b.hostname;a.$$port=Q(b.port)||Be[b.protocol]||null} +function Bc(b,a,c){var d="/"!==b.charAt(0);d&&(b="/"+b);b=ra(b,c);a.$$path=decodeURIComponent(d&&"/"===b.pathname.charAt(0)?b.pathname.substring(1):b.pathname);a.$$search=ac(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 Ya(b){var a=b.indexOf("#");return-1==a?b:b.substr(0,a)}function Lb(b){return b.substr(0,Ya(b).lastIndexOf("/")+1)}function Cc(b,a){this.$$html5=!0;a=a|| +"";var c=Lb(b);Ac(b,this,b);this.$$parse=function(a){var e=na(c,a);if(!C(e))throw Mb("ipthprfx",a,c);Bc(e,this,b);this.$$path||(this.$$path="/");this.$$compose()};this.$$compose=function(){var a=bc(this.$$search),b=this.$$hash?"#"+Ab(this.$$hash):"";this.$$url=zc(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 Nb(b,a){var c= +Lb(b);Ac(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(!C(e))throw Mb("ihshprfx",d,a);Bc(e,this,b);d=this.$$path;var f=/^\/?.*?:(\/.*)/;0===e.indexOf(b)&&(e=e.replace(b,""));f.exec(e)||(d=(e=f.exec(d))?e[1]:d);this.$$path=d;this.$$compose()};this.$$compose=function(){var c=bc(this.$$search),e=this.$$hash?"#"+Ab(this.$$hash):"";this.$$url=zc(this.$$path)+(c?"?"+c:"")+e;this.$$absUrl=b+(this.$$url?a+this.$$url:"")};this.$$rewrite=function(a){if(Ya(b)== +Ya(a))return a}}function Dc(b,a){this.$$html5=!0;Nb.apply(this,arguments);var c=Lb(b);this.$$rewrite=function(d){var e;if(b==Ya(d))return d;if(e=na(c,d))return b+a+e;if(c===d+"/")return c}}function qb(b){return function(){return this[b]}}function Ec(b,a){return function(c){if(E(c))return this[b];this[b]=a(c);this.$$compose();return this}}function be(){var b="",a=!1;this.hashPrefix=function(a){return w(a)?(b=a,this):b};this.html5Mode=function(b){return w(b)?(a=b,this):a};this.$get=["$rootScope","$browser", +"$sniffer","$rootElement",function(c,d,e,f){function h(a){c.$broadcast("$locationChangeSuccess",g.absUrl(),a)}var g,m=d.baseHref(),k=d.url();a?(m=k.substring(0,k.indexOf("/",k.indexOf("//")+2))+(m||"/"),e=e.history?Cc:Dc):(m=Ya(k),e=Nb);g=new e(m,"#"+b);g.$$parse(g.$$rewrite(k));f.on("click",function(a){if(!a.ctrlKey&&!a.metaKey&&2!=a.which){for(var b=v(a.target);"a"!==P(b[0].nodeName);)if(b[0]===f[0]||!(b=b.parent())[0])return;var e=b.prop("href");W(e)&&"[object SVGAnimatedString]"===e.toString()&& +(e=ra(e.animVal).href);var h=g.$$rewrite(e);e&&(!b.attr("target")&&h&&!a.isDefaultPrevented())&&(a.preventDefault(),h!=d.url()&&(g.$$parse(h),c.$apply(),R.angular["ff-684208-preventDefault"]=!0))}});g.absUrl()!=k&&d.url(g.absUrl(),!0);d.onUrlChange(function(a){g.absUrl()!=a&&(c.$evalAsync(function(){var b=g.absUrl();g.$$parse(a);c.$broadcast("$locationChangeStart",a,b).defaultPrevented?(g.$$parse(b),d.url(b)):h(b)}),c.$$phase||c.$digest())});var l=0;c.$watch(function(){var a=d.url(),b=g.$$replace; +l&&a==g.absUrl()||(l++,c.$evalAsync(function(){c.$broadcast("$locationChangeStart",g.absUrl(),a).defaultPrevented?g.$$parse(a):(d.url(g.absUrl(),b),h(a))}));g.$$replace=!1;return l});return g}]}function ce(){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||z;a=!1;try{a=!!e.apply}catch(m){}return a?function(){var a=[];r(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 ea(b,a){if("constructor"===b)throw Aa("isecfld",a);return b}function Za(b,a){if(b){if(b.constructor===b)throw Aa("isecfn",a);if(b.document&& +b.location&&b.alert&&b.setInterval)throw Aa("isecwindow",a);if(b.children&&(b.nodeName||b.prop&&b.attr&&b.find))throw Aa("isecdom",a);}return b}function rb(b,a,c,d,e){e=e||{};a=a.split(".");for(var f,h=0;1e?Fc(d[0],d[1],d[2],d[3],d[4],c,a):function(b,f){var g=0,h;do h=Fc(d[g++],d[g++],d[g++],d[g++],d[g++],c,a)(b,f),f=s,b=h;while(ga)for(b in k++,e)e.hasOwnProperty(b)&&!d.hasOwnProperty(b)&&(r--,delete e[b])}else e!==d&&(e=d,k++);return k},function(){q?(q=!1,b(d,d,c)):b(d,g,c);if(h)if(W(d))if(cb(d)){g=Array(d.length);for(var a=0;as&&(w=4-s,N[w]||(N[w]=[]),t=F(d.exp)?"fn: "+(d.exp.name||d.exp.toString()):d.exp,t+="; newVal: "+qa(f)+"; oldVal: "+qa(g),N[w].push(t));else if(d===c){x=!1;break a}}catch(C){q.$$phase=null,e(C)}if(!(h=S.$$childHead||S!==this&& +S.$$nextSibling))for(;S!==this&&!(h=S.$$nextSibling);)S=S.$parent}while(S=h);if((x||k.length)&&!s--)throw q.$$phase=null,a("infdig",b,qa(N));}while(x||k.length);for(q.$$phase=null;l.length;)try{l.shift()()}catch(z){e(z)}},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy");this.$$destroyed=!0;if(this!==q){r(this.$$listenerCount,gb(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);for(var b in this)Qb.call(this,b)&&(this[b]=null);this.$$destroyed=!0}}},$eval:function(a,b){return f(a)(this,b)},$evalAsync:function(a){q.$$phase||q.$$asyncQueue.length||h.defer(function(){q.$$asyncQueue.length&&q.$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{q.$$phase=null;try{q.$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[fb(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(xa.call(arguments,1)),l,m;do{d=f.$$listeners[a]||c;h.currentScope=f;l=0;for(m=d.length;lc.msieDocumentMode)throw ta("iequirks");var e=$(fa);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=Ca);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 f=e.parseAs,h=e.getTrusted,g=e.trustAs;r(fa,function(a,b){var c=P(b);e[Sa("parse_as_"+c)]=function(b){return f(a,b)};e[Sa("get_trusted_"+c)]=function(b){return h(a, +b)};e[Sa("trust_as_"+c)]=function(b){return g(a,b)}});return e}]}function ie(){this.$get=["$window","$document",function(b,a){var c={},d=Q((/android (\d+)/.exec(P((b.navigator||{}).userAgent))||[])[1]),e=/Boxee/i.test((b.navigator||{}).userAgent),f=a[0]||{},h=f.documentMode,g,m=/^(Moz|webkit|O|ms)(?=[A-Z])/,k=f.body&&f.body.style,l=!1,n=!1;if(k){for(var q in k)if(l=m.exec(q)){g=l[0];g=g.substr(0,1).toUpperCase()+g.substr(1);break}g||(g="WebkitOpacity"in k&&"webkit");l=!!("transition"in k||g+"Transition"in +k);n=!!("animation"in k||g+"Animation"in k);!d||l&&n||(l=C(f.body.style.webkitTransition),n=C(f.body.style.webkitAnimation))}return{history:!(!b.history||!b.history.pushState||4>d||e),hashchange:"onhashchange"in b&&(!h||7b;b=Math.abs(b);var h=b+"",g="",m=[],k=!1;if(-1!==h.indexOf("e")){var l=h.match(/([\d\.]+)e(-?)(\d+)/);l&&"-"==l[2]&&l[3]>e+1?h="0":(g=h,k=!0)}if(k)0b)&&(g=b.toFixed(e));else{h=(h.split(Pc)[1]||"").length;E(e)&&(e=Math.min(Math.max(a.minFrac,h),a.maxFrac));h=Math.pow(10,e);b=Math.round(b*h)/h;b=(""+b).split(Pc);h=b[0];b=b[1]||"";var l=0,n=a.lgSize,q=a.gSize;if(h.length>=n+q)for(l=h.length- +n,k=0;kb&&(d="-",b=-b);for(b=""+b;b.length-c)e+=c;0===e&&-12==c&&(e=12);return sb(e,a,d)}} +function tb(b,a){return function(c,d){var e=c["get"+b](),f=Ea(a?"SHORT"+b:b);return d[f][e]}}function Qc(b){var a=(new Date(b,0,1)).getDay();return new Date(b,0,(4>=a?5:12)-a)}function Rc(b){return function(a){var c=Qc(a.getFullYear());a=+new Date(a.getFullYear(),a.getMonth(),a.getDate()+(4-a.getDay()))-+c;a=1+Math.round(a/6048E5);return sb(a,b)}}function Lc(b){function a(a){var b;if(b=a.match(c)){a=new Date(0);var f=0,h=0,g=b[8]?a.setUTCFullYear:a.setFullYear,m=b[8]?a.setUTCHours:a.setHours;b[9]&& +(f=Q(b[9]+b[10]),h=Q(b[9]+b[11]));g.call(a,Q(b[1]),Q(b[2])-1,Q(b[3]));f=Q(b[4]||0)-f;h=Q(b[5]||0)-h;g=Q(b[6]||0);b=Math.round(1E3*parseFloat("0."+(b[7]||0)));m.call(a,f,h,g,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 f="",h=[],g,m;e=e||"mediumDate";e=b.DATETIME_FORMATS[e]||e;C(c)&&(c=Le.test(c)?Q(c):a(c));zb(c)&&(c=new Date(c));if(!pa(c))return c;for(;e;)(m=Me.exec(e))?(h=h.concat(xa.call(m,1)),e= +h.pop()):(h.push(e),e=null);r(h,function(a){g=Ne[a];f+=g?g(c,b.DATETIME_FORMATS):a.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return f}}function He(){return function(b){return qa(b,!0)}}function Ie(){return function(b,a){if(!M(b)&&!C(b))return b;a=Q(a);if(C(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)||l()});if(e.hasEvent("paste"))a.on("paste cut",l)}a.on("change",m);d.$render= +function(){a.val(d.$isEmpty(d.$viewValue)?"":d.$viewValue)};var n=c.ngPattern;n&&((e=n.match(/^\/(.*)\/([gim]*)$/))?(n=RegExp(e[1],e[2]),e=function(a){return oa(d,"pattern",d.$isEmpty(a)||n.test(a),a)}):e=function(c){var e=b.$eval(n);if(!e||!e.test)throw A("ngPattern")("noregexp",n,e,ga(a));return oa(d,"pattern",d.$isEmpty(c)||e.test(c),c)},d.$formatters.push(e),d.$parsers.push(e));if(c.ngMinlength){var q=Q(c.ngMinlength);e=function(a){return oa(d,"minlength",d.$isEmpty(a)||a.length>=q,a)};d.$parsers.push(e); +d.$formatters.push(e)}if(c.ngMaxlength){var p=Q(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 yb(b,a){return function(c){var d;return pa(c)?c:C(c)&&(b.lastIndex=0,c=b.exec(c))?(c.shift(),d={yyyy:0,MM:1,dd:1,HH:0,mm:0},r(c,function(b,c){c=c(h.min);g.$setValidity("min",b);return b?a:s},g.$parsers.push(e),g.$formatters.push(e));h.max&&(e=function(a){var b=g.$isEmpty(a)||c(a)<=c(h.max);g.$setValidity("max",b);return b?a:s},g.$parsers.push(e),g.$formatters.push(e))}}function Rb(b,a){b="ngClass"+b;return function(){return{restrict:"AC",link:function(c, +d,e){function f(b){if(!0===a||c.$index%2===a){var d=h(b||"");g?wa(b,g)||e.$updateClass(d,h(g)):e.$addClass(d)}g=$(b)}function h(a){if(M(a))return a.join(" ");if(W(a)){var b=[];r(a,function(a,c){a&&b.push(c)});return b.join(" ")}return a}var g;c.$watch(e[b],f,!0);e.$observe("class",function(a){f(c.$eval(e[b]))});"ngClass"!==b&&c.$watch("$index",function(d,f){var g=d&1;if(g!==f&1){var n=h(c.$eval(e[b]));g===a?e.$addClass(n):e.$removeClass(n)}})}}}}var P=function(b){return C(b)?b.toLowerCase():b},Qb= +Object.prototype.hasOwnProperty,Ea=function(b){return C(b)?b.toUpperCase():b},V,v,Fa,xa=[].slice,Pe=[].push,va=Object.prototype.toString,Na=A("ng"),Pa=R.angular||(R.angular={}),Ra,Ja,ja=["0","0","0"];V=Q((/msie (\d+)/.exec(P(navigator.userAgent))||[])[1]);isNaN(V)&&(V=Q((/trident\/.*; rv:(\d+)/.exec(P(navigator.userAgent))||[])[1]));z.$inject=[];Ca.$inject=[];var aa=function(){return String.prototype.trim?function(b){return C(b)?b.trim():b}:function(b){return C(b)?b.replace(/^\s\s*/,"").replace(/\s\s*$/, +""):b}}();Ja=9>V?function(b){b=b.nodeName?b:b[0];return b.scopeName&&"HTML"!=b.scopeName?Ea(b.scopeName+":"+b.nodeName):b.nodeName}:function(b){return b.nodeName?b.nodeName:b[0].nodeName};var dd=/[A-Z]/g,gd={full:"1.3.0-beta.4",major:1,minor:3,dot:0,codeName:"inconspicuous-deception"},Ua=O.cache={},ib=O.expando="ng-"+(new Date).getTime(),qe=1,pb=R.document.addEventListener?function(b,a,c){b.addEventListener(a,c,!1)}:function(b,a,c){b.attachEvent("on"+a,c)},Ta=R.document.removeEventListener?function(b, +a,c){b.removeEventListener(a,c,!1)}:function(b,a,c){b.detachEvent("on"+a,c)};O._data=function(b){return this.cache[b[this.expando]]||{}};var oe=/([\:\-\_]+(.))/g,pe=/^moz([A-Z])/,Fb=A("jqLite"),Ia=O.prototype={ready:function(b){function a(){c||(c=!0,b())}var c=!1;"complete"===U.readyState?setTimeout(a):(this.on("DOMContentLoaded",a),O(R).on("load",a))},toString:function(){var b=[];r(this,function(a){b.push(""+a)});return"["+b.join(", ")+"]"},eq:function(b){return 0<=b?v(this[b]):v(this[this.length+ +b])},length:0,push:Pe,sort:[].sort,splice:[].splice},mb={};r("multiple selected checked disabled readOnly required open".split(" "),function(b){mb[P(b)]=b});var qc={};r("input select option textarea button form details".split(" "),function(b){qc[Ea(b)]=!0});r({data:mc,inheritedData:lb,scope:function(b){return v(b).data("$scope")||lb(b.parentNode||b,["$isolateScope","$scope"])},isolateScope:function(b){return v(b).data("$isolateScope")||v(b).data("$isolateScopeNoTemplate")},controller:nc,injector:function(b){return lb(b, +"$injector")},removeAttr:function(b,a){b.removeAttribute(a)},hasClass:Ib,css:function(b,a,c){a=Sa(a);if(w(c))b.style[a]=c;else{var d;8>=V&&(d=b.currentStyle&&b.currentStyle[a],""===d&&(d="auto"));d=d||b.style[a];8>=V&&(d=""===d?s:d);return d}},attr:function(b,a,c){var d=P(a);if(mb[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)||z).specified?d:s;else if(w(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(w(c))b[a]=c;else return b[a]},text:function(){function b(b,d){var e=a[b.nodeType];if(E(d))return e?b[e]:"";b[e]=d}var a=[];9>V?(a[1]="innerText",a[3]="nodeValue"):a[1]=a[3]="textContent";b.$dv="";return b}(),val:function(b,a){if(E(a)){if("SELECT"===Ja(b)&&b.multiple){var c=[];r(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(E(a))return b.innerHTML;for(var c=0,d=b.childNodes;c< +d.length;c++)Ga(d[c]);b.innerHTML=a},empty:oc},function(b,a){O.prototype[a]=function(a,d){var e,f;if(b!==oc&&(2==b.length&&b!==Ib&&b!==nc?a:d)===s){if(W(a)){for(e=0;e":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)}},Se={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},Pb=function(a){this.options=a};Pb.prototype={constructor:Pb,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=w(c)?"s "+c+"-"+this.index+" ["+this.text.substring(c,d)+"]":" "+d;throw Aa("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($a.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=Gc(d,this.options,this.text);return t(function(c,d,g){return e(g||a(c,d))},{assign:function(e,h,g){return rb(a(e,g),d,h,c.text,c.options)}})},objectIndex:function(a){var c= +this,d=this.expression();this.consume("]");return t(function(e,f){var h=a(e,f),g=d(e,f),m;if(!h)return s;(h=Za(h[g],c.text))&&(h.then&&c.options.unwrapPromises)&&(m=h,"$$v"in h||(m.$$v=s,m.then(function(a){m.$$v=a})),h=h.$$v);return h},{assign:function(e,f,h){var g=d(e,h);return Za(a(e,h),c.text)[g]=f}})},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(f,h){for(var g=[],m=c?c(f,h): +f,k=0;ka.getHours()?c.AMPMS[0]:c.AMPMS[1]},Z:function(a){a=-1*a.getTimezoneOffset();return a=(0<=a?"+":"")+(sb(Math[0< +a?"floor":"ceil"](a/60),2)+sb(Math.abs(a%60),2))},ww:Rc(2),w:Rc(1)},Me=/((?:[^yMdHhmsaZEw']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|w+))(.*)/,Le=/^\-?\d+$/;Lc.$inject=["$locale"];var Je=Y(P),Ke=Y(Ea);Nc.$inject=["$parse"];var jd=Y({restrict:"E",compile:function(a,c){8>=V&&(c.href||c.name||c.$set("href",""),a.append(U.createComment("IE fix")));if(!c.href&&!c.xlinkHref&&!c.name)return function(a,c){var f="[object SVGAnimatedString]"===va.call(c.prop("href"))?"xlink:href":"href";c.on("click", +function(a){c.attr(f)||a.preventDefault()})}}}),Db={};r(mb,function(a,c){if("multiple"!=a){var d=la("ng-"+c);Db[d]=function(){return{priority:100,link:function(a,f,h){a.$watch(h[d],function(a){h.$set(c,!!a)})}}}}});r(["src","srcset","href"],function(a){var c=la("ng-"+a);Db[c]=function(){return{priority:99,link:function(d,e,f){var h=a,g=a;"href"===a&&"[object SVGAnimatedString]"===va.call(e.prop("href"))&&(g="xlinkHref",f.$attr[g]="xlink:href",h=null);f.$observe(c,function(a){a&&(f.$set(g,a),V&&h&& +e.prop(h,f[g]))})}}}});var wb={$addControl:z,$removeControl:z,$setValidity:z,$setDirty:z,$setPristine:z};Sc.$inject=["$element","$attrs","$scope","$animate"];var Tc=function(a){return["$timeout",function(c){return{name:"form",restrict:a?"EAC":"E",controller:Sc,compile:function(){return{pre:function(a,e,f,h){if(!f.action){var g=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1};pb(e[0],"submit",g);e.on("$destroy",function(){c(function(){Ta(e[0],"submit",g)},0,!1)})}var m=e.parent().controller("form"), +k=f.name||f.ngForm;k&&rb(a,k,h,k);if(m)e.on("$destroy",function(){m.$removeControl(h);k&&rb(a,k,s,k);t(h,wb)})}}}}}]},kd=Tc(),xd=Tc(!0),Te=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,Ue=/^[a-z0-9!#$%&'*+/=?^_`{|}~.-]+@[a-z0-9-]+(\.[a-z0-9-]+)*$/i,Ve=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,Uc=/^(\d{4})-(\d{2})-(\d{2})$/,Vc=/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)$/,Sb=/^(\d{4})-W(\d\d)$/,Wc=/^(\d{4})-(\d\d)$/,Xc=/^(\d\d):(\d\d)$/,Yc={text:ab,date:bb("date",Uc,yb(Uc, +["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":bb("datetimelocal",Vc,yb(Vc,["yyyy","MM","dd","HH","mm"]),"yyyy-MM-ddTHH:mm"),time:bb("time",Xc,yb(Xc,["HH","mm"]),"HH:mm"),week:bb("week",Sb,function(a){if(pa(a))return a;if(C(a)){Sb.lastIndex=0;var c=Sb.exec(a);if(c){a=+c[1];var d=+c[2],c=Qc(a),d=7*(d-1);return new Date(a,0,c.getDate()+d)}}return NaN},"yyyy-Www"),month:bb("month",Wc,yb(Wc,["yyyy","MM"]),"yyyy-MM"),number:function(a,c,d,e,f,h){ab(a,c,d,e,f,h);e.$parsers.push(function(a){var c=e.$isEmpty(a); +if(c||Ve.test(a))return e.$setValidity("number",!0),""===a?null:c?a:parseFloat(a);e.$setValidity("number",!1);return s});Oe(e,"number",c);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)||zb(a),a)})},url:function(a,c,d,e,f,h){ab(a,c,d,e,f,h);a=function(a){return oa(e,"url",e.$isEmpty(a)||Te.test(a),a)};e.$formatters.push(a);e.$parsers.push(a)},email:function(a,c,d,e,f,h){ab(a,c,d,e,f,h);a=function(a){return oa(e,"email",e.$isEmpty(a)||Ue.test(a),a)};e.$formatters.push(a);e.$parsers.push(a)},radio:function(a,c,d,e){E(d.name)&&c.attr("name",db());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 f=d.ngTrueValue,h=d.ngFalseValue;C(f)||(f=!0);C(h)||(h=!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!==f};e.$formatters.push(function(a){return a===f});e.$parsers.push(function(a){return a?f:h})},hidden:z,button:z,submit:z,reset:z,file:z},gc=["$browser","$sniffer","$filter",function(a,c,d){return{restrict:"E", +require:"?ngModel",link:function(e,f,h,g){g&&(Yc[P(h.type)]||Yc.text)(e,f,h,g,c,a,d)}}}],vb="ng-valid",ub="ng-invalid",La="ng-pristine",xb="ng-dirty",We=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate",function(a,c,d,e,f,h){function g(a,c){c=c?"-"+hb(c,"-"):"";h.removeClass(e,(a?ub:vb)+c);h.addClass(e,(a?vb:ub)+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 m=f(d.ngModel),k=m.assign;if(!k)throw A("ngModel")("nonassign",d.ngModel,ga(e));this.$render=z;this.$isEmpty=function(a){return E(a)||""===a||null===a||a!==a};var l=e.inheritedData("$formController")||wb,n=0,q=this.$error={};e.addClass(La);g(!0);this.$setValidity=function(a,c){q[a]!==!c&&(c?(q[a]&&n--,n||(g(!0),this.$valid=!0,this.$invalid=!1)):(g(!1),this.$invalid=!0,this.$valid=!1,n++),q[a]=!c,g(c,a),l.$setValidity(a,c,this))};this.$setPristine=function(){this.$dirty=!1; +this.$pristine=!0;h.removeClass(e,xb);h.addClass(e,La)};this.$setViewValue=function(d){this.$viewValue=d;this.$pristine&&(this.$dirty=!0,this.$pristine=!1,h.removeClass(e,La),h.addClass(e,xb),l.$setDirty());r(this.$parsers,function(a){d=a(d)});this.$modelValue!==d&&(this.$modelValue=d,k(a,d),r(this.$viewChangeListeners,function(a){try{a()}catch(d){c(d)}}))};var p=this;a.$watch(function(){var c=m(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})}],Md=function(){return{require:["ngModel","^?form"],controller:We,link:function(a,c,d,e){var f=e[0],h=e[1]||wb;h.$addControl(f);a.$on("$destroy",function(){h.$removeControl(f)})}}},Od=Y({require:"ngModel",link:function(a,c,d,e){e.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),hc=function(){return{require:"?ngModel",link:function(a,c,d,e){if(e){d.required=!0;var f=function(a){if(d.required&&e.$isEmpty(a))e.$setValidity("required",!1);else return e.$setValidity("required", +!0),a};e.$formatters.push(f);e.$parsers.unshift(f);d.$observe("required",function(){f(e.$viewValue)})}}}},Nd=function(){return{require:"ngModel",link:function(a,c,d,e){var f=(a=/\/(.*)\//.exec(d.ngList))&&RegExp(a[1])||d.ngList||",";e.$parsers.push(function(a){if(!E(a)){var c=[];a&&r(a.split(f),function(a){a&&c.push(aa(a))});return c}});e.$formatters.push(function(a){return M(a)?a.join(", "):s});e.$isEmpty=function(a){return!a||!a.length}}}},Xe=/^(true|false|\d+)$/,Pd=function(){return{priority:100, +compile:function(a,c){return Xe.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)})}}}},pd=ua(function(a,c,d){c.addClass("ng-binding").data("$binding",d.ngBind);a.$watch(d.ngBind,function(a){c.text(a==s?"":a)})}),rd=["$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)})}}],qd=["$sce","$parse", +function(a,c){return function(d,e,f){e.addClass("ng-binding").data("$binding",f.ngBindHtml);var h=c(f.ngBindHtml);d.$watch(function(){return(h(d)||"").toString()},function(c){e.html(a.getTrustedHtml(h(d))||"")})}}],sd=Rb("",!0),ud=Rb("Odd",0),td=Rb("Even",1),vd=ua({compile:function(a,c){c.$set("ngCloak",s);a.removeClass("ng-cloak")}}),wd=[function(){return{scope:!0,controller:"@",priority:500}}],ic={};r("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);ic[c]=["$parse",function(d){return{compile:function(e,f){var h=d(f[c]);return function(c,d,e){d.on(P(a),function(a){c.$apply(function(){h(c,{$event:a})})})}}}}]});var zd=["$animate",function(a){return{transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(c,d,e,f,h){var g,m,k;c.$watch(e.ngIf,function(f){Oa(f)?m||(m=c.$new(),h(m,function(c){c[c.length++]=U.createComment(" end ngIf: "+e.ngIf+" ");g={clone:c};a.enter(c,d.parent(),d)})):(k&&(k.remove(), +k=null),m&&(m.$destroy(),m=null),g&&(k=Cb(g.clone),a.leave(k,function(){k=null}),g=null))})}}}],Ad=["$http","$templateCache","$anchorScroll","$animate","$sce",function(a,c,d,e,f){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:Pa.noop,compile:function(h,g){var m=g.ngInclude||g.src,k=g.onload||"",l=g.autoscroll;return function(g,h,p,r,s){var t=0,y,v,J,x=function(){v&&(v.remove(),v=null);y&&(y.$destroy(),y=null);J&&(e.leave(J,function(){v=null}),v=J,J=null)};g.$watch(f.parseAsResourceUrl(m), +function(f){var m=function(){!w(l)||l&&!g.$eval(l)||d()},p=++t;f?(a.get(f,{cache:c}).success(function(a){if(p===t){var c=g.$new();r.template=a;a=s(c,function(a){x();e.enter(a,null,h,m)});y=c;J=a;y.$emit("$includeContentLoaded");g.$eval(k)}}).error(function(){p===t&&x()}),g.$emit("$includeContentRequested")):(x(),r.template=null)})}}}}],Qd=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(c,d,e,f){d.html(f.template);a(d.contents())(c)}}}],Bd=ua({priority:450, +compile:function(){return{pre:function(a,c,d){a.$eval(d.ngInit)}}}}),Cd=ua({terminal:!0,priority:1E3}),Dd=["$locale","$interpolate",function(a,c){var d=/{}/g;return{restrict:"EA",link:function(e,f,h){var g=h.count,m=h.$attr.when&&f.attr(h.$attr.when),k=h.offset||0,l=e.$eval(m)||{},n={},q=c.startSymbol(),p=c.endSymbol(),s=/^when(Minus)?(.+)$/;r(h,function(a,c){s.test(c)&&(l[P(c.replace("when","").replace("Minus","-"))]=f.attr(h.$attr[c]))});r(l,function(a,e){n[e]=c(a.replace(d,q+g+"-"+k+p))});e.$watch(function(){var c= +parseFloat(e.$eval(g));if(isNaN(c))return"";c in l||(c=a.pluralCat(c-k));return n[c](e,f,!0)},function(a){f.text(a)})}}}],Ed=["$parse","$animate",function(a,c){var d=A("ngRepeat");return{transclude:"element",priority:1E3,terminal:!0,$$tlb:!0,link:function(e,f,h,g,m){var k=h.ngRepeat,l=k.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),n,q,p,s,t,w,y={$id:Ha};if(!l)throw d("iexp",k);h=l[1];g=l[2];(l=l[3])?(n=a(l),q=function(a,c,d){w&&(y[w]=a);y[t]=c;y.$index=d;return n(e, +y)}):(p=function(a,c){return Ha(c)},s=function(a){return a});l=h.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/);if(!l)throw d("iidexp",h);t=l[3]||l[1];w=l[2];var H={};e.$watchCollection(g,function(a){var g,h,l=f[0],n,y={},C,B,K,z,E,L,A=[];if(cb(a))E=a,n=q||p;else{n=q||s;E=[];for(K in a)a.hasOwnProperty(K)&&"$"!=K.charAt(0)&&E.push(K);E.sort()}C=E.length;h=A.length=E.length;for(g=0;gD;)u.pop().element.remove()}for(;A.length> +B;)A.pop()[0].element.remove()}var k;if(!(k=t.match(d)))throw Ye("iexp",t,ga(f));var l=c(k[2]||k[1]),m=k[4]||k[6],n=k[5],q=c(k[3]||""),r=c(k[2]?k[1]:m),x=c(k[7]),v=k[8]?c(k[8]):null,A=[[{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=x(e)||[],d={},h,k,l,q,t,w,u;if(p)for(k=[],q=0,w=A.length;q@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/plugins/scheduler2/static/js/scheduler-helpers.js b/plugins/scheduler2/static/js/scheduler-helpers.js index a455919f..baddd8d6 100755 --- a/plugins/scheduler2/static/js/scheduler-helpers.js +++ b/plugins/scheduler2/static/js/scheduler-helpers.js @@ -22,7 +22,14 @@ function fixOddEvenClasses() { $('#' + rsvrTblNm + ' tbody tr:visible:odd').addClass('odd'); } -function isRightClick(e) { +SlotStatus = { + free: 0, + selected: 1, + reserved: 2, + maintenance: 3, +} + +function schedulerIsRightClick(e) { if (e.which) { return (e.which == 3); } else if (e.button) { @@ -30,3 +37,57 @@ function isRightClick(e) { } return false; } + +function schedulerCloneArray(originalArray) { + var clonedArray = $.map(originalArray, function (obj) { + return $.extend(true, {}, obj); + }); + + return clonedArray; +} + +function schedulerGetSlots(slotSpan) { + if (slotSpan == 0) slotSpan = 10; + var slots = []; + var d = new Date(2014, 1, 1, 0, 0, 0, 0); + var i = 0; + while (d.getDate() == 1) { + var tmpTime = schedulerPadStr(d.getHours()) + ':' + schedulerPadStr(d.getMinutes()); + slots.push({ id: i, time: tmpTime }); + d = schedulerAddMinutes(d, slotSpan); + i++; + } + return slots; +} + +function schedulerGetLeases(slotSpan) { + if (slotSpan == 0) slotSpan = 10; + var slots = []; + var d = new Date(2014, 1, 1, 0, 0, 0, 0); + var i = 0; + while (d.getDate() == 1) { + //var tmpTime = schedulerPadStr(d.getHours()) + schedulerPadStr(d.getMinutes()); + slots.push({ id: i, status: getRandomStatus() }); + d = schedulerAddMinutes(d, slotSpan); + i++; + } + return slots; +} + +function getRandomStatus() { + var randint = Math.floor(Math.random() * (10 - 0 + 1) + 0); + switch (randint) { + case 0: case 1: case 2: case 3: case 4: case 5: case 6: return "free"; + //case 8: return "selected"; + case 7: case 8: case 9: return "reserved"; + case 10: return "maintenance"; + } +} + +function schedulerPadStr(i) { + return (i < 10) ? "0" + i : "" + i; +} + +function schedulerAddMinutes(date, minutes) { + return new Date(date.getTime() + minutes * 60000); +} \ No newline at end of file diff --git a/plugins/scheduler2/static/js/scheduler2.js b/plugins/scheduler2/static/js/scheduler2.js index f8830028..07c81aa7 100755 --- a/plugins/scheduler2/static/js/scheduler2.js +++ b/plugins/scheduler2/static/js/scheduler2.js @@ -27,18 +27,27 @@ */ /* some params */ -var init_start_visible_index = 10; -var init_end_visible_index = 21; -var rsvrTblNm = "scheduler-reservation-table"; -var SchedulerResources = []; -var schdlr_totalColums = 0; -var SetPerFun = null; -var Sched2 = null; -var Debug = true; -var schdlr_PartsInOneHour = 6; +//is ctrl keyboard button pressed +var schedulerCtrlPressed = false; +//table Id +var schedulerTblId = "scheduler-reservation-table"; +var schedulerTblFirstColWidth = 150; +//Some Data +var schedulerSlotsPerHour = 6; +var schedulerMaxRows = 50; +var SchedulerData = []; +var SchedulerSlots = []; +var SchedulerDataViewData = []; +var SchedulerSlotsViewData = []; +var SchedulerTotalCells; +var SchedulerTotalVisibleCells; +//Help Variables +var _schedulerCurrentCellPosition = 0; +//Enable Debug +var schedulerDebug = true; (function ($) { - var Scheduler2 = Plugin.extend({ + var scheduler2 = Plugin.extend({ /** XXX to check * @brief Plugin constructor @@ -52,115 +61,34 @@ var schdlr_PartsInOneHour = 6; // Call the parent constructor, see FAQ when forgotten this._super(options, element); - schdlr_totalColums = $("#scheduler-reservation-table th").length; - + SchedulerSlots = schedulerGetSlots(60/schedulerSlotsPerHour); //selection from table $(window).keydown(function (evt) { if (evt.which == 17) { // ctrl - ctrlPressed = true; + schedulerCtrlPressed = true; } }).keyup(function (evt) { if (evt.which == 17) { // ctrl - ctrlPressed = false; + schedulerCtrlPressed = false; } }); - $("#" + rsvrTblNm).on('mousedown', 'td', rangeMouseDown).on('mouseup', 'td', rangeMouseUp).on('mousemove', 'td', rangeMouseMove); + //$("#" + schedulerTblId).on('mousedown', 'td', rangeMouseDown).on('mouseup', 'td', rangeMouseUp).on('mousemove', 'td', rangeMouseMove); // Explain this will allow query events to be handled // What happens when we don't define some events ? // Some can be less efficient - if (Debug) console.time("Listening_to_queries"); + if (schedulerDebug) console.time("Listening_to_queries"); /* Listening to queries */ this.listen_query(options.query_uuid, 'all_ev'); this.listen_query(options.query_all_resources_uuid, 'all_resources'); this.listen_query(options.query_lease_uuid, 'lease'); //this.listen_query(options.query_lease_uuid, 'lease'); - if (Debug) console.timeEnd("Listening_to_queries"); + if (schedulerDebug) console.timeEnd("Listening_to_queries"); - $("#ShedulerNodes tbody").html(''); }, - /* PLUGIN EVENTS */ - // on_show like in querytable - - - /* GUI EVENTS */ - - // a function to bind events here: click change - // how to raise manifold events - - - /* GUI MANIPULATION */ - - // We advise you to write function to change behaviour of the GUI - // Will use naming helpers to access content _inside_ the plugin - // always refer to these functions in the remaining of the code - - show_hide_button: function () { - // this.id, this.el, this.cl, this.elts - // same output as a jquery selector with some guarantees - }, - - //drawResources: function () { - drawLeases: function () { - - //if (Debug) this.debug('foo'); - if (Debug) console.time("each:SchedulerResources"); - - //scheduler-reservation-table main table columns - totalColums = $("#scheduler-reservation-table thead tr th").length; - //var totalCell = []; - //for (var i = 0; i < totalColums; i++) { totalCell.push(""); } - //var srt_body = []; - var totalCell = ""; - for (var i = 0; i < totalColums; i++) totalCell +=""; - var srt_body = ""; - /* - $.each(SchedulerResources, function (i, group) { - console.log(group.groupName); - //var groupTR = $("#ShedulerNodes tbody").html('
' + group.groupName + '
'); - //var groupTR = $("#ShedulerNodes tbody").html('
' + group.groupName + '
'); - var groupTR = $("#ShedulerNodes tbody").html(''); - - //$.each(group.resources.slice(0,30), function (i, resource) { - $.each(group.resources, function (i, resource) { - if (i == 0) { - //$("#ShedulerNodes tbody tr:first").append('' + resource.hostname + ''); - $(groupTR).find("#schdlr_frstTD").html(resource.urn); - //$(srt_body).html("" + totalCell + ""); - } else { - $(groupTR).find("tr:last").after('' + resource.urn + ''); - //$(srt_body).find("tr:last").after("" + totalCell + ""); - } - srt_body += "" + totalCell + ""; - //srt_body.push(''); srt_body = srt_body.concat(totalCell.concat()); srt_body.push('/'); - }); - }); - */ - srt_body += "" + totalCell + ""; - //$("#scheduler-reservation-table tbody").html(srt_body.join("")); - $("#scheduler-reservation-table tbody").append(srt_body); - - if (Debug) console.timeEnd("each:SchedulerResources"); - - - $("#" + rsvrTblNm + " tbody tr").each(function (index) { $(this).attr("data-trindex", index); }); - - }, - - /* TEMPLATES */ - - // see in the html template - // How to load a template, use of mustache - - /* QUERY HANDLERS */ - loadWithDate: function () { - // only convention, not strictly enforced at the moment - }, - // How to make sure the plugin is not desynchronized - // He should manifest its interest in filters, fields or records - // functions triggered only if the proper listen is done + /* Handlers */ /* all_ev QUERY HANDLERS Start */ on_all_ev_clear_records: function (data) { @@ -188,25 +116,14 @@ var schdlr_PartsInOneHour = 6; //data is empty on load }, on_all_resources_new_record: function (data) { - $("#ShedulerNodes tbody").find("tr:last").after('' + data.urn + ''); - this.drawLeases(); - //console.log(data); - var tmpGroup = lookup(SchedulerResources, 'groupName', data.type); - if (tmpGroup == null) { - tmpGroup = { groupName: data.type, resources: [] }; - SchedulerResources.push(tmpGroup); - //if (data.type != "node") alert('not all node'); - } - tmpGroup.resources.push(data); - //alert('new_record'); + if (SchedulerData.length < schedulerMaxRows) + SchedulerData.push({ name: data.hrn, leases: schedulerGetLeases(schedulerSlotsPerHour), urn: data.urn, type: data.type }); + //alert(data.toSource()); }, on_all_resources_query_done: function (data) { - //this.drawResources(); - //data is empty on load /* GUI setup and event binding */ this._initUI(); - this._SetPeriodInPage(init_start_visible_index, init_end_visible_index); - this.loadWithDate(); + //this.loadWithDate(); }, //another plugin has modified something, that requires you to update your display. on_all_resources_field_state_changed: function (data) { @@ -216,7 +133,7 @@ var schdlr_PartsInOneHour = 6; /* lease QUERY HANDLERS Start */ on_lease_clear_records: function (data) { console.log('clear_records'); }, on_lease_query_in_progress: function (data) { console.log('lease_query_in_progress'); }, - on_lease_new_record: function (data) { console.log('lease_new_record'); }, + on_lease_new_record: function (data) { alert(data.toSource()); console.log('lease_new_record'); }, on_lease_query_done: function (data) { console.log('lease_query_done'); }, //another plugin has modified something, that requires you to update your display. on_lease_field_state_changed: function (data) { console.log('lease_field_state_changed'); }, @@ -233,36 +150,19 @@ var schdlr_PartsInOneHour = 6; /* RECORD HANDLERS */ on_all_new_record: function (record) { - // - alert('on_all_new_record'); + //alert('on_all_new_record'); }, - debug : function (log_txt) { + debug : function (logTxt) { if (typeof window.console != 'undefined') { - console.debug(log_txt); + console.debug(logTxt); } }, /* INTERNAL FUNCTIONS */ _initUI: function () { - if (Debug) console.time("_initUI"); - //fix margins in tables - mtNodesTbl = $("#" + rsvrTblNm + " tr:first").outerHeight() + 6; - mtSchrollCon = $("#nodes").outerWidth(); - $("#nodes").css("margin-top", mtNodesTbl); - $("#reservation-table-scroll-container").css("margin-left", mtSchrollCon); - SetPerFun = this._SetPeriodInPage; - //slider - $("#time-range").slider({ - range: true, - min: 0, - max: 24, - step: 0.5, - values: [init_start_visible_index, init_end_visible_index], - slide: function (event, ui) { - SetPerFun(ui.values[0], ui.values[1]); - } - }); + if (schedulerDebug) console.time("_initUI"); + //init DatePicker Start $("#DateToRes").datepicker({ dateFormat: "yy-mm-dd", minDate: 0, @@ -272,48 +172,59 @@ var schdlr_PartsInOneHour = 6; }).click(function () { $("#ui-datepicker-div").css("z-index", 5); }); - //other stuff - fixOddEvenClasses(); - $("#" + rsvrTblNm + " td:not([class])").addClass("free"); - if (Debug) console.timeEnd("_initUI"); - }, - _SetPeriodInPage: function (start, end) { - if (Debug) console.time("_SetPeriodInPage"); - ClearTableSelection(); - $("#lbltime").html(GetTimeFromInt(start) + " - " + GetTimeFromInt(end)); + //End init DatePicker - var start_visible_index = (start * schdlr_PartsInOneHour) + 1; - var end_visible_index = (end * schdlr_PartsInOneHour); + //init Table + this._FixTable(); + //End init Table - //hide - show - for (i = 0; i < start_visible_index; i++) { - $("#" + rsvrTblNm + " td:nth-child(" + i + "), #" + rsvrTblNm + " th:nth-child(" + i + ")").hide(); - } - for (i = end_visible_index + 1; i <= schdlr_totalColums; i++) { - $("#" + rsvrTblNm + " td:nth-child(" + i + "), #" + rsvrTblNm + " th:nth-child(" + i + ")").hide(); - } - /*$("#" + rsvrTblNm + " td:not([class*='info']), #" + rsvrTblNm + " th:not([class*='fixed'])").hide();*/ - for (i = start_visible_index; i <= end_visible_index; i++) { - $("#" + rsvrTblNm + " td:nth-child(" + i + "), #" + rsvrTblNm + " th:nth-child(" + i + ")").show(); - } + //init Slider + $('#tblSlider').slider({ + min: 0, + max: SchedulerTotalCells - SchedulerTotalVisibleCells - 1, + value: 0, + slide: function (event, ui) { + //$("#amount").val("$" + ui.values[0] + " - $" + ui.values[1]); + //console.log(ui.value); + if (_schedulerCurrentCellPosition > ui.value) + angular.element(document.getElementById('SchedulerCtrl')).scope().moveBackSlot(ui.value, ui.value + SchedulerTotalVisibleCells); + else if (_schedulerCurrentCellPosition < ui.value) + angular.element(document.getElementById('SchedulerCtrl')).scope().moveFrontSlot(ui.value, ui.value + SchedulerTotalVisibleCells); + _schedulerCurrentCellPosition = ui.value; + } + }); + //End init Slider - if ($("#" + rsvrTblNm + " th:visible:first").width() > 105) { - $("#" + rsvrTblNm + " th span").css("display", "inline") - } else { - $("#" + rsvrTblNm + " th span").css("display", "block"); + //other stuff + //fixOddEvenClasses(); + //$("#" + schedulerTblId + " td:not([class])").addClass("free"); + if (schedulerDebug) console.timeEnd("_initUI"); + }, + _FixTable: function () { + var colWidth = 50; + SchedulerTotalCells = SchedulerSlots.length; + $('#' + schedulerTblId + ' thead tr th:eq(0)').css("width", schedulerTblFirstColWidth); + //this get width might need fix depending on the template + var tblwidth = $('#scheduler-tab').parent().outerWidth(); + SchedulerTotalVisibleCells = parseInt((tblwidth - schedulerTblFirstColWidth) / colWidth); + + if (SchedulerData.length == 0) { + //puth some test data + SchedulerData.push({ name: 'xyz+aaa', leases: schedulerGetLeases(60 / schedulerSlotsPerHour), urn: 'xyz+aaa', type: 'node' }); + SchedulerData.push({ name: 'xyz+bbb', leases: schedulerGetLeases(60 / schedulerSlotsPerHour), urn: 'xyz+bbb', type: 'node' }); + SchedulerData.push({ name: 'xyz+ccc', leases: schedulerGetLeases(60 / schedulerSlotsPerHour), urn: 'xyz+ccc', type: 'node' }); + SchedulerData.push({ name: 'nitos1', leases: schedulerGetLeases(60 / schedulerSlotsPerHour), urn: 'nitos1', type: 'node' }); } - mtNodesTbl = $("#" + rsvrTblNm + " tr:first").outerHeight() + 6; - $("#nodes").css("margin-top", mtNodesTbl); - //$("#scroll_container").width($("#Search").width() - $("#nodes").width()); - //$("#nodes th").height($("#tblReservation th:visible:first").height() - 2); - if (Debug) console.timeEnd("_SetPeriodInPage"); + angular.element(document.getElementById('SchedulerCtrl')).scope().initSlots(0, SchedulerTotalVisibleCells); + }, + _SetPeriodInPage: function (start, end) { } }); //Sched2 = new Scheduler2(); /* Plugin registration */ - $.plugin('Scheduler2', Scheduler2); + $.plugin('Scheduler2', scheduler2); // TODO Here use cases for instanciating plugins in different ways like in the pastie. diff --git a/plugins/scheduler2/static/js/scheduler2_old.js b/plugins/scheduler2/static/js/scheduler2_old.js new file mode 100755 index 00000000..ee833bf3 --- /dev/null +++ b/plugins/scheduler2/static/js/scheduler2_old.js @@ -0,0 +1,325 @@ +/* +# +# Copyright (c) 2013 NITLab, University of Thessaly, CERTH, Greece +# +# 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. +# +# +# This is a MySlice plugin for the NITOS Scheduler +# Nitos Scheduler v1 +# +*/ + +/* some params */ +var init_start_visible_index = 10; +var init_end_visible_index = 21; +var rsvrTblNm = "scheduler-reservation-table"; +var SchedulerResources = []; +var schdlr_totalColums = 0; +var SetPerFun = null; +var Sched2 = null; +var Debug = true; +var schdlr_PartsInOneHour = 6; + +(function ($) { + var Scheduler2 = Plugin.extend({ + + /** XXX to check + * @brief Plugin constructor + * @param options : an associative array of setting values + * @param element : + * @return : a jQuery collection of objects on which the plugin is + * applied, which allows to maintain chainability of calls + */ + init: function (options, element) { + this.classname="scheduler2"; + // Call the parent constructor, see FAQ when forgotten + this._super(options, element); + + schdlr_totalColums = $("#scheduler-reservation-table th").length; + + //selection from table + $(window).keydown(function (evt) { + if (evt.which == 17) { // ctrl + ctrlPressed = true; + } + }).keyup(function (evt) { + if (evt.which == 17) { // ctrl + ctrlPressed = false; + } + }); + $("#" + rsvrTblNm).on('mousedown', 'td', rangeMouseDown).on('mouseup', 'td', rangeMouseUp).on('mousemove', 'td', rangeMouseMove); + + // Explain this will allow query events to be handled + // What happens when we don't define some events ? + // Some can be less efficient + + if (Debug) console.time("Listening_to_queries"); + /* Listening to queries */ + this.listen_query(options.query_uuid, 'all_ev'); + this.listen_query(options.query_all_resources_uuid, 'all_resources'); + this.listen_query(options.query_lease_uuid, 'lease'); + //this.listen_query(options.query_lease_uuid, 'lease'); + if (Debug) console.timeEnd("Listening_to_queries"); + + $("#ShedulerNodes tbody").html(''); + }, + + /* PLUGIN EVENTS */ + // on_show like in querytable + + + /* GUI EVENTS */ + + // a function to bind events here: click change + // how to raise manifold events + + + /* GUI MANIPULATION */ + + // We advise you to write function to change behaviour of the GUI + // Will use naming helpers to access content _inside_ the plugin + // always refer to these functions in the remaining of the code + + show_hide_button: function () { + // this.id, this.el, this.cl, this.elts + // same output as a jquery selector with some guarantees + }, + + //drawResources: function () { + drawLeases: function () { + + //if (Debug) this.debug('foo'); + if (Debug) console.time("each:SchedulerResources"); + + //scheduler-reservation-table main table columns + totalColums = $("#scheduler-reservation-table thead tr th").length; + //var totalCell = []; + //for (var i = 0; i < totalColums; i++) { totalCell.push(""); } + //var srt_body = []; + var totalCell = ""; + for (var i = 0; i < totalColums; i++) totalCell +=""; + var srt_body = ""; + /* + $.each(SchedulerResources, function (i, group) { + console.log(group.groupName); + //var groupTR = $("#ShedulerNodes tbody").html('
' + group.groupName + '
'); + //var groupTR = $("#ShedulerNodes tbody").html('
' + group.groupName + '
'); + var groupTR = $("#ShedulerNodes tbody").html(''); + + //$.each(group.resources.slice(0,30), function (i, resource) { + $.each(group.resources, function (i, resource) { + if (i == 0) { + //$("#ShedulerNodes tbody tr:first").append('' + resource.hostname + ''); + $(groupTR).find("#schdlr_frstTD").html(resource.urn); + //$(srt_body).html("" + totalCell + ""); + } else { + $(groupTR).find("tr:last").after('' + resource.urn + ''); + //$(srt_body).find("tr:last").after("" + totalCell + ""); + } + srt_body += "" + totalCell + ""; + //srt_body.push(''); srt_body = srt_body.concat(totalCell.concat()); srt_body.push('/'); + }); + }); + */ + + srt_body += "" + totalCell + ""; + //$("#scheduler-reservation-table tbody").html(srt_body.join("")); + //$("#scheduler-reservation-table tbody").append(srt_body); + + if (Debug) console.timeEnd("each:SchedulerResources"); + + + $("#" + rsvrTblNm + " tbody tr").each(function (index) { $(this).attr("data-trindex", index); }); + + }, + + /* TEMPLATES */ + + // see in the html template + // How to load a template, use of mustache + + /* QUERY HANDLERS */ + loadWithDate: function () { + // only convention, not strictly enforced at the moment + }, + // How to make sure the plugin is not desynchronized + // He should manifest its interest in filters, fields or records + // functions triggered only if the proper listen is done + + /* all_ev QUERY HANDLERS Start */ + on_all_ev_clear_records: function (data) { + //alert('all_ev clear_records'); + }, + on_all_ev_query_in_progress: function (data) { + // alert('all_ev query_in_progress'); + }, + on_all_ev_new_record: function (data) { + //alert('all_ev new_record'); + }, + on_all_ev_query_done: function (data) { + //alert('all_ev query_done'); + }, + //another plugin has modified something, that requires you to update your display. + on_all_ev_field_state_changed: function (data) { + //alert('all_ev query_done'); + }, + /* all_ev QUERY HANDLERS End */ + /* all_resources QUERY HANDLERS Start */ + on_all_resources_clear_records: function (data) { + //data is empty on load + }, + on_all_resources_query_in_progress: function (data) { + //data is empty on load + }, + on_all_resources_new_record: function (data) { + $("#ShedulerNodes tbody").find("tr:last").after('' + data.urn + ''); + this.drawLeases(); + //console.log(data); + var tmpGroup = lookup(SchedulerResources, 'groupName', data.type); + if (tmpGroup == null) { + tmpGroup = { groupName: data.type, resources: [] }; + SchedulerResources.push(tmpGroup); + //if (data.type != "node") alert('not all node'); + } + tmpGroup.resources.push(data); + //alert('new_record'); + }, + on_all_resources_query_done: function (data) { + //this.drawResources(); + //data is empty on load + /* GUI setup and event binding */ + this._initUI(); + this._SetPeriodInPage(init_start_visible_index, init_end_visible_index); + this.loadWithDate(); + }, + //another plugin has modified something, that requires you to update your display. + on_all_resources_field_state_changed: function (data) { + //alert('all_resources query_done'); + }, + /* all_resources QUERY HANDLERS End */ + /* lease QUERY HANDLERS Start */ + on_lease_clear_records: function (data) { console.log('clear_records'); }, + on_lease_query_in_progress: function (data) { console.log('lease_query_in_progress'); }, + on_lease_new_record: function (data) { console.log('lease_new_record'); }, + on_lease_query_done: function (data) { console.log('lease_query_done'); }, + //another plugin has modified something, that requires you to update your display. + on_lease_field_state_changed: function (data) { console.log('lease_field_state_changed'); }, + /* lease QUERY HANDLERS End */ + + + // no prefix + + on_filter_added: function (filter) { + + }, + + // ... be sure to list all events here + + /* RECORD HANDLERS */ + on_all_new_record: function (record) { + // + alert('on_all_new_record'); + }, + + debug : function (log_txt) { + if (typeof window.console != 'undefined') { + console.debug(log_txt); + } + }, + + /* INTERNAL FUNCTIONS */ + _initUI: function () { + if (Debug) console.time("_initUI"); + //fix margins in tables + mtNodesTbl = $("#" + rsvrTblNm + " tr:first").outerHeight() + 6; + mtSchrollCon = $("#nodes").outerWidth(); + $("#nodes").css("margin-top", mtNodesTbl); + $("#reservation-table-scroll-container").css("margin-left", mtSchrollCon); + SetPerFun = this._SetPeriodInPage; + //slider + $("#time-range").slider({ + range: true, + min: 0, + max: 24, + step: 0.5, + values: [init_start_visible_index, init_end_visible_index], + slide: function (event, ui) { + SetPerFun(ui.values[0], ui.values[1]); + } + }); + $("#DateToRes").datepicker({ + dateFormat: "yy-mm-dd", + minDate: 0, + numberOfMonths: 3 + }).change(function () { + //Scheduler2.loadWithDate(); + }).click(function () { + $("#ui-datepicker-div").css("z-index", 5); + }); + //other stuff + fixOddEvenClasses(); + $("#" + rsvrTblNm + " td:not([class])").addClass("free"); + if (Debug) console.timeEnd("_initUI"); + }, + _SetPeriodInPage: function (start, end) { + if (Debug) console.time("_SetPeriodInPage"); + ClearTableSelection(); + $("#lbltime").html(GetTimeFromInt(start) + " - " + GetTimeFromInt(end)); + + var start_visible_index = (start * schdlr_PartsInOneHour) + 1; + var end_visible_index = (end * schdlr_PartsInOneHour); + + //hide - show + for (i = 0; i < start_visible_index; i++) { + $("#" + rsvrTblNm + " td:nth-child(" + i + "), #" + rsvrTblNm + " th:nth-child(" + i + ")").hide(); + } + for (i = end_visible_index + 1; i <= schdlr_totalColums; i++) { + $("#" + rsvrTblNm + " td:nth-child(" + i + "), #" + rsvrTblNm + " th:nth-child(" + i + ")").hide(); + } + /*$("#" + rsvrTblNm + " td:not([class*='info']), #" + rsvrTblNm + " th:not([class*='fixed'])").hide();*/ + for (i = start_visible_index; i <= end_visible_index; i++) { + $("#" + rsvrTblNm + " td:nth-child(" + i + "), #" + rsvrTblNm + " th:nth-child(" + i + ")").show(); + } + + if ($("#" + rsvrTblNm + " th:visible:first").width() > 105) { + $("#" + rsvrTblNm + " th span").css("display", "inline") + } else { + $("#" + rsvrTblNm + " th span").css("display", "block"); + } + mtNodesTbl = $("#" + rsvrTblNm + " tr:first").outerHeight() + 6; + $("#nodes").css("margin-top", mtNodesTbl); + //$("#scroll_container").width($("#Search").width() - $("#nodes").width()); + //$("#nodes th").height($("#tblReservation th:visible:first").height() - 2); + if (Debug) console.timeEnd("_SetPeriodInPage"); + } + }); + + //Sched2 = new Scheduler2(); + + /* Plugin registration */ + $.plugin('Scheduler2', Scheduler2); + + // TODO Here use cases for instanciating plugins in different ways like in the pastie. + + +})(jQuery); + + + diff --git a/plugins/scheduler2/static/js/table-selector.js b/plugins/scheduler2/static/js/table-selector.js index b4991519..ec8c1321 100755 --- a/plugins/scheduler2/static/js/table-selector.js +++ b/plugins/scheduler2/static/js/table-selector.js @@ -18,7 +18,7 @@ var isExecuting = false; function rangeMouseDown(e) { if (Debug) console.time("mouse:rangeMouseDown"); - if (isRightClick(e)) { + if (schedulerIsRightClick(e)) { return false; } else { dragStart_tr = $(this).parent().index(); @@ -43,7 +43,7 @@ function rangeMouseDown(e) { function rangeMouseUp(e) { if (Debug) console.time("mouse:rangeMouseUp"); - if (isRightClick(e)) { + if (schedulerIsRightClick(e)) { return false; } else { //var allCells = $("#tblReservation td"); diff --git a/plugins/scheduler2/templates/scheduler.html b/plugins/scheduler2/templates/scheduler.html index e4605f03..d32a5656 100755 --- a/plugins/scheduler2/templates/scheduler.html +++ b/plugins/scheduler2/templates/scheduler.html @@ -1,4 +1,4 @@ -
+
@@ -23,7 +23,7 @@
-
+ +
+
+
+
+
+ + - {% endif %} - + + + + + + + + - {% endfor %} - {% endfor %} - {% endcomment %}
{{ n }}# + {[{ slot.time }]} +
{[{ resource.name }]}
+ {% comment %}
@@ -66,7 +67,7 @@ - {% comment %} + {% for itms in nodes %} {% for n in itms.1 %} @@ -82,10 +83,10 @@ {% endfor %} {% endfor %} - {% endcomment %}
+ {% endcomment %}
    -- 2.43.0