0
0
mirror of https://github.com/Doodle3D/doodle3d-connect.git synced 2024-11-05 07:03:24 +01:00

Reorganised more files

This commit is contained in:
peteruithoven 2014-04-24 12:44:51 +02:00
parent 8a7587f878
commit de030ac756
29 changed files with 0 additions and 1666 deletions

View File

@ -1,20 +0,0 @@
<?php
header("Access-Control-Allow-Origin: *");
header("Content-type: application/json");
require 'credentials.php';
$database = "doodle3d_com_connect";
$dsn = "mysql:host=doodle1.sql.greenhost.nl;dbname=$database";
$table = "signins";
try {
$db = new PDO($dsn, $username, $password);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
$response = array( "status" => "error",
"msg" => $e->getMessage()." (".$e->getCode().")");
exit(json_encode($response)."\r\n");
}
?>

View File

@ -1,24 +0,0 @@
<?php
require 'connect.php';
try {
// exported structure using phpMyAdmin
$createsql = $db->prepare("CREATE TABLE IF NOT EXISTS $table (" .
"`id` varchar(31) NOT NULL," .
"`remoteip` varchar(15) NOT NULL," .
"`localip` varchar(15) NOT NULL," .
"`wifiboxid` varchar(140) NOT NULL," .
"`hidden` tinyint(1) NOT NULL DEFAULT '0'," .
"`date` datetime NOT NULL," .
"PRIMARY KEY (`id`)" .
") ENGINE=InnoDB DEFAULT CHARSET=latin1;");
if($createsql->execute() == TRUE)
echo "$table created";
} catch (PDOException $e) {
$response = array( "status" => "error",
"msg" => $e->getMessage()." (".$e->getCode().")");
exit(json_encode($response)."\r\n");
}
?>

View File

@ -1,21 +0,0 @@
{
"status":"success",
"data":[
{
"id":"62.216.8.197\/10.0.0.18",
"remoteip":"62.216.8.197",
"localip":"10.0.0.18",
"wifiboxid":"Albert",
"hidden":"0",
"date":"2013-10-03 17:24:33",
},
{
"id":"62.216.8.197\/10.0.0.29",
"remoteip":"62.216.8.197",
"localip":"10.0.0.29",
"wifiboxid":"Wilbert",
"hidden":"0",
"date":"2013-10-03 17:52:19"
}
],
}

View File

@ -1,21 +0,0 @@
<?php
require 'connect.php';
$hourago = time() - 60*60;
$remoteip = getenv('REMOTE_ADDR');
try {
$statement = $db->prepare("SELECT * FROM $table where date >= FROM_UNIXTIME(:hourago) AND remoteip = :remoteip");
$statement->execute(array( ':hourago' => $hourago,
':remoteip' => $remoteip));
$boxes = $statement->fetchAll(PDO::FETCH_CLASS);
} catch (PDOException $e) {
$response = array( "status" => "error",
"msg" => $e->getMessage()." (".$e->getCode().")");
exit(json_encode($response)."\r\n");
}
$response = array( "status" => "success",
"data" => $boxes);
exit(json_encode($response)."\r\n");
?>

View File

@ -1,68 +0,0 @@
<?php
/*if ($_SERVER['REQUEST_METHOD'] != "POST") {
$response = array( "status" => "error",
"msg" => "'signin' can only be accessed with the POST method");
exit(json_encode($response)."\r\n");
}*/
require 'connect.php';
if(!isset($_GET['localip'])) {
$response = array( "status" => "error",
"msg" => "missing localip");
exit(json_encode($response)."\r\n");
}
$localip = $_GET['localip'];
if(!isset($_GET['wifiboxid'])) {
$response = array( "status" => "error",
"msg" => "missing wifiboxid");
exit(json_encode($response)."\r\n");
}
$wifiboxid = $_GET['wifiboxid'];
$remoteip = getenv('REMOTE_ADDR');
$timestamp = time();
$id = $remoteip.'/'.$localip; //TODO: column length: 31
try {
$statement = $db->prepare( "REPLACE INTO $table " .
"SET id = :id, " .
" remoteip = :remoteip, " .
" localip = :localip, " .
" wifiboxid = :wifiboxid, " .
" date = FROM_UNIXTIME(:timestamp)");
$statement->execute(array( ":id" => $id,
":remoteip" => $remoteip,
":localip" => $localip,
":wifiboxid" => $wifiboxid,
":timestamp" => $timestamp));
} catch (PDOException $e) {
$response = array( "status" => "error",
"msg" => $e->getMessage()." (".$e->getCode().")");
exit(json_encode($response)."\r\n");
}
// Remove old signins
$hourago = time() - 60*60;
try {
$statement = $db->prepare("DELETE FROM $table WHERE date < FROM_UNIXTIME(:hourago)");
$statement->execute(array( ':hourago' => $hourago));
} catch (PDOException $e) {
$response = array( "status" => "error",
"msg" => $e->getMessage()." (".$e->getCode().")");
exit(json_encode($response)."\r\n");
}
$responseData = array( "remoteip" => $remoteip,
"localip" => $localip,
"wifiboxid" => $wifiboxid,
"timestamp" => $timestamp);
$response = array( "status" => "success",
"data" => $responseData);
exit(json_encode($response)."\r\n");
?>

View File

