svnno****@sourc*****
svnno****@sourc*****
2009年 2月 12日 (木) 20:58:09 JST
Revision: 1003 http://svn.sourceforge.jp/view?root=slashdotjp&view=rev&rev=1003 Author: tach Date: 2009-02-12 20:58:09 +0900 (Thu, 12 Feb 2009) Log Message: ----------- add ad-hoc comments.js changing script and fix js for IE to enable D2 Modified Paths: -------------- images/trunk/Makefile images/trunk/comments.js Added Paths: ----------- images/trunk/fix-comments.js.pl -------------- next part -------------- Modified: images/trunk/Makefile =================================================================== --- images/trunk/Makefile 2009-02-12 11:56:12 UTC (rev 1002) +++ images/trunk/Makefile 2009-02-12 11:58:09 UTC (rev 1003) @@ -84,7 +84,8 @@ sed -e "s/params\['postercomment'\] = \$$dom('postercomment_' + pid).value;/&\n\tparams\['posttype'\] = \$$dom('posttype_' + pid).value; var nobonus = \$$dom('nobonus_' + pid); if (nobonus \&\& nobonus.checked) params\['nobonus'\] = nobonus.value; params\['nobonus_present'\] = '1';/" | \ sed -e "s/'top' : 'left';/'上の' : '左の';/" | \ sed -e 's/hidden comment</個の隠れコメント</' | \ - sed -e 's/hidden comments</個の隠れコメント</' >> $@ + sed -e 's/hidden comments</個の隠れコメント</' | \ + perl fix-comments.js.pl >> $@ echo >> $@ if [ -f $@.jp ]; then cat $@.jp >> $@; fi Modified: images/trunk/comments.js =================================================================== --- images/trunk/comments.js 2009-02-12 11:56:12 UTC (rev 1002) +++ images/trunk/comments.js 2009-02-12 11:58:09 UTC (rev 1003) @@ -2271,38 +2271,34 @@ pinToRange: pinToRange }; -Slash.Util.qw.each('\ - abbrev_comments \ - adTimerUrl \ - comment_body_reply \ - comments \ - currents \ - d2_comment_order \ - d2_keybindings_disable \ - d2_keybindings_off \ - d2_reverse_shift \ - d2_seen \ - discussion_id \ - init_hiddens \ - more_comments_num \ - noshow_comments \ - pieces_comments \ - placeholder_no_update \ - base_comment \ - root_comment \ - root_comments \ - root_comments_hash \ - thresh_totals \ - user_d2asp \ - user_highlightthresh \ - user_is_admin \ - user_is_anon \ - user_is_subscriber \ - user_threshold \ - user_uid \ - ', function(){ - packageObj[this] = eval('(function(v){ if (v===undefined) return '+this+'; '+this+'=v;})'); -}); +packageObj['abbrev_comments'] = function(v){if (v===undefined) return abbrev_comments; abbrev_comments = v;} +packageObj['adTimerUrl'] = function(v){if (v===undefined) return adTimerUrl; adTimerUrl = v;} +packageObj['comment_body_reply'] = function(v){if (v===undefined) return comment_body_reply; comment_body_reply = v;} +packageObj['comments'] = function(v){if (v===undefined) return comments; comments = v;} +packageObj['currents'] = function(v){if (v===undefined) return currents; currents = v;} +packageObj['d2_comment_order'] = function(v){if (v===undefined) return d2_comment_order; d2_comment_order = v;} +packageObj['d2_keybindings_disable'] = function(v){if (v===undefined) return d2_keybindings_disable; d2_keybindings_disable = v;} +packageObj['d2_keybindings_off'] = function(v){if (v===undefined) return d2_keybindings_off; d2_keybindings_off = v;} +packageObj['d2_reverse_shift'] = function(v){if (v===undefined) return d2_reverse_shift; d2_reverse_shift = v;} +packageObj['d2_seen'] = function(v){if (v===undefined) return d2_seen; d2_seen = v;} +packageObj['discussion_id'] = function(v){if (v===undefined) return discussion_id; discussion_id = v;} +packageObj['init_hiddens'] = function(v){if (v===undefined) return init_hiddens; init_hiddens = v;} +packageObj['more_comments_num'] = function(v){if (v===undefined) return more_comments_num; more_comments_num = v;} +packageObj['noshow_comments'] = function(v){if (v===undefined) return noshow_comments; noshow_comments = v;} +packageObj['pieces_comments'] = function(v){if (v===undefined) return pieces_comments; pieces_comments = v;} +packageObj['placeholder_no_update'] = function(v){if (v===undefined) return placeholder_no_update; placeholder_no_update = v;} +packageObj['base_comment'] = function(v){if (v===undefined) return base_comment; base_comment = v;} +packageObj['root_comment'] = function(v){if (v===undefined) return root_comment; root_comment = v;} +packageObj['root_comments'] = function(v){if (v===undefined) return root_comments; root_comments = v;} +packageObj['root_comments_hash'] = function(v){if (v===undefined) return root_comments_hash; root_comments_hash = v;} +packageObj['thresh_totals'] = function(v){if (v===undefined) return thresh_totals; thresh_totals = v;} +packageObj['user_d2asp'] = function(v){if (v===undefined) return user_d2asp; user_d2asp = v;} +packageObj['user_highlightthresh'] = function(v){if (v===undefined) return user_highlightthresh; user_highlightthresh = v;} +packageObj['user_is_admin'] = function(v){if (v===undefined) return user_is_admin; user_is_admin = v;} +packageObj['user_is_anon'] = function(v){if (v===undefined) return user_is_anon; user_is_anon = v;} +packageObj['user_is_subscriber'] = function(v){if (v===undefined) return user_is_subscriber; user_is_subscriber = v;} +packageObj['user_threshold'] = function(v){if (v===undefined) return user_threshold; user_threshold = v;} +packageObj['user_uid'] = function(v){if (v===undefined) return user_uid; user_uid = v;} Slash.Util.Package({ named: 'Slash.Discussion', Added: images/trunk/fix-comments.js.pl =================================================================== --- images/trunk/fix-comments.js.pl (rev 0) +++ images/trunk/fix-comments.js.pl 2009-02-12 11:58:09 UTC (rev 1003) @@ -0,0 +1,22 @@ +#!/usr/bin/perl +# +# ad-hoc comments.js fix script for IE + +use strict; +use warnings; + +my $inq = 0; +my $alt = ""; + +while (my $l = <>) { + if (!$inq && $l =~ /^Slash\.Util\.qw\.each\('\\$/) { + $inq = 1; + } elsif ($inq && $l =~ /^\}\);$/) { + $inq = 0; + print $alt; + } elsif ($inq && $l =~ /\t(\w+)\s+\\$/) { + $alt .= "packageObj['$1'] = function(v){if (v===undefined) return $1; $1 = v;}\n"; + } elsif (!$inq) { + print $l; + } +}