From: <bra...@us...> - 2008-07-31 18:49:42
|
Revision: 2521 http://archive-access.svn.sourceforge.net/archive-access/?rev=2521&view=rev Author: bradtofel Date: 2008-07-31 18:49:49 +0000 (Thu, 31 Jul 2008) Log Message: ----------- REFACTOR: moved client-side watching of location.href changes to client-rewrite.js, which is where it should have been from the start. Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/js/client-rewrite.js trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/js/disclaim.js Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/js/client-rewrite.js =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/js/client-rewrite.js 2008-07-29 06:43:31 UTC (rev 2520) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/js/client-rewrite.js 2008-07-31 18:49:49 UTC (rev 2521) @@ -63,3 +63,24 @@ } } } +var interceptRunAlready = false; +function intercept_js_href_iawm(destination) { + if(!interceptRunAlready &&top.location.href != destination) { + interceptRunAlready = true; + top.location.href = sWayBackCGI+xResolveUrl(destination); + } +} +// ie triggers +href_iawmWatcher = document.createElement("a"); +top.location.href_iawm = top.location.href; +if(href_iawmWatcher.setExpression) { + href_iawmWatcher.setExpression("dummy","intercept_js_href_iawm(top.location.href_iawm)"); +} +// mozilla triggers +function intercept_js_moz(prop,oldval,newval) { + intercept_js_href_iawm(newval); + return newval; +} +if(top.location.watch) { + top.location.watch("href_iawm",intercept_js_moz); +} Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/js/disclaim.js =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/js/disclaim.js 2008-07-29 06:43:31 UTC (rev 2520) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/js/disclaim.js 2008-07-31 18:49:49 UTC (rev 2521) @@ -1,26 +1,3 @@ - -var interceptRunAlready = false; -function intercept_js_href_iawm(destination) { - if(!interceptRunAlready &&top.location.href != destination) { - interceptRunAlready = true; - top.location.href = sWayBackCGI+xResolveUrl(destination); - } -} -// ie triggers -href_iawmWatcher = document.createElement("a"); -top.location.href_iawm = top.location.href; -if(href_iawmWatcher.setExpression) { - href_iawmWatcher.setExpression("dummy","intercept_js_href_iawm(top.location.href_iawm)"); -} -// mozilla triggers -function intercept_js_moz(prop,oldval,newval) { - intercept_js_href_iawm(newval); - return newval; -} -if(top.location.watch) { - top.location.watch("href_iawm",intercept_js_moz); -} - var notice = "<div style='" + "position:relative;z-index:99999;"+ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |