rename /rpg-docs to /app

This commit is contained in:
Andrew Zhu
2018-06-07 01:07:49 -07:00
parent de93636c7c
commit c099e3173b
420 changed files with 12 additions and 25 deletions

View File

@@ -0,0 +1,3 @@
.noteDialog .colorDropdown {
top: 0;
}

View File

@@ -0,0 +1,22 @@
<template name="noteDialog">
{{#with note}}
{{#baseDialog title=name class=colorClass startEditing=../startEditing}}
<div>{{#markdown}}{{evaluateString charId description}}{{/markdown}}</div>
{{else}}
{{> noteDialogEdit}}
{{/baseDialog}}
{{/with}}
</template>
<template name="noteDialogEdit">
<!--Name-->
<div class="horizontal layout">
<paper-input id="noteNameInput"
label="Name"
value={{name}}
class="flex">
</paper-input>
</div>
<!--Description, formatting this nicely breaks it, leave it as is-->
<paper-textarea id="noteDescriptionInput" label="Description" value={{description}}></paper-textarea>
</template>

View File

@@ -0,0 +1,46 @@
Template.noteDialog.helpers({
note: function(){
return Notes.findOne(this.noteId);
}
});
Template.noteDialog.events({
"color-change": function(event, instance){
Notes.update(instance.data.noteId, {$set: {color: event.color}});
},
"tap #deleteButton": function(event, instance){
Notes.softRemove(instance.data.noteId);
GlobalUI.deletedToast(instance.data.noteId, "Notes", "Note");
popDialogStack();
},
});
const debounce = (f) => _.debounce(f, 300);
Template.noteDialogEdit.events({
"change #noteNameInput, input #noteNameInput": debounce(function(event){
const input = event.currentTarget;
var name = input.value;
if (!name){
input.invalid = true;
input.errorMessage = "Name is required";
} else {
input.invalid = false;
Notes.update(this._id, {
$set: {name: name}
}, {
removeEmptyStrings: false,
trimStrings: false,
});
}
}),
"input #noteDescriptionInput": debounce(function(event){
var value = event.currentTarget.value;
Notes.update(this._id, {
$set: {description: value}
}, {
removeEmptyStrings: false,
trimStrings: false,
});
}),
});