Created
October 28, 2009 21:03
-
-
Save koos/220837 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
/* | |
* Webcit Summary View v2 | |
* All comments, flowers and death threats to Jan Kus | |
* <jan@railslove.com> | |
* Copyright 2009 The Citadel Team | |
* Licensed under the GPL V3 | |
* | |
* QA reminders: because I keep forgetting / get cursed. | |
* After changing anything in here, make sure that you still can: | |
* 1. Resort messages in both normal and paged view. | |
* 2. Select a range with shift-click | |
* 3. Select messages with ctrl-click | |
* 4. Normal click will deselect everything done above | |
* 5. Move messages, and they will disappear | |
*/ | |
$(document).observe("dom:loaded", function() { | |
// Click observer to load the message in the preview_pane | |
$$(".show_message_preview").each(function(element){ | |
element.observe("click", function(e){ | |
e.stop(); | |
// FIXME: do we want to use the citadel:ctdlrowid="<?ITERATE:N>" ? | |
var msgId = element.id.gsub("msg_", ""); | |
console.log(msgId); | |
new Ajax.Request('msg/'+msgId, { | |
method: 'get', | |
onComplete: function(transport) { | |
var response = transport.responseText | |
$("loading").show(); | |
$("preview_pane").update(response); | |
$("preview_pane").show(); | |
$("loading").hide(); | |
} | |
}); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment