Making Font Awesome 'preload' a feature as this does not effect everyone. Absolute latest Foundation 5 js from their repo to fix all JQMigrate warnings.

sidebar
Tom Hutchison 2018-02-15 12:42:07 -05:00
parent 52aecafbc9
commit 65964dc883
18 changed files with 147 additions and 85 deletions

View File

@ -24,6 +24,7 @@ class SkinPivot extends SkinTemplate {
'wikiName' => &$GLOBALS['wgSitename'],
'wikiNameDesktop' => &$GLOBALS['wgSitename'],
'navbarIcon' => false,
'preloadFontAwesome' => false,
'showFooterIcons' => false,
'addThisPUBID' => '',
'useAddThisShare' => '',
@ -38,8 +39,9 @@ class SkinPivot extends SkinTemplate {
$viewport_meta = 'width=device-width, user-scalable=yes, initial-scale=1.0';
$out->addMeta('viewport', $viewport_meta);
$out->addModuleScripts('skins.pivot.js');
$out->addHeadItem('font', '<link rel="preload" href="'.$wgLocalStylePath.'/pivot/assets/fonts/fontawesome-webfont.woff2?v=4.7.0" as="font" type="font/woff2" crossorigin="anonymous" />');
if ( $wgPivotFeatures['preloadFontAwesome'] ) {
$out->addHeadItem('font', '<link rel="preload" href="'.$wgLocalStylePath.'/pivot/assets/fonts/fontawesome-webfont.woff2?v=4.7.0" as="font" type="font/woff2" crossorigin="anonymous" />');
}
}
}
@ -114,7 +116,7 @@ class pivotTemplate extends BaseTemplate {
</form>
</li>
<?php $this->renderSidebar() ?>
<?php $location="-off-canvas";$this->renderSidebar() ?>
</ul>
</aside>
@ -159,7 +161,7 @@ class pivotTemplate extends BaseTemplate {
</form>
</li>
<?php $this->renderSidebar() ?>
<?php $location="";$this->renderSidebar() ?>
</ul>
</div>
@ -291,12 +293,12 @@ class pivotTemplate extends BaseTemplate {
function renderSidebar() {
$sidebar = $this->getSidebar();
foreach ($sidebar as $boxName => $box) {
echo '<li><label class="sidebar" id="'.Sanitizer::escapeId( $box['id'] ).'"';echo Linker::tooltip( $box['id'] ).'>'.htmlspecialchars( $box['header'] ).'</label></li>';
foreach ($sidebar as $boxName => $box) {
echo '<li><label class="sidebar" id="'.Sanitizer::escapeId( $box['id'] ).$location.'"';echo Linker::tooltip( $box['id'] ).'>'.htmlspecialchars( $box['header'] ).'</label></li>';
if ( is_array( $box['content'] ) ) {
foreach ($box['content'] as $key => $item) { echo $this->makeListItem($key, $item); }
}
}
}
}
return; }
}
?>

View File

@ -4,7 +4,7 @@
Foundation.libs.abide = {
name : 'abide',
version : '5.5.3',
version : '{{VERSION}}',
settings : {
live_validate : true, // validate the form as you go
@ -154,7 +154,7 @@
validate : function (els, e, is_ajax) {
var validations = this.parse_patterns(els),
validation_count = validations.length,
form = this.S(els[0]).closest('form'),
form = this.S(els.length ? els[0] : e.target).closest('form'),
submit_event = /submit/.test(e.type);
// Has to count up to make sure the focus gets applied to the top error

View File

@ -4,7 +4,7 @@
Foundation.libs.accordion = {
name : 'accordion',
version : '5.5.3',
version : '{{VERSION}}',
settings : {
content_class : 'content',
@ -25,16 +25,18 @@
S(this.scope)
.off('.fndtn.accordion')
.on('click.fndtn.accordion', '[' + this.attr_name() + '] > dd > a, [' + this.attr_name() + '] > li > a', function (e) {
.on('click.fndtn.accordion', '[' + this.attr_name() + '] > dd > a:not(.follow), [' + this.attr_name() + '] > li > a:not(.follow)', function (e) {
var accordion = S(this).closest('[' + self.attr_name() + ']'),
groupSelector = self.attr_name() + '=' + accordion.attr(self.attr_name()),
settings = accordion.data(self.attr_name(true) + '-init') || self.settings,
target = S('#' + this.href.split('#')[1]),
contentAttr = S(this).context.attributes['data-content'],
target = S('#' + (contentAttr ? contentAttr.value : this.href.split('#')[1])),
aunts = $('> dd, > li', accordion),
siblings = aunts.children('.' + settings.content_class),
active_content = siblings.filter('.' + settings.active_class);
e.preventDefault();
e.stopPropagation();
if (accordion.attr(self.attr_name())) {
siblings = siblings.add('[' + groupSelector + '] dd > ' + '.' + settings.content_class + ', [' + groupSelector + '] li > ' + '.' + settings.content_class);

View File

@ -4,7 +4,7 @@
Foundation.libs.alert = {
name : 'alert',
version : '5.5.3',
version : '{{VERSION}}',
settings : {
callback : function () {}

View File

@ -4,7 +4,7 @@
Foundation.libs.clearing = {
name : 'clearing',
version : '5.5.3',
version : '{{VERSION}}',
settings : {
templates : {

View File

@ -4,7 +4,7 @@
Foundation.libs.dropdown = {
name : 'dropdown',
version : '5.5.3',
version : '{{VERSION}}',
settings : {
active_class : 'open',
@ -13,6 +13,7 @@
align : 'bottom',
is_hover : false,
hover_timeout : 150,
no_pip : false,
opened : function () {},
closed : function () {}
},
@ -276,7 +277,7 @@
//get the actual width of the page and store it
var actualBodyWidth;
var windowWidth = window.innerWidth;
if (document.getElementsByClassName('row')[0]) {
actualBodyWidth = document.getElementsByClassName('row')[0].clientWidth;
} else {
@ -289,7 +290,7 @@
if (!this.hasClass('mega') && !s.ignore_repositioning) {
var outerWidth = this.outerWidth();
var o_left = t.offset().left;
//miss top
if (t.offset().top <= this.outerHeight()) {
p.missTop = true;
@ -298,15 +299,13 @@
}
//miss right
if (o_left + outerWidth > o_left + actualMarginWidth && o_left - actualMarginWidth > outerWidth) {
if (o_left + outerWidth > o_left + actualMarginWidth && o_left - actualMarginWidth > outerWidth - o_left) {
p.missRight = true;
p.missLeft = false;
}
//miss left
if (o_left - outerWidth <= 0) {
p.missLeft = true;
p.missRight = false;
}
}
@ -315,89 +314,121 @@
top : function (t, s) {
var self = Foundation.libs.dropdown,
p = self.dirs._base.call(this, t, s);
p = self.dirs._base.call(this, t, s),
tOuterHeight = t.outerHeight(),
tOuterWidth = t.outerWidth(),
thisOuterHeight = this.outerHeight(),
thisOuterWidth = this.outerWidth();
this.addClass('drop-top');
if (p.missTop == true) {
p.top = p.top + t.outerHeight() + this.outerHeight();
p.top = p.top + tOuterHeight + thisOuterHeight;
this.removeClass('drop-top');
}
if (p.missRight == true) {
p.left = p.left - this.outerWidth() + t.outerWidth();
p.left = p.left - thisOuterWidth + tOuterWidth;
}
if (t.outerWidth() < this.outerWidth() || self.small() || this.hasClass(s.mega_menu)) {
if (!s.no_pip && tOuterWidth < thisOuterWidth || self.small() || this.hasClass(s.mega_menu)) {
self.adjust_pip(this, t, s, p);
}
if (Foundation.rtl) {
return {left : p.left - this.outerWidth() + t.outerWidth(),
top : p.top - this.outerHeight()};
return {left : p.left - thisOuterWidth + tOuterWidth,
top : p.top - thisOuterHeight};
}
return {left : p.left, top : p.top - this.outerHeight()};
return {left : p.left, top : p.top - thisOuterHeight};
},
bottom : function (t, s) {
var self = Foundation.libs.dropdown,
p = self.dirs._base.call(this, t, s);
p = self.dirs._base.call(this, t, s),
tOuterHeight = t.outerHeight(),
tOuterWidth = t.outerWidth(),
thisOuterHeight = this.outerHeight(),
thisOuterWidth = this.outerWidth();;
if (p.missRight == true) {
p.left = p.left - this.outerWidth() + t.outerWidth();
p.left = p.left - thisOuterWidth + tOuterWidth;
}
if (t.outerWidth() < this.outerWidth() || self.small() || this.hasClass(s.mega_menu)) {
if (!s.no_pip && tOuterWidth < thisOuterWidth || self.small() || this.hasClass(s.mega_menu)) {
self.adjust_pip(this, t, s, p);
}
if (self.rtl) {
return {left : p.left - this.outerWidth() + t.outerWidth(), top : p.top + t.outerHeight()};
return {left : p.left - thisOuterWidth + tOuterWidth, top : p.top + tOuterHeight};
}
return {left : p.left, top : p.top + t.outerHeight()};
return {left : p.left, top : p.top + tOuterHeight};
},
left : function (t, s) {
var p = Foundation.libs.dropdown.dirs._base.call(this, t, s);
var self = Foundation.libs.dropdown,
tOuterHeight = t.outerHeight(),
tOuterWidth = t.outerWidth(),
thisOuterHeight = this.outerHeight(),
thisOuterWidth = this.outerWidth();
this.addClass('drop-left');
if (p.missLeft == true) {
p.left = p.left + this.outerWidth();
p.top = p.top + t.outerHeight();
if (p.missLeft === true) {
p.left = p.left + thisOuterWidth;
p.top = p.top + tOuterHeight;
this.removeClass('drop-left');
}
return {left : p.left - this.outerWidth(), top : p.top};
if (p.missRight === true && p.missLeft === true && p.leftRightFlag == false) {
p.left = p.left - tOuterWidth;
this.removeClass('drop-left');
self.adjust_pip(this,t,s,p);
}
return {left : p.left - thisOuterWidth, top : p.top};
},
right : function (t, s) {
var p = Foundation.libs.dropdown.dirs._base.call(this, t, s);
var self = Foundation.libs.dropdown,
tOuterHeight = t.outerHeight(),
tOuterWidth = t.outerWidth(),
thisOuterHeight = this.outerHeight(),
thisOuterWidth = this.outerWidth();
this.addClass('drop-right');
if (p.missRight == true) {
p.left = p.left - this.outerWidth();
p.top = p.top + t.outerHeight();
this.removeClass('drop-right');
if (p.missRight === true && p.missLeft == false) {
p.left = p.left - thisOuterWidth;
p.top = p.top + tOuterHeight;
this.removeClass('drop-right');
} else {
p.triggeredRight = true;
p.triggeredRight = true;
}
var self = Foundation.libs.dropdown;
if (t.outerWidth() < this.outerWidth() || self.small() || this.hasClass(s.mega_menu)) {
self.adjust_pip(this, t, s, p);
if (p.missLeft === true && p.missRight === true && p.leftRightFlag === false) {
p.left = p.left - thisOuterWidth;
p.top = p.top + tOuterHeight;
this.removeClass('drop-right');
p.triggeredRight = false;
}
return {left : p.left + t.outerWidth(), top : p.top};
if (tOuterWidth < thisOuterWidth || self.small() || this.hasClass(s.mega_menu)) {
self.adjust_pip(this,t,s,p);
}
return {left : p.left + tOuterWidth, top : p.top};
}
},
// Insert rule to style psuedo elements
adjust_pip : function (dropdown, target, settings, position) {
if (settings.no_pip === true) return;
var sheet = Foundation.stylesheet,
pip_offset_base = 8;

View File

@ -4,7 +4,7 @@
Foundation.libs.equalizer = {
name : 'equalizer',
version : '5.5.3',
version : '{{VERSION}}',
settings : {
use_tallest : true,

View File

@ -4,7 +4,7 @@
Foundation.libs.interchange = {
name : 'interchange',
version : '5.5.3',
version : '{{VERSION}}',
cache : {},

View File

@ -6,7 +6,7 @@
Foundation.libs.joyride = {
name : 'joyride',
version : '5.5.3',
version : '{{VERSION}}',
defaults : {
expose : false, // turn on or off the expose feature
@ -668,8 +668,8 @@
expose.css({
top : el.offset().top,
left : el.offset().left,
width : el.outerWidth(true),
height : el.outerHeight(true)
width : el.outerWidth(),
height : el.outerHeight()
});
exposeCover = $(this.settings.template.expose_cover);
@ -828,9 +828,9 @@
corners : function (el) {
if (el.length === 0) {
return [false, false, false, false];
return [false, false, false, false];
}
var w = $(window),
window_half = w.height() / 2,
//using this to calculate since scroll may not have finished yet.

View File

@ -106,7 +106,7 @@
var self = this,
bind = function(){
var $this = S(this),
should_bind_events = !$this.data(self.attr_name(true) + '-init');
should_bind_events = !S(self).data(self.attr_name(true) + '-init');
$this.data(self.attr_name(true) + '-init', $.extend({}, self.settings, (options || method), self.data_options($this)));
if (should_bind_events) {
@ -300,7 +300,7 @@
window.Foundation = {
name : 'Foundation',
version : '5.5.3',
version : '{{VERSION}}',
media_queries : {
'small' : new MediaQuery('.foundation-mq-small'),
@ -342,7 +342,7 @@
}
}
S(window).load(function () {
S(window).on('load', function () {
S(window)
.trigger('resize.fndtn.clearing')
.trigger('resize.fndtn.dropdown')

View File

@ -4,7 +4,7 @@
Foundation.libs['magellan-expedition'] = {
name : 'magellan-expedition',
version : '5.5.3',
version : '{{VERSION}}',
settings : {
active_class : 'active',
@ -32,7 +32,7 @@
S(self.scope)
.off('.magellan')
.on('click.fndtn.magellan', '[' + self.add_namespace('data-magellan-arrival') + '] a[href*=#]', function (e) {
.on('click.fndtn.magellan', '[' + self.add_namespace('data-magellan-arrival') + '] a[href^="#"]', function (e) {
var sameHost = ((this.hostname === location.hostname) || !this.hostname),
samePath = self.filterPathname(location.pathname) === self.filterPathname(this.pathname),
testHash = this.hash.replace(/(:|\.|\/)/g, '\\$1'),
@ -80,7 +80,7 @@
$('[' + this.attr_name() + '=fixed]', self.scope).each(function (idx, el) {
var expedition = $(this),
settings = expedition.data('magellan-expedition-init'),
styles = expedition.attr('styles'), // save styles
styles = expedition.attr('style'), // save styles
top_offset, fixed_top;
expedition.attr('style', '');

View File

@ -4,7 +4,7 @@
Foundation.libs.offcanvas = {
name : 'offcanvas',
version : '5.5.3',
version : '{{VERSION}}',
settings : {
open_method : 'move',

View File

@ -407,7 +407,7 @@
Foundation.libs.orbit = {
name : 'orbit',
version : '5.5.3',
version : '{{VERSION}}',
settings : {
animation : 'slide',

View File

@ -6,7 +6,7 @@
Foundation.libs.reveal = {
name : 'reveal',
version : '5.5.3',
version : '{{VERSION}}',
locked : false,
@ -19,6 +19,7 @@
multiple_opened : false,
bg_class : 'reveal-modal-bg',
root_element : 'body',
no_scroll: false,
open : function(){},
opened : function(){},
close : function(){},
@ -49,7 +50,7 @@
S = self.S;
S(this.scope)
.off('.reveal')
.off('.fndtn.reveal')
.on('click.fndtn.reveal', '[' + this.add_namespace('data-reveal-id') + ']:not([disabled])', function (e) {
e.preventDefault();
@ -171,6 +172,14 @@
modal.attr('tabindex','0').attr('aria-hidden','false');
if(settings.no_scroll){//added 10/9/15, prevents annoying scroll positioning bug with position: absolute; reveals
var $body = $('body');
$body.on('open.fndtn.reveal', function(){
$body.css('overflow', 'hidden')
.off('open.fndtn.reveal');
});
}
this.key_up_on(modal); // PATCH #3: turning on key up capture only when a reveal window is open
// Prevent namespace event from triggering twice
@ -178,7 +187,8 @@
if (e.namespace !== 'fndtn.reveal') return;
});
modal.on('open.fndtn.reveal').trigger('open.fndtn.reveal');
modal.trigger('open.fndtn.reveal');
if (open_modal.length < 1) {
this.toggle_bg(modal, true);
@ -256,6 +266,14 @@
modal.removeAttr('tabindex','0').attr('aria-hidden','true');
if(settings.no_scroll){//added 10/9/15, prevents annoying scroll positioning bug with position: absolute; reveals
var $body = $('body');
$body.on('close.fndtn.reveal', function(){
$body.css('overflow', 'auto')
.off('close.fndtn.reveal');
});
}
this.locked = true;
this.key_up_off(modal); // PATCH #3: turning on key up capture only when a reveal window is open

View File

@ -4,13 +4,13 @@
Foundation.libs.slider = {
name : 'slider',
version : '5.5.3',
version : '{{VERSION}}',
settings : {
start : 0,
end : 100,
step : 1,
precision : 2,
precision : 0,
initial : null,
display_selector : '',
vertical : false,

View File

@ -4,7 +4,7 @@
Foundation.libs.tab = {
name : 'tab',
version : '5.5.3',
version : '{{VERSION}}',
settings : {
active_class : 'active',
@ -102,19 +102,19 @@
var hash_element = S(hash);
if (hash_element.hasClass('content') && hash_element.parent().hasClass('tabs-content')) {
// Tab content div
self.toggle_active_tab($('[' + self.attr_name() + '] > * > a[href=' + hash + ']').parent());
self.toggle_active_tab($('[' + self.attr_name() + '] > * > a[href=\\' + hash + ']').parent());
} else {
// Not the tab content div. If inside the tab content, find the
// containing tab and toggle it as active.
var hash_tab_container_id = hash_element.closest('.content').attr('id');
if (hash_tab_container_id != undefined) {
self.toggle_active_tab($('[' + self.attr_name() + '] > * > a[href=#' + hash_tab_container_id + ']').parent(), hash);
self.toggle_active_tab($('[' + self.attr_name() + '] > * > a[href=\\#' + hash_tab_container_id + ']').parent(), hash);
}
}
} else {
// Reference the default tab hashes which were initialized in the init function
for (var ind = 0; ind < self.default_tab_hashes.length; ind++) {
self.toggle_active_tab($('[' + self.attr_name() + '] > * > a[href=' + self.default_tab_hashes[ind] + ']').parent());
self.toggle_active_tab($('[' + self.attr_name() + '] > * > a[href=\\' + self.default_tab_hashes[ind] + ']').parent());
}
}
}

View File

@ -4,7 +4,7 @@
Foundation.libs.tooltip = {
name : 'tooltip',
version : '5.5.3',
version : '{{VERSION}}',
settings : {
additional_inheritable_classes : [],
@ -194,7 +194,7 @@
tip_template = window[settings.tip_template];
}
var $tip = $(tip_template(this.selector($target), $('<div></div>').html($target.attr('title')).html())),
var $tip = $(tip_template(this.selector($target), $('<div></div>').html($target.attr('title')).text())),
classes = this.inheritable_classes($target);
$tip.addClass(classes).appendTo(settings.append_to);

View File

@ -4,7 +4,7 @@
Foundation.libs.topbar = {
name : 'topbar',
version : '5.5.3',
version : '{{VERSION}}',
settings : {
index : 0,
@ -134,7 +134,7 @@
}
}
} else {
if (self.is_sticky(topbar, topbar.parent(), settings)) {
if (self.is_sticky(topbar, topbar.parent(), settings) && topbar.parent().offset().top === 0) {
topbar.parent().addClass('fixed');
}
@ -199,7 +199,7 @@
e.stopImmediatePropagation();
if (li.hasClass('hover')) {
if (li.hasClass('hover') && (settings.is_hover || li.children('a').first().hasClass('last-clicked'))) {
li
.removeClass('hover')
.find('li')
@ -214,6 +214,10 @@
if (target[0].nodeName === 'A' && target.parent().hasClass('has-dropdown')) {
e.preventDefault();
if(!settings.is_hover){
topbar.find('.last-clicked').removeClass('last-clicked');
target.addClass('last-clicked');
}
}
}
})
@ -245,19 +249,25 @@
S(window).off('.topbar').on('resize.fndtn.topbar', self.throttle(function () {
self.resize.call(self);
}, 50)).trigger('resize.fndtn.topbar').load(function () {
}, 50)).trigger('resize.fndtn.topbar').on('load', function () {
// Ensure that the offset is calculated after all of the pages resources have loaded
S(this).trigger('resize.fndtn.topbar');
});
S('body').off('.topbar').on('click.fndtn.topbar', function (e) {
var parent = S(e.target).closest('li').closest('li.hover');
var parent = S(e.target).closest('li').closest('li.hover'),
topbar = S(e.target).closest('[' + self.attr_name() + ']'),
settings = topbar.data(self.attr_name(true) + '-init');
if (parent.length > 0) {
return;
}
S('[' + self.attr_name() + '] li.hover').removeClass('hover');
if(settings && !settings.is_hover){
S('[' + self.attr_name() + '] a.last-clicked').removeClass('last-clicked');
}
});
// Go up a level on Click
@ -298,15 +308,14 @@
$(this).parents('.has-dropdown').addClass('hover');
})
.blur(function () {
$(this).parents('.has-dropdown').removeClass('hover');
$(this).removeClass('last-clicked').parents('.has-dropdown').removeClass('hover');
});
},
resize : function () {
var self = this;
self.S('[' + this.attr_name() + ']').each(function () {
var topbar = self.S(this),
settings = topbar.data(self.attr_name(true) + '-init');
var topbar = self.S(this);
var stickyContainer = topbar.parent('.' + self.settings.sticky_class);
var stickyOffset;
@ -324,7 +333,7 @@
}
}
if (self.is_sticky(topbar, stickyContainer, settings)) {
if (self.is_sticky(topbar, stickyContainer, self.settings)) {
if (stickyContainer.hasClass('fixed')) {
// Remove the fixed to allow for correct calculation of the offset.
stickyContainer.removeClass('fixed');
@ -377,14 +386,14 @@
if (!$dropdown.find('.title.back').length) {
if (settings.mobile_show_parent_link == true && url) {
if (settings.mobile_show_parent_link === true && url) {
$titleLi = $('<li class="title back js-generated"><h5><a href="javascript:void(0)"></a></h5></li><li class="parent-link hide-for-medium-up"><a class="parent-link js-generated" href="' + url + '">' + $link.html() +'</a></li>');
} else {
$titleLi = $('<li class="title back js-generated"><h5><a href="javascript:void(0)"></a></h5>');
}
// Copy link to subnav
if (settings.custom_back_text == true) {
if (settings.custom_back_text === true) {
$('h5>a', $titleLi).html(settings.back_text);
} else {
$('h5>a', $titleLi).html('&laquo; ' + $link.html());