Skip to content

Commit

Permalink
web: add a window to change nick/psm
Browse files Browse the repository at this point in the history
  • Loading branch information
borisfaure committed Aug 28, 2010
1 parent 2a9b1e4 commit 4333969
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
2 changes: 1 addition & 1 deletion amsn2/ui/front_ends/web/static/amsn2.html
Expand Up @@ -37,10 +37,10 @@
recenterLogin(null);

Event.observe('signin', 'submit', function(event) {
event.stop();
$('signin').request({
onComplete: function(){ aMSNStart(); }
});
event.stop();
});

</script>
Expand Down
44 changes: 43 additions & 1 deletion amsn2/ui/front_ends/web/static/js/amsn2.js
Expand Up @@ -68,11 +68,53 @@ function debug(d) {
var g_cl = null;
var g_pw = null;

function changeMe()
{
if($('changeMe')) {
Windows.getWindow('changeMe').toFront();
return;
}

changeMe = new Window({id: 'changeMe', className: "win", title: "Change my infos",
width: 300, height: 160, minWidth: 240, minHeight: 150,
resizable: true, draggable: true, closable: true,
maximizable: false, minimizable: false, detachable: false,
showEffectOptions: {duration: 0},
hideEffectOptions: {duration: 0}});

changeMe.setConstraint(true, {left: 0, right: 0, top: 0, bottom: 0});
var h = '<form id="fchangeme" action="/changeMe">';
h += 'Nick:<br/><input type="text" name="nick" value="';
h += $('pw_nick').innerHTML + '" /> <br/>';
h += 'Personal Message:<br/><input type="text" name="psm" value="';
h += $('pw_psm').innerHTML + '" /> <br/>';
h += '<input type="submit" value="Change" />';
h += '<input type="reset" value="Cancel" />';
h += '</form>';

changeMe.setHTMLContent(h);

changeMe.setDestroyOnClose();
changeMe.showCenter();

Event.observe('fchangeme', 'submit', function(event) {
event.stop();
$('fchangeme').request({
onComplete: function(){ Windows.getWindow('changeMe').destroy(); }
});
});
Event.observe('fchangeme', 'reset', function(event) {
event.stop();
Windows.getWindow('changeMe').destroy();
});
}

function PersonalWidget(_parent)
{
var parent = _parent;

parent.update('<div id="pw_nick"></div><div id="pw_psm"></div>'
parent.update('<a href="#" id="pw_nick" onclick="changeMe();"></a><br/>'
+'<a href="#" id="pw_psm" onclick="changeMe();"></a><br/>'
+'<a href="#" id="pw_presence"></a>');

this.remove = function() {
Expand Down

0 comments on commit 4333969

Please sign in to comment.