1 # Methods added to this helper will be available to all templates in the application.
2 module ApplicationHelper
7 return @@theme_prefix if @@theme_prefix
8 @@theme_prefix = '/themes'
9 if ActionController::Base.relative_url_root
10 @@theme_prefix = ActionController::Base.relative_url_root + @@theme_prefix
15 def compute_asset_host(source)
16 if defined? USE_STATIC
17 if source.slice(0, theme_prefix.length) == theme_prefix
18 return "http://static.opensuse.org"
20 return "http://static.opensuse.org/hosts/#{USE_STATIC}"
27 scr = "setCookie('search_baseproject','#{@baseproject}');\n"
29 scr = "var p = getCookie('search_baseproject'); if (p) { $(\"#baseproject option[value='\" + p + \"']\").attr('selected', 'selected'); }\n"
31 "<script type=\"text/javascript\">\n" +