Skip to content

Commit dcc64c8

Browse files
authored
Merge branch 'master' into master
2 parents ca54608 + 3a07431 commit dcc64c8

File tree

79 files changed

+509
-360
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+509
-360
lines changed

Gruntfile.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ module.exports = function(grunt) {
8383
options: {
8484
expand: true,
8585
flatten: true,
86-
helpers: ['<%= config.src %>/assets/js/translation.js'],
8786
assets: '<%= config.dist %>/assets',
87+
helpers: ['<%= config.src %>/assets/js/translation.js', '<%= config.src %>/assets/js/cache-busting.js'],
8888
layout: '<%= config.src %>/templates/layouts/default.hbs',
8989
data: [
9090
'<%= config.src %>/data/**/*.{json,yml}',
@@ -408,10 +408,11 @@ module.exports = function(grunt) {
408408
'update-version',
409409
'exec',
410410
'clean',
411+
'requirejs:yuidoc_theme',
411412
'requirejs',
412413
'copy',
413-
'assemble',
414414
'optimize',
415+
'assemble',
415416
'file_append',
416417
'compress',
417418
'i18n',

i18n-tracking.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ es:
44
line 721: ' project-a-1-4-phuong'
55
line 727: ' project-a-2-5-phuong'
66
line 730: ' project-a-2-7-phuong'
7+
line 480: ' notes3'
78
line 44: ' description-roni'
89
line 45: ' project-phuong'
910
line 17: Showcase
@@ -174,8 +175,6 @@ es:
174175
line 551: ' credit-moon-xin'
175176
line 552: ' description-moon-xin'
176177
line 669: ' credit-moon-xin'
177-
line 670: ''
178-
line 671: ''
179178
line 672: ' created-by'
180179
line 673: ' pronouns-female'
181180
line 674: ' creator-from-roni-cantor'
@@ -298,6 +297,14 @@ zh-Hans:
298297
line 721: ' project-a-1-4-phuong'
299298
line 727: ' project-a-2-5-phuong'
300299
line 730: ' project-a-2-7-phuong'
300+
line 481: ' notes1'
301+
line 482: ' notes2'
302+
line 483: ' notes3'
303+
line 484: ' notes4'
304+
line 485: ' notes5'
305+
line 608: ' book-1-authors'
306+
line 617: ' book-2-authors'
307+
line 409: ' p5.bots'
301308
line 44: ' description-roni'
302309
line 45: ' project-phuong'
303310
line 17: Showcase
@@ -395,8 +402,6 @@ zh-Hans:
395402
line 551: ' credit-moon-xin'
396403
line 552: ' description-moon-xin'
397404
line 669: ' credit-moon-xin'
398-
line 670: ''
399-
line 671: ''
400405
line 672: ' created-by'
401406
line 673: ' pronouns-female'
402407
line 674: ' creator-from-roni-cantor'

offline-reference/extra/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@
8686

8787
<script src="./js/p5.min.js"></script>
8888
<script src="./js/p5.sound.min.js"></script>
89-
<script src="./js/p5.dom.min.js"></script>
9089
<script src="./js/render.js"></script>
9190
<!-- prism for code highlighting -->
9291
<script src="./js/vendor/prism.js"></script>

offline-reference/extra/js/reference.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4595,7 +4595,7 @@ define('router',[
45954595
get: function(searchClass, searchItem) {
45964596

45974597
// if looking for a library page, redirect
4598-
if ((searchClass === 'p5.dom' || searchClass === 'p5.sound')
4598+
if (searchClass === 'p5.sound')
45994599
&& !searchItem) {
46004600
window.location.hash = '/libraries/'+searchClass;
46014601
return;
@@ -4743,7 +4743,7 @@ require([
47434743
'./documented-method'], function(App, DocumentedMethod) {
47444744

47454745
// Set collections
4746-
App.collections = ['allItems', 'classes', 'events', 'methods', 'properties', 'p5.sound', 'p5.dom'];
4746+
App.collections = ['allItems', 'classes', 'events', 'methods', 'properties', 'p5.sound'];
47474747

47484748
// Get json API data
47494749
var data = referenceData;
@@ -4767,9 +4767,6 @@ require([
47674767
if (m.name == "p5.sound") {
47684768
App.sound.module = m;
47694769
}
4770-
else if (m.name == "p5.dom") {
4771-
App.dom.module = m;
4772-
}
47734770
});
47744771

47754772

@@ -4803,12 +4800,6 @@ require([
48034800
if (el.module === "p5.sound") {
48044801
App.sound.items.push(el);
48054802
}
4806-
else if (el.module === "p5.dom" || el.module === 'DOM') {
4807-
if (el.class === 'p5.dom') {
4808-
el.class = 'p5';
4809-
}
4810-
App.dom.items.push(el);
4811-
}
48124803
}
48134804
});
48144805

src/assets/css/main.css

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,14 @@ div.reference-subgroup {
441441
margin: 1em 0 0 0;
442442
}
443443

444+
#item ul {
445+
margin-top: 0.5em;
446+
}
447+
448+
#item li {
449+
margin-bottom: 1em;
450+
}
451+
444452
.description {
445453
clear: both;
446454
display: block;
@@ -455,7 +463,8 @@ div.reference-subgroup {
455463

456464
.paramname {
457465
display: inline-block;
458-
width: 8em;
466+
min-width: 25%;
467+
margin-right: 1%;
459468
font-size: 1.2em;
460469
}
461470

@@ -467,7 +476,7 @@ div.reference-subgroup {
467476
.paramtype {
468477
display: inline-block;
469478
font-size: 1.2em;
470-
width: 20em;
479+
width: 73%;
471480
vertical-align: top;
472481
}
473482

@@ -939,6 +948,14 @@ h3 {
939948
margin: 1em 0 0 0;
940949
}
941950

951+
.label .nounderline img {
952+
height: fit-content;
953+
}
954+
955+
#learn-page .info {
956+
display: inline-block;
957+
}
958+
942959
#exampleDisplay,
943960
#exampleFrame,
944961
#exampleEditor {
@@ -2267,6 +2284,9 @@ footer {
22672284
footer {
22682285
font-size: 0.5em;
22692286
}
2287+
.paramtype {
2288+
width: 96%;
2289+
}
22702290
}
22712291

22722292
@media (max-width:400px) {
@@ -2414,15 +2434,15 @@ iframe {
24142434

24152435
#get-started-page #asterisk-design-element,
24162436
#community-page #asterisk-design-element {
2417-
top: -30%;
2418-
right: -40%;
2419-
height: 44em;
2420-
width: 44em;
2421-
-webkit-transform: rotate(9deg);
2422-
-moz-transform: rotate(9deg);
2423-
-ms-transform: rotate(9deg);
2424-
-o-transform: rotate(9deg);
2425-
transform: rotate(9deg);
2437+
top: 10%;
2438+
right: -20%;
2439+
height: 30em;
2440+
width: 30em;
2441+
-webkit-transform: rotate(2deg);
2442+
-moz-transform: rotate(2deg);
2443+
-ms-transform: rotate(2deg);
2444+
-o-transform: rotate(2deg);
2445+
transform: rotate(2deg);
24262446
}
24272447

24282448
#reference-page #asterisk-design-element,
135 KB
Loading
86.6 KB
Loading
54.2 KB
Loading

src/assets/js/cache-busting.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports.register = function(Handlebars, options) {
2+
Handlebars.registerHelper('versionedAsset', function(options) {
3+
// node libraries
4+
const crypto = require('crypto');
5+
const path = require('path');
6+
const fs = require('fs');
7+
const filePath = options.fn(this);
8+
const hash = crypto.createHash('sha256');
9+
// creating full path from the root dir to the file
10+
const fullPath = path.join(__dirname, "../../..", "dist", filePath);
11+
let hashCode = "";
12+
hash.on('readable', () => {
13+
const data = hash.read();
14+
if (data) hashCode = data.toString('hex');
15+
})
16+
hash.write(fs.readFileSync(fullPath, function (err) { if (err) return 0 }).toString());
17+
hash.end();
18+
// creating a version string from first 6 hash characters
19+
hashCode = "/" + filePath + "?v=" + hashCode.substr(0, 6);
20+
return hashCode;
21+
});
22+
};

src/assets/js/render.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,18 @@ var renderCode = function(exampleName) {
152152
edit_area.style.display = 'block';
153153
edit_area.focus();
154154
} else {
155-
$('.example_container').each(function(ind, con) {
156-
$(con).css('opacity', 1.0);
157-
$(con).removeClass('editing');
158-
});
159155
edit_button.innerHTML = 'edit';
160156
edit_area.style.display = 'none';
161157
sketch.textContent = edit_area.value;
158+
$('.example_container').each(function (ind, con) {
159+
$(con).css('opacity', 1.0);
160+
$(con).removeClass('editing');
161+
$this = $(this);
162+
var pre = $this.find('pre')[0];
163+
if (pre) {
164+
$this.height(Math.max($(pre).height(), 100) + 20);
165+
}
166+
});
162167
runCode(sketch, true, i);
163168
}
164169
}

0 commit comments

Comments
 (0)