After Width: | Height: | Size: 213 KiB |
@ -0,0 +1,149 @@
|
||||
/*jshint browser:true */ |
||||
/*eslint-env browser */ |
||||
/*global ADLER32, console, Uint8Array */ |
||||
/*:: declare var ADLER32: ADLER32Module; */ |
||||
var X = ADLER32; |
||||
|
||||
function console_log(/*:: ...args:Array<any> */) { if(typeof console !== 'undefined') console.log.apply(console, [].slice.call(arguments)); } |
||||
|
||||
function lpad(s/*:string*/, len/*:number*/, chr/*:?string*/)/*:string*/{ |
||||
var L/*:number*/ = len - s.length, C/*:string*/ = chr || " "; |
||||
if(L <= 0) return s; |
||||
return new Array(L+1).join(C) + s; |
||||
} |
||||
|
||||
function is_defined(val/*:any*/, keys/*:Array<string>*/)/*:boolean*/ { |
||||
if(typeof val === "undefined") return false; |
||||
return keys.length === 0 || is_defined(val[keys[0]], keys.slice(1)); |
||||
} |
||||
|
||||
/*# buffer to string; IE String.fromCharCode.apply limit, manual chunk */ |
||||
/*:: |
||||
type ArrayLike = any; |
||||
type Stringifier = {(d:ArrayLike):string}; |
||||
*/ |
||||
function make_chunk_buf_to_str(BType/*:function*/)/*:Stringifier*/ { |
||||
return function(data/*:any*/)/*:string*/ { |
||||
var o = "", l = 0, w = 10240, L = data.byteLength/w; |
||||
for(; l<L; ++l) o+=String.fromCharCode.apply(null, ((new BType(data.slice(l*w,l*w+w)))/*:any*/)); |
||||
o+=String.fromCharCode.apply(null, ((new BType(data.slice(l*w)))/*:any*/)); |
||||
return o; |
||||
}; |
||||
} |
||||
/*# buffer to binary string */ |
||||
var bstrify/*:Stringifier*/ = make_chunk_buf_to_str(typeof Uint8Array !== 'undefined' ? Uint8Array : Array); |
||||
|
||||
/*# readAsBinaryString support */ |
||||
var rABS/*:boolean*/ = typeof FileReader !== 'undefined' && is_defined(FileReader, ['prototype', 'readAsBinaryString']); |
||||
var userABS/*:HTMLInputElement*/ = (document.getElementsByName("userabs")[0]/*:any*/); |
||||
if(!rABS) { |
||||
userABS.disabled = true; |
||||
userABS.checked = false; |
||||
} |
||||
|
||||
function copyToClipboard(text){ |
||||
var dummy = document.createElement("input"); |
||||
document.body.appendChild(dummy); |
||||
dummy.setAttribute('value', text); |
||||
dummy.select(); |
||||
document.execCommand("copy"); |
||||
document.body.removeChild(dummy); |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*## Process Result */ |
||||
/*:: declare class HTMLPreElement extends HTMLElement { innerText?:string; } */ |
||||
function process_value(val/*:ADLER32Type*/) { |
||||
var output = []; |
||||
/*output[0] = "Signed : " + val; |
||||
output[1] = "Unsigned : " + (val>>>0); |
||||
*/ |
||||
|
||||
var ergebnis = lpad((val>>>0).toString(16),8,'0') |
||||
|
||||
|
||||
copyToClipboard(ergebnis); |
||||
|
||||
output[2] = "Rechnungsnummer: " + ergebnis; |
||||
|
||||
var out/*:HTMLPreElement*/ = (document.getElementById('out')/*:any*/); |
||||
var o = output.join("\n"); |
||||
if(typeof out.innerText == "undefined") out.textContent = o; |
||||
else out.innerText = o; |
||||
console_log("output", new Date()); |
||||
} |
||||
/*## Raw Text */ |
||||
var dotxt/*:HTMLInputElement*/ = (document.getElementById('dotext')/*:any*/); |
||||
dotxt.onclick = function() { |
||||
|
||||
var txt2 = document.getElementById('nr').value + "-" + document.getElementById('date').value + "-" + document.getElementById('job').value; |
||||
|
||||
// alert(txt2);
|
||||
|
||||
var txt/*:HTMLTextAreaElement*/=(document.getElementById('rawdata')/*:any*/); |
||||
console_log("onload", new Date()); |
||||
|
||||
var wb/*:ADLER32Type*/ = X.str(txt2); |
||||
|
||||
|
||||
process_value(wb); |
||||
}; |
||||
|
||||
/*# HTML5 */ |
||||
|
||||
var readcb = function(e/*:Event*/) { |
||||
console_log("onload", new Date(), rABS, false); |
||||
var target/*:FileReader*/ = (e.target/*:any*/); |
||||
var data = target.result; |
||||
var val/*:ADLER32Type*/ = rABS ? X.bstr(/*::(*/data/*:: :any)*/) : X.str(bstrify(data)); |
||||
process_value(val); |
||||
}; |
||||
|
||||
/*## File Input */ |
||||
var handle_file = function(e/*:Event*/) { |
||||
rABS = userABS.checked; |
||||
var otarget/*:HTMLInputElement*/ = (e.target/*:any*/); |
||||
var files/*:FileList*/ = otarget.files; |
||||
var f/*:File*/ = files[0]; |
||||
|
||||
var reader/*:FileReader*/ = new FileReader(); |
||||
reader.onload = readcb; |
||||
|
||||
if(rABS) (reader/*:any*/).readAsBinaryString(f); |
||||
else reader.readAsArrayBuffer(f); |
||||
}; |
||||
|
||||
var xlf/*:HTMLInputElement*/ = (document.getElementById('xlf')/*:any*/); |
||||
if(xlf.addEventListener) xlf.addEventListener('change', handle_file, false); |
||||
|
||||
/*## Drag and Drop File */ |
||||
var handle_drop/*:EventHandler*/ = (function(e/*:DragEvent*/) { |
||||
e.stopPropagation(); |
||||
e.preventDefault(); |
||||
rABS = userABS.checked; |
||||
if(!e.dataTransfer) return; |
||||
var files/*:FileList*/ = e.dataTransfer.files; |
||||
var f/*:File*/ = files[0]; |
||||
|
||||
var reader/*:FileReader*/ = new FileReader(); |
||||
reader.onload = readcb; |
||||
|
||||
if(rABS) (reader/*:any*/).readAsBinaryString(f); |
||||
else reader.readAsArrayBuffer(f); |
||||
}/*:any*/); |
||||
|
||||
var handle_drag/*:EventHandler*/ = (function (e/*:DragEvent*/) { |
||||
e.stopPropagation(); |
||||
e.preventDefault(); |
||||
if(e.dataTransfer) e.dataTransfer.dropEffect = 'copy'; |
||||
}/*:any*/); |
||||
|
||||
var drop/*:HTMLDivElement*/ = (document.getElementById('drop')/*:any*/); |
||||
if(drop.addEventListener) { |
||||
drop.addEventListener('dragenter', handle_drag, false); |
||||
drop.addEventListener('dragover', handle_drag, false); |
||||
drop.addEventListener('drop', handle_drop, false); |
||||
} |
After Width: | Height: | Size: 3.9 MiB |
After Width: | Height: | Size: 4.5 MiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 1.7 MiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 72 KiB |
@ -0,0 +1,36 @@
|
||||
#h1{ |
||||
text-align:center; |
||||
padding-top:50px; |
||||
font-size:250%; |
||||
color:black; |
||||
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; |
||||
} |
||||
#h2{ |
||||
text-align:center; |
||||
padding-top:20%; |
||||
} |
||||
|
||||
#h3{ |
||||
padding-top:5%; |
||||
text-align:center; |
||||
font-size:100%; |
||||
color:black; |
||||
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; |
||||
} |
||||
|
||||
#tabelle{ |
||||
align="center" |
||||
border="10" |
||||
color:white; |
||||
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; |
||||
text-align:center; |
||||
} |
||||
|
||||
a { |
||||
align:center; |
||||
color: black; |
||||
text-decoration: none; |
||||
text-underline: none; |
||||
font-family: Helvetica; |
||||
} |
||||
|
After Width: | Height: | Size: 4.6 KiB |
@ -0,0 +1,57 @@
|
||||
/*! |
||||
* Start Bootstrap - Half Slider (https://startbootstrap.com/template-overviews/half-slider) |
||||
* Copyright 2013-2017 Start Bootstrap |
||||
* Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap-half-slider/blob/master/LICENSE) |
||||
*/ |
||||
|
||||
.carousel-item { |
||||
height: 65vh; |
||||
min-height: 300px; |
||||
background: no-repeat center center scroll; |
||||
-webkit-background-size: cover; |
||||
-moz-background-size: cover; |
||||
-o-background-size: cover; |
||||
background-size: cover; |
||||
} |
||||
|
||||
.embed-responsive { |
||||
position: relative; |
||||
display: block; |
||||
height: 0; |
||||
padding: 0; |
||||
overflow: hidden; |
||||
} |
||||
.embed-responsive .embed-responsive-item, |
||||
.embed-responsive iframe, |
||||
.embed-responsive embed, |
||||
.embed-responsive object, |
||||
.embed-responsive video { |
||||
position: absolute; |
||||
top: 0; |
||||
bottom: 0; |
||||
left: 0; |
||||
width: 100%; |
||||
height: 100%; |
||||
border: 0; |
||||
} |
||||
.embed-responsive-16by9 { |
||||
padding-bottom: 56.25%; |
||||
} |
||||
.embed-responsive-4by3 { |
||||
padding-bottom: 75%; |
||||
} |
||||
|
||||
.vid-border{ |
||||
position: relative; |
||||
height: 480px; |
||||
width: 854px; |
||||
border: 5px solid black; |
||||
overflow: hidden; |
||||
} |
||||
#vid { |
||||
position: absolute; |
||||
top:-5px; |
||||
left:-5px; |
||||
height: 480px; |
||||
width: 854px; |
||||
} |
@ -0,0 +1,69 @@
|
||||
|
||||
<html> |
||||
<head> |
||||
<title>TLC WebView CDS</title> |
||||
|
||||
</head> |
||||
<body text="#000000" bgcolor="#d3d3d3" link="#FF0000" alink="#FF0000" vlink="#FF0000"> |
||||
<link rel="stylesheet" type="text/css" href="design.css"> |
||||
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico"> |
||||
<meta http-equiv="refresh" content="20" > |
||||
<div id="h1"> |
||||
  TLC WebView CDS |
