[Slashdotjp-dev 777] [291] merged from upstream 2.5.0.187

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2007年 12月 17日 (月) 22:26:49 JST


Revision: 291
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=slashdotjp&view=rev&rev=291
Author:   tach
Date:     2007-12-17 22:26:48 +0900 (Mon, 17 Dec 2007)

Log Message:
-----------
merged from upstream 2.5.0.187

Modified Paths:
--------------
    slashjp/trunk/Slash/DB/MySQL/MySQL.pm
    slashjp/trunk/Slash/Slash.pm
    slashjp/trunk/bin/symlink-tool
    slashjp/trunk/plugins/Admin/Admin.pm
    slashjp/trunk/plugins/Ajax/htdocs/ajax.pl
    slashjp/trunk/plugins/Ajax/htdocs/images/common.js
    slashjp/trunk/plugins/Ajax/mysql_dump.sql
    slashjp/trunk/plugins/Ajax/templates/prefs_messages;ajax;default
    slashjp/trunk/plugins/Ajax/templates/prefs_user;ajax;default
    slashjp/trunk/plugins/Console/Console.pm
    slashjp/trunk/plugins/Console/console.pl
    slashjp/trunk/plugins/Console/templates/display;console;default
    slashjp/trunk/plugins/FireHose/FireHose.pm
    slashjp/trunk/plugins/FireHose/templates/admin_extras;misc;default
    slashjp/trunk/plugins/FireHose/templates/dispFireHose;firehose;default
    slashjp/trunk/plugins/FireHose/templates/paginate;firehose;default
    slashjp/trunk/plugins/FireHose/templates/tagsfirehosedivtagbox;misc;default
    slashjp/trunk/plugins/PollBooth/PollBooth.pm
    slashjp/trunk/plugins/Tags/Tagbox.pm
    slashjp/trunk/plugins/Tags/Tags.pm
    slashjp/trunk/plugins/Tags/mysql_dump.sql
    slashjp/trunk/sql/mysql/defaults.sql
    slashjp/trunk/sql/mysql/upgrades
    slashjp/trunk/tagboxes/Despam/Despam.pm
    slashjp/trunk/themes/slashcode/THEME
    slashjp/trunk/themes/slashcode/htdocs/comments.css
    slashjp/trunk/themes/slashcode/htdocs/images/comments.js
    slashjp/trunk/themes/slashcode/templates/dispCommentDetails;misc;default
    slashjp/trunk/themes/slashcode/templates/ipid_display;misc;default
    slashjp/trunk/themes/slashcode/templates/prefs_titlebar;misc;default

Added Paths:
-----------
    slashjp/trunk/themes/slashcode/htdocs/badge.js
    slashjp/trunk/themes/slashcode/htdocs/badge.pl


-------------- next part --------------
Modified: slashjp/trunk/Slash/DB/MySQL/MySQL.pm
===================================================================
--- slashjp/trunk/Slash/DB/MySQL/MySQL.pm	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/Slash/DB/MySQL/MySQL.pm	2007-12-17 13:26:48 UTC (rev 291)
@@ -12154,6 +12154,7 @@
 
 sub _addGlobjEssentials_urls {
 	my($self, $ar, $data_hr) = @_;
+	my $constants = getCurrentStatic();
 	my $urls_hr = _addGlobjEssentials_getids($ar, 'urls');
 	my @url_ids = sort { $a <=> $b } keys %$urls_hr;
 	my $id_str = join(',', @url_ids);
@@ -12163,9 +12164,25 @@
 			'urls',
 			"url_id IN ($id_str)")
 		: { };
+	my $hoseid_hr = { };
+	my $firehose = getObject('Slash::FireHose');
+	if ($firehose) {
+		$hoseid_hr = $id_str
+			? $self->sqlSelectAllKeyValue(
+				'DISTINCT url_id, id',
+				'firehose',
+				"url_id IN ($id_str) AND type='bookmark'")
+			: { };
+	}
 	for my $url_id (@url_ids) {
 		my $globjid = $urls_hr->{$url_id};
-		$data_hr->{$globjid}{url} = $urldata_hr->{$url_id}{url};
+		# If there's a firehose entry for this URL's bookmark,
+		# link to it.  Otherwise, link directly to the URL.
+		# Is this a good idea?  Since there's no way to delete
+		# a firehose entry, I think so.
+		$data_hr->{$globjid}{url} = $hoseid_hr->{$url_id}
+			? "$constants->{rootdir}/firehose.pl?op=view&id=$hoseid_hr->{$url_id}"
+			: $urldata_hr->{$url_id}{url};
 		$data_hr->{$globjid}{title} = $urldata_hr->{$url_id}{validatedtitle}
 			|| $urldata_hr->{$url_id}{initialtitle};
 		$data_hr->{$globjid}{created_at} = $urldata_hr->{$url_id}{createtime};

Modified: slashjp/trunk/Slash/Slash.pm
===================================================================
--- slashjp/trunk/Slash/Slash.pm	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/Slash/Slash.pm	2007-12-17 13:26:48 UTC (rev 291)
@@ -365,9 +365,10 @@
 		}
 	} else {
 		my $comments_new;
-		my @keys = qw(pid kids points uid);
+		my @keys = qw(pid points uid);
 		for my $cid (grep $_, keys %$comments) {
 			@{$comments_new->{$cid}}{@keys} = @{$comments->{$cid}}{@keys};
+			$comments_new->{$cid}{kids} = [sort { $a <=> $b } @{$comments->{$cid}{kids}}];
 
 			# we only care about it if it is not original ... we could
 			# in theory guess at what it is and just use a flag, but that
@@ -401,6 +402,12 @@
 		$extra .= "d2_seen = '$d2_seen_0';\nmore_comments_num = $total;\n";
 	}
 
+	# maybe also check if this ad should be running with some other var?
+	# from ads table? -- pudge
+	if ($constants->{run_ads} && $constants->{run_ads_inline_comments}) {
+		$extra .= "adTimerUrl = '$constants->{run_ads_inline_comments}';\n";
+	}
+
 	return <<EOT;
 comments = $anon_comments;
 
@@ -1358,8 +1365,8 @@
 		vislenify($comment); # create $comment->{ipid_vis} and {subnetid_vis}
 		if ($constants->{comments_hardcoded}) {
 			$comment->{ipid_display} = <<EOT;
-IPID: <a href="$constants->{real_rootdir}/users.pl?op=userinfo&amp;userfield=$comment->{ipid}&amp;fieldname=ipid">$comment->{ipid_vis}</a>&nbsp;&nbsp;SubnetID: 
-<a href="$constants->{real_rootdir}/users.pl?op=userinfo&amp;userfield=$comment->{subnetid}&amp;fieldname=subnetid">$comment->{subnetid_vis}</a>
+<span class="user_ipid_display">[<a href="$constants->{real_rootdir}/users.pl?op=userinfo&amp;userfield=$comment->{ipid}&amp;fieldname=ipid">$comment->{ipid_vis}</a>
+<a href="$constants->{real_rootdir}/users.pl?op=userinfo&amp;userfield=$comment->{subnetid}&amp;fieldname=subnetid">$comment->{subnetid_vis}</a>]</span>
 EOT
 		} else {
 			$comment->{ipid_display} = slashDisplay(
@@ -1850,8 +1857,14 @@
 			$label = timeCalc($_, "%A", 0);
 		} elsif ($ty == $y) {
 			$label = timeCalc($_, "%B %e", 0);
+			if ($constants->{tweak_japanese}) {
+				$label = timeCalc($_, "%b%o", 0);
+			}
 		} else {
 			$label = timeCalc($_, "%b. %e, %Y", 0);
+			if ($constants->{tweak_japanese}) {
+				$label = timeCalc($_, "%Y$constants->{year}%b%o", 0);
+			}
 		}
 		push @$ret_array, [ $_, $label ];
 	}
@@ -2034,17 +2047,17 @@
 		if (!$comment->{karma_bonus} || $comment->{karma_bonus} eq 'no') {
 			$nofollow = ' rel="nofollow"';
 		}
-		$userinfo_to_display = qq[<a href="$comment->{homepage}"$nofollow>$homepage</a>]
+		$userinfo_to_display = qq[<a href="$comment->{homepage}" title="$comment->{homepage}" class="user_homepage_display"$nofollow>Homepage</a>]
 			if $homepage;
 		if ($comment->{journal_last_entry_date} =~ /[1-9]/) {
-			$userinfo_to_display .= " | " if $userinfo_to_display;
-			$userinfo_to_display .= sprintf('Last Journal: <a href="%s/~%s/journal/">%s</a>',
+			$userinfo_to_display .= "\n" if $userinfo_to_display;
+			$userinfo_to_display .= sprintf('<a href="%s/~%s/journal/" title="%s" class="user_journal_display">Journal</a>',
 				$constants->{real_rootdir},
 				$nick_param,
 				timeCalc($comment->{journal_last_entry_date})
 			);
 		}
-		$userinfo_to_display = "<br>($userinfo_to_display)" if $userinfo_to_display;
+		#$userinfo_to_display = "<br>($userinfo_to_display)" if $userinfo_to_display;
 
 		$user_nick_to_display = qq{<a href="$constants->{real_rootdir}/~$nick_param">$nick_literal ($comment->{uid})</a>};
 		if ($constants->{plugin}{Subscribe} && $constants->{subscribe}

Modified: slashjp/trunk/bin/symlink-tool
===================================================================
--- slashjp/trunk/bin/symlink-tool	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/bin/symlink-tool	2007-12-17 13:26:48 UTC (rev 291)
@@ -19,6 +19,7 @@
 use Slash::Utility;
 use Slash::DB;
 use Slash::Install;
+use Template;
 use Getopt::Std;
 use JavaScript::Minifier 0.02;
 
@@ -76,12 +77,23 @@
 			catfile($theme_or_plugin->{dir},
 				$theme_or_plugin->{'glob'}{$glob})
 		);
-		my $filelist = "";
+		my @filelist = ( );
 		for my $file (@{$theme_or_plugin->{$glob}}) {
-			$filelist .= canonpath(catfile($theme_or_plugin->{dir}, $file)) . " ";
+			push @filelist, canonpath(catfile($theme_or_plugin->{dir}, $file));
 		}
 
-		system("cat $filelist > $destpath");
+		my $glob_template = Template->new({
+			INCLUDE_PATH	=> $theme_or_plugin->{dir},
+			PROCESS				=> \@filelist,
+			OUTPUT				=> \$destpath,
+			ABSOLUTE			=> 1,
+			RELATIVE			=> 1,
+			INTERPOLATE		=> 0,
+		}) || die "$Template::ERROR\n";
+		
+		$glob_template->process($filelist[0], $constants, $destpath) || die $glob_template->error(), "\n";
+
+		# system("cat $filelist > $destpath");
 		my($name, $path, $suffix) = fileparse($destpath, qr/\.[^.]*/);
 
 		# you can glob any kinds of files you like, even mixing them...

Modified: slashjp/trunk/plugins/Admin/Admin.pm
===================================================================
--- slashjp/trunk/plugins/Admin/Admin.pm	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/plugins/Admin/Admin.pm	2007-12-17 13:26:48 UTC (rev 291)
@@ -260,6 +260,15 @@
 
 }
 
+sub ajax_sub_memory {
+	my $slashdb = getCurrentDB();
+	my $form = getCurrentForm();
+	my $user = getCurrentUser();
+	return unless $user->{is_admin};
+	$slashdb->updateSubMemory($form->{submatch}, $form->{subnote});
+	return "Added note of $form->{subnote} for term $form->{submatch}";
+}
+
 ##################################################################
 sub getStorySignoffs {
 	my($self, $stoid) = @_;

Modified: slashjp/trunk/plugins/Ajax/htdocs/ajax.pl
===================================================================
--- slashjp/trunk/plugins/Ajax/htdocs/ajax.pl	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/plugins/Ajax/htdocs/ajax.pl	2007-12-17 13:26:48 UTC (rev 291)
@@ -178,6 +178,7 @@
 			story023_default	=> \%story023_default,
 			multiple_values		=> $multiple_values,
 			master_value		=> $master_value,
+                        tabbed                  => $form->{'tabbed'},
 		},
 		{ Return => 1 }
 	);
@@ -534,7 +535,8 @@
 				messagecodes    => $messagecodes,
 				deliverymodes   => $deliverymodes,
 				bvmessagecodes  => $bvmessagecodes,
-				bvdeliverymodes => $bvdeliverymodes
+				bvdeliverymodes => $bvdeliverymodes,
+                                tabbed          => $form->{'tabbed'},
 			},
 			{ Return => 1 }
 		);
