Giter VIP home page Giter VIP logo

mobilefrontend's Introduction

Table of Contents

MobileFrontend Extension

Fork of https://gerrit.wikimedia.org/r/p/mediawiki/extensions/MobileFrontend.git

The MobileFrontend extension adds a mobile view to your mediawiki instance.

Installation

See https://www.mediawiki.org/wiki/Extension:MobileFrontend#Installation

Configuration

See https://www.mediawiki.org/wiki/Extension:MobileFrontend#Configuration_settings

Development

CSS

We currently use http://lesscss.org/ to generate stylesheets. Ensure when you contribute CSS code you update the less files in stylesheets/less and to generate run:

make less

To install less via npm (node package manager)

npm install less

When installed you may need to update your PATH so that you can run the lessc compiler. To do this edit your path (on OSX found in ~/.profile) like so (note your path may differ):

export PATH=/Users/{username}/.npm/less/1.3.0/package/bin/.

Ensure all css passes the style guidelines When adding a javascript module, ensure that the css module has the same name. e.g. javascripts/modules/mf-toggle.js has the corresponding less/css stylesheets stylesheets/less/modules/mf-toggle.less and stylesheets/modules/mf-toggle.css

Introduce any browser specific patches in the relevant stylesheet. If the browser does not have its own stylesheet considering adding one in DeviceDetection.php

NEVER use attribute selectors - these are known to cause issues in the phonegap app which shares some of this codebase.

Javascript

Javascript can be found in the javascript folder. Any javascript committed to the core must pass the style guidelines

JSHint

Install JSHint npm install jshint -g

Pre-commit hook

A pre-commit hook is provided in the scripts directory to assist with adhering to javascript code standards as well as running code through jshint. Install like so: ln -s $PWD/scripts/pre-commit .git/hooks/pre-commit chmod +x scripts/pre-commit It will run every time you run git commit

HTML

HTML should validate via http://validator.w3.org/ - note at the current time do not worry about markup introduced via wikitext.

Images

If you are adding images to the extension please ensure they have been optimised beforehand.

Committing

  • Commits are important as they give the reviewer more information to successfully review your code and find errors or potential problems you might not have thought of
  • Commits are also useful when troubleshooting issues and refactoring. If it's not clear why a line of code is in the repository important bug fixes could be lost.
  • Commits should be as minor as possible. Please avoid removing unrelated console.log statements, fixing unrelated whitespace etc.. do that in a separate commit which mentions the word cleanup.
  • First line commit should summarise the commit with bug it fixes if applicable. e.g. Fix problem with toggling see bug x
  • Second line should be blank
  • Third line should go into detail where necessary providing links to blog posts/other bugs to provide more background. Mention the platforms/browsers the change is for where necessary
    • e.g. 'this is a problem on Android but not OSX see http://<url></url> which explains problem in detail'
    • e.g. 'this is a workaround for a known bug in opera mobile see http://<url></url>'

Testing

Run Test Suite

To run the full test suite run

make tests

Note currently unit tests are run in the browser. It would be great to have these run using phantomjs - if anyone wants to take that challenge that would be awesome.

Unit tests

Javascript: Before commiting anything please ensure that you run Special:JavaScriptTest/qunit - ensure you do this on the desktop site! PHP: PHP tests can be run the normal way. See http://www.mediawiki.org/wiki/Manual:PHP_unit_testing/Writing_unit_tests_for_extensions for explanations on how to exclusively run php unit tests for the MobileFrontend extension.

Selenium tests

To run the Selenium tests you will have to install Ruby (for the exact version see tests/acceptance/.rvmrc), the latest version of RubyGems and Firefox.

The easiest way to install Ruby on *nix is RVM (https://rvm.io/) and on Windows RubyInstaller (http://rubyinstaller.org/).

Open terminal in tests/acceptance. Update RubyGems and install required gems with:

  gem update --system
  gem install bundler
  bundle install

Run the tests with:

  bundle exec rake

HTML report is created at tests/acceptance/reports and XML report (for Jenkins) is created at tests/acceptance/reports/junit.

Jenkins is hosted at https://wmf.ci.cloudbees.com/ and it drives browsers at http://saucelabs.com/

mobilefrontend's People

Contributors

jrobson avatar jdlrobson avatar awjrichards-zz avatar translatewiki avatar maxsem avatar reedy avatar siebrand avatar bvibber avatar zeljkofilipin avatar hartman avatar atdt avatar raymondde avatar krinkle avatar yllierop avatar jeesmon avatar amire80 avatar hashar avatar mary-kate avatar hexmode avatar mgrover avatar tstarling avatar yuvipanda avatar kghbln avatar srikanthlogic avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.