Difference between revisions of "MediaWiki:Common.js"

From SacredWiki
Jump to navigation Jump to search
m
 
(22 intermediate revisions by the same user not shown)
Line 60: Line 60:
 
'options': {
 
'options': {
 
'pre': "[[Sacred:",
 
'pre': "[[Sacred:",
'periMsg': 'Page Name you want to link to',
+
'peri': 'Page Name you want to link to',
 
'post': "|]]"
 
'post': "|]]"
 
}
 
}
Line 73: Line 73:
 
'options': {
 
'options': {
 
'pre': "[[Sacred 2:",
 
'pre': "[[Sacred 2:",
'periMsg': 'Page Name you want to link to',
+
'peri': 'Page Name you want to link to',
 
'post': "|]]"
 
'post': "|]]"
 
}
 
}
Line 85: Line 85:
 
'type': 'encapsulate',
 
'type': 'encapsulate',
 
'options': {
 
'options': {
'pre': "
+
'pre': "{{subst:Quest",
 
+
'post': "}}"
 
 
<div class="plainlinks">
 
{|WIDTH="100%"
 
|WIDTH="15%" VALIGN="TOP"|__TOC__
 
|WIDTH="35%" VALIGN="TOP"|
 
* '''Quest Objective:''' TYPE IN OBJECTIVE OF QUEST
 
* '''Quest Difficulty:''' TYPE IN NUMBER OF STARS THIS QUEST INDICATES AS DIFFICULTY
 
* '''Quest Giver:''' TYPE IN FULL NAME OF NPC QUEST GIVER [[Sacred 2:QUEST GIVER |QUEST GIVER ]]
 
* '''Location(s):''' TYPE IN REGION AND/OR TOWN THE QUEST IS GIVEN IN [[Sacred 2:REGION|REGION]] [[Sacred 2:PLACE|PLACE]]
 
* '''Prerequisite Quest:''' TYPE IN PREREQUISITE QUEST IF ONE IS NEEDED TO BE GIVEN THIS [[Sacred 2:QUEST|QUEST]]
 
* '''Next Quest:''' TYPE IN NAME OF NEXT [[Sacred 2:QUEST|QUEST]]
 
* '''Reward:''' TYPE IN REWARD RECEIVED UPON COMPLETION OF THIS QUEST [[Sacred 2:Gold|Gold]] [[Sacred 2:Experience|Experience]]
 
|WIDTH="50%" VALIGN="TOP"|UPLOAD A "TAB" MAP AND "M" MAP PICTURE SHOWING THE LOCATION WHERE THIS QUEST BEGINS AND REPLACE THIS TEXT WITH IT HERE.  EXAMPLE:
 
 
 
{{S2frame|[[Image:sample_worldmap.jpg|250px]][[Image:Quest_Name_map.jpg|250px]]|right|'''[[Sacred 2:Map of Ancaria|View the Ancaria Interactive Map]]'''}}
 
|}
 
{|WIDTH="100%"
 
|WIDTH="60%" VALIGN="TOP"|
 
== Quick Walkthrough ==
 
TYPE IN A FEW SENTENCES WHAT THE QUESTS GOALS ARE AND HOW TO ACHIEVE THEM USING BULLET FORM.  FOR EXAMPLE:
 
* TALK TO "QUEST GIVER"
 
* KILL 20 "ENEMY TYPE" AND COLLECT "WHATEVER QUEST ITEMS THEY DROP"
 
* RETURN TO "QUEST GIVER" FOR REWARD
 
|WIDTH="40%" VALIGN="TOP"|{{S2frame|[[Image:Quest_Location.jpg|500px]]}}
 
|}
 
 
 
== Detailed Walkthrough ==
 
TYPE IN ADDITIONAL INFO.  LINKS TO PICTURES, MAPS, VIDEOS ARE PERMITTED IN THIS FIELD.  PICTURES OF DIALOGUES MUST BE 430PX WIDE AND SHOULD NOT BE FRAMED.  WHEN YOU WANT TO SHOW A TAB MAP AND "m" MAP IMAGE BESIDE EACHTOTHER IN A FRAME THEY MUST EACH BE SET TO 250PX.
 
 
 
KEEP IN MIND THIS SECTION IS MEANT TO HAVE WRITTEN CONTENT AND NOT JUST FOR PICTURES.  TELL THE STORY OF THIS QUEST FOR READERS TO ENJOY.  BE CREATIVE AND HAVE FUN WITH IT!
 
 
 
 
 
PICTURES SUCH AS TO SHOW LOCATIONS SHOULD BE FRAMED AND MUST BE 400PX WIDE.  FRAMED IMAGES NEED A SPECIAL LINE OF CODE AFTER EACH WHICH YOU CAN SEE IN THE CODE BELOW; '''<NOWIKI><br clear="both" /></NOWIKI>'''
 
 
 
{{S2frame|[[Image:Quest_Name_camera1.jpg|400px]]|left}}
 
<br clear="both" />
 
 
 
 
 
{{S2frame|[[Image:Quest_Name_camera2.jpg|400px]]|left}}
 
<br clear="both" />
 
 
 
WHEN YOU WANT TO SHOW A TAB MAP AND "m" MAP IMAGE BESIDE EACHTOTHER IN A FRAME THEY MUST EACH BE SET TO 250PX.
 
{{S2frame|[[Image:sample_worldmap.jpg|250px]][[Image:Quest_Name_map.jpg|250px]]|left]]}}
 
