Browse Source

Fix webpack loader with jquery

pull/281/head
Artur Arseniev 9 years ago
parent
commit
4aecc536a2
  1. 2
      dist/css/grapes.min.css
  2. 6
      dist/grapes.min.js
  3. 2
      index.html
  4. 2
      package.json
  5. 10
      src/code_manager/index.js
  6. 4
      src/editor/model/Editor.js
  7. 6
      src/grapesjs/index.js
  8. 9
      src/storage_manager/index.js
  9. 2
      src/styles/scss/_gjs_inputs.scss
  10. 10
      test/specs/storage_manager/index.js
  11. 8
      webpack.config.js

2
dist/css/grapes.min.css

File diff suppressed because one or more lines are too long

6
dist/grapes.min.js

File diff suppressed because one or more lines are too long

2
index.html

@ -1325,7 +1325,7 @@
}
})
// Store and load events
editor.on('storage:load', function(e) {
console.log('LOAD ', e);

2
package.json

@ -1,7 +1,7 @@
{
"name": "grapesjs",
"description": "Free and Open Source Web Builder Framework",
"version": "0.9.49",
"version": "0.9.63",
"author": "Artur Arseniev",
"license": "BSD-3-Clause",
"homepage": "http://grapesjs.com",

10
src/code_manager/index.js

@ -69,16 +69,10 @@ module.exports = () => {
defGenerators.css = new gCss();
defGenerators.json = new gJson();
defGenerators.js = new gJs();
defViewers.CodeMirror = new eCM();
return this;
},
/**
* Callback on load
*/
onLoad() {
this.loadDefaultGenerators().loadDefaultViewers();
return this;
},
/**

4
src/editor/model/Editor.js

@ -23,6 +23,10 @@ var UndoManager = require('backbone-undo');
var key = require('keymaster');
var timedInterval;
if (!Backbone.$) {
Backbone.$ = $;
}
module.exports = Backbone.Model.extend({
defaults: {

6
src/grapesjs/index.js

@ -1,4 +1,6 @@
module.exports = (config => {
import { isUndefined } from 'underscore';
module.exports = (config => {
var c = config || {},
defaults = require('./config/config'),
Editor = require('editor'),
@ -36,7 +38,7 @@
var els = c.container;
// Make a missing $ more verbose
if (typeof $ == 'undefined') {
if (isUndefined($)) {
throw 'jQuery not found';
}

9
src/storage_manager/index.js

@ -65,15 +65,8 @@ module.exports = () => {
defaultStorages.remote = new RemoteStorage(c);
defaultStorages.local = new LocalStorage(c);
c.currentStorage = c.type;
return this;
},
/**
* Callback executed after the module is loaded
* @private
*/
onLoad() {
this.loadDefaultProviders().setCurrent(c.type);
return this;
},
/**

2
src/styles/scss/_gjs_inputs.scss

@ -174,7 +174,7 @@ $colorpSize: 22px;
.#{$app-prefix}radio-item-label {
cursor: pointer;
display: block;
padding: 5px;
padding: 4px;
}
.#{$app-prefix}field-units {

10
test/specs/storage_manager/index.js

@ -37,10 +37,6 @@ describe('Storage Manager', () => {
expect(obj.getStepsBeforeSave()).toEqual(5);
});
it('No storages inside', () => {
expect(obj.getStorages()).toEqual({});
});
it('Add and get new storage', () => {
obj.add('test', 'gen');
expect(obj.get('test')).toEqual('gen');
@ -59,12 +55,6 @@ describe('Storage Manager', () => {
expect(obj.store({item:'test'})).toEqual(null);
});
it('Load do not execute if empty', () => {
obj.load(['item'], (res) => {
expect(res).toEqual({});
});
});
it('Load default storages ', () => {
obj.loadDefaultProviders();
expect(obj.get('local')).toExist();

8
webpack.config.js

@ -25,7 +25,13 @@ module.exports = {
library: 'grapesjs',
libraryTarget: 'umd',
},
externals: ['jquery'],
externals: {
jquery: {
commonjs: 'jquery',
amd: 'jquery',
root: 'jQuery'
}
},
plugins: plugins,
module: {
loaders: [{

Loading…
Cancel
Save