-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from mizzao/modules
Use npm dependencies and module system
- Loading branch information
Showing
32 changed files
with
756 additions
and
693 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,6 @@ [email protected] | |
[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
|
@@ -39,9 +38,9 @@ [email protected] | |
[email protected] | ||
[email protected] | ||
[email protected] | ||
mizzao:sharejs@0.8.0 | ||
mizzao:sharejs-ace@1.3.0 | ||
mizzao:sharejs-codemirror@4.12.1 | ||
mizzao:sharejs@0.9.0 | ||
mizzao:sharejs-ace@1.4.0 | ||
mizzao:sharejs-codemirror@5.14.2 | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
|
||
|
||
Template.docList.helpers({ | ||
documents: function() { | ||
return Documents.find(); | ||
} | ||
}); | ||
|
||
Template.docList.events = { | ||
"click button": function() { | ||
return Documents.insert({ | ||
title: "untitled" | ||
}, function(err, id) { | ||
if (!id) { | ||
return; | ||
} | ||
return Session.set("document", id); | ||
}); | ||
} | ||
}; | ||
|
||
Template.docItem.helpers({ | ||
current: function() { | ||
return Session.equals("document", this._id); | ||
} | ||
}); | ||
|
||
Template.docItem.events = { | ||
"click a": function(e) { | ||
e.preventDefault(); | ||
return Session.set("document", this._id); | ||
} | ||
}; | ||
|
||
Session.setDefault("editorType", "ace"); | ||
|
||
Template.docTitle.helpers({ | ||
title: function() { | ||
var ref; | ||
return (ref = Documents.findOne(this + "")) != null ? ref.title : void 0; | ||
}, | ||
editorType: function(type) { | ||
return Session.equals("editorType", type); | ||
} | ||
}); | ||
|
||
Template.editor.helpers({ | ||
docid: function() { | ||
return Session.get("document"); | ||
} | ||
}); | ||
|
||
Template.editor.events = { | ||
"keydown input[name=title]": function(e) { | ||
var id; | ||
if (e.keyCode !== 13) { | ||
return; | ||
} | ||
e.preventDefault(); | ||
$(e.target).blur(); | ||
id = Session.get("document"); | ||
return Documents.update(id, { | ||
title: e.target.value | ||
}); | ||
}, | ||
"click button": function(e) { | ||
var id; | ||
e.preventDefault(); | ||
id = Session.get("document"); | ||
Session.set("document", null); | ||
return Meteor.call("deleteDocument", id); | ||
}, | ||
"change input[name=editor]": function(e) { | ||
return Session.set("editorType", e.target.value); | ||
} | ||
}; | ||
|
||
Template.editor.helpers({ | ||
textarea: function() { | ||
return Session.equals("editorType", "textarea"); | ||
}, | ||
cm: function() { | ||
return Session.equals("editorType", "cm"); | ||
}, | ||
ace: function() { | ||
return Session.equals("editorType", "ace"); | ||
}, | ||
configAce: function() { | ||
return function(ace) { | ||
ace.setTheme('ace/theme/monokai'); | ||
ace.setShowPrintMargin(false); | ||
return ace.getSession().setUseWrapMode(true); | ||
}; | ||
}, | ||
configCM: function() { | ||
return function(cm) { | ||
cm.setOption("theme", "default"); | ||
cm.setOption("lineNumbers", true); | ||
cm.setOption("lineWrapping", true); | ||
cm.setOption("smartIndent", true); | ||
return cm.setOption("indentWithTabs", true); | ||
}; | ||
} | ||
}); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* | ||
* Created by dsichau on 11.05.16. | ||
*/ | ||
|
||
import {ShareJS} from 'meteor/mizzao:sharejs'; | ||
|
||
this.Documents = new Meteor.Collection("documents"); | ||
|
||
Meteor.methods({ | ||
deleteDocument(id){ | ||
Documents.remove(id); | ||
if(Meteor.isServer) { | ||
ShareJS.model.delete(id); | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## v1.4.0 | ||
|
||
* Ace is added as npm dependencie | ||
|
||
## v1.3.0 | ||
|
||
* Support of Meteor 1.3 | ||
|
Submodule ace-builds
deleted from
4c1551
Oops, something went wrong.