fix write page

This commit is contained in:
francois
2018-04-09 22:01:42 +02:00
parent ab12b33532
commit 76faf824fc
13 changed files with 445 additions and 398 deletions

View File

@@ -17,6 +17,7 @@ class Auth extends PhpObject
public function __construct($oDb, $sApiKey='', $bAutoLogin=true) public function __construct($oDb, $sApiKey='', $bAutoLogin=true)
{ {
parent::__construct(__CLASS__, Settings::DEBUG);
$this->oDb = $oDb; $this->oDb = $oDb;
$this->setUserId(0); $this->setUserId(0);
$this->sApiKey = $sApiKey; $this->sApiKey = $sApiKey;

View File

@@ -5,7 +5,7 @@
* @author franzz * @author franzz
* @version 2.0 * @version 2.0
*/ */
class MyThoughts extends PhpObject class MyThoughts extends Main
{ {
//Interface keywords //Interface keywords
const SUCCESS = 'success'; const SUCCESS = 'success';
@@ -15,7 +15,6 @@ class MyThoughts extends PhpObject
//SQL tables //SQL tables
const USER_TABLE = 'users'; const USER_TABLE = 'users';
const THOUGHT_TABLE = 'thoughts';
const SETTINGS_TABLE = 'settings'; const SETTINGS_TABLE = 'settings';
//Mythoughts //Mythoughts
@@ -36,25 +35,17 @@ class MyThoughts extends PhpObject
const SIZE_18 = '18'; const SIZE_18 = '18';
const SIZE_20 = '20'; const SIZE_20 = '20';
//Objects //Format
private $oClassManagement; const OBJ = 'object';
const ARRAY = 'array';
const JSON = 'json';
/** /**
* Database Connection * Auth Object
* @var Db
*/
private $oDb;
/**
*
* @var Auth * @var Auth
*/ */
private $oAuth; private $oAuth;
//Variables
private $asContext;
//...
/** /**
* Main constructor [to be called from index.php] * Main constructor [to be called from index.php]
* @param ClassManagement $oClassManagement * @param ClassManagement $oClassManagement
@@ -62,22 +53,18 @@ class MyThoughts extends PhpObject
*/ */
public function __construct($oClassManagement, $sProcessPage) public function __construct($oClassManagement, $sProcessPage)
{ {
parent::__construct(__CLASS__, Settings::DEBUG);
$this->oClassManagement = $oClassManagement;
$this->setContext($sProcessPage);
//Load classes //Load classes
$this->oClassManagement->incClass('db');
$this->oClassManagement->incClass('auth', true);
//$this->oClassManagement->incClass('calendar', true); //$this->oClassManagement->incClass('calendar', true);
$asClasses = array( array('name'=>'auth', 'project'=>true),
array('name'=>'thought', 'project'=>true));
parent::__construct($oClassManagement, $sProcessPage, $asClasses);
//Init objects //Init objects
$this->oDb = new Db(Settings::DB_SERVER, Settings::DB_LOGIN, Settings::DB_PASS, Settings::DB_NAME, self::getSqlOptions() , Settings::DB_ENC); if($this->oDb->sDbState == Db::DB_PEACHY) $this->oAuth = new Auth($this->oDb, Settings::API_KEY);
if($this->oDb->sDbState == Db::DB_NO_DATA) $this->install();
else $this->oAuth = new Auth($this->oDb, Settings::API_KEY);
} }
private function install() protected function install()
{ {
$this->oAuth = new Auth($this->oDb, Settings::API_KEY, false); $this->oAuth = new Auth($this->oDb, Settings::API_KEY, false);
@@ -129,7 +116,7 @@ class MyThoughts extends PhpObject
/* Building main pages */ /* Building main pages */
public function getPage($bLoggedIn) public function getPage()
{ {
/*$asMaskPaths = glob('masks/*.html'); /*$asMaskPaths = glob('masks/*.html');
$asMaskNames = array_map('basename', $asMaskPaths, array_fill(1, count($asMaskPaths), '.html'));*/ $asMaskNames = array_map('basename', $asMaskPaths, array_fill(1, count($asMaskPaths), '.html'));*/
@@ -142,7 +129,7 @@ class MyThoughts extends PhpObject
$asGlobalVars['consts']['success'] = self::SUCCESS; $asGlobalVars['consts']['success'] = self::SUCCESS;
$asGlobalVars['consts']['context'] = $this->asContext; $asGlobalVars['consts']['context'] = $this->asContext;
$asGlobalVars['vars']['id'] = $this->oAuth->getUserId(); $asGlobalVars['vars']['id'] = $this->oAuth->getUserId();
$asGlobalVars['vars']['log_in'] = $bLoggedIn; $asGlobalVars['vars']['log_in'] = $this->isLoggedIn();
//Main Page //Main Page
$sPage = $this->getPageContent('index'); $sPage = $this->getPageContent('index');
@@ -150,44 +137,30 @@ class MyThoughts extends PhpObject
return $sPage; return $sPage;
} }
private function getPageContent($sPage)
{
$sPageFile = 'masks/'.$sPage.'.html';
return file_get_contents($sPageFile);
}
/* DB structure. See Db::__construct */ /* DB structure. See Db::__construct */
private static function getSqlOptions() protected function getSqlOptions()
{ {
return array return array(
( 'tables' => array(
'tables' => array self::USER_TABLE => array(Db::getText(self::USER_TABLE), 'nickname', 'pass', 'cookie'),
( Thought::THOUGHT_TABLE => array(Db::getId(self::USER_TABLE), Db::getText(Thought::THOUGHT_TABLE)),
self::USER_TABLE =>array(Db::getText(self::USER_TABLE), 'nickname', 'pass', 'cookie'), self::SETTINGS_TABLE => array(Db::getId(self::USER_TABLE), Db::getText(self::SETTINGS_TABLE), 'value')
self::THOUGHT_TABLE =>array(Db::getId(self::USER_TABLE),
Db::getText(self::THOUGHT_TABLE)),
self::SETTINGS_TABLE=>array(Db::getId(self::USER_TABLE),
Db::getText(self::SETTINGS_TABLE),
'value')
), ),
'types' => array 'types' => array(
( Db::getText(self::USER_TABLE) => "varchar(50) NOT NULL",
Db::getText(self::USER_TABLE)=>"varchar(50) NOT NULL", 'nickname' => "varchar(60) NOT NULL",
'nickname'=>'varchar(60) NOT NULL', 'pass' => "varchar(256)",
'pass'=>"varchar(256)", 'cookie' => "varchar(255)",
'cookie'=>"varchar(255)", Db::getText(Thought::THOUGHT_TABLE) => "longtext",
Db::getText(self::THOUGHT_TABLE)=>"longtext", Db::getText(self::SETTINGS_TABLE) => "varchar(20) NOT NULL",
Db::getText(self::SETTINGS_TABLE)=>"varchar(20) NOT NULL", 'value' => "varchar(20) NOT NULL"
'value'=>"varchar(20) NOT NULL"
), ),
'constraints' => array 'constraints' => array(
( self::USER_TABLE => "UNIQUE KEY `username` (`".Db::getText(self::USER_TABLE)."`)"
self::USER_TABLE=>"UNIQUE KEY `username` (`".Db::getText(self::USER_TABLE)."`)"
), ),
'cascading_delete' => array 'cascading_delete' => array(
( self::USER_TABLE => array(self::SETTINGS_TABLE)
self::USER_TABLE=>array(self::SETTINGS_TABLE)
) )
); );
} }
@@ -213,24 +186,44 @@ class MyThoughts extends PhpObject
return self::getJsonResult($bSuccess, $sDesc); return self::getJsonResult($bSuccess, $sDesc);
} }
public function updateThought($sThought, $iThoughtId=0) public function getThought($iThoughtId, $sFormat=self::OBJ)
{ {
if($iThoughtId==0) $oThought = new Thought($this->oDb);
if($iThoughtId=='last')
{ {
$iThoughtId = $this->addThought($sThought); $oThought->setUserId($this->oAuth->getUserId());
$sDesc = 'created'; $oThought->openLast();
} }
else else $oThought->open($iThoughtId);
switch($sFormat)
{ {
$asKeys = array(Db::getId(self::USER_TABLE) => $this->oAuth->getUserId(), case self::OBJ:
Db::getId(self::THOUGHT_TABLE)=> $iThoughtId); return $oThought; break;
$asThought = array(Db::getText(self::THOUGHT_TABLE) => self::encodeThought($sThought)); case self::ARRAY:
$iThoughtId = $this->oDb->updateRow(self::THOUGHT_TABLE, $asKeys, $asThought); return $oThought->get(); break;
$sDesc = 'updated'; case self::JSON:
return self::getJsonResult(true, '', $oThought->get()); break;
} }
}
public function updateThought($asOps, $iThoughtId=0, $iUserId=-1)
{
$oThought = new Thought($this->oDb, $iThoughtId);
if($oThought->getId() == 0) {
if($iUserId==-1) $iUserId = $this->oAuth->getUserId();
if($iUserId!=0) $oThought->setUserId($iUserId);
else $this->addError('Adding a thought with no user id');
}
$oThought->setOps($asOps);
$iThoughtId = $oThought->save();
$bSuccess = ($iThoughtId>0); $bSuccess = ($iThoughtId>0);
$sDesc = 'thought '.($bSuccess?'':'not ').$sDesc; $sDesc = 'thought '.($bSuccess?'':'not ').'saved';
return self::getJsonResult($bSuccess, $sDesc, $this->getThoughtInfo($iThoughtId)); return self::getJsonResult($bSuccess, $sDesc, $this->getThought($iThoughtId, self::ARRAY));
} }
/* My Thoughts private functions */ /* My Thoughts private functions */
@@ -238,105 +231,16 @@ class MyThoughts extends PhpObject
private function addUser($sNickName, $bLogMeIn=false) private function addUser($sNickName, $bLogMeIn=false)
{ {
$iUserId = $this->oAuth->addUser(self::getSafeNickName($sNickName), $sNickName, $bLogMeIn); $iUserId = $this->oAuth->addUser(self::getSafeNickName($sNickName), $sNickName, $bLogMeIn);
if($iUserId>0) $this->addThought(file_get_contents(self::WELCOME_MSG_FILE), $iUserId); //if($iUserId>0) $this->updateThought(file_get_contents(self::WELCOME_MSG_FILE), $iUserId);
return $iUserId; return $iUserId;
} }
private function addThought($sThought, $iUserId=-1)
{
if($iUserId==-1) $iUserId = $this->oAuth->getUserId();
if($iUserId!=0)
{
$asThought = array( Db::getId(self::USER_TABLE) => $iUserId,
Db::getText(self::THOUGHT_TABLE) => self::encodeThought($sThought));
$ithoughtId = $this->oDb->insertRow(self::THOUGHT_TABLE, $asThought);
}
else $this->addError('Adding a thought with no user id');
return $ithoughtId;
}
private function getThoughtInfo($iThoughtId, $bThoughtContent=false)
{
$asThoughtInfo = array();
if($iThoughtId>0)
{
$asThoughtInfo = $this->oDb->selectRow(self::THOUGHT_TABLE, $iThoughtId);
if(!$bThoughtContent) unset($asThoughtInfo[Db::getText(self::THOUGHT_TABLE)]);
}
else $this->addError('getting thought info with no thought id');
return $asThoughtInfo;
}
/* Static toolbox functions */ /* Static toolbox functions */
private static function encodeThought($sthought) public static function getSafeNickName($sNickName)
{
return base64_encode(serialize(explode("\n", self::shuffleText($sthought))));
}
private static function decodeThought($sEncodedThought)
{
return self::shuffleText(implode("\n", unserialize(base64_decode($sEncodedThought))));
}
private static function shuffleText($sText)
{
$sRandomText = "let's_mess%a&bit;with~it,!just§for¨the^sake*of-it";
for($iIndex=0; $iIndex < strlen($sText); $iIndex++)
{
$sText[$iIndex] = $sRandomText[$iIndex%strlen($sRandomText)] ^ $sText[$iIndex];
}
return $sText;
}
public static function getJsonResult($bSuccess, $sDesc='', $asVars=array())
{
header('Content-type: application/json');
return json_encode(array('result'=>$bSuccess?self::SUCCESS:self::ERROR, 'desc'=>ToolBox::mb_ucwords($sDesc))+$asVars);
}
public function getSafeNickName($sNickName)
{ {
return $sNickName; return $sNickName;
} }
public static function getDateTimeDesc($oTime)
{
$iTimeStamp = is_numeric($oTime)?$oTime:strtotime($oTime);
$sCurTimeStamp = time();
$asWeekDays = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'satursday', 'sunday');
$asMonths = array('january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december');
$sSep = '|';
$sFormat = 'Y'.$sSep.'n'.$sSep.'W'.$sSep.'N'.$sSep.'j'.$sSep.'G';
list($sYear, $sMonth, $sWeek, $sWeekDay, $sDay, $sHour) = explode($sSep, date($sFormat, $iTimeStamp));
list($sCurYear, $sCurMonth, $sCurWeek, $sCurWeekDay, $sCurDay, $sCurHour) = explode($sSep, date($sFormat, $sCurTimeStamp));
$sDesc = '';
if($iTimeStamp>$sCurTimeStamp) $sDesc = 'in the future';
elseif($sCurTimeStamp-$iTimeStamp<60) $sDesc = 'a few seconds ago';
elseif($sCurTimeStamp-$iTimeStamp<60*10) $sDesc = 'a few minutes ago';
elseif($sCurTimeStamp-$iTimeStamp<60*20) $sDesc = '15 minutes ago';
elseif($sCurTimeStamp-$iTimeStamp<60*50) $sDesc = 'half an hour ago';
elseif($sCurTimeStamp-$iTimeStamp<60*60*2) $sDesc = 'an hour ago';
elseif($sCurTimeStamp-$iTimeStamp<60*60*24 && $sDay==$sCurDay) $sDesc = 'at '.$sHour.' o\'clock';
elseif($sCurTimeStamp-$iTimeStamp<60*60*24) $sDesc = 'yesterday';
elseif($sCurTimeStamp-$iTimeStamp<60*60*24*7 && $sWeek==$sCurWeek) $sDesc = $asWeekDays[$sWeekDay-1];
elseif($sCurTimeStamp-$iTimeStamp<60*60*24*7) $sDesc = 'last '.$asWeekDays[$sWeekDay-1];
elseif($sCurTimeStamp-$iTimeStamp<60*60*24*9) $sDesc = 'a week ago';
elseif($sCurTimeStamp-$iTimeStamp<60*60*24*12) $sDesc = '10 days ago';
elseif($sCurTimeStamp-$iTimeStamp<60*60*24*16) $sDesc = '2 weeks ago';
elseif($sCurTimeStamp-$iTimeStamp<60*60*24*23) $sDesc = '3 weeks ago';
elseif($sCurTimeStamp-$iTimeStamp<60*60*24*31 && $sMonth==$sCurMonth) $sDesc = 'on '.$asMonths[$sMonth-1].', '.$sDay;
elseif($sCurTimeStamp-$iTimeStamp<60*60*24*30*2 && $sMonth==($sCurMonth-1)) $sDesc = 'last month';
elseif($sCurTimeStamp-$iTimeStamp<60*60*24*365 && $sYear==$sCurYear) $sDesc = 'in '.$asMonths[$sMonth-1];
elseif($sCurTimeStamp-$iTimeStamp<60*60*24*365) $sDesc = 'in '.$asMonths[$sMonth-1].' '.$sYear;
elseif($sYear==($sCurYear-1)) $sDesc = 'last year';
else $sDesc = 'in '.$sYear;
//return self::mb_ucfirst($sDesc);
return $sDesc;
}
} }
?> ?>

112
inc/thought.php Normal file
View File

@@ -0,0 +1,112 @@
<?php
class Thought extends PhpObject
{
const THOUGHT_TABLE = 'thoughts';
private $iId;
private $iUserId;
private $asOps;
private $sLed;
/**
* Database Handle
* @var Db
*/
private $oDb;
public function __construct(&$oDb, $iId=0)
{
parent::__construct(__CLASS__, Settings::DEBUG);
$this->oDb = $oDb;
$this->setId($iId);
}
public function getId()
{
return $this->iId;
}
public function setId($iId, $bOpen=true)
{
$this->iId = $iId;
if($this->iId > 0 && $bOpen) $this->open($this->iId);
}
public function setUserId($iUserId)
{
$this->iUserId = $iUserId;
}
public function setOps($asOps, $bSave=false)
{
$this->asOps = $asOps;
if($bSave) return $this->save();
}
public function openLast()
{
$iId = $this->oDb->selectValue(
self::THOUGHT_TABLE,
"MAX(".Db::getId(self::THOUGHT_TABLE).")",
array(Db::getId(MyThoughts::USER_TABLE) => $this->iUserId));
$this->open($iId);
}
public function open($iId)
{
if($iId>0)
{
$asInfo = $this->oDb->selectRow(self::THOUGHT_TABLE, $iId);
$this->iId = $asInfo[Db::getId(self::THOUGHT_TABLE)];
$this->iUserId = $asInfo[Db::getId(MyThoughts::USER_TABLE)];
$this->asOps = self::decodeThought($asInfo[Db::getText(self::THOUGHT_TABLE)]);
$this->sLed = $asInfo['led'];
}
else $this->addError('getting thought info with no thought id');
}
public function save()
{
$asThought = array(
Db::getId(MyThoughts::USER_TABLE) => $this->iUserId,
Db::getText(self::THOUGHT_TABLE) => self::encodeThought($this->asOps)
);
if($this->iId > 0) $this->oDb->updateRow(self::THOUGHT_TABLE, $this->iId, $asThought);
else $this->iId = $this->oDb->insertRow(self::THOUGHT_TABLE, $asThought);
return $this->iId;
}
public function get()
{
return array(
'id' => $this->iId,
'id_user' => $this->iUserId,
'ops' => $this->asOps,
'led' => $this->sLed
);
}
private static function encodeThought($sthought)
{
return base64_encode(serialize(explode("\n", self::shuffleText(json_encode($sthought)))));
}
private static function decodeThought($sEncodedThought)
{
return json_decode(self::shuffleText(implode("\n", unserialize(base64_decode($sEncodedThought)))), true);
}
private static function shuffleText($sText)
{
$sRandomText = "let's_mess%a&bit;with~it,!just§for¨the^sake*of-it";
for($iIndex=0; $iIndex < strlen($sText); $iIndex++)
{
$sText[$iIndex] = $sRandomText[$iIndex%strlen($sRandomText)] ^ $sText[$iIndex];
}
return $sText;
}
}

View File

@@ -49,6 +49,9 @@ elseif($sAction!='' && $bLoggedIn)
{ {
switch ($sAction) switch ($sAction)
{ {
case 'load':
$sResult = $oMyThoughts->getThought($iId, MyThoughts::JSON);
break;
case 'update': case 'update':
$sResult = $oMyThoughts->updateThought($sContent, $iId); $sResult = $oMyThoughts->updateThought($sContent, $iId);
break; break;
@@ -72,7 +75,7 @@ elseif($sAction!='' && !$bLoggedIn)
elseif($sAction=='register') $sResult = $oMyThoughts->register($sNickName); elseif($sAction=='register') $sResult = $oMyThoughts->register($sNickName);
else $sResult = MyThoughts::getJsonResult(false, MyThoughts::UNAUTHORIZED); else $sResult = MyThoughts::getJsonResult(false, MyThoughts::UNAUTHORIZED);
} }
else $sResult = $oMyThoughts->getPage($bLoggedIn); else $sResult = $oMyThoughts->getPage();
$sDebug = ob_get_clean(); $sDebug = ob_get_clean();
if(Settings::DEBUG && $sDebug!='') $oMyThoughts->addUncaughtError($sDebug); if(Settings::DEBUG && $sDebug!='') $oMyThoughts->addUncaughtError($sDebug);

View File

@@ -47,8 +47,8 @@
{insert: '\n'}, {insert: '\n'},
{insert: "In-extremist, I manage to babble some excuses about a rigorous lunch break time and leave the premises."} {insert: "In-extremist, I manage to babble some excuses about a rigorous lunch break time and leave the premises."}
]);*/ ]);*/
oQuill.setContents([{insert:self.vars('default_text')}]);
setLastContent();
setPageHeight(); setPageHeight();
//Key strokes Events //Key strokes Events
@@ -96,6 +96,21 @@
self.vars('page_height', iMaxHeight); self.vars('page_height', iMaxHeight);
} }
function setLastContent(oQuill)
{
getInfo
(
'load',
function(sDesc, asData)
{
self.vars('id', asData.id);
oQuill.setContents(asData.ops);
},
{id: 'last'}
);
}
function onChange(delta, oldDelta, source, e) function onChange(delta, oldDelta, source, e)
{ {
if(source == 'user') if(source == 'user')
@@ -170,8 +185,7 @@
function incKeyStrokes() function incKeyStrokes()
{ {
self.vars('keystrokes', self.vars('keystrokes') + 1); self.vars('keystrokes', self.vars('keystrokes') + 1);
if(self.vars('keystrokes') % 20 == 0) save();
if(self.vars('keystrokes') % 10) save();
} }
function save() function save()
@@ -183,12 +197,15 @@
getInfo getInfo
( (
'update', 'update',
function(asData) function(sDesc, asData)
{ {
self.vars('id', asData.id_thought); self.vars('id', asData.id);
oMyThoughts.onFeedback('notice', 'Saved ('+asData.led.substr(11, 5)+')'); oMyThoughts.onFeedback('notice', 'Saved ('+asData.led.substr(11, 5)+')');
}, },
{content:sContent, id:self.vars('id')}, {
id: self.vars('id'),
content: sContent
},
function(sError) function(sError)
{ {
oMyThoughts.onFeedback('error', 'Not saved! An error occured: '+sError); oMyThoughts.onFeedback('error', 'Not saved! An error occured: '+sError);

View File

@@ -78,7 +78,7 @@ function getInfo(action, fOnSuccess, vars, fOnError, sType/*, bProcessIcon*/)
else else
{ {
//if(bProcessIcon) self.resetIcon(); //if(bProcessIcon) self.resetIcon();
fOnSuccess(oData); fOnSuccess(oData.desc, oData.data);
} }
}) })
.fail(function(jqXHR, textStatus, errorThrown) .fail(function(jqXHR, textStatus, errorThrown)

View File

@@ -71,9 +71,7 @@ function MyThoughts(asGlobals)
this.onHashChange = function() this.onHashChange = function()
{ {
var asHash = self.getHash(); var asHash = self.getHash();
var sDefaultPage = self.vars('log_in')?'write':'logon'; self.switchPage(asHash);
if(asHash.hash !='' && asHash.page != '') self.switchPage(asHash); //page switching
else if(self.vars('page')=='') self.setHash(sDefaultPage); //first page
}; };
this.resetTmpFunctions = function() this.resetTmpFunctions = function()
@@ -146,13 +144,16 @@ function MyThoughts(asGlobals)
this.switchPage = function(asHash) this.switchPage = function(asHash)
{ {
var sPageName = asHash.page; var sCurrPage = self.vars('page');
var bSamePage = self.vars('page')==sPageName; var sNextPage = asHash.page;
var bLoggedIn = self.vars('log_in');
var sDefaultPage = bLoggedIn?'write':'logon';
if(asHash.hash !='' && sNextPage != '' && (bLoggedIn || sNextPage==sDefaultPage))
{
var bSamePage = (sCurrPage==sNextPage);
if(self.onQuitPage(bSamePage) && !bSamePage || self.onSamePageMove(asHash)) if(self.onQuitPage(bSamePage) && !bSamePage || self.onSamePageMove(asHash))
{ {
//Preload template if not already loaded
//Delete tmp variables //Delete tmp variables
self.vars('tmp', {}); self.vars('tmp', {});
@@ -160,15 +161,15 @@ function MyThoughts(asGlobals)
self.resetTmpFunctions(); self.resetTmpFunctions();
//Officially a new page //Officially a new page
var bFirstPage = self.vars('page')==''; var bFirstPage = (sCurrPage=='');
self.vars('page', sPageName); self.vars('page', sNextPage);
//Update Page Title //Update Page Title
var sDetail = asHash.items[0] || ''; var sDetail = asHash.items[0] || '';
document.title = self.consts.title+' - '+sPageName+' '+sDetail; document.title = self.consts.title+' - '+sNextPage+' '+sDetail;
//Replacing DOM //Replacing DOM
var $Dom = $(self.consts.pages[sPageName]); var $Dom = $(self.consts.pages[sNextPage]);
if(bFirstPage) if(bFirstPage)
{ {
self.elem.container.html($(self.consts.pages['template'])); self.elem.container.html($(self.consts.pages['template']));
@@ -180,6 +181,8 @@ function MyThoughts(asGlobals)
self.elem.main.stop().fadeTo('fast', 0, function(){self.splash(self.elem.main, $Dom, asHash, bFirstPage);}); //Switching page self.elem.main.stop().fadeTo('fast', 0, function(){self.splash(self.elem.main, $Dom, asHash, bFirstPage);}); //Switching page
} }
} }
}
else self.setHash(sDefaultPage); //force first page
}; };
this.splash = function($FadeInElem, $Dom, asHash, bFirstPage) this.splash = function($FadeInElem, $Dom, asHash, bFirstPage)

13
style/_variables.scss Normal file
View File

@@ -0,0 +1,13 @@
/* Colors
Very Very Bright Brown: #f7f2eb
Very Bright Brown: #ede0d0
bright brown : #e2ccb2
dark brown : #584127
blue lines : #2DCDFF
red lines : #EC3B45
*/
$col_main_1: #584127;
$col_main_2: #e2ccb2;
$col_main_3: #ede0d0;
$col_main_4: #f7f2eb;

View File

@@ -4,11 +4,9 @@
#editor_container { #editor_container {
border: 1em solid #EDE0D0;
border-radius: 0.5em;
height: calc(100% - 4em); height: calc(100% - 4em);
overflow: hidden; overflow: hidden;
position:relative; position: relative;
#editor_content { #editor_content {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,11 +1,6 @@
/* Colors /* Variables */
Very Very Bright Brown: #f7f2eb
Very Bright Brown: #ede0d0 @import 'variables';
bright brown : #e2ccb2
dark brown : #584127
blue lines : #2DCDFF
red lines : #EC3B45
*/
/* Fonts */ /* Fonts */
@@ -228,8 +223,9 @@ a.calendar_direction {
bottom:2em; bottom:2em;
right:0; right:0;
left:0; left:0;
background:#EDE0D0;
border-radius: 0.5em; border-radius: 0.5em;
box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
padding: 1em;
} }
/* Read */ /* Read */

View File

@@ -1,2 +1,2 @@
Welcome To MyThoughts Online Application! Hope you'll enjoy the effort. don't hesitate to give me feebacks by sending an email to francois on the french domain lutran Welcome To MyThoughts Online App! Hope you'll enjoy the effort. don't hesitate to give me feebacks by sending an email to francois on the french domain lutran
Hit the "Write" button to start writing your thoughts. Hit the "Write" button to start writing your thoughts.