@@ -543,7 +545,8 @@
         } else {
                 return
 			slashDisplay('prefs_' . $form->{'section'}, {
-				user => $user,
+				user   => $user,
+                                tabbed => $form->{'tabbed'},
 			},
 			{ Return => 1 }
 		);

Modified: slashjp/trunk/plugins/Ajax/htdocs/images/common.js
===================================================================
--- slashjp/trunk/plugins/Ajax/htdocs/images/common.js	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/plugins/Ajax/htdocs/images/common.js	2007-12-17 13:26:48 UTC (rev 291)
@@ -19,6 +19,7 @@
 var firehose_future;
 var firehose_removals;
 var firehose_is_embedded = 0;
+var firehose_not_id = 0;
 var fh_colorslider; 
 var fh_ticksize;
 var fh_pageval = 0;
@@ -502,7 +503,7 @@
 	var params = [];
 	params['op'] = 'firehose_set_options';
 	params['reskey'] = reskey_static;
-	theForm = document.forms["firehoseform"];
+	var theForm = document.forms["firehoseform"];
 	if (name == "firehose_usermode") {
 		if (value ==  true) {
 			value = 1;
@@ -537,7 +538,7 @@
 		}
 	}
 
-	if (name == "fhfilter") {
+	if (name == "fhfilter" && theForm) {
 		for (i=0; i< theForm.elements.length; i++) {
 			if (theForm.elements[i].name == "fhfilter") {
 				params['fhfilter'] = theForm.elements[i].value;
@@ -560,7 +561,7 @@
 			}
 		}
 	}
-	if (name == "mode" || name == "firehose_usermode" || name == "tab" || name == "mixedmode") {
+	if (name == "mode" || name == "firehose_usermode" || name == "tab" || name == "mixedmode" || name == "nocolors" || name == "nothumbs") {
 		// blur out then remove items
 		if (name == "mode") {
 			fh_view_mode = value;
@@ -1009,7 +1010,9 @@
 
 
 function firehose_get_updates_handler(transport) {
-	$('busy').className = "hide";
+	if ($('busy')) {
+		$('busy').className = "hide";
+	}
 	var response = eval_response(transport);
 	var processed = 0;
 	firehose_removals = response.update_data.removals;
@@ -1040,15 +1043,20 @@
 
 function firehose_get_item_idstring() {
 	var fhl = $('firehoselist');
-	var children = fhl.childNodes;
 	var str = "";
-	var id;
-	for (var i = 0; i < children.length; i++) {
-		if (children[i].id) {
-			id = children[i].id;
-			id = id.replace(/^firehose-/g, "");
-			id = id.replace(/^\s+|\s+$/g, "");
-			str = str + id + ",";
+	var children;
+	if (fhl) {
+		var id;
+		children = fhl.childNodes;
+		if (children) {
+			for (var i = 0; i < children.length; i++) {
+				if (children[i].id) {
+					id = children[i].id;
+					id = id.replace(/^firehose-/g, "");
+					id = id.replace(/^\s+|\s+$/g, "");
+					str = str + id + ",";
+				}
+			}
 		}
 	}
 	return str;
@@ -1060,7 +1068,7 @@
 	run_before_update();
 	if ((fh_play == 0 && !options.oneupdate) || fh_is_updating == 1) {
 		firehose_add_update_timerid(setTimeout("firehose_get_updates()", 2000));
-		//alert("wait loop: " + fh_is_updating);
+	//	alert("wait loop: " + fh_is_updating);
 		return;
 	}
 	if (fh_update_timerids.length > 0) {
@@ -1079,11 +1087,14 @@
 	params['duration'] = firehose_duration;
 	params['issue'] = firehose_issue;
 	params['page'] = page;
+	params['not_id'] = firehose_not_id;
 	if ( firehose_is_embedded ) {
 		params['embed'] = 1;
 	}
 	params['fh_pageval'] = fh_pageval;
-	$('busy').className = "";
+	if ($('busy')) {
+		$('busy').className = "";
+	}
 	ajax_update(params, '', handlers);
 }
 
@@ -1136,10 +1147,12 @@
 	fh_play = 1;
 	setFirehoseAction();
 	firehose_set_options('pause', '0');
+	var pausepanel = $('pauseorplay');
 	if ($('message_area'))
 		$('message_area').innerHTML = "";
-	if ($('pauseorplay'))
-		$('pauseorplay').innerHTML = "更新";
+	if (pausepanel) {
+		pausepanel.innerHTML = "更新";
+	}
 	var pause = $('pause');
 	
 	var play_div = $('play');
@@ -1157,8 +1170,9 @@
 	var play_div = $('play');
 	pause.className = "hide";
 	play_div.className = "show";
-	if ($('pauseorplay'))
+	if ($('pauseorplay')) {
 		$('pauseorplay').innerHTML = "停止";
+	}
 	firehose_set_options('pause', '1');
 }
 
@@ -1430,12 +1444,13 @@
 	return;
 }
 
-function getModalPrefs(section, title) {
+function getModalPrefs(section, title, tabbed) {
         document.getElementById('preference_title').innerHTML = title;
 	var params = [];
 	params['op'] = 'getModalPrefs';
 	params['section'] = section;
 	params['reskey'] = reskey_static;
+        params['tabbed'] = tabbed;
 	var handlers = {onComplete:show_modal_box};
 	ajax_update(params, 'modal_box_content', handlers);
 

Modified: slashjp/trunk/plugins/Ajax/mysql_dump.sql
===================================================================
--- slashjp/trunk/plugins/Ajax/mysql_dump.sql	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/plugins/Ajax/mysql_dump.sql	2007-12-17 13:26:48 UTC (rev 291)
@@ -167,6 +167,7 @@
 
 
 INSERT INTO ajax_ops VALUES (NULL, 'admin_neverdisplay', 'Slash::Admin', 'ajax_neverdisplay', 'ajax_admin_static', 'use');
+INSERT INTO ajax_ops VALUES (NULL, 'admin_submit_memory', 'Slash::Admin', 'ajax_sub_memory', 'ajax_admin_static', 'use');
 INSERT INTO ajax_ops VALUES (NULL, 'getTopVendorStory', 'Slash::SlashdotJournal', 'ajaxShowVendorStory', 'ajax_user', 'createuse');
 
 INSERT INTO ajax_ops VALUES (NULL, 'page_save_user_boxes', 'Slash::Page', 'ajaxSaveUserBoxes', 'ajax_user_static', 'use');

Modified: slashjp/trunk/plugins/Ajax/templates/prefs_messages;ajax;default
===================================================================
--- slashjp/trunk/plugins/Ajax/templates/prefs_messages;ajax;default	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/plugins/Ajax/templates/prefs_messages;ajax;default	2007-12-17 13:26:48 UTC (rev 291)
@@ -20,6 +20,15 @@
 		   modeweb  = Slash.MSG_MODE_WEB;
 		%]
 
+                [% IF tabbed == 1 %]
+                <div style="margin: 0 -2em 0em -2em; background: #e6e6e6;">
+                &nbsp;
+                <a href="" style="font-weight: bold; text-decoration: none; font-size: 14px;" onclick="getModalPrefs('user', 'User', 1); return false;">User</a>
+                &nbsp;|&nbsp;
+                <span style="font-weight: bold; text-decoration: none; font-size: 14px; color: #ccc;">Messages</span>
+                </div>
+                [% END %]
+
                 &nbsp;<br>
 
 		From this page you can configure various messages that [% constants.sitename %] can optionally send to you. The primary options are [% deliverymodes.$modenone %] (Disabled), [% deliverymodes.$modemail %], [% deliverymodes.$modeweb %], [% IF constants.im_screenname %]AIM,[% END %] and Mobile Text. Not all options are available for all message types.  [% deliverymodes.$modeweb %] messages <b>will be deleted</b> after <b>[% constants.message_web_expire || 31 %] days</b>.[% IF constants.im_screenname %] If you plan on receiving AIM messages, please add [% constants.im_screenname %] to your buddylist.[% END %]

Modified: slashjp/trunk/plugins/Ajax/templates/prefs_user;ajax;default
===================================================================
--- slashjp/trunk/plugins/Ajax/templates/prefs_user;ajax;default	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/plugins/Ajax/templates/prefs_user;ajax;default	2007-12-17 13:26:48 UTC (rev 291)
@@ -11,6 +11,15 @@
 prefs_user
 __template__
 
+                [% IF tabbed == 1 %]
+                <div style="margin: 0 -2em 0em -2em; background: #e6e6e6;">
+                &nbsp;
+                <span style="font-weight: bold; text-decoration: none; font-size: 14px; color: #ccc;">User</span>
+                &nbsp;|&nbsp;
+                <a href="" style="font-weight: bold; text-decoration: none; font-size: 14px;" onclick="getModalPrefs('messages', 'Messages', 1); return false;">Messages</a>
+                </div>
+                [% END %]
+
 		[% IF constants.offer_insecure_login_link %]
 		&nbsp;<br>
 		You can automatically log in by clicking <a href="[% gSkin.rootdir %]/index.pl?op=userlogin&amp;logtoken=[% user.logtoken | strip_paramattr %]" onclick="hide_modal_box()">This Link</a> and Bookmarking the resulting page. This is totally insecure, but very convenient. 

Modified: slashjp/trunk/plugins/Console/Console.pm
===================================================================
--- slashjp/trunk/plugins/Console/Console.pm	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/plugins/Console/Console.pm	2007-12-17 13:26:48 UTC (rev 291)
@@ -43,7 +43,6 @@
 	my $html = {};
 	my $admindb 	= getObject('Slash::Admin');
 	$html->{'storyadmin-content'}	= $admindb->showStoryAdminBox("", { contents_only => 1});
-	$html->{'slashdbox-content'}	= $admindb->showSlashdBox({ contents_only => 1});
 	$html->{'performancebox-content'}	= $admindb->showPerformanceBox({ contents_only => 1});
 	$html->{'authoractivity-content'}	= $admindb->showAuthorActivityBox({ contents_only => 1});
 	if (my $tagsdb = getObject('Slash::Tags')) {

Modified: slashjp/trunk/plugins/Console/console.pl
===================================================================
--- slashjp/trunk/plugins/Console/console.pl	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/plugins/Console/console.pl	2007-12-17 13:26:48 UTC (rev 291)
@@ -54,7 +54,6 @@
 
 	my $admindb 	= getObject('Slash::Admin');
 	my $storyadmin 	= $admindb->showStoryAdminBox("");
-	my $slashdbox 	= $admindb->showSlashdBox();
 	my $perfbox	= $admindb->showPerformanceBox();
 	my $authorbox	= $admindb->showAuthorActivityBox();
 	my $firehosebox = "";
@@ -73,7 +72,6 @@
 	slashDisplay('display', {
 		remarks 	=> $remarkstext,
 		storyadmin 	=> $storyadmin,
-		slashdbox 	=> $slashdbox,
 		perfbox		=> $perfbox,
 		authorbox	=> $authorbox,
 		firehosebox	=> $firehosebox,

Modified: slashjp/trunk/plugins/Console/templates/display;console;default
===================================================================
--- slashjp/trunk/plugins/Console/templates/display;console;default	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/plugins/Console/templates/display;console;default	2007-12-17 13:26:48 UTC (rev 291)
@@ -14,10 +14,9 @@
 <div id="slashboxes">
 	[% authorbox %]
 	[% storyadmin %]
+	[% tagnamesbox %]
 	[% perfbox %]
 	[% Slash.sidebox("Firehose Usage", ' ', "firehose_usage", 1) %]
-	[% slashdbox %]
-	[% tagnamesbox %]
 </div>
 <div id="console">
 	[% remarks %]

Modified: slashjp/trunk/plugins/FireHose/FireHose.pm
===================================================================
--- slashjp/trunk/plugins/FireHose/FireHose.pm	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/plugins/FireHose/FireHose.pm	2007-12-17 13:26:48 UTC (rev 291)
@@ -298,6 +298,7 @@
 		if ($id) {
 			# If a story is getting its primary skid to an ignored value set its firehose entry to non-public
 			my $public = ($story->{neverdisplay} || $ignore_skids{$story->{primaryskid}}) ? "no" : "yes";
+			print STDERR "Stoid: $story->{stoid} FHID: $id Public: $public ND: $story->{neverdisplay}\n";
 			my $data = {
 				title 		=> $story->{title},
 				uid		=> $story->{uid},
@@ -593,6 +594,10 @@
 		push @where, "firehose.id IN ($id_str)";
 	}
 
+	if ($options->{not_id}) {
+		push @where, "firehose.id != " . $self->sqlQuote($options->{not_id});
+	}
+
 	my $limit_str = '';
 	my $where = (join ' AND ', @where) || '';
 
@@ -770,8 +775,9 @@
 sub getURLsForItem {
 	my($self, $item) = @_;
 	my $url_id = $item->{url_id};
-	my $url =         $url_id ? $self->getUrl($url_id)->{url} : undef;
-	my $url_prepend =    $url ? qq{<a href="$url">$url</a>}   : '';
+	my $url = $url_id ? $self->getUrl($url_id) : undef;
+	$url = $url->{url} if $url;
+	my $url_prepend = $url ? qq{<a href="$url">$url</a>}   : '';
 	my $text = qq{$url_prepend $item->introtext $item->{bodytext}};
 
 	my %urls = ( );
@@ -2002,11 +2008,16 @@
 	$options->{public} = "yes";
 	if ($adminmode) {
 		# $options->{attention_needed} = "yes";
-		$options->{accepted} = "no" if !$options->{accepted};
-		$options->{rejected} = "no" if !$options->{rejected};
+		if ($user->{state}{firehose_page} ne "user") {
+			$options->{accepted} = "no" if !$options->{accepted};
+			$options->{rejected} = "no" if !$options->{rejected};
+		}
 		$options->{duration} ||= -1;
 	} else  {
-		$options->{accepted} = "no" if !$options->{accepted};
+		if ($user->{state}{firehose_page} ne "user") {
+			$options->{accepted} = "no" if !$options->{accepted};
+		}
+		
 		$options->{duration} ||= 1;
 		if ($user->{is_subscriber} && !$no_saved) {
 			$options->{createtime_subscriber_future} = 1;
@@ -2019,6 +2030,11 @@
 		$options->{duration} = 1;
 	}
 
+	if ($form->{not_id} && $form->{not_id} =~ /^\d+$/) {
+		$options->{not_id} = $form->{not_id};
+	}
+
+
 	return $options;
 }
 
@@ -2115,11 +2131,22 @@
 	$lv_opts ||= {};
 	my $slashdb = getCurrentDB();
 	my $user = getCurrentUser();
+	my $gSkin = getCurrentSkin();
 	my $firehose_reader = getObject('Slash::FireHose', {db_type => 'reader'});
+	my $featured;
+
+	if ($gSkin->{name} eq "idle") {
+		my($res) = $firehose_reader->getFireHoseEssentials({ primaryskid => $gSkin->{skid}, type => "story", limit => 1, orderby => 'createtime', orderdir => 'DESC'});
+		if ($res && $res->[0]) {
+			$featured = $firehose_reader->getFireHose($res->[0]->{id});
+		}
+	}
 	my $options = $lv_opts->{options} || $self->getAndSetOptions();
 	my $base_page = $lv_opts->{fh_page} || "firehose.pl";
 
-
+	if ($featured && $featured->{id}) {
+		$options->{no_id} = $featured->{id};
+	}
 	my($items, $results) = $firehose_reader->getFireHoseEssentials($options);
 
 	my $itemnum = scalar @$items;
@@ -2196,7 +2223,8 @@
 		slashboxes	=> $Slashboxes,
 		last_day	=> $last_day,
 		fh_page		=> $base_page,
-		search_results	=> $results
+		search_results	=> $results,
+		featured	=> $featured,
 	}, { Page => "firehose", Return => 1 });
 }
 

Modified: slashjp/trunk/plugins/FireHose/templates/admin_extras;misc;default
===================================================================
--- slashjp/trunk/plugins/FireHose/templates/admin_extras;misc;default	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/plugins/FireHose/templates/admin_extras;misc;default	2007-12-17 13:26:48 UTC (rev 291)
@@ -27,17 +27,20 @@
         </tr>
 [% END # FOREACH %]
         <tr>
-                <td><input name="submatch" size="10"></td>
-                <td colspan="2"><input name="subnote" size="40"></td>
+                <td><input name="submatch" size="10" id="submatch-[% item.id %]"></td>
+                <td colspan="2"><input name="subnote" size="40" id="subnote-[% item.id %]"></td>
                 <td>
                       [% IF form.nowrapper %]<input type="hidden" name="nowrapper" value="1">[% END %]
                       [% IF form.fromconsole %]<input type="hidden" name="fromconsole" value="1">[% END %]
                       <input type="hidden" name="op" value="viewsub">
                       <input type="hidden" name="subid" value="[% subid %]">
-                      <input type="submit" value="Remember">
+                      <input type="submit" value="Remember" onclick="admin_submit_memory([% item.id %]); return false;">
               </td>
 
         </tr>
+	<tr>
+		<td colspan="2" id="sub_mem_message-[% item.id %]"></td>
+	</tr>
 </table>
 </form>
 [% IF similar_stories.size > 0 %]

Modified: slashjp/trunk/plugins/FireHose/templates/dispFireHose;firehose;default
===================================================================
--- slashjp/trunk/plugins/FireHose/templates/dispFireHose;firehose;default	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/plugins/FireHose/templates/dispFireHose;firehose;default	2007-12-17 13:26:48 UTC (rev 291)
@@ -130,7 +130,7 @@
 				   }, 1);
 				 %]
 			[% ELSIF item.type == "journal" %]
-				<a href="[% gSkin.rootdir %]/~[% the_user.nickname %]/journal/[% item.srcid %]/">Read More</a>
+				<a href="[% gSkin.rootdir %]/~[% the_user.nickname | fixparam %]/journal/[% item.srcid %]/">Read More</a>
 			[% ELSIF item.discussion %]
 				<a href="[% gSkin.rootdir %]/firehose.pl?op=view&amp;id=[% item.id %]">Read More</a>
 			[% ELSE %]

Modified: slashjp/trunk/plugins/FireHose/templates/paginate;firehose;default
===================================================================
--- slashjp/trunk/plugins/FireHose/templates/paginate;firehose;default	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/plugins/FireHose/templates/paginate;firehose;default	2007-12-17 13:26:48 UTC (rev 291)
@@ -35,7 +35,7 @@
 	[% IF split_refresh %]<!-- split -->[% END %]
 	[% IF !split_refresh %]
 	<span class="active">
-		[% IF form.skipmenu %]
+		[% IF form.skipmenu || no_peer %]
 			[% PROCESS datewidget id='fhcalendar_pag' init='firehose_calendar_init' %]
 		[% ELSE %]
 			[% PROCESS datewidget id='fhcalendar_pag' peer = 'fhcalendar' init='firehose_calendar_init' %]

Modified: slashjp/trunk/plugins/FireHose/templates/tagsfirehosedivtagbox;misc;default
===================================================================
--- slashjp/trunk/plugins/FireHose/templates/tagsfirehosedivtagbox;misc;default	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/plugins/FireHose/templates/tagsfirehosedivtagbox;misc;default	2007-12-17 13:26:48 UTC (rev 291)
@@ -15,7 +15,7 @@
 __template__
 [% IF user.tags_canread_stories %]
 <div id="tagbox-[% id %]" class="tags">
-[% IF !form.skipvote && !options.nothumbs %]
+[% IF !form.skipvote && !options.nothumbs && !skipvote %]
 	<span id="updown-[% item.id %]" class="vote[% IF vote == "down" %]ddown[% ELSIF vote == "up" %]dup[% END %]">
 	  <a href="#" onclick="firehose_up_down('[% item.id %]','+'); return false" class="up" title="Vote this item up"
 	     [% IF !user.is_anon %]onMouseDown="show_nod_menu(this, '[% item.id %]')" onMouseOver="show_nod_menu(this, '[% item.id %]', 1200, 5200)" onMouseOut="dont_show_nodnix_menu()"[% END %]>+</a>

Modified: slashjp/trunk/plugins/PollBooth/PollBooth.pm
===================================================================
--- slashjp/trunk/plugins/PollBooth/PollBooth.pm	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/plugins/PollBooth/PollBooth.pm	2007-12-17 13:26:48 UTC (rev 291)
@@ -243,7 +243,7 @@
 		"stories",
 		"stoid=$stoid");
 	my $data;
-	my $viewable = $self->checkStoryViewable($stoid);
+	my $viewable = $self->checkStoryViewable($stoid, 0, { no_time_restrict => 1});
 	if ($story_ref->{qid}) {
 		$data->{date}           = $story_ref->{time} if $opts->{date};
 		$data->{polltype}       = $viewable ? "story" : "nodisplay" if $opts->{polltype};

Modified: slashjp/trunk/plugins/Tags/Tagbox.pm
===================================================================
--- slashjp/trunk/plugins/Tags/Tagbox.pm	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/plugins/Tags/Tagbox.pm	2007-12-17 13:26:48 UTC (rev 291)
@@ -314,8 +314,7 @@
 	push @id_clauses, "tagid <= $affected_hr->{max_tagid}" if $affected_hr->{max_tagid};
 	push @id_clauses, "tdid  <= $affected_hr->{max_tdid}"  if $affected_hr->{max_tdid};
 	push @id_clauses, "tuid  <= $affected_hr->{max_tuid}"  if $affected_hr->{max_tuid};
-	die "markTagboxRunComplete called with no max ids: " . Dumper($affected_hr)
-		if !@id_clauses;
+	@id_clauses = ("tagid=0 AND tdid=0 AND tuid=0") if !@id_clauses;
 	my $id_clause = join(' OR ', @id_clauses);
 	$delete_clause .= " AND ($id_clause)";
 

Modified: slashjp/trunk/plugins/Tags/Tags.pm
===================================================================
--- slashjp/trunk/plugins/Tags/Tags.pm	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/plugins/Tags/Tags.pm	2007-12-17 13:26:48 UTC (rev 291)
@@ -1325,8 +1325,8 @@
 	my $new_min_tagid = 0;
 
 print STDERR "type '$type' for c '$c' new_clout '$new_user_clout' for table $table id $id\n";
-	if ($type eq '+') {
-		# Plus sign means admin is saying this tagname is "OK",
+	if ($type eq '*') {
+		# Asterisk means admin is saying this tagname is "OK",
 		# which (at least so far, 2007/12) means it is not
 		# malicious or stupid or pointless or etc.
 		$self->setTagname($tagnameid, { admin_ok => 1 });
@@ -1741,6 +1741,7 @@
 
 sub getRecentTagnamesOfInterest {
 	my($self, $options) = @_;
+	my $constants = getCurrentStatic();
 	my $max_num = $options->{max_num} || 10;
 	my $min_weight = $options->{min_weight} || 1;
 
@@ -1784,7 +1785,7 @@
 		'DISTINCT tagnameid',
 		'tagcommand_adminlog',
 		"tagnameid IN ($tagnameid_str)
-		 AND cmdtype='+'");
+		 AND cmdtype='*'");
 	my %tagname_adminok = ( map { ($tagnameid_to_name->{$_}, 1) } @$tagnameid_ok_ar );
 
 	# Build a hash identifying those tagnames which have been
@@ -1799,11 +1800,12 @@
 	# Using the hashes, build a list of all recent tagnames which
 	# are of interest.
 	my @tagnames_of_interest = grep {
-		     $tagname_bad{$_}
-		||   $tagname_startauthor{$_}
-		|| ( $tagname_firstrecent{$_} && !$tagname_adminok{$_} )
+		!$tagname_adminok{$_}
+		&& (	   $tagname_bad{$_}
+			|| $tagname_startauthor{$_}
+			|| $tagname_firstrecent{$_}
+		)
 	} @$tagname_recent_ar;
-if (!@tagnames_of_interest) { use Data::Dumper; print STDERR "none interesting in '@$tagname_recent_ar', bad: " . Dumper(\%tagname_bad) . "startauthor: " . Dumper(\%tagname_startauthor) . "firstrecent: " . Dumper(\%tagname_firstrecent) . "adminok: " . Dumper(\%tagname_adminok); }
 	return [ ] if !@tagnames_of_interest;
 	my @tagnameids_of_interest = map { $tagname_to_id->{$_} } @tagnames_of_interest;
 	my $tagnameids_of_interest_str = join(',', map { $self->sqlQuote($_) }
@@ -1820,11 +1822,29 @@
 	$self->addCloutsToTagArrayref($tags_ar, 'describe');
 	my %tagnameid_weightsum = ( );
 	my %t_globjid_weightsum = ( );
+	# Admins will care less about new tagnames applied to data types other
+	# than stories, and less about poorly scored items.  Downweight tags
+	# on such objects.
+	my %type_wmult = ( submissions => 0.6, journals => 0.4, urls => 0.2 );
+	my $firehose = getObject('Slash::FireHose');
+	my $fh_min_score;
+	if ($firehose) {
+		$fh_min_score = $firehose->getMinPopularityForColorLevel($constants->{tags_rectn_mincare} || 5);
+	}
 	for my $tag_hr (@$tags_ar) {
 		my $tc = $tag_hr->{total_clout};
 		next unless $tc;
 		my $tagnameid = $tag_hr->{tagnameid};
 		my $globjid = $tag_hr->{globjid};
+		my($type) = $self->getGlobjTarget($globjid);
+		if ($firehose) {
+			my $fhid = $firehose->getFireHoseIdFromGlobjid($globjid);
+			my $item = $firehose->getFireHose($fhid) if $fhid;
+			$tc *= $constants->{tags_rectn_nocaremult}
+				if $item && $item->{userpop} < $fh_min_score;
+		}
+		next unless $tc;
+		$tc *= ($type_wmult{$type} || 1);
 		$tagnameid_weightsum{ $tagnameid } ||= 0;
 		$tagnameid_weightsum{ $tagnameid }  += $tc;
 		$t_globjid_weightsum{ $tagnameid }{ $globjid } ||= 0;
@@ -1865,7 +1885,6 @@
 			globjs =>	\@globjid_data,
 		};
 	}
-use Data::Dumper; print STDERR scalar(localtime) . " rtoi: " . Dumper(\@rtoi);
 
 	return \@rtoi;
 }

Modified: slashjp/trunk/plugins/Tags/mysql_dump.sql
===================================================================
--- slashjp/trunk/plugins/Tags/mysql_dump.sql	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/plugins/Tags/mysql_dump.sql	2007-12-17 13:26:48 UTC (rev 291)
@@ -13,6 +13,8 @@
 INSERT INTO vars (name, value, description) VALUES ('tags_prefixlist_num', '10', 'Number of tagnames returned by listTagnamesByPrefix');
 INSERT INTO vars (name, value, description) VALUES ('tags_prefixlist_priority', 'back bookmark feed hold journal none quik submission story', 'Tagnames to give priority to on autocomplete');
 INSERT INTO vars (name, value, description) VALUES ('tags_prefixlist_priority_score', '999', 'Fake score to give any tagnames from tags_autocomplete_priority which may match a prefix');
+INSERT INTO vars (name, value, description) VALUES ('tags_rectn_mincare', '5', 'Minimum color slice number to "care" about tags for Recent Tagnames (only matters if FireHose installed)');
+INSERT INTO vars (name, value, description) VALUES ('tags_rectn_nocaremult', '0', 'If tags_rectn_mincare excludes an item, how less do we still care? 1=no change, 0=not at all');
 INSERT INTO vars (name, value, description) VALUES ('tags_stories_allowread', '0', 'Who is allowed to see existing tags on stories (incl. search on them)? 0=nobody 1=admins 2=subscribers 2.5=tags_stories_allowread ACL 3=non-neg. karma 4=all logged in (3,4: up to tags_userfrac_read)');
 INSERT INTO vars (name, value, description) VALUES ('tags_stories_allowwrite', '0', 'Who is allowed to tag stories? 0=nobody 1=admins 2=subscribers 2.5=tags_stories_allowwrite ACL 3=non-neg. karma 4=all logged in (3,4: up to tags_userfrac_write)');
 INSERT INTO vars (name, value, description) VALUES ('tags_stories_examples_pre', 'dupe typo', 'Example tags for stories before they go live');

Modified: slashjp/trunk/sql/mysql/defaults.sql
===================================================================
--- slashjp/trunk/sql/mysql/defaults.sql	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/sql/mysql/defaults.sql	2007-12-17 13:26:48 UTC (rev 291)
@@ -1134,6 +1134,7 @@
 INSERT IGNORE INTO vars (name, value, description) VALUES ('takeover_discussion_from_firehose','0','Enable to takeover discussion before approve from firehose');
 INSERT IGNORE INTO vars (name, value, description) VALUES ('today','Today','string of "Today" for translation');
 INSERT IGNORE INTO vars (name, value, description) VALUES ('yesterday','Yesterday','string of "Yesterday" for translation');
+INSERT IGNORE INTO vars (name, value, description) VALUES ('year','','string of year suffix');
 INSERT IGNORE INTO vars (name, value, description) VALUES ('rss_no_tracking_query','0','When "1", the code does not add rss tracking code like "?from=rss".');
 INSERT IGNORE INTO vars (name, value, description) VALUES ('no_d2','0','When "1", disable using discussion2.');
 UPDATE vars SET value='text/html; charset=UTF-8' WHERE name='content_type_webpage';

Modified: slashjp/trunk/sql/mysql/upgrades
===================================================================
--- slashjp/trunk/sql/mysql/upgrades	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/sql/mysql/upgrades	2007-12-17 13:26:48 UTC (rev 291)
@@ -5046,8 +5046,6 @@
 # 2007-11-14
 UPDATE vars SET value = 'T_2_5_0_184' WHERE name = 'cvs_tag_currentcode';
 
-# SLASHDOT LAST UPDATED HERE
-
 # not for slashdot
 UPDATE vars SET value = 'yes no binspam dupe notthebest offtopic stupid slownewsday interesting funny insightful' WHERE name = 'tagbox_top_excludetagnames';
 
@@ -5056,8 +5054,6 @@
 # 2007-12-05
 UPDATE vars SET value = 'T_2_5_0_185' WHERE name = 'cvs_tag_currentcode';
 
-# SLASHCODE/USEPERL LAST UPDATED HERE
-
 # for plugins/Tags
 INSERT INTO ajax_ops VALUES (NULL, 'admin_recenttagnamesbox', 'Slash::Tags', 'ajax_recenttagnamesbox', 'ajax_admin', 'createuse');
 
@@ -5067,3 +5063,15 @@
 # 2007-12-05
 UPDATE vars SET value = 'T_2_5_0_186' WHERE name = 'cvs_tag_currentcode';
 
+# SLASHCODE/USEPERL LAST UPDATED HERE
+
+# SLASHDOT LAST UPDATED HERE
+
+# for plugins/Tags
+UPDATE tagcommand_adminlog SET cmdtype='*' WHERE cmdtype='+';
+INSERT INTO vars (name, value, description) VALUES ('tags_rectn_mincare', '5', 'Minimum color slice number to "care" about tags for Recent Tagnames (only matters if FireHose installed)');
+INSERT INTO vars (name, value, description) VALUES ('tags_rectn_nocaremult', '0', 'If tags_rectn_mincare excludes an item, how less do we still care? 1=no change, 0=not at all');
+
+#For plugins FireHose
+INSERT INTO ajax_ops VALUES (NULL, 'admin_submit_memory', 'Slash::Admin', 'ajax_sub_memory', 'ajax_admin_static', 'use');
+

Modified: slashjp/trunk/tagboxes/Despam/Despam.pm
===================================================================
--- slashjp/trunk/tagboxes/Despam/Despam.pm	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/tagboxes/Despam/Despam.pm	2007-12-17 13:26:48 UTC (rev 291)
@@ -273,7 +273,8 @@
 		 AND firehose.uid = $uid
 		 AND type IN ('submission', 'journal')
 		 AND createtime >= DATE_SUB(NOW(), INTERVAL $daysback DAY)
-		 AND tagnameid = $self->{upvoteid}");
+		 AND tagnameid = $self->{upvoteid}
+		 AND inactivated IS NULL");
 	my $max_clout = defined($constants->{tagbox_despam_upvotermaxclout})
 		? $constants->{tagbox_despam_upvotermaxclout} : '0.85';
 	for my $upvoter (@$upvoter_ar) {

Modified: slashjp/trunk/themes/slashcode/THEME
===================================================================
--- slashjp/trunk/themes/slashcode/THEME	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/themes/slashcode/THEME	2007-12-17 13:26:48 UTC (rev 291)
@@ -129,6 +129,9 @@
 htdoc=htdocs/images/comments.js
 htdoc=htdocs/images/comments2.js
 htdoc=htdocs/images/dumper.js
+htdoc=htdocs/badge.pl
+glob=badgejs:htdocs/badge.js
+badgejs=htdocs/badge.js
 css=htdocs/admin.css
 css=htdocs/base.css
 css=htdocs/comments.css

Copied: slashjp/trunk/themes/slashcode/htdocs/badge.js (from rev 289, slashjp/branches/upstream/current/themes/slashcode/htdocs/badge.js)

Copied: slashjp/trunk/themes/slashcode/htdocs/badge.pl (from rev 289, slashjp/branches/upstream/current/themes/slashcode/htdocs/badge.pl)

Modified: slashjp/trunk/themes/slashcode/htdocs/comments.css
===================================================================
--- slashjp/trunk/themes/slashcode/htdocs/comments.css	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/themes/slashcode/htdocs/comments.css	2007-12-17 13:26:48 UTC (rev 291)
@@ -88,7 +88,7 @@
 	padding: .3em;
 }
 
-.commentshrunk, .commentstatus { font-weight: bold }
+.commentshrunk, .commentstatus, .commentload { font-weight: bold }
 
 .quote {
     margin-bottom: .75em;

Modified: slashjp/trunk/themes/slashcode/htdocs/images/comments.js
===================================================================
--- slashjp/trunk/themes/slashcode/htdocs/images/comments.js	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/themes/slashcode/htdocs/images/comments.js	2007-12-17 13:26:48 UTC (rev 291)
@@ -48,6 +48,15 @@
 var ctrl_down = 0;
 var d2_seen = '';
 
+var adTimerSecs;
+var adTimerClicks;
+var adTimerInsert;
+var adTimerSecsMax   = 120;
+var adTimerClicksMax = 10;
+var adTimerSeen = {};
+var adTimerUrl  = '';
+resetAdTimer();
+
 var agt = navigator.userAgent.toLowerCase();
 var is_firefox = (agt.indexOf("firefox") != -1);
 
@@ -69,7 +78,9 @@
 			} else if (viewmodevalue[mode] >= viewmodevalue['full']) {
 				var cd = fetchEl('comment_otherdetails_' + cid);
 				if (!cd.innerHTML) {
-					cd.innerHTML = '<br><b><big>Loading ...</big></b>';
+					var cs = fetchEl('comment_sub_' + cid);
+					if (cs)
+						cs.innerHTML = '<span class="commentload">Loading ...</span>';
 					fetch_comments.push(cid);
 					fetch_comments_pieces[cid] = 1;
 					doshort = 1;
@@ -152,8 +163,7 @@
 
 	if (abscid == cid) { // expanding == selecting
 		setCurrentComment(cid);
-		if (checkAdTimer(cid))
-			adTimerInsert = cid;
+		checkAdTimer(cid);
 	}
 
 
@@ -183,6 +193,10 @@
 // 
 // 	resetModifiers();
 
+	var was_hidden = 0;
+	if (displaymode[abscid] == 'hidden' || prehiddendisplaymode[abscid] == 'hidden')
+		was_hidden = 1;
+
 	if (alone && alone == 1) {
 		var thismode = abscid == cid ? 'full' : 'oneline';
 		updateDisplayMode(abscid, thismode, 1);
@@ -194,10 +208,12 @@
 
 //	statusdiv.innerHTML = '';
 
-	if (!commentIsInWindow(abscid)) {
+	if (!commentIsInWindow(abscid))
 		scrollWindowTo(abscid);
-	}
 
+	if (was_hidden)
+		updateHiddens([abscid]);
+
 	return false;
 }
 
@@ -352,15 +368,7 @@
 
 	var comment = comments[cid];
 	if (comment && fetchEl('comment_' + cid)) {
-		var was_hidden = 0;
-		if (displaymode[cid] == 'hidden')
-			was_hidden = 1;
-
 		setFocusComment(cid, (collapse ? 2 : 1));
-
-		if (was_hidden)
-			updateHiddens([cid]);
-
 		return false;
 	} else {
 		return true; // follow link
@@ -730,39 +738,22 @@
 				// for some reason the modification done in addComment
 				// invalidates the linkage fetchEl() uses to get
 				// an element, so we need to refetch them
+				// for now, trying on-demand
 				if (is_firefox) {
-					// this is the worst ... not sure what else to do
-					if (root) {
-						var commlist = fetchEl('commentlisting');
-						loadAllElements('span', commlist);
-						loadAllElements('div', commlist);
-						loadAllElements('li', commlist);
-						loadAllElements('a', commlist);
-					} else {
+ 					if (root) {
+ 						reloadForFirefox('commentlisting');
+ 					} else {
 						for (var pid in pids) {
-							var tree = fetchEl('tree_' + pid);
-							loadAllElements('span', commlist);
-							loadAllElements('div', commlist);
-							loadAllElements('li', commlist);
-							loadAllElements('a', commlist);
-						}
-					}
+ 							reloadForFirefox('tree_' + pid);
+ 						}
+ 					}
 				}
 			}
 
 			json_update(response);
 
 			for (var i = 0; i < cids.length; i++) {
-				// this is needed for Firefox
-				// better way to do automatically?
-				if (is_firefox) {
-					loadNamedElement('comment_link_' + cids[i]);
-					loadNamedElement('comment_shrunk_' + cids[i]);
-					loadNamedElement('comment_sig_' + cids[i]);
-					loadNamedElement('comment_otherdetails_' + cids[i]);
-					loadNamedElement('comment_sub_' + cids[i]);
-					loadNamedElement('comment_top_' + cids[i]);
-				}
+				reloadCommentForFirefox(cids[i]);
 				setShortSubject(cids[i]);
 			}
 
@@ -818,18 +809,20 @@
 			}
 			ajaxCommentsStatus(0);
 
-			if (0 && adTimerInsert) {
+			if (adTimerInsert) {
 				var tree = $('tree_' + adTimerInsert);
 				if (tree) {
+					var adcall = '<iframe src="' + adTimerUrl + '" height="110" width="740"></iframe>';
+					var html = '<li id="comment_ad_' + adTimerInsert + '" class="inlinead"> ' + adcall +'  </li>';
+
 					var commtree = $('commtree_' + adTimerInsert);
-					var html = '<li id="comment_ad_' + adTimerInsert + '" class="inlinead"> SLASHDOT AD! </li>';
 					if (commtree) {
 						commtree.innerHTML = html + commtree.innerHTML;
 					} else {
 						tree.innerHTML = tree.innerHTML + '<ul id="commtree_' + adTimerInsert + '">' + html + '</ul>';
 					}
+					resetAdTimer();
 				}
-				adTimerInsert = 0;
 			}
 		}
 	};
@@ -988,17 +981,71 @@
 	return;
 }
 
+function reloadForFirefox(obj_name) {
+	if (is_firefox) {
+		var obj = $(obj_name);
+		loadAllElements('span', obj);
+		loadAllElements('div', obj);
+		loadAllElements('li', obj);
+		loadAllElements('a', obj);
+	}
+}
+
+function reloadCommentForFirefox(cid) {
+	if (is_firefox) {
+		loadNamedElement('comment_link_' + cid);
+		loadNamedElement('comment_shrunk_' + cid);
+		loadNamedElement('comment_sig_' + cid);
+		loadNamedElement('comment_otherdetails_' + cid);
+		loadNamedElement('comment_sub_' + cid);
+		loadNamedElement('comment_top_' + cid);
+	}
+}
+
 function loadNamedElement(name) {
 	commentelements[name] = $(name);
 	return;
 }
 
 function fetchEl(str) {
-	return loaded
-		? (is_firefox ? commentelements[str] : $(str))
-		: $(str);
+	var obj;
+
+	if (loaded && is_firefox) {
+		obj = commentelements[str];
+		// any other special cases to ignore? -- pudge
+		if (!str.match(/^hidestring_/))
+			if (!obj || !grepCommentNode(obj, str))
+				obj = commentelements[str] = $(str);
+	} else {
+		obj = $(str);
+	}
+
+	return obj;
 }
 
+// this is a generalized fix for Firefox, to find orphaned nodes
+// maybe more than we need? keep this around in case we need,
+// but maybe don't use it for now -- pudge
+function grepNode(obj, id) {
+	if (!id)
+		id = '^commentlisting$';
+	var parent = obj.parentNode;
+	if (!parent)
+		return false;
+//	if (parent.nodeName == '#document')
+	if (parent.id.match(id))
+		return parent;
+	return grepNode(parent);
+}
+
+function grepCommentNode(obj, str) {
+	var results = str.match(/^(tree|comment)_(\w+_)?\d+$/);
+	if (results)
+		return grepNode(obj)
+	return true;
+}
+
+
 function finishLoading() {
 	if (is_firefox) {
 		loadAllElements('span');
@@ -1031,6 +1078,7 @@
 			last_updated_comments.push(cid);
 	}
 	last_updated_comments = last_updated_comments.sort(numsort);
+	root_comments = root_comments.sort(numsort);
 
 	if (1 || user_is_admin) {
 		if (window.addEventListener) // DOM method for binding an event
@@ -1627,26 +1675,19 @@
 }
 
 
+function checkAdTimer (cid) {
+	if (!adTimerUrl)
+		return;
 
-var adTimerSecs;
-var adTimerClicks;
-var adTimerInsert;
-var adTimerSecsMax   = 10;
-var adTimerClicksMax = 5;
-var adTimerSeen = {};
-
-resetAdTimer();
-
-function checkAdTimer (cid) {
 	clickAdTimer();
 
 	if (cid && adTimerSeen[cid])
 		return 0;
 
 	var ad = 0;
-	if (adTimerClicks >= adTimerClicksMax)
+	if (adTimerClicks >= adTimerClicksMax) {
 		ad = 1;
-	else {
+	} else {
 		var secs = getSeconds() - adTimerSecs;
 		if (secs >= adTimerSecsMax)
 			ad = 1;
@@ -1655,14 +1696,14 @@
 	if (!ad)
 		return 0;
 
-	if (cid)
-		adTimerSeen[cid] = 1;
-
-	resetAdTimer();
-	return 1;
+	adTimerInsert = cid;
 }
 
 function resetAdTimer () {
+	if (adTimerInsert) {
+		adTimerSeen[adTimerInsert] = 1;
+	}
+	adTimerInsert = 0;
 	adTimerSecs   = getSeconds();
 	adTimerClicks = 0;
 }
@@ -1715,13 +1756,13 @@
 	W: { thread : 1, prev: 1 },
 	S: { thread : 1, next: 1 },
 	Q: { chrono : 1, prev: 1, comment: 1 },
-	E: { chrono : 1, next: 1, comment: 1 },
+	E: { chrono : 1, next: 1, comment: 1 }
 };
 
 validkeys['H'] = validkeys['A'];
 validkeys['L'] = validkeys['D'];
-validkeys['J'] = validkeys['W'];
-validkeys['K'] = validkeys['S'];
+validkeys['J'] = validkeys['S'];
+validkeys['K'] = validkeys['W'];
 
 function keyHandler(e, k) {
 	if (!k)
@@ -1830,11 +1871,15 @@
 		kids = rootSort();
 
 	for (var i = 0; i < kids.length; i++) {
-		var next_cid = kids[i];
-		if (next_cid > old_cid) {
-			if (next_cid)
-				if (!getNextUnread || (next_cid = getNextUnreadCid(next_cid)))
-					return next_cid;
+		var this_cid;
+		if (!old_cid)
+			this_cid = kids[i];
+		else if (kids[i] == old_cid)
+			this_cid = kids[i+1];
+
+		if (this_cid) {
+			if (!getNextUnread || (this_cid = getNextUnreadCid(this_cid)))
+				return this_cid;
 			continue;
 		}
 	}
@@ -1847,7 +1892,7 @@
 }
 
 function commTreePrevComm (cid, to_parent) {
-	var root_kids = root_comments.sort(numsort);
+	var root_kids = rootSort();
 	var comm = comments[cid];
 	var pid = comm.pid;
 
@@ -1877,11 +1922,11 @@
 }
 
 function rootSort() { // maybe cache later
-	return root_comments.sort(numsort);
+	return root_comments; //.sort(numsort);
 }
 
 function sortKids(cid) { // maybe cache later
-	return comments[cid].kids.sort(numsort);
+	return comments[cid].kids; //.sort(numsort);
 }
 
 function isUnread(cid) {

Modified: slashjp/trunk/themes/slashcode/templates/dispCommentDetails;misc;default
===================================================================
--- slashjp/trunk/themes/slashcode/templates/dispCommentDetails;misc;default	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/themes/slashcode/templates/dispCommentDetails;misc;default	2007-12-17 13:26:48 UTC (rev 291)
@@ -29,20 +29,14 @@
 			}, 1, { noextra => 1 }) %])[% END %]
 			<small>
 			[% has_homepage = homepage && homepage.length > 8;
-				has_journal = journal_last_entry_date.search('[1-9]');
-				IF !is_anon && (has_homepage || has_journal) %]
-					<br>
-					([% IF has_homepage %]
-						<a href="[% homepage %]">[% homepage | strip_literal %]</a>
-					[% IF has_journal %]| [% END %]
-					[% END %]
-					[% IF has_journal %]
-						Last Journal:
-						<a href="[% constants.real_rootdir %]/~[% nickname | strip_paramattr %]/journal/">[%
-						Slash.timeCalc(journal_last_entry_date) %]</a>
-					[% END %])
-				[% END %]
-				[% ipid_display %]
+			   has_journal = journal_last_entry_date.search('[1-9]');
+			   IF !is_anon && (has_homepage || has_journal);
+				IF has_homepage %]
+				<a href="[% homepage %]" title="[% homepage %]" class="user_homepage_display">Homepage</a>
+				[% END ; IF has_journal %]
+				<a href="[% constants.real_rootdir %]/~[% nickname | strip_paramattr %]/journal/" title="[% Slash.timeCalc(journal_last_entry_date) %]" class="user_journal_display">Journal</a>
+				[% END ; END %]
+			[% ipid_display %]
 			</small>
 __seclev__
 10000

Modified: slashjp/trunk/themes/slashcode/templates/ipid_display;misc;default
===================================================================
--- slashjp/trunk/themes/slashcode/templates/ipid_display;misc;default	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/themes/slashcode/templates/ipid_display;misc;default	2007-12-17 13:26:48 UTC (rev 291)
@@ -12,13 +12,12 @@
 __name__
 ipid_display
 __template__
-IPID:
-<a href="[%
+<span class="user_ipid_display">[<a href="[%
 gSkin.rootdir %]/users.pl?op=userinfo&amp;userfield=[%
-data.ipid %]&amp;fieldname=ipid">[% data.ipid_vis %]</a>&nbsp;&nbsp;SubnetID:
+data.ipid %]&amp;fieldname=ipid">[% data.ipid_vis %]</a>
 <a href="[%
 gSkin.rootdir %]/users.pl?op=userinfo&amp;userfield=[%
-data.subnetid %]&amp;fieldname=subnetid">[% data.subnetid_vis %]</a>
+data.subnetid %]&amp;fieldname=subnetid">[% data.subnetid_vis %]]</a></span>
 
 __seclev__
 10000

Modified: slashjp/trunk/themes/slashcode/templates/prefs_titlebar;misc;default
===================================================================
--- slashjp/trunk/themes/slashcode/templates/prefs_titlebar;misc;default	2007-12-17 12:30:37 UTC (rev 290)
+++ slashjp/trunk/themes/slashcode/templates/prefs_titlebar;misc;default	2007-12-17 13:26:48 UTC (rev 291)
@@ -20,7 +20,7 @@
 
 user_link = '/users.pl?op=edituser';
 IF constants.modal_prefs_active;
-        user_link = user_link _ "\" onclick=\"getModalPrefs('user', 'User')\; return false";
+        user_link = user_link _ "\" onclick=\"getModalPrefs('user', 'User', 1)\; return false";
 END;
 
 tabs = [
@@ -31,7 +31,7 @@
 IF constants.plugin.Messages;
         messages_link = "/my/messages";
         IF constants.modal_prefs_active;
-                messages_link = messages_link _ "\" onclick=\"getModalPrefs('messages', 'Messages')\; return false";
+                messages_link = messages_link _ "\" onclick=\"getModalPrefs('messages', 'Messages', 1)\; return false";
         END;
         tabs.push(
         { link = messages_link,                 label = "Messages",     sel_label = "messages" },


Slashdotjp-dev メーリングリストの案内
Back to archive index