├── .gitignore ├── README.md ├── app ├── hello.html ├── lucky.html ├── ng-todo.html └── todo.html ├── index.html ├── sea-modules ├── angular │ └── angularjs │ │ └── 1.1.5 │ │ ├── angular-debug.js │ │ └── angular.js ├── examples │ ├── hello │ │ └── 1.0.0 │ │ │ ├── main-debug.js │ │ │ ├── main.js │ │ │ ├── style-debug.css │ │ │ └── style.css │ ├── lucky │ │ └── 1.0.0 │ │ │ ├── main-debug.js │ │ │ ├── main.js │ │ │ ├── style-debug.css │ │ │ └── style.css │ ├── ng-todo │ │ └── 1.0.0 │ │ │ ├── base-debug.css │ │ │ ├── base.css │ │ │ ├── bg.png │ │ │ ├── main-debug.js │ │ │ └── main.js │ └── todo │ │ └── 1.0.0 │ │ ├── base-debug.css │ │ ├── base.css │ │ ├── bg.png │ │ ├── main-debug.js │ │ └── main.js ├── gallery │ ├── backbone │ │ └── 1.0.0 │ │ │ ├── backbone-debug.js │ │ │ ├── backbone.js │ │ │ └── package.json │ ├── store │ │ └── 1.3.7 │ │ │ ├── package.json │ │ │ ├── store-debug.js │ │ │ └── store.js │ └── underscore │ │ └── 1.4.4 │ │ ├── package.json │ │ ├── underscore-debug.js │ │ └── underscore.js ├── jquery │ ├── easing │ │ └── 1.3.0 │ │ │ ├── easing-debug.js │ │ │ ├── easing.js │ │ │ └── package.json │ └── jquery │ │ └── 1.10.1 │ │ ├── jquery-debug.js │ │ ├── jquery.js │ │ └── package.json └── seajs │ └── seajs │ ├── 2.1.0 │ ├── package.json │ ├── sea-debug.js │ ├── sea.js │ └── sea.js.map │ ├── 2.1.1 │ ├── package.json │ ├── sea-debug.js │ ├── sea.js │ └── sea.js.map │ └── 2.2.0 │ ├── package.json │ ├── sea-debug.js │ └── sea.js └── static ├── hello ├── Makefile ├── dist │ ├── main-debug.js │ ├── main.js │ ├── style-debug.css │ └── style.css ├── package.json └── src │ ├── main.js │ ├── spinning.js │ └── style.css ├── lucky ├── Makefile ├── dist │ ├── main-debug.js │ ├── main.js │ ├── style-debug.css │ └── style.css ├── package.json └── src │ ├── data.js │ ├── lucky.js │ ├── main.js │ ├── style.css │ └── user.js ├── ng-todo ├── Makefile ├── dist │ ├── base-debug.css │ ├── base.css │ ├── bg.png │ ├── main-debug.js │ └── main.js ├── package.json └── src │ ├── base.css │ ├── bg.png │ ├── common.js │ ├── main.js │ └── service.js └── todo ├── Makefile ├── dist ├── base-debug.css ├── base.css ├── bg.png ├── main-debug.js └── main.js ├── package.json └── src ├── base.css ├── bg.png ├── collections └── todos.js ├── common.js ├── main.js ├── models └── todo.js ├── routers └── router.js ├── vendor └── backbone.localStorage.js └── views ├── app.js └── todos.js /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .ipr 3 | .iws 4 | *~ 5 | ~* 6 | *.diff 7 | *.patch 8 | *.bak 9 | .DS_Store 10 | Thumbs.db 11 | *.swp 12 | .nojekyll 13 | .project 14 | node_modules 15 | .*/ 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Examples for Sea.js 2 | 3 | 4 | 5 | 6 | How to Build 7 | ------------ 8 | 9 | First, you should install `spm` and `spm-build`: 10 | 11 | ``` 12 | $ npm install spm@2.x -g 13 | $ npm install spm-build -g 14 | ``` 15 | 16 | Then, build it: 17 | 18 | ``` 19 | $ cd static/hello 20 | $ make build 21 | $ make deploy 22 | ``` 23 | 24 | Visit for detail information. 25 | 26 | -------------------------------------------------------------------------------- /app/hello.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hello Sea.js 6 | 7 | 8 | 9 |
10 | H 11 | e 12 | l 13 | l 14 | o 15 | , 16 | S 17 | e 18 | a 19 | J 20 | S 21 |
22 | 23 | 24 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /app/lucky.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Lucky Ball 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
    13 |
14 |
    15 |
16 |
17 | 18 | 19 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /app/ng-todo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Todo 7 | 8 | 9 | 10 |
11 | 15 |
16 | 17 | 18 |
    19 |
  • 20 |
    21 | 22 | 23 | 24 |
    25 | 26 |
  • 27 |
28 |
29 |
30 | 31 | 42 | 43 |
44 |
45 |
46 |

Double-click to edit a todo

47 |

Originated by Addy Osmani

48 |

Part of TodoMVC

49 |

Modified by LinkGod in March 2013

50 |
51 | 52 | 53 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /app/todo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Todo 7 | 8 | 9 | 10 |
11 | 15 |
16 | 17 | 18 |
    19 |
    20 |
    21 |
    22 |
    23 |

    Double-click to edit a todo

    24 |

    Originated by Addy Osmani

    25 |

    Part of TodoMVC

    26 |

    Modified by LinkGod in March 2013

    27 |
    28 | 36 | 53 | 54 | 55 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Examples for Sea.js 6 | 15 | 16 | 17 |
    18 |   seajs
    19 |     `-- examples
    20 |           | -- Hello Sea.js
    21 |           | -- Lucky Ball
    22 |           | -- Angularjs Todo
    23 |           ` -- Todo
    24 | 
    25 | 26 | 27 | -------------------------------------------------------------------------------- /sea-modules/examples/hello/1.0.0/main-debug.js: -------------------------------------------------------------------------------- 1 | define("examples/hello/1.0.0/main-debug", [ "./spinning-debug", "jquery-debug" ], function(require) { 2 | var Spinning = require("./spinning-debug"); 3 | var s = new Spinning("#container"); 4 | s.render(); 5 | }); 6 | 7 | define("examples/hello/1.0.0/spinning-debug", [ "jquery-debug" ], function(require, exports, module) { 8 | var $ = require("jquery-debug"); 9 | function Spinning(container) { 10 | this.container = $(container); 11 | this.icons = this.container.children(); 12 | this.spinnings = []; 13 | } 14 | module.exports = Spinning; 15 | Spinning.prototype.render = function() { 16 | this._init(); 17 | this.container.css("background", "none"); 18 | this.icons.show(); 19 | this._spin(); 20 | }; 21 | Spinning.prototype._init = function() { 22 | var spinnings = this.spinnings; 23 | $(this.icons).each(function(n) { 24 | var startDeg = random(360); 25 | var node = $(this); 26 | var timer; 27 | node.css({ 28 | top: random(40), 29 | left: n * 50 + random(10), 30 | zIndex: 1e3 31 | }).hover(function() { 32 | node.fadeTo(250, 1).css("zIndex", 1001).css("transform", "rotate(0deg)"); 33 | }, function() { 34 | node.fadeTo(250, .6).css("zIndex", 1e3); 35 | timer && clearTimeout(timer); 36 | timer = setTimeout(spin, Math.ceil(random(1e4))); 37 | }); 38 | function spin() { 39 | node.css("transform", "rotate(" + startDeg + "deg)"); 40 | } 41 | spinnings[n] = spin; 42 | }); 43 | return this; 44 | }; 45 | Spinning.prototype._spin = function() { 46 | $(this.spinnings).each(function(i, fn) { 47 | setTimeout(fn, Math.ceil(random(3e3))); 48 | }); 49 | return this; 50 | }; 51 | function random(x) { 52 | return Math.random() * x; 53 | } 54 | }); 55 | -------------------------------------------------------------------------------- /sea-modules/examples/hello/1.0.0/main.js: -------------------------------------------------------------------------------- 1 | define("examples/hello/1.0.0/main",["./spinning","jquery"],function(a){var b=a("./spinning"),c=new b("#container");c.render()}),define("examples/hello/1.0.0/spinning",["jquery"],function(a,b,c){function d(a){this.container=f(a),this.icons=this.container.children(),this.spinnings=[]}function e(a){return Math.random()*a}var f=a("jquery");c.exports=d,d.prototype.render=function(){this._init(),this.container.css("background","none"),this.icons.show(),this._spin()},d.prototype._init=function(){var a=this.spinnings;return f(this.icons).each(function(b){function c(){h.css("transform","rotate("+g+"deg)")}var d,g=e(360),h=f(this);h.css({top:e(40),left:50*b+e(10),zIndex:1e3}).hover(function(){h.fadeTo(250,1).css("zIndex",1001).css("transform","rotate(0deg)")},function(){h.fadeTo(250,.6).css("zIndex",1e3),d&&clearTimeout(d),d=setTimeout(c,Math.ceil(e(1e4)))}),a[b]=c}),this},d.prototype._spin=function(){return f(this.spinnings).each(function(a,b){setTimeout(b,Math.ceil(e(3e3)))}),this}}); 2 | -------------------------------------------------------------------------------- /sea-modules/examples/hello/1.0.0/style-debug.css: -------------------------------------------------------------------------------- 1 | /*! define examples/hello/1.0.0/style-debug.css */ 2 | html, body, div, span, h1, h2, h3, h4, p, img, strong, ol, ul, li { 3 | margin: 0; 4 | padding: 0; 5 | border: 0; 6 | font-size: 100%; 7 | vertical-align: baseline; 8 | background: transparent; 9 | } 10 | 11 | body { 12 | background: #F4F4F4; 13 | } 14 | 15 | #container { 16 | position: relative; 17 | margin: 40px 120px; 18 | background: url(https://a248.e.akamai.net/assets.github.com/images/spinners/octocat-spinner-32.gif) no-repeat; 19 | min-height: 32px; 20 | } 21 | 22 | #container img { 23 | position: absolute; 24 | cursor: pointer; 25 | opacity: .6; 26 | display: none; 27 | 28 | -webkit-transition-property: -webkit-transform; 29 | -moz-transition-property: -moz-transform; 30 | -o-transition-property: -o-transform; 31 | transition-property: transform; 32 | -webkit-transition-duration: 0.8s; 33 | -moz-transition-duration: 0.8s; 34 | -o-transition-duration: 0.8s; 35 | transition-duration: 0.8s; 36 | } 37 | -------------------------------------------------------------------------------- /sea-modules/examples/hello/1.0.0/style.css: -------------------------------------------------------------------------------- 1 | html,body,div,span,h1,h2,h3,h4,p,img,strong,ol,ul,li{margin:0;padding:0;border:0;font-size:100%;vertical-align:baseline;background:transparent}body{background:#F4F4F4}#container{position:relative;margin:40px 120px;background:url(https://a248.e.akamai.net/assets.github.com/images/spinners/octocat-spinner-32.gif) no-repeat;min-height:32px}#container img{position:absolute;cursor:pointer;opacity:.6;display:none;-webkit-transition-property:-webkit-transform;-moz-transition-property:-moz-transform;-o-transition-property:-o-transform;transition-property:transform;-webkit-transition-duration:.8s;-moz-transition-duration:.8s;-o-transition-duration:.8s;transition-duration:.8s} 2 | -------------------------------------------------------------------------------- /sea-modules/examples/lucky/1.0.0/main.js: -------------------------------------------------------------------------------- 1 | document.attachEvent&&alert("这个例子不支持 Old IE 哦"),define("examples/lucky/1.0.0/main",["./data","./lucky","jquery","jquery-easing","./user"],function(a){var b=a("./data"),c=a("./lucky");c.init(b)}),define("examples/lucky/1.0.0/data",[],["梓胥","李磊","俊义","兰玉","泥巴","对剑","希普","牧木","夏雩","衡芜","钝刀","苍新","琳心","玉鼎","冯衡","伍举","长松","卫海","伯川","道潜","丁勉","竹棒","妙才","许由","祢衡","赵盾","斗子文","寇恂","极天","秦天","裴秀","花朝","静俭","墨颜","王维","马武","公孙龙","甘德","流珠","路悠","樽空","沐峰","清筠","绝伦","星辰","羽单","伯兮","郝思文","聂壹","南岸","明恽","君乾","飞天","文赢","义均","文和","曹彬","晁错","兔葵","苏星河","太常","北湖","弘殷","吕蒙","颜良","庄辛","崇幻","贝儿","柏平","小毛","战尘","子盛","问柏","湛然","独慕","浴尘","公与","桑美","晏婴","严成方","连挚","汪信之","楚天","良臣","暮城","塔石","薇达","行洋","明何","昔空","蓝玉","韩当","丛英","吞佛","真岚","仲文","吕方","郑天寿","一恒","誉少","无竞","九弦","玉伯","冒顿","啸生","尹曰","臻儿","籽沐","余化","玉郎","右丞","默哈","血诺","桐杰","镜曦","沉鱼","贯高","陆辉","浩初","天材","偏右","云谦","乔花","展新","张初尘","宫煌","宗玄","一正","若夷","普渡","晴汐","徒离","仲景","大禹","徐盛","木合","郭淮","方嘉","李渔","长皓","渔樵","惜年","沧溟","东隅","海涛","磻溪"]),define("examples/lucky/1.0.0/lucky",["jquery","jquery-easing","examples/lucky/1.0.0/user"],function(a,b,c){function d(a,b){return Math.sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y))}function e(a,b){return d(a,b)<=(a.width+b.width)/2}function f(a,b){var c=b.y-a.y,e=b.x-a.x,f=d(a,b),g=Math.ceil(((a.width+b.width)/2-f)/j),h=c>0?Math.ceil(g*c/f):Math.floor(g*c/f),i=e>0?Math.ceil(g*e/f):Math.floor(g*e/f);a.lucky?(b._xMove+=2*i,b._yMove+=2*h):b.lucky?(a._xMove+=-2*i,a._yMove+=-2*h):(a._yMove+=-1*h,b._yMove+=h,a._xMove+=-1*i,b._xMove+=i)}var g=a("jquery");a("jquery-easing");var h=a("examples/lucky/1.0.0/user"),i=100,j=4;c.exports={users:[],init:function(a){g("#container").css("background","none"),this.data=a,this.users=a.map(function(b){return new h(b,a[b])}),this._bindUI()},_bindUI:function(){function a(){"start"===c.getAttribute("data-action")?(c.setAttribute("data-action","stop"),c.innerHTML=c.getAttribute("data-text-stop"),b.start()):(c.setAttribute("data-action","start"),c.innerHTML=c.getAttribute("data-text-start"),b.stop())}var b=this,c=document.querySelector("#go");c.innerHTML=c.getAttribute("data-text-start"),c.addEventListener("click",a,!1),g("#lucky-balls").on("click","li",function(a){var d=g(a.target),e=d.text();b.addItem(e),"start"===c.getAttribute("data-action")&&b.hit(),d.remove()}),g("#balls").on("click","li",function(a){for(var d=g(a.target),e=d.text(),f=0;f0&&(this.timer&&clearTimeout(this.timer),this.timer=setTimeout(function(){a.hit()},i))}}}),define("examples/lucky/1.0.0/user",["jquery"],function(a,b,c){function d(a,b){this.name=a,this.options=b||{},this.el=null,this.width=0,this.height=0,this.left=0,this.top=0,this.x=0,this.y=0,this.moving=!1,this.lucky=!1,this.createEl(),this.move()}function e(a,b){return a=a||0,b=b||1,Math.floor(Math.random()*(b-a+1)+a)}var f=a("jquery"),g=500,h=900,i=40,j=40,k=120,l=120,m=100,n=100,o=500,p=500;c.exports=d,d.prototype.createEl=function(){this.el=f("
  • "+this.name+"
  • ").appendTo("#balls"),this.width=this.el.width(),this.height=this.el.height()},d.prototype.move=function(a){this.left=e(0,h-this.width),this.top=e(0,g-this.height),this.zIndex=e(0,m),this.reflow(a)},d.prototype.reflow=function(a,b){this.x=this.left+this.width/2,this.y=this.top+this.height/2,this.el[0].style.zIndex=this.zIndex,b?(this.el[0].style.left=this.left,this.el[0].style.top=this.top):this.el.animate({left:this.left,top:this.top},e(n,o),"easeOutBack",a)},d.prototype.start=function(){this.reset(),this.moving=!0,this.autoMove()},d.prototype.reset=function(){this.el.stop(!0,!0),this.lucky=!1,this.el[0].className="",this.el[0].style.width=i+"px",this.el[0].style.height=j+"px",this.width=this.el.width(),this.height=this.el.height(),this._maxTop=g-this.height,this._maxLeft=h-this.width},d.prototype.autoMove=function(){var a=this;this.moving&&this.move(function(){a.autoMove()})},d.prototype.stop=function(){this.el.stop(!0,!0),this.moving=!1},d.prototype.bang=function(){this.lucky=!0,this.el[0].className="selected",this.width=k,this.height=l,this.left=(h-this.width)/2,this.top=(g-this.height)/2,this.el.animate({left:this.left,top:this.top,width:this.width,height:this.height},p)},d.prototype.beginHit=function(){this._xMove=0,this._yMove=0},d.prototype.hitMove=function(){this.left+=this._xMove,this.top+=this._yMove,this.top=this.top<0?0:this.top>this._maxTop?this._maxTop:this.top,this.left=this.left<0?0:this.left>this._maxLeft?this._maxLeft:this.left,this.reflow(null,!1)}}); 2 | -------------------------------------------------------------------------------- /sea-modules/examples/lucky/1.0.0/style-debug.css: -------------------------------------------------------------------------------- 1 | /*! define examples/lucky/1.0.0/style-debug.css */ 2 | body { 3 | font: 20px "Hiragino Sans GB", sans-serif; 4 | background: #eee; 5 | } 6 | 7 | ul li { 8 | list-style: none; 9 | } 10 | 11 | #container { 12 | width: 900px; 13 | margin: 10px auto; 14 | position: relative; 15 | background: url(https://a248.e.akamai.net/assets.github.com/images/spinners/octocat-spinner-32.gif) no-repeat 45% 25%; 16 | } 17 | 18 | #balls { 19 | padding: 0; 20 | margin: 0; 21 | list-style: none; 22 | height: 500px; 23 | } 24 | 25 | #balls li, 26 | #lucky-balls li { 27 | position: absolute; 28 | left: 420px; 29 | top: 470px; 30 | padding: 0; 31 | width: 40px; 32 | height: 40px; 33 | overflow: hidden; 34 | font-size: 12px; 35 | background: #333; 36 | color: #ddd; 37 | opacity: .5; 38 | text-align: center; 39 | line-height: 43px; 40 | border-radius: 30px; 41 | word-break: keep-all; 42 | cursor: pointer; 43 | } 44 | 45 | #go { 46 | width: 200px; 47 | height: 50px; 48 | display: block; 49 | margin: 0 auto; 50 | font-size: 22px; 51 | border: none; 52 | background: none; 53 | color: #999; 54 | } 55 | 56 | #balls li.selected { 57 | color: #fff; 58 | background: #f60; 59 | font-size: 40px; 60 | height: 200px; 61 | width: 200px; 62 | line-height: 128px; 63 | border-radius: 100px; 64 | -webkit-transition: 0.3s ease-in; 65 | -webkit-transition-property: width, height, font; 66 | z-index: 100; 67 | } 68 | 69 | #lucky-balls { 70 | padding: 20px; 71 | margin: 10px 0; 72 | list-style: none; 73 | } 74 | 75 | #lucky-balls li { 76 | position: relative; 77 | left: auto !important; 78 | top: auto !important; 79 | width: 40px !important; 80 | height: 40px !important; 81 | float: left; 82 | margin: 5px 10px; 83 | font-weight: bold; 84 | color: #fff; 85 | background: #f60; 86 | } 87 | -------------------------------------------------------------------------------- /sea-modules/examples/lucky/1.0.0/style.css: -------------------------------------------------------------------------------- 1 | body{font:20px "Hiragino Sans GB",sans-serif;background:#eee}ul li{list-style:none}#container{width:900px;margin:10px auto;position:relative;background:url(https://a248.e.akamai.net/assets.github.com/images/spinners/octocat-spinner-32.gif) no-repeat 45% 25%}#balls{padding:0;margin:0;list-style:none;height:500px}#balls li,#lucky-balls li{position:absolute;left:420px;top:470px;padding:0;width:40px;height:40px;overflow:hidden;font-size:12px;background:#333;color:#ddd;opacity:.5;text-align:center;line-height:43px;border-radius:30px;word-break:keep-all;cursor:pointer}#go{width:200px;height:50px;display:block;margin:0 auto;font-size:22px;border:0;background:0 0;color:#999}#balls li.selected{color:#fff;background:#f60;font-size:40px;height:200px;width:200px;line-height:128px;border-radius:100px;-webkit-transition:.3s ease-in;-webkit-transition-property:width,height,font;z-index:100}#lucky-balls{padding:20px;margin:10px 0;list-style:none}#lucky-balls li{position:relative;left:auto!important;top:auto!important;width:40px!important;height:40px!important;float:left;margin:5px 10px;font-weight:700;color:#fff;background:#f60} 2 | -------------------------------------------------------------------------------- /sea-modules/examples/ng-todo/1.0.0/base-debug.css: -------------------------------------------------------------------------------- 1 | /*! define examples/ng-todo/1.0.0/base-debug.css */ 2 | html, 3 | body { 4 | margin: 0; 5 | padding: 0; 6 | } 7 | 8 | button { 9 | margin: 0; 10 | padding: 0; 11 | border: 0; 12 | background: none; 13 | font-size: 100%; 14 | vertical-align: baseline; 15 | font-family: inherit; 16 | color: inherit; 17 | -webkit-appearance: none; 18 | /*-moz-appearance: none;*/ 19 | -ms-appearance: none; 20 | -o-appearance: none; 21 | appearance: none; 22 | } 23 | 24 | body { 25 | font: 14px 'Helvetica Neue', Helvetica, Arial, sans-serif; 26 | line-height: 1.4em; 27 | background: #eaeaea url('bg.png'); 28 | color: #4d4d4d; 29 | width: 550px; 30 | margin: 0 auto; 31 | -webkit-font-smoothing: antialiased; 32 | -moz-font-smoothing: antialiased; 33 | -ms-font-smoothing: antialiased; 34 | -o-font-smoothing: antialiased; 35 | font-smoothing: antialiased; 36 | } 37 | 38 | #todoapp { 39 | background: #fff; 40 | background: rgba(255, 255, 255, 0.9); 41 | margin: 130px 0 40px 0; 42 | border: 1px solid #ccc; 43 | position: relative; 44 | border-top-left-radius: 2px; 45 | border-top-right-radius: 2px; 46 | box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.2), 47 | 0 25px 50px 0 rgba(0, 0, 0, 0.15); 48 | } 49 | 50 | #todoapp:before { 51 | content: ''; 52 | border-left: 1px solid #f5d6d6; 53 | border-right: 1px solid #f5d6d6; 54 | width: 2px; 55 | position: absolute; 56 | top: 0; 57 | left: 40px; 58 | height: 100%; 59 | } 60 | 61 | #todoapp input::-webkit-input-placeholder { 62 | font-style: italic; 63 | } 64 | 65 | #todoapp input:-moz-placeholder { 66 | font-style: italic; 67 | color: #a9a9a9; 68 | } 69 | 70 | #todoapp h1 { 71 | position: absolute; 72 | top: -120px; 73 | width: 100%; 74 | font-size: 70px; 75 | font-weight: bold; 76 | text-align: center; 77 | color: #b3b3b3; 78 | color: rgba(255, 255, 255, 0.3); 79 | text-shadow: -1px -1px rgba(0, 0, 0, 0.2); 80 | -webkit-text-rendering: optimizeLegibility; 81 | -moz-text-rendering: optimizeLegibility; 82 | -ms-text-rendering: optimizeLegibility; 83 | -o-text-rendering: optimizeLegibility; 84 | text-rendering: optimizeLegibility; 85 | } 86 | 87 | #header { 88 | padding-top: 15px; 89 | border-radius: inherit; 90 | } 91 | 92 | #header:before { 93 | content: ''; 94 | position: absolute; 95 | top: 0; 96 | right: 0; 97 | left: 0; 98 | height: 15px; 99 | z-index: 2; 100 | border-bottom: 1px solid #6c615c; 101 | background: #8d7d77; 102 | background: -webkit-gradient(linear, left top, left bottom, from(rgba(132, 110, 100, 0.8)),to(rgba(101, 84, 76, 0.8))); 103 | background: -webkit-linear-gradient(top, rgba(132, 110, 100, 0.8), rgba(101, 84, 76, 0.8)); 104 | background: -moz-linear-gradient(top, rgba(132, 110, 100, 0.8), rgba(101, 84, 76, 0.8)); 105 | background: -o-linear-gradient(top, rgba(132, 110, 100, 0.8), rgba(101, 84, 76, 0.8)); 106 | background: -ms-linear-gradient(top, rgba(132, 110, 100, 0.8), rgba(101, 84, 76, 0.8)); 107 | background: linear-gradient(top, rgba(132, 110, 100, 0.8), rgba(101, 84, 76, 0.8)); 108 | filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#9d8b83', EndColorStr='#847670'); 109 | border-top-left-radius: 1px; 110 | border-top-right-radius: 1px; 111 | } 112 | 113 | #new-todo, 114 | .edit { 115 | position: relative; 116 | margin: 0; 117 | width: 100%; 118 | font-size: 24px; 119 | font-family: inherit; 120 | line-height: 1.4em; 121 | border: 0; 122 | outline: none; 123 | color: inherit; 124 | padding: 6px; 125 | border: 1px solid #999; 126 | box-shadow: inset 0 -1px 5px 0 rgba(0, 0, 0, 0.2); 127 | -webkit-box-sizing: border-box; 128 | -moz-box-sizing: border-box; 129 | -ms-box-sizing: border-box; 130 | -o-box-sizing: border-box; 131 | box-sizing: border-box; 132 | -webkit-font-smoothing: antialiased; 133 | -moz-font-smoothing: antialiased; 134 | -ms-font-smoothing: antialiased; 135 | -o-font-smoothing: antialiased; 136 | font-smoothing: antialiased; 137 | } 138 | 139 | #new-todo { 140 | padding: 16px 16px 16px 60px; 141 | border: none; 142 | background: rgba(0, 0, 0, 0.02); 143 | z-index: 2; 144 | box-shadow: none; 145 | } 146 | 147 | #main { 148 | position: relative; 149 | z-index: 2; 150 | border-top: 1px dotted #adadad; 151 | } 152 | 153 | label[for='toggle-all'] { 154 | display: none; 155 | } 156 | 157 | #toggle-all { 158 | position: absolute; 159 | top: -42px; 160 | left: -4px; 161 | width: 40px; 162 | text-align: center; 163 | border: none; /* Mobile Safari */ 164 | } 165 | 166 | #toggle-all:before { 167 | content: '»'; 168 | font-size: 28px; 169 | color: #d9d9d9; 170 | padding: 0 25px 7px; 171 | } 172 | 173 | #toggle-all:checked:before { 174 | color: #737373; 175 | } 176 | 177 | #todo-list { 178 | margin: 0; 179 | padding: 0; 180 | list-style: none; 181 | } 182 | 183 | #todo-list li { 184 | position: relative; 185 | font-size: 24px; 186 | border-bottom: 1px dotted #ccc; 187 | } 188 | 189 | #todo-list li:last-child { 190 | border-bottom: none; 191 | } 192 | 193 | #todo-list li.editing { 194 | border-bottom: none; 195 | padding: 0; 196 | } 197 | 198 | #todo-list li.editing .edit { 199 | display: block; 200 | width: 506px; 201 | padding: 13px 17px 12px 17px; 202 | margin: 0 0 0 43px; 203 | } 204 | 205 | #todo-list li.editing .view { 206 | display: none; 207 | } 208 | 209 | #todo-list li .toggle { 210 | text-align: center; 211 | width: 40px; 212 | /* auto, since non-WebKit browsers doesn't support input styling */ 213 | height: auto; 214 | position: absolute; 215 | top: 0; 216 | bottom: 0; 217 | margin: auto 0; 218 | border: none; /* Mobile Safari */ 219 | -webkit-appearance: none; 220 | /*-moz-appearance: none;*/ 221 | -ms-appearance: none; 222 | -o-appearance: none; 223 | appearance: none; 224 | } 225 | 226 | #todo-list li .toggle:after { 227 | content: '✔'; 228 | line-height: 43px; /* 40 + a couple of pixels visual adjustment */ 229 | font-size: 20px; 230 | color: #d9d9d9; 231 | text-shadow: 0 -1px 0 #bfbfbf; 232 | } 233 | 234 | #todo-list li .toggle:checked:after { 235 | color: #85ada7; 236 | text-shadow: 0 1px 0 #669991; 237 | bottom: 1px; 238 | position: relative; 239 | } 240 | 241 | #todo-list li label { 242 | word-break: break-word; 243 | padding: 15px; 244 | margin-left: 45px; 245 | display: block; 246 | line-height: 1.2; 247 | -webkit-transition: color 0.4s; 248 | -moz-transition: color 0.4s; 249 | -ms-transition: color 0.4s; 250 | -o-transition: color 0.4s; 251 | transition: color 0.4s; 252 | } 253 | 254 | #todo-list li.completed label { 255 | color: #a9a9a9; 256 | text-decoration: line-through; 257 | } 258 | 259 | #todo-list li .destroy { 260 | display: none; 261 | position: absolute; 262 | top: 0; 263 | right: 10px; 264 | bottom: 0; 265 | width: 40px; 266 | height: 40px; 267 | margin: auto 0; 268 | font-size: 22px; 269 | color: #a88a8a; 270 | -webkit-transition: all 0.2s; 271 | -moz-transition: all 0.2s; 272 | -ms-transition: all 0.2s; 273 | -o-transition: all 0.2s; 274 | transition: all 0.2s; 275 | } 276 | 277 | #todo-list li .destroy:hover { 278 | text-shadow: 0 0 1px #000, 279 | 0 0 10px rgba(199, 107, 107, 0.8); 280 | -webkit-transform: scale(1.3); 281 | -moz-transform: scale(1.3); 282 | -ms-transform: scale(1.3); 283 | -o-transform: scale(1.3); 284 | transform: scale(1.3); 285 | } 286 | 287 | #todo-list li .destroy:after { 288 | content: '✖'; 289 | } 290 | 291 | #todo-list li:hover .destroy { 292 | display: block; 293 | } 294 | 295 | #todo-list li .edit { 296 | display: none; 297 | } 298 | 299 | #todo-list li.editing:last-child { 300 | margin-bottom: -1px; 301 | } 302 | 303 | #footer { 304 | color: #777; 305 | padding: 0 15px; 306 | position: absolute; 307 | right: 0; 308 | bottom: -31px; 309 | left: 0; 310 | height: 20px; 311 | z-index: 1; 312 | text-align: center; 313 | } 314 | 315 | #footer:before { 316 | content: ''; 317 | position: absolute; 318 | right: 0; 319 | bottom: 31px; 320 | left: 0; 321 | height: 50px; 322 | z-index: -1; 323 | box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3), 324 | 0 6px 0 -3px rgba(255, 255, 255, 0.8), 325 | 0 7px 1px -3px rgba(0, 0, 0, 0.3), 326 | 0 43px 0 -6px rgba(255, 255, 255, 0.8), 327 | 0 44px 2px -6px rgba(0, 0, 0, 0.2); 328 | } 329 | 330 | #todo-count { 331 | float: left; 332 | text-align: left; 333 | } 334 | 335 | #filters { 336 | margin: 0; 337 | padding: 0; 338 | list-style: none; 339 | position: absolute; 340 | right: 0; 341 | left: 0; 342 | } 343 | 344 | #filters li { 345 | display: inline; 346 | } 347 | 348 | #filters li a { 349 | color: #83756f; 350 | margin: 2px; 351 | text-decoration: none; 352 | } 353 | 354 | #filters li a.selected { 355 | font-weight: bold; 356 | } 357 | 358 | #clear-completed { 359 | float: right; 360 | position: relative; 361 | line-height: 20px; 362 | text-decoration: none; 363 | background: rgba(0, 0, 0, 0.1); 364 | font-size: 11px; 365 | padding: 0 10px; 366 | border-radius: 3px; 367 | box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.2); 368 | } 369 | 370 | #clear-completed:hover { 371 | background: rgba(0, 0, 0, 0.15); 372 | box-shadow: 0 -1px 0 0 rgba(0, 0, 0, 0.3); 373 | } 374 | 375 | #info { 376 | margin: 65px auto 0; 377 | color: #a6a6a6; 378 | font-size: 12px; 379 | text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7); 380 | text-align: center; 381 | } 382 | 383 | #info a { 384 | color: inherit; 385 | } 386 | 387 | /* 388 | Hack to remove background from Mobile Safari. 389 | Can't use it globally since it destroys checkboxes in Firefox and Opera 390 | */ 391 | @media screen and (-webkit-min-device-pixel-ratio:0) { 392 | #toggle-all, 393 | #todo-list li .toggle { 394 | background: none; 395 | } 396 | 397 | #todo-list li .toggle { 398 | height: 40px; 399 | } 400 | 401 | #toggle-all { 402 | top: -56px; 403 | left: -15px; 404 | width: 65px; 405 | height: 41px; 406 | -webkit-transform: rotate(90deg); 407 | transform: rotate(90deg); 408 | -webkit-appearance: none; 409 | appearance: none; 410 | } 411 | } 412 | -------------------------------------------------------------------------------- /sea-modules/examples/ng-todo/1.0.0/base.css: -------------------------------------------------------------------------------- 1 | html,body{margin:0;padding:0}button{margin:0;padding:0;border:0;background:0;font-size:100%;vertical-align:baseline;font-family:inherit;color:inherit;-webkit-appearance:none;-ms-appearance:none;-o-appearance:none;appearance:none}body{font:14px 'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:1.4em;background:#eaeaea url(bg.png);color:#4d4d4d;width:550px;margin:0 auto;-webkit-font-smoothing:antialiased;-moz-font-smoothing:antialiased;-ms-font-smoothing:antialiased;-o-font-smoothing:antialiased;font-smoothing:antialiased}#todoapp{background:#fff;background:rgba(255,255,255,.9);margin:130px 0 40px;border:1px solid #ccc;position:relative;border-top-left-radius:2px;border-top-right-radius:2px;box-shadow:0 2px 6px 0 rgba(0,0,0,.2),0 25px 50px 0 rgba(0,0,0,.15)}#todoapp:before{content:'';border-left:1px solid #f5d6d6;border-right:1px solid #f5d6d6;width:2px;position:absolute;top:0;left:40px;height:100%}#todoapp input::-webkit-input-placeholder{font-style:italic}#todoapp input:-moz-placeholder{font-style:italic;color:#a9a9a9}#todoapp h1{position:absolute;top:-120px;width:100%;font-size:70px;font-weight:700;text-align:center;color:#b3b3b3;color:rgba(255,255,255,.3);text-shadow:-1px -1px rgba(0,0,0,.2);-webkit-text-rendering:optimizeLegibility;-moz-text-rendering:optimizeLegibility;-ms-text-rendering:optimizeLegibility;-o-text-rendering:optimizeLegibility;text-rendering:optimizeLegibility}#header{padding-top:15px;border-radius:inherit}#header:before{content:'';position:absolute;top:0;right:0;left:0;height:15px;z-index:2;border-bottom:1px solid #6c615c;background:#8d7d77;background:-webkit-gradient(linear,left top,left bottom,from(rgba(132,110,100,.8)),to(rgba(101,84,76,.8)));background:-webkit-linear-gradient(top,rgba(132,110,100,.8),rgba(101,84,76,.8));background:-moz-linear-gradient(top,rgba(132,110,100,.8),rgba(101,84,76,.8));background:-o-linear-gradient(top,rgba(132,110,100,.8),rgba(101,84,76,.8));background:-ms-linear-gradient(top,rgba(132,110,100,.8),rgba(101,84,76,.8));background:linear-gradient(top,rgba(132,110,100,.8),rgba(101,84,76,.8));filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, StartColorStr='#9d8b83', EndColorStr='#847670');border-top-left-radius:1px;border-top-right-radius:1px}#new-todo,.edit{position:relative;margin:0;width:100%;font-size:24px;font-family:inherit;line-height:1.4em;border:0;outline:0;color:inherit;padding:6px;border:1px solid #999;box-shadow:inset 0 -1px 5px 0 rgba(0,0,0,.2);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box;-webkit-font-smoothing:antialiased;-moz-font-smoothing:antialiased;-ms-font-smoothing:antialiased;-o-font-smoothing:antialiased;font-smoothing:antialiased}#new-todo{padding:16px 16px 16px 60px;border:0;background:rgba(0,0,0,.02);z-index:2;box-shadow:none}#main{position:relative;z-index:2;border-top:1px dotted #adadad}label[for=toggle-all]{display:none}#toggle-all{position:absolute;top:-42px;left:-4px;width:40px;text-align:center;border:0}#toggle-all:before{content:'»';font-size:28px;color:#d9d9d9;padding:0 25px 7px}#toggle-all:checked:before{color:#737373}#todo-list{margin:0;padding:0;list-style:none}#todo-list li{position:relative;font-size:24px;border-bottom:1px dotted #ccc}#todo-list li:last-child{border-bottom:0}#todo-list li.editing{border-bottom:0;padding:0}#todo-list li.editing .edit{display:block;width:506px;padding:13px 17px 12px;margin:0 0 0 43px}#todo-list li.editing .view{display:none}#todo-list li .toggle{text-align:center;width:40px;height:auto;position:absolute;top:0;bottom:0;margin:auto 0;border:0;-webkit-appearance:none;-ms-appearance:none;-o-appearance:none;appearance:none}#todo-list li .toggle:after{content:'✔';line-height:43px;font-size:20px;color:#d9d9d9;text-shadow:0 -1px 0 #bfbfbf}#todo-list li .toggle:checked:after{color:#85ada7;text-shadow:0 1px 0 #669991;bottom:1px;position:relative}#todo-list li label{word-break:break-word;padding:15px;margin-left:45px;display:block;line-height:1.2;-webkit-transition:color .4s;-moz-transition:color .4s;-ms-transition:color .4s;-o-transition:color .4s;transition:color .4s}#todo-list li.completed label{color:#a9a9a9;text-decoration:line-through}#todo-list li .destroy{display:none;position:absolute;top:0;right:10px;bottom:0;width:40px;height:40px;margin:auto 0;font-size:22px;color:#a88a8a;-webkit-transition:all .2s;-moz-transition:all .2s;-ms-transition:all .2s;-o-transition:all .2s;transition:all .2s}#todo-list li .destroy:hover{text-shadow:0 0 1px #000,0 0 10px rgba(199,107,107,.8);-webkit-transform:scale(1.3);-moz-transform:scale(1.3);-ms-transform:scale(1.3);-o-transform:scale(1.3);transform:scale(1.3)}#todo-list li .destroy:after{content:'✖'}#todo-list li:hover .destroy{display:block}#todo-list li .edit{display:none}#todo-list li.editing:last-child{margin-bottom:-1px}#footer{color:#777;padding:0 15px;position:absolute;right:0;bottom:-31px;left:0;height:20px;z-index:1;text-align:center}#footer:before{content:'';position:absolute;right:0;bottom:31px;left:0;height:50px;z-index:-1;box-shadow:0 1px 1px rgba(0,0,0,.3),0 6px 0 -3px rgba(255,255,255,.8),0 7px 1px -3px rgba(0,0,0,.3),0 43px 0 -6px rgba(255,255,255,.8),0 44px 2px -6px rgba(0,0,0,.2)}#todo-count{float:left;text-align:left}#filters{margin:0;padding:0;list-style:none;position:absolute;right:0;left:0}#filters li{display:inline}#filters li a{color:#83756f;margin:2px;text-decoration:none}#filters li a.selected{font-weight:700}#clear-completed{float:right;position:relative;line-height:20px;text-decoration:none;background:rgba(0,0,0,.1);font-size:11px;padding:0 10px;border-radius:3px;box-shadow:0 -1px 0 0 rgba(0,0,0,.2)}#clear-completed:hover{background:rgba(0,0,0,.15);box-shadow:0 -1px 0 0 rgba(0,0,0,.3)}#info{margin:65px auto 0;color:#a6a6a6;font-size:12px;text-shadow:0 1px 0 rgba(255,255,255,.7);text-align:center}#info a{color:inherit}@media screen and (-webkit-min-device-pixel-ratio:0){#toggle-all,#todo-list li .toggle{background:0}#todo-list li .toggle{height:40px}#toggle-all{top:-56px;left:-15px;width:65px;height:41px;-webkit-transform:rotate(90deg);transform:rotate(90deg);-webkit-appearance:none;appearance:none}} 2 | -------------------------------------------------------------------------------- /sea-modules/examples/ng-todo/1.0.0/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seajs/examples/7444afe379971df0eebeeedfa8178f4cc21c7748/sea-modules/examples/ng-todo/1.0.0/bg.png -------------------------------------------------------------------------------- /sea-modules/examples/ng-todo/1.0.0/main-debug.js: -------------------------------------------------------------------------------- 1 | define("examples/ng-todo/1.0.0/main-debug", [ "angularjs-debug", "./common-debug", "./service-debug", "store-debug" ], function(require) { 2 | var angular = require("angularjs-debug"); 3 | var common = require("./common-debug"); 4 | var todoService = require("./service-debug"); 5 | var todo = angular.module("TodoApp", []); 6 | todo.service("todoService", todoService); 7 | //TDDO Angular master code has been implemented 8 | todo.directive("ngBlur", function() { 9 | return function(scope, elem, attrs) { 10 | elem.bind("blur", function() { 11 | scope.$apply(attrs.ngBlur); 12 | }); 13 | }; 14 | }); 15 | todo.controller("MainCtrl", [ "$scope", "todoService", function($scope, todoService) { 16 | $scope.todoService = todoService; 17 | $scope.title = "todo"; 18 | $scope.todos = todoService.getTodos(); 19 | $scope.newTodo = ""; 20 | $scope.activeFilter = { 21 | completed: "" 22 | }; 23 | $scope.remaining = 0; 24 | $scope.hidden = false; 25 | $scope.toggleAll = function(e) { 26 | this.hidden = !this.hidden; 27 | }; 28 | $scope.createOnEnter = function(e) { 29 | if (e.which !== common.ENTER_KEY || !this.newTodo.trim()) { 30 | return; 31 | } 32 | this.todoService.addTodo(this.newTodo); 33 | this.newTodo = ""; 34 | }; 35 | $scope.$watch("todos", function() { 36 | var remaining = 0; 37 | $scope.todos.forEach(function(todo) { 38 | if (!todo.completed) { 39 | remaining++; 40 | } 41 | }); 42 | $scope.remaining = remaining; 43 | $scope.completed = $scope.todos.length - remaining; 44 | $scope.todoService.store(); 45 | }, true); 46 | $scope.filter = function(val) { 47 | this.activeFilter.completed = val; 48 | }; 49 | $scope.selected = function(val) { 50 | return val === $scope.activeFilter.completed; 51 | }; 52 | $scope.getTodos = function() { 53 | return todoService.getTodos(this.activeFilter); 54 | }; 55 | $scope.edit = function(todo, event) { 56 | todo.edit = true; 57 | // TODO ? 58 | setTimeout(function() { 59 | angular.element(event.target).parent().next()[0].focus(); 60 | }, 0); 61 | }; 62 | $scope.close = function(todo) { 63 | todo.edit = false; 64 | }; 65 | } ]); 66 | return { 67 | init: function() { 68 | angular.bootstrap(document.body, [ "TodoApp" ]); 69 | } 70 | }; 71 | }); 72 | 73 | define("examples/ng-todo/1.0.0/common-debug", [], { 74 | // Which filter are we using? 75 | TodoFilter: "", 76 | // empty, active, completed 77 | // What is the enter key constant? 78 | ENTER_KEY: 13 79 | }); 80 | 81 | define("examples/ng-todo/1.0.0/service-debug", [ "store-debug" ], function(require, exports, module) { 82 | var store = require("store-debug"); 83 | module.exports = function() { 84 | var todos = []; 85 | if (store.enabled) { 86 | console.log("localStorage is available"); 87 | todos = store.get("todos") || store.set("todos", todos); 88 | } 89 | return { 90 | getTodos: function(filter) { 91 | if (filter) { 92 | return todos.filter(function(todo) { 93 | if (filter.completed === "") return true; 94 | return todo.completed === filter.completed; 95 | }); 96 | } else { 97 | return todos; 98 | } 99 | }, 100 | addTodo: function(todo) { 101 | todos.push({ 102 | title: todo, 103 | completed: false 104 | }); 105 | }, 106 | delTodo: function(index) { 107 | todos.splice(index, 1); 108 | }, 109 | clearCompleted: function() { 110 | for (var i = todos.length - 1; i > -1; i--) { 111 | if (todos[i].completed) { 112 | this.delTodo(i); 113 | } 114 | } 115 | }, 116 | store: function() { 117 | store.set("todos", todos); 118 | } 119 | }; 120 | }; 121 | }); 122 | -------------------------------------------------------------------------------- /sea-modules/examples/ng-todo/1.0.0/main.js: -------------------------------------------------------------------------------- 1 | define("examples/ng-todo/1.0.0/main",["angularjs","./common","./service","store"],function(a){var b=a("angularjs"),c=a("./common"),d=a("./service"),e=b.module("TodoApp",[]);return e.service("todoService",d),e.directive("ngBlur",function(){return function(a,b,c){b.bind("blur",function(){a.$apply(c.ngBlur)})}}),e.controller("MainCtrl",["$scope","todoService",function(a,d){a.todoService=d,a.title="todo",a.todos=d.getTodos(),a.newTodo="",a.activeFilter={completed:""},a.remaining=0,a.hidden=!1,a.toggleAll=function(){this.hidden=!this.hidden},a.createOnEnter=function(a){a.which===c.ENTER_KEY&&this.newTodo.trim()&&(this.todoService.addTodo(this.newTodo),this.newTodo="")},a.$watch("todos",function(){var b=0;a.todos.forEach(function(a){a.completed||b++}),a.remaining=b,a.completed=a.todos.length-b,a.todoService.store()},!0),a.filter=function(a){this.activeFilter.completed=a},a.selected=function(b){return b===a.activeFilter.completed},a.getTodos=function(){return d.getTodos(this.activeFilter)},a.edit=function(a,c){a.edit=!0,setTimeout(function(){b.element(c.target).parent().next()[0].focus()},0)},a.close=function(a){a.edit=!1}}]),{init:function(){b.bootstrap(document.body,["TodoApp"])}}}),define("examples/ng-todo/1.0.0/common",[],{TodoFilter:"",ENTER_KEY:13}),define("examples/ng-todo/1.0.0/service",["store"],function(a,b,c){var d=a("store");c.exports=function(){var a=[];return d.enabled&&(console.log("localStorage is available"),a=d.get("todos")||d.set("todos",a)),{getTodos:function(b){return b?a.filter(function(a){return""===b.completed?!0:a.completed===b.completed}):a},addTodo:function(b){a.push({title:b,completed:!1})},delTodo:function(b){a.splice(b,1)},clearCompleted:function(){for(var b=a.length-1;b>-1;b--)a[b].completed&&this.delTodo(b)},store:function(){d.set("todos",a)}}}}); 2 | -------------------------------------------------------------------------------- /sea-modules/examples/todo/1.0.0/base.css: -------------------------------------------------------------------------------- 1 | html,body{margin:0;padding:0}button{margin:0;padding:0;border:0;background:0;font-size:100%;vertical-align:baseline;font-family:inherit;color:inherit;-webkit-appearance:none;-ms-appearance:none;-o-appearance:none;appearance:none}body{font:14px 'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:1.4em;background:#eaeaea url(bg.png);color:#4d4d4d;width:550px;margin:0 auto;-webkit-font-smoothing:antialiased;-moz-font-smoothing:antialiased;-ms-font-smoothing:antialiased;-o-font-smoothing:antialiased;font-smoothing:antialiased}#todoapp{background:#fff;background:rgba(255,255,255,.9);margin:130px 0 40px;border:1px solid #ccc;position:relative;border-top-left-radius:2px;border-top-right-radius:2px;box-shadow:0 2px 6px 0 rgba(0,0,0,.2),0 25px 50px 0 rgba(0,0,0,.15)}#todoapp:before{content:'';border-left:1px solid #f5d6d6;border-right:1px solid #f5d6d6;width:2px;position:absolute;top:0;left:40px;height:100%}#todoapp input::-webkit-input-placeholder{font-style:italic}#todoapp input:-moz-placeholder{font-style:italic;color:#a9a9a9}#todoapp h1{position:absolute;top:-120px;width:100%;font-size:70px;font-weight:700;text-align:center;color:#b3b3b3;color:rgba(255,255,255,.3);text-shadow:-1px -1px rgba(0,0,0,.2);-webkit-text-rendering:optimizeLegibility;-moz-text-rendering:optimizeLegibility;-ms-text-rendering:optimizeLegibility;-o-text-rendering:optimizeLegibility;text-rendering:optimizeLegibility}#header{padding-top:15px;border-radius:inherit}#header:before{content:'';position:absolute;top:0;right:0;left:0;height:15px;z-index:2;border-bottom:1px solid #6c615c;background:#8d7d77;background:-webkit-gradient(linear,left top,left bottom,from(rgba(132,110,100,.8)),to(rgba(101,84,76,.8)));background:-webkit-linear-gradient(top,rgba(132,110,100,.8),rgba(101,84,76,.8));background:-moz-linear-gradient(top,rgba(132,110,100,.8),rgba(101,84,76,.8));background:-o-linear-gradient(top,rgba(132,110,100,.8),rgba(101,84,76,.8));background:-ms-linear-gradient(top,rgba(132,110,100,.8),rgba(101,84,76,.8));background:linear-gradient(top,rgba(132,110,100,.8),rgba(101,84,76,.8));filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, StartColorStr='#9d8b83', EndColorStr='#847670');border-top-left-radius:1px;border-top-right-radius:1px}#new-todo,.edit{position:relative;margin:0;width:100%;font-size:24px;font-family:inherit;line-height:1.4em;border:0;outline:0;color:inherit;padding:6px;border:1px solid #999;box-shadow:inset 0 -1px 5px 0 rgba(0,0,0,.2);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box;-webkit-font-smoothing:antialiased;-moz-font-smoothing:antialiased;-ms-font-smoothing:antialiased;-o-font-smoothing:antialiased;font-smoothing:antialiased}#new-todo{padding:16px 16px 16px 60px;border:0;background:rgba(0,0,0,.02);z-index:2;box-shadow:none}#main{position:relative;z-index:2;border-top:1px dotted #adadad}label[for=toggle-all]{display:none}#toggle-all{position:absolute;top:-42px;left:-4px;width:40px;text-align:center;border:0}#toggle-all:before{content:'»';font-size:28px;color:#d9d9d9;padding:0 25px 7px}#toggle-all:checked:before{color:#737373}#todo-list{margin:0;padding:0;list-style:none}#todo-list li{position:relative;font-size:24px;border-bottom:1px dotted #ccc}#todo-list li:last-child{border-bottom:0}#todo-list li.editing{border-bottom:0;padding:0}#todo-list li.editing .edit{display:block;width:506px;padding:13px 17px 12px;margin:0 0 0 43px}#todo-list li.editing .view{display:none}#todo-list li .toggle{text-align:center;width:40px;height:auto;position:absolute;top:0;bottom:0;margin:auto 0;border:0;-webkit-appearance:none;-ms-appearance:none;-o-appearance:none;appearance:none}#todo-list li .toggle:after{content:'✔';line-height:43px;font-size:20px;color:#d9d9d9;text-shadow:0 -1px 0 #bfbfbf}#todo-list li .toggle:checked:after{color:#85ada7;text-shadow:0 1px 0 #669991;bottom:1px;position:relative}#todo-list li label{word-break:break-word;padding:15px;margin-left:45px;display:block;line-height:1.2;-webkit-transition:color .4s;-moz-transition:color .4s;-ms-transition:color .4s;-o-transition:color .4s;transition:color .4s}#todo-list li.completed label{color:#a9a9a9;text-decoration:line-through}#todo-list li .destroy{display:none;position:absolute;top:0;right:10px;bottom:0;width:40px;height:40px;margin:auto 0;font-size:22px;color:#a88a8a;-webkit-transition:all .2s;-moz-transition:all .2s;-ms-transition:all .2s;-o-transition:all .2s;transition:all .2s}#todo-list li .destroy:hover{text-shadow:0 0 1px #000,0 0 10px rgba(199,107,107,.8);-webkit-transform:scale(1.3);-moz-transform:scale(1.3);-ms-transform:scale(1.3);-o-transform:scale(1.3);transform:scale(1.3)}#todo-list li .destroy:after{content:'✖'}#todo-list li:hover .destroy{display:block}#todo-list li .edit{display:none}#todo-list li.editing:last-child{margin-bottom:-1px}#footer{color:#777;padding:0 15px;position:absolute;right:0;bottom:-31px;left:0;height:20px;z-index:1;text-align:center}#footer:before{content:'';position:absolute;right:0;bottom:31px;left:0;height:50px;z-index:-1;box-shadow:0 1px 1px rgba(0,0,0,.3),0 6px 0 -3px rgba(255,255,255,.8),0 7px 1px -3px rgba(0,0,0,.3),0 43px 0 -6px rgba(255,255,255,.8),0 44px 2px -6px rgba(0,0,0,.2)}#todo-count{float:left;text-align:left}#filters{margin:0;padding:0;list-style:none;position:absolute;right:0;left:0}#filters li{display:inline}#filters li a{color:#83756f;margin:2px;text-decoration:none}#filters li a.selected{font-weight:700}#clear-completed{float:right;position:relative;line-height:20px;text-decoration:none;background:rgba(0,0,0,.1);font-size:11px;padding:0 10px;border-radius:3px;box-shadow:0 -1px 0 0 rgba(0,0,0,.2)}#clear-completed:hover{background:rgba(0,0,0,.15);box-shadow:0 -1px 0 0 rgba(0,0,0,.3)}#info{margin:65px auto 0;color:#a6a6a6;font-size:12px;text-shadow:0 1px 0 rgba(255,255,255,.7);text-align:center}#info a{color:inherit}@media screen and (-webkit-min-device-pixel-ratio:0){#toggle-all,#todo-list li .toggle{background:0}#todo-list li .toggle{height:40px}#toggle-all{top:-56px;left:-15px;width:65px;height:41px;-webkit-transform:rotate(90deg);transform:rotate(90deg);-webkit-appearance:none;appearance:none}}.hidden{display:none} 2 | -------------------------------------------------------------------------------- /sea-modules/examples/todo/1.0.0/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seajs/examples/7444afe379971df0eebeeedfa8178f4cc21c7748/sea-modules/examples/todo/1.0.0/bg.png -------------------------------------------------------------------------------- /sea-modules/examples/todo/1.0.0/main.js: -------------------------------------------------------------------------------- 1 | define("examples/todo/1.0.0/main",["backbone","./views/app","$","underscore","./views/todos","./common","./collections/todos","./vendor/backbone.localStorage","./models/todo","./routers/router"],function(a){var b=a("backbone"),c=a("./views/app"),d=a("./routers/router");new d,b.history.start(),new c}),define("examples/todo/1.0.0/views/app",["$","underscore","backbone","examples/todo/1.0.0/views/todos","examples/todo/1.0.0/common","examples/todo/1.0.0/collections/todos","examples/todo/1.0.0/models/todo"],function(a,b,c){var d,e,f,g,h,i=a("$"),j=a("underscore");d=a("backbone"),e=a("examples/todo/1.0.0/views/todos"),f=a("examples/todo/1.0.0/collections/todos"),g=a("examples/todo/1.0.0/common"),h=d.View.extend({el:"#todoapp",statsTemplate:j.template(i("#stats-template").html()),events:{"keypress #new-todo":"createOnEnter","click #clear-completed":"clearCompleted","click #toggle-all":"toggleAllComplete"},initialize:function(){this.allCheckbox=this.$("#toggle-all")[0],this.$input=this.$("#new-todo"),this.$footer=this.$("#footer"),this.$main=this.$("#main"),this.listenTo(f,"add",this.addOne),this.listenTo(f,"reset",this.addAll),this.listenTo(f,"change:completed",this.filterOne),this.listenTo(f,"filter",this.filterAll),this.listenTo(f,"all",this.render),f.fetch()},render:function(){var a=f.completed().length,b=f.remaining().length;f.length?(this.$main.show(),this.$footer.show(),this.$footer.html(this.statsTemplate({completed:a,remaining:b})),this.$("#filters li a").removeClass("selected").filter('[href="#/'+(g.TodoFilter||"")+'"]').addClass("selected")):(this.$main.hide(),this.$footer.hide()),this.allCheckbox.checked=!b},addOne:function(a){var b=new e({model:a});i("#todo-list").append(b.render().el)},addAll:function(){this.$("#todo-list").html(""),f.each(this.addOne,this)},filterOne:function(a){a.trigger("visible")},filterAll:function(){f.each(this.filterOne,this)},newAttributes:function(){return{title:this.$input.val().trim(),order:f.nextOrder(),completed:!1}},createOnEnter:function(a){a.which===g.ENTER_KEY&&this.$input.val().trim()&&(f.create(this.newAttributes()),this.$input.val(""))},clearCompleted:function(){return j.invoke(f.completed(),"destroy"),!1},toggleAllComplete:function(){var a=this.allCheckbox.checked;f.each(function(b){b.save({completed:a})})}}),c.exports=h}),define("examples/todo/1.0.0/views/todos",["backbone","examples/todo/1.0.0/common","$","underscore"],function(a,b,c){var d,e,f;d=a("backbone"),e=a("examples/todo/1.0.0/common");var g=a("$"),h=a("underscore");f=d.View.extend({tagName:"li",template:h.template(g("#item-template").html()),events:{"click .toggle":"toggleCompleted","dblclick label":"edit","click .destroy":"clear","keypress .edit":"updateOnEnter","blur .edit":"close"},initialize:function(){this.listenTo(this.model,"change",this.render),this.listenTo(this.model,"destroy",this.remove),this.listenTo(this.model,"visible",this.toggleVisible)},render:function(){return this.$el.html(this.template(this.model.toJSON())),this.$el.toggleClass("completed",this.model.get("completed")),this.toggleVisible(),this.$input=this.$(".edit"),this},toggleVisible:function(){this.$el.toggleClass("hidden",this.isHidden())},isHidden:function(){{this.model.get("completed")}},toggleCompleted:function(){this.model.toggle()},edit:function(){this.$el.addClass("editing"),this.$input.focus()},close:function(){var a=this.$input.val().trim();a?this.model.save({title:a}):this.clear(),this.$el.removeClass("editing")},updateOnEnter:function(a){a.which===e.ENTER_KEY&&this.close()},clear:function(){this.model.destroy()}}),c.exports=f}),define("examples/todo/1.0.0/common",[],{TodoFilter:"",ENTER_KEY:13}),define("examples/todo/1.0.0/collections/todos",["backbone","$","underscore","examples/todo/1.0.0/models/todo"],function(a,b,c){var d,e,f;d=a("backbone"),a("examples/todo/1.0.0/vendor/backbone.localStorage"),a("$"),a("underscore"),e=a("examples/todo/1.0.0/models/todo"),f=d.Collection.extend({model:e,localStorage:new d.LocalStorage("todos-backbone"),completed:function(){return this.filter(function(a){return a.get("completed")})},remaining:function(){return this.without.apply(this,this.completed())},nextOrder:function(){return this.length?this.last().get("order")+1:1},comparator:function(a){return a.get("order")}}),c.exports=new f}),define("examples/todo/1.0.0/vendor/backbone.localStorage",["underscore","$","backbone"],function(a){function b(){return(0|65536*(1+Math.random())).toString(16).substring(1)}function c(){return b()+b()+"-"+b()+"-"+b()+"-"+b()+"-"+b()+b()+b()}var d=a("underscore"),e=a("$"),f=a("backbone");return f.LocalStorage=window.Store=function(a){this.name=a;var b=this.localStorage().getItem(this.name);this.records=b&&b.split(",")||[]},d.extend(f.LocalStorage.prototype,{save:function(){this.localStorage().setItem(this.name,this.records.join(","))},create:function(a){return a.id||(a.id=c(),a.set(a.idAttribute,a.id)),this.localStorage().setItem(this.name+"-"+a.id,JSON.stringify(a)),this.records.push(a.id.toString()),this.save(),this.find(a)},update:function(a){return this.localStorage().setItem(this.name+"-"+a.id,JSON.stringify(a)),d.include(this.records,a.id.toString())||this.records.push(a.id.toString()),this.save(),this.find(a)},find:function(a){return this.jsonData(this.localStorage().getItem(this.name+"-"+a.id))},findAll:function(){return d(this.records).chain().map(function(a){return this.jsonData(this.localStorage().getItem(this.name+"-"+a))},this).compact().value()},destroy:function(a){return a.isNew()?!1:(this.localStorage().removeItem(this.name+"-"+a.id),this.records=d.reject(this.records,function(b){return b===a.id.toString()}),this.save(),a)},localStorage:function(){return localStorage},jsonData:function(a){return a&&JSON.parse(a)}}),f.LocalStorage.sync=window.Store.sync=f.localSync=function(a,b,c){var d,g,h=b.localStorage||b.collection.localStorage,i=e.Deferred&&e.Deferred();try{switch(a){case"read":d=void 0!=b.id?h.find(b):h.findAll();break;case"create":d=h.create(b);break;case"update":d=h.update(b);break;case"delete":d=h.destroy(b)}}catch(j){g=j.code===DOMException.QUOTA_EXCEEDED_ERR&&0===window.localStorage.length?"Private browsing is unsupported":j.message}return d?(c&&c.success&&("0.9.10"===f.VERSION?c.success(b,d,c):c.success(d)),i&&i.resolve(d)):(g=g?g:"Record Not Found",c&&c.error&&("0.9.10"===f.VERSION?c.error(b,g,c):c.error(g)),i&&i.reject(g)),c&&c.complete&&c.complete(d),i&&i.promise()},f.ajaxSync=f.sync,f.getSyncMethod=function(a){return a.localStorage||a.collection&&a.collection.localStorage?f.localSync:f.ajaxSync},f.sync=function(a,b,c){return f.getSyncMethod(b).apply(this,[a,b,c])},f.LocalStorage}),define("examples/todo/1.0.0/models/todo",["backbone"],function(a,b,c){var d=a("backbone"),e=d.Model.extend({defaults:{title:"",completed:!1},toggle:function(){this.save({completed:!this.get("completed")})}});c.exports=e}),define("examples/todo/1.0.0/routers/router",["backbone","examples/todo/1.0.0/collections/todos","$","underscore","examples/todo/1.0.0/models/todo","examples/todo/1.0.0/common"],function(a,b,c){var d,e,f,g;d=a("backbone"),f=a("examples/todo/1.0.0/collections/todos"),g=a("examples/todo/1.0.0/common"),e=d.Router.extend({routes:{"*filter":"setFilter"},setFilter:function(a){g.TodoFilter=a&&a.trim()||"",f.trigger("filter")}}),c.exports=e}); 2 | -------------------------------------------------------------------------------- /sea-modules/gallery/backbone/1.0.0/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "family": "gallery", 3 | "name": "backbone", 4 | "version": "1.0.0", 5 | "description": "Give your JS App some Backbone with Models, Views, Collections, and Events.", 6 | "homepage": "http://backbonejs.org", 7 | "keywords": ["model", "view", "controller", "router", "server", "client", "browser"], 8 | "author": "Jeremy Ashkenas ", 9 | "package": "https://raw.github.com/documentcloud/backbone/master/package.json", 10 | "spm": { 11 | "alias": { 12 | "$": "$", 13 | "underscore": "gallery/underscore/1.4.4/underscore" 14 | }, 15 | "output": ["backbone.js"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /sea-modules/gallery/store/1.3.7/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "store", 3 | "family": "gallery", 4 | "version": "1.3.7", 5 | "package": "https://raw.github.com/marcuswestin/store.js/master/package.json", 6 | "description": "A localStorage wrapper for all browsers without using cookies or flash. Uses localStorage, globalStorage, and userData behavior under the hood", 7 | "homepage": "https://github.com/marcuswestin/store.js", 8 | "author": "Marcus Westin (http://marcuswest.in)", 9 | "contributors": [ 10 | "Matt Pizzimenti (http://mjpizz.com)", 11 | "Long Ouyang (https://github.com/longouyang)", 12 | "Paul Irish (http://paulirish.com)", 13 | "Guillermo Rauch (https://github.com/guille)", 14 | "whitmer (https://github.com/whitmer)", 15 | "Steven Black (https://github.com/StevenBlack)", 16 | "Marcus Tucker (https://github.com/MarcusJT)", 17 | "Leonid Bugaev (https://github.com/buger)", 18 | "Per Eckerdal (https://github.com/pereckerdal)", 19 | "Fredrik Blomqvist (https://github.com/blq)" 20 | ], 21 | "repository": { 22 | "type": "git", 23 | "url": "https://github.com/marcuswestin/store.js" 24 | }, 25 | "bugs": { 26 | "url": "http://github.com/marcuswestin/store.js/issues" 27 | }, 28 | "engines": { 29 | "browser": "*", 30 | "node": "*" 31 | }, 32 | "licenses": [ 33 | { 34 | "type": "MIT", 35 | "url": "https://raw.github.com/marcuswestin/store.js/master/store.js" 36 | } 37 | ], 38 | "spm": { 39 | "output": [ 40 | "store.js" 41 | ] 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /sea-modules/gallery/store/1.3.7/store-debug.js: -------------------------------------------------------------------------------- 1 | define("gallery/store/1.3.7/store-debug", [], function(require, exports, module) { 2 | (function() { 3 | var store = {}, win = window, doc = win.document, localStorageName = "localStorage", namespace = "__storejs__", storage; 4 | store.disabled = false; 5 | store.set = function(key, value) {}; 6 | store.get = function(key) {}; 7 | store.remove = function(key) {}; 8 | store.clear = function() {}; 9 | store.transact = function(key, defaultVal, transactionFn) { 10 | var val = store.get(key); 11 | if (transactionFn == null) { 12 | transactionFn = defaultVal; 13 | defaultVal = null; 14 | } 15 | if (typeof val == "undefined") { 16 | val = defaultVal || {}; 17 | } 18 | transactionFn(val); 19 | store.set(key, val); 20 | }; 21 | store.getAll = function() {}; 22 | store.serialize = function(value) { 23 | return JSON.stringify(value); 24 | }; 25 | store.deserialize = function(value) { 26 | if (typeof value != "string") { 27 | return undefined; 28 | } 29 | try { 30 | return JSON.parse(value); 31 | } catch (e) { 32 | return value || undefined; 33 | } 34 | }; 35 | // Functions to encapsulate questionable FireFox 3.6.13 behavior 36 | // when about.config::dom.storage.enabled === false 37 | // See https://github.com/marcuswestin/store.js/issues#issue/13 38 | function isLocalStorageNameSupported() { 39 | try { 40 | return localStorageName in win && win[localStorageName]; 41 | } catch (err) { 42 | return false; 43 | } 44 | } 45 | if (isLocalStorageNameSupported()) { 46 | storage = win[localStorageName]; 47 | store.set = function(key, val) { 48 | if (val === undefined) { 49 | return store.remove(key); 50 | } 51 | storage.setItem(key, store.serialize(val)); 52 | return val; 53 | }; 54 | store.get = function(key) { 55 | return store.deserialize(storage.getItem(key)); 56 | }; 57 | store.remove = function(key) { 58 | storage.removeItem(key); 59 | }; 60 | store.clear = function() { 61 | storage.clear(); 62 | }; 63 | store.getAll = function() { 64 | var ret = {}; 65 | for (var i = 0; i < storage.length; ++i) { 66 | var key = storage.key(i); 67 | ret[key] = store.get(key); 68 | } 69 | return ret; 70 | }; 71 | } else if (doc.documentElement.addBehavior) { 72 | var storageOwner, storageContainer; 73 | // Since #userData storage applies only to specific paths, we need to 74 | // somehow link our data to a specific path. We choose /favicon.ico 75 | // as a pretty safe option, since all browsers already make a request to 76 | // this URL anyway and being a 404 will not hurt us here. We wrap an 77 | // iframe pointing to the favicon in an ActiveXObject(htmlfile) object 78 | // (see: http://msdn.microsoft.com/en-us/library/aa752574(v=VS.85).aspx) 79 | // since the iframe access rules appear to allow direct access and 80 | // manipulation of the document element, even for a 404 page. This 81 | // document can be used instead of the current document (which would 82 | // have been limited to the current path) to perform #userData storage. 83 | try { 84 | storageContainer = new ActiveXObject("htmlfile"); 85 | storageContainer.open(); 86 | storageContainer.write("document.w=window