@@ -154,64 +154,66 @@ mixin makeJson( filePath, jsonConfig, title, stylePatterns)
154
154
else
155
155
!= styleString (jsonExtract, stylePatterns)
156
156
157
- - // Open (and close) an explanation <div>. See QuickStart
158
- script .
159
- function why (id , backTo ) {
160
- var id = " #" + id;
161
- var el = document .querySelector (id);
162
- el .hidden = el .hidden = ! el .hidden ;
163
-
164
- if (el .hidden && backTo){
165
- // the next line is required to work around a bug in WebKit (Chrome / Safari)
166
- location .href = " #" ;
167
- location .href = " #" + backTo;
157
+ if ! jade2ng
158
+ //- Open (and close) an explanation <div>. See QuickStart
159
+ script .
160
+ function why (id , backTo ) {
161
+ var id = " #" + id;
162
+ var el = document .querySelector (id);
163
+ el .hidden = el .hidden = ! el .hidden ;
164
+
165
+ if (el .hidden && backTo){
166
+ // the next line is required to work around a bug in WebKit (Chrome / Safari)
167
+ location .href = " #" ;
168
+ location .href = " #" + backTo;
169
+ }
170
+ }
171
+ script .
172
+ function verbose (isVerbose ) {
173
+ isVerbose = !! isVerbose;
174
+ var el = document .querySelector (' button.verbose.off' );
175
+ el .style .display = isVerbose ? ' block' : ' none' ;
176
+ var el = document .querySelector (' button.verbose.on' );
177
+ el .style .display = isVerbose ? ' none' : ' block' ;
178
+
179
+ CCSStylesheetRuleStyle (' main' ,' .l-verbose-section' , ' display' ,
180
+ isVerbose ? ' block' : ' none' );
168
181
}
169
- }
170
- script .
171
- function verbose (isVerbose ) {
172
- isVerbose = !! isVerbose;
173
- var el = document .querySelector (' button.verbose.off' );
174
- el .style .display = isVerbose ? ' block' : ' none' ;
175
- var el = document .querySelector (' button.verbose.on' );
176
- el .style .display = isVerbose ? ' none' : ' block' ;
177
-
178
- CCSStylesheetRuleStyle (' main' ,' .l-verbose-section' , ' display' ,
179
- isVerbose ? ' block' : ' none' );
180
- }
181
-
182
- script .
183
- function CCSStylesheetRuleStyle (stylesheet , selectorText , style , value ){
184
- /* returns the value of the element style of the rule in the stylesheet
185
- * If no value is given, reads the value
186
- * If value is given, the value is changed and returned
187
- * If '' (empty string) is given, erases the value.
188
- * The browser will apply the default one
189
- *
190
- * string stylesheet: part of the .css name to be recognized, e.g. 'default'
191
- * string selectorText: css selector, e.g. '#myId', '.myClass', 'thead td'
192
- * string style: camelCase element style, e.g. 'fontSize'
193
- * string value optional : the new value
194
- */
195
- var CCSstyle = undefined , rules, sheet;
196
- for (var m in document .styleSheets ){
197
- sheet = document .styleSheets [m];
198
- if (sheet .href && sheet .href .indexOf (stylesheet) != - 1 ){
199
- rules = sheet[document .all ? ' rules' : ' cssRules' ];
200
- for (var n in rules){
201
- console .log (rules[n].selectorText );
202
- if (rules[n].selectorText == selectorText){
203
- CCSstyle = rules[n].style ;
204
- break ;
182
+
183
+ script .
184
+ function CCSStylesheetRuleStyle (stylesheet , selectorText , style , value ){
185
+ /* returns the value of the element style of the rule in the stylesheet
186
+ * If no value is given, reads the value
187
+ * If value is given, the value is changed and returned
188
+ * If '' (empty string) is given, erases the value.
189
+ * The browser will apply the default one
190
+ *
191
+ * string stylesheet: part of the .css name to be recognized, e.g. 'default'
192
+ * string selectorText: css selector, e.g. '#myId', '.myClass', 'thead td'
193
+ * string style: camelCase element style, e.g. 'fontSize'
194
+ * string value optional : the new value
195
+ */
196
+ var CCSstyle = undefined , rules, sheet;
197
+ for (var m in document .styleSheets ){
198
+ sheet = document .styleSheets [m];
199
+ if (sheet .href && sheet .href .indexOf (stylesheet) != - 1 ){
200
+ rules = sheet[document .all ? ' rules' : ' cssRules' ];
201
+ for (var n in rules){
202
+ console .log (rules[n].selectorText );
203
+ if (rules[n].selectorText == selectorText){
204
+ CCSstyle = rules[n].style ;
205
+ break ;
206
+ }
207
+ }
208
+ break ;
205
209
}
206
210
}
207
- break ;
208
- }
211
+ if (value == undefined )
212
+ return CCSstyle[style]
213
+ else
214
+ return CCSstyle[style] = value
209
215
}
210
- if (value == undefined )
211
- return CCSstyle[style]
212
- else
213
- return CCSstyle[style] = value
214
- }
216
+
215
217
//---------------------------------------------------------------------------------------------------------
216
218
//- Converts the given project-relative path (like 'app/main.ts')
217
219
//- to a doc folder relative path (like 'quickstart/ts/app/main.ts')
@@ -298,7 +300,7 @@ script.
298
300
- } else {
299
301
- // ``` gets translated to <pre><code>.....</code></pre> and we need
300
302
- // to remove this from the fragment prefix is 11 long and suffix is 13 long
301
- - frag = frag .substring (11 , frag .length - 13 );
303
+ - frag = jade2ng ? frag : frag .substring (11 , frag .length - 13 );
302
304
- // Uncomment next line for debugging.
303
305
- // frag = "FileName: " + fullFileName + " Current path: " + current.path + " PathToDocs: " + getPathToDocs() + "\n" + frag;
304
306
- return frag;
0 commit comments