Permalink
Browse files

removed hardcoded domains from JS. We now pipe in through the stumpy_…

…domain var by setting a global JS var 'DOMAIN' in the index and then reference that JS var in our scripts. You will no longer need to set your domain as hardcoded into javascript code.
  • Loading branch information...
1 parent 77f9edd commit 325246d9523ade931a9355f2dd6774a54dcb7ed0 @mutaku committed Mar 28, 2012
Showing with 3 additions and 2 deletions.
  1. +1 −1 static/bookmarklet.js
  2. +1 −1 static/iframer.js
  3. +1 −0 templates/stumpy/index.html
View
@@ -1,5 +1,5 @@
function postUrl(){
w=window,d=document,t=encodeURIComponent(d.title),link=escape(d.location),
- w.open('http://t04u.be/url/?l='+link,'t','status=1,scrollbars=1,location=0,resizable=1,menubar=0,width=200,height=75,toolbar=0');
+ w.open(DOMAIN+'/url/?l='+link,'t','status=1,scrollbars=1,location=0,resizable=1,menubar=0,width=200,height=75,toolbar=0');
}
postUrl();
View
@@ -22,7 +22,7 @@ function runthis() {
<div id='stumpyframe_veil' style=''>\
<p>Harvesting your Stumps! ...</p>\
</div>\
- <iframe src='http://t04u.be/iframer/' onload=\"$('#stumpyframe iframe').animate({width:'toggle'},500);$('#stumpyframe_veil p').hide(500);\">Enable iFrames.</iframe>\
+ <iframe src='"+DOMAIN+"/iframer/' onload=\"$('#stumpyframe iframe').animate({width:'toggle'},500);$('#stumpyframe_veil p').hide(500);\">Enable iFrames.</iframe>\
<style type='text/css'>\
#stumpyframe {z-index: 850;}\
#stumpyframe_veil { display: none; position: fixed; width: 100%; height: 100%; top: 0; left: 0; cursor: pointer; z-index: 900; }\
@@ -9,6 +9,7 @@
{% if stumpy_domain %}
<p class=booky>
+ <script>var DOMAIN = "{{ stumpy_domain }}";</script>
<a href="javascript:(function(){document.body.appendChild(document.createElement('script')).src='http://{{ stumpy_domain }}/static/bookmarklet.js';})();">&#8620;&nbsp;Stumpy it!</a>
<a href="javascript:(function(){document.body.appendChild(document.createElement('script')).src='http://{{ stumpy_domain }}/static/iframer.js';})();">&#8620;&nbsp;Harvest Stumps!</a>
</p>

0 comments on commit 325246d

Please sign in to comment.