summaryrefslogtreecommitdiffstats
path: root/HTML/script.js
diff options
context:
space:
mode:
authorRomain d'Alverny <rdalverny@mandriva.org>2005-08-30 16:54:32 +0000
committerRomain d'Alverny <rdalverny@mandriva.org>2005-08-30 16:54:32 +0000
commit2938a0f15c136ba25dd6814df741e11a213cfc9b (patch)
treecef78f720ebb941ba28d6f7f001317c49b2b137b /HTML/script.js
parente79f18452fa04d031cc8c90e9cfafe3734fd6190 (diff)
downloadindexhtml-2938a0f15c136ba25dd6814df741e11a213cfc9b.tar
indexhtml-2938a0f15c136ba25dd6814df741e11a213cfc9b.tar.gz
indexhtml-2938a0f15c136ba25dd6814df741e11a213cfc9b.tar.bz2
indexhtml-2938a0f15c136ba25dd6814df741e11a213cfc9b.tar.xz
indexhtml-2938a0f15c136ba25dd6814df741e11a213cfc9b.zip
removed iframed testonline.html and updated javascript
Diffstat (limited to 'HTML/script.js')
-rw-r--r--HTML/script.js76
1 files changed, 22 insertions, 54 deletions
diff --git a/HTML/script.js b/HTML/script.js
index 9126143..24ed239 100644
--- a/HTML/script.js
+++ b/HTML/script.js
@@ -1,71 +1,39 @@
/* $Id$
*/
-/* */
var isRemoteAvail = false;
-
-/* Remote web site */
var remoteweb = 'http://start.mandriva.com/';
-
-/* Display a warning message on parent document in specific element if available.
- @param text string to display
- @param color text color
- @param background background color
- @return boolean
-*/
-/*
-function parentMessage( text, color, background ) {
- var p = parent.window.document.getElementById('status');
- if( p == null )
- return false;
- p.style.display = 'none';
- if( text == '' )
- return true;
+String.prototype.rtrim = function() { return this.replace(/\s*$/, ""); };
+String.prototype.ltrim = function() { return this.replace(/^\s*/, ""); };
+String.prototype.trim = function() { return this.rtrim().ltrim(); };
+String.prototype.encodeURI = function() { return escape( this ).replace(/\+/g,"%2B"); };
- p.innerHTML = text;
- p.style.color = color;
- p.style.background = background;
- p.style.display = 'block';
- return true;
-}
-*/
-
-/* Redirect parent document to available remote web site
- with the current language code.
- @return boolean
-*/
function actOnline() {
- var lang = null;
-
+ var release = '';
try {
- lang = parent.window.document.documentElement.attributes.getNamedItem('lang').value;
- } catch( e ) {
- return false;
- } finally { }
-
- if( lang != null )
- remoteweb += '?l='+lang;
+ var t = document.getElementsByTagName('meta');
+ for( var i=0; i<t.length; i+=1 ) {
+ if( t.item(i).getAttribute('name') == 'mdv.release' || t.item(i).getAttribute('name') == 'mdv:release' ) {
+ release = t.item(i).getAttribute('content');
+ break;
+ }
+ }
+ }
+ catch( e ) { return false; }
+ finally { }
+
+ if( release !== '' ) {
+ remoteweb += '?r='+release.trim().encodeURI();
+ }
parent.location = remoteweb;
- //parentMessage('You are online. Go to <a href="'+remoteweb+'">'+remoteweb+'</a>','#006000','#aaff99');
- return true;
-}
-
-/* If the remote website is not available.
- @return boolean
-*/
-function actOffline() {
- //parentMessage('You are offline...','#a00000','#ffaa88');
- //TODO write <meta http-equiv="Refresh" content="60" /> in <head> ?
return true;
}
-
+function actOffline() { return true; }
function bodyLoad() { if( isRemoteAvail ) { actOnline(); } else { actOffline(); } }
function imgLoad() { isRemoteAvail = true; }
-function imgError() { isRemoteAvail = false; }
-
+function imgError() { isRemoteAvail = false; var i = document.getElementById('i'); i.parentNode.removeChild(i); }
window.alert = function() {}
-//parentMessage( 'Mandriva...', '#000' );
-/*
+/*
*/