Created
April 14, 2013 20:44
-
-
Save plcosta/5384132 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var count = 0; | |
var __actionMessage = false; | |
function atualizaLoad() { | |
var elem = $( "loadCenterContent" ); | |
if (count == 0) { | |
$( "loadCenter" ).removeClassName( "loadCenterMaior" ); | |
$( "loadCenter" ).addClassName( "loadCenter" ); | |
elem.innerHTML = "Carregando"; | |
} | |
count++; | |
if (count == 10) { | |
$( "loadCenter" ).removeClassName( "loadCenter" ); | |
$( "loadCenter" ).addClassName( "loadCenterMaior" ); | |
elem.innerHTML = "Ainda Carregando"; | |
} | |
if (elem.innerHTML.indexOf( "....." ) != -1) { | |
if (count >= 10) { | |
$( "loadCenter" ).removeClassName( "loadCenter" ); | |
$( "loadCenter" ).addClassName( "loadCenterMaior" ); | |
elem.innerHTML = "Ainda Carregando"; | |
} else { | |
$( "loadCenter" ).removeClassName( "loadCenterMaior" ); | |
$( "loadCenter" ).addClassName( "loadCenter" ); | |
elem.innerHTML = "Carregando"; | |
} | |
} | |
elem.innerHTML = elem.innerHTML + "."; | |
} | |
function load(start) { | |
if (start) { | |
document.body.addClassName( 'waiting' ); | |
if (!__actionMessage) { | |
$( "loading" ).show(); | |
} | |
try { | |
executer.stop(); | |
} catch (e) { | |
} | |
executer = new PeriodicalExecuter( atualizaLoad, 0.5 ); | |
} else { | |
document.body.removeClassName( 'waiting' ); | |
try { | |
executer.stop(); | |
} catch (e) { | |
} | |
count = 0; | |
if (!__actionMessage) { | |
$( "loading" ).hide(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment