File tree 5 files changed +41
-1
lines changed
5 files changed +41
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ webcompat/static/js/diagnose.js
18
18
webcompat /static /js /issues.js
19
19
webcompat /static /js /issue-list.js
20
20
webcompat /static /js /user-activity.js
21
+ webcompat /static /js /cssfixme /cssfixme.js
21
22
webcompat /** /* .min.js
22
23
webcompat /** /* .min.css
23
24
webcompat /** /* .dev.css
Original file line number Diff line number Diff line change @@ -66,6 +66,14 @@ module.exports = function(grunt) {
66
66
'<%= jsPath %>/lib/user-activity.js'
67
67
] ,
68
68
dest : '<%= jsPath %>/user-activity.js'
69
+ } ,
70
+ cssFixmeLibs : {
71
+ src : [
72
+ 'git_modules/css-fixme/js/css-browserside.js' ,
73
+ 'git_modules/css-fixme/js/css-fixme.js' ,
74
+ '<%= jsPath %>/lib/css-fixme-ui.js'
75
+ ] ,
76
+ dest : '<%= jsPath %>/cssfixme/cssfixme.js'
69
77
}
70
78
} ) ;
71
79
} ;
Original file line number Diff line number Diff line change @@ -27,6 +27,10 @@ module.exports = function(grunt) {
27
27
diagnose : {
28
28
src : '<%= concat.diagnose.dest %>' ,
29
29
dest : '<%= jsPath %>/diagnose.min.js'
30
+ } ,
31
+ cssFixmeLibs : {
32
+ src : '<%= concat.cssFixmeLibs.dest %>' ,
33
+ dest : '<%= jsPath %>/cssfixme.min.js'
30
34
}
31
35
} ) ;
32
36
} ;
Original file line number Diff line number Diff line change
1
+ /* global doTheBigStyleFixing */
2
+ addEventListener ( 'load' , function ( ) {
3
+
4
+ function do_fixup ( ) {
5
+ var csscode = document . getElementsByTagName ( 'textarea' ) [ 0 ] . value ;
6
+ var pre = document . getElementById ( 'fixedcss' ) ;
7
+ var compact = document . getElementsByName ( 'compact' ) [ 0 ] . checked ;
8
+ doTheBigStyleFixing ( csscode , pre , compact ) ;
9
+ }
10
+
11
+ document . getElementById ( 'btn_do_fixup' ) . addEventListener ( 'click' , do_fixup , false ) ;
12
+
13
+ if ( document . getElementsByTagName ( 'textarea' ) [ 0 ] . value ) {
14
+ do_fixup ( ) ;
15
+ }
16
+
17
+ document . getElementById ( 'fixedcss' ) [ 0 ] . addEventListener ( 'dblclick' , function ( e ) {
18
+ window . getSelection ( ) . removeAllRanges ( ) ;
19
+ var rng = document . createRange ( ) ;
20
+ rng . selectNodeContents ( document . getElementById ( 'fixedcss' ) [ 0 ] ) ;
21
+ window . getSelection ( ) . addRange ( rng ) ;
22
+ e . preventDefault ( ) ;
23
+ } , false ) ;
24
+
25
+ } , false ) ;
26
+
Original file line number Diff line number Diff line change 9
9
< p > Paste CSS in this box to see what needs fixing:</ p >
10
10
11
11
< textarea style ="width:100%;height:20rem; "> </ textarea > < br />
12
- < button type ="button " onclick =" doTheBigStyleFixing(document.getElementsByTagName('textarea')[0].value) "> Add standard equivalents for prefixed CSS</ button >
12
+ < button type ="button " id =" btn_do_fixup "> Add standard equivalents for prefixed CSS</ button >
13
13
< label >
14
14
< input type ="checkbox " name ="compact "> Compact output (whitespace only after closing brace)</ label >
15
15
< pre id ="fixedcss "> </ pre >
16
+ < script src ="/js/cssfixme.min.js "> </ script >
16
17
</ main >
17
18
</ div >
18
19
{% endblock %}
You can’t perform that action at this time.
0 commit comments