Dan Brown

Migrated to custom gulp setup and conintue search interface

Showing 38 changed files with 337 additions and 110 deletions
...@@ -7,7 +7,6 @@ Homestead.yaml ...@@ -7,7 +7,6 @@ Homestead.yaml
7 /public/plugins 7 /public/plugins
8 /public/css 8 /public/css
9 /public/js 9 /public/js
10 -/public/fonts
11 /public/bower 10 /public/bower
12 /storage/images 11 /storage/images
13 _ide_helper.php 12 _ide_helper.php
......
1 +const argv = require('yargs').argv;
2 +const gulp = require('gulp'),
3 + plumber = require('gulp-plumber');
4 +const autoprefixer = require('gulp-autoprefixer');
5 +const uglify = require('gulp-uglify');
6 +const minifycss = require('gulp-clean-css');
7 +const sass = require('gulp-sass');
8 +const browserify = require("browserify");
9 +const source = require('vinyl-source-stream');
10 +const buffer = require('vinyl-buffer');
11 +const babelify = require("babelify");
12 +const watchify = require("watchify");
13 +const envify = require("envify");
14 +const gutil = require("gulp-util");
15 +
16 +if (argv.production) process.env.NODE_ENV = 'production';
17 +
18 +gulp.task('styles', () => {
19 + let chain = gulp.src(['resources/assets/sass/**/*.scss'])
20 + .pipe(plumber({
21 + errorHandler: function (error) {
22 + console.log(error.message);
23 + this.emit('end');
24 + }}))
25 + .pipe(sass())
26 + .pipe(autoprefixer('last 2 versions'));
27 + if (argv.production) chain = chain.pipe(minifycss());
28 + return chain.pipe(gulp.dest('public/css/'));
29 +});
30 +
31 +
32 +function scriptTask(watch=false) {
33 +
34 + let props = {
35 + basedir: 'resources/assets/js',
36 + debug: true,
37 + entries: ['global.js']
38 + };
39 +
40 + let bundler = watch ? watchify(browserify(props), { poll: true }) : browserify(props);
41 + bundler.transform(envify, {global: true}).transform(babelify, {presets: ['es2015']});
42 + function rebundle() {
43 + let stream = bundler.bundle();
44 + stream = stream.pipe(source('common.js'));
45 + if (argv.production) stream = stream.pipe(buffer()).pipe(uglify());
46 + return stream.pipe(gulp.dest('public/js/'));
47 + }
48 + bundler.on('update', function() {
49 + rebundle();
50 + gutil.log('Rebundle...');
51 + });
52 + bundler.on('log', gutil.log);
53 + return rebundle();
54 +}
55 +
56 +gulp.task('scripts', () => {scriptTask(false)});
57 +gulp.task('scripts-watch', () => {scriptTask(true)});
58 +
59 +gulp.task('default', ['styles', 'scripts-watch'], () => {
60 + gulp.watch("resources/assets/sass/**/*.scss", ['styles']);
61 +});
62 +
63 +gulp.task('build', ['styles', 'scripts']);
...\ No newline at end of file ...\ No newline at end of file
1 { 1 {
2 "private": true, 2 "private": true,
3 "scripts": { 3 "scripts": {
4 - "dev": "npm run development", 4 + "build": "gulp build",
5 - "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 5 + "production": "gulp build --production",
6 - "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", 6 + "dev": "gulp",
7 - "watch-poll": "npm run watch -- --watch-poll", 7 + "watch": "gulp"
8 - "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",
9 - "prod": "npm run production",
10 - "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
11 }, 8 },
12 "devDependencies": { 9 "devDependencies": {
10 + "babelify": "^7.3.0",
11 + "browserify": "^14.3.0",
12 + "envify": "^4.0.0",
13 + "gulp": "3.9.1",
14 + "gulp-autoprefixer": "3.1.1",
15 + "gulp-clean-css": "^3.0.4",
16 + "gulp-minify-css": "1.2.4",
17 + "gulp-plumber": "1.1.0",
18 + "gulp-sass": "3.1.0",
19 + "gulp-uglify": "2.1.2",
20 + "vinyl-buffer": "^1.0.0",
21 + "vinyl-source-stream": "^1.1.0",
22 + "watchify": "^3.9.0",
23 + "yargs": "^7.1.0"
24 + },
25 + "dependencies": {
13 "angular": "^1.5.5", 26 "angular": "^1.5.5",
14 "angular-animate": "^1.5.5", 27 "angular-animate": "^1.5.5",
15 "angular-resource": "^1.5.5", 28 "angular-resource": "^1.5.5",
16 "angular-sanitize": "^1.5.5", 29 "angular-sanitize": "^1.5.5",
17 - "angular-ui-sortable": "^0.15.0", 30 + "angular-ui-sortable": "^0.17.0",
18 - "cross-env": "^3.2.3",
19 - "dropzone": "^4.0.1",
20 - "gulp": "^3.9.0",
21 - "laravel-mix": "0.*",
22 - "marked": "^0.3.5",
23 - "moment": "^2.12.0"
24 - },
25 - "dependencies": {
26 "axios": "^0.16.1", 31 "axios": "^0.16.1",
32 + "babel-preset-es2015": "^6.24.1",
27 "clipboard": "^1.5.16", 33 "clipboard": "^1.5.16",
34 + "dropzone": "^4.0.1",
35 + "gulp-util": "^3.0.8",
36 + "marked": "^0.3.5",
37 + "moment": "^2.12.0",
28 "vue": "^2.2.6" 38 "vue": "^2.2.6"
39 + },
40 + "browser": {
41 + "vue": "vue/dist/vue.common.js"
29 } 42 }
30 } 43 }
......
1 -{
2 - "/js/common.js": "/js/common.js",
3 - "/css/styles.css": "/css/styles.css",
4 - "/css/print-styles.css": "/css/print-styles.css",
5 - "/css/export-styles.css": "/css/export-styles.css",
6 - "/js/vues.js": "/js/vues.js"
7 -}
...\ No newline at end of file ...\ No newline at end of file
1 "use strict"; 1 "use strict";
2 2
3 -import moment from 'moment'; 3 +const moment = require('moment');
4 -import 'moment/locale/en-gb'; 4 +require('moment/locale/en-gb');
5 -import editorOptions from "./pages/page-form"; 5 +const editorOptions = require("./pages/page-form");
6 6
7 moment.locale('en-gb'); 7 moment.locale('en-gb');
8 8
9 -export default function (ngApp, events) { 9 +module.exports = function (ngApp, events) {
10 10
11 ngApp.controller('ImageManagerController', ['$scope', '$attrs', '$http', '$timeout', 'imageManagerService', 11 ngApp.controller('ImageManagerController', ['$scope', '$attrs', '$http', '$timeout', 'imageManagerService',
12 function ($scope, $attrs, $http, $timeout, imageManagerService) { 12 function ($scope, $attrs, $http, $timeout, imageManagerService) {
......
1 "use strict"; 1 "use strict";
2 -import DropZone from "dropzone"; 2 +const DropZone = require("dropzone");
3 -import markdown from "marked"; 3 +const markdown = require("marked");
4 4
5 -export default function (ngApp, events) { 5 +module.exports = function (ngApp, events) {
6 6
7 /** 7 /**
8 * Common tab controls using simple jQuery functions. 8 * Common tab controls using simple jQuery functions.
......
...@@ -8,33 +8,33 @@ window.baseUrl = function(path) { ...@@ -8,33 +8,33 @@ window.baseUrl = function(path) {
8 return basePath + '/' + path; 8 return basePath + '/' + path;
9 }; 9 };
10 10
11 -// Vue and axios setup 11 +const Vue = require("vue");
12 -import vue from "vue/dist/vue.common"; 12 +const axios = require("axios");
13 -import axios from "axios";
14 13
15 let axiosInstance = axios.create({ 14 let axiosInstance = axios.create({
16 headers: { 15 headers: {
17 'X-CSRF-TOKEN': document.querySelector('meta[name=token]').getAttribute('content'), 16 'X-CSRF-TOKEN': document.querySelector('meta[name=token]').getAttribute('content'),
18 - 'baseURL': baseUrl('') 17 + 'baseURL': window.baseUrl('')
19 } 18 }
20 }); 19 });
21 20
22 -window.Vue = vue;
23 -window.axios = axiosInstance;
24 Vue.prototype.$http = axiosInstance; 21 Vue.prototype.$http = axiosInstance;
25 22
23 +require("./vues/vues");
24 +
25 +
26 // AngularJS - Create application and load components 26 // AngularJS - Create application and load components
27 -import angular from "angular"; 27 +const angular = require("angular");
28 -import "angular-resource"; 28 +require("angular-resource");
29 -import "angular-animate"; 29 +require("angular-animate");
30 -import "angular-sanitize"; 30 +require("angular-sanitize");
31 -import "angular-ui-sortable"; 31 +require("angular-ui-sortable");
32 32
33 let ngApp = angular.module('bookStack', ['ngResource', 'ngAnimate', 'ngSanitize', 'ui.sortable']); 33 let ngApp = angular.module('bookStack', ['ngResource', 'ngAnimate', 'ngSanitize', 'ui.sortable']);
34 34
35 // Translation setup 35 // Translation setup
36 // Creates a global function with name 'trans' to be used in the same way as Laravel's translation system 36 // Creates a global function with name 'trans' to be used in the same way as Laravel's translation system
37 -import Translations from "./translations" 37 +const Translations = require("./translations");
38 let translator = new Translations(window.translations); 38 let translator = new Translations(window.translations);
39 window.trans = translator.get.bind(translator); 39 window.trans = translator.get.bind(translator);
40 40
...@@ -65,9 +65,9 @@ window.Events = new EventManager(); ...@@ -65,9 +65,9 @@ window.Events = new EventManager();
65 Vue.prototype.$events = window.Events; 65 Vue.prototype.$events = window.Events;
66 66
67 // Load in angular specific items 67 // Load in angular specific items
68 -import Services from './services'; 68 +const Services = require('./services');
69 -import Directives from './directives'; 69 +const Directives = require('./directives');
70 -import Controllers from './controllers'; 70 +const Controllers = require('./controllers');
71 Services(ngApp, window.Events); 71 Services(ngApp, window.Events);
72 Directives(ngApp, window.Events); 72 Directives(ngApp, window.Events);
73 Controllers(ngApp, window.Events); 73 Controllers(ngApp, window.Events);
...@@ -170,4 +170,4 @@ if(navigator.userAgent.indexOf('MSIE')!==-1 ...@@ -170,4 +170,4 @@ if(navigator.userAgent.indexOf('MSIE')!==-1
170 } 170 }
171 171
172 // Page specific items 172 // Page specific items
173 -import "./pages/page-show"; 173 +require("./pages/page-show");
......
...@@ -60,7 +60,7 @@ function registerEditorShortcuts(editor) { ...@@ -60,7 +60,7 @@ function registerEditorShortcuts(editor) {
60 editor.addShortcut('meta+shift+E', '', ['FormatBlock', false, 'code']); 60 editor.addShortcut('meta+shift+E', '', ['FormatBlock', false, 'code']);
61 } 61 }
62 62
63 -export default function() { 63 +module.exports = function() {
64 let settings = { 64 let settings = {
65 selector: '#html-editor', 65 selector: '#html-editor',
66 content_css: [ 66 content_css: [
...@@ -213,4 +213,4 @@ export default function() { ...@@ -213,4 +213,4 @@ export default function() {
213 } 213 }
214 }; 214 };
215 return settings; 215 return settings;
216 -}
...\ No newline at end of file ...\ No newline at end of file
216 +};
...\ No newline at end of file ...\ No newline at end of file
......
1 "use strict"; 1 "use strict";
2 // Configure ZeroClipboard 2 // Configure ZeroClipboard
3 -import Clipboard from "clipboard"; 3 +const Clipboard = require("clipboard");
4 4
5 -export default window.setupPageShow = function (pageId) { 5 +let setupPageShow = window.setupPageShow = function (pageId) {
6 6
7 // Set up pointer 7 // Set up pointer
8 let $pointer = $('#pointer').detach(); 8 let $pointer = $('#pointer').detach();
...@@ -151,3 +151,5 @@ export default window.setupPageShow = function (pageId) { ...@@ -151,3 +151,5 @@ export default window.setupPageShow = function (pageId) {
151 }); 151 });
152 152
153 }; 153 };
154 +
155 +module.exports = setupPageShow;
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -44,4 +44,4 @@ class Translator { ...@@ -44,4 +44,4 @@ class Translator {
44 44
45 } 45 }
46 46
47 -export default Translator 47 +module.exports = Translator;
......
1 - 1 +const moment = require('moment');
2 -let termString = document.querySelector('[name=searchTerm]').value;
3 -let terms = termString.split(' ');
4 2
5 let data = { 3 let data = {
6 - terms: terms, 4 + terms: '',
7 - termString : termString, 5 + termString : '',
8 - search: { 6 + search: {
9 type: { 7 type: {
10 page: true, 8 page: true,
11 chapter: true, 9 chapter: true,
12 book: true 10 book: true
13 - } 11 + },
12 + exactTerms: [],
13 + tagTerms: [],
14 + option: {},
15 + dates: {}
14 } 16 }
15 }; 17 };
16 18
...@@ -21,8 +23,76 @@ let computed = { ...@@ -21,8 +23,76 @@ let computed = {
21 let methods = { 23 let methods = {
22 24
23 appendTerm(term) { 25 appendTerm(term) {
24 - if (this.termString.slice(-1) !== " ") this.termString += ' '; 26 + this.termString += ' ' + term;
25 - this.termString += term; 27 + this.termString = this.termString.replace(/\s{2,}/g, ' ');
28 + this.termString = this.termString.replace(/^\s+/, '');
29 + this.termString = this.termString.replace(/\s+$/, '');
30 + },
31 +
32 + exactParse(searchString) {
33 + this.search.exactTerms = [];
34 + let exactFilter = /"(.+?)"/g;
35 + let matches;
36 + while ((matches = exactFilter.exec(searchString)) !== null) {
37 + this.search.exactTerms.push(matches[1]);
38 + }
39 + },
40 +
41 + exactChange() {
42 + let exactFilter = /"(.+?)"/g;
43 + this.termString = this.termString.replace(exactFilter, '');
44 + let matchesTerm = this.search.exactTerms.filter(term => {
45 + return term.trim() !== '';
46 + }).map(term => {
47 + return `"${term}"`
48 + }).join(' ');
49 + this.appendTerm(matchesTerm);
50 + },
51 +
52 + addExact() {
53 + this.search.exactTerms.push('');
54 + setTimeout(() => {
55 + let exactInputs = document.querySelectorAll('.exact-input');
56 + exactInputs[exactInputs.length - 1].focus();
57 + }, 100);
58 + },
59 +
60 + removeExact(index) {
61 + this.search.exactTerms.splice(index, 1);
62 + this.exactChange();
63 + },
64 +
65 + tagParse(searchString) {
66 + this.search.tagTerms = [];
67 + let tagFilter = /\[(.+?)\]/g;
68 + let matches;
69 + while ((matches = tagFilter.exec(searchString)) !== null) {
70 + this.search.tagTerms.push(matches[1]);
71 + }
72 + },
73 +
74 + tagChange() {
75 + let tagFilter = /\[(.+?)\]/g;
76 + this.termString = this.termString.replace(tagFilter, '');
77 + let matchesTerm = this.search.tagTerms.filter(term => {
78 + return term.trim() !== '';
79 + }).map(term => {
80 + return `[${term}]`
81 + }).join(' ');
82 + this.appendTerm(matchesTerm);
83 + },
84 +
85 + addTag() {
86 + this.search.tagTerms.push('');
87 + setTimeout(() => {
88 + let tagInputs = document.querySelectorAll('.tag-input');
89 + tagInputs[tagInputs.length - 1].focus();
90 + }, 100);
91 + },
92 +
93 + removeTag(index) {
94 + this.search.tagTerms.splice(index, 1);
95 + this.tagChange();
26 }, 96 },
27 97
28 typeParse(searchString) { 98 typeParse(searchString) {
...@@ -55,14 +125,40 @@ let methods = { ...@@ -55,14 +125,40 @@ let methods = {
55 this.appendTerm(typeTerm); 125 this.appendTerm(typeTerm);
56 }, 126 },
57 127
58 - updateSearch() { 128 + optionParse(searchString) {
129 + let optionFilter = /{([a-z_-]+?)}/gi;
130 + let matches;
131 + while ((matches = optionFilter.exec(searchString)) !== null) {
132 + this.search.option[matches[1].toLowerCase()] = true;
133 + }
134 + },
135 +
136 + optionChange(optionName) {
137 + let isChecked = this.search.option[optionName];
138 + if (isChecked) {
139 + this.appendTerm(`{${optionName}}`);
140 + } else {
141 + this.termString = this.termString.replace(`{${optionName}}`, '');
142 + }
143 + },
144 +
145 + updateSearch(e) {
146 + e.preventDefault();
59 window.location = '/search?term=' + encodeURIComponent(this.termString); 147 window.location = '/search?term=' + encodeURIComponent(this.termString);
148 + },
149 +
150 + enableDate(optionName) {
151 + this.search.dates[optionName] = moment().format('YYYY-MM-DD');
60 } 152 }
61 153
62 }; 154 };
63 155
64 function created() { 156 function created() {
157 + this.termString = document.querySelector('[name=searchTerm]').value;
65 this.typeParse(this.termString); 158 this.typeParse(this.termString);
159 + this.exactParse(this.termString);
160 + this.tagParse(this.termString);
161 + this.optionParse(this.termString);
66 } 162 }
67 163
68 module.exports = { 164 module.exports = {
......
1 +const Vue = require("vue");
1 2
2 function exists(id) { 3 function exists(id) {
3 return document.getElementById(id) !== null; 4 return document.getElementById(id) !== null;
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
6 font-style: normal; 6 font-style: normal;
7 font-weight: 100; 7 font-weight: 100;
8 src: local('Roboto Thin'), local('Roboto-Thin'), 8 src: local('Roboto Thin'), local('Roboto-Thin'),
9 - url('assets/fonts/roboto-v15-cyrillic_latin-100.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ 9 + url('../fonts/roboto-v15-cyrillic_latin-100.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
10 - url('assets/fonts/roboto-v15-cyrillic_latin-100.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ 10 + url('../fonts/roboto-v15-cyrillic_latin-100.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
11 } 11 }
12 /* roboto-100italic - cyrillic_latin */ 12 /* roboto-100italic - cyrillic_latin */
13 @font-face { 13 @font-face {
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
15 font-style: italic; 15 font-style: italic;
16 font-weight: 100; 16 font-weight: 100;
17 src: local('Roboto Thin Italic'), local('Roboto-ThinItalic'), 17 src: local('Roboto Thin Italic'), local('Roboto-ThinItalic'),
18 - url('assets/fonts/roboto-v15-cyrillic_latin-100italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ 18 + url('../fonts/roboto-v15-cyrillic_latin-100italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
19 - url('assets/fonts/roboto-v15-cyrillic_latin-100italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ 19 + url('../fonts/roboto-v15-cyrillic_latin-100italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
20 } 20 }
21 /* roboto-300 - cyrillic_latin */ 21 /* roboto-300 - cyrillic_latin */
22 @font-face { 22 @font-face {
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
24 font-style: normal; 24 font-style: normal;
25 font-weight: 300; 25 font-weight: 300;
26 src: local('Roboto Light'), local('Roboto-Light'), 26 src: local('Roboto Light'), local('Roboto-Light'),
27 - url('assets/fonts/roboto-v15-cyrillic_latin-300.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ 27 + url('../fonts/roboto-v15-cyrillic_latin-300.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
28 - url('assets/fonts/roboto-v15-cyrillic_latin-300.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ 28 + url('../fonts/roboto-v15-cyrillic_latin-300.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
29 } 29 }
30 /* roboto-300italic - cyrillic_latin */ 30 /* roboto-300italic - cyrillic_latin */
31 @font-face { 31 @font-face {
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
33 font-style: italic; 33 font-style: italic;
34 font-weight: 300; 34 font-weight: 300;
35 src: local('Roboto Light Italic'), local('Roboto-LightItalic'), 35 src: local('Roboto Light Italic'), local('Roboto-LightItalic'),
36 - url('assets/fonts/roboto-v15-cyrillic_latin-300italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ 36 + url('../fonts/roboto-v15-cyrillic_latin-300italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
37 - url('assets/fonts/roboto-v15-cyrillic_latin-300italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ 37 + url('../fonts/roboto-v15-cyrillic_latin-300italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
38 } 38 }
39 /* roboto-regular - cyrillic_latin */ 39 /* roboto-regular - cyrillic_latin */
40 @font-face { 40 @font-face {
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
42 font-style: normal; 42 font-style: normal;
43 font-weight: 400; 43 font-weight: 400;
44 src: local('Roboto'), local('Roboto-Regular'), 44 src: local('Roboto'), local('Roboto-Regular'),
45 - url('assets/fonts/roboto-v15-cyrillic_latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ 45 + url('../fonts/roboto-v15-cyrillic_latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
46 - url('assets/fonts/roboto-v15-cyrillic_latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ 46 + url('../fonts/roboto-v15-cyrillic_latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
47 } 47 }
48 /* roboto-italic - cyrillic_latin */ 48 /* roboto-italic - cyrillic_latin */
49 @font-face { 49 @font-face {
...@@ -51,8 +51,8 @@ ...@@ -51,8 +51,8 @@
51 font-style: italic; 51 font-style: italic;
52 font-weight: 400; 52 font-weight: 400;
53 src: local('Roboto Italic'), local('Roboto-Italic'), 53 src: local('Roboto Italic'), local('Roboto-Italic'),
54 - url('assets/fonts/roboto-v15-cyrillic_latin-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ 54 + url('../fonts/roboto-v15-cyrillic_latin-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
55 - url('assets/fonts/roboto-v15-cyrillic_latin-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ 55 + url('../fonts/roboto-v15-cyrillic_latin-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
56 } 56 }
57 /* roboto-500 - cyrillic_latin */ 57 /* roboto-500 - cyrillic_latin */
58 @font-face { 58 @font-face {
...@@ -60,8 +60,8 @@ ...@@ -60,8 +60,8 @@
60 font-style: normal; 60 font-style: normal;
61 font-weight: 500; 61 font-weight: 500;
62 src: local('Roboto Medium'), local('Roboto-Medium'), 62 src: local('Roboto Medium'), local('Roboto-Medium'),
63 - url('assets/fonts/roboto-v15-cyrillic_latin-500.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ 63 + url('../fonts/roboto-v15-cyrillic_latin-500.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
64 - url('assets/fonts/roboto-v15-cyrillic_latin-500.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ 64 + url('../fonts/roboto-v15-cyrillic_latin-500.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
65 } 65 }
66 /* roboto-500italic - cyrillic_latin */ 66 /* roboto-500italic - cyrillic_latin */
67 @font-face { 67 @font-face {
...@@ -69,8 +69,8 @@ ...@@ -69,8 +69,8 @@
69 font-style: italic; 69 font-style: italic;
70 font-weight: 500; 70 font-weight: 500;
71 src: local('Roboto Medium Italic'), local('Roboto-MediumItalic'), 71 src: local('Roboto Medium Italic'), local('Roboto-MediumItalic'),
72 - url('assets/fonts/roboto-v15-cyrillic_latin-500italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ 72 + url('../fonts/roboto-v15-cyrillic_latin-500italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
73 - url('assets/fonts/roboto-v15-cyrillic_latin-500italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ 73 + url('../fonts/roboto-v15-cyrillic_latin-500italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
74 } 74 }
75 /* roboto-700 - cyrillic_latin */ 75 /* roboto-700 - cyrillic_latin */
76 @font-face { 76 @font-face {
...@@ -78,8 +78,8 @@ ...@@ -78,8 +78,8 @@
78 font-style: normal; 78 font-style: normal;
79 font-weight: 700; 79 font-weight: 700;
80 src: local('Roboto Bold'), local('Roboto-Bold'), 80 src: local('Roboto Bold'), local('Roboto-Bold'),
81 - url('assets/fonts/roboto-v15-cyrillic_latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ 81 + url('../fonts/roboto-v15-cyrillic_latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
82 - url('assets/fonts/roboto-v15-cyrillic_latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ 82 + url('../fonts/roboto-v15-cyrillic_latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
83 } 83 }
84 /* roboto-700italic - cyrillic_latin */ 84 /* roboto-700italic - cyrillic_latin */
85 @font-face { 85 @font-face {
...@@ -87,8 +87,8 @@ ...@@ -87,8 +87,8 @@
87 font-style: italic; 87 font-style: italic;
88 font-weight: 700; 88 font-weight: 700;
89 src: local('Roboto Bold Italic'), local('Roboto-BoldItalic'), 89 src: local('Roboto Bold Italic'), local('Roboto-BoldItalic'),
90 - url('assets/fonts/roboto-v15-cyrillic_latin-700italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ 90 + url('../fonts/roboto-v15-cyrillic_latin-700italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
91 - url('assets/fonts/roboto-v15-cyrillic_latin-700italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ 91 + url('../fonts/roboto-v15-cyrillic_latin-700italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
92 } 92 }
93 93
94 /* roboto-mono-regular - latin */ 94 /* roboto-mono-regular - latin */
...@@ -97,6 +97,6 @@ ...@@ -97,6 +97,6 @@
97 font-style: normal; 97 font-style: normal;
98 font-weight: 400; 98 font-weight: 400;
99 src: local('Roboto Mono'), local('RobotoMono-Regular'), 99 src: local('Roboto Mono'), local('RobotoMono-Regular'),
100 - url('assets/fonts/roboto-mono-v4-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ 100 + url('../fonts/roboto-mono-v4-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
101 - url('assets/fonts/roboto-mono-v4-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ 101 + url('../fonts/roboto-mono-v4-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
102 } 102 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -84,7 +84,6 @@ ...@@ -84,7 +84,6 @@
84 </div> 84 </div>
85 @yield('bottom') 85 @yield('bottom')
86 <script src="{{ versioned_asset('js/common.js') }}"></script> 86 <script src="{{ versioned_asset('js/common.js') }}"></script>
87 -<script src="{{ versioned_asset('js/vues.js') }}"></script>
88 @yield('scripts') 87 @yield('scripts')
89 </body> 88 </body>
90 </html> 89 </html>
......
...@@ -33,15 +33,94 @@ ...@@ -33,15 +33,94 @@
33 <div class="col-md-5 col-md-offset-1"> 33 <div class="col-md-5 col-md-offset-1">
34 <h3>Search Filters</h3> 34 <h3>Search Filters</h3>
35 35
36 - <p><strong>Content Type</strong></p> 36 + <form v-on:submit="updateSearch" v-cloak>
37 - <div class="form-group"> 37 + <p><strong>Content Type</strong></p>
38 - <label><input type="checkbox" v-on:change="typeChange" v-model="search.type.page" value="page"> Page</label> 38 + <div class="form-group">
39 - <label><input type="checkbox" v-on:change="typeChange" v-model="search.type.chapter" value="chapter"> Chapter</label> 39 + <label><input type="checkbox" v-on:change="typeChange" v-model="search.type.page" value="page"> Page</label>
40 - <label><input type="checkbox" v-on:change="typeChange" v-model="search.type.book" value="book"> Book</label> 40 + <label><input type="checkbox" v-on:change="typeChange" v-model="search.type.chapter" value="chapter"> Chapter</label>
41 - </div> 41 + <label><input type="checkbox" v-on:change="typeChange" v-model="search.type.book" value="book"> Book</label>
42 + </div>
43 +
44 + <p><strong>Exact Matches</strong></p>
45 + <table cellpadding="0" cellspacing="0" border="0" class="no-style">
46 + <tr v-for="(term, i) in search.exactTerms">
47 + <td style="padding: 0 12px 6px 0;">
48 + <input class="exact-input" v-on:input="exactChange" type="text" v-model="search.exactTerms[i]"></td>
49 + <td>
50 + <button type="button" class="text-button" v-on:click="removeExact(i)">
51 + <i class="zmdi zmdi-close-circle-o"></i>
52 + </button>
53 + </td>
54 + </tr>
55 + <tr>
56 + <td colspan="2">
57 + <button type="button" class="text-button" v-on:click="addExact">
58 + <i class="zmdi zmdi-plus-circle-o"></i>Add exact match term
59 + </button>
60 + </td>
61 + </tr>
62 + </table>
63 +
64 + <p><strong>Tag Searches</strong></p>
65 + <table cellpadding="0" cellspacing="0" border="0" class="no-style">
66 + <tr v-for="(term, i) in search.tagTerms">
67 + <td style="padding: 0 12px 6px 0;">
68 + <input class="tag-input" v-on:input="tagChange" type="text" v-model="search.tagTerms[i]"></td>
69 + <td>
70 + <button type="button" class="text-button" v-on:click="removeTag(i)">
71 + <i class="zmdi zmdi-close-circle-o"></i>
72 + </button>
73 + </td>
74 + </tr>
75 + <tr>
76 + <td colspan="2">
77 + <button type="button" class="text-button" v-on:click="addTag">
78 + <i class="zmdi zmdi-plus-circle-o"></i>Add tag search
79 + </button>
80 + </td>
81 + </tr>
82 + </table>
83 +
84 + <p><strong>Options</strong></p>
85 + <label>
86 + <input type="checkbox" v-on:change="optionChange('viewed_by_me')"
87 + v-model="search.option.viewed_by_me" value="page">
88 + Viewed by me
89 + </label>
90 + <label>
91 + <input type="checkbox" v-on:change="optionChange('not_viewed_by_me')"
92 + v-model="search.option.not_viewed_by_me" value="page">
93 + Not viewed by me
94 + </label>
95 +
96 + <p><strong>Date Options</strong></p>
97 + <table cellpadding="0" cellspacing="0" border="0" class="no-style">
98 + <tr>
99 + <td>Updated After</td>
100 + <td style="padding: 0 12px 6px 0;">
101 + <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}">
102 + <button type="button" class="text-button" v-if="!search.dates.updated_after" v-on:click="enableDate('updated_at')">Set Date</button>
103 + </td>
104 + <td>
105 + <button v-if="search.dates.updated_after" type="button" class="text-button" v-on:click="search.dates.updated_after = false">
106 + <i class="zmdi zmdi-close-circle-o"></i>
107 + </button>
108 + </td>
109 + </tr>
110 + <tr>
111 + <td colspan="2">
112 + <button type="button" class="text-button" v-on:click="addTag">
113 + <i class="zmdi zmdi-plus-circle-o"></i>Add tag search
114 + </button>
115 + </td>
116 + </tr>
117 + </table>
118 +
119 +
120 + <button type="submit" class="button pos">Update Search</button>
121 + </form>
42 122
43 123
44 - <button type="button" class="button pos" v-on:click="updateSearch">Update Search</button>
45 124
46 </div> 125 </div>
47 126
......
1 -const { mix } = require('laravel-mix');
2 -
3 -/*
4 - |--------------------------------------------------------------------------
5 - | Mix Asset Management
6 - |--------------------------------------------------------------------------
7 - |
8 - | Mix provides a clean, fluent API for defining some Webpack build steps
9 - | for your Laravel application. By default, we are compiling the Sass
10 - | file for the application as well as bundling up all the JS files.
11 - |
12 - */
13 -
14 -mix.js('resources/assets/js/global.js', './public/js/common.js')
15 - .js('resources/assets/js/vues/vues.js', './public/js/vues.js')
16 - .sass('resources/assets/sass/styles.scss', 'public/css')
17 - .sass('resources/assets/sass/print-styles.scss', 'public/css')
18 - .sass('resources/assets/sass/export-styles.scss', 'public/css');