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

Fix: Firefox issues by adding Squire on load of iframe

This commit is contained in:
Matthew Borden 2014-07-09 11:06:57 +10:00
parent f706dd6763
commit 3065edf906
3 changed files with 29 additions and 40 deletions

View file

@ -7,8 +7,6 @@ var file = new static.Server('./');
function puts(error, stdout, stderr) { sys.puts(stdout) }; function puts(error, stdout, stderr) { sys.puts(stdout) };
require('http').createServer(function (request, response) { require('http').createServer(function (request, response) {
exec("make -f Makefile build", puts);
exec("make -f Makefile ui", puts);
request.addListener('end', function () { request.addListener('end', function () {
file.serve(request, response); file.serve(request, response);
}).resume(); }).resume();

View file

@ -1,46 +1,34 @@
<div class="menu" contenteditable="false"> <div class="menu" contenteditable="false">
<div class="group"> <div class="group">
<div class="item fa fa-bold" data-action="bold" data-value=""></div> <div data-action="bold" data-value="" 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 class="item fa fa-italic" data-action="italic" data-value="" ></div> <div data-action="underline" data-value="" class="item"><i class="fa fa-underline"></i></div>
<div data-action="" data-value="" id="font" class="item">
<div class="item fa fa-underline" data-action="underline" data-value="" <i class="fa fa-font"></i>
></div> </div>
<div class="item fa fa-font" data-action="" data-value="" id="font"
></div>
</div> </div>
<div class="group"> <div class="group">
<div class="item fa fa-link" data-action="link" data-value="" style= <div data-action="link" data-value=""class="item"><i class="fa fa-link"></i></div>
"font-style: italic"></div> <div data-action="quote" data-value="" class="item"><i class="fa fa-quote-right"></i></div>
<div data-action="list" data-value="" class="item"><i class="fa fa-list"></i></div>
<div class="item fa fa-quote-right" data-action="quote" data-value="" <div data-action="image" data-value="" class="item">
></div> <i class="fa fa-picture-o"></i>
</div>
<div class="item fa fa-list" data-action="list" data-value="" ></div>
<div class="item fa fa-picture-o" data-action="image" data-value=""
></div>
</div> </div>
<div class="group"> <div class="group">
<div class="item fa fa-link" data-action="link" data-value="" style= <div data-action="link" data-value=""class="item"><i class="fa fa-link"></i></div>
"font-style: italic"></div> <div data-action="quote" data-value="" class="item"><i class="fa fa-quote-right"></i></div>
<div class="item fa fa-quote-right" data-action="quote" data-value=""
></div>
</div> </div>
<div class="group"> <div class="group">
<div class="item fa fa-undo" data-action="undo" data-value=""></div> <div data-action="undo" data-value="" 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 class="item fa fa-undo flip" data-action="redo" data-value="" ></div>
</div> </div>
</div> </div>
<div class="templates hidden">
<div class="templates hidden drop-font"> <div class="drop-font">
<i class="fa fa-chevron-up quit"></i> Text Size: <input max="72" min="12" <i class="fa fa-chevron-up quit"></i>
name="font-size" step="6" type="number" value="12"><br> Text Size: <input type="number" min="12" max="72" step="6" value="12" name="font-size">
<br>
Font: <input type="text"> Font: <input type="text">
</div> </div>
</div>

View file

@ -41,7 +41,10 @@ $(document).ready(function () {
$(container).append(div); $(container).append(div);
$(container).append(iframe); $(container).append(iframe);
iframe.addEventListener('load', function () {
iframe.contentWindow.editor = new Squire(iframe.contentWindow.document); iframe.contentWindow.editor = new Squire(iframe.contentWindow.document);
});
return iframe.contentWindow.editor; return iframe.contentWindow.editor;
}; };