211 lines
6.0 KiB
JavaScript
211 lines
6.0 KiB
JavaScript
|
// -*- coding: utf-8 -*-
|
||
|
//@require base.js
|
||
|
|
||
|
// options par défaut
|
||
|
config.options.chkAnimate = true;
|
||
|
config.options.txtUserName = "JephteCLAIN";
|
||
|
config.options.chkSaveBackups = false;
|
||
|
config.options.chkAutoSave = true;
|
||
|
config.options.chkHttpReadOnly = true;
|
||
|
|
||
|
config.views.editor.defaultText = "";
|
||
|
|
||
|
delete config.macros.saveChanges.accessKey;
|
||
|
delete config.macros.newJournal.accessKey;
|
||
|
config.macros.timeline.dateFormat = "0DD/0MM/YYYY";
|
||
|
|
||
|
// installer Les macros closeCurrent, keepCurrent, editCurrent, saveCurrent dans la barre latérale
|
||
|
var sbo = config.shadowTiddlers.SideBarOptions;
|
||
|
sbo = sbo.replace("<<closeAll>>", "<<closeCurrent>><<closeAll>>");
|
||
|
sbo = sbo.replace("<<saveChanges>>", "<<editCurrent>><<saveCurrent>><<saveChanges>>");
|
||
|
config.shadowTiddlers.SideBarOptions = sbo;
|
||
|
delete sbo;
|
||
|
|
||
|
// modifier les boutons affichés par défaut
|
||
|
installToolbarButton(toolbarKeep, false, config.views.wikified.toolbarClose);
|
||
|
removeToolbarButton(config.views.wikified.toolbarPermalink);
|
||
|
|
||
|
// déplacer le bouton delete, et ajouter une confirmation sur son utilisation
|
||
|
removeToolbarButton(config.views.editor.toolbarDelete, true);
|
||
|
installToolbarButton(config.views.editor.toolbarDelete);
|
||
|
window.onClickToolbarDelete = function(e) {
|
||
|
if(this.parentNode.id) {
|
||
|
var title = this.parentNode.id.substr(7);
|
||
|
if (confirm("Voulez-vous vraiment supprimer " + title + "?")) {
|
||
|
clearMessage();
|
||
|
deleteTiddler(title);
|
||
|
}
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
config.views.editor.toolbarDelete.onClick = window.onClickToolbarDelete;
|
||
|
|
||
|
// Désactiver le double-click
|
||
|
var createTiddlerSkeleton_patchedByBaseUi = window.createTiddlerSkeleton;
|
||
|
window.createTiddlerSkeleton = function(place, before, title) {
|
||
|
var tiddler = createTiddlerSkeleton_patchedByBaseUi(place, before, title);
|
||
|
delete tiddler.ondblclick;
|
||
|
return tiddler;
|
||
|
}
|
||
|
config.views.wikified.defaultText = "The tiddler '%0' doesn't yet exist.";
|
||
|
|
||
|
// interface utilisateur par défaut
|
||
|
config.shadowTiddlers.OptionsPanel += "\
|
||
|
, FormattingInstructions\
|
||
|
, KeyShortcuts\
|
||
|
, BaseConfiguration\
|
||
|
";
|
||
|
|
||
|
config.shadowTiddlers.BaseConfiguration = "\
|
||
|
! Configuration de ce wiki\n\
|
||
|
Modifiez la valeur de ces tiddlers pour configurer ce wiki:\n\
|
||
|
* SiteTitle - titre du wiki\n\
|
||
|
* SiteSubtitle - sous-title du wiki\n\
|
||
|
* SiteUrl - url du site web pour la génération du feed rss\n\
|
||
|
* MainMenu - contenu du menu principal\n\
|
||
|
* DefaultTiddlers - tiddlers affichés par défaut\n\
|
||
|
* StyleSheet - feuille de style utilisée\n\
|
||
|
";
|
||
|
config.shadowTiddlers.FormattingInstructions = "\
|
||
|
!! Syntaxes de base\n\
|
||
|
|Utiliser cette syntaxe:|Pour obtenir ceci:|h\n\
|
||
|
|{{{''Bold''}}}|''Bold''|\n\
|
||
|
|{{{==Striked==}}}|==Striked==|\n\
|
||
|
|{{{__Underline__}}}|__Underline__|\n\
|
||
|
|{{{//Italic//}}}|//Italic//|\n\
|
||
|
|{{{Normal^^super^^}}}|Normal^^super^^|\n\
|
||
|
|{{{Normal~~sub~~}}}|Normal~~sub~~|\n\
|
||
|
|{{{@@Highlight@@}}}|@@Highlight@@|\n\
|
||
|
|{{{@@color: red;background-color: black; texte rouge sur noir@@}}}|@@color: red;background-color: black; texte rouge sur noir@@ (application de styles css quelconques)|\n\
|
||
|
|{{{~NotAWikiWord}}}|~NotAWikiWorkd|\n\
|
||
|
|{{{[[Force wiki word]]}}}|[[Force wiki word]]|\n\
|
||
|
|{{{[[rename wiki link|AWikiLink]]}}}|[[rename wiki link|AWikiLink]]|\n\
|
||
|
|{{{[[external url|http://www.site.com/]]}}}|[[external url|http://www.site.com/]]|\n\
|
||
|
Pour faire une séparation, utiliser 4 tirets '-':\n\
|
||
|
----\n\
|
||
|
3 '{' permettent de monospacer un texte comme {{{ceci}}} ou:\n\
|
||
|
{{{\n\
|
||
|
ceci\n\
|
||
|
sur plusieurs lignes\n\
|
||
|
}}}\n\
|
||
|
\n\
|
||
|
!header1\n\
|
||
|
{{{!header1}}}\n\
|
||
|
!!header2\n\
|
||
|
{{{!!header2}}}\n\
|
||
|
!!!header3\n\
|
||
|
{{{!!!header3}}}\n\
|
||
|
!!!!header4\n\
|
||
|
{{{!!!!header4}}}\n\
|
||
|
!!!!!header5\n\
|
||
|
{{{!!!!!header5}}}\n\
|
||
|
\n\
|
||
|
!! Listes normales\n\
|
||
|
* dotted list\n\
|
||
|
* two\n\
|
||
|
* three\n\
|
||
|
** sublist\n\
|
||
|
** sub1\n\
|
||
|
** sub2\n\
|
||
|
* four\n\
|
||
|
\n\
|
||
|
!! Listes numérotées\n\
|
||
|
# numbered list\n\
|
||
|
# two\n\
|
||
|
# three\n\
|
||
|
## sub0\n\
|
||
|
## sub1\n\
|
||
|
## sub2\n\
|
||
|
# four\n\
|
||
|
\n\
|
||
|
!! Blockquotes\n\
|
||
|
<<<\n\
|
||
|
Sur plusieurs\n\
|
||
|
lignes\n\
|
||
|
<<<\n\
|
||
|
Ou sur plusieurs niveaux:\n\
|
||
|
>level1\n\
|
||
|
>level1\n\
|
||
|
>>level2\n\
|
||
|
>>level2\n\
|
||
|
>>>level3\n\
|
||
|
>>level2\n\
|
||
|
>level1\n\
|
||
|
>level1\n\
|
||
|
\n\
|
||
|
!! Tables\n\
|
||
|
Utiliser cette syntaxe:\n\
|
||
|
{{{\n\
|
||
|
|caption|c\n\
|
||
|
|!header|!header|h\n\
|
||
|
|cell|cell|\n\
|
||
|
|>|colspan|\n\
|
||
|
|rowspan|one|\n\
|
||
|
|~|two|\n\
|
||
|
|left| right|\n\
|
||
|
|>| center |\n\
|
||
|
}}}\n\
|
||
|
Pour obtenir ceci:\n\
|
||
|
|caption|c\n\
|
||
|
|!header|!header|h\n\
|
||
|
|cell|cell|\n\
|
||
|
|>|colspan|\n\
|
||
|
|rowspan|one|\n\
|
||
|
|~|two|\n\
|
||
|
|left| right|\n\
|
||
|
|>| center |\n\
|
||
|
\n\
|
||
|
!! Insertion d'images\n\
|
||
|
{{{\n\
|
||
|
[img[title|filename]]\n\
|
||
|
[img[filename]]\n\
|
||
|
[img[title|filename][link]]\n\
|
||
|
[img[filename][link]]\n\
|
||
|
[<img[filename]] (image cleared to left)\n\
|
||
|
[>img[filename]] (image cleared to right)\n\
|
||
|
}}}\n\
|
||
|
\n\
|
||
|
";
|
||
|
|
||
|
config.shadowTiddlers.KeyShortcuts = "\
|
||
|
|!Touche|!Action|h\n\
|
||
|
|Alt + F|Chercher|\n\
|
||
|
|Alt + W|Fermer le tiddler courant|\n\
|
||
|
|Alt + E|Editer le tiddler courant|\n\
|
||
|
|Alt + S|Valider les changements sur le tiddler courant|\n\
|
||
|
";
|
||
|
|
||
|
config.shadowTiddlers.StyleSheet = "\
|
||
|
#titleLine { padding: 1em 1em 1em 1em; }\n\
|
||
|
#sidebar { left: 0em; }\n\
|
||
|
#mainMenu { position: relative; width: auto; padding-top: 0.5em; }\n\
|
||
|
#sidebarTabs .tabContents { width: auto; }\n\
|
||
|
#displayArea { margin: 0em 0.3em 0em 16.3em; font-size: 8pt; }\n\
|
||
|
\n\
|
||
|
body { background-color: black; }\n\
|
||
|
#mainMenu { background-color: white; }\n\
|
||
|
.tiddler { background-color: white; margin-bottom: 0.3em; border-right: 3px solid #aaa; border-bottom: 3px solid #555; }\n\
|
||
|
.toolbar .button { color: #000; border: 1px outset #cf6; background: #cf6; }\n\
|
||
|
\n\
|
||
|
#titleLine { color: #cf6; background-color: black; }\n\
|
||
|
#siteSubtitle { color: white; }\n\
|
||
|
";
|
||
|
|
||
|
var main_patchedByBaseUi = window.main;
|
||
|
window.main = function() {
|
||
|
var mainMenu = document.getElementById("mainMenu");
|
||
|
var contentWrapper = document.getElementById("contentWrapper");
|
||
|
contentWrapper.removeChild(mainMenu);
|
||
|
|
||
|
var sidebar = document.getElementById("sidebar");
|
||
|
var sidebarOptions = document.getElementById("sidebarOptions");
|
||
|
sidebar.insertBefore(mainMenu, sidebarOptions);
|
||
|
|
||
|
var messageArea = document.getElementById("messageArea");
|
||
|
var displayArea = document.getElementById("displayArea");
|
||
|
displayArea.removeChild(messageArea);
|
||
|
displayArea.appendChild(messageArea);
|
||
|
|
||
|
return main_patchedByBaseUi();
|
||
|
}
|