Ticket #31823: 31823.3.diff
File 31823.3.diff, 6.2 KB (added by , 7 years ago) |
---|
-
Gruntfile.js
1 /* jshint node:true */1 /* global module, require, __dirname */ 2 2 module.exports = function(grunt) { 3 3 var path = require('path'), 4 4 fs = require( 'fs' ), … … 130 130 version = version.replace( /-[\d]{5}$/, '-' + grunt.template.today( 'yyyymmdd.HHMMss' ) ); 131 131 132 132 /* jshint quotmark: true */ 133 return "$wp_version = '" + version + "';";133 return '$wp_version = \'' + version + '\';'; 134 134 }); 135 135 } 136 136 }, … … 292 292 src: [] 293 293 } 294 294 }, 295 eslint: { 296 grunt: { 297 options: { 298 configFile: 'node_modules/eslint-config-wordpress/index.js' 299 }, 300 src: ['Gruntfile.js'] 301 }, 302 jshint: { 303 options: { 304 configFile: 'node_modules/eslint-config-wordpress/index.js' 305 }, 306 cwd: SOURCE_DIR, 307 src: [ 308 'wp-admin/js/*.js', 309 'wp-includes/js/*.js', 310 // Built scripts. 311 '!wp-includes/js/media-*', 312 // WordPress scripts inside directories 313 'wp-includes/js/jquery/jquery.table-hotkeys.js', 314 'wp-includes/js/mediaelement/wp-mediaelement.js', 315 'wp-includes/js/mediaelement/wp-playlist.js', 316 'wp-includes/js/plupload/handlers.js', 317 'wp-includes/js/plupload/wp-plupload.js', 318 'wp-includes/js/tinymce/plugins/wordpress/plugin.js', 319 'wp-includes/js/tinymce/plugins/wp*/plugin.js', 320 // Third party scripts 321 '!wp-admin/js/farbtastic.js', 322 '!wp-includes/js/backbone*.js', 323 '!wp-includes/js/swfobject.js', 324 '!wp-includes/js/underscore*.js', 325 '!wp-includes/js/colorpicker.js', 326 '!wp-includes/js/hoverIntent.js', 327 '!wp-includes/js/json2.js', 328 '!wp-includes/js/tw-sack.js', 329 '!wp-includes/js/twemoji.js', 330 '!**/*.min.js' 331 ] 332 }, 333 themes: { 334 options: { 335 configFile: 'node_modules/eslint-config-wordpress/index.js' 336 }, 337 expand: true, 338 cwd: SOURCE_DIR + 'wp-content/themes', 339 src: [ 340 'twenty*/**/*.js', 341 '!twenty{eleven,twelve,thirteen}/**', 342 // Third party scripts 343 '!twenty{fourteen,fifteen,sixteen,seventeen}/**/html5.js', 344 '!twentyseventeen/assets/js/jquery.scrollTo.js' 345 ] 346 } 347 }, 295 348 jshint: { 296 349 options: grunt.file.readJSON('.jshintrc'), 297 350 grunt: { … … 736 789 737 790 if ( set.length ) { 738 791 fs.stat( dir = set.shift(), function( error ) { 739 error ? find( set ) : run( path.basename( dir ).substr( 1 ) ); 792 if ( error ) { 793 find( set ) 794 } else { 795 run( path.basename( dir ).substr( 1 ) ); 796 } 740 797 } ); 741 798 } else { 742 799 grunt.fatal( 'This WordPress install is not under version control.' ); -
package.json
13 13 "license": "GPL-2.0+", 14 14 "devDependencies": { 15 15 "autoprefixer": "^6.5.1", 16 "eslint": "~3.19.0", 17 "eslint-config-wordpress": "~2.0.0", 16 18 "grunt": "~0.4.5", 17 19 "grunt-browserify": "~5.0.0", 18 20 "grunt-contrib-clean": "~1.0.0", … … 25 27 "grunt-contrib-qunit": "^1.2.0", 26 28 "grunt-contrib-uglify": "~2.0.0", 27 29 "grunt-contrib-watch": "~1.0.0", 30 "grunt-eslint": "~19.0.0", 28 31 "grunt-includes": "~0.5.1", 29 32 "grunt-jsvalidate": "~0.2.2", 30 33 "grunt-legacy-util": "^0.2.0", -
src/wp-content/themes/twentyfourteen/js/slider.js
20 20 // Make variables public. 21 21 slider.vars = $.extend( {}, $.featuredslider.defaults, options ); 22 22 23 namespace = slider.vars.namespace ,23 namespace = slider.vars.namespace; 24 24 25 25 // Store a reference to the slider object. 26 26 $.data( el, 'featuredslider', slider ); … … 105 105 var type = 'control-paging', 106 106 j = 1, 107 107 item, 108 slide,109 108 i; 110 109 111 110 slider.controlNavScaffold = $( '<ol class="' + namespace + 'control-nav ' + namespace + type + '"></ol>' ); 112 111 113 112 if ( slider.pagingCount > 1 ) { 114 113 for ( i = 0; i < slider.pagingCount; i++ ) { 115 slide = slider.slides.eq( i );116 114 item = '<a>' + j + '</a>'; 117 115 slider.controlNavScaffold.append( '<li>' + item + '</li>' ); 118 116 j++; … … 120 118 } 121 119 122 120 // CONTROLSCONTAINER 123 ( slider.controlsContainer ) ? $( slider.controlsContainer ).append( slider.controlNavScaffold ) : slider.append( slider.controlNavScaffold ); 121 if ( slider.controlsContainer ) { 122 $( slider.controlsContainer ).append( slider.controlNavScaffold ); 123 } else { 124 slider.append( slider.controlNavScaffold ); 125 } 124 126 methods.controlNav.set(); 125 127 126 128 methods.controlNav.active(); … … 162 164 slider.controlNav.eq( pos ).closest( 'li' ).remove(); 163 165 } 164 166 methods.controlNav.set(); 165 ( slider.pagingCount > 1 && slider.pagingCount !== slider.controlNav.length ) ? slider.update( pos, action ) : methods.controlNav.active(); 167 if ( slider.pagingCount > 1 && slider.pagingCount !== slider.controlNav.length ) { 168 slider.update( pos, action ); 169 } else { 170 methods.controlNav.active(); 171 } 166 172 } 167 173 }, 168 174 … … 315 321 return; 316 322 } 317 323 318 transX = -e.translationX ,324 transX = -e.translationX; 319 325 transY = -e.translationY; 320 326 321 327 // Accumulate translations. … … 349 355 } 350 356 351 357 if ( slider.animatingTo === slider.currentSlide && ! scrolling && dx !== null ) { 352 updateDx = dx ,358 updateDx = dx; 353 359 target = ( updateDx > 0 ) ? slider.getTarget( 'next' ) : slider.getTarget( 'prev' ); 354 360 355 361 slider.featureAnimate( target ); … … 376 382 377 383 smoothHeight: function( dur ) { 378 384 var $obj = slider.viewport; 379 ( dur ) ? $obj.animate( { 'height': slider.slides.eq( slider.animatingTo ).height() }, dur ) : $obj.height( slider.slides.eq( slider.animatingTo ).height() ); 385 if ( dur ) { 386 $obj.animate( { 'height': slider.slides.eq( slider.animatingTo ).height() }, dur ); 387 } else { 388 $obj.height( slider.slides.eq( slider.animatingTo ).height() ); 389 } 380 390 }, 381 391 382 392 setToClearWatchedEvent: function() {