view · edit · sidebar · attach · print · history

20120928-update-css-template-script-style-chooser

<< 20121001-sponsorlink-update-fi-search-update-style-chooser | 2012 | 20120927-debug-loadpath-of-production-server-sbsm-update >>


Summary

  • Created Style chooser for gcc flavor.
  • Updated update_css script

Commits

Index


Tried css class replace in to_html method.

I could not replace all style, expectedly. Because oddb.org have style and class and id in various place (view, lookandfeel etc.).

tried replace in to_html method. But this was not good way.

in pubictemplate.rb

      def to_html(context)
        html = super
        # oddb-style
        if style = @session.get_cookie_input(:style) and
           @lookandfeel.attributes(:styles).keys.include?(style)
          # html tags
          html.gsub!(/<TH>/) { "<th class=\"th-#{style}\">" }
          # css classes
          html.gsub!(/<(TABLE|TH|TD|A)(\s?class=\")([A-z\s\-_]*)(\")/i) {
            klass = $&.dup
            %w[th heading navigation atc explain sidebar].each do |target|
              klass.gsub!(/#{target}/, "#{target}-#{style}")
            end
            klass
          }
        end
        html
      end

update css template

Currently, generated css by update_css is old. applied current oddb.css to template.css

First I refactored CSS generator script.

  • bin/update_css
  • data/css/template.css
  • src/util/csstemplate.rb

Update update_css script

Update update_css script to generate css for oddb.org(gcc) style.

  • oddb-red.css
  • oddb-blue.css
  • oddb-olive.css
commit

Commits


Added full chapter option for fachinfo_search

  • If Search Term with this option given, then show matched full chapter and term highlight.
  • If this option without term given, then show all chapter.
commit

Added logo image switching

changed Logo image by style.

commit
view · edit · sidebar · attach · print · history
Page last modified on December 16, 2013, at 04:32 PM