initial commit
This commit is contained in:
20
app/assets/javascripts/app/frontend/models/note.js
Normal file
20
app/assets/javascripts/app/frontend/models/note.js
Normal file
@@ -0,0 +1,20 @@
|
||||
var Note = function (json_obj) {
|
||||
_.merge(this, json_obj);
|
||||
};
|
||||
|
||||
/* Returns true if note is shared individually or via group */
|
||||
Note.prototype.isPublic = function() {
|
||||
return this.hasEnabledPresentation() || this.shared_via_group;
|
||||
};
|
||||
|
||||
Note.prototype.isEncrypted = function() {
|
||||
return this.local_eek ? true : false;
|
||||
}
|
||||
|
||||
Note.prototype.hasEnabledPresentation = function() {
|
||||
return this.presentation && this.presentation.enabled;
|
||||
}
|
||||
|
||||
Note.prototype.presentationURL = function() {
|
||||
return this.presentation.url;
|
||||
}
|
||||
10
app/assets/javascripts/app/frontend/models/user.js
Normal file
10
app/assets/javascripts/app/frontend/models/user.js
Normal file
@@ -0,0 +1,10 @@
|
||||
var User = function (json_obj) {
|
||||
_.merge(this, json_obj);
|
||||
};
|
||||
|
||||
User.prototype.getUsername = function() {
|
||||
if(!this.presentation) {
|
||||
return null;
|
||||
}
|
||||
return this.presentation.root_path;
|
||||
};
|
||||
Reference in New Issue
Block a user