Example #1
0
var router = require('./router');

var events = new Events(window.data.eventList);

ready(function(){
  var navbar = new NavbarView({
    el: document.querySelector('nav')
  });

  navbar.render();

  var pagination = new PaginationView({
    el: document.querySelector('#pagination'),
    collection: events
  });

  pagination.render();

  var list = new ListView({
    el: document.querySelector('#event-list'),
    collection: events
  });

  list.render();

  router.history.start({
    pushState: true
  });
});
Example #2
0
    , values = {}

  arduino
    .pipe(split)
    .on('data', function(data) {
      data = data.split(/\t+/g)
      if (data.length < 1) return

      data.forEach(function(val) {
        val = val.split(':')
        if (val.length < 2) return
        val[1] = parseInt(val[1], 10)

        // Reduce noisy Arduino data in specific cases
        if (/d1|d0|p3/g.test(val[0])) {
          values[val[0]] = values[val[0]] === undefined ? val[1] : values[val[0]]
          values[val[0]] = val[1] + (values[val[0]] - val[1]) * 0.9
          val[1] = values[val[0]]
        }

        flora.emit('change', val[0], val[1])
        flora.emit('change:'+val[0], val[1])
      })

    })
};

if (!window.isStatic) {
  domready(ready)
}
Example #3
0
var domready = require('domready');

domready(function ready() {
    var jasmineEnv = jasmine.getEnv();
    jasmineEnv.updateInterval = 1000;
    var htmlReporter = new jasmine.HtmlReporter();
    jasmineEnv.addReporter(htmlReporter);
    jasmineEnv.specFilter = function(spec) {
         return htmlReporter.specFilter(spec);
    };
    jasmineEnv.execute();
});
Example #4
0
var React = require('react')
var render = require('react-dom').render
// var { Router, Route, browserHistory }  = require('react-router')
var App = require('./components/App.jsx')
var domready = require('domready')

domready(function () {
  render((
    <App />
  ), document.querySelector('#app'))
})
Example #5
0
    queue.shift()
    out.set(q)
    pool.freeFloat32(q)
  }
  
  return scriptNode
}

var context
if (typeof AudioContext !== "undefined") {
  context = new AudioContext();
} else if (typeof webkitAudioContext !== "undefined") {
  context = new webkitAudioContext();
} else {
  domready(function() {
    document.querySelector(".noWebAudio").style.display = "block"
  })
  throw new Error("No WebAudio!")
}

var ondatasource = function(url, buf) {}

var dataSources = {
  "oscillator": function() { return context.createOscillator() }
}

