tres 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +2 -4
- data/VERSION +1 -1
- data/javascripts/backbone-min.js +37 -37
- data/javascripts/jquery-1.9.0.min.js +4 -0
- data/javascripts/tres.coffee +5 -13
- data/lib/tres/app.rb +10 -6
- data/sass/tres/base.scss +18 -6
- metadata +3 -14
- data/examples/anagen/anagen.coffee +0 -61
- data/examples/anagen/anagen.css +0 -1413
- data/examples/anagen/anagen.js +0 -182
- data/examples/anagen/anagen.scss +0 -20
- data/examples/anagen/backbone-min.js +0 -38
- data/examples/anagen/index.html +0 -50
- data/examples/anagen/jquery-1.8.0.min.js +0 -2
- data/examples/anagen/templates.coffee +0 -6
- data/examples/anagen/templates.js +0 -13
- data/examples/anagen/tres.js +0 -375
- data/examples/anagen/underscore-min.js +0 -32
- data/javascripts/jquery-1.8.3.min.js +0 -2
data/sass/tres/base.scss
CHANGED
@@ -67,7 +67,7 @@ body {
|
|
67
67
|
bottom : 0;
|
68
68
|
left : 0;
|
69
69
|
opacity : 0;
|
70
|
-
overflow
|
70
|
+
overflow-y : auto;
|
71
71
|
pointer-events : none;
|
72
72
|
|
73
73
|
&.current {
|
@@ -122,16 +122,28 @@ body {
|
|
122
122
|
|
123
123
|
// ---
|
124
124
|
|
125
|
-
//
|
125
|
+
// Footers
|
126
126
|
|
127
|
-
.screen >
|
127
|
+
.screen > footer {
|
128
128
|
position: fixed;
|
129
|
-
top: 0;
|
130
|
-
right: 0;
|
131
129
|
bottom: 0;
|
130
|
+
right : 0;
|
132
131
|
left: 0;
|
133
|
-
overflow:
|
132
|
+
overflow: hidden
|
133
|
+
}
|
134
|
+
|
135
|
+
// ---
|
136
|
+
|
137
|
+
// Screen content
|
138
|
+
|
139
|
+
.screen > .content {
|
134
140
|
-webkit-overflow-scrolling: touch;
|
141
|
+
position : fixed;
|
142
|
+
top : 0;
|
143
|
+
right : 0;
|
144
|
+
bottom : 0;
|
145
|
+
left : 0;
|
146
|
+
overflow-y : auto;
|
135
147
|
}
|
136
148
|
|
137
149
|
// ---
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tres
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-03-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: listen
|
@@ -236,23 +236,12 @@ files:
|
|
236
236
|
- Rakefile
|
237
237
|
- VERSION
|
238
238
|
- bin/tres
|
239
|
-
- examples/anagen/anagen.coffee
|
240
|
-
- examples/anagen/anagen.css
|
241
|
-
- examples/anagen/anagen.js
|
242
|
-
- examples/anagen/anagen.scss
|
243
|
-
- examples/anagen/backbone-min.js
|
244
|
-
- examples/anagen/index.html
|
245
|
-
- examples/anagen/jquery-1.8.0.min.js
|
246
|
-
- examples/anagen/templates.coffee
|
247
|
-
- examples/anagen/templates.js
|
248
|
-
- examples/anagen/tres.js
|
249
|
-
- examples/anagen/underscore-min.js
|
250
239
|
- font/fontawesome-webfont.eot
|
251
240
|
- font/fontawesome-webfont.svg
|
252
241
|
- font/fontawesome-webfont.ttf
|
253
242
|
- font/fontawesome-webfont.woff
|
254
243
|
- javascripts/backbone-min.js
|
255
|
-
- javascripts/jquery-1.
|
244
|
+
- javascripts/jquery-1.9.0.min.js
|
256
245
|
- javascripts/tres.coffee
|
257
246
|
- javascripts/underscore-min.js
|
258
247
|
- lib/ext/.filemethods.rb.swp
|
@@ -1,61 +0,0 @@
|
|
1
|
-
URLs =
|
2
|
-
page : (name) -> "http://en.wikipedia.org/w/api.php?action=parse&page=#{name}&format=json&prop=text|displaytitle|sections|revid&mobileformat=html"
|
3
|
-
search : (query) -> "http://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=#{query}&format=json&srlimit=10&srprop="
|
4
|
-
|
5
|
-
class Article extends Backbone.Model
|
6
|
-
retrieve : (page, callback) ->
|
7
|
-
$.ajax
|
8
|
-
url : URLs.page(page)
|
9
|
-
dataType : 'jsonp'
|
10
|
-
data : { page : page }
|
11
|
-
success : (response) =>
|
12
|
-
@set(response.parse) unless response.error?
|
13
|
-
callback() if _.isFunction(callback)
|
14
|
-
|
15
|
-
class Suggestion extends Backbone.Model
|
16
|
-
class Suggestions extends Backbone.Collection
|
17
|
-
model : Suggestion
|
18
|
-
url : URLs.search
|
19
|
-
parse : (response) ->
|
20
|
-
response.query.search
|
21
|
-
search : (query) ->
|
22
|
-
@fetch(dataType : 'jsonp', url : URLs.search(query))
|
23
|
-
|
24
|
-
class Home extends Tres.Screen
|
25
|
-
id : 'home'
|
26
|
-
template : JST['home']
|
27
|
-
submit : (event) ->
|
28
|
-
event.preventDefault()
|
29
|
-
form = new Tres.Form(@$el.find('form'))
|
30
|
-
Tres.Router.navigate "search/#{encodeURI(form.attributes().query)}", true
|
31
|
-
|
32
|
-
class Search extends Tres.Screen
|
33
|
-
id : 'search'
|
34
|
-
template : JST['search']
|
35
|
-
active : (query) ->
|
36
|
-
@title(query)
|
37
|
-
@list ?= new Tres.List(
|
38
|
-
collection : App.Suggestions
|
39
|
-
el : @$el.find('ul')
|
40
|
-
entry : { template : JST['result'], url : -> "article/#{@model.attributes.title}" }
|
41
|
-
)
|
42
|
-
App.Suggestions.search query
|
43
|
-
|
44
|
-
class Reader extends Tres.Screen
|
45
|
-
id : 'show-article'
|
46
|
-
template : JST['article']
|
47
|
-
active : (name) ->
|
48
|
-
@title(name)
|
49
|
-
@model.retrieve name, => @render()
|
50
|
-
|
51
|
-
$ ->
|
52
|
-
window.App = new Tres.App
|
53
|
-
App.Suggestions = new Suggestions
|
54
|
-
App.Reader = new Reader(model : new Article)
|
55
|
-
|
56
|
-
App.on
|
57
|
-
'' : new Home
|
58
|
-
'search/:query' : new Search
|
59
|
-
'article/:title' : App.Reader
|
60
|
-
|
61
|
-
App.boot(root : '/anagen/')
|