From 8f234d0156cc6f2eb6e3c9f692e4633b35fafc41 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 28 Sep 2016 18:59:15 +0200 Subject: [PATCH 1/1] remove autocomplete and bring fonts through npm --- Gruntfile.js | 14 ++++++++++++-- app/Resources/static/themes/baggy/js/init.js | 7 ++++++- package.json | 19 ++++++++++++++----- 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 92774081..bf488ff9 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -67,12 +67,22 @@ module.exports = function (grunt) { transform: [ ["babelify", { presets: ["es2015"] - }], "browserify-shim" + }], ["browserify-shim", { + "jquery": { + "exports": "$" + }, + "materialize": "materialize", + "jquery-ui": { + "depends": "jquery", + "exports": null + } + }] ], browserifyOptions: { browser: { "jQuery": "./node_modules/jquery/dist/jquery.js", - "jquery.tinydot": "./nodes_modules/jquery.tinydot/src/jquery.tinydot.js" + "jquery.tinydot": "./node_modules/jquery.tinydot/src/jquery.tinydot.js", + "jquery.ui": "./node_modules/jquery-ui-browserify/dist/jquery-ui.js" } } } diff --git a/app/Resources/static/themes/baggy/js/init.js b/app/Resources/static/themes/baggy/js/init.js index c6a54f6f..8da9a859 100755 --- a/app/Resources/static/themes/baggy/js/init.js +++ b/app/Resources/static/themes/baggy/js/init.js @@ -1,6 +1,6 @@ const $ = global.jquery = require('jquery'); require('jquery.cookie'); -require('jquery-ui'); +require('jquery-ui-browserify'); const annotator = require('annotator'); import { savePercent, retrievePercent } from '../../_global/js/tools.js'; import { split, extractLast } from './autoCompleteTags.js'; @@ -124,6 +124,10 @@ $.fn.ready(() => { /** * Tags autocomplete */ + /** + * Not working on v2 + * + $('#value').bind('keydown', (event) => { if (event.keyCode === $.ui.keyCode.TAB && $(this).data('ui-autocomplete').menu.active) { event.preventDefault(); @@ -156,6 +160,7 @@ $.fn.ready(() => { return false; }, }); + */ //--------------------------------------------------------------------------- // Close the message box when the user clicks the close icon diff --git a/package.json b/package.json index 78970f8f..f7918d8f 100644 --- a/package.json +++ b/package.json @@ -27,17 +27,21 @@ "grunt-contrib-uglify": "^1.0.0", "grunt-postcss": "^0.8.0", "hammerjs": "^2.0.6", - "jquery": "^2.2.1", - "jquery-ui": "^1.10.5", + "icomoon-free-npm": "0.0.0", + "jquery": "^2.2.4", + "jquery-ui-browserify": "^1.11.0-pre-seelio", "jquery.cookie": "^1.4.1", "jquery.tinydot": "^0.2.1", "load-grunt-tasks": "^3.4.1", + "material-design-icons-iconfont": "^3.0.0", "materialize-css": "0.97.5", "npm": "^3.8.3", "pickadate": "^3.5.6", "pixrem": "^3.0.0", "postcss-cssnext": "^2.5.1", "prismjs": "^1.4.1", + "ptsans-npm-webfont": "0.0.4", + "roboto-fontface": "^0.6.0", "through": "^2.3.8" }, "engines": { @@ -49,9 +53,14 @@ "materialize": "./node_modules/materialize-css/bin/materialize.js" }, "browserify-shim": { - "jquery": "$", - "jQuery": "jQuery", - "materialize": "materialize" + "jquery": { + "exports": "$" + }, + "materialize": "materialize", + "jquery-ui": { + "depends": "jquery", + "exports": null + } }, "browserify": { "transform": [ -- 2.41.0