Skip to content

Instantly share code, notes, and snippets.

@koos
Created October 28, 2009 21:03
Show Gist options
  • Save koos/220837 to your computer and use it in GitHub Desktop.
Save koos/220837 to your computer and use it in GitHub Desktop.
/*
* 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