File tree Expand file tree Collapse file tree 10 files changed +491
-15
lines changed Expand file tree Collapse file tree 10 files changed +491
-15
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ module.exports = grunt => {
150150 source : {
151151 options : {
152152 parserOptions : {
153- ecmaVersion : 5
153+ ecmaVersion : 8
154154 }
155155 } ,
156156 src : [ 'src/**/*.js' ]
@@ -163,7 +163,7 @@ module.exports = grunt => {
163163 'eslint-samples' : {
164164 options : {
165165 parserOptions : {
166- ecmaVersion : 6
166+ ecmaVersion : 8
167167 } ,
168168 format : 'unix'
169169 } ,
@@ -259,6 +259,16 @@ module.exports = grunt => {
259259 }
260260 }
261261 } ,
262+ babel : {
263+ options : {
264+ presets : [ '@babel/preset-env' ]
265+ } ,
266+ dist : {
267+ files : {
268+ 'lib/p5.pre-min.js' : 'lib/p5.js'
269+ }
270+ }
271+ } ,
262272
263273 // This minifies the javascript into a single file and adds a banner to the
264274 // front of the file.
@@ -274,8 +284,8 @@ module.exports = grunt => {
274284 } ,
275285 dist : {
276286 files : {
277- 'lib/p5.min.js' : 'lib/p5.pre-min.js' ,
278- 'lib/modules/p5Custom.min.js' : 'lib/modules/p5Custom.pre-min.js'
287+ 'lib/p5.min.js' : [ 'lib/p5.pre-min.js' ] ,
288+ 'lib/modules/p5Custom.min.js' : [ 'lib/modules/p5Custom.pre-min.js' ]
279289 }
280290 }
281291 } ,
@@ -523,10 +533,14 @@ module.exports = grunt => {
523533 grunt . loadNpmTasks ( 'grunt-contrib-clean' ) ;
524534 grunt . loadNpmTasks ( 'grunt-simple-nyc' ) ;
525535
536+ //this library converts the ES6 JS to ES5 so it can be properly minified
537+ grunt . loadNpmTasks ( 'grunt-babel' ) ;
538+
526539 // Create the multitasks.
527540 grunt . registerTask ( 'build' , [
528541 'browserify' ,
529542 'browserify:min' ,
543+ 'babel' ,
530544 'uglify' ,
531545 'browserify:test'
532546 ] ) ;
Original file line number Diff line number Diff line change 1+ * .html
2+ * .js
Original file line number Diff line number Diff line change 99 body {
1010 padding : 0 ;
1111 margin : 0 ;
12+ background-color : # 1b1b1b ;
1213 }
1314 </ style >
14- < script src ="../p5.js "> </ script >
15+ < script src ="../p5.min. js "> </ script >
1516 <!-- <script src="../addons/p5.sound.js"></script> -->
1617 < script src ="sketch.js "> </ script >
1718</ head >
Original file line number Diff line number Diff line change @@ -4,4 +4,4 @@ function setup() {
44
55function draw ( ) {
66 // put drawing code here
7- }
7+ }
Original file line number Diff line number Diff line change 6767 "grunt-mocha-test" : " ^0.13.3" ,
6868 "grunt-newer" : " ^1.1.0" ,
6969 "grunt-simple-nyc" : " ^3.0.1" ,
70+ "grunt-babel" : " ^8.0.0" ,
7071 "html-entities" : " ^1.3.1" ,
7172 "husky" : " ^4.2.3" ,
7273 "i18next" : " ^19.0.2" ,
8586 "regenerator-runtime" : " ^0.13.3" ,
8687 "request" : " ^2.88.0" ,
8788 "simple-git" : " ^3.3.0" ,
88- "whatwg-fetch" : " ^2.0.4"
89+ "whatwg-fetch" : " ^2.0.4" ,
90+ "gifenc" : " ^1.0.3"
8991 },
9092 "license" : " LGPL-2.1" ,
9193 "main" : " ./lib/p5.min.js" ,
154156 " not dead"
155157 ],
156158 "author" : " " ,
157- "dependencies" : {},
158159 "husky" : {
159160 "hooks" : {
160161 "pre-commit" : " lint-staged"
Original file line number Diff line number Diff line change @@ -184,7 +184,10 @@ p5.prototype.saveCanvas = function() {
184184 } , mimeType ) ;
185185} ;
186186
187- p5 . prototype . saveGif = function ( pImg , filename ) {
187+ // this is the old saveGif, left here for compatibility purposes
188+ // the only place I found it being used was on image/p5.Image.js, on the
189+ // save function. that has been changed to use this function.
190+ p5 . prototype . encodeAndDownloadGif = function ( pImg , filename ) {
188191 const props = pImg . gifProperties ;
189192
190193 //convert loopLimit back into Netscape Block formatting
You can’t perform that action at this time.
0 commit comments