-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f8f1098
commit f4c9bdc
Showing
18 changed files
with
9,945 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
function MoveContentOutside() { | ||
// Script written by Chiel van Amstel to move the inserted content, thereby relieving it from the reign of the iGEM stylesheet. This script is free to be used by others, as long as full credit is given (in the form of this comment). | ||
|
||
inserted_content = document.querySelector('div#mw-content-text').children | ||
head = inserted_content[0].children //<head> items from inserted html | ||
oldHead = document.querySelector('head').children; | ||
|
||
// move all <head> items to the iGEM <head> section | ||
for (var i = head.length; i > 0; i--) { | ||
el = head[0]; | ||
document.querySelector('head').appendChild(el); | ||
} | ||
|
||
// move all content outside of the iGEM scope (all but 1, because p before inserted content = inserted head) | ||
for (var j = inserted_content.length - 2; j > 0; j--) { | ||
el = inserted_content[1]; | ||
document.querySelector('body').appendChild(el); | ||
} | ||
|
||
// remove the inserted iGEM sections (empty, because content is moved outside now | ||
var leftover = document.querySelector('#globalWrapper>div#content'); | ||
leftover.parentNode.removeChild(leftover); | ||
|
||
// remove padding from top iGEM bar | ||
document.querySelector('div#globalWrapper').style.paddingBottom = "0px"; | ||
} |
Oops, something went wrong.