Brion VIBBER has submitted this change and it was merged.

Change subject: Add pagestyle, preview and abusefilter modules
......................................................................


Add pagestyle, preview and abusefilter modules

Imports from the Android App.

- Embed all images specified here directly. This keeps
  relative / absolute URL issues to a minimum.
- font.less not added yet, due to relative URL issues

Change-Id: Ie242037926a8b557c7e5ebb9f841e51a974196c3
---
M MobileApp.php
A images/edit.png
R less/pagestyles.less
A less/preview.less
A less/ui.less
A less/wikihacks.less
6 files changed, 140 insertions(+), 14 deletions(-)

Approvals:
  Brion VIBBER: Verified; Looks good to me, approved



diff --git a/MobileApp.php b/MobileApp.php
index 807dd17..b70f057 100644
--- a/MobileApp.php
+++ b/MobileApp.php
@@ -27,10 +27,30 @@
 
 $wgMessagesDirs['MobileApp'] = __DIR__ . "/i18n";
 
-$wgResourceModules['mobile.app'] = array(
-       'styles' => array(
-               'less/common.less'
-       ),
+$wgCommonMobileAppModuleDef = array(
        'localBasePath' => $localBasePath,
        'remoteExtPath' => $remoteExtPath
 );
+
+$wgCommonMobileAppLESSFiles = array(
+       'less/pagestyles.less',
+       'less/wikihacks.less'
+);
+
+$wgResourceModules['mobile.app.pagestyle'] = array(
+       'styles' => array(
+               'less/ui.less',
+       ) + $wgCommonMobileAppLESSFiles
+) + $wgCommonMobileAppModuleDef;
+
+$wgResourceModules['mobile.app.preview'] = array(
+       'styles' => array(
+               'less/preview.less',
+       ) + $wgCommonMobileAppLESSFiles
+) + $wgCommonMobileAppModuleDef;
+
+$wgResourceModules['mobile.app.abusefilter'] = array(
+       'styles' => array(
+               'less/abusefilter.less',
+       ) + $wgCommonMobileAppLESSFiles
+) + $wgCommonMobileAppModuleDef;
diff --git a/images/edit.png b/images/edit.png
new file mode 100644
index 0000000..4d773a3
--- /dev/null
+++ b/images/edit.png
Binary files differ
diff --git a/less/common.less b/less/pagestyles.less
similarity index 89%
rename from less/common.less
rename to less/pagestyles.less
index ee025ce..faccc8f 100644
--- a/less/common.less
+++ b/less/pagestyles.less
@@ -7,6 +7,10 @@
     margin: 0;
     padding: 0;
     margin-top: 48px;
+
+    // Deal with long links (bug 60387)
+    word-wrap: break-word;
+
 }
 
 #content {
@@ -21,7 +25,7 @@
 /* Headers */
 h1 {
     font-family: serif;
-    color: #064AAD;
+    color: #333;
     font-size: 26px;
     line-height: 36px;
     margin-bottom: 24px;
@@ -84,14 +88,5 @@
     border: 1px solid #ccc;
     margin-top: 4px;
     margin-bottom: 4px;
-}
-
-/* Last updated info */
-#attribution {
-    border-top: 1px solid #ccc;
-    padding: 8px;
-    text-align: center;
-    color: #888;
-    font-size: 80%;
 }
 
diff --git a/less/preview.less b/less/preview.less
new file mode 100644
index 0000000..61b470a
--- /dev/null
+++ b/less/preview.less
@@ -0,0 +1,4 @@
+/* Hide the stupid editlink */
+.edit-page {
+  display: none;
+}
diff --git a/less/ui.less b/less/ui.less
new file mode 100644
index 0000000..4fee95a
--- /dev/null
+++ b/less/ui.less
@@ -0,0 +1,55 @@
+a.edit_section_button {
+    height: 32px;
+    width: 32px;
+       /* @embed */
+    background-image: url("../images/edit.png");
+    background-size: 32px 32px;
+    float: right;
+    display: inline-float;
+}
+
+.no-editing {
+    .edit_section_button {
+        display: none;
+    }
+}
+
+.content-rtl a.edit_section_button {
+    float: left;
+    /* Flip it! */
+    -webkit-transform: scaleX(-1);
+    transform: scaleX(-1);
+}
+
+/* Loading animation in pure CSS
+   Thanks to http://dabblet.com/gist/7708654 */
+.loading {
+    border: 4px solid rgba(0, 0, 0, .1);
+    border-top: 4px solid rgba(0, 0, 0, .4);
+    border-radius: 100%;
+    -webkit-animation: rot .6s infinite linear;
+}
+
+@-webkit-keyframes rot {
+    from {
+        -webkit-transform: rotate(0deg);
+    }
+    to {
+        -webkit-transform: rotate(359deg);
+    }
+}
+
+#loading_sections {
+    margin: 8px auto;
+    height: 24px;
+    width: 24px;
+}
+
+/* Last updated info */
+#attribution {
+  border-top: 1px solid #ccc;
+  padding: 8px;
+  text-align: center;
+  color: #888;
+  font-size: 80%;
+}
diff --git a/less/wikihacks.less b/less/wikihacks.less
new file mode 100644
index 0000000..df4d440
--- /dev/null
+++ b/less/wikihacks.less
@@ -0,0 +1,52 @@
+/*
+Imported from MobileFrontend. Should be made into a live link later.
+A file for css that corrects known rendering issues on known Wikimedia wikis.
+
+the following definitions exist to deal with certain inline styles
+present in wikitext.
+This file should not need to exist
+It will become redundant when the following RFC is resolved:
+https://www.mediawiki.org/wiki/Requests_for_comment/Allow_styling_in_templates
+
+FIXME: Review all of these hacks to see if they still apply.
+*/
+
+/* Hide some on-wiki defined classes
+   - Issue boxes, Nav Boxes, co-ordinates are hidden
+   - Investigate alternative ways of surfacing those */
+
+.ambox,
+#coordinates,
+  // Hide article badges, clean-up notices, stub notices, and navigation boxes
+.navbox, .vertical-navbox, .topicon, .metadata {
+  // It's important as some of these are tables which become display: table on 
larger screens
+  display: none !important;
+}
+
+/* Galleries */
+/* See 
https://www.mediawiki.org/wiki/Help:Images#Rendering_a_gallery_of_images */
+
+ul.gallery {
+  width: 100% !important;
+  max-width: 100% !important;
+
+  li.gallerybox {
+    width: auto !important;
+
+    > div {
+      width: auto !important;
+
+      > div.thumb {
+        width: auto !important;
+      }
+    }
+  }
+}
+
+.hlist > ul, // FIXME: to support hlists on enwiki projects - this should be 
deprecated
+ul.hlist {
+  li {
+    display: inline-block;
+    margin-right: 8px;
+  }
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/130752
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie242037926a8b557c7e5ebb9f841e51a974196c3
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileApp
Gerrit-Branch: master
Gerrit-Owner: Yuvipanda <yuvipa...@gmail.com>
Gerrit-Reviewer: Brion VIBBER <br...@wikimedia.org>
Gerrit-Reviewer: Dbrant <dbr...@wikimedia.org>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Yuvipanda <yuvipa...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to