[MediaWiki-commits] [Gerrit] Add pagestyle, preview and abusefilter modules - change (mediawiki...MobileApp)

2014-04-30 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/130752

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

Add pagestyle, preview and abusefilter modules

Imports from the Android App.

- font.less not added yet
- Embed all images specified here directly. Should help keep
  things simpler.

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, 141 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileApp 
refs/changes/52/130752/1

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 000..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..f20af3e 100644
--- a/less/common.less
+++ b/less/pagestyles.less
@@ -1,3 +1,4 @@
+/* Should be moved out to the MobileApp extension at some point */
 body {
 background-color: #F2F2F2;
 color: #333;
@@ -7,6 +8,10 @@
 margin: 0;
 padding: 0;
 margin-top: 48px;
+
+// Deal with long links (bug 60387)
+word-wrap: break-word;
+
 }
 
 #content {
@@ -21,7 +26,7 @@
 /* Headers */
 h1 {
 font-family: serif;
-color: #064AAD;
+color: #333;
 font-size: 26px;
 line-height: 36px;
 margin-bottom: 24px;
@@ -84,14 +89,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 000..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 000..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 000..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 

[MediaWiki-commits] [Gerrit] Add pagestyle, preview and abusefilter modules - change (mediawiki...MobileApp)

2014-04-30 Thread Brion VIBBER (Code Review)
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 000..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 000..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 000..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 000..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