r106030 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106029‎ | r106030 | r106031 >
Date:15:40, 13 December 2011
Author:finlay
Status:deferred
Tags:
Comment:
Adding jquery skin files missing from r106028
Modified paths:
  • /trunk/extensions/HeaderTabs/skins-jquery (added) (history)
  • /trunk/extensions/HeaderTabs/skins-jquery/ext.headertabs.bare.css (added) (history)
  • /trunk/extensions/HeaderTabs/skins-jquery/ext.headertabs.core.js (added) (history)
  • /trunk/extensions/HeaderTabs/skins-jquery/ext.headertabs.jquery-large.css (added) (history)

Diff [purge]

Index: trunk/extensions/HeaderTabs/skins-jquery/ext.headertabs.bare.css
@@ -0,0 +1,50 @@
 2+/**
 3+ * A more Vector like tabs with normal sized text, blue links, and shiny tabs.
 4+ *
 5+ * @file
 6+ * @ingroup Extensions
 7+ *
 8+ * @author 70.189.238.136
 9+ * @author Olivier Beaton
 10+ */
 11+
 12+/* JQuery UI tabs clearing styles by Olivier Finlay Beaton and 70.189.238.136 */
 13+#headertabs.bare.ui-widget {
 14+ font-family: inherit;
 15+ font-size: 1em; /* ie doesn't like inherit here */
 16+}
 17+
 18+#headertabs.bare.ui-widget-content {
 19+ color: inherit;
 20+ background: transparent;
 21+ border: none;
 22+}
 23+
 24+#headertabs.bare.ui-tabs {
 25+ padding: 0;
 26+}
 27+
 28+#headertabs.bare.ui-tabs .ui-tabs-panel {
 29+ padding: 0;
 30+ padding-left: 0.5em;
 31+ padding-right: 0.5em;
 32+}
 33+
 34+#headertabs.bare .ui-widget-header {
 35+ border: none;
 36+ border-bottom-width: 1px;
 37+ border-bottom-style: solid;
 38+ border-bottom-color: #cccccc;
 39+}
 40+
 41+/* section by 70.189.238.136, for things I forgot, thanks! */
 42+#headertabs.bare .ui-widget input, #headertabs.bare .ui-widget select, #headertabs.bare .ui-widget textarea, #headertabs.bare .ui-widget button { font-family: inherit; font-size: 1em; } /* ie doesn't like inherit here */
 43+#headertabs.bare .ui-widget-content a { color:#0645AD; }
 44+#headertabs.bare .ui-widget-content a:visited { color:#0b0080; }
 45+#headertabs.bare .ui-widget-content a.new { color:#CC2200; }
 46+#headertabs.bare .ui-widget-content a.new:visited { color:#A55858; }
 47+#headertabs.bare .ui-widget-content a.extiw { color:#3366BB; }
 48+#headertabs.bare .ui-widget-content a.redirect { color:#308050; } /*Color redirect links*/
 49+#headertabs.bare .ui-widget-content a.redirect:visited { color:#3070A0; } /*Color redirect links*/
 50+
 51+/* end JQuery UI tabs style clearer */