<br clear="both" />
 
 
 
 
 
DIALOGUES CAN BE CUT OUT NICELY LIKE THIS ONE:
 
 
 
[[Image:NPC_name_dialog.jpg|430px]]
 
 
 
OR CROPPED WITH A FRAME:
 
 
 
{{S2frame|[[Image:NPC_name_dialog2.jpg|430px]]|left}}
 
<br clear="both" />
 
 
 
== Quest Enemies ==
 
QUEST ENEMIES SHOULD BE IMPORTED FROM THEIR OWN PAGE USING THE EXAMPLE CODE BELOW.  DESCRIBE ANY SPECIAL ATTACKS THEY HAVE OR OTHER IMPORTANT INFO IF YOU LIKE.
 
 
 
=== [[Sacred 2:Sample Enemy|Sample Enemy]] ===
 
{{:Sacred 2:Sample Enemy}}
 
 
 
== Hirelings and Escorts ==
 
REPLACE THE BELOW WITH THE NAMES OF ANY HIRELINGS OR ESCORTS THAT ARE INVOLVED IN THIS QUEST.  BRIEFLY DESCRIBE THEIR INVOLVEMENT.  HOW DO THE BEHAVE WHEN THEY ARE WITH YOU?  wILL YOU FAIL THE QUEST IF THEY DIE?
 
 
 
* [[Sacred 2:Warrior|Warrior]] - Hireling. Not Immortal. Tries to fight.  If killed quest will fail.
 
* [[Sacred 2:Child|Child]] - Escort. Immortal. Tries to escape the fight.
 
 
 
 
 
== Logbook Entry ==
 
UPLOAD A PICTURE SHOWING THE LOGBOOK FOR THIS QUEST AND REPLACE THIS TEXT WITH A THUMBNAIL OF IT HERE.  EXAMPLE: 
 
{|
 
|{{S2frame|[[Image:Quest Name log1.jpg|300px]]|left}}
 
|{{S2frame|[[Image:Quest Name log1.jpg|300px]]|left}}
 
|}
 
 
 
 
 
== Notes ==
 
TYPE IN ANY POSSIBLE BUGS, EXPLOITS, TRICKS, HINTS, SHORTCUTS ETC
 
 
 
 
 
 
 
</div>
 
DECIDE WHICH OF THE FOLLOWING CATEGORY('S) APPLY TO THIS QUEST (LEAVE IN THE SACRED 2 QUEST CATEGORY) AND DELETE THOSE THAT DO NOT APPLY(AS WELL AS THIS COMMENT):
 
[[Category:Sacred 2 Quest|{{PAGENAME}}]]
 
[[Category:Sacred 2 Side Quest|{{PAGENAME}}]]
 
[[Category:Sacred 2 Chain Quest]|{{PAGENAME}}]]
 
[[Category:Sacred 2 Class Quest|{{PAGENAME}}]]
 
[[Category:Sacred 2 Light Path Quest|{{PAGENAME}}]]
 
[[Category:Sacred 2 Shadow Path Quest|{{PAGENAME}}]]
 
[[Category:Sacred 2 Light Campaign Quest|{{PAGENAME}}]]
 
[[Category:Sacred 2 Shadow Campaign Quest|{{PAGENAME}}]]
 
[[Category:Sacred 2 CM Patch Quest|{{SUBPAGENAME}}]]
 
 
 
"
 
 
}
 
}
 
}
 
}
Line 191: Line 97:
 
'type': 'encapsulate',
 
'type': 'encapsulate',
 
'options': {
 
'options': {
'pre': "
+
'pre': "{{subst:ChainQuest",
 
+
'post': "}}"
 
 
<div class="plainlinks">
 
 
 
{|WIDTH="100%"
 
|WIDTH="15%" VALIGN="TOP"|__TOC__
 
|WIDTH="35%" VALIGN="TOP"|
 
* '''Quest Objective:''' TYPE IN OBJECTIVE OF QUEST
 
* '''Quest Difficulty:''' TYPE IN NUMBER OF STARS THIS QUEST INDICATES AS DIFFICULTY
 
* '''Quest Giver:''' [[Sacred 2:QUEST GIVER |QUEST GIVER ]] TYPE IN FULL NAME OF NPC QUEST GIVER
 
* '''Location(s):''' [[Sacred 2:REGION|REGION]] [[Sacred 2:PLACE|PLACE]] TYPE IN REGION AND/OR TOWN THE QUEST IS GIVEN IN
 
* '''Prerequisite Quest:''' [[Sacred 2:QUEST|QUEST]] TYPE IN PREREQUISITE QUEST IF ONE IS NEEDED TO BE GIVEN THIS QUEST
 
* '''Next Quest:''' [[Sacred 2:QUEST|QUEST]] TYPE IN NAME OF NEXT QUEST
 
* '''Reward:''' [[Sacred 2:Gold|Gold]] [[Sacred 2:Experience|Experience]] TYPE IN REWARD RECEIVED UPON COMPLETION OF THIS QUEST
 
|WIDTH="50%" VALIGN="TOP"|UPLOAD A "TAB" MAP AND "M" MAP PICTURE SHOWING THE LOCATION WHERE THIS QUEST BEGINS AND REPLACE THIS TEXT WITH IT HERE.  EXAMPLE:
 
 
 
{{S2frame|[[Image:sample_worldmap.jpg|250px]][[Image:Quest_Name_map.jpg|250px]]|right|'''[[Sacred 2:Map of Ancaria|View the Ancaria Interactive Map]]'''}}
 
|}
 
{{S2frame|[[Image:Quest_Location.jpg|500px]]}}
 
== Quest Parts ==
 
This is the name for the NUMBER_OF_PARTS-part 'chain-quest' starting in REPLACE THIS WITH A DESCRIPTION OF THE PLACE WHERE IT STARTS (REMEMBER OF USING LINKS TO PLACES).
 
 
 
The SPELLED_NUMBER_OF_PARTS quests in this chain are:
 
 
 
#[[Sacred 2:FIRST QUEST PAGE|FIRST QUEST PAGE]]
 
#[[Sacred 2:SECOND QUEST PAGE|SECOND QUEST PAGE]]
 
#[[Sacred 2:THIRD QUEST PAGE|THIRD QUEST PAGE]]
 
...
 
 
 
In order to start your journey towards completing this multi-part quest, you will have to REPLACE THIS WITH A DESCRIPTION ON THE ACTION NEEDED TO START THIS CHAIN QUEST (USUALLY TALK TO SOMEONE). The detailed information on this string of quests starts [[Sacred 2:FIRST QUEST PAGE|HERE]]
 
 
 
 
 
 
 
== Quick Walkthrough ==
 
 
 
PUT HERE ALL QUICK WALKTHROUGHS OF ALL INDIVIDUAL QUESTS IN THIS CHAIN QUEST IN ORDER
 
 
 
 
 
 
 
=== 1. [[Sacred 2:FIRST QUEST PAGE|FIRST QUEST PAGE]] ===
 
 
 
* FIRST THING TO DO
 
* NEXT THING TO DO
 
* NEXT THING TO DO
 
 
 
 
 
 
 
=== 2. [[Sacred 2:SECOND QUEST PAGE|SECOND QUEST PAGE]] ===
 
 
 
* FIRST THING TO DO
 
* NEXT THING TO DO
 
* NEXT THING TO DO
 
 
 
 
 
 
 
=== 3. [[Sacred 2:THIRD QUEST PAGE|THIRD QUEST PAGE]] ===
 
 
 
* FIRST THING TO DO
 
* NEXT THING TO DO
 
* NEXT THING TO DO
 
 
 
 
 
 
 
== Notes ==
 
 
 
* PUT HERE ANY USEFUL NOTES (F.I. IF THIS CHAIN QUEST IS LIGHT OR SHADOW ONLY)
 
* YOU CAN PUT HERE ALSO THE LINK TO THE LIGHT VERSION (OR SHADOW VERSION) FOR THIS CHAIN QUEST
 
 
 
 
 
[[Category:Sacred 2 Quest]][[Category:Sacred 2 Chain Quest]]
 
 
 
"
 
 
}
 
}
 
}
 
}
Line 274: Line 109:
 
'type': 'encapsulate',
 
'type': 'encapsulate',
 
'options': {
 
'options': {
'pre': "{{Languages}}
+
'pre': "{{subst:Place",
 
+
'post': "}}"
 
 
 
 
 
 
__NOTOC__
 
<div style="float:right;">
 
REPLACE THE THUMBNAILS/LINKS HERE WITH VALID THUMBNAILS/LINKS TO YOUR PHOTOBUCKET UPLOADED IMAGES.
 
DELETE THOSE YOU DON'T USE (AND THIS TEXT).
 
{{S2frame|[http://www.photobucket.com/place_screenshot.jpg http://www.photobucket.com/place_screenshot_325px.jpg]}}
 
<br clear="right">
 
{{S2frame|[http://www.photobucket.com/capture_map.jpg http://www.photobucket.com/th_capture_map.jpg][http://www.photobucket.com/tab_map.jpg http://www.photobucket.com/th_tab_map.jpg]}}
 
</div>
 
 
 
BELOW THERE ARE ALL ICONS AVAILABLE (SEE [[Template:Icons|TEMPLATE]]).
 
REMOVE THOSE MEANING SERVICES/THINGS YOU CAN'T FIND IN THIS PLACE. ALSO REMOVE THIS TEXT.
 
{{Icons|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16}}
 
 
 
REPLACE THIS TEXT WITH A GENERAL DESCRIPTION, TEXT, HISTORY, LITERATURE, ETC. OF THE PLACE YOU ARE WRITING ON
 
 
 
 
 
 
 
MODIFY THIS LINK WITH THE CORRECT LATITUDE/LONGITUDE PARAMETERS TO POINT THE RIGHT PLACE IN THE INTERACTIVE MAP
 
<span style="font-size: x-large;">[http://www.maplib.net/fullmap.php?id=4184&lat=-53.65&lng=34.86&z=12 Locate {{PAGENAME}} on the Ancaria Interactive Map]</span>
 
 
 
 
 
== Quests & NPC's ==
 
ENTER HERE A LIST OF NPC NAMES YOU CAN FIND IN THIS PLACE AND ITS ROLE IN THE FOLLOWING LAYOUT:
 
* [[Sacred 2:WikiPage|Name]]: NPC ROLE DESCRIPTION.
 
QUEST GIVER SAMPLE:
 
* [[Sacred 2:Master Hunter|Master Hunter]]: Quest giver for [[Sacred 2:Help with the Hunt|Help with the Hunt]] quest.
 
ASCARON EMPLOYEE SAMPLE:
 
* [[Sacred 2:Uygar Kalem|Uygar Kalem]]: Ascaron employee involved in [[Sacred 2:Epic Office Quest|Epic Office Quest]] quest.
 
INVOLVED IN QUEST SAMPLE:
 
* [[Sacred 2:Lord Gemma's Court Clerk|Lord Gemma's Court Clerk]]: Involved in [[Sacred 2:The Undead Legion|The Undead Legion]] chain quest.
 
 
 
 
 
 
 
== Transportation ==
 
REPLACE THIS TEXT WITH SOME LINES EXPLAINING HOW TO GET HERE, ROADS, PORTALS, MONOLITHS, ETC.
 
YOU CAN ALSO INDICATE IF YOU ARE LED HERE IN THE MAIN CAMPAIGN.
 
 
 
 
 
 
 
== Enemies ==
 
REPLACE THIS TEXT WITH AN EXPLANATION OF WHAT TYPES OF ENEMIES YOU CAN FIND IN THIS PLACE (OR VERY NEAR).
 
YOU MAY ALSO MENTION HERE IF YOU CAN FIND ANY BOSS PRESENT IN THE ZONE.
 
 
 
 
 
 
 
== Interesting Photos ==
 
REPLACE THE LINKS HERE WITH VALID THUMBNAILS/LINKS TO YOUR PHOTOBUCKET UPLOADED IMAGES. DELETE THOSE YOU DON'T USE (AND THIS TEXT).
 
 
 
{|valign="top" width="100%" padding="10px" style="font-size:1em;text-align:center"
 
|-valign="top"
 
|PUT HERE PHOTO COMMENT
 
 
 
PLACE A [http://darkmatters.org/forums/index.php?act=Help&CODE=01&HID=17 THUMBNAIL] LINK [http://photobucket.com (USING PHOTOBUCKET TO HOST THE IMAGE)] OF A SCREEN CAPTURE OF THIS PLACE
 
 
 
|PUT HERE PHOTO COMMENT
 
 
 
PLACE A [http://darkmatters.org/forums/index.php?act=Help&CODE=01&HID=17 THUMBNAIL] LINK [http://photobucket.com (USING PHOTOBUCKET TO HOST THE IMAGE)] OF A SCREEN CAPTURE OF THIS PLACE
 
 
 
|PUT HERE PHOTO COMMENT
 
 
 
PLACE A [http://darkmatters.org/forums/index.php?act=Help&CODE=01&HID=17 THUMBNAIL] LINK [http://photobucket.com (USING PHOTOBUCKET TO HOST THE IMAGE)] OF A SCREEN CAPTURE OF THIS PLACE
 
 
 
|PUT HERE PHOTO COMMENT
 
 
 
PLACE A [http://darkmatters.org/forums/index.php?act=Help&CODE=01&HID=17 THUMBNAIL] LINK [http://photobucket.com (USING PHOTOBUCKET TO HOST THE IMAGE)] OF A SCREEN CAPTURE OF THIS PLACE
 
 
 
|-valign="top"
 
|PUT HERE PHOTO COMMENT
 
 
 
PLACE A [http://darkmatters.org/forums/index.php?act=Help&CODE=01&HID=17 THUMBNAIL] LINK [http://photobucket.com (USING PHOTOBUCKET TO HOST THE IMAGE)] OF A SCREEN CAPTURE OF THIS PLACE
 
 
 
|PUT HERE PHOTO COMMENT
 
 
 
PLACE A [http://darkmatters.org/forums/index.php?act=Help&CODE=01&HID=17 THUMBNAIL] LINK [http://photobucket.com (USING PHOTOBUCKET TO HOST THE IMAGE)] OF A SCREEN CAPTURE OF THIS PLACE
 
 
 
|PUT HERE PHOTO COMMENT
 
 
 
PLACE A [http://darkmatters.org/forums/index.php?act=Help&CODE=01&HID=17 THUMBNAIL] LINK [http://photobucket.com (USING PHOTOBUCKET TO HOST THE IMAGE)] OF A SCREEN CAPTURE OF THIS PLACE
 
 
 
|...
 
 
 
|}
 
 
 
 
 
== Notes ==
 
 
 
* PUT HERE ANY NOTES, HINTS, ETC.
 
* USE THIS LIST LAYOUT TO MAKE IT MORE READABLE
 
 
 
[[Category:Sacred 2 Places Of Ancaria]]
 
"
 
 
}
 
}
 
}
 
}
Line 380: Line 121:
 
'type': 'encapsulate',
 
'type': 'encapsulate',
 
'options': {
 
'options': {
'pre': "
+
'pre': "{{subst:NPC",
 
+
'post': "}}"
 
+
}
__NOTOC__
+
}
{{Languages}}
+
},
{{S2frame|[[Image:UPLOAD A PORTRAIT IMAGE TO THE WIKI AND PUT IMAGE NAME HERE. PORTRAIT MUST SHOW "?" OR "!" ABOVE NPC HEAD|x550px]]|right}}
+
/*                'TEST': {
 
+
                        label: 'TESTing',
 
+
                        type: 'button',
 
+
                        icon: 'NPC.png',
WRITE HERE A GENERAL DESCRIPTION ON WHO IS THIS NPC, WHERE HE IS, WHICH QUESTS DOES HE TAKE PART IN, ETC.  BE CREATIVE.
+
'action': {
 
+
                            'type':'dialog',
 
+
                                'module':'insert-link'
==== Location ====
+
}
* {{PAGENAME}} can be located in [[Sacred 2:REPLACE WITH PAGE NAME OF PLACE|REPLACE WITH PAGE NAME OF PLACE]]
+
}
* [[Sacred 2:Map of Ancaria|Have a look through the SacredWiki Map]]
+
}, */
* See exact location below:
+
                'S2Frame': {
UPLOAD TWO IMAGES SHOWING THE LOCATION.  A TAB MAP IMAGE AND AN "M" MAP IMAGE.
+
                        label: 'Sacred 2 Frame to put around images and videos',
{{S2frame|[[Image:NAME OF IMAGE|300px]] [[Image:NAME OF IMAGE|300px]]|left}}
+
                        type: 'button',
<br clear="left" />
+
                        icon: 's2frame.png',
 
+
'action': {
 
+
'type': 'encapsulate',
==== Quests ====
+
'options': {
REMOVE FROM THE FOLLOWING LINES THOSE WHICH DON'T MATCH OR DON'T APPLY TO THE NPC YOU ARE ADDING. REMOVE THIS TEXT AS WELL.
+
'pre': "{{s2frame|",
* {{PAGENAME}} is quest giver for [[Sacred 2:REPLACE WITH A LINK TO THE CORRECT QUEST|REPLACE WITH A LINK TO THE CORRECT QUEST]] quest
+
'post': "|none}}"
* {{PAGENAME}} is involved in [[Sacred 2:REPLACE WITH A LINK TO THE CORRECT QUEST|REPLACE WITH A LINK TO THE CORRECT QUEST]] quest
+
}
 
+
}
==== Notes ====
+
},
* ADD NOTES HERE (IF APPROPIATE) IN LIST LAYOUT
+
                'Dialogue': {
* LIST LAYOUT HELPS TO MAKE THIS MORE READABLE
+
                        label: 'S2 Dialogue Template. Push the preview to see results', // or use labelMsg for a localized label, see above
 
+
                        type: 'button',
[[Category:Sacred 2 NPC]]
+
                        icon: 'dialogue.png',
"
+
'action': {
 +
'type': 'encapsulate',
 +
'options': {
 +
'pre': "{{S2 Dialogue|NPC NAME=NPCNAME|PORTRAIT FILE NAME=NoPicDialog.png|DIALOGUE=<poem>",
 +
'peri': 'TYPEtextHERE',
 +
'post': "</poem>}}"
 
}
 
}
 
}
 
}
Line 417: Line 163:
 
         }
 
         }
 
} );
 
} );
};
+
}
 
   
 
   
 
/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar . . . */
 
/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar . . . */
Line 429: Line 175:
 
         } );
 
         } );
 
}
 
}
// Add the customizations to LiquidThreads' edit toolbar, if available
 
