Created
November 20, 2009 21:23
-
-
Save tstone/239795 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// When the toolbar button is clicked... | |
$('#newNickButton').click(function() { | |
var newNick = getNewNickname(); | |
setNewNickname(newNick); | |
} | |
function getNewNickname() { | |
// Build dialog markup | |
var win = $('<div><p>Enter your new nickname</p></div>'); | |
var userInput = $('<input type="text" style="width:100%"></input>'); | |
userInput.appendTo(win); | |
var userValue = ''; | |
// Display dialog | |
$(win).dialog({ | |
'modal': true, | |
'buttons': { | |
'Ok': function() { | |
userValue = $(userInput).val(); | |
$(this).dialog('close'); | |
}, | |
'Cancel': function() { | |
$(this).dialog('close'); | |
} | |
} | |
}); | |
// Wait until dialog is closed !?!?!? | |
// How do we do this!? OH NOES!?! | |
return userValue; | |
} | |
function setNewNickname(nick) { | |
// Do whatever... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment