Changeset 5285
- Timestamp:
- 02/11/2014 04:29:19 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 7 added
- 4 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Gruntfile.js
r5271 r5285 6 6 7 7 BBP_RTL_CSS = [ 8 'admin/css/*-rtl.css', 8 'includes/admin/css/*-rtl.css', 9 'includes/admin/styles/*-rtl.css', 9 10 'templates/default/css/*-rtl.css' 10 11 ], 11 12 12 13 BBP_LTR_CSS = [ 13 'admin/css/*.css', 14 'includes/admin/css/*.css', 15 'includes/admin/styles/*.css', 14 16 'templates/default/css/*.css' 15 17 ], 16 18 17 19 BBP_JS = [ 18 ' admin/js/*.js',20 'includes/admin/js/*.js', 19 21 'templates/default/js/*.js' 20 22 ], … … 83 85 } 84 86 }, 87 sass: { 88 colors: { 89 expand: true, 90 cwd: SOURCE_DIR, 91 dest: BUILD_DIR, 92 ext: '.css', 93 src: ['includes/admin/styles/*/colors.scss'], 94 options: { 95 outputStyle: 'expanded' 96 } 97 } 98 }, 85 99 cssmin: { 86 100 ltr: { … … 99 113 src: BBP_RTL_CSS, 100 114 options: { banner: '/*! https://wordpress.org/plugins/bbpress/ */' } 115 }, 116 colors: { 117 cwd: BUILD_DIR, 118 dest: BUILD_DIR, 119 expand: true, 120 ext: '.min.css', 121 src: [ 122 'includes/admin/styles/*/*.css' 123 ] 101 124 } 102 125 }, … … 109 132 src: BBP_LTR_CSS, 110 133 options: { generateExactDuplicates: true } 134 }, 135 colors: { 136 options: { 137 processContent: function( src ) { 138 return src.replace( /([^/]+)\.css/gi, '$1-rtl.css' ); 139 } 140 }, 141 expand: true, 142 cwd: BUILD_DIR, 143 dest: BUILD_DIR, 144 ext: '-rtl.css', 145 src: [ 146 'includes/admin/styles/*/colors.css' 147 ] 111 148 }, 112 149 dynamic: { … … 203 240 } 204 241 }, 242 colors: { 243 files: [SOURCE_DIR + 'includes/admin/styles/**'], 244 tasks: ['sass:colors'] 245 }, 205 246 rtl: { 206 247 files: BBP_LTR_CSS.map( function( path ) { … … 216 257 }); 217 258 259 // Register tasks. 260 261 // Color schemes task. 262 grunt.registerTask('colors', ['sass:colors']); 218 263 219 264 // Build tasks. 220 grunt.registerTask( 'build', [ 'clean:all', 'copy:files', 'cssjanus:core', 'cssmin:ltr', 'cssmin:rtl', ' uglify:core', 'jsvalidate:build' ] );221 grunt.registerTask( 'build-release', [ 'clean:all', 'copy:files', 'cssjanus:core', 'cssmin:ltr', 'cssmin:rtl', ' uglify:core', 'jsvalidate:build', 'phpunit:all' ] );265 grunt.registerTask( 'build', [ 'clean:all', 'copy:files', 'cssjanus:core', 'cssmin:ltr', 'cssmin:rtl', 'colors', 'cssjanus:colors', 'cssmin:colors','uglify:core', 'jsvalidate:build' ] ); 266 grunt.registerTask( 'build-release', [ 'clean:all', 'copy:files', 'cssjanus:core', 'cssmin:ltr', 'cssmin:rtl', 'colors', 'cssjanus:colors', 'cssmin:colors','uglify:core', 'jsvalidate:build', 'phpunit:all' ] ); 222 267 223 268 // Testing tasks. … … 235 280 grunt.registerTask( 'default', [ 'build' ] ); 236 281 237 238 282 // Add a listener to the watch task. 239 283 // -
trunk/package.json
r5271 r5285 14 14 "grunt-contrib-jshint": "~0.8.0", 15 15 "grunt-cssjanus": "~0.2.2", 16 "grunt-sass": "~0.10.0", 16 17 "grunt-phpunit": "~0.3.2", 17 18 "grunt-jsvalidate": "~0.2.2", -
trunk/src/includes/admin/admin.php
r5268 r5285 547 547 */ 548 548 public function enqueue_scripts() { 549 550 // Enqueue suggest for forum/topic/reply autocmopletes 549 551 wp_enqueue_script( 'suggest' ); 550 552 553 // Minified 554 $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 555 551 556 // Get the version to use for JS 552 557 $version = bbp_get_version(); … … 559 564 560 565 // Enqueue the common JS 561 wp_enqueue_script( 'bbp-admin-common-js', $this->js_url . 'common .js', array( 'jquery' ), $version );566 wp_enqueue_script( 'bbp-admin-common-js', $this->js_url . 'common' . $suffix . '.js', array( 'jquery' ), $version ); 562 567 563 568 // Topics admin 564 569 if ( bbp_get_topic_post_type() === get_current_screen()->post_type ) { 565 wp_enqueue_script( 'bbp-admin-common-js', $this->js_url . 'topics .js', array( 'jquery' ), $version );570 wp_enqueue_script( 'bbp-admin-common-js', $this->js_url . 'topics' . $suffix . '.js', array( 'jquery' ), $version ); 566 571 567 572 // Replies admin 568 573 } elseif ( bbp_get_reply_post_type() === get_current_screen()->post_type ) { 569 wp_enqueue_script( 'bbp-admin-common-js', $this->js_url . 'replies .js', array( 'jquery' ), $version );574 wp_enqueue_script( 'bbp-admin-common-js', $this->js_url . 'replies' . $suffix . '.js', array( 'jquery' ), $version ); 570 575 } 571 576 … … 614 619 615 620 // RTL and/or minified 616 $suffix = is_rtl() ? '-rtl' : '';617 //$suffix .= defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';621 $suffix = is_rtl() ? '-rtl' : ''; 622 $suffix .= defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 618 623 619 624 // Mint 620 625 wp_admin_css_color( 621 626 'bbp-mint', 622 esc_html_x( 'Mint', 623 $this->styles_url . 'mint ' . $suffix . '.css',627 esc_html_x( 'Mint', 'admin color scheme', 'bbpress' ), 628 $this->styles_url . 'mint/colors' . $suffix . '.css', 624 629 array( '#4f6d59', '#33834e', '#5FB37C', '#81c498' ), 625 630 array( 'base' => '#f1f3f2', 'focus' => '#fff', 'current' => '#fff' ) … … 630 635 'bbp-evergreen', 631 636 esc_html_x( 'Evergreen', 'admin color scheme', 'bbpress' ), 632 $this->styles_url . 'evergreen ' . $suffix . '.css',637 $this->styles_url . 'evergreen/colors' . $suffix . '.css', 633 638 array( '#324d3a', '#446950', '#56b274', '#324d3a' ), 634 639 array( 'base' => '#f1f3f2', 'focus' => '#fff', 'current' => '#fff' ) -
trunk/src/templates/default/bbpress-functions.php
r5183 r5285 169 169 $scripts = array(); 170 170 171 // Minified 172 $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 173 171 174 // Always pull in jQuery for TinyMCE shortcode usage 172 175 if ( bbp_use_wp_editor() ) { 173 176 $scripts['bbpress-editor'] = array( 174 'file' => 'js/editor .js',177 'file' => 'js/editor' . $suffix . '.js', 175 178 'dependencies' => array( 'jquery' ) 176 179 ); … … 180 183 if ( bbp_is_single_forum() ) { 181 184 $scripts['bbpress-forum'] = array( 182 'file' => 'js/forum .js',185 'file' => 'js/forum' . $suffix . '.js', 183 186 'dependencies' => array( 'jquery' ) 184 187 ); … … 190 193 // Topic favorite/unsubscribe 191 194 $scripts['bbpress-topic'] = array( 192 'file' => 'js/topic .js',195 'file' => 'js/topic' . $suffix . '.js', 193 196 'dependencies' => array( 'jquery' ) 194 197 ); … … 197 200 if ( bbp_thread_replies() ) { 198 201 $scripts['bbpress-reply'] = array( 199 'file' => 'js/reply .js',202 'file' => 'js/reply' . $suffix . '.js', 200 203 'dependencies' => array( 'jquery' ) 201 204 ); … … 206 209 if ( bbp_is_single_user_edit() ) { 207 210 $scripts['bbpress-user'] = array( 208 'file' => 'js/user .js',211 'file' => 'js/user' . $suffix . '.js', 209 212 'dependencies' => array( 'user-query' ) 210 213 );
Note: See TracChangeset
for help on using the changeset viewer.