Skip to content

Commit

Permalink
Copy toobar pattern from CMFPlone.
Browse files Browse the repository at this point in the history
  • Loading branch information
thet committed Nov 2, 2018
1 parent 730cbdc commit 7903355
Show file tree
Hide file tree
Showing 16 changed files with 1,970 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mockup/patterns/toolbar/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
components
node_modules
31 changes: 31 additions & 0 deletions mockup/patterns/toolbar/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"bitwise": true,
"browser": true,
"curly": true,
"eqeqeq": true,
"evil": true,
"immed": true,
"latedef": true,
"newcap": true,
"noarg": true,
"noempty": true,
"nomen": false,
"nonew": true,
"plusplus": true,
"strict": true,
"trailing": true,
"undef": true,
"globals": {
"afterEach": true,
"beforeEach": true,
"console": true,
"define": false,
"describe": true,
"document": false,
"it": true,
"require": false,
"requirejs": true,
"tinymce": true,
"window": false
}
}
40 changes: 40 additions & 0 deletions mockup/patterns/toolbar/Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
module.exports = function(grunt) {

// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
bower: {
target: {
rjsConfig: 'config.js'
}
},
requirejs: {
compile: {
options: {
name: 'core',
mainConfigFile: 'config.js',
out: "jspak.js"
}
}
},
bowerbuster: {
path: 'bowerbuster.json'
},
buster: {
test: {
config: 'buster.js'
},
server: {
port: 1111
}
}
});

grunt.loadNpmTasks('grunt-requirejs');
grunt.loadNpmTasks('grunt-bower-requirejs');
grunt.loadNpmTasks('grunt-bower-busterjs');
grunt.loadNpmTasks('grunt-buster');

grunt.registerTask('default', ['bower', 'requirejs']);
grunt.registerTask('test', ['bower', 'bowerbuster', 'buster']);
};
23 changes: 23 additions & 0 deletions mockup/patterns/toolbar/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# jspak

A sample project where we hook up Bower to RequireJS and Bower to
Buster.JS, using Grunt.

You need to have nodejs, npm, bower, grunt, buster and PhantomJS
installed.

Installation:

$ npm install

Install client-side dependencies:

$ bower install

Run the tests with buster (and PhantomJS):

$ grunt test

For more about the background, see this blog post:

http://blog.startifact.com/posts/overwhelmed-by-javascript-dependencies.html
17 changes: 17 additions & 0 deletions mockup/patterns/toolbar/bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "jspak",
"version": "0.1.0",
"ignore": [
"**/.*",
"node_modules",
"components"
],
"dependencies": {
"jquery": "~2.0.0",
"requirejs": "",
"patternslib": "2.0.13"
},
"resolutions": {
"jquery": "~2.0.0",
}
}
1 change: 1 addition & 0 deletions mockup/patterns/toolbar/bowerbuster.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["components/backbone/backbone.js",["components/bootstrap/dist/css/bootstrap.css","components/bootstrap/dist/js/bootstrap.js","components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot","components/bootstrap/dist/fonts/glyphicons-halflings-regular.svg","components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf","components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff"],"components/console-polyfill/index.js","components/es5-shim","components/jquery/jquery.js","components/lodash/dist/lodash.compat.js","components/marked/lib/marked.js","components/react/react.js","components/requirejs-text","components/selectivizr","components/underscore/underscore.js"]
25 changes: 25 additions & 0 deletions mockup/patterns/toolbar/buster.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
var config = module.exports;

var fs = require('fs');

var sources = JSON.parse(fs.readFileSync('bowerbuster.json', 'utf8'));
sources.push('src/**/*.js');

config.core = {
rootPath: ".",
environment: "browser",
libs: [
'components/requirejs/require.js',
'config.js'
],
sources: sources,
tests: [
"test/**/*.js"
],
extensions: [require('buster-amd')],
"buster-amd": {
pathMapper: function(path) {
return path.replace(/\.js$/, "").replace(/^\//, "../");
}
}
};
18 changes: 18 additions & 0 deletions mockup/patterns/toolbar/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require.config({
baseUrl: 'src',
paths: {
backbone: '../components/backbone/backbone',
bootstrap: '../components/bootstrap/dist/js/bootstrap',
'console-polyfill': '../components/console-polyfill/index',
jquery: '../components/jquery/jquery',
lodash: '../components/lodash/dist/lodash.compat',
marked: '../components/marked/lib/marked',
react: '../components/react/react',
'requirejs-text': '../components/requirejs-text/text',
selectivizr: '../components/selectivizr/selectivizr',
underscore: '../components/underscore/underscore',
'pat-registry': '../components/patternslib/src/core/registry',
'pat-base': '../components/patternslib/src/core/base',
'plone-patterns-toolbar': 'toolbar'
}
});
26 changes: 26 additions & 0 deletions mockup/patterns/toolbar/jspak.js

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions mockup/patterns/toolbar/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "jspak",
"version": "0.1.0",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-jshint": "~0.1.1",
"grunt-contrib-nodeunit": "~0.1.2",
"grunt-requirejs": "~0.4.2",
"grunt-bower-requirejs": "~0.4.2",
"buster-amd": "",
"grunt-bower-busterjs": "~0.1.1",
"bower": "~0.9.2",
"grunt-buster": "~0.1.2"
}
}
19 changes: 19 additions & 0 deletions mockup/patterns/toolbar/plone-toolbarlogo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 7903355

Please sign in to comment.