From 66e8ef6006dafafce422933214f714884d0885f7 Mon Sep 17 00:00:00 2001 From: Julian Kniephoff Date: Tue, 19 Dec 2023 17:06:29 +0100 Subject: [PATCH] Get frontend dependencies from NPM instead of vendoring them Not all of the libraries we were using could be found (in the correct version) in NPM, so had to get creative with some of them. I tried to stick to our current versions as closely as possible, except for some that were easy to update. Thus, most versions are pinned instead of using the usual `^x.y.z` constraint. Only ones where we are using a current version anyway, and where minor updates should be fine use the more traditional constraint. Here are the detailed notes about where dependencies (might have) changed: * `vis-timeline` should be in the correct version, but the NPM build is a few moments younger, and differs slightly. I hope it's just variable naming or something like that, but comparing minified JS is hard, so I'm not 100% sure. * `jquery.colorPicker` (or rather `really-simple-colorpicker` as the NPM package is called) is newer, because the original version isn't in NPM. Our use of it is relatively isolated, though, and it still seems to work superficially, so I'm relatively confident that this is fine. * `jquery.appear` was never actually in use, so I removed it. * `jquery` itself is updated to `1.8.2`. We were on `1.8.0` which is not in NPM. `1.8.2` is, and that should be fine, but jQuery is one of these candidates that you can never really be sure about since it doesn't follow SemVer perfectly and is used so pervasively, that even checking all our usages against the changelog is basically impossible. * `i18next-xhr-backend` was replaced with (the newest version of) `i18next-http-backend`. The former is deprecated and not in NPM anymore, but the update here is literally a drop in replacement, apparently. * Our Bootstrap version (`2.3.2`) is so dead it's not even funny. No `2.x` release is in NPM. Fortunately in this case one can just install it directly from their GitHub using the appropriate tag, but this is a bit shady and I want to get rid of it sooner rather than later. Unfortunately upgrading Bootstrap is a rather invasive step. * The Bootstrap slider thing we were using doesn't even have a GitHub. I replaced it with one that does, and which is based on our original one. I used the oldest release they have on GitHub, and seems to be more or less the same, still, but there have been significant code changes between the two. As with the color picker, this is a rather isolated thing, though, so we should be fine? * The RequireJS `text` plugin wasn't used anymore, so I got rid of it. * RequireJS `domReady` only has newer versions in NPM, but they seem to work fine, even though there was a major jump here. * `moment` got a minor update because the version we were using was actually incompatible with our `vis-timeline` version, and our own few uses should still work exactly the same. Note that this is merely a convenience to make `npm install` work. We are using all of these libraries pre-bundled, so `vis-timeline` isn't actually using the version of `moment` we are including, but rather comes with its own. Fixes #138. Fixes #457. --- frontend/.eslintrc.js | 1 - frontend/Gruntfile.js | 13 +- frontend/img/arrow.gif | Bin 111 -> 0 bytes frontend/index.html | 2 +- frontend/js/libs/FileSaver.min.js | 3 - frontend/js/libs/Sortable.min.js | 2 - frontend/js/libs/backbone-min.js | 2 - frontend/js/libs/backbone-min.map | 1 - frontend/js/libs/backbone.js | 1571 -- .../js/libs/bootstrap/bootstrap-slider.js | 388 - frontend/js/libs/bootstrap/bootstrap.min.js | 6 - frontend/js/libs/chroma.min.js | 58 - frontend/js/libs/goldenlayout.js | 5344 ----- frontend/js/libs/handlebars.js | 5210 ----- frontend/js/libs/i18next.min.js | 8 - .../i18nextBrowserLanguageDetector.min.js | 7 - frontend/js/libs/i18nextXHRBackend.min.js | 7 - frontend/js/libs/jquery-1.8.0.js | 9227 -------- frontend/js/libs/jquery-i18next.min.js | 7 - frontend/js/libs/jquery.appear.js | 109 - frontend/js/libs/jquery.colorPicker.min.js | 26 - frontend/js/libs/mediaelement/lang/ca.js | 89 - frontend/js/libs/mediaelement/lang/cs.js | 90 - frontend/js/libs/mediaelement/lang/de.js | 90 - frontend/js/libs/mediaelement/lang/es.js | 90 - frontend/js/libs/mediaelement/lang/fa.js | 90 - frontend/js/libs/mediaelement/lang/fr.js | 91 - frontend/js/libs/mediaelement/lang/hr.js | 87 - frontend/js/libs/mediaelement/lang/hu.js | 90 - frontend/js/libs/mediaelement/lang/it.js | 90 - frontend/js/libs/mediaelement/lang/ja.js | 90 - frontend/js/libs/mediaelement/lang/ko.js | 90 - frontend/js/libs/mediaelement/lang/nl.js | 91 - frontend/js/libs/mediaelement/lang/pl.js | 90 - frontend/js/libs/mediaelement/lang/pt.js | 92 - frontend/js/libs/mediaelement/lang/ro.js | 90 - frontend/js/libs/mediaelement/lang/ru.js | 90 - frontend/js/libs/mediaelement/lang/sk.js | 90 - frontend/js/libs/mediaelement/lang/sv.js | 89 - frontend/js/libs/mediaelement/lang/uk.js | 89 - frontend/js/libs/mediaelement/lang/zh-cn.js | 90 - frontend/js/libs/mediaelement/lang/zh.js | 91 - .../mediaelement/mediaelement-and-player.js | 8540 -------- .../js/libs/mediaelement/renderers/hls.js | 18168 ---------------- .../js/libs/mediaelement/renderers/hls.js.map | 1 - frontend/js/libs/moment-with-locales.js | 13706 ------------ frontend/js/libs/mousetrap.min.js | 31 - frontend/js/libs/papaparse.min.js | 7 - frontend/js/libs/require/domReady.js | 7 - frontend/js/libs/require/require.js | 2145 -- frontend/js/libs/require/text.js | 11 - frontend/js/libs/underscore-min.js | 5 - frontend/js/libs/underscore-min.map | 1 - frontend/js/libs/underscore.js | 1688 -- .../vis-timeline/vis-timeline-graph2d.min.js | 84 - .../vis-timeline-graph2d.min.js.map | 1 - frontend/js/libs/xlsx.full.min.js | 25 - frontend/js/main.js | 12 +- frontend/js/require.config.js | 51 +- frontend/js/views/alert.js | 3 +- frontend/js/views/category-modal.js | 1 - frontend/js/views/list.js | 3 +- frontend/js/views/main.js | 3 +- frontend/js/views/modal-add-free-text.js | 2 +- frontend/js/views/modal-add-labelled.js | 3 +- frontend/js/views/modal-container.js | 2 +- frontend/js/views/modal-edit-free-text.js | 2 +- frontend/js/views/modal-edit-labelled.js | 3 +- frontend/js/views/modal-mca.js | 3 +- frontend/js/views/modal.js | 3 +- frontend/js/views/questionnaire-block-text.js | 3 +- frontend/js/views/questionnaire/categories.js | 3 +- frontend/js/views/questionnaire/help.js | 3 +- frontend/js/views/questionnaire/label.js | 3 +- frontend/js/views/questionnaire/scale.js | 3 +- frontend/js/views/questionnaire/text.js | 3 +- frontend/js/views/timeline.js | 3 +- frontend/package-lock.json | 5100 ++++- frontend/package.json | 26 + frontend/style/bootstrap-slider/slider.less | 104 - frontend/style/bootstrap/accordion.less | 34 - frontend/style/bootstrap/alerts.less | 79 - frontend/style/bootstrap/bootstrap.less | 63 - frontend/style/bootstrap/breadcrumbs.less | 24 - frontend/style/bootstrap/button-groups.less | 229 - frontend/style/bootstrap/buttons.less | 228 - frontend/style/bootstrap/carousel.less | 160 - frontend/style/bootstrap/close.less | 32 - frontend/style/bootstrap/code.less | 61 - .../style/bootstrap/component-animations.less | 22 - frontend/style/bootstrap/dropdowns.less | 249 - frontend/style/bootstrap/forms.less | 690 - frontend/style/bootstrap/grid.less | 21 - frontend/style/bootstrap/hero-unit.less | 25 - frontend/style/bootstrap/labels-badges.less | 84 - frontend/style/bootstrap/layouts.less | 16 - frontend/style/bootstrap/media.less | 55 - frontend/style/bootstrap/mixins.less | 702 - frontend/style/bootstrap/modals.less | 97 - frontend/style/bootstrap/navbar.less | 497 - frontend/style/bootstrap/navs.less | 409 - frontend/style/bootstrap/pager.less | 43 - frontend/style/bootstrap/pagination.less | 123 - frontend/style/bootstrap/popovers.less | 133 - frontend/style/bootstrap/progress-bars.less | 122 - frontend/style/bootstrap/reset.less | 216 - .../bootstrap/responsive-1200px-min.less | 28 - .../style/bootstrap/responsive-767px-max.less | 193 - .../bootstrap/responsive-768px-979px.less | 19 - .../style/bootstrap/responsive-navbar.less | 189 - .../style/bootstrap/responsive-utilities.less | 59 - frontend/style/bootstrap/responsive.less | 48 - frontend/style/bootstrap/scaffolding.less | 53 - frontend/style/bootstrap/sprites.less | 197 - frontend/style/bootstrap/tables.less | 244 - frontend/style/bootstrap/thumbnails.less | 53 - frontend/style/bootstrap/tooltip.less | 70 - frontend/style/bootstrap/type.less | 247 - frontend/style/bootstrap/utilities.less | 30 - frontend/style/bootstrap/variables.less | 301 - frontend/style/bootstrap/wells.less | 29 - frontend/style/colorpicker.css | 36 - frontend/style/goldenlayout/base.css | 1 - frontend/style/goldenlayout/dark-theme.css | 1 - .../goldenlayout/goldenlayout-base.css.map | 1 - .../goldenlayout-dark-theme.css.map | 1 - .../mediaelementplayer.min.css | 1 - .../mediaelementplayer/mejs-controls.png | Bin 2883 -> 0 bytes .../mediaelementplayer/mejs-controls.svg | 1 - frontend/style/style.less | 14 +- .../vis-timeline/vis-timeline-graph2d.css | 1 - 131 files changed, 4837 insertions(+), 75037 deletions(-) delete mode 100644 frontend/img/arrow.gif delete mode 100755 frontend/js/libs/FileSaver.min.js delete mode 100644 frontend/js/libs/Sortable.min.js delete mode 100644 frontend/js/libs/backbone-min.js delete mode 100644 frontend/js/libs/backbone-min.map delete mode 100644 frontend/js/libs/backbone.js delete mode 100755 frontend/js/libs/bootstrap/bootstrap-slider.js delete mode 100644 frontend/js/libs/bootstrap/bootstrap.min.js delete mode 100644 frontend/js/libs/chroma.min.js delete mode 100644 frontend/js/libs/goldenlayout.js delete mode 100644 frontend/js/libs/handlebars.js delete mode 100644 frontend/js/libs/i18next.min.js delete mode 100644 frontend/js/libs/i18nextBrowserLanguageDetector.min.js delete mode 100644 frontend/js/libs/i18nextXHRBackend.min.js delete mode 100644 frontend/js/libs/jquery-1.8.0.js delete mode 100644 frontend/js/libs/jquery-i18next.min.js delete mode 100644 frontend/js/libs/jquery.appear.js delete mode 100755 frontend/js/libs/jquery.colorPicker.min.js delete mode 100644 frontend/js/libs/mediaelement/lang/ca.js delete mode 100644 frontend/js/libs/mediaelement/lang/cs.js delete mode 100644 frontend/js/libs/mediaelement/lang/de.js delete mode 100644 frontend/js/libs/mediaelement/lang/es.js delete mode 100644 frontend/js/libs/mediaelement/lang/fa.js delete mode 100644 frontend/js/libs/mediaelement/lang/fr.js delete mode 100644 frontend/js/libs/mediaelement/lang/hr.js delete mode 100644 frontend/js/libs/mediaelement/lang/hu.js delete mode 100644 frontend/js/libs/mediaelement/lang/it.js delete mode 100644 frontend/js/libs/mediaelement/lang/ja.js delete mode 100644 frontend/js/libs/mediaelement/lang/ko.js delete mode 100644 frontend/js/libs/mediaelement/lang/nl.js delete mode 100644 frontend/js/libs/mediaelement/lang/pl.js delete mode 100644 frontend/js/libs/mediaelement/lang/pt.js delete mode 100644 frontend/js/libs/mediaelement/lang/ro.js delete mode 100644 frontend/js/libs/mediaelement/lang/ru.js delete mode 100644 frontend/js/libs/mediaelement/lang/sk.js delete mode 100644 frontend/js/libs/mediaelement/lang/sv.js delete mode 100644 frontend/js/libs/mediaelement/lang/uk.js delete mode 100644 frontend/js/libs/mediaelement/lang/zh-cn.js delete mode 100644 frontend/js/libs/mediaelement/lang/zh.js delete mode 100644 frontend/js/libs/mediaelement/mediaelement-and-player.js delete mode 100644 frontend/js/libs/mediaelement/renderers/hls.js delete mode 100644 frontend/js/libs/mediaelement/renderers/hls.js.map delete mode 100644 frontend/js/libs/moment-with-locales.js delete mode 100644 frontend/js/libs/mousetrap.min.js delete mode 100644 frontend/js/libs/papaparse.min.js delete mode 100644 frontend/js/libs/require/domReady.js delete mode 100644 frontend/js/libs/require/require.js delete mode 100644 frontend/js/libs/require/text.js delete mode 100644 frontend/js/libs/underscore-min.js delete mode 100644 frontend/js/libs/underscore-min.map delete mode 100644 frontend/js/libs/underscore.js delete mode 100644 frontend/js/libs/vis-timeline/vis-timeline-graph2d.min.js delete mode 100644 frontend/js/libs/vis-timeline/vis-timeline-graph2d.min.js.map delete mode 100644 frontend/js/libs/xlsx.full.min.js delete mode 100644 frontend/style/bootstrap-slider/slider.less delete mode 100644 frontend/style/bootstrap/accordion.less delete mode 100644 frontend/style/bootstrap/alerts.less delete mode 100644 frontend/style/bootstrap/bootstrap.less delete mode 100644 frontend/style/bootstrap/breadcrumbs.less delete mode 100644 frontend/style/bootstrap/button-groups.less delete mode 100644 frontend/style/bootstrap/buttons.less delete mode 100644 frontend/style/bootstrap/carousel.less delete mode 100644 frontend/style/bootstrap/close.less delete mode 100644 frontend/style/bootstrap/code.less delete mode 100644 frontend/style/bootstrap/component-animations.less delete mode 100644 frontend/style/bootstrap/dropdowns.less delete mode 100644 frontend/style/bootstrap/forms.less delete mode 100644 frontend/style/bootstrap/grid.less delete mode 100644 frontend/style/bootstrap/hero-unit.less delete mode 100644 frontend/style/bootstrap/labels-badges.less delete mode 100644 frontend/style/bootstrap/layouts.less delete mode 100644 frontend/style/bootstrap/media.less delete mode 100644 frontend/style/bootstrap/mixins.less delete mode 100644 frontend/style/bootstrap/modals.less delete mode 100644 frontend/style/bootstrap/navbar.less delete mode 100644 frontend/style/bootstrap/navs.less delete mode 100644 frontend/style/bootstrap/pager.less delete mode 100644 frontend/style/bootstrap/pagination.less delete mode 100644 frontend/style/bootstrap/popovers.less delete mode 100644 frontend/style/bootstrap/progress-bars.less delete mode 100644 frontend/style/bootstrap/reset.less delete mode 100644 frontend/style/bootstrap/responsive-1200px-min.less delete mode 100644 frontend/style/bootstrap/responsive-767px-max.less delete mode 100644 frontend/style/bootstrap/responsive-768px-979px.less delete mode 100644 frontend/style/bootstrap/responsive-navbar.less delete mode 100644 frontend/style/bootstrap/responsive-utilities.less delete mode 100644 frontend/style/bootstrap/responsive.less delete mode 100644 frontend/style/bootstrap/scaffolding.less delete mode 100644 frontend/style/bootstrap/sprites.less delete mode 100644 frontend/style/bootstrap/tables.less delete mode 100644 frontend/style/bootstrap/thumbnails.less delete mode 100644 frontend/style/bootstrap/tooltip.less delete mode 100644 frontend/style/bootstrap/type.less delete mode 100644 frontend/style/bootstrap/utilities.less delete mode 100644 frontend/style/bootstrap/variables.less delete mode 100644 frontend/style/bootstrap/wells.less delete mode 100644 frontend/style/colorpicker.css delete mode 100644 frontend/style/goldenlayout/base.css delete mode 100644 frontend/style/goldenlayout/dark-theme.css delete mode 100644 frontend/style/goldenlayout/goldenlayout-base.css.map delete mode 100644 frontend/style/goldenlayout/goldenlayout-dark-theme.css.map delete mode 100644 frontend/style/mediaelementplayer/mediaelementplayer.min.css delete mode 100644 frontend/style/mediaelementplayer/mejs-controls.png delete mode 100644 frontend/style/mediaelementplayer/mejs-controls.svg delete mode 100644 frontend/style/vis-timeline/vis-timeline-graph2d.css diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js index a536f02c9..6b21c9162 100644 --- a/frontend/.eslintrc.js +++ b/frontend/.eslintrc.js @@ -1,6 +1,5 @@ module.exports = { ignorePatterns: [ - '/js/libs', 'src', 'target', '!.*' diff --git a/frontend/Gruntfile.js b/frontend/Gruntfile.js index dd1ab0ad7..b410acf94 100644 --- a/frontend/Gruntfile.js +++ b/frontend/Gruntfile.js @@ -13,7 +13,7 @@ module.exports = function (grunt) { less: { options: { - paths: 'style', + paths: ['style', 'node_modules/bootstrap/less'], syncImport: true, compress: true, sourceMap: true, @@ -47,7 +47,8 @@ module.exports = function (grunt) { 'js/**/*', 'img/**/*', 'style/**/*', - 'locales/**/*' + 'locales/**/*', + 'node_modules/**/*' ], dest: '<%= destPath %>' }, { @@ -67,12 +68,16 @@ module.exports = function (grunt) { 'jquery.colorPicker', 'slider', 'bootstrap', + 'slider', + // This is actually an AMD module + // but doesn't behave correctly. + // See https://github.com/eligrey/FileSaver.js/issues/646 'filesaver' ] }, all: { expand: true, - src: ['js/**/*.js', '!js/libs/**/*'], + src: ['js/**/*.js'], dest: '.' } }, @@ -83,7 +88,7 @@ module.exports = function (grunt) { maxWarnings: grunt.option('maxWarnings'), fix: grunt.option('fix') }, - files: ['js/**/*.js', './{,.}*.js', '!js/libs/**/{,.}*'] + files: ['js/**/*.js', './{,.}*.js'] }, stylelint: { diff --git a/frontend/img/arrow.gif b/frontend/img/arrow.gif deleted file mode 100644 index b9bdca92f8947235cb599742587af5cc43847b58..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 111 zcmZ?wbhEHb6krfw*v!Ci>(;Gv=gyrvb!zY4y<4|#UAuPe(xpr1%$f85|9=K-K=CIF wBRc~JgAPa%WCjC^jKE3H)q5>opWXdGL8H&(A+Ni-$TKm44{SWli7pJ*0Q^NHd;kCd diff --git a/frontend/index.html b/frontend/index.html index 35413b170..da7d1e55c 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -7,7 +7,7 @@ - + diff --git a/frontend/js/libs/FileSaver.min.js b/frontend/js/libs/FileSaver.min.js deleted file mode 100755 index 40e742ddc..000000000 --- a/frontend/js/libs/FileSaver.min.js +++ /dev/null @@ -1,3 +0,0 @@ -// source: https://raw.githubusercontent.com/eligrey/FileSaver.js/43bbd2f0ae6794f8d452cd360e9d33aef6071234/dist/FileSaver.min.js -// license: MIT -(function(a,b){if("function"==typeof define&&define.amd)define([],b);else if("undefined"!=typeof exports)b();else{b(),a.FileSaver={exports:{}}.exports}})(this,function(){"use strict";function b(a,b){return"undefined"==typeof b?b={autoBom:!1}:"object"!=typeof b&&(console.warn("Deprecated: Expected third argument to be a object"),b={autoBom:!b}),b.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}function c(a,b,c){var d=new XMLHttpRequest;d.open("GET",a),d.responseType="blob",d.onload=function(){g(d.response,b,c)},d.onerror=function(){console.error("could not download file")},d.send()}function d(a){var b=new XMLHttpRequest;b.open("HEAD",a,!1);try{b.send()}catch(a){}return 200<=b.status&&299>=b.status}function e(a){try{a.dispatchEvent(new MouseEvent("click"))}catch(c){var b=document.createEvent("MouseEvents");b.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(b)}}var f="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,a=/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),g=f.saveAs||("object"!=typeof window||window!==f?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(b,g,h){var i=f.URL||f.webkitURL,j=document.createElement("a");g=g||b.name||"download",j.download=g,j.rel="noopener","string"==typeof b?(j.href=b,j.origin===location.origin?e(j):d(j.href)?c(b,g,h):e(j,j.target="_blank")):(j.href=i.createObjectURL(b),setTimeout(function(){i.revokeObjectURL(j.href)},4E4),setTimeout(function(){e(j)},0))}:"msSaveOrOpenBlob"in navigator?function(f,g,h){if(g=g||f.name||"download","string"!=typeof f)navigator.msSaveOrOpenBlob(b(f,h),g);else if(d(f))c(f,g,h);else{var i=document.createElement("a");i.href=f,i.target="_blank",setTimeout(function(){e(i)})}}:function(b,d,e,g){if(g=g||open("","_blank"),g&&(g.document.title=g.document.body.innerText="downloading..."),"string"==typeof b)return c(b,d,e);var h="application/octet-stream"===b.type,i=/constructor/i.test(f.HTMLElement)||f.safari,j=/CriOS\/[\d]+/.test(navigator.userAgent);if((j||h&&i||a)&&"undefined"!=typeof FileReader){var k=new FileReader;k.onloadend=function(){var a=k.result;a=j?a:a.replace(/^data:[^;]*;/,"data:attachment/file;"),g?g.location.href=a:location=a,g=null},k.readAsDataURL(b)}else{var l=f.URL||f.webkitURL,m=l.createObjectURL(b);g?g.location=m:location.href=m,g=null,setTimeout(function(){l.revokeObjectURL(m)},4E4)}});f.saveAs=g.saveAs=g,"undefined"!=typeof module&&(module.exports=g)}); diff --git a/frontend/js/libs/Sortable.min.js b/frontend/js/libs/Sortable.min.js deleted file mode 100644 index 573538f0d..000000000 --- a/frontend/js/libs/Sortable.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! Sortable 1.6.0 - MIT | git://github.com/rubaxa/Sortable.git */ -!function(a){"use strict";"function"==typeof define&&define.amd?define(a):"undefined"!=typeof module&&"undefined"!=typeof module.exports?module.exports=a():window.Sortable=a()}(function(){"use strict";function a(a,b){if(!a||!a.nodeType||1!==a.nodeType)throw"Sortable: `el` must be HTMLElement, and not "+{}.toString.call(a);this.el=a,this.options=b=t({},b),a[T]=this;var c={group:Math.random(),sort:!0,disabled:!1,store:null,handle:null,scroll:!0,scrollSensitivity:30,scrollSpeed:10,draggable:/[uo]l/i.test(a.nodeName)?"li":">*",ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,setData:function(a,b){a.setData("Text",b.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0}};for(var d in c)!(d in b)&&(b[d]=c[d]);ga(b);for(var e in this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this));this.nativeDraggable=!b.forceFallback&&$,f(a,"mousedown",this._onTapStart),f(a,"touchstart",this._onTapStart),f(a,"pointerdown",this._onTapStart),this.nativeDraggable&&(f(a,"dragover",this),f(a,"dragenter",this)),ea.push(this._onDragOver),b.store&&this.sort(b.store.get(this))}function b(a,b){"clone"!==a.lastPullMode&&(b=!0),z&&z.state!==b&&(i(z,"display",b?"none":""),b||z.state&&(a.options.group.revertClone?(A.insertBefore(z,B),a._animate(w,z)):A.insertBefore(z,w)),z.state=b)}function c(a,b,c){if(a){c=c||V;do if(">*"===b&&a.parentNode===c||r(a,b))return a;while(a=d(a))}return null}function d(a){var b=a.host;return b&&b.nodeType?b:a.parentNode}function e(a){a.dataTransfer&&(a.dataTransfer.dropEffect="move"),a.preventDefault()}function f(a,b,c){a.addEventListener(b,c,Z)}function g(a,b,c){a.removeEventListener(b,c,Z)}function h(a,b,c){if(a)if(a.classList)a.classList[c?"add":"remove"](b);else{var d=(" "+a.className+" ").replace(R," ").replace(" "+b+" "," ");a.className=(d+(c?" "+b:"")).replace(R," ")}}function i(a,b,c){var d=a&&a.style;if(d){if(void 0===c)return V.defaultView&&V.defaultView.getComputedStyle?c=V.defaultView.getComputedStyle(a,""):a.currentStyle&&(c=a.currentStyle),void 0===b?c:c[b];b in d||(b="-webkit-"+b),d[b]=c+("string"==typeof c?"":"px")}}function j(a,b,c){if(a){var d=a.getElementsByTagName(b),e=0,f=d.length;if(c)for(;e5||b.clientX-(d.left+d.width)>5}function p(a){for(var b=a.tagName+a.className+a.src+a.href+a.textContent,c=b.length,d=0;c--;)d+=b.charCodeAt(c);return d.toString(36)}function q(a,b){var c=0;if(!a||!a.parentNode)return-1;for(;a&&(a=a.previousElementSibling);)"TEMPLATE"===a.nodeName.toUpperCase()||">*"!==b&&!r(a,b)||c++;return c}function r(a,b){if(a){b=b.split(".");var c=b.shift().toUpperCase(),d=new RegExp("\\s("+b.join("|")+")(?=\\s)","g");return!(""!==c&&a.nodeName.toUpperCase()!=c||b.length&&((" "+a.className+" ").match(d)||[]).length!=b.length)}return!1}function s(a,b){var c,d;return function(){void 0===c&&(c=arguments,d=this,setTimeout(function(){1===c.length?a.call(d,c[0]):a.apply(d,c),c=void 0},b))}}function t(a,b){if(a&&b)for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}function u(a){return X?X(a).clone(!0)[0]:Y&&Y.dom?Y.dom(a).cloneNode(!0):a.cloneNode(!0)}function v(a){for(var b=a.getElementsByTagName("input"),c=b.length;c--;){var d=b[c];d.checked&&da.push(d)}}if("undefined"==typeof window||!window.document)return function(){throw new Error("Sortable.js requires a window with a document")};var w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q={},R=/\s+/g,S=/left|right|inline/,T="Sortable"+(new Date).getTime(),U=window,V=U.document,W=U.parseInt,X=U.jQuery||U.Zepto,Y=U.Polymer,Z=!1,$=!!("draggable"in V.createElement("div")),_=function(a){return!navigator.userAgent.match(/Trident.*rv[ :]?11\./)&&(a=V.createElement("x"),a.style.cssText="pointer-events:auto","auto"===a.style.pointerEvents)}(),aa=!1,ba=Math.abs,ca=Math.min,da=[],ea=[],fa=s(function(a,b,c){if(c&&b.scroll){var d,e,f,g,h,i,j=c[T],k=b.scrollSensitivity,l=b.scrollSpeed,m=a.clientX,n=a.clientY,o=window.innerWidth,p=window.innerHeight;if(E!==c&&(D=b.scroll,E=c,F=b.scrollFn,D===!0)){D=c;do if(D.offsetWidth-1:e==a)}}var c={},d=a.group;d&&"object"==typeof d||(d={name:d}),c.name=d.name,c.checkPull=b(d.pull,!0),c.checkPut=b(d.put),c.revertClone=d.revertClone,a.group=c};a.prototype={constructor:a,_onTapStart:function(a){var b,d=this,e=this.el,f=this.options,g=f.preventOnFilter,h=a.type,i=a.touches&&a.touches[0],j=(i||a).target,l=a.target.shadowRoot&&a.path[0]||j,m=f.filter;if(v(e),!w&&!("mousedown"===h&&0!==a.button||f.disabled)&&(j=c(j,f.draggable,e),j&&C!==j)){if(b=q(j,f.draggable),"function"==typeof m){if(m.call(this,a,j,this))return k(d,l,"filter",j,e,b),void(g&&a.preventDefault())}else if(m&&(m=m.split(",").some(function(a){if(a=c(l,a.trim(),e))return k(d,a,"filter",j,e,b),!0})))return void(g&&a.preventDefault());f.handle&&!c(l,f.handle,e)||this._prepareDragStart(a,i,j,b)}},_prepareDragStart:function(a,b,c,d){var e,g=this,i=g.el,l=g.options,n=i.ownerDocument;c&&!w&&c.parentNode===i&&(N=a,A=i,w=c,x=w.parentNode,B=w.nextSibling,C=c,L=l.group,J=d,this._lastX=(b||a).clientX,this._lastY=(b||a).clientY,w.style["will-change"]="transform",e=function(){g._disableDelayedDrag(),w.draggable=g.nativeDraggable,h(w,l.chosenClass,!0),g._triggerDragStart(a,b),k(g,A,"choose",w,A,J)},l.ignore.split(",").forEach(function(a){j(w,a.trim(),m)}),f(n,"mouseup",g._onDrop),f(n,"touchend",g._onDrop),f(n,"touchcancel",g._onDrop),f(n,"pointercancel",g._onDrop),f(n,"selectstart",g),l.delay?(f(n,"mouseup",g._disableDelayedDrag),f(n,"touchend",g._disableDelayedDrag),f(n,"touchcancel",g._disableDelayedDrag),f(n,"mousemove",g._disableDelayedDrag),f(n,"touchmove",g._disableDelayedDrag),f(n,"pointermove",g._disableDelayedDrag),g._dragStartTimer=setTimeout(e,l.delay)):e())},_disableDelayedDrag:function(){var a=this.el.ownerDocument;clearTimeout(this._dragStartTimer),g(a,"mouseup",this._disableDelayedDrag),g(a,"touchend",this._disableDelayedDrag),g(a,"touchcancel",this._disableDelayedDrag),g(a,"mousemove",this._disableDelayedDrag),g(a,"touchmove",this._disableDelayedDrag),g(a,"pointermove",this._disableDelayedDrag)},_triggerDragStart:function(a,b){b=b||("touch"==a.pointerType?a:null),b?(N={target:w,clientX:b.clientX,clientY:b.clientY},this._onDragStart(N,"touch")):this.nativeDraggable?(f(w,"dragend",this),f(A,"dragstart",this._onDragStart)):this._onDragStart(N,!0);try{V.selection?setTimeout(function(){V.selection.empty()}):window.getSelection().removeAllRanges()}catch(a){}},_dragStarted:function(){if(A&&w){var b=this.options;h(w,b.ghostClass,!0),h(w,b.dragClass,!1),a.active=this,k(this,A,"start",w,A,J)}else this._nulling()},_emulateDragOver:function(){if(O){if(this._lastX===O.clientX&&this._lastY===O.clientY)return;this._lastX=O.clientX,this._lastY=O.clientY,_||i(y,"display","none");var a=V.elementFromPoint(O.clientX,O.clientY),b=a,c=ea.length;if(b)do{if(b[T]){for(;c--;)ea[c]({clientX:O.clientX,clientY:O.clientY,target:a,rootEl:b});break}a=b}while(b=b.parentNode);_||i(y,"display","")}},_onTouchMove:function(b){if(N){var c=this.options,d=c.fallbackTolerance,e=c.fallbackOffset,f=b.touches?b.touches[0]:b,g=f.clientX-N.clientX+e.x,h=f.clientY-N.clientY+e.y,j=b.touches?"translate3d("+g+"px,"+h+"px,0)":"translate("+g+"px,"+h+"px)";if(!a.active){if(d&&ca(ba(f.clientX-this._lastX),ba(f.clientY-this._lastY))w.offsetWidth,D=e.offsetHeight>w.offsetHeight,E=(v?(d.clientX-g.left)/t:(d.clientY-g.top)/u)>.5,F=e.nextElementSibling,J=!1;if(v){var K=w.offsetTop,N=e.offsetTop;J=K===N?e.previousElementSibling===w&&!C||E&&C:e.previousElementSibling===w||w.previousElementSibling===e?(d.clientY-g.top)/u>.5:N>K}else r||(J=F!==w&&!D||E&&D);var O=l(A,j,w,f,e,g,d,J);O!==!1&&(1!==O&&O!==-1||(J=1===O),aa=!0,setTimeout(n,30),b(p,q),w.contains(j)||(J&&!F?j.appendChild(w):e.parentNode.insertBefore(w,J?F:e)),x=w.parentNode,this._animate(f,w),this._animate(g,e))}}},_animate:function(a,b){var c=this.options.animation;if(c){var d=b.getBoundingClientRect();1===a.nodeType&&(a=a.getBoundingClientRect()),i(b,"transition","none"),i(b,"transform","translate3d("+(a.left-d.left)+"px,"+(a.top-d.top)+"px,0)"),b.offsetWidth,i(b,"transition","all "+c+"ms"),i(b,"transform","translate3d(0,0,0)"),clearTimeout(b.animated),b.animated=setTimeout(function(){i(b,"transition",""),i(b,"transform",""),b.animated=!1},c)}},_offUpEvents:function(){var a=this.el.ownerDocument;g(V,"touchmove",this._onTouchMove),g(V,"pointermove",this._onTouchMove),g(a,"mouseup",this._onDrop),g(a,"touchend",this._onDrop),g(a,"pointerup",this._onDrop),g(a,"touchcancel",this._onDrop),g(a,"pointercancel",this._onDrop),g(a,"selectstart",this)},_onDrop:function(b){var c=this.el,d=this.options;clearInterval(this._loopId),clearInterval(Q.pid),clearTimeout(this._dragStartTimer),g(V,"mousemove",this._onTouchMove),this.nativeDraggable&&(g(V,"drop",this),g(c,"dragstart",this._onDragStart)),this._offUpEvents(),b&&(P&&(b.preventDefault(),!d.dropBubble&&b.stopPropagation()),y&&y.parentNode&&y.parentNode.removeChild(y),A!==x&&"clone"===a.active.lastPullMode||z&&z.parentNode&&z.parentNode.removeChild(z),w&&(this.nativeDraggable&&g(w,"dragend",this),m(w),w.style["will-change"]="",h(w,this.options.ghostClass,!1),h(w,this.options.chosenClass,!1),k(this,A,"unchoose",w,A,J),A!==x?(K=q(w,d.draggable),K>=0&&(k(null,x,"add",w,A,J,K),k(this,A,"remove",w,A,J,K),k(null,x,"sort",w,A,J,K),k(this,A,"sort",w,A,J,K))):w.nextSibling!==B&&(K=q(w,d.draggable),K>=0&&(k(this,A,"update",w,A,J,K),k(this,A,"sort",w,A,J,K))),a.active&&(null!=K&&K!==-1||(K=J),k(this,A,"end",w,A,J,K),this.save()))),this._nulling()},_nulling:function(){A=w=x=y=B=z=C=D=E=N=O=P=K=G=H=M=L=a.active=null,da.forEach(function(a){a.checked=!0}),da.length=0},handleEvent:function(a){switch(a.type){case"drop":case"dragend":this._onDrop(a);break;case"dragover":case"dragenter":w&&(this._onDragOver(a),e(a));break;case"selectstart":a.preventDefault()}},toArray:function(){for(var a,b=[],d=this.el.children,e=0,f=d.length,g=this.options;e").attr(attrs);this.setElement($el,false)}else{this.setElement(_.result(this,"el"),false)}}});Backbone.sync=function(method,model,options){var type=methodMap[method];_.defaults(options||(options={}),{emulateHTTP:Backbone.emulateHTTP,emulateJSON:Backbone.emulateJSON});var params={type:type,dataType:"json"};if(!options.url){params.url=_.result(model,"url")||urlError()}if(options.data==null&&model&&(method==="create"||method==="update"||method==="patch")){params.contentType="application/json";params.data=JSON.stringify(options.attrs||model.toJSON(options))}if(options.emulateJSON){params.contentType="application/x-www-form-urlencoded";params.data=params.data?{model:params.data}:{}}if(options.emulateHTTP&&(type==="PUT"||type==="DELETE"||type==="PATCH")){params.type="POST";if(options.emulateJSON)params.data._method=type;var beforeSend=options.beforeSend;options.beforeSend=function(xhr){xhr.setRequestHeader("X-HTTP-Method-Override",type);if(beforeSend)return beforeSend.apply(this,arguments)}}if(params.type!=="GET"&&!options.emulateJSON){params.processData=false}if(params.type==="PATCH"&&window.ActiveXObject&&!(window.external&&window.external.msActiveXFilteringEnabled)){params.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}var xhr=options.xhr=Backbone.ajax(_.extend(params,options));model.trigger("request",model,xhr,options);return xhr};var methodMap={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};Backbone.ajax=function(){return Backbone.$.ajax.apply(Backbone.$,arguments)};var Router=Backbone.Router=function(options){options||(options={});if(options.routes)this.routes=options.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var optionalParam=/\((.*?)\)/g;var namedParam=/(\(\?)?:\w+/g;var splatParam=/\*\w+/g;var escapeRegExp=/[\-{}\[\]+?.,\\\^$|#\s]/g;_.extend(Router.prototype,Events,{initialize:function(){},route:function(route,name,callback){if(!_.isRegExp(route))route=this._routeToRegExp(route);if(_.isFunction(name)){callback=name;name=""}if(!callback)callback=this[name];var router=this;Backbone.history.route(route,function(fragment){var args=router._extractParameters(route,fragment);callback&&callback.apply(router,args);router.trigger.apply(router,["route:"+name].concat(args));router.trigger("route",name,args);Backbone.history.trigger("route",router,name,args)});return this},navigate:function(fragment,options){Backbone.history.navigate(fragment,options);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=_.result(this,"routes");var route,routes=_.keys(this.routes);while((route=routes.pop())!=null){this.route(route,this.routes[route])}},_routeToRegExp:function(route){route=route.replace(escapeRegExp,"\\$&").replace(optionalParam,"(?:$1)?").replace(namedParam,function(match,optional){return optional?match:"([^/]+)"}).replace(splatParam,"(.*?)");return new RegExp("^"+route+"$")},_extractParameters:function(route,fragment){var params=route.exec(fragment).slice(1);return _.map(params,function(param){return param?decodeURIComponent(param):null})}});var History=Backbone.History=function(){this.handlers=[];_.bindAll(this,"checkUrl");if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var routeStripper=/^[#\/]|\s+$/g;var rootStripper=/^\/+|\/+$/g;var isExplorer=/msie [\w.]+/;var trailingSlash=/\/$/;History.started=false;_.extend(History.prototype,Events,{interval:50,getHash:function(window){var match=(window||this).location.href.match(/#(.*)$/);return match?match[1]:""},getFragment:function(fragment,forcePushState){if(fragment==null){if(this._hasPushState||!this._wantsHashChange||forcePushState){fragment=this.location.pathname;var root=this.root.replace(trailingSlash,"");if(!fragment.indexOf(root))fragment=fragment.substr(root.length)}else{fragment=this.getHash()}}return fragment.replace(routeStripper,"")},start:function(options){if(History.started)throw new Error("Backbone.history has already been started");History.started=true;this.options=_.extend({},{root:"/"},this.options,options);this.root=this.options.root;this._wantsHashChange=this.options.hashChange!==false;this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var fragment=this.getFragment();var docMode=document.documentMode;var oldIE=isExplorer.exec(navigator.userAgent.toLowerCase())&&(!docMode||docMode<=7);this.root=("/"+this.root+"/").replace(rootStripper,"/");if(oldIE&&this._wantsHashChange){this.iframe=Backbone.$('