Olemis Lang avatar Olemis Lang committed 5e40311

TracMac: Improved support for NetSurf. Minor fix in preferences.

Comments (0)

Files changed (4)

   - Netsurf 1.2-1 build 1
     - No JavaScript.
     - No hover.
-    - Issues with hiding fake toolbar.
-- Repair issues found using NetSurf
-  - Show ctxtnav hidden by logo and header.
-  - Show metanav hidden by logo and header.
-  - Hide toolbar replacement shown at the bottom.
+    + Issues with hiding fake toolbar.
++ Repair issues found using NetSurf
+  + Show ctxtnav hidden by logo and header.
+  + Show metanav hidden by logo and header.
+  + Hide toolbar replacement shown at the bottom.
 
 

tracmacos/htdocs/mac.css

 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-Trac custom stylesheet for Example theme 
+Trac custom stylesheet for Trac Mac OS theme 
 */
 
 .nav ul {
   color: #333333;
 }
 
+/* Preferences */
+
+#content.prefs #tabs {
+  background: none repeat scroll 0 0 transparent;
+}
+
 /* Styles for PyDoc macro */
 
 tr.pydocheading, font.pydocheading {

tracmacos/htdocs/netsurf.css

+/* 
+# Copyright (c) 2010 Olemis Lang. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+Trac custom stylesheet used to fix issues found when 
+browsing with NetSurf the Trac sites where Trac Mac OS theme 
+is installed.
+
+Main difference between this and other browser is that it 
+doesn't support JavaScript nor any other dynamic behaviors 
+(e.g. CSS `hover`).
+*/
+
+#mactb_min {
+  display: none;
+}
+
+#banner {
+  /* 
+  display: none
+  */
+  margin-top: 30px;
+  padding-top: 0px;
+}
+

tracmacos/theme.py

 from trac.config import Option, IntOption, ListOption
 from trac.util.translation import _
 from trac.web.api import IRequestFilter, IRequestHandler, RequestDone
-from trac.web.chrome import add_script
+from trac.web.chrome import add_script, add_stylesheet
 
 from genshi.builder import Markup, Element, Fragment, tag
 from genshi.input import XML
     BROWSER_BLACKLIST = [
                         '; MSIE ',
                         '; Dillo',
-                        'NetSurf',
+#                        'NetSurf',
                         ]
     BROWSER_BLACKLIST = '|'.join('(?:%s)' % x for x in BROWSER_BLACKLIST)
     BROWSER_SUPPORTED = [
                         ('SeaMonkey', 'http://www.seamonkey-project.org/releases'),
                         ('Konqueror', 'http://konqueror.kde.org'),
                         ('Midori', 'http://www.twotoasts.de/index.php?/pages/midori_summary.html'),
-#                        ('Netsurf', 'http://www.netsurf-browser.org'),
+                        ('Netsurf', 'http://www.netsurf-browser.org'),
                         ]
     
     # IRequestFilter methods
         add_script(req, '/chrome/theme/jquery.jqDock.min.js')
         add_script(req, '/chrome/theme/animatedcollapse.js')
         add_script(req, '/chrome/theme/jquery.cookie.js')
+        # Send browser specific files
+        ua = dict(req._inheaders).get('user-agent')
+        if 'NetSurf' in ua :
+            add_stylesheet(req, '/chrome/theme/netsurf.css');
         
     def _prepare_request(self, req):
         def to_text(fragment):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.