set up quill library

This commit is contained in:
francois.lutran
2016-12-16 10:42:04 +13:00
parent 2038e07a60
commit 5b74289001
16 changed files with 1008 additions and 256 deletions

View File

@@ -5,18 +5,18 @@
<span class="page_nb">1</span>
<A class="fa fa-next"></a>
</div>
<textarea id="editor"></textarea>
<div id="editor">
<p>So, I'm there, wondering about myself and my future - such a luxury by the way - when suddenly, someone approaches. mid-40s i'd say, elegant cold women, the kind you've learned not to talk to, to eventually avoid feeling repressed, or bad for yourself, or both.</p>
<p>Anyhow, it would seem that in this particular situation, the choice wasn't given to me to decide whether or not to talk to that precise women. She seats down next to me and engage a conversation. 'How is it you're here today?' I'm already regretting not having gone away when i still had the chance.</p>
<p>'Hello to you too' I say, still willing to show some manhood, even though I already know this women crushes manhood by pairs as a breakfast ritual.</p>
<p>In-extremist, I manage to babble some excuses about a rigorous lunch break time and leave the premises.</p>
<p>So, I'm there, wondering about myself and my future - such a luxury by the way - when suddenly, someone approaches. mid-40s i'd say, elegant cold women, the kind you've learned not to talk to, to eventually avoid feeling repressed, or bad for yourself, or both.</p>
<p>Anyhow, it would seem that in this particular situation, the choice wasn't given to me to decide whether or not to talk to that precise women. She seats down next to me and engage a conversation. 'How is it you're here today?' I'm already regretting not having gone away when i still had the chance.</p>
<p>'Hello to you too' I say, still willing to show some manhood, even though I already know this women crushes manhood by pairs as a breakfast ritual.</p>
<p>In-extremist, I manage to babble some excuses about a rigorous lunch break time and leave the premises.</p>
</div>
</div>
<script type="text/javascript">
var sText = //'<p>David na pas fait grand chose, il a juste créé un embryon de programme. Mais ce programme sest développé lui-même. Comme lordinateur de David nétait pas suffisant, il a utilisé le réseau pour sinstaller sur les autres ordinateurs. Il a grandi alors de manière exponentielle et le voilà : Prélude. Connecté à tout les ordinateurs et capable de leur donner les ordres quil veut.</p>'
//+'<p>Il sort de son lit, les yeux dans un brouillard Londonien, avance jusqu\'à la salle de bain dont la baignoire a été remplie cinq minutes avant par l\'ordinateur de la maison, et va directement prendre un bain. Un bain moussant comme tout les matins. Un bain bien chaud. Et comme il est trop grand pour sa baignoire, ses pieds dépassent. Quelques minutes plus tard, il sendort. Aucun risque de noyade.</p>'
//+'<p>« Prélude mavait dit quil désirait connaître lamour. Les ordinateurs nont pas de sentiments et lamour nest que sentiments. Il y a bien lamour physique, mais sans les sentiments, cela ressemble davantage à un instinct de reproduction quà de lamour. Un ordinateur na pas ce besoin de reproduction. Et pourquoi mavoir choisi ? »</p>'
//+'<p>« Oui, mais rien dexceptionnel. » David essai de se rappeler si dans la lancé de sa jeunesse fougueuse, il naurait pas installé une bombe logique sur les ordinateurs de larmée, mais il ne se rappelait pas avoir fait une telle bêtise. Planter tout le système informatique de la base aurait été trop grave de conséquences.</p>'
'<p>So, I\'m there, wondering about myself and my future - such a luxury by the way - when suddenly, someone approaches. mid-40s i\'d say, elegant cold women, the kind you\'ve learned not to talk to, to eventually avoid feeling repressed, or bad for yourself, or both.</p>'
+'<p>Anyhow, it would seem that in this particular situation, the choice wasn\'t given to me to decide whether or not to talk to that precise women. She seats down next to me and engage a conversation. \'How is it you\'re here today?\' I\'m already regretting not having gone away when i still had the chance.</p>'
+'<p>\'Hello to you too\' I say, still willing to show some manhood, even though I already know this women crushes manhood by pairs as a breakfast ritual.'
+'<p>In-extremist, I manage to babble some excuses about a rigorous lunch break time and leave the premises.</p>';
oMyThoughts.pageInit = function(asHash, bFirstPage)
{
self.vars('counter', 0);
@@ -26,69 +26,23 @@
self.vars('prec_displayed', 0);
self.vars('prec_content', 0);
self.vars('page', $('.page_nb').text());
$('#editor')
.jqte({
br: false,
center: false,
color: false,
fsize: false,
format: false,
indent: false,
link: false,
left: false,
outdent: false,
placeholder: "It all started here",
remove:false,
right:false,
rule:false,
source:false,
sub:false,
sup:false,
title:false,
unlink:false,
change: function(){
//First run
if(!self.vars('editor'))
{
self.vars('max_height', $('.jqte').height());
self.vars('editor', $('.jqte_editor'));
self.vars('editor').css('height', '100%');
self.vars('editor').css('min-height', self.vars('editor').height());
self.vars('editor').css('height', 'auto');
}
//Fixing "empty" content
var sContent = self.vars('editor').html();
if(sContent=='<br>' || sContent=='') $('#editor').jqteVal(self.vars('default_text'));
if(self.vars('counter')%100==0)
{
//Saving
save(sContent);
}
//Adjust book behaviour
if(!self.vars('working')) checkPageBook();
self.vars('counter', self.vars('counter')+1);
}
})
.jqteVal(sText);
//.jqteVal(self.vars('default_text'));
$('.jqte_tool_4')
.attr('title', 'Bold (Ctrl+B)');
$('.jqte_tool_5')
.attr('title', 'Italic (Ctrl+I)');
$('.jqte_tool_6')
.attr('title', 'Underline (Ctrl+U)');
$('.jqte_tool_7')
.attr('title', 'Numbered List (Ctrl+.)');
$('.jqte_tool_8')
.attr('title', 'List (Ctrl+,)');
$('.jqte_tool_16')
.attr('title', 'Strike through (Ctrl+K)')
.insertAfter($('.jqte_tool_6'));
self.vars('page_height', $('#editor').height());
var oQuill = new Quill('#editor', {
theme: 'bubble',
modules:
{
toolbar: [['bold', 'italic', 'underline'], [{ 'list': 'ordered'}, { 'list': 'bullet' }], ['clean']]
}
});
quill.on('text-change', function(delta, oldDelta, source) {
if(source == 'user')
{
}
});
$('.fa-prev').click(function(){moveToPage(-1);});
$('.fa-next').click(function(){moveToPage(1);});