Add integration test.

This commit is contained in:
Lars Jung 2015-04-29 14:23:15 +02:00
parent ea306c7d0c
commit 70c8364349
5 changed files with 154 additions and 20 deletions

View file

@ -2,21 +2,33 @@
'use strict';
var title;
var htmlId;
var htmlClasses;
var bodyId;
var bodyClasses;
var $pinnedElements;
function pinHtml() {
title = document.title;
htmlId = $('html').attr('id');
htmlClasses = $('html').attr('class');
bodyId = $('body').attr('id');
bodyClasses = $('body').attr('class');
$pinnedElements = $('head,body').children();
}
function restoreHtml() {
document.title = title;
$('html').attr('id', htmlId);
$('html').attr('class', htmlClasses);
$('body').attr('id', bodyId);
$('body').attr('class', bodyClasses);
$('head,body').children().not($pinnedElements).remove();
if (window.localStorage && window.localStorage.clear) {
window.localStorage.clear();
}
}
window.util = window.util || {};