||||
<p> |
||||
|
||||
</p> |
||||
</div> |
||||
<div id="tabelle"> |
||||
<table width="100%" cellpadding="0" cellspacing="0"> |
||||
<tr> |
||||
<td><div id="h3"><a href="data/TLC01.jpg"><img src="data/TLC01.jpg" alt="TLC01" width="328" height="246" /></a> </div></td> |
||||
<td><div id="h3"><a href="data/TLC02.jpg"><img src="data/TLC02.jpg" alt="TLC02" width="328" height="246" /></a> </div></td> |
||||
<td><div id="h3"><a href=""><img src="data/TLC03.gif" alt="TLC03" width="328" height="246" /></a> </div></td> |
||||
<td><div id="h3"><a href="data/TLC04.jpg"><img src="data/TLC04.jpg" alt="TLC04" width="328" height="246" /></a> </div></td> |
||||
</tr> |
||||
<tr> |
||||
<td><div id="h3"> TLC01 - Salmenkopf, Freistett <p> </p> <button data-clipboard-text="https://services.schuttercloud.com/data/TLC01.jpg">Copy direct link to clipboard</button> </div></td> |
||||
<td><div id="h3"> TLC02 - Salmenkopf, Freistett <p> </p> <button data-clipboard-text="https://services.schuttercloud.com/data/TLC02.jpg">Copy direct link to clipboard</button> </div></td> |
||||
<td><div id="h3"> TLC03 - not used yet <p> </p> <button data-clipboard-text="https://services.schuttercloud.com">Copy direct link to clipboard</button> </div></td> |
||||
<td><div id="h3"> TLC04 - Demo <p> </p> <button data-clipboard-text="https://services.schuttercloud.com/data/TLC04.jpg">Copy direct link to clipboard</button> </div></td> |
||||
</tr> |
||||
<tr> |
||||
<td><div id="h3"><a href=""><img src="data/TLC05.gif" alt="TLC05" width="328" height="246" /></a> </div></td> |
||||
<td><div id="h3"><a href=""><img src="data/TLC06.gif" alt="TLC06" width="328" height="246" /></a> </div></td> |
||||
<td><div id="h3"><a href=""><img src="data/TLC07.gif" alt="TLC07" width="328" height="246" /></a> </div></td> |
||||
<td><div id="h3"><a href=""><img src="data/TLC08.gif" alt="TLC08" width="328" height="246" /></a> </div></td> |
||||
</tr> |
||||
<tr> |
||||
<td><div id="h3"> TLC05 - not used yet <p> </p> <button data-clipboard-text="https://services.schuttercloud.com">Copy direct link to clipboard</button> </div></td> |
||||
<td><div id="h3"> TLC06 - not used yet <p> </p> <button data-clipboard-text="https://services.schuttercloud.com">Copy direct link to clipboard</button> </div></td> |
||||
<td><div id="h3"> TLC07 - not used yet <p> </p> <button data-clipboard-text="https://services.schuttercloud.com">Copy direct link to clipboard</button> </div></td> |
||||
<td><div id="h3"> TLC08 - not used yet <p> </p> <button data-clipboard-text="https://services.schuttercloud.com">Copy direct link to clipboard</button> </div></td> |
||||
</tr> |
||||
</table> |
||||
</div> |
||||
<div id="h2"> |
||||
<a href="https://services.schuttercloud.com/slider.html">Slider</a> |
||||
<br><br> |
||||
Version 0.3 <br> <br> |
||||
<a href="https://coptersicht.de/index.php/impressum/">Impressum</a> |
||||
</p> |
||||
</div> |
||||
|
||||
|
||||
|
||||
<script src="clipboard.min.js"></script> |
||||
<script> |
||||
var btns = document.querySelectorAll('button'); |
||||
var clipboard = new Clipboard(btns); |
||||
clipboard.on('success', function(e) { |
||||
console.log(e); |
||||
}); |
||||
clipboard.on('error', function(e) { |
||||
console.log(e); |
||||
}); |
||||
</script> |
||||
|
||||
|
||||
</body> |
||||
</html> |
@ -0,0 +1,172 @@
|
||||
<!DOCTYPE html> |
||||
<html lang="de"> |
||||
|
||||
<head> |
||||
<meta charset="UTF-8"> |
||||
<title>TLC WebView CDS</title> |
||||
<meta name="language" content="de"> |
||||
<meta name="author" content="CopterSicht"> |
||||
<meta name="date" content="2017-11-13T016:43:53+01:00"> |
||||
<meta name="keywords" content="Luftaufnahmen, Luftbild, Filmproduktion"> |
||||
<meta name="description" content="CopterSicht Website"> |
||||
<meta name="robots" content="index,follow"> |
||||
<meta name="audience" content="alle"> |
||||
<meta name="page-topic" content="Dienstleistungen"> |
||||
<meta name="revisit-after" CONTENT="7 days"> |
||||
<meta name="expires" content="0"> |
||||
<meta name="viewport" |
||||
content="width=device-width, initial-scale=1, shrink-to-fit=no"> |
||||
|
||||
<!-- Bootstrap core CSS --> |
||||
<link href="bootstrap.min.css" rel="stylesheet"> |
||||
|
||||
<!-- Custom styles for this template --> |
||||
<link href="half-slider.css" rel="stylesheet"> |
||||
|
||||
</head> |
||||
|
||||
<body> |
||||
|
||||
<!-- Navigation --> |
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top"> |
||||
<div class="container"> |
||||
<a class="navbar-brand" href="https://www.coptersicht.de/">CopterSicht</a> |
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" |
||||
data-target="#navbarResponsive" aria-controls="navbarResponsive" |
||||
aria-expanded="false" aria-label="Toggle navigation"> |
||||
<span class="navbar-toggler-icon"></span> |
||||
</button> |
||||
<div class="collapse navbar-collapse" id="navbarResponsive"> |
||||
<ul class="navbar-nav ml-auto"> |
||||
<li class="nav-item active"><a class="nav-link" href="https://www.coptersicht.de/">Home |
||||
<span class="sr-only">(current)</span> |
||||
</a></li> |
||||
<li class="nav-item"><a class="nav-link" |
||||
href="https://www.coptersicht.de">Kontakt</a></li> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
</div> |
||||
</nav> |
||||
|
||||
<header> |
||||
<div id="carouselExampleIndicators" class="carousel slide" |
||||
data-ride="carousel"> |
||||
<div class="carousel-inner" role="listbox"> |
||||
<!-- Slide One - Set the background image for this slide in the line below --> |
||||
<div class="carousel-item active" |
||||
style="background-image: url('1img.jpg')"> |
||||
<div class="carousel-caption d-none d-md-block"></div> |
||||
</div> |
||||
<!-- Slide Two - Set the background image for this slide in the line below --> |
||||
<div class="carousel-item" |
||||
style="background-image: url('img/2img.jpg')"> |
||||
<div class="carousel-caption d-none d-md-block"></div> |
||||
</div> |
||||
<!-- Slide Three - Set the background image for this slide in the line below --> |
||||
<div class="carousel-item" |
||||
style="background-image: url('img/3img.jpg')"> |
||||
<div class="carousel-caption d-none d-md-block"></div> |
||||
</div> |
||||
<!-- Slide Three - Set the background image for this slide in the line below --> |
||||
<div class="carousel-item" |
||||
style="background-image: url('img/4img.jpg')"> |
||||
<div class="carousel-caption d-none d-md-block"></div> |
||||
</div> |
||||
<!-- Slide Three - Set the background image for this slide in the line below --> |
||||
<div class="carousel-item" |
||||
style="background-image: url('img/5img.jpg')"> |
||||
<div class="carousel-caption d-none d-md-block"></div> |
||||
</div> |
||||
<!-- Slide Three - Set the background image for this slide in the line below --> |
||||
<div class="carousel-item" |
||||
style="background-image: url('img/6img.jpg')"> |
||||
<div class="carousel-caption d-none d-md-block"></div> |
||||
</div> |
||||
</div> |
||||
<!-- Slide Three - Set the background image for this slide in the line below --> |
||||
<div class="carousel-item" |
||||
style="background-image: url('img/7img.jpg')"> |
||||
<div class="carousel-caption d-none d-md-block"></div> |
||||
</div> |
||||
<!-- Slide Three - Set the background image for this slide in the line below --> |
||||
<div class="carousel-item" |
||||
style="background-image: url('img/8img.jpg')"> |
||||
<div class="carousel-caption d-none d-md-block"></div> |
||||
</div> |
||||
<!-- Slide Three - Set the background image for this slide in the line below --> |
||||
<div class="carousel-item" |
||||
style="background-image: url('img/9img.jpg')"> |
||||
<div class="carousel-caption d-none d-md-block"></div> |
||||
</div> |
||||
<a class="carousel-control-prev" href="#carouselExampleIndicators" |
||||
role="button" data-slide="prev"> <span |
||||
class="carousel-control-prev-icon" aria-hidden="true"></span> <span |
||||
class="sr-only">Previous</span> |
||||
</a> <a class="carousel-control-next" href="#carouselExampleIndicators" |
||||
role="button" data-slide="next"> <span |
||||
class="carousel-control-next-icon" aria-hidden="true"></span> <span |
||||
class="sr-only">Next</span> |
||||
</a> |
||||
</div> |
||||
</header> |
||||
|
||||
<br> |
||||
<br> |
||||
|
||||
</div> |
||||
<div id="tabelle"> |
||||
<table width="100%" cellpadding="0" cellspacing="0"> |
||||
<tr> |
||||
<td><div id="h3"><a href="data/TLC01.jpg"><img src="data/TLC01.jpg" alt="TLC01" width="328" height="246" /></a> </div></td> |
||||
<td><div id="h3"><a href="data/TLC02.jpg"><img src="data/TLC02.jpg" alt="TLC02" width="328" height="246" /></a> </div></td> |
||||
<td><div id="h3"><a href=""><img src="data/TLC03.gif" alt="TLC03" width="328" height="246" /></a> </div></td> |
||||
<td><div id="h3"><a href="data/TLC04.jpg"><img src="data/TLC04.jpg" alt="TLC04" width="328" height="246" /></a> </div></td> |
||||
</tr> |
||||
<tr> |
||||
<td><div id="h3"> TLC01 - Salmenkopf, Freistett <p> </p> <button data-clipboard-text="https://services.schuttercloud.com/data/TLC01.jpg">Copy direct link to clipboard</button> </div></td> |
||||
<td><div id="h3"> TLC02 - Salmenkopf, Freistett <p> </p> <button data-clipboard-text="https://services.schuttercloud.com/data/TLC02.jpg">Copy direct link to clipboard</button> </div></td> |
||||
<td><div id="h3"> TLC03 - not used yet <p> </p> <button data-clipboard-text="https://services.schuttercloud.com">Copy direct link to clipboard</button> </div></td> |
||||
<td><div id="h3"> TLC04 - Demo <p> </p> <button data-clipboard-text="https://services.schuttercloud.com/data/TLC04.jpg">Copy direct link to clipboard</button> </div></td> |
||||
</tr> |
||||
<tr> |
||||
<td><div id="h3"><a href=""><img src="data/TLC05.gif" alt="TLC05" width="328" height="246" /></a> </div></td> |
||||
<td><div id="h3"><a href=""><img src="data/TLC06.gif" alt="TLC06" width="328" height="246" /></a> </div></td> |
||||
<td><div id="h3"><a href=""><img src="data/TLC07.gif" alt="TLC07" width="328" height="246" /></a> </div></td> |
||||
<td><div id="h3"><a href=""><img src="data/TLC08.gif" alt="TLC08" width="328" height="246" /></a> </div></td> |
||||
</tr> |
||||
<tr> |
||||
<td><div id="h3"> TLC05 - not used yet <p> </p> <button data-clipboard-text="https://services.schuttercloud.com">Copy direct link to clipboard</button> </div></td> |
||||
<td><div id="h3"> TLC06 - not used yet <p> </p> <button data-clipboard-text="https://services.schuttercloud.com">Copy direct link to clipboard</button> </div></td> |
||||
<td><div id="h3"> TLC07 - not used yet <p> </p> <button data-clipboard-text="https://services.schuttercloud.com">Copy direct link to clipboard</button> </div></td> |
||||
<td><div id="h3"> TLC08 - not used yet <p> </p> <button data-clipboard-text="https://services.schuttercloud.com">Copy direct link to clipboard</button> </div></td> |
||||
</tr> |
||||
</table> |
||||
</div> |
||||
|
||||
<br /> |
||||
</div> |
||||
<script type="text/javascript">/* jshint browser: true */</script> |
||||
<script src="clipboard.min.js"></script> |
||||
<script src="shim.js"></script> |
||||
<script src="adler32.js"></script> |
||||
<script src="browser.flow.js"></script> |
||||
|
||||
|
||||
<script type="text/javascript"> |
||||
</script> |
||||
|
||||
<!-- Footer --> |
||||
<footer class="py-5 bg-dark"> |
||||
<div class="container"> |
||||
<p class="m-0 text-center text-white">Copyright © |
||||
CopterSicht 2018</p> |
||||
<button type="button" class="btn btn-link" |
||||
onclick="window.location.href='https://www.coptersicht.de'">AGB</button> |
||||
<button type="button" class="btn btn-link" |
||||
onclick="window.location.href='https://www.coptersicht.de'">Impressum</button> |
||||
</div> |
||||
<!-- /.container --> |
||||
</footer> |
||||
</body> |
||||
</html> |
@ -0,0 +1,237 @@
|
||||
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys
|
||||
if (!Object.keys) { |
||||
Object.keys = (function () { |
||||
var hasOwnProperty = Object.prototype.hasOwnProperty, |
||||
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'), |
||||
dontEnums = [ |
||||
'toString', |
||||
'toLocaleString', |
||||
'valueOf', |
||||
'hasOwnProperty', |
||||
'isPrototypeOf', |
||||
'propertyIsEnumerable', |
||||
'constructor' |
||||
], |
||||
dontEnumsLength = dontEnums.length; |
||||
|
||||
return function (obj) { |
||||
if (typeof obj !== 'object' && typeof obj !== 'function' || obj === null) throw new TypeError('Object.keys called on non-object'); |
||||
|
||||
var result = []; |
||||
|
||||
for (var prop in obj) { |
||||
if (hasOwnProperty.call(obj, prop)) result.push(prop); |
||||
} |
||||
|
||||
if (hasDontEnumBug) { |
||||
for (var i=0; i < dontEnumsLength; i++) { |
||||
if (hasOwnProperty.call(obj, dontEnums[i])) result.push(dontEnums[i]); |
||||
} |
||||
} |
||||
return result; |
||||
}; |
||||
})(); |
||||
} |
||||
|
||||
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter
|
||||
if (!Array.prototype.filter) |
||||
{ |
||||
Array.prototype.filter = function(fun /*, thisp */) |
||||
{ |
||||
"use strict"; |
||||
|
||||
if (this == null) |
||||
throw new TypeError(); |
||||
|
||||
var t = Object(this); |
||||
var len = t.length >>> 0; |
||||
if (typeof fun != "function") |
||||
throw new TypeError(); |
||||
|
||||
var res = []; |
||||
var thisp = arguments[1]; |
||||
for (var i = 0; i < len; i++) |
||||
{ |
||||
if (i in t) |
||||
{ |
||||
var val = t[i]; // in case fun mutates this
|
||||
if (fun.call(thisp, val, i, t)) |
||||
res.push(val); |
||||
} |
||||
} |
||||
|
||||
return res; |
||||
}; |
||||
} |
||||
|
||||
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim
|
||||
if (!String.prototype.trim) { |
||||
String.prototype.trim = function () { |
||||
return this.replace(/^\s+|\s+$/g, ''); |
||||
}; |
||||
} |
||||
|
||||
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach
|
||||
if (!Array.prototype.forEach) |
||||
{ |
||||
Array.prototype.forEach = function(fun /*, thisArg */) |
||||
{ |
||||
"use strict"; |
||||
|
||||
if (this === void 0 || this === null) |
||||
throw new TypeError(); |
||||
|
||||
var t = Object(this); |
||||
var len = t.length >>> 0; |
||||
if (typeof fun !== "function") |
||||
throw new TypeError(); |
||||
|
||||
var thisArg = arguments.length >= 2 ? arguments[1] : void 0; |
||||
for (var i = 0; i < len; i++) |
||||
{ |
||||
if (i in t) |
||||
fun.call(thisArg, t[i], i, t); |
||||
} |
||||
}; |
||||
} |
||||
|
||||
// Production steps of ECMA-262, Edition 5, 15.4.4.19
|
||||
// Reference: http://es5.github.com/#x15.4.4.19
|
||||
if (!Array.prototype.map) { |
||||
Array.prototype.map = function(callback, thisArg) { |
||||
|
||||
var T, A, k; |
||||
|
||||
if (this == null) { |
||||
throw new TypeError(" this is null or not defined"); |
||||
} |
||||
|
||||
// 1. Let O be the result of calling ToObject passing the |this| value as the argument.
|
||||
var O = Object(this); |
||||
|
||||
// 2. Let lenValue be the result of calling the Get internal method of O with the argument "length".
|
||||
// 3. Let len be ToUint32(lenValue).
|
||||
var len = O.length >>> 0; |
||||
|
||||
// 4. If IsCallable(callback) is false, throw a TypeError exception.
|
||||
// See: http://es5.github.com/#x9.11
|
||||
if (typeof callback !== "function") { |
||||
throw new TypeError(callback + " is not a function"); |
||||
} |
||||
|
||||
// 5. If thisArg was supplied, let T be thisArg; else let T be undefined.
|
||||
if (thisArg) { |
||||
T = thisArg; |
||||
} |
||||
|
||||
// 6. Let A be a new array created as if by the expression new Array(len) where Array is
|
||||
// the standard built-in constructor with that name and len is the value of len.
|
||||
A = new Array(len); |
||||
|
||||
// 7. Let k be 0
|
||||
k = 0; |
||||
|
||||
// 8. Repeat, while k < len
|
||||
while(k < len) { |
||||
|
||||
var kValue, mappedValue; |
||||
|
||||
// a. Let Pk be ToString(k).
|
||||
// This is implicit for LHS operands of the in operator
|
||||
// b. Let kPresent be the result of calling the HasProperty internal method of O with argument Pk.
|
||||
// This step can be combined with c
|
||||
// c. If kPresent is true, then
|
||||
if (k in O) { |
||||
|
||||
// i. Let kValue be the result of calling the Get internal method of O with argument Pk.
|
||||
kValue = O[ k ]; |
||||
|
||||
// ii. Let mappedValue be the result of calling the Call internal method of callback
|
||||
// with T as the this value and argument list containing kValue, k, and O.
|
||||
mappedValue = callback.call(T, kValue, k, O); |
||||
|
||||
// iii. Call the DefineOwnProperty internal method of A with arguments
|
||||
// Pk, Property Descriptor {Value: mappedValue, : true, Enumerable: true, Configurable: true},
|
||||
// and false.
|
||||
|
||||
// In browsers that support Object.defineProperty, use the following:
|
||||
// Object.defineProperty(A, Pk, { value: mappedValue, writable: true, enumerable: true, configurable: true });
|
||||
|
||||
// For best browser support, use the following:
|
||||
A[ k ] = mappedValue; |
||||
} |
||||
// d. Increase k by 1.
|
||||
k++; |
||||
} |
||||
|
||||
// 9. return A
|
||||
return A; |
||||
}; |
||||
} |
||||
|
||||
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf
|
||||
if (!Array.prototype.indexOf) { |
||||
Array.prototype.indexOf = function (searchElement, fromIndex) { |
||||
if ( this === undefined || this === null ) { |
||||
throw new TypeError( '"this" is null or not defined' ); |
||||
} |
||||
|
||||
var length = this.length >>> 0; // Hack to convert object.length to a UInt32
|
||||
|
||||
fromIndex = +fromIndex || 0; |
||||
|
||||
if (Math.abs(fromIndex) === Infinity) { |
||||
fromIndex = 0; |
||||
} |
||||
|
||||
if (fromIndex < 0) { |
||||
fromIndex += length; |
||||
if (fromIndex < 0) { |
||||
fromIndex = 0; |
||||
} |
||||
} |
||||
|
||||
for (;fromIndex < length; fromIndex++) { |
||||
if (this[fromIndex] === searchElement) { |
||||
return fromIndex; |
||||
} |
||||
} |
||||
|
||||
return -1; |
||||
}; |
||||
} |
||||
// Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray
|
||||
|
||||
if (! Array.isArray) { |
||||
Array.isArray = function(obj) { |
||||
return Object.prototype.toString.call(obj) === "[object Array]"; |
||||
}; |
||||
} |
||||
|
||||
// https://github.com/ttaubert/node-arraybuffer-slice
|
||||
// (c) 2013 Tim Taubert <tim@timtaubert.de>
|
||||
// arraybuffer-slice may be freely distributed under the MIT license.
|
||||
|
||||
"use strict"; |
||||
|
||||
if (typeof ArrayBuffer !== 'undefined' && !ArrayBuffer.prototype.slice) { |
||||
ArrayBuffer.prototype.slice = function (begin, end) { |
||||
begin = (begin|0) || 0; |
||||
var num = this.byteLength; |
||||
end = end === (void 0) ? num : (end|0); |
||||
|
||||
// Handle negative values.
|
||||
if (begin < 0) begin += num; |
||||
if (end < 0) end += num; |
||||
|
||||
if (num === 0 || begin >= num || begin >= end) { |
||||
return new ArrayBuffer(0); |
||||
} |
||||
|
||||
var length = Math.min(num - begin, end - begin); |
||||
var target = new ArrayBuffer(length); |
||||
var targetArray = new Uint8Array(target); |
||||
targetArray.set(new Uint8Array(this, begin, length)); |
||||
return target; |
||||
}; |
||||
} |