0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 15:23:29 -05:00

stuff is working more and more

This commit is contained in:
Matthew Borden 2014-07-10 19:05:25 +10:00
parent bea183d23f
commit 8e1b30b2ad
4 changed files with 30 additions and 16 deletions

View file

@ -87,7 +87,14 @@ input[type=text] {
.menu .item:first-child { .menu .item:first-child {
border-left:none; border-left:none;
} }
.menu {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.drop { .drop {
border: 1px solid #dbdbdb; border: 1px solid #dbdbdb;
padding: 14px; padding: 14px;

View file

@ -87,7 +87,14 @@ input[type=text] {
.menu .item:first-child { .menu .item:first-child {
border-left:none; border-left:none;
} }
.menu {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.drop { .drop {
border: 1px solid #dbdbdb; border: 1px solid #dbdbdb;
padding: 14px; padding: 14px;

View file

@ -1,24 +1,24 @@
<div class="menu" contenteditable="false"> <div class="menu" contenteditable="false">
<div class="group"> <div class="group">
<div data-action="bold" data-value="" class="item"><i class="fa fa-bold"></i></div> <div data-action="bold" class="item"><i class="fa fa-bold"></i></div>
<div data-action="italic" data-value="" class="item"><i class="fa fa-italic"></i></div> <div data-action="italic" class="item"><i class="fa fa-italic"></i></div>
<div data-action="underline" data-value="" class="item"><i class="fa fa-underline"></i></div> <div data-action="underline" class="item"><i class="fa fa-underline"></i></div>
<div id="selectFont" data-action="selectFont" data-value="" class="item"> <div id="selectFont" data-action="selectFont" class="item">
<i class="fa fa-font"></i> <i class="fa fa-font"></i>
</div> </div>
</div> </div>
<div class="group"> <div class="group">
<div id="makeLink" data-action="makeLink" data-value=""class="item"><i class="fa fa-link"></i></div> <div id="makeLink" data-action="makeLink" class="item"><i class="fa fa-link"></i></div>
<div data-action="makeOrderedList" data-value="" class="item"><i class="fa fa-list"></i></div> <div data-action="makeOrderedList" class="item"><i class="fa fa-list"></i></div>
<div id="insertImage" data-action="insertImage" data-value="" class="item"> <div id="insertImage" data-action="insertImage" class="item">
<i class="fa fa-picture-o"></i> <i class="fa fa-picture-o"></i>
</div> </div>
<div data-action="increaseQuoteLevel" data-value="" class="item"><i class="fa fa-quote-right"></i></div> <div data-action="increaseQuoteLevel" class="item"><i class="fa fa-quote-right"></i></div>
</div> </div>
<div class="group"> <div class="group">
<div data-action="undo" data-value="" class="item"><i class="fa fa-undo"></i></div> <div data-action="undo" class="item"><i class="fa fa-undo"></i></div>
<div data-action="redo" data-value="" class="item"><i class="fa fa-undo flip"></i></div> <div data-action="redo" class="item"><i class="fa fa-undo flip"></i></div>
</div> </div>
</div> </div>
<div class="templates hidden"> <div class="templates hidden">
@ -31,13 +31,13 @@
<div id="drop-link"> <div id="drop-link">
<label>Insert Link</label> <label>Insert Link</label>
<i class="fa fa-chevron-up quit"></i> <i class="fa fa-chevron-up quit"></i>
<input placeholder="Link URL" type="text" id="url" /> <input value="http://" type="text" id="url" />
<div class="btn submitLink">Insert</div> <div class="btn submitLink">Insert</div>
</div> </div>
<div id="drop-image"> <div id="drop-image">
<label>Insert Image</label> <label>Insert Image</label>
<i class="fa fa-chevron-up quit"></i> <i class="fa fa-chevron-up quit"></i>
<input placeholder="Image URL" type="text" id="imageUrl" /> <input value="http://" placeholder="Image URL" type="text" id="imageUrl" />
<div class="btn sumbitImageURL">Insert</div> <div class="btn sumbitImageURL">Insert</div>
</div> </div>
</div> </div>

View file

@ -49,8 +49,7 @@ $(document).ready(function() {
$('.submitLink').click(function () { $('.submitLink').click(function () {
editor = iframe.contentWindow.editor; editor = iframe.contentWindow.editor;
url = $(this).parent().children('#url').first()[0]; editor.makeLink($(this).parent().children('#url').first().val());
editor.makeLink(url.value);
$(this).parent().parent().removeClass('drop-open'); $(this).parent().parent().removeClass('drop-open');
$(this).parent().children('#url').attr('value', ''); $(this).parent().children('#url').attr('value', '');
}); });
@ -115,6 +114,7 @@ $(document).ready(function() {
} else if (test.isNotValue('makeLink') | test.isNotValue('insertImage') | test.isNotValue('selectFont')) { } else if (test.isNotValue('makeLink') | test.isNotValue('insertImage') | test.isNotValue('selectFont')) {
// do nothing these are dropdowns. // do nothing these are dropdowns.
} else { } else {
console.log($(this).data('action'));
editor[$(this).data('action')](); editor[$(this).data('action')]();
} }
}); });