function createFileSource(buf) {
  var ret = context.createBufferSource()
  ret.buffer = buf
  return ret
}
Example #6
0
(function(b,c,d){typeof a!="undefined"&&a.exports?a.exports=d():typeof define=="function"&&define.amd?define(d):c[b]=d()})("bonzo",this,function(){function G(a){return a&&a.nodeName&&(a.nodeType==1||a.nodeType==11)}function H(a,b,c){var d,e,f;if(typeof a=="string")return ab.create(a);G(a)&&(a=[a]);if(c){f=[];for(d=0,e=a.length;d<e;d++)f[d]=X(b,a[d]);return f}return a}function I(a){return new RegExp("(^|\\s+)"+a+"(\\s+|$)")}function J(a,b,c,d){var e,f=0,g=a.length;for(;f<g;f++){e=d?a.length-f-1:f;b.call(c||a[e],a[e],e,a)}return a}function K(a,b,c){for(var d=0,e=a.length;d<e;d++)if(G(a[d])){K(a[d].childNodes,b,c);b.call(c||a[d],a[d],d,a)}return a}function L(a){return a.replace(/-(.)/g,function(a,b){return b.toUpperCase()})}function M(a){return a?a.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase():a}function N(a){a[x]("data-node-uid")||a[w]("data-node-uid",++s);var b=a[x]("data-node-uid");return r[b]||(r[b]={})}function O(a){var b=a[x]("data-node-uid");b&&delete r[b]}function P(a){var b;try{return a===null||a===undefined?undefined:a==="true"?!0:a==="false"?!1:a==="null"?null:(b=parseFloat(a))==a?b:a}catch(c){}return undefined}function Q(a,b,c){for(var d=0,e=a.length;d<e;++d)if(b.call(c||null,a[d],d,a))return!0;return!1}function R(a){a=="transform"&&(a=z.transform)||/^transform-?[Oo]rigin$/.test(a)&&(a=z.transform+"Origin")||a=="float"&&(a=z.cssFloat);return a?L(a):null}function T(a,b,c,d){var e=0,f=b||this,g=[],h=E&&typeof a=="string"&&a.charAt(0)!="<"?E(a):a;J(H(h),function(a,b){J(f,function(d){c(a,g[e++]=b>0?X(f,d):d)},null,d)},this,d);f.length=e;J(g,function(a){f[--e]=a},null,!d);return f}function U(a,b,c){var d=ab(a),e=d.css("position"),f=d.offset(),g="relative",h=e==g,i=[parseInt(d.css("left"),10),parseInt(d.css("top"),10)];if(e=="static"){d.css("position",g);e=g}isNaN(i[0])&&(i[0]=h?0:a.offsetLeft);isNaN(i[1])&&(i[1]=h?0:a.offsetTop);b!=null&&(a.style.left=b-f.left+i[0]+v);c!=null&&(a.style.top=c-f.top+i[1]+v)}function V(a,b){return typeof b=="function"?b(a):b}function W(a){this.length=0;if(a){a=typeof a!="string"&&!a.nodeType&&typeof a.length!="undefined"?a:[a];this.length=a.length;for(var b=0;b<a.length;b++)this[b]=a[b]}}function X(a,b){var c=b.cloneNode(!0),d,e;if(a.$&&typeof a.cloneEvents=="function"){a.$(c).cloneEvents(b);d=a.$(c).find("*");e=a.$(b).find("*");for(var f=0;f<e.length;f++)a.$(d[f]).cloneEvents(e[f])}return c}function Y(b,c,d){var e=this[0];if(!e)return this;if(b==null&&c==null)return(Z(e)?$():{x:e.scrollLeft,y:e.scrollTop})[d];if(Z(e))a.scrollTo(b,c);else{b!=null&&(e.scrollLeft=b);c!=null&&(e.scrollTop=c)}return this}function Z(b){return b===a||/^(?:body|html)$/i.test(b.tagName)}function $(){return{x:a.pageXOffset||c.scrollLeft,y:a.pageYOffset||c.scrollTop}}function _(a){var b=document.createElement("script"),c=a.match(g);b.src=c[1];return b}function ab(a){return new W(a)}var a=window,b=a.document,c=b.documentElement,d="parentNode",e=/^(checked|value|selected|disabled)$/i,f=/^(select|fieldset|table|tbody|tfoot|td|tr|colgroup)$/i,g=/\s*<script +src=['"]([^'"]+)['"]>/,h=["<table>","</table>",1],i=["<table><tbody><tr>","</tr></tbody></table>",3],j=["<select>","</select>",1],k=["_","",0,1],l={thead:h,tbody:h,tfoot:h,colgroup:h,caption:h,tr:["<table><tbody>","</tbody></table>",2],th:i,td:i,col:["<table><colgroup>","</colgroup></table>",2],fieldset:["<form>","</form>",1],legend:["<form><fieldset>","</fieldset></form>",2],option:j,optgroup:j,script:k,style:k,link:k,param:k,base:k},m=/^(checked|selected|disabled)$/,n=/msie/i.test(navigator.userAgent),o,p,q,r={},s=0,t=/^-?[\d\.]+$/,u=/^data-(.+)$/,v="px",w="setAttribute",x="getAttribute",y="getElementsByTagName",z=function(){var a=b.createElement("p");a.innerHTML='<a href="#x">x</a><table style="float:left;"></table>';return{hrefExtended:a[y]("a")[0][x]("href")!="#x",autoTbody:a[y]("tbody").length!==0,computedStyle:b.defaultView&&b.defaultView.getComputedStyle,cssFloat:a[y]("table")[0].style.styleFloat?"styleFloat":"cssFloat",transform:function(){var b=["transform","webkitTransform","MozTransform","OTransform","msTransform"],c;for(c=0;c<b.length;c++)if(b[c]in a.style)return b[c]}(),classList:"classList"in a,opasity:function(){return typeof b.createElement("a").style.opacity!="undefined"}()}}(),A=/(^\s*|\s*$)/g,B=/\s+/,C=String.prototype.toString,D={lineHeight:1,zoom:1,zIndex:1,opacity:1,boxFlex:1,WebkitBoxFlex:1,MozBoxFlex:1},E=b.querySelectorAll&&function(a){return b.querySelectorAll(a)},F=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(A,"")},S=z.computedStyle?function(a,c){var d=null,e=b.defaultView.getComputedStyle(a,"");e&&(d=e[c]);return a.style[c]||d}:n&&c.currentStyle?function(a,b){if(b=="opacity"&&!z.opasity){var c=100;try{c=a.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(d){try{c=a.filters("alpha").opacity}catch(e){}}return c/100}var f=a.currentStyle?a.currentStyle[b]:null;return a.style[b]||f}:function(a,b){return a.style[b]};if(z.classList){o=function(a,b){return a.classList.contains(b)};p=function(a,b){a.classList.add(b)};q=function(a,b){a.classList.remove(b)}}else{o=function(a,b){return I(b).test(a.className)};p=function(a,b){a.className=F(a.className+" "+b)};q=function(a,b){a.className=F(a.className.replace(I(b)," "))}}W.prototype={get:function(a){return this[a]||null},each:function(a,b){return J(this,a,b)},deepEach:function(a,b){return K(this,a,b)},map:function(a,b){var c=[],d,e;for(e=0;e<this.length;e++){d=a.call(this,this[e],e);b?b(d)&&c.push(d):c.push(d)}return c},html:function(a,b){var d=b?c.textContent===undefined?"innerText":"textContent":"innerHTML",e=this,g=function(b,c){J(H(a,e,c),function(a){b.appendChild(a)})},h=function(c,e){try{if(b||typeof a=="string"&&!f.test(c.tagName))return c[d]=a}catch(h){}g(c,e)};return typeof a!="undefined"?this.empty().each(h):this[0]?this[0][d]:""},text:function(a){return this.html(a,!0)},append:function(a){var b=this;return this.each(function(c,d){J(H(a,b,d),function(a){c.appendChild(a)})})},prepend:function(a){var b=this;return this.each(function(c,d){var e=c.firstChild;J(H(a,b,d),function(a){c.insertBefore(a,e)})})},appendTo:function(a,b){return T.call(this,a,b,function(a,b){a.appendChild(b)})},prependTo:function(a,b){return T.call(this,a,b,function(a,b){a.insertBefore(b,a.firstChild)},1)},before:function(a){var b=this;return this.each(function(c,e){J(H(a,b,e),function(a){c[d].insertBefore(a,c)})})},after:function(a){var b=this;return this.each(function(c,e){J(H(a,b,e),function(a){c[d].insertBefore(a,c.nextSibling)},null,1)})},insertBefore:function(a,b){return T.call(this,a,b,function(a,b){a[d].insertBefore(b,a)})},insertAfter:function(a,b){return T.call(this,a,b,function(a,b){var c=a.nextSibling;c?a[d].insertBefore(b,c):a[d].appendChild(b)},1)},replaceWith:function(a){ab(H(a)).insertAfter(this);return this.remove()},addClass:function(a){a=C.call(a).split(B);return this.each(function(b){J(a,function(a){a&&!o(b,V(b,a))&&p(b,V(b,a))})})},removeClass:function(a){a=C.call(a).split(B);return this.each(function(b){J(a,function(a){a&&o(b,V(b,a))&&q(b,V(b,a))})})},hasClass:function(a){a=C.call(a).split(B);return Q(this,function(b){return Q(a,function(a){return a&&o(b,a)})})},toggleClass:function(a,b){a=C.call(a).split(B);return this.each(function(c){J(a,function(a){a&&(typeof b!="undefined"?b?!o(c,a)&&p(c,a):q(c,a):o(c,a)?q(c,a):p(c,a))})})},show:function(a){a=typeof a=="string"?a:"";return this.each(function(b){b.style.display=a})},hide:function(){return this.each(function(a){a.style.display="none"})},toggle:function(a,b){b=typeof b=="string"?b:"";typeof a!="function"&&(a=null);return this.each(function(c){c.style.display=c.offsetWidth||c.offsetHeight?"none":b;a&&a.call(c)})},first:function(){return ab(this.length?this[0]:[])},last:function(){return ab(this.length?this[this.length-1]:[])},next:function(){return this.related("nextSibling")},previous:function(){return this.related("previousSibling")},parent:function(){return this.related(d)},related:function(a){return this.map(function(b){b=b[a];while(b&&b.nodeType!==1)b=b[a];return b||0},function(a){return a})},focus:function(){this.length&&this[0].focus();return this},blur:function(){this.length&&this[0].blur();return this},css:function(c,d){function g(a,b,c){for(var d in f)if(f.hasOwnProperty(d)){c=f[d];(b=R(d))&&t.test(c)&&!(b in D)&&(c+=v);try{a.style[b]=V(a,c)}catch(e){}}}var e,f=c;if(d===undefined&&typeof c=="string"){d=this[0];if(!d)return null;if(d===b||d===a){e=d===b?ab.doc():ab.viewport();return c=="width"?e.width:c=="height"?e.height:""}return(c=R(c))?S(d,c):null}if(typeof c=="string"){f={};f[c]=d}if(n&&f.opacity){f.filter="alpha(opacity="+f.opacity*100+")";f.zoom=c.zoom||1;delete f.opacity}return this.each(g)},offset:function(a,c){if(!a||typeof a!="object"||typeof a.top!="number"&&typeof a.left!="number"){if(typeof a=="number"||typeof c=="number")return this.each(function(b){U(b,a,c)});if(!this[0])return{top:0,left:0,height:0,width:0};var d=this[0],e=d.ownerDocument.documentElement,f=d.getBoundingClientRect(),g=$(),h=d.offsetWidth,i=d.offsetHeight,j=f.top+g.y-Math.max(0,e&&e.clientTop,b.body.clientTop),k=f.left+g.x-Math.max(0,e&&e.clientLeft,b.body.clientLeft);return{top:j,left:k,height:i,width:h}}return this.each(function(b){U(b,a.left,a.top)})},dim:function(){if(!this.length)return{height:0,width:0};var a=this[0],b=a.nodeType==9&&a.documentElement,c=!b&&!!a.style&&!a.offsetWidth&&!a.offsetHeight?function(b){var c={position:a.style.position||"",visibility:a.style.visibility||"",display:a.style.display||""};b.first().css({position:"absolute",visibility:"hidden",display:"block"});return c}(this):null,d=b?Math.max(a.body.scrollWidth,a.body.offsetWidth,b.scrollWidth,b.offsetWidth,b.clientWidth):a.offsetWidth,e=b?Math.max(a.body.scrollHeight,a.body.offsetHeight,b.scrollHeight,b.offsetHeight,b.clientHeight):a.offsetHeight;c&&this.first().css(c);return{height:e,width:d}},attr:function(a,b){var c=this[0];if(typeof a=="string"||a instanceof String)return typeof b=="undefined"?c?e.test(a)?m.test(a)&&typeof c[a]=="string"?!0:c[a]:a!="href"&&a!="src"||!z.hrefExtended?c[x](a):c[x](a,2):null:this.each(function(c){e.test(a)?c[a]=V(c,b):c[w](a,V(c,b))});for(var d in a)a.hasOwnProperty(d)&&this.attr(d,a[d]);return this},removeAttr:function(a){return this.each(function(b){m.test(a)?b[a]=!1:b.removeAttribute(a)})},val:function(a){return typeof a=="string"?this.attr("value",a):this.length?this[0].value:null},data:function(a,b){var c=this[0],d,e;if(typeof b=="undefined"){if(!c)return null;d=N(c);if(typeof a=="undefined"){J(c.attributes,function(a){(e=(""+a.name).match(u))&&(d[L(e[1])]=P(a.value))});return d}typeof d[a]=="undefined"&&(d[a]=P(this.attr("data-"+M(a))));return d[a]}return this.each(function(c){N(c)[a]=b})},remove:function(){this.deepEach(O);return this.detach()},empty:function(){return this.each(function(a){K(a.childNodes,O);while(a.firstChild)a.removeChild(a.firstChild)})},detach:function(){return this.each(function(a){a[d]&&a[d].removeChild(a)})},scrollTop:function(a){return Y.call(this,null,a,"y")},scrollLeft:function(a){return Y.call(this,a,null,"x")}};ab.setQueryEngine=function(a){E=a;delete ab.setQueryEngine};ab.aug=function(a,b){for(var c in a)a.hasOwnProperty(c)&&((b||W.prototype)[c]=a[c])};ab.create=function(a){return typeof a=="string"&&a!==""?function(){if(g.test(a))return[_(a)];var c=a.match(/^\s*<([^\s>]+)/),e=b.createElement("div"),f=[],h=c?l[c[1].toLowerCase()]:null,i=h?h[2]+1:1,j=h&&h[3],k=d,m=z.autoTbody&&h&&h[0]=="<table>"&&!/<tbody/i.test(a);e.innerHTML=h?h[0]+a+h[1]:a;while(i--)e=e.firstChild;j&&e&&e.nodeType!==1&&(e=e.nextSibling);do(!c||e.nodeType==1)&&(!m||e.tagName&&e.tagName!="TBODY")&&f.push(e);while(e=e.nextSibling);J(f,function(a){a[k]&&a[k].removeChild(a)});return f}():G(a)?[a.cloneNode(!0)]:[]};ab.doc=function(){var a=ab.viewport();return{width:Math.max(b.body.scrollWidth,c.scrollWidth,a.width),height:Math.max(b.body.scrollHeight,c.scrollHeight,a.height)}};ab.firstChild=function(a){for(var b=a.childNodes,c=0,d=b&&b.length||0,e;c<d;c++)b[c].nodeType===1&&(e=b[d=c]);return e};ab.viewport=function(){return{width:n?c.clientWidth:self.innerWidth,height:n?c.clientHeight:self.innerHeight}};ab.isAncestor="compareDocumentPosition"in c?function(a,b){return(a.compareDocumentPosition(b)&16)==16}:"contains"in c?function(a,b){return a!==b&&a.contains(b)}:function(a,b){while(b=b[d])if(b===a)return!0;return!1};return ab});provide("bonzo",a.exports);(function(a){function c(a,b){for(var c=0;c<a.length;c++)if(a[c]===b)return c;return-1}function d(a){var b=[],c=0,d=0,e,f,g;for(;f=a[c];++c){g=!1;for(e=0;e<b.length;++e)if(b[e]===f){g=!0;break}g||(b[d++]=f)}return b}function e(a,c){return typeof c=="undefined"?b(this).dim()[a]:this.css(a,c)}var b=require("bonzo");b.setQueryEngine(a);a.ender(b);a.ender(b(),!0);a.ender({create:function(c){return a(b.create(c))}});a.id=function(b){return a([document.getElementById(b)])};a.ender({parents:function(b,e){if(!this.length)return this;b||(b="*");var f=a(b),g,h,i,j=[];for(g=0,h=this.length;g<h;g++){i=this[g];while(i=i.parentNode)if(~c(f,i)){j.push(i);if(e)break}}return a(d(j))},parent:function(){return a(d(b(this).parent()))},closest:function(a){return this.parents(a,!0)},first:function(){return a(this.length?this[0]:this)},last:function(){return a(this.length?this[this.length-1]:[])},next:function(){return a(b(this).next())},previous:function(){return a(b(this).previous())},appendTo:function(a){return b(this.selector).appendTo(a,this)},prependTo:function(a){return b(this.selector).prependTo(a,this)},insertAfter:function(a){return b(this.selector).insertAfter(a,this)},insertBefore:function(a){return b(this.selector).insertBefore(a,this)},siblings:function(){var b,c,d,e=[];for(b=0,c=this.length;b<c;b++){d=this[b];while(d=d.previousSibling)d.nodeType==1&&e.push(d);d=this[b];while(d=d.nextSibling)d.nodeType==1&&e.push(d)}return a(e)},children:function(){var c,e,f,g=[];for(c=0,e=this.length;c<e;c++){if(!(f=b.firstChild(this[c])))continue;g.push(f);while(f=f.nextSibling)f.nodeType==1&&g.push(f)}return a(d(g))},height:function(a){return e.call(this,"height",a)},width:function(a){return e.call(this,"width",a)}},!0)})(ender)})()
var newElement = require('new-element')
var fs = require('fs')
var domready = require('domready')
var template = fs.readFileSync('./button.html').toString()
var newTemplate = fs.readFileSync('./new-button.html').toString()

var tries = 0
domready(inject)


function inject () {
  var buttons = document.querySelector('.html5-player-chrome')
  var button = newElement(template)
  
  if (!buttons) {
    buttons = document.querySelector('.ytp-chrome-controls')
    button = newElement(newTemplate)
  }
  
  if (!buttons) {
    if (++tries > 5) return
    setTimeout(inject, 1000)
  }
  
  button.href = getHref()
  buttons.insertBefore(button, buttons.firstChild)

  button.addEventListener('click', function () {
    var pause = buttons.querySelector('.ytp-button-pause')
    if (!pause) pause = buttons.querySelector('.ytp-play-button')
    if (pause) pause.click()
Example #8
0
var React  = require('react');
var ReactDOM  = require('react-dom');
var $ = require('jquery');

let Models = require('../ex/ex2');
let models = new Models();
console.log(models) ;

let ReactView = require('../ex/ex1');

var domready = require('domready')
domready(function(){
    ReactDOM.render(
        <ReactView />,
        document.getElementById('masterView')
    )
});
Example #9
0
ready(function(){


  var buff = b2a.decode(file);

  fileBuff(context, buff, function(e, source){
    gotSource(e,source)
  })


  function gotSource (err, source){
    var sr = context.sampleRate
    var bpm = 115
    var scb = 60 / bpm
    var spb = Math.floor(sr * scb)
    var l = source.buffer.getChannelData(0).length
    var f = .67
    var m = .07
    var dist = 16 
    var odist = 32
    var d = jdelay(spb * 4, f, m)
    var od = jdelay(spb * 4, f, m)
    var mod = 0
    var a = 1
    var warble = jdelay(spb * 1/3, 1, 1)
    var synth = jsynth(context, function(t, s, i){
      if(s > l * 2 && s % l > l / 2) a = amod(3/4, 3/8, t, 1 / scb / amod(9, 6, t, 1 / scb / 24)) 

      else a = 1
      if(s < l * 1.5){
        //(d(i, s % l < scb * 12 * sr ? Math.floor(spb * 1/3 - mod): spb * dist, 1 - f, 1 - m))  
        f += .0000000005
        m += .00000000005
        d(i* a, Math.floor(spb * Math.floor(dist)), 1 -f, 1-m)
        return  i*a//warble(i, spb * 1 / 3, f, m)
      }
      else{
        if(s % l  === 0){ 
          //dist+=2
          od = d
          odist = 32 
          dist = 16 
          f = .37
          m = .07
          mod = 0
          d = jdelay(spb * dist, f, m)
        }
        else if(s % l ===  Math.floor(l / 2)){
          od = d
          f = 0.37
          m = 0.07
          odist = 32//dist 
          dist = 32
          mod = scb * sr * 1/2
          d = jdelay(spb * dist, f, m)
        }
        f += .0000000005
        m += .00000000005
        
        d(i* a, Math.floor(spb * Math.floor(dist)), 1 -f, 1-m)
        return a*((i/2) + od(i, s % l < scb * 12 * sr ? Math.floor(spb * 1/3): Math.floor(spb * odist), 1 - f, 1 - m))  
      }
    })
    source.loop = true
    //source.playbackRate.value = 5/9;
    source.connect(synth)
    synth.connect(context.destination)
    source.start(context.currentTime)
  };

  function trash(_track, div, ac, offset){
    var track = new Float32Array(Math.floor(_track.length / div))
    for(var x = 0; x < track.length; x++){
      var y = 0
      for(var z = 0; z < div; z++){
        y += _track[x * z]
      }
      track[x] = y / div
    }
    if(ac){
      var tt = new Float32Array(Math.floor(_track.length / ac))
      offset = tt.length * offset 
      tt.set(track, offset || 0)
      return tt
    }else return track 
  }

  function mergeTracks(tracks, a){
    a = a || 1
    var track = new Float32Array(tracks[0].length)
    for(var x = 0; x < track.length; x++){
      var y = 0
        for(var z = 0; z < tracks.length; z++){
          y += tracks[z][x] 
        }
      track[x] = y / tracks.length * a
    }
    return track
  }

})
Example #10
0
!function(a){function d(a){var c=b[a]||window[a];if(!c)throw new Error("Requested module '"+a+"' has not been defined.");return c}function e(a,c){return b[a]=c}function f(a,b){for(var c in b)c!="noConflict"&&c!="_VERSION"&&(a[c]=b[c]);return a}function g(a,b,c){return typeof a=="string"||a.nodeName||a.length&&"item"in a||a==window?(c=h._select(a,b),c.selector=a):c=isFinite(a.length)?a:[a],f(c,g)}function h(a,b){return g(a,b)}a.global=a;var b={},c=a.$;a.provide=e,a.require=d,f(h,{_VERSION:"0.3.6",fn:g,ender:function(a,b){f(b?g:h,a)},_select:function(a,b){return(b||document).querySelectorAll(a)}}),f(g,{forEach:function(a,b,c){for(c=0,l=this.length;c<l;++c)c in this&&a.call(b||this[c],this[c],c,this);return this},$:h}),h.noConflict=function(){return a.$=c,this},typeof module!="undefined"&&module.exports&&(module.exports=h),a.ender=a.$=a.ender||h}(this),!function(){var a={exports:{}},b=a.exports;!function(b,c){typeof define=="function"?define(c):typeof a!="undefined"?a.exports=c():this[b]=this.domReady=c()}("domready",function(a){function l(a){k=1;while(a=b.shift())a()}var b=[],c,d=!1,e=document,f=e.documentElement,g=f.doScroll,h="DOMContentLoaded",i="addEventListener",j="onreadystatechange",k=/^loade|c/.test(e.readyState);return e[i]&&e[i](h,c=function(){e.removeEventListener(h,c,d),l()},d),g&&e.attachEvent(j,c=function(){/^c/.test(e.readyState)&&(e.detachEvent(j,c),l())}),a=g?function(c){self!=top?k?c():b.push(c):function(){try{f.doScroll("left")}catch(b){return setTimeout(function(){a(c)},50)}c()}()}:function(a){k?a():b.push(a)}}),provide("domready",a.exports),!function(a){var b=require("domready");a.ender({domReady:b}),a.ender({ready:function(a){return b(a),this}},!0)}(ender)}(),!function(){var a={exports:{}},b=a.exports;
Example #11
0
!function(b,c){typeof a!="undefined"?a.exports=c():typeof define=="function"&&define.amd?define(b,c):this[b]=c()}("bonzo",function(){function C(a){return new RegExp("(^|\\s+)"+a+"(\\s+|$)")}function D(a,b,c){for(var d=0,e=a.length;d<e;d++)b.call(c||a[d],a[d],d,a);return a}function E(a,b,c){for(var d=0,e=a.length;d<e;d++)K(a[d])&&(E(a[d].childNodes,b,c),b.call(c||a[d],a[d],d,a));return a}function F(a){return a.replace(/-(.)/g,function(a,b){return b.toUpperCase()})}function G(a){return a?a.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase():a}function H(a){return a[w]("data-node-uid")||a[v]("data-node-uid",++r),uid=a[w]("data-node-uid"),q[uid]||(q[uid]={})}function I(a){uid=a[w]("data-node-uid"),uid&&delete q[uid]}function J(a){try{return a==="true"?!0:a==="false"?!1:a==="null"?null:isNaN(a)?a:parseFloat(a)}catch(b){}return undefined}function K(a){return a&&a.nodeName&&a.nodeType==1}function L(a,b,c,d){for(d=0,j=a.length;d<j;++d)if(b.call(c,a[d],d,a))return!0;return!1}function M(a){return a=="transform"&&(a=y.transform)||/^transform-?[Oo]rigin$/.test(a)&&(a=y.transform+"Origin")||a=="float"&&(a=y.cssFloat),a?F(a):null}function O(a,b,c){var d=0,e=b||this,h=[],i=g&&typeof a=="string"&&a.charAt(0)!="<"?g(a):a;return D(V(i),function(a){D(e,function(b){var g=!b[f]||b[f]&&!b[f][f]?function(){var a=b.cloneNode(!0);return e.$&&e.cloneEvents&&e.$(a).cloneEvents(b),a}():b;c(a,g),h[d]=g,d++})},this),D(h,function(a,b){e[b]=a}),e.length=d,e}function P(a,b,c){var d=Z(a),e=d.css("position"),f=d.offset(),g="relative",h=e==g,i=[parseInt(d.css("left"),10),parseInt(d.css("top"),10)];e=="static"&&(d.css("position",g),e=g),isNaN(i[0])&&(i[0]=h?0:a.offsetLeft),isNaN(i[1])&&(i[1]=h?0:a.offsetTop),b!=null&&(a.style.left=b-f.left+i[0]+u),c!=null&&(a.style.top=c-f.top+i[1]+u)}function Q(a,b){return C(b).test(a.className)}function R(a,b){a.className=B(a.className+" "+b)}function S(a,b){a.className=B(a.className.replace(C(b)," "))}function T(a,b){return typeof b=="function"?b(a):b}function U(a){this.length=0;if(a){a=typeof a!="string"&&!a.nodeType&&typeof a.length!="undefined"?a:[a],this.length=a.length;for(var b=0;b<a.length;b++)this[b]=a[b]}}function V(a){return typeof a=="string"?Z.create(a):K(a)?[a]:a}function W(a,b,d){var e=this[0];return a==null&&b==null?(X(e)?Y():{x:e.scrollLeft,y:e.scrollTop})[d]:(X(e)?c.scrollTo(a,b):(a!=null&&(e.scrollLeft=a),b!=null&&(e.scrollTop=b)),this)}function X(a){return a===c||/^(?:body|html)$/i.test(a.tagName)}function Y(){return{x:c.pageXOffset||e.scrollLeft,y:c.pageYOffset||e.scrollTop}}function Z(a,b){return new U(a,b)}var a=this,b=a.bonzo,c=window,d=c.document,e=d.documentElement,f="parentNode",g=null,h=/^checked|value|selected$/,i=/select|fieldset|table|tbody|tfoot|td|tr|colgroup/i,k=["<table>","</table>",1],l=["<table><tbody><tr>","</tr></tbody></table>",3],m=["<select>","</select>",1],n={thead:k,tbody:k,tfoot:k,colgroup:k,caption:k,tr:["<table><tbody>","</tbody></table>",2],th:l,td:l,col:["<table><colgroup>","</colgroup></table>",2],fieldset:["<form>","</form>",1],legend:["<form><fieldset>","</fieldset></form>",2],option:m,optgroup:m},o=/^checked|selected$/,p=/msie/i.test(navigator.userAgent),q={},r=0,s=/^-?[\d\.]+$/,t=/^data-(.+)$/,u="px",v="setAttribute",w="getAttribute",x="getElementsByTagName",y=function(){var a=d.createElement("p");return a.innerHTML='<a href="#x">x</a><table style="float:left;"></table>',{hrefExtended:a[x]("a")[0][w]("href")!="#x",autoTbody:a[x]("tbody").length!==0,computedStyle:d.defaultView&&d.defaultView.getComputedStyle,cssFloat:a[x]("table")[0].style.styleFloat?"styleFloat":"cssFloat",transform:function(){var b=["webkitTransform","MozTransform","OTransform","msTransform","Transform"],c;for(c=0;c<b.length;c++)if(b[c]in a.style)return b[c]}()}}(),z=/(^\s*|\s*$)/g,A={lineHeight:1,zoom:1,zIndex:1,opacity:1},B=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(z,"")},N=y.computedStyle?function(a,b){var c=null,e=d.defaultView.getComputedStyle(a,"");return e&&(c=e[b]),a.style[b]||c}:p&&e.currentStyle?function(a,b){if(b=="opacity"){var c=100;try{c=a.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(d){try{c=a.filters("alpha").opacity}catch(e){}}return c/100}var f=a.currentStyle?a.currentStyle[b]:null;return a.style[b]||f}:function(a,b){return a.style[b]};return U.prototype={get:function(a){return this[a]},each:function(a,b){return D(this,a,b)},deepEach:function(a,b){return E(this,a,b)},map:function(a,b){var c=[],d,e;for(e=0;e<this.length;e++)d=a.call(this,this[e],e),b?b(d)&&c.push(d):c.push(d);return c},first:function(){return Z(this.length?this[0]:[])},last:function(){return Z(this.length?this[this.length-1]:[])},html:function(a,b){function f(b){D(V(a),function(a){b.appendChild(a)})}var c=b?e.textContent===undefined?"innerText":"textContent":"innerHTML",d;return typeof a!="undefined"?this.empty().each(function(e){!b&&(d=e.tagName.match(i))?f(e,d[0]):e[c]=a}):this[0]?this[0][c]:""},text:function(a){return this.html(a,1)},addClass:function(a){return this.each(function(b){Q(b,T(b,a))||R(b,T(b,a))})},removeClass:function(a){return this.each(function(b){Q(b,T(b,a))&&S(b,T(b,a))})},hasClass:function(a){return L(this,function(b){return Q(b,a)})},toggleClass:function(a,b){return this.each(function(c){typeof b!="undefined"?b?R(c,a):S(c,a):Q(c,a)?S(c,a):R(c,a)})},show:function(a){return this.each(function(b){b.style.display=a||""})},hide:function(){return this.each(function(a){a.style.display="none"})},append:function(a){return this.each(function(b){D(V(a),function(a){b.appendChild(a)})})},prepend:function(a){return this.each(function(b){var c=b.firstChild;D(V(a),function(a){b.insertBefore(a,c)})})},appendTo:function(a,b){return O.call(this,a,b,function(a,b){a.appendChild(b)})},prependTo:function(a,b){return O.call(this,a,b,function(a,b){a.insertBefore(b,a.firstChild)})},next:function(){return this.related("nextSibling")},previous:function(){return this.related("previousSibling")},related:function(a){return this.map(function(b){b=b[a];while(b&&b.nodeType!==1)b=b[a];return b||0},function(a){return a})},before:function(a){return this.each(function(b){D(Z.create(a),function(a){b[f].insertBefore(a,b)})})},after:function(a){return this.each(function(b){D(Z.create(a),function(a){b[f].insertBefore(a,b.nextSibling)})})},insertBefore:function(a,b){return O.call(this,a,b,function(a,b){a[f].insertBefore(b,a)})},insertAfter:function(a,b){return O.call(this,a,b,function(a,b){var c=a.nextSibling;c?a[f].insertBefore(b,c):a[f].appendChild(b)})},replaceWith:function(a){return this.deepEach(I),this.each(function(b){b.parentNode.replaceChild(Z.create(a)[0],b)})},css:function(a,b,e){function g(a,b,c){for(var d in f)f.hasOwnProperty(d)&&(c=f[d],(b=M(d))&&s.test(c)&&!(b in A)&&(c+=u),a.style[b]=T(a,c))}if(b===undefined&&typeof a=="string")return b=this[0],b?b===d||b===c?(e=b===d?Z.doc():Z.viewport(),a=="width"?e.width:a=="height"?e.height:""):(a=M(a))?N(b,a):null:null;var f=a;return typeof a=="string"&&(f={},f[a]=b),p&&f.opacity&&(f.filter="alpha(opacity="+f.opacity*100+")",f.zoom=a.zoom||1,delete f.opacity),this.each(g)},offset:function(a,b){if(typeof a=="number"||typeof b=="number")return this.each(function(c){P(c,a,b)});if(!this[0])return{top:0,left:0,height:0,width:0};var c=this[0],d=c.offsetWidth,e=c.offsetHeight,f=c.offsetTop,g=c.offsetLeft;while(c=c.offsetParent)f+=c.offsetTop,g+=c.offsetLeft;return{top:f,left:g,height:e,width:d}},dim:function(){var a=this[0],b=!a.offsetWidth&&!a.offsetHeight?function(b,c){return c={position:a.style.position||"",visibility:a.style.visibility||"",display:a.style.display||""},b.first().css({position:"absolute",visibility:"hidden",display:"block"}),c}(this):null,c=a.offsetWidth,d=a.offsetHeight;return b&&this.first().css(b),{height:d,width:c}},attr:function(a,b){var c=this[0];if(typeof a=="string"||a instanceof String)return typeof b=="undefined"?h.test(a)?o.test(a)&&typeof c[a]=="string"?!0:c[a]:a!="href"&&a!="src"||!y.hrefExtended?c[w](a):c[w](a,2):this.each(function(c){h.test(a)?c[a]=T(c,b):c[v](a,T(c,b))});for(var d in a)a.hasOwnProperty(d)&&this.attr(d,a[d]);return this},val:function(a){return typeof a=="string"?this.attr("value",a):this[0].value},removeAttr:function(a){return this.each(function(b){o.test(a)?b[a]=!1:b.removeAttribute(a)})},data:function(a,b){var c=this[0],d,e,f;return typeof b=="undefined"?(e=H(c),typeof a=="undefined"?(D(c.attributes,function(a){(f=(""+a.name).match(t))&&(e[F(f[1])]=J(a.value))}),e):typeof e[a]=="undefined"?e[a]=J(this.attr("data-"+G(a))):e[a]):this.each(function(c){H(c)[a]=b})},remove:function(){return this.deepEach(I),this.each(function(a){a[f]&&a[f].removeChild(a)})},empty:function(){return this.each(function(a){E(a.childNodes,I);while(a.firstChild)a.removeChild(a.firstChild)})},detach:function(){return this.map(function(a){return a[f].removeChild(a)})},scrollTop:function(a){return W.call(this,null,a,"y")},scrollLeft:function(a){return W.call(this,a,null,"x")},toggle:function(a,b){return this.each(function(a){a.style.display=a.offsetWidth||a.offsetHeight?"none":b||""}),a&&a(),this}},Z.setQueryEngine=function(a){g=a,delete Z.setQueryEngine},Z.aug=function(a,b){for(var c in a)a.hasOwnProperty(c)&&((b||U.prototype)[c]=a[c])},Z.create=function(a){return typeof a=="string"&&a!==""?function(){var b=/^\s*<([^\s>]+)/.exec(a),c=d.createElement("div"),e=[],g=b?n[b[1].toLowerCase()]:null,h=g?g[2]+1:1,i=f,j=y.autoTbody&&g&&g[0]=="<table>"&&!/<tbody/i.test(a);c.innerHTML=g?g[0]+a+g[1]:a;while(h--)c=c.firstChild;do(!b||c.nodeType==1)&&(!j||c.tagName.toLowerCase()!="tbody")&&e.push(c);while(c=c.nextSibling);return D(e,function(a){a[i]&&a[i].removeChild(a)}),e}():K(a)?[a.cloneNode(!0)]:[]},Z.doc=function(){var a=Z.viewport();return{width:Math.max(d.body.scrollWidth,e.scrollWidth,a.width),height:Math.max(d.body.scrollHeight,e.scrollHeight,a.height)}},Z.firstChild=function(a){for(var b=a.childNodes,c=0,d=b&&b.length||0,e;c<d;c++)b[c].nodeType===1&&(e=b[d=c]);return e},Z.viewport=function(){return{width:p?e.clientWidth:self.innerWidth,height:p?e.clientHeight:self.innerHeight}},Z.isAncestor="compareDocumentPosition"in e?function(a,b){return(a.compareDocumentPosition(b)&16)==16}:"contains"in e?function(a,b){return a!==b&&a.contains(b)}:function(a,b){while(b=b[f])if(b===a)return!0;return!1},Z.noConflict=function(){return a.bonzo=b,this},Z}),provide("bonzo",a.exports),!function(a){function c(a,b){for(var c=0;c<a.length;c++)if(a[c]===b)return c;return-1}function d(a){var b=[],c,d;e:for(c=0;c<a.length;c++){for(d=0;d<b.length;d++)if(b[d]==a[c])continue e;b[b.length]=a[c]}return b}function e(a,b,c){return a?b.css(c,a):function(a){return b[0]?(a=parseInt(b.css(c),10),isNaN(a)?b[0]["offset"+c.replace(/^\w/,function(a){return a.toUpperCase()})]:a):0}()}var b=require("bonzo");b.setQueryEngine(a),a.ender(b),a.ender(b(),!0),a.ender({create:function(c){return a(b.create(c))}}),a.id=function(b){return a([document.getElementById(b)])},a.ender({parents:function(b,e){var f=a(b),g,h,i,j=[];for(g=0,h=this.length;g<h;g++){i=this[g];while(i=i.parentNode)if(~c(f,i)){j.push(i);if(e)break}}return a(d(j))},closest:function(a){return this.parents(a,!0)},first:function(){return a(this.length?this[0]:this)},last:function(){return a(this.length?this[this.length-1]:[])},next:function(){return a(b(this).next())},previous:function(){return a(b(this).previous())},appendTo:function(a){return b(this.selector).appendTo(a,this)},prependTo:function(a){return b(this.selector).prependTo(a,this)},insertAfter:function(a){return b(this.selector).insertAfter(a,this)},insertBefore:function(a){return b(this.selector).insertBefore(a,this)},siblings:function(){var b,c,d,e=[];for(b=0,c=this.length;b<c;b++){d=this[b];while(d=d.previousSibling)d.nodeType==1&&e.push(d);d=this[b];while(d=d.nextSibling)d.nodeType==1&&e.push(d)}return a(e)},children:function(){var c,e,f=[];for(c=0,l=this.length;c<l;c++){if(!(e=b.firstChild(this[c])))continue;f.push(e);while(e=e.nextSibling)e.nodeType==1&&f.push(e)}return a(d(f))},height:function(a){return e(a,this,"height")},width:function(a){return e(a,this,"width")}},!0)}(ender)}()
Example #12
0
import CanvasApp from './components/canvas-app'
import React from 'react'
import ReactDOM from 'react-dom'
import domready from 'domready'

domready(() => {
  ReactDOM.render(<CanvasApp />, document.getElementById('canvas-app'))
})
Example #13
0
import vueComponent from '../../../vueComponent'
import EventEmitter from 'events'
import NativePromise from 'native-promise-only'
import domready from 'domready'
import homeScreen from './screens/home'
import viewLibs from './screens/viewLibs'
import notFound from './screens/notFound'
import views from './vues'

Vue.config.silent = true

const emitter = new EventEmitter()
const config = {
  document,
  components: vueComponent(Vue),
  promises: NativePromise,
  events: {
    emitter,
    trigger: 'emit',
    on: 'addListener',
    off: 'removeListener'
  }
}
const machine = global.machine = screenMachine(config)

views(Vue)
homeScreen(machine)
viewLibs(machine)
notFound(machine)
domready(() => machine.start())
Example #14
0
domready(function(){
  var stream = shoe('/shoe');

  stream.on('connection', function(data) {
    console.log("Connected");
  });

  var counter = 10;
  var results = [];
  stream.on('data', function(data) {
    if (counter > 0) {
      stream.write(createMessage(counter));
      results.push(JSON.parse(data));
      counter -= 1;
    } else {
      stream.end();
    }

  });

  stream.on('end', function(data) {
    console.log("Closed connnection", results);
  });

  var createMessage = function(type) {
    var obj = {
      type: type,
      time: Date.now()
    };
    return JSON.stringify(obj);
  };

});
Example #15
0
;!function(b,c){typeof a!="undefined"?a.exports=c():typeof define=="function"&&typeof define.amd=="object"?define(c):this[b]=c()}("domready",function(a){function m(a){l=1;while(a=b.shift())a()}var b=[],c,d=!1,e=document,f=e.documentElement,g=f.doScroll,h="DOMContentLoaded",i="addEventListener",j="onreadystatechange",k="readyState",l=/^loade|c/.test(e[k]);e[i]&&e[i](h,c=function(){e.removeEventListener(h,c,d);m()},d);g&&e.attachEvent(j,c=function(){if(/^c/.test(e[k])){e.detachEvent(j,c);m()}});return a=g?function(c){self!=top?l?c():b.push(c):function(){try{f.doScroll("left")}catch(b){return setTimeout(function(){a(c)},50)}c()}()}:function(a){l?a():b.push(a)}});provide("domready",a.exports);!function(a){var b=require("domready");a.ender({domReady:b});a.ender({ready:function(a){b(a);return this}},!0)}(ender)})();(function(){var a={exports:{}},b=a.exports;
Example #16
0
domready(function () {

    // create a renderer instance
    var renderer = new PIXI.WebGLRenderer(600, 600, null, false, true);//autoDetectRenderer(400, 300);

    // add the renderer view element to the DOM
    document.body.appendChild(renderer.view);
    requestAnimFrame( animate );

    // draw a circle
    var graphics = new PIXI.Graphics();
    graphics.lineStyle(0);
    graphics.beginFill(0xFFFFFF, 0.5);

    var grid = new Grid();
    var adjacencyList = new AdjacencyList(graphics, grid);

    function makeNodes() {
        var arr = [];
        var i = 0;

        while (i < 9) {
            arr[i] = i;
            i++;
        }

        async.each(arr, function (index, callback) {
            var node = new Node();
            adjacencyList.addNode(index, node);
            callback();
        }, function (err) {
           if (err) throw err;
        });

    //    var n2 = new Node();
  //      adjacencyList.addNode(3, n2);
//
    //    var n3 = new Node();
   //     adjacencyList.addNode(3, n3);

      //  n1.addConnection(n2);
//        n3.addConnection(n1);

    }

    makeNodes();
    stage.addChild(graphics);


    function animate() {
        requestAnimFrame( animate );


        // just for fun, lets rotate mr rabbit a little
        //bunny.rotation += 0.1;


        // render the stage
        graphics.clear();
        adjacencyList.draw();
        renderer.render(stage);
    }
});
Example #17
0
(function(b,c,d){typeof a!="undefined"&&a.exports?a.exports=d():typeof c["define"]=="function"&&c.define.amd?define(d):c[b]=d()})("qwery",this,function(){function C(){this.c={}}function H(a){return D.g(a)||D.s(a,"(^|\\s+)"+a+"(\\s+|$)",1)}function I(a,b){var c=0,d=a.length;for(;c<d;c++)b(a[c])}function J(a){for(var b=[],c=0,d=a.length;c<d;++c)V(a[c])?b=b.concat(a[c]):b[b.length]=a[c];return b}function K(a){var b=0,c=a.length,d=[];for(;b<c;b++)d[b]=a[b];return d}function L(a){while(a=a.previousSibling)if(a[h]==1)break;return a}function M(a){return a.match(A)}function N(a,b,c,d,e,f,i,l,m,n,o){var p,q,r,s,t;if(this[h]!==1)return!1;if(b&&b!=="*"&&this[g]&&this[g].toLowerCase()!==b)return!1;if(c&&(q=c.match(j))&&q[1]!==this.id)return!1;if(c&&(t=c.match(k)))for(p=t.length;p--;)if(!H(t[p].slice(1)).test(this.className))return!1;if(m&&Y.pseudos[m]&&!Y.pseudos[m](this,o))return!1;if(d&&!i){s=this.attributes;for(r in s)if(Object.prototype.hasOwnProperty.call(s,r)&&(s[r].name||r)==e)return this}return d&&!P(f,_(this,e)||"",i)?!1:this}function O(a){return E.g(a)||E.s(a,a.replace(t,"\\$1"))}function P(a,b,c){switch(a){case"=":return b==c;case"^=":return b.match(F.g("^="+c)||F.s("^="+c,"^"+O(c),1));case"$=":return b.match(F.g("$="+c)||F.s("$="+c,O(c)+"$",1));case"*=":return b.match(F.g(c)||F.s(c,O(c),1));case"~=":return b.match(F.g("~="+c)||F.s("~="+c,"(?:^|\\s+)"+O(c)+"(?:\\s+|$)",1));case"|=":return b.match(F.g("|="+c)||F.s("|="+c,"^"+O(c)+"(-|$)",1))}return 0}function Q(a,b){var c=[],e=[],f,i,j,k,m,n,o,p,q=b,r=G.g(a)||G.s(a,a.split(z)),s=a.match(y);if(!r.length)return c;k=(r=r.slice(0)).pop();r.length&&(j=r[r.length-1].match(l))&&(q=X(b,j[1]));if(!q)return c;o=M(k);n=q!==b&&q[h]!==9&&s&&/^[+~]$/.test(s[s.length-1])?function(a){while(q=q.nextSibling)q[h]==1&&(o[1]?o[1]==q[g].toLowerCase():1)&&(a[a.length]=q);return a}([]):q[d](o[1]||"*");for(f=0,i=n.length;f<i;f++)if(p=N.apply(n[f],o))c[c.length]=p;if(!r.length)return c;I(c,function(a){S(a,r,s)&&(e[e.length]=a)});return e}function R(a,b,c){if(T(b))return a==b;if(V(b))return!!~J(b).indexOf(a);var d=b.split(","),e,f;while(b=d.pop()){e=G.g(b)||G.s(b,b.split(z));f=b.match(y);e=e.slice(0);if(N.apply(a,M(e.pop()))&&(!e.length||S(a,e,f,c)))return!0}return!1}function S(a,b,c,d){function f(a,d,g){while(g=B[c[d]](g,a))if(T(g)&&N.apply(g,M(b[d]))){if(!d)return g;if(e=f(g,d-1,g))return e}}var e;return(e=f(a,b.length-1,a))&&(!d||$(e,d))}function T(a,b){return a&&typeof a=="object"&&(b=a[h])&&(b==1||b==9)}function U(a){var b=[],c,d;a:for(c=0;c<a.length;++c){for(d=0;d<b.length;++d)if(b[d]==a[c])continue a;b[b.length]=a[c]}return b}function V(a){return typeof a=="object"&&isFinite(a.length)}function W(b){return b?typeof b=="string"?Y(b)[0]:!b[h]&&V(b)?b[0]:b:a}function X(a,b,c){return a[h]===9?a.getElementById(b):a.ownerDocument&&((c=a.ownerDocument.getElementById(b))&&$(c,a)&&c||!$(a,a.ownerDocument)&&i('[id="'+b+'"]',a)[0])}function Y(a,b){var e,f,g=W(b);if(!g||!a)return[];if(a===window||T(a))return!b||a!==window&&T(g)&&$(a,g)?[a]:[];if(a&&V(a))return J(a);if(e=a.match(x)){if(e[1])return(f=X(g,e[1]))?[f]:[];if(e[2])return K(g[d](e[2]));if(ab&&e[3])return K(g[c](e[3]))}return i(a,g)}function Z(a,b){return function(c){var d,e;if(p.test(c)){if(a[h]!==9){(e=d=a.getAttribute("id"))||a.setAttribute("id",e="__qwerymeupscotty");c='[id="'+e+'"]'+c;b(a.parentNode||a,c,!0);d||a.removeAttribute("id")}return}c.length&&b(a,c,!1)}}var a=document,b=a.documentElement,c="getElementsByClassName",d="getElementsByTagName",e="querySelectorAll",f="useNativeQSA",g="tagName",h="nodeType",i,j=/#([\w\-]+)/,k=/\.[\w\-]+/g,l=/^#([\w\-]+)$/,m=/^\.([\w\-]+)$/,n=/^([\w\-]+)$/,o=/^([\w]+)?\.([\w\-]+)$/,p=/(^|,)\s*[>~+]/,q=/^\s+|\s*([,\s\+\~>]|$)\s*/g,r=/[\s\>\+\~]/,s=/(?![\s\w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^'"]*\]|[\s\w\+\-]*\))/,t=/([.*+?\^=!:${}()|\[\]\/\\])/g,u=/^(\*|[a-z0-9]+)?(?:([\.\#]+[\w\-\.#]+)?)/,v=/\[([\w\-]+)(?:([\|\^\$\*\~]?\=)['"]?([ \w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^]+)["']?)?\]/,w=/:([\w\-]+)(\(['"]?([^()]+)['"]?\))?/,x=new RegExp(l.source+"|"+n.source+"|"+m.source),y=new RegExp("("+r.source+")"+s.source,"g"),z=new RegExp(r.source+s.source),A=new RegExp(u.source+"("+v.source+")?"+"("+w.source+")?"),B={" ":function(a){return a&&a!==b&&a.parentNode},">":function(a,b){return a&&a.parentNode==b.parentNode&&a.parentNode},"~":function(a){return a&&a.previousSibling},"+":function(a,b,c,d){return a?(c=L(a))&&(d=L(b))&&c==d&&c:!1}};C.prototype={g:function(a){return this.c[a]||undefined},s:function(a,b,c){b=c?new RegExp(b):b;return this.c[a]=b}};var D=new C,E=new C,F=new C,G=new C,$="compareDocumentPosition"in b?function(a,b){return(b.compareDocumentPosition(a)&16)==16}:"contains"in b?function(a,c){c=c[h]===9||c==window?b:c;return c!==a&&c.contains(a)}:function(a,b){while(a=a.parentNode)if(a===b)return 1;return 0},_=function(){var b=a.createElement("p");return(b.innerHTML='<a href="#x">x</a>')&&b.firstChild.getAttribute("href")!="#x"?function(a,b){return b==="class"?a.className:b==="href"||b==="src"?a.getAttribute(b,2):a.getAttribute(b)}:function(a,b){return a.getAttribute(b)}}(),ab=!!a[c],bb=a.querySelector&&a[e],cb=function(a,b){var c=[],d,f;try{if(b[h]===9||!p.test(a))return K(b[e](a));I(d=a.split(","),Z(b,function(a,b){f=a[e](b);f.length==1?c[c.length]=f.item(0):f.length&&(c=c.concat(K(f)))}));return d.length>1&&c.length>1?U(c):c}catch(g){}return db(a,b)},db=function(a,b){var c=[],e,f,g,i,j,k;a=a.replace(q,"$1");if(f=a.match(o)){j=H(f[2]);e=b[d](f[1]||"*");for(g=0,i=e.length;g<i;g++)j.test(e[g].className)&&(c[c.length]=e[g]);return c}I(k=a.split(","),Z(b,function(a,d,e){j=Q(d,a);for(g=0,i=j.length;g<i;g++)if(a[h]===9||e||$(j[g],b))c[c.length]=j[g]}));return k.length>1&&c.length>1?U(c):c},eb=function(a){typeof a[f]!="undefined"&&(i=a[f]?bb?cb:db:db)};eb({useNativeQSA:!0});Y.configure=eb;Y.uniq=U;Y.is=R;Y.pseudos={};return Y});provide("qwery",a.exports);(function(a){var b=function(){var a;try{a=require("qwery")}catch(b){a=require("qwery-mobile")}finally{return a}}();a.pseudos=b.pseudos;a._select=function(c,d){return(a._select=function(){var c;if(typeof a.create=="function")return function(c,d){return/^\s*</.test(c)?a.create(c,d):b(c,d)};try{c=require("bonzo");return function(a,d){return/^\s*</.test(a)?c.create(a,d):b(a,d)}}catch(d){}return b}())(c,d)};a.ender({find:function(c){var d=[],e,f,g,h,i;for(e=0,f=this.length;e<f;e++){i=b(c,this[e]);for(g=0,h=i.length;g<h;g++)d.push(i[g])}return a(b.uniq(d))},and:function(b){var c=a(b);for(var d=this.length,e=0,f=this.length+c.length;d<f;d++,e++)this[d]=c[e];this.length+=c.length;return this},is:function(a,c){var d,e;for(d=0,e=this.length;d<e;d++)if(b.is(this[d],a,c))return!0;return!1}},!0)})(ender)})();(function(){var a={exports:{}},b=a.exports;
Example #18
0
/*jslint node:true*/
var domready = require('domready'),
    map = require('./map');

domready(function () {
    'use strict';
    map();
});
Example #19
0
module.exports = function (selector, root) {
  if (typeof selector === 'function') {
    return domready(selector);
  }
  return bonzo(qwery('#a0-widget ' + (selector || ''), root));
};
Example #20
0
  Youtube.play = function() {
    if (!Youtube.player) { return; }
    Youtube.player.playVideo();
  };

  Youtube.pause = function() {
    if (!Youtube.player) { return; }
    Youtube.player.pauseVideo();
  };

  Youtube.stop = function() {
    if (!Youtube.player) { return; }
    Youtube.player.stopVideo();
  };

  Youtube.taylorswift = function() {
    Youtube.loadVideo("vNoKguSdy4Y");
  };

  return (yt = Youtube);
});

domready(function(){

  // This is a youtube built-in callback function convention. We're just delegating
  // to the namespaced function.
  window.onYouTubePlayerReady = function(playerId) {
    Youtube.onYouTubePlayerReady(playerId);
  };

});
Example #21
0
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
var domready=require("domready");function mailArchiveJump(){var e=document.getElementById("msgid").value;document.location.href="https://www.mail-archive.com/search?l=mid&q="+e}function debianJump(){var e=document.getElementById("msgid").value;document.location.href="https://lists.debian.org/msgid-search/"+e}function mailArchiveShow(){var e=document.getElementById("msgid"),t=e.value;e.value="https://www.mail-archive.com/search?l=mid&q="+t}function debianShow(){var e=document.getElementById("msgid"),t=e.value;e.value="https://lists.debian.org/msgid-search/"+t}domready(function(){var e=document.getElementsByTagName("body")[0],t=document.createElement("p");t.appendChild(document.createTextNode("Takes a Message-ID from a public mailing list and attempts to look up a public archive entry for it from multiple sources.")),e.appendChild(t);var a=document.createElement("p"),d=document.createElement("input");d.id="msgid",d.type="text",d.placeholder="Message-ID",d.style.width="50%",a.appendChild(d),a.appendChild(document.createElement("br"));var n=document.createElement("input");n.type="button",n.value="Mail Archive Link",n.onclick=mailArchiveShow,a.appendChild(n),a.appendChild(document.createTextNode(" "));var i=document.createElement("input");i.type="button",i.value="Debian Link",i.onclick=debianShow,a.appendChild(i),a.appendChild(document.createElement("br"));var c=document.createElement("input");c.type="button",c.value="Mail Archive Jump",c.onclick=mailArchiveJump,a.appendChild(c),a.appendChild(document.createTextNode(" "));var l=document.createElement("input");l.type="button",l.value="Debian Jump",l.onclick=debianJump,a.appendChild(l),e.appendChild(a);var m=document.createElement("p");m.appendChild(document.createTextNode("Example Mail Archive MessageID: cfb1d155-499d-3205-8283-ce84c39dbb14@redhat.com")),e.appendChild(m);var o=document.createElement("p");o.appendChild(document.createTextNode("Example Debian MessageID: 20171121214924.kwjklln5t6t7dedh@rene-engelhard.de")),e.appendChild(o)});

},{"domready":2}],2:[function(require,module,exports){
Example #22
0
    stream.on('data', function(d) {
      try {
        var obj = JSON.parse(d);
        if (obj.x !== null) {
          sim.moveTool(obj.x, obj.y, obj.z);
        }
      } catch(e) {}
    });

  });
} else {
  cz = 0;
  setInterval(function() {
    cz -= 0.001;
    var time = Date.now()/1000;
    var cx = stockDimensions[0]/2 + Math.sin(time)*stockDimensions[0]/2;
    var cy = stockDimensions[1]/2 + Math.cos(time)*stockDimensions[1]/2;
    sim.moveTool(cx, cy, cz)
  }, 0);
}

domready(function() {
  var gl = fc(function(dt) {
    sim.render(gl, dt);
  }, false, 3);

  sim.init(gl);

  gl.start();
});