-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Benjamin
committed
Feb 27, 2020
1 parent
a0e1b73
commit f0535ab
Showing
7 changed files
with
149 additions
and
33 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#form-container { | ||
width: 500px; | ||
} | ||
|
||
.row { | ||
margin-top: 15px; | ||
} | ||
.row.form-group { | ||
padding-left: 15px; | ||
padding-right: 15px; | ||
} | ||
.btn { | ||
margin-left: 15px; | ||
} | ||
|
||
.change-link { | ||
background-color: #000; | ||
border-bottom-left-radius: 6px; | ||
border-bottom-right-radius: 6px; | ||
bottom: 0; | ||
color: #fff; | ||
opacity: 0.8; | ||
padding: 4px; | ||
position: absolute; | ||
text-align: center; | ||
width: 150px; | ||
} | ||
.change-link:hover { | ||
color: #fff; | ||
text-decoration: none; | ||
} | ||
|
||
img { | ||
width: 150px; | ||
} | ||
|
||
#editor-container { | ||
height: 130px; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
var quill = new Quill('#editor-container', { | ||
modules: { | ||
toolbar: [ | ||
['bold', 'italic'], | ||
['link', 'blockquote', 'code-block', 'image'], | ||
[{ list: 'ordered' }, { list: 'bullet' }] | ||
] | ||
}, | ||
placeholder: 'Compose an epic...', | ||
theme: 'snow' | ||
}); | ||
|
||
var form = document.querySelector('form'); | ||
|
||
form.onsubmit = function() { | ||
// Populate hidden form on submit | ||
var about = document.querySelector('input[name=about]'); | ||
about.value = JSON.stringify(quill.getContents()); | ||
|
||
// To set the contents | ||
// quill.setContents([{"insert":"Testing new content!\n"}]) | ||
|
||
// What we want to save | ||
// var saved_string = JSON.stringify(quill.getContents()['ops']) | ||
|
||
// To load | ||
// var loaded_string = JSON.parse(saved_string) | ||
// quill.setContents(loaded_string) | ||
|
||
console.log("Submitted", $(form).serialize()); | ||
|
||
console.log("\n\n\n"); | ||
|
||
console.log("Submitted", $(form).serializeArray()); | ||
|
||
// No back end to actually submit to! | ||
alert('Open the console to see the submit data!') | ||
return false; | ||
}; |
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