@@ -175,30 +175,56 @@ docsApp.serviceFactory.openPlunkr = function(templateMerge, formPostData, loaded
175
175
' </head>\n' +
176
176
' <body>\n\n' +
177
177
'{{indexContents}}\n\n' +
178
+ '{{postScriptDeps}}' +
178
179
' </body>\n' +
179
180
'</html>\n' ;
180
181
var scriptDeps = '' ;
182
+ var postScriptDeps = '' ;
181
183
angular . forEach ( loadedUrls . base , function ( url ) {
184
+ url = url . replace ( / ( \/ r e l e a s e .+ ?$ ) / g, "http://ui-grid.info$1" ) ;
185
+
186
+ // scriptDeps += ' <script src="' + url + '"></script>\n';
187
+ var ext = url . split ( / \. / ) . pop ( ) ;
188
+ if ( ext == 'css' ) {
189
+ scriptDeps += ' <link rel="stylesheet" href="' + url + '" type="text/css">\n' ;
190
+ }
191
+ else {
182
192
scriptDeps += ' <script src="' + url + '"></script>\n' ;
193
+ }
183
194
} ) ;
184
195
angular . forEach ( allFiles , function ( file ) {
185
196
var ext = file . name . split ( / \. / ) . pop ( ) ;
186
- if ( ext == 'css' ) {
187
- scriptDeps += ' <link rel="stylesheet" href="' + file . name + '" type="text/css">\n' ;
188
- } else if ( ext == 'js' && file . name !== 'angular.js' ) {
189
- scriptDeps += ' <script src="' + file . name + '"></script>\n' ;
190
- }
197
+ if ( ext == 'css' ) {
198
+ scriptDeps += ' <link rel="stylesheet" href="' + file . name + '" type="text/css">\n' ;
199
+ }
200
+ else if ( ext == 'js' && file . name !== 'angular.js' ) {
201
+ if ( file . name === 'app.js' ) {
202
+ postScriptDeps += ' <script src="' + file . name + '"></script>\n' ;
203
+ }
204
+ else {
205
+ scriptDeps += ' <script src="' + file . name + '"></script>\n' ;
206
+ }
207
+ }
191
208
} ) ;
209
+
192
210
indexProp = {
193
211
module : content . module ,
194
212
scriptDeps : scriptDeps ,
213
+ postScriptDeps : postScriptDeps ,
195
214
indexContents : content . html [ 0 ] . content
196
215
} ;
197
216
198
217
var postData = { } ;
199
218
angular . forEach ( allFiles , function ( file , index ) {
200
219
if ( file . content && file . name != 'index.html' ) {
201
- postData [ 'files[' + file . name + ']' ] = file . content ;
220
+ if ( file . name === 'app.js' ) {
221
+ var contents = file . content ;
222
+ contents = contents . replace ( / ( \/ d a t a .+ ?\. j s o n ) / g, "https://rawgit.com/angular-ui/ui-grid.info/gh-pages$1" ) ;
223
+ postData [ 'files[' + file . name + ']' ] = contents ;
224
+ }
225
+ else {
226
+ postData [ 'files[' + file . name + ']' ] = file . content ;
227
+ }
202
228
}
203
229
} ) ;
204
230
0 commit comments