User:Peteparker/wikia.js

/* //////////////////////////////////////////////////////////////////////////////////////////// // Auto-fill the Blog title with sub page name in the URL (coded with help from Monchoman45) ////////////////////////////////////////////////////////////////////////////////////////////

function blogTitle{ if (wgCanonicalSpecialPageName == "CreateBlogPage" && urlQuery('action') != null && urlQuery('action') != 'submit'){ var pageTitle = fbReturnToTitle.replace("Special:CreateBlogPage", ""); pageTitle = pageTitle.replace("/", ""); pageTitle = pageTitle.replace(/_/gi, " ");

var titleTitle = pageTitle.replace(/Vol (\d+) (\d+)/, "$2 (Volume $1)"); titleTitle = titleTitle.replace(" (Volume 1)", "");

var user = wgUserName;

if (pageTitle != "") { var sel = document.getElementById('blogPostTitle'); if (sel != null && sel.value == ''){ sel.value = titleTitle+" Review by "+user; }

var signature = ""+""; var template = "\{\{subst:User:Peteparker\/Review\|"+pageTitle+"\|\}\}\n\n\n\[\[Category:"+pageTitle+"\/Reviews\]\]\[\[Category:"+user+"\/Reviews\]\]"; var textBlock1 = document.getElementById('wpTextbox1'); if (textBlock1 != null){ textBlock1.value = template; }   }

} }

function urlQuery(quer) { for (i in location.href.split('?')) { for (j in location.href.split('?')[i].split('&')) { if (location.href.split('?')[i].split('&')[j].split('=')[0] == quer) { return location.href.split('?')[i].split('&')[j].split('=')[1]; }     }    }    return ''; }

addOnloadHook(blogTitle)

/* /////////////////////////////////////////////////////////////////////////////// // MOVES THE CHAT WINDOW ABOVE THE RECENT WIKI ACTIVITY: Written by Monchoman45 ///////////////////////////////////////////////////////////////////////////////

function rearrangeRail{

if (urlQuery('action') != 'edit' && urlQuery('action') != 'submit') {

var latestPhotos = $('.LatestPhotosModule').clone; $('.LatestPhotosModule')[0].setAttribute("id","LatestPhotosModule1"); $('.WikiaPagesOnWikiModule').after(latestPhotos); $('#LatestPhotosModule1').remove;

var chat = $('.ChatModule').clone; $('.ChatModule')[0].setAttribute("id","ChatModule1"); $('.LatestPhotosModule').after(chat); $('#ChatModule1').remove; }

}

function urlQuery(quer) { for (i in location.href.split('?')) { for (j in location.href.split('?')[i].split('&')) { if (location.href.split('?')[i].split('&')[j].split('=')[0] == quer) { return location.href.split('?')[i].split('&')[j].split('=')[1]; }     }    }    return ''; }

addOnloadHook(rearrangeRail);

/* ///////////////////////////////////////////////////////////////////////////////////////////////////////// // Altering the edit links in section titles to reflect the actual page they're on, and not the template. ///////////////////////////////////////////////////////////////////////////////////////////////////////// // importScriptPage('User:Peteparker/beta.js', 'dev');

/* //////////////////////////////////////////////////////////////////// // THE BELOW CODE ADDS CUSTOM BUTTONS TO THE JAVASCRIPT EDIT TOOLBAR ////////////////////////////////////////////////////////////////////

if (mwCustomEditButtons) {

mwCustomEditButtons[3] = { "imageFile": "http://images.wikia.com/central/images/c/c8/Button_redirect.png", "speedTip": "Redirect", "tagOpen": "#REDIRECT ",    "tagClose": "", "sampleText": "Insert text"}; mwCustomEditButtons[4] = { "imageFile": "http://images.wikia.com/marveldatabase/images/3/3a/Comic_Button.png", "speedTip": "Revised Comic Template", "tagOpen": "\{\{DC Database:Comic Template\r| Image              = \{\{subst:#replace:\{\{subst:PAGENAME}}.jpg|:}}", "tagClose": "\r| Image2             = \{\{subst:#replace:\{\{subst:PAGENAME\}\} Textless.jpg|:\}\}\r| Image2Text          = Textless\r| Month               = \r| Year                = \r\r| Editor-in-Chief     = Axel Alonso\r| CoverArtist1        = \r\r| Quotation           = \r| Speaker             = \r\r| StoryTitle1         = \r| Writer1_1           = \r| Penciler1_1         = \r| Inker1_1            = \r| Colourist1_1        = \r| Letterer1_1         = \r| Editor1_1           = \r| Synopsis1           = \r\r| Appearing1          = \rFeatured Characters:\r* \rSupporting Characters:\r* \rVillains:\r* \rOther Characters:\r* \rLocations:\r* \rItems:\r* \rVehicles:\r* \r\r| Notes               = \r| Trivia              = \r| Recommended         = \r| Links               = \r\}\}", "sampleText": ""}

mwCustomEditButtons[5] = { "imageFile": "http://images4.wikia.nocookie.net/marveldatabase/images/8/88/Comic_List.png", "speedTip": "Insert Comic List template", "tagOpen": "\{\{DC Database:Volume Template\r| IssueList              = \r\r| SeeAlso                 = \r\}\}", "sampleText": ""}

mwCustomEditButtons[11] = { "imageFile": "http://images3.wikia.nocookie.net/marveldatabase/images/f/f0/Organization_Button.png", "speedTip": "Organization Template", "tagOpen": "\{\{DC Database:Organization Template\r| Image                  = ", "tagClose": "\r| OfficialName           = \r| Aliases                 = \r\r| Status                  = \r| Identity                = \r| Universe                = \{\{subst:#explode:\{\{subst:#explode:\{\{subst:PAGENAME}}|(|1\}\}|)\}\}\r| BaseOfOperations        = \r\r| OrganizationLeaders     = \r| CurrentMembers          = \r| FormerMembers           = \r| Allies                  = \r| Enemies                 = \r\r| Origin                  = \r| PlaceOfFormation        = \r| PlaceOfDefunction       = \r| Creators                = \r| First                   = \r| Last                    = \r\r| HistoryText             = \r\r| Equipment               = \r| Transportation          = \r| Weapons                 = \r\r| Notes                   = \r| Trivia                  = \r| Links                   = \r\}\}", "sampleText": ""}; mwCustomEditButtons[12] = { "imageFile": "http://images.wikia.com/marveldatabase/images/f/f2/Location_Button.png", "speedTip": "Insert location template", "tagOpen": "\{\{DC Database:Location Template\r| Image                  = ", "tagClose": "\r| OfficialName           = \r| Aliases                 = \r\r| Galaxy                  = \r| StarSystem              = \r| Planet                  = \r| Country                 = \r| City                    = \r| State                   = \r| Province                = \r| Locale                  = \r\r| Dimensions              = \r| Population              = \r| First                   = \r\r| HistoryText             = \r\r| PointsOfInterest        = \r| Residents               = \r\r| Notes                   = \r| Trivia                  = \r| Links                   = \r\}\}", "sampleText": ""}

mwCustomEditButtons[13] = { "imageFile": "http://images3.wikia.nocookie.net/marveldatabase/images/2/20/Vehicle_Button.png", "speedTip": "Insert vehicle template", "tagOpen": "\{\{DC Database: Vehicle Template\r| Image                  = ", "tagClose": "\r| OfficialName           = \r| Title                   = \r| Nicknames               = \r| Universe                = \r| Status                  = \r| CurrentModel            = \r| CurrentOwner            = \r| TransportMethod         = \r| Dimensions              = \r| Creators                = \r| Origin                  = \r| First                   = \r\r| HistoryText             = \r\r| Notes                   = \r| Trivia                  = \r| Links                   = \r\}\}", "sampleText": ""};

mwCustomEditButtons[14] = { "imageFile": " http://images1.wikia.nocookie.net/marveldatabase/images/0/02/Eyetem_Button.png", "speedTip": "Insert item template", "tagOpen": "\{\{DC Database: Item Template\r| Image                  = ", "tagClose": "\r| OfficialName           = \r| Aliases                 = \r| Model                   = \r| Version                 = \r\r| Universe                = \r| LeadDesigner            = \r| AdditionalDesigners     = \r| PlaceOfCreation         = \r| PlaceOfDestruction      = \r| Origin                  = \r\r| Dimensions              = \r| Weight                  = \r| First                   = \r\r| HistoryText             = \r\r| CurrentOwner            = \r| PreviousOwners          = \r\r| Notes                   = \r| Trivia                  = \r| Links                   = \r\}\}", "sampleText": ""};

mwCustomEditButtons[15] = { "imageFile": "http://images2.wikia.nocookie.net/marveldatabase/images/2/2c/Race_Button.png", "speedTip": "Insert race template", "tagOpen": "\{\{DC Database:Race Template\r| Image                  = ", "tagClose": "\r| Name                   = \r| Aliases                 = \r| Identity                = \r| Affiliation             = \r| BaseOfOperations        = \r\r| BodyType                = \r| AvgHeight               = \r| AvgWeight               = \r| Eyes                    = \r| Hair                    = \r| Skin                    = \r| NumberOfLimbs           = \r| NumberOfFingers         = \r| NumberOfToes            = \r| SpecialAdaptations      = \r| UnusualFeatures         = \r\r| Origin                  = \r| GalaxyOfOrigin          = \r| StarSystemOfOrigin      = \r| HomePlanet              = \r| PlaceOfBirth            = \r| Creators                = \r| First                   = \r\r| HistoryText             = \r\r| Habitat                 = \r| Gravity                 = \r| Atmosphere              = \r| Population              = \r\r| Powers                  = \r| Abilities               = \r| AvgStrength             = \r| Weaknesses              = \r\r| GovernmentType          = \r| TechnologyLevel         = \r| CulturalTraits          = \r| Representatives         = \r\r| Notes                   = \r| Trivia                  = \r| Links                   = \r\}\}", "sampleText": ""};

mwCustomEditButtons[16] = { "imageFile": "http://images1.wikia.nocookie.net/marveldatabase/images/1/12/Reality_Button.png", "speedTip": "Insert reality template", "tagOpen": "\{\{DC Database:Reality Template\r| Image                  = ", "tagClose": "\r| EarthNumber            = \{\{subst:#explode:\{\{subst:PAGENAME}}|-|1}}\r| Title                   = \r| Aliases                 = \r| Status                  = Existing\r\r| Creators                = \r| First                   = \r\r| History                 = \r\r| Residents               = \r| Notes                   = \r| Trivia                  = \r| Links                   = \r\}\}", "sampleText": ""};

mwCustomEditButtons[17] = { "imageFile": "http://images.wikia.com/marveldatabase/images/d/d6/Event_Button.png", "speedTip": "Insert event template", "tagOpen": "\{\{DC Database:Event Template\r| EventImage             = ", "tagClose": "\r| EventName              = \r| Aliases                 = \r| Universe                = \{\{subst:#explode:\{\{subst:#explode:\{\{subst:PAGENAME}}|(|1\}\}|)\}\}\r| Locations               = \r| Heroes                  = \r| Villains                = \r| Others                  = \r| Creators                = \r\r| FullSynopsis            = \r\r| Part1                   = \r| Part2                   = \r| Part3                   = \r\r| Notes                   = \r| Trivia                  = \r| Links                   = \r\}\}", "sampleText": ""}

mwCustomEditButtons[18] = { "imageFile": "http://images3.wikia.nocookie.net/marveldatabase/images/e/ee/Episode_Button.png", "speedTip": "Insert episode template", "tagOpen": "\{\{DC Database:Episode Template\r| Image              = ", "tagClose": "\r| Month              = \r| Year                = \r\r| Director            = \r| Producer1_1         = \r| Writer1_1           = \r\r| Quotation           = \r| Speaker             = \r\r| EpisodeTitle        = \r| Synopsis            = \r\r| Appearing           = \rFeatured Characters:\r* \rSupporting Characters:\r* \rVillains:\r* \rOther Characters:\r* \rLocations:\r* \rItems:\r* \rVehicles:\r* \r\r| Notes               = \r| Trivia              = \r| Recommended         = \r| Links               = \r\}\}", "sampleText": ""};

mwCustomEditButtons[19] = { "imageFile": "http://images.wikia.com/marveldatabase/images/3/3e/Staff_Button.png", "speedTip": "Insert marvel staff template", "tagOpen": "\{\{DC Database:Staff Template\r| Image                  = ", "tagClose": "\r| RealName               = \{\{subst:PAGENAME\}\}\r| Pseudonyms              = \r| Employers               = \r| Titles                  = \r\r| Gender                  = Male\r| YearOfBirth             = \r| MonthOfBirth            = \r| DayOfBirth              = \r| CityOfBirth             = \r| StateOfBirth            = \r| CountryOfBirth          = \r| Creations               = \r| First                   = \r\r| PersonalHistory         = \r| ProfessionalHistory     = \r\r| Notes                   = \r| Trivia                  = \r| OfficialWebsite         = \r| Links                   = \r\}\}", "sampleText": ""};

mwCustomEditButtons[20] = { "imageFile": "http://images4.wikia.nocookie.net/marveldatabase/images/4/49/Glossary_Button.png", "speedTip": "Glossary Entry", "tagOpen": "\{\{DC Database:Glossary Template\r| Title            = \{\{subst:#explode:\{\{subst:PAGENAME\}\}|:|1\}\}\r| Image             = \r| Definition        = ", "tagClose": "\r| SeeAlso          = \r\}\}", "sampleText": ""};

mwCustomEditButtons[21] = { "imageFile": "http://images2.wikia.nocookie.net/marveldatabase/images/5/54/Universe.png", "speedTip": "Universe", "tagOpen": "\{\{subst:#explode:\{\{subst:#explode:\{\{subst:PAGENAME\}\}|(|1}}|)\}\}", "tagClose": "", "sampleText": ""}

mwCustomEditButtons[22] = { "imageFile": "http://images4.wikia.nocookie.net/marveldatabase/images/3/3c/Powers.png", "speedTip": "616Powers", "tagOpen": "\{\{subst:616Powers\}\}", "tagClose": "", "sampleText": ""}

mwCustomEditButtons[23] = { "imageFile": "http://images4.wikia.nocookie.net/marveldatabase/images/2/2b/Textless.png", "speedTip": "Image 2 Textless", "tagOpen": "\r| Image              = \{\{subst:#replace:\{\{subst:PAGENAME\}\}.jpg|:\}\}\r| Image2              = \{\{subst:#replace:\{\{subst:PAGENAME\}\} Textless.jpg|:\}\}\r| Image2Text          = Textless", "tagClose": "", "sampleText": ""}

mwCustomEditButtons[24] = { "imageFile": "http://images1.wikia.nocookie.net/marveldatabase/images/1/1a/Fetch.png", "speedTip": "Fetch", "tagOpen": "\{\{subst:Fetch|", "tagClose": "\}\}", "sampleText": "Field|Page|Number"}

mwCustomEditButtons[25] = { "imageFile": "http://images2.wikia.nocookie.net/marveldatabase/images/8/88/Cat_Button.png", "speedTip": "Cat", "tagOpen": "\{\{subst:Cat\}\}", "tagClose": "", "sampleText": ""}

mwCustomEditButtons[26] = { "imageFile": "http://images.wikia.com/marveldatabase/images/d/dc/Image_Button.png", "speedTip": "Insert image template", "tagOpen": "== Licensing (Required) ==\r\{\{subst:User:Peteparker/Image Template\r| License                = \r| ImageType               = \r| Description             = ", "tagClose": "\r\r| Issue                  = \r\r| Universe                = \{\{subst:#explode:\{\{subst:#explode:\{\{subst:PAGENAME}}|(|1\}\}|)\}\}\r| Subject1                = \{\{subst:Ic|\{\{subst:#explode:\{\{subst:#explode:\{\{subst:PAGENAME\}\}|page|1\}\}| \}\}\}\}\r| Subject2                = \r| Subject3                = \r| Subject4                = \r| Subject5                = \r\r| Notes                   = \r| Trivia                  = \r\}\}", "sampleText": ""}

mwCustomEditButtons[27] = { "imageFile": "http://images3.wikia.nocookie.net/marveldatabase/images/b/b4/Character_Image_Button.png", "speedTip": "Character Image", "tagOpen": "== Licensing (Required) ==\r\{\{subst:User:Peteparker/Character Image|", "tagClose": "\}\}", "sampleText": ""}

mwCustomEditButtons[28] = { "imageFile": "http://images2.wikia.nocookie.net/marveldatabase/images/4/49/Comic_Image_Button.png", "speedTip": "Cover Image", "tagOpen": "== Licensing (Required) ==\r\{\{subst:User:Peteparker/Cover Image|", "tagClose": "\}\}", "sampleText": ""}

mwCustomEditButtons[29] = { "imageFile": "http://images1.wikia.nocookie.net/marveldatabase/images/5/57/Solicit_button.png", "speedTip": "Solicit Template", "tagOpen": "\{\{subst:Solicit Template\r| ReleaseDate        = ", "tagClose": "\r| Pages              = \r| Rating              = \r| Price               = \r| CoverArtist         = \r| Writer              = \r| Penciler            = \r| Inker               = \r| Colorist            = \r| Letterer            = \r| StoryTitle          = \r| SolicitText         = \r| CatalogURL          = \r\}\}", "sampleText": ""}

}