# HG changeset patch # User Atul Varma # Date 1207348623 25200 # Node ID 0b247e2afdfa5c6a1bc3d94c4c1125e0f2f2e598 # Parent 62659c78b809317181346cd0921c99939b1b525c Moved javascript code out of list.html and into a new file, media/js/personas.js. diff -r 62659c78b809 -r 0b247e2afdfa media/js/personas.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/media/js/personas.js Fri Apr 04 15:37:03 2008 -0700 @@ -0,0 +1,18 @@ +function dispatchPersonaEvent(aType, aNode, aUrl) { + if (aUrl) { + /* TODO: We should only do this if the Persona is successfully + set, i.e. if the user actually has Personas installed, etc. */ + /* TODO: We should probably just use a library like jQuery to + do this for us. */ + var request = new XMLHttpRequest(); + /* TODO: Be reasonable and make this a POST, as this 'ping' will + change the server's state. */ + request.open( "GET", aUrl, true ); + request.onreadystatechange = function() {} + request.send(null); + } + + var event = document.createEvent("Events"); + event.initEvent(aType, true, false); + aNode.dispatchEvent(event); +} diff -r 62659c78b809 -r 0b247e2afdfa personasbackend/personas/templates/personas/base.html --- a/personasbackend/personas/templates/personas/base.html Fri Apr 04 15:12:13 2008 -0700 +++ b/personasbackend/personas/templates/personas/base.html Fri Apr 04 15:37:03 2008 -0700 @@ -9,6 +9,8 @@ href="{{ MEDIA_URL }}css/otherpages.css" /> +
diff -r 62659c78b809 -r 0b247e2afdfa personasbackend/personas/templates/personas/list.html --- a/personasbackend/personas/templates/personas/list.html Fri Apr 04 15:12:13 2008 -0700 +++ b/personasbackend/personas/templates/personas/list.html Fri Apr 04 15:37:03 2008 -0700 @@ -9,26 +9,6 @@

If you like the Persona, you can click on the preview image to set it as your current Persona.

Enjoy!

- {% for persona in personas %}