[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Debian JP master SVN www commits (rev.205)
=======================================================
Repository: /org/svn.debian.or.jp/repos
Revision: 205
Commiter: kmuto
Date: 2007-03-09 15:28:44 +0900 (金, 09 3月 2007)
=======================================================
Log:
implemented random-screen-shot.
=======================================================
Changed:
U www/trunk/include/page
U www/trunk/src/index.tt2
A www/trunk/src/screen.js
U www/trunk/ttreerc
Modified: www/trunk/include/page
===================================================================
--- www/trunk/include/page 2007-03-08 22:40:20 UTC (rev 204)
+++ www/trunk/include/page 2007-03-09 06:28:44 UTC (rev 205)
@@ -23,6 +23,9 @@
<link rel="alternate" type="application/rss+xml" title="RSS" href="[% PATH %]/blog/index.cgi/index.rss">
[% END %]
<link rev="made" href="webadmin at debian.or.jp">
+[% IF template.name == "index.tt2" %]
+ <script type="text/Javascript" src="screen.js" charset="EUC-JP"></script>
+[% END %]
<title>Debian JP Project - [% title %]</title>
</head>
<body>
Modified: www/trunk/src/index.tt2
===================================================================
--- www/trunk/src/index.tt2 2007-03-08 22:40:20 UTC (rev 204)
+++ www/trunk/src/index.tt2 2007-03-09 06:28:44 UTC (rev 205)
@@ -29,7 +29,13 @@
</p><p>
Debian は 1,000 人以上ものフリーソフトウェア開発者の集合である <a href="[% wwworg %]/">Debian Project</a> によって開発されており、次のような優れた特徴を持っています。
</p>
- <p><a href="image/gnome.png"><img src="image/gnomesmall.png" alt="Debian GNOME desktop image"></a></p>
+ <p><script language="JavaScript1.2">
+<!--
+show_screen(0);
+// --></script>
+ <noscript>
+ <a href="image/gnome.png"><img src="image/gnomesmall.png" alt="Debian GNOME desktop image"></a>
+ </noscript></p>
<ul>
<li>Debian GNU/Linux の <strong>15,000 個以上もの多様なソフトウェア</strong>をすぐに利用可能</li>
Added: www/trunk/src/screen.js
===================================================================
--- www/trunk/src/screen.js (rev 0)
+++ www/trunk/src/screen.js 2007-03-09 06:28:44 UTC (rev 205)
@@ -0,0 +1,49 @@
+function img(url, file, name, width, height, weight) {
+ this.url = url;
+ this.file = file;
+ this.name = name;
+ this.width = width;
+ this.height = height;
+ this.weight = weight;
+}
+
+var image = new Array(
+ new img("image/gnome.png", "image/gnomesmall.png", "Debian GNOME desktop image", "272", "204", 5)
+ // You can add another images:
+ // , new img(fullsize_image, thumbnail_image, ALT_message, width, height, weight )
+ );
+
+var choice = new Array();
+for (i = 0; i < image.length; i++) {
+ for (i2 = 0; i2 < image[i].weight; i2++) {
+ choice = choice.concat(i);
+ }
+}
+
+var presented = new Array(choice.length);
+
+function show_screen(pat) {
+ check = 1;
+ count = 0;
+ while (check == 1 && count < 20) {
+ n = parseInt(Math.random() * choice.length);
+ for (i = 0; i < pat; i++) {
+ if (choice[n] == presented[i]) break;
+ }
+
+ if (choice[n] != presented[i]) {
+ presented[pat] = choice[n];
+ check = 0;
+ }
+ count++;
+ if (count == 20) n = 0;
+ }
+
+ document.writeln("<a href=\"" + image[choice[n]].url + "\">"
+ + "<img src=\"" + image[choice[n]].file + "\""
+ + " alt=\"" + image[choice[n]].name + "\""
+ + " title=\"" + image[choice[n]].name + "\""
+ + " width=\"" + image[choice[n]].width + "\""
+ + " height=\"" + image[choice[n]].height + "\""
+ + "></a>");
+}
Modified: www/trunk/ttreerc
===================================================================
--- www/trunk/ttreerc 2007-03-08 22:40:20 UTC (rev 204)
+++ www/trunk/ttreerc 2007-03-09 06:28:44 UTC (rev 205)
@@ -45,6 +45,7 @@
copy = \.ent$
copy = \.sgml$
copy = \.css$
+copy = \.js$
# by default, everything not ignored or copied is accepted; add 'accept'
# lines if you want to filter further. e.g.