Permalink
Browse files

Fixes a few misc bugs caused by event handlers that wern't preventing…

… default actions. Also fixes some misc css issues
  • Loading branch information...
1 parent 307e068 commit f14179555cb74d2c5084af3f8da29b254abe652c @crgwbr committed Apr 12, 2012
@@ -24,8 +24,10 @@ body {
@include reset;
}
-article, article *, a, a:hover, a:visited, a:active {
- @include body();
+article{
+ a, a:hover, a:visited, a:active {
+ @include body();
+ }
}
h1, h2, h3, h4, h5, h6 {
@@ -34,6 +36,13 @@ h1, h2, h3, h4, h5, h6 {
margin: 20px 0 0 0;
}
+h1 { font-size: 2.2em; }
+h2 { font-size: 2.0em; }
+h3 { font-size: 1.8em; }
+h4 { font-size: 1.6em; }
+h5 { font-size: 1.4em; }
+h6 { font-size: 1.2em; }
+
p {
margin: 0 0 20px 0;
}
@@ -108,7 +108,6 @@ class Detail extends Flakey.controllers.Controller
delete_file: (event) =>
event.preventDefault()
- event.preventDefault()
ui.confirm('There be Monsters!', 'Are you sure you want to delete this annotation?').show (ok) =>
if ok
id = $(event.target).attr('data-id')
@@ -50,6 +50,7 @@ class History extends Flakey.controllers.Controller
doc.rollback(doc.versions[version_index].version_id)
update: (event) =>
+ event.preventDefault()
version_index = $('#version-input').val()
doc = Document.get(@query_params.id)
time = new Date(doc.versions[version_index].time)
@@ -38,6 +38,7 @@ class List extends Flakey.controllers.Controller
window.location.hash = "#/new?" + (if @query_params.q? then Flakey.util.querystring.build({title: @query_params.q}) else "")
select_doc: (event) ->
+ event.preventDefault()
id = $(event.currentTarget).attr('id').replace('document-', '')
window.location.hash = "#/detail?" + Flakey.util.querystring.build({id: id})
@@ -13,8 +13,14 @@ class NewDocument extends Flakey.controllers.Controller
@class_name = "new_document view"
@actions = {
+ # Normal Actions
'click .new.save': 'save'
'click .new.discard': 'discard'
+ # Keyboard shortcuts
+ 'keyup esc #new-editor': 'discard'
+ 'keyup esc': 'discard'
+ 'keyup ctrl+s #new-editor': 'save'
+ 'keyup ctrl+s': 'save'
}
super(config)
@@ -36,7 +42,8 @@ class NewDocument extends Flakey.controllers.Controller
$('#new-editor').blur()
$('#name').focus()
- save: (params) =>
+ save: (event) =>
+ event.preventDefault()
name = $('#name').val()
text = $('#new-editor').val()
if name.length > 0 and text.length > 0
@@ -49,7 +56,8 @@ class NewDocument extends Flakey.controllers.Controller
ui.info('Everything\'s Shiny Capt\'n!', "\"#{ doc.name }\" was successfully saved.").hide(settings.growl_hide_after).effect(settings.growl_effect)
window.location.hash = "#/detail?" + Flakey.util.querystring.build({id: doc.id})
- discard: (params) =>
+ discard: (event) =>
+ event.preventDefault()
ui.confirm('There be Monsters!', 'Careful there Captain; are you sure you want to discard this document?').show (ok) ->
if ok
window.location.hash = "#/list"
@@ -498,7 +498,7 @@ body {
margin: 0 0 0 0;
padding: 0 0 0 0; }
-article, article *, a, a:hover, a:visited, a:active {
+article a, article a:hover, article a:visited, article a:active {
font-family: Courier, monospace;
font-size: 16px;
line-height: 1.5; }
@@ -509,6 +509,24 @@ h1, h2, h3, h4, h5, h6 {
line-height: 1;
margin: 20px 0 0 0; }
+h1 {
+ font-size: 2.2em; }
+
+h2 {
+ font-size: 2.0em; }
+
+h3 {
+ font-size: 1.8em; }
+
+h4 {
+ font-size: 1.6em; }
+
+h5 {
+ font-size: 1.4em; }
+
+h6 {
+ font-size: 1.2em; }
+
p {
margin: 0 0 20px 0; }
@@ -5989,7 +5989,11 @@ require.define("/controllers/new_document.js", function (require, module, export
this.class_name = "new_document view";
this.actions = {
'click .new.save': 'save',
- 'click .new.discard': 'discard'
+ 'click .new.discard': 'discard',
+ 'keyup esc #new-editor': 'discard',
+ 'keyup esc': 'discard',
+ 'keyup ctrl+s #new-editor': 'save',
+ 'keyup ctrl+s': 'save'
};
NewDocument.__super__.constructor.call(this, config);
this.tmpl = Flakey.templates.get_template('new_document', require('../views/new_document'));
@@ -6009,8 +6013,9 @@ require.define("/controllers/new_document.js", function (require, module, export
return $('#name').focus();
};
- NewDocument.prototype.save = function(params) {
+ NewDocument.prototype.save = function(event) {
var doc, name, text;
+ event.preventDefault();
name = $('#name').val();
text = $('#new-editor').val();
if (name.length > 0 && text.length > 0) {
@@ -6027,7 +6032,8 @@ require.define("/controllers/new_document.js", function (require, module, export
}
};
- NewDocument.prototype.discard = function(params) {
+ NewDocument.prototype.discard = function(event) {
+ event.preventDefault();
return ui.confirm('There be Monsters!', 'Careful there Captain; are you sure you want to discard this document?').show(function(ok) {
if (ok) return window.location.hash = "#/list";
});
@@ -7935,6 +7941,7 @@ require.define("/controllers/list.js", function (require, module, exports, __dir
List.prototype.select_doc = function(event) {
var id;
+ event.preventDefault();
id = $(event.currentTarget).attr('id').replace('document-', '');
return window.location.hash = "#/detail?" + Flakey.util.querystring.build({
id: id
@@ -8176,7 +8183,6 @@ require.define("/controllers/detail.js", function (require, module, exports, __d
Detail.prototype.delete_file = function(event) {
var _this = this;
event.preventDefault();
- event.preventDefault();
return ui.confirm('There be Monsters!', 'Are you sure you want to delete this annotation?').show(function(ok) {
var id;
if (ok) {
@@ -8524,6 +8530,7 @@ require.define("/controllers/history.js", function (require, module, exports, __
History.prototype.update = function(event) {
var converter, doc, html, rev, time, version_index;
+ event.preventDefault();
version_index = $('#version-input').val();
doc = Document.get(this.query_params.id);
time = new Date(doc.versions[version_index].time);

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

0 comments on commit f141795

Please sign in to comment.