Skip to content

Commit

Permalink
Added a loading message, and disabled save/parent buttons while loadi…
Browse files Browse the repository at this point in the history
…ng a shader. The load times can be long on systems where ANGLE must translate GLSL to HLSL.
  • Loading branch information
emackey committed Dec 23, 2011
1 parent 061270b commit 1c98126
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions server/assets/js/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ function load_url_code() {

function add_server_buttons() {
saveButton = document.createElement( 'button' );
saveButton.style.visibility = 'hidden';
saveButton.textContent = 'save';
saveButton.addEventListener( 'click', save, false );
toolbar.appendChild( saveButton );

parentButton = document.createElement( 'a' );
parentButton.style.visibility = 'hidden';
parentButton.textContent = 'parent';
parentButton.href = original_version;
toolbar.appendChild( parentButton );
Expand Down Expand Up @@ -113,6 +115,14 @@ function save() {
}

function load_code(hash) {
if (gl) {
compileButton.title = '';
compileButton.style.color = '#ffff00';
compileButton.textContent = 'Loading...';
}
set_save_button('hidden');
set_parent_button('hidden');

$.getJSON('/item/'+hash, function(result) {
code.setValue(result['code']);
original_code=code.getValue();
Expand Down

0 comments on commit 1c98126

Please sign in to comment.