Permalink
Browse files

Add ability in htc to override the js resource path, useful for debug…

…ging purposes.
  • Loading branch information...
1 parent e56857e commit 9d84290e40fc0aa7a85f0477508b474af06c1890 @lojjic committed May 21, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 sources/htc_script.js
View
@@ -29,8 +29,14 @@ if ( !window[ 'PIE' ] && docMode < 10 ) {
tester.innerHTML = '<!--[if IE 6]><i></i><![endif]-->';
isIE6 = tester.getElementsByTagName('i')[0];
- // Look for a custom -pie-load-path, or fall back to the CDN url
- baseUrl = doc.documentElement.currentStyle.getAttribute( ( isIE6 ? '' : '-' ) + 'pie-load-path' );
+ // Look for a custom -pie-load-path in the url or the css, or fall back to the CDN url
+ baseUrl = doc.location.href.match(/pie-load-path=([^&]+)/);
+ if( baseUrl ) {
+ baseUrl = decodeURIComponent(baseUrl[1]);
+ }
+ if( !baseUrl ) {
+ baseUrl = doc.documentElement.currentStyle.getAttribute( ( isIE6 ? '' : '-' ) + 'pie-load-path' );
+ }
if( baseUrl ) {
baseUrl = baseUrl.replace(/^("|')|("|')$/g, '');
baseUrls = [ baseUrl ];

0 comments on commit 9d84290

Please sign in to comment.