Changeset 5026
- Timestamp:
- 01/20/08 11:49:10 (5 years ago)
- Location:
- platform/tdiary
- Files:
-
- 2 removed
- 2 modified
-
doc/ja/account_ad.txt (modified) (1 diff)
-
plugin/account_ad.rb (modified) (2 diffs)
-
plugin/en/account_ad.rb (deleted)
-
plugin/ja/account_ad.rb (deleted)
Legend:
- Unmodified
- Added
- Removed
-
platform/tdiary/doc/ja/account_ad.txt
r5024 r5026 6 6 7 7 ! 更新履歴 8 !! 20080120 9 * openid.rb をベースにリファクタリング 8 10 9 11 !! 20070109 -
platform/tdiary/plugin/account_ad.rb
r3326 r5026 1 1 # account_ad.rb $Revision: 1.3 $ 2 2 # 3 # Copyright (c) 200 5SHIBATA Hiroshi <h-sbt@nifty.com>3 # Copyright (c) 2008 SHIBATA Hiroshi <h-sbt@nifty.com> 4 4 # Distributed under the GPL 5 5 # 6 6 7 add_header_proc do 8 account_ad_init 9 10 account_name = @conf['account.name'] 11 account_service = @conf['account.service'] 12 13 if @mode == "day" 14 permalink=@conf.base_url+anchor(@date.strftime('%Y%m%d')) 15 else 16 permalink=@conf.base_url 17 end 18 19 if account_name.length > 0 then 20 <<-HTML 7 if /^(latest|day|conf|saveconf)$/ =~ @mode then 8 9 @account_ad_list = { 10 # Service => ServiceHomepage 11 'Hatena' => 'https://www.hatena.ne.jp/', 12 } 13 14 if @conf['account.service'] and @conf['account.name'] then 15 if @mode == "day" 16 permalink=@conf.base_url+anchor(@date.strftime('%Y%m%d')) 17 else 18 permalink=@conf.base_url 19 end 20 21 account_service = @account_ad_list[@conf['account.service']] 22 account_name = @conf['account.name'] 23 24 add_header_proc do 25 result = <<-HTML 21 26 <!-- 22 27 <rdf:RDF … … 34 39 </rdf:RDF> 35 40 --> 36 HTML37 else38 ''41 HTML 42 result.gsub( /^\t\t/, '' ) 43 end 39 44 end 40 45 end 41 46 42 def account_ad_init 43 @conf['account.name'] ||= "" 44 @conf['account.service'] ||= "http://www.hatena.ne.jp/" 45 end 47 add_conf_proc( 'account_ad', 'Account Auto-Discovery' ) do 46 48 47 if @mode == 'saveconf' 48 def saveconf_account_ad 49 if @mode == 'saveconf' then 49 50 @conf['account.name'] = @cgi.params['account.name'][0] 50 51 @conf['account.service'] = @cgi.params['account.service'][0] 51 end 52 end 53 54 options = '' 55 @account_ad_list.each_key do |key| 56 options << %Q|<option value="#{h key}"#{" selected" if @conf['account.service'] == key}>#{h key}</option>\n| 57 end 58 59 <<-HTML 60 <h3 class="subtitle">Account Service</h3> 61 <p><select name="account.service"> 62 #{options} 63 </select></p> 64 <h3 class="subtitle">Account Name</h3> 65 <p><input name="account.name" value="#{h @conf['account.name']}" /></p> 66 HTML 52 67 end
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)