Greasemonkey Manual:Editing: Difference between revisions

From GreaseSpot Wiki
Jump to navigationJump to search
m (Reverted edits by 109.182.107.254 (Talk) to last revision by Arantius)
No edit summary
Line 1: Line 1:
__NOTOC__
Digmaan sa Oppresso Liber (06.01.2011 4:52:22)
{{Greasemonkey Manual TOC}}
Tiga Sugod: REDnhoJ galing RedPhulah
== User Script Flow ==
Tiga Depensa: Batista69 galing 7TH-Evolution 1, Xbytes galing Oppresso Liber, Seventh First, Deo Vindice
 
Kinalabasan ng labanan
A [[user script]] is a plain text file with a file extension of <code>.user.js</code>.
Tiga Sugod
Typically a [[Metadata Block]] is included.  Although this is not strictly required '''it is highly recommended'''.
 
Creation of a [[user script]] can be done with any plain text editor. Upon completion of a script it may be distributed via any server method available or even a specialized user script hosting site such as [http://userscripts.org userscripts.org].
 
The tricky part of course is what happens between starting a script and when the script is finished.
Manually walking through all the steps will ensure common understanding of what is going on.
 
Mga Kalaban 0 (-400) 7 (-0) 10 (-0) 0 (-250) 35 (-0) - 0 (-100)
== Picking an Editor ==
Tiga Depensa
Most script authors use a familiar built in text editor such as Windows Notepad, Linux KDE Kwrite/Kate, Linux Gnome gedit, or Mac OS X TextEdit.
Xbytes 948 (-180) 36 (-0) - 112 (-311) 30 (-0) - 116 (-3)
Many other editors are available that provide features to make programming easier.
Tauhan ng kaalyansa
For more information, and choices, see Wikipedia's [http://en.wikipedia.org/wiki/Comparison_of_text_editors comparison of text editors].
-
 
== Creating the Script ==
-
 
Begin with creating the text file in a favorite plain text editor. It should contain the [[Metadata Block]] with at least  the [[Metadata Block#.40name|@name]], [[Metadata Block#.40namespace|@namespace]], a brief [[Metadata Block#.40description|@description]] and any appropriate [[Metadata Block#.40include|@include]] and [[Metadata Block#.40exclude|@exclude]] [[include and exclude rules|rules]]. Once this has been completed continuation of writing the actual code may occur.  However it is not yet necessary, and can be considered counterproductive for new script authors. Now the script stub is ready to be installed into [[Greasemonkey]].
-
 
== Editing the Script ==
1 (-0)
 
At this point [[Greasemonkey]] has already made a copy of the script installed and placed it in the [[scripts directory]]. Any future page loads which match the [[include and exclude rules]] will execute the script. Close the text editor and optionally delete the original source file.
-
 
Next is finding and editing the copy of the script that Greasemonkey is working with.
0 (-7)
This may be done directly as explained in the [[FAQ#Yes.2C_but_how_can_I_edit_a_script_without_going_through_Greasemonkey.3F|FAQ]], or by one of two shortcuts Greasemonkey provides.
The first shortcut would be the edit button in the [[Greasemonkey Manual:Manage Dialog|manage dialog]].
-
Alternately a quick right-click in the [[Greasemonkey Manual:Monkey Menu|monkey menu]] will produce the same results.
Tiga Sugod
 
When working with the copy of the script that [[Greasemonkey]] has installed, code changes will be immediately available (excluding changes to the [[Metadata Block]], which is read only at install time).
Simply save the file and reload any pages that apply.
 
== Changing the Editor ==
 
Mga Kalaban 0 (-1) 0 (-100) 0 (-20) - -
Currently, the only way to change the selected editor is via the [http://kb.mozillazine.org/About:config about:config] page. Find the <code>greasemonkey.editor</code> preference. Double-click it, and type or paste in the location of the script editor to use.
Tiga Depensa
Future versions of Greasemonkey are expected to have a GUI for this.
Xbytes - 97 (-0) 90 (-10) 134 (-70) 19 (-0)
 
Mga Nanalo:
== That's It! ==
Xbytes
 
Mga Natalo:
Writing scripts for [[Greasemonkey]] is not hard.
Batista69, REDnhoJ
What can get difficult, however, is working with the quirks and limitations that the script runs under;
392 na mga tauhan ang inilipat mula sa Xbytes patungong Oppresso Liber
Some things that work perfectly in a normal web page, copied and pasted directly to a [[user script]] suddenly fail.
Ang mga hukbo ni Batista69 ay nagsitakas dahil naubusan sila ng lakas sa pakikipaglaban.
It's important to know how the [[Greasemonkey Manual:Environment|environment]] the scripts run in works.
Dahil wala nang tauhan si REDnhoJ na pupuna sa kanyang pangunahing linya ng labananan, ang mga natira sa kanyang hukbo ay nagsiatras.
Dahil wala nang tauhan si REDnhoJ na pupuna sa kanyang pangunahing linya ng labananan, ang mga natira sa kanyang hukbo ay nagsiatras.

Revision as of 05:06, 6 January 2011

Digmaan sa Oppresso Liber (06.01.2011 4:52:22) Tiga Sugod: REDnhoJ galing RedPhulah Tiga Depensa: Batista69 galing 7TH-Evolution 1, Xbytes galing Oppresso Liber, Seventh First, Deo Vindice Kinalabasan ng labanan Tiga Sugod




Mga Kalaban 0 (-400) 7 (-0) 10 (-0) 0 (-250) 35 (-0) - 0 (-100) Tiga Depensa Xbytes 948 (-180) 36 (-0) - 112 (-311) 30 (-0) - 116 (-3) Tauhan ng kaalyansa -

-

-

1 (-0)

-

0 (-7)

- Tiga Sugod



Mga Kalaban 0 (-1) 0 (-100) 0 (-20) - - Tiga Depensa Xbytes - 97 (-0) 90 (-10) 134 (-70) 19 (-0) Mga Nanalo: Xbytes Mga Natalo: Batista69, REDnhoJ 392 na mga tauhan ang inilipat mula sa Xbytes patungong Oppresso Liber Ang mga hukbo ni Batista69 ay nagsitakas dahil naubusan sila ng lakas sa pakikipaglaban. Dahil wala nang tauhan si REDnhoJ na pupuna sa kanyang pangunahing linya ng labananan, ang mga natira sa kanyang hukbo ay nagsiatras. Dahil wala nang tauhan si REDnhoJ na pupuna sa kanyang pangunahing linya ng labananan, ang mga natira sa kanyang hukbo ay nagsiatras.