v2.0 first push
This commit is contained in:
27
masks/calendar.html
Executable file
27
masks/calendar.html
Executable file
@@ -0,0 +1,27 @@
|
||||
<div id="calendar">
|
||||
<table class="calendar_list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="7">
|
||||
<a class="calendar_direction" href="#link_prev#"><-</a>
|
||||
#current_month#
|
||||
<a class="calendar_direction" href="#link_next#">-></a>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="round">
|
||||
<tr>
|
||||
<!-- [PART] TITLE [START] -->
|
||||
<td>#day_name#</td>
|
||||
<!-- [PART] TITLE [END] -->
|
||||
</tr>
|
||||
<!-- [PART] WEEK [START] -->
|
||||
<tr class="calendar_items">
|
||||
<!-- [PART] DAY [START] -->
|
||||
<td class="item_#item_class#" title="#item_link_title#" onclick="goTo('#item_link#');">#item_day#</td>
|
||||
<!-- [PART] DAY [END] -->
|
||||
</tr>
|
||||
<!-- [PART] WEEK [END] -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
7
masks/errors.html
Executable file
7
masks/errors.html
Executable file
@@ -0,0 +1,7 @@
|
||||
<div id="errors" class="round_top">
|
||||
<ul>
|
||||
<!-- [PART] ERROR [START] -->
|
||||
<li>#error#</li>
|
||||
<!-- [PART] ERROR [END] -->
|
||||
</ul>
|
||||
</div>
|
||||
6
masks/home.html
Executable file
6
masks/home.html
Executable file
@@ -0,0 +1,6 @@
|
||||
<script type="text/javascript">
|
||||
oMyThoughts.pageInit = function(asHash, bFirstPage)
|
||||
{
|
||||
console.log('home init');
|
||||
}
|
||||
</script>
|
||||
25
masks/index.html
Executable file
25
masks/index.html
Executable file
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
||||
<meta name="author" content="Franzz" />
|
||||
<link href="style/style.css" rel="stylesheet" type="text/css" />
|
||||
<link href="style/font-awesome.css" rel="stylesheet" type="text/css" />
|
||||
<link href="style/trumbowyg.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="style/jquery-te-1.4.0.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="scripts/jquery.js"></script>
|
||||
<script type="text/javascript" src="scripts/functions.js"></script>
|
||||
<script type="text/javascript" src="scripts/mythoughts.js"></script>
|
||||
<script type="text/javascript" src="scripts/trumbowyg.min.js"></script>
|
||||
<script type="text/javascript" src="scripts/jquery-te-1.4.0.min.js"></script>
|
||||
<link rel="shortcut icon" href="images/favicon2.ico" />
|
||||
<title>My Thoughts</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container"></div>
|
||||
<script type="text/javascript">
|
||||
var oMyThoughts = new MyThoughts(asGlobalVars);
|
||||
$(document).ready(oMyThoughts.init);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
56
masks/logon.html
Executable file
56
masks/logon.html
Executable file
@@ -0,0 +1,56 @@
|
||||
<div id="logon">
|
||||
<form name="post_logon" id="post_logon">
|
||||
<div class="credentials">
|
||||
<p><input type="text" name="login" id="login" value="" /></p>
|
||||
<p><input type="password" name="pass" id="pass" /></p>
|
||||
</div>
|
||||
<p class="register"><input type="button" name="register" id="register" value="No account?" /></p>
|
||||
<p><input type="button" name="ok" id="ok" class="connection" value="Ok" /></p>
|
||||
</form>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
oMyThoughts.pageInit = function(asHash, bFirstPage)
|
||||
{
|
||||
$('#logon').hide();
|
||||
$('#login').addDefaultValue('Nickname');
|
||||
$('#pass').addDefaultValue('Password');
|
||||
|
||||
$(window).keyup(function(e){if(e.which==13) logMeIn();});
|
||||
$('#ok').click(logMeIn);
|
||||
$('#register').click(register);
|
||||
|
||||
$('#logon').fadeIn('slow');
|
||||
};
|
||||
|
||||
function logMeIn()
|
||||
{
|
||||
var sLogin = $.trim(removeDiacritics($('#login').val().toLowerCase()));
|
||||
var sPass = $.trim($('#pass').val());
|
||||
if($('#post_logon').checkForm())
|
||||
{
|
||||
getInfo
|
||||
(
|
||||
'logmein',
|
||||
oMyThoughts.loadHome,
|
||||
{token:md5(sLogin)+oMyThoughts.consts.token_sep+getLoginToken(sPass)},
|
||||
function(sDesc){feedback('error', sDesc);}
|
||||
);
|
||||
}
|
||||
else feedback('warning', 'incomplete form');
|
||||
}
|
||||
|
||||
function register()
|
||||
{
|
||||
if($('#post_logon').checkForm('#login'))
|
||||
{
|
||||
getInfo
|
||||
(
|
||||
'register',
|
||||
oMyThoughts.loadHome,
|
||||
{nickname:$('#login').val()},
|
||||
function(sDesc){feedback('error', sDesc);}
|
||||
);
|
||||
}
|
||||
else feedback('warning', 'Please choose a nickname');
|
||||
}
|
||||
</script>
|
||||
4
masks/menu.html
Executable file
4
masks/menu.html
Executable file
@@ -0,0 +1,4 @@
|
||||
<a id="signout" href="?p=w" title="Exit" class="option">Write</a> .
|
||||
<a id="signout" href="?p=s" title="Exit" class="option">Settings</a> .
|
||||
<a id="signout" href="?p=q" title="Exit" class="option">Sign out</a>
|
||||
#calendar#
|
||||
14
masks/read_thought.html
Executable file
14
masks/read_thought.html
Executable file
@@ -0,0 +1,14 @@
|
||||
<p class="date">Thoughts on #date#.</p>
|
||||
<div class="read round_right">
|
||||
<!-- [PART] THOUGHT [START] -->
|
||||
<div class="thought">
|
||||
<div class="time">At #time#</div>
|
||||
<div class="paragraphs">
|
||||
<!-- [PART] THOUGHT_PARA [START] -->
|
||||
<p>#thought_paragraph#</p>
|
||||
<!-- [PART] THOUGHT_PARA [END] -->
|
||||
<p style="text-align:center;text-indent:0;font-family:Comic sans MS;">* * *</p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- [PART] THOUGHT [END] -->
|
||||
</div>
|
||||
19
masks/settings.html
Executable file
19
masks/settings.html
Executable file
@@ -0,0 +1,19 @@
|
||||
<div id="settings">
|
||||
<form method="post" action="?p=s" name="post_settings">
|
||||
<table>
|
||||
<!-- [PART] SETTING [START] -->
|
||||
<tr>
|
||||
<td>#setting_name#</td>
|
||||
<td>
|
||||
<select name="#setting_name#">
|
||||
<!-- [PART] SETTING_OPTION [START] -->
|
||||
<option value="#setting_option_value#" #setting_option_selected#>#setting_option_name#</option>
|
||||
<!-- [PART] SETTING_OPTION [END] -->
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- [PART] SETTING [END] -->
|
||||
</table>
|
||||
<input type="submit" value="Ok" />
|
||||
</form>
|
||||
</div>
|
||||
10
masks/template.html
Executable file
10
masks/template.html
Executable file
@@ -0,0 +1,10 @@
|
||||
<div id="header"></div>
|
||||
<div id="menu">
|
||||
<a href="#settings" class="button fa fa-gear"></a>
|
||||
</div>
|
||||
<div id="main"></div>
|
||||
<div id="footer">
|
||||
Designed and powered by Franzz & Clarita.
|
||||
My Thoughts Project under <a href="http://www.gnu.org/licenses/gpl.html" target="_blank">GPLv3</a> License.
|
||||
</div>
|
||||
#errors#
|
||||
176
masks/write.html
Executable file
176
masks/write.html
Executable file
@@ -0,0 +1,176 @@
|
||||
<div id="write">
|
||||
<div id="write_feedback"></div>
|
||||
<div id="nav">
|
||||
<a class="fa fa-prev"></a>
|
||||
<span class="page_nb">1</span>
|
||||
<A class="fa fa-next"></a>
|
||||
</div>
|
||||
<textarea id="editor"></textarea>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var sText = //'<p>David n’a pas fait grand chose, il a juste créé un embryon de programme. Mais ce programme s’est développé lui-même. Comme l’ordinateur de David n’était pas suffisant, il a utilisé le réseau pour s’installer 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 qu’il 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 s’endort. Aucun risque de noyade.</p>'
|
||||
//+'<p>« Prélude m’avait dit qu’il désirait connaître l’amour. Les ordinateurs n’ont pas de sentiments et l’amour n’est que sentiments. Il y a bien l’amour physique, mais sans les sentiments, cela ressemble davantage à un instinct de reproduction qu’à de l’amour. Un ordinateur n’a pas ce besoin de reproduction. Et pourquoi m’avoir choisi ? »</p>'
|
||||
//+'<p>« Oui, mais rien d’exceptionnel. » David essai de se rappeler si dans la lancé de sa jeunesse fougueuse, il n’aurait pas installé une bombe logique sur les ordinateurs de l’armé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);
|
||||
self.vars('id', 0);
|
||||
self.vars('default_text', '<p><br></p>');
|
||||
self.vars('working', false);
|
||||
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'));
|
||||
|
||||
$('.fa-prev').click(function(){moveToPage(-1);});
|
||||
$('.fa-next').click(function(){moveToPage(1);});
|
||||
};
|
||||
|
||||
oMyThoughts.onFeedback = function(sType, sMsg)
|
||||
{
|
||||
var $Feedback = $('#write_feedback');
|
||||
$Feedback
|
||||
.stop()
|
||||
.fadeOut($Feedback.is(':empty')?0:'fast', function(){
|
||||
$(this)
|
||||
.empty()
|
||||
.append($('<span>', {'class':sType}).text(sMsg))
|
||||
.fadeIn('fast');
|
||||
});
|
||||
};
|
||||
|
||||
oMyThoughts.onQuitPage = function()
|
||||
{
|
||||
save();
|
||||
return true;
|
||||
};
|
||||
|
||||
function save(sContent)
|
||||
{
|
||||
if(sContent != self.vars('default_text'))
|
||||
{
|
||||
oMyThoughts.onFeedback('info', 'Saving...');
|
||||
getInfo
|
||||
(
|
||||
'update',
|
||||
function(asData)
|
||||
{
|
||||
self.vars('id', asData.id_thought);
|
||||
oMyThoughts.onFeedback('notice', 'Saved ('+asData.led.substr(11, 5)+')');
|
||||
},
|
||||
{content:sContent, id:self.vars('id')},
|
||||
function(sError)
|
||||
{
|
||||
oMyThoughts.onFeedback('error', 'Not saved! Un error occured: '+sError);
|
||||
},
|
||||
'POST'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function checkPageBook()
|
||||
{
|
||||
self.vars('working', true);
|
||||
var iEm = $(1).toPx();
|
||||
iEm = iEm.substr(0, iEm.length - 2);
|
||||
|
||||
$Editor = self.vars('editor');
|
||||
|
||||
//Content Height
|
||||
var iContentHeight = $Editor.height();
|
||||
|
||||
//Calculates what should be displayed
|
||||
iDisplayedHeight = iContentHeight % self.vars('max_height');
|
||||
console.log(iContentHeight+'%'+self.vars('max_height')+'='+iDisplayedHeight);
|
||||
|
||||
//Navigation
|
||||
var iNewPage = Math.ceil(iContentHeight / self.vars('max_height'));
|
||||
moveToPage(iNewPage);
|
||||
|
||||
|
||||
self.vars('prec_displayed', iDisplayedHeight);
|
||||
self.vars('prec_content', iContentHeight);
|
||||
|
||||
self.vars('working', false);
|
||||
}
|
||||
|
||||
function moveToPage(iNewPage)
|
||||
{
|
||||
if(iNewPage!=self.vars('page'))
|
||||
{
|
||||
self.vars('page', iNewPage);
|
||||
console.log('moving to page '+self.vars('page'));
|
||||
$('.page_nb').text(self.vars('page'));
|
||||
|
||||
self.vars('editor').css('top', (self.vars('page') - 1)*self.vars('max_height')*-1);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user