\ No newline at end of file
Property changes on: trunk/extensions/HeaderTabs/skins-jquery/ext.headertabs.bare.css
___________________________________________________________________
Added: svn:eol-style
152 + native
Index: trunk/extensions/HeaderTabs/skins-jquery/ext.headertabs.core.js
@@ -0,0 +1,88 @@
 2+/**
 3+ * Version of the HeaderTabs class that uses jQuery and the ResourceLoader.
 4+ *
 5+ * @file
 6+ * @ingroup Extensions
 7+ *
 8+ * @author Sergey Chernyshev
 9+ * @author Yaron Koren
 10+ * @author Olivier Beaton
 11+ */
 12+
 13+function tabNameEscape(tabName) {
 14+ tabName = escape( tabName );
 15+ // For some reason, the JS escape() function doesn't handle
 16+ // '+', '/' or '@' - take care of these manually.
 17+ tabName = tabName.replace( /\+/g, "%2B" );
 18+ tabName = tabName.replace( /\//g, "%2F" );
 19+ tabName = tabName.replace( /@/g, "%40" );
 20+ tabName = tabName.replace( /%/g, "_" );
 21+ tabName = tabName.replace( /\./g, "_" );
 22+ return tabName;
 23+}
 24+
 25+var $tabs = $("#headertabs").tabs();
 26+
 27+/* follow a # anchor to a tab OR a heading */
 28+var curHash = window.location.hash;
 29+if ( curHash.indexOf( "#tab=" ) == 0 ) {
 30+ // remove the fragment identifier, we're using it for the name of the tab in the jquery ui tabs
 31+ var tabName = curHash.replace( "#tab=", "" );
 32+ $tabs.tabs('select', tabName);
 33+} else if (curHash != '') {
 34+ /* select tab in a fragment
 35+ thanks kboudloche, Alphos
 36+ http://forum.jquery.com/topic/jquery-ui-tabs-create-an-anchor-to-content-within-tab#14737000001187015
 37+ */
 38+ var tabName = $(curHash).closest('.ui-tabs-panel').attr('id');
 39+ $tabs.tabs('select', tabNameEscape(tabName));
 40+}
 41+
 42+function tabEditTabLink(hash) {
 43+ var section = '';
 44+ if ( hash.indexOf( "#tab=" ) == 0 ) {
 45+ // keep the fragment identifier, using it to do a jquery find on the id
 46+ hash = hash.replace( "#tab=", "#" );
 47+ }
 48+
 49+ if (hash != '') {
 50+ section = $(hash).attr('class');
 51+ var s = section.indexOf('section-')+8;
 52+ section = section.substring(s, s+section.substring(s).indexOf(' '));
 53+ if (section != 0) {
 54+ section = '&section='+section;
 55+ // no way to edit anything before the first section except to edit the entire article
 56+ }
 57+ }
 58+
 59+ if (!section || section == '0' || section == 0) {
 60+ section = '';
 61+ }
 62+ // http://wiki.org/wiki/index.php?title=User_talk:Finlay&action=edit&section=1
 63+ var $anchor = $('#edittab').find('a');
 64+ $anchor.attr('href', mw.config.get("wgScript")+'?title='+mw.config.get("wgPageName")+'&action=edit'+section);
 65+}
 66+
 67+// page load behaviour
 68+if (mw.config.get("htEditTabLink")) {
 69+ tabEditTabLink(window.location.hash);
 70+}
 71+
 72+// only fires when the user clicks on a tab, not on page load
 73+$tabs.bind('tabsshow', function(event, ui) {
 74+ // make the url show the current tab name for bookmarks
 75+ if (mw.config.get("htUseHistory")) {
 76+ window.location.hash = '#tab='+ui.tab.hash.slice(1);
 77+ }
 78+
 79+ if (mw.config.get("htEditTabLink")) {
 80+ tabEditTabLink(ui.tab.hash);
 81+ }
 82+});
 83+
 84+/* click a tab parserhook link */
 85+$(".tabLink").click( function() {
 86+ var href = $(this).attr('href');
 87+ $tabs.tabs('select', tabNameEscape(href));
 88+ return false;
 89+} );
\ No newline at end of file
Property changes on: trunk/extensions/HeaderTabs/skins-jquery/ext.headertabs.core.js
___________________________________________________________________
Added: svn:eol-style
190 + native
Index: trunk/extensions/HeaderTabs/skins-jquery/ext.headertabs.jquery-large.css
@@ -0,0 +1,27 @@
 2+/**
 3+ * Default jquery styling with normal sized font and blue links.
 4+ *
 5+ * @file
 6+ * @ingroup Extensions
 7+ *
 8+ * @author 70.189.238.136
 9+ * @author Olivier Beaton
 10+ */
 11+
 12+/* JQuery UI tabs clearing styles by Olivier Finlay Beaton and 70.189.238.136 */
 13+#headertabs.jquery-large.ui-widget {
 14+ font-family: inherit;
 15+ font-size: 1em; /* ie doesn't like inherit here */
 16+}
 17+
 18+/* section by 70.189.238.136, for things I forgot, thanks! */
 19+#headertabs.jquery-large .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: inherit; font-size: 1em; } /* ie doesn't like inherit here */
 20+#headertabs.jquery-large .ui-widget-content a { color:#0645AD; }
 21+#headertabs.jquery-large .ui-widget-content a:visited { color:#0b0080; }
 22+#headertabs.jquery-large .ui-widget-content a.new { color:#CC2200; }
 23+#headertabs.jquery-large .ui-widget-content a.new:visited { color:#A55858; }
 24+#headertabs.jquery-large .ui-widget-content a.extiw { color:#3366BB; }
 25+#headertabs.jquery-large .ui-widget-content a.redirect { color:#308050; } /*Color redirect links*/
 26+#headertabs.jquery-large .ui-widget-content a.redirect:visited { color:#3070A0; } /*Color redirect links*/
 27+
 28+/* end JQuery UI tabs style clearer */
\ No newline at end of file
Property changes on: trunk/extensions/HeaderTabs/skins-jquery/ext.headertabs.jquery-large.css
___________________________________________________________________
Added: svn:eol-style
129 + native

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r106028* added Extension:Configure support...finlay15:38, 13 December 2011

Status & tagging log