Ticket #31332: 31332.diff
File 31332.diff, 11.5 KB (added by , 10 years ago) |
---|
-
Gruntfile.js
6 6 7 7 // Load tasks. 8 8 require('matchdep').filterDev(['grunt-*', '!grunt-legacy-util']).forEach( grunt.loadNpmTasks ); 9 grunt.loadTasks( 'tools/grunt' ); 9 10 // Load legacy utils 10 11 grunt.util = require('grunt-legacy-util'); 11 12 … … 172 173 ] 173 174 } 174 175 }, 175 cssjanus: { 176 core: { 177 options: { 176 rtlcss: { 177 options: { 178 // rtlcss options 179 config: { 180 swapLeftRightInUrl: false, 178 181 swapLtrRtlInUrl: false, 179 processContent: function( src ) { 180 return src.replace( /url\((.+?)\.css\)/g, 'url($1-rtl.css)' ); 181 } 182 autoRename: false, 183 preserveDirectives: true, 184 stringMap: [ 185 { 186 name: 'import-rtl-stylesheet', 187 search: [ '.css' ], 188 replace: [ '-rtl.css' ], 189 options: { 190 scope: 'url', 191 ignoreCase: false 192 } 193 } 194 ] 182 195 }, 196 saveUnmodified: false 197 }, 198 core: { 183 199 expand: true, 184 200 cwd: SOURCE_DIR, 185 201 dest: BUILD_DIR, … … 190 206 ] 191 207 }, 192 208 colors: { 193 options: {194 processContent: function( src ) {195 return src.replace( /([^/]+)\.css/gi, '$1-rtl.css' );196 }197 },198 209 expand: true, 199 210 cwd: BUILD_DIR, 200 211 dest: BUILD_DIR, … … 214 225 jshint: { 215 226 options: grunt.file.readJSON('.jshintrc'), 216 227 grunt: { 217 src: ['Gruntfile.js'] 228 options: { 229 'node': true 230 }, 231 src: [ 232 'Gruntfile.js', 233 'tools/grunt/*' 234 ] 218 235 }, 219 236 tests: { 220 237 src: [ … … 493 510 SOURCE_DIR + 'wp-admin/css/*.css', 494 511 SOURCE_DIR + 'wp-includes/css/*.css' 495 512 ], 496 tasks: [' cssjanus:dynamic'],513 tasks: ['rtlcss:dynamic'], 497 514 options: { 498 515 spawn: false, 499 516 interval: 2000 … … 512 529 // Register tasks. 513 530 514 531 // RTL task. 515 grunt.registerTask('rtl', [' cssjanus:core', 'cssjanus:colors']);532 grunt.registerTask('rtl', ['rtlcss:core', 'rtlcss:colors']); 516 533 517 534 // Color schemes task. 518 535 grunt.registerTask('colors', ['sass:colors', 'autoprefixer:colors']); … … 566 583 // 567 584 // On `watch:all`, automatically updates the `copy:dynamic` and `clean:dynamic` 568 585 // configurations so that only the changed files are updated. 569 // On `watch:rtl`, automatically updates the ` cssjanus:dynamic` configuration.586 // On `watch:rtl`, automatically updates the `rtlcss:dynamic` configuration. 570 587 grunt.event.on('watch', function( action, filepath, target ) { 571 588 if ( target !== 'all' && target !== 'rtl' ) { 572 589 return; … … 578 595 579 596 grunt.config(['clean', 'dynamic', 'src'], cleanSrc); 580 597 grunt.config(['copy', 'dynamic', 'src'], copySrc); 581 grunt.config([' cssjanus', 'dynamic', 'src'], copySrc);598 grunt.config(['rtlcss', 'dynamic', 'src'], copySrc); 582 599 }); 583 600 }; -
package.json
22 22 "grunt-contrib-qunit": "~0.5.2", 23 23 "grunt-contrib-uglify": "~0.6.0", 24 24 "grunt-contrib-watch": "~0.6.1", 25 "grunt-cssjanus": "~0.2.4",26 25 "grunt-jsvalidate": "~0.2.2", 27 26 "grunt-legacy-util": "^0.2.0", 28 27 "grunt-patch-wordpress": "~0.2.1", 28 "grunt-rtlcss": "~1.5.1", 29 29 "grunt-sass": "~0.16.0", 30 30 "matchdep": "~0.3.0" 31 31 } -
src/wp-admin/css/about.css
263 263 opacity: 0; 264 264 } 265 265 266 /* rtl:ignore */ 266 267 .about-wrap .dfw-container .overlay-image.from-left { 267 268 -webkit-transform: translate3d(-100%, 0, 0); 268 269 transform: translate3d(-100%, 0, 0); … … 296 297 .about-wrap .feature-list svg { 297 298 float: left; 298 299 clear: left; 299 margin: 15px 15px 0 0 300 margin: 15px 15px 0 0; 300 301 height: 90px; 301 302 width: 90px; 302 303 background-color: #cccccc; -
src/wp-admin/css/admin-menu.css
595 595 -moz-osx-font-smoothing: grayscale; 596 596 } 597 597 598 /* rtl:ignore */ 598 599 .folded #collapse-button div:after, 599 600 .rtl #collapse-button div:after { 600 601 -webkit-transform: rotate(180deg); … … 726 727 background: none; 727 728 } 728 729 730 /* rtl:ignore */ 729 731 .auto-fold #collapse-button div:after { 730 732 -webkit-transform: rotate(180deg); 731 733 -ms-transform: rotate(180deg); -
src/wp-admin/css/common.css
390 390 margin: 0 0 0.5em; 391 391 } 392 392 393 /* @noflip*/393 /* rtl:ignore */ 394 394 .ltr { 395 395 direction: ltr; 396 396 } 397 397 398 /* @noflip*/398 /* rtl:ignore */ 399 399 .code, 400 400 code { 401 401 font-family: Consolas, Monaco, monospace; … … 2427 2427 background: #f3f3f3; 2428 2428 } 2429 2429 2430 /* @noflip*/2430 /* rtl:ignore */ 2431 2431 #plugin-information .section { 2432 2432 direction: ltr; 2433 2433 } 2434 2434 2435 /* @noflip*/2435 /* rtl:ignore */ 2436 2436 #plugin-information .section ul, 2437 2437 #plugin-information .section ol { 2438 2438 list-style-type: disc; … … 2460 2460 box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.3 ); 2461 2461 } 2462 2462 2463 /* @noflip*/2463 /* rtl:ignore */ 2464 2464 #plugin-information #section-screenshots li p { 2465 2465 font-style: italic; 2466 2466 padding-left: 20px; … … 2472 2472 border: 1px solid #ccc; 2473 2473 } 2474 2474 2475 /* @noflip*/2475 /* rtl:ignore */ 2476 2476 #plugin-information .review { 2477 2477 overflow: hidden; /* clearfix */ 2478 2478 width: 100%; … … 2484 2484 overflow: hidden; /* clearfix */ 2485 2485 } 2486 2486 2487 /* @noflip*/2487 /* rtl:ignore */ 2488 2488 #plugin-information .review-title-section h4 { 2489 2489 display: inline-block; 2490 2490 float: left; … … 2497 2497 padding-top: 2px; 2498 2498 } 2499 2499 2500 /* @noflip*/2500 /* rtl:ignore */ 2501 2501 #plugin-information .reviewer-info .avatar { 2502 2502 float: left; 2503 2503 margin: 4px 6px 0 0; 2504 2504 } 2505 2505 2506 /* @noflip*/2506 /* rtl:ignore */ 2507 2507 #plugin-information .reviewer-info .star-rating { 2508 2508 float: left; 2509 2509 } 2510 2510 2511 /* @noflip*/2511 /* rtl:ignore */ 2512 2512 #plugin-information .review-meta { 2513 2513 float: left; 2514 2514 margin-left: 0.75em; 2515 2515 } 2516 2516 2517 /* @noflip*/2517 /* rtl:ignore */ 2518 2518 #plugin-information .review-body { 2519 2519 float: left; 2520 2520 width: 100%; … … 2763 2763 outline: none; 2764 2764 } 2765 2765 2766 /* @noflip*/2766 /* rtl:ignore */ 2767 2767 #template textarea, 2768 2768 #docs-list { 2769 2769 direction: ltr; -
src/wp-admin/css/edit.css
1310 1310 transition-timing-function: ease-in-out; 1311 1311 } 1312 1312 1313 /* @noflip */1314 1313 .focus-on #adminmenuback, 1315 1314 .focus-on #adminmenuwrap { 1316 1315 -webkit-transform: translateX( -100% ); … … 1318 1317 transform: translateX( -100% ); 1319 1318 } 1320 1319 1321 /* @noflip */1322 .rtl.focus-on #adminmenuback,1323 .rtl.focus-on #adminmenuwrap {1324 -webkit-transform: translateX( 100% );1325 -ms-transform: translateX( 100% );1326 transform: translateX( 100% );1327 }1328 1329 1320 .focus-off #adminmenuback, 1330 1321 .focus-off #adminmenuwrap { 1331 1322 -webkit-transform: translateX( 0 ); -
src/wp-admin/css/forms.css
61 61 box-shadow: 0 0 2px rgba( 30, 140, 190, 0.8 ); 62 62 } 63 63 64 /* @noflip*/64 /* rtl:ignore */ 65 65 input[type="email"], 66 66 input[type="url"] { 67 67 direction: ltr; -
src/wp-admin/css/install.css
237 237 background-color: #ffebe8; 238 238 } 239 239 240 /* @noflip*/240 /* rtl:ignore */ 241 241 #dbname, 242 242 #uname, 243 243 #pwd, -
src/wp-admin/css/themes.css
1523 1523 text-decoration: none !important; 1524 1524 } 1525 1525 1526 /* rtl:ignore */ 1526 1527 .wp-full-overlay.collapsed .collapse-sidebar-arrow:before, 1527 1528 .rtl .wp-full-overlay .collapse-sidebar-arrow:before { 1528 1529 -webkit-transform: rotate(180deg); -
src/wp-includes/css/editor.css
2112 2112 font-family: Tahoma, sans-serif; 2113 2113 } 2114 2114 2115 /* @noflip*/2115 /* rtl:ignore */ 2116 2116 .mce-rtl .mce-flow-layout .mce-flow-layout-item > div { 2117 2117 direction: rtl; 2118 2118 } 2119 2119 2120 /* @noflip*/2120 /* rtl:ignore */ 2121 2121 .mce-rtl .mce-listbox i.mce-caret { 2122 2122 left: 6px; 2123 2123 } -
src/wp-includes/css/jquery-ui-dialog.css
128 128 bottom: -5px; 129 129 left: 0; 130 130 } 131 /* @noflip*/131 /* rtl:ignore */ 132 132 .ui-resizable-e { 133 133 cursor: e-resize; 134 134 width: 7px; … … 136 136 top: 0; 137 137 height: 100%; 138 138 } 139 /* @noflip*/139 /* rtl:ignore */ 140 140 .ui-resizable-w { 141 141 cursor: w-resize; 142 142 width: 7px; … … 144 144 top: 0; 145 145 height: 100%; 146 146 } 147 /* @noflip*/147 /* rtl:ignore */ 148 148 .ui-resizable-se { 149 149 cursor: se-resize; 150 150 width: 12px; … … 152 152 right: 1px; 153 153 bottom: 1px; 154 154 } 155 /* @noflip*/155 /* rtl:ignore */ 156 156 .ui-resizable-sw { 157 157 cursor: sw-resize; 158 158 width: 9px; … … 160 160 left: -5px; 161 161 bottom: -5px; 162 162 } 163 /* @noflip*/163 /* rtl:ignore */ 164 164 .ui-resizable-nw { 165 165 cursor: nw-resize; 166 166 width: 9px; … … 168 168 left: -5px; 169 169 top: -5px; 170 170 } 171 /* @noflip*/171 /* rtl:ignore */ 172 172 .ui-resizable-ne { 173 173 cursor: ne-resize; 174 174 width: 9px; -
src/wp-includes/css/media-views.css
886 886 overflow: hidden; 887 887 } 888 888 889 /* @noflip */890 889 .wp-core-ui .attachment .thumbnail img { 891 890 top: 0; 892 891 left: 0; 893 892 } 894 893 895 /* @noflip */896 894 .wp-core-ui .attachment .thumbnail .centered { 897 895 position: absolute; 898 896 top: 0; -
src/wp-includes/css/wp-pointer.css
110 110 padding-bottom: 13px; 111 111 } 112 112 113 /* @noflip*/113 /* rtl:ignore */ 114 114 .wp-pointer-left { 115 115 padding-left: 13px; 116 116 } 117 /* @noflip*/117 /* rtl:ignore */ 118 118 .wp-pointer-right { 119 119 margin-left: -13px; 120 120 padding-right: 13px; … … 168 168 content: ' '; 169 169 } 170 170 171 /* @noflip*/171 /* rtl:ignore */ 172 172 .wp-pointer-left .wp-pointer-arrow { 173 173 left: 0; 174 174 border-width: 13px 13px 13px 0; 175 175 border-right-color: #ccc; 176 176 } 177 177 178 /* @noflip*/178 /* rtl:ignore */ 179 179 .wp-pointer-left .wp-pointer-arrow-inner { 180 180 left: 1px; 181 181 margin-left: -13px; … … 186 186 content: ' '; 187 187 } 188 188 189 /* @noflip*/189 /* rtl:ignore */ 190 190 .wp-pointer-right .wp-pointer-arrow { 191 191 right: 0; 192 192 border-width: 13px 0 13px 13px; 193 193 border-left-color: #ccc; 194 194 } 195 195 196 /* @noflip*/196 /* rtl:ignore */ 197 197 .wp-pointer-right .wp-pointer-arrow-inner { 198 198 right: 1px; 199 199 margin-right: -13px; -
tools/grunt/deprecatedTasks.js
1 module.exports = function( grunt ) { 2 3 grunt.registerTask( 'cssjanus', function( target ) { 4 grunt.log.warn( 'The cssjanus task has been removed. Use `grunt rtlcss` to convert LTR CSS to RTL.' ); 5 grunt.task.run( [ 'rtlcss' + ( target ? ':' + target : '' ) ] ); 6 }); 7 8 };