]> BookStack Code Mirror - bookstack/commitdiff
Migrated to custom gulp setup and conintue search interface
authorDan Brown <redacted>
Fri, 14 Apr 2017 17:47:33 +0000 (18:47 +0100)
committerDan Brown <redacted>
Fri, 14 Apr 2017 17:47:33 +0000 (18:47 +0100)
38 files changed:
.gitignore
gulpfile.js [new file with mode: 0644]
package.json
public/fonts/roboto-mono-v4-latin-regular.woff [moved from resources/assets/fonts/roboto-mono-v4-latin-regular.woff with 100% similarity]
public/fonts/roboto-mono-v4-latin-regular.woff2 [moved from resources/assets/fonts/roboto-mono-v4-latin-regular.woff2 with 100% similarity]
public/fonts/roboto-v15-cyrillic_latin-100.woff [moved from resources/assets/fonts/roboto-v15-cyrillic_latin-100.woff with 100% similarity]
public/fonts/roboto-v15-cyrillic_latin-100.woff2 [moved from resources/assets/fonts/roboto-v15-cyrillic_latin-100.woff2 with 100% similarity]
public/fonts/roboto-v15-cyrillic_latin-100italic.woff [moved from resources/assets/fonts/roboto-v15-cyrillic_latin-100italic.woff with 100% similarity]
public/fonts/roboto-v15-cyrillic_latin-100italic.woff2 [moved from resources/assets/fonts/roboto-v15-cyrillic_latin-100italic.woff2 with 100% similarity]
public/fonts/roboto-v15-cyrillic_latin-300.woff [moved from resources/assets/fonts/roboto-v15-cyrillic_latin-300.woff with 100% similarity]
public/fonts/roboto-v15-cyrillic_latin-300.woff2 [moved from resources/assets/fonts/roboto-v15-cyrillic_latin-300.woff2 with 100% similarity]
public/fonts/roboto-v15-cyrillic_latin-300italic.woff [moved from resources/assets/fonts/roboto-v15-cyrillic_latin-300italic.woff with 100% similarity]
public/fonts/roboto-v15-cyrillic_latin-300italic.woff2 [moved from resources/assets/fonts/roboto-v15-cyrillic_latin-300italic.woff2 with 100% similarity]
public/fonts/roboto-v15-cyrillic_latin-500.woff [moved from resources/assets/fonts/roboto-v15-cyrillic_latin-500.woff with 100% similarity]
public/fonts/roboto-v15-cyrillic_latin-500.woff2 [moved from resources/assets/fonts/roboto-v15-cyrillic_latin-500.woff2 with 100% similarity]
public/fonts/roboto-v15-cyrillic_latin-500italic.woff [moved from resources/assets/fonts/roboto-v15-cyrillic_latin-500italic.woff with 100% similarity]
public/fonts/roboto-v15-cyrillic_latin-500italic.woff2 [moved from resources/assets/fonts/roboto-v15-cyrillic_latin-500italic.woff2 with 100% similarity]
public/fonts/roboto-v15-cyrillic_latin-700.woff [moved from resources/assets/fonts/roboto-v15-cyrillic_latin-700.woff with 100% similarity]
public/fonts/roboto-v15-cyrillic_latin-700.woff2 [moved from resources/assets/fonts/roboto-v15-cyrillic_latin-700.woff2 with 100% similarity]
public/fonts/roboto-v15-cyrillic_latin-700italic.woff [moved from resources/assets/fonts/roboto-v15-cyrillic_latin-700italic.woff with 100% similarity]
public/fonts/roboto-v15-cyrillic_latin-700italic.woff2 [moved from resources/assets/fonts/roboto-v15-cyrillic_latin-700italic.woff2 with 100% similarity]
public/fonts/roboto-v15-cyrillic_latin-italic.woff [moved from resources/assets/fonts/roboto-v15-cyrillic_latin-italic.woff with 100% similarity]
public/fonts/roboto-v15-cyrillic_latin-italic.woff2 [moved from resources/assets/fonts/roboto-v15-cyrillic_latin-italic.woff2 with 100% similarity]
public/fonts/roboto-v15-cyrillic_latin-regular.woff [moved from resources/assets/fonts/roboto-v15-cyrillic_latin-regular.woff with 100% similarity]
public/fonts/roboto-v15-cyrillic_latin-regular.woff2 [moved from resources/assets/fonts/roboto-v15-cyrillic_latin-regular.woff2 with 100% similarity]
public/mix-manifest.json [deleted file]
resources/assets/js/controllers.js
resources/assets/js/directives.js
resources/assets/js/global.js
resources/assets/js/pages/page-form.js
resources/assets/js/pages/page-show.js
resources/assets/js/translations.js
resources/assets/js/vues/search.js
resources/assets/js/vues/vues.js
resources/assets/sass/_fonts.scss
resources/views/base.blade.php
resources/views/search/all.blade.php
webpack.mix.js [deleted file]

