From b18aef404a4eb681dc26a9e3fe2b1b9e4b6bf961 Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Mon, 23 Mar 2015 16:42:32 +0000 Subject: [PATCH] Use bower for managing client side dependencies Fixes #117 --- .gitignore | 1 + src/.bowerrc | 4 + src/bower.json | 17 + src/gulpfile.js | 70 +++- src/mibew/css/vex-theme-default.css | 388 ------------------ src/mibew/css/vex.css | 248 ----------- src/mibew/js/libs/backbone-min.js | 2 - src/mibew/js/libs/backbone.marionette.min.js | 23 -- src/mibew/js/libs/handlebars.min.js | 28 -- src/mibew/js/libs/jquery.min.js | 4 - src/mibew/js/libs/json2.js | 13 - src/mibew/js/libs/underscore-min.js | 6 - src/mibew/js/libs/validator.min.js | 23 -- src/mibew/js/libs/vex.combined.min.js | 2 - .../Mibew/Controller/AbstractController.php | 20 +- src/package.json | 2 + 16 files changed, 101 insertions(+), 750 deletions(-) create mode 100644 src/.bowerrc create mode 100644 src/bower.json delete mode 100644 src/mibew/css/vex-theme-default.css delete mode 100644 src/mibew/css/vex.css delete mode 100644 src/mibew/js/libs/backbone-min.js delete mode 100644 src/mibew/js/libs/backbone.marionette.min.js delete mode 100644 src/mibew/js/libs/handlebars.min.js delete mode 100644 src/mibew/js/libs/jquery.min.js delete mode 100644 src/mibew/js/libs/json2.js delete mode 100644 src/mibew/js/libs/underscore-min.js delete mode 100644 src/mibew/js/libs/validator.min.js delete mode 100644 src/mibew/js/libs/vex.combined.min.js diff --git a/.gitignore b/.gitignore index db0543c0..c5ef579e 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,7 @@ src/composer.lock # Do not index third-party libraries src/mibew/vendor +src/mibew/js/vendor # Do not index node.js modules that are used for building src/node_modules diff --git a/src/.bowerrc b/src/.bowerrc new file mode 100644 index 00000000..260b3086 --- /dev/null +++ b/src/.bowerrc @@ -0,0 +1,4 @@ +{ + "directory": "./mibew/js/vendor", + "analytics": false +} \ No newline at end of file diff --git a/src/bower.json b/src/bower.json new file mode 100644 index 00000000..6ff9cd69 --- /dev/null +++ b/src/bower.json @@ -0,0 +1,17 @@ +{ + "name": "mibew", + "private": true, + "dependencies": { + "underscore": "1.8.2", + "json": "2012.10.08", + "jquery": "1.11.2", + "backbone": "1.1.2", + "marionette": "2.4.1", + "handlebars": "3.0.0", + "vex": "2.3.2", + "validator-js": "3.34.0" + }, + "resolutions": { + "underscore": "1.8.2" + } +} \ No newline at end of file diff --git a/src/gulpfile.js b/src/gulpfile.js index 2c85c5fb..c244e76f 100644 --- a/src/gulpfile.js +++ b/src/gulpfile.js @@ -7,6 +7,7 @@ var fs = require('fs'), lodash = require('lodash'), PoFile = require('pofile'), strftime = require('strftime'), + bower = require('bower'), gulp = require('gulp'), uglify = require('gulp-uglify'), concat = require('gulp-concat'), @@ -21,13 +22,15 @@ var fs = require('fs'), gzip = require('gulp-gzip'), chmod = require('gulp-chmod'), xgettext = require('gulp-xgettext'), - concatPo = require('gulp-concat-po'); + concatPo = require('gulp-concat-po'), + rename = require('gulp-rename'); // Set global configs. var config = { mibewPath: 'mibew', configsPath: 'mibew/configs', phpVendorPath: 'mibew/vendor', + jsVendorPath: 'mibew/js/vendor', pluginsPath: 'mibew/plugins', avatarsPath: 'mibew/files/avatar', cachePath: 'mibew/cache', @@ -98,6 +101,45 @@ gulp.task('composer-install-dev', ['get-composer'], function(callback) { }); }); +// Installs bower dependencies +gulp.task('bower-install', function(callback) { + bower.commands.install([], {}, {}) + .on('error', function(error) { + callback(error); + }) + .on('end', function() { + // We should manually minify JavaScript files that was not minified + // by bower packages' authors. + // TODO: This is a temproary workaround and should be removed once + // the packages will be fixed. + var stream = eventStream.merge( + gulp.src(config.jsVendorPath + '/backbone/backbone.js', {base: config.jsVendorPath}) + .pipe(uglify({preserveComments: 'some'})) + // There are neither "@license" tag nor "!preserve" in the + // header. Add the header manually. + .pipe(header( + "// Backbone.js 1.1.2\n" + + "// (c) 2010-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n" + + "// Backbone may be freely distributed under the MIT license.\n" + + "// For all details and documentation:\n" + + "// http://backbonejs.org\n" + )) + .pipe(rename('backbone/backbone-min.js')), + gulp.src(config.jsVendorPath + '/json/json2.js', {base: config.jsVendorPath}) + .pipe(uglify({preserveComments: 'some'})) + // There are neither "@license" tag nor "!preserve" in the + // header. Add the header manually. + .pipe(header("// json2.js. Public Domain. See http://www.JSON.org/js.html\n")) + .pipe(rename('json/json2.min.js')) + ); + + stream.pipe(gulp.dest(config.jsVendorPath)); + stream + .on('error', callback) + .on('end', callback); + }); +}); + // Compile all JavaScript files of the Mibew Core gulp.task('js', function() { return eventStream.merge( @@ -214,7 +256,7 @@ gulp.task('generate-pot', function() { }); // Pack sources to .zip and .tar.gz archives. -gulp.task('pack-sources', ['composer-install'], function() { +gulp.task('pack-sources', ['composer-install', 'bower-install'], function() { var sources = [ config.mibewPath + '/**/*', // Exclude user's config @@ -232,7 +274,29 @@ gulp.task('pack-sources', ['composer-install'], function() { // Exclude vendors binaries '!' + config.phpVendorPath + '/bin/**/*', // Exclude JavaScript sources - '!' + config.jsPath + '/source/**/*' + '!' + config.jsPath + '/source/**/*', + // Actually we does not need backbone.babysitter and backbone.wreqr + // dependencies because they embed into marionette.js. So we exclude + // "backbone.babysitter" and "backbone.wreqr" directories and all their + // contents. + '!' + config.jsVendorPath + '/backbone.babysitter{,/**}', + '!' + config.jsVendorPath + '/backbone.wreqr{,/**}', + // Exclude dot files within third-party JS libraries. + '!' + config.jsVendorPath + '/**/.*', + // Exclude config files of various package systems + '!' + config.jsVendorPath + '/**/{bower,component,package,composer}.json', + // Exclude config files of various build systems + '!' + config.jsVendorPath + '/**/Gruntfile.*', + '!' + config.jsVendorPath + '/**/gulpfile.*', + '!' + config.jsVendorPath + '/**/Makefile', + // Exclude HTML files from third-party JS libraries. Such files can be + // used for docs or for tests, we need none of them. + '!' + config.jsVendorPath + '/**/*.html', + // There are too many useless files in Vex.js library. Exclude them. + '!' + config.jsVendorPath + '/vex/sass{,/**}', + '!' + config.jsVendorPath + '/vex/docs{,/**}', + '!' + config.jsVendorPath + '/vex/docs{,/**}', + '!' + config.jsVendorPath + '/vex/coffee{,/**}' ]; var srcOptions = { // Dot files (.htaccess, .keep, etc.) must be included in the package. diff --git a/src/mibew/css/vex-theme-default.css b/src/mibew/css/vex-theme-default.css deleted file mode 100644 index 989d2613..00000000 --- a/src/mibew/css/vex-theme-default.css +++ /dev/null @@ -1,388 +0,0 @@ -@keyframes vex-flyin { - 0% { - opacity: 0; - transform: translateY(-40px); - -webkit-transform: translateY(-40px); - -moz-transform: translateY(-40px); - -ms-transform: translateY(-40px); - -o-transform: translateY(-40px); } - - 100% { - opacity: 1; - transform: translateY(0); - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -ms-transform: translateY(0); - -o-transform: translateY(0); } } - -@-webkit-keyframes vex-flyin { - 0% { - opacity: 0; - transform: translateY(-40px); - -webkit-transform: translateY(-40px); - -moz-transform: translateY(-40px); - -ms-transform: translateY(-40px); - -o-transform: translateY(-40px); } - - 100% { - opacity: 1; - transform: translateY(0); - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -ms-transform: translateY(0); - -o-transform: translateY(0); } } - -@-moz-keyframes vex-flyin { - 0% { - opacity: 0; - transform: translateY(-40px); - -webkit-transform: translateY(-40px); - -moz-transform: translateY(-40px); - -ms-transform: translateY(-40px); - -o-transform: translateY(-40px); } - - 100% { - opacity: 1; - transform: translateY(0); - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -ms-transform: translateY(0); - -o-transform: translateY(0); } } - -@-ms-keyframes vex-flyin { - 0% { - opacity: 0; - transform: translateY(-40px); - -webkit-transform: translateY(-40px); - -moz-transform: translateY(-40px); - -ms-transform: translateY(-40px); - -o-transform: translateY(-40px); } - - 100% { - opacity: 1; - transform: translateY(0); - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -ms-transform: translateY(0); - -o-transform: translateY(0); } } - -@-o-keyframes vex-flyin { - 0% { - opacity: 0; - transform: translateY(-40px); - -webkit-transform: translateY(-40px); - -moz-transform: translateY(-40px); - -ms-transform: translateY(-40px); - -o-transform: translateY(-40px); } - - 100% { - opacity: 1; - transform: translateY(0); - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -ms-transform: translateY(0); - -o-transform: translateY(0); } } - -@keyframes vex-flyout { - 0% { - opacity: 1; - transform: translateY(0); - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -ms-transform: translateY(0); - -o-transform: translateY(0); } - - 100% { - opacity: 0; - transform: translateY(-40px); - -webkit-transform: translateY(-40px); - -moz-transform: translateY(-40px); - -ms-transform: translateY(-40px); - -o-transform: translateY(-40px); } } - -@-webkit-keyframes vex-flyout { - 0% { - opacity: 1; - transform: translateY(0); - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -ms-transform: translateY(0); - -o-transform: translateY(0); } - - 100% { - opacity: 0; - transform: translateY(-40px); - -webkit-transform: translateY(-40px); - -moz-transform: translateY(-40px); - -ms-transform: translateY(-40px); - -o-transform: translateY(-40px); } } - -@-moz-keyframes vex-flyout { - 0% { - opacity: 1; - transform: translateY(0); - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -ms-transform: translateY(0); - -o-transform: translateY(0); } - - 100% { - opacity: 0; - transform: translateY(-40px); - -webkit-transform: translateY(-40px); - -moz-transform: translateY(-40px); - -ms-transform: translateY(-40px); - -o-transform: translateY(-40px); } } - -@-ms-keyframes vex-flyout { - 0% { - opacity: 1; - transform: translateY(0); - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -ms-transform: translateY(0); - -o-transform: translateY(0); } - - 100% { - opacity: 0; - transform: translateY(-40px); - -webkit-transform: translateY(-40px); - -moz-transform: translateY(-40px); - -ms-transform: translateY(-40px); - -o-transform: translateY(-40px); } } - -@-o-keyframes vex-flyout { - 0% { - opacity: 1; - transform: translateY(0); - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -ms-transform: translateY(0); - -o-transform: translateY(0); } - - 100% { - opacity: 0; - transform: translateY(-40px); - -webkit-transform: translateY(-40px); - -moz-transform: translateY(-40px); - -ms-transform: translateY(-40px); - -o-transform: translateY(-40px); } } - -@keyframes vex-pulse { - 0% { - -moz-box-shadow: inset 0 0 0 300px transparent; - -webkit-box-shadow: inset 0 0 0 300px transparent; - box-shadow: inset 0 0 0 300px transparent; } - - 70% { - -moz-box-shadow: inset 0 0 0 300px rgba(255, 255, 255, 0.25); - -webkit-box-shadow: inset 0 0 0 300px rgba(255, 255, 255, 0.25); - box-shadow: inset 0 0 0 300px rgba(255, 255, 255, 0.25); } - - 100% { - -moz-box-shadow: inset 0 0 0 300px transparent; - -webkit-box-shadow: inset 0 0 0 300px transparent; - box-shadow: inset 0 0 0 300px transparent; } } - -@-webkit-keyframes vex-pulse { - 0% { - -moz-box-shadow: inset 0 0 0 300px transparent; - -webkit-box-shadow: inset 0 0 0 300px transparent; - box-shadow: inset 0 0 0 300px transparent; } - - 70% { - -moz-box-shadow: inset 0 0 0 300px rgba(255, 255, 255, 0.25); - -webkit-box-shadow: inset 0 0 0 300px rgba(255, 255, 255, 0.25); - box-shadow: inset 0 0 0 300px rgba(255, 255, 255, 0.25); } - - 100% { - -moz-box-shadow: inset 0 0 0 300px transparent; - -webkit-box-shadow: inset 0 0 0 300px transparent; - box-shadow: inset 0 0 0 300px transparent; } } - -@-moz-keyframes vex-pulse { - 0% { - -moz-box-shadow: inset 0 0 0 300px transparent; - -webkit-box-shadow: inset 0 0 0 300px transparent; - box-shadow: inset 0 0 0 300px transparent; } - - 70% { - -moz-box-shadow: inset 0 0 0 300px rgba(255, 255, 255, 0.25); - -webkit-box-shadow: inset 0 0 0 300px rgba(255, 255, 255, 0.25); - box-shadow: inset 0 0 0 300px rgba(255, 255, 255, 0.25); } - - 100% { - -moz-box-shadow: inset 0 0 0 300px transparent; - -webkit-box-shadow: inset 0 0 0 300px transparent; - box-shadow: inset 0 0 0 300px transparent; } } - -@-ms-keyframes vex-pulse { - 0% { - -moz-box-shadow: inset 0 0 0 300px transparent; - -webkit-box-shadow: inset 0 0 0 300px transparent; - box-shadow: inset 0 0 0 300px transparent; } - - 70% { - -moz-box-shadow: inset 0 0 0 300px rgba(255, 255, 255, 0.25); - -webkit-box-shadow: inset 0 0 0 300px rgba(255, 255, 255, 0.25); - box-shadow: inset 0 0 0 300px rgba(255, 255, 255, 0.25); } - - 100% { - -moz-box-shadow: inset 0 0 0 300px transparent; - -webkit-box-shadow: inset 0 0 0 300px transparent; - box-shadow: inset 0 0 0 300px transparent; } } - -@-o-keyframes vex-pulse { - 0% { - -moz-box-shadow: inset 0 0 0 300px transparent; - -webkit-box-shadow: inset 0 0 0 300px transparent; - box-shadow: inset 0 0 0 300px transparent; } - - 70% { - -moz-box-shadow: inset 0 0 0 300px rgba(255, 255, 255, 0.25); - -webkit-box-shadow: inset 0 0 0 300px rgba(255, 255, 255, 0.25); - box-shadow: inset 0 0 0 300px rgba(255, 255, 255, 0.25); } - - 100% { - -moz-box-shadow: inset 0 0 0 300px transparent; - -webkit-box-shadow: inset 0 0 0 300px transparent; - box-shadow: inset 0 0 0 300px transparent; } } - -.vex.vex-theme-default { - padding-top: 160px; - padding-bottom: 160px; } - .vex.vex-theme-default.vex-closing .vex-content { - animation: vex-flyout 0.5s; - -webkit-animation: vex-flyout 0.5s; - -moz-animation: vex-flyout 0.5s; - -ms-animation: vex-flyout 0.5s; - -o-animation: vex-flyout 0.5s; - -webkit-backface-visibility: hidden; } - .vex.vex-theme-default .vex-content { - animation: vex-flyin 0.5s; - -webkit-animation: vex-flyin 0.5s; - -moz-animation: vex-flyin 0.5s; - -ms-animation: vex-flyin 0.5s; - -o-animation: vex-flyin 0.5s; - -webkit-backface-visibility: hidden; } - .vex.vex-theme-default .vex-content { - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - font-family: "Helvetica Neue", sans-serif; - background: #f0f0f0; - color: #444; - padding: 1em; - position: relative; - margin: 0 auto; - max-width: 100%; - width: 450px; - font-size: 1.1em; - line-height: 1.5em; } - .vex.vex-theme-default .vex-content h1, .vex.vex-theme-default .vex-content h2, .vex.vex-theme-default .vex-content h3, .vex.vex-theme-default .vex-content h4, .vex.vex-theme-default .vex-content h5, .vex.vex-theme-default .vex-content h6, .vex.vex-theme-default .vex-content p, .vex.vex-theme-default .vex-content ul, .vex.vex-theme-default .vex-content li { - color: inherit; } - .vex.vex-theme-default .vex-close { - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - position: absolute; - top: 0; - right: 0; - cursor: pointer; } - .vex.vex-theme-default .vex-close:before { - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; - position: absolute; - content: "\00D7"; - font-size: 26px; - font-weight: normal; - line-height: 31px; - height: 30px; - width: 30px; - text-align: center; - top: 3px; - right: 3px; - color: #bbb; - background: transparent; } - .vex.vex-theme-default .vex-close:hover:before, .vex.vex-theme-default .vex-close:active:before { - color: #777; - background: #e0e0e0; } - .vex.vex-theme-default .vex-dialog-form .vex-dialog-message { - margin-bottom: 0.5em; } - .vex.vex-theme-default .vex-dialog-form .vex-dialog-input { - margin-bottom: 1em; } - .vex.vex-theme-default .vex-dialog-form .vex-dialog-input textarea, .vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="date"], .vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="datetime"], .vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="datetime-local"], .vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="email"], .vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="month"], .vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="number"], .vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="password"], .vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="search"], .vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="tel"], .vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="text"], .vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="time"], .vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="url"], .vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="week"] { - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; - background: #fff; - width: 100%; - padding: 0.25em 0.67em; - border: 0; - font-family: inherit; - font-weight: inherit; - font-size: inherit; - min-height: 2.5em; - margin: 0 0 0.25em; } - .vex.vex-theme-default .vex-dialog-form .vex-dialog-input textarea:focus, .vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="date"]:focus, .vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="datetime"]:focus, .vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="datetime-local"]:focus, .vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="email"]:focus, .vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="month"]:focus, .vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="number"]:focus, .vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="password"]:focus, .vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="search"]:focus, .vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="tel"]:focus, .vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="text"]:focus, .vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="time"]:focus, .vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="url"]:focus, .vex.vex-theme-default .vex-dialog-form .vex-dialog-input input[type="week"]:focus { - -moz-box-shadow: inset 0 0 0 2px #8dbdf1; - -webkit-box-shadow: inset 0 0 0 2px #8dbdf1; - box-shadow: inset 0 0 0 2px #8dbdf1; - outline: none; } - .vex.vex-theme-default .vex-dialog-form .vex-dialog-buttons { - *zoom: 1; } - .vex.vex-theme-default .vex-dialog-form .vex-dialog-buttons:after { - content: ""; - display: table; - clear: both; } - .vex.vex-theme-default .vex-dialog-button { - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; - border: 0; - float: right; - margin: 0 0 0 0.5em; - font-family: inherit; - text-transform: uppercase; - letter-spacing: 0.1em; - font-size: 0.8em; - line-height: 1em; - padding: 0.75em 2em; } - .vex.vex-theme-default .vex-dialog-button.vex-last { - margin-left: 0; } - .vex.vex-theme-default .vex-dialog-button:focus { - animation: vex-pulse 1.1s infinite; - -webkit-animation: vex-pulse 1.1s infinite; - -moz-animation: vex-pulse 1.1s infinite; - -ms-animation: vex-pulse 1.1s infinite; - -o-animation: vex-pulse 1.1s infinite; - -webkit-backface-visibility: hidden; - outline: none; } - @media (max-width: 568px) { - .vex.vex-theme-default .vex-dialog-button:focus { - animation: none; - -webkit-animation: none; - -moz-animation: none; - -ms-animation: none; - -o-animation: none; - -webkit-backface-visibility: hidden; } } - .vex.vex-theme-default .vex-dialog-button.vex-dialog-button-primary { - background: #3288e6; - color: #fff; } - .vex.vex-theme-default .vex-dialog-button.vex-dialog-button-secondary { - background: #e0e0e0; - color: #777; } - -.vex-loading-spinner.vex-theme-default { - -moz-box-shadow: 0 0 0 0.5em #f0f0f0, 0 0 1px 0.5em rgba(0, 0, 0, 0.3); - -webkit-box-shadow: 0 0 0 0.5em #f0f0f0, 0 0 1px 0.5em rgba(0, 0, 0, 0.3); - box-shadow: 0 0 0 0.5em #f0f0f0, 0 0 1px 0.5em rgba(0, 0, 0, 0.3); - -moz-border-radius: 100%; - -webkit-border-radius: 100%; - border-radius: 100%; - background: #f0f0f0; - border: 0.2em solid transparent; - border-top-color: #bbb; - top: -1.1em; - bottom: auto; } diff --git a/src/mibew/css/vex.css b/src/mibew/css/vex.css deleted file mode 100644 index f3912219..00000000 --- a/src/mibew/css/vex.css +++ /dev/null @@ -1,248 +0,0 @@ -@keyframes vex-fadein { - 0% { - opacity: 0; } - - 100% { - opacity: 1; } } - -@-webkit-keyframes vex-fadein { - 0% { - opacity: 0; } - - 100% { - opacity: 1; } } - -@-moz-keyframes vex-fadein { - 0% { - opacity: 0; } - - 100% { - opacity: 1; } } - -@-ms-keyframes vex-fadein { - 0% { - opacity: 0; } - - 100% { - opacity: 1; } } - -@-o-keyframes vex-fadein { - 0% { - opacity: 0; } - - 100% { - opacity: 1; } } - -@keyframes vex-fadeout { - 0% { - opacity: 1; } - - 100% { - opacity: 0; } } - -@-webkit-keyframes vex-fadeout { - 0% { - opacity: 1; } - - 100% { - opacity: 0; } } - -@-moz-keyframes vex-fadeout { - 0% { - opacity: 1; } - - 100% { - opacity: 0; } } - -@-ms-keyframes vex-fadeout { - 0% { - opacity: 1; } - - 100% { - opacity: 0; } } - -@-o-keyframes vex-fadeout { - 0% { - opacity: 1; } - - 100% { - opacity: 0; } } - -@keyframes vex-rotation { - 0% { - transform: rotate(0deg); - -webkit-transform: rotate(0deg); - -moz-transform: rotate(0deg); - -ms-transform: rotate(0deg); - -o-transform: rotate(0deg); } - - 100% { - transform: rotate(359deg); - -webkit-transform: rotate(359deg); - -moz-transform: rotate(359deg); - -ms-transform: rotate(359deg); - -o-transform: rotate(359deg); } } - -@-webkit-keyframes vex-rotation { - 0% { - transform: rotate(0deg); - -webkit-transform: rotate(0deg); - -moz-transform: rotate(0deg); - -ms-transform: rotate(0deg); - -o-transform: rotate(0deg); } - - 100% { - transform: rotate(359deg); - -webkit-transform: rotate(359deg); - -moz-transform: rotate(359deg); - -ms-transform: rotate(359deg); - -o-transform: rotate(359deg); } } - -@-moz-keyframes vex-rotation { - 0% { - transform: rotate(0deg); - -webkit-transform: rotate(0deg); - -moz-transform: rotate(0deg); - -ms-transform: rotate(0deg); - -o-transform: rotate(0deg); } - - 100% { - transform: rotate(359deg); - -webkit-transform: rotate(359deg); - -moz-transform: rotate(359deg); - -ms-transform: rotate(359deg); - -o-transform: rotate(359deg); } } - -@-ms-keyframes vex-rotation { - 0% { - transform: rotate(0deg); - -webkit-transform: rotate(0deg); - -moz-transform: rotate(0deg); - -ms-transform: rotate(0deg); - -o-transform: rotate(0deg); } - - 100% { - transform: rotate(359deg); - -webkit-transform: rotate(359deg); - -moz-transform: rotate(359deg); - -ms-transform: rotate(359deg); - -o-transform: rotate(359deg); } } - -@-o-keyframes vex-rotation { - 0% { - transform: rotate(0deg); - -webkit-transform: rotate(0deg); - -moz-transform: rotate(0deg); - -ms-transform: rotate(0deg); - -o-transform: rotate(0deg); } - - 100% { - transform: rotate(359deg); - -webkit-transform: rotate(359deg); - -moz-transform: rotate(359deg); - -ms-transform: rotate(359deg); - -o-transform: rotate(359deg); } } - -.vex, .vex *, .vex *:before, .vex *:after { - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; } - -.vex { - position: fixed; - overflow: auto; - -webkit-overflow-scrolling: touch; - z-index: 1111; - top: 0; - right: 0; - bottom: 0; - left: 0; } - -.vex-scrollbar-measure { - position: absolute; - top: -9999px; - width: 50px; - height: 50px; - overflow: scroll; } - -.vex-overlay { - background: #000; - filter: alpha(opacity=40); - /* IE 5–7 */ - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"; - /* IE 8 */ } - -.vex-overlay { - animation: vex-fadein 0.5s; - -webkit-animation: vex-fadein 0.5s; - -moz-animation: vex-fadein 0.5s; - -ms-animation: vex-fadein 0.5s; - -o-animation: vex-fadein 0.5s; - -webkit-backface-visibility: hidden; - position: fixed; - background: rgba(0, 0, 0, 0.4); - top: 0; - right: 0; - bottom: 0; - left: 0; } - .vex.vex-closing .vex-overlay { - animation: vex-fadeout 0.5s; - -webkit-animation: vex-fadeout 0.5s; - -moz-animation: vex-fadeout 0.5s; - -ms-animation: vex-fadeout 0.5s; - -o-animation: vex-fadeout 0.5s; - -webkit-backface-visibility: hidden; } - -.vex-content { - animation: vex-fadein 0.5s; - -webkit-animation: vex-fadein 0.5s; - -moz-animation: vex-fadein 0.5s; - -ms-animation: vex-fadein 0.5s; - -o-animation: vex-fadein 0.5s; - -webkit-backface-visibility: hidden; - background: #fff; } - .vex.vex-closing .vex-content { - animation: vex-fadeout 0.5s; - -webkit-animation: vex-fadeout 0.5s; - -moz-animation: vex-fadeout 0.5s; - -ms-animation: vex-fadeout 0.5s; - -o-animation: vex-fadeout 0.5s; - -webkit-backface-visibility: hidden; } - -.vex-close:before { - font-family: Arial, sans-serif; - content: "\00D7"; } - -.vex-dialog-form { - margin: 0; } - -.vex-dialog-button { - text-rendering: optimizeLegibility; - -moz-appearance: none; - -webkit-appearance: none; - cursor: pointer; - -webkit-tap-highlight-color: transparent; } - -.vex-loading-spinner { - animation: vex-rotation 0.7s linear infinite; - -webkit-animation: vex-rotation 0.7s linear infinite; - -moz-animation: vex-rotation 0.7s linear infinite; - -ms-animation: vex-rotation 0.7s linear infinite; - -o-animation: vex-rotation 0.7s linear infinite; - -webkit-backface-visibility: hidden; - -moz-box-shadow: 0 0 1em rgba(0, 0, 0, 0.1); - -webkit-box-shadow: 0 0 1em rgba(0, 0, 0, 0.1); - box-shadow: 0 0 1em rgba(0, 0, 0, 0.1); - position: fixed; - z-index: 1112; - margin: auto; - top: 0; - right: 0; - bottom: 0; - left: 0; - height: 2em; - width: 2em; - background: #fff; } - -body.vex-open { - overflow: hidden; } diff --git a/src/mibew/js/libs/backbone-min.js b/src/mibew/js/libs/backbone-min.js deleted file mode 100644 index 8ea4b13d..00000000 --- a/src/mibew/js/libs/backbone-min.js +++ /dev/null @@ -1,2 +0,0 @@ -(function(t,e){if(typeof define==="function"&&define.amd){define(["underscore","jquery","exports"],function(i,r,s){t.Backbone=e(t,s,i,r)})}else if(typeof exports!=="undefined"){var i=require("underscore");e(t,exports,i)}else{t.Backbone=e(t,{},t._,t.jQuery||t.Zepto||t.ender||t.$)}})(this,function(t,e,i,r){var s=t.Backbone;var n=[];var a=n.push;var o=n.slice;var h=n.splice;e.VERSION="1.1.2";e.$=r;e.noConflict=function(){t.Backbone=s;return this};e.emulateHTTP=false;e.emulateJSON=false;var u=e.Events={on:function(t,e,i){if(!c(this,"on",t,[e,i])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);r.push({callback:e,context:i,ctx:i||this});return this},once:function(t,e,r){if(!c(this,"once",t,[e,r])||!e)return this;var s=this;var n=i.once(function(){s.off(t,n);e.apply(this,arguments)});n._callback=e;return this.on(t,n,r)},off:function(t,e,r){var s,n,a,o,h,u,l,f;if(!this._events||!c(this,"off",t,[e,r]))return this;if(!t&&!e&&!r){this._events=void 0;return this}o=t?[t]:i.keys(this._events);for(h=0,u=o.length;h").attr(t);this.setElement(r,false)}else{this.setElement(i.result(this,"el"),false)}}});e.sync=function(t,r,s){var n=T[t];i.defaults(s||(s={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:n,dataType:"json"};if(!s.url){a.url=i.result(r,"url")||M()}if(s.data==null&&r&&(t==="create"||t==="update"||t==="patch")){a.contentType="application/json";a.data=JSON.stringify(s.attrs||r.toJSON(s))}if(s.emulateJSON){a.contentType="application/x-www-form-urlencoded";a.data=a.data?{model:a.data}:{}}if(s.emulateHTTP&&(n==="PUT"||n==="DELETE"||n==="PATCH")){a.type="POST";if(s.emulateJSON)a.data._method=n;var o=s.beforeSend;s.beforeSend=function(t){t.setRequestHeader("X-HTTP-Method-Override",n);if(o)return o.apply(this,arguments)}}if(a.type!=="GET"&&!s.emulateJSON){a.processData=false}if(a.type==="PATCH"&&k){a.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}var h=s.xhr=e.ajax(i.extend(a,s));r.trigger("request",r,h,s);return h};var k=typeof window!=="undefined"&&!!window.ActiveXObject&&!(window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent);var T={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var $=e.Router=function(t){t||(t={});if(t.routes)this.routes=t.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var S=/\((.*?)\)/g;var H=/(\(\?)?:\w+/g;var A=/\*\w+/g;var I=/[\-{}\[\]+?.,\\\^$|#\s]/g;i.extend($.prototype,u,{initialize:function(){},route:function(t,r,s){if(!i.isRegExp(t))t=this._routeToRegExp(t);if(i.isFunction(r)){s=r;r=""}if(!s)s=this[r];var n=this;e.history.route(t,function(i){var a=n._extractParameters(t,i);n.execute(s,a);n.trigger.apply(n,["route:"+r].concat(a));n.trigger("route",r,a);e.history.trigger("route",n,r,a)});return this},execute:function(t,e){if(t)t.apply(this,e)},navigate:function(t,i){e.history.navigate(t,i);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=i.result(this,"routes");var t,e=i.keys(this.routes);while((t=e.pop())!=null){this.route(t,this.routes[t])}},_routeToRegExp:function(t){t=t.replace(I,"\\$&").replace(S,"(?:$1)?").replace(H,function(t,e){return e?t:"([^/?]+)"}).replace(A,"([^?]*?)");return new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var r=t.exec(e).slice(1);return i.map(r,function(t,e){if(e===r.length-1)return t||null;return t?decodeURIComponent(t):null})}});var N=e.History=function(){this.handlers=[];i.bindAll(this,"checkUrl");if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var R=/^[#\/]|\s+$/g;var O=/^\/+|\/+$/g;var P=/msie [\w.]+/;var C=/\/$/;var j=/#.*$/;N.started=false;i.extend(N.prototype,u,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(t==null){if(this._hasPushState||!this._wantsHashChange||e){t=decodeURI(this.location.pathname+this.location.search);var i=this.root.replace(C,"");if(!t.indexOf(i))t=t.slice(i.length)}else{t=this.getHash()}}return t.replace(R,"")},start:function(t){if(N.started)throw new Error("Backbone.history has already been started");N.started=true;this.options=i.extend({root:"/"},this.options,t);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 r=this.getFragment();var s=document.documentMode;var n=P.exec(navigator.userAgent.toLowerCase())&&(!s||s<=7);this.root=("/"+this.root+"/").replace(O,"/");if(n&&this._wantsHashChange){var a=e.$('