From c3d4fe39d0ecba1bb8bcd3c046c466b6e7f68423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Mon, 16 May 2016 02:24:44 +0200 Subject: [PATCH] working now Former-commit-id: 4ea0cf9e5dbdb0385e1e7eb2bfb89b1c4ba14719 --- html/js/all.js | 2 +- html/pages/home.tpl | 14 +++----- html_src/_start.php | 2 +- html_src/js-src/page_home.js | 16 ++++++++- html_src/js/all.js | 2 +- html_src/page_home.php | 14 +++----- user/datalink.h | 4 +-- user/page_home.c | 67 ++++++++++++++++++++++++++++++++++-- user/page_home.h | 2 ++ user/routes.c | 10 ++++-- user/sbmp_config.h | 2 +- user/user_main.c | 3 +- 12 files changed, 104 insertions(+), 34 deletions(-) diff --git a/html/js/all.js b/html/js/all.js index 2fff11b..1194e1c 100644 --- a/html/js/all.js +++ b/html/js/all.js @@ -1 +1 @@ -function bool(t){return 1===t||"1"===t||t===!0||"true"===t}function numfmt(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}function estimateLoadTime(t,e){return 1e3/t*e+1500}function msNow(){return+new Date}function msElapsed(t){return msNow()-t}function copyToClipboard(t){if(!document.execCommand)return!1;var e="_hiddenCopyText_";if(n=document.getElementById(e),!n){var n=document.createElement("textarea");n.style.position="absolute",n.style.left="-9999px",n.style.top="0",n.id=e,document.body.appendChild(n)}n.textContent=t;var r=document.activeElement;n.focus(),n.setSelectionRange(0,n.value.length);var o;try{o=document.execCommand("copy")}catch(u){o=!1}return r&&"function"==typeof r.focus&&r.focus(),n.textContent="",o}function errorMsg(t,e){$("#notif").addClass("error"),notify.show(t,e||3e3)}function infoMsg(t,e){$("#notif").removeClass("error"),notify.show(t,e||3e3)}!function(){"use strict";function t(){var t;for(h=!0,t=0;t=0;n-=1)t(e[n])}function r(t){return t.replace(/-\w/g,function(t){return t.charAt(1).toUpperCase()})}function o(t,e){return t.currentStyle?t.currentStyle[r(e)]:m.getComputedStyle?m.getComputedStyle(t,null).getPropertyValue(e):null}function u(t,e){return encodeURIComponent(t).replace(/%20/g,"+")+"="+encodeURIComponent(e).replace(/%20/g,"+")}function a(t,e,n){try{t.style[r(e)]=n}catch(o){}}function i(t){t.style.display="","none"===o(t,"display")&&(t.style.display="block")}function c(t){var e,r,o,a="";if(t.constructor===Object){for(e in t)if(t.hasOwnProperty(e))if(t[e].constructor===Array)for(r=0;r0&&(a+="&"+u(e.name,e.value));break;case"select-multiple":for(o=0;o0?a.substring(1):""}function f(t,e,r){var o,u,a,i=!1;return t&&(o=t.split(/\s+/),n(function(t){for(a=0;a0?b[0].className.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"").replace(/\s+/," "):void 0},e.setClass=function(t){return(t||""===t)&&n(function(e){e.className=t},b),e},e.addClass=function(t){return t&&n(function(e){e.className+=" "+t},b),e},e.removeClass=function(t){return f(t,"remove",b),e},e.toggleClass=function(t){return f(t,"toggle",b),e},e.hasClass=function(t){return f(t,"has",b)},e.html=function(t){return t||""===t?(n(function(e){e.innerHTML=t},b),e):b[0]?b[0].innerHTML:void 0},e.htmlBefore=function(t){return s(t,"before",b),e},e.htmlAfter=function(t){return s(t,"after",b),e},e.htmlAppend=function(t){return s(t,"append",b),e},e.htmlPrepend=function(t){return s(t,"prepend",b),e},e.attr=function(t,r){if(t){if(t=t.toLowerCase(),"undefined"!=typeof r)return n(function(e){"style"===t?e.style.cssText=r:"class"===t?e.className=r:e.setAttribute(t,r)},b),e;if(b[0])if("style"===t){if(b[0].style.cssText)return b[0].style.cssText}else if("class"===t){if(b[0].className)return b[0].className}else if(b[0].getAttribute(t))return b[0].getAttribute(t)}},e.data=function(t,n){return t?e.attr("data-"+t,n):void 0},e.val=function(t){var r,o,u;if(!_.isUndefined(t))return n(function(e){switch(e.nodeName){case"SELECT":for(("string"==typeof t||"number"==typeof t)&&(t=[t]),o=0;o1?r:r[0];case"INPUT":case"TEXTAREA":case"BUTTON":return b[0].value}},e.checked=function(t){return"boolean"==typeof t?(n(function(e){"INPUT"!==e.nodeName||"checkbox"!==e.type&&"radio"!==e.type||(e.checked=t)},b),e):!b[0]||"INPUT"!==b[0].nodeName||"checkbox"!==b[0].type&&"radio"!==b[0].type?void 0:!!b[0].checked},e.on=function(r,o){return(t===m||t===g)&&(b=[t]),n(function(t){g.addEventListener?t.addEventListener(r,o,!1):g.attachEvent&&(t[r+o]=function(){return o.apply(t,arguments)},t.attachEvent("on"+r,t[r+o]))},b),e},e.off=function(r,o){return(t===m||t===g)&&(b=[t]),n(function(t){g.addEventListener?t.removeEventListener(r,o,!1):g.attachEvent&&(t.detachEvent("on"+r,t[r+o]),t[r+o]=null)},b),e},e.ajax=function(t,e,n,r){var o,u,a=c(b),i=e?e.toUpperCase():"GET";_.isNumber(r)&&(r={timeout:r});var f=_.extend({},{nocache:!0,timeout:5e3,loader:!0},r);if(a&&"GET"===i&&(t+=-1===t.indexOf("?")?"?"+a:"&"+a,a=null),o=new XMLHttpRequest){if(f.nocache){var s=(+new Date).toString(36);t+=(-1===t.indexOf("?")?"?":"&")+"_="+s}f.loader&&$("#loader").addClass("show"),o.open(i,t,!0),o.timeout=f.timeout,u=setTimeout(function(){errorMsg("XHR timed out."),o.abort(),f.loader&&$("#loader").removeClass("show")},f.timeout+10),o.onreadystatechange=function(){4===o.readyState&&(f.loader&&$("#loader").removeClass("show"),n&&0!=o.status&&n(o.responseText,o.status),clearTimeout(u))},o.setRequestHeader("X-Requested-With","XMLHttpRequest"),"POST"===i&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.send(a)}return o},e.get=function(t,n,r){return e.ajax(t,"get",n,r)},e.post=function(t,n,r){return e.ajax(t,"post",n,r)},e}var p=[],d=[],h=!1,v=!1,g=document,m=window;g.addEventListener?(g.addEventListener("DOMContentLoaded",t,!1),m.addEventListener("load",e,!1)):g.attachEvent?(g.attachEvent("onreadystatechange",t),m.attachEvent("onload",e)):m.onload=e,m.$=l}(),function(){function t(t,e){return t.set(e[0],e[1]),t}function e(t,e){return t.add(e),t}function n(t,e,n){var r=n.length;switch(r){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function r(t,e){for(var n=-1,r=t.length;++n-1&&t%1==0&&e>t}function d(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}function h(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function v(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}function g(t){return $n[t]}function m(){}function y(){}function b(t,e){return _(t,e)&&delete t[e]}function w(t,e){if(ur){var n=t[e];return n===Ce?je:n}return Bn.call(t,e)?t[e]:je}function _(t,e){return ur?t[e]!==je:Bn.call(t,e)}function E(t,e,n){t[e]=ur&&n===je?Ce:n}function j(t){var e=-1,n=t?t.length:0;for(this.clear();++en)return!1;var r=t.length-1;return n==r?t.pop():Qn.call(t,n,1),!0}function R(t,e){var n=U(t,e);return 0>n?je:t[n][1]}function I(t,e){return U(t,e)>-1}function U(t,e){for(var n=t.length;n--;)if(Gt(t[n][0],e))return n;return-1}function F(t,e,n){var r=U(t,e);0>r?t.push([e,n]):t[r][1]=n}function B(t,e,n){var r=t[e];Bn.call(t,e)&&Gt(r,n)&&(n!==je||e in t)||(t[e]=n)}function q(t,e){return t&&mt(e,pe(e),t)}function H(t){return"function"==typeof t?t:we}function W(t){return mr(t)?t:Ht(t)}function D(t,e,n,o,u,a,i){var c;if(o&&(c=a?o(t,u,a,i):o(t)),c!==je)return c;if(!Zt(t))return t;var f=mr(t);if(f){if(c=St(t),!e)return gt(t,c)}else{var s=Nt(t),p=s==Fe||s==Be;if(yr(t))return ft(t,e);if(s==We||s==Me||p&&!a){if(l(t))return a?t:{};if(c=Lt(p?{}:t),!e)return c=q(c,t),n?bt(t,c):c}else{if(!An[s])return a?t:{};c=Mt(t,s,e)}}i||(i=new T);var d=i.get(t);return d?d:(i.set(t,c),(f?r:z)(t,function(r,u){B(c,u,D(r,e,n,o,u,t,i))}),n&&!f?bt(t,c):c)}function X(t){return Zt(t)?Yn(t):{}}function z(t,e){return t&&hr(t,e,pe)}function G(t,e){e=It(e,t)?[e+""]:W(e);for(var n=0,r=e.length;null!=t&&r>n;)t=t[e[n++]];return n&&n==r?t:je}function V(t,e){return Bn.call(t,e)||"object"==typeof t&&e in t&&null===Vn(t)}function J(t,e){return e in Object(t)}function Y(t,e,n,r,o){return t===e?!0:null==t||null==e||!Zt(t)&&!te(e)?t!==t&&e!==e:K(t,e,Y,n,r,o)}function K(t,e,n,r,o,u){var a=mr(t),i=mr(e),c=Pe,f=Pe;a||(c=Nt(t),c=c==Me?We:c),i||(f=Nt(e),f=f==Me?We:f);var s=c==We&&!l(t),p=f==We&&!l(e),d=c==f;if(d&&!s)return u||(u=new T),a||ue(t)?At(t,e,n,r,o,u):xt(t,e,c,n,r,o,u);if(!(o&Te)){var h=s&&Bn.call(t,"__wrapped__"),v=p&&Bn.call(e,"__wrapped__");if(h||v)return u||(u=new T),n(h?t.value():t,v?e.value():e,r,o,u)}return d?(u||(u=new T),$t(t,e,n,r,o,u)):!1}function Q(t,e,n,r){var o=n.length,u=o,a=!r;if(null==t)return!u;for(t=Object(t);o--;){var i=n[o];if(a&&i[2]?i[1]!==t[i[0]]:!(i[0]in t))return!1}for(;++oe&&(e=-e>o?0:o+e),n=n>o?o:n,0>n&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var u=Array(o);++r1?n[o-1]:je,a=o>2?n[2]:je;for(u="function"==typeof u?(o--,u):je,a&&Rt(n[0],n[1],a)&&(u=3>o?je:u,o=1),e=Object(e);++re?1:-1:ce(r)||0,it(e,n,r,t)}}function At(t,e,n,r,o,u){var i=-1,c=o&Te,f=o&Oe,s=t.length,l=e.length;if(s!=l&&!(c&&l>s))return!1;var p=u.get(t);if(p)return p==e;var d=!0;for(u.set(t,e);++i-1&&t%1==0&&ke>=t}function Zt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function te(t){return!!t&&"object"==typeof t}function ee(t){return null==t?!1:Kt(t)?Hn.test(Fn.call(t)):te(t)&&(l(t)?Hn:wn).test(t)}function ne(t){return"number"==typeof t||te(t)&&qn.call(t)==He}function re(t){return"string"==typeof t||!mr(t)&&te(t)&&qn.call(t)==ze}function oe(t){return"symbol"==typeof t||te(t)&&qn.call(t)==Ge}function ue(t){return te(t)&&Qt(t.length)&&!!jn[qn.call(t)]}function ae(t){return t===je}function ie(t){if(!t)return 0===t?t:0;if(t=ce(t),t===Ne||t===-Ne){var e=0>t?-1:1;return e*Se}var n=t%1;return t===t?n?t-n:t:0}function ce(t){if(Zt(t)){var e=Kt(t.valueOf)?t.valueOf():t;t=Zt(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(vn,"");var n=bn.test(t);return n||_n.test(t)?On(t.slice(2),n?2:8):yn.test(t)?Le:+t}function fe(t){if("string"==typeof t)return t;if(null==t)return"";if(oe(t))return pr?pr.call(t):"";var e=t+"";return"0"==e&&1/t==-Ne?"-0":e}function se(t,e,n){var r=null==t?je:G(t,e);return r===je?n:r}function le(t,e){return kt(t,e,J)}function pe(t){var e=Ft(t);if(!e&&!Jt(t))return tt(t);var n=Pt(t),r=!!n,o=n||[],u=o.length;for(var a in t)!V(t,a)||r&&("length"==a||p(a,u))||e&&"constructor"==a||o.push(a);return o}function de(t){for(var e=-1,n=Ft(t),r=et(t),o=r.length,u=Pt(t),a=!!u,i=u||[],c=i.length;++e"'`]/g,cn=RegExp(un.source),fn=RegExp(an.source),sn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ln=/^\w*$/,pn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,dn=/[\\^$.*+?()[\]{}|]/g,hn=RegExp(dn.source),vn=/^\s+|\s+$/g,gn=/\\(\\)?/g,mn=/\w*$/,yn=/^[-+]0x[0-9a-f]+$/i,bn=/^0b[01]+$/i,wn=/^\[object .+?Constructor\]$/,_n=/^0o[0-7]+$/i,En=/^(?:0|[1-9]\d*)$/,jn={};jn[Ye]=jn[Ke]=jn[Qe]=jn[Ze]=jn[tn]=jn[en]=jn[nn]=jn[rn]=jn[on]=!0,jn[Me]=jn[Pe]=jn[Je]=jn[Re]=jn[Ie]=jn[Ue]=jn[Fe]=jn[qe]=jn[He]=jn[We]=jn[De]=jn[Xe]=jn[ze]=jn[Ve]=!1;var An={};An[Me]=An[Pe]=An[Je]=An[Re]=An[Ie]=An[Ye]=An[Ke]=An[Qe]=An[Ze]=An[tn]=An[qe]=An[He]=An[We]=An[De]=An[Xe]=An[ze]=An[Ge]=An[en]=An[nn]=An[rn]=An[on]=!0,An[Ue]=An[Fe]=An[Ve]=!1;var xn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},$n={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Cn={"function":!0,object:!0},On=parseInt,Tn=Cn[typeof exports]&&exports&&!exports.nodeType?exports:je,Nn=Cn[typeof module]&&module&&!module.nodeType?module:je,kn=Nn&&Nn.exports===Tn?Tn:je,Sn=f(Tn&&Nn&&"object"==typeof global&&global),Ln=f(Cn[typeof self]&&self),Mn=f(Cn[typeof window]&&window),Pn=f(Cn[typeof this]&&this),Rn=Sn||Mn!==(Pn&&Pn.window)&&Mn||Ln||Pn||Function("return this")(),In=Array.prototype,Un=Object.prototype,Fn=Function.prototype.toString,Bn=Un.hasOwnProperty,qn=Un.toString,Hn=RegExp("^"+Fn.call(Bn).replace(dn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Wn=kn?Rn.Buffer:je,Dn=Rn.Reflect,Xn=Rn.Symbol,zn=Rn.Uint8Array,Gn=Dn?Dn.enumerate:je,Vn=Object.getPrototypeOf,Jn=Object.getOwnPropertySymbols,Yn=Object.create,Kn=Un.propertyIsEnumerable,Qn=In.splice,Zn=Math.ceil,tr=Object.keys,er=Math.max,nr=Tt(Rn,"Map"),rr=Tt(Rn,"Set"),or=Tt(Rn,"WeakMap"),ur=Tt(Object,"create"),ar=!Kn.call({valueOf:1},"valueOf"),ir=nr?Fn.call(nr):"",cr=rr?Fn.call(rr):"",fr=or?Fn.call(or):"",sr=Xn?Xn.prototype:je,lr=sr?sr.valueOf:je,pr=sr?sr.toString:je,dr=_t(z),hr=Et();Gn&&!Kn.call({valueOf:1},"valueOf")&&(et=function(t){return d(Gn(t))});var vr=ut("length"),gr=Jn||function(){return[]};(nr&&Nt(new nr)!=qe||rr&&Nt(new rr)!=Xe||or&&Nt(new or)!=Ve)&&(Nt=function(t){var e=qn.call(t),n=e==We?t.constructor:null,r="function"==typeof n?Fn.call(n):"";if(r)switch(r){case ir:return qe;case cr:return Xe;case fr:return Ve}return e});var mr=Array.isArray,yr=Wn?function(t){return t instanceof Wn}:be(!1),br=wt(function(t,e){if(ar||Ft(e)||Jt(e))return void mt(e,de(e),t);for(var n in e)B(t,n,e[n])}),wr=jt();y.prototype=ur?ur(null):Un,j.prototype.clear=A,j.prototype["delete"]=x,j.prototype.get=$,j.prototype.has=C,j.prototype.set=O,T.prototype.clear=N,T.prototype["delete"]=k,T.prototype.get=S,T.prototype.has=L,T.prototype.set=M,m.assignIn=br,m.constant=be,m.iteratee=_e,m.keys=pe,m.keysIn=de,m.map=Xt,m.property=Ee,m.range=wr,m.rest=zt,m.toPairs=he,m.extend=br,m.eq=Gt,m.escape=ve,m.escapeRegExp=ge,m.forEach=Dt,m.get=se,m.hasIn=le,m.identity=we,m.isArguments=Vt,m.isArray=mr,m.isArrayLike=Jt,m.isArrayLikeObject=Yt,m.isBuffer=yr,m.isFunction=Kt,m.isLength=Qt,m.isNative=ee,m.isNumber=ne,m.isObject=Zt,m.isObjectLike=te,m.isString=re,m.isSymbol=oe,m.isTypedArray=ue,m.isUndefined=ae,m.last=Wt,m.replace=me,m.toInteger=ie,m.toNumber=ce,m.toString=fe,m.unescape=ye,m.each=Dt,m.VERSION=Ae,(Mn||Ln||{})._=m,Rn._=m}.call(this),Math.log10=Math.log10||function(t){return Math.log(t)/Math.LN10},String.prototype.format=function(){var t=this,e=arguments;1==arguments.length&&(_.isArray(arguments[0])||_.isObject(arguments[0]))&&(e=arguments[0]);for(var n in e)if(e.hasOwnProperty(n)){var r=n;n.match(/^\{.*\}$/)||(n="{"+n+"}");var o=new RegExp(_.escapeRegExp(n),"g");t=t.replace(o,e[r])}return t};var modal=function(){var t={};return t.show=function(t){var e=$(t);e.removeClass("hidden visible"),setTimeout(function(){e.addClass("visible")},1)},t.hide=function(t){var e=$(t);e.removeClass("visible"),setTimeout(function(){e.addClass("hidden")},500)},t.init=function(){$(".Modal").on("click",function(){$(this).hasClass("no-close")||t.hide(this)}),$(".Dialog").on("click",function(t){t.stopImmediatePropagation()}),$(window).on("keydown",function(e){27==e.which&&t.hide(".Modal")})},t}(),notify=function(){var t,e,n={},r="#notif";return n.show=function(o,u){$(r).html(o),modal.show(r),clearTimeout(t),clearTimeout(e),_.isUndefined(u)||(t=setTimeout(n.hide,u))},n.hide=function(){var t=$(r);t.removeClass("visible"),e=setTimeout(function(){t.addClass("hidden")},250)},n.init=function(){$(r).on("click",function(){n.hide(this)})},n}();$().ready(function(){setInterval(function(){$(".anim-dots").each(function(t){var e=$(t),n=e.html()+".";5==n.length&&(n="."),e.html(n)})},1e3),$("input[type=number]").on("mousewheel",function(t){var e=+$(this).val(),n=+($(this).attr("step")||1),r=$(this).attr("min"),o=$(this).attr("max");if(t.wheelDelta>0?e+=n:e-=n,_.isUndefined(r)||(e=Math.max(e,r)),_.isUndefined(o)||(e=Math.min(e,o)),$(this).val(e),"createEvent"in document){var u=document.createEvent("HTMLEvents");u.initEvent("change",!1,!0),$(this)[0].dispatchEvent(u)}else $(this)[0].fireEvent("onchange");t.preventDefault()}),modal.init(),notify.init()});var page_wifi=function(){function t(t,e){if(200!=e)return void n(5e3);t=JSON.parse(t);var u=!bool(t.result.inProgress)&&t.result.APs.length>0;if(n(u?15e3:1e3),u){var a=$("#ap-list");$(".AP").remove(),a.toggle(u),$("#ap-loader").toggle(!u),t.result.APs.sort(function(t,e){return e.rssi-t.rssi}).forEach(function(t){if(t.enc=parseInt(t.enc),!(t.enc>4)){var e=document.createElement("div"),n=$(e).data("ssid",t.essid).data("pwd",0!=t.enc).addClass("AP");t.essid==r.current&&n.addClass("selected");var u=document.createElement("div");$(u).addClass("inner").htmlAppend('
{0}
'.format(t.rssi_perc)).htmlAppend('
{0}
'.format(_.escape(t.essid))).htmlAppend('
{0}
'.format(o[t.enc]));n.on("click",function(){var t=$(this);$("#conn-essid").val(t.data("ssid")),$("#conn-passwd").val(""),t.data("pwd")?modal.show("#psk-modal"):$("#conn-form").submit()}),e.appendChild(u),a[0].appendChild(e)}})}}function e(){$().get(_root+"/wifi/scan",t)}function n(t){setTimeout(e,t)}var r={},o=["Open","WEP","WPA","WPA2","WPA/WPA2"];return r.init=function(){e()},r}(),page_home=function(){var t={};return t.init=function(){},t}(); \ No newline at end of file +function bool(t){return 1===t||"1"===t||t===!0||"true"===t}function numfmt(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}function estimateLoadTime(t,e){return 1e3/t*e+1500}function msNow(){return+new Date}function msElapsed(t){return msNow()-t}function copyToClipboard(t){if(!document.execCommand)return!1;var e="_hiddenCopyText_";if(n=document.getElementById(e),!n){var n=document.createElement("textarea");n.style.position="absolute",n.style.left="-9999px",n.style.top="0",n.id=e,document.body.appendChild(n)}n.textContent=t;var r=document.activeElement;n.focus(),n.setSelectionRange(0,n.value.length);var o;try{o=document.execCommand("copy")}catch(u){o=!1}return r&&"function"==typeof r.focus&&r.focus(),n.textContent="",o}function errorMsg(t,e){$("#notif").addClass("error"),notify.show(t,e||3e3)}function infoMsg(t,e){$("#notif").removeClass("error"),notify.show(t,e||3e3)}!function(){"use strict";function t(){var t;for(h=!0,t=0;t=0;n-=1)t(e[n])}function r(t){return t.replace(/-\w/g,function(t){return t.charAt(1).toUpperCase()})}function o(t,e){return t.currentStyle?t.currentStyle[r(e)]:m.getComputedStyle?m.getComputedStyle(t,null).getPropertyValue(e):null}function u(t,e){return encodeURIComponent(t).replace(/%20/g,"+")+"="+encodeURIComponent(e).replace(/%20/g,"+")}function a(t,e,n){try{t.style[r(e)]=n}catch(o){}}function i(t){t.style.display="","none"===o(t,"display")&&(t.style.display="block")}function c(t){var e,r,o,a="";if(t.constructor===Object){for(e in t)if(t.hasOwnProperty(e))if(t[e].constructor===Array)for(r=0;r0&&(a+="&"+u(e.name,e.value));break;case"select-multiple":for(o=0;o0?a.substring(1):""}function f(t,e,r){var o,u,a,i=!1;return t&&(o=t.split(/\s+/),n(function(t){for(a=0;a0?b[0].className.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"").replace(/\s+/," "):void 0},e.setClass=function(t){return(t||""===t)&&n(function(e){e.className=t},b),e},e.addClass=function(t){return t&&n(function(e){e.className+=" "+t},b),e},e.removeClass=function(t){return f(t,"remove",b),e},e.toggleClass=function(t){return f(t,"toggle",b),e},e.hasClass=function(t){return f(t,"has",b)},e.html=function(t){return t||""===t?(n(function(e){e.innerHTML=t},b),e):b[0]?b[0].innerHTML:void 0},e.htmlBefore=function(t){return s(t,"before",b),e},e.htmlAfter=function(t){return s(t,"after",b),e},e.htmlAppend=function(t){return s(t,"append",b),e},e.htmlPrepend=function(t){return s(t,"prepend",b),e},e.attr=function(t,r){if(t){if(t=t.toLowerCase(),"undefined"!=typeof r)return n(function(e){"style"===t?e.style.cssText=r:"class"===t?e.className=r:e.setAttribute(t,r)},b),e;if(b[0])if("style"===t){if(b[0].style.cssText)return b[0].style.cssText}else if("class"===t){if(b[0].className)return b[0].className}else if(b[0].getAttribute(t))return b[0].getAttribute(t)}},e.data=function(t,n){return t?e.attr("data-"+t,n):void 0},e.val=function(t){var r,o,u;if(!_.isUndefined(t))return n(function(e){switch(e.nodeName){case"SELECT":for(("string"==typeof t||"number"==typeof t)&&(t=[t]),o=0;o1?r:r[0];case"INPUT":case"TEXTAREA":case"BUTTON":return b[0].value}},e.checked=function(t){return"boolean"==typeof t?(n(function(e){"INPUT"!==e.nodeName||"checkbox"!==e.type&&"radio"!==e.type||(e.checked=t)},b),e):!b[0]||"INPUT"!==b[0].nodeName||"checkbox"!==b[0].type&&"radio"!==b[0].type?void 0:!!b[0].checked},e.on=function(r,o){return(t===m||t===g)&&(b=[t]),n(function(t){g.addEventListener?t.addEventListener(r,o,!1):g.attachEvent&&(t[r+o]=function(){return o.apply(t,arguments)},t.attachEvent("on"+r,t[r+o]))},b),e},e.off=function(r,o){return(t===m||t===g)&&(b=[t]),n(function(t){g.addEventListener?t.removeEventListener(r,o,!1):g.attachEvent&&(t.detachEvent("on"+r,t[r+o]),t[r+o]=null)},b),e},e.ajax=function(t,e,n,r){var o,u,a=c(b),i=e?e.toUpperCase():"GET";_.isNumber(r)&&(r={timeout:r});var f=_.extend({},{nocache:!0,timeout:5e3,loader:!0},r);if(a&&"GET"===i&&(t+=-1===t.indexOf("?")?"?"+a:"&"+a,a=null),o=new XMLHttpRequest){if(f.nocache){var s=(+new Date).toString(36);t+=(-1===t.indexOf("?")?"?":"&")+"_="+s}f.loader&&$("#loader").addClass("show"),o.open(i,t,!0),o.timeout=f.timeout,u=setTimeout(function(){errorMsg("XHR timed out."),o.abort(),f.loader&&$("#loader").removeClass("show")},f.timeout+10),o.onreadystatechange=function(){4===o.readyState&&(f.loader&&$("#loader").removeClass("show"),n&&0!=o.status&&n(o.responseText,o.status),clearTimeout(u))},o.setRequestHeader("X-Requested-With","XMLHttpRequest"),"POST"===i&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.send(a)}return o},e.get=function(t,n,r){return e.ajax(t,"get",n,r)},e.post=function(t,n,r){return e.ajax(t,"post",n,r)},e}var p=[],d=[],h=!1,v=!1,g=document,m=window;g.addEventListener?(g.addEventListener("DOMContentLoaded",t,!1),m.addEventListener("load",e,!1)):g.attachEvent?(g.attachEvent("onreadystatechange",t),m.attachEvent("onload",e)):m.onload=e,m.$=l}(),function(){function t(t,e){return t.set(e[0],e[1]),t}function e(t,e){return t.add(e),t}function n(t,e,n){var r=n.length;switch(r){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function r(t,e){for(var n=-1,r=t.length;++n-1&&t%1==0&&e>t}function d(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}function h(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function v(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}function g(t){return xn[t]}function m(){}function y(){}function b(t,e){return _(t,e)&&delete t[e]}function w(t,e){if(ur){var n=t[e];return n===Ce?je:n}return Bn.call(t,e)?t[e]:je}function _(t,e){return ur?t[e]!==je:Bn.call(t,e)}function E(t,e,n){t[e]=ur&&n===je?Ce:n}function j(t){var e=-1,n=t?t.length:0;for(this.clear();++en)return!1;var r=t.length-1;return n==r?t.pop():Qn.call(t,n,1),!0}function R(t,e){var n=U(t,e);return 0>n?je:t[n][1]}function I(t,e){return U(t,e)>-1}function U(t,e){for(var n=t.length;n--;)if(Gt(t[n][0],e))return n;return-1}function F(t,e,n){var r=U(t,e);0>r?t.push([e,n]):t[r][1]=n}function B(t,e,n){var r=t[e];Bn.call(t,e)&&Gt(r,n)&&(n!==je||e in t)||(t[e]=n)}function q(t,e){return t&&mt(e,pe(e),t)}function H(t){return"function"==typeof t?t:we}function W(t){return mr(t)?t:Ht(t)}function D(t,e,n,o,u,a,i){var c;if(o&&(c=a?o(t,u,a,i):o(t)),c!==je)return c;if(!Zt(t))return t;var f=mr(t);if(f){if(c=St(t),!e)return gt(t,c)}else{var s=Nt(t),p=s==Fe||s==Be;if(yr(t))return ft(t,e);if(s==We||s==Me||p&&!a){if(l(t))return a?t:{};if(c=Lt(p?{}:t),!e)return c=q(c,t),n?bt(t,c):c}else{if(!An[s])return a?t:{};c=Mt(t,s,e)}}i||(i=new T);var d=i.get(t);return d?d:(i.set(t,c),(f?r:z)(t,function(r,u){B(c,u,D(r,e,n,o,u,t,i))}),n&&!f?bt(t,c):c)}function X(t){return Zt(t)?Yn(t):{}}function z(t,e){return t&&hr(t,e,pe)}function G(t,e){e=It(e,t)?[e+""]:W(e);for(var n=0,r=e.length;null!=t&&r>n;)t=t[e[n++]];return n&&n==r?t:je}function V(t,e){return Bn.call(t,e)||"object"==typeof t&&e in t&&null===Vn(t)}function J(t,e){return e in Object(t)}function Y(t,e,n,r,o){return t===e?!0:null==t||null==e||!Zt(t)&&!te(e)?t!==t&&e!==e:K(t,e,Y,n,r,o)}function K(t,e,n,r,o,u){var a=mr(t),i=mr(e),c=Pe,f=Pe;a||(c=Nt(t),c=c==Me?We:c),i||(f=Nt(e),f=f==Me?We:f);var s=c==We&&!l(t),p=f==We&&!l(e),d=c==f;if(d&&!s)return u||(u=new T),a||ue(t)?At(t,e,n,r,o,u):$t(t,e,c,n,r,o,u);if(!(o&Te)){var h=s&&Bn.call(t,"__wrapped__"),v=p&&Bn.call(e,"__wrapped__");if(h||v)return u||(u=new T),n(h?t.value():t,v?e.value():e,r,o,u)}return d?(u||(u=new T),xt(t,e,n,r,o,u)):!1}function Q(t,e,n,r){var o=n.length,u=o,a=!r;if(null==t)return!u;for(t=Object(t);o--;){var i=n[o];if(a&&i[2]?i[1]!==t[i[0]]:!(i[0]in t))return!1}for(;++oe&&(e=-e>o?0:o+e),n=n>o?o:n,0>n&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var u=Array(o);++r1?n[o-1]:je,a=o>2?n[2]:je;for(u="function"==typeof u?(o--,u):je,a&&Rt(n[0],n[1],a)&&(u=3>o?je:u,o=1),e=Object(e);++re?1:-1:ce(r)||0,it(e,n,r,t)}}function At(t,e,n,r,o,u){var i=-1,c=o&Te,f=o&Oe,s=t.length,l=e.length;if(s!=l&&!(c&&l>s))return!1;var p=u.get(t);if(p)return p==e;var d=!0;for(u.set(t,e);++i-1&&t%1==0&&ke>=t}function Zt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function te(t){return!!t&&"object"==typeof t}function ee(t){return null==t?!1:Kt(t)?Hn.test(Fn.call(t)):te(t)&&(l(t)?Hn:wn).test(t)}function ne(t){return"number"==typeof t||te(t)&&qn.call(t)==He}function re(t){return"string"==typeof t||!mr(t)&&te(t)&&qn.call(t)==ze}function oe(t){return"symbol"==typeof t||te(t)&&qn.call(t)==Ge}function ue(t){return te(t)&&Qt(t.length)&&!!jn[qn.call(t)]}function ae(t){return t===je}function ie(t){if(!t)return 0===t?t:0;if(t=ce(t),t===Ne||t===-Ne){var e=0>t?-1:1;return e*Se}var n=t%1;return t===t?n?t-n:t:0}function ce(t){if(Zt(t)){var e=Kt(t.valueOf)?t.valueOf():t;t=Zt(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(vn,"");var n=bn.test(t);return n||_n.test(t)?On(t.slice(2),n?2:8):yn.test(t)?Le:+t}function fe(t){if("string"==typeof t)return t;if(null==t)return"";if(oe(t))return pr?pr.call(t):"";var e=t+"";return"0"==e&&1/t==-Ne?"-0":e}function se(t,e,n){var r=null==t?je:G(t,e);return r===je?n:r}function le(t,e){return kt(t,e,J)}function pe(t){var e=Ft(t);if(!e&&!Jt(t))return tt(t);var n=Pt(t),r=!!n,o=n||[],u=o.length;for(var a in t)!V(t,a)||r&&("length"==a||p(a,u))||e&&"constructor"==a||o.push(a);return o}function de(t){for(var e=-1,n=Ft(t),r=et(t),o=r.length,u=Pt(t),a=!!u,i=u||[],c=i.length;++e"'`]/g,cn=RegExp(un.source),fn=RegExp(an.source),sn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ln=/^\w*$/,pn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,dn=/[\\^$.*+?()[\]{}|]/g,hn=RegExp(dn.source),vn=/^\s+|\s+$/g,gn=/\\(\\)?/g,mn=/\w*$/,yn=/^[-+]0x[0-9a-f]+$/i,bn=/^0b[01]+$/i,wn=/^\[object .+?Constructor\]$/,_n=/^0o[0-7]+$/i,En=/^(?:0|[1-9]\d*)$/,jn={};jn[Ye]=jn[Ke]=jn[Qe]=jn[Ze]=jn[tn]=jn[en]=jn[nn]=jn[rn]=jn[on]=!0,jn[Me]=jn[Pe]=jn[Je]=jn[Re]=jn[Ie]=jn[Ue]=jn[Fe]=jn[qe]=jn[He]=jn[We]=jn[De]=jn[Xe]=jn[ze]=jn[Ve]=!1;var An={};An[Me]=An[Pe]=An[Je]=An[Re]=An[Ie]=An[Ye]=An[Ke]=An[Qe]=An[Ze]=An[tn]=An[qe]=An[He]=An[We]=An[De]=An[Xe]=An[ze]=An[Ge]=An[en]=An[nn]=An[rn]=An[on]=!0,An[Ue]=An[Fe]=An[Ve]=!1;var $n={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},xn={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Cn={"function":!0,object:!0},On=parseInt,Tn=Cn[typeof exports]&&exports&&!exports.nodeType?exports:je,Nn=Cn[typeof module]&&module&&!module.nodeType?module:je,kn=Nn&&Nn.exports===Tn?Tn:je,Sn=f(Tn&&Nn&&"object"==typeof global&&global),Ln=f(Cn[typeof self]&&self),Mn=f(Cn[typeof window]&&window),Pn=f(Cn[typeof this]&&this),Rn=Sn||Mn!==(Pn&&Pn.window)&&Mn||Ln||Pn||Function("return this")(),In=Array.prototype,Un=Object.prototype,Fn=Function.prototype.toString,Bn=Un.hasOwnProperty,qn=Un.toString,Hn=RegExp("^"+Fn.call(Bn).replace(dn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Wn=kn?Rn.Buffer:je,Dn=Rn.Reflect,Xn=Rn.Symbol,zn=Rn.Uint8Array,Gn=Dn?Dn.enumerate:je,Vn=Object.getPrototypeOf,Jn=Object.getOwnPropertySymbols,Yn=Object.create,Kn=Un.propertyIsEnumerable,Qn=In.splice,Zn=Math.ceil,tr=Object.keys,er=Math.max,nr=Tt(Rn,"Map"),rr=Tt(Rn,"Set"),or=Tt(Rn,"WeakMap"),ur=Tt(Object,"create"),ar=!Kn.call({valueOf:1},"valueOf"),ir=nr?Fn.call(nr):"",cr=rr?Fn.call(rr):"",fr=or?Fn.call(or):"",sr=Xn?Xn.prototype:je,lr=sr?sr.valueOf:je,pr=sr?sr.toString:je,dr=_t(z),hr=Et();Gn&&!Kn.call({valueOf:1},"valueOf")&&(et=function(t){return d(Gn(t))});var vr=ut("length"),gr=Jn||function(){return[]};(nr&&Nt(new nr)!=qe||rr&&Nt(new rr)!=Xe||or&&Nt(new or)!=Ve)&&(Nt=function(t){var e=qn.call(t),n=e==We?t.constructor:null,r="function"==typeof n?Fn.call(n):"";if(r)switch(r){case ir:return qe;case cr:return Xe;case fr:return Ve}return e});var mr=Array.isArray,yr=Wn?function(t){return t instanceof Wn}:be(!1),br=wt(function(t,e){if(ar||Ft(e)||Jt(e))return void mt(e,de(e),t);for(var n in e)B(t,n,e[n])}),wr=jt();y.prototype=ur?ur(null):Un,j.prototype.clear=A,j.prototype["delete"]=$,j.prototype.get=x,j.prototype.has=C,j.prototype.set=O,T.prototype.clear=N,T.prototype["delete"]=k,T.prototype.get=S,T.prototype.has=L,T.prototype.set=M,m.assignIn=br,m.constant=be,m.iteratee=_e,m.keys=pe,m.keysIn=de,m.map=Xt,m.property=Ee,m.range=wr,m.rest=zt,m.toPairs=he,m.extend=br,m.eq=Gt,m.escape=ve,m.escapeRegExp=ge,m.forEach=Dt,m.get=se,m.hasIn=le,m.identity=we,m.isArguments=Vt,m.isArray=mr,m.isArrayLike=Jt,m.isArrayLikeObject=Yt,m.isBuffer=yr,m.isFunction=Kt,m.isLength=Qt,m.isNative=ee,m.isNumber=ne,m.isObject=Zt,m.isObjectLike=te,m.isString=re,m.isSymbol=oe,m.isTypedArray=ue,m.isUndefined=ae,m.last=Wt,m.replace=me,m.toInteger=ie,m.toNumber=ce,m.toString=fe,m.unescape=ye,m.each=Dt,m.VERSION=Ae,(Mn||Ln||{})._=m,Rn._=m}.call(this),Math.log10=Math.log10||function(t){return Math.log(t)/Math.LN10},String.prototype.format=function(){var t=this,e=arguments;1==arguments.length&&(_.isArray(arguments[0])||_.isObject(arguments[0]))&&(e=arguments[0]);for(var n in e)if(e.hasOwnProperty(n)){var r=n;n.match(/^\{.*\}$/)||(n="{"+n+"}");var o=new RegExp(_.escapeRegExp(n),"g");t=t.replace(o,e[r])}return t};var modal=function(){var t={};return t.show=function(t){var e=$(t);e.removeClass("hidden visible"),setTimeout(function(){e.addClass("visible")},1)},t.hide=function(t){var e=$(t);e.removeClass("visible"),setTimeout(function(){e.addClass("hidden")},500)},t.init=function(){$(".Modal").on("click",function(){$(this).hasClass("no-close")||t.hide(this)}),$(".Dialog").on("click",function(t){t.stopImmediatePropagation()}),$(window).on("keydown",function(e){27==e.which&&t.hide(".Modal")})},t}(),notify=function(){var t,e,n={},r="#notif";return n.show=function(o,u){$(r).html(o),modal.show(r),clearTimeout(t),clearTimeout(e),_.isUndefined(u)||(t=setTimeout(n.hide,u))},n.hide=function(){var t=$(r);t.removeClass("visible"),e=setTimeout(function(){t.addClass("hidden")},250)},n.init=function(){$(r).on("click",function(){n.hide(this)})},n}();$().ready(function(){setInterval(function(){$(".anim-dots").each(function(t){var e=$(t),n=e.html()+".";5==n.length&&(n="."),e.html(n)})},1e3),$("input[type=number]").on("mousewheel",function(t){var e=+$(this).val(),n=+($(this).attr("step")||1),r=$(this).attr("min"),o=$(this).attr("max");if(t.wheelDelta>0?e+=n:e-=n,_.isUndefined(r)||(e=Math.max(e,r)),_.isUndefined(o)||(e=Math.min(e,o)),$(this).val(e),"createEvent"in document){var u=document.createEvent("HTMLEvents");u.initEvent("change",!1,!0),$(this)[0].dispatchEvent(u)}else $(this)[0].fireEvent("onchange");t.preventDefault()}),modal.init(),notify.init()});var page_wifi=function(){function t(t,e){if(200!=e)return void n(5e3);t=JSON.parse(t);var u=!bool(t.result.inProgress)&&t.result.APs.length>0;if(n(u?15e3:1e3),u){var a=$("#ap-list");$(".AP").remove(),a.toggle(u),$("#ap-loader").toggle(!u),t.result.APs.sort(function(t,e){return e.rssi-t.rssi}).forEach(function(t){if(t.enc=parseInt(t.enc),!(t.enc>4)){var e=document.createElement("div"),n=$(e).data("ssid",t.essid).data("pwd",0!=t.enc).addClass("AP");t.essid==r.current&&n.addClass("selected");var u=document.createElement("div");$(u).addClass("inner").htmlAppend('
{0}
'.format(t.rssi_perc)).htmlAppend('
{0}
'.format(_.escape(t.essid))).htmlAppend('
{0}
'.format(o[t.enc]));n.on("click",function(){var t=$(this);$("#conn-essid").val(t.data("ssid")),$("#conn-passwd").val(""),t.data("pwd")?modal.show("#psk-modal"):$("#conn-form").submit()}),e.appendChild(u),a[0].appendChild(e)}})}}function e(){$().get(_root+"/wifi/scan",t)}function n(t){setTimeout(e,t)}var r={},o=["Open","WEP","WPA","WPA2","WPA/WPA2"];return r.init=function(){e()},r}(),page_home=function(){var t={};return t.init=function(){$("#btn-fwd").on("mousedown",function(){$().get(_root+"/m/start?dir=f")}).on("mouseup",function(){$().get(_root+"/m/stop")}),$("#btn-rev").on("mousedown",function(){$().get(_root+"/m/start?dir=r")}).on("mouseup",function(){$().get(_root+"/m/stop")})},t}(); \ No newline at end of file diff --git a/html/pages/home.tpl b/html/pages/home.tpl index 7ba4719..b817f2b 100644 --- a/html/pages/home.tpl +++ b/html/pages/home.tpl @@ -23,17 +23,11 @@
Loading… -

Home

+

Motor Control

-
-

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus cum eius molestias nesciunt nihil sequi? Laboriosam molestiae nesciunt - quis! Aut eius esse in laudantium obcaecati possimus quis repudiandae tenetur velit.

-
- -
-

Firmware

-

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus cum eius molestias nesciunt nihil sequi? Laboriosam molestiae nesciunt - quis! Aut eius esse in laudantium obcaecati possimus quis repudiandae tenetur velit.

+
+ REV + FWD