From 322a79739dbee9f5a9bb4e012cd75a3d034a8bad Mon Sep 17 00:00:00 2001 From: csarven Date: Fri, 14 Nov 2008 22:35:49 -0500 Subject: trac670 trac689 Favorites (duplicate id, background image, JavaScript) darcs-hash:20081115033549-eefa4-cfbca6f9c723aa63869c39d6851de7a7803f0703.gz --- lib/util.php | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) (limited to 'lib/util.php') diff --git a/lib/util.php b/lib/util.php index cfc95cc36..e958a87ba 100644 --- a/lib/util.php +++ b/lib/util.php @@ -180,6 +180,9 @@ function common_show_header($pagetitle, $callable=NULL, $data=NULL, $headercall= common_element('script', array('type' => 'text/javascript', 'src' => common_path('js/jquery.form.js')), ' '); + common_element('script', array('type' => 'text/javascript', + 'src' => common_path('js/xbImportNode.js')), + ' '); common_element('script', array('type' => 'text/javascript', 'src' => common_path('js/util.js?version='.LACONICA_VERSION)), ' '); @@ -1809,13 +1812,25 @@ function common_disfavor_form($notice) { 'method' => 'post', 'class' => 'disfavor', 'action' => common_local_url('disfavor'))); - common_hidden('token', common_session_token()); - common_hidden('notice', $notice->id); + + common_element('input', array('type' => 'hidden', + 'name' => 'token-'. $notice->id, + 'id' => 'token-'. $notice->id, + 'class' => 'token', + 'value' => common_session_token())); + + common_element('input', array('type' => 'hidden', + 'name' => 'notice', + 'id' => 'notice-n'. $notice->id, + 'class' => 'notice', + 'value' => $notice->id)); + common_element('input', array('type' => 'submit', 'id' => 'disfavor-submit-' . $notice->id, 'name' => 'disfavor-submit-' . $notice->id, 'class' => 'disfavor', - 'value' => '♥')); + 'value' => 'Disfavor favorite', + 'title' => 'Remove this message from favorites')); common_element_end('form'); } @@ -1824,13 +1839,25 @@ function common_favor_form($notice) { 'method' => 'post', 'class' => 'favor', 'action' => common_local_url('favor'))); - common_hidden('token', common_session_token()); - common_hidden('notice', $notice->id); + + common_element('input', array('type' => 'hidden', + 'name' => 'token-'. $notice->id, + 'id' => 'token-'. $notice->id, + 'class' => 'token', + 'value' => common_session_token())); + + common_element('input', array('type' => 'hidden', + 'name' => 'notice', + 'id' => 'notice-n'. $notice->id, + 'class' => 'notice', + 'value' => $notice->id)); + common_element('input', array('type' => 'submit', 'id' => 'favor-submit-' . $notice->id, 'name' => 'favor-submit-' . $notice->id, 'class' => 'favor', - 'value' => '♡')); + 'value' => 'Add to favorites', + 'title' => 'Add this message to favorites')); common_element_end('form'); } -- cgit v1.2.3-54-g00ecf