Code Monkey home page Code Monkey logo

twinkle's Introduction

Twinkle

Twinkle is a JavaScript library and application that gives Wikipedians a quick way of performing common maintenance tasks, such as nominating pages for deletion and cleaning up vandalism.

It is based upon the morebits.js library, which forms the basis for many Wikipedia scripts and editing tools.

See Wikipedia:Twinkle on the English Wikipedia for more information.

AzaToth is the original author and maintainer of the tool, as well as the morebits.js library.

Updating scripts on Wikipedia

To generate the concatenated Twinkle script, use the following bash command:

awk 'FNR==1{print ""}{print}' twinkle.header.js modules/*.js twinkle.footer.js > alltwinkle.js

Then you will be able to upload alltwinkle.js to MediaWiki:Gadget-Twinkle.js. This does not include morebits.js and morebits.css; these have to be uploaded separately.

If morebits.js and/or morebits.css need to be updated, they should be synched to these places:

MediaWiki:Gadgets-definition should contain the following line:

* Twinkle[ResourceLoader|dependencies=jquery.ui.dialog,jquery.tipsy]|morebits.js|morebits.css|Twinkle.js

Synchronization (for developers)

There is a synchronization script called sync.pl, which can be used to pull and push files to Wikipedia.

The program depends on Perl 5.10 and the modules Git::Repository and MediaWiki::Bot, which can be installed easily using App::cpanminus:

cpanm --sudo install Git::Repository MediaWiki::Bot

When running the program, you can enter your credentials on the command line using the --username and --password parameters, but it is recommended to save them in a file called ~/.mwbotrc using the following format:

username => "Username",
password => "password",
base     => "User::Username"

where base is the wiki path to prefix the files for pull and push.

Notice that your working directory must be clean; if not, either stash or commit your changes.

To pull user Foobar's changes, do:

./sync.pl --base User:Foobar --pull morebits.js

To push your changes to Foobar's wiki page, do:

./sync.pl --base User:Foobar --push morebits.js

There is also an deploy command to deploy the new files live.

./sync.pl --deploy twinkle.js
make deploy

The edit summary will contain the branch, the last commit sha, and the oneliner for that commit.

Style guideline

While old legacy code has many different and incoherent styles, it has been decided to utilize a more coherent style throughout the code.

The jQuery Core Style Guideline is what we will hereafter use as our style guideline.

twinkle's People

Contributors

atlight avatar azatoth avatar amalthea avatar uncledouggie avatar kevinji avatar qedk avatar loganrosen avatar ioeth avatar ebe123 avatar theopolisme avatar jimmyxu avatar hartman avatar marcusq avatar mariushoch avatar

Watchers

James Cloos 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.