index 856cf37222195a285877fc301603fac73dcc338a..5f41a864e58092fd0467efe1ffbeac7c6dd8558c 100644 (file)
@@ -7,7 +7,6 @@ Homestead.yaml
 /public/plugins
 /public/css
 /public/js
-/public/fonts
 /public/bower
 /storage/images
 _ide_helper.php
diff --git a/gulpfile.js b/gulpfile.js
new file mode 100644 (file)
index 0000000..b72bb36
--- /dev/null
@@ -0,0 +1,63 @@
+const argv = require('yargs').argv;
+const gulp = require('gulp'),
+    plumber = require('gulp-plumber');
+const autoprefixer = require('gulp-autoprefixer');
+const uglify = require('gulp-uglify');
+const minifycss = require('gulp-clean-css');
+const sass = require('gulp-sass');
+const browserify = require("browserify");
+const source = require('vinyl-source-stream');
+const buffer = require('vinyl-buffer');
+const babelify = require("babelify");
+const watchify = require("watchify");
+const envify = require("envify");
+const gutil = require("gulp-util");
+
+if (argv.production) process.env.NODE_ENV = 'production';
+
+gulp.task('styles', () => {
+    let chain = gulp.src(['resources/assets/sass/**/*.scss'])
+        .pipe(plumber({
+            errorHandler: function (error) {
+                console.log(error.message);
+                this.emit('end');
+            }}))
+        .pipe(sass())
+        .pipe(autoprefixer('last 2 versions'));
+    if (argv.production) chain = chain.pipe(minifycss());
+    return chain.pipe(gulp.dest('public/css/'));
+});
+
+
+function scriptTask(watch=false) {
+
+    let props = {
+        basedir: 'resources/assets/js',
+        debug: true,
+        entries: ['global.js']
+    };
+
+    let bundler = watch ? watchify(browserify(props), { poll: true }) : browserify(props);
+    bundler.transform(envify, {global: true}).transform(babelify, {presets: ['es2015']});
+    function rebundle() {
+        let stream = bundler.bundle();
+        stream = stream.pipe(source('common.js'));
+        if (argv.production) stream = stream.pipe(buffer()).pipe(uglify());
+        return stream.pipe(gulp.dest('public/js/'));
+    }
+    bundler.on('update', function() {
+        rebundle();
+        gutil.log('Rebundle...');
+    });
+    bundler.on('log', gutil.log);
+    return rebundle();
+}
+
+gulp.task('scripts', () => {scriptTask(false)});
+gulp.task('scripts-watch', () => {scriptTask(true)});
+
+gulp.task('default', ['styles', 'scripts-watch'], () => {
+    gulp.watch("resources/assets/sass/**/*.scss", ['styles']);
+});
+
+gulp.task('build', ['styles', 'scripts']);
\ No newline at end of file
index 1d7e8e26882cfb08ad1a1efaef657eb67febe8f4..9f2ce4c1ae6d96c8df3a599ae1c420b0e1a56db7 100644 (file)
@@ -1,30 +1,43 @@
 {
   "private": true,
   "scripts": {
-    "dev": "npm run development",
-    "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
-    "watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
-    "watch-poll": "npm run watch -- --watch-poll",
-    "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
-    "prod": "npm run production",
-    "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
+    "build": "gulp build",
+    "production": "gulp build --production",
+    "dev": "gulp",
+    "watch": "gulp"
   },
   "devDependencies": {
+    "babelify": "^7.3.0",
+    "browserify": "^14.3.0",
+    "envify": "^4.0.0",
+    "gulp": "3.9.1",
+    "gulp-autoprefixer": "3.1.1",
+    "gulp-clean-css": "^3.0.4",
+    "gulp-minify-css": "1.2.4",
+    "gulp-plumber": "1.1.0",
+    "gulp-sass": "3.1.0",
+    "gulp-uglify": "2.1.2",
+    "vinyl-buffer": "^1.0.0",
+    "vinyl-source-stream": "^1.1.0",
+    "watchify": "^3.9.0",
+    "yargs": "^7.1.0"
+  },
+  "dependencies": {
     "angular": "^1.5.5",
     "angular-animate": "^1.5.5",
     "angular-resource": "^1.5.5",
     "angular-sanitize": "^1.5.5",
-    "angular-ui-sortable": "^0.15.0",
-    "cross-env": "^3.2.3",
-    "dropzone": "^4.0.1",
-    "gulp": "^3.9.0",
-    "laravel-mix": "0.*",
-    "marked": "^0.3.5",
-    "moment": "^2.12.0"
-  },
-  "dependencies": {
+    "angular-ui-sortable": "^0.17.0",
     "axios": "^0.16.1",
+    "babel-preset-es2015": "^6.24.1",
     "clipboard": "^1.5.16",
+    "dropzone": "^4.0.1",
+    "gulp-util": "^3.0.8",
+    "marked": "^0.3.5",
+    "moment": "^2.12.0",
     "vue": "^2.2.6"
+  },
+  "browser": {
+    "vue": "vue/dist/vue.common.js"
   }
 }
