Skip to content

Commit f49cd70

Browse files
committed
Merge branch 'master' of https://github.com/processing/p5.js
* 'master' of https://github.com/processing/p5.js: fix #1430 detail warning fix illegal trailing whitespace Improve example for p5.prototype.focused Fix missing entry in documentation Fix ellipsoid crashing Fix #1438: negative rect arguments in CORNERS mode fixes #253 Using constants for vertical alignment checks Code style fix: double quotes to single quotes Update leading vertical offset to match processing Add manual test for leading with system fonts Moved Underscore and Backbone out of reference.js Minified data.json and use minified versions of libs
2 parents 2265031 + 4cce4e6 commit f49cd70

File tree

26 files changed

+195
-98
lines changed

26 files changed

+195
-98
lines changed

Gruntfile.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,13 @@ module.exports = function(grunt) {
332332
tags: ['master']
333333
}
334334
}
335+
},
336+
minjson: {
337+
compile: {
338+
files: {
339+
'./docs/reference/data.min.json': './docs/reference/data.json'
340+
}
341+
}
335342
}
336343
});
337344

@@ -352,15 +359,15 @@ module.exports = function(grunt) {
352359
grunt.loadNpmTasks('grunt-release-it');
353360
grunt.loadNpmTasks('grunt-saucelabs');
354361
grunt.loadNpmTasks('grunt-mocha-test');
362+
grunt.loadNpmTasks('grunt-minjson');
355363

356364
// Create the multitasks.
357365
// TODO: "requirejs" is in here to run the "yuidoc_themes" subtask. Is this needed?
358366
grunt.registerTask('build', ['browserify', 'uglify', 'requirejs']);
359367
grunt.registerTask('test', ['jshint', 'jscs', 'build', 'yuidoc:dev', 'connect', 'mocha', 'mochaTest']);
360368
grunt.registerTask('test:nobuild', ['jshint:test', 'jscs:test', 'connect', 'mocha']);
361-
grunt.registerTask('yui', ['yuidoc:prod']);
362-
grunt.registerTask('yui:dev', ['yuidoc:dev']);
363-
grunt.registerTask('yui', ['yuidoc:prod']);
369+
grunt.registerTask('yui', ['yuidoc:prod', 'minjson']);
370+
grunt.registerTask('yui:dev', ['yuidoc:dev', 'minjson']);
364371
grunt.registerTask('yui:test', ['yuidoc:dev', 'connect', 'mocha:yui']);
365372
grunt.registerTask('default', ['test']);
366373
grunt.registerTask('saucetest', ['connect', 'saucelabs-mocha']);

docs/yuidoc-p5-theme-src/scripts/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ var require = {
2828
'menuView': 'views/menuView',
2929
'libraryView': 'views/libraryView'
3030
}
31-
};
31+
};

