]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Added ability to define mobile stylesheets (handheld, screen) at the
authorSarven Capadisli <csarven@status.net>
Sun, 4 Oct 2009 16:26:04 +0000 (16:26 +0000)
committerSarven Capadisli <csarven@status.net>
Sun, 4 Oct 2009 16:26:04 +0000 (16:26 +0000)
theme level. If there are no mobile stylesheets in the theme
directory, it will use the ones that come with the plugin.

plugins/MobileProfile/MobileProfilePlugin.php
plugins/MobileProfile/mp-handheld.css [new file with mode: 0644]
plugins/MobileProfile/mp-screen.css [new file with mode: 0644]

index 02a732493e0cce0d3fe900fd2b14534b69ae4063..35756cfe79e425d16f22585f03f066ea48dd9429 100644 (file)
@@ -158,6 +158,30 @@ class MobileProfilePlugin extends WAP20Plugin
     }
 
 
+    function onStartShowStatusNetStyles($action) {
+        if (file_exists(theme_file('css/mp-screen.css'))) {
+            $action->cssLink('css/mp-screen.css', null, 'screen');
+        }
+        else {
+            $action->element('link', array('rel' => 'stylesheet',
+                                         'type' => 'text/css',
+                                         'href' => common_path('plugins/MobileProfile/mp-screen.css') . '?version=' . STATUSNET_VERSION,
+                                         'media' => 'screen'));
+        }
+
+        if (file_exists(theme_file('css/mp-handheld.css'))) {
+            $action->cssLink('css/mp-handheld.css', null, 'handheld');
+        }
+        else {
+            $action->element('link', array('rel' => 'stylesheet',
+                                         'type' => 'text/css',
+                                         'href' => common_path('plugins/MobileProfile/mp-handheld.css') . '?version=' . STATUSNET_VERSION,
+                                         'media' => 'handheld'));
+        }
+
+        return false;
+    }
+
 
     function onStartShowAside($action)
     {
diff --git a/plugins/MobileProfile/mp-handheld.css b/plugins/MobileProfile/mp-handheld.css
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/plugins/MobileProfile/mp-screen.css b/plugins/MobileProfile/mp-screen.css
new file mode 100644 (file)
index 0000000..31986ee
--- /dev/null
@@ -0,0 +1 @@
+@import url(../../theme/base/css/display.css);