~ubuntu-branches/ubuntu/utopic/tdiary/utopic

« back to all changes in this revision

Viewing changes to misc/plugin/whatsnew.rb

  • Committer: Bazaar Package Importer
  • Author(s): Daigo Moriwaki
  • Date: 2011-04-11 21:53:16 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110411215316-ih4gt4q8p29d2wf8
Tags: 3.0.1-1
* New upstream release (Closes: #542801, #594947)
* debian/control:
 - Bumped up Standards-Version to 3.9.1.
 - Updated version dependency.
* debian/tdiary-setup.rb: Followed the upstream changes, incorporating js and
  index.fcgi

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# whatsnew.rb $Revision: 1.4 $
2
 
#
3
 
# ̾�Ρ�
4
 
# What's New�ץ饰����
5
 
#
6
 
# ���ס�
7
 
# ̤�ɤΥ��������˻��ꤷ���ޡ�����Ĥ��뤳�Ȥ��Ǥ��ޤ���
8
 
#
9
 
# �Ȥ�����
10
 
# tdiary.conf �� @section_anchor ����Ƭ�˰ʲ��Τ褦�� <%= whats_new %> ���ɲä��ޤ���
 
1
# -*- coding: utf-8 -*-
 
2
# whatsnew.rb
 
3
#
 
4
# 名称:
 
5
# What's Newプラグイン
 
6
#
 
7
# 概要:
 
8
# 未読のセクションに指定したマークをつけることができます.
 
9
#
 
10
# 使い方:
 
11
# tdiary.conf の @section_anchor の先頭に以下のように <%= whats_new %> を追加します.
11
12
#
12
13
#   @section_anchor = '<%= whats_new %><span class="sanchor">_</span>'
13
14
#
14
 
# ����������̤��/���ɤˤ�ä� <%= whats_new %> ����ʬ�����餫�����
15
 
# �ꤷ���ޡ������֤��������ޤ����ǥե���ȤǤ�̤�ɥ��������Ǥ�
16
 
# "!!!NEW!!!"�����ɥ��������Ǥ� "" ��Ÿ������ޤ���
17
 
#
18
 
# ����Revision �� 1.1 �� whats_new.rb �������Ǥϡ�<span> �����
19
 
#     <%= whats_new %> ��ޤ��褦�˽񤤤Ƥ��ޤ�������sanchor�Dz�����
20
 
#     ɽ������褦�ʥơ��ޤǤϡ�whats_new �ν��Ϥ� sanchor �β�������
21
 
#     �ʤäƤ��ޤ��Ȥ������꤬����ޤ�����
22
 
#     �����ѹ���ȼ�������ɻ��Υǥե���Ȥ� '' ���ѹ����ޤ�����
23
 
#
24
 
# �֤���������ʸ������ѹ����������� tdiary.conf ���
 
15
# セクションの未読/既読によって <%= whats_new %> の部分があらかじめ指
 
16
# 定したマークで置き換えられます.デフォルトでは未読セクションでは
 
17
# "!!!NEW!!!",既読セクションでは "" に展開されます.
 
18
#
 
19
# 注:Revision が 1.1 の whats_new.rb の説明では,<span> の中に
 
20
#     <%= whats_new %> を含めるように書いていましたが,sanchorで画像を
 
21
#     表示するようなテーマでは,whats_new の出力と sanchor の画像が重
 
22
#     なってしまうという問題がありました.
 
23
#     この変更に伴い,既読時のデフォルトは '' に変更しました.
 
24
#
 
25
# 置き換えられる文字列を変更したい場合は tdiary.conf 中で
25
26
#
26
27
#   @options['whats_new.new_mark'] = '<img src="/Images/new.png" alt="NEW!" border="0">'
27
 
#   @options['whats_new.read_mark'] = '��'
 
28
#   @options['whats_new.read_mark'] = '既'
28
29
#
29
 
# �Τ褦�˻��ꤷ�ޤ���
 
30
# のように指定します.
30
31
#
31
32
# Copyright (c) 2002 Junichiro KITA <kita@kitaj.no-ip.com>
32
33
# Distributed under the GPL
41
42
        if t > @whats_new[:this_time]
42
43
                @whats_new[:this_time] = t
43
44
        end
44
 
        # ���⤷���� cookie ��Ȥ�ʤ�����ξ��ϵ�ǽ���ʤ�
 
45
        # 初回もしくは cookie を使わない設定の場合は機能しない
45
46
        return apply_plugin( @whats_new[:read_mark] ) if @whats_new[:last_time] == "00000000000"
46
47
        if t > @whats_new[:last_time]
47
48
                apply_plugin( @whats_new[:new_mark] )
64
65
                if @cgi.cookies['tdiary_whats_new'][0]
65
66
                        @whats_new[:this_time] = @whats_new[:last_time] = @cgi.cookies['tdiary_whats_new'][0]
66
67
                else
67
 
                        # ���ơ��⤷���� cookie �ϻȤ�ʤ�����
 
68
                        # 初めて,もしくは cookie は使わない設定
68
69
                        @whats_new[:this_time] = @whats_new[:last_time] = "00000000000"
69
70
                end
70
71
                @whats_new[:new_mark] = @options['whats_new.new_mark'] || '!!!new!!!'
89
90
        end
90
91
        ""
91
92
end
 
93
 
 
94
# Local Variables:
 
95
# mode: ruby
 
96
# indent-tabs-mode: t
 
97
# tab-width: 3
 
98
# ruby-indent-level: 3
 
99
# End:
92
100
# vim: ts=3