docs/yuidoc-p5-theme-src/scripts/main.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,18 @@ define('App', function() {
88

99
/**
1010
* Load json API data and start the router.
11-
* @param {module} _
12-
* @param {module} Backbone
1311
* @param {module} App
1412
* @param {module} router
1513
*/
1614
require([
17-
'underscore',
18-
'backbone',
1915
'App',
20-
'./documented-method'], function(_, Backbone, App, DocumentedMethod) {
21-
16+
'./documented-method'], function(App, DocumentedMethod) {
17+
2218
// Set collections
2319
App.collections = ['allItems', 'classes', 'events', 'methods', 'properties', 'p5.sound', 'p5.dom'];
2420

2521
// Get json API data
26-
$.getJSON("data.json", function(data) {
22+
$.getJSON('data.min.json', function(data) {
2723
App.data = data;
2824
App.classes = [];
2925
App.methods = [];
@@ -74,7 +70,7 @@ require([
7470
} else if (el.itemtype === "event") {
7571
App.events.push(el);
7672
App.allItems.push(el);
77-
}
73+
}
7874

7975
// libraries
8076
if (el.module === "p5.sound") {
@@ -88,11 +84,11 @@ require([
8884
}
8985
}
9086
});
91-
87+
9288
_.each(App.classes, function(c, idx) {
9389
c.items = _.filter(App.allItems, function(it){ return it.class === c.name; });
9490
});
9591

9692
require(['router']);
9793
});
98-
});
94+
});

docs/yuidoc-p5-theme-src/scripts/router.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
define([
2-
'underscore',
3-
'backbone',
42
'App'
5-
], function(_, Backbone, App) {
3+
], function(App) {
64

75
'use strict'; //
86

docs/yuidoc-p5-theme-src/scripts/views/itemView.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
define([
2-
'underscore',
3-
'backbone',
42
'App',
53
// Templates
64
'text!tpl/item.html',
75
'text!tpl/class.html',
86
'text!tpl/itemEnd.html',
97
// Tools
108
'prettify'
11-
], function (_, Backbone, App, itemTpl, classTpl, endTpl) {
9+
], function (App, itemTpl, classTpl, endTpl) {
1210

1311
'use strict';
1412

@@ -34,7 +32,7 @@ define([
3432
if (isMethod || isConstructor) {
3533
syntax += '(';
3634
if (cleanItem.params) {
37-
for (var i=0; i<cleanItem.params.length; i++) {
35+
for (var i=0; i<cleanItem.params.length; i++) {
3836
var p = cleanItem.params[i];
3937
if (p.optional) syntax += '[';
4038
syntax += p.name;
@@ -172,4 +170,4 @@ define([
172170

173171
return itemView;
174172

175-
});
173+
});

docs/yuidoc-p5-theme-src/scripts/views/libraryView.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
define([
2-
'underscore',
3-
'backbone',
42
'App',
53
// Templates
64
'text!tpl/library.html'
7-
], function (_, Backbone, App, libraryTpl) {
5+
], function (App, libraryTpl) {
86

97
var libraryView = Backbone.View.extend({
108
el: '#list',
@@ -108,4 +106,4 @@ define([
108106

109107
return libraryView;
110108

111-
});
109+
});

docs/yuidoc-p5-theme-src/scripts/views/listView.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
define([
2-
'underscore',
3-
'backbone',
42
'App',
53
// Templates
64
'text!tpl/list.html'
7-
], function (_, Backbone, App, listTpl) {
5+
], function (App, listTpl) {
86
var striptags = function(html) {
97
var div = document.createElement('div');
108
div.innerHTML = html;

docs/yuidoc-p5-theme-src/scripts/views/menuView.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
define([
2-
'underscore',
3-
'backbone',
42
'App',
53
'text!tpl/menu.html'
6-
], function(_, Backbone, App, menuTpl) {
4+
], function(App, menuTpl) {
75

86
var menuView = Backbone.View.extend({
97
el: '#collection-list-nav',
@@ -20,7 +18,7 @@ define([
2018
* @returns {object} This view.
2119
*/
2220
render: function() {
23-
21+
2422
var groups = [];
2523
_.each(App.modules, function (item, i) {
2624
if (!item.is_submodule) {
@@ -64,4 +62,4 @@ define([
6462

6563
return menuView;
6664

67-
});
65+
});

docs/yuidoc-p5-theme-src/scripts/views/pageView.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
define([
2-
'underscore',
3-
'backbone',
42
'App',
5-
3+
64
// Views
75
'searchView',
86
'listView',
97
'itemView',
108
'menuView',
119
'libraryView'
12-
], function(_, Backbone, App, searchView, listView, itemView, menuView, libraryView) {
10+
], function(App, searchView, listView, itemView, menuView, libraryView) {
1311

1412
var pageView = Backbone.View.extend({
1513
el: 'body',
@@ -26,37 +24,37 @@ define([
2624
* Render.
2725
*/
2826
render: function() {
29-
27+
3028
// Menu view
3129
if (!App.menuView) {
3230
App.menuView = new menuView();
3331
App.menuView.init().render();
3432
}
35-
33+
3634
// Item view
3735
if (!App.itemView) {
3836
App.itemView = new itemView();
3937
App.itemView.init().render();
4038
// Add the item view to the views array
4139
App.contentViews.push(App.itemView);
4240
}
43-
41+
4442
// List view
4543
if (!App.listView) {
4644
App.listView = new listView();
4745
App.listView.init().render();
4846
// Add the list view to the views array
4947
App.contentViews.push(App.listView);
5048
}
51-
49+
5250
// Libary view
5351
if (!App.libraryView) {
5452
App.libraryView = new libraryView();
5553
App.libraryView.init().render();
5654
// Add the list view to the views array
5755
App.contentViews.push(App.libraryView);
5856
}
59-
57+
6058
// Search
6159
if (!App.searchView) {
6260
App.searchView = new searchView();
@@ -72,11 +70,11 @@ define([
7270
_.each(App.contentViews, function(view, i) {
7371
view.$el.hide();
7472
});
75-
73+
7674
return this;
7775
}
7876
});
7977

8078
return pageView;
8179

82-
});
80+
});

docs/yuidoc-p5-theme-src/scripts/views/searchView.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
define([
2-
'underscore',
3-
'backbone',
42
'App',
53
// Templates
64
'text!tpl/search.html',
75
'text!tpl/search_suggestion.html',
86
// Tools
97
'typeahead'
10-
], function(_, Backbone, App, searchTpl, suggestionTpl) {
8+
], function(App, searchTpl, suggestionTpl) {
119

1210
var searchView = Backbone.View.extend({
1311
el: '#search',
@@ -32,7 +30,7 @@ define([
3230
render: function() {
3331
// Append the view to the dom
3432
this.$el.append(this.searchHtml);
35-
33+
3634
// Render Typeahead
3735
var $searchInput = this.$el.find('input[type=text]');
3836
this.typeaheadRender($searchInput);
@@ -71,7 +69,7 @@ define([
7169
var txt = $input.val();
7270
var f = _.find(self.items, function(it) { return it.name == txt; });
7371
if (f) {
74-
select(f);
72+
select(f);
7573
}
7674
} else if (e.which === 27) {
7775
$input.blur();

0 commit comments

Comments
 (0)