Skip to content

Commit f17e65a

Browse files
committed
add dev structure, and move search box
1 parent a98d3f2 commit f17e65a

File tree

9 files changed

+90
-10
lines changed

9 files changed

+90
-10
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
public/uploads
22
public/system
3+
.bundle
4+
db/*.sqlite3
5+
log/*.log
6+
tmp/**/*
7+
vendor/bundle
8+
vendor/gems

app/javascripts/controllers/assets.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ window.Assets = Spine.Controller.create({
3030

3131
var message = Message.create({
3232
name: this.handle,
33-
body: "Uploading " + file.name + "...",
33+
body: "Uploading " + file.name,
3434
channel_id: this.messages.channel.id
3535
});
3636

app/javascripts/controllers/messages.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ window.MessagesItem = Spine.Controller.create({
1919
var elements = this.template(this.item);
2020
this.el.replaceWith(elements);
2121
this.el = elements;
22+
this.el.autolink();
23+
this.el.mailto();
2224
return this;
2325
},
2426

app/javascripts/controllers/searches.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ window.Searches = Spine.Controller.create({
1212
},
1313

1414
init: function(){
15-
this.input = $("#title input[type=search]");
15+
this.input = $("#sidebar input[type=search]");
1616
this.input.keyup(this.query);
1717
this.model = Search.inst();
1818
this.model.bind("change", this.render);

app/javascripts/controllers/settings.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
(function($){
2+
3+
var Channels = Spine.Controller.create({
4+
5+
})
26

37
window.Settings = Spine.Controller.create({
8+
9+
410
newChannel: function(){
511
var channelName = prompt("Channel name?");
612
if ( !channelName ) return;

app/javascripts/utils.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,18 @@ $.fn.forItem = function(item){
1313
});
1414
};
1515

16+
$.fn.autolink = function () {
17+
return this.each( function(){
18+
var re = /((http|https|ftp):\/\/[\w?=&.\/-;#~%-]+(?![\w\s?&.\/;#~%"=-]*>))/g;
19+
$(this).html( $(this).html().replace(re, '<a href="$1">$1</a> ') );
20+
});
21+
};
22+
23+
$.fn.mailto = function () {
24+
return this.each( function() {
25+
var re = /(([a-z0-9*._+]){1,}\@(([a-z0-9]+[-]?){1,}[a-z0-9]+\.){1,}([a-z]{2,4}|museum)(?![\w\s?&.\/;#~%"=-]*>))/g
26+
$(this).html( $(this).html().replace( re, '<a href="mailto:$1">$1</a>' ) );
27+
});
28+
};
29+
1630
})(jQuery);

app/stylesheets/application.less

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,21 @@ body {
132132

133133
li.current {
134134
color: #FFF;
135-
text-shadow: 0 1px 1px #46677F;
136-
137-
-webkit-box-shadow: none;
138-
-moz-box-shadow: none;
139-
135+
text-shadow: 0 -1px 1px #46677F;
140136
.vbg-gradient(#7BB5DB, #4775B8);
137+
border-bottom-color: #609FD0;
138+
139+
.inset-box-shadow(0, 2px, 2px, #4775B8);
140+
-webkit-box-shadow: inset 0 1px 1px #4775B8, inset 0 -1px 1px #3E67A3;
141141
}
142142
}
143143

144+
#sidebar input[type="search"] {
145+
font-size: 20px;
146+
margin: 15px 10px;
147+
width: 170px;
148+
}
149+
144150
#content {
145151
.box-flex(1);
146152
.vbox();

app/views/app/index.html.erb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
</head>
1616
<body>
1717
<header id="title">
18-
<h1>Holla</h1>
19-
20-
<input type="search" results="0" incremental="true" placeholder="Search">
18+
<h1>Holla</h1>
2119
</header>
2220

2321
<div id="wrapper">
@@ -31,6 +29,9 @@
3129
<li data-name="settings">Settings</li>
3230
<li data-name="profile">Profile</li>
3331
</ul>
32+
33+
<h3>Search</h3>
34+
<input type="search" results="0" incremental="true" placeholder="Search">
3435
</div>
3536

3637
<div class="vdivide"></div>

db/development_structure.sql

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
CREATE TABLE `channels` (
2+
`id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
3+
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
4+
`created_at` datetime DEFAULT NULL,
5+
`updated_at` datetime DEFAULT NULL,
6+
PRIMARY KEY (`id`)
7+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
8+
9+
CREATE TABLE `messages` (
10+
`id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
11+
`body` text COLLATE utf8_unicode_ci,
12+
`created_at` datetime DEFAULT NULL,
13+
`updated_at` datetime DEFAULT NULL,
14+
`channel_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
15+
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
16+
PRIMARY KEY (`id`)
17+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
18+
19+
CREATE TABLE `schema_migrations` (
20+
`version` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
21+
UNIQUE KEY `unique_schema_migrations` (`version`)
22+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
23+
24+
CREATE TABLE `sessions` (
25+
`id` int(11) NOT NULL AUTO_INCREMENT,
26+
`session_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
27+
`data` text COLLATE utf8_unicode_ci,
28+
`created_at` datetime DEFAULT NULL,
29+
`updated_at` datetime DEFAULT NULL,
30+
PRIMARY KEY (`id`),
31+
KEY `index_sessions_on_session_id` (`session_id`),
32+
KEY `index_sessions_on_updated_at` (`updated_at`)
33+
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
34+
35+
INSERT INTO schema_migrations (version) VALUES ('20110324001706');
36+
37+
INSERT INTO schema_migrations (version) VALUES ('20110324051348');
38+
39+
INSERT INTO schema_migrations (version) VALUES ('20110325083934');
40+
41+
INSERT INTO schema_migrations (version) VALUES ('20110325211741');
42+
43+
INSERT INTO schema_migrations (version) VALUES ('20110326065302');
44+
45+
INSERT INTO schema_migrations (version) VALUES ('20110326213742');

0 commit comments

Comments
 (0)