Diferencia entre revisiones de «MediaWiki:Gadget-Reader.js»
(test reader mode) |
(typo con titulo) |
||
Línea 22: | Línea 22: | ||
.css('z-index', '10') | .css('z-index', '10') | ||
.wrapInner('<div id="panelmenu" style="height: ' + pmenuheight + 'px; overflow: auto" />') | .wrapInner('<div id="panelmenu" style="height: ' + pmenuheight + 'px; overflow: auto" />') | ||
− | .prepend('<div id="panelbutton" style="position: absolute; top: 0px; background:black; color:white; padding: 10px 8px 10px 172px; border-top-right-radius: 8px; border-bottom-right-radius: 8px;"> | + | .prepend('<div id="panelbutton" style="position: absolute; top: 0px; background:black; color:white; padding: 10px 8px 10px 172px; border-top-right-radius: 8px; border-bottom-right-radius: 8px;">Vitalinux</div>'); |
− | $('#p-logo,.editsection').hide(); | + | $('#p-logo,.editsection,#mw-head').hide(); |
$('#content').css('margin-left', '0px').css('border', 'none'); | $('#content').css('margin-left', '0px').css('border', 'none'); | ||
$('#p-search').insertBefore('#p-Navigation'); | $('#p-search').insertBefore('#p-Navigation'); |
Revisión del 12:28 19 nov 2015
//<source lang="javascript">
// read-mostly layout adjustments for vector skin to make left panel into slideout dravtr
// Based on Jim Tittsler Reader mode for WE
$(function () {
var ppos = -164;
var pmenuheight = $(window).height()-15;
var vtReaderMode = false;
var vtReaderWidth = window['vtReaderWidth'] || 1024;
function restyleSearch() { // FIXME custom search may not be loaded yet
$('#p-search').css('margin-bottom', '30px').css('margin-top', '30px');
$('#searchInput, #gcse').css('width', '115px');
}
function reader(){
if (!vtReaderMode && (window.vtReader || ($(window).width() <= vtReaderWidth))) {
vtReaderMode = true;
$('#mw-panel').css('position', 'fixed')
.css('top', '2px')
.css('left', ppos + 'px')
.css('background', '#f3f3f3')
.css('border-right', 'solid black')
.css('border-bottom', 'solid black')
.css('z-index', '10')
.wrapInner('<div id="panelmenu" style="height: ' + pmenuheight + 'px; overflow: auto" />')
.prepend('<div id="panelbutton" style="position: absolute; top: 0px; background:black; color:white; padding: 10px 8px 10px 172px; border-top-right-radius: 8px; border-bottom-right-radius: 8px;">Vitalinux</div>');
$('#p-logo,.editsection,#mw-head').hide();
$('#content').css('margin-left', '0px').css('border', 'none');
$('#p-search').insertBefore('#p-Navigation');
$('#p-namespaces').insertBefore('#p-Navigation').attr('class', 'portal').find('ul').wrap('<div class="body" />');
$('#p-views').insertAfter('#p-Navigation').attr('class', 'portal').find('ul').wrap('<div class="body" />');
if ($('#p-views li').length === 0) $('#p-views').hide();
$('#p-cactions').insertAfter('#p-views').attr('class', 'portal').find('ul').wrap('<div class="body" />');
if ($('#p-cactions li').length === 0) $('#p-cactions').hide();
restyleSearch(); setTimeout(restyleSearch, 2000); // FIXME don't know if search has been added yet
$('#p-personal').insertAfter('#p-cactions')
.addClass('portal')
.css('position', 'static')
.css('right', '0px')
.find('ul').wrap('<div class="body" />').end()
.find('h5').css('display', 'block').end()
.find('li').css('float', 'none');
$('#left-navigation').css('top', '0px');
$('#right-navigation').css('margin-top', '0px');
$('#head-base').css('height', '40px');
$('#socialbookmarks').css('padding-left', '0.5em');
$('#panelbutton').click(function(e) {
e.preventDefault();
ppos = (ppos === 0) ? -164 : 0;
$('#mw-panel').animate( {left: ppos }, 'fast');
});
}
}
$(window).resize(function() {
reader();
if (vtReaderMode) {
$('#mw-head-base').css('height', '3em');
}
});
reader();
});