-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
44 lines (43 loc) · 20.9 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!doctype html><html><head><!-- Global site tag (gtag.js) - Google Analytics --><script async src="https://www.googletagmanager.com/gtag/js?id=UA-69446843-11"></script><script>window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-69446843-11');</script><title>Plusstimer Elvebakken</title><meta name="description" content="Denne nettsiden kan du bruke til å regne ut hvor mange plusstimer du har samlet opp dette semesteret hvis du går på Elvebakken videregående skole."><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=0"><meta name="apple-mobile-web-app-capable" content="yes"><style>html{min-height:100%;display:flex}body{min-width:100%;display:flex;margin:0;justify-content:center;text-align:center;font-family:ubuntu,-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"}h4{margin-bottom:5px}h6{margin-top:5px}h4,h6 {font-weight:300}a{color:#337ab7}footer{position:fixed;padding:20px;bottom:0;font-size:1.3em}input[type="text"],input[type="number"],select,[type="submit"]{border-radius:5px;border:1px solid #ccc;font-size:inherit;font-family:inherit;padding:5px;box-shadow:0 1px 2px #ccc;background:#fff;color:inherit;text-decoration:none}info{border-radius:5px;border:1px solid #ccc;font-size:inherit;font-family:inherit;padding:5px;box-shadow:0 1px 2px #ccc;color:inherit;text-decoration:none}.button{border-radius:5px;border:1px solid #ccc;font-size:inherit;font-family:inherit;padding:5px;box-shadow:0 1px 2px #ccc;background:#fff;color:inherit;text-decoration:none}input[type="text"],[type="submit"],info,.button{-webkit-appearance:none;width:calc(62vw + 64px);max-width:calc(210px + 64px)}#authorize-div{display:none;margin-top:30px}#extra-div{display:none}.grid-2{display:grid;grid-template-areas:". .";grid-gap:10px}.grid-2>*{display:flex;align-items:center}.no-overlay{-webkit-tap-highlight-color:rgba(0,0,0,0)}#loselink{position:fixed;font-size:2em;margin:20px;right:0;color:#777;cursor:pointer;background:none;border:none;opacity:0;transition:opacity .25s ease-in-out;text-decoration:none}#loselink[onclick]{opacity:1}#loselink:hover{color:#555}#loselink:active{color:#000}#losetimer[style*="display: block"]+#loselink,#losetimer[style*="display:block"]+#loselink{opacity:0;cursor:inherit}span{transition:opacity .25s ease-in-out}span:empty{opacity:0}info{position:absolute;margin:20px 0 0 -142.5px;font-weight:100;font-style:oblique;z-index:-100;opacity:0;transition:opacity .15s;background:aliceblue}info:before{content:" ";background:#ccc;height:24px;width:2px;top:-24px;position:absolute}@media screen and (min-width:930px){info{margin:-32px 0 0 160px}info:before{width:16px;height:2px;left:-17px;top:initial}}@media screen and (max-width:929px){info+*,info+*+*,info+*+*+*,info+*+*+*+*{transition:opacity .15s}input:focus+info+*,input:focus+info+*+*,input:focus+info+*+*+*,input:focus+info+*+*+*+*{opacity:0}}input:focus+info{z-index:1000;opacity:1}form:valid input[type="submit"],.button{cursor:pointer}form:valid input[type="submit"]:active,.button:active{background:#ccc}input:invalid{color:#a94442;background:#f2dede;border-color:#a94442}form:invalid input[type="submit"]{background:#ccc;color:#999;cursor:not-allowed}form#update{max-width:284px;width:calc(62vw + 74px);display:none;margin:auto}form#losetimer{width:calc(62vw + 74px);display:none;margin:auto;max-width:335px}form#losetimer [key]{font-weight:100}menu{display:flex;padding:0;margin-top:20px}menu>*{margin-right:5px}menu>:last-child{margin-right:0}menu>:active{background:#ddd}#result-view{display:none}#result-wrapper{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center}#result-wrapper>*{width:62vw;max-width:210px;margin:5px}#result{height:65vw;max-height:180px;border-radius:10px;background-color:rgba(0,0,0,0.8);color:white;padding:2em;box-shadow:0 2px 14px #aaa}.number{font-size:130px}.description{font-size:1.75em}.caption-s{display:block;width:62vw;max-width:100%;min-height:12px;font-size:11px}.caption-b{max-width:280px;padding:5px;font-size:12px}.caption-3{font-size:.9em;margin:-10px auto 15px}@keyframes spin{0%{transform:rotate(45deg)}17%{transform:rotate(300deg)}34%{transform:rotate(90deg)}51%{transform:rotate(450deg)}66%{transform:rotate(135deg)}83%{transform:rotate(495deg)}to{transform:rotate(405deg)}}#loading{animation:spin 5s infinite}pre{white-space:pre-line;padding:20px;margin:auto;font-family:inherit}pre:empty{display:none}pre h4:last-child{margin-bottom:25px}pre h4:last-child::after{animation:spin 5s infinite;background-image:url(/img/loading.svg);background-size:contain;content:" ";display:inline-block;height:1em;margin-left:1em;width:1em}pre h4.error::after{content:none}</style><link rel="apple-touch-icon" href="img/app-icon.png"><link rel="icon" href="img/favicon.png"></head><body><div id="result-view"><div id="result-wrapper"><div id="result"><div class="number">0</div><span class="description">plusstimer</span></div><a href="#" onclick="show(UPDATE)" class="button"><div>Oppdater fravær</div><span class="caption-s" id="last-update"><span style="color: white">.</span></span></a></div></div><form id="update"><h4>Hvor mange dager fravær har du på skolearena?</h4><input type="text" name="days" required="true" autocomplete="off" value="0"><info>Skriv hele dager direkte fra skolearena<br><img src="https://i.snag.gy/RLUAui.jpg"></info><h4>Hvor mange klokketimer fravær har du på skolearena?</h4><input type="text" name="hours" required="true" autocomplete="off" value="0"><info>Skriv hele klokketimer (60 min) direkte fra skolearena<br><img src="https://i.snag.gy/deH0i2.jpg"></info><div id="extra-form" class="no-overlay"><h4>Har du jobbet på elevlagsmesse, åpen dag e.l.?</h4><label><input type="radio" name="show-extra" value="false" checked="checked"> Nei</label> <label><input type="radio" name="show-extra" value="true" id="show-extra"> Ja</label></div><div id="extra-div"><h4>Hvor mange ekstratimer har du fått?</h4><input type="text" name="extra" placeholder="0" autocomplete="off"><info>F.eks. elevlagsmesse eller guide på åpen dag, <b>IKKE</b> vanlige studietimer</info></div><menu><a href="#" class="button" style="flex:1" onclick="show(RESULT)"><</a> <input type="submit" value="Send inn" style="flex:10"></menu></form><form id="losetimer"><h3>Hvilke dager har du <u>løse</u> studietimer?</h3><div class="caption-3">Det vil si studietimer som ikke er tilknyttet noe fag.</div><div class="grid-2"></div><menu><a href="#" class="button" style="flex:1" onclick="show(RESULT)"><</a> <input type="submit" value="Send inn" style="flex:10"></menu></form><a href="#" id="loselink" class="fa fa-cog"></a><pre id="output">
<div id="authorize-div">
<span>Du må autorisere med Google Disk:</span>
<button onclick="handleAuthClick(event)" class="button" style="max-width: 150px; margin-top: 20px">Autoriser</button>
<a style="display: block; margin-top: 30px" href="privacy.html">Hvorfor?</a>
</div>
</pre><footer><a target="_blank" href="https://www.instagram.com/beatforbeat2019/">@beatforbeat2019</a></footer><script>var $jscomp$templatelit$0=['[name="extra"]'];$jscomp$templatelit$0.raw=['[name="extra"]'];var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):$jscomp.arrayIterator(a)};
$jscomp.arrayFromIterator=function(a){for(var b,c=[];!(b=a.next()).done;)c.push(b.value);return c};$jscomp.arrayFromIterable=function(a){return a instanceof Array?a:$jscomp.arrayFromIterator($jscomp.makeIterator(a))};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};
$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(a,b,c,d){if(b){c=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var e=a[d];e in c||(c[e]={});c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:b})}};
$jscomp.polyfill("Array.prototype.fill",function(a){return a?a:function(a,c,d){var b=this.length||0;0>c&&(c=Math.max(0,b+c));if(null==d||d>b)d=b;d=Number(d);0>d&&(d=Math.max(0,b+d));for(c=Number(c||0);c<d;c++)this[c]=a;return this}},"es6","es3");$jscomp.findInternal=function(a,b,c){a instanceof String&&(a=String(a));for(var d=a.length,e=0;e<d;e++){var f=a[e];if(b.call(c,f,e,a))return{i:e,v:f}}return{i:-1,v:void 0}};
$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,c){return $jscomp.findInternal(this,a,c).v}},"es6","es3");$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.Symbol=function(){var a=0;return function(b){return $jscomp.SYMBOL_PREFIX+(b||"")+a++}}();
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.iterator;a||(a=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&$jscomp.defineProperty(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}});$jscomp.initSymbolIterator=function(){}};
$jscomp.initSymbolAsyncIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.asyncIterator;a||(a=$jscomp.global.Symbol.asyncIterator=$jscomp.global.Symbol("asyncIterator"));$jscomp.initSymbolAsyncIterator=function(){}};$jscomp.iteratorPrototype=function(a){$jscomp.initSymbolIterator();a={next:a};a[$jscomp.global.Symbol.iterator]=function(){return this};return a};
$jscomp.iteratorFromArray=function(a,b){$jscomp.initSymbolIterator();a instanceof String&&(a+="");var c=0,d={next:function(){if(c<a.length){var e=c++;return{value:b(e,a[e]),done:!1}}d.next=function(){return{done:!0,value:void 0}};return d.next()}};d[Symbol.iterator]=function(){return d};return d};$jscomp.polyfill("Array.prototype.values",function(a){return a?a:function(){return $jscomp.iteratorFromArray(this,function(a,c){return c})}},"es8","es3");
$jscomp.polyfill("Object.is",function(a){return a?a:function(a,c){return a===c?0!==a||1/a===1/c:a!==a&&c!==c}},"es6","es3");$jscomp.polyfill("Array.prototype.includes",function(a){return a?a:function(a,c){var b=this;b instanceof String&&(b=String(b));var e=b.length;c=c||0;for(0>c&&(c=Math.max(c+e,0));c<e;c++){var f=b[c];if(f===a||Object.is(f,a))return!0}return!1}},"es7","es3");
$jscomp.checkStringArgs=function(a,b,c){if(null==a)throw new TypeError("The 'this' value for String.prototype."+c+" must not be null or undefined");if(b instanceof RegExp)throw new TypeError("First argument to String.prototype."+c+" must not be a regular expression");return a+""};$jscomp.polyfill("String.prototype.includes",function(a){return a?a:function(a,c){return-1!==$jscomp.checkStringArgs(this,a,"includes").indexOf(a,c||0)}},"es6","es3");
var CLIENT_ID="1068107389496-sapmb6nh9l85vccdke6ju2jsbv5ibs51.apps.googleusercontent.com",SCOPES=["https://www.googleapis.com/auth/spreadsheets","https://www.googleapis.com/auth/drive"],MIME="application/vnd.google-apps.spreadsheet",q=function(a){return document.querySelector(a)},range=function(a){return Array(a).fill().map(function(a,c){return c})},COMPONENTS=["#result-view","form#update","form#losetimer","pre#output"],$jscomp$destructuring$var0=$jscomp.makeIterator(COMPONENTS),RESULT=$jscomp$destructuring$var0.next().value,
UPDATE=$jscomp$destructuring$var0.next().value,LOSETIMER=$jscomp$destructuring$var0.next().value,PRE=$jscomp$destructuring$var0.next().value,show=function(a){return a?COMPONENTS.forEach(function(b){return q(b).style.display=a===b?"block":"none"}):COMPONENTS.filter(function(a){return"block"===q(a).style.display})},VERSION={key:"ba20e7c6932aff82e4cce69e9693fb2f",title:"Plusstimer v\u00e5r 2019",template:"1IUZTdlJlaKUEuQXE4SzRbByYjGW7rnGjTeT-QDFDk2o",range:"Plusstimer!D7:G7",days:[0,0],hours:[0,1],extra:[0,
2],plusstimer:[0,3],losetimer:"Plusstimer!M15:N19"},COMPATIBLE_VERSIONS=[{key:"2c15975b3cbd3189dd9a776e91da0507",title:"Plusstimer v\u00e5r 2019",template:"1TQS9fNNx-TxM4kx8IiZTIe96acp6xLB2ERvzZ-lYNgo",range:"Plusstimer!D7:L19",days:[0,0],hours:[0,1],extra:[0,2],losetimer:"Plusstimer!K15:L19"}],INCOMPATIBLE_VERSIONS=["Plusstimer 2017 h\u00f8st Panda Bever","Plusstimer 2017 h\u00f8st Ulv Rotte","Plusstimer 2018 v\u00e5r gfxksll","Versjon ll20s0gc","tnjioe0fh34j9"];
function checkAuth(){var a=setTimeout(apiLoadErr,5E3);gapi.auth.authorize({client_id:CLIENT_ID,scope:SCOPES.join(" "),immediate:!0},function(b){return q("#authorize-div").style.display="block",handleAuthResult(b),clearTimeout(a)})}function handleAuthClick(){gapi.auth.authorize({client_id:CLIENT_ID,scope:SCOPES,immediate:!1},handleAuthResult)}function log(a,b){if(void 0===b?0:b)show(PRE),q("pre").innerHTML='<h4 class="error">'+a+"</h4>";console.log(a)}
function showLoading(){show(PRE);q(PRE).innerHTML='<img id="loading" src="img/loading.svg">'}function handleAuthResult(a){a&&!a.error&&(showLoading(),loadGDriveApi())}function apiLoadErr(){log("Det virker som om det er noe galt. Pr\u00f8v \u00e5 laste inn siden p\u00e5 nytt, eller \u00e5 bruke mobilen eller en annen PC.",!0)}
function loadGDriveApi(){log("Laster inn...");gapi.client.load("drive","v2",function(a){"sheetId"in localStorage&&"versionKey"in localStorage&&localStorage.versionKey===VERSION.key&&loadSheetsApi(fetchAndOutputData,localStorage.sheetId,!1);findFile()})}
function findFile(){log("Leter etter regnearket");gapi.client.drive.files.list({q:"fullText contains '"+VERSION.key+"'"}).execute(function(a){if(a.error)401==a.error.code?checkAuth():log("En feil oppsto: "+a.error.message,!0);else if(trashIncompatibles(),a=getID(a.items))loadSheetsApi(fetchAndOutputData,a,!1),setEventListener(a),localStorage.sheetId=a,localStorage.versionKey=VERSION.key,"losetimer"in VERSION&&q("#loselink").setAttribute("onclick",'renderLosetimer("'+a+'"); false')})}
function getID(a){if(a=a.find(function(a){return a.mimeType===MIME&&!a.labels.trashed}))return a.id;log("Oppretter regneark");copyFile()}var sheetsApiLoaded=!1;function loadSheetsApi(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];sheetsApiLoaded?a.apply(null,$jscomp.arrayFromIterable(c)):gapi.client.load("https://sheets.googleapis.com/$discovery/rest?version=v4").then(function(b){sheetsApiLoaded=!0;a.apply(null,$jscomp.arrayFromIterable(c))})}
function fetchAndOutputData(a,b){b=void 0===b?!1:b;console.log("fetchAndOutputData called with sheetId",a);log("Laster inn plusstimer");"string"===typeof a?gapi.client.sheets.spreadsheets.values.get({spreadsheetId:a,range:VERSION.range}).then(function(c){var d=c.result;0<d.values.length?(b||show(RESULT),["days","hours","extra"].forEach(function(a){return q(UPDATE).querySelector('[name="'+a+'"]').value=d.values[VERSION[a][0]][VERSION[a][1]]}),q("#result>.number").innerHTML=d.values[VERSION.plusstimer[0]][VERSION.plusstimer[1]],
showExtraFormIf(0<d.values[VERSION.extra[0]][VERSION.extra[1]]),displayLastEditDate(a)):log("Fant ingen data.",!0);b&&renderLosetimer(a,!0)}).catch(function(a){log("Feil: "+a.result.error.message,!0)}):log("Noe gikk galt, vennligst last inn siden p\u00e5 nytt og pr\u00f8v igjen",!0)}
function displayLastEditDate(a){var b=q("#last-update");b.innerHTML="";setTimeout(function(c){return gapi.client.drive.files.get({fileId:a}).execute(function(a){b.innerHTML="(Sist endret "+formatDate(a.modifiedDate)+")"})},500)}function copyFile(){gapi.client.drive.files.copy({fileId:VERSION.template,resource:{title:VERSION.title}}).execute(function(a){COMPATIBLE_VERSIONS.length?copyFromOldSheet(a.id):loadSheetsApi(function(b){return renderLosetimer(a.id,!0)});setEventListener(a.id)})}
function copyFromOldSheet(a){if(!COMPATIBLE_VERSIONS.length)return renderLosetimer(a,!0);log("Pr\u00f8ver \u00e5 finne et gammelt regneark");gapi.client.drive.files.list({q:COMPATIBLE_VERSIONS.map(function(a){return'fullText contains "'+a.key+'"'}).join(" or ")}).execute(function(b){if(b.error)renderLosetimer(a,!0);else{var c=b.items.find(function(a){return a.mimeType===MIME&&!a.labels.trashed});if(c){log("Fant et gammelt regneark");var d=COMPATIBLE_VERSIONS.find(function(a){return a.title===c.title})||
COMPATIBLE_VERSIONS[0];loadSheetsApi(function(b){gapi.client.sheets.spreadsheets.values.get({spreadsheetId:c.id,range:d.range}).then(function(b){var e=$jscomp.makeIterator(["days","hours","extra"].map(function(a){return d[a]}).map(function(a){return b.result.values[a[0]][a[1]]})),f=e.next().value,k=e.next().value,l=e.next().value;d.losetimer?gapi.client.sheets.spreadsheets.values.get({spreadsheetId:c.id,range:d.losetimer}).then(function(b){updateLoseTimer(a,b.result.values,function(){trashFile(c.id);
updateSheet(a,f,k,l,!1)},d)}):(updateSheet(a,f,k,l,!0),trashFile(c.id))})})}else renderLosetimer(a,!0)}})}function trashFile(a){log("Flytter gammelt regneark til papirkurven");gapi.client.drive.files.trash({fileId:a}).execute(function(a){a.error&&console.warn(a.error,a)})}
function trashIncompatibles(){INCOMPATIBLE_VERSIONS.forEach(function(a){gapi.client.drive.files.list({q:"fullText contains '"+a+"'"}).execute(function(a){return a.items.filter(function(a){return a.mimeType==MIME&&!a.labels.trashed}).map(function(a){return a.id}).forEach(trashFile)})})}
function updateSheet(a,b,c,d,e){e=void 0===e?!1:e;if(b&&c){show(PRE);var f=[],g=["days","hours","extra"];g.forEach(function(a){return f[VERSION[a][0]]=[]});g.forEach(function(a,e){return f[VERSION[a][0]][VERSION[a][1]]=[b,c,d][e]});log("Oppdaterer frav\u00e6r");gapi.client.sheets.spreadsheets.values.update({spreadsheetId:a,range:VERSION.range,valueInputOption:"USER_ENTERED",values:f}).then(function(c){fetchAndOutputData(a,e)})}else show(UPDATE)}
function setEventListener(a){q(UPDATE).onsubmit=function(b){b.preventDefault();updateSheet.apply(null,[a].concat($jscomp.arrayFromIterable(["days","hours","extra"].map(function(a){return document.getElementsByName(a)[0].value}))))}}function showExtraFormIf(a){q("#extra-div").style.display=a?"block":"none";[].concat($jscomp.arrayFromIterable(document.getElementsByName("show-extra"))).forEach(function(b,c){return b.checked=c==a})}
["click","keyup"].forEach(function(a){return q("#extra-form").addEventListener(a,function(a){showExtraFormIf(q("#show-extra").checked);q("#show-extra").checked||(q(UPDATE).querySelector($jscomp$templatelit$0).value="")})});
function updateLoseTimer(a,b,c){c=void 0===c?!1:c;loadSheetsApi(function(d){showLoading();gapi.client.sheets.spreadsheets.values.update({spreadsheetId:a,range:VERSION.losetimer,valueInputOption:"USER_ENTERED",values:b}).then(c?c:function(){return fetchAndOutputData(a)}).catch(function(a){log("Det oppsto en feil: "+a.result.error.message+"\n\nLast inn siden p\u00e5 nytt for \u00e5 pr\u00f8ve igjen.",!0)})})}
function renderLosetimer(a,b){b=void 0===b?!1:b;if("losetimer"in VERSION){show().includes("form#losetimer")||showLoading();var c=q(LOSETIMER);c.onsubmit=function(d){d.preventDefault();d=range(5).map(function(a){return[].concat($jscomp.arrayFromIterable(c.querySelectorAll('[key="'+a+'"]'))).map(function(a){return a.value||a.innerText})});updateLoseTimer(a,d,b?function(){return show(UPDATE)}:!1)};loadSheetsApi(function(b){gapi.client.sheets.spreadsheets.values.get({spreadsheetId:a,range:VERSION.losetimer}).then(function(a){show(LOSETIMER);
c.querySelector(".grid-2").innerHTML="\n <div>Ukedag</div>\n <div>Antall l\u00f8se studietimer</div>"+a.result.values.map(function(a,b){return'\n <div key="'+b+'">'+a[0]+'</div>\n <input key="'+b+'" name="amount" type="number" value="'+a[1]+'">'}).join("")})})}else show(RESULT)}
["https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"].forEach(function(a){var b=document.createElement("link");b.setAttribute("rel","stylesheet");b.setAttribute("href",a);q("head").appendChild(b)});
var formatDate=function(a){for(var b=[],c=0;c<arguments.length;++c)b[c-0]=arguments[c];b=new (Function.prototype.bind.apply(Date,[null].concat($jscomp.arrayFromIterable(b))));c=new Date;for(var d=[["getFullYear","for {} \u00e5r siden"],["getMonth","for {} m\u00e5ned((er)) siden"],["getDate","for {} dag((er)) siden"],["getHours","for {} time((r)) siden"],["getMinutes","for {} minutt((er)) siden"]].map(function(a){return{method:a[0],text:a[1]}}),e={},f=0;f<d.length;e={diff:e.diff},f++){var g=d[f],h=
g.method;g=g.text;e.diff=b[h]()-c[h]();if(0!==e.diff)return g.replace(/\{\}/g,-e.diff).replace(/\(\((\w+)\)\)/g,function(a){return function(b,c){return-1===a.diff?"":c}}(e))}return"akkurat n\u00e5"};</script><script src="https://apis.google.com/js/client.js?onload=checkAuth"></script><style type="text/css">/* This element can be filled with CSS loaded with AJAX */</style></body></html>