").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cd=a.document.documentElement;function dd(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dd(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cd;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cd})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dd(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=Lb(k.pixelPosition,function(a,c){return c?(c=Jb(a,b),Hb.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ed=a.jQuery,fd=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fd),b&&a.jQuery===m&&(a.jQuery=ed),m},typeof b===K&&(a.jQuery=a.$=m),m});
diff --git a/django_code/templates/cloudmanager/js/jquery.mixitup.js b/django_code/templates/cloudmanager/js/jquery.mixitup.js
new file mode 100644
index 0000000..d6b6f01
--- /dev/null
+++ b/django_code/templates/cloudmanager/js/jquery.mixitup.js
@@ -0,0 +1,2072 @@
+/**!
+ * MixItUp v2.1.7
+ *
+ * @copyright Copyright 2014 KunkaLabs Limited.
+ * @author KunkaLabs Limited.
+ * @link https://mixitup.kunkalabs.com
+ *
+ * @license Commercial use requires a commercial license.
+ * https://mixitup.kunkalabs.com/licenses/
+ *
+ * Non-commercial use permitted under terms of CC-BY-NC license.
+ * http://creativecommons.org/licenses/by-nc/3.0/
+ */
+
+(function($, undf){
+
+ /**
+ * MixItUp Constructor Function
+ * @constructor
+ * @extends jQuery
+ */
+
+ $.MixItUp = function(){
+ var self = this;
+
+ self._execAction('_constructor', 0);
+
+ $.extend(self, {
+
+ /* Public Properties
+ ---------------------------------------------------------------------- */
+
+ selectors: {
+ target: '.mix',
+ filter: '.filter',
+ sort: '.sort'
+ },
+
+ animation: {
+ enable: true,
+ effects: 'fade scale',
+ duration: 600,
+ easing: 'ease',
+ perspectiveDistance: '3000',
+ perspectiveOrigin: '50% 50%',
+ queue: true,
+ queueLimit: 1,
+ animateChangeLayout: false,
+ animateResizeContainer: true,
+ animateResizeTargets: false,
+ staggerSequence: false,
+ reverseOut: false
+ },
+
+ callbacks: {
+ onMixLoad: false,
+ onMixStart: false,
+ onMixBusy: false,
+ onMixEnd: false,
+ onMixFail: false,
+ _user: false
+ },
+
+ controls: {
+ enable: true,
+ live: false,
+ toggleFilterButtons: false,
+ toggleLogic: 'or',
+ activeClass: 'active'
+ },
+
+ layout: {
+ display: 'inline-block',
+ containerClass: '',
+ containerClassFail: 'fail'
+ },
+
+ load: {
+ filter: 'all',
+ sort: false
+ },
+
+ /* Private Properties
+ ---------------------------------------------------------------------- */
+
+ _$body: null,
+ _$container: null,
+ _$targets: null,
+ _$parent: null,
+ _$sortButtons: null,
+ _$filterButtons: null,
+
+ _suckMode: false,
+ _mixing: false,
+ _sorting: false,
+ _clicking: false,
+ _loading: true,
+ _changingLayout: false,
+ _changingClass: false,
+ _changingDisplay: false,
+
+ _origOrder: [],
+ _startOrder: [],
+ _newOrder: [],
+ _activeFilter: null,
+ _toggleArray: [],
+ _toggleString: '',
+ _activeSort: 'default:asc',
+ _newSort: null,
+ _startHeight: null,
+ _newHeight: null,
+ _incPadding: true,
+ _newDisplay: null,
+ _newClass: null,
+ _targetsBound: 0,
+ _targetsDone: 0,
+ _queue: [],
+
+ _$show: $(),
+ _$hide: $()
+ });
+
+ self._execAction('_constructor', 1);
+ };
+
+ /**
+ * MixItUp Prototype
+ * @override
+ */
+
+ $.MixItUp.prototype = {
+ constructor: $.MixItUp,
+
+ /* Static Properties
+ ---------------------------------------------------------------------- */
+
+ _instances: {},
+ _handled: {
+ _filter: {},
+ _sort: {}
+ },
+ _bound: {
+ _filter: {},
+ _sort: {}
+ },
+ _actions: {},
+ _filters: {},
+
+ /* Static Methods
+ ---------------------------------------------------------------------- */
+
+ /**
+ * Extend
+ * @since 2.1.0
+ * @param {object} new properties/methods
+ * @extends {object} prototype
+ */
+
+ extend: function(extension){
+ for(var key in extension){
+ $.MixItUp.prototype[key] = extension[key];
+ }
+ },
+
+ /**
+ * Add Action
+ * @since 2.1.0
+ * @param {string} hook name
+ * @param {string} namespace
+ * @param {function} function to execute
+ * @param {number} priority
+ * @extends {object} $.MixItUp.prototype._actions
+ */
+
+ addAction: function(hook, name, func, priority){
+ $.MixItUp.prototype._addHook('_actions', hook, name, func, priority);
+ },
+
+ /**
+ * Add Filter
+ * @since 2.1.0
+ * @param {string} hook name
+ * @param {string} namespace
+ * @param {function} function to execute
+ * @param {number} priority
+ * @extends {object} $.MixItUp.prototype._filters
+ */
+
+ addFilter: function(hook, name, func, priority){
+ $.MixItUp.prototype._addHook('_filters', hook, name, func, priority);
+ },
+
+ /**
+ * Add Hook
+ * @since 2.1.0
+ * @param {string} type of hook
+ * @param {string} hook name
+ * @param {function} function to execute
+ * @param {number} priority
+ * @extends {object} $.MixItUp.prototype._filters
+ */
+
+ _addHook: function(type, hook, name, func, priority){
+ var collection = $.MixItUp.prototype[type],
+ obj = {};
+
+ priority = (priority === 1 || priority === 'post') ? 'post' : 'pre';
+
+ obj[hook] = {};
+ obj[hook][priority] = {};
+ obj[hook][priority][name] = func;
+
+ $.extend(true, collection, obj);
+ },
+
+
+ /* Private Methods
+ ---------------------------------------------------------------------- */
+
+ /**
+ * Initialise
+ * @since 2.0.0
+ * @param {object} domNode
+ * @param {object} config
+ */
+
+ _init: function(domNode, config){
+ var self = this;
+
+ self._execAction('_init', 0, arguments);
+
+ config && $.extend(true, self, config);
+
+ self._$body = $('body');
+ self._domNode = domNode;
+ self._$container = $(domNode);
+ self._$container.addClass(self.layout.containerClass);
+ self._id = domNode.id;
+
+ self._platformDetect();
+
+ self._brake = self._getPrefixedCSS('transition', 'none');
+
+ self._refresh(true);
+
+ self._$parent = self._$targets.parent().length ? self._$targets.parent() : self._$container;
+
+ if(self.load.sort){
+ self._newSort = self._parseSort(self.load.sort);
+ self._newSortString = self.load.sort;
+ self._activeSort = self.load.sort;
+ self._sort();
+ self._printSort();
+ }
+
+ self._activeFilter = self.load.filter === 'all' ?
+ self.selectors.target :
+ self.load.filter === 'none' ?
+ '' :
+ self.load.filter;
+
+ self.controls.enable && self._bindHandlers();
+
+ if(self.controls.toggleFilterButtons){
+ self._buildToggleArray();
+
+ for(var i = 0; i < self._toggleArray.length; i++){
+ self._updateControls({filter: self._toggleArray[i], sort: self._activeSort}, true);
+ };
+ } else if(self.controls.enable){
+ self._updateControls({filter: self._activeFilter, sort: self._activeSort});
+ }
+
+ self._filter();
+
+ self._init = true;
+
+ self._$container.data('mixItUp',self);
+
+ self._execAction('_init', 1, arguments);
+
+ self._buildState();
+
+ self._$targets.css(self._brake);
+
+ self._goMix(self.animation.enable);
+ },
+
+ /**
+ * Platform Detect
+ * @since 2.0.0
+ */
+
+ _platformDetect: function(){
+ var self = this,
+ vendorsTrans = ['Webkit', 'Moz', 'O', 'ms'],
+ vendorsRAF = ['webkit', 'moz'],
+ chrome = window.navigator.appVersion.match(/Chrome\/(\d+)\./) || false,
+ ff = typeof InstallTrigger !== 'undefined',
+ prefix = function(el){
+ for (var i = 0; i < vendorsTrans.length; i++){
+ if (vendorsTrans[i] + 'Transition' in el.style){
+ return {
+ prefix: '-'+vendorsTrans[i].toLowerCase()+'-',
+ vendor: vendorsTrans[i]
+ };
+ };
+ };
+ return 'transition' in el.style ? '' : false;
+ },
+ transPrefix = prefix(self._domNode);
+
+ self._execAction('_platformDetect', 0);
+
+ self._chrome = chrome ? parseInt(chrome[1], 10) : false;
+ self._ff = ff ? parseInt(window.navigator.userAgent.match(/rv:([^)]+)\)/)[1]) : false;
+ self._prefix = transPrefix.prefix;
+ self._vendor = transPrefix.vendor;
+ self._suckMode = window.atob && self._prefix ? false : true;
+
+ self._suckMode && (self.animation.enable = false);
+ (self._ff && self._ff <= 4) && (self.animation.enable = false);
+
+ /* Polyfills
+ ---------------------------------------------------------------------- */
+
+ /**
+ * window.requestAnimationFrame
+ */
+
+ for(var x = 0; x < vendorsRAF.length && !window.requestAnimationFrame; x++){
+ window.requestAnimationFrame = window[vendorsRAF[x]+'RequestAnimationFrame'];
+ }
+
+ /**
+ * Object.getPrototypeOf
+ */
+
+ if(typeof Object.getPrototypeOf !== 'function'){
+ if(typeof 'test'.__proto__ === 'object'){
+ Object.getPrototypeOf = function(object){
+ return object.__proto__;
+ };
+ } else {
+ Object.getPrototypeOf = function(object){
+ return object.constructor.prototype;
+ };
+ }
+ }
+
+ /**
+ * Element.nextElementSibling
+ */
+
+ if(self._domNode.nextElementSibling === undf){
+ Object.defineProperty(Element.prototype, 'nextElementSibling',{
+ get: function(){
+ var el = this.nextSibling;
+
+ while(el){
+ if(el.nodeType ===1){
+ return el;
+ }
+ el = el.nextSibling;
+ }
+ return null;
+ }
+ });
+ }
+
+ self._execAction('_platformDetect', 1);
+ },
+
+ /**
+ * Refresh
+ * @since 2.0.0
+ * @param {boolean} init
+ * @param {boolean} force
+ */
+
+ _refresh: function(init, force){
+ var self = this;
+
+ self._execAction('_refresh', 0, arguments);
+
+ self._$targets = self._$container.find(self.selectors.target);
+
+ for(var i = 0; i < self._$targets.length; i++){
+ var target = self._$targets[i];
+
+ if(target.dataset === undf || force){
+
+ target.dataset = {};
+
+ for(var j = 0; j < target.attributes.length; j++){
+
+ var attr = target.attributes[j],
+ name = attr.name,
+ val = attr.value;
+
+ if(name.indexOf('data-') > -1){
+ var dataName = self._helpers._camelCase(name.substring(5,name.length));
+ target.dataset[dataName] = val;
+ }
+ }
+ }
+
+ if(target.mixParent === undf){
+ target.mixParent = self._id;
+ }
+ }
+
+ if(
+ (self._$targets.length && init) ||
+ (!self._origOrder.length && self._$targets.length)
+ ){
+ self._origOrder = [];
+
+ for(var i = 0; i < self._$targets.length; i++){
+ var target = self._$targets[i];
+
+ self._origOrder.push(target);
+ }
+ }
+
+ self._execAction('_refresh', 1, arguments);
+ },
+
+ /**
+ * Bind Handlers
+ * @since 2.0.0
+ */
+
+ _bindHandlers: function(){
+ var self = this,
+ filters = $.MixItUp.prototype._bound._filter,
+ sorts = $.MixItUp.prototype._bound._sort;
+
+ self._execAction('_bindHandlers', 0);
+
+ if(self.controls.live){
+ self._$body
+ .on('click.mixItUp.'+self._id, self.selectors.sort, function(){
+ self._processClick($(this), 'sort');
+ })
+ .on('click.mixItUp.'+self._id, self.selectors.filter, function(){
+ self._processClick($(this), 'filter');
+ });
+ } else {
+ self._$sortButtons = $(self.selectors.sort);
+ self._$filterButtons = $(self.selectors.filter);
+
+ self._$sortButtons.on('click.mixItUp.'+self._id, function(){
+ self._processClick($(this), 'sort');
+ });
+
+ self._$filterButtons.on('click.mixItUp.'+self._id, function(){
+ self._processClick($(this), 'filter');
+ });
+ }
+
+ filters[self.selectors.filter] = (filters[self.selectors.filter] === undf) ? 1 : filters[self.selectors.filter] + 1;
+ sorts[self.selectors.sort] = (sorts[self.selectors.sort] === undf) ? 1 : sorts[self.selectors.sort] + 1;
+
+ self._execAction('_bindHandlers', 1);
+ },
+
+ /**
+ * Process Click
+ * @since 2.0.0
+ * @param {object} $button
+ * @param {string} type
+ */
+
+ _processClick: function($button, type){
+ var self = this,
+ trackClick = function($button, type, off){
+ var proto = $.MixItUp.prototype;
+
+ proto._handled['_'+type][self.selectors[type]] = (proto._handled['_'+type][self.selectors[type]] === undf) ?
+ 1 :
+ proto._handled['_'+type][self.selectors[type]] + 1;
+
+ if(proto._handled['_'+type][self.selectors[type]] === proto._bound['_'+type][self.selectors[type]]){
+ $button[(off ? 'remove' : 'add')+'Class'](self.controls.activeClass);
+ delete proto._handled['_'+type][self.selectors[type]];
+ }
+ };
+
+ self._execAction('_processClick', 0, arguments);
+
+ if(!self._mixing || (self.animation.queue && self._queue.length < self.animation.queueLimit)){
+ self._clicking = true;
+
+ if(type === 'sort'){
+ var sort = $button.attr('data-sort');
+
+ if(!$button.hasClass(self.controls.activeClass) || sort.indexOf('random') > -1){
+ $(self.selectors.sort).removeClass(self.controls.activeClass);
+ trackClick($button, type);
+ self.sort(sort);
+ }
+ }
+
+ if(type === 'filter') {
+ var filter = $button.attr('data-filter'),
+ ndx,
+ seperator = self.controls.toggleLogic === 'or' ? ',' : '';
+
+ if(!self.controls.toggleFilterButtons){
+ if(!$button.hasClass(self.controls.activeClass)){
+ $(self.selectors.filter).removeClass(self.controls.activeClass);
+ trackClick($button, type);
+ self.filter(filter);
+ }
+ } else {
+ self._buildToggleArray();
+
+ if(!$button.hasClass(self.controls.activeClass)){
+ trackClick($button, type);
+
+ self._toggleArray.push(filter);
+ } else {
+ trackClick($button, type, true);
+ ndx = self._toggleArray.indexOf(filter);
+ self._toggleArray.splice(ndx, 1);
+ }
+
+ self._toggleArray = $.grep(self._toggleArray,function(n){return(n);});
+
+ self._toggleString = self._toggleArray.join(seperator);
+
+ self.filter(self._toggleString);
+ }
+ }
+
+ self._execAction('_processClick', 1, arguments);
+ } else {
+ if(typeof self.callbacks.onMixBusy === 'function'){
+ self.callbacks.onMixBusy.call(self._domNode, self._state, self);
+ }
+ self._execAction('_processClickBusy', 1, arguments);
+ }
+ },
+
+ /**
+ * Build Toggle Array
+ * @since 2.0.0
+ */
+
+ _buildToggleArray: function(){
+ var self = this,
+ activeFilter = self._activeFilter.replace(/\s/g, '');
+
+ self._execAction('_buildToggleArray', 0, arguments);
+
+ if(self.controls.toggleLogic === 'or'){
+ self._toggleArray = activeFilter.split(',');
+ } else {
+ self._toggleArray = activeFilter.split('.');
+
+ !self._toggleArray[0] && self._toggleArray.shift();
+
+ for(var i = 0, filter; filter = self._toggleArray[i]; i++){
+ self._toggleArray[i] = '.'+filter;
+ }
+ }
+
+ self._execAction('_buildToggleArray', 1, arguments);
+ },
+
+ /**
+ * Update Controls
+ * @since 2.0.0
+ * @param {object} command
+ * @param {boolean} multi
+ */
+
+ _updateControls: function(command, multi){
+ var self = this,
+ output = {
+ filter: command.filter,
+ sort: command.sort
+ },
+ update = function($el, filter){
+ (multi && type === 'filter' && !(output.filter === 'none' || output.filter === '')) ?
+ $el.filter(filter).addClass(self.controls.activeClass) :
+ $el.removeClass(self.controls.activeClass).filter(filter).addClass(self.controls.activeClass);
+ },
+ type = 'filter',
+ $el = null;
+
+ self._execAction('_updateControls', 0, arguments);
+
+ (command.filter === undf) && (output.filter = self._activeFilter);
+ (command.sort === undf) && (output.sort = self._activeSort);
+ (output.filter === self.selectors.target) && (output.filter = 'all');
+
+ for(var i = 0; i < 2; i++){
+ $el = self.controls.live ? $(self.selectors[type]) : self['_$'+type+'Buttons'];
+ $el && update($el, '[data-'+type+'="'+output[type]+'"]');
+ type = 'sort';
+ }
+
+ self._execAction('_updateControls', 1, arguments);
+ },
+
+ /**
+ * Filter (private)
+ * @since 2.0.0
+ */
+
+ _filter: function(){
+ var self = this;
+
+ self._execAction('_filter', 0);
+
+ for(var i = 0; i < self._$targets.length; i++){
+ var $target = $(self._$targets[i]);
+
+ if($target.is(self._activeFilter)){
+ self._$show = self._$show.add($target);
+ } else {
+ self._$hide = self._$hide.add($target);
+ }
+ }
+
+ self._execAction('_filter', 1);
+ },
+
+ /**
+ * Sort (private)
+ * @since 2.0.0
+ */
+
+ _sort: function(){
+ var self = this,
+ arrayShuffle = function(oldArray){
+ var newArray = oldArray.slice(),
+ len = newArray.length,
+ i = len;
+
+ while(i--){
+ var p = parseInt(Math.random()*len);
+ var t = newArray[i];
+ newArray[i] = newArray[p];
+ newArray[p] = t;
+ };
+ return newArray;
+ };
+
+ self._execAction('_sort', 0);
+
+ self._startOrder = [];
+
+ for(var i = 0; i < self._$targets.length; i++){
+ var target = self._$targets[i];
+
+ self._startOrder.push(target);
+ }
+
+ switch(self._newSort[0].sortBy){
+ case 'default':
+ self._newOrder = self._origOrder;
+ break;
+ case 'random':
+ self._newOrder = arrayShuffle(self._startOrder);
+ break;
+ case 'custom':
+ self._newOrder = self._newSort[0].order;
+ break;
+ default:
+ self._newOrder = self._startOrder.concat().sort(function(a, b){
+ return self._compare(a, b);
+ });
+ }
+
+ self._execAction('_sort', 1);
+ },
+
+ /**
+ * Compare Algorithm
+ * @since 2.0.0
+ * @param {string|number} a
+ * @param {string|number} b
+ * @param {number} depth (recursion)
+ * @return {number}
+ */
+
+ _compare: function(a, b, depth){
+ depth = depth ? depth : 0;
+
+ var self = this,
+ order = self._newSort[depth].order,
+ getData = function(el){
+ return el.dataset[self._newSort[depth].sortBy] || 0;
+ },
+ attrA = isNaN(getData(a) * 1) ? getData(a).toLowerCase() : getData(a) * 1,
+ attrB = isNaN(getData(b) * 1) ? getData(b).toLowerCase() : getData(b) * 1;
+
+ if(attrA < attrB)
+ return order === 'asc' ? -1 : 1;
+ if(attrA > attrB)
+ return order === 'asc' ? 1 : -1;
+ if(attrA === attrB && self._newSort.length > depth+1)
+ return self._compare(a, b, depth+1);
+
+ return 0;
+ },
+
+ /**
+ * Print Sort
+ * @since 2.0.0
+ * @param {boolean} reset
+ */
+
+ _printSort: function(reset){
+ var self = this,
+ order = reset ? self._startOrder : self._newOrder,
+ targets = self._$parent[0].querySelectorAll(self.selectors.target),
+ nextSibling = targets.length ? targets[targets.length -1].nextElementSibling : null,
+ frag = document.createDocumentFragment();
+
+ self._execAction('_printSort', 0, arguments);
+
+ for(var i = 0; i < targets.length; i++){
+ var target = targets[i],
+ whiteSpace = target.nextSibling;
+
+ if(target.style.position === 'absolute') continue;
+
+ if(whiteSpace && whiteSpace.nodeName === '#text'){
+ self._$parent[0].removeChild(whiteSpace);
+ }
+
+ self._$parent[0].removeChild(target);
+ }
+
+ for(var i = 0; i < order.length; i++){
+ var el = order[i];
+
+ if(self._newSort[0].sortBy === 'default' && self._newSort[0].order === 'desc' && !reset){
+ var firstChild = frag.firstChild;
+ frag.insertBefore(el, firstChild);
+ frag.insertBefore(document.createTextNode(' '), el);
+ } else {
+ frag.appendChild(el);
+ frag.appendChild(document.createTextNode(' '));
+ }
+ }
+
+ nextSibling ?
+ self._$parent[0].insertBefore(frag, nextSibling) :
+ self._$parent[0].appendChild(frag);
+
+ self._execAction('_printSort', 1, arguments);
+ },
+
+ /**
+ * Parse Sort
+ * @since 2.0.0
+ * @param {string} sortString
+ * @return {array} newSort
+ */
+
+ _parseSort: function(sortString){
+ var self = this,
+ rules = typeof sortString === 'string' ? sortString.split(' ') : [sortString],
+ newSort = [];
+
+ for(var i = 0; i < rules.length; i++){
+ var rule = typeof sortString === 'string' ? rules[i].split(':') : ['custom', rules[i]],
+ ruleObj = {
+ sortBy: self._helpers._camelCase(rule[0]),
+ order: rule[1] || 'asc'
+ };
+
+ newSort.push(ruleObj);
+
+ if(ruleObj.sortBy === 'default' || ruleObj.sortBy === 'random') break;
+ }
+
+ return self._execFilter('_parseSort', newSort, arguments);
+ },
+
+ /**
+ * Parse Effects
+ * @since 2.0.0
+ * @return {object} effects
+ */
+
+ _parseEffects: function(){
+ var self = this,
+ effects = {
+ opacity: '',
+ transformIn: '',
+ transformOut: '',
+ filter: ''
+ },
+ parse = function(effect, extract, reverse){
+ if(self.animation.effects.indexOf(effect) > -1){
+ if(extract){
+ var propIndex = self.animation.effects.indexOf(effect+'(');
+ if(propIndex > -1){
+ var str = self.animation.effects.substring(propIndex),
+ match = /\(([^)]+)\)/.exec(str),
+ val = match[1];
+
+ return {val: val};
+ }
+ }
+ return true;
+ } else {
+ return false;
+ }
+ },
+ negate = function(value, invert){
+ if(invert){
+ return value.charAt(0) === '-' ? value.substr(1, value.length) : '-'+value;
+ } else {
+ return value;
+ }
+ },
+ buildTransform = function(key, invert){
+ var transforms = [
+ ['scale', '.01'],
+ ['translateX', '20px'],
+ ['translateY', '20px'],
+ ['translateZ', '20px'],
+ ['rotateX', '90deg'],
+ ['rotateY', '90deg'],
+ ['rotateZ', '180deg'],
+ ];
+
+ for(var i = 0; i < transforms.length; i++){
+ var prop = transforms[i][0],
+ def = transforms[i][1],
+ inverted = invert && prop !== 'scale';
+
+ effects[key] += parse(prop) ? prop+'('+negate(parse(prop, true).val || def, inverted)+') ' : '';
+ }
+ };
+
+ effects.opacity = parse('fade') ? parse('fade',true).val || '0' : '1';
+
+ buildTransform('transformIn');
+
+ self.animation.reverseOut ? buildTransform('transformOut', true) : (effects.transformOut = effects.transformIn);
+
+ effects.transition = {};
+
+ effects.transition = self._getPrefixedCSS('transition','all '+self.animation.duration+'ms '+self.animation.easing+', opacity '+self.animation.duration+'ms linear');
+
+ self.animation.stagger = parse('stagger') ? true : false;
+ self.animation.staggerDuration = parseInt(parse('stagger') ? (parse('stagger',true).val ? parse('stagger',true).val : 100) : 100);
+
+ return self._execFilter('_parseEffects', effects);
+ },
+
+ /**
+ * Build State
+ * @since 2.0.0
+ * @param {boolean} future
+ * @return {object} futureState
+ */
+
+ _buildState: function(future){
+ var self = this,
+ state = {};
+
+ self._execAction('_buildState', 0);
+
+ state = {
+ activeFilter: self._activeFilter === '' ? 'none' : self._activeFilter,
+ activeSort: future && self._newSortString ? self._newSortString : self._activeSort,
+ fail: !self._$show.length && self._activeFilter !== '',
+ $targets: self._$targets,
+ $show: self._$show,
+ $hide: self._$hide,
+ totalTargets: self._$targets.length,
+ totalShow: self._$show.length,
+ totalHide: self._$hide.length,
+ display: future && self._newDisplay ? self._newDisplay : self.layout.display
+ };
+
+ if(future){
+ return self._execFilter('_buildState', state);
+ } else {
+ self._state = state;
+
+ self._execAction('_buildState', 1);
+ }
+ },
+
+ /**
+ * Go Mix
+ * @since 2.0.0
+ * @param {boolean} animate
+ */
+
+ _goMix: function(animate){
+ var self = this,
+ phase1 = function(){
+ if(self._chrome && (self._chrome === 31)){
+ chromeFix(self._$parent[0]);
+ }
+
+ self._setInter();
+
+ phase2();
+ },
+ phase2 = function(){
+ var scrollTop = window.pageYOffset,
+ scrollLeft = window.pageXOffset,
+ docHeight = document.documentElement.scrollHeight;
+
+ self._getInterMixData();
+
+ self._setFinal();
+
+ self._getFinalMixData();
+
+ (window.pageYOffset !== scrollTop) && window.scrollTo(scrollLeft, scrollTop);
+
+ self._prepTargets();
+
+ if(window.requestAnimationFrame){
+ requestAnimationFrame(phase3);
+ } else {
+ setTimeout(function(){
+ phase3();
+ },20);
+ }
+ },
+ phase3 = function(){
+ self._animateTargets();
+
+ if(self._targetsBound === 0){
+ self._cleanUp();
+ }
+ },
+ chromeFix = function(grid){
+ var parent = grid.parentElement,
+ placeholder = document.createElement('div'),
+ frag = document.createDocumentFragment();
+
+ parent.insertBefore(placeholder, grid);
+ frag.appendChild(grid);
+ parent.replaceChild(grid, placeholder);
+ },
+ futureState = self._buildState(true);
+
+ self._execAction('_goMix', 0, arguments);
+
+ !self.animation.duration && (animate = false);
+
+ self._mixing = true;
+
+ self._$container.removeClass(self.layout.containerClassFail);
+
+ if(typeof self.callbacks.onMixStart === 'function'){
+ self.callbacks.onMixStart.call(self._domNode, self._state, futureState, self);
+ }
+
+ self._$container.trigger('mixStart', [self._state, futureState, self]);
+
+ self._getOrigMixData();
+
+ if(animate && !self._suckMode){
+
+ window.requestAnimationFrame ?
+ requestAnimationFrame(phase1) :
+ phase1();
+
+ } else {
+ self._cleanUp();
+ }
+
+ self._execAction('_goMix', 1, arguments);
+ },
+
+ /**
+ * Get Target Data
+ * @since 2.0.0
+ */
+
+ _getTargetData: function(el, stage){
+ var self = this,
+ elStyle;
+
+ el.dataset[stage+'PosX'] = el.offsetLeft;
+ el.dataset[stage+'PosY'] = el.offsetTop;
+
+ if(self.animation.animateResizeTargets){
+ elStyle = window.getComputedStyle(el);
+
+ el.dataset[stage+'MarginBottom'] = parseInt(elStyle.marginBottom);
+ el.dataset[stage+'MarginRight'] = parseInt(elStyle.marginRight);
+ el.dataset[stage+'Width'] = el.offsetWidth;
+ el.dataset[stage+'Height'] = el.offsetHeight;
+ }
+ },
+
+ /**
+ * Get Original Mix Data
+ * @since 2.0.0
+ */
+
+ _getOrigMixData: function(){
+ var self = this,
+ parentStyle = !self._suckMode ? window.getComputedStyle(self._$parent[0]) : {boxSizing: ''},
+ parentBS = parentStyle.boxSizing || parentStyle[self._vendor+'BoxSizing'];
+
+ self._incPadding = (parentBS === 'border-box');
+
+ self._execAction('_getOrigMixData', 0);
+
+ !self._suckMode && (self.effects = self._parseEffects());
+
+ self._$toHide = self._$hide.filter(':visible');
+ self._$toShow = self._$show.filter(':hidden');
+ self._$pre = self._$targets.filter(':visible');
+
+ self._startHeight = self._incPadding ?
+ self._$parent.outerHeight() :
+ self._$parent.height();
+
+ for(var i = 0; i < self._$pre.length; i++){
+ var el = self._$pre[i];
+
+ self._getTargetData(el, 'orig');
+ }
+
+ self._execAction('_getOrigMixData', 1);
+ },
+
+ /**
+ * Set Intermediate Positions
+ * @since 2.0.0
+ */
+
+ _setInter: function(){
+ var self = this;
+
+ self._execAction('_setInter', 0);
+
+ if(self._changingLayout && self.animation.animateChangeLayout){
+ self._$toShow.css('display',self._newDisplay);
+
+ if(self._changingClass){
+ self._$container
+ .removeClass(self.layout.containerClass)
+ .addClass(self._newClass);
+ }
+ } else {
+ self._$toShow.css('display', self.layout.display);
+ }
+
+ self._execAction('_setInter', 1);
+ },
+
+ /**
+ * Get Intermediate Mix Data
+ * @since 2.0.0
+ */
+
+ _getInterMixData: function(){
+ var self = this;
+
+ self._execAction('_getInterMixData', 0);
+
+ for(var i = 0; i < self._$toShow.length; i++){
+ var el = self._$toShow[i];
+
+ self._getTargetData(el, 'inter');
+ }
+
+ for(var i = 0; i < self._$pre.length; i++){
+ var el = self._$pre[i];
+
+ self._getTargetData(el, 'inter');
+ }
+
+ self._execAction('_getInterMixData', 1);
+ },
+
+ /**
+ * Set Final Positions
+ * @since 2.0.0
+ */
+
+ _setFinal: function(){
+ var self = this;
+
+ self._execAction('_setFinal', 0);
+
+ self._sorting && self._printSort();
+
+ self._$toHide.removeStyle('display');
+
+ if(self._changingLayout && self.animation.animateChangeLayout){
+ self._$pre.css('display',self._newDisplay);
+ }
+
+ self._execAction('_setFinal', 1);
+ },
+
+ /**
+ * Get Final Mix Data
+ * @since 2.0.0
+ */
+
+ _getFinalMixData: function(){
+ var self = this;
+
+ self._execAction('_getFinalMixData', 0);
+
+ for(var i = 0; i < self._$toShow.length; i++){
+ var el = self._$toShow[i];
+
+ self._getTargetData(el, 'final');
+ }
+
+ for(var i = 0; i < self._$pre.length; i++){
+ var el = self._$pre[i];
+
+ self._getTargetData(el, 'final');
+ }
+
+ self._newHeight = self._incPadding ?
+ self._$parent.outerHeight() :
+ self._$parent.height();
+
+ self._sorting && self._printSort(true);
+
+ self._$toShow.removeStyle('display');
+
+ self._$pre.css('display',self.layout.display);
+
+ if(self._changingClass && self.animation.animateChangeLayout){
+ self._$container
+ .removeClass(self._newClass)
+ .addClass(self.layout.containerClass);
+ }
+
+ self._execAction('_getFinalMixData', 1);
+ },
+
+ /**
+ * Prepare Targets
+ * @since 2.0.0
+ */
+
+ _prepTargets: function(){
+ var self = this,
+ transformCSS = {
+ _in: self._getPrefixedCSS('transform', self.effects.transformIn),
+ _out: self._getPrefixedCSS('transform', self.effects.transformOut)
+ };
+
+ self._execAction('_prepTargets', 0);
+
+ if(self.animation.animateResizeContainer){
+ self._$parent.css('height',self._startHeight+'px');
+ }
+
+ for(var i = 0; i < self._$toShow.length; i++){
+ var el = self._$toShow[i],
+ $el = $(el);
+
+ el.style.opacity = self.effects.opacity;
+ el.style.display = (self._changingLayout && self.animation.animateChangeLayout) ?
+ self._newDisplay :
+ self.layout.display;
+
+ $el.css(transformCSS._in);
+
+ if(self.animation.animateResizeTargets){
+ el.style.width = el.dataset.finalWidth+'px';
+ el.style.height = el.dataset.finalHeight+'px';
+ el.style.marginRight = -(el.dataset.finalWidth - el.dataset.interWidth) + (el.dataset.finalMarginRight * 1)+'px';
+ el.style.marginBottom = -(el.dataset.finalHeight - el.dataset.interHeight) + (el.dataset.finalMarginBottom * 1)+'px';
+ }
+ }
+
+ for(var i = 0; i < self._$pre.length; i++){
+ var el = self._$pre[i],
+ $el = $(el),
+ translate = {
+ x: el.dataset.origPosX - el.dataset.interPosX,
+ y: el.dataset.origPosY - el.dataset.interPosY
+ },
+ transformCSS = self._getPrefixedCSS('transform','translate('+translate.x+'px,'+translate.y+'px)');
+
+ $el.css(transformCSS);
+
+ if(self.animation.animateResizeTargets){
+ el.style.width = el.dataset.origWidth+'px';
+ el.style.height = el.dataset.origHeight+'px';
+
+ if(el.dataset.origWidth - el.dataset.finalWidth){
+ el.style.marginRight = -(el.dataset.origWidth - el.dataset.interWidth) + (el.dataset.origMarginRight * 1)+'px';
+ }
+
+ if(el.dataset.origHeight - el.dataset.finalHeight){
+ el.style.marginBottom = -(el.dataset.origHeight - el.dataset.interHeight) + (el.dataset.origMarginBottom * 1) +'px';
+ }
+ }
+ }
+
+ self._execAction('_prepTargets', 1);
+ },
+
+ /**
+ * Animate Targets
+ * @since 2.0.0
+ */
+
+ _animateTargets: function(){
+ var self = this;
+
+ self._execAction('_animateTargets', 0);
+
+ self._targetsDone = 0;
+ self._targetsBound = 0;
+
+ self._$parent
+ .css(self._getPrefixedCSS('perspective', self.animation.perspectiveDistance+'px'))
+ .css(self._getPrefixedCSS('perspective-origin', self.animation.perspectiveOrigin));
+
+ if(self.animation.animateResizeContainer){
+ self._$parent
+ .css(self._getPrefixedCSS('transition','height '+self.animation.duration+'ms ease'))
+ .css('height',self._newHeight+'px');
+ }
+
+ for(var i = 0; i < self._$toShow.length; i++){
+ var el = self._$toShow[i],
+ $el = $(el),
+ translate = {
+ x: el.dataset.finalPosX - el.dataset.interPosX,
+ y: el.dataset.finalPosY - el.dataset.interPosY
+ },
+ delay = self._getDelay(i),
+ toShowCSS = {};
+
+ el.style.opacity = '';
+
+ for(var j = 0; j < 2; j++){
+ var a = j === 0 ? a = self._prefix : '';
+
+ if(self._ff && self._ff <= 20){
+ toShowCSS[a+'transition-property'] = 'all';
+ toShowCSS[a+'transition-timing-function'] = self.animation.easing+'ms';
+ toShowCSS[a+'transition-duration'] = self.animation.duration+'ms';
+ }
+
+ toShowCSS[a+'transition-delay'] = delay+'ms';
+ toShowCSS[a+'transform'] = 'translate('+translate.x+'px,'+translate.y+'px)';
+ }
+
+ if(self.effects.transform || self.effects.opacity){
+ self._bindTargetDone($el);
+ }
+
+ (self._ff && self._ff <= 20) ?
+ $el.css(toShowCSS) :
+ $el.css(self.effects.transition).css(toShowCSS);
+ }
+
+ for(var i = 0; i < self._$pre.length; i++){
+ var el = self._$pre[i],
+ $el = $(el),
+ translate = {
+ x: el.dataset.finalPosX - el.dataset.interPosX,
+ y: el.dataset.finalPosY - el.dataset.interPosY
+ },
+ delay = self._getDelay(i);
+
+ if(!(
+ el.dataset.finalPosX === el.dataset.origPosX &&
+ el.dataset.finalPosY === el.dataset.origPosY
+ )){
+ self._bindTargetDone($el);
+ }
+
+ $el.css(self._getPrefixedCSS('transition', 'all '+self.animation.duration+'ms '+self.animation.easing+' '+delay+'ms'));
+ $el.css(self._getPrefixedCSS('transform', 'translate('+translate.x+'px,'+translate.y+'px)'));
+
+ if(self.animation.animateResizeTargets){
+ if(el.dataset.origWidth - el.dataset.finalWidth && el.dataset.finalWidth * 1){
+ el.style.width = el.dataset.finalWidth+'px';
+ el.style.marginRight = -(el.dataset.finalWidth - el.dataset.interWidth)+(el.dataset.finalMarginRight * 1)+'px';
+ }
+
+ if(el.dataset.origHeight - el.dataset.finalHeight && el.dataset.finalHeight * 1){
+ el.style.height = el.dataset.finalHeight+'px';
+ el.style.marginBottom = -(el.dataset.finalHeight - el.dataset.interHeight)+(el.dataset.finalMarginBottom * 1) +'px';
+ }
+ }
+ }
+
+ if(self._changingClass){
+ self._$container
+ .removeClass(self.layout.containerClass)
+ .addClass(self._newClass);
+ }
+
+ for(var i = 0; i < self._$toHide.length; i++){
+ var el = self._$toHide[i],
+ $el = $(el),
+ delay = self._getDelay(i),
+ toHideCSS = {};
+
+ for(var j = 0; j<2; j++){
+ var a = j === 0 ? a = self._prefix : '';
+
+ toHideCSS[a+'transition-delay'] = delay+'ms';
+ toHideCSS[a+'transform'] = self.effects.transformOut;
+ toHideCSS.opacity = self.effects.opacity;
+ }
+
+ $el.css(self.effects.transition).css(toHideCSS);
+
+ if(self.effects.transform || self.effects.opacity){
+ self._bindTargetDone($el);
+ };
+ }
+
+ self._execAction('_animateTargets', 1);
+
+ },
+
+ /**
+ * Bind Targets TransitionEnd
+ * @since 2.0.0
+ * @param {object} $el
+ */
+
+ _bindTargetDone: function($el){
+ var self = this,
+ el = $el[0];
+
+ self._execAction('_bindTargetDone', 0, arguments);
+
+ if(!el.dataset.bound){
+
+ el.dataset.bound = true;
+ self._targetsBound++;
+
+ $el.on('webkitTransitionEnd.mixItUp transitionend.mixItUp',function(e){
+ if(
+ (e.originalEvent.propertyName.indexOf('transform') > -1 ||
+ e.originalEvent.propertyName.indexOf('opacity') > -1) &&
+ $(e.originalEvent.target).is(self.selectors.target)
+ ){
+ $el.off('.mixItUp');
+ delete el.dataset.bound;
+ self._targetDone();
+ }
+ });
+ }
+
+ self._execAction('_bindTargetDone', 1, arguments);
+ },
+
+ /**
+ * Target Done
+ * @since 2.0.0
+ */
+
+ _targetDone: function(){
+ var self = this;
+
+ self._execAction('_targetDone', 0);
+
+ self._targetsDone++;
+
+ (self._targetsDone === self._targetsBound) && self._cleanUp();
+
+ self._execAction('_targetDone', 1);
+ },
+
+ /**
+ * Clean Up
+ * @since 2.0.0
+ */
+
+ _cleanUp: function(){
+ var self = this,
+ targetStyles = self.animation.animateResizeTargets ? 'transform opacity width height margin-bottom margin-right' : 'transform opacity';
+ unBrake = function(){
+ self._$targets.removeStyle('transition', self._prefix);
+ };
+
+ self._execAction('_cleanUp', 0);
+
+ !self._changingLayout ?
+ self._$show.css('display',self.layout.display) :
+ self._$show.css('display',self._newDisplay);
+
+ self._$targets.css(self._brake);
+
+ self._$targets
+ .removeStyle(targetStyles, self._prefix)
+ .removeAttr('data-inter-pos-x data-inter-pos-y data-final-pos-x data-final-pos-y data-orig-pos-x data-orig-pos-y data-orig-height data-orig-width data-final-height data-final-width data-inter-width data-inter-height data-orig-margin-right data-orig-margin-bottom data-inter-margin-right data-inter-margin-bottom data-final-margin-right data-final-margin-bottom');
+
+ self._$hide.removeStyle('display');
+
+ self._$parent.removeStyle('height transition perspective-distance perspective perspective-origin-x perspective-origin-y perspective-origin perspectiveOrigin', self._prefix);
+
+ if(self._sorting){
+ self._printSort();
+ self._activeSort = self._newSortString;
+ self._sorting = false;
+ }
+
+ if(self._changingLayout){
+ if(self._changingDisplay){
+ self.layout.display = self._newDisplay;
+ self._changingDisplay = false;
+ }
+
+ if(self._changingClass){
+ self._$parent.removeClass(self.layout.containerClass).addClass(self._newClass);
+ self.layout.containerClass = self._newClass;
+ self._changingClass = false;
+ }
+
+ self._changingLayout = false;
+ }
+
+ self._refresh();
+
+ self._buildState();
+
+ if(self._state.fail){
+ self._$container.addClass(self.layout.containerClassFail);
+ }
+
+ self._$show = $();
+ self._$hide = $();
+
+ if(window.requestAnimationFrame){
+ requestAnimationFrame(unBrake);
+ }
+
+ self._mixing = false;
+
+ if(typeof self.callbacks._user === 'function'){
+ self.callbacks._user.call(self._domNode, self._state, self);
+ }
+
+ if(typeof self.callbacks.onMixEnd === 'function'){
+ self.callbacks.onMixEnd.call(self._domNode, self._state, self);
+ }
+
+ self._$container.trigger('mixEnd', [self._state, self]);
+
+ if(self._state.fail){
+ (typeof self.callbacks.onMixFail === 'function') && self.callbacks.onMixFail.call(self._domNode, self._state, self);
+ self._$container.trigger('mixFail', [self._state, self]);
+ }
+
+ if(self._loading){
+ (typeof self.callbacks.onMixLoad === 'function') && self.callbacks.onMixLoad.call(self._domNode, self._state, self);
+ self._$container.trigger('mixLoad', [self._state, self]);
+ }
+
+ if(self._queue.length){
+ self._execAction('_queue', 0);
+
+ self.multiMix(self._queue[0][0],self._queue[0][1],self._queue[0][2]);
+ self._queue.splice(0, 1);
+ }
+
+ self._execAction('_cleanUp', 1);
+
+ self._loading = false;
+ },
+
+ /**
+ * Get Prefixed CSS
+ * @since 2.0.0
+ * @param {string} property
+ * @param {string} value
+ * @param {boolean} prefixValue
+ * @return {object} styles
+ */
+
+ _getPrefixedCSS: function(property, value, prefixValue){
+ var self = this,
+ styles = {};
+
+ for(i = 0; i < 2; i++){
+ var prefix = i === 0 ? self._prefix : '';
+ prefixValue ? styles[prefix+property] = prefix+value : styles[prefix+property] = value;
+ }
+
+ return self._execFilter('_getPrefixedCSS', styles, arguments);
+ },
+
+ /**
+ * Get Delay
+ * @since 2.0.0
+ * @param {number} i
+ * @return {number} delay
+ */
+
+ _getDelay: function(i){
+ var self = this,
+ n = typeof self.animation.staggerSequence === 'function' ? self.animation.staggerSequence.call(self._domNode, i, self._state) : i,
+ delay = self.animation.stagger ? n * self.animation.staggerDuration : 0;
+
+ return self._execFilter('_getDelay', delay, arguments);
+ },
+
+ /**
+ * Parse MultiMix Arguments
+ * @since 2.0.0
+ * @param {array} args
+ * @return {object} output
+ */
+
+ _parseMultiMixArgs: function(args){
+ var self = this,
+ output = {
+ command: null,
+ animate: self.animation.enable,
+ callback: null
+ };
+
+ for(var i = 0; i < args.length; i++){
+ var arg = args[i];
+
+ if(arg !== null){
+ if(typeof arg === 'object' || typeof arg === 'string'){
+ output.command = arg;
+ } else if(typeof arg === 'boolean'){
+ output.animate = arg;
+ } else if(typeof arg === 'function'){
+ output.callback = arg;
+ }
+ }
+ }
+
+ return self._execFilter('_parseMultiMixArgs', output, arguments);
+ },
+
+ /**
+ * Parse Insert Arguments
+ * @since 2.0.0
+ * @param {array} args
+ * @return {object} output
+ */
+
+ _parseInsertArgs: function(args){
+ var self = this,
+ output = {
+ index: 0,
+ $object: $(),
+ multiMix: {filter: self._state.activeFilter},
+ callback: null
+ };
+
+ for(var i = 0; i < args.length; i++){
+ var arg = args[i];
+
+ if(typeof arg === 'number'){
+ output.index = arg;
+ } else if(typeof arg === 'object' && arg instanceof $){
+ output.$object = arg;
+ } else if(typeof arg === 'object' && self._helpers._isElement(arg)){
+ output.$object = $(arg);
+ } else if(typeof arg === 'object' && arg !== null){
+ output.multiMix = arg;
+ } else if(typeof arg === 'boolean' && !arg){
+ output.multiMix = false;
+ } else if(typeof arg === 'function'){
+ output.callback = arg;
+ }
+ }
+
+ return self._execFilter('_parseInsertArgs', output, arguments);
+ },
+
+ /**
+ * Execute Action
+ * @since 2.0.0
+ * @param {string} methodName
+ * @param {boolean} isPost
+ * @param {array} args
+ */
+
+ _execAction: function(methodName, isPost, args){
+ var self = this,
+ context = isPost ? 'post' : 'pre';
+
+ if(!self._actions.isEmptyObject && self._actions.hasOwnProperty(methodName)){
+ for(var key in self._actions[methodName][context]){
+ self._actions[methodName][context][key].call(self, args);
+ }
+ }
+ },
+
+ /**
+ * Execute Filter
+ * @since 2.0.0
+ * @param {string} methodName
+ * @param {mixed} value
+ * @return {mixed} value
+ */
+
+ _execFilter: function(methodName, value, args){
+ var self = this;
+
+ if(!self._filters.isEmptyObject && self._filters.hasOwnProperty(methodName)){
+ for(var key in self._filters[methodName]){
+ return self._filters[methodName][key].call(self, args);
+ }
+ } else {
+ return value;
+ }
+ },
+
+ /* Helpers
+ ---------------------------------------------------------------------- */
+
+ _helpers: {
+
+ /**
+ * CamelCase
+ * @since 2.0.0
+ * @param {string}
+ * @return {string}
+ */
+
+ _camelCase: function(string){
+ return string.replace(/-([a-z])/g, function(g){
+ return g[1].toUpperCase();
+ });
+ },
+
+ /**
+ * Is Element
+ * @since 2.1.3
+ * @param {object} element to test
+ * @return {boolean}
+ */
+
+ _isElement: function(el){
+ if(window.HTMLElement){
+ return el instanceof HTMLElement;
+ } else {
+ return (
+ el !== null &&
+ el.nodeType === 1 &&
+ el.nodeName === 'string'
+ );
+ }
+ }
+ },
+
+ /* Public Methods
+ ---------------------------------------------------------------------- */
+
+ /**
+ * Is Mixing
+ * @since 2.0.0
+ * @return {boolean}
+ */
+
+ isMixing: function(){
+ var self = this;
+
+ return self._execFilter('isMixing', self._mixing);
+ },
+
+ /**
+ * Filter (public)
+ * @since 2.0.0
+ * @param {array} arguments
+ */
+
+ filter: function(){
+ var self = this,
+ args = self._parseMultiMixArgs(arguments);
+
+ self._clicking && (self._toggleString = '');
+
+ self.multiMix({filter: args.command}, args.animate, args.callback);
+ },
+
+ /**
+ * Sort (public)
+ * @since 2.0.0
+ * @param {array} arguments
+ */
+
+ sort: function(){
+ var self = this,
+ args = self._parseMultiMixArgs(arguments);
+
+ self.multiMix({sort: args.command}, args.animate, args.callback);
+ },
+
+ /**
+ * Change Layout (public)
+ * @since 2.0.0
+ * @param {array} arguments
+ */
+
+ changeLayout: function(){
+ var self = this,
+ args = self._parseMultiMixArgs(arguments);
+
+ self.multiMix({changeLayout: args.command}, args.animate, args.callback);
+ },
+
+ /**
+ * MultiMix
+ * @since 2.0.0
+ * @param {array} arguments
+ */
+
+ multiMix: function(){
+ var self = this,
+ args = self._parseMultiMixArgs(arguments);
+
+ self._execAction('multiMix', 0, arguments);
+
+ if(!self._mixing){
+ if(self.controls.enable && !self._clicking){
+ self.controls.toggleFilterButtons && self._buildToggleArray();
+ self._updateControls(args.command, self.controls.toggleFilterButtons);
+ }
+
+ (self._queue.length < 2) && (self._clicking = false);
+
+ delete self.callbacks._user;
+ if(args.callback) self.callbacks._user = args.callback;
+
+ var sort = args.command.sort,
+ filter = args.command.filter,
+ changeLayout = args.command.changeLayout;
+
+ self._refresh();
+
+ if(sort){
+ self._newSort = self._parseSort(sort);
+ self._newSortString = sort;
+
+ self._sorting = true;
+ self._sort();
+ }
+
+ if(filter !== undf){
+ filter = (filter === 'all') ? self.selectors.target : filter;
+
+ self._activeFilter = filter;
+ }
+
+ self._filter();
+
+ if(changeLayout){
+ self._newDisplay = (typeof changeLayout === 'string') ? changeLayout : changeLayout.display || self.layout.display;
+ self._newClass = changeLayout.containerClass || '';
+
+ if(
+ self._newDisplay !== self.layout.display ||
+ self._newClass !== self.layout.containerClass
+ ){
+ self._changingLayout = true;
+
+ self._changingClass = (self._newClass !== self.layout.containerClass);
+ self._changingDisplay = (self._newDisplay !== self.layout.display);
+ }
+ }
+
+ self._$targets.css(self._brake);
+
+ self._goMix(args.animate ^ self.animation.enable ? args.animate : self.animation.enable);
+
+ self._execAction('multiMix', 1, arguments);
+
+ } else {
+ if(self.animation.queue && self._queue.length < self.animation.queueLimit){
+ self._queue.push(arguments);
+
+ (self.controls.enable && !self._clicking) && self._updateControls(args.command);
+
+ self._execAction('multiMixQueue', 1, arguments);
+
+ } else {
+ if(typeof self.callbacks.onMixBusy === 'function'){
+ self.callbacks.onMixBusy.call(self._domNode, self._state, self);
+ }
+ self._$container.trigger('mixBusy', [self._state, self]);
+
+ self._execAction('multiMixBusy', 1, arguments);
+ }
+ }
+ },
+
+ /**
+ * Insert
+ * @since 2.0.0
+ * @param {array} arguments
+ */
+
+ insert: function(){
+ var self = this,
+ args = self._parseInsertArgs(arguments),
+ callback = (typeof args.callback === 'function') ? args.callback : null,
+ frag = document.createDocumentFragment(),
+ target = (function(){
+ self._refresh();
+
+ if(self._$targets.length){
+ return (args.index < self._$targets.length || !self._$targets.length) ?
+ self._$targets[args.index] :
+ self._$targets[self._$targets.length-1].nextElementSibling;
+ } else {
+ return self._$parent[0].children[0];
+ }
+ })();
+
+ self._execAction('insert', 0, arguments);
+
+ if(args.$object){
+ for(var i = 0; i < args.$object.length; i++){
+ var el = args.$object[i];
+
+ frag.appendChild(el);
+ frag.appendChild(document.createTextNode(' '));
+ }
+
+ self._$parent[0].insertBefore(frag, target);
+ }
+
+ self._execAction('insert', 1, arguments);
+
+ if(typeof args.multiMix === 'object'){
+ self.multiMix(args.multiMix, callback);
+ }
+ },
+
+ /**
+ * Prepend
+ * @since 2.0.0
+ * @param {array} arguments
+ */
+
+ prepend: function(){
+ var self = this,
+ args = self._parseInsertArgs(arguments);
+
+ self.insert(0, args.$object, args.multiMix, args.callback);
+ },
+
+ /**
+ * Append
+ * @since 2.0.0
+ * @param {array} arguments
+ */
+
+ append: function(){
+ var self = this,
+ args = self._parseInsertArgs(arguments);
+
+ self.insert(self._state.totalTargets, args.$object, args.multiMix, args.callback);
+ },
+
+ /**
+ * Get Option
+ * @since 2.0.0
+ * @param {string} string
+ * @return {mixed} value
+ */
+
+ getOption: function(string){
+ var self = this,
+ getProperty = function(obj, prop){
+ var parts = prop.split('.'),
+ last = parts.pop(),
+ l = parts.length,
+ i = 1,
+ current = parts[0] || prop;
+
+ while((obj = obj[current]) && i < l){
+ current = parts[i];
+ i++;
+ }
+
+ if(obj !== undf){
+ return obj[last] !== undf ? obj[last] : obj;
+ }
+ };
+
+ return string ? self._execFilter('getOption', getProperty(self, string), arguments) : self;
+ },
+
+ /**
+ * Set Options
+ * @since 2.0.0
+ * @param {object} config
+ */
+
+ setOptions: function(config){
+ var self = this;
+
+ self._execAction('setOptions', 0, arguments);
+
+ typeof config === 'object' && $.extend(true, self, config);
+
+ self._execAction('setOptions', 1, arguments);
+ },
+
+ /**
+ * Get State
+ * @since 2.0.0
+ * @return {object} state
+ */
+
+ getState: function(){
+ var self = this;
+
+ return self._execFilter('getState', self._state, self);
+ },
+
+ /**
+ * Force Refresh
+ * @since 2.1.2
+ */
+
+ forceRefresh: function(){
+ var self = this;
+
+ self._refresh(false, true);
+ },
+
+ /**
+ * Destroy
+ * @since 2.0.0
+ * @param {boolean} hideAll
+ */
+
+ destroy: function(hideAll){
+ var self = this;
+
+ self._execAction('destroy', 0, arguments);
+
+ self._$body
+ .add($(self.selectors.sort))
+ .add($(self.selectors.filter))
+ .off('.mixItUp');
+
+ for(var i = 0; i < self._$targets.length; i++){
+ var target = self._$targets[i];
+
+ hideAll && (target.style.display = '');
+
+ delete target.mixParent;
+ }
+
+ self._execAction('destroy', 1, arguments);
+
+ delete $.MixItUp.prototype._instances[self._id];
+ }
+
+ };
+
+ /* jQuery Methods
+ ---------------------------------------------------------------------- */
+
+ /**
+ * jQuery .mixItUp() method
+ * @since 2.0.0
+ * @extends $.fn
+ */
+
+ $.fn.mixItUp = function(){
+ var args = arguments,
+ dataReturn = [],
+ eachReturn,
+ _instantiate = function(domNode, settings){
+ var instance = new $.MixItUp(),
+ rand = function(){
+ return ('00000'+(Math.random()*16777216<<0).toString(16)).substr(-6).toUpperCase();
+ };
+
+ instance._execAction('_instantiate', 0, arguments);
+
+ domNode.id = !domNode.id ? 'MixItUp'+rand() : domNode.id;
+
+ if(!instance._instances[domNode.id]){
+ instance._instances[domNode.id] = instance;
+ instance._init(domNode, settings);
+ }
+
+ instance._execAction('_instantiate', 1, arguments);
+ };
+
+ eachReturn = this.each(function(){
+ if(args && typeof args[0] === 'string'){
+ var instance = $.MixItUp.prototype._instances[this.id];
+ if(args[0] === 'isLoaded'){
+ dataReturn.push(instance ? true : false);
+ } else {
+ var data = instance[args[0]](args[1], args[2], args[3]);
+ if(data !== undf)dataReturn.push(data);
+ }
+ } else {
+ _instantiate(this, args[0]);
+ }
+ });
+
+ if(dataReturn.length){
+ return dataReturn.length > 1 ? dataReturn : dataReturn[0];
+ } else {
+ return eachReturn;
+ }
+ };
+
+ /**
+ * jQuery .removeStyle() method
+ * @since 2.0.0
+ * @extends $.fn
+ */
+
+ $.fn.removeStyle = function(style, prefix){
+ prefix = prefix ? prefix : '';
+
+ return this.each(function(){
+ var el = this,
+ styles = style.split(' ');
+
+ for(var i = 0; i < styles.length; i++){
+ for(var j = 0; j < 4; j++){
+ switch (j) {
+ case 0:
+ var prop = styles[i];
+ break;
+ case 1:
+ var prop = $.MixItUp.prototype._helpers._camelCase(prop);
+ break;
+ case 2:
+ var prop = prefix+styles[i];
+ break;
+ case 3:
+ var prop = $.MixItUp.prototype._helpers._camelCase(prefix+styles[i]);
+ }
+
+ if(
+ el.style[prop] !== undf &&
+ typeof el.style[prop] !== 'unknown' &&
+ el.style[prop].length > 0
+ ){
+ el.style[prop] = '';
+ }
+
+ if(!prefix && j === 1)break;
+ }
+ }
+
+ if(el.attributes && el.attributes.style && el.attributes.style !== undf && el.attributes.style.value === ''){
+ el.attributes.removeNamedItem('style');
+ }
+ });
+ };
+
+})(jQuery);
\ No newline at end of file
diff --git a/django_code/templates/cloudmanager/js/jquery.mixitup.min.js b/django_code/templates/cloudmanager/js/jquery.mixitup.min.js
new file mode 100644
index 0000000..0b17aa7
--- /dev/null
+++ b/django_code/templates/cloudmanager/js/jquery.mixitup.min.js
@@ -0,0 +1,14 @@
+/**!
+ * MixItUp v2.1.7
+ *
+ * @copyright Copyright 2014 KunkaLabs Limited.
+ * @author KunkaLabs Limited.
+ * @link https://mixitup.kunkalabs.com
+ *
+ * @license Commercial use requires a commercial license.
+ * https://mixitup.kunkalabs.com/licenses/
+ *
+ * Non-commercial use permitted under terms of CC-BY-NC license.
+ * http://creativecommons.org/licenses/by-nc/3.0/
+ */
+!function(a,b){a.MixItUp=function(){var b=this;b._execAction("_constructor",0),a.extend(b,{selectors:{target:".mix",filter:".filter",sort:".sort"},animation:{enable:!0,effects:"fade scale",duration:600,easing:"ease",perspectiveDistance:"3000",perspectiveOrigin:"50% 50%",queue:!0,queueLimit:1,animateChangeLayout:!1,animateResizeContainer:!0,animateResizeTargets:!1,staggerSequence:!1,reverseOut:!1},callbacks:{onMixLoad:!1,onMixStart:!1,onMixBusy:!1,onMixEnd:!1,onMixFail:!1,_user:!1},controls:{enable:!0,live:!1,toggleFilterButtons:!1,toggleLogic:"or",activeClass:"active"},layout:{display:"inline-block",containerClass:"",containerClassFail:"fail"},load:{filter:"all",sort:!1},_$body:null,_$container:null,_$targets:null,_$parent:null,_$sortButtons:null,_$filterButtons:null,_suckMode:!1,_mixing:!1,_sorting:!1,_clicking:!1,_loading:!0,_changingLayout:!1,_changingClass:!1,_changingDisplay:!1,_origOrder:[],_startOrder:[],_newOrder:[],_activeFilter:null,_toggleArray:[],_toggleString:"",_activeSort:"default:asc",_newSort:null,_startHeight:null,_newHeight:null,_incPadding:!0,_newDisplay:null,_newClass:null,_targetsBound:0,_targetsDone:0,_queue:[],_$show:a(),_$hide:a()}),b._execAction("_constructor",1)},a.MixItUp.prototype={constructor:a.MixItUp,_instances:{},_handled:{_filter:{},_sort:{}},_bound:{_filter:{},_sort:{}},_actions:{},_filters:{},extend:function(b){for(var c in b)a.MixItUp.prototype[c]=b[c]},addAction:function(b,c,d,e){a.MixItUp.prototype._addHook("_actions",b,c,d,e)},addFilter:function(b,c,d,e){a.MixItUp.prototype._addHook("_filters",b,c,d,e)},_addHook:function(b,c,d,e,f){var g=a.MixItUp.prototype[b],h={};f=1===f||"post"===f?"post":"pre",h[c]={},h[c][f]={},h[c][f][d]=e,a.extend(!0,g,h)},_init:function(b,c){var d=this;if(d._execAction("_init",0,arguments),c&&a.extend(!0,d,c),d._$body=a("body"),d._domNode=b,d._$container=a(b),d._$container.addClass(d.layout.containerClass),d._id=b.id,d._platformDetect(),d._brake=d._getPrefixedCSS("transition","none"),d._refresh(!0),d._$parent=d._$targets.parent().length?d._$targets.parent():d._$container,d.load.sort&&(d._newSort=d._parseSort(d.load.sort),d._newSortString=d.load.sort,d._activeSort=d.load.sort,d._sort(),d._printSort()),d._activeFilter="all"===d.load.filter?d.selectors.target:"none"===d.load.filter?"":d.load.filter,d.controls.enable&&d._bindHandlers(),d.controls.toggleFilterButtons){d._buildToggleArray();for(var e=0;e
-1){var k=d._helpers._camelCase(i.substring(5,i.length));f.dataset[k]=j}}}f.mixParent===b&&(f.mixParent=d._id)}if(d._$targets.length&&a||!d._origOrder.length&&d._$targets.length){d._origOrder=[];for(var e=0;e-1)&&(a(e.selectors.sort).removeClass(e.controls.activeClass),f(c,d),e.sort(g))}if("filter"===d){var h,i=c.attr("data-filter"),j="or"===e.controls.toggleLogic?",":"";e.controls.toggleFilterButtons?(e._buildToggleArray(),c.hasClass(e.controls.activeClass)?(f(c,d,!0),h=e._toggleArray.indexOf(i),e._toggleArray.splice(h,1)):(f(c,d),e._toggleArray.push(i)),e._toggleArray=a.grep(e._toggleArray,function(a){return a}),e._toggleString=e._toggleArray.join(j),e.filter(e._toggleString)):c.hasClass(e.controls.activeClass)||(a(e.selectors.filter).removeClass(e.controls.activeClass),f(c,d),e.filter(i))}e._execAction("_processClick",1,arguments)}else"function"==typeof e.callbacks.onMixBusy&&e.callbacks.onMixBusy.call(e._domNode,e._state,e),e._execAction("_processClickBusy",1,arguments)},_buildToggleArray:function(){var a=this,b=a._activeFilter.replace(/\s/g,"");if(a._execAction("_buildToggleArray",0,arguments),"or"===a.controls.toggleLogic)a._toggleArray=b.split(",");else{a._toggleArray=b.split("."),!a._toggleArray[0]&&a._toggleArray.shift();for(var c,d=0;c=a._toggleArray[d];d++)a._toggleArray[d]="."+c}a._execAction("_buildToggleArray",1,arguments)},_updateControls:function(c,d){var e=this,f={filter:c.filter,sort:c.sort},g=function(a,b){d&&"filter"===h&&"none"!==f.filter&&""!==f.filter?a.filter(b).addClass(e.controls.activeClass):a.removeClass(e.controls.activeClass).filter(b).addClass(e.controls.activeClass)},h="filter",i=null;e._execAction("_updateControls",0,arguments),c.filter===b&&(f.filter=e._activeFilter),c.sort===b&&(f.sort=e._activeSort),f.filter===e.selectors.target&&(f.filter="all");for(var j=0;2>j;j++)i=e.controls.live?a(e.selectors[h]):e["_$"+h+"Buttons"],i&&g(i,"[data-"+h+'="'+f[h]+'"]'),h="sort";e._execAction("_updateControls",1,arguments)},_filter:function(){var b=this;b._execAction("_filter",0);for(var c=0;cg?"asc"===e?-1:1:g>h?"asc"===e?1:-1:g===h&&d._newSort.length>c+1?d._compare(a,b,c+1):0},_printSort:function(a){var b=this,c=a?b._startOrder:b._newOrder,d=b._$parent[0].querySelectorAll(b.selectors.target),e=d.length?d[d.length-1].nextElementSibling:null,f=document.createDocumentFragment();b._execAction("_printSort",0,arguments);for(var g=0;g-1){if(c){var d=a.animation.effects.indexOf(b+"(");if(d>-1){var e=a.animation.effects.substring(d),f=/\(([^)]+)\)/.exec(e),g=f[1];return{val:g}}}return!0}return!1},d=function(a,b){return b?"-"===a.charAt(0)?a.substr(1,a.length):"-"+a:a},e=function(a,e){for(var f=[["scale",".01"],["translateX","20px"],["translateY","20px"],["translateZ","20px"],["rotateX","90deg"],["rotateY","90deg"],["rotateZ","180deg"]],g=0;gi;i++){var j=0===i?j=b._prefix:"";b._ff&&b._ff<=20&&(h[j+"transition-property"]="all",h[j+"transition-timing-function"]=b.animation.easing+"ms",h[j+"transition-duration"]=b.animation.duration+"ms"),h[j+"transition-delay"]=g+"ms",h[j+"transform"]="translate("+f.x+"px,"+f.y+"px)"}(b.effects.transform||b.effects.opacity)&&b._bindTargetDone(e),b._ff&&b._ff<=20?e.css(h):e.css(b.effects.transition).css(h)}for(var c=0;ci;i++){var j=0===i?j=b._prefix:"";k[j+"transition-delay"]=g+"ms",k[j+"transform"]=b.effects.transformOut,k.opacity=b.effects.opacity}e.css(b.effects.transition).css(k),(b.effects.transform||b.effects.opacity)&&b._bindTargetDone(e)}b._execAction("_animateTargets",1)},_bindTargetDone:function(b){var c=this,d=b[0];c._execAction("_bindTargetDone",0,arguments),d.dataset.bound||(d.dataset.bound=!0,c._targetsBound++,b.on("webkitTransitionEnd.mixItUp transitionend.mixItUp",function(e){(e.originalEvent.propertyName.indexOf("transform")>-1||e.originalEvent.propertyName.indexOf("opacity")>-1)&&a(e.originalEvent.target).is(c.selectors.target)&&(b.off(".mixItUp"),delete d.dataset.bound,c._targetDone())})),c._execAction("_bindTargetDone",1,arguments)},_targetDone:function(){var a=this;a._execAction("_targetDone",0),a._targetsDone++,a._targetsDone===a._targetsBound&&a._cleanUp(),a._execAction("_targetDone",1)},_cleanUp:function(){var b=this,c=b.animation.animateResizeTargets?"transform opacity width height margin-bottom margin-right":"transform opacity";unBrake=function(){b._$targets.removeStyle("transition",b._prefix)},b._execAction("_cleanUp",0),b._changingLayout?b._$show.css("display",b._newDisplay):b._$show.css("display",b.layout.display),b._$targets.css(b._brake),b._$targets.removeStyle(c,b._prefix).removeAttr("data-inter-pos-x data-inter-pos-y data-final-pos-x data-final-pos-y data-orig-pos-x data-orig-pos-y data-orig-height data-orig-width data-final-height data-final-width data-inter-width data-inter-height data-orig-margin-right data-orig-margin-bottom data-inter-margin-right data-inter-margin-bottom data-final-margin-right data-final-margin-bottom"),b._$hide.removeStyle("display"),b._$parent.removeStyle("height transition perspective-distance perspective perspective-origin-x perspective-origin-y perspective-origin perspectiveOrigin",b._prefix),b._sorting&&(b._printSort(),b._activeSort=b._newSortString,b._sorting=!1),b._changingLayout&&(b._changingDisplay&&(b.layout.display=b._newDisplay,b._changingDisplay=!1),b._changingClass&&(b._$parent.removeClass(b.layout.containerClass).addClass(b._newClass),b.layout.containerClass=b._newClass,b._changingClass=!1),b._changingLayout=!1),b._refresh(),b._buildState(),b._state.fail&&b._$container.addClass(b.layout.containerClassFail),b._$show=a(),b._$hide=a(),window.requestAnimationFrame&&requestAnimationFrame(unBrake),b._mixing=!1,"function"==typeof b.callbacks._user&&b.callbacks._user.call(b._domNode,b._state,b),"function"==typeof b.callbacks.onMixEnd&&b.callbacks.onMixEnd.call(b._domNode,b._state,b),b._$container.trigger("mixEnd",[b._state,b]),b._state.fail&&("function"==typeof b.callbacks.onMixFail&&b.callbacks.onMixFail.call(b._domNode,b._state,b),b._$container.trigger("mixFail",[b._state,b])),b._loading&&("function"==typeof b.callbacks.onMixLoad&&b.callbacks.onMixLoad.call(b._domNode,b._state,b),b._$container.trigger("mixLoad",[b._state,b])),b._queue.length&&(b._execAction("_queue",0),b.multiMix(b._queue[0][0],b._queue[0][1],b._queue[0][2]),b._queue.splice(0,1)),b._execAction("_cleanUp",1),b._loading=!1},_getPrefixedCSS:function(a,b,c){var d=this,e={};for(i=0;2>i;i++){var f=0===i?d._prefix:"";e[f+a]=c?f+b:b}return d._execFilter("_getPrefixedCSS",e,arguments)},_getDelay:function(a){var b=this,c="function"==typeof b.animation.staggerSequence?b.animation.staggerSequence.call(b._domNode,a,b._state):a,d=b.animation.stagger?c*b.animation.staggerDuration:0;return b._execFilter("_getDelay",d,arguments)},_parseMultiMixArgs:function(a){for(var b=this,c={command:null,animate:b.animation.enable,callback:null},d=0;dg;)h=d[g],g++;return a!==b?a[e]!==b?a[e]:a:void 0};return a?c._execFilter("getOption",d(c,a),arguments):c},setOptions:function(b){var c=this;c._execAction("setOptions",0,arguments),"object"==typeof b&&a.extend(!0,c,b),c._execAction("setOptions",1,arguments)},getState:function(){var a=this;return a._execFilter("getState",a._state,a)},forceRefresh:function(){var a=this;a._refresh(!1,!0)},destroy:function(b){var c=this;c._execAction("destroy",0,arguments),c._$body.add(a(c.selectors.sort)).add(a(c.selectors.filter)).off(".mixItUp");for(var d=0;d1?e:e[0]:c},a.fn.removeStyle=function(c,d){return d=d?d:"",this.each(function(){for(var e=this,f=c.split(" "),g=0;gh;h++){switch(h){case 0:var i=f[g];break;case 1:var i=a.MixItUp.prototype._helpers._camelCase(i);break;case 2:var i=d+f[g];break;case 3:var i=a.MixItUp.prototype._helpers._camelCase(d+f[g])}if(e.style[i]!==b&&"unknown"!=typeof e.style[i]&&e.style[i].length>0&&(e.style[i]=""),!d&&1===h)break}e.attributes&&e.attributes.style&&e.attributes.style!==b&&""===e.attributes.style.value&&e.attributes.removeNamedItem("style")})}}(jQuery);
\ No newline at end of file
diff --git a/django_code/templates/cloudmanager/js/jquery.prettyPhoto.js b/django_code/templates/cloudmanager/js/jquery.prettyPhoto.js
new file mode 100644
index 0000000..d958202
--- /dev/null
+++ b/django_code/templates/cloudmanager/js/jquery.prettyPhoto.js
@@ -0,0 +1,7 @@
+/* ------------------------------------------------------------------------
+ Class: prettyPhoto
+ Use: Lightbox clone for jQuery
+ Author: Stephane Caron (http://www.no-margin-for-errors.com)
+ Version: 3.1.5
+------------------------------------------------------------------------- */
+(function(e){function t(){var e=location.href;hashtag=e.indexOf("#prettyPhoto")!==-1?decodeURI(e.substring(e.indexOf("#prettyPhoto")+1,e.length)):false;return hashtag}function n(){if(typeof theRel=="undefined")return;location.hash=theRel+"/"+rel_index+"/"}function r(){if(location.href.indexOf("#prettyPhoto")!==-1)location.hash="prettyPhoto"}function i(e,t){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var n="[\\?&]"+e+"=([^]*)";var r=new RegExp(n);var i=r.exec(t);return i==null?"":i[1]}e.prettyPhoto={version:"3.1.5"};e.fn.prettyPhoto=function(s){function g(){e(".pp_loaderIcon").hide();projectedTop=scroll_pos["scrollTop"]+(d/2-a["containerHeight"]/2);if(projectedTop<0)projectedTop=0;$ppt.fadeTo(settings.animation_speed,1);$pp_pic_holder.find(".pp_content").animate({height:a["contentHeight"],width:a["contentWidth"]},settings.animation_speed);$pp_pic_holder.animate({top:projectedTop,left:v/2-a["containerWidth"]/2<0?0:v/2-a["containerWidth"]/2,width:a["containerWidth"]},settings.animation_speed,function(){$pp_pic_holder.find(".pp_hoverContainer,#fullResImage").height(a["height"]).width(a["width"]);$pp_pic_holder.find(".pp_fade").fadeIn(settings.animation_speed);if(isSet&&S(pp_images[set_position])=="image"){$pp_pic_holder.find(".pp_hoverContainer").show()}else{$pp_pic_holder.find(".pp_hoverContainer").hide()}if(settings.allow_expand){if(a["resized"]){e("a.pp_expand,a.pp_contract").show()}else{e("a.pp_expand").hide()}}if(settings.autoplay_slideshow&&!m&&!f)e.prettyPhoto.startSlideshow();settings.changepicturecallback();f=true});C();s.ajaxcallback()}function y(t){$pp_pic_holder.find("#pp_full_res object,#pp_full_res embed").css("visibility","hidden");$pp_pic_holder.find(".pp_fade").fadeOut(settings.animation_speed,function(){e(".pp_loaderIcon").show();t()})}function b(t){t>1?e(".pp_nav").show():e(".pp_nav").hide()}function w(e,t){resized=false;E(e,t);imageWidth=e,imageHeight=t;if((p>v||h>d)&&doresize&&settings.allow_resize&&!u){resized=true,fitting=false;while(!fitting){if(p>v){imageWidth=v-200;imageHeight=t/e*imageWidth}else if(h>d){imageHeight=d-200;imageWidth=e/t*imageHeight}else{fitting=true}h=imageHeight,p=imageWidth}if(p>v||h>d){w(p,h)}E(imageWidth,imageHeight)}return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(h),containerWidth:Math.floor(p)+settings.horizontal_padding*2,contentHeight:Math.floor(l),contentWidth:Math.floor(c),resized:resized}}function E(t,n){t=parseFloat(t);n=parseFloat(n);$pp_details=$pp_pic_holder.find(".pp_details");$pp_details.width(t);detailsHeight=parseFloat($pp_details.css("marginTop"))+parseFloat($pp_details.css("marginBottom"));$pp_details=$pp_details.clone().addClass(settings.theme).width(t).appendTo(e("body")).css({position:"absolute",top:-1e4});detailsHeight+=$pp_details.height();detailsHeight=detailsHeight<=34?36:detailsHeight;$pp_details.remove();$pp_title=$pp_pic_holder.find(".ppt");$pp_title.width(t);titleHeight=parseFloat($pp_title.css("marginTop"))+parseFloat($pp_title.css("marginBottom"));$pp_title=$pp_title.clone().appendTo(e("body")).css({position:"absolute",top:-1e4});titleHeight+=$pp_title.height();$pp_title.remove();l=n+detailsHeight;c=t;h=l+titleHeight+$pp_pic_holder.find(".pp_top").height()+$pp_pic_holder.find(".pp_bottom").height();p=t}function S(e){if(e.match(/youtube\.com\/watch/i)||e.match(/youtu\.be/i)){return"youtube"}else if(e.match(/vimeo\.com/i)){return"vimeo"}else if(e.match(/\b.mov\b/i)){return"quicktime"}else if(e.match(/\b.swf\b/i)){return"flash"}else if(e.match(/\biframe=true\b/i)){return"iframe"}else if(e.match(/\bajax=true\b/i)){return"ajax"}else if(e.match(/\bcustom=true\b/i)){return"custom"}else if(e.substr(0,1)=="#"){return"inline"}else{return"image"}}function x(){if(doresize&&typeof $pp_pic_holder!="undefined"){scroll_pos=T();contentHeight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width();projectedTop=d/2+scroll_pos["scrollTop"]-contentHeight/2;if(projectedTop<0)projectedTop=0;if(contentHeight>d)return;$pp_pic_holder.css({top:projectedTop,left:v/2+scroll_pos["scrollLeft"]-contentwidth/2})}}function T(){if(self.pageYOffset){return{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset}}else if(document.documentElement&&document.documentElement.scrollTop){return{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft}}else if(document.body){return{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft}}}function N(){d=e(window).height(),v=e(window).width();if(typeof $pp_overlay!="undefined")$pp_overlay.height(e(document).height()).width(v)}function C(){if(isSet&&settings.overlay_gallery&&S(pp_images[set_position])=="image"){itemWidth=52+5;navWidth=settings.theme=="facebook"||settings.theme=="pp_default"?50:30;itemsPerPage=Math.floor((a["containerWidth"]-100-navWidth)/itemWidth);itemsPerPage=itemsPerPage
"}toInject=settings.gallery_markup.replace(/{gallery}/g,toInject);$pp_pic_holder.find("#pp_full_res").after(toInject);$pp_gallery=e(".pp_pic_holder .pp_gallery"),$pp_gallery_li=$pp_gallery.find("li");$pp_gallery.find(".pp_arrow_next").click(function(){e.prettyPhoto.changeGalleryPage("next");e.prettyPhoto.stopSlideshow();return false});$pp_gallery.find(".pp_arrow_previous").click(function(){e.prettyPhoto.changeGalleryPage("previous");e.prettyPhoto.stopSlideshow();return false});$pp_pic_holder.find(".pp_content").hover(function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeIn()},function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeOut()});itemWidth=52+5;$pp_gallery_li.each(function(t){e(this).find("a").click(function(){e.prettyPhoto.changePage(t);e.prettyPhoto.stopSlideshow();return false})})}if(settings.slideshow){$pp_pic_holder.find(".pp_nav").prepend('Play');$pp_pic_holder.find(".pp_nav .pp_play").click(function(){e.prettyPhoto.startSlideshow();return false})}$pp_pic_holder.attr("class","pp_pic_holder "+settings.theme);$pp_overlay.css({opacity:0,height:e(document).height(),width:e(window).width()}).bind("click",function(){if(!settings.modal)e.prettyPhoto.close()});e("a.pp_close").bind("click",function(){e.prettyPhoto.close();return false});if(settings.allow_expand){e("a.pp_expand").bind("click",function(t){if(e(this).hasClass("pp_expand")){e(this).removeClass("pp_expand").addClass("pp_contract");doresize=false}else{e(this).removeClass("pp_contract").addClass("pp_expand");doresize=true}y(function(){e.prettyPhoto.open()});return false})}$pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous").bind("click",function(){e.prettyPhoto.changePage("previous");e.prettyPhoto.stopSlideshow();return false});$pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next").bind("click",function(){e.prettyPhoto.changePage("next");e.prettyPhoto.stopSlideshow();return false});x()}s=jQuery.extend({hook:"rel",animation_speed:"fast",ajaxcallback:function(){},slideshow:5e3,autoplay_slideshow:false,opacity:.8,show_title:true,allow_resize:true,allow_expand:true,default_width:500,default_height:344,counter_separator_label:"/",theme:"pp_default",horizontal_padding:20,hideflash:false,wmode:"opaque",autoplay:true,modal:false,deeplinking:true,overlay_gallery:true,overlay_gallery_max:30,keyboard_shortcuts:true,changepicturecallback:function(){},callback:function(){},ie6_fallback:true,markup:' ',gallery_markup:'',image_markup:'
',flash_markup:'',quicktime_markup:'',iframe_markup:'',inline_markup:'{content}
',custom_markup:"",social_tools:''},s);var o=this,u=false,a,f,l,c,h,p,d=e(window).height(),v=e(window).width(),m;doresize=true,scroll_pos=T();e(window).unbind("resize.prettyphoto").bind("resize.prettyphoto",function(){x();N()});if(s.keyboard_shortcuts){e(document).unbind("keydown.prettyphoto").bind("keydown.prettyphoto",function(t){if(typeof $pp_pic_holder!="undefined"){if($pp_pic_holder.is(":visible")){switch(t.keyCode){case 37:e.prettyPhoto.changePage("previous");t.preventDefault();break;case 39:e.prettyPhoto.changePage("next");t.preventDefault();break;case 27:if(!settings.modal)e.prettyPhoto.close();t.preventDefault();break}}}})}e.prettyPhoto.initialize=function(){settings=s;if(settings.theme=="pp_default")settings.horizontal_padding=16;theRel=e(this).attr(settings.hook);galleryRegExp=/\[(?:.*)\]/;isSet=galleryRegExp.exec(theRel)?true:false;pp_images=isSet?jQuery.map(o,function(t,n){if(e(t).attr(settings.hook).indexOf(theRel)!=-1)return e(t).attr("href")}):e.makeArray(e(this).attr("href"));pp_titles=isSet?jQuery.map(o,function(t,n){if(e(t).attr(settings.hook).indexOf(theRel)!=-1)return e(t).find("img").attr("alt")?e(t).find("img").attr("alt"):""}):e.makeArray(e(this).find("img").attr("alt"));pp_descriptions=isSet?jQuery.map(o,function(t,n){if(e(t).attr(settings.hook).indexOf(theRel)!=-1)return e(t).attr("title")?e(t).attr("title"):""}):e.makeArray(e(this).attr("title"));if(pp_images.length>settings.overlay_gallery_max)settings.overlay_gallery=false;set_position=jQuery.inArray(e(this).attr("href"),pp_images);rel_index=isSet?set_position:e("a["+settings.hook+"^='"+theRel+"']").index(e(this));k(this);if(settings.allow_resize)e(window).bind("scroll.prettyphoto",function(){x()});e.prettyPhoto.open();return false};e.prettyPhoto.open=function(t){if(typeof settings=="undefined"){settings=s;pp_images=e.makeArray(arguments[0]);pp_titles=arguments[1]?e.makeArray(arguments[1]):e.makeArray("");pp_descriptions=arguments[2]?e.makeArray(arguments[2]):e.makeArray("");isSet=pp_images.length>1?true:false;set_position=arguments[3]?arguments[3]:0;k(t.target)}if(settings.hideflash)e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","hidden");b(e(pp_images).size());e(".pp_loaderIcon").show();if(settings.deeplinking)n();if(settings.social_tools){facebook_like_link=settings.social_tools.replace("{location_href}",encodeURIComponent(location.href));$pp_pic_holder.find(".pp_social").html(facebook_like_link)}if($ppt.is(":hidden"))$ppt.css("opacity",0).show();$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity);$pp_pic_holder.find(".currentTextHolder").text(set_position+1+settings.counter_separator_label+e(pp_images).size());if(typeof pp_descriptions[set_position]!="undefined"&&pp_descriptions[set_position]!=""){$pp_pic_holder.find(".pp_description").show().html(unescape(pp_descriptions[set_position]))}else{$pp_pic_holder.find(".pp_description").hide()}movie_width=parseFloat(i("width",pp_images[set_position]))?i("width",pp_images[set_position]):settings.default_width.toString();movie_height=parseFloat(i("height",pp_images[set_position]))?i("height",pp_images[set_position]):settings.default_height.toString();u=false;if(movie_height.indexOf("%")!=-1){movie_height=parseFloat(e(window).height()*parseFloat(movie_height)/100-150);u=true}if(movie_width.indexOf("%")!=-1){movie_width=parseFloat(e(window).width()*parseFloat(movie_width)/100-150);u=true}$pp_pic_holder.fadeIn(function(){settings.show_title&&pp_titles[set_position]!=""&&typeof pp_titles[set_position]!="undefined"?$ppt.html(unescape(pp_titles[set_position])):$ppt.html(" ");imgPreloader="";skipInjection=false;switch(S(pp_images[set_position])){case"image":imgPreloader=new Image;nextImage=new Image;if(isSet&&set_position0)movie_id=movie_id.substr(0,movie_id.indexOf("?"));if(movie_id.indexOf("&")>0)movie_id=movie_id.substr(0,movie_id.indexOf("&"))}movie="http://www.youtube.com/embed/"+movie_id;i("rel",pp_images[set_position])?movie+="?rel="+i("rel",pp_images[set_position]):movie+="?rel=1";if(settings.autoplay)movie+="&autoplay=1";toInject=settings.iframe_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case"vimeo":a=w(movie_width,movie_height);movie_id=pp_images[set_position];var t=/http(s?):\/\/(www\.)?vimeo.com\/(\d+)/;var n=movie_id.match(t);movie="http://player.vimeo.com/video/"+n[3]+"?title=0&byline=0&portrait=0";if(settings.autoplay)movie+="&autoplay=1;";vimeo_width=a["width"]+"/embed/?moog_width="+a["width"];toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,a["height"]).replace(/{path}/g,movie);break;case"quicktime":a=w(movie_width,movie_height);a["height"]+=15;a["contentHeight"]+=15;a["containerHeight"]+=15;toInject=settings.quicktime_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);break;case"flash":a=w(movie_width,movie_height);flash_vars=pp_images[set_position];flash_vars=flash_vars.substring(pp_images[set_position].indexOf("flashvars")+10,pp_images[set_position].length);filename=pp_images[set_position];filename=filename.substring(0,filename.indexOf("?"));toInject=settings.flash_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+"?"+flash_vars);break;case"iframe":a=w(movie_width,movie_height);frame_url=pp_images[set_position];frame_url=frame_url.substr(0,frame_url.indexOf("iframe")-1);toInject=settings.iframe_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{path}/g,frame_url);break;case"ajax":doresize=false;a=w(movie_width,movie_height);doresize=true;skipInjection=true;e.get(pp_images[set_position],function(e){toInject=settings.inline_markup.replace(/{content}/g,e);$pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject;g()});break;case"custom":a=w(movie_width,movie_height);toInject=settings.custom_markup;break;case"inline":myClone=e(pp_images[set_position]).clone().append('
').css({width:settings.default_width}).wrapInner('').appendTo(e("body")).show();doresize=false;a=w(e(myClone).width(),e(myClone).height());doresize=true;e(myClone).remove();toInject=settings.inline_markup.replace(/{content}/g,e(pp_images[set_position]).html());break}if(!imgPreloader&&!skipInjection){$pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject;g()}});return false};e.prettyPhoto.changePage=function(t){currentGalleryPage=0;if(t=="previous"){set_position--;if(set_position<0)set_position=e(pp_images).size()-1}else if(t=="next"){set_position++;if(set_position>e(pp_images).size()-1)set_position=0}else{set_position=t}rel_index=set_position;if(!doresize)doresize=true;if(settings.allow_expand){e(".pp_contract").removeClass("pp_contract").addClass("pp_expand")}y(function(){e.prettyPhoto.open()})};e.prettyPhoto.changeGalleryPage=function(e){if(e=="next"){currentGalleryPage++;if(currentGalleryPage>totalPage)currentGalleryPage=0}else if(e=="previous"){currentGalleryPage--;if(currentGalleryPage<0)currentGalleryPage=totalPage}else{currentGalleryPage=e}slide_speed=e=="next"||e=="previous"?settings.animation_speed:0;slide_to=currentGalleryPage*itemsPerPage*itemWidth;$pp_gallery.find("ul").animate({left:-slide_to},slide_speed)};e.prettyPhoto.startSlideshow=function(){if(typeof m=="undefined"){$pp_pic_holder.find(".pp_play").unbind("click").removeClass("pp_play").addClass("pp_pause").click(function(){e.prettyPhoto.stopSlideshow();return false});m=setInterval(e.prettyPhoto.startSlideshow,settings.slideshow)}else{e.prettyPhoto.changePage("next")}};e.prettyPhoto.stopSlideshow=function(){$pp_pic_holder.find(".pp_pause").unbind("click").removeClass("pp_pause").addClass("pp_play").click(function(){e.prettyPhoto.startSlideshow();return false});clearInterval(m);m=undefined};e.prettyPhoto.close=function(){if($pp_overlay.is(":animated"))return;e.prettyPhoto.stopSlideshow();$pp_pic_holder.stop().find("object,embed").css("visibility","hidden");e("div.pp_pic_holder,div.ppt,.pp_fade").fadeOut(settings.animation_speed,function(){e(this).remove()});$pp_overlay.fadeOut(settings.animation_speed,function(){if(settings.hideflash)e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","visible");e(this).remove();e(window).unbind("scroll.prettyphoto");r();settings.callback();doresize=true;f=false;delete settings})};if(!pp_alreadyInitialized&&t()){pp_alreadyInitialized=true;hashIndex=t();hashRel=hashIndex;hashIndex=hashIndex.substring(hashIndex.indexOf("/")+1,hashIndex.length-1);hashRel=hashRel.substring(0,hashRel.indexOf("/"));setTimeout(function(){e("a["+s.hook+"^='"+hashRel+"']:eq("+hashIndex+")").trigger("click")},50)}return this.unbind("click.prettyphoto").bind("click.prettyphoto",e.prettyPhoto.initialize)};})(jQuery);var pp_alreadyInitialized=false
\ No newline at end of file
diff --git a/django_code/templates/cloudmanager/js/jquery.validate.js b/django_code/templates/cloudmanager/js/jquery.validate.js
new file mode 100644
index 0000000..cadc305
--- /dev/null
+++ b/django_code/templates/cloudmanager/js/jquery.validate.js
@@ -0,0 +1,1231 @@
+/*!
+ * jQuery Validation Plugin 1.11.1
+ *
+ * http://bassistance.de/jquery-plugins/jquery-plugin-validation/
+ * http://docs.jquery.com/Plugins/Validation
+ *
+ * Copyright 2013 Jörn Zaefferer
+ * Released under the MIT license:
+ * http://www.opensource.org/licenses/mit-license.php
+ */
+
+(function($) {
+
+$.extend($.fn, {
+ // http://docs.jquery.com/Plugins/Validation/validate
+ validate: function( options ) {
+
+ // if nothing is selected, return nothing; can't chain anyway
+ if ( !this.length ) {
+ if ( options && options.debug && window.console ) {
+ console.warn( "Nothing selected, can't validate, returning nothing." );
+ }
+ return;
+ }
+
+ // check if a validator for this form was already created
+ var validator = $.data( this[0], "validator" );
+ if ( validator ) {
+ return validator;
+ }
+
+ // Add novalidate tag if HTML5.
+ this.attr( "novalidate", "novalidate" );
+
+ validator = new $.validator( options, this[0] );
+ $.data( this[0], "validator", validator );
+
+ if ( validator.settings.onsubmit ) {
+
+ this.validateDelegate( ":submit", "click", function( event ) {
+ if ( validator.settings.submitHandler ) {
+ validator.submitButton = event.target;
+ }
+ // allow suppressing validation by adding a cancel class to the submit button
+ if ( $(event.target).hasClass("cancel") ) {
+ validator.cancelSubmit = true;
+ }
+
+ // allow suppressing validation by adding the html5 formnovalidate attribute to the submit button
+ if ( $(event.target).attr("formnovalidate") !== undefined ) {
+ validator.cancelSubmit = true;
+ }
+ });
+
+ // validate the form on submit
+ this.submit( function( event ) {
+ if ( validator.settings.debug ) {
+ // prevent form submit to be able to see console output
+ event.preventDefault();
+ }
+ function handle() {
+ var hidden;
+ if ( validator.settings.submitHandler ) {
+ if ( validator.submitButton ) {
+ // insert a hidden input as a replacement for the missing submit button
+ hidden = $("").attr("name", validator.submitButton.name).val( $(validator.submitButton).val() ).appendTo(validator.currentForm);
+ }
+ validator.settings.submitHandler.call( validator, validator.currentForm, event );
+ if ( validator.submitButton ) {
+ // and clean up afterwards; thanks to no-block-scope, hidden can be referenced
+ hidden.remove();
+ }
+ return false;
+ }
+ return true;
+ }
+
+ // prevent submit for invalid forms or custom submit handlers
+ if ( validator.cancelSubmit ) {
+ validator.cancelSubmit = false;
+ return handle();
+ }
+ if ( validator.form() ) {
+ if ( validator.pendingRequest ) {
+ validator.formSubmitted = true;
+ return false;
+ }
+ return handle();
+ } else {
+ validator.focusInvalid();
+ return false;
+ }
+ });
+ }
+
+ return validator;
+ },
+ // http://docs.jquery.com/Plugins/Validation/valid
+ valid: function() {
+ if ( $(this[0]).is("form")) {
+ return this.validate().form();
+ } else {
+ var valid = true;
+ var validator = $(this[0].form).validate();
+ this.each(function() {
+ valid = valid && validator.element(this);
+ });
+ return valid;
+ }
+ },
+ // attributes: space seperated list of attributes to retrieve and remove
+ removeAttrs: function( attributes ) {
+ var result = {},
+ $element = this;
+ $.each(attributes.split(/\s/), function( index, value ) {
+ result[value] = $element.attr(value);
+ $element.removeAttr(value);
+ });
+ return result;
+ },
+ // http://docs.jquery.com/Plugins/Validation/rules
+ rules: function( command, argument ) {
+ var element = this[0];
+
+ if ( command ) {
+ var settings = $.data(element.form, "validator").settings;
+ var staticRules = settings.rules;
+ var existingRules = $.validator.staticRules(element);
+ switch(command) {
+ case "add":
+ $.extend(existingRules, $.validator.normalizeRule(argument));
+ // remove messages from rules, but allow them to be set separetely
+ delete existingRules.messages;
+ staticRules[element.name] = existingRules;
+ if ( argument.messages ) {
+ settings.messages[element.name] = $.extend( settings.messages[element.name], argument.messages );
+ }
+ break;
+ case "remove":
+ if ( !argument ) {
+ delete staticRules[element.name];
+ return existingRules;
+ }
+ var filtered = {};
+ $.each(argument.split(/\s/), function( index, method ) {
+ filtered[method] = existingRules[method];
+ delete existingRules[method];
+ });
+ return filtered;
+ }
+ }
+
+ var data = $.validator.normalizeRules(
+ $.extend(
+ {},
+ $.validator.classRules(element),
+ $.validator.attributeRules(element),
+ $.validator.dataRules(element),
+ $.validator.staticRules(element)
+ ), element);
+
+ // make sure required is at front
+ if ( data.required ) {
+ var param = data.required;
+ delete data.required;
+ data = $.extend({required: param}, data);
+ }
+
+ return data;
+ }
+});
+
+// Custom selectors
+$.extend($.expr[":"], {
+ // http://docs.jquery.com/Plugins/Validation/blank
+ blank: function( a ) { return !$.trim("" + $(a).val()); },
+ // http://docs.jquery.com/Plugins/Validation/filled
+ filled: function( a ) { return !!$.trim("" + $(a).val()); },
+ // http://docs.jquery.com/Plugins/Validation/unchecked
+ unchecked: function( a ) { return !$(a).prop("checked"); }
+});
+
+// constructor for validator
+$.validator = function( options, form ) {
+ this.settings = $.extend( true, {}, $.validator.defaults, options );
+ this.currentForm = form;
+ this.init();
+};
+
+$.validator.format = function( source, params ) {
+ if ( arguments.length === 1 ) {
+ return function() {
+ var args = $.makeArray(arguments);
+ args.unshift(source);
+ return $.validator.format.apply( this, args );
+ };
+ }
+ if ( arguments.length > 2 && params.constructor !== Array ) {
+ params = $.makeArray(arguments).slice(1);
+ }
+ if ( params.constructor !== Array ) {
+ params = [ params ];
+ }
+ $.each(params, function( i, n ) {
+ source = source.replace( new RegExp("\\{" + i + "\\}", "g"), function() {
+ return n;
+ });
+ });
+ return source;
+};
+
+$.extend($.validator, {
+
+ defaults: {
+ messages: {},
+ groups: {},
+ rules: {},
+ errorClass: "error",
+ validClass: "valid",
+ errorElement: "label",
+ focusInvalid: true,
+ errorContainer: $([]),
+ errorLabelContainer: $([]),
+ onsubmit: true,
+ ignore: ":hidden",
+ ignoreTitle: false,
+ onfocusin: function( element, event ) {
+ this.lastActive = element;
+
+ // hide error label and remove error class on focus if enabled
+ if ( this.settings.focusCleanup && !this.blockFocusCleanup ) {
+ if ( this.settings.unhighlight ) {
+ this.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass );
+ }
+ this.addWrapper(this.errorsFor(element)).hide();
+ }
+ },
+ onfocusout: function( element, event ) {
+ if ( !this.checkable(element) && (element.name in this.submitted || !this.optional(element)) ) {
+ this.element(element);
+ }
+ },
+ onkeyup: function( element, event ) {
+ if ( event.which === 9 && this.elementValue(element) === "" ) {
+ return;
+ } else if ( element.name in this.submitted || element === this.lastElement ) {
+ this.element(element);
+ }
+ },
+ onclick: function( element, event ) {
+ // click on selects, radiobuttons and checkboxes
+ if ( element.name in this.submitted ) {
+ this.element(element);
+ }
+ // or option elements, check parent select in that case
+ else if ( element.parentNode.name in this.submitted ) {
+ this.element(element.parentNode);
+ }
+ },
+ highlight: function( element, errorClass, validClass ) {
+ if ( element.type === "radio" ) {
+ this.findByName(element.name).addClass(errorClass).removeClass(validClass);
+ } else {
+ $(element).addClass(errorClass).removeClass(validClass);
+ }
+ },
+ unhighlight: function( element, errorClass, validClass ) {
+ if ( element.type === "radio" ) {
+ this.findByName(element.name).removeClass(errorClass).addClass(validClass);
+ } else {
+ $(element).removeClass(errorClass).addClass(validClass);
+ }
+ }
+ },
+
+ // http://docs.jquery.com/Plugins/Validation/Validator/setDefaults
+ setDefaults: function( settings ) {
+ $.extend( $.validator.defaults, settings );
+ },
+
+ messages: {
+ required: "This field is required.",
+ remote: "Please fix this field.",
+ email: "Please enter a valid email address.",
+ url: "Please enter a valid URL.",
+ date: "Please enter a valid date.",
+ dateISO: "Please enter a valid date (ISO).",
+ number: "Please enter a valid number.",
+ digits: "Please enter only digits.",
+ creditcard: "Please enter a valid credit card number.",
+ equalTo: "Please enter the same value again.",
+ maxlength: $.validator.format("Please enter no more than {0} characters."),
+ minlength: $.validator.format("Please enter at least {0} characters."),
+ rangelength: $.validator.format("Please enter a value between {0} and {1} characters long."),
+ range: $.validator.format("Please enter a value between {0} and {1}."),
+ max: $.validator.format("Please enter a value less than or equal to {0}."),
+ min: $.validator.format("Please enter a value greater than or equal to {0}.")
+ },
+
+ autoCreateRanges: false,
+
+ prototype: {
+
+ init: function() {
+ this.labelContainer = $(this.settings.errorLabelContainer);
+ this.errorContext = this.labelContainer.length && this.labelContainer || $(this.currentForm);
+ this.containers = $(this.settings.errorContainer).add( this.settings.errorLabelContainer );
+ this.submitted = {};
+ this.valueCache = {};
+ this.pendingRequest = 0;
+ this.pending = {};
+ this.invalid = {};
+ this.reset();
+
+ var groups = (this.groups = {});
+ $.each(this.settings.groups, function( key, value ) {
+ if ( typeof value === "string" ) {
+ value = value.split(/\s/);
+ }
+ $.each(value, function( index, name ) {
+ groups[name] = key;
+ });
+ });
+ var rules = this.settings.rules;
+ $.each(rules, function( key, value ) {
+ rules[key] = $.validator.normalizeRule(value);
+ });
+
+ function delegate(event) {
+ var validator = $.data(this[0].form, "validator"),
+ eventType = "on" + event.type.replace(/^validate/, "");
+ if ( validator.settings[eventType] ) {
+ validator.settings[eventType].call(validator, this[0], event);
+ }
+ }
+ $(this.currentForm)
+ .validateDelegate(":text, [type='password'], [type='file'], select, textarea, " +
+ "[type='number'], [type='search'] ,[type='tel'], [type='url'], " +
+ "[type='email'], [type='datetime'], [type='date'], [type='month'], " +
+ "[type='week'], [type='time'], [type='datetime-local'], " +
+ "[type='range'], [type='color'] ",
+ "focusin focusout keyup", delegate)
+ .validateDelegate("[type='radio'], [type='checkbox'], select, option", "click", delegate);
+
+ if ( this.settings.invalidHandler ) {
+ $(this.currentForm).bind("invalid-form.validate", this.settings.invalidHandler);
+ }
+ },
+
+ // http://docs.jquery.com/Plugins/Validation/Validator/form
+ form: function() {
+ this.checkForm();
+ $.extend(this.submitted, this.errorMap);
+ this.invalid = $.extend({}, this.errorMap);
+ if ( !this.valid() ) {
+ $(this.currentForm).triggerHandler("invalid-form", [this]);
+ }
+ this.showErrors();
+ return this.valid();
+ },
+
+ checkForm: function() {
+ this.prepareForm();
+ for ( var i = 0, elements = (this.currentElements = this.elements()); elements[i]; i++ ) {
+ this.check( elements[i] );
+ }
+ return this.valid();
+ },
+
+ // http://docs.jquery.com/Plugins/Validation/Validator/element
+ element: function( element ) {
+ element = this.validationTargetFor( this.clean( element ) );
+ this.lastElement = element;
+ this.prepareElement( element );
+ this.currentElements = $(element);
+ var result = this.check( element ) !== false;
+ if ( result ) {
+ delete this.invalid[element.name];
+ } else {
+ this.invalid[element.name] = true;
+ }
+ if ( !this.numberOfInvalids() ) {
+ // Hide error containers on last error
+ this.toHide = this.toHide.add( this.containers );
+ }
+ this.showErrors();
+ return result;
+ },
+
+ // http://docs.jquery.com/Plugins/Validation/Validator/showErrors
+ showErrors: function( errors ) {
+ if ( errors ) {
+ // add items to error list and map
+ $.extend( this.errorMap, errors );
+ this.errorList = [];
+ for ( var name in errors ) {
+ this.errorList.push({
+ message: errors[name],
+ element: this.findByName(name)[0]
+ });
+ }
+ // remove items from success list
+ this.successList = $.grep( this.successList, function( element ) {
+ return !(element.name in errors);
+ });
+ }
+ if ( this.settings.showErrors ) {
+ this.settings.showErrors.call( this, this.errorMap, this.errorList );
+ } else {
+ this.defaultShowErrors();
+ }
+ },
+
+ // http://docs.jquery.com/Plugins/Validation/Validator/resetForm
+ resetForm: function() {
+ if ( $.fn.resetForm ) {
+ $(this.currentForm).resetForm();
+ }
+ this.submitted = {};
+ this.lastElement = null;
+ this.prepareForm();
+ this.hideErrors();
+ this.elements().removeClass( this.settings.errorClass ).removeData( "previousValue" );
+ },
+
+ numberOfInvalids: function() {
+ return this.objectLength(this.invalid);
+ },
+
+ objectLength: function( obj ) {
+ var count = 0;
+ for ( var i in obj ) {
+ count++;
+ }
+ return count;
+ },
+
+ hideErrors: function() {
+ this.addWrapper( this.toHide ).hide();
+ },
+
+ valid: function() {
+ return this.size() === 0;
+ },
+
+ size: function() {
+ return this.errorList.length;
+ },
+
+ focusInvalid: function() {
+ if ( this.settings.focusInvalid ) {
+ try {
+ $(this.findLastActive() || this.errorList.length && this.errorList[0].element || [])
+ .filter(":visible")
+ .focus()
+ // manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find
+ .trigger("focusin");
+ } catch(e) {
+ // ignore IE throwing errors when focusing hidden elements
+ }
+ }
+ },
+
+ findLastActive: function() {
+ var lastActive = this.lastActive;
+ return lastActive && $.grep(this.errorList, function( n ) {
+ return n.element.name === lastActive.name;
+ }).length === 1 && lastActive;
+ },
+
+ elements: function() {
+ var validator = this,
+ rulesCache = {};
+
+ // select all valid inputs inside the form (no submit or reset buttons)
+ return $(this.currentForm)
+ .find("input, select, textarea")
+ .not(":submit, :reset, :image, [disabled]")
+ .not( this.settings.ignore )
+ .filter(function() {
+ if ( !this.name && validator.settings.debug && window.console ) {
+ console.error( "%o has no name assigned", this);
+ }
+
+ // select only the first element for each name, and only those with rules specified
+ if ( this.name in rulesCache || !validator.objectLength($(this).rules()) ) {
+ return false;
+ }
+
+ rulesCache[this.name] = true;
+ return true;
+ });
+ },
+
+ clean: function( selector ) {
+ return $(selector)[0];
+ },
+
+ errors: function() {
+ var errorClass = this.settings.errorClass.replace(" ", ".");
+ return $(this.settings.errorElement + "." + errorClass, this.errorContext);
+ },
+
+ reset: function() {
+ this.successList = [];
+ this.errorList = [];
+ this.errorMap = {};
+ this.toShow = $([]);
+ this.toHide = $([]);
+ this.currentElements = $([]);
+ },
+
+ prepareForm: function() {
+ this.reset();
+ this.toHide = this.errors().add( this.containers );
+ },
+
+ prepareElement: function( element ) {
+ this.reset();
+ this.toHide = this.errorsFor(element);
+ },
+
+ elementValue: function( element ) {
+ var type = $(element).attr("type"),
+ val = $(element).val();
+
+ if ( type === "radio" || type === "checkbox" ) {
+ return $("input[name='" + $(element).attr("name") + "']:checked").val();
+ }
+
+ if ( typeof val === "string" ) {
+ return val.replace(/\r/g, "");
+ }
+ return val;
+ },
+
+ check: function( element ) {
+ element = this.validationTargetFor( this.clean( element ) );
+
+ var rules = $(element).rules();
+ var dependencyMismatch = false;
+ var val = this.elementValue(element);
+ var result;
+
+ for (var method in rules ) {
+ var rule = { method: method, parameters: rules[method] };
+ try {
+
+ result = $.validator.methods[method].call( this, val, element, rule.parameters );
+
+ // if a method indicates that the field is optional and therefore valid,
+ // don't mark it as valid when there are no other rules
+ if ( result === "dependency-mismatch" ) {
+ dependencyMismatch = true;
+ continue;
+ }
+ dependencyMismatch = false;
+
+ if ( result === "pending" ) {
+ this.toHide = this.toHide.not( this.errorsFor(element) );
+ return;
+ }
+
+ if ( !result ) {
+ this.formatAndAdd( element, rule );
+ return false;
+ }
+ } catch(e) {
+ if ( this.settings.debug && window.console ) {
+ console.log( "Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.", e );
+ }
+ throw e;
+ }
+ }
+ if ( dependencyMismatch ) {
+ return;
+ }
+ if ( this.objectLength(rules) ) {
+ this.successList.push(element);
+ }
+ return true;
+ },
+
+ // return the custom message for the given element and validation method
+ // specified in the element's HTML5 data attribute
+ customDataMessage: function( element, method ) {
+ return $(element).data("msg-" + method.toLowerCase()) || (element.attributes && $(element).attr("data-msg-" + method.toLowerCase()));
+ },
+
+ // return the custom message for the given element name and validation method
+ customMessage: function( name, method ) {
+ var m = this.settings.messages[name];
+ return m && (m.constructor === String ? m : m[method]);
+ },
+
+ // return the first defined argument, allowing empty strings
+ findDefined: function() {
+ for(var i = 0; i < arguments.length; i++) {
+ if ( arguments[i] !== undefined ) {
+ return arguments[i];
+ }
+ }
+ return undefined;
+ },
+
+ defaultMessage: function( element, method ) {
+ return this.findDefined(
+ this.customMessage( element.name, method ),
+ this.customDataMessage( element, method ),
+ // title is never undefined, so handle empty string as undefined
+ !this.settings.ignoreTitle && element.title || undefined,
+ $.validator.messages[method],
+ "Warning: No message defined for " + element.name + ""
+ );
+ },
+
+ formatAndAdd: function( element, rule ) {
+ var message = this.defaultMessage( element, rule.method ),
+ theregex = /\$?\{(\d+)\}/g;
+ if ( typeof message === "function" ) {
+ message = message.call(this, rule.parameters, element);
+ } else if (theregex.test(message)) {
+ message = $.validator.format(message.replace(theregex, "{$1}"), rule.parameters);
+ }
+ this.errorList.push({
+ message: message,
+ element: element
+ });
+
+ this.errorMap[element.name] = message;
+ this.submitted[element.name] = message;
+ },
+
+ addWrapper: function( toToggle ) {
+ if ( this.settings.wrapper ) {
+ toToggle = toToggle.add( toToggle.parent( this.settings.wrapper ) );
+ }
+ return toToggle;
+ },
+
+ defaultShowErrors: function() {
+ var i, elements;
+ for ( i = 0; this.errorList[i]; i++ ) {
+ var error = this.errorList[i];
+ if ( this.settings.highlight ) {
+ this.settings.highlight.call( this, error.element, this.settings.errorClass, this.settings.validClass );
+ }
+ this.showLabel( error.element, error.message );
+ }
+ if ( this.errorList.length ) {
+ this.toShow = this.toShow.add( this.containers );
+ }
+ if ( this.settings.success ) {
+ for ( i = 0; this.successList[i]; i++ ) {
+ this.showLabel( this.successList[i] );
+ }
+ }
+ if ( this.settings.unhighlight ) {
+ for ( i = 0, elements = this.validElements(); elements[i]; i++ ) {
+ this.settings.unhighlight.call( this, elements[i], this.settings.errorClass, this.settings.validClass );
+ }
+ }
+ this.toHide = this.toHide.not( this.toShow );
+ this.hideErrors();
+ this.addWrapper( this.toShow ).show();
+ },
+
+ validElements: function() {
+ return this.currentElements.not(this.invalidElements());
+ },
+
+ invalidElements: function() {
+ return $(this.errorList).map(function() {
+ return this.element;
+ });
+ },
+
+ showLabel: function( element, message ) {
+ var label = this.errorsFor( element );
+ if ( label.length ) {
+ // refresh error/success class
+ label.removeClass( this.settings.validClass ).addClass( this.settings.errorClass );
+ // replace message on existing label
+ label.html(message);
+ } else {
+ // create label
+ label = $("<" + this.settings.errorElement + ">")
+ .attr("for", this.idOrName(element))
+ .addClass(this.settings.errorClass)
+ .html(message || "");
+ if ( this.settings.wrapper ) {
+ // make sure the element is visible, even in IE
+ // actually showing the wrapped element is handled elsewhere
+ label = label.hide().show().wrap("<" + this.settings.wrapper + "/>").parent();
+ }
+ if ( !this.labelContainer.append(label).length ) {
+ if ( this.settings.errorPlacement ) {
+ this.settings.errorPlacement(label, $(element) );
+ } else {
+ label.insertAfter(element);
+ }
+ }
+ }
+ if ( !message && this.settings.success ) {
+ label.text("");
+ if ( typeof this.settings.success === "string" ) {
+ label.addClass( this.settings.success );
+ } else {
+ this.settings.success( label, element );
+ }
+ }
+ this.toShow = this.toShow.add(label);
+ },
+
+ errorsFor: function( element ) {
+ var name = this.idOrName(element);
+ return this.errors().filter(function() {
+ return $(this).attr("for") === name;
+ });
+ },
+
+ idOrName: function( element ) {
+ return this.groups[element.name] || (this.checkable(element) ? element.name : element.id || element.name);
+ },
+
+ validationTargetFor: function( element ) {
+ // if radio/checkbox, validate first element in group instead
+ if ( this.checkable(element) ) {
+ element = this.findByName( element.name ).not(this.settings.ignore)[0];
+ }
+ return element;
+ },
+
+ checkable: function( element ) {
+ return (/radio|checkbox/i).test(element.type);
+ },
+
+ findByName: function( name ) {
+ return $(this.currentForm).find("[name='" + name + "']");
+ },
+
+ getLength: function( value, element ) {
+ switch( element.nodeName.toLowerCase() ) {
+ case "select":
+ return $("option:selected", element).length;
+ case "input":
+ if ( this.checkable( element) ) {
+ return this.findByName(element.name).filter(":checked").length;
+ }
+ }
+ return value.length;
+ },
+
+ depend: function( param, element ) {
+ return this.dependTypes[typeof param] ? this.dependTypes[typeof param](param, element) : true;
+ },
+
+ dependTypes: {
+ "boolean": function( param, element ) {
+ return param;
+ },
+ "string": function( param, element ) {
+ return !!$(param, element.form).length;
+ },
+ "function": function( param, element ) {
+ return param(element);
+ }
+ },
+
+ optional: function( element ) {
+ var val = this.elementValue(element);
+ return !$.validator.methods.required.call(this, val, element) && "dependency-mismatch";
+ },
+
+ startRequest: function( element ) {
+ if ( !this.pending[element.name] ) {
+ this.pendingRequest++;
+ this.pending[element.name] = true;
+ }
+ },
+
+ stopRequest: function( element, valid ) {
+ this.pendingRequest--;
+ // sometimes synchronization fails, make sure pendingRequest is never < 0
+ if ( this.pendingRequest < 0 ) {
+ this.pendingRequest = 0;
+ }
+ delete this.pending[element.name];
+ if ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() ) {
+ $(this.currentForm).submit();
+ this.formSubmitted = false;
+ } else if (!valid && this.pendingRequest === 0 && this.formSubmitted) {
+ $(this.currentForm).triggerHandler("invalid-form", [this]);
+ this.formSubmitted = false;
+ }
+ },
+
+ previousValue: function( element ) {
+ return $.data(element, "previousValue") || $.data(element, "previousValue", {
+ old: null,
+ valid: true,
+ message: this.defaultMessage( element, "remote" )
+ });
+ }
+
+ },
+
+ classRuleSettings: {
+ required: {required: true},
+ email: {email: true},
+ url: {url: true},
+ date: {date: true},
+ dateISO: {dateISO: true},
+ number: {number: true},
+ digits: {digits: true},
+ creditcard: {creditcard: true}
+ },
+
+ addClassRules: function( className, rules ) {
+ if ( className.constructor === String ) {
+ this.classRuleSettings[className] = rules;
+ } else {
+ $.extend(this.classRuleSettings, className);
+ }
+ },
+
+ classRules: function( element ) {
+ var rules = {};
+ var classes = $(element).attr("class");
+ if ( classes ) {
+ $.each(classes.split(" "), function() {
+ if ( this in $.validator.classRuleSettings ) {
+ $.extend(rules, $.validator.classRuleSettings[this]);
+ }
+ });
+ }
+ return rules;
+ },
+
+ attributeRules: function( element ) {
+ var rules = {};
+ var $element = $(element);
+ var type = $element[0].getAttribute("type");
+
+ for (var method in $.validator.methods) {
+ var value;
+
+ // support for in both html5 and older browsers
+ if ( method === "required" ) {
+ value = $element.get(0).getAttribute(method);
+ // Some browsers return an empty string for the required attribute
+ // and non-HTML5 browsers might have required="" markup
+ if ( value === "" ) {
+ value = true;
+ }
+ // force non-HTML5 browsers to return bool
+ value = !!value;
+ } else {
+ value = $element.attr(method);
+ }
+
+ // convert the value to a number for number inputs, and for text for backwards compability
+ // allows type="date" and others to be compared as strings
+ if ( /min|max/.test( method ) && ( type === null || /number|range|text/.test( type ) ) ) {
+ value = Number(value);
+ }
+
+ if ( value ) {
+ rules[method] = value;
+ } else if ( type === method && type !== 'range' ) {
+ // exception: the jquery validate 'range' method
+ // does not test for the html5 'range' type
+ rules[method] = true;
+ }
+ }
+
+ // maxlength may be returned as -1, 2147483647 (IE) and 524288 (safari) for text inputs
+ if ( rules.maxlength && /-1|2147483647|524288/.test(rules.maxlength) ) {
+ delete rules.maxlength;
+ }
+
+ return rules;
+ },
+
+ dataRules: function( element ) {
+ var method, value,
+ rules = {}, $element = $(element);
+ for (method in $.validator.methods) {
+ value = $element.data("rule-" + method.toLowerCase());
+ if ( value !== undefined ) {
+ rules[method] = value;
+ }
+ }
+ return rules;
+ },
+
+ staticRules: function( element ) {
+ var rules = {};
+ var validator = $.data(element.form, "validator");
+ if ( validator.settings.rules ) {
+ rules = $.validator.normalizeRule(validator.settings.rules[element.name]) || {};
+ }
+ return rules;
+ },
+
+ normalizeRules: function( rules, element ) {
+ // handle dependency check
+ $.each(rules, function( prop, val ) {
+ // ignore rule when param is explicitly false, eg. required:false
+ if ( val === false ) {
+ delete rules[prop];
+ return;
+ }
+ if ( val.param || val.depends ) {
+ var keepRule = true;
+ switch (typeof val.depends) {
+ case "string":
+ keepRule = !!$(val.depends, element.form).length;
+ break;
+ case "function":
+ keepRule = val.depends.call(element, element);
+ break;
+ }
+ if ( keepRule ) {
+ rules[prop] = val.param !== undefined ? val.param : true;
+ } else {
+ delete rules[prop];
+ }
+ }
+ });
+
+ // evaluate parameters
+ $.each(rules, function( rule, parameter ) {
+ rules[rule] = $.isFunction(parameter) ? parameter(element) : parameter;
+ });
+
+ // clean number parameters
+ $.each(['minlength', 'maxlength'], function() {
+ if ( rules[this] ) {
+ rules[this] = Number(rules[this]);
+ }
+ });
+ $.each(['rangelength', 'range'], function() {
+ var parts;
+ if ( rules[this] ) {
+ if ( $.isArray(rules[this]) ) {
+ rules[this] = [Number(rules[this][0]), Number(rules[this][1])];
+ } else if ( typeof rules[this] === "string" ) {
+ parts = rules[this].split(/[\s,]+/);
+ rules[this] = [Number(parts[0]), Number(parts[1])];
+ }
+ }
+ });
+
+ if ( $.validator.autoCreateRanges ) {
+ // auto-create ranges
+ if ( rules.min && rules.max ) {
+ rules.range = [rules.min, rules.max];
+ delete rules.min;
+ delete rules.max;
+ }
+ if ( rules.minlength && rules.maxlength ) {
+ rules.rangelength = [rules.minlength, rules.maxlength];
+ delete rules.minlength;
+ delete rules.maxlength;
+ }
+ }
+
+ return rules;
+ },
+
+ // Converts a simple string to a {string: true} rule, e.g., "required" to {required:true}
+ normalizeRule: function( data ) {
+ if ( typeof data === "string" ) {
+ var transformed = {};
+ $.each(data.split(/\s/), function() {
+ transformed[this] = true;
+ });
+ data = transformed;
+ }
+ return data;
+ },
+
+ // http://docs.jquery.com/Plugins/Validation/Validator/addMethod
+ addMethod: function( name, method, message ) {
+ $.validator.methods[name] = method;
+ $.validator.messages[name] = message !== undefined ? message : $.validator.messages[name];
+ if ( method.length < 3 ) {
+ $.validator.addClassRules(name, $.validator.normalizeRule(name));
+ }
+ },
+
+ methods: {
+
+ // http://docs.jquery.com/Plugins/Validation/Methods/required
+ required: function( value, element, param ) {
+ // check if dependency is met
+ if ( !this.depend(param, element) ) {
+ return "dependency-mismatch";
+ }
+ if ( element.nodeName.toLowerCase() === "select" ) {
+ // could be an array for select-multiple or a string, both are fine this way
+ var val = $(element).val();
+ return val && val.length > 0;
+ }
+ if ( this.checkable(element) ) {
+ return this.getLength(value, element) > 0;
+ }
+ return $.trim(value).length > 0;
+ },
+
+ // http://docs.jquery.com/Plugins/Validation/Methods/email
+ email: function( value, element ) {
+ // contributed by Scott Gonzalez: http://projects.scottsplayground.com/email_address_validation/
+ return this.optional(element) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(value);
+ },
+
+ // http://docs.jquery.com/Plugins/Validation/Methods/url
+ url: function( value, element ) {
+ // contributed by Scott Gonzalez: http://projects.scottsplayground.com/iri/
+ return this.optional(element) || /^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);
+ },
+
+ // http://docs.jquery.com/Plugins/Validation/Methods/date
+ date: function( value, element ) {
+ return this.optional(element) || !/Invalid|NaN/.test(new Date(value).toString());
+ },
+
+ // http://docs.jquery.com/Plugins/Validation/Methods/dateISO
+ dateISO: function( value, element ) {
+ return this.optional(element) || /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(value);
+ },
+
+ // http://docs.jquery.com/Plugins/Validation/Methods/number
+ number: function( value, element ) {
+ return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
+ },
+
+ // http://docs.jquery.com/Plugins/Validation/Methods/digits
+ digits: function( value, element ) {
+ return this.optional(element) || /^\d+$/.test(value);
+ },
+
+ // http://docs.jquery.com/Plugins/Validation/Methods/creditcard
+ // based on http://en.wikipedia.org/wiki/Luhn
+ creditcard: function( value, element ) {
+ if ( this.optional(element) ) {
+ return "dependency-mismatch";
+ }
+ // accept only spaces, digits and dashes
+ if ( /[^0-9 \-]+/.test(value) ) {
+ return false;
+ }
+ var nCheck = 0,
+ nDigit = 0,
+ bEven = false;
+
+ value = value.replace(/\D/g, "");
+
+ for (var n = value.length - 1; n >= 0; n--) {
+ var cDigit = value.charAt(n);
+ nDigit = parseInt(cDigit, 10);
+ if ( bEven ) {
+ if ( (nDigit *= 2) > 9 ) {
+ nDigit -= 9;
+ }
+ }
+ nCheck += nDigit;
+ bEven = !bEven;
+ }
+
+ return (nCheck % 10) === 0;
+ },
+
+ // http://docs.jquery.com/Plugins/Validation/Methods/minlength
+ minlength: function( value, element, param ) {
+ var length = $.isArray( value ) ? value.length : this.getLength($.trim(value), element);
+ return this.optional(element) || length >= param;
+ },
+
+ // http://docs.jquery.com/Plugins/Validation/Methods/maxlength
+ maxlength: function( value, element, param ) {
+ var length = $.isArray( value ) ? value.length : this.getLength($.trim(value), element);
+ return this.optional(element) || length <= param;
+ },
+
+ // http://docs.jquery.com/Plugins/Validation/Methods/rangelength
+ rangelength: function( value, element, param ) {
+ var length = $.isArray( value ) ? value.length : this.getLength($.trim(value), element);
+ return this.optional(element) || ( length >= param[0] && length <= param[1] );
+ },
+
+ // http://docs.jquery.com/Plugins/Validation/Methods/min
+ min: function( value, element, param ) {
+ return this.optional(element) || value >= param;
+ },
+
+ // http://docs.jquery.com/Plugins/Validation/Methods/max
+ max: function( value, element, param ) {
+ return this.optional(element) || value <= param;
+ },
+
+ // http://docs.jquery.com/Plugins/Validation/Methods/range
+ range: function( value, element, param ) {
+ return this.optional(element) || ( value >= param[0] && value <= param[1] );
+ },
+
+ // http://docs.jquery.com/Plugins/Validation/Methods/equalTo
+ equalTo: function( value, element, param ) {
+ // bind to the blur event of the target in order to revalidate whenever the target field is updated
+ // TODO find a way to bind the event just once, avoiding the unbind-rebind overhead
+ var target = $(param);
+ if ( this.settings.onfocusout ) {
+ target.unbind(".validate-equalTo").bind("blur.validate-equalTo", function() {
+ $(element).valid();
+ });
+ }
+ return value === target.val();
+ },
+
+ // http://docs.jquery.com/Plugins/Validation/Methods/remote
+ remote: function( value, element, param ) {
+ if ( this.optional(element) ) {
+ return "dependency-mismatch";
+ }
+
+ var previous = this.previousValue(element);
+ if (!this.settings.messages[element.name] ) {
+ this.settings.messages[element.name] = {};
+ }
+ previous.originalMessage = this.settings.messages[element.name].remote;
+ this.settings.messages[element.name].remote = previous.message;
+
+ param = typeof param === "string" && {url:param} || param;
+
+ if ( previous.old === value ) {
+ return previous.valid;
+ }
+
+ previous.old = value;
+ var validator = this;
+ this.startRequest(element);
+ var data = {};
+ data[element.name] = value;
+ $.ajax($.extend(true, {
+ url: param,
+ mode: "abort",
+ port: "validate" + element.name,
+ dataType: "json",
+ data: data,
+ success: function( response ) {
+ validator.settings.messages[element.name].remote = previous.originalMessage;
+ var valid = response === true || response === "true";
+ if ( valid ) {
+ var submitted = validator.formSubmitted;
+ validator.prepareElement(element);
+ validator.formSubmitted = submitted;
+ validator.successList.push(element);
+ delete validator.invalid[element.name];
+ validator.showErrors();
+ } else {
+ var errors = {};
+ var message = response || validator.defaultMessage( element, "remote" );
+ errors[element.name] = previous.message = $.isFunction(message) ? message(value) : message;
+ validator.invalid[element.name] = true;
+ validator.showErrors(errors);
+ }
+ previous.valid = valid;
+ validator.stopRequest(element, valid);
+ }
+ }, param));
+ return "pending";
+ }
+
+ }
+
+});
+
+// deprecated, use $.validator.format instead
+$.format = $.validator.format;
+
+}(jQuery));
+
+// ajax mode: abort
+// usage: $.ajax({ mode: "abort"[, port: "uniqueport"]});
+// if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort()
+(function($) {
+ var pendingRequests = {};
+ // Use a prefilter if available (1.5+)
+ if ( $.ajaxPrefilter ) {
+ $.ajaxPrefilter(function( settings, _, xhr ) {
+ var port = settings.port;
+ if ( settings.mode === "abort" ) {
+ if ( pendingRequests[port] ) {
+ pendingRequests[port].abort();
+ }
+ pendingRequests[port] = xhr;
+ }
+ });
+ } else {
+ // Proxy ajax
+ var ajax = $.ajax;
+ $.ajax = function( settings ) {
+ var mode = ( "mode" in settings ? settings : $.ajaxSettings ).mode,
+ port = ( "port" in settings ? settings : $.ajaxSettings ).port;
+ if ( mode === "abort" ) {
+ if ( pendingRequests[port] ) {
+ pendingRequests[port].abort();
+ }
+ pendingRequests[port] = ajax.apply(this, arguments);
+ return pendingRequests[port];
+ }
+ return ajax.apply(this, arguments);
+ };
+ }
+}(jQuery));
+
+// provides delegate(type: String, delegate: Selector, handler: Callback) plugin for easier event delegation
+// handler is only called when $(event.target).is(delegate), in the scope of the jquery-object for event.target
+(function($) {
+ $.extend($.fn, {
+ validateDelegate: function( delegate, type, handler ) {
+ return this.bind(type, function( event ) {
+ var target = $(event.target);
+ if ( target.is(delegate) ) {
+ return handler.apply(target, arguments);
+ }
+ });
+ }
+ });
+}(jQuery));
\ No newline at end of file
diff --git a/django_code/templates/cloudmanager/js/jquery.validate.min.js b/django_code/templates/cloudmanager/js/jquery.validate.min.js
new file mode 100644
index 0000000..5264617
--- /dev/null
+++ b/django_code/templates/cloudmanager/js/jquery.validate.min.js
@@ -0,0 +1,4 @@
+/*! jQuery Validation Plugin - v1.13.0 - 7/1/2014
+ * http://jqueryvalidation.org/
+ * Copyright (c) 2014 Jörn Zaefferer; Licensed MIT */
+!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.validateDelegate(":submit","click",function(b){c.settings.submitHandler&&(c.submitButton=b.target),a(b.target).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(b.target).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.submit(function(b){function d(){var d;return c.settings.submitHandler?(c.submitButton&&(d=a("").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),c.settings.submitHandler.call(c,c.currentForm,b),c.submitButton&&d.remove(),!1):!0}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c;return a(this[0]).is("form")?b=this.validate().form():(b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b})),b},removeAttrs:function(b){var c={},d=this;return a.each(b.split(/\s/),function(a,b){c[b]=d.attr(b),d.removeAttr(b)}),c},rules:function(b,c){var d,e,f,g,h,i,j=this[0];if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(b,c){i[c]=f[c],delete f[c],"required"===c&&a(j).removeAttr("aria-required")}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g),a(j).attr("aria-required","true")),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}),a.extend(a.expr[":"],{blank:function(b){return!a.trim(""+a(b).val())},filled:function(b){return!!a.trim(""+a(b).val())},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(a,b){(9!==b.which||""!==this.elementValue(a))&&(a.name in this.submitted||a===this.lastElement)&&this.element(a)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date ( ISO ).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){var c=a.data(this[0].form,"validator"),d="on"+b.type.replace(/^validate/,""),e=c.settings;e[d]&&!this.is(e.ignore)&&e[d].call(c,this[0],b)}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){d[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox']","focusin focusout keyup",b).validateDelegate("select, option, [type='radio'], [type='checkbox']","click",b),this.settings.invalidHandler&&a(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler),a(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required","true")},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c=this.clean(b),d=this.validationTargetFor(c),e=!0;return this.lastElement=d,void 0===d?delete this.invalid[c.name]:(this.prepareElement(d),this.currentElements=a(d),e=this.check(d)!==!1,e?delete this.invalid[d.name]:this.invalid[d.name]=!0),a(b).attr("aria-invalid",!e),this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),e},showErrors:function(b){if(b){a.extend(this.errorMap,b),this.errorList=[];for(var c in b)this.errorList.push({message:b[c],element:this.findByName(c)[0]});this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue").removeAttr("aria-invalid")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)c++;return c},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in c||!b.objectLength(a(this).rules())?!1:(c[this.name]=!0,!0)})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([]),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d=a(b),e=b.type;return"radio"===e||"checkbox"===e?a("input[name='"+b.name+"']:checked").val():"number"===e&&"undefined"!=typeof b.validity?b.validity.badInput?!1:d.val():(c=d.val(),"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f=a(b).rules(),g=a.map(f,function(a,b){return b}).length,h=!1,i=this.elementValue(b);for(d in f){e={method:d,parameters:f[d]};try{if(c=a.validator.methods[d].call(this,i,b,e.parameters),"dependency-mismatch"===c&&1===g){h=!0;continue}if(h=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(j){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",j),j}}if(!h)return this.objectLength(f)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;aWarning: No message defined for "+b.name+"")},formatAndAdd:function(b,c){var d=this.defaultMessage(b,c.method),e=/\$?\{(\d+)\}/g;"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),this.errorList.push({message:d,element:b,method:c.method}),this.errorMap[b.name]=d,this.submitted[b.name]=d},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g=this.errorsFor(b),h=this.idOrName(b),i=a(b).attr("aria-describedby");g.length?(g.removeClass(this.settings.validClass).addClass(this.settings.errorClass),g.html(c)):(g=a("<"+this.settings.errorElement+">").attr("id",h+"-error").addClass(this.settings.errorClass).html(c||""),d=g,this.settings.wrapper&&(d=g.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement(d,a(b)):d.insertAfter(b),g.is("label")?g.attr("for",h):0===g.parents("label[for='"+h+"']").length&&(f=g.attr("id"),i?i.match(new RegExp("\b"+f+"\b"))||(i+=" "+f):i=f,a(b).attr("aria-describedby",i),e=this.groups[b.name],e&&a.each(this.groups,function(b,c){c===e&&a("[name='"+b+"']",this.currentForm).attr("aria-describedby",g.attr("id"))}))),!c&&this.settings.success&&(g.text(""),"string"==typeof this.settings.success?g.addClass(this.settings.success):this.settings.success(g,b)),this.toShow=this.toShow.add(g)},errorsFor:function(b){var c=this.idOrName(b),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+d.replace(/\s+/g,", #")),this.errors().filter(e)},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(a){return this.checkable(a)&&(a=this.findByName(a.name).not(this.settings.ignore)[0]),a},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+b+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):!0},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(a){this.pending[a.name]||(this.pendingRequest++,this.pending[a.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),/min|max/.test(c)&&(null===g||/number|range|text/.test(g))&&(d=Number(d)),d||0===d?e[c]=d:g===c&&"range"!==g&&(e[c]=!0);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b);for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),void 0!==d&&(e[c]=d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0!==e.param?e.param:!0:delete b[d]}}),a.each(b,function(d,e){b[d]=a.isFunction(e)?e(c):e}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var c;b[this]&&(a.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(c=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(c[0]),Number(c[1])]))}),a.validator.autoCreateRanges&&(b.min&&b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),b.minlength&&b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:a.trim(b).length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a).toString())},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 \-]+/.test(a))return!1;var c,d,e=0,f=0,g=!1;if(a=a.replace(/\D/g,""),a.length<13||a.length>19)return!1;for(c=a.length-1;c>=0;c--)d=a.charAt(c),f=parseInt(d,10),g&&(f*=2)>9&&(f-=9),e+=f,g=!g;return e%10===0},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||d>=e},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||c>=a},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d){if(this.optional(c))return"dependency-mismatch";var e,f,g=this.previousValue(c);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),g.originalMessage=this.settings.messages[c.name].remote,this.settings.messages[c.name].remote=g.message,d="string"==typeof d&&{url:d}||d,g.old===b?g.valid:(g.old=b,e=this,this.startRequest(c),f={},f[c.name]=b,a.ajax(a.extend(!0,{url:d,mode:"abort",port:"validate"+c.name,dataType:"json",data:f,context:e.currentForm,success:function(d){var f,h,i,j=d===!0||"true"===d;e.settings.messages[c.name].remote=g.originalMessage,j?(i=e.formSubmitted,e.prepareElement(c),e.formSubmitted=i,e.successList.push(c),delete e.invalid[c.name],e.showErrors()):(f={},h=d||e.defaultMessage(c,"remote"),f[c.name]=g.message=a.isFunction(h)?h(b):h,e.invalid[c.name]=!0,e.showErrors(f)),g.valid=j,e.stopRequest(c,j)}},d)),"pending")}}}),a.format=function(){throw"$.format has been deprecated. Please use $.validator.format instead."};var b,c={};a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,d){var e=a.port;"abort"===a.mode&&(c[e]&&c[e].abort(),c[e]=d)}):(b=a.ajax,a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return"abort"===e?(c[f]&&c[f].abort(),c[f]=b.apply(this,arguments),c[f]):b.apply(this,arguments)}),a.extend(a.fn,{validateDelegate:function(b,c,d){return this.bind(c,function(c){var e=a(c.target);return e.is(b)?d.apply(e,arguments):void 0})}})});
\ No newline at end of file
diff --git a/django_code/templates/cloudmanager/js/retina.js b/django_code/templates/cloudmanager/js/retina.js
new file mode 100644
index 0000000..7646e0b
--- /dev/null
+++ b/django_code/templates/cloudmanager/js/retina.js
@@ -0,0 +1,182 @@
+/*!
+ * Retina.js v1.3.0
+ *
+ * Copyright 2014 Imulus, LLC
+ * Released under the MIT license
+ *
+ * Retina.js is an open source script that makes it easy to serve
+ * high-resolution images to devices with retina displays.
+ */
+
+(function() {
+ var root = (typeof exports === 'undefined' ? window : exports);
+ var config = {
+ // An option to choose a suffix for 2x images
+ retinaImageSuffix : '@2x',
+
+ // Ensure Content-Type is an image before trying to load @2x image
+ // https://github.com/imulus/retinajs/pull/45)
+ check_mime_type: true,
+
+ // Resize high-resolution images to original image's pixel dimensions
+ // https://github.com/imulus/retinajs/issues/8
+ force_original_dimensions: true
+ };
+
+ function Retina() {}
+
+ root.Retina = Retina;
+
+ Retina.configure = function(options) {
+ if (options === null) {
+ options = {};
+ }
+
+ for (var prop in options) {
+ if (options.hasOwnProperty(prop)) {
+ config[prop] = options[prop];
+ }
+ }
+ };
+
+ Retina.init = function(context) {
+ if (context === null) {
+ context = root;
+ }
+
+ var existing_onload = context.onload || function(){};
+
+ context.onload = function() {
+ var images = document.getElementsByTagName('img'), retinaImages = [], i, image;
+ for (i = 0; i < images.length; i += 1) {
+ image = images[i];
+ if (!!!image.getAttributeNode('data-no-retina')) {
+ retinaImages.push(new RetinaImage(image));
+ }
+ }
+ existing_onload();
+ };
+ };
+
+ Retina.isRetina = function(){
+ var mediaQuery = '(-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx)';
+
+ if (root.devicePixelRatio > 1) {
+ return true;
+ }
+
+ if (root.matchMedia && root.matchMedia(mediaQuery).matches) {
+ return true;
+ }
+
+ return false;
+ };
+
+
+ var regexMatch = /\.\w+$/;
+ function suffixReplace (match) {
+ return config.retinaImageSuffix + match;
+ }
+
+ function RetinaImagePath(path, at_2x_path) {
+ this.path = path || '';
+ if (typeof at_2x_path !== 'undefined' && at_2x_path !== null) {
+ this.at_2x_path = at_2x_path;
+ this.perform_check = false;
+ } else {
+ if (undefined !== document.createElement) {
+ var locationObject = document.createElement('a');
+ locationObject.href = this.path;
+ locationObject.pathname = locationObject.pathname.replace(regexMatch, suffixReplace);
+ this.at_2x_path = locationObject.href;
+ } else {
+ var parts = this.path.split('?');
+ parts[0] = parts[0].replace(regexMatch, suffixReplace);
+ this.at_2x_path = parts.join('?');
+ }
+ this.perform_check = true;
+ }
+ }
+
+ root.RetinaImagePath = RetinaImagePath;
+
+ RetinaImagePath.confirmed_paths = [];
+
+ RetinaImagePath.prototype.is_external = function() {
+ return !!(this.path.match(/^https?\:/i) && !this.path.match('//' + document.domain) );
+ };
+
+ RetinaImagePath.prototype.check_2x_variant = function(callback) {
+ var http, that = this;
+ if (this.is_external()) {
+ return callback(false);
+ } else if (!this.perform_check && typeof this.at_2x_path !== 'undefined' && this.at_2x_path !== null) {
+ return callback(true);
+ } else if (this.at_2x_path in RetinaImagePath.confirmed_paths) {
+ return callback(true);
+ } else {
+ http = new XMLHttpRequest();
+ http.open('HEAD', this.at_2x_path);
+ http.onreadystatechange = function() {
+ if (http.readyState !== 4) {
+ return callback(false);
+ }
+
+ if (http.status >= 200 && http.status <= 399) {
+ if (config.check_mime_type) {
+ var type = http.getResponseHeader('Content-Type');
+ if (type === null || !type.match(/^image/i)) {
+ return callback(false);
+ }
+ }
+
+ RetinaImagePath.confirmed_paths.push(that.at_2x_path);
+ return callback(true);
+ } else {
+ return callback(false);
+ }
+ };
+ http.send();
+ }
+ };
+
+
+ function RetinaImage(el) {
+ this.el = el;
+ this.path = new RetinaImagePath(this.el.getAttribute('src'), this.el.getAttribute('data-at2x'));
+ var that = this;
+ this.path.check_2x_variant(function(hasVariant) {
+ if (hasVariant) {
+ that.swap();
+ }
+ });
+ }
+
+ root.RetinaImage = RetinaImage;
+
+ RetinaImage.prototype.swap = function(path) {
+ if (typeof path === 'undefined') {
+ path = this.path.at_2x_path;
+ }
+
+ var that = this;
+ function load() {
+ if (! that.el.complete) {
+ setTimeout(load, 5);
+ } else {
+ if (config.force_original_dimensions) {
+ that.el.setAttribute('width', that.el.offsetWidth);
+ that.el.setAttribute('height', that.el.offsetHeight);
+ }
+
+ that.el.setAttribute('src', path);
+ }
+ }
+ load();
+ };
+
+
+ if (Retina.isRetina()) {
+ Retina.init(root);
+ }
+})();
diff --git a/django_code/templates/cloudmanager/js/retina.min.js b/django_code/templates/cloudmanager/js/retina.min.js
new file mode 100644
index 0000000..da0a60d
--- /dev/null
+++ b/django_code/templates/cloudmanager/js/retina.min.js
@@ -0,0 +1,10 @@
+/*!
+ * Retina.js v1.3.0
+ *
+ * Copyright 2014 Imulus, LLC
+ * Released under the MIT license
+ *
+ * Retina.js is an open source script that makes it easy to serve
+ * high-resolution images to devices with retina displays.
+ */
+!function(){function a(){}function b(a){return f.retinaImageSuffix+a}function c(a,c){if(this.path=a||"","undefined"!=typeof c&&null!==c)this.at_2x_path=c,this.perform_check=!1;else{if(void 0!==document.createElement){var d=document.createElement("a");d.href=this.path,d.pathname=d.pathname.replace(g,b),this.at_2x_path=d.href}else{var e=this.path.split("?");e[0]=e[0].replace(g,b),this.at_2x_path=e.join("?")}this.perform_check=!0}}function d(a){this.el=a,this.path=new c(this.el.getAttribute("src"),this.el.getAttribute("data-at2x"));var b=this;this.path.check_2x_variant(function(a){a&&b.swap()})}var e="undefined"==typeof exports?window:exports,f={retinaImageSuffix:"@2x",check_mime_type:!0,force_original_dimensions:!0};e.Retina=a,a.configure=function(a){null===a&&(a={});for(var b in a)a.hasOwnProperty(b)&&(f[b]=a[b])},a.init=function(a){null===a&&(a=e);var b=a.onload||function(){};a.onload=function(){var a,c,e=document.getElementsByTagName("img"),f=[];for(a=0;a1?!0:e.matchMedia&&e.matchMedia(a).matches?!0:!1};var g=/\.\w+$/;e.RetinaImagePath=c,c.confirmed_paths=[],c.prototype.is_external=function(){return!(!this.path.match(/^https?\:/i)||this.path.match("//"+document.domain))},c.prototype.check_2x_variant=function(a){var b,d=this;return this.is_external()?a(!1):this.perform_check||"undefined"==typeof this.at_2x_path||null===this.at_2x_path?this.at_2x_path in c.confirmed_paths?a(!0):(b=new XMLHttpRequest,b.open("HEAD",this.at_2x_path),b.onreadystatechange=function(){if(4!==b.readyState)return a(!1);if(b.status>=200&&b.status<=399){if(f.check_mime_type){var e=b.getResponseHeader("Content-Type");if(null===e||!e.match(/^image/i))return a(!1)}return c.confirmed_paths.push(d.at_2x_path),a(!0)}return a(!1)},b.send(),void 0):a(!0)},e.RetinaImage=d,d.prototype.swap=function(a){function b(){c.el.complete?(f.force_original_dimensions&&(c.el.setAttribute("width",c.el.offsetWidth),c.el.setAttribute("height",c.el.offsetHeight)),c.el.setAttribute("src",a)):setTimeout(b,5)}"undefined"==typeof a&&(a=this.path.at_2x_path);var c=this;b()},a.isRetina()&&a.init(e)}();
\ No newline at end of file
diff --git a/django_code/templates/cloudmanager/js/waypoints.js b/django_code/templates/cloudmanager/js/waypoints.js
new file mode 100644
index 0000000..4f9a33b
--- /dev/null
+++ b/django_code/templates/cloudmanager/js/waypoints.js
@@ -0,0 +1,517 @@
+// Generated by CoffeeScript 1.6.2
+/*!
+jQuery Waypoints - v2.0.5
+Copyright (c) 2011-2014 Caleb Troughton
+Licensed under the MIT license.
+https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt
+*/
+
+
+(function() {
+ var __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
+ __slice = [].slice;
+
+ (function(root, factory) {
+ if (typeof define === 'function' && define.amd) {
+ return define('waypoints', ['jquery'], function($) {
+ return factory($, root);
+ });
+ } else {
+ return factory(root.jQuery, root);
+ }
+ })(window, function($, window) {
+ var $w, Context, Waypoint, allWaypoints, contextCounter, contextKey, contexts, isTouch, jQMethods, methods, resizeEvent, scrollEvent, waypointCounter, waypointKey, wp, wps;
+
+ $w = $(window);
+ isTouch = __indexOf.call(window, 'ontouchstart') >= 0;
+ allWaypoints = {
+ horizontal: {},
+ vertical: {}
+ };
+ contextCounter = 1;
+ contexts = {};
+ contextKey = 'waypoints-context-id';
+ resizeEvent = 'resize.waypoints';
+ scrollEvent = 'scroll.waypoints';
+ waypointCounter = 1;
+ waypointKey = 'waypoints-waypoint-ids';
+ wp = 'waypoint';
+ wps = 'waypoints';
+ Context = (function() {
+ function Context($element) {
+ var _this = this;
+
+ this.$element = $element;
+ this.element = $element[0];
+ this.didResize = false;
+ this.didScroll = false;
+ this.id = 'context' + contextCounter++;
+ this.oldScroll = {
+ x: $element.scrollLeft(),
+ y: $element.scrollTop()
+ };
+ this.waypoints = {
+ horizontal: {},
+ vertical: {}
+ };
+ this.element[contextKey] = this.id;
+ contexts[this.id] = this;
+ $element.bind(scrollEvent, function() {
+ var scrollHandler;
+
+ if (!(_this.didScroll || isTouch)) {
+ _this.didScroll = true;
+ scrollHandler = function() {
+ _this.doScroll();
+ return _this.didScroll = false;
+ };
+ return window.setTimeout(scrollHandler, $[wps].settings.scrollThrottle);
+ }
+ });
+ $element.bind(resizeEvent, function() {
+ var resizeHandler;
+
+ if (!_this.didResize) {
+ _this.didResize = true;
+ resizeHandler = function() {
+ $[wps]('refresh');
+ return _this.didResize = false;
+ };
+ return window.setTimeout(resizeHandler, $[wps].settings.resizeThrottle);
+ }
+ });
+ }
+
+ Context.prototype.doScroll = function() {
+ var axes,
+ _this = this;
+
+ axes = {
+ horizontal: {
+ newScroll: this.$element.scrollLeft(),
+ oldScroll: this.oldScroll.x,
+ forward: 'right',
+ backward: 'left'
+ },
+ vertical: {
+ newScroll: this.$element.scrollTop(),
+ oldScroll: this.oldScroll.y,
+ forward: 'down',
+ backward: 'up'
+ }
+ };
+ if (isTouch && (!axes.vertical.oldScroll || !axes.vertical.newScroll)) {
+ $[wps]('refresh');
+ }
+ $.each(axes, function(aKey, axis) {
+ var direction, isForward, triggered;
+
+ triggered = [];
+ isForward = axis.newScroll > axis.oldScroll;
+ direction = isForward ? axis.forward : axis.backward;
+ $.each(_this.waypoints[aKey], function(wKey, waypoint) {
+ var _ref, _ref1;
+
+ if ((axis.oldScroll < (_ref = waypoint.offset) && _ref <= axis.newScroll)) {
+ return triggered.push(waypoint);
+ } else if ((axis.newScroll < (_ref1 = waypoint.offset) && _ref1 <= axis.oldScroll)) {
+ return triggered.push(waypoint);
+ }
+ });
+ triggered.sort(function(a, b) {
+ return a.offset - b.offset;
+ });
+ if (!isForward) {
+ triggered.reverse();
+ }
+ return $.each(triggered, function(i, waypoint) {
+ if (waypoint.options.continuous || i === triggered.length - 1) {
+ return waypoint.trigger([direction]);
+ }
+ });
+ });
+ return this.oldScroll = {
+ x: axes.horizontal.newScroll,
+ y: axes.vertical.newScroll
+ };
+ };
+
+ Context.prototype.refresh = function() {
+ var axes, cOffset, isWin,
+ _this = this;
+
+ isWin = $.isWindow(this.element);
+ cOffset = this.$element.offset();
+ this.doScroll();
+ axes = {
+ horizontal: {
+ contextOffset: isWin ? 0 : cOffset.left,
+ contextScroll: isWin ? 0 : this.oldScroll.x,
+ contextDimension: this.$element.width(),
+ oldScroll: this.oldScroll.x,
+ forward: 'right',
+ backward: 'left',
+ offsetProp: 'left'
+ },
+ vertical: {
+ contextOffset: isWin ? 0 : cOffset.top,
+ contextScroll: isWin ? 0 : this.oldScroll.y,
+ contextDimension: isWin ? $[wps]('viewportHeight') : this.$element.height(),
+ oldScroll: this.oldScroll.y,
+ forward: 'down',
+ backward: 'up',
+ offsetProp: 'top'
+ }
+ };
+ return $.each(axes, function(aKey, axis) {
+ return $.each(_this.waypoints[aKey], function(i, waypoint) {
+ var adjustment, elementOffset, oldOffset, _ref, _ref1;
+
+ adjustment = waypoint.options.offset;
+ oldOffset = waypoint.offset;
+ elementOffset = $.isWindow(waypoint.element) ? 0 : waypoint.$element.offset()[axis.offsetProp];
+ if ($.isFunction(adjustment)) {
+ adjustment = adjustment.apply(waypoint.element);
+ } else if (typeof adjustment === 'string') {
+ adjustment = parseFloat(adjustment);
+ if (waypoint.options.offset.indexOf('%') > -1) {
+ adjustment = Math.ceil(axis.contextDimension * adjustment / 100);
+ }
+ }
+ waypoint.offset = elementOffset - axis.contextOffset + axis.contextScroll - adjustment;
+ if ((waypoint.options.onlyOnScroll && (oldOffset != null)) || !waypoint.enabled) {
+ return;
+ }
+ if (oldOffset !== null && (oldOffset < (_ref = axis.oldScroll) && _ref <= waypoint.offset)) {
+ return waypoint.trigger([axis.backward]);
+ } else if (oldOffset !== null && (oldOffset > (_ref1 = axis.oldScroll) && _ref1 >= waypoint.offset)) {
+ return waypoint.trigger([axis.forward]);
+ } else if (oldOffset === null && axis.oldScroll >= waypoint.offset) {
+ return waypoint.trigger([axis.forward]);
+ }
+ });
+ });
+ };
+
+ Context.prototype.checkEmpty = function() {
+ if ($.isEmptyObject(this.waypoints.horizontal) && $.isEmptyObject(this.waypoints.vertical)) {
+ this.$element.unbind([resizeEvent, scrollEvent].join(' '));
+ return delete contexts[this.id];
+ }
+ };
+
+ return Context;
+
+ })();
+ Waypoint = (function() {
+ function Waypoint($element, context, options) {
+ var idList, _ref;
+
+ if (options.offset === 'bottom-in-view') {
+ options.offset = function() {
+ var contextHeight;
+
+ contextHeight = $[wps]('viewportHeight');
+ if (!$.isWindow(context.element)) {
+ contextHeight = context.$element.height();
+ }
+ return contextHeight - $(this).outerHeight();
+ };
+ }
+ this.$element = $element;
+ this.element = $element[0];
+ this.axis = options.horizontal ? 'horizontal' : 'vertical';
+ this.callback = options.handler;
+ this.context = context;
+ this.enabled = options.enabled;
+ this.id = 'waypoints' + waypointCounter++;
+ this.offset = null;
+ this.options = options;
+ context.waypoints[this.axis][this.id] = this;
+ allWaypoints[this.axis][this.id] = this;
+ idList = (_ref = this.element[waypointKey]) != null ? _ref : [];
+ idList.push(this.id);
+ this.element[waypointKey] = idList;
+ }
+
+ Waypoint.prototype.trigger = function(args) {
+ if (!this.enabled) {
+ return;
+ }
+ if (this.callback != null) {
+ this.callback.apply(this.element, args);
+ }
+ if (this.options.triggerOnce) {
+ return this.destroy();
+ }
+ };
+
+ Waypoint.prototype.disable = function() {
+ return this.enabled = false;
+ };
+
+ Waypoint.prototype.enable = function() {
+ this.context.refresh();
+ return this.enabled = true;
+ };
+
+ Waypoint.prototype.destroy = function() {
+ delete allWaypoints[this.axis][this.id];
+ delete this.context.waypoints[this.axis][this.id];
+ return this.context.checkEmpty();
+ };
+
+ Waypoint.getWaypointsByElement = function(element) {
+ var all, ids;
+
+ ids = element[waypointKey];
+ if (!ids) {
+ return [];
+ }
+ all = $.extend({}, allWaypoints.horizontal, allWaypoints.vertical);
+ return $.map(ids, function(id) {
+ return all[id];
+ });
+ };
+
+ return Waypoint;
+
+ })();
+ methods = {
+ init: function(f, options) {
+ var _ref;
+
+ options = $.extend({}, $.fn[wp].defaults, options);
+ if ((_ref = options.handler) == null) {
+ options.handler = f;
+ }
+ this.each(function() {
+ var $this, context, contextElement, _ref1;
+
+ $this = $(this);
+ contextElement = (_ref1 = options.context) != null ? _ref1 : $.fn[wp].defaults.context;
+ if (!$.isWindow(contextElement)) {
+ contextElement = $this.closest(contextElement);
+ }
+ contextElement = $(contextElement);
+ context = contexts[contextElement[0][contextKey]];
+ if (!context) {
+ context = new Context(contextElement);
+ }
+ return new Waypoint($this, context, options);
+ });
+ $[wps]('refresh');
+ return this;
+ },
+ disable: function() {
+ return methods._invoke.call(this, 'disable');
+ },
+ enable: function() {
+ return methods._invoke.call(this, 'enable');
+ },
+ destroy: function() {
+ return methods._invoke.call(this, 'destroy');
+ },
+ prev: function(axis, selector) {
+ return methods._traverse.call(this, axis, selector, function(stack, index, waypoints) {
+ if (index > 0) {
+ return stack.push(waypoints[index - 1]);
+ }
+ });
+ },
+ next: function(axis, selector) {
+ return methods._traverse.call(this, axis, selector, function(stack, index, waypoints) {
+ if (index < waypoints.length - 1) {
+ return stack.push(waypoints[index + 1]);
+ }
+ });
+ },
+ _traverse: function(axis, selector, push) {
+ var stack, waypoints;
+
+ if (axis == null) {
+ axis = 'vertical';
+ }
+ if (selector == null) {
+ selector = window;
+ }
+ waypoints = jQMethods.aggregate(selector);
+ stack = [];
+ this.each(function() {
+ var index;
+
+ index = $.inArray(this, waypoints[axis]);
+ return push(stack, index, waypoints[axis]);
+ });
+ return this.pushStack(stack);
+ },
+ _invoke: function(method) {
+ this.each(function() {
+ var waypoints;
+
+ waypoints = Waypoint.getWaypointsByElement(this);
+ return $.each(waypoints, function(i, waypoint) {
+ waypoint[method]();
+ return true;
+ });
+ });
+ return this;
+ }
+ };
+ $.fn[wp] = function() {
+ var args, method;
+
+ method = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
+ if (methods[method]) {
+ return methods[method].apply(this, args);
+ } else if ($.isFunction(method)) {
+ return methods.init.apply(this, arguments);
+ } else if ($.isPlainObject(method)) {
+ return methods.init.apply(this, [null, method]);
+ } else if (!method) {
+ return $.error("jQuery Waypoints needs a callback function or handler option.");
+ } else {
+ return $.error("The " + method + " method does not exist in jQuery Waypoints.");
+ }
+ };
+ $.fn[wp].defaults = {
+ context: window,
+ continuous: true,
+ enabled: true,
+ horizontal: false,
+ offset: 0,
+ triggerOnce: false
+ };
+ jQMethods = {
+ refresh: function() {
+ return $.each(contexts, function(i, context) {
+ return context.refresh();
+ });
+ },
+ viewportHeight: function() {
+ var _ref;
+
+ return (_ref = window.innerHeight) != null ? _ref : $w.height();
+ },
+ aggregate: function(contextSelector) {
+ var collection, waypoints, _ref;
+
+ collection = allWaypoints;
+ if (contextSelector) {
+ collection = (_ref = contexts[$(contextSelector)[0][contextKey]]) != null ? _ref.waypoints : void 0;
+ }
+ if (!collection) {
+ return [];
+ }
+ waypoints = {
+ horizontal: [],
+ vertical: []
+ };
+ $.each(waypoints, function(axis, arr) {
+ $.each(collection[axis], function(key, waypoint) {
+ return arr.push(waypoint);
+ });
+ arr.sort(function(a, b) {
+ return a.offset - b.offset;
+ });
+ waypoints[axis] = $.map(arr, function(waypoint) {
+ return waypoint.element;
+ });
+ return waypoints[axis] = $.unique(waypoints[axis]);
+ });
+ return waypoints;
+ },
+ above: function(contextSelector) {
+ if (contextSelector == null) {
+ contextSelector = window;
+ }
+ return jQMethods._filter(contextSelector, 'vertical', function(context, waypoint) {
+ return waypoint.offset <= context.oldScroll.y;
+ });
+ },
+ below: function(contextSelector) {
+ if (contextSelector == null) {
+ contextSelector = window;
+ }
+ return jQMethods._filter(contextSelector, 'vertical', function(context, waypoint) {
+ return waypoint.offset > context.oldScroll.y;
+ });
+ },
+ left: function(contextSelector) {
+ if (contextSelector == null) {
+ contextSelector = window;
+ }
+ return jQMethods._filter(contextSelector, 'horizontal', function(context, waypoint) {
+ return waypoint.offset <= context.oldScroll.x;
+ });
+ },
+ right: function(contextSelector) {
+ if (contextSelector == null) {
+ contextSelector = window;
+ }
+ return jQMethods._filter(contextSelector, 'horizontal', function(context, waypoint) {
+ return waypoint.offset > context.oldScroll.x;
+ });
+ },
+ enable: function() {
+ return jQMethods._invoke('enable');
+ },
+ disable: function() {
+ return jQMethods._invoke('disable');
+ },
+ destroy: function() {
+ return jQMethods._invoke('destroy');
+ },
+ extendFn: function(methodName, f) {
+ return methods[methodName] = f;
+ },
+ _invoke: function(method) {
+ var waypoints;
+
+ waypoints = $.extend({}, allWaypoints.vertical, allWaypoints.horizontal);
+ return $.each(waypoints, function(key, waypoint) {
+ waypoint[method]();
+ return true;
+ });
+ },
+ _filter: function(selector, axis, test) {
+ var context, waypoints;
+
+ context = contexts[$(selector)[0][contextKey]];
+ if (!context) {
+ return [];
+ }
+ waypoints = [];
+ $.each(context.waypoints[axis], function(i, waypoint) {
+ if (test(context, waypoint)) {
+ return waypoints.push(waypoint);
+ }
+ });
+ waypoints.sort(function(a, b) {
+ return a.offset - b.offset;
+ });
+ return $.map(waypoints, function(waypoint) {
+ return waypoint.element;
+ });
+ }
+ };
+ $[wps] = function() {
+ var args, method;
+
+ method = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
+ if (jQMethods[method]) {
+ return jQMethods[method].apply(null, args);
+ } else {
+ return jQMethods.aggregate.call(null, method);
+ }
+ };
+ $[wps].settings = {
+ resizeThrottle: 100,
+ scrollThrottle: 30
+ };
+ return $w.on('load.waypoints', function() {
+ return $[wps]('refresh');
+ });
+ });
+
+}).call(this);
diff --git a/django_code/templates/cloudmanager/js/waypoints.min.js b/django_code/templates/cloudmanager/js/waypoints.min.js
new file mode 100644
index 0000000..b9098f8
--- /dev/null
+++ b/django_code/templates/cloudmanager/js/waypoints.min.js
@@ -0,0 +1,8 @@
+// Generated by CoffeeScript 1.6.2
+/*!
+jQuery Waypoints - v2.0.5
+Copyright (c) 2011-2014 Caleb Troughton
+Licensed under the MIT license.
+https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt
+*/
+(function(){var t=[].indexOf||function(t){for(var e=0,n=this.length;e=0;s={horizontal:{},vertical:{}};f=1;c={};u="waypoints-context-id";p="resize.waypoints";y="scroll.waypoints";v=1;w="waypoints-waypoint-ids";g="waypoint";m="waypoints";o=function(){function t(t){var e=this;this.$element=t;this.element=t[0];this.didResize=false;this.didScroll=false;this.id="context"+f++;this.oldScroll={x:t.scrollLeft(),y:t.scrollTop()};this.waypoints={horizontal:{},vertical:{}};this.element[u]=this.id;c[this.id]=this;t.bind(y,function(){var t;if(!(e.didScroll||a)){e.didScroll=true;t=function(){e.doScroll();return e.didScroll=false};return r.setTimeout(t,n[m].settings.scrollThrottle)}});t.bind(p,function(){var t;if(!e.didResize){e.didResize=true;t=function(){n[m]("refresh");return e.didResize=false};return r.setTimeout(t,n[m].settings.resizeThrottle)}})}t.prototype.doScroll=function(){var t,e=this;t={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};if(a&&(!t.vertical.oldScroll||!t.vertical.newScroll)){n[m]("refresh")}n.each(t,function(t,r){var i,o,l;l=[];o=r.newScroll>r.oldScroll;i=o?r.forward:r.backward;n.each(e.waypoints[t],function(t,e){var n,i;if(r.oldScroll<(n=e.offset)&&n<=r.newScroll){return l.push(e)}else if(r.newScroll<(i=e.offset)&&i<=r.oldScroll){return l.push(e)}});l.sort(function(t,e){return t.offset-e.offset});if(!o){l.reverse()}return n.each(l,function(t,e){if(e.options.continuous||t===l.length-1){return e.trigger([i])}})});return this.oldScroll={x:t.horizontal.newScroll,y:t.vertical.newScroll}};t.prototype.refresh=function(){var t,e,r,i=this;r=n.isWindow(this.element);e=this.$element.offset();this.doScroll();t={horizontal:{contextOffset:r?0:e.left,contextScroll:r?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:r?0:e.top,contextScroll:r?0:this.oldScroll.y,contextDimension:r?n[m]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};return n.each(t,function(t,e){return n.each(i.waypoints[t],function(t,r){var i,o,l,s,f;i=r.options.offset;l=r.offset;o=n.isWindow(r.element)?0:r.$element.offset()[e.offsetProp];if(n.isFunction(i)){i=i.apply(r.element)}else if(typeof i==="string"){i=parseFloat(i);if(r.options.offset.indexOf("%")>-1){i=Math.ceil(e.contextDimension*i/100)}}r.offset=o-e.contextOffset+e.contextScroll-i;if(r.options.onlyOnScroll&&l!=null||!r.enabled){return}if(l!==null&&l<(s=e.oldScroll)&&s<=r.offset){return r.trigger([e.backward])}else if(l!==null&&l>(f=e.oldScroll)&&f>=r.offset){return r.trigger([e.forward])}else if(l===null&&e.oldScroll>=r.offset){return r.trigger([e.forward])}})})};t.prototype.checkEmpty=function(){if(n.isEmptyObject(this.waypoints.horizontal)&&n.isEmptyObject(this.waypoints.vertical)){this.$element.unbind([p,y].join(" "));return delete c[this.id]}};return t}();l=function(){function t(t,e,r){var i,o;if(r.offset==="bottom-in-view"){r.offset=function(){var t;t=n[m]("viewportHeight");if(!n.isWindow(e.element)){t=e.$element.height()}return t-n(this).outerHeight()}}this.$element=t;this.element=t[0];this.axis=r.horizontal?"horizontal":"vertical";this.callback=r.handler;this.context=e;this.enabled=r.enabled;this.id="waypoints"+v++;this.offset=null;this.options=r;e.waypoints[this.axis][this.id]=this;s[this.axis][this.id]=this;i=(o=this.element[w])!=null?o:[];i.push(this.id);this.element[w]=i}t.prototype.trigger=function(t){if(!this.enabled){return}if(this.callback!=null){this.callback.apply(this.element,t)}if(this.options.triggerOnce){return this.destroy()}};t.prototype.disable=function(){return this.enabled=false};t.prototype.enable=function(){this.context.refresh();return this.enabled=true};t.prototype.destroy=function(){delete s[this.axis][this.id];delete this.context.waypoints[this.axis][this.id];return this.context.checkEmpty()};t.getWaypointsByElement=function(t){var e,r;r=t[w];if(!r){return[]}e=n.extend({},s.horizontal,s.vertical);return n.map(r,function(t){return e[t]})};return t}();d={init:function(t,e){var r;e=n.extend({},n.fn[g].defaults,e);if((r=e.handler)==null){e.handler=t}this.each(function(){var t,r,i,s;t=n(this);i=(s=e.context)!=null?s:n.fn[g].defaults.context;if(!n.isWindow(i)){i=t.closest(i)}i=n(i);r=c[i[0][u]];if(!r){r=new o(i)}return new l(t,r,e)});n[m]("refresh");return this},disable:function(){return d._invoke.call(this,"disable")},enable:function(){return d._invoke.call(this,"enable")},destroy:function(){return d._invoke.call(this,"destroy")},prev:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e>0){return t.push(n[e-1])}})},next:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(et.oldScroll.y})},left:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset<=t.oldScroll.x})},right:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset>t.oldScroll.x})},enable:function(){return h._invoke("enable")},disable:function(){return h._invoke("disable")},destroy:function(){return h._invoke("destroy")},extendFn:function(t,e){return d[t]=e},_invoke:function(t){var e;e=n.extend({},s.vertical,s.horizontal);return n.each(e,function(e,n){n[t]();return true})},_filter:function(t,e,r){var i,o;i=c[n(t)[0][u]];if(!i){return[]}o=[];n.each(i.waypoints[e],function(t,e){if(r(i,e)){return o.push(e)}});o.sort(function(t,e){return t.offset-e.offset});return n.map(o,function(t){return t.element})}};n[m]=function(){var t,n;n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(h[n]){return h[n].apply(null,t)}else{return h.aggregate.call(null,n)}};n[m].settings={resizeThrottle:100,scrollThrottle:30};return i.on("load.waypoints",function(){return n[m]("refresh")})})}).call(this);
\ No newline at end of file
diff --git a/django_code/templates/cloudmanager/js/wow.js b/django_code/templates/cloudmanager/js/wow.js
new file mode 100644
index 0000000..d71bafb
--- /dev/null
+++ b/django_code/templates/cloudmanager/js/wow.js
@@ -0,0 +1,456 @@
+(function() {
+ var MutationObserver, Util, WeakMap, getComputedStyle, getComputedStyleRX,
+ __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
+ __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ Util = (function() {
+ function Util() {}
+
+ Util.prototype.extend = function(custom, defaults) {
+ var key, value;
+ for (key in defaults) {
+ value = defaults[key];
+ if (custom[key] == null) {
+ custom[key] = value;
+ }
+ }
+ return custom;
+ };
+
+ Util.prototype.isMobile = function(agent) {
+ return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(agent);
+ };
+
+ Util.prototype.addEvent = function(elem, event, fn) {
+ if (elem.addEventListener != null) {
+ return elem.addEventListener(event, fn, false);
+ } else if (elem.attachEvent != null) {
+ return elem.attachEvent("on" + event, fn);
+ } else {
+ return elem[event] = fn;
+ }
+ };
+
+ Util.prototype.removeEvent = function(elem, event, fn) {
+ if (elem.removeEventListener != null) {
+ return elem.removeEventListener(event, fn, false);
+ } else if (elem.detachEvent != null) {
+ return elem.detachEvent("on" + event, fn);
+ } else {
+ return delete elem[event];
+ }
+ };
+
+ Util.prototype.innerHeight = function() {
+ if ('innerHeight' in window) {
+ return window.innerHeight;
+ } else {
+ return document.documentElement.clientHeight;
+ }
+ };
+
+ return Util;
+
+ })();
+
+ WeakMap = this.WeakMap || this.MozWeakMap || (WeakMap = (function() {
+ function WeakMap() {
+ this.keys = [];
+ this.values = [];
+ }
+
+ WeakMap.prototype.get = function(key) {
+ var i, item, _i, _len, _ref;
+ _ref = this.keys;
+ for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
+ item = _ref[i];
+ if (item === key) {
+ return this.values[i];
+ }
+ }
+ };
+
+ WeakMap.prototype.set = function(key, value) {
+ var i, item, _i, _len, _ref;
+ _ref = this.keys;
+ for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
+ item = _ref[i];
+ if (item === key) {
+ this.values[i] = value;
+ return;
+ }
+ }
+ this.keys.push(key);
+ return this.values.push(value);
+ };
+
+ return WeakMap;
+
+ })());
+
+ MutationObserver = this.MutationObserver || this.WebkitMutationObserver || this.MozMutationObserver || (MutationObserver = (function() {
+ function MutationObserver() {
+ if (typeof console !== "undefined" && console !== null) {
+ console.warn('MutationObserver is not supported by your browser.');
+ }
+ if (typeof console !== "undefined" && console !== null) {
+ console.warn('WOW.js cannot detect dom mutations, please call .sync() after loading new content.');
+ }
+ }
+
+ MutationObserver.notSupported = true;
+
+ MutationObserver.prototype.observe = function() {};
+
+ return MutationObserver;
+
+ })());
+
+ getComputedStyle = this.getComputedStyle || function(el, pseudo) {
+ this.getPropertyValue = function(prop) {
+ var _ref;
+ if (prop === 'float') {
+ prop = 'styleFloat';
+ }
+ if (getComputedStyleRX.test(prop)) {
+ prop.replace(getComputedStyleRX, function(_, char) {
+ return char.toUpperCase();
+ });
+ }
+ return ((_ref = el.currentStyle) != null ? _ref[prop] : void 0) || null;
+ };
+ return this;
+ };
+
+ getComputedStyleRX = /(\-([a-z]){1})/g;
+
+ this.WOW = (function() {
+ WOW.prototype.defaults = {
+ boxClass: 'wow',
+ animateClass: 'animated',
+ offset: 0,
+ mobile: true,
+ live: true
+ };
+
+ function WOW(options) {
+ if (options == null) {
+ options = {};
+ }
+ this.scrollCallback = __bind(this.scrollCallback, this);
+ this.scrollHandler = __bind(this.scrollHandler, this);
+ this.start = __bind(this.start, this);
+ this.scrolled = true;
+ this.config = this.util().extend(options, this.defaults);
+ this.animationNameCache = new WeakMap();
+ }
+
+ WOW.prototype.init = function() {
+ var _ref;
+ this.element = window.document.documentElement;
+ if ((_ref = document.readyState) === "interactive" || _ref === "complete") {
+ this.start();
+ } else {
+ this.util().addEvent(document, 'DOMContentLoaded', this.start);
+ }
+ return this.finished = [];
+ };
+
+ WOW.prototype.start = function() {
+ var box, _i, _len, _ref;
+ this.stopped = false;
+ this.boxes = (function() {
+ var _i, _len, _ref, _results;
+ _ref = this.element.querySelectorAll("." + this.config.boxClass);
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ box = _ref[_i];
+ _results.push(box);
+ }
+ return _results;
+ }).call(this);
+ this.all = (function() {
+ var _i, _len, _ref, _results;
+ _ref = this.boxes;
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ box = _ref[_i];
+ _results.push(box);
+ }
+ return _results;
+ }).call(this);
+ if (this.boxes.length) {
+ if (this.disabled()) {
+ this.resetStyle();
+ } else {
+ _ref = this.boxes;
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ box = _ref[_i];
+ this.applyStyle(box, true);
+ }
+ }
+ }
+ if (!this.disabled()) {
+ this.util().addEvent(window, 'scroll', this.scrollHandler);
+ this.util().addEvent(window, 'resize', this.scrollHandler);
+ this.interval = setInterval(this.scrollCallback, 50);
+ }
+ if (this.config.live) {
+ return new MutationObserver((function(_this) {
+ return function(records) {
+ var node, record, _j, _len1, _results;
+ _results = [];
+ for (_j = 0, _len1 = records.length; _j < _len1; _j++) {
+ record = records[_j];
+ _results.push((function() {
+ var _k, _len2, _ref1, _results1;
+ _ref1 = record.addedNodes || [];
+ _results1 = [];
+ for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) {
+ node = _ref1[_k];
+ _results1.push(this.doSync(node));
+ }
+ return _results1;
+ }).call(_this));
+ }
+ return _results;
+ };
+ })(this)).observe(document.body, {
+ childList: true,
+ subtree: true
+ });
+ }
+ };
+
+ WOW.prototype.stop = function() {
+ this.stopped = true;
+ this.util().removeEvent(window, 'scroll', this.scrollHandler);
+ this.util().removeEvent(window, 'resize', this.scrollHandler);
+ if (this.interval != null) {
+ return clearInterval(this.interval);
+ }
+ };
+
+ WOW.prototype.sync = function(element) {
+ if (MutationObserver.notSupported) {
+ return this.doSync(this.element);
+ }
+ };
+
+ WOW.prototype.doSync = function(element) {
+ var box, _i, _len, _ref, _results;
+ if (element == null) {
+ element = this.element;
+ }
+ if (element.nodeType !== 1) {
+ return;
+ }
+ element = element.parentNode || element;
+ _ref = element.querySelectorAll("." + this.config.boxClass);
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ box = _ref[_i];
+ if (__indexOf.call(this.all, box) < 0) {
+ this.boxes.push(box);
+ this.all.push(box);
+ if (this.stopped || this.disabled()) {
+ this.resetStyle();
+ } else {
+ this.applyStyle(box, true);
+ }
+ _results.push(this.scrolled = true);
+ } else {
+ _results.push(void 0);
+ }
+ }
+ return _results;
+ };
+
+ WOW.prototype.show = function(box) {
+ this.applyStyle(box);
+ return box.className = "" + box.className + " " + this.config.animateClass;
+ };
+
+ WOW.prototype.applyStyle = function(box, hidden) {
+ var delay, duration, iteration;
+ duration = box.getAttribute('data-wow-duration');
+ delay = box.getAttribute('data-wow-delay');
+ iteration = box.getAttribute('data-wow-iteration');
+ return this.animate((function(_this) {
+ return function() {
+ return _this.customStyle(box, hidden, duration, delay, iteration);
+ };
+ })(this));
+ };
+
+ WOW.prototype.animate = (function() {
+ if ('requestAnimationFrame' in window) {
+ return function(callback) {
+ return window.requestAnimationFrame(callback);
+ };
+ } else {
+ return function(callback) {
+ return callback();
+ };
+ }
+ })();
+
+ WOW.prototype.resetStyle = function() {
+ var box, _i, _len, _ref, _results;
+ _ref = this.boxes;
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ box = _ref[_i];
+ _results.push(box.style.visibility = 'visible');
+ }
+ return _results;
+ };
+
+ WOW.prototype.customStyle = function(box, hidden, duration, delay, iteration) {
+ if (hidden) {
+ this.cacheAnimationName(box);
+ }
+ box.style.visibility = hidden ? 'hidden' : 'visible';
+ if (duration) {
+ this.vendorSet(box.style, {
+ animationDuration: duration
+ });
+ }
+ if (delay) {
+ this.vendorSet(box.style, {
+ animationDelay: delay
+ });
+ }
+ if (iteration) {
+ this.vendorSet(box.style, {
+ animationIterationCount: iteration
+ });
+ }
+ this.vendorSet(box.style, {
+ animationName: hidden ? 'none' : this.cachedAnimationName(box)
+ });
+ return box;
+ };
+
+ WOW.prototype.vendors = ["moz", "webkit"];
+
+ WOW.prototype.vendorSet = function(elem, properties) {
+ var name, value, vendor, _results;
+ _results = [];
+ for (name in properties) {
+ value = properties[name];
+ elem["" + name] = value;
+ _results.push((function() {
+ var _i, _len, _ref, _results1;
+ _ref = this.vendors;
+ _results1 = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ vendor = _ref[_i];
+ _results1.push(elem["" + vendor + (name.charAt(0).toUpperCase()) + (name.substr(1))] = value);
+ }
+ return _results1;
+ }).call(this));
+ }
+ return _results;
+ };
+
+ WOW.prototype.vendorCSS = function(elem, property) {
+ var result, style, vendor, _i, _len, _ref;
+ style = getComputedStyle(elem);
+ result = style.getPropertyCSSValue(property);
+ _ref = this.vendors;
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ vendor = _ref[_i];
+ result = result || style.getPropertyCSSValue("-" + vendor + "-" + property);
+ }
+ return result;
+ };
+
+ WOW.prototype.animationName = function(box) {
+ var animationName;
+ try {
+ animationName = this.vendorCSS(box, 'animation-name').cssText;
+ } catch (_error) {
+ animationName = getComputedStyle(box).getPropertyValue('animation-name');
+ }
+ if (animationName === 'none') {
+ return '';
+ } else {
+ return animationName;
+ }
+ };
+
+ WOW.prototype.cacheAnimationName = function(box) {
+ return this.animationNameCache.set(box, this.animationName(box));
+ };
+
+ WOW.prototype.cachedAnimationName = function(box) {
+ return this.animationNameCache.get(box);
+ };
+
+ WOW.prototype.scrollHandler = function() {
+ return this.scrolled = true;
+ };
+
+ WOW.prototype.scrollCallback = function() {
+ var box;
+ if (this.scrolled) {
+ this.scrolled = false;
+ this.boxes = (function() {
+ var _i, _len, _ref, _results;
+ _ref = this.boxes;
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ box = _ref[_i];
+ if (!(box)) {
+ continue;
+ }
+ if (this.isVisible(box)) {
+ this.show(box);
+ continue;
+ }
+ _results.push(box);
+ }
+ return _results;
+ }).call(this);
+ if (!(this.boxes.length || this.config.live)) {
+ return this.stop();
+ }
+ }
+ };
+
+ WOW.prototype.offsetTop = function(element) {
+ var top;
+ while (element.offsetTop === void 0) {
+ element = element.parentNode;
+ }
+ top = element.offsetTop;
+ while (element = element.offsetParent) {
+ top += element.offsetTop;
+ }
+ return top;
+ };
+
+ WOW.prototype.isVisible = function(box) {
+ var bottom, offset, top, viewBottom, viewTop;
+ offset = box.getAttribute('data-wow-offset') || this.config.offset;
+ viewTop = window.pageYOffset;
+ viewBottom = viewTop + Math.min(this.element.clientHeight, this.util().innerHeight()) - offset;
+ top = this.offsetTop(box);
+ bottom = top + box.clientHeight;
+ return top <= viewBottom && bottom >= viewTop;
+ };
+
+ WOW.prototype.util = function() {
+ return this._util != null ? this._util : this._util = new Util();
+ };
+
+ WOW.prototype.disabled = function() {
+ return !this.config.mobile && this.util().isMobile(navigator.userAgent);
+ };
+
+ return WOW;
+
+ })();
+
+}).call(this);
diff --git a/django_code/templates/cloudmanager/js/wow.min.js b/django_code/templates/cloudmanager/js/wow.min.js
new file mode 100644
index 0000000..2124a96
--- /dev/null
+++ b/django_code/templates/cloudmanager/js/wow.min.js
@@ -0,0 +1,2 @@
+/*! WOW - v1.0.2 - 2014-10-28
+* Copyright (c) 2014 Matthieu Aussaguel; Licensed MIT */(function(){var a,b,c,d,e,f=function(a,b){return function(){return a.apply(b,arguments)}},g=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};b=function(){function a(){}return a.prototype.extend=function(a,b){var c,d;for(c in b)d=b[c],null==a[c]&&(a[c]=d);return a},a.prototype.isMobile=function(a){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(a)},a.prototype.addEvent=function(a,b,c){return null!=a.addEventListener?a.addEventListener(b,c,!1):null!=a.attachEvent?a.attachEvent("on"+b,c):a[b]=c},a.prototype.removeEvent=function(a,b,c){return null!=a.removeEventListener?a.removeEventListener(b,c,!1):null!=a.detachEvent?a.detachEvent("on"+b,c):delete a[b]},a.prototype.innerHeight=function(){return"innerHeight"in window?window.innerHeight:document.documentElement.clientHeight},a}(),c=this.WeakMap||this.MozWeakMap||(c=function(){function a(){this.keys=[],this.values=[]}return a.prototype.get=function(a){var b,c,d,e,f;for(f=this.keys,b=d=0,e=f.length;e>d;b=++d)if(c=f[b],c===a)return this.values[b]},a.prototype.set=function(a,b){var c,d,e,f,g;for(g=this.keys,c=e=0,f=g.length;f>e;c=++e)if(d=g[c],d===a)return void(this.values[c]=b);return this.keys.push(a),this.values.push(b)},a}()),a=this.MutationObserver||this.WebkitMutationObserver||this.MozMutationObserver||(a=function(){function a(){"undefined"!=typeof console&&null!==console&&console.warn("MutationObserver is not supported by your browser."),"undefined"!=typeof console&&null!==console&&console.warn("WOW.js cannot detect dom mutations, please call .sync() after loading new content.")}return a.notSupported=!0,a.prototype.observe=function(){},a}()),d=this.getComputedStyle||function(a){return this.getPropertyValue=function(b){var c;return"float"===b&&(b="styleFloat"),e.test(b)&&b.replace(e,function(a,b){return b.toUpperCase()}),(null!=(c=a.currentStyle)?c[b]:void 0)||null},this},e=/(\-([a-z]){1})/g,this.WOW=function(){function e(a){null==a&&(a={}),this.scrollCallback=f(this.scrollCallback,this),this.scrollHandler=f(this.scrollHandler,this),this.start=f(this.start,this),this.scrolled=!0,this.config=this.util().extend(a,this.defaults),this.animationNameCache=new c}return e.prototype.defaults={boxClass:"wow",animateClass:"animated",offset:0,mobile:!0,live:!0},e.prototype.init=function(){var a;return this.element=window.document.documentElement,"interactive"===(a=document.readyState)||"complete"===a?this.start():this.util().addEvent(document,"DOMContentLoaded",this.start),this.finished=[]},e.prototype.start=function(){var b,c,d,e;if(this.stopped=!1,this.boxes=function(){var a,c,d,e;for(d=this.element.querySelectorAll("."+this.config.boxClass),e=[],a=0,c=d.length;c>a;a++)b=d[a],e.push(b);return e}.call(this),this.all=function(){var a,c,d,e;for(d=this.boxes,e=[],a=0,c=d.length;c>a;a++)b=d[a],e.push(b);return e}.call(this),this.boxes.length)if(this.disabled())this.resetStyle();else for(e=this.boxes,c=0,d=e.length;d>c;c++)b=e[c],this.applyStyle(b,!0);return this.disabled()||(this.util().addEvent(window,"scroll",this.scrollHandler),this.util().addEvent(window,"resize",this.scrollHandler),this.interval=setInterval(this.scrollCallback,50)),this.config.live?new a(function(a){return function(b){var c,d,e,f,g;for(g=[],e=0,f=b.length;f>e;e++)d=b[e],g.push(function(){var a,b,e,f;for(e=d.addedNodes||[],f=[],a=0,b=e.length;b>a;a++)c=e[a],f.push(this.doSync(c));return f}.call(a));return g}}(this)).observe(document.body,{childList:!0,subtree:!0}):void 0},e.prototype.stop=function(){return this.stopped=!0,this.util().removeEvent(window,"scroll",this.scrollHandler),this.util().removeEvent(window,"resize",this.scrollHandler),null!=this.interval?clearInterval(this.interval):void 0},e.prototype.sync=function(){return a.notSupported?this.doSync(this.element):void 0},e.prototype.doSync=function(a){var b,c,d,e,f;if(null==a&&(a=this.element),1===a.nodeType){for(a=a.parentNode||a,e=a.querySelectorAll("."+this.config.boxClass),f=[],c=0,d=e.length;d>c;c++)b=e[c],g.call(this.all,b)<0?(this.boxes.push(b),this.all.push(b),this.stopped||this.disabled()?this.resetStyle():this.applyStyle(b,!0),f.push(this.scrolled=!0)):f.push(void 0);return f}},e.prototype.show=function(a){return this.applyStyle(a),a.className=""+a.className+" "+this.config.animateClass},e.prototype.applyStyle=function(a,b){var c,d,e;return d=a.getAttribute("data-wow-duration"),c=a.getAttribute("data-wow-delay"),e=a.getAttribute("data-wow-iteration"),this.animate(function(f){return function(){return f.customStyle(a,b,d,c,e)}}(this))},e.prototype.animate=function(){return"requestAnimationFrame"in window?function(a){return window.requestAnimationFrame(a)}:function(a){return a()}}(),e.prototype.resetStyle=function(){var a,b,c,d,e;for(d=this.boxes,e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(a.style.visibility="visible");return e},e.prototype.customStyle=function(a,b,c,d,e){return b&&this.cacheAnimationName(a),a.style.visibility=b?"hidden":"visible",c&&this.vendorSet(a.style,{animationDuration:c}),d&&this.vendorSet(a.style,{animationDelay:d}),e&&this.vendorSet(a.style,{animationIterationCount:e}),this.vendorSet(a.style,{animationName:b?"none":this.cachedAnimationName(a)}),a},e.prototype.vendors=["moz","webkit"],e.prototype.vendorSet=function(a,b){var c,d,e,f;f=[];for(c in b)d=b[c],a[""+c]=d,f.push(function(){var b,f,g,h;for(g=this.vendors,h=[],b=0,f=g.length;f>b;b++)e=g[b],h.push(a[""+e+c.charAt(0).toUpperCase()+c.substr(1)]=d);return h}.call(this));return f},e.prototype.vendorCSS=function(a,b){var c,e,f,g,h,i;for(e=d(a),c=e.getPropertyCSSValue(b),i=this.vendors,g=0,h=i.length;h>g;g++)f=i[g],c=c||e.getPropertyCSSValue("-"+f+"-"+b);return c},e.prototype.animationName=function(a){var b;try{b=this.vendorCSS(a,"animation-name").cssText}catch(c){b=d(a).getPropertyValue("animation-name")}return"none"===b?"":b},e.prototype.cacheAnimationName=function(a){return this.animationNameCache.set(a,this.animationName(a))},e.prototype.cachedAnimationName=function(a){return this.animationNameCache.get(a)},e.prototype.scrollHandler=function(){return this.scrolled=!0},e.prototype.scrollCallback=function(){var a;return!this.scrolled||(this.scrolled=!1,this.boxes=function(){var b,c,d,e;for(d=this.boxes,e=[],b=0,c=d.length;c>b;b++)a=d[b],a&&(this.isVisible(a)?this.show(a):e.push(a));return e}.call(this),this.boxes.length||this.config.live)?void 0:this.stop()},e.prototype.offsetTop=function(a){for(var b;void 0===a.offsetTop;)a=a.parentNode;for(b=a.offsetTop;a=a.offsetParent;)b+=a.offsetTop;return b},e.prototype.isVisible=function(a){var b,c,d,e,f;return c=a.getAttribute("data-wow-offset")||this.config.offset,f=window.pageYOffset,e=f+Math.min(this.element.clientHeight,this.util().innerHeight())-c,d=this.offsetTop(a),b=d+a.clientHeight,e>=d&&b>=f},e.prototype.util=function(){return null!=this._util?this._util:this._util=new b},e.prototype.disabled=function(){return!this.config.mobile&&this.util().isMobile(navigator.userAgent)},e}()}).call(this);
\ No newline at end of file
diff --git a/django_code/dashboard/templates/about.html b/django_code/templates/dashboard/about.html
similarity index 100%
rename from django_code/dashboard/templates/about.html
rename to django_code/templates/dashboard/about.html
diff --git a/django_code/dashboard/templates/home.html b/django_code/templates/dashboard/home.html
similarity index 100%
rename from django_code/dashboard/templates/home.html
rename to django_code/templates/dashboard/home.html
diff --git a/django_code/dashboard/templates/shutdown.html b/django_code/templates/dashboard/shutdown.html
similarity index 100%
rename from django_code/dashboard/templates/shutdown.html
rename to django_code/templates/dashboard/shutdown.html
diff --git a/django_code/dashboard/templates/start.html b/django_code/templates/dashboard/start.html
similarity index 100%
rename from django_code/dashboard/templates/start.html
rename to django_code/templates/dashboard/start.html
diff --git a/django_code/kubernetes_connection/templates/my_template.html b/django_code/templates/random_simpsons/my_template.html
similarity index 100%
rename from django_code/kubernetes_connection/templates/my_template.html
rename to django_code/templates/random_simpsons/my_template.html
diff --git a/django_code/stash_management/templates/album_form.html b/django_code/templates/stash/album_form.html
similarity index 100%
rename from django_code/stash_management/templates/album_form.html
rename to django_code/templates/stash/album_form.html
diff --git a/django_code/stash_management/templates/incremental_form.html b/django_code/templates/stash/incremental_form.html
similarity index 100%
rename from django_code/stash_management/templates/incremental_form.html
rename to django_code/templates/stash/incremental_form.html
diff --git a/django_code/stash_management/templates/listing.html b/django_code/templates/stash/listing.html
similarity index 100%
rename from django_code/stash_management/templates/listing.html
rename to django_code/templates/stash/listing.html
diff --git a/django_code/random_simpsons/templates/my_template.html b/django_code/templates/stash/my_template.html
similarity index 100%
rename from django_code/random_simpsons/templates/my_template.html
rename to django_code/templates/stash/my_template.html
diff --git a/django_code/stash_management/templates/simple_form.html b/django_code/templates/stash/simple_form.html
similarity index 100%
rename from django_code/stash_management/templates/simple_form.html
rename to django_code/templates/stash/simple_form.html
diff --git a/django_code/stash_management/templates/stash_form.html b/django_code/templates/stash/stash_form.html
similarity index 100%
rename from django_code/stash_management/templates/stash_form.html
rename to django_code/templates/stash/stash_form.html
diff --git a/django_code/stash_management/templates/template.stash-pornpics-dowloader.job.yml b/django_code/templates/stash/template.stash-pornpics-dowloader.job.yml
similarity index 100%
rename from django_code/stash_management/templates/template.stash-pornpics-dowloader.job.yml
rename to django_code/templates/stash/template.stash-pornpics-dowloader.job.yml
diff --git a/django_code/website_redirection/templates/blank_page.html b/django_code/templates/website_redirection/blank_page.html
similarity index 100%
rename from django_code/website_redirection/templates/blank_page.html
rename to django_code/templates/website_redirection/blank_page.html
diff --git a/django_code/templates/website_redirection/redirect_form.html b/django_code/templates/website_redirection/redirect_form.html
new file mode 100644
index 0000000..8546ce5
--- /dev/null
+++ b/django_code/templates/website_redirection/redirect_form.html
@@ -0,0 +1,294 @@
+
+
+
+
+
+ Redirect form
+
+
+
+
+
+
+
+
+
+
+
+
Redirect Form
+
Download form
+
+
+
+
+
+
+
diff --git a/django_code/website_redirection/models.py b/django_code/website_redirection/models.py
deleted file mode 100644
index 71a8362..0000000
--- a/django_code/website_redirection/models.py
+++ /dev/null
@@ -1,3 +0,0 @@
-from django.db import models
-
-# Create your models here.
diff --git a/docker-compose.yml b/docker-compose.yml
index b0b2389..6a252cf 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,12 +1,12 @@
services:
db:
- image: django:local
+ image: docker.io/library/postgres:latest
restart: always
volumes:
- - type: bind
- target: /code
- source: ./django_code
- command: python manage.py runserver 0.0.0.0:7000
+ - db:/var/lib/postgresql/
ports:
- - 7000:7000
-
+ - 5432:5432
+ environment:
+ POSTGRES_PASSWORD: example
+volumes:
+ db: