vines-web 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. data/Gemfile +3 -0
  2. data/LICENSE +19 -0
  3. data/README.md +37 -0
  4. data/Rakefile +28 -0
  5. data/app/assets/javascripts/application.coffee +19 -0
  6. data/app/assets/javascripts/chat.coffee +362 -0
  7. data/app/assets/javascripts/lib/button.coffee +25 -0
  8. data/app/assets/javascripts/lib/contact.coffee +32 -0
  9. data/app/assets/javascripts/lib/filter.coffee +49 -0
  10. data/app/assets/javascripts/lib/index.coffee +1 -0
  11. data/app/assets/javascripts/lib/layout.coffee +30 -0
  12. data/app/assets/javascripts/lib/login.coffee +68 -0
  13. data/app/assets/javascripts/lib/logout.coffee +5 -0
  14. data/app/assets/javascripts/lib/navbar.coffee +84 -0
  15. data/app/assets/javascripts/lib/notification.coffee +14 -0
  16. data/app/assets/javascripts/lib/router.coffee +40 -0
  17. data/app/assets/javascripts/lib/session.coffee +229 -0
  18. data/app/assets/javascripts/lib/transfer.coffee +106 -0
  19. data/app/assets/javascripts/vendor/icons.js +110 -0
  20. data/app/assets/javascripts/vendor/index.js +1 -0
  21. data/app/assets/javascripts/vendor/jquery.js +4 -0
  22. data/app/assets/javascripts/vendor/raphael.js +6 -0
  23. data/app/assets/javascripts/vendor/strophe.js +1 -0
  24. data/app/assets/stylesheets/application.css +5 -0
  25. data/app/assets/stylesheets/base.scss +385 -0
  26. data/app/assets/stylesheets/chat.scss +144 -0
  27. data/app/assets/stylesheets/login.scss +68 -0
  28. data/bin/vines-web +63 -0
  29. data/config.ru +10 -0
  30. data/lib/vines/web/command/init.rb +34 -0
  31. data/lib/vines/web/command/install.rb +19 -0
  32. data/lib/vines/web/version.rb +5 -0
  33. data/lib/vines/web.rb +4 -0
  34. data/public/assets/application.css +598 -0
  35. data/public/assets/application.js +9 -0
  36. data/public/assets/lib.js +1 -0
  37. data/public/assets/vendor.js +8 -0
  38. data/public/images/dark-gray.png +0 -0
  39. data/public/images/default-user.png +0 -0
  40. data/public/images/light-gray.png +0 -0
  41. data/public/images/logo-large.png +0 -0
  42. data/public/images/logo-small.png +0 -0
  43. data/public/images/white.png +0 -0
  44. data/public/index.html +13 -0
  45. data/vines-web.gemspec +27 -0
  46. metadata +207 -0
@@ -0,0 +1 @@
1
+ !function(){this.Button=function(){function t(t,e,n){this.node=$(t),this.path=e,this.options=n||{},null==this.options.animate&&(this.options.animate=!0),this.draw()}return t.prototype.draw=function(){var t,e,n;return e=Raphael(this.node.get(0)),n="s"+(this.options.scale||.85),this.options.translation&&(n+=",t"+this.options.translation),t=e.path(this.path).attr({fill:this.options.fill||"#000",stroke:this.options.stroke||"#fff","stroke-width":this.options["stroke-width"]||.3,opacity:this.options.opacity||.6,transform:n}),this.options.animate?this.node.hover(function(){return t.animate({opacity:1},200)},function(){return t.animate({opacity:.6},200)}):void 0},t}()}.call(this),function(){this.Contact=function(){function t(t){t=$(t),this.jid=t.attr("jid"),this.name=t.attr("name"),this.ask=t.attr("ask"),this.subscription=t.attr("subscription"),this.groups=$("group",t).map(function(){return $(this).text()}).get(),this.presence=[]}return t.prototype.online=function(){return this.presence.length>0},t.prototype.offline=function(){return 0===this.presence.length},t.prototype.available=function(){var t;return this.online()&&function(){var e,n,i,r;for(i=this.presence,r=[],e=0,n=i.length;n>e;e++)t=i[e],t.away||r.push(t);return r}.call(this).length>0},t.prototype.away=function(){return!this.available()},t.prototype.status=function(){var t,e,n;return t=function(){var t,e,i,r;for(i=this.presence,r=[],t=0,e=i.length;e>t;t++)n=i[t],n.status&&!n.away&&r.push(n.status);return r}.call(this)[0]||"Available",e=function(){var t,e,i,r;for(i=this.presence,r=[],t=0,e=i.length;e>t;t++)n=i[t],n.status&&n.away&&r.push(n.status);return r}.call(this)[0]||"Away",this.offline()?"Offline":this.away()?e:t},t.prototype.update=function(t){var e;return this.presence=function(){var n,i,r,s;for(r=this.presence,s=[],n=0,i=r.length;i>n;n++)e=r[n],e.from!==t.from&&s.push(e);return s}.call(this),t.type||this.presence.push(t),"unsubscribed"===t.type?this.presence=[]:void 0},t}()}.call(this),function(){this.Filter=function(){function t(t){this.list=t.list,this.icon=t.icon,this.form=t.form,this.attrs=t.attrs,this.open=t.open,this.close=t.close,this.draw()}return t.prototype.draw=function(){var t,e,n=this;return $(this.icon).addClass("filter-button"),t=$('<form class="filter-form" style="display:none;"></form>').appendTo(this.form),e=$('<input class="filter-text" type="search" placeholder="Filter" results="5"/>').appendTo(t),this.icon&&new Button(this.icon,ICONS.search,{scale:.5,translation:"-16,-16"}),t.submit(function(){return!1}),e.keyup(function(){return n.filter(e)}),e.change(function(){return n.filter(e)}),e.click(function(){return n.filter(e)}),$(this.icon).click(function(){if(t.is(":hidden")){if(n.filter(e),t.show(),n.open)return n.open()}else if(t.hide(),t[0].reset(),n.filter(e),n.close)return n.close()})},t.prototype.filter=function(t){var e,n,i=this;return n=t.val().toLowerCase(),""===n?($("li",this.list).show(),void 0):(e=function(t,e){var i;return i=(t.attr(e)||"").toLowerCase(),-1!==i.indexOf(n)},$("> li",this.list).each(function(t,n){var r,s;return n=$(n),s=function(){var t,i,s,o;for(s=this.attrs,o=[],t=0,i=s.length;i>t;t++)r=s[t],e(n,r)&&o.push(!0);return o}.call(i),s.length>0?n.show():n.hide()}))},t}()}.call(this),function(){this.Layout=function(){function t(t){var e=this;this.fn=t,this.resize(),this.listen(),setTimeout(function(){return e.resize()},250)}return t.prototype.resize=function(){return this.fill(".x-fill","outerWidth","width"),this.fill(".y-fill","outerHeight","height"),this.fn()},t.prototype.fill=function(t,e,n){var i=this;return $(t).filter(":visible").each(function(r,s){var o,a,u;return s=$(s),a=s[e],u=a.call(s.parent(),!0),o=i.fixed(s,t,function(t){return a.call(t,!0)}),s[n].call(s,u-o)})},t.prototype.fixed=function(t,e,n){return t.siblings().not(e).not(".float").filter(":visible").map(function(){return n($(this))}).get().reduce(function(t,e){return t+e},0)},t.prototype.listen=function(){var t,e=this;return t=null,$(window).resize(function(){return clearTimeout(t),t=setTimeout(function(){return e.resize()},10),e.resize()})},t}()}.call(this),function(){this.LoginPage=function(){function t(t,e){this.session=t,this.startPage=e}return t.prototype.start=function(){var t,e,n,i,r=this;return $("#error").hide(),i=function(){var e,n,i,r;for(i=["#jid","#password"],r=[],e=0,n=i.length;n>e;e++)t=i[e],r.push($(t).val().trim());return r}(),e=i[0],n=i[1],0===e.length||0===n.length||-1===e.indexOf("@")?($("#error").show(),void 0):this.session.connect(e,n,function(t){return t?(localStorage.jid=e,$("#current-user-name").text(r.session.bareJid()),$("#current-user-avatar").attr("src",r.session.avatar(r.session.jid())),$("#current-user-avatar").attr("alt",r.session.bareJid()),$("#container").fadeOut(200,function(){return $("#navbar").show(),window.location.hash=r.startPage})):(r.session.disconnect(),$("#error").show(),$("#password").val("").focus(),void 0)})},t.prototype.draw=function(){var t,e=this;return this.session.disconnect(),t=localStorage.jid||"",$("#navbar").hide(),$("body").attr("id","login-page"),$("#container").hide().empty(),$('<form id="login-form">\n <div id="icon"></div>\n <h1>vines</h1>\n <fieldset id="login-form-controls">\n <input id="jid" name="jid" type="email" maxlength="1024" value="'+t+'" placeholder="Your user name"/>\n <input id="password" name="password" type="password" maxlength="1024" placeholder="Your password"/>\n <input id="start" type="submit" value="Sign in"/>\n </fieldset>\n <p id="error" style="display:none;">User name and password not found.</p>\n</form>').appendTo("#container"),$("#container").fadeIn(1e3),$("#login-form").submit(function(){return e.start(),!1}),$("#jid").keydown(function(){return $("#error").fadeOut()}),$("#password").keydown(function(){return $("#error").fadeOut()}),this.resize(),this.icon()},t.prototype.icon=function(){var t;return t={fill:"90-#ccc-#fff",stroke:"#fff","stroke-width":1.1,opacity:.95,scale:3,translation:"10,8",animate:!1},new Button("#icon",ICONS.chat,t)},t.prototype.resize=function(){var t,e,n;return n=$(window),t=$("#login-form"),e=function(){return t.css("top",n.height()/2-t.height()/2)},n.resize(e),e()},t}()}.call(this),function(){this.LogoutPage=function(){function t(t){this.session=t}return t.prototype.draw=function(){return window.location.hash="",window.location.reload()},t}()}.call(this),function(){this.NavBar=function(){function t(t){var e=this;this.session=t,this.session.onCard(function(t){return t.jid===e.session.bareJid()?$("#current-user-avatar").attr("src",e.session.avatar(t.jid)):void 0})}return t.prototype.draw=function(){var t=this;return $('<header id="navbar" class="x-fill">\n <h1 id="logo">vines&gt;</h1>\n <div id="current-user">\n <img id="current-user-avatar" alt="'+this.session.bareJid()+'" src="'+this.session.avatar(this.session.jid())+'"/>\n <div id="current-user-info">\n <h1 id="current-user-name">'+this.session.bareJid()+'</h1>\n <form id="current-user-presence-form">\n <span class="select">\n <span class="text">Available</span>\n <select id="current-user-presence">\n <optgroup label="Available">\n <option>Available</option>\n <option>Surfing the web</option>\n <option>Reading email</option>\n </optgroup>\n <optgroup label="Away">\n <option value="xa">Away</option>\n <option value="xa">Out to lunch</option>\n <option value="xa">On the phone</option>\n <option value="xa">In a meeting</option>\n </optgroup>\n </select>\n </span>\n </form>\n </div>\n </div>\n <nav id="app-nav" class="x-fill">\n <ul id="nav-links"></ul>\n </nav>\n</header>').appendTo("body"),$('<div id="container" class="x-fill y-fill"></div>').appendTo("body"),$("#current-user-presence").change(function(e){var n;return n=$("option:selected",e.currentTarget),$("#current-user-presence-form .text").text(n.text()),t.session.sendPresence("xa"===n.val(),n.text())})},t.prototype.addButton=function(t,e){var n,i,r=this;return n="nav-link-"+t.toLowerCase(),i=$('<li>\n <a id="'+n+'" href="#/'+t.toLowerCase()+'">\n <span>'+t+"</span>\n </a>\n</li>").appendTo("#nav-links"),this.button(n,e),i.click(function(t){return r.select(t.currentTarget)})},t.prototype.select=function(t){var e,n;return t=$(t),$("#nav-links li").removeClass("selected"),$("#nav-links li a").removeClass("selected"),t.addClass("selected"),$("a",t).addClass("selected"),e=$("#nav-links svg path"),e.attr("opacity","0.6"),e.css("opacity","0.6"),n=$("svg path",t),n.attr("opacity","1.0"),n.css("opacity","1.0")},t.prototype.button=function(t,e){var n,i,r;return r=Raphael(t),n=r.path(e).attr({fill:"#fff",stroke:"#000","stroke-width":.3,opacity:.6}),i=$("#"+t),i.hover(function(){return n.animate({opacity:1},200)},function(){return i.hasClass("selected")?void 0:n.animate({opacity:.6},200)}),i.get(0)},t}()}.call(this),function(){this.Notification=function(){function t(t){this.text=t,this.draw()}return t.prototype.draw=function(){var t,e,n,i;return n=$('<div class="notification float" style="display:none;"></div>').appendTo("body"),n.text(this.text),i=n.outerHeight()/2,e=n.outerWidth()/2,n.css({marginTop:"-"+i+"px",marginLeft:"-"+e+"px"}),n.fadeIn(200),t=function(){return n.fadeOut(200,function(){return n.remove()})},setTimeout(t,1500)},t}()}.call(this),function(){this.Router=function(){function t(t){var e=this;this.pages=t,this.routes=this.build(),$(window).bind("hashchange",function(){return e.draw()})}return t.prototype.build=function(){var t,e,n,i,r,s,o,a;o=[],a=this.pages;for(r in a)i=a[r],o.push(s={args:[],page:i,re:null}),"default"!==r?(e=function(){var e,n,i,s;for(i=r.split("/"),s=[],e=0,n=i.length;n>e;e++)t=i[e],t.length>0&&s.push(t);return s}(),n=function(t){return":"===t[0]?(s.args.push(t.replace(":","")),"(/[^/]+)?"):"/"+t},s.re=new RegExp("#"+function(){var i,r,s;for(s=[],i=0,r=e.length;r>i;i++)t=e[i],s.push(n(t));return s}().join(""))):s.re=r;return o},t.prototype.draw=function(){var t,e,n,i,r,s,o,a,u,p;if(a=this.match(),r=a[0],t=a[1],r||(r=this.defaultRoute()),r){for(u=[{},0],i=u[0],e=u[1],p=r.args,s=0,o=p.length;o>s;s++)n=p[s],i[n]=t[e++];return r.page.draw(i)}},t.prototype.match=function(){var t,e,n,i,r,s,o;for(o=this.routes,r=0,s=o.length;s>r;r++)if(i=o[r],n=window.location.hash.match(i.re))return e=function(){var e,i,r,s;for(r=n.slice(1),s=[],e=0,i=r.length;i>e;e++)t=r[e],s.push(t.replace("/",""));return s}(),[i,e];return[]},t.prototype.defaultRoute=function(){var t,e,n,i;for(i=this.routes,e=0,n=i.length;n>e;e++)if(t=i[e],"default"===t.re)return t},t}()}.call(this),function(){this.Session=function(){function t(){this.xmpp=new Strophe.Connection("/xmpp"),this.roster={},this.listeners={card:[],message:[],presence:[],roster:[]}}return t.prototype.connect=function(t,e,n){var i=this;return this.xmpp.connect(t,e,function(t){switch(t){case Strophe.Status.AUTHFAIL:case Strophe.Status.CONNFAIL:return n(!1);case Strophe.Status.CONNECTED:return i.xmpp.addHandler(function(t){return i.handleIq(t)},null,"iq"),i.xmpp.addHandler(function(t){return i.handleMessage(t)},null,"message"),i.xmpp.addHandler(function(t){return i.handlePresence(t)},null,"presence"),n(!0),i.findRoster(function(){return i.notify("roster"),i.xmpp.send(i.xml("<presence/>")),i.findCards()})}})},t.prototype.disconnect=function(){return this.xmpp.disconnect()},t.prototype.onCard=function(t){return this.listeners.card.push(t)},t.prototype.onRoster=function(t){return this.listeners.roster.push(t)},t.prototype.onMessage=function(t){return this.listeners.message.push(t)},t.prototype.onPresence=function(t){return this.listeners.presence.push(t)},t.prototype.connected=function(){return this.xmpp.jid&&this.xmpp.jid.length>0},t.prototype.jid=function(){return this.xmpp.jid},t.prototype.bareJid=function(){return this.xmpp.jid.split("/")[0]},t.prototype.uniqueId=function(){return this.xmpp.getUniqueId()},t.prototype.avatar=function(t){var e;return e=this.loadCard(t),e&&e.photo?"data:"+e.photo.type+";base64,"+e.photo.binval:"/lib/images/default-user.png"},t.prototype.loadCard=function(t){var e;return t=t.split("/")[0],e=localStorage["vcard:"+t],e?JSON.parse(e):void 0},t.prototype.storeCard=function(t){return localStorage["vcard:"+t.jid]=JSON.stringify(t)},t.prototype.findCards=function(){var t,e,n,i,r=this;return n=function(){var n,i;n=this.roster,i=[];for(e in n)t=n[e],this.loadCard(e)||i.push(e);return i}.call(this),this.loadCard(this.bareJid())||n.push(this.bareJid()),i=function(t){return r.findCard(n.shift(),i),t?(r.storeCard(t),r.notify("card",t)):void 0},this.findCard(n.shift(),i)},t.prototype.findCard=function(t,e){var n;if(t)return n=this.xml('<iq id="'+this.uniqueId()+'" to="'+t+'" type="get">\n <vCard xmlns="vcard-temp"/>\n</iq>'),this.sendIQ(n,function(n){var i,r,s,o,a;return r=$("vCard",n),s=$("PHOTO",r),o=$("TYPE",s).text(),i=$("BINVAL",s).text(),s=o&&i?{type:o,binval:i.replace(/\n/g,"")}:null,a={jid:t,photo:s,retrieved:new Date},e(r.size()>0?a:null)})},t.prototype.parseRoster=function(t){return $("item",t).map(function(){return new Contact(this)}).get()},t.prototype.findRoster=function(t){var e,n=this;return e=this.xml("<iq id='"+this.uniqueId()+'\' type="get">\n <query xmlns="jabber:iq:roster"/>\n</iq>'),this.sendIQ(e,function(e){var i,r,s,o;for(r=n.parseRoster(e),s=0,o=r.length;o>s;s++)i=r[s],n.roster[i.jid]=i;return t()})},t.prototype.sendMessage=function(t,e){var n;return n=this.xml('<message id="'+this.uniqueId()+'" to="'+t+'" type="chat">\n <body></body>\n</message>'),$("body",n).text(e),this.xmpp.send(n)},t.prototype.sendPresence=function(t,e){var n;return n=$(this.xml("<presence/>")),t?(n.append($(this.xml("<show>xa</show>"))),"Away"!==e&&n.append($(this.xml("<status/>")).text(e))):"Available"!==e&&n.append($(this.xml("<status/>")).text(e)),this.xmpp.send(n)},t.prototype.sendIQ=function(t,e){return this.xmpp.sendIQ(t,e,e,5e3)},t.prototype.updateContact=function(t,e){var n,i,r,s,o;for(i=this.xml('<iq id="'+this.uniqueId()+'" type="set">\n <query xmlns="jabber:iq:roster">\n <item name="" jid="'+t.jid+'"/>\n </query>\n</iq>'),$("item",i).attr("name",t.name),o=t.groups,r=0,s=o.length;s>r;r++)n=o[r],$("item",i).append($(this.xml("<group></group>")).text(n));return this.xmpp.send(i),e?this.sendSubscribe(t.jid):void 0},t.prototype.removeContact=function(t){var e;return e=this.xml('<iq id="'+this.uniqueId()+'" type="set">\n <query xmlns="jabber:iq:roster">\n <item jid="'+t+'" subscription="remove"/>\n </query>\n</iq>'),this.xmpp.send(e)},t.prototype.sendSubscribe=function(t){return this.xmpp.send(this.presence(t,"subscribe"))},t.prototype.sendSubscribed=function(t){return this.xmpp.send(this.presence(t,"subscribed"))},t.prototype.sendUnsubscribed=function(t){return this.xmpp.send(this.presence(t,"unsubscribed"))},t.prototype.presence=function(t,e){return this.xml('<presence\n id="'+this.uniqueId()+'"\n to="'+t+'"\n type="'+e+'"/>')},t.prototype.handleIq=function(t){var e,n,i,r,s,o,a;if(t=$(t),s=t.attr("type"),i=t.find("query").attr("xmlns"),"set"===s&&"jabber:iq:roster"===i){for(n=this.parseRoster(t),o=0,a=n.length;a>o;o++)e=n[o],"remove"===e.subscription?delete this.roster[e.jid]:(r=this.roster[e.jid],r&&(e.presence=r.presence),this.roster[e.jid]=e);this.notify("roster")}return!0},t.prototype.handleMessage=function(t){var e,n,i,r,s;return t=$(t),r=t.attr("to"),n=t.attr("from"),s=t.attr("type"),i=t.find("thread").first(),e=t.find("body").first(),this.notify("message",{to:r,from:n,type:s,thread:i.text(),text:e.text(),received:new Date,node:t}),!0},t.prototype.handlePresence=function(t){var e,n,i,r,s,o,a;return t=$(t),o=t.attr("to"),n=t.attr("from"),a=t.attr("type"),r=t.find("show").first(),s=t.find("status").first(),i={to:o,from:n,status:s.text(),show:r.text(),type:a,offline:"unavailable"===a||"error"===a,away:"away"===r.text()||"xa"===r.text(),dnd:"dnd"===r.text(),node:t},e=this.roster[n.split("/")[0]],e&&e.update(i),this.notify("presence",i),!0},t.prototype.notify=function(t,e){var n,i,r,s,o;for(s=this.listeners[t]||[],o=[],i=0,r=s.length;r>i;i++)n=s[i],o.push(n(e));return o},t.prototype.xml=function(t){return $.parseXML(t).documentElement},t}()}.call(this),function(){this.Transfer=function(){function t(t){this.session=t.session,this.file=t.file,this.to=t.to,this.progress=t.progress,this.complete=t.complete,this.chunks=new e(this.file),this.opened=!1,this.closed=!1,this.sid=this.session.uniqueId(),this.seq=0,this.sent=0}var e;return t.prototype.start=function(){var t,e=this;return t=$('<iq id="'+this.session.uniqueId()+'" to="'+this.to+'" type="set">\n <si xmlns="http://jabber.org/protocol/si" id="'+this.session.uniqueId()+'" profile="http://jabber.org/protocol/si/profile/file-transfer">\n <file xmlns="http://jabber.org/protocol/si/profile/file-transfer" name="" size="'+this.file.size+'"/>\n <feature xmlns="http://jabber.org/protocol/feature-neg">\n <x xmlns="jabber:x:data" type="form">\n <field var="stream-method" type="list-single">\n <option><value>http://jabber.org/protocol/ibb</value></option>\n </field>\n </x>\n </feature>\n </si>\n</iq>'),$("file",t).attr("name",this.file.name),this.session.sendIQ(t.get(0),function(t){var n,i,r;return i=$('si feature x field[var="stream-method"] value',t),r=function(){var t,e,r;for(r=[],t=0,e=i.length;e>t;t++)n=i[t],"http://jabber.org/protocol/ibb"===$(n).text()&&r.push(!0);return r}().length>0,r?e.open():void 0})},t.prototype.open=function(){var t,e=this;return t=$('<iq id="'+this.session.uniqueId()+'" to="'+this.to+'" type="set">\n <open xmlns="http://jabber.org/protocol/ibb" sid="'+this.sid+'" block-size="4096"/>\n</iq>'),this.session.sendIQ(t.get(0),function(t){return e.ok(t)?(e.opened=!0,e.sendChunk()):void 0})},t.prototype.sendChunk=function(){var t=this;if(!this.closed)return this.chunks.chunk(function(e){var n;return e?(n=$('<iq id="'+t.session.uniqueId()+'" to="'+t.to+'" type="set">\n <data xmlns="http://jabber.org/protocol/ibb" sid="'+t.sid+'" seq="'+t.seq++ +'">'+e+"</data>\n</iq>"),t.seq>65535&&(t.seq=0),t.session.sendIQ(n.get(0),function(e){var n;if(t.ok(e))return n=Math.ceil(100*(++t.sent/t.chunks.total)),t.progress(n),t.sendChunk()})):(t.close(),void 0)})},t.prototype.close=function(){var t;if(!this.closed)return this.closed=!0,t=$('<iq id="'+this.session.uniqueId()+'" to="'+this.to+'" type="set">\n <close xmlns="http://jabber.org/protocol/ibb" sid="'+this.sid+'"/>\n</iq>'),this.session.sendIQ(t.get(0),function(){}),this.complete()},t.prototype.stop=function(){return this.opened?this.close():this.complete()},t.prototype.ok=function(t){return"result"===$(t).attr("type")},e=function(){function t(t){this.file=t,this.total=Math.ceil(this.file.size/e),this.slice=this.file.slice||this.file.webkitSlice||this.file.mozSlice,this.pos=0}var e;return e=3072,t.prototype.chunk=function(t){var n,i,r,s;return s=this.pos,i=this.pos+e,this.pos=i,s>this.file.size?t(null):(n=this.slice.call(this.file,s,i),r=new FileReader,r.onload=function(e){return t(btoa(e.target.result))},r.readAsBinaryString(n))},t}(),t}()}.call(this),function(){}.call(this);