mw.hook( 'ext.lqt.textareaCreated' ).add( customizeToolbar );
 

Latest revision as of 10:36, 25 February 2014

/* Any JavaScript here will be loaded for all users on every page load. */


 if (mwCustomEditButtons) {
   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://www.darkmatters.org/SacredWiki/images/buttons/align_center.png",
     "speedTip": "Will center highlighted text.",
     "tagOpen": "<center>",
     "tagClose": "</center>",
     "sampleText": ""};
   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://www.darkmatters.org/SacredWiki/images/buttons/S1internallink.jpg",
     "speedTip": "Make a Sacred Underworld Internal Link",
     "tagOpen": "[[Sacred:",
     "tagClose": "|]]",
     "sampleText": "Page Name you are linking to"};
   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://www.darkmatters.org/SacredWiki/images/buttons/S2internallink.jpg",
     "speedTip": "Make a Sacred 2:Fallen Angel Internal Link",
     "tagOpen": "[[Sacred 2:",
     "tagClose": "|]]",
     "sampleText": "Type here what you want the link to be read as..."};
   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://www.darkmatters.org/SacredWiki/images/buttons/questbutton.jpg",
     "speedTip": "Quest Template.  Push the preview to see results.",
     "tagOpen": "{{subst:Quest",
     "tagClose": "}}",
     "sampleText": ""};
   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://www.darkmatters.org/SacredWiki/images/buttons/chainquest.jpg",
     "speedTip": "ChainQuest Template.  Push the preview to see results.",
     "tagOpen": "{{subst:ChainQuest",
     "tagClose": "}}",
     "sampleText": ""};
   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://www.darkmatters.org/SacredWiki/images/buttons/place.jpg",
     "speedTip": "Place Template.  Push the preview to see results.",
     "tagOpen": "{{subst:Place",
     "tagClose": "}}",
     "sampleText": ""};
   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://www.darkmatters.org/SacredWiki/images/buttons/npc.jpg",
     "speedTip": "NPC Template.  Push the preview to see results.",
     "tagOpen": "{{subst:NPC",
     "tagClose": "}}",
     "sampleText": ""};
  }