@ -1,180 +0,0 @@
/**
*
* Main container
*
*/
#addToHomeScreen {
z-index:9999;
-webkit-user-select:none;
user-select:none;
-webkit-box-sizing:border-box;
box-sizing:border-box;
-webkit-touch-callout:none;
touch-callout:none;
width:240px;
font-size:15px;
padding:12px 14px;
text-align:left;
font-family:helvetica;
background-image:-webkit-gradient(linear,0 0,0 100%,color-stop(0,#fff),color-stop(0.02,#eee),color-stop(0.98,#ccc),color-stop(1,#a3a3a3));
border:1px solid #505050;
-webkit-border-radius:8px;
-webkit-background-clip:padding-box;
color:#333;
text-shadow:0 1px 0 rgba(255,255,255,0.75);
line-height:130%;
-webkit-box-shadow:0 0 4px rgba(0,0,0,0.5);
}
#addToHomeScreen.addToHomeIOS7 {
background:#f2f2f2 !important;
-webkit-border-radius:1px !important;
border:1px solid #ccc;
-webkit-box-shadow:0 0 4px rgba(0,0,0,0.2);
}
#addToHomeScreen.addToHomeIpad {
width:268px;
font-size:18px;
padding:14px;
}
/**
*
* The 'wide' class is added when the popup contains the touch icon
*
*/
#addToHomeScreen.addToHomeWide {
width:296px;
}
#addToHomeScreen.addToHomeIpad.addToHomeWide {
width:320px;
font-size:18px;
padding:14px;
}
/**
*
* The balloon arrow
*
*/
#addToHomeScreen .addToHomeArrow {
position:absolute;
background-image:-webkit-gradient(linear,0 0,100% 100%,color-stop(0,rgba(204,204,204,0)),color-stop(0.4,rgba(204,204,204,0)),color-stop(0.4,#ccc));
border-width:0 1px 1px 0;
border-style:solid;
border-color:#505050;
width:16px; height:16px;
-webkit-transform:rotateZ(45deg);
bottom:-9px;
left:50%;
margin-left:-8px;
-webkit-box-shadow:inset -1px -1px 0 #a9a9a9;
-webkit-border-bottom-right-radius:2px;
}
#addToHomeScreen.addToHomeIOS7 .addToHomeArrow {
background-image:-webkit-gradient(linear,0 0,100% 100%,color-stop(0,rgba(204,204,204,0)),color-stop(0.4,rgba(204,204,204,0)),color-stop(0.4,#f2f2f2)) !important;
-webkit-box-shadow:inset -1px -1px 0 #fff !important;
border-color:#ccc !important;
}
/**
*
* The balloon arrow for iPad
*
*/
#addToHomeScreen.addToHomeIpad .addToHomeArrow {
-webkit-transform:rotateZ(-135deg);
background-image:-webkit-gradient(linear,0 0,100% 100%,color-stop(0,rgba(238,238,238,0)),color-stop(0.4,rgba(238,238,238,0)),color-stop(0.4,#eee));
-webkit-box-shadow:inset -1px -1px 0 #fff;
top:-9px; bottom:auto; left:50%;
}
/**
*
* Close button
*
*/
#addToHomeScreen .addToHomeClose {
-webkit-box-sizing:border-box;
position:absolute;
right:4px;
top:4px;
width:18px;
height:18px; line-height:14px;
text-align:center;
text-indent:1px;
-webkit-border-radius:9px;
background:rgba(0,0,0,0.12);
color:#888;
-webkit-box-shadow:0 1px 0 #fff;
font-size:16px;
}
#addToHomeScreen.addToHomeIOS7 .addToHomeClose {
line-height:12px;
padding-right:1px;
background:transparent;
border: 1px solid #888;
-webkit-box-shadow:none;
}
/**
*
* The '+' icon, displayed only on iOS < 4.2
*
*/
#addToHomeScreen .addToHomePlus {
font-weight:bold;
font-size:1.3em;
}
/**
*
* The 'share' icon, displayed only on iOS >= 4.2
*
*/
#addToHomeScreen .addToHomeShare {
display:inline-block;
width:18px;
height:15px;
background-repeat:no-repeat;
background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAeCAQAAADu6HTYAAADPElEQVR4Xq3TX2gcRRzA8e/M7mVv2+TSNpc/TZtrY6jUGqgaSAmEChKLrYK0YH0RFC2CSCkEfCghiKU04J8qNigq6os+iQV98MHWFwVBrQQRWs21lBw5cw3NNb1/udu72RGG5Y77IzXW77D7sAwf5scyYoL6BGXSDKFZwaGpLvIUaeoCkvX1MmsM0Ny6oRSQYOLuIS+YZOpfQdqslpUxcZrzTVAz4qPwW2O3CeIwC/RSzeY6Ow1QhUrkr+YOWfEKDkEP8Rij7CHKJmrFSDHBdwGEE5wiGChPN+PnT8VdRtEIl1d4gRj/1EVe5ZSBKGh8iqQpo/Fo5+3C/gz0MYg4zgwbqday1/Q4B8BGQ45d/Hi54lakCrU5obOcidJpu1+Lg9whjabyaOYLnrIBFFaRD+xe2ybMDWY66GmP/WA9cGfGp0CWhy0wkMN8inepFiH2rV1j0NQSNQbFLRQnS8/8YSDBBpadfv4CYDub2fmeHDNAsL1MBWUel0iA+Xik6eHcyvD3vAMSU1TGuA/YRS+dD7ovCQN43GKRFCU20Kd3V/avDVVyAZ5niTEuLA5/zBGWg9EEEhfJKN200Tat8CmRAQb9+wv7soPlHt2tQorsz1uPbr0HTY4sJwrH47zJZwABBAKLMBoQXepwgTwdHCo+fXMkQ4lrxEmQ5AaXipPqDY9V2vn09tgvTPI71EEGYxM+/uMJLJ4svpgaWGKOi/xKgmqLSUGSUd5f2vIVJ/CgBaTIUsZ7ZBsn0+NzfMOXLFCXQyTcybN6ep5ZZgUOHn7jpfUpsZshdugPGf+E5zjbyHTSRyQ8xfRPPM/s63RHeuknSoT22mjmmnAOIMkUZ6D1xSfPPAfd1WFKM3sO2CMaHx8M1NjnXKHaAGGkOW0C02WeYHUz4qMtx+w5gUDS8NckYe5lHsMYwCZEPyEEmjLDZFmAS7CDviMdxyTkMNVBKEmYLvbiQQBIBBbCQG04bGQvFWz6CfsCQLWCigILFwcfkGYBiOpbYuOizTAyYyDdCtrGaRG1LCkIgMYEFhI0WqQZoSlbGRyHKe4qOx7iv2bVQW9dp4dlM/x6kmwnWQcd/Q3FCqwTEiT5s+6D5v/pb0SSHyg7uhMWAAAAAElFTkSuQmCC);
background-size:18px 15px;
text-indent:-9999em;
overflow:hidden;
}
#addToHomeScreen.addToHomeIOS7 .addToHomeShare {
width:11px;
background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAA8CAYAAAAQTCjdAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAASCQAAEgkB80sG3AAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAKjSURBVGiB7dpPiFVVHMDxz7m9NCtMyI2bEJEC25WrEkzHUXCRraIwdNE8ZxfYIlcis1ZEbGEzT1QCF4XgH1CyWhUoJKIWNRGEiCNKmkSiYTzfcfGuOokx77x3ZlS8382959zfn+/invvn3RdijHIRBrwkOINCYXEcdjpb7VyiYdBsLScwt5y6IloYdzqXo36Ro0gY9IKWo+5JwmzBt2HQnBw9ehYNazyn5TBee8Dh+Vq+CWu92GufnkTDR6ab7gDeBNHouMM/l9tXTXM0fGBmL726Fg1Dam74EsvKqR8VNowL2Yzj5f7rnnE4DHq2235diYYhhTGfC94up35T0y+6di/ITU0rKVd+sEi0P7xr2pSJOu8zvF+OzqEv7vDH/WFxt7/cshy/ticsN8sXYUht0kXDOlsF9XJ4UaEvNoz9X3zc5bKaZThbyr5jzJ4wlNY7KTgM+ES0vhz+KeiPw36fKC/ucAF9uFBOrTZm26SJCtaV27+xIo7cXdkTEhvOoh+XyxprU1qnim7CQdGK2HAyKRexYVShT3RItDElN+mkjiP2Ym+S3f01hv2EVal5WW6hU0ElmptaqJuBpXg6MbeFH2LDpU6CQ93zWIKnEvs0cayGU3glMfkOo1jQYewZzOuyz7FC95Jwo5OgUFfgeg993hh/eTqCTxOSm/iuk8DY0Ap1b2GhtHXxsfZN4j/X0fOx4auEIknEhqv4OiUn1L13Z/+xWfWVaG4q0dxUormpRHNTieamEs1NJZqbJ1Q0jHvdiJo5S2cVjSNOCHZhn3/SnuYnIvl3yomIIz7MXZMn9hydRCrR3FSiualEc1OJ5qYSzU0lmptKNDePjWgwcPePT7/g+4cp8wCW4GXaryK3tL+mLdD5x62ppllgu7bso8q/2HIbzGWdNmWnSJwAAAAASUVORK5CYII=);
background-size:11px 15px;
}
/**
*
* The touch icon (if available)
*
*/
#addToHomeScreen .addToHomeTouchIcon {
display:block;
float:left;
-webkit-border-radius:6px;
border-radius:6px;
-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.5),
inset 0 0 2px rgba(255,255,255,0.9);
box-shadow:0 1px 3px rgba(0,0,0,0.5),
inset 0 0 2px rgba(255,255,255,0.9);
background-repeat:no-repeat;
width:57px; height:57px;
-webkit-background-size:57px 57px;
background-size:57px 57px;
margin:0 12px 0 0;
border:1px solid #333;
-webkit-background-clip:padding-box;
background-clip:padding-box;
}

View File

@ -1,82 +0,0 @@
.uiButtonsContainer {
position: absolute;
max-width: 1024px;
/*min-width: 800px;*/
width: 100%;
height: 100%;
/*max-height: 768px;*/
/*min-height: 300px;*/
top: 0; left: 0; right: 0; bottom: 0;
/*overflow: hidden;*/
margin: 0 auto;
outline: 2px solid #5e8c71;
box-shadow: 0 0 8px rgba(8, 8, 8, 0.25);
/* height: 768px;*/
}
#d3dlogo {
position: absolute;
top: 2.5%;
/*left: 31%;*/
width: 100%;
margin: 0 auto;
height: 139px;
background: url('../img/logo_full.png') no-repeat center center;
cursor: pointer;
}
.bgContainer {
position: absolute;
width: 100%;
height: 100%;
overflow: hidden;
}
.bgTop, .bgMiddle, .bgBottom {
opacity: 1.0;
transition: opacity .35s linear;
position: absolute;
left: 0;
z-index: -5;
}
.bgTop {
top: 0;
}
.bgMiddle {
top: 30%;
}
.bgBottom {
bottom: 0;
}
/* The code below is for resizing UI elements as the viewport becomes less high (suitable for tablets & smartphones) */
@media screen and (max-height: 655px) {
.bgMiddle { opacity: 0; }
}
@media screen and (max-height: 675px) {
#d3dlogo {
/*width: 399px;*/
height: 74px;
background-image: url('../img/logo_small.png');
top: 6%;
}
}
@media screen and (max-height: 560px) {
#d3dlogo {
/*width: 399px;*/
height: 57px;
background-image: url('../img/logo_smaller_wide.png');
top: 6%;
}
}
@media screen and (max-height: 420px) {
#d3dlogo {
top: 3%;
}
}

3
css/chosen.min.css vendored

File diff suppressed because one or more lines are too long

View File

@ -1,207 +0,0 @@
p, small {
line-height: 1.2em;
}
#container {
position:absolute;
width: 100%;
max-width: 1024px;
/*max-height: 768px;*/
top: 0;
bottom: 0;
left: 0;
right: 0;
overflow: hidden;
margin: 0 auto;
box-shadow: 0 0 0 2px #5e8c71, 0 0 8px 4px rgba(8, 8, 8, 0.25);
}
a {
color: #5491D2;
text-decoration: none;
}
#preloader {
position: absolute;
top: 50%;
left: 50%;
width: 50px;
height: 50px;
margin: -25px 0 0 -25px;
pointer-events: none;
}
#list {
padding: 0;
}
.box{
list-style-type: none;
float: left;
margin: 0 15px 15px 0;
/*padding: 25px;*/
padding: 0 0 25px 0;
display: block;
position: relative;
min-width: 200px; /*175px;*/
min-height: 175px; /*175px;*/
/*height: 275px;*/
border: 2px solid #333;
border-radius: 25px;
-moz-box-shadow: 0px 2px 7px 0px rgba(16, 16, 16, 0.60);
-webkit-box-shadow: 0px 2px 7px 0px rgba(16, 16, 16, 0.60);
box-shadow: 0px 2px 7px 0px rgba(16, 16, 16, 0.60);
transition:background-color 0.1s, color 0.1s;
}
.box:hover {
background-color: #5491D2;
}
.box:hover .link{
color: #fff;
}
.box.complex {
width: 375px; /*320px;*/
height: 350px;
/*border: 2px solid #00f;*/
}
box.connecting {
border: 2px solid #ff0;
}
.box .link{
display:block;
padding: 25px 25px 12px 25px;
text-align: center;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.box.complex .link {
position: relative;
top: auto;
right: auto;
bottom: auto;
left: auto;
}
.box small {
margin: 0.5em 0 0 0;
display: block;
}
#hint {
display:none;
position: absolute;
bottom: 1em;
}
#networkForm {
display: none;
}
.box .networkForm {
display: none;
}
.box.complex .networkForm {
display: block;
}
/* FORMS */
form label {
min-width: 110px;
display: block;
float: left;
margin: 1px 0 10px 0;
}
form label.inline {
display: inline;
float: none;
}
form input, form select {
margin-bottom: 5px;
}
form select {
margin-right: 5px;
}
form input[type="text"], form input[type="number"], form input[type="password"], form select {
width: 130px;
}
form input[type="text"], form input[type="number"], form input[type="password"] {
border: 1px solid rgb(144, 192, 255);
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
form .row {
clear: left;
}
form .row div {
/* float: left;*/
}
/* NETWORK PANEL */
.networkForm {
background-color: #fff;
/*border-radius: 0 0 25px 25px;*/
padding: 12px 25px 12px 25px;
}
.networkForm p {
margin: 0 0 10px 0;
}
.networkForm #network {
margin-right: 5px;
width: 180px;
}
.networkForm #ssid,
.networkForm #listNetworks,
.networkForm #passwordSettings {
display: none;
}
.networkForm.customNetwork #passwordSettings {
display: block;
}
.networkForm.customNetwork #ssid,
.networkForm.customNetwork #listNetworks{
display: inline-block;
}
.networkForm.customNetwork #network,
.networkForm.customNetwork #refreshNetworks {
display: none;
}
.networkForm #status {
position: relative;
top: 2px;
}
.networkForm #action {
/*clear: left;*/
display: block;
padding: 5px 4px 4px 4px;
}
.networkForm #action.error {
background: #EB313C;
color: #fff;
}
.networkForm #action.warning {
background: #E9A86E;
}
.networkForm #action.notice {
background: #93CAF4;
}
.networkForm #action.info {
background: #97DD8A;
}
.networkForm #action.none {
display: none;
}
.networkForm .chosen-container-single .chosen-default {
color: #333; /* let's not pretend it's disabled */
}

View File

@ -1,51 +0,0 @@
/* MOBILE */
@media only screen and (max-width: 480px),
only screen and (max-width: 720px) and (min-device-pixel-ratio : 1.5),
only screen and (max-width: 720px) and (-webkit-min-device-pixel-ratio : 1.5) {
body {
/*background-color: #f0f;*/
}
#d3dlogo {
/*width: 399px;*/
height: 57px;
background-image: url('../img/logo_smaller_wide.png');
top: 7px;
}
.popup {
/*background-color: rgba(255, 255, 255, 0.6);*/
background-color: rgba(245, 245, 245, 0.65);
position: absolute;
bottom: 0;
left: 0;
top: 75px;
width: 100%;
height: auto;
margin: 0;
/*-moz-box-shadow: 0 0 0 3px rgba(16, 16, 16, 1.0), 0 2px 6px 0 rgba(16, 16, 16, 0.65), 0 6px 6px -2px rgba(16, 16, 16, 0.2) inset;*/
/*-webkit-box-shadow: 0 0 0 3px rgba(16, 16, 16, 1.0), 0 2px 6px 0 rgba(16, 16, 16, 0.65), 0 6px 6px -2px rgba(16, 16, 16, 0.2) inset;*/
box-shadow: 0 0 0 2px rgba(16, 16, 16, 0.8), 0 2px 6px 0 rgba(16, 16, 16, 0.65), 0 6px 6px -2px rgba(16, 16, 16, 0.2) inset;
border: 0;
border-radius: 0;
/*-moz-border-radius: 15px;*/
/*-webkit-border-radius: 15px;*/
overflow-x: hidden;
overflow-y: scroll;
}
.bgContainer {
/*display: none;*/
}
#list {
padding: 0;
}
#list li {
list-style-type: none;
float: none;
}
}

534
css/normalize.css vendored
View File

@ -1,534 +0,0 @@
/*! normalize.css v1.0.2 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/*
* Corrects `block` display not defined in IE 6/7/8/9 and Firefox 3.
*/
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section,
summary {
display: block;
}
/*
* Corrects `inline-block` display not defined in IE 6/7/8/9 and Firefox 3.
*/
audio,
canvas,
video {
display: inline-block;
*display: inline;
*zoom: 1;
}
/*
* Prevents modern browsers from displaying `audio` without controls.
* Remove excess height in iOS 5 devices.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/*
* Addresses styling for `hidden` attribute not present in IE 7/8/9, Firefox 3,
* and Safari 4.
* Known issue: no IE 6 support.
*/
[hidden] {
display: none;
}
/* ==========================================================================
Base
========================================================================== */
/*
* 1. Corrects text resizing oddly in IE 6/7 when body `font-size` is set using
* `em` units.
* 2. Prevents iOS text size adjust after orientation change, without disabling
* user zoom.
*/
html {
font-size: 100%; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
-ms-text-size-adjust: 100%; /* 2 */
}
/*
* Addresses `font-family` inconsistency between `textarea` and other form
* elements.
*/
html,
button,
input,
select,
textarea {
font-family: sans-serif;
}
/*
* Addresses margins handled incorrectly in IE 6/7.
*/
body {
margin: 0;
}
/* ==========================================================================
Links
========================================================================== */
/*
* Addresses `outline` inconsistency between Chrome and other browsers.
*/
a:focus {
outline: thin dotted;
}
/*
* Improves readability when focused and also mouse hovered in all browsers.
*/
a:active,
a:hover {
outline: 0;
}
/* ==========================================================================
Typography
========================================================================== */
/*
* Addresses font sizes and margins set differently in IE 6/7.
* Addresses font sizes within `section` and `article` in Firefox 4+, Safari 5,
* and Chrome.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
h2 {
font-size: 1.5em;
margin: 0.83em 0;
}
h3 {
font-size: 1.17em;
margin: 1em 0;
}
h4 {
font-size: 1em;
margin: 1.33em 0;
}
h5 {
font-size: 0.83em;
margin: 1.67em 0;
}
h6 {
font-size: 0.67em;
margin: 2.33em 0;
}
/*
* Addresses styling not present in IE 7/8/9, Safari 5, and Chrome.
*/
abbr[title] {
border-bottom: 1px dotted;
}
/*
* Addresses style set to `bolder` in Firefox 3+, Safari 4/5, and Chrome.
*/
b,
strong {
font-weight: bold;
}
blockquote {
margin: 1em 40px;
}
/*
* Addresses styling not present in Safari 5 and Chrome.
*/
dfn {
font-style: italic;
}
/*
* Addresses styling not present in IE 6/7/8/9.
*/
mark {
background: #ff0;
color: #000;
}
/*
* Addresses margins set differently in IE 6/7.
*/
p,
pre {
margin: 1em 0;
}
/*
* Corrects font family set oddly in IE 6, Safari 4/5, and Chrome.
*/
code,
kbd,
pre,
samp {
font-family: monospace, serif;
_font-family: 'courier new', monospace;
font-size: 1em;
}
/*
* Improves readability of pre-formatted text in all browsers.
*/
pre {
white-space: pre;
white-space: pre-wrap;
word-wrap: break-word;
}
/*
* Addresses CSS quotes not supported in IE 6/7.
*/
q {
quotes: none;
}
/*
* Addresses `quotes` property not supported in Safari 4.
*/
q:before,
q:after {
content: '';
content: none;
}
/*
* Addresses inconsistent and variable font size in all browsers.
*/
small {
font-size: 80%;
}
/*
* Prevents `sub` and `sup` affecting `line-height` in all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
/* ==========================================================================
Lists
========================================================================== */
/*
* Addresses margins set differently in IE 6/7.
*/
dl,
menu,
ol,
ul {
margin: 1em 0;
}
dd {
margin: 0 0 0 40px;
}
/*
* Addresses paddings set differently in IE 6/7.
*/
menu,
ol,
ul {
padding: 0 0 0 40px;
}
/*
* Corrects list images handled incorrectly in IE 7.
*/
nav ul,
nav ol {
list-style: none;
list-style-image: none;
}
/* ==========================================================================
Embedded content
========================================================================== */
/*
* 1. Removes border when inside `a` element in IE 6/7/8/9 and Firefox 3.
* 2. Improves image quality when scaled in IE 7.
*/
img {
border: 0; /* 1 */
-ms-interpolation-mode: bicubic; /* 2 */
}
/*
* Corrects overflow displayed oddly in IE 9.
*/
svg:not(:root) {
overflow: hidden;
}
/* ==========================================================================
Figures
========================================================================== */
/*
* Addresses margin not present in IE 6/7/8/9, Safari 5, and Opera 11.
*/
figure {
margin: 0;
}
/* ==========================================================================
Forms
========================================================================== */
/*
* Corrects margin displayed oddly in IE 6/7.
*/
form {
margin: 0;
}
/*
* Define consistent border, margin, and padding.
*/
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
/*
* 1. Corrects color not being inherited in IE 6/7/8/9.
* 2. Corrects text not wrapping in Firefox 3.
* 3. Corrects alignment displayed oddly in IE 6/7.
*/
legend {
border: 0; /* 1 */
padding: 0;
white-space: normal; /* 2 */
*margin-left: -7px; /* 3 */
}
/*
* 1. Corrects font size not being inherited in all browsers.
* 2. Addresses margins set differently in IE 6/7, Firefox 3+, Safari 5,
* and Chrome.
* 3. Improves appearance and consistency in all browsers.
*/
button,
input,
select,
textarea {
font-size: 100%; /* 1 */
margin: 0; /* 2 */
vertical-align: baseline; /* 3 */
*vertical-align: middle; /* 3 */
}
/*
* Addresses Firefox 3+ setting `line-height` on `input` using `!important` in
* the UA stylesheet.
*/
button,
input {
line-height: normal;
}
/*
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
* and `video` controls.
* 2. Corrects inability to style clickable `input` types in iOS.
* 3. Improves usability and consistency of cursor style between image-type
* `input` and others.
* 4. Removes inner spacing in IE 7 without affecting normal text inputs.
* Known issue: inner spacing remains in IE 6.
*/
button,
html input[type="button"], /* 1 */
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button; /* 2 */
cursor: pointer; /* 3 */
*overflow: visible; /* 4 */
}
/*
* Re-set default cursor for disabled elements.
*/
button[disabled],
input[disabled] {
cursor: default;
}
/*
* 1. Addresses box sizing set to content-box in IE 8/9.
* 2. Removes excess padding in IE 8/9.
* 3. Removes excess padding in IE 7.
* Known issue: excess padding remains in IE 6.
*/
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
*height: 13px; /* 3 */
*width: 13px; /* 3 */
}
/*
* 1. Addresses `appearance` set to `searchfield` in Safari 5 and Chrome.
* 2. Addresses `box-sizing` set to `border-box` in Safari 5 and Chrome
* (include `-moz` to future-proof).
*/
input[type="search"] {
-webkit-appearance: textfield; /* 1 */
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box; /* 2 */
box-sizing: content-box;
}
/*
* Removes inner padding and search cancel button in Safari 5 and Chrome
* on OS X.
*/
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/*
* Removes inner padding and border in Firefox 3+.
*/
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
/*
* 1. Removes default vertical scrollbar in IE 6/7/8/9.
* 2. Improves readability and alignment in all browsers.
*/
textarea {
overflow: auto; /* 1 */
vertical-align: top; /* 2 */
}
/* ==========================================================================
Tables
========================================================================== */
/*
* Remove most spacing between table cells.
*/
table {
border-collapse: collapse;
border-spacing: 0;
}
/* http://nicolasgallagher.com/micro-clearfix-hack/ */
/**
* For modern browsers
* 1. The space content is one way to avoid an Opera bug when the
* contenteditable attribute is included anywhere else in the document.
* Otherwise it causes space to appear at the top and bottom of elements
* that are clearfixed.
* 2. The use of `table` rather than `block` is only necessary if using
* `:before` to contain the top-margins of child elements.
*/
/**
* For IE 6/7 only
* Include this rule to trigger hasLayout and contain floats.
*/
.cf {
*zoom: 1;
}
.cf:before,
.cf:after {
content: " "; /* 1 */
display: table; /* 2 */
}
.cf:after {
clear: both;
}

View File

@ -1,41 +0,0 @@
#contentOverlay {
background-color: rgba(255, 255, 255, 0.65);
z-index: 10;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
max-width: 1024px;
height: 100%;
/*max-height: 768px;*/
}
.popup {
background-color: #fff;
z-index: 15;
position: absolute;
bottom: 6%;
left: 50%;
width: 80%;
height: 70%;
margin: -35% 0 0 -40%;
/*-moz-box-shadow: 0px 2px 6px 0px rgba(16, 16, 16, 0.65);*/
/*-webkit-box-shadow: 0px 2px 6px 0px rgba(16, 16, 16, 0.65);*/
box-shadow: 0px 2px 6px 0px rgba(16, 16, 16, 0.65);
border: 2px solid #222;
border-radius: 15px;
/*-moz-border-radius: 15px;*/
/*-webkit-border-radius: 15px;*/
overflow-x: hidden;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
.popup .content {
margin: 0 1em;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 646 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 872 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 814 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

View File

@ -1,94 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Doodle3D Connect</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="mobile-web-app-capable" content="yes">
<meta id="Viewport" name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=yes,minimal-ui">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="./img/apple-touch-icon-144x144-precomposed.png">
<link rel="shortcut" sizes="144x144" href="./img/apple-touch-icon-144x144-precomposed.png">
<link rel="icon" type="image/ico" href="./img/favicon.ico">
<link href="css/normalize.css" rel="stylesheet" media="screen">
<link href="css/chosen.min.css" rel="stylesheet" media="screen">
<link href="css/add2home.css" rel="stylesheet" media="screen">
<link href="css/main.css" rel="stylesheet" media="screen">
<link href="css/bg.css" rel="stylesheet" media="screen">
<link href="css/popups.css" rel="stylesheet" media="screen">
<link href="css/mobile.css" rel="stylesheet" media="screen">
<script src="js/libs/jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="js/libs/spin.min.js" type="text/javascript"></script>
<script src="js/libs/add2home.js" type="text/javascript"></script>
<script src="js/libs/jquery.showpassword.js" type="text/javascript"></script>
<script src="js/libs/chosen.jquery.min.js" type="text/javascript"></script>
<script src="js/libs/jquery.stayInWebApp.js" type="text/javascript"></script>
<script src="js/api/NetworkAPI.js" type="text/javascript"></script>
<script src="js/api/ConnectAPI.js" type="text/javascript"></script>
<script src="js/NetworkPanel.js" type="text/javascript"></script>
<script src="js/Box.js" type="text/javascript"></script>
<script src="js/main.js" type="text/javascript"></script>
</head>
<body>
<div id="container">
<div class="bgContainer">
<img class="bgTop" src="img/bg_top.png" />
<img class="bgMiddle" src="img/bg_middle.png" />
<img class="bgBottom" src="img/bg_bottom.png" />
</div>
<div class="uiButtonsContainer">
<div id="d3dlogo" onclick="location.reload()"></div>
<div id="contentOverlay">
<div id="settings" class="popup">
<div class="content">
<p id="intro"></p>
<ul id="list" class="cf"></ul>
<small id="hint">
Can&#8217;t find your box? <br/>
Maybe your box isn&#8217;t connected to your network yet, try to connect to a Doodle3D-... WiFi network. <br/>
Otherwise, make sure you&#8217;re on the same WiFi network. <br/>
You can always connect your box to your computer using an ethernet cable.
</small>
<div id="preloader"></div>
</div>
</div>
</div>
</div>
</div>
<form id="networkForm">
<p>Connect this box to your WiFi network:</p>
<div class="row">
<label for="ssid">Network:</label><input type="text" name="ssid" id="ssid"><input type="button" name="list" value="List" class="button" id="listNetworks"/>
<select id="network" data-placeholder="Please select"></select>
</div>
<div id="passwordSettings" class="row">
<div>
<label for="phrase" id="phraseLabel">Password:</label>
</div>
<div>
<input type="password" name="" id="phrase" data-typetoggle='#showPassword' ><br/>
<input id="showPassword" type="checkbox" name="showPassword" value="showPassword">
<label for="showPassword" class="inline">show password</label>
</div>
</div>
<div class="row">
<input type="submit" value="Connect" class="button" id="btnConnect"/>
<span id="status"></span>
</div>
<div class="row">
<span id="action"></span>
</div>
<div class="row">
<small>Connecting the box to your WiFi network makes it easier to connect to and allows you to update. You can also continue using the box on it&#8217;s own WiFi network by going to <a href="http://draw.doodle3d.com">draw.doodle3d.com</a>. </small>
</div>
</form>
</body>
</html>

View File

@ -1,317 +0,0 @@
/*
* This file is part of the Doodle3D project (http://doodle3d.com).
*
* Copyright (c) 2013, Doodle3D
* This software is licensed under the terms of the GNU GPL v2 or later.
* See file LICENSE.txt or visit http://www.gnu.org/licenses/gpl.html for full license details.
*/
function NetworkPanel() {
this.id;
var NETWORK_SELECTOR_DEFAULT = ""; // used as first item in networks list
//var NETWORK_SELECTOR_CUSTOM = "join other network...";
// network mode
NetworkPanel.NETWORK_MODE = {
NEITHER: "neither",
CLIENT: "clientMode",
ACCESS_POINT: "accessPointMode"
};
var _networkMode = NetworkPanel.NETWORK_MODE.NEITHER;
var _api = new NetworkAPI();
var _networks = {};
var _currentNetwork; // the ssid of the network the box is on
var _selectedNetwork; // the ssid of the selected network in the client mode settings
var _currentNetworkStatus;
var _customNetwork = false;
var _retryDelay = 2000;
var _retryRetrieveStatusDelayTime = 1000;
var _retryRetrieveStatusDelay;
var _retrieveStatusDelayTime = 1000;
var _retrieveStatusDelay;
var _statusChangeHandler;
// ui elements
var _element;
var _networkSelector;
var _btnRefreshNetworks;
var _networkField;
var _btnListNetworks;
var _passwordSettings;
var _passwordField;
var _btnConnect;
var _statusTextField;
var _actionTextField;
var _self = this;
this.init = function(wifiboxURL,panelElement,statusChangeHandler) {
//console.log(_self.id,"NetworkPanel:init");
_api.init(wifiboxURL);
_element = panelElement;
_networkSelector = _element.find("#network");
_btnRefreshNetworks = _element.find("#refreshNetworks");
_networkField = _element.find("#ssid");
_btnListNetworks = _element.find("#listNetworks");
_passwordSettings = _element.find("#passwordSettings");
_passwordField = _element.find("#phrase");
_btnConnect = _element.find("#btnConnect");
_statusTextField = _element.find("#status");
_actionTextField = _element.find("#action");
_btnRefreshNetworks.on('touchstart mousedown',onRefreshClick);
_btnListNetworks.on('touchstart mousedown',showNetworkSelector);
//_btnConnect.on('touchstart mousedown',_self.connectToNetwork);
_element.submit(connectToNetwork);
_networkSelector.change(networkSelectorChanged);
_networkSelector.chosen({width: "180px"});
_networkSelector.on('chosen:hiding_dropdown', function() {
_self.refreshNetworks
});
//_networkSelector.trigger("chosen:updated");
_passwordField.showPassword();
_statusChangeHandler = statusChangeHandler;
_self.retrieveStatus(function(networkStatus) {
if(networkStatus != NetworkAPI.STATUS.CONNECTED) {
_self.refreshNetworks();
}
});
}
/*
* Handlers
*/
function onRefreshClick() {
_btnRefreshNetworks.attr("disabled", true);
_self.refreshNetworks(function() {
_btnRefreshNetworks.removeAttr("disabled");
})
}
function networkSelectorChanged(e) {
var selectedOption = $(this).find("option:selected");
_self.selectNetwork(selectedOption.val());
};
this.retrieveStatus = function(completeHandler) {
//console.log(_self.id,"NetworkPanel:retrieveStatus");
_api.status(function(data) {
if(typeof data.status === 'string') {
data.status = parseInt(data.status);
}
//console.log(_self.id,"NetworkPanel:retrievedStatus status: ",data.status,data.statusMessage);
//console.log(" networkPanel ",_element[0]," parent: ",_element.parent()[0]);
// ToDo: update _currentNetwork when available
setStatus(data.status,data);
// Keep checking for updates?
switch(data.status) {
case NetworkAPI.STATUS.CONNECTING:
case NetworkAPI.STATUS.CREATING:
clearTimeout(_retryRetrieveStatusDelay);
_retryRetrieveStatusDelay = setTimeout(_self.retrieveStatus,_retryRetrieveStatusDelayTime); // retry after delay
break;
}
_currentNetworkStatus = data.status;
if(completeHandler) completeHandler(data.status);
}, function() {
//console.log("NetworkPanel:retrieveStatus failed");
clearTimeout(_retryRetrieveStatusDelay);
_retryRetrieveStatusDelay = setTimeout(_self.retrieveStatus, _retryRetrieveStatusDelayTime); // retry after delay
});
};
function setStatus(status,data) {
if(status == _currentNetworkStatus) return;
_currentNetworkStatus = status;
var targetNetwork;
// update info
switch(status) {
case NetworkAPI.STATUS.CONNECTED:
//console.log(" data.ssid: ",data.ssid);
if(data.ssid == "") {
_currentNetwork = undefined;
//data.status = NetworkAPI.STATUS.NOT_CONNECTED;
setStatus(NetworkAPI.STATUS.NOT_CONNECTED);
} else {
_currentNetwork = data.ssid;
}
break;
case NetworkAPI.STATUS.CONNECTING:
if(_selectedNetwork != undefined) {
targetNetwork = _selectedNetwork;
} else if(_currentNetwork != undefined) {
targetNetwork = _currentNetwork;
}
case NetworkAPI.STATUS.CREATING:
case NetworkAPI.STATUS.CREATED:
_currentNetwork = undefined;
break;
}
// network selector
switch(status) {
case NetworkAPI.STATUS.NOT_CONNECTED:
case NetworkAPI.STATUS.CREATING:
case NetworkAPI.STATUS.CREATED:
_networkSelector.val(NETWORK_SELECTOR_DEFAULT);
break;
case NetworkAPI.STATUS.CONNECTED:
_self.selectNetwork(_currentNetwork);
break;
case NetworkAPI.STATUS.CONNECTING:
case NetworkAPI.STATUS.CONNECTING_FAILED:
// ToDo
break;
}
// connect button
switch(status) {
case NetworkAPI.STATUS.CONNECTING:
case NetworkAPI.STATUS.CREATING:
_btnConnect.attr("disabled", true);
break;
default:
_btnConnect.removeAttr("disabled");
break;
}
// update status text
var statusText = "";
switch(status) {
case NetworkAPI.STATUS.CONNECTING:
statusText = "Connecting... ";
break;
case NetworkAPI.STATUS.CONNECTING_FAILED:
//msg = data.statusMessage;
statusText = "Could not connect.";
break;
}
_statusTextField.html(statusText);
// update action text
var actionText = "";
switch(status) {
case NetworkAPI.STATUS.CONNECTING:
if(targetNetwork != undefined) {
actionText = "Connect your device to <b>"+targetNetwork+"</b>.";
_actionTextField.attr("class","info");
}
break;
case NetworkAPI.STATUS.CONNECTING_FAILED:
actionText = "Please check password and try again";
_actionTextField.attr("class","error");
break;
default:
_actionTextField.attr("class","none");
break;
}
_actionTextField.html(actionText);
if(_statusChangeHandler) _statusChangeHandler(status);
}
this.refreshNetworks = function(completeHandler) {
//console.log("NetworkPanel:refreshNetworks");
_api.scan(function(data) { // completed
//console.log("NetworkPanel:scanned");
// order networks alphabetically
/*data.networks.sort(function (a, b) {
if (a.ssid > b.ssid)
return 1;
if (a.ssid < b.ssid)
return -1;
// a must be equal to b
return 0;
});*/
fillNetworkSelector(data.networks)
_networks = {};
$.each(data.networks, function(index,network) {
_networks[network.ssid] = network;
});
if(completeHandler) completeHandler();
});
};
function fillNetworkSelector(networks) {
var foundCurrentNetwork = false;
_networkSelector.empty();
_networkSelector.append(
$("<option></option>").val(NETWORK_SELECTOR_DEFAULT).html(NETWORK_SELECTOR_DEFAULT)
);
$.each(networks, function(index,network) {
if(network.ssid == _currentNetwork) {
foundCurrentNetwork = true;
}
_networkSelector.append(
$("<option></option>").val(network.ssid).html(network.ssid)
);
});
/*_networkSelector.append(
$("<option></option>").val(NETWORK_SELECTOR_CUSTOM).html(NETWORK_SELECTOR_CUSTOM)
);*/
if(foundCurrentNetwork) {
_networkSelector.val(_currentNetwork);
//_self.selectNetwork(_currentNetwork);
}
_networkSelector.trigger("chosen:updated");
}
this.selectNetwork = function(ssid) {
//console.log("NetworkPanel:selectNetwork: ",ssid);
if(ssid == "") return;
_selectedNetwork = ssid;
var network = _networks[ssid];
//console.log(" network: ",network);
/*if(ssid == NETWORK_SELECTOR_CUSTOM) {
showCustomNetworkInput();
_passwordSettings.show();
} else*/ if(network === undefined || network.encryption == "none" || ssid == NETWORK_SELECTOR_DEFAULT) {
_passwordSettings.hide();
} else {
_passwordSettings.show();
}
_passwordField.val("");
};
function showNetworkSelector() {
_customNetwork = false;
_element.removeClass("customNetwork");
_networkSelector.val(NETWORK_SELECTOR_DEFAULT);
}
/*function showCustomNetworkInput() {
_customNetwork = true;
_element.addClass("customNetwork");
}*/
function connectToNetwork() {
//console.log("NetworkPanel:connectToNetwork");
if(_selectedNetwork == NETWORK_SELECTOR_DEFAULT) return;
setStatus(NetworkAPI.STATUS.CONNECTING); // override status
var ssid = (_customNetwork)? _networkField.val() : _selectedNetwork;
_api.associate(ssid,_passwordField.val(),true);
// after switching wifi network or creating a access point we delay the status retrieval
// because the webserver needs time to switch it's status
clearTimeout(_retrieveStatusDelay);
_retrieveStatusDelay = setTimeout(_self.retrieveStatus, _retrieveStatusDelayTime);
return false;
};
this.destroy = function() {
clearTimeout(_retryRetrieveStatusDelay);
clearTimeout(_retrieveStatusDelay);
}
}

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

1
js/libs/spin.min.js vendored
View File

@ -1 +0,0 @@
(function(t,e){if(typeof exports=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else t.Spinner=e()})(this,function(){"use strict";var t=["webkit","Moz","ms","O"],e={},i;function o(t,e){var i=document.createElement(t||"div"),o;for(o in e)i[o]=e[o];return i}function n(t){for(var e=1,i=arguments.length;e<i;e++)t.appendChild(arguments[e]);return t}var r=function(){var t=o("style",{type:"text/css"});n(document.getElementsByTagName("head")[0],t);return t.sheet||t.styleSheet}();function s(t,o,n,s){var a=["opacity",o,~~(t*100),n,s].join("-"),f=.01+n/s*100,l=Math.max(1-(1-t)/o*(100-f),t),u=i.substring(0,i.indexOf("Animation")).toLowerCase(),d=u&&"-"+u+"-"||"";if(!e[a]){r.insertRule("@"+d+"keyframes "+a+"{"+"0%{opacity:"+l+"}"+f+"%{opacity:"+t+"}"+(f+.01)+"%{opacity:1}"+(f+o)%100+"%{opacity:"+t+"}"+"100%{opacity:"+l+"}"+"}",r.cssRules.length);e[a]=1}return a}function a(e,i){var o=e.style,n,r;i=i.charAt(0).toUpperCase()+i.slice(1);for(r=0;r<t.length;r++){n=t[r]+i;if(o[n]!==undefined)return n}if(o[i]!==undefined)return i}function f(t,e){for(var i in e)t.style[a(t,i)||i]=e[i];return t}function l(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var o in i)if(t[o]===undefined)t[o]=i[o]}return t}function u(t){var e={x:t.offsetLeft,y:t.offsetTop};while(t=t.offsetParent)e.x+=t.offsetLeft,e.y+=t.offsetTop;return e}function d(t,e){return typeof t=="string"?t:t[e%t.length]}var p={lines:12,length:7,width:5,radius:10,rotate:0,corners:1,color:"#000",direction:1,speed:1,trail:100,opacity:1/4,fps:20,zIndex:2e9,className:"spinner",top:"auto",left:"auto",position:"relative"};function c(t){if(typeof this=="undefined")return new c(t);this.opts=l(t||{},c.defaults,p)}c.defaults={};l(c.prototype,{spin:function(t){this.stop();var e=this,n=e.opts,r=e.el=f(o(0,{className:n.className}),{position:n.position,width:0,zIndex:n.zIndex}),s=n.radius+n.length+n.width,a,l;if(t){t.insertBefore(r,t.firstChild||null);l=u(t);a=u(r);f(r,{left:(n.left=="auto"?l.x-a.x+(t.offsetWidth>>1):parseInt(n.left,10)+s)+"px",top:(n.top=="auto"?l.y-a.y+(t.offsetHeight>>1):parseInt(n.top,10)+s)+"px"})}r.setAttribute("role","progressbar");e.lines(r,e.opts);if(!i){var d=0,p=(n.lines-1)*(1-n.direction)/2,c,h=n.fps,m=h/n.speed,y=(1-n.opacity)/(m*n.trail/100),g=m/n.lines;(function v(){d++;for(var t=0;t<n.lines;t++){c=Math.max(1-(d+(n.lines-t)*g)%m*y,n.opacity);e.opacity(r,t*n.direction+p,c,n)}e.timeout=e.el&&setTimeout(v,~~(1e3/h))})()}return e},stop:function(){var t=this.el;if(t){clearTimeout(this.timeout);if(t.parentNode)t.parentNode.removeChild(t);this.el=undefined}return this},lines:function(t,e){var r=0,a=(e.lines-1)*(1-e.direction)/2,l;function u(t,i){return f(o(),{position:"absolute",width:e.length+e.width+"px",height:e.width+"px",background:t,boxShadow:i,transformOrigin:"left",transform:"rotate("+~~(360/e.lines*r+e.rotate)+"deg) translate("+e.radius+"px"+",0)",borderRadius:(e.corners*e.width>>1)+"px"})}for(;r<e.lines;r++){l=f(o(),{position:"absolute",top:1+~(e.width/2)+"px",transform:e.hwaccel?"translate3d(0,0,0)":"",opacity:e.opacity,animation:i&&s(e.opacity,e.trail,a+r*e.direction,e.lines)+" "+1/e.speed+"s linear infinite"});if(e.shadow)n(l,f(u("#000","0 0 4px "+"#000"),{top:2+"px"}));n(t,n(l,u(d(e.color,r),"0 0 1px rgba(0,0,0,.1)")))}return t},opacity:function(t,e,i){if(e<t.childNodes.length)t.childNodes[e].style.opacity=i}});function h(){function t(t,e){return o("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',e)}r.addRule(".spin-vml","behavior:url(#default#VML)");c.prototype.lines=function(e,i){var o=i.length+i.width,r=2*o;function s(){return f(t("group",{coordsize:r+" "+r,coordorigin:-o+" "+-o}),{width:r,height:r})}var a=-(i.width+i.length)*2+"px",l=f(s(),{position:"absolute",top:a,left:a}),u;function p(e,r,a){n(l,n(f(s(),{rotation:360/i.lines*e+"deg",left:~~r}),n(f(t("roundrect",{arcsize:i.corners}),{width:o,height:i.width,left:i.radius,top:-i.width>>1,filter:a}),t("fill",{color:d(i.color,e),opacity:i.opacity}),t("stroke",{opacity:0}))))}if(i.shadow)for(u=1;u<=i.lines;u++)p(u,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(u=1;u<=i.lines;u++)p(u);return n(e,l)};c.prototype.opacity=function(t,e,i,o){var n=t.firstChild;o=o.shadow&&o.lines||0;if(n&&e+o<n.childNodes.length){n=n.childNodes[e+o];n=n&&n.firstChild;n=n&&n.firstChild;if(n)n.opacity=i}}}var m=f(o("group"),{behavior:"url(#default#VML)"});if(!a(m,"transform")&&m.adj)h();else i=a(m,"animation");return c});