File: jquery_ui_theme.rb

package info (click to toggle)
tdiary-contrib 5.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,576 kB
  • ctags: 1,957
  • sloc: ruby: 16,900; lisp: 514; xml: 451; php: 61; sql: 40; sh: 35; makefile: 33
file content (55 lines) | stat: -rw-r--r-- 1,179 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# -*- coding: utf-8 -*-
#
# jquery_ui.rb - use jQuery UI
#
# Copyright (C) 2012, tamoot <tamoot+tdiary@gmail.com>
# You can redistribute it and/or modify it under GPL.
#

#
# not support
#
return if feed?

add_header_proc do
   if /\A(?:form|preview|append|edit|update)\z/ =~ @mode

      themes   = @conf['jquery_ui.theme']
      if themes.nil? || theme == ''
         themes = 'base'
      end

      jquery_ui = ''
      jquery_ui << %Q|<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/#{themes.downcase}/jquery-ui.css"/>\n|
      jquery_ui

   else
      ''

   end

end

add_conf_proc( 'jquery_ui_theme', 'jQuery UI Theme' ) do
   if @mode == 'saveconf' then
      @conf['jquery_ui.theme'] = @cgi.params['jquery_ui.theme'][0]

   end

   <<-HTML
   <h3 class="subtitle">Theme name</h3>
   <p><input name="jquery_ui.theme" value="#{h @conf['jquery_ui.theme']}" size="40"></p>
   <p>sample) blitzer, flick .. <a href="http://jqueryui.com/themeroller/">See JQuery UI Theme.</a></p>
   <p>default is <b>base</b>.</p>
   HTML

end


# Local Variables:
# mode: ruby
# indent-tabs-mode: t
# tab-width: 3
# ruby-indent-level: 3
# End:
# vim: ts=3