var customizeToolbar = function() {
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        'section': 'main',
        'group': 'insert',
        'tools': {
                'S1link': {
                        label: 'Sacred 1 Link', // or use labelMsg for a localized label, see above
                        type: 'button',
                        icon: 'S1link.jpg',
			'action': {
				'type': 'encapsulate',
				'options': {
					'pre': "[[Sacred:",
					'peri': 'Page Name you want to link to',
					'post': "|]]"
				}
			}
          },
                'S2link': {
                        label: 'Sacred 2 Link', // or use labelMsg for a localized label, see above
                        type: 'button',
                        icon: 'S2link.jpg',
			'action': {
				'type': 'encapsulate',
				'options': {
					'pre': "[[Sacred 2:",
					'peri': 'Page Name you want to link to',
					'post': "|]]"
					}
				}
			},
                'Quest': {
                        label: 'Quest Template.  Push the preview to see results', // or use labelMsg for a localized label, see above
                        type: 'button',
                        icon: 'quest.png',
			'action': {
				'type': 'encapsulate',
				'options': {
					'pre': "{{subst:Quest",
					'post': "}}"
					}
				}
			},
                'ChainQuest': {
                        label: 'Chain Quest Template.  Push the preview to see results', // or use labelMsg for a localized label, see above
                        type: 'button',
                        icon: 'chainquest.png',
			'action': {
				'type': 'encapsulate',
				'options': {
					'pre': "{{subst:ChainQuest",
					'post': "}}"
					}
				}
			},
                'Place': {
                        label: 'Place Template.  Push the preview to see results', // or use labelMsg for a localized label, see above
                        type: 'button',
                        icon: 'place.png',
			'action': {
				'type': 'encapsulate',
				'options': {
					'pre': "{{subst:Place",
					'post': "}}"
					}
				}
			},
                'NPC': {
                        label: 'NPC Template.  Push the preview to see results', // or use labelMsg for a localized label, see above
                        type: 'button',
                        icon: 'NPC.png',
			'action': {
				'type': 'encapsulate',
				'options': {
					'pre': "{{subst:NPC",
					'post': "}}"
					}
				}
			},
/*                'TEST': {
                        label: 'TESTing',
                        type: 'button',
                        icon: 'NPC.png',
			'action': {
                            'type':'dialog',
                                'module':'insert-link'
					}
				}
			}, */
                'S2Frame': {
                        label: 'Sacred 2 Frame to put around images and videos',
                        type: 'button',
                        icon: 's2frame.png',
			'action': {
				'type': 'encapsulate',
				'options': {
					'pre': "{{s2frame|",
					'post': "|none}}"
					}
				}
			},
                'Dialogue': {
                        label: 'S2 Dialogue Template.  Push the preview to see results', // or use labelMsg for a localized label, see above
                        type: 'button',
                        icon: 'dialogue.png',
			'action': {
				'type': 'encapsulate',
				'options': {
					'pre': "{{S2 Dialogue|NPC NAME=NPCNAME|PORTRAIT FILE NAME=NoPicDialog.png|DIALOGUE=<poem>",
					'peri': 'TYPEtextHERE',
					'post': "</poem>}}"
					}
				}
			}
        }
} );
}
 
/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar . . . */
if ( $.inArray( mw.config.get( 'wgAction' ), ['edit', 'submit'] ) !== -1 ) {
        mw.loader.using( 'user.options', function () {
                if ( mw.user.options.get('usebetatoolbar') ) {
                        mw.loader.using( 'ext.wikiEditor.toolbar', function () {
                                $(document).ready( customizeToolbar );
                        } );
                }
        } );
}