summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Parecki <aaron@parecki.com>2015-05-11 22:07:20 +0200
committerAaron Parecki <aaron@parecki.com>2015-05-11 22:07:20 +0200
commitd6a2dddc5b96eb943faae8e64b5890159026b5e3 (patch)
tree31af3811e873597d60233c34b40f56d59fc2d7d6
parentaea6e8a02998b9e22343cbe5b8425eb53b4a4c4c (diff)
apparently MediumEditor already has a placeholder text mechanism
-rw-r--r--public/editor/editor.js7
-rw-r--r--views/editor.php2
-rw-r--r--views/partials/appcache.php4
3 files changed, 5 insertions, 8 deletions
diff --git a/public/editor/editor.js b/public/editor/editor.js
index 08c09b0..0d72998 100644
--- a/public/editor/editor.js
+++ b/public/editor/editor.js
@@ -1,5 +1,6 @@
var editor = new MediumEditor('.editable', {
buttons: ['bold', 'italic', 'anchor', 'header1', 'header2', 'quote', 'unorderedlist', 'pre'],
+ placeholder: 'Write something nice...',
paste: {
// This example includes the default options for paste, if nothing is passed this is what it used
forcePlainText: false,
@@ -10,7 +11,7 @@ var editor = new MediumEditor('.editable', {
}
});
-$(function () {
+$(function() {
$('.editable').mediumInsert({
editor: editor,
beginning: true,
@@ -26,9 +27,6 @@ $(function () {
}
}
});
- $('.editable').focus(function(){
- $('.placeholder').removeClass('placeholder');
- });
$.post('/editor/test-login', {}, function(response) {
if(response.logged_in) {
@@ -91,7 +89,6 @@ $(function () {
function reset_page() {
$("#post-name").val('');
- $("#content").html('<p class="placeholder">Write something nice...</p>');
$("#draft-status").text("New");
return localforage.setItem('currentdraft', {});
}
diff --git a/views/editor.php b/views/editor.php
index cadeb19..3913584 100644
--- a/views/editor.php
+++ b/views/editor.php
@@ -89,7 +89,7 @@
<div class="container">
<input id="post-name" type="text" value="" placeholder="Title">
- <div id="content" class="editable"><p class="placeholder">Write something nice...</p></div>
+ <div id="content" class="editable"></div>
</div>
<div id="new_version_available">
diff --git a/views/partials/appcache.php b/views/partials/appcache.php
index def02df..5fdf9a2 100644
--- a/views/partials/appcache.php
+++ b/views/partials/appcache.php
@@ -1,6 +1,6 @@
CACHE MANIFEST
-# v15
+# v17
/editor
/editor/style.css
@@ -18,7 +18,7 @@ CACHE MANIFEST
/editor/medium-editor/js/medium-editor-insert-plugin.min.js
/editor/localforage/localforage.js
/editor/quill-logo-36.png
-/editor/editor.js
+# /editor/editor.js
/editor/font-awesome/fonts/fontawesome-webfont.woff2?v=4.3.0
/editor/font-awesome/fonts/fontawesome-webfont.woff?v=4.3.0
/editor/font-awesome/fonts/fontawesome-webfont.ttf?v=4.3.0