diff --git a/public/mix-manifest.json b/public/mix-manifest.json
deleted file mode 100644 (file)
index 3885bcd..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "/js/common.js": "/js/common.js",
-  "/css/styles.css": "/css/styles.css",
-  "/css/print-styles.css": "/css/print-styles.css",
-  "/css/export-styles.css": "/css/export-styles.css",
-  "/js/vues.js": "/js/vues.js"
-}
\ No newline at end of file
index 0d57b09add8307f7284ceb9c417f7bd768751a1f..c5baecf16601dda404b3a2406943fb4cd4bf0682 100644 (file)
@@ -1,12 +1,12 @@
 "use strict";
 
-import moment from 'moment';
-import 'moment/locale/en-gb';
-import editorOptions from "./pages/page-form";
+const moment = require('moment');
+require('moment/locale/en-gb');
+const editorOptions = require("./pages/page-form");
 
 moment.locale('en-gb');
 
-export default function (ngApp, events) {
+module.exports = function (ngApp, events) {
 
     ngApp.controller('ImageManagerController', ['$scope', '$attrs', '$http', '$timeout', 'imageManagerService',
         function ($scope, $attrs, $http, $timeout, imageManagerService) {
index 10458e753fac0809a8fe9678affa5f4ade0bbac9..19badcac83e5f570101305b250b3f099a8cef559 100644 (file)
@@ -1,8 +1,8 @@
 "use strict";
-import DropZone from "dropzone";
-import markdown from "marked";
+const DropZone = require("dropzone");
+const markdown = require("marked");
 
-export default function (ngApp, events) {
+module.exports = function (ngApp, events) {
 
     /**
      * Common tab controls using simple jQuery functions.
index 7c980f6e9acf7eb698968c48097a816869c70e5e..dc6802e12ba6646be4099f759773f2368e2c5ffe 100644 (file)
@@ -8,33 +8,33 @@ window.baseUrl = function(path) {
     return basePath + '/' + path;
 };
 
-// Vue and axios setup
-import vue from "vue/dist/vue.common";
-import axios from "axios";
+const Vue = require("vue");
+const axios = require("axios");
 
 let axiosInstance = axios.create({
     headers: {
         'X-CSRF-TOKEN': document.querySelector('meta[name=token]').getAttribute('content'),
-        'baseURL': baseUrl('')
+        'baseURL': window.baseUrl('')
     }
 });
 
-window.Vue = vue;
-window.axios = axiosInstance;
 Vue.prototype.$http = axiosInstance;
 
+require("./vues/vues");
+
+
 // AngularJS - Create application and load components
-import angular from "angular";
-import "angular-resource";
-import "angular-animate";
-import "angular-sanitize";
-import "angular-ui-sortable";
+const angular = require("angular");
+require("angular-resource");
+require("angular-animate");
+require("angular-sanitize");
+require("angular-ui-sortable");
 
 let ngApp = angular.module('bookStack', ['ngResource', 'ngAnimate', 'ngSanitize', 'ui.sortable']);
 
 // Translation setup
 // Creates a global function with name 'trans' to be used in the same way as Laravel's translation system
-import Translations from "./translations"
+const Translations = require("./translations");
 let translator = new Translations(window.translations);
 window.trans = translator.get.bind(translator);
 
@@ -65,9 +65,9 @@ window.Events = new EventManager();
 Vue.prototype.$events = window.Events;
 
 // Load in angular specific items
-import Services from './services';
-import Directives from './directives';
-import Controllers from './controllers';
+const Services = require('./services');
+const Directives = require('./directives');
+const Controllers = require('./controllers');
 Services(ngApp, window.Events);
 Directives(ngApp, window.Events);
 Controllers(ngApp, window.Events);
@@ -170,4 +170,4 @@ if(navigator.userAgent.indexOf('MSIE')!==-1
 }
 
 // Page specific items
-import "./pages/page-show";
+require("./pages/page-show");
index 0f44b3d09a5aa45e47a787264333f45a2eb1a59e..b5a0a29980382d83faabe8d7168715597173dce5 100644 (file)
@@ -60,7 +60,7 @@ function registerEditorShortcuts(editor) {
     editor.addShortcut('meta+shift+E', '', ['FormatBlock', false, 'code']);
 }
 
-export default function() {
+module.exports = function() {
     let settings = {
         selector: '#html-editor',
         content_css: [
@@ -213,4 +213,4 @@ export default function() {
         }
     };
     return settings;
-}
\ No newline at end of file
+};
\ No newline at end of file
index 0f45e1987cf434959169128a0632692cc1937aa9..cc6296434ee41c78db8494cd9e6d86338c30e67a 100644 (file)
@@ -1,8 +1,8 @@
 "use strict";
 // Configure ZeroClipboard
-import Clipboard from "clipboard";
+const Clipboard = require("clipboard");
 
-export default window.setupPageShow = function (pageId) {
+let setupPageShow = window.setupPageShow = function (pageId) {
 
     // Set up pointer
     let $pointer = $('#pointer').detach();
@@ -151,3 +151,5 @@ export default window.setupPageShow = function (pageId) {
     });
 
 };
+
+module.exports = setupPageShow;
\ No newline at end of file
index 306c696b6efbf92a48f516167bc665206cc5fd6f..ca6a7bd29a8f7224a31c8dae62f2c4f8a58f5266 100644 (file)
@@ -44,4 +44,4 @@ class Translator {
 
 }
 
-export default Translator
+module.exports = Translator;
index 708418271f3b9cdcceb45fbd8698cc798dfffe1d..710f4b214730b0732a836955669d640f23faa9e1 100644 (file)
@@ -1,16 +1,18 @@
-
-let termString = document.querySelector('[name=searchTerm]').value;
-let terms = termString.split(' ');
+const moment = require('moment');
 
 let data = {
-    terms: terms,
-        termString : termString,
-        search: {
+    terms: '',
+    termString : '',
+    search: {
         type: {
             page: true,
             chapter: true,
             book: true
-        }
+        },
+        exactTerms: [],
+        tagTerms: [],
+        option: {},
+        dates: {}
     }
 };
 
@@ -21,8 +23,76 @@ let computed = {
 let methods = {
 
     appendTerm(term) {
-        if (this.termString.slice(-1) !== " ") this.termString += ' ';
-        this.termString += term;
+        this.termString += ' ' + term;
+        this.termString = this.termString.replace(/\s{2,}/g, ' ');
+        this.termString = this.termString.replace(/^\s+/, '');
+        this.termString = this.termString.replace(/\s+$/, '');
+    },
+
+    exactParse(searchString) {
+        this.search.exactTerms = [];
+        let exactFilter = /"(.+?)"/g;
+        let matches;
+        while ((matches = exactFilter.exec(searchString)) !== null) {
+            this.search.exactTerms.push(matches[1]);
+        }
+    },
+
+    exactChange() {
+        let exactFilter = /"(.+?)"/g;
+        this.termString = this.termString.replace(exactFilter, '');
+        let matchesTerm = this.search.exactTerms.filter(term => {
+            return term.trim() !== '';
+        }).map(term => {
+            return `"${term}"`
+        }).join(' ');
+        this.appendTerm(matchesTerm);
+    },
+
+    addExact() {
+        this.search.exactTerms.push('');
+        setTimeout(() => {
+            let exactInputs = document.querySelectorAll('.exact-input');
+            exactInputs[exactInputs.length - 1].focus();
+        }, 100);
+    },
+
+    removeExact(index) {
+        this.search.exactTerms.splice(index, 1);
+        this.exactChange();
+    },
+
+    tagParse(searchString) {
+        this.search.tagTerms = [];
+        let tagFilter = /\[(.+?)\]/g;
+        let matches;
+        while ((matches = tagFilter.exec(searchString)) !== null) {
+            this.search.tagTerms.push(matches[1]);
+        }
+    },
+
+    tagChange() {
+        let tagFilter = /\[(.+?)\]/g;
+        this.termString = this.termString.replace(tagFilter, '');
+        let matchesTerm = this.search.tagTerms.filter(term => {
+            return term.trim() !== '';
+        }).map(term => {
+            return `[${term}]`
+        }).join(' ');
+        this.appendTerm(matchesTerm);
+    },
+
+    addTag() {
+        this.search.tagTerms.push('');
+        setTimeout(() => {
+            let tagInputs = document.querySelectorAll('.tag-input');
+            tagInputs[tagInputs.length - 1].focus();
+        }, 100);
+    },
+
+    removeTag(index) {
+        this.search.tagTerms.splice(index, 1);
+        this.tagChange();
     },
 
     typeParse(searchString) {
@@ -55,14 +125,40 @@ let methods = {
         this.appendTerm(typeTerm);
     },
 
-    updateSearch() {
+    optionParse(searchString) {
+        let optionFilter = /{([a-z_-]+?)}/gi;
+        let matches;
+        while ((matches = optionFilter.exec(searchString)) !== null) {
+            this.search.option[matches[1].toLowerCase()] = true;
+        }
+    },
+
+    optionChange(optionName) {
+        let isChecked = this.search.option[optionName];
+        if (isChecked) {
+            this.appendTerm(`{${optionName}}`);
+        } else {
+            this.termString = this.termString.replace(`{${optionName}}`, '');
+        }
+    },
+
+    updateSearch(e) {
+        e.preventDefault();
         window.location = '/search?term=' + encodeURIComponent(this.termString);
+    },
+
+    enableDate(optionName) {
+        this.search.dates[optionName] = moment().format('YYYY-MM-DD');
     }
 
 };
 
 function created() {
+    this.termString = document.querySelector('[name=searchTerm]').value;
     this.typeParse(this.termString);
+    this.exactParse(this.termString);
+    this.tagParse(this.termString);
+    this.optionParse(this.termString);
 }
 
 module.exports = {
index d500185985d7fd5f3ee89cbbea0e2f148b58922b..832a5415df53eb50b9edc909483a93eea8c85fa0 100644 (file)
@@ -1,3 +1,4 @@
+const Vue = require("vue");
 
 function exists(id) {
     return document.getElementById(id) !== null;
index 7d19f051c63b0dcd9d591f616e512a7e2cbd9cf7..c8e8ea833482d56a751b48b925a04f2f1c35537b 100644 (file)
@@ -6,8 +6,8 @@
   font-style: normal;
   font-weight: 100;
   src: local('Roboto Thin'), local('Roboto-Thin'),
-  url('assets/fonts/roboto-v15-cyrillic_latin-100.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
-  url('assets/fonts/roboto-v15-cyrillic_latin-100.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+  url('../fonts/roboto-v15-cyrillic_latin-100.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
+  url('../fonts/roboto-v15-cyrillic_latin-100.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
 }
 /* roboto-100italic - cyrillic_latin */
 @font-face {
@@ -15,8 +15,8 @@
   font-style: italic;
   font-weight: 100;
   src: local('Roboto Thin Italic'), local('Roboto-ThinItalic'),
-  url('assets/fonts/roboto-v15-cyrillic_latin-100italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
-  url('assets/fonts/roboto-v15-cyrillic_latin-100italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+  url('../fonts/roboto-v15-cyrillic_latin-100italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
+  url('../fonts/roboto-v15-cyrillic_latin-100italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
 }
 /* roboto-300 - cyrillic_latin */
 @font-face {
@@ -24,8 +24,8 @@
   font-style: normal;
   font-weight: 300;
   src: local('Roboto Light'), local('Roboto-Light'),
-  url('assets/fonts/roboto-v15-cyrillic_latin-300.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
-  url('assets/fonts/roboto-v15-cyrillic_latin-300.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+  url('../fonts/roboto-v15-cyrillic_latin-300.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
+  url('../fonts/roboto-v15-cyrillic_latin-300.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
 }
 /* roboto-300italic - cyrillic_latin */
 @font-face {
@@ -33,8 +33,8 @@
   font-style: italic;
   font-weight: 300;
   src: local('Roboto Light Italic'), local('Roboto-LightItalic'),
-  url('assets/fonts/roboto-v15-cyrillic_latin-300italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
-  url('assets/fonts/roboto-v15-cyrillic_latin-300italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+  url('../fonts/roboto-v15-cyrillic_latin-300italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
+  url('../fonts/roboto-v15-cyrillic_latin-300italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
 }
 /* roboto-regular - cyrillic_latin */
 @font-face {
@@ -42,8 +42,8 @@
   font-style: normal;
   font-weight: 400;
   src: local('Roboto'), local('Roboto-Regular'),
-  url('assets/fonts/roboto-v15-cyrillic_latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
-  url('assets/fonts/roboto-v15-cyrillic_latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+  url('../fonts/roboto-v15-cyrillic_latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
+  url('../fonts/roboto-v15-cyrillic_latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
 }
 /* roboto-italic - cyrillic_latin */
 @font-face {
@@ -51,8 +51,8 @@
   font-style: italic;
   font-weight: 400;
   src: local('Roboto Italic'), local('Roboto-Italic'),
-  url('assets/fonts/roboto-v15-cyrillic_latin-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
-  url('assets/fonts/roboto-v15-cyrillic_latin-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+  url('../fonts/roboto-v15-cyrillic_latin-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
+  url('../fonts/roboto-v15-cyrillic_latin-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
 }
 /* roboto-500 - cyrillic_latin */
 @font-face {
@@ -60,8 +60,8 @@
   font-style: normal;
   font-weight: 500;
   src: local('Roboto Medium'), local('Roboto-Medium'),
-  url('assets/fonts/roboto-v15-cyrillic_latin-500.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
-  url('assets/fonts/roboto-v15-cyrillic_latin-500.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+  url('../fonts/roboto-v15-cyrillic_latin-500.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
+  url('../fonts/roboto-v15-cyrillic_latin-500.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
 }
 /* roboto-500italic - cyrillic_latin */
 @font-face {
@@ -69,8 +69,8 @@
   font-style: italic;
   font-weight: 500;
   src: local('Roboto Medium Italic'), local('Roboto-MediumItalic'),
-  url('assets/fonts/roboto-v15-cyrillic_latin-500italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
-  url('assets/fonts/roboto-v15-cyrillic_latin-500italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+  url('../fonts/roboto-v15-cyrillic_latin-500italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
+  url('../fonts/roboto-v15-cyrillic_latin-500italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
 }
 /* roboto-700 - cyrillic_latin */
 @font-face {
@@ -78,8 +78,8 @@
   font-style: normal;
   font-weight: 700;
   src: local('Roboto Bold'), local('Roboto-Bold'),
-  url('assets/fonts/roboto-v15-cyrillic_latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
-  url('assets/fonts/roboto-v15-cyrillic_latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+  url('../fonts/roboto-v15-cyrillic_latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
+  url('../fonts/roboto-v15-cyrillic_latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
 }
 /* roboto-700italic - cyrillic_latin */
 @font-face {
@@ -87,8 +87,8 @@
   font-style: italic;
   font-weight: 700;
   src: local('Roboto Bold Italic'), local('Roboto-BoldItalic'),
-  url('assets/fonts/roboto-v15-cyrillic_latin-700italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
-  url('assets/fonts/roboto-v15-cyrillic_latin-700italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+  url('../fonts/roboto-v15-cyrillic_latin-700italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
+  url('../fonts/roboto-v15-cyrillic_latin-700italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
 }
 
 /* roboto-mono-regular - latin */
@@ -97,6 +97,6 @@
   font-style: normal;
   font-weight: 400;
   src: local('Roboto Mono'), local('RobotoMono-Regular'),
-  url('assets/fonts/roboto-mono-v4-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
-  url('assets/fonts/roboto-mono-v4-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+  url('../fonts/roboto-mono-v4-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
+  url('../fonts/roboto-mono-v4-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
 }
\ No newline at end of file
index 2251ed2dfebdba14e998017795caf83124584ffe..95a9d72b0dcff779bfea147298a97ca208a37129 100644 (file)
@@ -84,7 +84,6 @@
     </div>
 @yield('bottom')
 <script src="{{ versioned_asset('js/common.js') }}"></script>
-<script src="{{ versioned_asset('js/vues.js') }}"></script>
 @yield('scripts')
 </body>
 </html>
index ac5cd7db4ee0ab2b4a62802d795c1d7bc6308706..d1f928912d861332dc8dad427f87d4a80f480d67 100644 (file)
             <div class="col-md-5 col-md-offset-1">
                <h3>Search Filters</h3>
 
-                <p><strong>Content Type</strong></p>
-                <div class="form-group">
-                    <label><input type="checkbox" v-on:change="typeChange" v-model="search.type.page" value="page"> Page</label>
-                    <label><input type="checkbox" v-on:change="typeChange" v-model="search.type.chapter" value="chapter"> Chapter</label>
-                    <label><input type="checkbox" v-on:change="typeChange" v-model="search.type.book" value="book"> Book</label>
-                </div>
+                <form v-on:submit="updateSearch" v-cloak>
+                    <p><strong>Content Type</strong></p>
+                    <div class="form-group">
+                        <label><input type="checkbox" v-on:change="typeChange" v-model="search.type.page" value="page"> Page</label>
+                        <label><input type="checkbox" v-on:change="typeChange" v-model="search.type.chapter" value="chapter"> Chapter</label>
+                        <label><input type="checkbox" v-on:change="typeChange" v-model="search.type.book" value="book"> Book</label>
+                    </div>
+
+                    <p><strong>Exact Matches</strong></p>
+                    <table cellpadding="0" cellspacing="0" border="0" class="no-style">
+                        <tr v-for="(term, i) in search.exactTerms">
+                            <td style="padding: 0 12px 6px 0;">
+                                <input class="exact-input" v-on:input="exactChange" type="text" v-model="search.exactTerms[i]"></td>
+                            <td>
+                                <button type="button" class="text-button" v-on:click="removeExact(i)">
+                                    <i class="zmdi zmdi-close-circle-o"></i>
+                                </button>
+                            </td>
+                        </tr>
+                        <tr>
+                            <td colspan="2">
+                                <button type="button" class="text-button" v-on:click="addExact">
+                                    <i class="zmdi zmdi-plus-circle-o"></i>Add exact match term
+                                </button>
+                            </td>
+                        </tr>
+                    </table>
+
+                    <p><strong>Tag Searches</strong></p>
+                    <table cellpadding="0" cellspacing="0" border="0" class="no-style">
+                        <tr v-for="(term, i) in search.tagTerms">
+                            <td style="padding: 0 12px 6px 0;">
+                                <input class="tag-input" v-on:input="tagChange" type="text" v-model="search.tagTerms[i]"></td>
+                            <td>
+                                <button type="button" class="text-button" v-on:click="removeTag(i)">
+                                    <i class="zmdi zmdi-close-circle-o"></i>
+                                </button>
+                            </td>
+                        </tr>
+                        <tr>
+                            <td colspan="2">
+                                <button type="button" class="text-button" v-on:click="addTag">
+                                    <i class="zmdi zmdi-plus-circle-o"></i>Add tag search
+                                </button>
+                            </td>
+                        </tr>
+                    </table>
+
+                    <p><strong>Options</strong></p>
+                    <label>
+                        <input type="checkbox" v-on:change="optionChange('viewed_by_me')"
+                               v-model="search.option.viewed_by_me" value="page">
+                        Viewed by me
+                    </label>
+                    <label>
+                        <input type="checkbox" v-on:change="optionChange('not_viewed_by_me')"
+                               v-model="search.option.not_viewed_by_me" value="page">
+                        Not viewed by me
+                    </label>
+
+                    <p><strong>Date Options</strong></p>
+                    <table cellpadding="0" cellspacing="0" border="0" class="no-style">
+                        <tr>
+                            <td>Updated After</td>
+                            <td style="padding: 0 12px 6px 0;">
+                                <input v-if="search.dates.updated_after" class="tag-input" v-on:input="tagChange" type="date" v-model="search.dates.updated_after" pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}">
+                                <button type="button" class="text-button" v-if="!search.dates.updated_after" v-on:click="enableDate('updated_at')">Set Date</button>
+                            </td>
+                            <td>
+                                <button v-if="search.dates.updated_after" type="button" class="text-button" v-on:click="search.dates.updated_after = false">
+                                    <i class="zmdi zmdi-close-circle-o"></i>
+                                </button>
+                            </td>
+                        </tr>
+                        <tr>
+                            <td colspan="2">
+                                <button type="button" class="text-button" v-on:click="addTag">
+                                    <i class="zmdi zmdi-plus-circle-o"></i>Add tag search
+                                </button>
+                            </td>
+                        </tr>
+                    </table>
+
+
+                    <button type="submit" class="button pos">Update Search</button>
+                </form>
 
 
-                <button type="button" class="button pos" v-on:click="updateSearch">Update Search</button>
 
             </div>
 
diff --git a/webpack.mix.js b/webpack.mix.js
deleted file mode 100644 (file)
index 2e691bd..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-const { mix } = require('laravel-mix');
-
-/*
- |--------------------------------------------------------------------------
- | Mix Asset Management
- |--------------------------------------------------------------------------
- |
- | Mix provides a clean, fluent API for defining some Webpack build steps
- | for your Laravel application. By default, we are compiling the Sass
- | file for the application as well as bundling up all the JS files.
- |
- */
-
-mix.js('resources/assets/js/global.js', './public/js/common.js')
-    .js('resources/assets/js/vues/vues.js', './public/js/vues.js')
-    .sass('resources/assets/sass/styles.scss', 'public/css')
-    .sass('resources/assets/sass/print-styles.scss', 'public/css')
-    .sass('resources/assets/sass/export-styles.scss', 'public/css');