@@ -9,15 +9,15 @@ var HTMLPreview = {
99 } ,
1010
1111 raw : function ( ) {
12- return HTMLPreview . file ( ) . replace ( / \/ \/ g i t h u b \. c o m / , '//raw.github .com' ) . replace ( / \/ b l o b \/ / , '/' ) ; //Get URL of the raw file
12+ return HTMLPreview . file ( ) . replace ( / \/ \/ g i t h u b \. c o m / , '//raw.githubusercontent .com' ) . replace ( / \/ b l o b \/ / , '/' ) ; //Get URL of the raw file
1313 } ,
1414
1515 replaceAssets : function ( ) {
1616 var frame , a , link , script , i , href , src ;
1717 frame = document . querySelectorAll ( 'iframe[src],frame[src]' ) ;
1818 for ( i = 0 ; i < frame . length ; ++ i ) {
1919 src = frame [ i ] . src ; //Get absolute URL
20- if ( src . indexOf ( '//raw.github .com' ) > 0 || src . indexOf ( '//bitbucket.org' ) > 0 ) { //Check if it's from raw.github.com or bitbucket.org
20+ if ( src . indexOf ( '//raw.githubusercontent .com' ) > 0 || src . indexOf ( '//bitbucket.org' ) > 0 ) { //Check if it's from raw.github.com or bitbucket.org
2121 frame [ i ] . src = 'http://' + location . hostname + location . pathname + '?' + src ; //Then rewrite URL so it can be loaded using YQL
2222 }
2323 }
@@ -27,7 +27,7 @@ var HTMLPreview = {
2727 if ( href . indexOf ( '#' ) > 0 ) { //Check if it's an anchor
2828 a [ i ] . href = 'http://' + location . hostname + location . pathname + location . search + '#' + a [ i ] . hash . substring ( 1 ) ; //Then rewrite URL with support for empty anchor
2929 }
30- else if ( href . indexOf ( '//raw.github .com' ) > 0 || href . indexOf ( '//bitbucket.org' ) > 0 ) { //Check if it's from raw.github.com or bitbucket.org
30+ else if ( href . indexOf ( '//raw.githubusercontent .com' ) > 0 || href . indexOf ( '//bitbucket.org' ) > 0 ) { //Check if it's from raw.github.com or bitbucket.org
3131 a [ i ] . href = 'http://' + location . hostname + location . pathname + '?' + href ; //Then rewrite URL so it can be loaded using YQL
3232 }
3333 }
@@ -36,14 +36,14 @@ var HTMLPreview = {
3636 link = document . querySelectorAll ( 'link[rel=stylesheet]' ) ;
3737 for ( i = 0 ; i < link . length ; ++ i ) {
3838 href = link [ i ] . href ; //Get absolute URL
39- if ( href . indexOf ( '//raw.github .com' ) > 0 || href . indexOf ( '//bitbucket.org' ) > 0 ) { //Check if it's from raw.github.com or bitbucket.org
39+ if ( href . indexOf ( '//raw.githubusercontent .com' ) > 0 || href . indexOf ( '//bitbucket.org' ) > 0 ) { //Check if it's from raw.github.com or bitbucket.org
4040 HTMLPreview . send ( href , 'loadCSS' ) ; //Then load it using YQL
4141 }
4242 }
4343 script = document . querySelectorAll ( 'script' ) ;
4444 for ( i = 0 ; i < script . length ; ++ i ) {
4545 src = script [ i ] . src ; //Get absolute URL
46- if ( src . indexOf ( '//raw.github .com' ) > 0 || src . indexOf ( '//bitbucket.org' ) > 0 ) { //Check if it's from raw.github.com or bitbucket.org
46+ if ( src . indexOf ( '//raw.githubusercontent .com' ) > 0 || src . indexOf ( '//bitbucket.org' ) > 0 ) { //Check if it's from raw.github.com or bitbucket.org
4747 HTMLPreview . send ( src , 'loadJS' ) ; //Then load it using YQL
4848 }
4949 else if ( ! src && script [ i ] . innerHTML . indexOf ( 'HTMLPreview' ) < 0 ) { //Move all inline scripts except HTMLPreview.replaceAssets()
0 commit comments